@@ -36,105 +36,60 @@ const hideDrawer = (drawerID: string) => {
3636} ;
3737
3838const storyTemplate = html < StoryArgs < FluentDrawer >> `
39- <style>
40- #docs-root .innerZoomElementWrapper > div,
41- #docs-root .innerZoomElementWrapper > div > div {
42- padding: 0;
43- }
44-
45- .demo {
46- display: flex;
47- align-items: center;
48- min-height: 22rem;
49- width: 100%;
50- }
51-
52- .demo-content {
53- grid-area: content;
54- padding: 48px 24px;
55- }
56-
57- .demo:has([position='end']) [position='end'] {
58- order: 1;
59- }
60- </style>
39+ <fluent-button appearance="primary" @click="${ ( ) => toggleDrawer ( 'drawer-default' ) } "> Toggle Drawer </fluent-button>
40+ <fluent-drawer
41+ id="drawer-default"
42+ position="${ story => story . position } "
43+ size="${ story => story . size } "
44+ type="${ story => story . type } "
45+ style="${ story => ( story [ '--drawer-width' ] !== '' ? `--drawer-width: ${ story [ '--drawer-width' ] } ;` : '' ) } ${ story =>
46+ story [ '--dialog-backdrop' ] !== '' ? `--dialog-backdrop: ${ story [ '--dialog-backdrop' ] } ;` : '' } "
47+ >
48+ <fluent-drawer-body>
49+ <h2 slot="title">Drawer Header</h2>
50+ <fluent-button
51+ slot="close"
52+ appearance="transparent"
53+ icon-only
54+ aria-label="close"
55+ @click="${ ( ) => hideDrawer ( 'drawer-default' ) } "
56+ >
57+ ${ dismissed20Regular }
58+ </fluent-button>
59+ <div>
60+ <fluent-text>
61+ The drawer gives users a quick entry point to configuration and information. It should be used when retaining
62+ context is beneficial to users. An overlay is optional depending on whether or not interacting with the
63+ background content is beneficial to the user's context/scenario. An overlay makes the drawer blocking and
64+ signifies that the users full attention is required when making configurations.
65+ </fluent-text>
6166
62- <div class="demo">
63- <fluent-drawer
64- id="drawer-default"
65- position="${ story => story . position } "
66- size="${ story => story . size } "
67- type="${ story => story . type } "
68- style="${ story =>
69- story [ '--drawer-width' ] !== '' ? `--drawer-width: ${ story [ '--drawer-width' ] } ;` : '' } ${ story =>
70- story [ '--dialog-backdrop' ] !== '' ? `--dialog-backdrop: ${ story [ '--dialog-backdrop' ] } ;` : '' } "
71- >
72- <fluent-drawer-body>
73- <span slot="title"> Drawer Header</span>
74- <fluent-button
75- slot="close"
76- appearance="transparent"
77- icon-only
78- aria-label="close"
79- @click="${ ( ) => hideDrawer ( 'drawer-default' ) } "
80- >
81- ${ dismissed20Regular }
82- </fluent-button>
8367 <div>
84- <fluent-text>
85- The drawer gives users a quick entry point to configuration and information. It should be used when
86- retaining context is beneficial to users. An overlay is optional depending on whether or not interacting
87- with the background content is beneficial to the user's context/scenario. An overlay makes the drawer
88- blocking and signifies that the users full attention is required when making configurations.
89- </fluent-text>
90-
91- <div>
92- <fluent-field>
93- <label slot="label">Please select an option</label>
94- <fluent-radio-group id="demo-options" slot="input" orientation="vertical">
95- <fluent-field label-position="after">
96- <label for="option-one" slot="label">Option 1</label>
97- <fluent-radio id="option-one" slot="input" name="demo-options" value="1"></fluent-radio>
98- </fluent-field>
99- <fluent-field label-position="after">
100- <label for="option-two" slot="label">Option 2</label>
101- <fluent-radio id="option-two" slot="input" name="demo-options" value="2"></fluent-radio>
102- </fluent-field>
103- <fluent-field label-position="after">
104- <label for="option-three" slot="label">Option 3</label>
105- <fluent-radio id="option-three" slot="input" name="demo-options" value="3"></fluent-radio>
106- </fluent-field>
107- </fluent-radio-group>
108- </fluent-field>
109- </div>
110- </div>
111- <div slot="footer">
112- <fluent-button appearance="primary" @click="${ ( ) => hideDrawer ( 'drawer-default' ) } ">Close</fluent-button>
113- <fluent-button appearance="secondary">Do Something</fluent-button>
68+ <fluent-field>
69+ <label slot="label">Please select an option</label>
70+ <fluent-radio-group id="demo-options" slot="input" orientation="vertical">
71+ <fluent-field label-position="after">
72+ <label for="option-one" slot="label">Option 1</label>
73+ <fluent-radio id="option-one" slot="input" name="demo-options" value="1"></fluent-radio>
74+ </fluent-field>
75+ <fluent-field label-position="after">
76+ <label for="option-two" slot="label">Option 2</label>
77+ <fluent-radio id="option-two" slot="input" name="demo-options" value="2"></fluent-radio>
78+ </fluent-field>
79+ <fluent-field label-position="after">
80+ <label for="option-three" slot="label">Option 3</label>
81+ <fluent-radio id="option-three" slot="input" name="demo-options" value="3"></fluent-radio>
82+ </fluent-field>
83+ </fluent-radio-group>
84+ </fluent-field>
11485 </div>
115- </fluent-drawer-body>
116- </fluent-drawer>
117- <div class="demo-content">
118- <fluent-text font="base" size="300" weight="regular" as="p">
119- <p>
120- The Drawer gives users a quick entry point to configuration and information. It should be used when retaining
121- context is beneficial to users.
122- </p>
123- </fluent-text>
124- <br />
125- <br />
126- <fluent-text font="monospace" size="300" weight="regular">
127- <code>fluent-drawer</code>
128- </fluent-text>
129- <br />
130- <br />
131- <div>
132- <fluent-button appearance="primary" @click="${ ( ) => toggleDrawer ( 'drawer-default' ) } "
133- >Toggle Drawer</fluent-button
134- >
13586 </div>
136- </div>
137- </div>
87+ <div slot="footer">
88+ <fluent-button appearance="primary" @click="${ ( ) => hideDrawer ( 'drawer-default' ) } ">Close</fluent-button>
89+ <fluent-button appearance="secondary">Do Something</fluent-button>
90+ </div>
91+ </fluent-drawer-body>
92+ </fluent-drawer>
13893` ;
13994
14095export default {
0 commit comments