-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PageHeader: Address dom order issues (screen reader experience feedba…
…ck from sign-off) (#4358) * Update layout styles so that all interactive elements come after the title * Add PageHeder.Breadcrumbs sub component * remove shapshot check on jest * test(vrt): update snapshots * test(vrt): update snapshots * make the interactive element in the heading check a warning not error * add pageheader story for screen reader tes * add links * add onclick events to the buttons * add a placeholder for file content example * test(vrt): update snapshots * elements losing context when viewport is narrrow - keep the same text for buttons in all viewports * fix linting * test(vrt): update snapshots * hide the overflow menu in narrow since we show it on the context area * accomodate different format sx prop for font size * when no fontsize is specified css var returns as an empty string so need ternary instead of Nullish coalescing * temporary fix on navlist --------- Co-authored-by: broccolinisoup <broccolinisoup@users.noreply.github.com>
- Loading branch information
1 parent
b1fef5c
commit e34e4b2
Showing
73 changed files
with
813 additions
and
481 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@primer/react': minor | ||
--- | ||
|
||
PageHeader: Update the layout styles so that all interactive content comes after the title (while keeping the component visually the same) | ||
This is a breaking change however PageHeader is still a draft component so we are releasing the changes as minor but please upgrade with caution. | ||
``` |
Binary file modified
BIN
+6.25 KB
(160%)
...ts/PageHeader.test.ts-snapshots/PageHeader-Files-Page-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.34 KB
(160%)
...onents/PageHeader.test.ts-snapshots/PageHeader-Files-Page-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.23 KB
(160%)
...PageHeader.test.ts-snapshots/PageHeader-Files-Page-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.25 KB
(160%)
...ts/components/PageHeader.test.ts-snapshots/PageHeader-Files-Page-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.25 KB
(160%)
...ts/PageHeader.test.ts-snapshots/PageHeader-Files-Page-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.31 KB
(160%)
...s/PageHeader.test.ts-snapshots/PageHeader-Files-Page-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.16 KB
(160%)
...ageHeader.test.ts-snapshots/PageHeader-Files-Page-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.31 KB
(160%)
...s/components/PageHeader.test.ts-snapshots/PageHeader-Files-Page-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.31 KB
(160%)
...s/PageHeader.test.ts-snapshots/PageHeader-Files-Page-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.25 KB
(160%)
...ts-snapshots/PageHeader-Files-Page-on-Narrow-Viewport-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.34 KB
(160%)
...est.ts-snapshots/PageHeader-Files-Page-on-Narrow-Viewport-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.23 KB
(160%)
...snapshots/PageHeader-Files-Page-on-Narrow-Viewport-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.25 KB
(160%)
...eader.test.ts-snapshots/PageHeader-Files-Page-on-Narrow-Viewport-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.25 KB
(160%)
...ts-snapshots/PageHeader-Files-Page-on-Narrow-Viewport-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.31 KB
(160%)
...s-snapshots/PageHeader-Files-Page-on-Narrow-Viewport-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.16 KB
(160%)
...napshots/PageHeader-Files-Page-on-Narrow-Viewport-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.31 KB
(160%)
...ader.test.ts-snapshots/PageHeader-Files-Page-on-Narrow-Viewport-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.31 KB
(160%)
...s-snapshots/PageHeader-Files-Page-on-Narrow-Viewport-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.8 KB
...apshots/PageHeader-Large-Variant-with-Multiline-Title-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.3 KB
...s-snapshots/PageHeader-Large-Variant-with-Multiline-Title-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+55.4 KB
...hots/PageHeader-Large-Variant-with-Multiline-Title-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+56.1 KB
....test.ts-snapshots/PageHeader-Large-Variant-with-Multiline-Title-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.8 KB
...apshots/PageHeader-Large-Variant-with-Multiline-Title-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+55.4 KB
...pshots/PageHeader-Large-Variant-with-Multiline-Title-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+53.6 KB
...ots/PageHeader-Large-Variant-with-Multiline-Title-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+55.2 KB
...test.ts-snapshots/PageHeader-Large-Variant-with-Multiline-Title-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+55.4 KB
...pshots/PageHeader-Large-Variant-with-Multiline-Title-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+36 Bytes
(100%)
...Header.test.ts-snapshots/PageHeader-Pull-Request-Page-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+189 Bytes
(100%)
...PageHeader.test.ts-snapshots/PageHeader-Pull-Request-Page-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
+26 Bytes
(100%)
...der.test.ts-snapshots/PageHeader-Pull-Request-Page-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+29 Bytes
(100%)
...onents/PageHeader.test.ts-snapshots/PageHeader-Pull-Request-Page-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
+41 Bytes
(100%)
...Header.test.ts-snapshots/PageHeader-Pull-Request-Page-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+151 Bytes
(100%)
...eader.test.ts-snapshots/PageHeader-Pull-Request-Page-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+11 Bytes
(100%)
...er.test.ts-snapshots/PageHeader-Pull-Request-Page-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+108 Bytes
(100%)
...nents/PageHeader.test.ts-snapshots/PageHeader-Pull-Request-Page-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
+257 Bytes
(100%)
...eader.test.ts-snapshots/PageHeader-Pull-Request-Page-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+36 Bytes
(100%)
...shots/PageHeader-Pull-Request-Page-on-Narrow-Viewport-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+189 Bytes
(100%)
...snapshots/PageHeader-Pull-Request-Page-on-Narrow-Viewport-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
+26 Bytes
(100%)
...ts/PageHeader-Pull-Request-Page-on-Narrow-Viewport-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+29 Bytes
(100%)
...est.ts-snapshots/PageHeader-Pull-Request-Page-on-Narrow-Viewport-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
+41 Bytes
(100%)
...shots/PageHeader-Pull-Request-Page-on-Narrow-Viewport-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+151 Bytes
(100%)
...hots/PageHeader-Pull-Request-Page-on-Narrow-Viewport-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+11 Bytes
(100%)
...s/PageHeader-Pull-Request-Page-on-Narrow-Viewport-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+108 Bytes
(100%)
...st.ts-snapshots/PageHeader-Pull-Request-Page-on-Narrow-Viewport-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
+257 Bytes
(100%)
...hots/PageHeader-Pull-Request-Page-on-Narrow-Viewport-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+224 Bytes
(100%)
...er.test.ts-snapshots/PageHeader-With-Description-Slot-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
-11 Bytes
(100%)
...Header.test.ts-snapshots/PageHeader-With-Description-Slot-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
-20 Bytes
(100%)
...test.ts-snapshots/PageHeader-With-Description-Slot-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-63 Bytes
(100%)
...ts/PageHeader.test.ts-snapshots/PageHeader-With-Description-Slot-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
+224 Bytes
(100%)
...er.test.ts-snapshots/PageHeader-With-Description-Slot-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
...r.test.ts-snapshots/PageHeader-With-Description-Slot-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
...est.ts-snapshots/PageHeader-With-Description-Slot-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
...s/PageHeader.test.ts-snapshots/PageHeader-With-Description-Slot-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
...r.test.ts-snapshots/PageHeader-With-Description-Slot-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+25 Bytes
(100%)
...eHeader.test.ts-snapshots/PageHeader-With-Page-Layout-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+83 Bytes
(100%)
.../PageHeader.test.ts-snapshots/PageHeader-With-Page-Layout-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
+179 Bytes
(100%)
...ader.test.ts-snapshots/PageHeader-With-Page-Layout-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+26 Bytes
(100%)
...ponents/PageHeader.test.ts-snapshots/PageHeader-With-Page-Layout-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
+28 Bytes
(100%)
...eHeader.test.ts-snapshots/PageHeader-With-Page-Layout-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
-17 Bytes
(100%)
...Header.test.ts-snapshots/PageHeader-With-Page-Layout-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+25 Bytes
(100%)
...der.test.ts-snapshots/PageHeader-With-Page-Layout-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
-57 Bytes
(100%)
...onents/PageHeader.test.ts-snapshots/PageHeader-With-Page-Layout-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
+127 Bytes
(100%)
...Header.test.ts-snapshots/PageHeader-With-Page-Layout-light-tritanopia-linux.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import React from 'react' | ||
import type {Meta} from '@storybook/react' | ||
import {Button, IconButton, Box} from '..' | ||
import Label from '../Label' | ||
import {GitBranchIcon, PencilIcon, SidebarExpandIcon} from '@primer/octicons-react' | ||
|
||
import {PageHeader} from './PageHeader' | ||
|
||
const meta: Meta<typeof PageHeader> = { | ||
title: 'Drafts/Components/PageHeader/DevOnly', | ||
parameters: { | ||
layout: 'fullscreen', | ||
controls: {expanded: true}, | ||
}, | ||
} | ||
|
||
export default meta | ||
|
||
export const LargeVariantWithMultilineTitle = () => ( | ||
<Box sx={{padding: 3}}> | ||
<PageHeader> | ||
<PageHeader.LeadingAction> | ||
<IconButton aria-label="Edit" icon={PencilIcon} variant="invisible" /> | ||
</PageHeader.LeadingAction> | ||
<PageHeader.TitleArea variant="large"> | ||
<PageHeader.LeadingVisual> | ||
<GitBranchIcon /> | ||
</PageHeader.LeadingVisual> | ||
<PageHeader.Title> | ||
Title long title some extra loooong looong words here some extra loooong looong words here some extra loooong | ||
looong words here some extra loooong looong words here some extra loooong looong words here | ||
</PageHeader.Title> | ||
<PageHeader.TrailingVisual> | ||
<Label>Beta</Label> | ||
</PageHeader.TrailingVisual> | ||
</PageHeader.TitleArea> | ||
<PageHeader.TrailingAction> | ||
<IconButton aria-label="Expand sidebar" icon={SidebarExpandIcon} variant="invisible" /> | ||
</PageHeader.TrailingAction> | ||
<PageHeader.Actions> | ||
<Button variant="primary">Add Item</Button> | ||
</PageHeader.Actions> | ||
</PageHeader> | ||
</Box> | ||
) | ||
|
||
export const ArrayTypeFontSizeOnTitle = () => ( | ||
<Box sx={{padding: 3}}> | ||
<PageHeader> | ||
<PageHeader.TitleArea> | ||
<PageHeader.Title | ||
sx={{ | ||
lineHeight: '1.25', | ||
fontWeight: 'normal', | ||
fontSize: ['26px', '26px', 'var(--text-title-size-large, 32px)', 'var(--text-title-size-large, 32px)'], // it doesn't support this format right now. | ||
}} | ||
> | ||
Issue Title | ||
</PageHeader.Title> | ||
</PageHeader.TitleArea> | ||
</PageHeader> | ||
</Box> | ||
) | ||
|
||
export const ThemeBaseFontSizeOnTitle = () => ( | ||
<Box sx={{padding: 3}}> | ||
<PageHeader> | ||
<PageHeader.TitleArea> | ||
<PageHeader.Title | ||
sx={{ | ||
fontSize: 8, | ||
}} | ||
> | ||
Issue Title | ||
</PageHeader.Title> | ||
</PageHeader.TitleArea> | ||
</PageHeader> | ||
</Box> | ||
) | ||
|
||
export const StringTypeFontSizeOnTitle = () => ( | ||
<Box sx={{padding: 3}}> | ||
<PageHeader> | ||
<PageHeader.TitleArea> | ||
<PageHeader.Title | ||
sx={{ | ||
fontSize: '56px', | ||
}} | ||
> | ||
Issue Title | ||
</PageHeader.Title> | ||
</PageHeader.TitleArea> | ||
</PageHeader> | ||
</Box> | ||
) |
Oops, something went wrong.