@hero-design/rn 8.45.0-test.0 → 8.45.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 +2 -2
- package/CHANGELOG.md +23 -2
- package/es/index.js +764 -578
- package/lib/index.js +764 -578
- package/package.json +6 -6
- package/src/components/Accordion/index.tsx +1 -1
- package/src/components/Avatar/AvatarStack/StyledAvatarStack.tsx +63 -9
- package/src/components/Avatar/AvatarStack/__tests__/StyledAvatarStack.spec.tsx +71 -9
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/StyledAvatarStack.spec.tsx.snap +271 -2
- package/src/components/Avatar/AvatarStack/__tests__/__snapshots__/index.spec.tsx.snap +2156 -7
- package/src/components/Avatar/AvatarStack/__tests__/index.spec.tsx +140 -6
- package/src/components/Avatar/AvatarStack/index.tsx +94 -9
- package/src/components/Carousel/index.tsx +18 -11
- package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.spec.tsx.snap +108 -57
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +36 -19
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerCalendar.spec.tsx.snap +36 -19
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +36 -19
- package/src/components/RichTextEditor/RichTextEditor.tsx +89 -38
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +130 -102
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +247 -146
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +211 -127
- package/src/components/TextInput/StyledTextInput.tsx +9 -31
- package/src/components/TextInput/__tests__/StyledTextInput.spec.tsx +0 -44
- package/src/components/TextInput/__tests__/__snapshots__/StyledTextInput.spec.tsx.snap +21 -638
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +1159 -833
- package/src/components/TextInput/__tests__/index.spec.tsx +2 -2
- package/src/components/TextInput/index.tsx +128 -57
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +72 -38
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +72 -38
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +2 -2
- package/src/theme/components/textInput.ts +2 -2
- package/types/components/Accordion/index.d.ts +1 -1
- package/types/components/Avatar/AvatarStack/StyledAvatarStack.d.ts +13 -0
- package/types/components/Avatar/AvatarStack/index.d.ts +14 -2
- package/types/components/Avatar/index.d.ts +1 -1
- package/types/components/TextInput/StyledTextInput.d.ts +4 -24
- package/types/components/TextInput/index.d.ts +1 -0
|
@@ -432,10 +432,10 @@ describe('TextInput', () => {
|
|
|
432
432
|
expect(wrapper.getByTestId('text-input-border')).toHaveStyle({
|
|
433
433
|
backgroundColor: theme.colors.neutralGlobalSurface,
|
|
434
434
|
});
|
|
435
|
-
expect(wrapper.getByTestId('label
|
|
435
|
+
expect(wrapper.getByTestId('input-label')).toHaveStyle({
|
|
436
436
|
backgroundColor: theme.colors.neutralGlobalSurface,
|
|
437
437
|
});
|
|
438
|
-
expect(wrapper.
|
|
438
|
+
expect(wrapper.getByTestId('input-label-asterisk')).toHaveStyle({
|
|
439
439
|
backgroundColor: theme.colors.neutralGlobalSurface,
|
|
440
440
|
});
|
|
441
441
|
});
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
1
|
+
import React, {
|
|
2
|
+
useMemo,
|
|
3
|
+
forwardRef,
|
|
4
|
+
useRef,
|
|
5
|
+
useCallback,
|
|
6
|
+
useEffect,
|
|
7
|
+
} from 'react';
|
|
8
|
+
import {
|
|
9
|
+
StyleSheet,
|
|
10
|
+
TextInput as RNTextInput,
|
|
11
|
+
Animated,
|
|
12
|
+
Easing,
|
|
13
|
+
View,
|
|
14
|
+
} from 'react-native';
|
|
3
15
|
import type {
|
|
4
16
|
TextInputProps as NativeTextInputProps,
|
|
5
17
|
StyleProp,
|
|
6
18
|
ViewStyle,
|
|
7
19
|
TextStyle,
|
|
20
|
+
LayoutChangeEvent,
|
|
8
21
|
} from 'react-native';
|
|
9
22
|
import {
|
|
10
23
|
StyledTextInputContainer,
|
|
11
|
-
StyledLabel,
|
|
12
|
-
StyledLabelContainer,
|
|
13
24
|
StyledLabelInsideTextInput,
|
|
14
|
-
StyledAsteriskLabel,
|
|
15
25
|
StyledError,
|
|
16
26
|
StyledTextInput,
|
|
17
27
|
StyledContainer,
|
|
@@ -149,6 +159,8 @@ export const getState = ({
|
|
|
149
159
|
// https://github.com/callstack/react-native-paper/pull/3331
|
|
150
160
|
const EMPTY_PLACEHOLDER_VALUE = ' ';
|
|
151
161
|
|
|
162
|
+
export const LABEL_ANIMATION_DURATION = 150;
|
|
163
|
+
|
|
152
164
|
const TextInput = forwardRef<TextInputHandles, TextInputProps>(
|
|
153
165
|
(
|
|
154
166
|
{
|
|
@@ -180,6 +192,13 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
|
|
|
180
192
|
const isEmptyValue = displayText.length === 0;
|
|
181
193
|
const actualSuffix = loading ? 'loading' : suffix;
|
|
182
194
|
|
|
195
|
+
const [inputSize, setInputSize] = React.useState<{
|
|
196
|
+
height: number;
|
|
197
|
+
width: number;
|
|
198
|
+
}>({ height: 0, width: 0 });
|
|
199
|
+
const [labelWidth, setLabelWidth] = React.useState<number>(0);
|
|
200
|
+
const [prefixWidth, setPrefixWidth] = React.useState<number>(0);
|
|
201
|
+
|
|
183
202
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
184
203
|
|
|
185
204
|
const state = getState({
|
|
@@ -195,6 +214,31 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
|
|
|
195
214
|
|
|
196
215
|
const theme = useTheme();
|
|
197
216
|
|
|
217
|
+
const focusAnimation = useRef(new Animated.Value(0)).current;
|
|
218
|
+
|
|
219
|
+
useEffect(() => {
|
|
220
|
+
Animated.timing(focusAnimation, {
|
|
221
|
+
toValue: isFocused || !isEmptyValue ? 1 : 0,
|
|
222
|
+
duration: LABEL_ANIMATION_DURATION,
|
|
223
|
+
easing: Easing.bezier(0.4, 0, 0.2, 1),
|
|
224
|
+
useNativeDriver: true,
|
|
225
|
+
}).start();
|
|
226
|
+
}, [focusAnimation, isEmptyValue, isFocused]);
|
|
227
|
+
|
|
228
|
+
const onLayout = useCallback((event: LayoutChangeEvent) => {
|
|
229
|
+
const { height, width } = event.nativeEvent.layout;
|
|
230
|
+
setInputSize((prev) => ({ ...prev, height, width }));
|
|
231
|
+
}, []);
|
|
232
|
+
|
|
233
|
+
const onPrefixLayout = useCallback((event: LayoutChangeEvent) => {
|
|
234
|
+
const { width } = event.nativeEvent.layout;
|
|
235
|
+
setPrefixWidth(width);
|
|
236
|
+
}, []);
|
|
237
|
+
const onLabelLayout = useCallback((event: LayoutChangeEvent) => {
|
|
238
|
+
const { width } = event.nativeEvent.layout;
|
|
239
|
+
setLabelWidth(width);
|
|
240
|
+
}, []);
|
|
241
|
+
|
|
198
242
|
const innerTextInput = React.useRef<RNTextInput | undefined | null>();
|
|
199
243
|
React.useImperativeHandle(
|
|
200
244
|
ref,
|
|
@@ -293,66 +337,93 @@ const TextInput = forwardRef<TextInputHandles, TextInputProps>(
|
|
|
293
337
|
}
|
|
294
338
|
testID={testID}
|
|
295
339
|
>
|
|
296
|
-
<StyledTextInputContainer>
|
|
340
|
+
<StyledTextInputContainer onLayout={onLayout}>
|
|
297
341
|
<StyledBorderBackDrop
|
|
298
342
|
themeFocused={isFocused}
|
|
299
343
|
themeState={state}
|
|
300
344
|
testID="text-input-border"
|
|
301
345
|
style={[{ backgroundColor }, borderStyle]}
|
|
302
346
|
/>
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
347
|
+
|
|
348
|
+
<View onLayout={onPrefixLayout}>
|
|
349
|
+
{typeof prefix === 'string' ? (
|
|
350
|
+
<Icon
|
|
351
|
+
intent={state === 'disabled' ? 'disabled-text' : 'text'}
|
|
352
|
+
testID="input-prefix"
|
|
353
|
+
icon={prefix}
|
|
354
|
+
size="xsmall"
|
|
355
|
+
/>
|
|
356
|
+
) : (
|
|
357
|
+
prefix
|
|
358
|
+
)}
|
|
359
|
+
</View>
|
|
360
|
+
<StyledLabelContainerInsideTextInput
|
|
361
|
+
themeVariant={variant}
|
|
362
|
+
pointerEvents="none"
|
|
363
|
+
style={[
|
|
364
|
+
{
|
|
365
|
+
position: 'absolute',
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
transform: [
|
|
369
|
+
{
|
|
370
|
+
translateY: focusAnimation.interpolate({
|
|
371
|
+
inputRange: [0, 1],
|
|
372
|
+
outputRange: [
|
|
373
|
+
variant !== 'textarea'
|
|
374
|
+
? inputSize.height / 2
|
|
375
|
+
: theme.space.large,
|
|
376
|
+
0,
|
|
377
|
+
],
|
|
378
|
+
}),
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
translateX: focusAnimation.interpolate({
|
|
382
|
+
inputRange: [0, 1],
|
|
383
|
+
outputRange: [
|
|
384
|
+
-inputSize.width / 2 +
|
|
385
|
+
labelWidth / 2 +
|
|
386
|
+
prefixWidth +
|
|
387
|
+
theme.space.large,
|
|
388
|
+
-inputSize.width / 2 +
|
|
389
|
+
labelWidth / 2 +
|
|
390
|
+
theme.space.small,
|
|
391
|
+
],
|
|
392
|
+
}),
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
scale: focusAnimation.interpolate({
|
|
396
|
+
inputRange: [0, 1],
|
|
397
|
+
outputRange: [1, 0.75],
|
|
398
|
+
}),
|
|
399
|
+
},
|
|
400
|
+
],
|
|
401
|
+
},
|
|
402
|
+
]}
|
|
403
|
+
>
|
|
404
|
+
{required && (
|
|
405
|
+
<StyledAsteriskLabelInsideTextInput
|
|
406
|
+
style={{ backgroundColor }}
|
|
407
|
+
themeState={state}
|
|
408
|
+
testID="input-label-asterisk"
|
|
409
|
+
>
|
|
410
|
+
*
|
|
411
|
+
</StyledAsteriskLabelInsideTextInput>
|
|
412
|
+
)}
|
|
413
|
+
{!!label && (
|
|
414
|
+
<StyledLabelInsideTextInput
|
|
415
|
+
style={{ backgroundColor }}
|
|
416
|
+
nativeID={accessibilityLabelledBy}
|
|
417
|
+
testID="input-label"
|
|
418
|
+
themeState={state}
|
|
419
|
+
onLayout={onLabelLayout}
|
|
339
420
|
>
|
|
340
|
-
{
|
|
341
|
-
|
|
342
|
-
*
|
|
343
|
-
</StyledAsteriskLabelInsideTextInput>
|
|
344
|
-
)}
|
|
345
|
-
{!!label && (
|
|
346
|
-
<StyledLabelInsideTextInput
|
|
347
|
-
nativeID={accessibilityLabelledBy}
|
|
348
|
-
testID="input-label"
|
|
349
|
-
themeState={state}
|
|
350
|
-
>
|
|
351
|
-
{label}
|
|
352
|
-
</StyledLabelInsideTextInput>
|
|
353
|
-
)}
|
|
354
|
-
</StyledLabelContainerInsideTextInput>
|
|
421
|
+
{label}
|
|
422
|
+
</StyledLabelInsideTextInput>
|
|
355
423
|
)}
|
|
424
|
+
</StyledLabelContainerInsideTextInput>
|
|
425
|
+
|
|
426
|
+
<StyledTextInputAndLabelContainer>
|
|
356
427
|
{renderInputValue ? (
|
|
357
428
|
renderInputValue(nativeInputProps)
|
|
358
429
|
) : (
|
|
@@ -59,6 +59,7 @@ exports[`TimePickerAndroid renders correct with hide suffix 1`] = `
|
|
|
59
59
|
}
|
|
60
60
|
>
|
|
61
61
|
<View
|
|
62
|
+
onLayout={[Function]}
|
|
62
63
|
style={
|
|
63
64
|
[
|
|
64
65
|
{
|
|
@@ -98,40 +99,55 @@ exports[`TimePickerAndroid renders correct with hide suffix 1`] = `
|
|
|
98
99
|
themeState="filled"
|
|
99
100
|
/>
|
|
100
101
|
<View
|
|
102
|
+
onLayout={[Function]}
|
|
103
|
+
/>
|
|
104
|
+
<View
|
|
105
|
+
collapsable={false}
|
|
101
106
|
pointerEvents="none"
|
|
102
107
|
style={
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
{
|
|
109
|
+
"alignItems": "center",
|
|
110
|
+
"flexDirection": "row",
|
|
111
|
+
"justifyContent": "center",
|
|
112
|
+
"left": 0,
|
|
113
|
+
"position": "absolute",
|
|
114
|
+
"right": 0,
|
|
115
|
+
"top": -10.666666666666666,
|
|
116
|
+
"transform": [
|
|
117
|
+
{
|
|
118
|
+
"translateY": 0,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"translateX": 24,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"scale": 1,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
"zIndex": 1,
|
|
128
|
+
}
|
|
117
129
|
}
|
|
118
|
-
|
|
130
|
+
themeVariant="text"
|
|
119
131
|
>
|
|
120
132
|
<Text
|
|
121
133
|
allowFontScaling={false}
|
|
134
|
+
onLayout={[Function]}
|
|
122
135
|
style={
|
|
123
136
|
[
|
|
124
137
|
{
|
|
125
138
|
"color": "#001f23",
|
|
126
139
|
"fontFamily": "BeVietnamPro-Regular",
|
|
127
|
-
"fontSize":
|
|
140
|
+
"fontSize": 16,
|
|
128
141
|
"letterSpacing": 0.48,
|
|
129
|
-
"lineHeight":
|
|
142
|
+
"lineHeight": 24,
|
|
130
143
|
},
|
|
131
144
|
[
|
|
132
145
|
{
|
|
146
|
+
"alignContent": "center",
|
|
147
|
+
"alignItems": "center",
|
|
133
148
|
"color": "#001f23",
|
|
134
|
-
"
|
|
149
|
+
"marginTop": -2,
|
|
150
|
+
"textAlignVertical": "center",
|
|
135
151
|
},
|
|
136
152
|
{
|
|
137
153
|
"backgroundColor": "#ffffff",
|
|
@@ -140,9 +156,10 @@ exports[`TimePickerAndroid renders correct with hide suffix 1`] = `
|
|
|
140
156
|
]
|
|
141
157
|
}
|
|
142
158
|
testID="input-label"
|
|
143
|
-
themeFontWeight="regular"
|
|
144
159
|
themeIntent="body"
|
|
145
160
|
themeState="filled"
|
|
161
|
+
themeTypeface="neutral"
|
|
162
|
+
themeVariant="regular"
|
|
146
163
|
>
|
|
147
164
|
Break time
|
|
148
165
|
</Text>
|
|
@@ -327,6 +344,7 @@ exports[`TimePickerAndroid renders correctly 1`] = `
|
|
|
327
344
|
}
|
|
328
345
|
>
|
|
329
346
|
<View
|
|
347
|
+
onLayout={[Function]}
|
|
330
348
|
style={
|
|
331
349
|
[
|
|
332
350
|
{
|
|
@@ -366,40 +384,55 @@ exports[`TimePickerAndroid renders correctly 1`] = `
|
|
|
366
384
|
themeState="filled"
|
|
367
385
|
/>
|
|
368
386
|
<View
|
|
387
|
+
onLayout={[Function]}
|
|
388
|
+
/>
|
|
389
|
+
<View
|
|
390
|
+
collapsable={false}
|
|
369
391
|
pointerEvents="none"
|
|
370
392
|
style={
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
393
|
+
{
|
|
394
|
+
"alignItems": "center",
|
|
395
|
+
"flexDirection": "row",
|
|
396
|
+
"justifyContent": "center",
|
|
397
|
+
"left": 0,
|
|
398
|
+
"position": "absolute",
|
|
399
|
+
"right": 0,
|
|
400
|
+
"top": -10.666666666666666,
|
|
401
|
+
"transform": [
|
|
402
|
+
{
|
|
403
|
+
"translateY": 0,
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"translateX": 24,
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"scale": 1,
|
|
410
|
+
},
|
|
411
|
+
],
|
|
412
|
+
"zIndex": 1,
|
|
413
|
+
}
|
|
385
414
|
}
|
|
386
|
-
|
|
415
|
+
themeVariant="text"
|
|
387
416
|
>
|
|
388
417
|
<Text
|
|
389
418
|
allowFontScaling={false}
|
|
419
|
+
onLayout={[Function]}
|
|
390
420
|
style={
|
|
391
421
|
[
|
|
392
422
|
{
|
|
393
423
|
"color": "#001f23",
|
|
394
424
|
"fontFamily": "BeVietnamPro-Regular",
|
|
395
|
-
"fontSize":
|
|
425
|
+
"fontSize": 16,
|
|
396
426
|
"letterSpacing": 0.48,
|
|
397
|
-
"lineHeight":
|
|
427
|
+
"lineHeight": 24,
|
|
398
428
|
},
|
|
399
429
|
[
|
|
400
430
|
{
|
|
431
|
+
"alignContent": "center",
|
|
432
|
+
"alignItems": "center",
|
|
401
433
|
"color": "#001f23",
|
|
402
|
-
"
|
|
434
|
+
"marginTop": -2,
|
|
435
|
+
"textAlignVertical": "center",
|
|
403
436
|
},
|
|
404
437
|
{
|
|
405
438
|
"backgroundColor": "#ffffff",
|
|
@@ -408,9 +441,10 @@ exports[`TimePickerAndroid renders correctly 1`] = `
|
|
|
408
441
|
]
|
|
409
442
|
}
|
|
410
443
|
testID="input-label"
|
|
411
|
-
themeFontWeight="regular"
|
|
412
444
|
themeIntent="body"
|
|
413
445
|
themeState="filled"
|
|
446
|
+
themeTypeface="neutral"
|
|
447
|
+
themeVariant="regular"
|
|
414
448
|
>
|
|
415
449
|
Break time
|
|
416
450
|
</Text>
|
|
@@ -59,6 +59,7 @@ exports[`TimePickerIOS renders correct with hide suffix 1`] = `
|
|
|
59
59
|
}
|
|
60
60
|
>
|
|
61
61
|
<View
|
|
62
|
+
onLayout={[Function]}
|
|
62
63
|
style={
|
|
63
64
|
[
|
|
64
65
|
{
|
|
@@ -98,40 +99,55 @@ exports[`TimePickerIOS renders correct with hide suffix 1`] = `
|
|
|
98
99
|
themeState="filled"
|
|
99
100
|
/>
|
|
100
101
|
<View
|
|
102
|
+
onLayout={[Function]}
|
|
103
|
+
/>
|
|
104
|
+
<View
|
|
105
|
+
collapsable={false}
|
|
101
106
|
pointerEvents="none"
|
|
102
107
|
style={
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
{
|
|
109
|
+
"alignItems": "center",
|
|
110
|
+
"flexDirection": "row",
|
|
111
|
+
"justifyContent": "center",
|
|
112
|
+
"left": 0,
|
|
113
|
+
"position": "absolute",
|
|
114
|
+
"right": 0,
|
|
115
|
+
"top": -10.666666666666666,
|
|
116
|
+
"transform": [
|
|
117
|
+
{
|
|
118
|
+
"translateY": 0,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"translateX": 24,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"scale": 1,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
"zIndex": 1,
|
|
128
|
+
}
|
|
117
129
|
}
|
|
118
|
-
|
|
130
|
+
themeVariant="text"
|
|
119
131
|
>
|
|
120
132
|
<Text
|
|
121
133
|
allowFontScaling={false}
|
|
134
|
+
onLayout={[Function]}
|
|
122
135
|
style={
|
|
123
136
|
[
|
|
124
137
|
{
|
|
125
138
|
"color": "#001f23",
|
|
126
139
|
"fontFamily": "BeVietnamPro-Regular",
|
|
127
|
-
"fontSize":
|
|
140
|
+
"fontSize": 16,
|
|
128
141
|
"letterSpacing": 0.48,
|
|
129
|
-
"lineHeight":
|
|
142
|
+
"lineHeight": 24,
|
|
130
143
|
},
|
|
131
144
|
[
|
|
132
145
|
{
|
|
146
|
+
"alignContent": "center",
|
|
147
|
+
"alignItems": "center",
|
|
133
148
|
"color": "#001f23",
|
|
134
|
-
"
|
|
149
|
+
"marginTop": -2,
|
|
150
|
+
"textAlignVertical": "center",
|
|
135
151
|
},
|
|
136
152
|
{
|
|
137
153
|
"backgroundColor": "#ffffff",
|
|
@@ -140,9 +156,10 @@ exports[`TimePickerIOS renders correct with hide suffix 1`] = `
|
|
|
140
156
|
]
|
|
141
157
|
}
|
|
142
158
|
testID="input-label"
|
|
143
|
-
themeFontWeight="regular"
|
|
144
159
|
themeIntent="body"
|
|
145
160
|
themeState="filled"
|
|
161
|
+
themeTypeface="neutral"
|
|
162
|
+
themeVariant="regular"
|
|
146
163
|
>
|
|
147
164
|
Break time
|
|
148
165
|
</Text>
|
|
@@ -327,6 +344,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
327
344
|
}
|
|
328
345
|
>
|
|
329
346
|
<View
|
|
347
|
+
onLayout={[Function]}
|
|
330
348
|
style={
|
|
331
349
|
[
|
|
332
350
|
{
|
|
@@ -366,40 +384,55 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
366
384
|
themeState="filled"
|
|
367
385
|
/>
|
|
368
386
|
<View
|
|
387
|
+
onLayout={[Function]}
|
|
388
|
+
/>
|
|
389
|
+
<View
|
|
390
|
+
collapsable={false}
|
|
369
391
|
pointerEvents="none"
|
|
370
392
|
style={
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
393
|
+
{
|
|
394
|
+
"alignItems": "center",
|
|
395
|
+
"flexDirection": "row",
|
|
396
|
+
"justifyContent": "center",
|
|
397
|
+
"left": 0,
|
|
398
|
+
"position": "absolute",
|
|
399
|
+
"right": 0,
|
|
400
|
+
"top": -10.666666666666666,
|
|
401
|
+
"transform": [
|
|
402
|
+
{
|
|
403
|
+
"translateY": 0,
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"translateX": 24,
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"scale": 1,
|
|
410
|
+
},
|
|
411
|
+
],
|
|
412
|
+
"zIndex": 1,
|
|
413
|
+
}
|
|
385
414
|
}
|
|
386
|
-
|
|
415
|
+
themeVariant="text"
|
|
387
416
|
>
|
|
388
417
|
<Text
|
|
389
418
|
allowFontScaling={false}
|
|
419
|
+
onLayout={[Function]}
|
|
390
420
|
style={
|
|
391
421
|
[
|
|
392
422
|
{
|
|
393
423
|
"color": "#001f23",
|
|
394
424
|
"fontFamily": "BeVietnamPro-Regular",
|
|
395
|
-
"fontSize":
|
|
425
|
+
"fontSize": 16,
|
|
396
426
|
"letterSpacing": 0.48,
|
|
397
|
-
"lineHeight":
|
|
427
|
+
"lineHeight": 24,
|
|
398
428
|
},
|
|
399
429
|
[
|
|
400
430
|
{
|
|
431
|
+
"alignContent": "center",
|
|
432
|
+
"alignItems": "center",
|
|
401
433
|
"color": "#001f23",
|
|
402
|
-
"
|
|
434
|
+
"marginTop": -2,
|
|
435
|
+
"textAlignVertical": "center",
|
|
403
436
|
},
|
|
404
437
|
{
|
|
405
438
|
"backgroundColor": "#ffffff",
|
|
@@ -408,9 +441,10 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
408
441
|
]
|
|
409
442
|
}
|
|
410
443
|
testID="input-label"
|
|
411
|
-
themeFontWeight="regular"
|
|
412
444
|
themeIntent="body"
|
|
413
445
|
themeState="filled"
|
|
446
|
+
themeTypeface="neutral"
|
|
447
|
+
themeVariant="regular"
|
|
414
448
|
>
|
|
415
449
|
Break time
|
|
416
450
|
</Text>
|
|
@@ -1068,9 +1068,9 @@ exports[`theme returns correct theme object 1`] = `
|
|
|
1068
1068
|
"inputHorizontalMargin": 8,
|
|
1069
1069
|
"labelHorizontalPadding": 4,
|
|
1070
1070
|
"labelInsideTextInputMarginTop": -2,
|
|
1071
|
-
"labelLeft":
|
|
1071
|
+
"labelLeft": 32,
|
|
1072
1072
|
"labelPaddingBottom": 8,
|
|
1073
|
-
"labelTop":
|
|
1073
|
+
"labelTop": 10.666666666666666,
|
|
1074
1074
|
"maxLengthLabelMarginLeft": 4,
|
|
1075
1075
|
},
|
|
1076
1076
|
},
|
|
@@ -45,8 +45,8 @@ const getTextInputTheme = (theme: GlobalTheme) => {
|
|
|
45
45
|
|
|
46
46
|
const space = {
|
|
47
47
|
containerPadding: theme.space.medium,
|
|
48
|
-
labelLeft: theme.space.
|
|
49
|
-
labelTop: theme.
|
|
48
|
+
labelLeft: theme.space.xlarge,
|
|
49
|
+
labelTop: theme.space.xlarge / 3,
|
|
50
50
|
labelPaddingBottom: theme.space.small,
|
|
51
51
|
labelHorizontalPadding: theme.space.xsmall,
|
|
52
52
|
inputHorizontalMargin: theme.space.small,
|
|
@@ -35,5 +35,5 @@ export interface AccordionProps<K extends Key> {
|
|
|
35
35
|
*/
|
|
36
36
|
testID?: string;
|
|
37
37
|
}
|
|
38
|
-
declare const Accordion: <K extends React.Key>({ items, activeItemKey, onItemPress, variant,
|
|
38
|
+
declare const Accordion: <K extends React.Key>({ items, activeItemKey, onItemPress, variant, style, testID, }: AccordionProps<K>) => React.JSX.Element;
|
|
39
39
|
export default Accordion;
|