Skip to content

Commit fb0113d

Browse files
authored
docs: update dynamic button examples to use AriaAlert (#5548)
* docs: update example to use AriaAlert * docs: make announcement examples more discoverable * Revert "docs: make announcement examples more discoverable" This reverts commit 996f1ab. * Don't explicitly specify stories so that all stories get pulled in * Set to empty array * Just individually specify
1 parent c87e80c commit fb0113d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

packages/react/src/Banner/Banner.docs.json

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
},
4747
{
4848
"id": "experimental-components-banner-features--custom-icon"
49+
},
50+
{
51+
"id": "experimental-components-banner-examples--with-announcement"
4952
}
5053
],
5154
"props": [

packages/react/src/Banner/Banner.examples.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const WithUserAction = () => {
4646
)
4747
}
4848

49-
export const WithDynamicContent = () => {
49+
export const WithAnnouncement = () => {
5050
type Choice = 'one' | 'two' | 'three'
5151
const messages: Map<Choice, string> = new Map([
5252
['one', 'This is a message for choice one'],

packages/react/src/Button/Button.examples.stories.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {Meta} from '@storybook/react'
33
import {Button} from '.'
44
import {DownloadIcon} from '@primer/octicons-react'
55
import {Banner} from '../experimental'
6-
import {AriaStatus} from '../live-region'
6+
import {AriaStatus, AriaAlert} from '../live-region'
77

88
const meta: Meta<typeof Button> = {
99
title: 'Components/Button/Examples',
@@ -69,7 +69,11 @@ export const LoadingStatusAnnouncementError = () => {
6969

7070
return (
7171
<>
72-
{!loading && error ? <Banner title="Export failed" variant="critical" /> : null}
72+
{!loading && error ? (
73+
<AriaAlert>
74+
<Banner title="Export failed" variant="critical" />
75+
</AriaAlert>
76+
) : null}
7377

7478
<Button loading={loading} leadingVisual={DownloadIcon} onClick={onClick('error')}>
7579
Export (error)

0 commit comments

Comments
 (0)