Commit 9edb9f4 1 parent b5a3d39 commit 9edb9f4 Copy full SHA for 9edb9f4
File tree 1 file changed +43
-0
lines changed
1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { DateTimePickerElement , FormContainer } from '../src'
2
+ import { ComponentMeta , ComponentStory } from '@storybook/react'
3
+ import DateFnsProvider from '../src/DateFnsProvider'
4
+ import { action } from '@storybook/addon-actions'
5
+ import { SubmitButton } from '../src/Shared'
6
+
7
+ export default {
8
+ title : 'DateTimePickerElement' ,
9
+ component : DateTimePickerElement
10
+ } as ComponentMeta < typeof DateTimePickerElement >
11
+
12
+
13
+ const Template : ComponentStory < typeof DateTimePickerElement > = ( args ) => (
14
+ < DateFnsProvider >
15
+ < FormContainer defaultValues = { { } } onSuccess = { action ( 'submit' ) } >
16
+ < DateTimePickerElement { ...args } />
17
+ < br />
18
+ < SubmitButton />
19
+ </ FormContainer >
20
+ </ DateFnsProvider >
21
+ )
22
+
23
+
24
+ export const Basic = Template . bind ( { } )
25
+ Basic . args = {
26
+ label : 'Datetime Picker' ,
27
+ name : 'basic'
28
+ }
29
+
30
+ export const RequiredPicker = Template . bind ( { } )
31
+ RequiredPicker . args = {
32
+ label : 'Datetime Picker' ,
33
+ name : 'required_picker' ,
34
+ required : true
35
+ }
36
+
37
+ export const RequiredPickerCustom = Template . bind ( { } )
38
+ RequiredPickerCustom . args = {
39
+ label : 'Datetime Picker' ,
40
+ name : 'required_picker_custom' ,
41
+ required : true ,
42
+ validation : { required : 'Custom required message' }
43
+ }
You can’t perform that action at this time.
0 commit comments