@hero-design/rn 8.20.0 → 8.21.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.
Files changed (44) hide show
  1. package/.turbo/turbo-build.log +9 -9
  2. package/es/index.js +190 -60
  3. package/lib/index.js +190 -60
  4. package/package.json +5 -5
  5. package/src/components/Button/Button.tsx +1 -1
  6. package/src/components/Button/StyledButton.tsx +0 -3
  7. package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +0 -10
  8. package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +0 -16
  9. package/src/components/Calendar/index.tsx +7 -2
  10. package/src/components/Carousel/StyledCarousel.tsx +11 -3
  11. package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +791 -6
  12. package/src/components/Carousel/__tests__/index.spec.tsx +41 -31
  13. package/src/components/Carousel/index.tsx +39 -7
  14. package/src/components/DatePicker/DatePickerAndroid.tsx +1 -1
  15. package/src/components/DatePicker/DatePickerCalendar.tsx +110 -0
  16. package/src/components/DatePicker/DatePickerIOS.tsx +1 -1
  17. package/src/components/DatePicker/__tests__/DatePicker.spec.tsx +27 -8
  18. package/src/components/DatePicker/__tests__/DatePickerCalendar.spec.tsx +61 -0
  19. package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +670 -0
  20. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +220 -0
  21. package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +0 -1
  22. package/src/components/DatePicker/index.tsx +5 -1
  23. package/src/components/DatePicker/types.ts +7 -1
  24. package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +0 -3
  25. package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +0 -1
  26. package/src/components/TimePicker/types.ts +1 -1
  27. package/src/components/Toast/Toast.tsx +3 -1
  28. package/src/components/Toast/types.ts +4 -0
  29. package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +2 -3
  30. package/src/theme/components/button.ts +0 -5
  31. package/src/theme/components/carousel.ts +3 -0
  32. package/types/components/Calendar/index.d.ts +6 -2
  33. package/types/components/Carousel/StyledCarousel.d.ts +7 -1
  34. package/types/components/Carousel/index.d.ts +7 -1
  35. package/types/components/DatePicker/DatePickerAndroid.d.ts +1 -1
  36. package/types/components/DatePicker/DatePickerCalendar.d.ts +3 -0
  37. package/types/components/DatePicker/DatePickerIOS.d.ts +1 -1
  38. package/types/components/DatePicker/index.d.ts +1 -1
  39. package/types/components/DatePicker/types.d.ts +7 -1
  40. package/types/components/TimePicker/types.d.ts +1 -1
  41. package/types/components/Toast/Toast.d.ts +1 -1
  42. package/types/components/Toast/types.d.ts +4 -0
  43. package/types/theme/components/button.d.ts +0 -3
  44. package/types/theme/components/carousel.d.ts +2 -0
