@hero-design/rn-work-uikit 1.7.1 → 1.7.3
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 +18 -0
- package/lib/index.js +649 -137
- package/package.json +3 -3
- package/src/components/DatePicker/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/FormGroup/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/Select/__tests__/__snapshots__/index.spec.tsx.snap +2 -2
- package/src/components/TextInput/InputComponent.tsx +8 -3
- package/src/components/TextInput/InputRow.tsx +1 -0
- package/src/components/TextInput/__tests__/InputComponent.spec.tsx +2 -0
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +17 -17
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +12 -2
- package/stats/1.7.3/rn-work-uikit-stats.html +4844 -0
- package/stats/1.7.1/rn-work-uikit-stats.html +0 -4844
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn-work-uikit",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
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.108.0",
|
|
27
27
|
"hero-editor": "^1.16.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"react-native-safe-area-context": "4.12.0",
|
|
110
110
|
"react-native-svg": "15.8.0",
|
|
111
111
|
"react-native-vector-icons": "^9.1.0",
|
|
112
|
-
"react-native-webview": "13.
|
|
112
|
+
"react-native-webview": "^13.16.0",
|
|
113
113
|
"react-test-renderer": "18.2.0",
|
|
114
114
|
"rollup": "^4.24.3",
|
|
115
115
|
"rollup-plugin-copy": "^3.5.0",
|
|
@@ -235,7 +235,7 @@ exports[`DatePicker renders correctly (snapshot) 1`] = `
|
|
|
235
235
|
onChangeText={[Function]}
|
|
236
236
|
onFocus={[Function]}
|
|
237
237
|
placeholder=" "
|
|
238
|
-
placeholderTextColor="#
|
|
238
|
+
placeholderTextColor="#001f23"
|
|
239
239
|
style={
|
|
240
240
|
[
|
|
241
241
|
[
|
|
@@ -887,7 +887,7 @@ exports[`Dialog renders DatePickerAndroid when OS is android 1`] = `
|
|
|
887
887
|
onChangeText={[Function]}
|
|
888
888
|
onFocus={[Function]}
|
|
889
889
|
placeholder=" "
|
|
890
|
-
placeholderTextColor="#
|
|
890
|
+
placeholderTextColor="#001f23"
|
|
891
891
|
style={
|
|
892
892
|
[
|
|
893
893
|
[
|
|
@@ -1221,7 +1221,7 @@ exports[`Dialog renders DatePickerIOS when OS is iOS 1`] = `
|
|
|
1221
1221
|
onChangeText={[Function]}
|
|
1222
1222
|
onFocus={[Function]}
|
|
1223
1223
|
placeholder=" "
|
|
1224
|
-
placeholderTextColor="#
|
|
1224
|
+
placeholderTextColor="#001f23"
|
|
1225
1225
|
style={
|
|
1226
1226
|
[
|
|
1227
1227
|
[
|
|
@@ -211,7 +211,7 @@ exports[`FormGroup should render: xxx 1`] = `
|
|
|
211
211
|
onChangeText={[Function]}
|
|
212
212
|
onFocus={[Function]}
|
|
213
213
|
placeholder=" "
|
|
214
|
-
placeholderTextColor="#
|
|
214
|
+
placeholderTextColor="#001f23"
|
|
215
215
|
style={
|
|
216
216
|
[
|
|
217
217
|
[
|
|
@@ -499,7 +499,7 @@ exports[`FormGroup should render: xxx 1`] = `
|
|
|
499
499
|
onChangeText={[Function]}
|
|
500
500
|
onFocus={[Function]}
|
|
501
501
|
placeholder=" "
|
|
502
|
-
placeholderTextColor="#
|
|
502
|
+
placeholderTextColor="#001f23"
|
|
503
503
|
style={
|
|
504
504
|
[
|
|
505
505
|
[
|
|
@@ -839,7 +839,7 @@ exports[`FormGroup should render: xxx 1`] = `
|
|
|
839
839
|
onChangeText={[Function]}
|
|
840
840
|
onFocus={[Function]}
|
|
841
841
|
placeholder=" "
|
|
842
|
-
placeholderTextColor="#
|
|
842
|
+
placeholderTextColor="#001f23"
|
|
843
843
|
style={
|
|
844
844
|
[
|
|
845
845
|
[
|
|
@@ -238,7 +238,7 @@ exports[`MultiSelect renders correctly (snapshot) 1`] = `
|
|
|
238
238
|
onChangeText={[Function]}
|
|
239
239
|
onFocus={[Function]}
|
|
240
240
|
placeholder=" "
|
|
241
|
-
placeholderTextColor="#
|
|
241
|
+
placeholderTextColor="#001f23"
|
|
242
242
|
pointerEvents="none"
|
|
243
243
|
style={
|
|
244
244
|
[
|
|
@@ -937,7 +937,7 @@ exports[`Select renders correctly (snapshot) 1`] = `
|
|
|
937
937
|
onChangeText={[Function]}
|
|
938
938
|
onFocus={[Function]}
|
|
939
939
|
placeholder=" "
|
|
940
|
-
placeholderTextColor="#
|
|
940
|
+
placeholderTextColor="#001f23"
|
|
941
941
|
pointerEvents="none"
|
|
942
942
|
style={
|
|
943
943
|
[
|
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
TextInput as RNTextInput,
|
|
4
4
|
TextInputProps as RNTextInputProps,
|
|
5
5
|
} from 'react-native';
|
|
6
|
+
import type { State } from '@hero-design/rn/src/components/TextInput/StyledTextInput';
|
|
6
7
|
import { StyledTextInput } from './StyledTextInput';
|
|
7
8
|
import { useTheme } from '../../theme';
|
|
8
9
|
import type {
|
|
@@ -15,10 +16,11 @@ interface DefaultTextInputProps {
|
|
|
15
16
|
variant: TextInputVariant;
|
|
16
17
|
/** Native TextInput props */
|
|
17
18
|
nativeInputProps: NativeTextInputProps;
|
|
19
|
+
state: State;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
const DefaultTextInput = React.forwardRef<TextInputRef, DefaultTextInputProps>(
|
|
21
|
-
({ variant, nativeInputProps }, ref) => {
|
|
23
|
+
({ variant, nativeInputProps, state }, ref) => {
|
|
22
24
|
const theme = useTheme();
|
|
23
25
|
const inputRef = useRef<RNTextInput>(null);
|
|
24
26
|
useImperativeHandle(
|
|
@@ -42,7 +44,7 @@ const DefaultTextInput = React.forwardRef<TextInputRef, DefaultTextInputProps>(
|
|
|
42
44
|
themeVariant={variant}
|
|
43
45
|
multiline={variant === 'textarea' || nativeInputProps.multiline}
|
|
44
46
|
ref={inputRef}
|
|
45
|
-
placeholderTextColor={theme.__hd__.textInput.colors.placeholder}
|
|
47
|
+
placeholderTextColor={theme.__hd__.textInput.colors.placeholder[state]}
|
|
46
48
|
/>
|
|
47
49
|
);
|
|
48
50
|
}
|
|
@@ -58,6 +60,8 @@ export interface InputComponentProps {
|
|
|
58
60
|
inputProps: NativeTextInputProps,
|
|
59
61
|
ref?: React.ForwardedRef<TextInputRef>
|
|
60
62
|
) => React.ReactNode;
|
|
63
|
+
/** Current state of the input (default, filled, disabled, readonly, error) */
|
|
64
|
+
state: State;
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
/**
|
|
@@ -83,7 +87,7 @@ export interface InputComponentProps {
|
|
|
83
87
|
* @param props - The component props (see InputComponentProps interface for details)
|
|
84
88
|
*/
|
|
85
89
|
const InputComponent = React.forwardRef<TextInputRef, InputComponentProps>(
|
|
86
|
-
({ variant, nativeInputProps, renderInputValue }, ref) => {
|
|
90
|
+
({ variant, nativeInputProps, renderInputValue, state }, ref) => {
|
|
87
91
|
if (renderInputValue) {
|
|
88
92
|
return <>{renderInputValue({ ...nativeInputProps }, ref)}</>;
|
|
89
93
|
}
|
|
@@ -92,6 +96,7 @@ const InputComponent = React.forwardRef<TextInputRef, InputComponentProps>(
|
|
|
92
96
|
variant={variant}
|
|
93
97
|
nativeInputProps={nativeInputProps}
|
|
94
98
|
ref={ref}
|
|
99
|
+
state={state}
|
|
95
100
|
/>
|
|
96
101
|
);
|
|
97
102
|
}
|
|
@@ -18,6 +18,7 @@ describe('InputComponent', () => {
|
|
|
18
18
|
/>
|
|
19
19
|
)}
|
|
20
20
|
ref={ref}
|
|
21
|
+
state="default"
|
|
21
22
|
/>
|
|
22
23
|
);
|
|
23
24
|
expect(wrapper.queryAllByTestId('custom-text-input')).toHaveLength(1);
|
|
@@ -31,6 +32,7 @@ describe('InputComponent', () => {
|
|
|
31
32
|
variant="textarea"
|
|
32
33
|
nativeInputProps={{ testID: 'text-input', value: 'text input value' }}
|
|
33
34
|
ref={ref}
|
|
35
|
+
state="default"
|
|
34
36
|
/>
|
|
35
37
|
);
|
|
36
38
|
expect(wrapper.queryAllByTestId('text-input')).toHaveLength(1);
|
|
@@ -238,7 +238,7 @@ exports[`TextInput when user applies custom styling should respect user-provided
|
|
|
238
238
|
onChangeText={[Function]}
|
|
239
239
|
onFocus={[Function]}
|
|
240
240
|
placeholder=" "
|
|
241
|
-
placeholderTextColor="#
|
|
241
|
+
placeholderTextColor="#001f23"
|
|
242
242
|
style={
|
|
243
243
|
[
|
|
244
244
|
[
|
|
@@ -573,7 +573,7 @@ exports[`TextInput when user chooses textarea variant should provide multiline t
|
|
|
573
573
|
onChangeText={[Function]}
|
|
574
574
|
onFocus={[Function]}
|
|
575
575
|
placeholder=" "
|
|
576
|
-
placeholderTextColor="#
|
|
576
|
+
placeholderTextColor="#001f23"
|
|
577
577
|
style={
|
|
578
578
|
[
|
|
579
579
|
[
|
|
@@ -851,7 +851,7 @@ exports[`TextInput when user encounters a disabled field should display content
|
|
|
851
851
|
onChangeText={[Function]}
|
|
852
852
|
onFocus={[Function]}
|
|
853
853
|
placeholder=" "
|
|
854
|
-
placeholderTextColor="#
|
|
854
|
+
placeholderTextColor="#bfc1c5"
|
|
855
855
|
style={
|
|
856
856
|
[
|
|
857
857
|
[
|
|
@@ -1178,7 +1178,7 @@ exports[`TextInput when user encounters a read-only field should display content
|
|
|
1178
1178
|
onChangeText={[Function]}
|
|
1179
1179
|
onFocus={[Function]}
|
|
1180
1180
|
placeholder=" "
|
|
1181
|
-
placeholderTextColor="#
|
|
1181
|
+
placeholderTextColor="#001f23"
|
|
1182
1182
|
style={
|
|
1183
1183
|
[
|
|
1184
1184
|
[
|
|
@@ -1540,7 +1540,7 @@ exports[`TextInput when user has entered text should show the input content and
|
|
|
1540
1540
|
onChangeText={[Function]}
|
|
1541
1541
|
onFocus={[Function]}
|
|
1542
1542
|
placeholder=" "
|
|
1543
|
-
placeholderTextColor="#
|
|
1543
|
+
placeholderTextColor="#001f23"
|
|
1544
1544
|
style={
|
|
1545
1545
|
[
|
|
1546
1546
|
[
|
|
@@ -1873,7 +1873,7 @@ exports[`TextInput when user interacts with placeholder text starting from empty
|
|
|
1873
1873
|
onChangeText={[Function]}
|
|
1874
1874
|
onFocus={[Function]}
|
|
1875
1875
|
placeholder=" "
|
|
1876
|
-
placeholderTextColor="#
|
|
1876
|
+
placeholderTextColor="#001f23"
|
|
1877
1877
|
style={
|
|
1878
1878
|
[
|
|
1879
1879
|
[
|
|
@@ -2172,7 +2172,7 @@ exports[`TextInput when user needs programmatic control should provide ref metho
|
|
|
2172
2172
|
onChangeText={[Function]}
|
|
2173
2173
|
onFocus={[Function]}
|
|
2174
2174
|
placeholder=" "
|
|
2175
|
-
placeholderTextColor="#
|
|
2175
|
+
placeholderTextColor="#001f23"
|
|
2176
2176
|
style={
|
|
2177
2177
|
[
|
|
2178
2178
|
[
|
|
@@ -2472,7 +2472,7 @@ exports[`TextInput when user provides default values starting with pre-filled co
|
|
|
2472
2472
|
onChangeText={[Function]}
|
|
2473
2473
|
onFocus={[Function]}
|
|
2474
2474
|
placeholder=" "
|
|
2475
|
-
placeholderTextColor="#
|
|
2475
|
+
placeholderTextColor="#001f23"
|
|
2476
2476
|
style={
|
|
2477
2477
|
[
|
|
2478
2478
|
[
|
|
@@ -2827,7 +2827,7 @@ exports[`TextInput when user provides default values when both default and contr
|
|
|
2827
2827
|
onChangeText={[Function]}
|
|
2828
2828
|
onFocus={[Function]}
|
|
2829
2829
|
placeholder=" "
|
|
2830
|
-
placeholderTextColor="#
|
|
2830
|
+
placeholderTextColor="#001f23"
|
|
2831
2831
|
style={
|
|
2832
2832
|
[
|
|
2833
2833
|
[
|
|
@@ -3210,7 +3210,7 @@ exports[`TextInput when user sees a loading state should show loading indicator
|
|
|
3210
3210
|
onChangeText={[Function]}
|
|
3211
3211
|
onFocus={[Function]}
|
|
3212
3212
|
placeholder=" "
|
|
3213
|
-
placeholderTextColor="#
|
|
3213
|
+
placeholderTextColor="#001f23"
|
|
3214
3214
|
style={
|
|
3215
3215
|
[
|
|
3216
3216
|
[
|
|
@@ -3562,7 +3562,7 @@ exports[`TextInput when user sees a required field should indicate the field is
|
|
|
3562
3562
|
onChangeText={[Function]}
|
|
3563
3563
|
onFocus={[Function]}
|
|
3564
3564
|
placeholder=" "
|
|
3565
|
-
placeholderTextColor="#
|
|
3565
|
+
placeholderTextColor="#001f23"
|
|
3566
3566
|
style={
|
|
3567
3567
|
[
|
|
3568
3568
|
[
|
|
@@ -3925,7 +3925,7 @@ exports[`TextInput when user sees a textarea with character count should display
|
|
|
3925
3925
|
onChangeText={[Function]}
|
|
3926
3926
|
onFocus={[Function]}
|
|
3927
3927
|
placeholder=" "
|
|
3928
|
-
placeholderTextColor="#
|
|
3928
|
+
placeholderTextColor="#001f23"
|
|
3929
3929
|
style={
|
|
3930
3930
|
[
|
|
3931
3931
|
[
|
|
@@ -4324,7 +4324,7 @@ exports[`TextInput when user sees a textarea with character count should hide ch
|
|
|
4324
4324
|
onChangeText={[Function]}
|
|
4325
4325
|
onFocus={[Function]}
|
|
4326
4326
|
placeholder=" "
|
|
4327
|
-
placeholderTextColor="#
|
|
4327
|
+
placeholderTextColor="#001f23"
|
|
4328
4328
|
style={
|
|
4329
4329
|
[
|
|
4330
4330
|
[
|
|
@@ -4688,7 +4688,7 @@ exports[`TextInput when user sees an empty input field should display label and
|
|
|
4688
4688
|
onChangeText={[Function]}
|
|
4689
4689
|
onFocus={[Function]}
|
|
4690
4690
|
placeholder=" "
|
|
4691
|
-
placeholderTextColor="#
|
|
4691
|
+
placeholderTextColor="#001f23"
|
|
4692
4692
|
style={
|
|
4693
4693
|
[
|
|
4694
4694
|
[
|
|
@@ -5020,7 +5020,7 @@ exports[`TextInput when user sees an error state should display error message to
|
|
|
5020
5020
|
onChangeText={[Function]}
|
|
5021
5021
|
onFocus={[Function]}
|
|
5022
5022
|
placeholder=" "
|
|
5023
|
-
placeholderTextColor="#
|
|
5023
|
+
placeholderTextColor="#001f23"
|
|
5024
5024
|
style={
|
|
5025
5025
|
[
|
|
5026
5026
|
[
|
|
@@ -5397,7 +5397,7 @@ exports[`TextInput when user sees helper text should display guidance text to as
|
|
|
5397
5397
|
onChangeText={[Function]}
|
|
5398
5398
|
onFocus={[Function]}
|
|
5399
5399
|
placeholder=" "
|
|
5400
|
-
placeholderTextColor="#
|
|
5400
|
+
placeholderTextColor="#001f23"
|
|
5401
5401
|
style={
|
|
5402
5402
|
[
|
|
5403
5403
|
[
|
|
@@ -5704,7 +5704,7 @@ exports[`TextInput when user sees input with custom prefix and suffix elements s
|
|
|
5704
5704
|
onChangeText={[Function]}
|
|
5705
5705
|
onFocus={[Function]}
|
|
5706
5706
|
placeholder=" "
|
|
5707
|
-
placeholderTextColor="#
|
|
5707
|
+
placeholderTextColor="#001f23"
|
|
5708
5708
|
style={
|
|
5709
5709
|
[
|
|
5710
5710
|
[
|
|
@@ -427,6 +427,9 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
427
427
|
"sizes": {
|
|
428
428
|
"indicatorWidth": 15.692307692307693,
|
|
429
429
|
},
|
|
430
|
+
"space": {
|
|
431
|
+
"dataCardContentPadding": 15.692307692307693,
|
|
432
|
+
},
|
|
430
433
|
},
|
|
431
434
|
"cardCarousel": {
|
|
432
435
|
"colors": {
|
|
@@ -1528,7 +1531,13 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
1528
1531
|
"focused": "#001f23",
|
|
1529
1532
|
"readonly": "#808f91",
|
|
1530
1533
|
},
|
|
1531
|
-
"placeholder":
|
|
1534
|
+
"placeholder": {
|
|
1535
|
+
"default": "#001f23",
|
|
1536
|
+
"disabled": "#bfc1c5",
|
|
1537
|
+
"error": "#001f23",
|
|
1538
|
+
"filled": "#001f23",
|
|
1539
|
+
"readonly": "#001f23",
|
|
1540
|
+
},
|
|
1532
1541
|
"text": "#001f23",
|
|
1533
1542
|
},
|
|
1534
1543
|
"fontSizes": {
|
|
@@ -1559,6 +1568,7 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
1559
1568
|
"containerMarginTop": 7.846153846153847,
|
|
1560
1569
|
"containerPadding": 15.692307692307693,
|
|
1561
1570
|
"errorAndHelpTextContainerHorizontalPadding": 15.692307692307693,
|
|
1571
|
+
"errorAndHelpTextContainerMarginTop": 1.9615384615384617,
|
|
1562
1572
|
"errorAndHelpTextContainerPaddingTop": 1.9615384615384617,
|
|
1563
1573
|
"errorContainerMarginRight": 3.9230769230769234,
|
|
1564
1574
|
"errorMarginLeft": 3.9230769230769234,
|
|
@@ -1677,7 +1687,7 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
1677
1687
|
"colors": {
|
|
1678
1688
|
"archived": "#606065",
|
|
1679
1689
|
"body": "#001f23",
|
|
1680
|
-
"danger": "#
|
|
1690
|
+
"danger": "#cb300a",
|
|
1681
1691
|
"disabled": "#bfc1c5",
|
|
1682
1692
|
"inactive": "#808f91",
|
|
1683
1693
|
"info": "#355bfb",
|