@hero-design/rn 7.8.0 → 7.10.1
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 +741 -258
- package/lib/assets/fonts/hero-icons.ttf +0 -0
- package/lib/index.js +740 -257
- package/package.json +2 -2
- package/src/components/Button/Button.tsx +10 -2
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +7 -1
- package/src/components/Button/LoadingIndicator/__tests__/StyledLoadingIndicator.spec.tsx +3 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/StyledLoadingIndicator.spec.tsx.snap +60 -0
- package/src/components/Button/LoadingIndicator/__tests__/__snapshots__/index.spec.tsx.snap +363 -0
- package/src/components/Button/LoadingIndicator/__tests__/index.spec.tsx +3 -0
- package/src/components/Button/LoadingIndicator/index.tsx +4 -1
- package/src/components/Button/StyledButton.tsx +57 -1
- package/src/components/Button/UtilityButton/__tests__/__snapshots__/index.spec.tsx.snap +167 -0
- package/src/components/Button/UtilityButton/__tests__/index.spec.tsx +55 -0
- package/src/components/Button/UtilityButton/index.tsx +53 -0
- package/src/components/Button/UtilityButton/styled.tsx +25 -0
- package/src/components/Button/__tests__/Button.spec.tsx +3 -0
- package/src/components/Button/__tests__/StyledButton.spec.tsx +18 -0
- package/src/components/Button/__tests__/__snapshots__/StyledButton.spec.tsx.snap +468 -0
- package/src/components/Button/index.tsx +3 -0
- package/src/components/Card/DataCard/StyledDataCard.tsx +1 -3
- package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +0 -1
- package/src/components/Card/DataCard/__tests__/__snapshots__/index.spec.tsx.snap +0 -5
- package/src/components/Card/StyledCard.tsx +1 -3
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +0 -1
- package/src/components/Icon/HeroIcon/index.tsx +3 -1
- package/src/components/Icon/HeroIcon/selection.json +1 -1
- package/src/components/Icon/IconList.ts +2 -0
- package/src/components/Icon/index.tsx +2 -1
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +248 -94
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +248 -94
- package/src/components/TextInput/StyledTextInput.tsx +133 -11
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +143 -7
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +922 -15
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +2078 -0
- package/src/components/TextInput/__tests__/index.spec.tsx +302 -11
- package/src/components/TextInput/index.tsx +232 -28
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +73 -3
- package/src/theme/components/button.ts +6 -0
- package/src/theme/components/card.ts +5 -1
- package/src/theme/components/icon.ts +1 -0
- package/src/theme/components/textInput.ts +62 -3
- package/src/theme/global/colors.ts +1 -0
- package/src/types.ts +8 -1
- package/types/components/Button/Button.d.ts +2 -2
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +1 -1
- package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +1 -1
- package/types/components/{Select/MultiSelect/__tests__/StyledMultiSelect.spec.d.ts → Button/UtilityButton/__tests__/index.spec.d.ts} +0 -0
- package/types/components/Button/UtilityButton/index.d.ts +23 -0
- package/types/components/Button/UtilityButton/styled.d.ts +17 -0
- package/types/components/Button/index.d.ts +2 -0
- package/types/components/Icon/HeroIcon/index.d.ts +1 -1
- 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/components/TextInput/StyledTextInput.d.ts +82 -3
- package/types/components/TextInput/index.d.ts +33 -5
- package/types/theme/components/button.d.ts +6 -0
- package/types/theme/components/card.d.ts +3 -0
- package/types/theme/components/icon.d.ts +1 -0
- package/types/theme/components/textInput.d.ts +61 -2
- package/types/theme/global/colors.d.ts +1 -0
- package/types/theme/global/index.d.ts +1 -0
- package/types/types.d.ts +2 -1
- package/.expo/README.md +0 -15
- package/.expo/packager-info.json +0 -10
- package/.expo/prebuild/cached-packages.json +0 -4
- package/.expo/settings.json +0 -10
- package/.expo/xcodebuild-error.log +0 -2
- package/.expo/xcodebuild.log +0 -11199
- package/types/components/Select/MultiSelect/Footer.d.ts +0 -5
- package/types/components/Select/MultiSelect/StyledMultiSelect.d.ts +0 -26
- package/types/components/Select/MultiSelect/types.d.ts +0 -5
|
@@ -20,34 +20,54 @@ exports[`rendering renders correctly when bottom sheet is NOT visible 1`] = `
|
|
|
20
20
|
}
|
|
21
21
|
>
|
|
22
22
|
<View
|
|
23
|
+
pointerEvents="auto"
|
|
23
24
|
style={
|
|
24
25
|
Array [
|
|
25
26
|
Object {
|
|
26
|
-
"
|
|
27
|
-
"borderRadius": 8,
|
|
28
|
-
"borderWidth": 1,
|
|
29
|
-
"flexDirection": "row",
|
|
30
|
-
"padding": 16,
|
|
31
|
-
"position": "relative",
|
|
27
|
+
"marginVertical": 8,
|
|
32
28
|
"width": "100%",
|
|
33
29
|
},
|
|
34
30
|
undefined,
|
|
35
31
|
]
|
|
36
32
|
}
|
|
37
33
|
>
|
|
38
|
-
<
|
|
34
|
+
<View
|
|
39
35
|
style={
|
|
40
36
|
Array [
|
|
41
37
|
Object {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"letterSpacing": 0.36,
|
|
46
|
-
"lineHeight": 20,
|
|
38
|
+
"alignItems": "center",
|
|
39
|
+
"flexDirection": "row",
|
|
40
|
+
"padding": 16,
|
|
47
41
|
},
|
|
42
|
+
undefined,
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
>
|
|
46
|
+
<View
|
|
47
|
+
style={
|
|
48
|
+
Array [
|
|
49
|
+
Object {
|
|
50
|
+
"borderColor": "#8b8d92",
|
|
51
|
+
"borderRadius": 8,
|
|
52
|
+
"borderWidth": 1,
|
|
53
|
+
"bottom": 0,
|
|
54
|
+
"left": 0,
|
|
55
|
+
"position": "absolute",
|
|
56
|
+
"right": 0,
|
|
57
|
+
"top": 0,
|
|
58
|
+
},
|
|
59
|
+
undefined,
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
themeVariant="readonly"
|
|
63
|
+
/>
|
|
64
|
+
<View
|
|
65
|
+
pointerEvents="none"
|
|
66
|
+
style={
|
|
48
67
|
Array [
|
|
49
68
|
Object {
|
|
50
69
|
"backgroundColor": "#ffffff",
|
|
70
|
+
"flexDirection": "row",
|
|
51
71
|
"left": 16,
|
|
52
72
|
"paddingHorizontal": 4,
|
|
53
73
|
"position": "absolute",
|
|
@@ -55,49 +75,106 @@ exports[`rendering renders correctly when bottom sheet is NOT visible 1`] = `
|
|
|
55
75
|
"zIndex": 1,
|
|
56
76
|
},
|
|
57
77
|
undefined,
|
|
58
|
-
]
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
>
|
|
81
|
+
<Text
|
|
82
|
+
style={
|
|
83
|
+
Array [
|
|
84
|
+
Object {
|
|
85
|
+
"color": "#292a2b",
|
|
86
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
87
|
+
"fontSize": 12,
|
|
88
|
+
"letterSpacing": 0.36,
|
|
89
|
+
"lineHeight": 20,
|
|
90
|
+
},
|
|
91
|
+
Array [
|
|
92
|
+
Object {
|
|
93
|
+
"color": "#8b8d92",
|
|
94
|
+
},
|
|
95
|
+
undefined,
|
|
96
|
+
],
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
testID="input-label"
|
|
100
|
+
themeFontSize="small"
|
|
101
|
+
themeFontWeight="regular"
|
|
102
|
+
themeIntent="body"
|
|
103
|
+
themeVariant="readonly"
|
|
104
|
+
>
|
|
105
|
+
Allow notifications
|
|
106
|
+
</Text>
|
|
107
|
+
</View>
|
|
108
|
+
<View
|
|
109
|
+
style={
|
|
110
|
+
Array [
|
|
111
|
+
Object {
|
|
112
|
+
"alignItems": "center",
|
|
113
|
+
"alignSelf": "stretch",
|
|
114
|
+
"flexDirection": "row",
|
|
115
|
+
"flexGrow": 2,
|
|
116
|
+
},
|
|
117
|
+
undefined,
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
>
|
|
121
|
+
<TextInput
|
|
122
|
+
accessibilityState={
|
|
123
|
+
Object {
|
|
124
|
+
"disabled": false,
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
editable={false}
|
|
128
|
+
multiline={true}
|
|
129
|
+
onBlur={[Function]}
|
|
130
|
+
onChangeText={[Function]}
|
|
131
|
+
onFocus={[Function]}
|
|
132
|
+
onPressIn={[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="Monday"
|
|
149
|
+
/>
|
|
150
|
+
</View>
|
|
151
|
+
<HeroIcon
|
|
152
|
+
name="arrow-down"
|
|
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
|
|
72
168
|
style={
|
|
73
169
|
Array [
|
|
74
170
|
Object {
|
|
75
171
|
"flex": 1,
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
},
|
|
79
|
-
Object {
|
|
80
|
-
"color": "#292a2b",
|
|
81
|
-
},
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
testID="text-input"
|
|
85
|
-
value="Monday"
|
|
86
|
-
/>
|
|
87
|
-
<HeroIcon
|
|
88
|
-
name="arrow-down"
|
|
89
|
-
style={
|
|
90
|
-
Array [
|
|
91
|
-
Object {
|
|
92
|
-
"color": "#292a2b",
|
|
93
|
-
"fontSize": 16,
|
|
172
|
+
"flexDirection": "row",
|
|
173
|
+
"justifyContent": "space-between",
|
|
94
174
|
},
|
|
95
175
|
undefined,
|
|
96
176
|
]
|
|
97
177
|
}
|
|
98
|
-
testID="input-suffix"
|
|
99
|
-
themeIntent="text"
|
|
100
|
-
themeSize="xsmall"
|
|
101
178
|
/>
|
|
102
179
|
</View>
|
|
103
180
|
<Modal
|
|
@@ -743,34 +820,54 @@ exports[`rendering renders correctly when bottom sheet is visible 1`] = `
|
|
|
743
820
|
}
|
|
744
821
|
>
|
|
745
822
|
<View
|
|
823
|
+
pointerEvents="auto"
|
|
746
824
|
style={
|
|
747
825
|
Array [
|
|
748
826
|
Object {
|
|
749
|
-
"
|
|
750
|
-
"borderRadius": 8,
|
|
751
|
-
"borderWidth": 1,
|
|
752
|
-
"flexDirection": "row",
|
|
753
|
-
"padding": 16,
|
|
754
|
-
"position": "relative",
|
|
827
|
+
"marginVertical": 8,
|
|
755
828
|
"width": "100%",
|
|
756
829
|
},
|
|
757
830
|
undefined,
|
|
758
831
|
]
|
|
759
832
|
}
|
|
760
833
|
>
|
|
761
|
-
<
|
|
834
|
+
<View
|
|
762
835
|
style={
|
|
763
836
|
Array [
|
|
764
837
|
Object {
|
|
765
|
-
"
|
|
766
|
-
"
|
|
767
|
-
"
|
|
768
|
-
"letterSpacing": 0.36,
|
|
769
|
-
"lineHeight": 20,
|
|
838
|
+
"alignItems": "center",
|
|
839
|
+
"flexDirection": "row",
|
|
840
|
+
"padding": 16,
|
|
770
841
|
},
|
|
842
|
+
undefined,
|
|
843
|
+
]
|
|
844
|
+
}
|
|
845
|
+
>
|
|
846
|
+
<View
|
|
847
|
+
style={
|
|
848
|
+
Array [
|
|
849
|
+
Object {
|
|
850
|
+
"borderColor": "#8b8d92",
|
|
851
|
+
"borderRadius": 8,
|
|
852
|
+
"borderWidth": 1,
|
|
853
|
+
"bottom": 0,
|
|
854
|
+
"left": 0,
|
|
855
|
+
"position": "absolute",
|
|
856
|
+
"right": 0,
|
|
857
|
+
"top": 0,
|
|
858
|
+
},
|
|
859
|
+
undefined,
|
|
860
|
+
]
|
|
861
|
+
}
|
|
862
|
+
themeVariant="readonly"
|
|
863
|
+
/>
|
|
864
|
+
<View
|
|
865
|
+
pointerEvents="none"
|
|
866
|
+
style={
|
|
771
867
|
Array [
|
|
772
868
|
Object {
|
|
773
869
|
"backgroundColor": "#ffffff",
|
|
870
|
+
"flexDirection": "row",
|
|
774
871
|
"left": 16,
|
|
775
872
|
"paddingHorizontal": 4,
|
|
776
873
|
"position": "absolute",
|
|
@@ -778,49 +875,106 @@ exports[`rendering renders correctly when bottom sheet is visible 1`] = `
|
|
|
778
875
|
"zIndex": 1,
|
|
779
876
|
},
|
|
780
877
|
undefined,
|
|
781
|
-
]
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
878
|
+
]
|
|
879
|
+
}
|
|
880
|
+
>
|
|
881
|
+
<Text
|
|
882
|
+
style={
|
|
883
|
+
Array [
|
|
884
|
+
Object {
|
|
885
|
+
"color": "#292a2b",
|
|
886
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
887
|
+
"fontSize": 12,
|
|
888
|
+
"letterSpacing": 0.36,
|
|
889
|
+
"lineHeight": 20,
|
|
890
|
+
},
|
|
891
|
+
Array [
|
|
892
|
+
Object {
|
|
893
|
+
"color": "#8b8d92",
|
|
894
|
+
},
|
|
895
|
+
undefined,
|
|
896
|
+
],
|
|
897
|
+
]
|
|
898
|
+
}
|
|
899
|
+
testID="input-label"
|
|
900
|
+
themeFontSize="small"
|
|
901
|
+
themeFontWeight="regular"
|
|
902
|
+
themeIntent="body"
|
|
903
|
+
themeVariant="readonly"
|
|
904
|
+
>
|
|
905
|
+
Allow notifications
|
|
906
|
+
</Text>
|
|
907
|
+
</View>
|
|
908
|
+
<View
|
|
909
|
+
style={
|
|
910
|
+
Array [
|
|
911
|
+
Object {
|
|
912
|
+
"alignItems": "center",
|
|
913
|
+
"alignSelf": "stretch",
|
|
914
|
+
"flexDirection": "row",
|
|
915
|
+
"flexGrow": 2,
|
|
916
|
+
},
|
|
917
|
+
undefined,
|
|
918
|
+
]
|
|
919
|
+
}
|
|
920
|
+
>
|
|
921
|
+
<TextInput
|
|
922
|
+
accessibilityState={
|
|
923
|
+
Object {
|
|
924
|
+
"disabled": false,
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
editable={false}
|
|
928
|
+
multiline={true}
|
|
929
|
+
onBlur={[Function]}
|
|
930
|
+
onChangeText={[Function]}
|
|
931
|
+
onFocus={[Function]}
|
|
932
|
+
onPressIn={[Function]}
|
|
933
|
+
style={
|
|
934
|
+
Array [
|
|
935
|
+
Object {
|
|
936
|
+
"alignSelf": "stretch",
|
|
937
|
+
"flexGrow": 2,
|
|
938
|
+
"fontSize": 14,
|
|
939
|
+
"marginHorizontal": 8,
|
|
940
|
+
"textAlignVertical": "center",
|
|
941
|
+
},
|
|
942
|
+
Object {
|
|
943
|
+
"color": "#292a2b",
|
|
944
|
+
},
|
|
945
|
+
]
|
|
946
|
+
}
|
|
947
|
+
testID="text-input"
|
|
948
|
+
value="Monday"
|
|
949
|
+
/>
|
|
950
|
+
</View>
|
|
951
|
+
<HeroIcon
|
|
952
|
+
name="arrow-down"
|
|
953
|
+
style={
|
|
954
|
+
Array [
|
|
955
|
+
Object {
|
|
956
|
+
"color": "#292a2b",
|
|
957
|
+
"fontSize": 16,
|
|
958
|
+
},
|
|
959
|
+
undefined,
|
|
960
|
+
]
|
|
961
|
+
}
|
|
962
|
+
testID="input-suffix"
|
|
963
|
+
themeIntent="text"
|
|
964
|
+
themeSize="xsmall"
|
|
965
|
+
/>
|
|
966
|
+
</View>
|
|
967
|
+
<View
|
|
795
968
|
style={
|
|
796
969
|
Array [
|
|
797
970
|
Object {
|
|
798
971
|
"flex": 1,
|
|
799
|
-
"
|
|
800
|
-
"
|
|
801
|
-
},
|
|
802
|
-
Object {
|
|
803
|
-
"color": "#292a2b",
|
|
804
|
-
},
|
|
805
|
-
]
|
|
806
|
-
}
|
|
807
|
-
testID="text-input"
|
|
808
|
-
value="Monday"
|
|
809
|
-
/>
|
|
810
|
-
<HeroIcon
|
|
811
|
-
name="arrow-down"
|
|
812
|
-
style={
|
|
813
|
-
Array [
|
|
814
|
-
Object {
|
|
815
|
-
"color": "#292a2b",
|
|
816
|
-
"fontSize": 16,
|
|
972
|
+
"flexDirection": "row",
|
|
973
|
+
"justifyContent": "space-between",
|
|
817
974
|
},
|
|
818
975
|
undefined,
|
|
819
976
|
]
|
|
820
977
|
}
|
|
821
|
-
testID="input-suffix"
|
|
822
|
-
themeIntent="text"
|
|
823
|
-
themeSize="xsmall"
|
|
824
978
|
/>
|
|
825
979
|
</View>
|
|
826
980
|
<Modal
|
|
@@ -1,30 +1,152 @@
|
|
|
1
|
-
import { TextInput, View } from 'react-native';
|
|
1
|
+
import { TextInput, View, StyleSheet } from 'react-native';
|
|
2
2
|
import styled from '@emotion/native';
|
|
3
3
|
import Typography from '../Typography';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
export type Variant =
|
|
6
|
+
| 'default'
|
|
7
|
+
| 'filled'
|
|
8
|
+
| 'focused'
|
|
9
|
+
| 'disabled'
|
|
10
|
+
| 'readonly'
|
|
11
|
+
| 'error';
|
|
12
|
+
|
|
13
|
+
const StyledContainer = styled(View)(({ theme }) => ({
|
|
7
14
|
width: '100%',
|
|
8
|
-
|
|
9
|
-
borderRadius: theme.__hd__.textInput.radii.container,
|
|
10
|
-
padding: theme.__hd__.textInput.space.containerPadding,
|
|
11
|
-
flexDirection: 'row',
|
|
12
|
-
alignItems: 'center',
|
|
15
|
+
marginVertical: theme.__hd__.textInput.space.containerMarginVertical,
|
|
13
16
|
}));
|
|
14
17
|
|
|
15
|
-
const
|
|
18
|
+
const StyledLabelContainer = styled(View)(({ theme }) => ({
|
|
16
19
|
position: 'absolute',
|
|
20
|
+
flexDirection: 'row',
|
|
17
21
|
left: theme.__hd__.textInput.space.labelLeft,
|
|
18
22
|
top: theme.__hd__.textInput.space.labelTop,
|
|
19
23
|
backgroundColor: theme.__hd__.textInput.colors.labelBackground,
|
|
20
24
|
zIndex: 1,
|
|
21
25
|
paddingHorizontal: theme.__hd__.textInput.space.labelHorizontalPadding,
|
|
22
26
|
}));
|
|
27
|
+
const StyledLabel = styled(Typography.Text)<{
|
|
28
|
+
themeVariant: Variant;
|
|
29
|
+
}>(({ theme, themeVariant }) => ({
|
|
30
|
+
color: theme.__hd__.textInput.colors.labels[themeVariant],
|
|
31
|
+
}));
|
|
23
32
|
|
|
24
|
-
const
|
|
33
|
+
const StyledAsteriskLabel = styled(Typography.Text)<{
|
|
34
|
+
themeVariant: Variant;
|
|
35
|
+
}>(({ theme, themeVariant }) => ({
|
|
36
|
+
color: theme.__hd__.textInput.colors.asterisks[themeVariant],
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
const StyledLabelContainerInsideTextInput = styled(View)((): any => ({
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
zIndex: 9999,
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
...StyleSheet.absoluteFillObject,
|
|
44
|
+
}));
|
|
45
|
+
|
|
46
|
+
const StyledLabelInsideTextInput = styled(Typography.Text)<{
|
|
47
|
+
themeVariant: Variant;
|
|
48
|
+
}>(({ theme, themeVariant }) => ({
|
|
49
|
+
textAlignVertical: 'center',
|
|
50
|
+
alignContent: 'center',
|
|
51
|
+
fontSize: theme.__hd__.textInput.fontSizes.labelInsideTextInput,
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
color: theme.__hd__.textInput.colors.labelsInsideTextInput[themeVariant],
|
|
54
|
+
}));
|
|
55
|
+
|
|
56
|
+
const StyledAsteriskLabelInsideTextInput = styled(Typography.Text)<{
|
|
57
|
+
themeVariant: Variant;
|
|
58
|
+
}>(({ theme, themeVariant }) => ({
|
|
59
|
+
color: theme.__hd__.textInput.colors.asterisks[themeVariant],
|
|
60
|
+
fontSize: theme.__hd__.textInput.fontSizes.asteriskLabel,
|
|
61
|
+
}));
|
|
62
|
+
const StyledErrorContainer = styled(View)(({ theme }) => ({
|
|
63
|
+
marginLeft: theme.__hd__.textInput.space.errorContainerMarginLeft,
|
|
64
|
+
marginRight: theme.__hd__.textInput.space.errorContainerMarginRight,
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
flex: 1,
|
|
68
|
+
flexGrow: 4,
|
|
69
|
+
}));
|
|
70
|
+
|
|
71
|
+
const StyledError = styled(Typography.Text)(({ theme }) => ({
|
|
72
|
+
color: theme.__hd__.textInput.colors.error,
|
|
73
|
+
fontSize: theme.__hd__.textInput.fontSizes.error,
|
|
74
|
+
marginLeft: theme.__hd__.textInput.space.errorMarginLeft,
|
|
75
|
+
}));
|
|
76
|
+
|
|
77
|
+
const StyledMaxLengthMessage = styled(Typography.Text)<{
|
|
78
|
+
themeVariant: Variant;
|
|
79
|
+
}>(({ theme, themeVariant }) => ({
|
|
80
|
+
color: theme.__hd__.textInput.colors.maxLengthLabels[themeVariant],
|
|
81
|
+
fontSize: theme.__hd__.textInput.fontSizes.maxLength,
|
|
82
|
+
marginRight: theme.__hd__.textInput.space.maxLengthLabelMarginLeft,
|
|
83
|
+
alignSelf: 'flex-end',
|
|
25
84
|
flex: 1,
|
|
85
|
+
flexGrow: 1,
|
|
86
|
+
textAlign: 'right',
|
|
87
|
+
}));
|
|
88
|
+
|
|
89
|
+
const StyledHelperText = styled(Typography.Text)(({ theme }) => ({
|
|
90
|
+
fontSize: theme.__hd__.textInput.fontSizes.error,
|
|
91
|
+
marginLeft: theme.__hd__.textInput.space.errorMarginLeft,
|
|
92
|
+
}));
|
|
93
|
+
|
|
94
|
+
const StyledTextInput = styled(TextInput)(({ theme }) => ({
|
|
95
|
+
textAlignVertical: 'center',
|
|
26
96
|
fontSize: theme.__hd__.textInput.fontSizes.text,
|
|
97
|
+
alignSelf: 'stretch',
|
|
98
|
+
flexGrow: 2,
|
|
27
99
|
marginHorizontal: theme.__hd__.textInput.space.inputHorizontalMargin,
|
|
28
100
|
}));
|
|
29
101
|
|
|
30
|
-
|
|
102
|
+
const StyledBorderBackDrop = styled(View)<{
|
|
103
|
+
themeVariant: Variant;
|
|
104
|
+
}>(({ theme, themeVariant }) => ({
|
|
105
|
+
...StyleSheet.absoluteFillObject,
|
|
106
|
+
borderWidth:
|
|
107
|
+
themeVariant === 'focused'
|
|
108
|
+
? theme.__hd__.textInput.borderWidths.container.focused
|
|
109
|
+
: theme.__hd__.textInput.borderWidths.container.normal,
|
|
110
|
+
borderRadius: theme.__hd__.textInput.radii.container,
|
|
111
|
+
borderColor:
|
|
112
|
+
theme.__hd__.textInput.colors.borders[themeVariant] ??
|
|
113
|
+
theme.__hd__.textInput.colors.borders.default,
|
|
114
|
+
}));
|
|
115
|
+
|
|
116
|
+
const StyledTextInputContainer = styled(View)(({ theme }) => ({
|
|
117
|
+
flexDirection: 'row',
|
|
118
|
+
alignItems: 'center',
|
|
119
|
+
padding: theme.__hd__.textInput.space.containerPadding,
|
|
120
|
+
}));
|
|
121
|
+
|
|
122
|
+
const StyledTextInputAndLabelContainer = styled(View)(() => ({
|
|
123
|
+
flexDirection: 'row',
|
|
124
|
+
alignItems: 'center',
|
|
125
|
+
alignSelf: 'stretch',
|
|
126
|
+
flexGrow: 2,
|
|
127
|
+
}));
|
|
128
|
+
|
|
129
|
+
const StyledErrorAndHelpTextContainer = styled(View)(() => ({
|
|
130
|
+
flex: 1,
|
|
131
|
+
flexDirection: 'row',
|
|
132
|
+
justifyContent: 'space-between',
|
|
133
|
+
}));
|
|
134
|
+
|
|
135
|
+
export {
|
|
136
|
+
StyledTextInputContainer,
|
|
137
|
+
StyledLabel,
|
|
138
|
+
StyledLabelContainer,
|
|
139
|
+
StyledAsteriskLabel,
|
|
140
|
+
StyledAsteriskLabelInsideTextInput,
|
|
141
|
+
StyledTextInput,
|
|
142
|
+
StyledError,
|
|
143
|
+
StyledMaxLengthMessage,
|
|
144
|
+
StyledLabelInsideTextInput,
|
|
145
|
+
StyledContainer,
|
|
146
|
+
StyledErrorContainer,
|
|
147
|
+
StyledHelperText,
|
|
148
|
+
StyledTextInputAndLabelContainer,
|
|
149
|
+
StyledLabelContainerInsideTextInput,
|
|
150
|
+
StyledErrorAndHelpTextContainer,
|
|
151
|
+
StyledBorderBackDrop,
|
|
152
|
+
};
|