@@ -19,6 +19,7 @@ import {css, html, nothing} from 'lit';
19
19
20
20
/** Knob types for dialog stories. */
21
21
export interface StoryKnobs {
22
+ quick : boolean ;
22
23
icon : string ;
23
24
headline : string ;
24
25
supportingText : string ;
@@ -30,13 +31,15 @@ function showDialog(event: Event) {
30
31
31
32
const standard : MaterialStoryInit < StoryKnobs > = {
32
33
name : 'Dialog' ,
33
- render ( { icon, headline, supportingText} ) {
34
+ render ( { icon, headline, supportingText, quick } ) {
34
35
return html `
35
- < md-filled-button @click =${ showDialog } aria-label ="Open a dialog"
36
- > Open</ md-filled-button
37
- >
36
+ < md-filled-button @click =${ showDialog } aria-label ="Open a dialog">
37
+ Open
38
+ </ md-filled-button >
38
39
39
- < md-dialog aria-label =${ headline ? nothing : 'A simple dialog' } >
40
+ < md-dialog
41
+ aria-label =${ headline ? nothing : 'A simple dialog' }
42
+ ?quick =${ quick } >
40
43
${ icon ? html `< md-icon slot ="icon "> ${ icon } </ md-icon > ` : nothing }
41
44
< div slot ="headline "> ${ headline } </ div >
42
45
< form id ="form " slot ="content " method ="dialog ">
@@ -53,13 +56,13 @@ const standard: MaterialStoryInit<StoryKnobs> = {
53
56
54
57
const alert : MaterialStoryInit < StoryKnobs > = {
55
58
name : 'Alert' ,
56
- render ( ) {
59
+ render ( { quick } ) {
57
60
return html `
58
- < md-filled-button @click =${ showDialog } aria-label ="Open an alert dialog"
59
- > Alert</ md-filled-button
60
- >
61
+ < md-filled-button @click =${ showDialog } aria-label ="Open an alert dialog">
62
+ Alert
63
+ </ md-filled-button >
61
64
62
- < md-dialog type ="alert ">
65
+ < md-dialog type ="alert " ?quick = ${ quick } >
63
66
< div slot ="headline "> Alert dialog</ div >
64
67
< form id ="form " slot ="content " method ="dialog ">
65
68
This is a standard alert dialog. Alert dialogs interrupt users with
@@ -75,15 +78,15 @@ const alert: MaterialStoryInit<StoryKnobs> = {
75
78
76
79
const confirm : MaterialStoryInit < StoryKnobs > = {
77
80
name : 'Confirm' ,
78
- render ( ) {
81
+ render ( { quick } ) {
79
82
return html `
80
83
< md-filled-button
81
84
@click =${ showDialog }
82
- aria-label ="Open a confirmation dialog"
83
- > Confirm</ md-filled-button
84
- >
85
+ aria-label ="Open a confirmation dialog">
86
+ Confirm
87
+ </ md-filled-button >
85
88
86
- < md-dialog style ="max-width: 320px; ">
89
+ < md-dialog style ="max-width: 320px; " ?quick = ${ quick } >
87
90
< div slot ="headline "> Permanently delete?</ div >
88
91
< md-icon slot ="icon "> delete_outline</ md-icon >
89
92
< form id ="form " slot ="content " method ="dialog ">
@@ -109,13 +112,13 @@ const choose: MaterialStoryInit<StoryKnobs> = {
109
112
align-items: center;
110
113
}
111
114
` ,
112
- render ( ) {
115
+ render ( { quick } ) {
113
116
return html `
114
- < md-filled-button @click =${ showDialog } aria-label ="Open a choice dialog"
115
- > Choice</ md-filled-button
116
- >
117
+ < md-filled-button @click =${ showDialog } aria-label ="Open a choice dialog">
118
+ Choice
119
+ </ md-filled-button >
117
120
118
- < md-dialog >
121
+ < md-dialog ?quick = ${ quick } >
119
122
< div slot ="headline "> Choose your favorite pet</ div >
120
123
< form id ="form " slot ="content " method ="dialog ">
121
124
< label >
@@ -184,13 +187,13 @@ const contacts: MaterialStoryInit<StoryKnobs> = {
184
187
flex: 1;
185
188
}
186
189
` ,
187
- render ( ) {
190
+ render ( { quick } ) {
188
191
return html `
189
- < md-filled-button @click =${ showDialog } aria-label ="Open a form dialog"
190
- > Form</ md-filled-button
191
- >
192
+ < md-filled-button @click =${ showDialog } aria-label ="Open a form dialog">
193
+ Form
194
+ </ md-filled-button >
192
195
193
- < md-dialog class ="contacts ">
196
+ < md-dialog class ="contacts " ?quick = ${ quick } >
194
197
< span slot ="headline ">
195
198
< md-icon-button form ="form " value ="close " aria-label ="Close dialog ">
196
199
< md-icon > close</ md-icon >
@@ -226,13 +229,13 @@ const contacts: MaterialStoryInit<StoryKnobs> = {
226
229
227
230
const floatingSheet : MaterialStoryInit < StoryKnobs > = {
228
231
name : 'Floating sheet' ,
229
- render ( ) {
232
+ render ( { quick } ) {
230
233
return html `
231
234
< md-filled-button @click =${ showDialog } aria-label ="Open a floating sheet">
232
235
Floating sheet
233
236
</ md-filled-button >
234
237
235
- < md-dialog >
238
+ < md-dialog ?quick = ${ quick } >
236
239
< span slot ="headline ">
237
240
< span style ="flex: 1; "> Floating Sheet</ span >
238
241
< md-icon-button form ="form " value ="close " aria-label ="Close dialog ">
0 commit comments