@hero-design/rn 7.10.2 → 7.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +8 -8
- package/assets/fonts/hero-icons.ttf +0 -0
- package/es/index.js +3778 -728
- package/global-setup.js +3 -0
- package/jest.config.js +1 -0
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +3779 -726
- package/package.json +7 -3
- package/rollup.config.js +8 -1
- package/src/components/ContentNavigator/__tests__/__snapshots__/index.spec.tsx.snap +2 -0
- package/src/components/ContentNavigator/__tests__/index.spec.tsx +19 -2
- package/src/components/ContentNavigator/index.tsx +12 -1
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +4 -0
- package/src/components/FAB/ActionGroup/index.tsx +16 -5
- package/src/components/Icon/HeroIcon/selection.json +1 -1
- package/src/components/Icon/IconList.ts +1 -0
- package/src/components/PinInput/PinCell.tsx +34 -0
- package/src/components/PinInput/StyledPinInput.tsx +88 -0
- package/src/components/PinInput/__tests__/PinCell.spec.tsx +48 -0
- package/src/components/PinInput/__tests__/StyledPinInput.spec.tsx +22 -0
- package/src/components/PinInput/__tests__/__snapshots__/PinCell.spec.tsx.snap +186 -0
- package/src/components/PinInput/__tests__/__snapshots__/StyledPinInput.spec.tsx.snap +58 -0
- package/src/components/PinInput/__tests__/__snapshots__/index.spec.tsx.snap +1028 -0
- package/src/components/PinInput/__tests__/index.spec.tsx +91 -0
- package/src/components/PinInput/index.tsx +173 -0
- package/src/components/Select/MultiSelect/Option.tsx +1 -1
- package/src/components/Select/MultiSelect/OptionList.tsx +48 -26
- package/src/components/Select/MultiSelect/__tests__/OptionList.spec.tsx +13 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +1062 -556
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +983 -889
- package/src/components/Select/MultiSelect/index.tsx +59 -31
- package/src/components/Select/SingleSelect/OptionList.tsx +45 -26
- package/src/components/Select/SingleSelect/__tests__/OptionList.spec.tsx +8 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +992 -500
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +880 -786
- package/src/components/Select/SingleSelect/index.tsx +60 -31
- package/src/components/Select/StyledOptionList.tsx +88 -0
- package/src/components/Select/StyledSelect.tsx +18 -16
- package/src/components/Select/__tests__/StyledSelect.spec.tsx +1 -14
- package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +0 -13
- package/src/components/Select/types.tsx +47 -0
- package/src/components/TextInput/__tests__/index.spec.tsx +15 -0
- package/src/components/TextInput/index.tsx +20 -16
- package/src/components/TimePicker/StyledTimePicker.tsx +8 -0
- package/src/components/TimePicker/TimePickerAndroid.tsx +61 -0
- package/src/components/TimePicker/TimePickerIOS.tsx +91 -0
- package/src/components/TimePicker/__tests__/TimePicker.spec.tsx +34 -0
- package/src/components/TimePicker/__tests__/TimePickerAndroid.spec.tsx +39 -0
- package/src/components/TimePicker/__tests__/TimePickerIOS.spec.tsx +46 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +200 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +513 -0
- package/src/components/TimePicker/index.tsx +15 -0
- package/src/components/TimePicker/types.ts +50 -0
- package/src/components/Typography/Text/StyledText.tsx +1 -1
- package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
- package/src/components/Typography/Text/index.tsx +1 -1
- package/src/index.ts +4 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +44 -0
- package/src/theme/components/pinInput.ts +45 -0
- package/src/theme/components/select.ts +4 -0
- package/src/theme/components/timePicker.ts +11 -0
- package/src/theme/components/typography.ts +2 -0
- package/src/theme/global/colors.ts +1 -1
- package/src/theme/global/space.ts +10 -10
- package/src/theme/index.ts +9 -3
- package/testUtils/setup.tsx +10 -0
- package/types/components/ContentNavigator/index.d.ts +5 -1
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/components/PinInput/PinCell.d.ts +8 -0
- package/types/components/PinInput/StyledPinInput.d.ts +73 -0
- package/types/components/PinInput/__tests__/PinCell.spec.d.ts +1 -0
- package/types/components/PinInput/__tests__/StyledPinInput.spec.d.ts +1 -0
- package/types/components/PinInput/__tests__/index.spec.d.ts +1 -0
- package/types/components/PinInput/index.d.ts +48 -0
- package/types/components/Select/MultiSelect/OptionList.d.ts +1 -1
- package/types/components/Select/MultiSelect/index.d.ts +3 -25
- package/types/components/Select/SingleSelect/OptionList.d.ts +1 -1
- package/types/components/Select/SingleSelect/index.d.ts +4 -26
- package/types/components/Select/StyledOptionList.d.ts +17 -0
- package/types/components/Select/StyledSelect.d.ts +7 -7
- package/types/components/Select/index.d.ts +1 -1
- package/types/components/Select/types.d.ts +44 -0
- package/types/components/TimePicker/StyledTimePicker.d.ts +8 -0
- package/types/components/TimePicker/TimePickerAndroid.d.ts +3 -0
- package/types/components/TimePicker/TimePickerIOS.d.ts +3 -0
- package/types/components/TimePicker/__tests__/TimePicker.spec.d.ts +1 -0
- package/types/components/TimePicker/__tests__/TimePickerAndroid.spec.d.ts +1 -0
- package/types/components/TimePicker/__tests__/TimePickerIOS.spec.d.ts +1 -0
- package/types/components/TimePicker/index.d.ts +3 -0
- package/types/components/TimePicker/types.d.ts +49 -0
- package/types/components/Typography/Text/StyledText.d.ts +1 -1
- package/types/components/Typography/Text/index.d.ts +1 -1
- package/types/index.d.ts +3 -1
- package/types/theme/components/pinInput.d.ts +35 -0
- package/types/theme/components/select.d.ts +4 -0
- package/types/theme/components/timePicker.d.ts +6 -0
- package/types/theme/components/typography.d.ts +2 -0
- package/types/theme/index.d.ts +6 -2
- package/src/components/Select/types.ts +0 -1
- package/src/components/TextInput/__tests__/.log/ti-10343.log +0 -62
- package/src/components/TextInput/__tests__/.log/tsserver.log +0 -15584
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`TimePickerIOS renders correctly 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
accessible={true}
|
|
6
|
+
focusable={true}
|
|
7
|
+
onClick={[Function]}
|
|
8
|
+
onResponderGrant={[Function]}
|
|
9
|
+
onResponderMove={[Function]}
|
|
10
|
+
onResponderRelease={[Function]}
|
|
11
|
+
onResponderTerminate={[Function]}
|
|
12
|
+
onResponderTerminationRequest={[Function]}
|
|
13
|
+
onStartShouldSetResponder={[Function]}
|
|
14
|
+
style={
|
|
15
|
+
Object {
|
|
16
|
+
"opacity": 1,
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
>
|
|
20
|
+
<View
|
|
21
|
+
pointerEvents="none"
|
|
22
|
+
testID="timePickerInputIOS"
|
|
23
|
+
>
|
|
24
|
+
<View
|
|
25
|
+
pointerEvents="auto"
|
|
26
|
+
style={
|
|
27
|
+
Array [
|
|
28
|
+
Object {
|
|
29
|
+
"marginVertical": 8,
|
|
30
|
+
"width": "100%",
|
|
31
|
+
},
|
|
32
|
+
undefined,
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
>
|
|
36
|
+
<View
|
|
37
|
+
style={
|
|
38
|
+
Array [
|
|
39
|
+
Object {
|
|
40
|
+
"alignItems": "center",
|
|
41
|
+
"flexDirection": "row",
|
|
42
|
+
"padding": 16,
|
|
43
|
+
},
|
|
44
|
+
undefined,
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
>
|
|
48
|
+
<View
|
|
49
|
+
style={
|
|
50
|
+
Array [
|
|
51
|
+
Object {
|
|
52
|
+
"borderColor": "#292a2b",
|
|
53
|
+
"borderRadius": 8,
|
|
54
|
+
"borderWidth": 1,
|
|
55
|
+
"bottom": 0,
|
|
56
|
+
"left": 0,
|
|
57
|
+
"position": "absolute",
|
|
58
|
+
"right": 0,
|
|
59
|
+
"top": 0,
|
|
60
|
+
},
|
|
61
|
+
undefined,
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
themeVariant="filled"
|
|
65
|
+
/>
|
|
66
|
+
<View
|
|
67
|
+
pointerEvents="none"
|
|
68
|
+
style={
|
|
69
|
+
Array [
|
|
70
|
+
Object {
|
|
71
|
+
"backgroundColor": "#ffffff",
|
|
72
|
+
"flexDirection": "row",
|
|
73
|
+
"left": 16,
|
|
74
|
+
"paddingHorizontal": 4,
|
|
75
|
+
"position": "absolute",
|
|
76
|
+
"top": -10,
|
|
77
|
+
"zIndex": 1,
|
|
78
|
+
},
|
|
79
|
+
undefined,
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
>
|
|
83
|
+
<Text
|
|
84
|
+
style={
|
|
85
|
+
Array [
|
|
86
|
+
Object {
|
|
87
|
+
"color": "#292a2b",
|
|
88
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
89
|
+
"fontSize": 12,
|
|
90
|
+
"letterSpacing": 0.36,
|
|
91
|
+
"lineHeight": 20,
|
|
92
|
+
},
|
|
93
|
+
Array [
|
|
94
|
+
Object {
|
|
95
|
+
"color": "#292a2b",
|
|
96
|
+
},
|
|
97
|
+
undefined,
|
|
98
|
+
],
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
testID="input-label"
|
|
102
|
+
themeFontSize="small"
|
|
103
|
+
themeFontWeight="regular"
|
|
104
|
+
themeIntent="body"
|
|
105
|
+
themeVariant="filled"
|
|
106
|
+
>
|
|
107
|
+
Break time
|
|
108
|
+
</Text>
|
|
109
|
+
</View>
|
|
110
|
+
<View
|
|
111
|
+
style={
|
|
112
|
+
Array [
|
|
113
|
+
Object {
|
|
114
|
+
"alignItems": "center",
|
|
115
|
+
"alignSelf": "stretch",
|
|
116
|
+
"flexDirection": "row",
|
|
117
|
+
"flexGrow": 2,
|
|
118
|
+
},
|
|
119
|
+
undefined,
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
>
|
|
123
|
+
<TextInput
|
|
124
|
+
accessibilityState={
|
|
125
|
+
Object {
|
|
126
|
+
"disabled": false,
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
editable={true}
|
|
130
|
+
onBlur={[Function]}
|
|
131
|
+
onChangeText={[Function]}
|
|
132
|
+
onFocus={[Function]}
|
|
133
|
+
style={
|
|
134
|
+
Array [
|
|
135
|
+
Object {
|
|
136
|
+
"alignSelf": "stretch",
|
|
137
|
+
"flexGrow": 2,
|
|
138
|
+
"fontSize": 14,
|
|
139
|
+
"marginHorizontal": 8,
|
|
140
|
+
"textAlignVertical": "center",
|
|
141
|
+
},
|
|
142
|
+
Object {
|
|
143
|
+
"color": "#292a2b",
|
|
144
|
+
},
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
testID="text-input"
|
|
148
|
+
value="03:24 AM"
|
|
149
|
+
/>
|
|
150
|
+
</View>
|
|
151
|
+
<HeroIcon
|
|
152
|
+
name="clock-3"
|
|
153
|
+
style={
|
|
154
|
+
Array [
|
|
155
|
+
Object {
|
|
156
|
+
"color": "#292a2b",
|
|
157
|
+
"fontSize": 16,
|
|
158
|
+
},
|
|
159
|
+
undefined,
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
testID="input-suffix"
|
|
163
|
+
themeIntent="text"
|
|
164
|
+
themeSize="xsmall"
|
|
165
|
+
/>
|
|
166
|
+
</View>
|
|
167
|
+
<View
|
|
168
|
+
style={
|
|
169
|
+
Array [
|
|
170
|
+
Object {
|
|
171
|
+
"paddingLeft": 16,
|
|
172
|
+
},
|
|
173
|
+
undefined,
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
>
|
|
177
|
+
<View
|
|
178
|
+
style={
|
|
179
|
+
Array [
|
|
180
|
+
Object {
|
|
181
|
+
"flexDirection": "row",
|
|
182
|
+
"justifyContent": "space-between",
|
|
183
|
+
},
|
|
184
|
+
undefined,
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
/>
|
|
188
|
+
</View>
|
|
189
|
+
</View>
|
|
190
|
+
</View>
|
|
191
|
+
<RCTModalHostView
|
|
192
|
+
animationType="none"
|
|
193
|
+
hardwareAccelerated={false}
|
|
194
|
+
identifier={0}
|
|
195
|
+
onRequestClose={[Function]}
|
|
196
|
+
onStartShouldSetResponder={[Function]}
|
|
197
|
+
presentationStyle="overFullScreen"
|
|
198
|
+
style={
|
|
199
|
+
Object {
|
|
200
|
+
"position": "absolute",
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
transparent={true}
|
|
204
|
+
>
|
|
205
|
+
<View
|
|
206
|
+
collapsable={false}
|
|
207
|
+
style={
|
|
208
|
+
Array [
|
|
209
|
+
Object {
|
|
210
|
+
"flex": 1,
|
|
211
|
+
"left": 0,
|
|
212
|
+
"top": 0,
|
|
213
|
+
},
|
|
214
|
+
Object {
|
|
215
|
+
"backgroundColor": "transparent",
|
|
216
|
+
},
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
>
|
|
220
|
+
<View
|
|
221
|
+
pointerEvents="box-none"
|
|
222
|
+
style={
|
|
223
|
+
Object {
|
|
224
|
+
"flex": 1,
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
>
|
|
228
|
+
<View
|
|
229
|
+
collapsable={true}
|
|
230
|
+
pointerEvents="box-none"
|
|
231
|
+
style={
|
|
232
|
+
Object {
|
|
233
|
+
"flex": 1,
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
>
|
|
237
|
+
<View
|
|
238
|
+
pointerEvents="box-none"
|
|
239
|
+
style={
|
|
240
|
+
Array [
|
|
241
|
+
Object {
|
|
242
|
+
"bottom": 0,
|
|
243
|
+
"flexDirection": "column-reverse",
|
|
244
|
+
"left": 0,
|
|
245
|
+
"position": "absolute",
|
|
246
|
+
"right": 0,
|
|
247
|
+
"top": 0,
|
|
248
|
+
},
|
|
249
|
+
undefined,
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
>
|
|
253
|
+
<View
|
|
254
|
+
accessible={true}
|
|
255
|
+
collapsable={false}
|
|
256
|
+
focusable={true}
|
|
257
|
+
nativeID="animatedComponent"
|
|
258
|
+
onBlur={[Function]}
|
|
259
|
+
onClick={[Function]}
|
|
260
|
+
onFocus={[Function]}
|
|
261
|
+
onResponderGrant={[Function]}
|
|
262
|
+
onResponderMove={[Function]}
|
|
263
|
+
onResponderRelease={[Function]}
|
|
264
|
+
onResponderTerminate={[Function]}
|
|
265
|
+
onResponderTerminationRequest={[Function]}
|
|
266
|
+
onStartShouldSetResponder={[Function]}
|
|
267
|
+
style={
|
|
268
|
+
Object {
|
|
269
|
+
"backgroundColor": "#292a2b",
|
|
270
|
+
"bottom": 0,
|
|
271
|
+
"left": 0,
|
|
272
|
+
"opacity": 0.48,
|
|
273
|
+
"position": "absolute",
|
|
274
|
+
"right": 0,
|
|
275
|
+
"top": 0,
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/>
|
|
279
|
+
<View
|
|
280
|
+
collapsable={false}
|
|
281
|
+
nativeID="animatedComponent"
|
|
282
|
+
onLayout={[Function]}
|
|
283
|
+
style={
|
|
284
|
+
Object {
|
|
285
|
+
"backgroundColor": "#ffffff",
|
|
286
|
+
"borderTopLeftRadius": 16,
|
|
287
|
+
"borderTopRightRadius": 16,
|
|
288
|
+
"elevation": 10,
|
|
289
|
+
"maxHeight": "94%",
|
|
290
|
+
"shadowColor": "#292a2b",
|
|
291
|
+
"shadowOffset": Object {
|
|
292
|
+
"height": 3,
|
|
293
|
+
"width": 0,
|
|
294
|
+
},
|
|
295
|
+
"shadowOpacity": 0.27,
|
|
296
|
+
"shadowRadius": 4.65,
|
|
297
|
+
"transform": Array [
|
|
298
|
+
Object {
|
|
299
|
+
"scaleY": 0,
|
|
300
|
+
},
|
|
301
|
+
Object {
|
|
302
|
+
"translateY": 0,
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
"width": "100%",
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
>
|
|
309
|
+
<View
|
|
310
|
+
style={
|
|
311
|
+
Array [
|
|
312
|
+
Object {
|
|
313
|
+
"flexDirection": "row",
|
|
314
|
+
"minHeight": 64,
|
|
315
|
+
},
|
|
316
|
+
undefined,
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
>
|
|
320
|
+
<View
|
|
321
|
+
adjacentIcon={true}
|
|
322
|
+
style={
|
|
323
|
+
Array [
|
|
324
|
+
Object {
|
|
325
|
+
"flex": 1,
|
|
326
|
+
"justifyContent": "center",
|
|
327
|
+
"paddingLeft": 24,
|
|
328
|
+
"paddingRight": 0,
|
|
329
|
+
"paddingVertical": 8,
|
|
330
|
+
},
|
|
331
|
+
undefined,
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
>
|
|
335
|
+
<Text
|
|
336
|
+
style={
|
|
337
|
+
Array [
|
|
338
|
+
Object {
|
|
339
|
+
"color": "#292a2b",
|
|
340
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
341
|
+
"fontSize": 16,
|
|
342
|
+
"letterSpacing": 0.48,
|
|
343
|
+
"lineHeight": 24,
|
|
344
|
+
},
|
|
345
|
+
undefined,
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
themeFontSize="large"
|
|
349
|
+
themeFontWeight="semi-bold"
|
|
350
|
+
themeIntent="body"
|
|
351
|
+
>
|
|
352
|
+
Break time
|
|
353
|
+
</Text>
|
|
354
|
+
</View>
|
|
355
|
+
<View
|
|
356
|
+
style={
|
|
357
|
+
Array [
|
|
358
|
+
Object {
|
|
359
|
+
"alignItems": "center",
|
|
360
|
+
"justifyContent": "center",
|
|
361
|
+
"width": 72,
|
|
362
|
+
},
|
|
363
|
+
undefined,
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
>
|
|
367
|
+
<View
|
|
368
|
+
accessible={true}
|
|
369
|
+
collapsable={false}
|
|
370
|
+
focusable={true}
|
|
371
|
+
nativeID="animatedComponent"
|
|
372
|
+
onClick={[Function]}
|
|
373
|
+
onResponderGrant={[Function]}
|
|
374
|
+
onResponderMove={[Function]}
|
|
375
|
+
onResponderRelease={[Function]}
|
|
376
|
+
onResponderTerminate={[Function]}
|
|
377
|
+
onResponderTerminationRequest={[Function]}
|
|
378
|
+
onStartShouldSetResponder={[Function]}
|
|
379
|
+
style={
|
|
380
|
+
Object {
|
|
381
|
+
"opacity": 1,
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
testID="bottom-sheet-close-icon"
|
|
385
|
+
>
|
|
386
|
+
<HeroIcon
|
|
387
|
+
name="cancel"
|
|
388
|
+
style={
|
|
389
|
+
Array [
|
|
390
|
+
Object {
|
|
391
|
+
"color": "#292a2b",
|
|
392
|
+
"fontSize": 24,
|
|
393
|
+
},
|
|
394
|
+
undefined,
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
themeIntent="text"
|
|
398
|
+
themeSize="medium"
|
|
399
|
+
/>
|
|
400
|
+
</View>
|
|
401
|
+
</View>
|
|
402
|
+
</View>
|
|
403
|
+
<View
|
|
404
|
+
style={
|
|
405
|
+
Array [
|
|
406
|
+
Object {
|
|
407
|
+
"borderBottomColor": "#dadbde",
|
|
408
|
+
"borderBottomWidth": 1,
|
|
409
|
+
"maxWidth": "100%",
|
|
410
|
+
},
|
|
411
|
+
undefined,
|
|
412
|
+
]
|
|
413
|
+
}
|
|
414
|
+
/>
|
|
415
|
+
<View
|
|
416
|
+
style={
|
|
417
|
+
Array [
|
|
418
|
+
Object {
|
|
419
|
+
"height": 176,
|
|
420
|
+
},
|
|
421
|
+
undefined,
|
|
422
|
+
]
|
|
423
|
+
}
|
|
424
|
+
>
|
|
425
|
+
<Picker
|
|
426
|
+
display="spinner"
|
|
427
|
+
mode="time"
|
|
428
|
+
onChange={[Function]}
|
|
429
|
+
style={
|
|
430
|
+
Object {
|
|
431
|
+
"flex": 1,
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
testID="timePickerIOS"
|
|
435
|
+
value={1995-12-17T03:24:00.000Z}
|
|
436
|
+
/>
|
|
437
|
+
</View>
|
|
438
|
+
<View>
|
|
439
|
+
<View
|
|
440
|
+
style={
|
|
441
|
+
Array [
|
|
442
|
+
Object {
|
|
443
|
+
"borderBottomColor": "#dadbde",
|
|
444
|
+
"borderBottomWidth": 1,
|
|
445
|
+
"maxWidth": "100%",
|
|
446
|
+
},
|
|
447
|
+
undefined,
|
|
448
|
+
]
|
|
449
|
+
}
|
|
450
|
+
/>
|
|
451
|
+
<View
|
|
452
|
+
style={
|
|
453
|
+
Array [
|
|
454
|
+
Object {
|
|
455
|
+
"alignItems": "center",
|
|
456
|
+
"flexDirection": "row",
|
|
457
|
+
"justifyContent": "flex-end",
|
|
458
|
+
"minHeight": 64,
|
|
459
|
+
"paddingHorizontal": 24,
|
|
460
|
+
"paddingVertical": 8,
|
|
461
|
+
},
|
|
462
|
+
undefined,
|
|
463
|
+
]
|
|
464
|
+
}
|
|
465
|
+
>
|
|
466
|
+
<View
|
|
467
|
+
accessible={true}
|
|
468
|
+
collapsable={false}
|
|
469
|
+
focusable={true}
|
|
470
|
+
nativeID="animatedComponent"
|
|
471
|
+
onClick={[Function]}
|
|
472
|
+
onResponderGrant={[Function]}
|
|
473
|
+
onResponderMove={[Function]}
|
|
474
|
+
onResponderRelease={[Function]}
|
|
475
|
+
onResponderTerminate={[Function]}
|
|
476
|
+
onResponderTerminationRequest={[Function]}
|
|
477
|
+
onStartShouldSetResponder={[Function]}
|
|
478
|
+
style={
|
|
479
|
+
Object {
|
|
480
|
+
"opacity": 1,
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
>
|
|
484
|
+
<Text
|
|
485
|
+
style={
|
|
486
|
+
Array [
|
|
487
|
+
Object {
|
|
488
|
+
"color": "#7622d7",
|
|
489
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
490
|
+
"fontSize": 16,
|
|
491
|
+
"letterSpacing": 0.48,
|
|
492
|
+
"lineHeight": 24,
|
|
493
|
+
},
|
|
494
|
+
undefined,
|
|
495
|
+
]
|
|
496
|
+
}
|
|
497
|
+
themeFontSize="large"
|
|
498
|
+
themeFontWeight="semi-bold"
|
|
499
|
+
themeIntent="primary"
|
|
500
|
+
>
|
|
501
|
+
Confirm
|
|
502
|
+
</Text>
|
|
503
|
+
</View>
|
|
504
|
+
</View>
|
|
505
|
+
</View>
|
|
506
|
+
</View>
|
|
507
|
+
</View>
|
|
508
|
+
</View>
|
|
509
|
+
</View>
|
|
510
|
+
</View>
|
|
511
|
+
</RCTModalHostView>
|
|
512
|
+
</View>
|
|
513
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import TimePickerAndroid from './TimePickerAndroid';
|
|
4
|
+
import TimePickerIOS from './TimePickerIOS';
|
|
5
|
+
import { TimePickerProps } from './types';
|
|
6
|
+
|
|
7
|
+
const TimePicker = (props: TimePickerProps) => {
|
|
8
|
+
if (Platform.OS === 'ios') {
|
|
9
|
+
return <TimePickerIOS {...props} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return <TimePickerAndroid {...props} />;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default TimePicker;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface TimePickerProps {
|
|
4
|
+
/**
|
|
5
|
+
* Time picker input label.
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* Current time value. Must be in correct default format or format provided via format prop.
|
|
10
|
+
*/
|
|
11
|
+
value: Date | null;
|
|
12
|
+
/**
|
|
13
|
+
* Input placeholder. Time format will be used as placeholder if not specified.
|
|
14
|
+
*/
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Callback that is called when new value is selected.
|
|
18
|
+
*/
|
|
19
|
+
onChange: (value: Date) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Confirm label text. iOS only.
|
|
22
|
+
*/
|
|
23
|
+
confirmLabel: string;
|
|
24
|
+
/**
|
|
25
|
+
* Time display format of current value presented on the input. Default format is: HH:mm aa.
|
|
26
|
+
* Following date-fns's format (https://date-fns.org/v2.16.1/docs/format).
|
|
27
|
+
* This also change how the time picker display between 24 hour and 12 hour mode.
|
|
28
|
+
*/
|
|
29
|
+
displayFormat?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the Time picker is disabled.
|
|
32
|
+
*/
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Error message to display.
|
|
36
|
+
*/
|
|
37
|
+
error?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the value is required, if true, an asterisk will be appended to the label.
|
|
40
|
+
*/
|
|
41
|
+
required?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Addtional style.
|
|
44
|
+
*/
|
|
45
|
+
style?: StyleProp<ViewStyle>;
|
|
46
|
+
/**
|
|
47
|
+
* Testing id of the component..
|
|
48
|
+
*/
|
|
49
|
+
testID?: string;
|
|
50
|
+
}
|
|
@@ -8,7 +8,7 @@ const FONTWEIGHT_MAP = {
|
|
|
8
8
|
} as const;
|
|
9
9
|
|
|
10
10
|
const StyledText = styled(Text)<{
|
|
11
|
-
themeFontSize: 'small' | 'medium' | 'large' | 'xlarge';
|
|
11
|
+
themeFontSize: 'small' | 'medium' | 'large' | 'xlarge' | 'xxxxxlarge';
|
|
12
12
|
themeFontWeight: 'light' | 'regular' | 'semi-bold';
|
|
13
13
|
themeIntent:
|
|
14
14
|
| 'body'
|
|
@@ -307,3 +307,25 @@ exports[`StyledText has xlarge fontSize style 1`] = `
|
|
|
307
307
|
This is a test
|
|
308
308
|
</Text>
|
|
309
309
|
`;
|
|
310
|
+
|
|
311
|
+
exports[`StyledText has xxxxxlarge fontSize style 1`] = `
|
|
312
|
+
<Text
|
|
313
|
+
style={
|
|
314
|
+
Array [
|
|
315
|
+
Object {
|
|
316
|
+
"color": "#292a2b",
|
|
317
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
318
|
+
"fontSize": 32,
|
|
319
|
+
"letterSpacing": 0.96,
|
|
320
|
+
"lineHeight": 40,
|
|
321
|
+
},
|
|
322
|
+
undefined,
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
themeFontSize="xxxxxlarge"
|
|
326
|
+
themeFontWeight="regular"
|
|
327
|
+
themeIntent="body"
|
|
328
|
+
>
|
|
329
|
+
This is a test
|
|
330
|
+
</Text>
|
|
331
|
+
`;
|
package/src/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ import Drawer from './components/Drawer';
|
|
|
16
16
|
import FAB from './components/FAB';
|
|
17
17
|
import Icon from './components/Icon';
|
|
18
18
|
import List from './components/List';
|
|
19
|
+
import PinInput from './components/PinInput';
|
|
19
20
|
import Progress from './components/Progress';
|
|
20
21
|
import Spinner from './components/Spinner';
|
|
21
22
|
import Radio from './components/Radio';
|
|
@@ -25,6 +26,7 @@ import Switch from './components/Switch';
|
|
|
25
26
|
import Tabs from './components/Tabs';
|
|
26
27
|
import Tag from './components/Tag';
|
|
27
28
|
import TextInput from './components/TextInput';
|
|
29
|
+
import TimePicker from './components/TimePicker';
|
|
28
30
|
import Toast from './components/Toast';
|
|
29
31
|
import Toolbar from './components/Toolbar';
|
|
30
32
|
import Typography from './components/Typography';
|
|
@@ -50,6 +52,7 @@ export {
|
|
|
50
52
|
FAB,
|
|
51
53
|
Icon,
|
|
52
54
|
List,
|
|
55
|
+
PinInput,
|
|
53
56
|
Progress,
|
|
54
57
|
Spinner,
|
|
55
58
|
Radio,
|
|
@@ -59,6 +62,7 @@ export {
|
|
|
59
62
|
Tabs,
|
|
60
63
|
Tag,
|
|
61
64
|
TextInput,
|
|
65
|
+
TimePicker,
|
|
62
66
|
Toast,
|
|
63
67
|
Toolbar,
|
|
64
68
|
Typography,
|