Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More a11y fixes for Storybook stories #4959

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 101 additions & 5 deletions packages/react/src/Flash/Flash.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import type {Meta} from '@storybook/react'
import Flash from './Flash'
import Octicon from '../Octicon'
import {InfoIcon, XIcon} from '@primer/octicons-react'
import {AlertIcon, CheckCircleIcon, InfoIcon, XIcon} from '@primer/octicons-react'
import {Button, IconButton} from '../Button'
import Link from '../Link'
import Box from '../Box'
Expand All @@ -12,13 +12,109 @@ export default {
component: Flash,
} as Meta<typeof Flash>

export const Success = () => <Flash variant="success">Success</Flash>
export const Success = () => (
<Flash
variant="success"
sx={{
display: 'grid',
gridTemplateColumns: 'min-content 1fr minmax(0, auto)',
gridTemplateAreas: `'visual message actions'`,
}}
>
<Box sx={{display: 'grid', paddingBlock: 'var(--base-size-8)', alignSelf: 'start', gridArea: 'visual'}}>
<Octicon icon={CheckCircleIcon} />
</Box>
<Box
sx={{
fontSize: 1,
lineHeight: '1.5',
padding: '0.375rem var(--base-size-8)',
alignSelf: 'center',
gridArea: 'message',
}}
>
Success
</Box>
</Flash>
)

export const Danger = () => <Flash variant="danger">Danger</Flash>
export const Danger = () => (
<Flash
variant="danger"
sx={{
display: 'grid',
gridTemplateColumns: 'min-content 1fr minmax(0, auto)',
gridTemplateAreas: `'visual message actions'`,
}}
>
<Box sx={{display: 'grid', paddingBlock: 'var(--base-size-8)', alignSelf: 'start', gridArea: 'visual'}}>
<Octicon icon={InfoIcon} />
</Box>
<Box
sx={{
fontSize: 1,
lineHeight: '1.5',
padding: '0.375rem var(--base-size-8)',
alignSelf: 'center',
gridArea: 'message',
}}
>
Danger
</Box>
</Flash>
)

export const Warning = () => <Flash variant="warning">Warning</Flash>
export const Warning = () => (
<Flash
variant="warning"
sx={{
display: 'grid',
gridTemplateColumns: 'min-content 1fr minmax(0, auto)',
gridTemplateAreas: `'visual message actions'`,
}}
>
<Box sx={{display: 'grid', paddingBlock: 'var(--base-size-8)', alignSelf: 'start', gridArea: 'visual'}}>
<Octicon icon={AlertIcon} />
</Box>
<Box
sx={{
fontSize: 1,
lineHeight: '1.5',
padding: '0.375rem var(--base-size-8)',
alignSelf: 'center',
gridArea: 'message',
}}
>
Warning
</Box>
</Flash>
)

export const Full = () => <Flash full>Full</Flash>
export const Full = () => (
<Flash
full
sx={{
display: 'grid',
gridTemplateColumns: 'min-content 1fr minmax(0, auto)',
gridTemplateAreas: `'visual message actions'`,
}}
>
<Box sx={{display: 'grid', paddingBlock: 'var(--base-size-8)', alignSelf: 'start', gridArea: 'visual'}}>
<Octicon icon={InfoIcon} />
</Box>
<Box
sx={{
fontSize: 1,
lineHeight: '1.5',
padding: '0.375rem var(--base-size-8)',
alignSelf: 'center',
gridArea: 'message',
}}
>
Full
</Box>
</Flash>
)

export const WithIconAndAction = () => (
<Flash
Expand Down
17 changes: 15 additions & 2 deletions packages/react/src/Pagehead/Pagehead.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
import React from 'react'
import type {Meta, StoryFn} from '@storybook/react'
import Pagehead from './Pagehead'
import Heading from '../Heading'

export default {
title: 'Components/Pagehead',
component: Pagehead,
} as Meta<typeof Pagehead>

export const Default = () => <Pagehead>Pagehead</Pagehead>
export const Default = () => (
<Pagehead>
<Heading as="h2" variant="small">
Pagehead
</Heading>
</Pagehead>
)

export const Playground: StoryFn<typeof Pagehead> = args => <Pagehead {...args}>Pagehead</Pagehead>
export const Playground: StoryFn<typeof Pagehead> = args => (
<Pagehead {...args}>
<Heading as="h2" variant="small">
Pagehead
</Heading>
</Pagehead>
)

Playground.args = {
as: 'div',
Expand Down
Loading