@hero-design/rn 8.42.4 → 8.43.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 +1 -1
- package/CHANGELOG.md +11 -0
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +670 -499
- package/lib/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/lib/index.js +1109 -937
- package/package.json +1 -1
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +197 -211
- package/src/components/BottomSheet/index.tsx +1 -1
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +6 -10
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +0 -20
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +0 -70
- package/src/components/Button/StyledButton.tsx +4 -0
- package/src/components/Button/__tests__/__snapshots__/Button.spec.tsx.snap +16 -42
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +10 -0
- package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +3 -0
- package/src/components/Carousel/__tests__/index.spec.tsx +8 -10
- package/src/components/Chip/StyledChip.tsx +121 -0
- package/src/components/Chip/__tests__/__snapshots__/index.spec.tsx.snap +943 -0
- package/src/components/Chip/__tests__/index.spec.tsx +136 -0
- package/src/components/Chip/index.tsx +82 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +12 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +417 -399
- package/src/components/Error/__tests__/index.spec.tsx +9 -6
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +1 -0
- package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +8 -10
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +367 -451
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +7 -10
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +357 -419
- package/src/components/Success/__tests__/index.spec.tsx +9 -6
- package/src/components/Tabs/__tests__/SceneView.spec.tsx +19 -23
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +417 -399
- package/src/index.ts +2 -0
- package/src/testHelpers/renderWithTheme.tsx +1 -7
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +38 -1
- package/src/theme/components/button.ts +0 -1
- package/src/theme/components/chip.ts +47 -0
- package/src/theme/getTheme.ts +3 -0
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +3 -3
- package/types/components/Chip/StyledChip.d.ts +31 -0
- package/types/components/Chip/index.d.ts +26 -0
- package/types/components/Icon/IconList.d.ts +1 -1
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/Icon/utils.d.ts +1 -1
- package/types/index.d.ts +2 -1
- package/types/theme/components/button.d.ts +0 -1
- package/types/theme/components/chip.d.ts +40 -0
- package/types/theme/getTheme.d.ts +2 -0
- package/.turbo/turbo-publish:npm.log +0 -0
|
@@ -24,6 +24,7 @@ exports[`Button renders correctly 1`] = `
|
|
|
24
24
|
"backgroundColor": "#401960",
|
|
25
25
|
"borderRadius": 32,
|
|
26
26
|
"flexDirection": "row",
|
|
27
|
+
"height": 60,
|
|
27
28
|
"justifyContent": "center",
|
|
28
29
|
"padding": 16,
|
|
29
30
|
},
|
|
@@ -89,6 +90,7 @@ exports[`Button renders correctly 2`] = `
|
|
|
89
90
|
"backgroundColor": "#401960",
|
|
90
91
|
"borderRadius": 32,
|
|
91
92
|
"flexDirection": "row",
|
|
93
|
+
"height": 60,
|
|
92
94
|
"justifyContent": "center",
|
|
93
95
|
"padding": 16,
|
|
94
96
|
},
|
|
@@ -104,7 +106,6 @@ exports[`Button renders correctly 2`] = `
|
|
|
104
106
|
"alignItems": "center",
|
|
105
107
|
"flexDirection": "row",
|
|
106
108
|
"justifyContent": "center",
|
|
107
|
-
"paddingVertical": 1,
|
|
108
109
|
},
|
|
109
110
|
{},
|
|
110
111
|
]
|
|
@@ -132,9 +133,7 @@ exports[`Button renders correctly 2`] = `
|
|
|
132
133
|
"backgroundColor": "#ffffff",
|
|
133
134
|
"borderRadius": 8,
|
|
134
135
|
"height": 12,
|
|
135
|
-
"marginBottom": 4,
|
|
136
136
|
"marginHorizontal": 8,
|
|
137
|
-
"marginTop": 4,
|
|
138
137
|
"width": 12,
|
|
139
138
|
},
|
|
140
139
|
{},
|
|
@@ -164,9 +163,7 @@ exports[`Button renders correctly 2`] = `
|
|
|
164
163
|
"backgroundColor": "#ffffff",
|
|
165
164
|
"borderRadius": 8,
|
|
166
165
|
"height": 12,
|
|
167
|
-
"marginBottom": 4,
|
|
168
166
|
"marginHorizontal": 8,
|
|
169
|
-
"marginTop": 4,
|
|
170
167
|
"width": 12,
|
|
171
168
|
},
|
|
172
169
|
{},
|
|
@@ -196,9 +193,7 @@ exports[`Button renders correctly 2`] = `
|
|
|
196
193
|
"backgroundColor": "#ffffff",
|
|
197
194
|
"borderRadius": 8,
|
|
198
195
|
"height": 12,
|
|
199
|
-
"marginBottom": 4,
|
|
200
196
|
"marginHorizontal": 8,
|
|
201
|
-
"marginTop": 4,
|
|
202
197
|
"width": 12,
|
|
203
198
|
},
|
|
204
199
|
{},
|
|
@@ -235,6 +230,7 @@ exports[`Button renders correctly 3`] = `
|
|
|
235
230
|
"backgroundColor": "#bfc1c5",
|
|
236
231
|
"borderRadius": 32,
|
|
237
232
|
"flexDirection": "row",
|
|
233
|
+
"height": 60,
|
|
238
234
|
"justifyContent": "center",
|
|
239
235
|
"padding": 16,
|
|
240
236
|
},
|
|
@@ -302,6 +298,7 @@ exports[`Button renders correctly 4`] = `
|
|
|
302
298
|
"borderRadius": 32,
|
|
303
299
|
"borderWidth": 2,
|
|
304
300
|
"flexDirection": "row",
|
|
301
|
+
"height": 60,
|
|
305
302
|
"justifyContent": "center",
|
|
306
303
|
"padding": 14,
|
|
307
304
|
},
|
|
@@ -369,6 +366,7 @@ exports[`Button renders correctly 5`] = `
|
|
|
369
366
|
"borderRadius": 32,
|
|
370
367
|
"borderWidth": 2,
|
|
371
368
|
"flexDirection": "row",
|
|
369
|
+
"height": 60,
|
|
372
370
|
"justifyContent": "center",
|
|
373
371
|
"padding": 14,
|
|
374
372
|
},
|
|
@@ -384,7 +382,6 @@ exports[`Button renders correctly 5`] = `
|
|
|
384
382
|
"alignItems": "center",
|
|
385
383
|
"flexDirection": "row",
|
|
386
384
|
"justifyContent": "center",
|
|
387
|
-
"paddingVertical": 1,
|
|
388
385
|
},
|
|
389
386
|
{},
|
|
390
387
|
]
|
|
@@ -412,9 +409,7 @@ exports[`Button renders correctly 5`] = `
|
|
|
412
409
|
"backgroundColor": "#401960",
|
|
413
410
|
"borderRadius": 8,
|
|
414
411
|
"height": 12,
|
|
415
|
-
"marginBottom": 4,
|
|
416
412
|
"marginHorizontal": 8,
|
|
417
|
-
"marginTop": 4,
|
|
418
413
|
"width": 12,
|
|
419
414
|
},
|
|
420
415
|
{},
|
|
@@ -444,9 +439,7 @@ exports[`Button renders correctly 5`] = `
|
|
|
444
439
|
"backgroundColor": "#401960",
|
|
445
440
|
"borderRadius": 8,
|
|
446
441
|
"height": 12,
|
|
447
|
-
"marginBottom": 4,
|
|
448
442
|
"marginHorizontal": 8,
|
|
449
|
-
"marginTop": 4,
|
|
450
443
|
"width": 12,
|
|
451
444
|
},
|
|
452
445
|
{},
|
|
@@ -476,9 +469,7 @@ exports[`Button renders correctly 5`] = `
|
|
|
476
469
|
"backgroundColor": "#401960",
|
|
477
470
|
"borderRadius": 8,
|
|
478
471
|
"height": 12,
|
|
479
|
-
"marginBottom": 4,
|
|
480
472
|
"marginHorizontal": 8,
|
|
481
|
-
"marginTop": 4,
|
|
482
473
|
"width": 12,
|
|
483
474
|
},
|
|
484
475
|
{},
|
|
@@ -517,6 +508,7 @@ exports[`Button renders correctly 6`] = `
|
|
|
517
508
|
"borderRadius": 32,
|
|
518
509
|
"borderWidth": 2,
|
|
519
510
|
"flexDirection": "row",
|
|
511
|
+
"height": 60,
|
|
520
512
|
"justifyContent": "center",
|
|
521
513
|
"padding": 14,
|
|
522
514
|
},
|
|
@@ -582,6 +574,7 @@ exports[`Button renders correctly 7`] = `
|
|
|
582
574
|
"borderRadius": 4,
|
|
583
575
|
"borderWidth": 0,
|
|
584
576
|
"flexDirection": "row",
|
|
577
|
+
"height": 60,
|
|
585
578
|
"justifyContent": "center",
|
|
586
579
|
"padding": 12,
|
|
587
580
|
},
|
|
@@ -648,6 +641,7 @@ exports[`Button renders correctly 8`] = `
|
|
|
648
641
|
"borderRadius": 4,
|
|
649
642
|
"borderWidth": 0,
|
|
650
643
|
"flexDirection": "row",
|
|
644
|
+
"height": 60,
|
|
651
645
|
"justifyContent": "center",
|
|
652
646
|
"padding": 12,
|
|
653
647
|
},
|
|
@@ -663,7 +657,6 @@ exports[`Button renders correctly 8`] = `
|
|
|
663
657
|
"alignItems": "center",
|
|
664
658
|
"flexDirection": "row",
|
|
665
659
|
"justifyContent": "center",
|
|
666
|
-
"paddingVertical": 1,
|
|
667
660
|
},
|
|
668
661
|
{},
|
|
669
662
|
]
|
|
@@ -691,9 +684,7 @@ exports[`Button renders correctly 8`] = `
|
|
|
691
684
|
"backgroundColor": "#795e90",
|
|
692
685
|
"borderRadius": 8,
|
|
693
686
|
"height": 12,
|
|
694
|
-
"marginBottom": 4,
|
|
695
687
|
"marginHorizontal": 8,
|
|
696
|
-
"marginTop": 4,
|
|
697
688
|
"width": 12,
|
|
698
689
|
},
|
|
699
690
|
{},
|
|
@@ -723,9 +714,7 @@ exports[`Button renders correctly 8`] = `
|
|
|
723
714
|
"backgroundColor": "#795e90",
|
|
724
715
|
"borderRadius": 8,
|
|
725
716
|
"height": 12,
|
|
726
|
-
"marginBottom": 4,
|
|
727
717
|
"marginHorizontal": 8,
|
|
728
|
-
"marginTop": 4,
|
|
729
718
|
"width": 12,
|
|
730
719
|
},
|
|
731
720
|
{},
|
|
@@ -755,9 +744,7 @@ exports[`Button renders correctly 8`] = `
|
|
|
755
744
|
"backgroundColor": "#795e90",
|
|
756
745
|
"borderRadius": 8,
|
|
757
746
|
"height": 12,
|
|
758
|
-
"marginBottom": 4,
|
|
759
747
|
"marginHorizontal": 8,
|
|
760
|
-
"marginTop": 4,
|
|
761
748
|
"width": 12,
|
|
762
749
|
},
|
|
763
750
|
{},
|
|
@@ -794,6 +781,7 @@ exports[`Button renders correctly 9`] = `
|
|
|
794
781
|
"borderRadius": 4,
|
|
795
782
|
"borderWidth": 0,
|
|
796
783
|
"flexDirection": "row",
|
|
784
|
+
"height": 60,
|
|
797
785
|
"justifyContent": "center",
|
|
798
786
|
"padding": 12,
|
|
799
787
|
},
|
|
@@ -860,6 +848,7 @@ exports[`Button renders correctly 10`] = `
|
|
|
860
848
|
"borderRadius": 4,
|
|
861
849
|
"borderWidth": 0,
|
|
862
850
|
"flexDirection": "row",
|
|
851
|
+
"height": 60,
|
|
863
852
|
"justifyContent": "center",
|
|
864
853
|
"padding": 12,
|
|
865
854
|
},
|
|
@@ -926,6 +915,7 @@ exports[`Button renders correctly 11`] = `
|
|
|
926
915
|
"borderRadius": 4,
|
|
927
916
|
"borderWidth": 0,
|
|
928
917
|
"flexDirection": "row",
|
|
918
|
+
"height": 60,
|
|
929
919
|
"justifyContent": "center",
|
|
930
920
|
"padding": 12,
|
|
931
921
|
},
|
|
@@ -941,7 +931,6 @@ exports[`Button renders correctly 11`] = `
|
|
|
941
931
|
"alignItems": "center",
|
|
942
932
|
"flexDirection": "row",
|
|
943
933
|
"justifyContent": "center",
|
|
944
|
-
"paddingVertical": 1,
|
|
945
934
|
},
|
|
946
935
|
{},
|
|
947
936
|
]
|
|
@@ -969,9 +958,7 @@ exports[`Button renders correctly 11`] = `
|
|
|
969
958
|
"backgroundColor": "#795e90",
|
|
970
959
|
"borderRadius": 8,
|
|
971
960
|
"height": 12,
|
|
972
|
-
"marginBottom": 4,
|
|
973
961
|
"marginHorizontal": 8,
|
|
974
|
-
"marginTop": 4,
|
|
975
962
|
"width": 12,
|
|
976
963
|
},
|
|
977
964
|
{},
|
|
@@ -1001,9 +988,7 @@ exports[`Button renders correctly 11`] = `
|
|
|
1001
988
|
"backgroundColor": "#795e90",
|
|
1002
989
|
"borderRadius": 8,
|
|
1003
990
|
"height": 12,
|
|
1004
|
-
"marginBottom": 4,
|
|
1005
991
|
"marginHorizontal": 8,
|
|
1006
|
-
"marginTop": 4,
|
|
1007
992
|
"width": 12,
|
|
1008
993
|
},
|
|
1009
994
|
{},
|
|
@@ -1033,9 +1018,7 @@ exports[`Button renders correctly 11`] = `
|
|
|
1033
1018
|
"backgroundColor": "#795e90",
|
|
1034
1019
|
"borderRadius": 8,
|
|
1035
1020
|
"height": 12,
|
|
1036
|
-
"marginBottom": 4,
|
|
1037
1021
|
"marginHorizontal": 8,
|
|
1038
|
-
"marginTop": 4,
|
|
1039
1022
|
"width": 12,
|
|
1040
1023
|
},
|
|
1041
1024
|
{},
|
|
@@ -1072,6 +1055,7 @@ exports[`Button renders correctly 12`] = `
|
|
|
1072
1055
|
"borderRadius": 4,
|
|
1073
1056
|
"borderWidth": 0,
|
|
1074
1057
|
"flexDirection": "row",
|
|
1058
|
+
"height": 60,
|
|
1075
1059
|
"justifyContent": "center",
|
|
1076
1060
|
"padding": 12,
|
|
1077
1061
|
},
|
|
@@ -1138,6 +1122,7 @@ exports[`Button renders correctly 13`] = `
|
|
|
1138
1122
|
"borderRadius": 4,
|
|
1139
1123
|
"borderWidth": 0,
|
|
1140
1124
|
"flexDirection": "row",
|
|
1125
|
+
"height": 60,
|
|
1141
1126
|
"justifyContent": "center",
|
|
1142
1127
|
"padding": 12,
|
|
1143
1128
|
},
|
|
@@ -1204,6 +1189,7 @@ exports[`Button renders correctly 14`] = `
|
|
|
1204
1189
|
"borderRadius": 4,
|
|
1205
1190
|
"borderWidth": 0,
|
|
1206
1191
|
"flexDirection": "row",
|
|
1192
|
+
"height": 60,
|
|
1207
1193
|
"justifyContent": "center",
|
|
1208
1194
|
"padding": 12,
|
|
1209
1195
|
},
|
|
@@ -1219,7 +1205,6 @@ exports[`Button renders correctly 14`] = `
|
|
|
1219
1205
|
"alignItems": "center",
|
|
1220
1206
|
"flexDirection": "row",
|
|
1221
1207
|
"justifyContent": "center",
|
|
1222
|
-
"paddingVertical": 1,
|
|
1223
1208
|
},
|
|
1224
1209
|
{},
|
|
1225
1210
|
]
|
|
@@ -1247,9 +1232,7 @@ exports[`Button renders correctly 14`] = `
|
|
|
1247
1232
|
"backgroundColor": "#cb300a",
|
|
1248
1233
|
"borderRadius": 8,
|
|
1249
1234
|
"height": 12,
|
|
1250
|
-
"marginBottom": 4,
|
|
1251
1235
|
"marginHorizontal": 8,
|
|
1252
|
-
"marginTop": 4,
|
|
1253
1236
|
"width": 12,
|
|
1254
1237
|
},
|
|
1255
1238
|
{},
|
|
@@ -1279,9 +1262,7 @@ exports[`Button renders correctly 14`] = `
|
|
|
1279
1262
|
"backgroundColor": "#cb300a",
|
|
1280
1263
|
"borderRadius": 8,
|
|
1281
1264
|
"height": 12,
|
|
1282
|
-
"marginBottom": 4,
|
|
1283
1265
|
"marginHorizontal": 8,
|
|
1284
|
-
"marginTop": 4,
|
|
1285
1266
|
"width": 12,
|
|
1286
1267
|
},
|
|
1287
1268
|
{},
|
|
@@ -1311,9 +1292,7 @@ exports[`Button renders correctly 14`] = `
|
|
|
1311
1292
|
"backgroundColor": "#cb300a",
|
|
1312
1293
|
"borderRadius": 8,
|
|
1313
1294
|
"height": 12,
|
|
1314
|
-
"marginBottom": 4,
|
|
1315
1295
|
"marginHorizontal": 8,
|
|
1316
|
-
"marginTop": 4,
|
|
1317
1296
|
"width": 12,
|
|
1318
1297
|
},
|
|
1319
1298
|
{},
|
|
@@ -1350,6 +1329,7 @@ exports[`Button renders correctly 15`] = `
|
|
|
1350
1329
|
"borderRadius": 4,
|
|
1351
1330
|
"borderWidth": 0,
|
|
1352
1331
|
"flexDirection": "row",
|
|
1332
|
+
"height": 60,
|
|
1353
1333
|
"justifyContent": "center",
|
|
1354
1334
|
"padding": 12,
|
|
1355
1335
|
},
|
|
@@ -1416,6 +1396,7 @@ exports[`Button renders loading icon 1`] = `
|
|
|
1416
1396
|
"backgroundColor": "#401960",
|
|
1417
1397
|
"borderRadius": 32,
|
|
1418
1398
|
"flexDirection": "row",
|
|
1399
|
+
"height": 60,
|
|
1419
1400
|
"justifyContent": "center",
|
|
1420
1401
|
"padding": 16,
|
|
1421
1402
|
},
|
|
@@ -1432,7 +1413,6 @@ exports[`Button renders loading icon 1`] = `
|
|
|
1432
1413
|
"alignItems": "center",
|
|
1433
1414
|
"flexDirection": "row",
|
|
1434
1415
|
"justifyContent": "center",
|
|
1435
|
-
"paddingVertical": 1,
|
|
1436
1416
|
},
|
|
1437
1417
|
{},
|
|
1438
1418
|
]
|
|
@@ -1460,9 +1440,7 @@ exports[`Button renders loading icon 1`] = `
|
|
|
1460
1440
|
"backgroundColor": "#ffffff",
|
|
1461
1441
|
"borderRadius": 8,
|
|
1462
1442
|
"height": 12,
|
|
1463
|
-
"marginBottom": 4,
|
|
1464
1443
|
"marginHorizontal": 8,
|
|
1465
|
-
"marginTop": 4,
|
|
1466
1444
|
"width": 12,
|
|
1467
1445
|
},
|
|
1468
1446
|
{},
|
|
@@ -1492,9 +1470,7 @@ exports[`Button renders loading icon 1`] = `
|
|
|
1492
1470
|
"backgroundColor": "#ffffff",
|
|
1493
1471
|
"borderRadius": 8,
|
|
1494
1472
|
"height": 12,
|
|
1495
|
-
"marginBottom": 4,
|
|
1496
1473
|
"marginHorizontal": 8,
|
|
1497
|
-
"marginTop": 4,
|
|
1498
1474
|
"width": 12,
|
|
1499
1475
|
},
|
|
1500
1476
|
{},
|
|
@@ -1524,9 +1500,7 @@ exports[`Button renders loading icon 1`] = `
|
|
|
1524
1500
|
"backgroundColor": "#ffffff",
|
|
1525
1501
|
"borderRadius": 8,
|
|
1526
1502
|
"height": 12,
|
|
1527
|
-
"marginBottom": 4,
|
|
1528
1503
|
"marginHorizontal": 8,
|
|
1529
|
-
"marginTop": 4,
|
|
1530
1504
|
"width": 12,
|
|
1531
1505
|
},
|
|
1532
1506
|
{},
|
|
@@ -19,6 +19,7 @@ exports[`StyledButtonContainer has filled-danger style 1`] = `
|
|
|
19
19
|
"backgroundColor": "#cb300a",
|
|
20
20
|
"borderRadius": 32,
|
|
21
21
|
"flexDirection": "row",
|
|
22
|
+
"height": 60,
|
|
22
23
|
"justifyContent": "center",
|
|
23
24
|
"padding": 16,
|
|
24
25
|
},
|
|
@@ -51,6 +52,7 @@ exports[`StyledButtonContainer has filled-primary style 1`] = `
|
|
|
51
52
|
"backgroundColor": "#401960",
|
|
52
53
|
"borderRadius": 32,
|
|
53
54
|
"flexDirection": "row",
|
|
55
|
+
"height": 60,
|
|
54
56
|
"justifyContent": "center",
|
|
55
57
|
"padding": 16,
|
|
56
58
|
},
|
|
@@ -83,6 +85,7 @@ exports[`StyledButtonContainer has filled-secondary style 1`] = `
|
|
|
83
85
|
"backgroundColor": "#795e90",
|
|
84
86
|
"borderRadius": 32,
|
|
85
87
|
"flexDirection": "row",
|
|
88
|
+
"height": 60,
|
|
86
89
|
"justifyContent": "center",
|
|
87
90
|
"padding": 16,
|
|
88
91
|
},
|
|
@@ -117,6 +120,7 @@ exports[`StyledButtonContainer has outlined-danger style 1`] = `
|
|
|
117
120
|
"borderRadius": 32,
|
|
118
121
|
"borderWidth": 2,
|
|
119
122
|
"flexDirection": "row",
|
|
123
|
+
"height": 60,
|
|
120
124
|
"justifyContent": "center",
|
|
121
125
|
"padding": 14,
|
|
122
126
|
},
|
|
@@ -151,6 +155,7 @@ exports[`StyledButtonContainer has outlined-primary style 1`] = `
|
|
|
151
155
|
"borderRadius": 32,
|
|
152
156
|
"borderWidth": 2,
|
|
153
157
|
"flexDirection": "row",
|
|
158
|
+
"height": 60,
|
|
154
159
|
"justifyContent": "center",
|
|
155
160
|
"padding": 14,
|
|
156
161
|
},
|
|
@@ -185,6 +190,7 @@ exports[`StyledButtonContainer has outlined-secondary style 1`] = `
|
|
|
185
190
|
"borderRadius": 32,
|
|
186
191
|
"borderWidth": 2,
|
|
187
192
|
"flexDirection": "row",
|
|
193
|
+
"height": 60,
|
|
188
194
|
"justifyContent": "center",
|
|
189
195
|
"padding": 14,
|
|
190
196
|
},
|
|
@@ -217,6 +223,7 @@ exports[`StyledButtonContainer has text-danger style 1`] = `
|
|
|
217
223
|
"borderRadius": 4,
|
|
218
224
|
"borderWidth": 0,
|
|
219
225
|
"flexDirection": "row",
|
|
226
|
+
"height": 60,
|
|
220
227
|
"justifyContent": "center",
|
|
221
228
|
"padding": 12,
|
|
222
229
|
},
|
|
@@ -249,6 +256,7 @@ exports[`StyledButtonContainer has text-primary style 1`] = `
|
|
|
249
256
|
"borderRadius": 4,
|
|
250
257
|
"borderWidth": 0,
|
|
251
258
|
"flexDirection": "row",
|
|
259
|
+
"height": 60,
|
|
252
260
|
"justifyContent": "center",
|
|
253
261
|
"padding": 12,
|
|
254
262
|
},
|
|
@@ -281,6 +289,7 @@ exports[`StyledButtonContainer has text-secondary style 1`] = `
|
|
|
281
289
|
"borderRadius": 4,
|
|
282
290
|
"borderWidth": 0,
|
|
283
291
|
"flexDirection": "row",
|
|
292
|
+
"height": 60,
|
|
284
293
|
"justifyContent": "center",
|
|
285
294
|
"padding": 12,
|
|
286
295
|
},
|
|
@@ -318,6 +327,7 @@ exports[`StyledButtonContainer renders disabled correctly 1`] = `
|
|
|
318
327
|
"backgroundColor": "#bfc1c5",
|
|
319
328
|
"borderRadius": 32,
|
|
320
329
|
"flexDirection": "row",
|
|
330
|
+
"height": 60,
|
|
321
331
|
"justifyContent": "center",
|
|
322
332
|
"padding": 16,
|
|
323
333
|
},
|
|
@@ -622,6 +622,7 @@ exports[`Carousel renders correctly with pageControlPosition bottom 1`] = `
|
|
|
622
622
|
"backgroundColor": "#401960",
|
|
623
623
|
"borderRadius": 32,
|
|
624
624
|
"flexDirection": "row",
|
|
625
|
+
"height": 60,
|
|
625
626
|
"justifyContent": "center",
|
|
626
627
|
"padding": 16,
|
|
627
628
|
},
|
|
@@ -1475,6 +1476,7 @@ exports[`Carousel renders correctly with pageControlPosition top 1`] = `
|
|
|
1475
1476
|
"backgroundColor": "#401960",
|
|
1476
1477
|
"borderRadius": 32,
|
|
1477
1478
|
"flexDirection": "row",
|
|
1479
|
+
"height": 60,
|
|
1478
1480
|
"justifyContent": "center",
|
|
1479
1481
|
"padding": 16,
|
|
1480
1482
|
},
|
|
@@ -2235,6 +2237,7 @@ exports[`Carousel should call skip call back when press skip 1`] = `
|
|
|
2235
2237
|
"backgroundColor": "#401960",
|
|
2236
2238
|
"borderRadius": 32,
|
|
2237
2239
|
"flexDirection": "row",
|
|
2240
|
+
"height": 60,
|
|
2238
2241
|
"justifyContent": "center",
|
|
2239
2242
|
"padding": 16,
|
|
2240
2243
|
},
|
|
@@ -4,7 +4,7 @@ import { ImageResizeMode } from 'react-native';
|
|
|
4
4
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
5
5
|
import Carousel from '..';
|
|
6
6
|
import Image from '../../Image';
|
|
7
|
-
import {
|
|
7
|
+
import { ThemeProvider, theme } from '../../..';
|
|
8
8
|
import Button from '../../Button/Button';
|
|
9
9
|
|
|
10
10
|
const carouselData = [
|
|
@@ -144,15 +144,13 @@ describe('Carousel', () => {
|
|
|
144
144
|
);
|
|
145
145
|
rerender(
|
|
146
146
|
<ThemeProvider theme={theme}>
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
/>
|
|
155
|
-
</Portal.Provider>
|
|
147
|
+
<Carousel
|
|
148
|
+
testID="carousel"
|
|
149
|
+
items={carouselData}
|
|
150
|
+
renderActions={(_) => {
|
|
151
|
+
return <Button text="Skip" onPress={onSkip} />;
|
|
152
|
+
}}
|
|
153
|
+
/>
|
|
156
154
|
</ThemeProvider>
|
|
157
155
|
);
|
|
158
156
|
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import styled from '@emotion/native';
|
|
2
|
+
import { TouchableOpacity } from 'react-native';
|
|
3
|
+
import Box from '../Box';
|
|
4
|
+
import Icon from '../Icon';
|
|
5
|
+
import Typography from '../Typography';
|
|
6
|
+
|
|
7
|
+
type StyledChipWrapperProps = {
|
|
8
|
+
themeVariant?: 'outlined' | 'filled';
|
|
9
|
+
themeSelected?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const StyledChipWrapper = styled(TouchableOpacity)<StyledChipWrapperProps>(
|
|
13
|
+
({ themeVariant, themeSelected, theme }) => {
|
|
14
|
+
const getShadowStyles = () => {
|
|
15
|
+
switch (themeVariant) {
|
|
16
|
+
case 'filled':
|
|
17
|
+
return {
|
|
18
|
+
...theme.__hd__.chip.shadows.filledWrapper,
|
|
19
|
+
};
|
|
20
|
+
case 'outlined':
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const getBorderStyles = () => {
|
|
26
|
+
const commonStyle = {
|
|
27
|
+
borderWidth: theme.__hd__.chip.sizes.wrapperBorder,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
if (themeSelected) {
|
|
31
|
+
return {
|
|
32
|
+
...commonStyle,
|
|
33
|
+
borderColor: theme.__hd__.chip.colors.wrapperSelectedBorder,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
switch (themeVariant) {
|
|
38
|
+
case 'outlined': {
|
|
39
|
+
return {
|
|
40
|
+
...commonStyle,
|
|
41
|
+
borderColor: theme.__hd__.chip.colors.wrapperBorder,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
case 'filled': {
|
|
45
|
+
return {
|
|
46
|
+
...commonStyle,
|
|
47
|
+
borderColor: theme.__hd__.chip.colors.wrapperSelectedBorder,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const getBackgroundStyles = () => {
|
|
54
|
+
if (themeSelected) {
|
|
55
|
+
switch (themeVariant) {
|
|
56
|
+
case 'outlined': {
|
|
57
|
+
return {
|
|
58
|
+
backgroundColor: theme.__hd__.chip.colors.primaryBackground,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
case 'filled':
|
|
62
|
+
return {
|
|
63
|
+
backgroundColor: theme.__hd__.chip.colors.secondaryBackground,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
switch (themeVariant) {
|
|
68
|
+
case 'outlined': {
|
|
69
|
+
return {
|
|
70
|
+
backgroundColor: theme.__hd__.chip.colors.outlinedBackground,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
case 'filled':
|
|
74
|
+
return {
|
|
75
|
+
backgroundColor: theme.__hd__.chip.colors.filledBackground,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
alignSelf: 'flex-start',
|
|
83
|
+
flexDirection: 'row',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
justifyContent: 'center',
|
|
86
|
+
borderRadius: theme.__hd__.chip.radii.wrapper,
|
|
87
|
+
paddingVertical: theme.__hd__.chip.space.wrapperVerticalPadding,
|
|
88
|
+
paddingHorizontal: theme.__hd__.chip.space.wrapperHorizontalPadding,
|
|
89
|
+
borderWidth: theme.__hd__.chip.sizes.wrapperBorder,
|
|
90
|
+
...getShadowStyles(),
|
|
91
|
+
...getBorderStyles(),
|
|
92
|
+
...getBackgroundStyles(),
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
const StyledIconWrapper = styled(Box)(({ theme }) => ({
|
|
98
|
+
marginRight: theme.__hd__.chip.space.iconWrapperMarginRight,
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
const StyledLabel = styled(Typography.Body)<{
|
|
102
|
+
themeSelected?: boolean;
|
|
103
|
+
themeVariant?: 'outlined' | 'filled';
|
|
104
|
+
}>(({ themeSelected, themeVariant, theme }) => ({
|
|
105
|
+
color:
|
|
106
|
+
themeSelected && themeVariant === 'outlined'
|
|
107
|
+
? theme.__hd__.chip.colors.selectedPrimaryText
|
|
108
|
+
: undefined,
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
const StyledIcon = styled(Icon)<{
|
|
112
|
+
themeSelected?: boolean;
|
|
113
|
+
themeVariant?: 'outlined' | 'filled';
|
|
114
|
+
}>(({ themeSelected, themeVariant, theme }) => ({
|
|
115
|
+
color:
|
|
116
|
+
themeSelected && themeVariant === 'outlined'
|
|
117
|
+
? theme.__hd__.chip.colors.selectedPrimaryText
|
|
118
|
+
: undefined,
|
|
119
|
+
}));
|
|
120
|
+
|
|
121
|
+
export { StyledChipWrapper, StyledIcon, StyledIconWrapper, StyledLabel };
|