@@ -57,7 +57,12 @@ const closeTemplate = html`
5757
5858const storyTemplate = html < StoryArgs < FluentDialog & FluentDialogBody >> `
5959 <fluent-button @click="${ story => story . storyDialog ?. show ( ) } ">Open Dialog</fluent-button>
60- <fluent-dialog id="dialog-default" type="${ story => story . type } " ${ ref ( 'storyDialog' ) } >
60+ <fluent-dialog
61+ id="dialog-default"
62+ type="${ story => story . type } "
63+ ${ ref ( 'storyDialog' ) }
64+ aria-label="${ story => story . ariaLabel } "
65+ >
6166 <fluent-dialog-body>
6267 ${ story => story . actionSlottedContent ?.( ) } ${ story => story . slottedContent ?.( ) }
6368 ${ story => story . titleActionSlottedContent ?.( ) } ${ story => story . closeSlottedContent ?.( ) }
@@ -100,7 +105,8 @@ export default {
100105
101106export const Default : Story = {
102107 args : {
103- titleSlottedContent : ( ) => html ` <div slot= "title" > Default Dialog </ div> ` ,
108+ titleSlottedContent : ( ) => html ` <h2 slot= "title" > Default Dialog </ h2> ` ,
109+ ariaLabel : 'Default Dialog' ,
104110 slottedContent : ( ) => html `
105111 <p>
106112 The dialog component is a window overlaid on either the primary window or another dialog window . Windows under a
@@ -114,7 +120,8 @@ export const Default: Story = {
114120
115121export const WithTitleAction : Story = {
116122 args : {
117- titleSlottedContent : ( ) => html ` <div slot= "title" > Title Action Slot </ div> ` ,
123+ titleSlottedContent : ( ) => html ` <h2 slot= "title" > Title Action Slot </ h2> ` ,
124+ ariaLabel : 'Title Action Slot' ,
118125 titleActionSlottedContent : ( ) => html `
119126 <fluent- butto n appearance= "transparent" icon-only slot = "title-action"> ${ info20Regular } </ fluent- butto n>
120127 ` ,
@@ -126,7 +133,8 @@ export const WithTitleAction: Story = {
126133export const ModalType : Story = {
127134 args : {
128135 type : DialogType . modal ,
129- titleSlottedContent : ( ) => html ` <div slot= "title" > Modal </ div> ` ,
136+ titleSlottedContent : ( ) => html ` <h2 slot= "title" > Modal </ h2> ` ,
137+ ariaLabel : 'Model' ,
130138 slottedContent : ( ) => html `
131139 <p>
132140 A modal is a type of dialog that temporarily halts the main workflow to convey a significant message or require
@@ -144,7 +152,8 @@ export const NonModalType: Story = {
144152 render : renderComponent ( html < StoryArgs < FluentDialog >> ` <div style="min-height: 300px">${ storyTemplate } </div> ` ) ,
145153 args : {
146154 type : DialogType . nonModal ,
147- titleSlottedContent : ( ) => html ` <div slot="title">Non-modal</div> ` ,
155+ titleSlottedContent : ( ) => html ` <h2 slot="title">Non-modal</h2> ` ,
156+ ariaLabel : 'Non-modal' ,
148157 slottedContent : ( ) => html `
149158 <p>
150159 A non-modal dialog by default presents no backdrop, allowing elements outside of the dialog to be interacted
@@ -165,7 +174,8 @@ export const AlertType: Story = {
165174 args : {
166175 type : DialogType . alert ,
167176 closeSlottedContent : ( ) => html `` ,
168- titleSlottedContent : ( ) => html ` <div slot="title">Non-modal</div> ` ,
177+ titleSlottedContent : ( ) => html ` <h2 slot="title">Alert</h2> ` ,
178+ ariaLabel : 'Alert' ,
169179 actionSlottedContent : ( ) => closeButtonTemplate ,
170180 slottedContent : ( ) => html `
171181 <p>
@@ -179,7 +189,8 @@ export const AlertType: Story = {
179189
180190export const Actions : Story = {
181191 args : {
182- titleSlottedContent : ( ) => html ` <div slot= "title" > Actions </ div> ` ,
192+ titleSlottedContent : ( ) => html ` <h2 slot= "title" > Actions </ h2> ` ,
193+ ariaLabel : 'Actions' ,
183194 actionSlottedContent : ( ) => html `
184195 <fluent- butto n size= "small" slot = "action"> Something</ fluent- butto n>
185196 <fluent- butto n size= "small" slot = "action"> Something Else</ fluent- butto n>
@@ -215,13 +226,15 @@ export const CustomClose: Story = {
215226 and a custom icon. Clicking the button will trigger a JavaScript alert.
216227 </p>
217228 ` ,
218- titleSlottedContent : ( ) => html ` <div slot=" title">Custom Close Slot</div> ` ,
229+ titleSlottedContent : ( ) => html ` <h2 slot=" title">Custom Close Slot</h2> ` ,
230+ ariaLabel : 'Custom Close Slot' ,
219231 } ,
220232} ;
221233
222234export const NoClose : Story = {
223235 args : {
224- titleSlottedContent : ( ) => html ` <div slot=" title">No Close Slot</div> ` ,
236+ titleSlottedContent : ( ) => html ` <h2 slot=" title">No Close Slot</h2> ` ,
237+ ariaLabel : 'No Close Slot' ,
225238 closeSlottedContent : ( ) => html `` ,
226239 slottedContent : ( ) => html `
227240 <p>
@@ -236,13 +249,15 @@ export const NoClose: Story = {
236249export const ModalWithNoTitleOrTitleActions : Story = {
237250 args : {
238251 type : DialogType . modal ,
252+ ariaLabel : 'No Title' ,
239253 slottedContent : ( ) => html ` <p>A dialog without a <code>title</code> slot or <code>title-action</code> slot</p> ` ,
240254 } ,
241255} ;
242256
243257export const ModalWithNoTitle : Story = {
244258 args : {
245259 type : DialogType . modal ,
260+ ariaLabel : 'No Title' ,
246261 titleActionSlottedContent : ( ) => html `
247262 <fluent-button appearance=" transparent" icon- only slot= "title-action"> ${ info20Regular } </ fluent- butto n>
248263 ` ,
@@ -273,7 +288,8 @@ export const AlertWithNoTitleOrActions: Story = {
273288
274289export const TwoColumnLayout : Story = {
275290 args : {
276- titleSlottedContent : ( ) => html ` <div slot=" title">Two Column Layout</div> ` ,
291+ titleSlottedContent : ( ) => html ` <h2 slot= "title" > Two Column Layout </ h2> ` ,
292+ ariaLabel : 'Two Column Layout' ,
277293 slottedContent : ( ) => html < StoryArgs < FluentDialog > > `
278294 <div style="margin-bottom: 12px;">
279295 <fluent-text block>
@@ -317,7 +333,8 @@ export const TwoColumnLayout: Story = {
317333
318334export const ScrollingLongContent : Story = {
319335 args : {
320- titleSlottedContent : ( ) => html ` <div slot=" title"> Scrolling Long Content</ div> ` ,
336+ titleSlottedContent : ( ) => html ` <h2 slot= "title" > Scrolling Long Content </ h2> ` ,
337+ ariaLabel : 'Scrolling Long Content' ,
321338 slottedContent : ( ) => html `
322339 <p>
323340 By default content provided in the default slot should grow until it fits viewport size . Overflow content will
0 commit comments