File tree Expand file tree Collapse file tree
e2e/integration-tests/nextjs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @primer/react-brand ' : patch
3+ ---
4+
5+ Fixed missing size and animation tokens in tree-shaken ESM component bundles like ` Button ` . Now all control tokens are loaded globally as a side-effect.
Original file line number Diff line number Diff line change @@ -96,10 +96,13 @@ jobs:
9696 run : |
9797 rm ./${{ env.NEXTJS_FOLDER }}/app/page.tsx
9898 cp ./packages/e2e/integration-tests/nextjs/page.tsx ./${{ env.NEXTJS_FOLDER }}/app
99+ mkdir ./${{ env.NEXTJS_FOLDER }}/app/button-only
100+ cp ./packages/e2e/integration-tests/nextjs/button-only/page.tsx ./${{ env.NEXTJS_FOLDER }}/app/button-only
99101 cp ./packages/e2e/cypress.config.js ./${{ env.NEXTJS_FOLDER }}
100102 mkdir ${{ env.NEXTJS_FOLDER }}/integration-tests
101103 cp -r ./packages/e2e/integration-tests/fixtures ./${{ env.NEXTJS_FOLDER }}/integration-tests
102104 cp -r ./packages/e2e/integration-tests/tests ./${{ env.NEXTJS_FOLDER }}/integration-tests
105+ cp ./packages/e2e/integration-tests/nextjs/check-size-tokens.cy.ts ./${{ env.NEXTJS_FOLDER }}/integration-tests/tests
103106
104107 - name : Excluded cypress tests in-place
105108 # includes temp workaround for cypress bug. remove when fixed
Original file line number Diff line number Diff line change 1+ 'use client'
2+
3+ import { Button } from '../../integration-tests/fixtures'
4+
5+ export default function ButtonOnlyPage ( ) {
6+ return < Button data-testid = "button-only" > Button-only page</ Button >
7+ }
Original file line number Diff line number Diff line change 1+ describe ( 'Size token integration tests' , ( ) => {
2+ it ( 'loads shared size tokens without Stack on the page' , ( ) => {
3+ cy . visit ( 'http://localhost:3000/button-only' )
4+
5+ cy . get ( '[data-testid="button-only"]' ) . should ( button => {
6+ const ownerWindow = button [ 0 ] . ownerDocument . defaultView
7+
8+ if ( ! ownerWindow ) throw new Error ( 'Expected the Button document to have a window' )
9+
10+ const controlSize = ownerWindow . getComputedStyle ( button [ 0 ] ) . getPropertyValue ( '--brand-control-medium-size' ) . trim ( )
11+
12+ expect ( controlSize ) . not . to . equal ( '' )
13+ } )
14+ } )
15+ } )
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import './reset.css'
99import '@primer/brand-primitives/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css'
1010import '@primer/brand-primitives/lib/design-tokens/css/tokens/base/size/size.css'
1111import '@primer/brand-primitives/lib/design-tokens/css/tokens/base/typography/typography.css'
12+ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/animation/base.css'
13+ import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/size/size.css'
1214import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css'
1315import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/size/breakpoints.css'
1416import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/size/border.css'
You can’t perform that action at this time.
0 commit comments