@terreno/ui 0.20.0 → 0.20.2
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/dist/Badge.js +5 -6
- package/dist/Badge.js.map +1 -1
- package/dist/Button.js +3 -1
- package/dist/Button.js.map +1 -1
- package/dist/Common.d.ts +36 -2
- package/dist/Common.js.map +1 -1
- package/dist/Icon.js +6 -0
- package/dist/Icon.js.map +1 -1
- package/dist/IconButton.js +3 -1
- package/dist/IconButton.js.map +1 -1
- package/dist/IconRegistry.d.ts +17 -0
- package/dist/IconRegistry.js +26 -0
- package/dist/IconRegistry.js.map +1 -0
- package/dist/PickerSelect.js +14 -10
- package/dist/PickerSelect.js.map +1 -1
- package/dist/TerrenoProvider.d.ts +7 -0
- package/dist/TerrenoProvider.js +12 -11
- package/dist/TerrenoProvider.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Badge.tsx +5 -6
- package/src/Button.test.tsx +18 -1
- package/src/Button.tsx +7 -1
- package/src/Common.ts +45 -2
- package/src/Icon.test.tsx +23 -1
- package/src/Icon.tsx +8 -0
- package/src/IconButton.test.tsx +23 -1
- package/src/IconButton.tsx +4 -0
- package/src/IconRegistry.test.tsx +104 -0
- package/src/IconRegistry.tsx +41 -0
- package/src/PickerSelect.tsx +27 -27
- package/src/TerrenoProvider.tsx +32 -22
- package/src/__snapshots__/AddressField.test.tsx.snap +7 -3
- package/src/__snapshots__/Badge.test.tsx.snap +2 -2
- package/src/__snapshots__/Button.test.tsx.snap +0 -71
- package/src/__snapshots__/CustomSelectField.test.tsx.snap +51 -24
- package/src/__snapshots__/DataTable.test.tsx.snap +0 -366
- package/src/__snapshots__/Field.test.tsx.snap +49 -21
- package/src/__snapshots__/PickerSelect.test.tsx.snap +51 -24
- package/src/__snapshots__/SegmentedControl.test.tsx.snap +6 -9
- package/src/__snapshots__/SelectField.test.tsx.snap +44 -21
- package/src/__snapshots__/TimezonePicker.test.tsx.snap +42 -18
- package/src/index.tsx +1 -0
- package/src/table/__snapshots__/TableBadge.test.tsx.snap +19 -15
- package/src/test-utils.tsx +32 -0
|
@@ -17,9 +17,11 @@ exports[`SelectField renders correctly with default props 1`] = `
|
|
|
17
17
|
"$$typeof": Symbol(react.test.json),
|
|
18
18
|
"children": null,
|
|
19
19
|
"props": {
|
|
20
|
-
"
|
|
20
|
+
"editable": false,
|
|
21
|
+
"multiline": true,
|
|
21
22
|
"style": {
|
|
22
23
|
"color": "#1C1C1C",
|
|
24
|
+
"flex": 1,
|
|
23
25
|
},
|
|
24
26
|
"testID": "text_input",
|
|
25
27
|
"value": "Please select an option.",
|
|
@@ -40,8 +42,8 @@ exports[`SelectField renders correctly with default props 1`] = `
|
|
|
40
42
|
],
|
|
41
43
|
"props": {
|
|
42
44
|
"style": {
|
|
45
|
+
"alignItems": "center",
|
|
43
46
|
"flexDirection": "row",
|
|
44
|
-
"justifyContent": "space-between",
|
|
45
47
|
"pointerEvents": "box-only",
|
|
46
48
|
"width": "100%",
|
|
47
49
|
},
|
|
@@ -51,13 +53,15 @@ exports[`SelectField renders correctly with default props 1`] = `
|
|
|
51
53
|
},
|
|
52
54
|
],
|
|
53
55
|
"props": {
|
|
56
|
+
"disabled": false,
|
|
54
57
|
"onPress": [Function],
|
|
55
58
|
"style": {
|
|
56
59
|
"alignItems": "center",
|
|
57
60
|
"flexDirection": "row",
|
|
58
61
|
"justifyContent": "center",
|
|
59
62
|
"minHeight": 40,
|
|
60
|
-
"
|
|
63
|
+
"paddingHorizontal": 8,
|
|
64
|
+
"width": "100%",
|
|
61
65
|
},
|
|
62
66
|
"testID": "ios_touchable_wrapper",
|
|
63
67
|
},
|
|
@@ -308,9 +312,11 @@ exports[`SelectField renders with title 1`] = `
|
|
|
308
312
|
"$$typeof": Symbol(react.test.json),
|
|
309
313
|
"children": null,
|
|
310
314
|
"props": {
|
|
311
|
-
"
|
|
315
|
+
"editable": false,
|
|
316
|
+
"multiline": true,
|
|
312
317
|
"style": {
|
|
313
318
|
"color": "#1C1C1C",
|
|
319
|
+
"flex": 1,
|
|
314
320
|
},
|
|
315
321
|
"testID": "text_input",
|
|
316
322
|
"value": "Please select an option.",
|
|
@@ -331,8 +337,8 @@ exports[`SelectField renders with title 1`] = `
|
|
|
331
337
|
],
|
|
332
338
|
"props": {
|
|
333
339
|
"style": {
|
|
340
|
+
"alignItems": "center",
|
|
334
341
|
"flexDirection": "row",
|
|
335
|
-
"justifyContent": "space-between",
|
|
336
342
|
"pointerEvents": "box-only",
|
|
337
343
|
"width": "100%",
|
|
338
344
|
},
|
|
@@ -342,13 +348,15 @@ exports[`SelectField renders with title 1`] = `
|
|
|
342
348
|
},
|
|
343
349
|
],
|
|
344
350
|
"props": {
|
|
351
|
+
"disabled": false,
|
|
345
352
|
"onPress": [Function],
|
|
346
353
|
"style": {
|
|
347
354
|
"alignItems": "center",
|
|
348
355
|
"flexDirection": "row",
|
|
349
356
|
"justifyContent": "center",
|
|
350
357
|
"minHeight": 40,
|
|
351
|
-
"
|
|
358
|
+
"paddingHorizontal": 8,
|
|
359
|
+
"width": "100%",
|
|
352
360
|
},
|
|
353
361
|
"testID": "ios_touchable_wrapper",
|
|
354
362
|
},
|
|
@@ -584,9 +592,11 @@ exports[`SelectField renders with selected value 1`] = `
|
|
|
584
592
|
"$$typeof": Symbol(react.test.json),
|
|
585
593
|
"children": null,
|
|
586
594
|
"props": {
|
|
587
|
-
"
|
|
595
|
+
"editable": false,
|
|
596
|
+
"multiline": true,
|
|
588
597
|
"style": {
|
|
589
598
|
"color": "#1C1C1C",
|
|
599
|
+
"flex": 1,
|
|
590
600
|
},
|
|
591
601
|
"testID": "text_input",
|
|
592
602
|
"value": "Option 2",
|
|
@@ -607,8 +617,8 @@ exports[`SelectField renders with selected value 1`] = `
|
|
|
607
617
|
],
|
|
608
618
|
"props": {
|
|
609
619
|
"style": {
|
|
620
|
+
"alignItems": "center",
|
|
610
621
|
"flexDirection": "row",
|
|
611
|
-
"justifyContent": "space-between",
|
|
612
622
|
"pointerEvents": "box-only",
|
|
613
623
|
"width": "100%",
|
|
614
624
|
},
|
|
@@ -618,13 +628,15 @@ exports[`SelectField renders with selected value 1`] = `
|
|
|
618
628
|
},
|
|
619
629
|
],
|
|
620
630
|
"props": {
|
|
631
|
+
"disabled": false,
|
|
621
632
|
"onPress": [Function],
|
|
622
633
|
"style": {
|
|
623
634
|
"alignItems": "center",
|
|
624
635
|
"flexDirection": "row",
|
|
625
636
|
"justifyContent": "center",
|
|
626
637
|
"minHeight": 40,
|
|
627
|
-
"
|
|
638
|
+
"paddingHorizontal": 8,
|
|
639
|
+
"width": "100%",
|
|
628
640
|
},
|
|
629
641
|
"testID": "ios_touchable_wrapper",
|
|
630
642
|
},
|
|
@@ -860,9 +872,11 @@ exports[`SelectField renders with custom placeholder 1`] = `
|
|
|
860
872
|
"$$typeof": Symbol(react.test.json),
|
|
861
873
|
"children": null,
|
|
862
874
|
"props": {
|
|
863
|
-
"
|
|
875
|
+
"editable": false,
|
|
876
|
+
"multiline": true,
|
|
864
877
|
"style": {
|
|
865
878
|
"color": "#1C1C1C",
|
|
879
|
+
"flex": 1,
|
|
866
880
|
},
|
|
867
881
|
"testID": "text_input",
|
|
868
882
|
"value": "Choose one...",
|
|
@@ -883,8 +897,8 @@ exports[`SelectField renders with custom placeholder 1`] = `
|
|
|
883
897
|
],
|
|
884
898
|
"props": {
|
|
885
899
|
"style": {
|
|
900
|
+
"alignItems": "center",
|
|
886
901
|
"flexDirection": "row",
|
|
887
|
-
"justifyContent": "space-between",
|
|
888
902
|
"pointerEvents": "box-only",
|
|
889
903
|
"width": "100%",
|
|
890
904
|
},
|
|
@@ -894,13 +908,15 @@ exports[`SelectField renders with custom placeholder 1`] = `
|
|
|
894
908
|
},
|
|
895
909
|
],
|
|
896
910
|
"props": {
|
|
911
|
+
"disabled": false,
|
|
897
912
|
"onPress": [Function],
|
|
898
913
|
"style": {
|
|
899
914
|
"alignItems": "center",
|
|
900
915
|
"flexDirection": "row",
|
|
901
916
|
"justifyContent": "center",
|
|
902
917
|
"minHeight": 40,
|
|
903
|
-
"
|
|
918
|
+
"paddingHorizontal": 8,
|
|
919
|
+
"width": "100%",
|
|
904
920
|
},
|
|
905
921
|
"testID": "ios_touchable_wrapper",
|
|
906
922
|
},
|
|
@@ -1134,17 +1150,18 @@ exports[`SelectField renders disabled state 1`] = `
|
|
|
1134
1150
|
"children": [
|
|
1135
1151
|
{
|
|
1136
1152
|
"$$typeof": Symbol(react.test.json),
|
|
1137
|
-
"children":
|
|
1138
|
-
"Please select an option.",
|
|
1139
|
-
],
|
|
1153
|
+
"children": null,
|
|
1140
1154
|
"props": {
|
|
1155
|
+
"editable": false,
|
|
1156
|
+
"multiline": true,
|
|
1141
1157
|
"style": {
|
|
1142
1158
|
"color": "#686868",
|
|
1143
1159
|
"flex": 1,
|
|
1144
1160
|
},
|
|
1145
1161
|
"testID": "text_input",
|
|
1162
|
+
"value": "Please select an option.",
|
|
1146
1163
|
},
|
|
1147
|
-
"type": "
|
|
1164
|
+
"type": "TextInput",
|
|
1148
1165
|
},
|
|
1149
1166
|
{
|
|
1150
1167
|
"$$typeof": Symbol(react.test.json),
|
|
@@ -1160,8 +1177,8 @@ exports[`SelectField renders disabled state 1`] = `
|
|
|
1160
1177
|
],
|
|
1161
1178
|
"props": {
|
|
1162
1179
|
"style": {
|
|
1180
|
+
"alignItems": "center",
|
|
1163
1181
|
"flexDirection": "row",
|
|
1164
|
-
"justifyContent": "space-between",
|
|
1165
1182
|
"pointerEvents": "box-only",
|
|
1166
1183
|
"width": "100%",
|
|
1167
1184
|
},
|
|
@@ -1171,13 +1188,15 @@ exports[`SelectField renders disabled state 1`] = `
|
|
|
1171
1188
|
},
|
|
1172
1189
|
],
|
|
1173
1190
|
"props": {
|
|
1191
|
+
"disabled": true,
|
|
1174
1192
|
"onPress": [Function],
|
|
1175
1193
|
"style": {
|
|
1176
1194
|
"alignItems": "center",
|
|
1177
1195
|
"flexDirection": "row",
|
|
1178
1196
|
"justifyContent": "center",
|
|
1179
1197
|
"minHeight": 40,
|
|
1180
|
-
"
|
|
1198
|
+
"paddingHorizontal": 8,
|
|
1199
|
+
"width": "100%",
|
|
1181
1200
|
},
|
|
1182
1201
|
"testID": "ios_touchable_wrapper",
|
|
1183
1202
|
},
|
|
@@ -1415,9 +1434,11 @@ exports[`SelectField renders with requireValue (no clear option) 1`] = `
|
|
|
1415
1434
|
"$$typeof": Symbol(react.test.json),
|
|
1416
1435
|
"children": null,
|
|
1417
1436
|
"props": {
|
|
1418
|
-
"
|
|
1437
|
+
"editable": false,
|
|
1438
|
+
"multiline": true,
|
|
1419
1439
|
"style": {
|
|
1420
1440
|
"color": "#1C1C1C",
|
|
1441
|
+
"flex": 1,
|
|
1421
1442
|
},
|
|
1422
1443
|
"testID": "text_input",
|
|
1423
1444
|
"value": "Option 1",
|
|
@@ -1438,8 +1459,8 @@ exports[`SelectField renders with requireValue (no clear option) 1`] = `
|
|
|
1438
1459
|
],
|
|
1439
1460
|
"props": {
|
|
1440
1461
|
"style": {
|
|
1462
|
+
"alignItems": "center",
|
|
1441
1463
|
"flexDirection": "row",
|
|
1442
|
-
"justifyContent": "space-between",
|
|
1443
1464
|
"pointerEvents": "box-only",
|
|
1444
1465
|
"width": "100%",
|
|
1445
1466
|
},
|
|
@@ -1449,13 +1470,15 @@ exports[`SelectField renders with requireValue (no clear option) 1`] = `
|
|
|
1449
1470
|
},
|
|
1450
1471
|
],
|
|
1451
1472
|
"props": {
|
|
1473
|
+
"disabled": false,
|
|
1452
1474
|
"onPress": [Function],
|
|
1453
1475
|
"style": {
|
|
1454
1476
|
"alignItems": "center",
|
|
1455
1477
|
"flexDirection": "row",
|
|
1456
1478
|
"justifyContent": "center",
|
|
1457
1479
|
"minHeight": 40,
|
|
1458
|
-
"
|
|
1480
|
+
"paddingHorizontal": 8,
|
|
1481
|
+
"width": "100%",
|
|
1459
1482
|
},
|
|
1460
1483
|
"testID": "ios_touchable_wrapper",
|
|
1461
1484
|
},
|
|
@@ -32,9 +32,11 @@ exports[`TimezonePicker renders correctly with default props 1`] = `
|
|
|
32
32
|
"$$typeof": Symbol(react.test.json),
|
|
33
33
|
"children": null,
|
|
34
34
|
"props": {
|
|
35
|
-
"
|
|
35
|
+
"editable": false,
|
|
36
|
+
"multiline": true,
|
|
36
37
|
"style": {
|
|
37
38
|
"color": "#1C1C1C",
|
|
39
|
+
"flex": 1,
|
|
38
40
|
},
|
|
39
41
|
"testID": "text_input",
|
|
40
42
|
"value": "Please select an option.",
|
|
@@ -55,8 +57,8 @@ exports[`TimezonePicker renders correctly with default props 1`] = `
|
|
|
55
57
|
],
|
|
56
58
|
"props": {
|
|
57
59
|
"style": {
|
|
60
|
+
"alignItems": "center",
|
|
58
61
|
"flexDirection": "row",
|
|
59
|
-
"justifyContent": "space-between",
|
|
60
62
|
"pointerEvents": "box-only",
|
|
61
63
|
"width": "100%",
|
|
62
64
|
},
|
|
@@ -66,13 +68,15 @@ exports[`TimezonePicker renders correctly with default props 1`] = `
|
|
|
66
68
|
},
|
|
67
69
|
],
|
|
68
70
|
"props": {
|
|
71
|
+
"disabled": false,
|
|
69
72
|
"onPress": [Function],
|
|
70
73
|
"style": {
|
|
71
74
|
"alignItems": "center",
|
|
72
75
|
"flexDirection": "row",
|
|
73
76
|
"justifyContent": "center",
|
|
74
77
|
"minHeight": 40,
|
|
75
|
-
"
|
|
78
|
+
"paddingHorizontal": 8,
|
|
79
|
+
"width": "100%",
|
|
76
80
|
},
|
|
77
81
|
"testID": "ios_touchable_wrapper",
|
|
78
82
|
},
|
|
@@ -348,9 +352,11 @@ exports[`TimezonePicker hides title when hideTitle is true 1`] = `
|
|
|
348
352
|
"$$typeof": Symbol(react.test.json),
|
|
349
353
|
"children": null,
|
|
350
354
|
"props": {
|
|
351
|
-
"
|
|
355
|
+
"editable": false,
|
|
356
|
+
"multiline": true,
|
|
352
357
|
"style": {
|
|
353
358
|
"color": "#1C1C1C",
|
|
359
|
+
"flex": 1,
|
|
354
360
|
},
|
|
355
361
|
"testID": "text_input",
|
|
356
362
|
"value": "Please select an option.",
|
|
@@ -371,8 +377,8 @@ exports[`TimezonePicker hides title when hideTitle is true 1`] = `
|
|
|
371
377
|
],
|
|
372
378
|
"props": {
|
|
373
379
|
"style": {
|
|
380
|
+
"alignItems": "center",
|
|
374
381
|
"flexDirection": "row",
|
|
375
|
-
"justifyContent": "space-between",
|
|
376
382
|
"pointerEvents": "box-only",
|
|
377
383
|
"width": "100%",
|
|
378
384
|
},
|
|
@@ -382,13 +388,15 @@ exports[`TimezonePicker hides title when hideTitle is true 1`] = `
|
|
|
382
388
|
},
|
|
383
389
|
],
|
|
384
390
|
"props": {
|
|
391
|
+
"disabled": false,
|
|
385
392
|
"onPress": [Function],
|
|
386
393
|
"style": {
|
|
387
394
|
"alignItems": "center",
|
|
388
395
|
"flexDirection": "row",
|
|
389
396
|
"justifyContent": "center",
|
|
390
397
|
"minHeight": 40,
|
|
391
|
-
"
|
|
398
|
+
"paddingHorizontal": 8,
|
|
399
|
+
"width": "100%",
|
|
392
400
|
},
|
|
393
401
|
"testID": "ios_touchable_wrapper",
|
|
394
402
|
},
|
|
@@ -679,9 +687,11 @@ exports[`TimezonePicker renders with selected timezone 1`] = `
|
|
|
679
687
|
"$$typeof": Symbol(react.test.json),
|
|
680
688
|
"children": null,
|
|
681
689
|
"props": {
|
|
682
|
-
"
|
|
690
|
+
"editable": false,
|
|
691
|
+
"multiline": true,
|
|
683
692
|
"style": {
|
|
684
693
|
"color": "#1C1C1C",
|
|
694
|
+
"flex": 1,
|
|
685
695
|
},
|
|
686
696
|
"testID": "text_input",
|
|
687
697
|
"value": "Eastern",
|
|
@@ -702,8 +712,8 @@ exports[`TimezonePicker renders with selected timezone 1`] = `
|
|
|
702
712
|
],
|
|
703
713
|
"props": {
|
|
704
714
|
"style": {
|
|
715
|
+
"alignItems": "center",
|
|
705
716
|
"flexDirection": "row",
|
|
706
|
-
"justifyContent": "space-between",
|
|
707
717
|
"pointerEvents": "box-only",
|
|
708
718
|
"width": "100%",
|
|
709
719
|
},
|
|
@@ -713,13 +723,15 @@ exports[`TimezonePicker renders with selected timezone 1`] = `
|
|
|
713
723
|
},
|
|
714
724
|
],
|
|
715
725
|
"props": {
|
|
726
|
+
"disabled": false,
|
|
716
727
|
"onPress": [Function],
|
|
717
728
|
"style": {
|
|
718
729
|
"alignItems": "center",
|
|
719
730
|
"flexDirection": "row",
|
|
720
731
|
"justifyContent": "center",
|
|
721
732
|
"minHeight": 40,
|
|
722
|
-
"
|
|
733
|
+
"paddingHorizontal": 8,
|
|
734
|
+
"width": "100%",
|
|
723
735
|
},
|
|
724
736
|
"testID": "ios_touchable_wrapper",
|
|
725
737
|
},
|
|
@@ -1010,9 +1022,11 @@ exports[`TimezonePicker renders USA timezones by default 1`] = `
|
|
|
1010
1022
|
"$$typeof": Symbol(react.test.json),
|
|
1011
1023
|
"children": null,
|
|
1012
1024
|
"props": {
|
|
1013
|
-
"
|
|
1025
|
+
"editable": false,
|
|
1026
|
+
"multiline": true,
|
|
1014
1027
|
"style": {
|
|
1015
1028
|
"color": "#1C1C1C",
|
|
1029
|
+
"flex": 1,
|
|
1016
1030
|
},
|
|
1017
1031
|
"testID": "text_input",
|
|
1018
1032
|
"value": "Eastern",
|
|
@@ -1033,8 +1047,8 @@ exports[`TimezonePicker renders USA timezones by default 1`] = `
|
|
|
1033
1047
|
],
|
|
1034
1048
|
"props": {
|
|
1035
1049
|
"style": {
|
|
1050
|
+
"alignItems": "center",
|
|
1036
1051
|
"flexDirection": "row",
|
|
1037
|
-
"justifyContent": "space-between",
|
|
1038
1052
|
"pointerEvents": "box-only",
|
|
1039
1053
|
"width": "100%",
|
|
1040
1054
|
},
|
|
@@ -1044,13 +1058,15 @@ exports[`TimezonePicker renders USA timezones by default 1`] = `
|
|
|
1044
1058
|
},
|
|
1045
1059
|
],
|
|
1046
1060
|
"props": {
|
|
1061
|
+
"disabled": false,
|
|
1047
1062
|
"onPress": [Function],
|
|
1048
1063
|
"style": {
|
|
1049
1064
|
"alignItems": "center",
|
|
1050
1065
|
"flexDirection": "row",
|
|
1051
1066
|
"justifyContent": "center",
|
|
1052
1067
|
"minHeight": 40,
|
|
1053
|
-
"
|
|
1068
|
+
"paddingHorizontal": 8,
|
|
1069
|
+
"width": "100%",
|
|
1054
1070
|
},
|
|
1055
1071
|
"testID": "ios_touchable_wrapper",
|
|
1056
1072
|
},
|
|
@@ -1341,9 +1357,11 @@ exports[`TimezonePicker renders with short timezone labels 1`] = `
|
|
|
1341
1357
|
"$$typeof": Symbol(react.test.json),
|
|
1342
1358
|
"children": null,
|
|
1343
1359
|
"props": {
|
|
1344
|
-
"
|
|
1360
|
+
"editable": false,
|
|
1361
|
+
"multiline": true,
|
|
1345
1362
|
"style": {
|
|
1346
1363
|
"color": "#1C1C1C",
|
|
1364
|
+
"flex": 1,
|
|
1347
1365
|
},
|
|
1348
1366
|
"testID": "text_input",
|
|
1349
1367
|
"value": "EDT",
|
|
@@ -1364,8 +1382,8 @@ exports[`TimezonePicker renders with short timezone labels 1`] = `
|
|
|
1364
1382
|
],
|
|
1365
1383
|
"props": {
|
|
1366
1384
|
"style": {
|
|
1385
|
+
"alignItems": "center",
|
|
1367
1386
|
"flexDirection": "row",
|
|
1368
|
-
"justifyContent": "space-between",
|
|
1369
1387
|
"pointerEvents": "box-only",
|
|
1370
1388
|
"width": "100%",
|
|
1371
1389
|
},
|
|
@@ -1375,13 +1393,15 @@ exports[`TimezonePicker renders with short timezone labels 1`] = `
|
|
|
1375
1393
|
},
|
|
1376
1394
|
],
|
|
1377
1395
|
"props": {
|
|
1396
|
+
"disabled": false,
|
|
1378
1397
|
"onPress": [Function],
|
|
1379
1398
|
"style": {
|
|
1380
1399
|
"alignItems": "center",
|
|
1381
1400
|
"flexDirection": "row",
|
|
1382
1401
|
"justifyContent": "center",
|
|
1383
1402
|
"minHeight": 40,
|
|
1384
|
-
"
|
|
1403
|
+
"paddingHorizontal": 8,
|
|
1404
|
+
"width": "100%",
|
|
1385
1405
|
},
|
|
1386
1406
|
"testID": "ios_touchable_wrapper",
|
|
1387
1407
|
},
|
|
@@ -1672,9 +1692,11 @@ exports[`TimezonePicker calls onChange when timezone is selected 1`] = `
|
|
|
1672
1692
|
"$$typeof": Symbol(react.test.json),
|
|
1673
1693
|
"children": null,
|
|
1674
1694
|
"props": {
|
|
1675
|
-
"
|
|
1695
|
+
"editable": false,
|
|
1696
|
+
"multiline": true,
|
|
1676
1697
|
"style": {
|
|
1677
1698
|
"color": "#1C1C1C",
|
|
1699
|
+
"flex": 1,
|
|
1678
1700
|
},
|
|
1679
1701
|
"testID": "text_input",
|
|
1680
1702
|
"value": "Eastern",
|
|
@@ -1695,8 +1717,8 @@ exports[`TimezonePicker calls onChange when timezone is selected 1`] = `
|
|
|
1695
1717
|
],
|
|
1696
1718
|
"props": {
|
|
1697
1719
|
"style": {
|
|
1720
|
+
"alignItems": "center",
|
|
1698
1721
|
"flexDirection": "row",
|
|
1699
|
-
"justifyContent": "space-between",
|
|
1700
1722
|
"pointerEvents": "box-only",
|
|
1701
1723
|
"width": "100%",
|
|
1702
1724
|
},
|
|
@@ -1706,13 +1728,15 @@ exports[`TimezonePicker calls onChange when timezone is selected 1`] = `
|
|
|
1706
1728
|
},
|
|
1707
1729
|
],
|
|
1708
1730
|
"props": {
|
|
1731
|
+
"disabled": false,
|
|
1709
1732
|
"onPress": [Function],
|
|
1710
1733
|
"style": {
|
|
1711
1734
|
"alignItems": "center",
|
|
1712
1735
|
"flexDirection": "row",
|
|
1713
1736
|
"justifyContent": "center",
|
|
1714
1737
|
"minHeight": 40,
|
|
1715
|
-
"
|
|
1738
|
+
"paddingHorizontal": 8,
|
|
1739
|
+
"width": "100%",
|
|
1716
1740
|
},
|
|
1717
1741
|
"testID": "ios_touchable_wrapper",
|
|
1718
1742
|
},
|
package/src/index.tsx
CHANGED
|
@@ -42,6 +42,7 @@ export * from "./HeightActionSheet";
|
|
|
42
42
|
export * from "./HeightField";
|
|
43
43
|
export * from "./Icon";
|
|
44
44
|
export * from "./IconButton";
|
|
45
|
+
export * from "./IconRegistry";
|
|
45
46
|
export * from "./Image";
|
|
46
47
|
export * from "./ImageBackground";
|
|
47
48
|
export * from "./InfoModalIcon";
|
|
@@ -33,10 +33,10 @@ exports[`TableBadge renders correctly with value 1`] = `
|
|
|
33
33
|
"backgroundColor": "#B6CDD5",
|
|
34
34
|
"borderRadius": 4,
|
|
35
35
|
"flexDirection": "row",
|
|
36
|
-
"height":
|
|
36
|
+
"height": 20,
|
|
37
37
|
"justifyContent": "center",
|
|
38
38
|
"paddingHorizontal": 8,
|
|
39
|
-
"paddingVertical":
|
|
39
|
+
"paddingVertical": 0,
|
|
40
40
|
"width": "auto",
|
|
41
41
|
},
|
|
42
42
|
false,
|
|
@@ -103,10 +103,10 @@ exports[`TableBadge renders with info status (default) 1`] = `
|
|
|
103
103
|
"backgroundColor": "#B6CDD5",
|
|
104
104
|
"borderRadius": 4,
|
|
105
105
|
"flexDirection": "row",
|
|
106
|
-
"height":
|
|
106
|
+
"height": 20,
|
|
107
107
|
"justifyContent": "center",
|
|
108
108
|
"paddingHorizontal": 8,
|
|
109
|
-
"paddingVertical":
|
|
109
|
+
"paddingVertical": 0,
|
|
110
110
|
"width": "auto",
|
|
111
111
|
},
|
|
112
112
|
false,
|
|
@@ -173,10 +173,10 @@ exports[`TableBadge renders with success status 1`] = `
|
|
|
173
173
|
"backgroundColor": "#DCF2E2",
|
|
174
174
|
"borderRadius": 4,
|
|
175
175
|
"flexDirection": "row",
|
|
176
|
-
"height":
|
|
176
|
+
"height": 20,
|
|
177
177
|
"justifyContent": "center",
|
|
178
178
|
"paddingHorizontal": 8,
|
|
179
|
-
"paddingVertical":
|
|
179
|
+
"paddingVertical": 0,
|
|
180
180
|
"width": "auto",
|
|
181
181
|
},
|
|
182
182
|
false,
|
|
@@ -243,10 +243,10 @@ exports[`TableBadge renders with warning status 1`] = `
|
|
|
243
243
|
"backgroundColor": "#FFE3C6",
|
|
244
244
|
"borderRadius": 4,
|
|
245
245
|
"flexDirection": "row",
|
|
246
|
-
"height":
|
|
246
|
+
"height": 20,
|
|
247
247
|
"justifyContent": "center",
|
|
248
248
|
"paddingHorizontal": 8,
|
|
249
|
-
"paddingVertical":
|
|
249
|
+
"paddingVertical": 0,
|
|
250
250
|
"width": "auto",
|
|
251
251
|
},
|
|
252
252
|
false,
|
|
@@ -313,10 +313,10 @@ exports[`TableBadge renders with error status 1`] = `
|
|
|
313
313
|
"backgroundColor": "#FDD7D7",
|
|
314
314
|
"borderRadius": 4,
|
|
315
315
|
"flexDirection": "row",
|
|
316
|
-
"height":
|
|
316
|
+
"height": 20,
|
|
317
317
|
"justifyContent": "center",
|
|
318
318
|
"paddingHorizontal": 8,
|
|
319
|
-
"paddingVertical":
|
|
319
|
+
"paddingVertical": 0,
|
|
320
320
|
"width": "auto",
|
|
321
321
|
},
|
|
322
322
|
false,
|
|
@@ -394,10 +394,10 @@ exports[`TableBadge renders with icon 1`] = `
|
|
|
394
394
|
"backgroundColor": "#DCF2E2",
|
|
395
395
|
"borderRadius": 4,
|
|
396
396
|
"flexDirection": "row",
|
|
397
|
-
"height":
|
|
397
|
+
"height": 20,
|
|
398
398
|
"justifyContent": "center",
|
|
399
399
|
"paddingHorizontal": 8,
|
|
400
|
-
"paddingVertical":
|
|
400
|
+
"paddingVertical": 0,
|
|
401
401
|
"width": "auto",
|
|
402
402
|
},
|
|
403
403
|
false,
|
|
@@ -451,9 +451,11 @@ exports[`TableBadge renders select field when editing 1`] = `
|
|
|
451
451
|
"$$typeof": Symbol(react.test.json),
|
|
452
452
|
"children": null,
|
|
453
453
|
"props": {
|
|
454
|
-
"
|
|
454
|
+
"editable": false,
|
|
455
|
+
"multiline": true,
|
|
455
456
|
"style": {
|
|
456
457
|
"color": "#1C1C1C",
|
|
458
|
+
"flex": 1,
|
|
457
459
|
},
|
|
458
460
|
"testID": "text_input",
|
|
459
461
|
"value": "Option A",
|
|
@@ -474,8 +476,8 @@ exports[`TableBadge renders select field when editing 1`] = `
|
|
|
474
476
|
],
|
|
475
477
|
"props": {
|
|
476
478
|
"style": {
|
|
479
|
+
"alignItems": "center",
|
|
477
480
|
"flexDirection": "row",
|
|
478
|
-
"justifyContent": "space-between",
|
|
479
481
|
"pointerEvents": "box-only",
|
|
480
482
|
"width": "100%",
|
|
481
483
|
},
|
|
@@ -485,13 +487,15 @@ exports[`TableBadge renders select field when editing 1`] = `
|
|
|
485
487
|
},
|
|
486
488
|
],
|
|
487
489
|
"props": {
|
|
490
|
+
"disabled": false,
|
|
488
491
|
"onPress": [Function],
|
|
489
492
|
"style": {
|
|
490
493
|
"alignItems": "center",
|
|
491
494
|
"flexDirection": "row",
|
|
492
495
|
"justifyContent": "center",
|
|
493
496
|
"minHeight": 40,
|
|
494
|
-
"
|
|
497
|
+
"paddingHorizontal": 8,
|
|
498
|
+
"width": "100%",
|
|
495
499
|
},
|
|
496
500
|
"testID": "ios_touchable_wrapper",
|
|
497
501
|
},
|
package/src/test-utils.tsx
CHANGED
|
@@ -1,13 +1,45 @@
|
|
|
1
1
|
import {mock} from "bun:test";
|
|
2
2
|
import {render} from "@testing-library/react-native";
|
|
3
3
|
import type React from "react";
|
|
4
|
+
import {View} from "react-native";
|
|
4
5
|
|
|
6
|
+
import type {CustomIconProps, IconRegistryMap} from "./Common";
|
|
7
|
+
import {IconRegistryProvider} from "./IconRegistry";
|
|
5
8
|
import {ThemeProvider} from "./Theme";
|
|
6
9
|
|
|
10
|
+
// Register a custom icon name for tests. test-utils.tsx is excluded from the
|
|
11
|
+
// published build (see tsconfig), so this augmentation never leaks to consumers.
|
|
12
|
+
declare module "./Common" {
|
|
13
|
+
interface CustomIconRegistry {
|
|
14
|
+
testCustomIcon: true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const TEST_CUSTOM_ICON_TEST_ID = "test-custom-icon";
|
|
19
|
+
|
|
20
|
+
export const TestCustomIcon: React.FC<CustomIconProps> = ({size, testID}) => {
|
|
21
|
+
return <View accessibilityLabel={`size:${size}`} testID={testID ?? TEST_CUSTOM_ICON_TEST_ID} />;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const testCustomIcons: IconRegistryMap = {testCustomIcon: TestCustomIcon};
|
|
25
|
+
|
|
7
26
|
export const renderWithTheme = (ui: React.ReactElement) => {
|
|
8
27
|
return render(ui, {wrapper: ThemeProvider});
|
|
9
28
|
};
|
|
10
29
|
|
|
30
|
+
export const renderWithIcons = (
|
|
31
|
+
ui: React.ReactElement,
|
|
32
|
+
icons: IconRegistryMap = testCustomIcons
|
|
33
|
+
) => {
|
|
34
|
+
return render(ui, {
|
|
35
|
+
wrapper: ({children}: {children: React.ReactNode}) => (
|
|
36
|
+
<ThemeProvider>
|
|
37
|
+
<IconRegistryProvider icons={icons}>{children}</IconRegistryProvider>
|
|
38
|
+
</ThemeProvider>
|
|
39
|
+
),
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
11
43
|
export const createCommonMocks = () => ({
|
|
12
44
|
onBlur: mock(() => {}),
|
|
13
45
|
onChange: mock(() => {}),
|