@hero-design/rn-work-uikit 1.2.0-alpha.1 → 1.2.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/CHANGELOG.md +8 -8
- package/lib/index.js +2102 -186
- package/package.json +2 -2
- package/rollup.config.mjs +0 -1
- package/src/__tests__/__snapshots__/index.spec.tsx.snap +10 -29
- package/src/components/TextInput/FloatingLabel.tsx +8 -2
- package/src/components/TextInput/Group/__tests__/__snapshots__/index.spec.tsx.snap +883 -0
- package/src/components/TextInput/Group/__tests__/index.spec.tsx +179 -0
- package/src/components/TextInput/Group/__tests__/utils.spec.ts +73 -0
- package/src/components/TextInput/Group/index.tsx +102 -0
- package/src/components/TextInput/Group/utils.ts +67 -0
- package/src/components/TextInput/InputRow.tsx +47 -29
- package/src/components/TextInput/MIGRATION.md +133 -0
- package/src/components/TextInput/StyledTextInput.tsx +36 -8
- package/src/components/TextInput/__tests__/FloatingLabel.spec.tsx +36 -46
- package/src/components/TextInput/__tests__/InputRow.spec.tsx +50 -95
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +559 -544
- package/src/components/TextInput/__tests__/index.spec.tsx +241 -262
- package/src/components/TextInput/index.tsx +39 -17
- package/src/components/TextInput/types.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn-work-uikit",
|
|
3
|
-
"version": "1.2.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@emotion/native": "^11.9.3",
|
|
24
24
|
"@emotion/primitives-core": "11.0.0",
|
|
25
25
|
"@emotion/react": "^11.9.3",
|
|
26
|
-
"@hero-design/rn": "^8.
|
|
26
|
+
"@hero-design/rn": "^8.102.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@hero-design/react-native-month-year-picker": "^8.43.1",
|
package/rollup.config.mjs
CHANGED
|
@@ -24,6 +24,9 @@ exports[`first test to ensure configure correctly should render TextInput with p
|
|
|
24
24
|
]
|
|
25
25
|
}
|
|
26
26
|
testID="text-input"
|
|
27
|
+
themeFocused={false}
|
|
28
|
+
themeHasError={false}
|
|
29
|
+
themeUseGroupStyleEnabled={false}
|
|
27
30
|
>
|
|
28
31
|
<View
|
|
29
32
|
pointerEvents="none"
|
|
@@ -66,7 +69,7 @@ exports[`first test to ensure configure correctly should render TextInput with p
|
|
|
66
69
|
]
|
|
67
70
|
}
|
|
68
71
|
>
|
|
69
|
-
<
|
|
72
|
+
<Pressable
|
|
70
73
|
style={
|
|
71
74
|
[
|
|
72
75
|
[
|
|
@@ -76,42 +79,20 @@ exports[`first test to ensure configure correctly should render TextInput with p
|
|
|
76
79
|
"flexGrow": 2,
|
|
77
80
|
"flexShrink": 1,
|
|
78
81
|
"gap": 3.9230769230769234,
|
|
82
|
+
"opacity": 1,
|
|
79
83
|
},
|
|
80
84
|
],
|
|
81
85
|
undefined,
|
|
82
86
|
]
|
|
83
87
|
}
|
|
88
|
+
themeOpacity={1}
|
|
84
89
|
>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
{
|
|
88
|
-
"opacity": {
|
|
89
|
-
"_offset": 0,
|
|
90
|
-
"_value": 0,
|
|
91
|
-
"addListener": [MockFunction],
|
|
92
|
-
"interpolate": [MockFunction],
|
|
93
|
-
"removeAllListeners": [MockFunction],
|
|
94
|
-
"removeListener": [MockFunction],
|
|
95
|
-
"setValue": [MockFunction],
|
|
96
|
-
},
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
/>
|
|
100
|
-
<AnimatedView
|
|
101
|
-
accessibilityElementsHidden={false}
|
|
90
|
+
<View />
|
|
91
|
+
<View
|
|
102
92
|
accessibilityLabel="Text input field"
|
|
103
93
|
style={
|
|
104
94
|
{
|
|
105
95
|
"flex": 1,
|
|
106
|
-
"opacity": {
|
|
107
|
-
"_offset": 0,
|
|
108
|
-
"_value": 0,
|
|
109
|
-
"addListener": [MockFunction],
|
|
110
|
-
"interpolate": [MockFunction],
|
|
111
|
-
"removeAllListeners": [MockFunction],
|
|
112
|
-
"removeListener": [MockFunction],
|
|
113
|
-
"setValue": [MockFunction],
|
|
114
|
-
},
|
|
115
96
|
}
|
|
116
97
|
}
|
|
117
98
|
testID="input-row-input-wrapper"
|
|
@@ -156,8 +137,8 @@ exports[`first test to ensure configure correctly should render TextInput with p
|
|
|
156
137
|
themeVariant="text"
|
|
157
138
|
value="test value"
|
|
158
139
|
/>
|
|
159
|
-
</
|
|
160
|
-
</
|
|
140
|
+
</View>
|
|
141
|
+
</Pressable>
|
|
161
142
|
<View
|
|
162
143
|
style={
|
|
163
144
|
[
|
|
@@ -97,7 +97,11 @@ const FloatingLabel: React.FC<FloatingLabelProps> = ({
|
|
|
97
97
|
},
|
|
98
98
|
]}
|
|
99
99
|
>
|
|
100
|
-
<Animated.View
|
|
100
|
+
<Animated.View
|
|
101
|
+
style={{
|
|
102
|
+
flexDirection: 'row',
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
101
105
|
<StyledLabel
|
|
102
106
|
nativeID={accessibilityLabelledBy}
|
|
103
107
|
testID="input-label"
|
|
@@ -108,8 +112,10 @@ const FloatingLabel: React.FC<FloatingLabelProps> = ({
|
|
|
108
112
|
}}
|
|
109
113
|
>
|
|
110
114
|
{label}
|
|
111
|
-
{!required && ' (Optional)'}
|
|
112
115
|
</StyledLabel>
|
|
116
|
+
{!required ? (
|
|
117
|
+
<StyledLabel themeState={state}>{' (Optional)'}</StyledLabel>
|
|
118
|
+
) : null}
|
|
113
119
|
</Animated.View>
|
|
114
120
|
</StyledFloatingLabelContainer>
|
|
115
121
|
);
|