diff --git a/.changeset/cold-items-try.md b/.changeset/cold-items-try.md new file mode 100644 index 000000000..2ce59c8b0 --- /dev/null +++ b/.changeset/cold-items-try.md @@ -0,0 +1,12 @@ +--- +'@primer/react-brand': minor +--- + +Improved a11y labelling in various components. + +Please note these changes could affect any behavioral tests, which rely on accessible matchers such as `getByRole`. + +- `SubdomainNavBar` search button `aria-label` changed from 'search' to 'Toggle search bar' +- `SubdomainNavBar` removal of unnecessary `aria-label` 'global breadcrumb' +- `Checkbox` addition of new label for `checked` state icon as 'Checkmark' +- `Checkbox` addition of new label for `indeterminate` state icon as 'Dash icon' diff --git a/.changeset/lovely-timers-visit.md b/.changeset/lovely-timers-visit.md new file mode 100644 index 000000000..6201feb57 --- /dev/null +++ b/.changeset/lovely-timers-visit.md @@ -0,0 +1,25 @@ +--- +'@primer/brand-primitives': minor +--- + +Change to `xxlarge` breakpoint and the addition of two new base scale size tokens. + +Outcome of an upgrade to Primer Primitives `v9` release. + +```diff ++ --base-size-2: 0.125rem; +``` + +```diff ++ --base-size-6: 0.375rem; +``` + +```diff +- --brand-breakpoint-xxlarge: 90rem; ++ --brand-breakpoint-xxlarge: 87.5rem; +``` + +```diff +- @custom-media --brand-viewportRange-wide-viewport (min-width: 90rem); ++ @custom-media --brand-viewportRange-wide-viewport (min-width: 87.5rem); +``` diff --git a/.changeset/three-sloths-grin.md b/.changeset/three-sloths-grin.md new file mode 100644 index 000000000..3f42eb16f --- /dev/null +++ b/.changeset/three-sloths-grin.md @@ -0,0 +1,11 @@ +--- +'@primer/react-brand': patch +--- + +Hide paged items in Pagination component on narrow viewports to prevent horizontal scrolling and offer improved accessibility by default. + +Use `showPages` to re-enable paged items if required: + +```jsx + +``` diff --git a/.eslintrc.js b/.eslintrc.js index 65f509947..bef7ec658 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -58,7 +58,6 @@ module.exports = { allow: ['dark_dimmed'], }, ], - 'primer-react/no-deprecated-colors': ['warn', {checkAllStrings: true}], }, overrides: [ // rules which apply only to JS @@ -170,6 +169,14 @@ module.exports = { '@typescript-eslint/no-unnecessary-condition': 0, '@typescript-eslint/no-unused-vars': 0, 'no-redeclare': 0, + 'github/a11y-svg-has-accessible-name': 0, + }, + }, + // rules which apply only to Figma code connect files + { + files: ['**/*.figma.tsx'], + rules: { + 'github/unescaped-html-literal': 0, }, }, ], diff --git a/.github/workflows/ui_test_primitives_diff.yml b/.github/workflows/ui_test_primitives_diff.yml index 62ba66e87..47c399d3b 100644 --- a/.github/workflows/ui_test_primitives_diff.yml +++ b/.github/workflows/ui_test_primitives_diff.yml @@ -45,7 +45,7 @@ jobs: - name: Export diff run: | - diff -r -y --width=300 -B -I '*' -I 'Generated' --suppress-common-lines temp-main/packages/design-tokens/lib/design-tokens/css packages/design-tokens/lib/design-tokens/css | tail -n +2 > diff.txt + diff -r -y --width=300 -B -I 'Generated' --suppress-common-lines temp-main/packages/design-tokens/lib/design-tokens/css packages/design-tokens/lib/design-tokens/css | tail -n +2 > diff.txt npx ts-node ./packages/design-tokens/scripts/ci-check-diff.ts - name: Read raw diff diff --git a/apps/docs/content/components/VideoPlayer.mdx b/apps/docs/content/components/VideoPlayer.mdx index 9a6a5914f..009c01ae6 100644 --- a/apps/docs/content/components/VideoPlayer.mdx +++ b/apps/docs/content/components/VideoPlayer.mdx @@ -18,8 +18,8 @@ import {VideoPlayer} from '@primer/react-brand' ```jsx live - - + + ``` @@ -27,11 +27,11 @@ import {VideoPlayer} from '@primer/react-brand' ```jsx live - - + + ``` @@ -39,8 +39,8 @@ import {VideoPlayer} from '@primer/react-brand' ```jsx live - - + + ``` @@ -48,8 +48,8 @@ import {VideoPlayer} from '@primer/react-brand' ```jsx live - - + + ``` @@ -65,11 +65,8 @@ import {VideoPlayer} from '@primer/react-brand' showVolumeControl={false} showFullScreenButton={false} > - - + + ``` @@ -77,11 +74,8 @@ import {VideoPlayer} from '@primer/react-brand' ```jsx live - - + + ``` @@ -94,11 +88,8 @@ import {VideoPlayer} from '@primer/react-brand' showBranding={false} showControlsWhenPaused={false} > - - + + ``` @@ -109,11 +100,8 @@ import {VideoPlayer} from '@primer/react-brand' title="GitHub media player" playIcon={() => } > - - + + ``` @@ -140,10 +128,10 @@ Full documentation for the `useVideo` hook can be found [below](#usevideo-contex showFullScreenButton={false} > - + ) + const {getByTestId} = render() const el = getByTestId(leadingVisualId) @@ -233,7 +233,7 @@ describe('Button', () => { it('accepts a native svg as a valid trailing or leading visual', () => { const mockId = 'mock-svg' - const mockSvg = + const mockSvg = const {getByTestId} = render( {active && ( diff --git a/packages/react/src/SubdomainNavBar/SubdomainNavBar.visual.spec.ts-snapshots/Visual-Comparison-SubdomainNavBar-SubdomainNavBar-Search-Results-Visible-1-linux.png b/packages/react/src/SubdomainNavBar/SubdomainNavBar.visual.spec.ts-snapshots/Visual-Comparison-SubdomainNavBar-SubdomainNavBar-Search-Results-Visible-1-linux.png index a9d8ecffc..5b1f5e112 100644 Binary files a/packages/react/src/SubdomainNavBar/SubdomainNavBar.visual.spec.ts-snapshots/Visual-Comparison-SubdomainNavBar-SubdomainNavBar-Search-Results-Visible-1-linux.png and b/packages/react/src/SubdomainNavBar/SubdomainNavBar.visual.spec.ts-snapshots/Visual-Comparison-SubdomainNavBar-SubdomainNavBar-Search-Results-Visible-1-linux.png differ diff --git a/packages/react/src/VideoPlayer/VideoPlayer.features.stories.tsx b/packages/react/src/VideoPlayer/VideoPlayer.features.stories.tsx index e81ab0c28..173e4aba5 100644 --- a/packages/react/src/VideoPlayer/VideoPlayer.features.stories.tsx +++ b/packages/react/src/VideoPlayer/VideoPlayer.features.stories.tsx @@ -15,22 +15,22 @@ export default { export const WithPoster = () => ( - - + + ) export const WithoutBranding = () => ( - - + + ) export const WithVisuallyHiddenTitle = () => ( - - + + ) @@ -44,22 +44,22 @@ export const WithSomeHiddenControls = () => ( showVolumeControl={false} showFullScreenButton={false} > - - + + ) export const HideControlsWhenPaused = () => ( - - + + ) export const Minimal = () => ( - - + + ) @@ -77,8 +77,8 @@ const MyVideoPlayer = () => { showVolumeControl={false} showFullScreenButton={false} > - - + + @@ -99,7 +99,7 @@ export const ControlledProgrammatically = () => { export const CustomPlayIcon = () => ( }> - - + + ) diff --git a/packages/react/src/VideoPlayer/VideoPlayer.stories.tsx b/packages/react/src/VideoPlayer/VideoPlayer.stories.tsx index 27fdc6a27..7d5005884 100644 --- a/packages/react/src/VideoPlayer/VideoPlayer.stories.tsx +++ b/packages/react/src/VideoPlayer/VideoPlayer.stories.tsx @@ -62,8 +62,8 @@ export default meta export const Playground: StoryFn = args => ( - - + + ) diff --git a/packages/react/src/forms/Checkbox/Checkbox.tsx b/packages/react/src/forms/Checkbox/Checkbox.tsx index 47baf6d38..aa4de9f2a 100644 --- a/packages/react/src/forms/Checkbox/Checkbox.tsx +++ b/packages/react/src/forms/Checkbox/Checkbox.tsx @@ -83,7 +83,7 @@ const _Checkbox = ( className={clsx(styles.Checkbox, indeterminate && styles['Checkbox--indeterminate'], className)} > {!indeterminate && ( - + diff --git a/packages/react/src/recipes/SolutionTemplates/SolutionPage/SolutionPage.tsx b/packages/react/src/recipes/SolutionTemplates/SolutionPage/SolutionPage.tsx index 49195cd0b..f4be314c9 100644 --- a/packages/react/src/recipes/SolutionTemplates/SolutionPage/SolutionPage.tsx +++ b/packages/react/src/recipes/SolutionTemplates/SolutionPage/SolutionPage.tsx @@ -920,8 +920,8 @@ function HeroVideo() { - - + + diff --git a/packages/react/src/river/River/River.stories.tsx b/packages/react/src/river/River/River.stories.tsx index e8f76ffec..5ad2fcb1e 100644 --- a/packages/react/src/river/River/River.stories.tsx +++ b/packages/react/src/river/River/River.stories.tsx @@ -101,7 +101,6 @@ export const Video: StoryFn = args => ( playsInline autoPlay muted - aria-hidden="true" poster="https://github.githubassets.com/images/modules/site/issues/issue-tasks-progress-placeholder.png" > ( src="https://githubnext.com/assets/projects/copilot-workspace/features-river-1.mp4" type="video/mp4; codecs=avc1.4d002a" /> - + @@ -232,7 +232,7 @@ export const Video = args => ( src="https://githubnext.com/assets/projects/copilot-workspace/features-river-2.mp4" type="video/mp4; codecs=avc1.4d002a" /> - + @@ -251,7 +251,7 @@ export const Video = args => ( src="https://githubnext.com/assets/projects/copilot-workspace/features-river-3.mp4" type="video/mp4; codecs=avc1.4d002a" /> - + @@ -270,7 +270,7 @@ export const Video = args => ( src="https://githubnext.com/assets/projects/copilot-workspace/features-river-4.mp4" type="video/mp4; codecs=avc1.4d002a" /> - +