@hero-design/rn 7.22.1 → 7.22.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/.turbo/turbo-build.log +2 -2
- package/es/index.js +42 -46
- package/lib/index.js +42 -46
- package/package.json +4 -4
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +4 -18
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +4 -18
- package/src/components/List/StyledBasicListItem.tsx +1 -0
- package/src/components/List/__tests__/BasicListItem.spec.tsx +37 -13
- package/src/components/List/__tests__/__snapshots__/BasicListItem.spec.tsx.snap +162 -1
- package/src/components/List/__tests__/__snapshots__/StyledBasicListItem.spec.tsx.snap +6 -2
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +2 -2
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +3 -1
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +4 -1
- package/src/components/RichTextEditor/RichTextEditor.tsx +1 -3
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +8 -36
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +2 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +17 -5
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +56 -98
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +2 -1
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +16 -4
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +52 -94
- package/src/components/TextInput/StyledTextInput.tsx +11 -16
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +3 -3
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +18 -36
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +55 -237
- package/src/components/TextInput/index.tsx +27 -27
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +4 -18
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +4 -18
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +4 -2
- package/src/theme/components/list.ts +5 -2
- package/src/theme/global/colors/swag.ts +1 -0
- package/src/theme/global/colors/types.ts +1 -0
- package/types/components/TextInput/StyledTextInput.d.ts +3 -9
- package/types/components/TextInput/index.d.ts +4 -4
- package/types/theme/components/list.d.ts +1 -0
- package/types/theme/global/colors/types.d.ts +1 -0
- package/types/theme/global/index.d.ts +1 -0
|
@@ -6,12 +6,16 @@ exports[`TextInput defaultValue TextInput is idle renders correctly 1`] = `
|
|
|
6
6
|
style={
|
|
7
7
|
Array [
|
|
8
8
|
Object {
|
|
9
|
+
"borderColor": "#001f23",
|
|
10
|
+
"borderRadius": 8,
|
|
11
|
+
"borderWidth": 1,
|
|
9
12
|
"marginVertical": 8,
|
|
10
13
|
"width": "100%",
|
|
11
14
|
},
|
|
12
15
|
undefined,
|
|
13
16
|
]
|
|
14
17
|
}
|
|
18
|
+
themeVariant="filled"
|
|
15
19
|
>
|
|
16
20
|
<View
|
|
17
21
|
style={
|
|
@@ -25,24 +29,6 @@ exports[`TextInput defaultValue TextInput is idle renders correctly 1`] = `
|
|
|
25
29
|
]
|
|
26
30
|
}
|
|
27
31
|
>
|
|
28
|
-
<View
|
|
29
|
-
style={
|
|
30
|
-
Array [
|
|
31
|
-
Object {
|
|
32
|
-
"borderColor": "#001f23",
|
|
33
|
-
"borderRadius": 8,
|
|
34
|
-
"borderWidth": 1,
|
|
35
|
-
"bottom": 0,
|
|
36
|
-
"left": 0,
|
|
37
|
-
"position": "absolute",
|
|
38
|
-
"right": 0,
|
|
39
|
-
"top": 0,
|
|
40
|
-
},
|
|
41
|
-
undefined,
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
themeVariant="filled"
|
|
45
|
-
/>
|
|
46
32
|
<View
|
|
47
33
|
pointerEvents="none"
|
|
48
34
|
style={
|
|
@@ -260,12 +246,16 @@ exports[`TextInput defaultValue default Value and Value renders correctly with 2
|
|
|
260
246
|
style={
|
|
261
247
|
Array [
|
|
262
248
|
Object {
|
|
249
|
+
"borderColor": "#001f23",
|
|
250
|
+
"borderRadius": 8,
|
|
251
|
+
"borderWidth": 1,
|
|
263
252
|
"marginVertical": 8,
|
|
264
253
|
"width": "100%",
|
|
265
254
|
},
|
|
266
255
|
undefined,
|
|
267
256
|
]
|
|
268
257
|
}
|
|
258
|
+
themeVariant="filled"
|
|
269
259
|
>
|
|
270
260
|
<View
|
|
271
261
|
style={
|
|
@@ -279,24 +269,6 @@ exports[`TextInput defaultValue default Value and Value renders correctly with 2
|
|
|
279
269
|
]
|
|
280
270
|
}
|
|
281
271
|
>
|
|
282
|
-
<View
|
|
283
|
-
style={
|
|
284
|
-
Array [
|
|
285
|
-
Object {
|
|
286
|
-
"borderColor": "#001f23",
|
|
287
|
-
"borderRadius": 8,
|
|
288
|
-
"borderWidth": 1,
|
|
289
|
-
"bottom": 0,
|
|
290
|
-
"left": 0,
|
|
291
|
-
"position": "absolute",
|
|
292
|
-
"right": 0,
|
|
293
|
-
"top": 0,
|
|
294
|
-
},
|
|
295
|
-
undefined,
|
|
296
|
-
]
|
|
297
|
-
}
|
|
298
|
-
themeVariant="filled"
|
|
299
|
-
/>
|
|
300
272
|
<View
|
|
301
273
|
pointerEvents="none"
|
|
302
274
|
style={
|
|
@@ -515,6 +487,9 @@ exports[`TextInput disabled renders correctly 1`] = `
|
|
|
515
487
|
style={
|
|
516
488
|
Array [
|
|
517
489
|
Object {
|
|
490
|
+
"borderColor": "#bfc1c5",
|
|
491
|
+
"borderRadius": 8,
|
|
492
|
+
"borderWidth": 1,
|
|
518
493
|
"marginVertical": 8,
|
|
519
494
|
"width": "100%",
|
|
520
495
|
},
|
|
@@ -522,6 +497,7 @@ exports[`TextInput disabled renders correctly 1`] = `
|
|
|
522
497
|
]
|
|
523
498
|
}
|
|
524
499
|
testID="disabled-text-input"
|
|
500
|
+
themeVariant="disabled"
|
|
525
501
|
>
|
|
526
502
|
<View
|
|
527
503
|
style={
|
|
@@ -535,24 +511,6 @@ exports[`TextInput disabled renders correctly 1`] = `
|
|
|
535
511
|
]
|
|
536
512
|
}
|
|
537
513
|
>
|
|
538
|
-
<View
|
|
539
|
-
style={
|
|
540
|
-
Array [
|
|
541
|
-
Object {
|
|
542
|
-
"borderColor": "#bfc1c5",
|
|
543
|
-
"borderRadius": 8,
|
|
544
|
-
"borderWidth": 1,
|
|
545
|
-
"bottom": 0,
|
|
546
|
-
"left": 0,
|
|
547
|
-
"position": "absolute",
|
|
548
|
-
"right": 0,
|
|
549
|
-
"top": 0,
|
|
550
|
-
},
|
|
551
|
-
undefined,
|
|
552
|
-
]
|
|
553
|
-
}
|
|
554
|
-
themeVariant="disabled"
|
|
555
|
-
/>
|
|
556
514
|
<View
|
|
557
515
|
pointerEvents="none"
|
|
558
516
|
style={
|
|
@@ -696,12 +654,16 @@ exports[`TextInput error renders correctly 1`] = `
|
|
|
696
654
|
style={
|
|
697
655
|
Array [
|
|
698
656
|
Object {
|
|
657
|
+
"borderColor": "#de350b",
|
|
658
|
+
"borderRadius": 8,
|
|
659
|
+
"borderWidth": 1,
|
|
699
660
|
"marginVertical": 8,
|
|
700
661
|
"width": "100%",
|
|
701
662
|
},
|
|
702
663
|
undefined,
|
|
703
664
|
]
|
|
704
665
|
}
|
|
666
|
+
themeVariant="error"
|
|
705
667
|
>
|
|
706
668
|
<View
|
|
707
669
|
style={
|
|
@@ -715,24 +677,6 @@ exports[`TextInput error renders correctly 1`] = `
|
|
|
715
677
|
]
|
|
716
678
|
}
|
|
717
679
|
>
|
|
718
|
-
<View
|
|
719
|
-
style={
|
|
720
|
-
Array [
|
|
721
|
-
Object {
|
|
722
|
-
"borderColor": "#de350b",
|
|
723
|
-
"borderRadius": 8,
|
|
724
|
-
"borderWidth": 1,
|
|
725
|
-
"bottom": 0,
|
|
726
|
-
"left": 0,
|
|
727
|
-
"position": "absolute",
|
|
728
|
-
"right": 0,
|
|
729
|
-
"top": 0,
|
|
730
|
-
},
|
|
731
|
-
undefined,
|
|
732
|
-
]
|
|
733
|
-
}
|
|
734
|
-
themeVariant="error"
|
|
735
|
-
/>
|
|
736
680
|
<HeroIcon
|
|
737
681
|
name="dollar-sign"
|
|
738
682
|
style={
|
|
@@ -954,12 +898,16 @@ exports[`TextInput filled renders correctly 1`] = `
|
|
|
954
898
|
style={
|
|
955
899
|
Array [
|
|
956
900
|
Object {
|
|
901
|
+
"borderColor": "#001f23",
|
|
902
|
+
"borderRadius": 8,
|
|
903
|
+
"borderWidth": 1,
|
|
957
904
|
"marginVertical": 8,
|
|
958
905
|
"width": "100%",
|
|
959
906
|
},
|
|
960
907
|
undefined,
|
|
961
908
|
]
|
|
962
909
|
}
|
|
910
|
+
themeVariant="filled"
|
|
963
911
|
>
|
|
964
912
|
<View
|
|
965
913
|
style={
|
|
@@ -973,24 +921,6 @@ exports[`TextInput filled renders correctly 1`] = `
|
|
|
973
921
|
]
|
|
974
922
|
}
|
|
975
923
|
>
|
|
976
|
-
<View
|
|
977
|
-
style={
|
|
978
|
-
Array [
|
|
979
|
-
Object {
|
|
980
|
-
"borderColor": "#001f23",
|
|
981
|
-
"borderRadius": 8,
|
|
982
|
-
"borderWidth": 1,
|
|
983
|
-
"bottom": 0,
|
|
984
|
-
"left": 0,
|
|
985
|
-
"position": "absolute",
|
|
986
|
-
"right": 0,
|
|
987
|
-
"top": 0,
|
|
988
|
-
},
|
|
989
|
-
undefined,
|
|
990
|
-
]
|
|
991
|
-
}
|
|
992
|
-
themeVariant="filled"
|
|
993
|
-
/>
|
|
994
924
|
<View
|
|
995
925
|
pointerEvents="none"
|
|
996
926
|
style={
|
|
@@ -1139,12 +1069,16 @@ exports[`TextInput helper text renders correctly 1`] = `
|
|
|
1139
1069
|
style={
|
|
1140
1070
|
Array [
|
|
1141
1071
|
Object {
|
|
1072
|
+
"borderColor": "#001f23",
|
|
1073
|
+
"borderRadius": 8,
|
|
1074
|
+
"borderWidth": 1,
|
|
1142
1075
|
"marginVertical": 8,
|
|
1143
1076
|
"width": "100%",
|
|
1144
1077
|
},
|
|
1145
1078
|
undefined,
|
|
1146
1079
|
]
|
|
1147
1080
|
}
|
|
1081
|
+
themeVariant="default"
|
|
1148
1082
|
>
|
|
1149
1083
|
<View
|
|
1150
1084
|
style={
|
|
@@ -1158,24 +1092,6 @@ exports[`TextInput helper text renders correctly 1`] = `
|
|
|
1158
1092
|
]
|
|
1159
1093
|
}
|
|
1160
1094
|
>
|
|
1161
|
-
<View
|
|
1162
|
-
style={
|
|
1163
|
-
Array [
|
|
1164
|
-
Object {
|
|
1165
|
-
"borderColor": "#001f23",
|
|
1166
|
-
"borderRadius": 8,
|
|
1167
|
-
"borderWidth": 1,
|
|
1168
|
-
"bottom": 0,
|
|
1169
|
-
"left": 0,
|
|
1170
|
-
"position": "absolute",
|
|
1171
|
-
"right": 0,
|
|
1172
|
-
"top": 0,
|
|
1173
|
-
},
|
|
1174
|
-
undefined,
|
|
1175
|
-
]
|
|
1176
|
-
}
|
|
1177
|
-
themeVariant="default"
|
|
1178
|
-
/>
|
|
1179
1095
|
<HeroIcon
|
|
1180
1096
|
name="dollar-sign"
|
|
1181
1097
|
style={
|
|
@@ -1363,13 +1279,19 @@ exports[`TextInput idle renders correctly 1`] = `
|
|
|
1363
1279
|
style={
|
|
1364
1280
|
Array [
|
|
1365
1281
|
Object {
|
|
1282
|
+
"borderColor": "#001f23",
|
|
1283
|
+
"borderRadius": 8,
|
|
1284
|
+
"borderWidth": 1,
|
|
1366
1285
|
"marginVertical": 8,
|
|
1367
1286
|
"width": "100%",
|
|
1368
1287
|
},
|
|
1369
|
-
|
|
1288
|
+
Object {
|
|
1289
|
+
"borderColor": "#de350b",
|
|
1290
|
+
},
|
|
1370
1291
|
]
|
|
1371
1292
|
}
|
|
1372
1293
|
testID="idle-text-input"
|
|
1294
|
+
themeVariant="default"
|
|
1373
1295
|
>
|
|
1374
1296
|
<View
|
|
1375
1297
|
style={
|
|
@@ -1383,26 +1305,6 @@ exports[`TextInput idle renders correctly 1`] = `
|
|
|
1383
1305
|
]
|
|
1384
1306
|
}
|
|
1385
1307
|
>
|
|
1386
|
-
<View
|
|
1387
|
-
style={
|
|
1388
|
-
Array [
|
|
1389
|
-
Object {
|
|
1390
|
-
"borderColor": "#001f23",
|
|
1391
|
-
"borderRadius": 8,
|
|
1392
|
-
"borderWidth": 1,
|
|
1393
|
-
"bottom": 0,
|
|
1394
|
-
"left": 0,
|
|
1395
|
-
"position": "absolute",
|
|
1396
|
-
"right": 0,
|
|
1397
|
-
"top": 0,
|
|
1398
|
-
},
|
|
1399
|
-
Object {
|
|
1400
|
-
"borderColor": "#de350b",
|
|
1401
|
-
},
|
|
1402
|
-
]
|
|
1403
|
-
}
|
|
1404
|
-
themeVariant="default"
|
|
1405
|
-
/>
|
|
1406
1308
|
<HeroIcon
|
|
1407
1309
|
name="dollar-sign"
|
|
1408
1310
|
style={
|
|
@@ -1555,12 +1457,16 @@ exports[`TextInput idle with suffix and prefix are React Element renders correct
|
|
|
1555
1457
|
style={
|
|
1556
1458
|
Array [
|
|
1557
1459
|
Object {
|
|
1460
|
+
"borderColor": "#001f23",
|
|
1461
|
+
"borderRadius": 8,
|
|
1462
|
+
"borderWidth": 1,
|
|
1558
1463
|
"marginVertical": 8,
|
|
1559
1464
|
"width": "100%",
|
|
1560
1465
|
},
|
|
1561
1466
|
undefined,
|
|
1562
1467
|
]
|
|
1563
1468
|
}
|
|
1469
|
+
themeVariant="default"
|
|
1564
1470
|
>
|
|
1565
1471
|
<View
|
|
1566
1472
|
style={
|
|
@@ -1574,24 +1480,6 @@ exports[`TextInput idle with suffix and prefix are React Element renders correct
|
|
|
1574
1480
|
]
|
|
1575
1481
|
}
|
|
1576
1482
|
>
|
|
1577
|
-
<View
|
|
1578
|
-
style={
|
|
1579
|
-
Array [
|
|
1580
|
-
Object {
|
|
1581
|
-
"borderColor": "#001f23",
|
|
1582
|
-
"borderRadius": 8,
|
|
1583
|
-
"borderWidth": 1,
|
|
1584
|
-
"bottom": 0,
|
|
1585
|
-
"left": 0,
|
|
1586
|
-
"position": "absolute",
|
|
1587
|
-
"right": 0,
|
|
1588
|
-
"top": 0,
|
|
1589
|
-
},
|
|
1590
|
-
undefined,
|
|
1591
|
-
]
|
|
1592
|
-
}
|
|
1593
|
-
themeVariant="default"
|
|
1594
|
-
/>
|
|
1595
1483
|
<HeroIcon
|
|
1596
1484
|
name="eye-circle"
|
|
1597
1485
|
style={
|
|
@@ -1770,12 +1658,16 @@ exports[`TextInput loading renders correctly 1`] = `
|
|
|
1770
1658
|
style={
|
|
1771
1659
|
Array [
|
|
1772
1660
|
Object {
|
|
1661
|
+
"borderColor": "#808f91",
|
|
1662
|
+
"borderRadius": 8,
|
|
1663
|
+
"borderWidth": 1,
|
|
1773
1664
|
"marginVertical": 8,
|
|
1774
1665
|
"width": "100%",
|
|
1775
1666
|
},
|
|
1776
1667
|
undefined,
|
|
1777
1668
|
]
|
|
1778
1669
|
}
|
|
1670
|
+
themeVariant="readonly"
|
|
1779
1671
|
>
|
|
1780
1672
|
<View
|
|
1781
1673
|
style={
|
|
@@ -1789,24 +1681,6 @@ exports[`TextInput loading renders correctly 1`] = `
|
|
|
1789
1681
|
]
|
|
1790
1682
|
}
|
|
1791
1683
|
>
|
|
1792
|
-
<View
|
|
1793
|
-
style={
|
|
1794
|
-
Array [
|
|
1795
|
-
Object {
|
|
1796
|
-
"borderColor": "#808f91",
|
|
1797
|
-
"borderRadius": 8,
|
|
1798
|
-
"borderWidth": 1,
|
|
1799
|
-
"bottom": 0,
|
|
1800
|
-
"left": 0,
|
|
1801
|
-
"position": "absolute",
|
|
1802
|
-
"right": 0,
|
|
1803
|
-
"top": 0,
|
|
1804
|
-
},
|
|
1805
|
-
undefined,
|
|
1806
|
-
]
|
|
1807
|
-
}
|
|
1808
|
-
themeVariant="readonly"
|
|
1809
|
-
/>
|
|
1810
1684
|
<View
|
|
1811
1685
|
style={
|
|
1812
1686
|
Array [
|
|
@@ -1927,12 +1801,16 @@ exports[`TextInput max length renders correctly 1`] = `
|
|
|
1927
1801
|
style={
|
|
1928
1802
|
Array [
|
|
1929
1803
|
Object {
|
|
1804
|
+
"borderColor": "#de350b",
|
|
1805
|
+
"borderRadius": 8,
|
|
1806
|
+
"borderWidth": 1,
|
|
1930
1807
|
"marginVertical": 8,
|
|
1931
1808
|
"width": "100%",
|
|
1932
1809
|
},
|
|
1933
1810
|
undefined,
|
|
1934
1811
|
]
|
|
1935
1812
|
}
|
|
1813
|
+
themeVariant="error"
|
|
1936
1814
|
>
|
|
1937
1815
|
<View
|
|
1938
1816
|
style={
|
|
@@ -1946,24 +1824,6 @@ exports[`TextInput max length renders correctly 1`] = `
|
|
|
1946
1824
|
]
|
|
1947
1825
|
}
|
|
1948
1826
|
>
|
|
1949
|
-
<View
|
|
1950
|
-
style={
|
|
1951
|
-
Array [
|
|
1952
|
-
Object {
|
|
1953
|
-
"borderColor": "#de350b",
|
|
1954
|
-
"borderRadius": 8,
|
|
1955
|
-
"borderWidth": 1,
|
|
1956
|
-
"bottom": 0,
|
|
1957
|
-
"left": 0,
|
|
1958
|
-
"position": "absolute",
|
|
1959
|
-
"right": 0,
|
|
1960
|
-
"top": 0,
|
|
1961
|
-
},
|
|
1962
|
-
undefined,
|
|
1963
|
-
]
|
|
1964
|
-
}
|
|
1965
|
-
themeVariant="error"
|
|
1966
|
-
/>
|
|
1967
1827
|
<View
|
|
1968
1828
|
pointerEvents="none"
|
|
1969
1829
|
style={
|
|
@@ -2200,12 +2060,16 @@ exports[`TextInput placeholder TextInput is idle renders correctly 1`] = `
|
|
|
2200
2060
|
style={
|
|
2201
2061
|
Array [
|
|
2202
2062
|
Object {
|
|
2063
|
+
"borderColor": "#001f23",
|
|
2064
|
+
"borderRadius": 8,
|
|
2065
|
+
"borderWidth": 1,
|
|
2203
2066
|
"marginVertical": 8,
|
|
2204
2067
|
"width": "100%",
|
|
2205
2068
|
},
|
|
2206
2069
|
undefined,
|
|
2207
2070
|
]
|
|
2208
2071
|
}
|
|
2072
|
+
themeVariant="default"
|
|
2209
2073
|
>
|
|
2210
2074
|
<View
|
|
2211
2075
|
style={
|
|
@@ -2219,24 +2083,6 @@ exports[`TextInput placeholder TextInput is idle renders correctly 1`] = `
|
|
|
2219
2083
|
]
|
|
2220
2084
|
}
|
|
2221
2085
|
>
|
|
2222
|
-
<View
|
|
2223
|
-
style={
|
|
2224
|
-
Array [
|
|
2225
|
-
Object {
|
|
2226
|
-
"borderColor": "#001f23",
|
|
2227
|
-
"borderRadius": 8,
|
|
2228
|
-
"borderWidth": 1,
|
|
2229
|
-
"bottom": 0,
|
|
2230
|
-
"left": 0,
|
|
2231
|
-
"position": "absolute",
|
|
2232
|
-
"right": 0,
|
|
2233
|
-
"top": 0,
|
|
2234
|
-
},
|
|
2235
|
-
undefined,
|
|
2236
|
-
]
|
|
2237
|
-
}
|
|
2238
|
-
themeVariant="default"
|
|
2239
|
-
/>
|
|
2240
2086
|
<HeroIcon
|
|
2241
2087
|
name="dollar-sign"
|
|
2242
2088
|
style={
|
|
@@ -2424,12 +2270,16 @@ exports[`TextInput readonly renders correctly 1`] = `
|
|
|
2424
2270
|
style={
|
|
2425
2271
|
Array [
|
|
2426
2272
|
Object {
|
|
2273
|
+
"borderColor": "#808f91",
|
|
2274
|
+
"borderRadius": 8,
|
|
2275
|
+
"borderWidth": 1,
|
|
2427
2276
|
"marginVertical": 8,
|
|
2428
2277
|
"width": "100%",
|
|
2429
2278
|
},
|
|
2430
2279
|
undefined,
|
|
2431
2280
|
]
|
|
2432
2281
|
}
|
|
2282
|
+
themeVariant="readonly"
|
|
2433
2283
|
>
|
|
2434
2284
|
<View
|
|
2435
2285
|
style={
|
|
@@ -2443,24 +2293,6 @@ exports[`TextInput readonly renders correctly 1`] = `
|
|
|
2443
2293
|
]
|
|
2444
2294
|
}
|
|
2445
2295
|
>
|
|
2446
|
-
<View
|
|
2447
|
-
style={
|
|
2448
|
-
Array [
|
|
2449
|
-
Object {
|
|
2450
|
-
"borderColor": "#808f91",
|
|
2451
|
-
"borderRadius": 8,
|
|
2452
|
-
"borderWidth": 1,
|
|
2453
|
-
"bottom": 0,
|
|
2454
|
-
"left": 0,
|
|
2455
|
-
"position": "absolute",
|
|
2456
|
-
"right": 0,
|
|
2457
|
-
"top": 0,
|
|
2458
|
-
},
|
|
2459
|
-
undefined,
|
|
2460
|
-
]
|
|
2461
|
-
}
|
|
2462
|
-
themeVariant="readonly"
|
|
2463
|
-
/>
|
|
2464
2296
|
<View
|
|
2465
2297
|
pointerEvents="none"
|
|
2466
2298
|
style={
|
|
@@ -2634,12 +2466,16 @@ exports[`TextInput required renders correctly 1`] = `
|
|
|
2634
2466
|
style={
|
|
2635
2467
|
Array [
|
|
2636
2468
|
Object {
|
|
2469
|
+
"borderColor": "#001f23",
|
|
2470
|
+
"borderRadius": 8,
|
|
2471
|
+
"borderWidth": 1,
|
|
2637
2472
|
"marginVertical": 8,
|
|
2638
2473
|
"width": "100%",
|
|
2639
2474
|
},
|
|
2640
2475
|
undefined,
|
|
2641
2476
|
]
|
|
2642
2477
|
}
|
|
2478
|
+
themeVariant="default"
|
|
2643
2479
|
>
|
|
2644
2480
|
<View
|
|
2645
2481
|
style={
|
|
@@ -2653,24 +2489,6 @@ exports[`TextInput required renders correctly 1`] = `
|
|
|
2653
2489
|
]
|
|
2654
2490
|
}
|
|
2655
2491
|
>
|
|
2656
|
-
<View
|
|
2657
|
-
style={
|
|
2658
|
-
Array [
|
|
2659
|
-
Object {
|
|
2660
|
-
"borderColor": "#001f23",
|
|
2661
|
-
"borderRadius": 8,
|
|
2662
|
-
"borderWidth": 1,
|
|
2663
|
-
"bottom": 0,
|
|
2664
|
-
"left": 0,
|
|
2665
|
-
"position": "absolute",
|
|
2666
|
-
"right": 0,
|
|
2667
|
-
"top": 0,
|
|
2668
|
-
},
|
|
2669
|
-
undefined,
|
|
2670
|
-
]
|
|
2671
|
-
}
|
|
2672
|
-
themeVariant="default"
|
|
2673
|
-
/>
|
|
2674
2492
|
<HeroIcon
|
|
2675
2493
|
name="dollar-sign"
|
|
2676
2494
|
style={
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { StyleSheet } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
3
|
import type {
|
|
4
4
|
TextInputProps as NativeTextInputProps,
|
|
5
5
|
StyleProp,
|
|
6
6
|
ViewStyle,
|
|
7
7
|
TextStyle,
|
|
8
|
-
} from
|
|
8
|
+
} from 'react-native';
|
|
9
9
|
import {
|
|
10
10
|
StyledTextInputContainer,
|
|
11
11
|
StyledLabel,
|
|
@@ -22,13 +22,12 @@ import {
|
|
|
22
22
|
StyledTextInputAndLabelContainer,
|
|
23
23
|
StyledLabelContainerInsideTextInput,
|
|
24
24
|
StyledErrorAndHelpTextContainer,
|
|
25
|
-
StyledBorderBackDrop,
|
|
26
25
|
StyledErrorAndMaxLengthContainer,
|
|
27
|
-
} from
|
|
28
|
-
import Icon from
|
|
29
|
-
import { useTheme } from
|
|
30
|
-
import type { Variant } from
|
|
31
|
-
import type { IconName } from
|
|
26
|
+
} from './StyledTextInput';
|
|
27
|
+
import Icon from '../Icon';
|
|
28
|
+
import { useTheme } from '../../theme';
|
|
29
|
+
import type { Variant } from './StyledTextInput';
|
|
30
|
+
import type { IconName } from '../Icon';
|
|
32
31
|
|
|
33
32
|
export interface TextInputProps extends NativeTextInputProps {
|
|
34
33
|
/**
|
|
@@ -114,21 +113,21 @@ export const getVariant = ({
|
|
|
114
113
|
isEmptyValue?: boolean;
|
|
115
114
|
}): Variant => {
|
|
116
115
|
if (disabled) {
|
|
117
|
-
return
|
|
116
|
+
return 'disabled';
|
|
118
117
|
}
|
|
119
118
|
if (error) {
|
|
120
|
-
return
|
|
119
|
+
return 'error';
|
|
121
120
|
}
|
|
122
121
|
if (!editable || loading) {
|
|
123
|
-
return
|
|
122
|
+
return 'readonly';
|
|
124
123
|
}
|
|
125
124
|
if (isFocused) {
|
|
126
|
-
return
|
|
125
|
+
return 'focused';
|
|
127
126
|
}
|
|
128
127
|
if (!isEmptyValue) {
|
|
129
|
-
return
|
|
128
|
+
return 'filled';
|
|
130
129
|
}
|
|
131
|
-
return
|
|
130
|
+
return 'default';
|
|
132
131
|
};
|
|
133
132
|
|
|
134
133
|
const TextInput = ({
|
|
@@ -151,9 +150,9 @@ const TextInput = ({
|
|
|
151
150
|
renderInputValue,
|
|
152
151
|
...nativeProps
|
|
153
152
|
}: TextInputProps): JSX.Element => {
|
|
154
|
-
const displayText = (value !== undefined ? value : defaultValue) ??
|
|
153
|
+
const displayText = (value !== undefined ? value : defaultValue) ?? '';
|
|
155
154
|
const isEmptyValue = displayText.length === 0;
|
|
156
|
-
const actualSuffix = loading ?
|
|
155
|
+
const actualSuffix = loading ? 'loading' : suffix;
|
|
157
156
|
|
|
158
157
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
159
158
|
|
|
@@ -175,9 +174,9 @@ const TextInput = ({
|
|
|
175
174
|
{ color: theme.__hd__.textInput.colors.text },
|
|
176
175
|
textStyle,
|
|
177
176
|
]),
|
|
178
|
-
testID:
|
|
177
|
+
testID: 'text-input',
|
|
179
178
|
accessibilityState: {
|
|
180
|
-
disabled: variant ===
|
|
179
|
+
disabled: variant === 'disabled' || variant === 'readonly',
|
|
181
180
|
},
|
|
182
181
|
// @ts-ignore
|
|
183
182
|
accessibilityLabelledBy,
|
|
@@ -197,18 +196,19 @@ const TextInput = ({
|
|
|
197
196
|
nativeProps.onChangeText?.(text);
|
|
198
197
|
},
|
|
199
198
|
defaultValue,
|
|
200
|
-
placeholder: variant ===
|
|
199
|
+
placeholder: variant === 'focused' ? nativeProps.placeholder : undefined,
|
|
201
200
|
};
|
|
202
201
|
|
|
203
202
|
return (
|
|
204
203
|
<StyledContainer
|
|
205
204
|
pointerEvents={
|
|
206
|
-
variant ===
|
|
205
|
+
variant === 'disabled' || variant === 'readonly' ? 'none' : 'auto'
|
|
207
206
|
}
|
|
208
207
|
testID={testID}
|
|
208
|
+
style={style}
|
|
209
|
+
themeVariant={variant}
|
|
209
210
|
>
|
|
210
211
|
<StyledTextInputContainer>
|
|
211
|
-
<StyledBorderBackDrop themeVariant={variant} style={style} />
|
|
212
212
|
{(isFocused || (label && !isEmptyValue)) && (
|
|
213
213
|
<StyledLabelContainer pointerEvents="none">
|
|
214
214
|
{required && (
|
|
@@ -228,9 +228,9 @@ const TextInput = ({
|
|
|
228
228
|
)}
|
|
229
229
|
</StyledLabelContainer>
|
|
230
230
|
)}
|
|
231
|
-
{typeof prefix ===
|
|
231
|
+
{typeof prefix === 'string' ? (
|
|
232
232
|
<Icon
|
|
233
|
-
intent={variant ===
|
|
233
|
+
intent={variant === 'disabled' ? 'disabled-text' : 'text'}
|
|
234
234
|
testID="input-prefix"
|
|
235
235
|
icon={prefix}
|
|
236
236
|
size="xsmall"
|
|
@@ -264,12 +264,12 @@ const TextInput = ({
|
|
|
264
264
|
<StyledTextInput {...nativeInputProps} />
|
|
265
265
|
)}
|
|
266
266
|
</StyledTextInputAndLabelContainer>
|
|
267
|
-
{typeof actualSuffix ===
|
|
267
|
+
{typeof actualSuffix === 'string' ? (
|
|
268
268
|
<Icon
|
|
269
|
-
intent={variant ===
|
|
269
|
+
intent={variant === 'disabled' ? 'disabled-text' : 'text'}
|
|
270
270
|
testID="input-suffix"
|
|
271
271
|
icon={actualSuffix}
|
|
272
|
-
spin={actualSuffix ===
|
|
272
|
+
spin={actualSuffix === 'loading'}
|
|
273
273
|
size="xsmall"
|
|
274
274
|
/>
|
|
275
275
|
) : (
|