@hero-design/rn 7.28.0 → 7.29.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/.eslintrc.js +2 -1
- package/.turbo/turbo-build.log +9 -9
- package/es/index.js +119 -95
- package/lib/index.js +119 -95
- package/package.json +5 -4
- package/src/components/Alert/index.tsx +1 -0
- package/src/components/BottomSheet/Header.tsx +1 -1
- package/src/components/BottomSheet/StyledBottomSheet.tsx +1 -2
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +12 -14
- package/src/components/DatePicker/DatePickerIOS.tsx +5 -11
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerAndroid.spec.tsx.snap +1 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +35 -16
- package/src/components/Empty/StyledEmpty.tsx +1 -1
- package/src/components/Empty/__tests__/__snapshots__/index.spec.tsx.snap +10 -10
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
- package/src/components/FAB/ActionGroup/index.tsx +1 -1
- package/src/components/List/ListItem.tsx +2 -2
- package/src/components/Progress/ProgressCircle.tsx +1 -1
- package/src/components/Select/{StyledOptionList.tsx → BaseOptionList.tsx} +6 -6
- package/src/components/Select/Footer.tsx +2 -7
- package/src/components/Select/MultiSelect/Option.tsx +24 -11
- package/src/components/Select/MultiSelect/OptionList.tsx +3 -2
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/Option.spec.tsx.snap +3 -2
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +47 -21
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +204 -107
- package/src/components/Select/MultiSelect/index.tsx +16 -0
- package/src/components/Select/SingleSelect/Option.tsx +12 -12
- package/src/components/Select/SingleSelect/OptionList.tsx +3 -2
- package/src/components/Select/SingleSelect/StyledSingleSelect.tsx +6 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/Option.spec.tsx.snap +0 -1
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +32 -16
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +70 -54
- package/src/components/Select/SingleSelect/index.tsx +16 -0
- package/src/components/Select/StyledSelect.tsx +6 -7
- package/src/components/Select/types.ts +1 -0
- package/src/components/Tabs/ScrollableTabs.tsx +1 -1
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +9 -3
- package/src/components/Tag/index.tsx +2 -2
- package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +12 -0
- package/src/components/TextInput/__tests__/index.spec.tsx +4 -2
- package/src/components/TextInput/index.tsx +7 -1
- package/src/components/TimePicker/TimePickerIOS.tsx +5 -11
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerAndroid.spec.tsx.snap +1 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +35 -16
- package/src/components/Toast/ToastContainer.tsx +1 -1
- package/src/components/Toast/ToastProvider.tsx +10 -1
- package/src/components/Toast/__tests__/ToastContainer.spec.tsx +5 -5
- package/src/components/Toast/__tests__/__snapshots__/ToastContainer.spec.tsx.snap +4 -4
- package/src/components/Typography/Text/StyledText.tsx +2 -1
- package/src/components/Typography/Text/index.tsx +2 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +19 -15
- package/src/theme/components/bottomSheet.ts +4 -5
- package/src/theme/components/empty.ts +6 -5
- package/src/theme/components/fab.ts +1 -1
- package/src/theme/components/select.ts +4 -6
- package/src/theme/components/typography.ts +2 -0
- package/src/theme/global/colors/global.ts +1 -0
- package/src/theme/global/colors/types.ts +1 -0
- package/src/theme/global/typography.ts +4 -1
- package/types/components/Alert/index.d.ts +1 -0
- package/types/components/List/ListItem.d.ts +2 -2
- package/types/components/Select/{StyledOptionList.d.ts → BaseOptionList.d.ts} +3 -3
- package/types/components/Select/MultiSelect/Option.d.ts +2 -1
- package/types/components/Select/SingleSelect/Option.d.ts +2 -1
- package/types/components/Select/SingleSelect/StyledSingleSelect.d.ts +1 -0
- package/types/components/Select/StyledSelect.d.ts +3 -6
- package/types/components/Select/types.d.ts +1 -0
- package/types/components/Toast/ToastProvider.d.ts +1 -1
- package/types/components/Toast/index.d.ts +1 -1
- package/types/components/Typography/Text/StyledText.d.ts +1 -1
- package/types/components/Typography/Text/index.d.ts +1 -1
- package/types/theme/components/bottomSheet.d.ts +0 -1
- package/types/theme/components/empty.d.ts +1 -0
- package/types/theme/components/select.d.ts +3 -4
- package/types/theme/components/typography.d.ts +2 -0
- package/types/theme/global/colors/types.d.ts +1 -0
- package/types/theme/global/index.d.ts +1 -0
- package/types/theme/global/typography.d.ts +1 -0
- package/src/components/Select/__tests__/StyledSelect.spec.tsx +0 -14
- package/src/components/Select/__tests__/__snapshots__/StyledSelect.spec.tsx.snap +0 -29
|
@@ -59,6 +59,8 @@ describe('TextInput', () => {
|
|
|
59
59
|
expect(
|
|
60
60
|
within(getByTestId('idle-text-input')).queryAllByTestId('input-suffix')
|
|
61
61
|
).toHaveLength(1);
|
|
62
|
+
|
|
63
|
+
expect(getByTestId('text-input').props.placeholder).toBe(' ');
|
|
62
64
|
});
|
|
63
65
|
|
|
64
66
|
it('should not render input-label if label is empty', () => {
|
|
@@ -319,13 +321,13 @@ describe('TextInput', () => {
|
|
|
319
321
|
);
|
|
320
322
|
|
|
321
323
|
expect(wrapper.toJSON()).toMatchSnapshot();
|
|
322
|
-
expect(wrapper.
|
|
324
|
+
expect(wrapper.getByTestId('text-input').props.placeholder).toBe(' ');
|
|
323
325
|
|
|
324
326
|
fireEvent(wrapper.getByTestId('text-input'), 'focus');
|
|
325
327
|
expect(wrapper.queryByPlaceholderText('Enter Amount')).toBeTruthy();
|
|
326
328
|
|
|
327
329
|
fireEvent(wrapper.getByTestId('text-input'), 'blur');
|
|
328
|
-
expect(wrapper.
|
|
330
|
+
expect(wrapper.getByTestId('text-input').props.placeholder).toBe(' ');
|
|
329
331
|
});
|
|
330
332
|
});
|
|
331
333
|
});
|
|
@@ -128,6 +128,10 @@ export const getVariant = ({
|
|
|
128
128
|
return 'default';
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
+
// Fix issue: Placeholder is not shown on iOS when multiline is true
|
|
132
|
+
// https://github.com/callstack/react-native-paper/pull/3331
|
|
133
|
+
const EMPTY_PLACEHOLDER_VALUE = ' ';
|
|
134
|
+
|
|
131
135
|
const TextInput = ({
|
|
132
136
|
label,
|
|
133
137
|
prefix,
|
|
@@ -211,7 +215,9 @@ const TextInput = ({
|
|
|
211
215
|
},
|
|
212
216
|
defaultValue,
|
|
213
217
|
placeholder:
|
|
214
|
-
isFocused || label === undefined
|
|
218
|
+
isFocused || label === undefined
|
|
219
|
+
? nativeProps.placeholder
|
|
220
|
+
: EMPTY_PLACEHOLDER_VALUE,
|
|
215
221
|
};
|
|
216
222
|
|
|
217
223
|
return (
|
|
@@ -5,7 +5,7 @@ import formatTime from 'date-fns/fp/format';
|
|
|
5
5
|
|
|
6
6
|
import BottomSheet from '../BottomSheet';
|
|
7
7
|
import TextInput from '../TextInput';
|
|
8
|
-
import
|
|
8
|
+
import Button from '../Button';
|
|
9
9
|
import { StyledPickerWrapper } from './StyledTimePicker';
|
|
10
10
|
import type { TimePickerProps } from './types';
|
|
11
11
|
|
|
@@ -50,22 +50,16 @@ const TimePickerIOS = ({
|
|
|
50
50
|
onRequestClose={() => setOpen(false)}
|
|
51
51
|
header={label}
|
|
52
52
|
footer={
|
|
53
|
-
<
|
|
53
|
+
<Button
|
|
54
|
+
variant="text"
|
|
55
|
+
text={confirmLabel}
|
|
54
56
|
onPress={() => {
|
|
55
57
|
if (selectingDate) {
|
|
56
58
|
onChange(selectingDate);
|
|
57
59
|
}
|
|
58
60
|
setOpen(false);
|
|
59
61
|
}}
|
|
60
|
-
|
|
61
|
-
<Typography.Text
|
|
62
|
-
fontSize="large"
|
|
63
|
-
fontWeight="semi-bold"
|
|
64
|
-
intent="primary"
|
|
65
|
-
>
|
|
66
|
-
{confirmLabel}
|
|
67
|
-
</Typography.Text>
|
|
68
|
-
</TouchableOpacity>
|
|
62
|
+
/>
|
|
69
63
|
}
|
|
70
64
|
>
|
|
71
65
|
<StyledPickerWrapper>
|
|
@@ -133,6 +133,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
133
133
|
onBlur={[Function]}
|
|
134
134
|
onChangeText={[Function]}
|
|
135
135
|
onFocus={[Function]}
|
|
136
|
+
placeholder=" "
|
|
136
137
|
style={
|
|
137
138
|
Array [
|
|
138
139
|
Object {
|
|
@@ -287,7 +288,7 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
287
288
|
onStartShouldSetResponder={[Function]}
|
|
288
289
|
style={
|
|
289
290
|
Object {
|
|
290
|
-
"backgroundColor": "#
|
|
291
|
+
"backgroundColor": "#000000",
|
|
291
292
|
"bottom": 0,
|
|
292
293
|
"left": 0,
|
|
293
294
|
"opacity": 0.48,
|
|
@@ -313,8 +314,8 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
313
314
|
"height": 3,
|
|
314
315
|
"width": 0,
|
|
315
316
|
},
|
|
316
|
-
"shadowOpacity": 0.
|
|
317
|
-
"shadowRadius":
|
|
317
|
+
"shadowOpacity": 0.4,
|
|
318
|
+
"shadowRadius": 16,
|
|
318
319
|
"transform": Array [
|
|
319
320
|
Object {
|
|
320
321
|
"scaleY": 1,
|
|
@@ -410,13 +411,13 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
410
411
|
Array [
|
|
411
412
|
Object {
|
|
412
413
|
"color": "#001f23",
|
|
413
|
-
"fontSize":
|
|
414
|
+
"fontSize": 16,
|
|
414
415
|
},
|
|
415
416
|
undefined,
|
|
416
417
|
]
|
|
417
418
|
}
|
|
418
419
|
themeIntent="text"
|
|
419
|
-
themeSize="
|
|
420
|
+
themeSize="xsmall"
|
|
420
421
|
/>
|
|
421
422
|
</View>
|
|
422
423
|
</View>
|
|
@@ -476,9 +477,8 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
476
477
|
"alignItems": "center",
|
|
477
478
|
"flexDirection": "row",
|
|
478
479
|
"justifyContent": "flex-end",
|
|
479
|
-
"minHeight": 64,
|
|
480
480
|
"paddingHorizontal": 12,
|
|
481
|
-
"paddingVertical":
|
|
481
|
+
"paddingVertical": 2,
|
|
482
482
|
},
|
|
483
483
|
undefined,
|
|
484
484
|
]
|
|
@@ -498,27 +498,46 @@ exports[`TimePickerIOS renders correctly 1`] = `
|
|
|
498
498
|
onStartShouldSetResponder={[Function]}
|
|
499
499
|
style={
|
|
500
500
|
Object {
|
|
501
|
+
"alignItems": "center",
|
|
502
|
+
"borderWidth": 0,
|
|
503
|
+
"flexDirection": "row",
|
|
504
|
+
"justifyContent": "center",
|
|
501
505
|
"opacity": 1,
|
|
506
|
+
"padding": 16,
|
|
502
507
|
}
|
|
503
508
|
}
|
|
504
509
|
>
|
|
505
510
|
<Text
|
|
511
|
+
disabled={false}
|
|
512
|
+
ellipsizeMode="tail"
|
|
513
|
+
numberOfLines={1}
|
|
506
514
|
style={
|
|
507
515
|
Array [
|
|
508
516
|
Object {
|
|
509
|
-
"color": "#
|
|
510
|
-
"fontFamily": "BeVietnamPro-
|
|
511
|
-
"fontSize":
|
|
512
|
-
"letterSpacing": 0.
|
|
513
|
-
"lineHeight":
|
|
517
|
+
"color": "#001f23",
|
|
518
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
519
|
+
"fontSize": 14,
|
|
520
|
+
"letterSpacing": 0.42,
|
|
521
|
+
"lineHeight": 22,
|
|
514
522
|
},
|
|
515
|
-
|
|
523
|
+
Array [
|
|
524
|
+
Object {
|
|
525
|
+
"color": "#401960",
|
|
526
|
+
"flexShrink": 1,
|
|
527
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
528
|
+
"fontSize": 16,
|
|
529
|
+
"lineHeight": 24,
|
|
530
|
+
"textAlign": "center",
|
|
531
|
+
},
|
|
532
|
+
undefined,
|
|
533
|
+
],
|
|
516
534
|
]
|
|
517
535
|
}
|
|
518
|
-
themeFontSize="
|
|
519
|
-
themeFontWeight="
|
|
520
|
-
themeIntent="
|
|
536
|
+
themeFontSize="medium"
|
|
537
|
+
themeFontWeight="regular"
|
|
538
|
+
themeIntent="body"
|
|
521
539
|
themeTypeface="neutral"
|
|
540
|
+
themeVariant="text-primary"
|
|
522
541
|
>
|
|
523
542
|
Confirm
|
|
524
543
|
</Text>
|
|
@@ -38,7 +38,7 @@ const SingleToastDisplay = ({
|
|
|
38
38
|
const ToastContainer = React.forwardRef<
|
|
39
39
|
ToastControllerContextType,
|
|
40
40
|
ToastContainerProps
|
|
41
|
-
>(({ displayType = 'single', position = '
|
|
41
|
+
>(({ displayType = 'single', position = 'bottom', style }, ref) => {
|
|
42
42
|
const theme = useTheme();
|
|
43
43
|
const [toastList, setToastList] = useState<ToastItemProps[]>([]);
|
|
44
44
|
|
|
@@ -6,6 +6,7 @@ import ToastContainer from './ToastContainer';
|
|
|
6
6
|
import { ToastConfigContext, ToastContext } from './ToastContext';
|
|
7
7
|
import type { ToastControllerContextType } from './ToastContext';
|
|
8
8
|
import type { ToastContainerProps } from './types';
|
|
9
|
+
import { useDeprecation } from '../../utils/hooks';
|
|
9
10
|
|
|
10
11
|
type ToastProviderProps = {
|
|
11
12
|
/**
|
|
@@ -17,8 +18,16 @@ type ToastProviderProps = {
|
|
|
17
18
|
const ToastProvider = ({
|
|
18
19
|
children,
|
|
19
20
|
displayType = 'single',
|
|
20
|
-
position
|
|
21
|
+
position: _position,
|
|
21
22
|
}: ToastProviderProps) => {
|
|
23
|
+
const position: ToastContainerProps['position'] =
|
|
24
|
+
_position === undefined ? 'bottom' : _position;
|
|
25
|
+
|
|
26
|
+
useDeprecation(
|
|
27
|
+
"Toast's position prop is deprecated and will be removed in the next major release.\nPlease remove it.",
|
|
28
|
+
_position !== undefined
|
|
29
|
+
);
|
|
30
|
+
|
|
22
31
|
const toastRef = useRef<ToastControllerContextType>(null);
|
|
23
32
|
// @ts-expect-error: TODO: @tungv Fix this type error
|
|
24
33
|
const [refState, setRefState] = useState<ToastControllerContextType>(null);
|
|
@@ -10,11 +10,11 @@ describe('ToastContainer', () => {
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
it.each`
|
|
13
|
-
displayType
|
|
14
|
-
${'single'}
|
|
15
|
-
${'
|
|
16
|
-
${'single'}
|
|
17
|
-
${'
|
|
13
|
+
displayType | position
|
|
14
|
+
${'single'} | ${'top'}
|
|
15
|
+
${'stack'} | ${'top'}
|
|
16
|
+
${'single'} | ${'bottom'}
|
|
17
|
+
${'stack'} | ${'bottom'}
|
|
18
18
|
`(
|
|
19
19
|
'renders correctly with displayType: $displayType, position: $position',
|
|
20
20
|
({ displayType, position }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`ToastContainer renders correctly with displayType:
|
|
3
|
+
exports[`ToastContainer renders correctly with displayType: single, position: bottom 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
pointerEvents="box-none"
|
|
6
6
|
position="bottom"
|
|
@@ -23,7 +23,7 @@ exports[`ToastContainer renders correctly with displayType: displayType, positio
|
|
|
23
23
|
/>
|
|
24
24
|
`;
|
|
25
25
|
|
|
26
|
-
exports[`ToastContainer renders correctly with displayType:
|
|
26
|
+
exports[`ToastContainer renders correctly with displayType: single, position: top 1`] = `
|
|
27
27
|
<View
|
|
28
28
|
pointerEvents="box-none"
|
|
29
29
|
position="top"
|
|
@@ -46,7 +46,7 @@ exports[`ToastContainer renders correctly with displayType: displayType, positio
|
|
|
46
46
|
/>
|
|
47
47
|
`;
|
|
48
48
|
|
|
49
|
-
exports[`ToastContainer renders correctly with displayType:
|
|
49
|
+
exports[`ToastContainer renders correctly with displayType: stack, position: bottom 1`] = `
|
|
50
50
|
<View
|
|
51
51
|
pointerEvents="box-none"
|
|
52
52
|
position="bottom"
|
|
@@ -69,7 +69,7 @@ exports[`ToastContainer renders correctly with displayType: single, position: bo
|
|
|
69
69
|
/>
|
|
70
70
|
`;
|
|
71
71
|
|
|
72
|
-
exports[`ToastContainer renders correctly with displayType:
|
|
72
|
+
exports[`ToastContainer renders correctly with displayType: stack, position: top 1`] = `
|
|
73
73
|
<View
|
|
74
74
|
pointerEvents="box-none"
|
|
75
75
|
position="top"
|
|
@@ -145,7 +145,7 @@ Object {
|
|
|
145
145
|
},
|
|
146
146
|
"bottomSheet": Object {
|
|
147
147
|
"colors": Object {
|
|
148
|
-
"backdrop": "#
|
|
148
|
+
"backdrop": "#000000",
|
|
149
149
|
"background": "#ffffff",
|
|
150
150
|
"shadow": "#001f23",
|
|
151
151
|
},
|
|
@@ -158,17 +158,16 @@ Object {
|
|
|
158
158
|
"height": 3,
|
|
159
159
|
"width": 0,
|
|
160
160
|
},
|
|
161
|
-
"opacity": 0.
|
|
162
|
-
"radius":
|
|
161
|
+
"opacity": 0.4,
|
|
162
|
+
"radius": 16,
|
|
163
163
|
},
|
|
164
164
|
"sizes": Object {
|
|
165
165
|
"closeIcon": 48,
|
|
166
|
-
"sectionHeight": 64,
|
|
167
166
|
},
|
|
168
167
|
"space": Object {
|
|
169
168
|
"closeIconMargin": 12,
|
|
170
169
|
"footerHorizontalPadding": 12,
|
|
171
|
-
"footerVerticalPadding":
|
|
170
|
+
"footerVerticalPadding": 2,
|
|
172
171
|
"headerWrapperHorizontalPadding": 16,
|
|
173
172
|
"headerWrapperVerticalPadding": 8,
|
|
174
173
|
},
|
|
@@ -331,17 +330,18 @@ Object {
|
|
|
331
330
|
},
|
|
332
331
|
"empty": Object {
|
|
333
332
|
"colors": Object {
|
|
333
|
+
"invertedSubduedText": "#ffffff",
|
|
334
334
|
"invertedText": "#ffffff",
|
|
335
|
-
"subduedText": "#
|
|
335
|
+
"subduedText": "#4d6265",
|
|
336
336
|
"text": "#001f23",
|
|
337
337
|
},
|
|
338
338
|
"fontSizes": Object {
|
|
339
|
-
"description":
|
|
340
|
-
"title":
|
|
339
|
+
"description": 18,
|
|
340
|
+
"title": 24,
|
|
341
341
|
},
|
|
342
342
|
"fonts": Object {
|
|
343
|
-
"description": "
|
|
344
|
-
"title": "
|
|
343
|
+
"description": "RebondGrotesque-Regular",
|
|
344
|
+
"title": "RebondGrotesque-SemiBold",
|
|
345
345
|
},
|
|
346
346
|
"sizes": Object {
|
|
347
347
|
"image": 168,
|
|
@@ -356,7 +356,7 @@ Object {
|
|
|
356
356
|
"colors": Object {
|
|
357
357
|
"actionItemBackground": "#401960",
|
|
358
358
|
"actionItemText": "#ffffff",
|
|
359
|
-
"backdropBackground": "#
|
|
359
|
+
"backdropBackground": "#000000",
|
|
360
360
|
"buttonBackground": "#401960",
|
|
361
361
|
"headerText": "#ffffff",
|
|
362
362
|
"icon": "#ffffff",
|
|
@@ -599,20 +599,19 @@ Object {
|
|
|
599
599
|
},
|
|
600
600
|
},
|
|
601
601
|
"select": Object {
|
|
602
|
-
"colors": Object {
|
|
603
|
-
"footerText": "#795e90",
|
|
604
|
-
},
|
|
605
602
|
"radii": Object {
|
|
606
603
|
"option": 4,
|
|
607
604
|
},
|
|
608
605
|
"space": Object {
|
|
609
606
|
"minimumOptionListHeight": 280,
|
|
610
|
-
"
|
|
607
|
+
"optionListHorizontalPadding": 12,
|
|
611
608
|
"optionSpacing": 4,
|
|
612
609
|
"searchBarBottomSpacing": 8,
|
|
613
610
|
"searchBarHorizontalSpacing": 16,
|
|
614
611
|
"searchBarMarginTopSpacing": 8,
|
|
615
612
|
"sectionSpacing": 12,
|
|
613
|
+
"singleSelectContentPaddingBottom": 16,
|
|
614
|
+
"suffixMarginRight": 12,
|
|
616
615
|
},
|
|
617
616
|
},
|
|
618
617
|
"slider": Object {
|
|
@@ -909,6 +908,7 @@ Object {
|
|
|
909
908
|
"warning": "#ffa234",
|
|
910
909
|
},
|
|
911
910
|
"fontSizes": Object {
|
|
911
|
+
"7xlarge": 42,
|
|
912
912
|
"large": 16,
|
|
913
913
|
"medium": 14,
|
|
914
914
|
"small": 12,
|
|
@@ -929,6 +929,7 @@ Object {
|
|
|
929
929
|
},
|
|
930
930
|
},
|
|
931
931
|
"lineHeights": Object {
|
|
932
|
+
"7xlarge": 50,
|
|
932
933
|
"large": 24,
|
|
933
934
|
"medium": 22,
|
|
934
935
|
"small": 20,
|
|
@@ -1006,6 +1007,7 @@ Object {
|
|
|
1006
1007
|
"onSuccessSurface": "#017d6d",
|
|
1007
1008
|
"onWarningSurface": "#ffa234",
|
|
1008
1009
|
"outline": "#e8e9ea",
|
|
1010
|
+
"overlayGlobalSurface": "#000000",
|
|
1009
1011
|
"platformBackground": "#ffffff",
|
|
1010
1012
|
"pressedSurface": "#664780",
|
|
1011
1013
|
"primary": "#401960",
|
|
@@ -1033,6 +1035,7 @@ Object {
|
|
|
1033
1035
|
"warningSurface": "#fff6eb",
|
|
1034
1036
|
},
|
|
1035
1037
|
"fontSizes": Object {
|
|
1038
|
+
"7xlarge": 42,
|
|
1036
1039
|
"large": 16,
|
|
1037
1040
|
"medium": 14,
|
|
1038
1041
|
"small": 12,
|
|
@@ -1056,6 +1059,7 @@ Object {
|
|
|
1056
1059
|
},
|
|
1057
1060
|
},
|
|
1058
1061
|
"lineHeights": Object {
|
|
1062
|
+
"7xlarge": 50,
|
|
1059
1063
|
"large": 24,
|
|
1060
1064
|
"medium": 22,
|
|
1061
1065
|
"small": 20,
|
|
@@ -4,11 +4,10 @@ const getBottomSheetTheme = (theme: GlobalTheme) => {
|
|
|
4
4
|
const colors = {
|
|
5
5
|
shadow: theme.colors.primaryOutline,
|
|
6
6
|
background: theme.colors.defaultGlobalSurface,
|
|
7
|
-
backdrop: theme.colors.
|
|
7
|
+
backdrop: theme.colors.overlayGlobalSurface,
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
const sizes = {
|
|
11
|
-
sectionHeight: theme.sizes.xxxxxlarge,
|
|
12
11
|
closeIcon: theme.sizes.xxxlarge,
|
|
13
12
|
};
|
|
14
13
|
|
|
@@ -16,14 +15,14 @@ const getBottomSheetTheme = (theme: GlobalTheme) => {
|
|
|
16
15
|
headerWrapperVerticalPadding: theme.space.small,
|
|
17
16
|
headerWrapperHorizontalPadding: theme.space.medium,
|
|
18
17
|
closeIconMargin: theme.space.smallMedium,
|
|
19
|
-
footerVerticalPadding: theme.space.
|
|
18
|
+
footerVerticalPadding: theme.space.xxsmall,
|
|
20
19
|
footerHorizontalPadding: theme.space.smallMedium,
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
const shadows = {
|
|
24
23
|
offset: { width: 0, height: 3 },
|
|
25
|
-
opacity: 0.
|
|
26
|
-
radius:
|
|
24
|
+
opacity: 0.4,
|
|
25
|
+
radius: theme.radii.xlarge,
|
|
27
26
|
elevation: 10,
|
|
28
27
|
};
|
|
29
28
|
|
|
@@ -14,17 +14,18 @@ const getEmptyTheme = (theme: GlobalTheme) => {
|
|
|
14
14
|
const colors = {
|
|
15
15
|
text: theme.colors.onDefaultGlobalSurface,
|
|
16
16
|
invertedText: theme.colors.onDarkGlobalSurface,
|
|
17
|
-
subduedText: theme.colors.
|
|
17
|
+
subduedText: theme.colors.mutedOnDefaultGlobalSurface,
|
|
18
|
+
invertedSubduedText: theme.colors.onDarkGlobalSurface,
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
const fontSizes = {
|
|
21
|
-
title: theme.fontSizes.
|
|
22
|
-
description: theme.fontSizes.
|
|
22
|
+
title: theme.fontSizes.xxxlarge,
|
|
23
|
+
description: theme.fontSizes.xlarge,
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
const fonts = {
|
|
26
|
-
title: theme.fonts.
|
|
27
|
-
description: theme.fonts.
|
|
27
|
+
title: theme.fonts.playful.semiBold,
|
|
28
|
+
description: theme.fonts.playful.regular,
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
return { fontSizes, colors, sizes, space, fonts };
|
|
@@ -6,7 +6,7 @@ const getFABTheme = (theme: GlobalTheme) => {
|
|
|
6
6
|
icon: theme.colors.onPrimary,
|
|
7
7
|
headerText: theme.colors.onDarkGlobalSurface,
|
|
8
8
|
actionItemBackground: theme.colors.primary,
|
|
9
|
-
backdropBackground: theme.colors.
|
|
9
|
+
backdropBackground: theme.colors.overlayGlobalSurface,
|
|
10
10
|
titleText: theme.colors.onDarkGlobalSurface,
|
|
11
11
|
actionItemText: theme.colors.onPrimary,
|
|
12
12
|
};
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import type { GlobalTheme } from '../global';
|
|
2
2
|
|
|
3
3
|
const getSelectTheme = (theme: GlobalTheme) => {
|
|
4
|
-
const colors = {
|
|
5
|
-
footerText: theme.colors.secondary,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
4
|
const space = {
|
|
9
5
|
minimumOptionListHeight: theme.space.xxxxlarge * 5,
|
|
10
6
|
sectionSpacing: theme.space.smallMedium,
|
|
11
7
|
optionSpacing: theme.space.xsmall,
|
|
12
|
-
|
|
8
|
+
optionListHorizontalPadding: theme.space.smallMedium,
|
|
13
9
|
searchBarMarginTopSpacing: theme.space.small,
|
|
14
10
|
searchBarHorizontalSpacing: theme.space.medium,
|
|
15
11
|
searchBarBottomSpacing: theme.space.small,
|
|
12
|
+
singleSelectContentPaddingBottom: theme.space.medium,
|
|
13
|
+
suffixMarginRight: theme.space.smallMedium,
|
|
16
14
|
};
|
|
17
15
|
|
|
18
16
|
const radii = {
|
|
19
17
|
option: theme.radii.base,
|
|
20
18
|
};
|
|
21
19
|
|
|
22
|
-
return { space,
|
|
20
|
+
return { space, radii };
|
|
23
21
|
};
|
|
24
22
|
|
|
25
23
|
export default getSelectTheme;
|
|
@@ -20,6 +20,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
|
|
|
20
20
|
xlarge: theme.fontSizes.xlarge,
|
|
21
21
|
xxxlarge: theme.fontSizes.xxxlarge,
|
|
22
22
|
xxxxxlarge: theme.fontSizes.xxxxxlarge,
|
|
23
|
+
'7xlarge': theme.fontSizes['7xlarge'],
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
const lineHeights = {
|
|
@@ -29,6 +30,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
|
|
|
29
30
|
xlarge: theme.lineHeights.xlarge,
|
|
30
31
|
xxxlarge: theme.lineHeights.xxxlarge,
|
|
31
32
|
xxxxxlarge: theme.lineHeights.xxxxxlarge,
|
|
33
|
+
'7xlarge': theme.lineHeights['7xlarge'],
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
return { colors, fonts: theme.fonts, fontSizes, lineHeights };
|
|
@@ -12,6 +12,7 @@ const globalPalette: GlobalSystemPalette = {
|
|
|
12
12
|
disabledOnDefaultGlobalSurface: palette.greyLight30,
|
|
13
13
|
darkGlobalSurface: palette.maasstrichtBlue,
|
|
14
14
|
onDarkGlobalSurface: palette.white,
|
|
15
|
+
overlayGlobalSurface: palette.black,
|
|
15
16
|
|
|
16
17
|
// Outlines
|
|
17
18
|
primaryOutline: palette.maasstrichtBlue,
|
|
@@ -12,6 +12,7 @@ interface Fonts {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface FontSizes {
|
|
15
|
+
'7xlarge': number;
|
|
15
16
|
xxxxxlarge: number;
|
|
16
17
|
xxxxlarge: number;
|
|
17
18
|
xxxlarge: number;
|
|
@@ -50,7 +51,7 @@ const getFonts = ({
|
|
|
50
51
|
});
|
|
51
52
|
|
|
52
53
|
const getFontSizes = (baseFontSize: number): FontSizes => {
|
|
53
|
-
const fontSizes = Array.from(new Array(
|
|
54
|
+
const fontSizes = Array.from(new Array(11));
|
|
54
55
|
fontSizes.forEach((_, index) => {
|
|
55
56
|
if (index === 0) {
|
|
56
57
|
fontSizes[0] = baseFontSize;
|
|
@@ -60,6 +61,7 @@ const getFontSizes = (baseFontSize: number): FontSizes => {
|
|
|
60
61
|
return undefined;
|
|
61
62
|
});
|
|
62
63
|
return {
|
|
64
|
+
'7xlarge': scale(fontSizes[10]), // 42
|
|
63
65
|
xxxxxlarge: scale(fontSizes[8]), // 32
|
|
64
66
|
xxxxlarge: scale(fontSizes[7]), // 28
|
|
65
67
|
xxxlarge: scale(fontSizes[6]), // 24
|
|
@@ -75,6 +77,7 @@ const getFontSizes = (baseFontSize: number): FontSizes => {
|
|
|
75
77
|
const getLineHeights = (fontSizes: FontSizes): LineHeights => {
|
|
76
78
|
const additionalSpace = 8;
|
|
77
79
|
return {
|
|
80
|
+
'7xlarge': fontSizes['7xlarge'] + additionalSpace,
|
|
78
81
|
xxxxxlarge: fontSizes.xxxxxlarge + additionalSpace,
|
|
79
82
|
xxxxlarge: fontSizes.xxxxlarge + additionalSpace,
|
|
80
83
|
xxxlarge: fontSizes.xxxlarge + additionalSpace,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
import type { IconName } from '../Icon';
|
|
@@ -14,7 +14,7 @@ export interface ListItemProps {
|
|
|
14
14
|
/**
|
|
15
15
|
* The title of the component.
|
|
16
16
|
*/
|
|
17
|
-
title?: string;
|
|
17
|
+
title?: string | ReactElement;
|
|
18
18
|
/**
|
|
19
19
|
* The subtile title of the component.
|
|
20
20
|
*/
|
|
@@ -3,10 +3,10 @@ import { SectionList } from 'react-native';
|
|
|
3
3
|
import type { ReactElement } from 'react';
|
|
4
4
|
import type { SectionListRenderItemInfo } from 'react-native';
|
|
5
5
|
import type { SectionData, OptionType, SelectProps, SectionType } from './types';
|
|
6
|
-
export declare type
|
|
6
|
+
export declare type BaseOptionListProps<V, T extends OptionType<V>> = Pick<SelectProps<V, T>, 'keyExtractor' | 'loading' | 'onEndReached' | 'onQueryChange'> & {
|
|
7
7
|
sections: SectionData<V, T>[];
|
|
8
8
|
renderItem: (info: SectionListRenderItemInfo<T, SectionType>) => ReactElement;
|
|
9
9
|
sectionListRef?: React.RefObject<SectionList<T, SectionType>>;
|
|
10
10
|
};
|
|
11
|
-
declare const
|
|
12
|
-
export default
|
|
11
|
+
declare const BaseOptionList: <V, T extends OptionType<V>>({ keyExtractor, loading, onEndReached, onQueryChange, sections, renderItem, sectionListRef, }: BaseOptionListProps<V, T>) => JSX.Element;
|
|
12
|
+
export default BaseOptionList;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
-
declare const Option: ({ text, disabled, selected, onPress, }: {
|
|
2
|
+
declare const Option: ({ text, disabled, selected, onPress, highlighted, }: {
|
|
3
3
|
text: string | ReactElement;
|
|
4
4
|
disabled?: boolean | undefined;
|
|
5
5
|
selected: boolean;
|
|
6
6
|
onPress: () => void;
|
|
7
|
+
highlighted?: boolean | undefined;
|
|
7
8
|
}) => JSX.Element;
|
|
8
9
|
export default Option;
|