@@ -5,61 +5,171 @@ import 'semantic-ui-css/semantic.min.css';
55import SemanticDatepicker from '../src' ;
66import localePtBr from '../src/locales/pt-BR' ;
77
8+ const Content = ( { children, style } ) => (
9+ < div
10+ style = { Object . assign (
11+ { } ,
12+ { display : 'flex' , flex : 1 , justifyContent : 'center' } ,
13+ style
14+ ) }
15+ >
16+ { children }
17+ </ div >
18+ ) ;
19+
820storiesOf ( 'Examples' , module )
9- . add ( 'Basic' , ( ) => < SemanticDatepicker onDateChange = { console . log } /> )
21+ . add ( 'Basic' , ( ) => (
22+ < Content >
23+ < SemanticDatepicker onDateChange = { console . log } />
24+ </ Content >
25+ ) )
1026 . add ( 'Basic with firstDayOfWeek' , ( ) => (
11- < SemanticDatepicker firstDayOfWeek = { 3 } onDateChange = { console . log } />
27+ < Content >
28+ < SemanticDatepicker firstDayOfWeek = { 3 } onDateChange = { console . log } />
29+ </ Content >
1230 ) )
1331 . add ( 'Basic with outside days' , ( ) => (
14- < SemanticDatepicker showOutsideDays onDateChange = { console . log } />
32+ < Content >
33+ < SemanticDatepicker showOutsideDays onDateChange = { console . log } />
34+ </ Content >
1535 ) )
1636 . add ( 'Basic with format prop' , ( ) => (
17- < SemanticDatepicker format = "DD/MM/YYYY" onDateChange = { console . log } />
37+ < Content >
38+ < SemanticDatepicker format = "DD/MM/YYYY" onDateChange = { console . log } />
39+ </ Content >
1840 ) )
1941 . add ( 'Range' , ( ) => (
20- < SemanticDatepicker type = "range" onDateChange = { console . log } />
42+ < Content >
43+ < SemanticDatepicker type = "range" onDateChange = { console . log } />
44+ </ Content >
45+ ) )
46+ . add ( 'Range with right pointing' , ( ) => (
47+ < Content >
48+ < SemanticDatepicker
49+ type = "range"
50+ pointing = "right"
51+ onDateChange = { console . log }
52+ />
53+ </ Content >
2154 ) )
2255 . add ( 'Range with firstDayOfWeek' , ( ) => (
23- < SemanticDatepicker
24- type = "range"
25- firstDayOfWeek = { 6 }
26- onDateChange = { console . log }
27- />
56+ < Content >
57+ < SemanticDatepicker
58+ type = "range"
59+ firstDayOfWeek = { 6 }
60+ onDateChange = { console . log }
61+ />
62+ </ Content >
2863 ) )
2964 . add ( 'Range with outside days' , ( ) => (
30- < SemanticDatepicker
31- type = "range"
32- showOutsideDays
33- onDateChange = { console . log }
34- />
65+ < Content >
66+ < SemanticDatepicker
67+ type = "range"
68+ showOutsideDays
69+ onDateChange = { console . log }
70+ />
71+ </ Content >
3572 ) )
3673 . add ( 'Range with format prop' , ( ) => (
37- < SemanticDatepicker
38- type = "range"
39- format = "DD/MM/YYYY"
40- onDateChange = { console . log }
41- />
74+ < Content >
75+ < SemanticDatepicker
76+ type = "range"
77+ format = "DD/MM/YYYY"
78+ onDateChange = { console . log }
79+ />
80+ </ Content >
4281 ) )
4382 . add ( 'Basic with brazilian portuguese locale' , ( ) => (
44- < SemanticDatepicker
45- onDateChange = { console . log }
46- format = "DD/MM/YYYY"
47- locale = { localePtBr }
48- />
83+ < Content >
84+ < SemanticDatepicker
85+ onDateChange = { console . log }
86+ format = "DD/MM/YYYY"
87+ locale = { localePtBr }
88+ />
89+ </ Content >
4990 ) )
5091 . add ( 'Basic as form component' , ( ) => (
51- < Form >
52- < Form . Group width = "equals" >
53- < SemanticDatepicker
54- label = "Birth date"
55- id = "birthDate"
56- onDateChange = { console . log }
57- />
58- < SemanticDatepicker
59- label = "Start date"
60- id = "startDate"
61- onDateChange = { console . log }
62- />
63- </ Form . Group >
64- </ Form >
92+ < Content >
93+ < Form >
94+ < Form . Group width = "equals" >
95+ < SemanticDatepicker
96+ label = "Birth date"
97+ id = "birthDate"
98+ onDateChange = { console . log }
99+ />
100+ < SemanticDatepicker
101+ label = "Start date"
102+ id = "startDate"
103+ onDateChange = { console . log }
104+ />
105+ </ Form . Group >
106+ </ Form >
107+ </ Content >
108+ ) )
109+ . add ( 'Basic with left pointing' , ( ) => (
110+ < Content >
111+ < SemanticDatepicker pointing = "left" onDateChange = { console . log } />
112+ </ Content >
113+ ) )
114+ . add ( 'Basic with right pointing' , ( ) => (
115+ < Content >
116+ < SemanticDatepicker pointing = "right" onDateChange = { console . log } />
117+ </ Content >
118+ ) )
119+ . add ( 'Basic with top pointing' , ( ) => (
120+ < Content
121+ style = { {
122+ alignItems : 'flex-end' ,
123+ position : 'absolute' ,
124+ left : 0 ,
125+ right : 0 ,
126+ bottom : 0 ,
127+ top : 0 ,
128+ } }
129+ >
130+ < SemanticDatepicker pointing = "top" onDateChange = { console . log } />
131+ </ Content >
132+ ) )
133+ . add ( 'Basic with top left pointing' , ( ) => (
134+ < Content
135+ style = { {
136+ alignItems : 'flex-end' ,
137+ position : 'absolute' ,
138+ left : 0 ,
139+ right : 0 ,
140+ bottom : 0 ,
141+ top : 0 ,
142+ } }
143+ >
144+ < SemanticDatepicker pointing = "top left" onDateChange = { console . log } />
145+ </ Content >
146+ ) )
147+ . add ( 'Basic with top right pointing' , ( ) => (
148+ < Content
149+ style = { {
150+ alignItems : 'flex-end' ,
151+ position : 'absolute' ,
152+ left : 0 ,
153+ right : 0 ,
154+ bottom : 0 ,
155+ top : 0 ,
156+ } }
157+ >
158+ < SemanticDatepicker pointing = "top right" onDateChange = { console . log } />
159+ </ Content >
160+ ) )
161+ . add ( 'Basic with bottom pointing' , ( ) => (
162+ < Content >
163+ < SemanticDatepicker pointing = "bottom" onDateChange = { console . log } />
164+ </ Content >
165+ ) )
166+ . add ( 'Basic with bottom left pointing' , ( ) => (
167+ < Content >
168+ < SemanticDatepicker pointing = "bottom left" onDateChange = { console . log } />
169+ </ Content >
170+ ) )
171+ . add ( 'Basic with bottom right pointing' , ( ) => (
172+ < Content >
173+ < SemanticDatepicker pointing = "bottom right" onDateChange = { console . log } />
174+ </ Content >
65175 ) ) ;
0 commit comments