Skip to content

Commit 1f30d25

Browse files
Merge 0bd22ee into 4ecbe1a
2 parents 4ecbe1a + 0bd22ee commit 1f30d25

File tree

73 files changed

+750
-485
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+750
-485
lines changed

.changeset/clever-schools-shave.md

Lines changed: 7 additions & 0 deletions

e2e/components/PageHeader.test.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,4 +673,38 @@ test.describe('PageHeader', () => {
673673
})
674674
}
675675
})
676+
677+
test.describe('Large Variant with Multiline Title', () => {
678+
for (const theme of themes) {
679+
test.describe(theme, () => {
680+
test('default @vrt', async ({page}) => {
681+
await visit(page, {
682+
id: 'drafts-components-pageheader-devonly--large-variant-with-multiline-title',
683+
globals: {
684+
colorScheme: theme,
685+
},
686+
})
687+
688+
// Default state
689+
expect(await page.screenshot()).toMatchSnapshot(`PageHeader.Large Variant with Multiline Title.${theme}.png`)
690+
})
691+
692+
test('axe @aat', async ({page}) => {
693+
await visit(page, {
694+
id: 'drafts-components-pageheader-devonly--large-variant-with-multiline-title',
695+
globals: {
696+
colorScheme: theme,
697+
},
698+
})
699+
await expect(page).toHaveNoViolations({
700+
rules: {
701+
'color-contrast': {
702+
enabled: theme !== 'dark_dimmed',
703+
},
704+
},
705+
})
706+
})
707+
})
708+
}
709+
})
676710
})
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import React from 'react'
2+
import type {Meta} from '@storybook/react'
3+
import {Button, IconButton, Box} from '..'
4+
import Label from '../Label'
5+
import {GitBranchIcon, PencilIcon, SidebarExpandIcon} from '@primer/octicons-react'
6+
7+
import {PageHeader} from './PageHeader'
8+
9+
const meta: Meta<typeof PageHeader> = {
10+
title: 'Drafts/Components/PageHeader/DevOnly',
11+
parameters: {
12+
layout: 'fullscreen',
13+
controls: {expanded: true},
14+
},
15+
}
16+
17+
export default meta
18+
19+
export const LargeVariantWithMultilineTitle = () => (
20+
<Box sx={{padding: 3}}>
21+
<PageHeader>
22+
<PageHeader.LeadingAction>
23+
<IconButton aria-label="Edit" icon={PencilIcon} variant="invisible" />
24+
</PageHeader.LeadingAction>
25+
<PageHeader.TitleArea variant="large">
26+
<PageHeader.LeadingVisual>
27+
<GitBranchIcon />
28+
</PageHeader.LeadingVisual>
29+
<PageHeader.Title>
30+
Title long title some extra loooong looong words here some extra loooong looong words here some extra loooong
31+
looong words here some extra loooong looong words here some extra loooong looong words here
32+
</PageHeader.Title>
33+
<PageHeader.TrailingVisual>
34+
<Label>Beta</Label>
35+
</PageHeader.TrailingVisual>
36+
</PageHeader.TitleArea>
37+
<PageHeader.TrailingAction>
38+
<IconButton aria-label="Expand sidebar" icon={SidebarExpandIcon} variant="invisible" />
39+
</PageHeader.TrailingAction>
40+
<PageHeader.Actions>
41+
<Button variant="primary">Add Item</Button>
42+
</PageHeader.Actions>
43+
</PageHeader>
44+
</Box>
45+
)

0 commit comments

Comments
 (0)