13
13
import { action } from '@storybook/addon-actions' ;
14
14
import { Button } from '@react-spectrum/button' ;
15
15
import { ButtonGroup } from '@react-spectrum/buttongroup' ;
16
- import { Checkbox } from '@react-spectrum/checkbox' ;
16
+ import { Checkbox , CheckboxGroup } from '@react-spectrum/checkbox' ;
17
17
import { countries , states } from './data' ;
18
18
import { Flex } from '@react-spectrum/layout' ;
19
19
import { Form } from '../' ;
20
20
import { Item , Picker } from '@react-spectrum/picker' ;
21
+ import { NumberField } from '@react-spectrum/numberfield' ;
21
22
import { Radio , RadioGroup } from '@react-spectrum/radio' ;
22
23
import React , { Key , useState } from 'react' ;
23
24
import { storiesOf } from '@storybook/react' ;
@@ -107,6 +108,24 @@ storiesOf('Form', module)
107
108
. add (
108
109
'form with reset' ,
109
110
( ) => < FormWithControls />
111
+ )
112
+ . add (
113
+ 'form with numberfield and locale=ar-AE' ,
114
+ ( ) => (
115
+ < Flex gap = "size-100" >
116
+ < NumberField label = "Outside form" />
117
+ < Form >
118
+ < NumberField label = "Inside form" />
119
+ </ Form >
120
+ < Form >
121
+ < TextField label = "First Name" placeholder = "John" />
122
+ </ Form >
123
+ < Form >
124
+ < TextField label = "First Name" placeholder = "John" />
125
+ < NumberField label = "Inside form" />
126
+ </ Form >
127
+ </ Flex >
128
+ )
110
129
) ;
111
130
112
131
function render ( props : any = { } ) {
@@ -116,13 +135,19 @@ function render(props: any = {}) {
116
135
< TextField label = "Last Name" placeholder = "Smith" />
117
136
< TextField label = "Street Address" placeholder = "123 Any Street" />
118
137
< TextField label = "City" placeholder = "San Francisco" />
138
+ < NumberField label = "Years lived there" />
119
139
< Picker label = "State" placeholder = "Select a state" items = { states } >
120
140
{ item => < Item key = { item . abbr } > { item . name } </ Item > }
121
141
</ Picker >
122
142
< TextField label = "Zip code" placeholder = "12345" />
123
143
< Picker label = "Country" placeholder = "Select a country" items = { countries } >
124
144
{ item => < Item key = { item . name } > { item . name } </ Item > }
125
145
</ Picker >
146
+ < CheckboxGroup defaultValue = { [ 'dragons' ] } label = "Pets" >
147
+ < Checkbox value = "dogs" > Dogs</ Checkbox >
148
+ < Checkbox value = "cats" > Cats</ Checkbox >
149
+ < Checkbox value = "dragons" > Dragons</ Checkbox >
150
+ </ CheckboxGroup >
126
151
< RadioGroup label = "Favorite pet" name = "favorite-pet-group" >
127
152
< Radio value = "dogs" > Dogs</ Radio >
128
153
< Radio value = "cats" > Cats</ Radio >
0 commit comments