@@ -0,0 +1,670 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`DatePicker renders DatePickerAndroid when OS is android 1`] = `
4
+ <View
5
+ accessibilityState={
6
+ Object {
7
+ "disabled": false,
8
+ }
9
+ }
10
+ accessible={true}
11
+ collapsable={false}
12
+ focusable={true}
13
+ onClick={[Function]}
14
+ onResponderGrant={[Function]}
15
+ onResponderMove={[Function]}
16
+ onResponderRelease={[Function]}
17
+ onResponderTerminate={[Function]}
18
+ onResponderTerminationRequest={[Function]}
19
+ onStartShouldSetResponder={[Function]}
20
+ style={
21
+ Object {
22
+ "opacity": 1,
23
+ }
24
+ }
25
+ >
26
+ <View
27
+ pointerEvents="none"
28
+ testID="datePickerInputAndroid"
29
+ >
30
+ <View
31
+ pointerEvents="auto"
32
+ style={
33
+ Array [
34
+ Object {
35
+ "marginTop": 8,
36
+ "width": "100%",
37
+ },
38
+ undefined,
39
+ ]
40
+ }
41
+ >
42
+ <View
43
+ style={
44
+ Array [
45
+ Object {
46
+ "alignItems": "center",
47
+ "backgroundColor": "#ffffff",
48
+ "borderRadius": 8,
49
+ "flexDirection": "row",
50
+ "padding": 16,
51
+ },
52
+ undefined,
53
+ ]
54
+ }
55
+ >
56
+ <View
57
+ style={
58
+ Array [
59
+ Object {
60
+ "borderColor": "#001f23",
61
+ "borderRadius": 8,
62
+ "borderWidth": 1,
63
+ "bottom": 0,
64
+ "left": 0,
65
+ "position": "absolute",
66
+ "right": 0,
67
+ "top": 0,
68
+ },
69
+ Array [
70
+ Object {
71
+ "backgroundColor": "#ffffff",
72
+ },
73
+ undefined,
74
+ ],
75
+ ]
76
+ }
77
+ testID="text-input-border"
78
+ themeFocused={false}
79
+ themeVariant="filled"
80
+ />
81
+ <View
82
+ pointerEvents="none"
83
+ style={
84
+ Array [
85
+ Object {
86
+ "backgroundColor": "#ffffff",
87
+ "flexDirection": "row",
88
+ "left": 16,
89
+ "paddingHorizontal": 4,
90
+ "position": "absolute",
91
+ "top": -10,
92
+ "zIndex": 1,
93
+ },
94
+ Object {
95
+ "backgroundColor": "#ffffff",
96
+ },
97
+ ]
98
+ }
99
+ testID="label-container"
100
+ >
101
+ <Text
102
+ allowFontScaling={false}
103
+ style={
104
+ Array [
105
+ Object {
106
+ "color": "#001f23",
107
+ "fontFamily": "BeVietnamPro-Regular",
108
+ "fontSize": 12,
109
+ "letterSpacing": 0.36,
110
+ "lineHeight": 20,
111
+ },
112
+ Array [
113
+ Object {
114
+ "color": "#001f23",
115
+ },
116
+ Object {
117
+ "backgroundColor": "#ffffff",
118
+ },
119
+ ],
120
+ ]
121
+ }
122
+ testID="input-label"
123
+ themeFontSize="small"
124
+ themeFontWeight="regular"
125
+ themeIntent="body"
126
+ themeTypeface="neutral"
127
+ themeVariant="filled"
128
+ >
129
+ Start date
130
+ </Text>
131
+ </View>
132
+ <View
133
+ style={
134
+ Array [
135
+ Object {
136
+ "alignItems": "center",
137
+ "alignSelf": "stretch",
138
+ "flexDirection": "row",
139
+ "flexGrow": 2,
140
+ "flexShrink": 1,
141
+ },
142
+ undefined,
143
+ ]
144
+ }
145
+ >
146
+ <TextInput
147
+ accessibilityState={
148
+ Object {
149
+ "disabled": false,
150
+ }
151
+ }
152
+ allowFontScaling={false}
153
+ editable={true}
154
+ onBlur={[Function]}
155
+ onChangeText={[Function]}
156
+ onFocus={[Function]}
157
+ placeholder=" "
158
+ style={
159
+ Array [
160
+ Object {
161
+ "alignSelf": "stretch",
162
+ "flexGrow": 2,
163
+ "fontSize": 14,
164
+ "marginHorizontal": 8,
165
+ "paddingVertical": 0,
166
+ "textAlignVertical": "center",
167
+ },
168
+ Object {
169
+ "backgroundColor": "#ffffff",
170
+ "color": "#001f23",
171
+ },
172
+ ]
173
+ }
174
+ testID="text-input"
175
+ value="17/12/1995"
176
+ />
177
+ </View>
178
+ <HeroIcon
179
+ name="calendar-dates-outlined"
180
+ style={
181
+ Array [
182
+ Object {
183
+ "color": "#001f23",
184
+ "fontSize": 16,
185
+ },
186
+ undefined,
187
+ ]
188
+ }
189
+ testID="input-suffix"
190
+ themeIntent="text"
191
+ themeSize="xsmall"
192
+ />
193
+ </View>
194
+ <View
195
+ style={
196
+ Array [
197
+ Object {
198
+ "minHeight": 16,
199
+ "paddingLeft": 16,
200
+ },
201
+ undefined,
202
+ ]
203
+ }
204
+ >
205
+ <View
206
+ style={
207
+ Array [
208
+ Object {
209
+ "flexDirection": "row",
210
+ "justifyContent": "space-between",
211
+ },
212
+ undefined,
213
+ ]
214
+ }
215
+ />
216
+ </View>
217
+ </View>
218
+ </View>
219
+ </View>
220
+ `;
221
+
222
+ exports[`DatePicker renders DatePickerIOS when OS is iOS 1`] = `
223
+ <View
224
+ accessibilityState={
225
+ Object {
226
+ "disabled": false,
227
+ }
228
+ }
229
+ accessible={true}
230
+ collapsable={false}
231
+ focusable={true}
232
+ onClick={[Function]}
233
+ onResponderGrant={[Function]}
234
+ onResponderMove={[Function]}
235
+ onResponderRelease={[Function]}
236
+ onResponderTerminate={[Function]}
237
+ onResponderTerminationRequest={[Function]}
238
+ onStartShouldSetResponder={[Function]}
239
+ style={
240
+ Object {
241
+ "opacity": 1,
242
+ }
243
+ }
244
+ >
245
+ <View
246
+ pointerEvents="none"
247
+ testID="datePickerInputIOS"
248
+ >
249
+ <View
250
+ pointerEvents="auto"
251
+ style={
252
+ Array [
253
+ Object {
254
+ "marginTop": 8,
255
+ "width": "100%",
256
+ },
257
+ undefined,
258
+ ]
259
+ }
260
+ >
261
+ <View
262
+ style={
263
+ Array [
264
+ Object {
265
+ "alignItems": "center",
266
+ "backgroundColor": "#ffffff",
267
+ "borderRadius": 8,
268
+ "flexDirection": "row",
269
+ "padding": 16,
270
+ },
271
+ undefined,
272
+ ]
273
+ }
274
+ >
275
+ <View
276
+ style={
277
+ Array [
278
+ Object {
279
+ "borderColor": "#001f23",
280
+ "borderRadius": 8,
281
+ "borderWidth": 1,
282
+ "bottom": 0,
283
+ "left": 0,
284
+ "position": "absolute",
285
+ "right": 0,
286
+ "top": 0,
287
+ },
288
+ Array [
289
+ Object {
290
+ "backgroundColor": "#ffffff",
291
+ },
292
+ undefined,
293
+ ],
294
+ ]
295
+ }
296
+ testID="text-input-border"
297
+ themeFocused={false}
298
+ themeVariant="filled"
299
+ />
300
+ <View
301
+ pointerEvents="none"
302
+ style={
303
+ Array [
304
+ Object {
305
+ "backgroundColor": "#ffffff",
306
+ "flexDirection": "row",
307
+ "left": 16,
308
+ "paddingHorizontal": 4,
309
+ "position": "absolute",
310
+ "top": -10,
311
+ "zIndex": 1,
312
+ },
313
+ Object {
314
+ "backgroundColor": "#ffffff",
315
+ },
316
+ ]
317
+ }
318
+ testID="label-container"
319
+ >
320
+ <Text
321
+ allowFontScaling={false}
322
+ style={
323
+ Array [
324
+ Object {
325
+ "color": "#001f23",
326
+ "fontFamily": "BeVietnamPro-Regular",
327
+ "fontSize": 12,
328
+ "letterSpacing": 0.36,
329
+ "lineHeight": 20,
330
+ },
331
+ Array [
332
+ Object {
333
+ "color": "#001f23",
334
+ },
335
+ Object {
336
+ "backgroundColor": "#ffffff",
337
+ },
338
+ ],
339
+ ]
340
+ }
341
+ testID="input-label"
342
+ themeFontSize="small"
343
+ themeFontWeight="regular"
344
+ themeIntent="body"
345
+ themeTypeface="neutral"
346
+ themeVariant="filled"
347
+ >
348
+ Start date
349
+ </Text>
350
+ </View>
351
+ <View
352
+ style={
353
+ Array [
354
+ Object {
355
+ "alignItems": "center",
356
+ "alignSelf": "stretch",
357
+ "flexDirection": "row",
358
+ "flexGrow": 2,
359
+ "flexShrink": 1,
360
+ },
361
+ undefined,
362
+ ]
363
+ }
364
+ >
365
+ <TextInput
366
+ accessibilityState={
367
+ Object {
368
+ "disabled": false,
369
+ }
370
+ }
371
+ allowFontScaling={false}
372
+ editable={true}
373
+ onBlur={[Function]}
374
+ onChangeText={[Function]}
375
+ onFocus={[Function]}
376
+ placeholder=" "
377
+ style={
378
+ Array [
379
+ Object {
380
+ "alignSelf": "stretch",
381
+ "flexGrow": 2,
382
+ "fontSize": 14,
383
+ "marginHorizontal": 8,
384
+ "paddingVertical": 0,
385
+ "textAlignVertical": "center",
386
+ },
387
+ Object {
388
+ "backgroundColor": "#ffffff",
389
+ "color": "#001f23",
390
+ },
391
+ ]
392
+ }
393
+ testID="text-input"
394
+ value="17/12/1995"
395
+ />
396
+ </View>
397
+ <HeroIcon
398
+ name="calendar-dates-outlined"
399
+ style={
400
+ Array [
401
+ Object {
402
+ "color": "#001f23",
403
+ "fontSize": 16,
404
+ },
405
+ undefined,
406
+ ]
407
+ }
408
+ testID="input-suffix"
409
+ themeIntent="text"
410
+ themeSize="xsmall"
411
+ />
412
+ </View>
413
+ <View
414
+ style={
415
+ Array [
416
+ Object {
417
+ "minHeight": 16,
418
+ "paddingLeft": 16,
419
+ },
420
+ undefined,
421
+ ]
422
+ }
423
+ >
424
+ <View
425
+ style={
426
+ Array [
427
+ Object {
428
+ "flexDirection": "row",
429
+ "justifyContent": "space-between",
430
+ },
431
+ undefined,
432
+ ]
433
+ }
434
+ />
435
+ </View>
436
+ </View>
437
+ </View>
438
+ <Modal
439
+ hardwareAccelerated={false}
440
+ onRequestClose={[Function]}
441
+ transparent={true}
442
+ visible={false}
443
+ />
444
+ </View>
445
+ `;
446
+
447
+ exports[`DatePicker renders variant Calendar 1`] = `
448
+ <View
449
+ accessibilityState={
450
+ Object {
451
+ "disabled": false,
452
+ }
453
+ }
454
+ accessible={true}
455
+ collapsable={false}
456
+ focusable={true}
457
+ onClick={[Function]}
458
+ onResponderGrant={[Function]}
459
+ onResponderMove={[Function]}
460
+ onResponderRelease={[Function]}
461
+ onResponderTerminate={[Function]}
462
+ onResponderTerminationRequest={[Function]}
463
+ onStartShouldSetResponder={[Function]}
464
+ style={
465
+ Object {
466
+ "opacity": 1,
467
+ }
468
+ }
469
+ >
470
+ <View
471
+ pointerEvents="none"
472
+ testID="datePickerCalendar"
473
+ >
474
+ <View
475
+ pointerEvents="auto"
476
+ style={
477
+ Array [
478
+ Object {
479
+ "marginTop": 8,
480
+ "width": "100%",
481
+ },
482
+ undefined,
483
+ ]
484
+ }
485
+ >
486
+ <View
487
+ style={
488
+ Array [
489
+ Object {
490
+ "alignItems": "center",
491
+ "backgroundColor": "#ffffff",
492
+ "borderRadius": 8,
493
+ "flexDirection": "row",
494
+ "padding": 16,
495
+ },
496
+ undefined,
497
+ ]
498
+ }
499
+ >
500
+ <View
501
+ style={
502
+ Array [
503
+ Object {
504
+ "borderColor": "#001f23",
505
+ "borderRadius": 8,
506
+ "borderWidth": 1,
507
+ "bottom": 0,
508
+ "left": 0,
509
+ "position": "absolute",
510
+ "right": 0,
511
+ "top": 0,
512
+ },
513
+ Array [
514
+ Object {
515
+ "backgroundColor": "#ffffff",
516
+ },
517
+ undefined,
518
+ ],
519
+ ]
520
+ }
521
+ testID="text-input-border"
522
+ themeFocused={false}
523
+ themeVariant="filled"
524
+ />
525
+ <View
526
+ pointerEvents="none"
527
+ style={
528
+ Array [
529
+ Object {
530
+ "backgroundColor": "#ffffff",
531
+ "flexDirection": "row",
532
+ "left": 16,
533
+ "paddingHorizontal": 4,
534
+ "position": "absolute",
535
+ "top": -10,
536
+ "zIndex": 1,
537
+ },
538
+ Object {
539
+ "backgroundColor": "#ffffff",
540
+ },
541
+ ]
542
+ }
543
+ testID="label-container"
544
+ >
545
+ <Text
546
+ allowFontScaling={false}
547
+ style={
548
+ Array [
549
+ Object {
550
+ "color": "#001f23",
551
+ "fontFamily": "BeVietnamPro-Regular",
552
+ "fontSize": 12,
553
+ "letterSpacing": 0.36,
554
+ "lineHeight": 20,
555
+ },
556
+ Array [
557
+ Object {
558
+ "color": "#001f23",
559
+ },
560
+ Object {
561
+ "backgroundColor": "#ffffff",
562
+ },
563
+ ],
564
+ ]
565
+ }
566
+ testID="input-label"
567
+ themeFontSize="small"
568
+ themeFontWeight="regular"
569
+ themeIntent="body"
570
+ themeTypeface="neutral"
571
+ themeVariant="filled"
572
+ >
573
+ Start date
574
+ </Text>
575
+ </View>
576
+ <View
577
+ style={
578
+ Array [
579
+ Object {
580
+ "alignItems": "center",
581
+ "alignSelf": "stretch",
582
+ "flexDirection": "row",
583
+ "flexGrow": 2,
584
+ "flexShrink": 1,
585
+ },
586
+ undefined,
587
+ ]
588
+ }
589
+ >
590
+ <TextInput
591
+ accessibilityState={
592
+ Object {
593
+ "disabled": false,
594
+ }
595
+ }
596
+ allowFontScaling={false}
597
+ editable={true}
598
+ onBlur={[Function]}
599
+ onChangeText={[Function]}
600
+ onFocus={[Function]}
601
+ placeholder=" "
602
+ style={
603
+ Array [
604
+ Object {
605
+ "alignSelf": "stretch",
606
+ "flexGrow": 2,
607
+ "fontSize": 14,
608
+ "marginHorizontal": 8,
609
+ "paddingVertical": 0,
610
+ "textAlignVertical": "center",
611
+ },
612
+ Object {
613
+ "backgroundColor": "#ffffff",
614
+ "color": "#001f23",
615
+ },
616
+ ]
617
+ }
618
+ testID="text-input"
619
+ value="17/12/1995"
620
+ />
621
+ </View>
622
+ <HeroIcon
623
+ name="calendar-dates-outlined"
624
+ style={
625
+ Array [
626
+ Object {
627
+ "color": "#001f23",
628
+ "fontSize": 16,
629
+ },
630
+ undefined,
631
+ ]
632
+ }
633
+ testID="input-suffix"
634
+ themeIntent="text"
635
+ themeSize="xsmall"
636
+ />
637
+ </View>
638
+ <View
639
+ style={
640
+ Array [
641
+ Object {
642
+ "minHeight": 16,
643
+ "paddingLeft": 16,
644
+ },
645
+ undefined,
646
+ ]
647
+ }
648
+ >
649
+ <View
650
+ style={
651
+ Array [
652
+ Object {
653
+ "flexDirection": "row",
654
+ "justifyContent": "space-between",
655
+ },
656
+ undefined,
657
+ ]
658
+ }
659
+ />
660
+ </View>
661
+ </View>
662
+ </View>
663
+ <Modal
664
+ hardwareAccelerated={false}
665
+ onRequestClose={[Function]}
666
+ transparent={true}
667
+ visible={false}
668
+ />
669
+ </View>
670
+ `;