@@ -70,7 +70,9 @@ const meta: Meta<typeof Modal> = {
7070 decorators : [
7171 ( Story ) => (
7272 < PortalProvider >
73- < Story />
73+ < div className = "jn:m-20 jn:flex jn:justify-center" >
74+ < Story />
75+ </ div >
7476 </ PortalProvider >
7577 ) ,
7678 ] ,
@@ -116,15 +118,89 @@ export const AutoFocusDialog: Story = {
116118 } ,
117119}
118120
119- export const LargeWithTitle : Story = {
121+ const ReusableForm = ( ) => (
122+ < Form >
123+ < FormRow >
124+ < TextInput label = "First Name" id = "firstname" />
125+ </ FormRow >
126+ < FormRow >
127+ < TextInput label = "Last Name" id = "lastname" />
128+ </ FormRow >
129+ < FormRow >
130+ < TextInput label = "Email" id = "email" type = "email" />
131+ </ FormRow >
132+ < FormRow >
133+ < TextInput label = "Password" id = "password" type = "password" />
134+ </ FormRow >
135+ < FormRow >
136+ < TextInput label = "Retype Password" id = "retype-password" type = "password" />
137+ </ FormRow >
138+ < FormRow >
139+ < Select label = "Role" >
140+ < SelectOption > Private Person</ SelectOption >
141+ < SelectOption > Small Business</ SelectOption >
142+ </ Select >
143+ </ FormRow >
144+ < FormRow >
145+ < ComboBox label = "Country" >
146+ < ComboBoxOption value = "germany" key = "DE" >
147+ Germany
148+ </ ComboBoxOption >
149+ < ComboBoxOption value = "uk" key = "UK" >
150+ United Kingdom
151+ </ ComboBoxOption >
152+ < ComboBoxOption value = "us" key = "US" >
153+ USA
154+ </ ComboBoxOption >
155+ </ ComboBox >
156+ </ FormRow >
157+ </ Form >
158+ )
159+
160+ export const DefaultWithForm : Story = {
161+ render : Template ,
162+ args : {
163+ title : "Default Modal Form" ,
164+ initialFocus : "#firstname" ,
165+ cancelButtonLabel : "Cancel" ,
166+ confirmButtonLabel : "Register now" ,
167+ children : < ReusableForm /> ,
168+ } ,
169+ }
170+
171+ export const LargeWithForm : Story = {
120172 render : Template ,
121173 args : {
122174 size : "large" ,
123- title : "Large Modal" ,
124- confirmButtonLabel : "OK" ,
125- // @ts -ignore
126- closeOnConfirm : true /* Only relevant for storybook, this is not a native prop of the component! */ ,
127- children : < p > A large modal with a title</ p > ,
175+ title : "Large Modal Form" ,
176+ initialFocus : "#firstname" ,
177+ cancelButtonLabel : "Cancel" ,
178+ confirmButtonLabel : "Register now" ,
179+ children : < ReusableForm /> ,
180+ } ,
181+ }
182+
183+ export const XLWithForm : Story = {
184+ render : Template ,
185+ args : {
186+ size : "xl" ,
187+ title : "XL With Form" ,
188+ initialFocus : "#firstname" ,
189+ cancelButtonLabel : "Cancel" ,
190+ confirmButtonLabel : "Register now" ,
191+ children : < ReusableForm /> ,
192+ } ,
193+ }
194+
195+ export const XXLWithForm : Story = {
196+ render : Template ,
197+ args : {
198+ size : "2xl" ,
199+ title : "2XL With Form" ,
200+ initialFocus : "#firstname" ,
201+ cancelButtonLabel : "Cancel" ,
202+ confirmButtonLabel : "Register now" ,
203+ children : < ReusableForm /> ,
128204 } ,
129205}
130206
@@ -235,51 +311,3 @@ export const TestComboBoxInModal: Story = {
235311 ) ,
236312 } ,
237313}
238-
239- export const ModalWithALargerForm : Story = {
240- render : Template ,
241- args : {
242- title : "Register" ,
243- initialFocus : "#firstname" ,
244- cancelButtonLabel : "Cancel" ,
245- confirmButtonLabel : "Register now" ,
246- children : (
247- < Form >
248- < FormRow >
249- < TextInput label = "First Name" id = "firstname" />
250- </ FormRow >
251- < FormRow >
252- < TextInput label = "Last Name" id = "lastname" />
253- </ FormRow >
254- < FormRow >
255- < TextInput label = "Email" id = "email" type = "email" />
256- </ FormRow >
257- < FormRow >
258- < TextInput label = "Password" id = "password" type = "password" />
259- </ FormRow >
260- < FormRow >
261- < TextInput label = "Retype Password" id = "retype-password" type = "password" />
262- </ FormRow >
263- < FormRow >
264- < Select label = "Role" >
265- < SelectOption > Private Person</ SelectOption >
266- < SelectOption > Small Business</ SelectOption >
267- </ Select >
268- </ FormRow >
269- < FormRow >
270- < ComboBox label = "Country" >
271- < ComboBoxOption value = "germany" key = "DE" >
272- Germany
273- </ ComboBoxOption >
274- < ComboBoxOption value = "uk" key = "UK" >
275- United Kingdom
276- </ ComboBoxOption >
277- < ComboBoxOption value = "us" key = "US" >
278- USA
279- </ ComboBoxOption >
280- </ ComboBox >
281- </ FormRow >
282- </ Form >
283- ) ,
284- } ,
285- }
0 commit comments