@hero-design/rn 7.18.0 → 7.19.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/.turbo/turbo-build.log +2 -2
- package/es/index.js +155 -143
- package/lib/index.js +155 -143
- package/package.json +2 -2
- package/src/components/Accordion/AccordionItem.tsx +5 -4
- package/src/components/Accordion/__tests__/index.spec.tsx +2 -1
- package/src/components/Accordion/index.tsx +3 -2
- package/src/components/Alert/StyledAlert.tsx +3 -2
- package/src/components/Alert/index.tsx +5 -3
- package/src/components/Avatar/index.tsx +2 -2
- package/src/components/Badge/Status.tsx +4 -2
- package/src/components/Badge/index.tsx +2 -1
- package/src/components/BottomNavigation/__tests__/index.spec.tsx +4 -2
- package/src/components/BottomNavigation/index.tsx +6 -8
- package/src/components/BottomSheet/Footer.tsx +2 -1
- package/src/components/BottomSheet/Header.tsx +2 -1
- package/src/components/BottomSheet/StyledBottomSheet.tsx +2 -2
- package/src/components/BottomSheet/index.tsx +4 -8
- package/src/components/Button/Button.tsx +5 -6
- package/src/components/Button/IconButton.tsx +4 -7
- package/src/components/Button/LoadingIndicator/StyledLoadingIndicator.tsx +5 -3
- package/src/components/Button/LoadingIndicator/index.tsx +2 -8
- package/src/components/Button/StyledButton.tsx +4 -5
- package/src/components/Button/UtilityButton/index.tsx +5 -4
- package/src/components/Button/index.tsx +3 -2
- package/src/components/Calendar/StyledCalendar.tsx +2 -1
- package/src/components/Card/DataCard/index.tsx +3 -2
- package/src/components/Card/index.tsx +3 -2
- package/src/components/Checkbox/StyledCheckbox.tsx +44 -14
- package/src/components/Checkbox/__tests__/StyledCheckbox.spec.tsx +28 -3
- package/src/components/Checkbox/__tests__/__snapshots__/StyledCheckbox.spec.tsx.snap +95 -9
- package/src/components/Checkbox/__tests__/__snapshots__/index.spec.tsx.snap +337 -23
- package/src/components/Checkbox/__tests__/index.spec.tsx +38 -7
- package/src/components/Checkbox/index.tsx +35 -18
- package/src/components/Collapse/index.tsx +4 -8
- package/src/components/ContentNavigator/index.tsx +1 -1
- package/src/components/DatePicker/DatePickerAndroid.tsx +1 -1
- package/src/components/DatePicker/DatePickerIOS.tsx +1 -1
- package/src/components/DatePicker/StyledDatePicker.tsx +2 -1
- package/src/components/DatePicker/__tests__/DatePickerIOS.spec.tsx +1 -2
- package/src/components/DatePicker/index.tsx +1 -1
- package/src/components/DatePicker/types.ts +1 -1
- package/src/components/Divider/index.tsx +1 -1
- package/src/components/Drawer/DragableDrawer/index.tsx +3 -2
- package/src/components/Drawer/StyledDrawer.tsx +3 -2
- package/src/components/Drawer/index.tsx +2 -1
- package/src/components/Empty/index.tsx +1 -2
- package/src/components/FAB/ActionGroup/ActionItem.tsx +3 -2
- package/src/components/FAB/ActionGroup/StyledActionGroup.tsx +4 -3
- package/src/components/FAB/ActionGroup/StyledActionItem.tsx +4 -2
- package/src/components/FAB/ActionGroup/index.tsx +5 -3
- package/src/components/FAB/AnimatedFABIcon.tsx +1 -1
- package/src/components/FAB/FAB.tsx +2 -2
- package/src/components/FAB/StyledFAB.tsx +4 -7
- package/src/components/Icon/AnimatedIcon.tsx +2 -1
- package/src/components/Icon/index.tsx +1 -1
- package/src/components/List/BasicListItem.tsx +3 -3
- package/src/components/List/ListItem.tsx +6 -3
- package/src/components/List/StyledListItem.tsx +2 -1
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +13 -27
- package/src/components/List/__tests__/__snapshots__/StyledListItem.spec.tsx.snap +2 -0
- package/src/components/PinInput/PinCell.tsx +1 -1
- package/src/components/PinInput/index.tsx +3 -7
- package/src/components/Progress/ProgressBar.tsx +2 -1
- package/src/components/Progress/ProgressCircle.tsx +3 -9
- package/src/components/Progress/StyledProgressBar.tsx +3 -3
- package/src/components/Progress/StyledProgressCircle.tsx +3 -3
- package/src/components/Radio/Radio.tsx +20 -14
- package/src/components/Radio/RadioGroup.tsx +5 -3
- package/src/components/Radio/StyledRadio.tsx +12 -29
- package/src/components/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +84 -50
- package/src/components/Radio/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +124 -73
- package/src/components/RichTextEditor/EditorToolbar.tsx +4 -8
- package/src/components/RichTextEditor/RichTextEditor.tsx +5 -14
- package/src/components/RichTextEditor/__tests__/EditorToolbar.spec.tsx +2 -6
- package/src/components/RichTextEditor/__tests__/MentionList.spec.tsx +2 -6
- package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +4 -7
- package/src/components/RichTextEditor/index.tsx +6 -6
- package/src/components/SectionHeading/index.tsx +5 -4
- package/src/components/Select/MultiSelect/Option.tsx +2 -1
- package/src/components/Select/MultiSelect/OptionList.tsx +3 -3
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +605 -585
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +1 -1
- package/src/components/Select/MultiSelect/index.tsx +20 -16
- package/src/components/Select/SingleSelect/Option.tsx +2 -1
- package/src/components/Select/SingleSelect/OptionList.tsx +3 -3
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +602 -582
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +1 -1
- package/src/components/Select/SingleSelect/index.tsx +20 -16
- package/src/components/Select/StyledOptionList.tsx +11 -9
- package/src/components/Select/helpers.tsx +1 -1
- package/src/components/Select/index.tsx +6 -4
- package/src/components/Select/types.ts +3 -3
- package/src/components/Spinner/StyledSpinner.tsx +2 -1
- package/src/components/Spinner/index.tsx +3 -3
- package/src/components/Switch/StyledSwitch.tsx +10 -26
- package/src/components/Switch/__tests__/StyledSwitch.spec.tsx +25 -0
- package/src/components/Switch/__tests__/__snapshots__/{StyledHeading.spec.tsx.snap → StyledSwitch.spec.tsx.snap} +45 -18
- package/src/components/Switch/__tests__/__snapshots__/index.spec.tsx.snap +26 -52
- package/src/components/Switch/index.tsx +23 -20
- package/src/components/Tabs/ScrollableTabs.tsx +1 -1
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +4 -2
- package/src/components/Tabs/__tests__/index.spec.tsx +4 -2
- package/src/components/Tabs/index.tsx +7 -13
- package/src/components/Tag/index.tsx +1 -1
- package/src/components/TextInput/index.tsx +5 -5
- package/src/components/TimePicker/StyledTimePicker.tsx +2 -1
- package/src/components/TimePicker/TimePickerAndroid.tsx +1 -1
- package/src/components/TimePicker/TimePickerIOS.tsx +1 -1
- package/src/components/TimePicker/__tests__/TimePickerIOS.spec.tsx +1 -2
- package/src/components/TimePicker/index.tsx +1 -1
- package/src/components/TimePicker/types.ts +1 -1
- package/src/components/Toast/StyledToast.tsx +3 -8
- package/src/components/Toast/Toast.tsx +3 -2
- package/src/components/Toast/ToastContainer.tsx +2 -2
- package/src/components/Toast/ToastContext.ts +1 -1
- package/src/components/Toast/ToastProvider.tsx +5 -7
- package/src/components/Toast/__tests__/ToastContainer.spec.tsx +1 -1
- package/src/components/Toast/types.ts +3 -3
- package/src/components/Toolbar/StyledToolbar.tsx +2 -1
- package/src/components/Toolbar/ToolbarGroup.tsx +2 -1
- package/src/components/Toolbar/ToolbarItem.tsx +2 -1
- package/src/components/Toolbar/index.tsx +2 -1
- package/src/components/Typography/Text/index.tsx +3 -2
- package/src/testHelpers/renderWithTheme.tsx +2 -1
- package/src/theme/ThemeProvider.ts +1 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +24 -26
- package/src/theme/components/accordion.ts +1 -1
- package/src/theme/components/alert.ts +1 -1
- package/src/theme/components/avatar.ts +1 -1
- package/src/theme/components/badge.ts +1 -1
- package/src/theme/components/bottomNavigation.ts +1 -1
- package/src/theme/components/bottomSheet.ts +1 -1
- package/src/theme/components/button.ts +1 -1
- package/src/theme/components/calendar.ts +1 -1
- package/src/theme/components/card.ts +1 -1
- package/src/theme/components/checkbox.ts +12 -8
- package/src/theme/components/contentNavigator.ts +1 -1
- package/src/theme/components/divider.ts +1 -1
- package/src/theme/components/drawer.ts +1 -1
- package/src/theme/components/empty.ts +1 -1
- package/src/theme/components/fab.ts +1 -1
- package/src/theme/components/icon.ts +1 -1
- package/src/theme/components/list.ts +5 -4
- package/src/theme/components/pinInput.ts +1 -1
- package/src/theme/components/progress.ts +1 -1
- package/src/theme/components/radio.ts +3 -11
- package/src/theme/components/richTextEditor.ts +1 -1
- package/src/theme/components/sectionHeading.ts +1 -1
- package/src/theme/components/select.ts +1 -1
- package/src/theme/components/spinner.ts +1 -1
- package/src/theme/components/switch.ts +7 -8
- package/src/theme/components/tabs.ts +1 -1
- package/src/theme/components/tag.ts +1 -1
- package/src/theme/components/textInput.ts +1 -1
- package/src/theme/components/toast.ts +1 -1
- package/src/theme/components/toolbar.ts +1 -1
- package/src/theme/components/typography.ts +1 -1
- package/src/theme/getTheme.ts +4 -11
- package/src/theme/global/borders.ts +2 -1
- package/src/theme/global/colors/swag.ts +2 -3
- package/src/theme/global/colors/work.ts +1 -2
- package/src/theme/global/index.ts +6 -11
- package/src/theme/global/scale.ts +2 -1
- package/src/theme/global/space.ts +2 -1
- package/src/theme/global/typography.ts +2 -8
- package/src/theme/index.ts +5 -2
- package/src/types.ts +9 -10
- package/testUtils/setup.tsx +2 -0
- package/tsconfig.json +4 -9
- package/types/components/Accordion/AccordionItem.d.ts +3 -3
- package/types/components/Accordion/index.d.ts +3 -2
- package/types/components/Alert/StyledAlert.d.ts +2 -1
- package/types/components/Alert/index.d.ts +3 -3
- package/types/components/Avatar/index.d.ts +1 -1
- package/types/components/Badge/Status.d.ts +2 -2
- package/types/components/Badge/index.d.ts +2 -1
- package/types/components/BottomNavigation/index.d.ts +3 -3
- package/types/components/BottomSheet/Footer.d.ts +1 -1
- package/types/components/BottomSheet/Header.d.ts +1 -1
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +2 -1
- package/types/components/BottomSheet/index.d.ts +2 -2
- package/types/components/Button/Button.d.ts +4 -4
- package/types/components/Button/IconButton.d.ts +2 -2
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +3 -2
- package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +3 -2
- package/types/components/Button/UtilityButton/index.d.ts +3 -3
- package/types/components/Button/index.d.ts +2 -2
- package/types/components/Calendar/StyledCalendar.d.ts +2 -1
- package/types/components/Card/DataCard/index.d.ts +2 -2
- package/types/components/Card/index.d.ts +2 -2
- package/types/components/Checkbox/StyledCheckbox.d.ts +21 -3
- package/types/components/Checkbox/index.d.ts +11 -3
- package/types/components/Collapse/index.d.ts +2 -2
- package/types/components/ContentNavigator/index.d.ts +1 -1
- package/types/components/DatePicker/DatePickerAndroid.d.ts +1 -1
- package/types/components/DatePicker/DatePickerIOS.d.ts +1 -1
- package/types/components/DatePicker/StyledDatePicker.d.ts +2 -1
- package/types/components/DatePicker/index.d.ts +1 -1
- package/types/components/DatePicker/types.d.ts +1 -1
- package/types/components/Divider/index.d.ts +1 -1
- package/types/components/Drawer/DragableDrawer/index.d.ts +1 -1
- package/types/components/Drawer/StyledDrawer.d.ts +2 -1
- package/types/components/Drawer/index.d.ts +1 -1
- package/types/components/Empty/index.d.ts +1 -1
- package/types/components/FAB/ActionGroup/ActionItem.d.ts +2 -2
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +3 -2
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +3 -2
- package/types/components/FAB/ActionGroup/index.d.ts +3 -3
- package/types/components/FAB/AnimatedFABIcon.d.ts +1 -1
- package/types/components/FAB/FAB.d.ts +2 -2
- package/types/components/FAB/StyledFAB.d.ts +3 -2
- package/types/components/Icon/AnimatedIcon.d.ts +1 -1
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/List/BasicListItem.d.ts +2 -2
- package/types/components/List/ListItem.d.ts +4 -3
- package/types/components/PinInput/PinCell.d.ts +1 -1
- package/types/components/PinInput/index.d.ts +2 -2
- package/types/components/Progress/ProgressBar.d.ts +1 -1
- package/types/components/Progress/ProgressCircle.d.ts +1 -1
- package/types/components/Progress/StyledProgressBar.d.ts +3 -2
- package/types/components/Progress/StyledProgressCircle.d.ts +3 -2
- package/types/components/Radio/Radio.d.ts +2 -2
- package/types/components/Radio/RadioGroup.d.ts +3 -3
- package/types/components/Radio/StyledRadio.d.ts +2 -12
- package/types/components/RichTextEditor/RichTextEditor.d.ts +3 -2
- package/types/components/RichTextEditor/index.d.ts +3 -2
- package/types/components/SectionHeading/index.d.ts +3 -3
- package/types/components/Select/MultiSelect/Option.d.ts +1 -1
- package/types/components/Select/MultiSelect/OptionList.d.ts +2 -2
- package/types/components/Select/MultiSelect/index.d.ts +1 -1
- package/types/components/Select/SingleSelect/Option.d.ts +1 -1
- package/types/components/Select/SingleSelect/OptionList.d.ts +2 -2
- package/types/components/Select/SingleSelect/index.d.ts +1 -1
- package/types/components/Select/StyledOptionList.d.ts +4 -4
- package/types/components/Select/helpers.d.ts +1 -1
- package/types/components/Select/index.d.ts +4 -3
- package/types/components/Select/types.d.ts +3 -3
- package/types/components/Spinner/StyledSpinner.d.ts +2 -1
- package/types/components/Spinner/index.d.ts +2 -2
- package/types/components/Switch/StyledSwitch.d.ts +3 -18
- package/types/components/{Radio/__tests__/StyledRadio.spec.d.ts → Switch/__tests__/StyledSwitch.spec.d.ts} +0 -0
- package/types/components/Switch/index.d.ts +3 -2
- package/types/components/Tabs/ScrollableTabs.d.ts +1 -1
- package/types/components/Tabs/index.d.ts +3 -3
- package/types/components/Tag/index.d.ts +1 -1
- package/types/components/TextInput/index.d.ts +3 -3
- package/types/components/TimePicker/StyledTimePicker.d.ts +2 -1
- package/types/components/TimePicker/TimePickerAndroid.d.ts +1 -1
- package/types/components/TimePicker/TimePickerIOS.d.ts +1 -1
- package/types/components/TimePicker/index.d.ts +1 -1
- package/types/components/TimePicker/types.d.ts +1 -1
- package/types/components/Toast/StyledToast.d.ts +2 -1
- package/types/components/Toast/Toast.d.ts +1 -1
- package/types/components/Toast/ToastContainer.d.ts +2 -2
- package/types/components/Toast/ToastContext.d.ts +1 -1
- package/types/components/Toast/ToastProvider.d.ts +2 -2
- package/types/components/Toast/types.d.ts +3 -3
- package/types/components/Toolbar/StyledToolbar.d.ts +2 -1
- package/types/components/Toolbar/ToolbarGroup.d.ts +1 -1
- package/types/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/types/components/Toolbar/index.d.ts +1 -1
- package/types/components/Typography/Text/index.d.ts +2 -2
- package/types/testHelpers/renderWithTheme.d.ts +1 -1
- package/types/theme/ThemeProvider.d.ts +1 -1
- package/types/theme/components/accordion.d.ts +1 -1
- package/types/theme/components/alert.d.ts +1 -1
- package/types/theme/components/avatar.d.ts +1 -1
- package/types/theme/components/badge.d.ts +1 -1
- package/types/theme/components/bottomNavigation.d.ts +1 -1
- package/types/theme/components/bottomSheet.d.ts +1 -1
- package/types/theme/components/button.d.ts +1 -1
- package/types/theme/components/calendar.d.ts +1 -1
- package/types/theme/components/card.d.ts +1 -1
- package/types/theme/components/checkbox.d.ts +10 -7
- package/types/theme/components/contentNavigator.d.ts +1 -1
- package/types/theme/components/divider.d.ts +1 -1
- package/types/theme/components/drawer.d.ts +1 -1
- package/types/theme/components/empty.d.ts +1 -1
- package/types/theme/components/fab.d.ts +1 -1
- package/types/theme/components/icon.d.ts +1 -1
- package/types/theme/components/list.d.ts +8 -7
- package/types/theme/components/pinInput.d.ts +1 -1
- package/types/theme/components/progress.d.ts +1 -1
- package/types/theme/components/radio.d.ts +1 -8
- package/types/theme/components/richTextEditor.d.ts +1 -1
- package/types/theme/components/sectionHeading.d.ts +1 -1
- package/types/theme/components/select.d.ts +1 -1
- package/types/theme/components/spinner.d.ts +1 -1
- package/types/theme/components/switch.d.ts +7 -6
- package/types/theme/components/tabs.d.ts +1 -1
- package/types/theme/components/tag.d.ts +1 -1
- package/types/theme/components/textInput.d.ts +1 -1
- package/types/theme/components/toast.d.ts +1 -1
- package/types/theme/components/toolbar.d.ts +1 -1
- package/types/theme/components/typography.d.ts +1 -1
- package/types/theme/getTheme.d.ts +2 -2
- package/types/theme/global/borders.d.ts +2 -1
- package/types/theme/global/colors/swag.d.ts +1 -1
- package/types/theme/global/colors/work.d.ts +1 -1
- package/types/theme/global/index.d.ts +5 -3
- package/types/theme/global/scale.d.ts +2 -1
- package/types/theme/global/space.d.ts +2 -1
- package/types/theme/global/typography.d.ts +2 -1
- package/types/theme/index.d.ts +4 -2
- package/types/types.d.ts +9 -8
- package/src/components/Radio/__tests__/StyledRadio.spec.tsx +0 -43
- package/src/components/Radio/__tests__/__snapshots__/StyledRadio.spec.tsx.snap +0 -124
- package/src/components/Switch/__tests__/StyledHeading.spec.tsx +0 -42
- package/types/components/Switch/__tests__/StyledHeading.spec.d.ts +0 -1
|
@@ -4,7 +4,7 @@ import renderWithTheme from '../../../../testHelpers/renderWithTheme';
|
|
|
4
4
|
import SingleSelect from '..';
|
|
5
5
|
import Typography from '../../../Typography';
|
|
6
6
|
import List from '../../../List';
|
|
7
|
-
import { ListRenderOptionInfo } from '../../types';
|
|
7
|
+
import type { ListRenderOptionInfo } from '../../types';
|
|
8
8
|
|
|
9
9
|
const options = [
|
|
10
10
|
{ text: 'Monday', value: 'mon' },
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { TouchableOpacity, View } from 'react-native';
|
|
3
|
-
|
|
4
|
-
import { OptionType, SelectProps } from '../types';
|
|
5
3
|
import BottomSheet from '../../BottomSheet';
|
|
6
4
|
import OptionList from './OptionList';
|
|
7
5
|
import TextInput from '../../TextInput';
|
|
8
6
|
import { StyledSearchBar } from '../StyledSelect';
|
|
9
7
|
import { toFlatOptions, toSections, useKeyboard } from '../helpers';
|
|
8
|
+
import type { OptionType, SelectProps } from '../types';
|
|
10
9
|
|
|
11
10
|
export interface SingleSelectProps<V, T extends OptionType<V> = OptionType<V>>
|
|
12
11
|
extends SelectProps<V, T> {
|
|
@@ -53,20 +52,25 @@ const SingleSelect = <V, T extends OptionType<V>>({
|
|
|
53
52
|
}
|
|
54
53
|
>
|
|
55
54
|
<TouchableOpacity onPress={() => setOpen(true)}>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
{
|
|
56
|
+
// prevent users from focusing TextInput
|
|
57
|
+
}
|
|
58
|
+
<View pointerEvents="none">
|
|
59
|
+
<TextInput
|
|
60
|
+
label={label}
|
|
61
|
+
value={displayedValue}
|
|
62
|
+
suffix="arrow-down"
|
|
63
|
+
multiline
|
|
64
|
+
error={error}
|
|
65
|
+
editable={editable}
|
|
66
|
+
disabled={disabled}
|
|
67
|
+
loading={inputProps?.loading}
|
|
68
|
+
numberOfLines={numberOfLines}
|
|
69
|
+
pointerEvents="none"
|
|
70
|
+
style={style}
|
|
71
|
+
testID={testID}
|
|
72
|
+
/>
|
|
73
|
+
</View>
|
|
70
74
|
</TouchableOpacity>
|
|
71
75
|
</View>
|
|
72
76
|
<BottomSheet
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { useTheme } from '@emotion/react';
|
|
2
|
-
import React, {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
SectionListRenderItemInfo,
|
|
7
|
-
View,
|
|
8
|
-
} from 'react-native';
|
|
2
|
+
import React, { useRef, useState } from 'react';
|
|
3
|
+
import { Dimensions, SectionList, View } from 'react-native';
|
|
4
|
+
import type { ReactElement } from 'react';
|
|
5
|
+
import type { SectionListRenderItemInfo } from 'react-native';
|
|
9
6
|
import SectionHeading from '../SectionHeading';
|
|
10
7
|
import Spinner from '../Spinner';
|
|
11
|
-
import { ScrollParams } from './helpers';
|
|
12
8
|
import { OptionSpacer, SectionSpacer } from './StyledSelect';
|
|
13
|
-
import {
|
|
9
|
+
import type { ScrollParams } from './helpers';
|
|
10
|
+
import type {
|
|
11
|
+
SectionData,
|
|
12
|
+
OptionType,
|
|
13
|
+
SelectProps,
|
|
14
|
+
SectionType,
|
|
15
|
+
} from './types';
|
|
14
16
|
|
|
15
17
|
export type StyledOptionListProps<V, T extends OptionType<V>> = Pick<
|
|
16
18
|
SelectProps<V, T>,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import { Keyboard } from 'react-native';
|
|
3
|
-
import { SectionData, CombinedOptionsType, OptionType } from './types';
|
|
3
|
+
import type { SectionData, CombinedOptionsType, OptionType } from './types';
|
|
4
4
|
|
|
5
5
|
export const getKey = <V, T extends OptionType<V>>(
|
|
6
6
|
option: T,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import MultiSelect
|
|
2
|
-
import SingleSelect
|
|
1
|
+
import MultiSelect from './MultiSelect';
|
|
2
|
+
import SingleSelect from './SingleSelect';
|
|
3
|
+
import type { MultiSelectProps } from './MultiSelect';
|
|
4
|
+
import type { SingleSelectProps } from './SingleSelect';
|
|
5
|
+
|
|
6
|
+
export type { MultiSelectProps, SingleSelectProps };
|
|
3
7
|
|
|
4
8
|
export default Object.assign(SingleSelect, {
|
|
5
9
|
Multi: MultiSelect,
|
|
6
10
|
});
|
|
7
|
-
|
|
8
|
-
export { MultiSelectProps, SingleSelectProps };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type {
|
|
3
3
|
ListRenderItemInfo,
|
|
4
4
|
SectionListData,
|
|
5
5
|
SectionListRenderItemInfo,
|
|
6
6
|
StyleProp,
|
|
7
7
|
ViewStyle,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
import { TextInputProps } from '../TextInput';
|
|
9
|
+
import type { TextInputProps } from '../TextInput';
|
|
10
10
|
|
|
11
11
|
export type OptionType<V> = {
|
|
12
12
|
value: V;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { View
|
|
1
|
+
import { View } from 'react-native';
|
|
2
2
|
import styled from '@emotion/native';
|
|
3
|
+
import type { ViewProps } from 'react-native';
|
|
3
4
|
import { scale } from '../../utils/scale';
|
|
4
5
|
|
|
5
6
|
const StyledView = styled(View)<ViewProps>();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { ViewProps } from 'react-native';
|
|
4
4
|
import { StyledSpinnerContainer, StyledView } from './StyledSpinner';
|
|
5
5
|
import { AnimatedSpinner } from './AnimatedSpinner';
|
|
6
6
|
|
|
@@ -3,37 +3,21 @@ import { Animated, View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
type ThemeSize = 'small' | 'medium';
|
|
5
5
|
|
|
6
|
+
export type Variant =
|
|
7
|
+
| 'checked'
|
|
8
|
+
| 'unchecked'
|
|
9
|
+
| 'disabled-checked'
|
|
10
|
+
| 'disabled-unchecked';
|
|
11
|
+
|
|
6
12
|
const StyledWrapper = styled(View)<{
|
|
7
|
-
|
|
13
|
+
themeVariant: Variant;
|
|
8
14
|
themeSize: ThemeSize;
|
|
9
|
-
}>(({ theme,
|
|
15
|
+
}>(({ theme, themeVariant, themeSize }) => ({
|
|
10
16
|
height: theme.__hd__.switch.heights[themeSize],
|
|
11
17
|
width: theme.__hd__.switch.widths[themeSize],
|
|
12
18
|
paddingHorizontal: theme.__hd__.switch.spaces[themeSize],
|
|
13
19
|
borderRadius: theme.__hd__.switch.radii.rounded,
|
|
14
|
-
backgroundColor:
|
|
15
|
-
? theme.__hd__.switch.colors.active
|
|
16
|
-
: theme.__hd__.switch.colors.inactive,
|
|
17
|
-
}));
|
|
18
|
-
|
|
19
|
-
const StyledDisabledWrapper = styled(View)<{
|
|
20
|
-
themeSize: ThemeSize;
|
|
21
|
-
}>(({ theme, themeSize }) => ({
|
|
22
|
-
position: 'absolute',
|
|
23
|
-
height: theme.__hd__.switch.heights[themeSize],
|
|
24
|
-
width: theme.__hd__.switch.widths[themeSize],
|
|
25
|
-
borderRadius: theme.__hd__.switch.radii.rounded,
|
|
26
|
-
backgroundColor: theme.__hd__.switch.colors.thumb,
|
|
27
|
-
zIndex: 9999,
|
|
28
|
-
opacity: 0.8,
|
|
29
|
-
}));
|
|
30
|
-
|
|
31
|
-
const StyledThumbWrapper = styled(View)<{
|
|
32
|
-
themeSize: ThemeSize;
|
|
33
|
-
}>(({ theme, themeSize }) => ({
|
|
34
|
-
height: theme.__hd__.switch.heights[themeSize],
|
|
35
|
-
width: theme.__hd__.switch.widths[themeSize],
|
|
36
|
-
borderRadius: theme.__hd__.switch.radii.rounded,
|
|
20
|
+
backgroundColor: theme.__hd__.switch.colors.backgroundColors[themeVariant],
|
|
37
21
|
display: 'flex',
|
|
38
22
|
justifyContent: 'center',
|
|
39
23
|
}));
|
|
@@ -47,4 +31,4 @@ const StyledKnot = styled(Animated.View)<{
|
|
|
47
31
|
borderRadius: theme.__hd__.switch.radii.rounded,
|
|
48
32
|
}));
|
|
49
33
|
|
|
50
|
-
export { StyledWrapper,
|
|
34
|
+
export { StyledWrapper, StyledKnot };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
+
import { StyledWrapper, StyledKnot } from '../StyledSwitch';
|
|
4
|
+
|
|
5
|
+
describe('StyledWrapper', () => {
|
|
6
|
+
it.each`
|
|
7
|
+
variant
|
|
8
|
+
${'checked'}
|
|
9
|
+
${'unchecked'}
|
|
10
|
+
${'disabled-unchecked'}
|
|
11
|
+
${'disabled-checked'}
|
|
12
|
+
`('renders correct style with variant $variant', ({ variant }) => {
|
|
13
|
+
const { toJSON } = renderWithTheme(
|
|
14
|
+
<StyledWrapper themeVariant={variant} themeSize="medium" />
|
|
15
|
+
);
|
|
16
|
+
expect(toJSON()).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('StyledKnot', () => {
|
|
21
|
+
it('renders correct style', () => {
|
|
22
|
+
const { toJSON } = renderWithTheme(<StyledKnot themeSize="medium" />);
|
|
23
|
+
expect(toJSON()).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -1,74 +1,101 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`StyledKnot renders correct style 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
collapsable={false}
|
|
6
|
+
nativeID="animatedComponent"
|
|
7
|
+
style={
|
|
8
|
+
Object {
|
|
9
|
+
"backgroundColor": "#ffffff",
|
|
10
|
+
"borderRadius": 999,
|
|
11
|
+
"height": 20.8,
|
|
12
|
+
"width": 20.8,
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
themeSize="medium"
|
|
16
|
+
/>
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
exports[`StyledWrapper renders correct style with variant checked 1`] = `
|
|
4
20
|
<View
|
|
5
21
|
style={
|
|
6
22
|
Array [
|
|
7
23
|
Object {
|
|
8
|
-
"backgroundColor": "#
|
|
24
|
+
"backgroundColor": "#8505a2",
|
|
9
25
|
"borderRadius": 999,
|
|
26
|
+
"display": "flex",
|
|
10
27
|
"height": 28.799999999999997,
|
|
11
|
-
"
|
|
12
|
-
"
|
|
28
|
+
"justifyContent": "center",
|
|
29
|
+
"paddingHorizontal": 4,
|
|
13
30
|
"width": 56,
|
|
14
|
-
"zIndex": 9999,
|
|
15
31
|
},
|
|
16
32
|
undefined,
|
|
17
33
|
]
|
|
18
34
|
}
|
|
19
35
|
themeSize="medium"
|
|
36
|
+
themeVariant="checked"
|
|
20
37
|
/>
|
|
21
38
|
`;
|
|
22
39
|
|
|
23
|
-
exports[`
|
|
40
|
+
exports[`StyledWrapper renders correct style with variant disabled-checked 1`] = `
|
|
24
41
|
<View
|
|
25
|
-
collapsable={false}
|
|
26
|
-
nativeID="animatedComponent"
|
|
27
42
|
style={
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
Array [
|
|
44
|
+
Object {
|
|
45
|
+
"backgroundColor": "#c282d1",
|
|
46
|
+
"borderRadius": 999,
|
|
47
|
+
"display": "flex",
|
|
48
|
+
"height": 28.799999999999997,
|
|
49
|
+
"justifyContent": "center",
|
|
50
|
+
"paddingHorizontal": 4,
|
|
51
|
+
"width": 56,
|
|
52
|
+
},
|
|
53
|
+
undefined,
|
|
54
|
+
]
|
|
34
55
|
}
|
|
35
56
|
themeSize="medium"
|
|
57
|
+
themeVariant="disabled-checked"
|
|
36
58
|
/>
|
|
37
59
|
`;
|
|
38
60
|
|
|
39
|
-
exports[`
|
|
61
|
+
exports[`StyledWrapper renders correct style with variant disabled-unchecked 1`] = `
|
|
40
62
|
<View
|
|
41
63
|
style={
|
|
42
64
|
Array [
|
|
43
65
|
Object {
|
|
66
|
+
"backgroundColor": "#ccced1",
|
|
44
67
|
"borderRadius": 999,
|
|
45
68
|
"display": "flex",
|
|
46
69
|
"height": 28.799999999999997,
|
|
47
70
|
"justifyContent": "center",
|
|
71
|
+
"paddingHorizontal": 4,
|
|
48
72
|
"width": 56,
|
|
49
73
|
},
|
|
50
74
|
undefined,
|
|
51
75
|
]
|
|
52
76
|
}
|
|
53
77
|
themeSize="medium"
|
|
78
|
+
themeVariant="disabled-unchecked"
|
|
54
79
|
/>
|
|
55
80
|
`;
|
|
56
81
|
|
|
57
|
-
exports[`StyledWrapper renders correct style 1`] = `
|
|
82
|
+
exports[`StyledWrapper renders correct style with variant unchecked 1`] = `
|
|
58
83
|
<View
|
|
59
84
|
style={
|
|
60
85
|
Array [
|
|
61
86
|
Object {
|
|
62
|
-
"backgroundColor": "#
|
|
87
|
+
"backgroundColor": "#808f91",
|
|
63
88
|
"borderRadius": 999,
|
|
89
|
+
"display": "flex",
|
|
64
90
|
"height": 28.799999999999997,
|
|
91
|
+
"justifyContent": "center",
|
|
65
92
|
"paddingHorizontal": 4,
|
|
66
93
|
"width": 56,
|
|
67
94
|
},
|
|
68
95
|
undefined,
|
|
69
96
|
]
|
|
70
97
|
}
|
|
71
|
-
themeChecked={true}
|
|
72
98
|
themeSize="medium"
|
|
99
|
+
themeVariant="unchecked"
|
|
73
100
|
/>
|
|
74
101
|
`;
|
|
@@ -21,7 +21,9 @@ exports[`Switch renders correctly 1`] = `
|
|
|
21
21
|
Object {
|
|
22
22
|
"backgroundColor": "#808f91",
|
|
23
23
|
"borderRadius": 999,
|
|
24
|
+
"display": "flex",
|
|
24
25
|
"height": 28.799999999999997,
|
|
26
|
+
"justifyContent": "center",
|
|
25
27
|
"paddingHorizontal": 4,
|
|
26
28
|
"width": 56,
|
|
27
29
|
},
|
|
@@ -30,37 +32,22 @@ exports[`Switch renders correctly 1`] = `
|
|
|
30
32
|
}
|
|
31
33
|
testID="switch"
|
|
32
34
|
themeSize="medium"
|
|
35
|
+
themeVariant="unchecked"
|
|
33
36
|
>
|
|
34
37
|
<View
|
|
38
|
+
collapsable={false}
|
|
39
|
+
nativeID="animatedComponent"
|
|
35
40
|
style={
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
undefined,
|
|
45
|
-
]
|
|
41
|
+
Object {
|
|
42
|
+
"backgroundColor": "#ffffff",
|
|
43
|
+
"borderRadius": 999,
|
|
44
|
+
"height": 20.8,
|
|
45
|
+
"left": 0,
|
|
46
|
+
"width": 20.8,
|
|
47
|
+
}
|
|
46
48
|
}
|
|
47
49
|
themeSize="medium"
|
|
48
|
-
|
|
49
|
-
<View
|
|
50
|
-
collapsable={false}
|
|
51
|
-
nativeID="animatedComponent"
|
|
52
|
-
style={
|
|
53
|
-
Object {
|
|
54
|
-
"backgroundColor": "#ffffff",
|
|
55
|
-
"borderRadius": 999,
|
|
56
|
-
"height": 20.8,
|
|
57
|
-
"left": 0,
|
|
58
|
-
"width": 20.8,
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
themeSize="medium"
|
|
62
|
-
/>
|
|
63
|
-
</View>
|
|
50
|
+
/>
|
|
64
51
|
</View>
|
|
65
52
|
`;
|
|
66
53
|
|
|
@@ -85,7 +72,9 @@ exports[`Switch trigger press function correctly 1`] = `
|
|
|
85
72
|
Object {
|
|
86
73
|
"backgroundColor": "#808f91",
|
|
87
74
|
"borderRadius": 999,
|
|
75
|
+
"display": "flex",
|
|
88
76
|
"height": 28.799999999999997,
|
|
77
|
+
"justifyContent": "center",
|
|
89
78
|
"paddingHorizontal": 4,
|
|
90
79
|
"width": 56,
|
|
91
80
|
},
|
|
@@ -94,36 +83,21 @@ exports[`Switch trigger press function correctly 1`] = `
|
|
|
94
83
|
}
|
|
95
84
|
testID="switch"
|
|
96
85
|
themeSize="medium"
|
|
86
|
+
themeVariant="unchecked"
|
|
97
87
|
>
|
|
98
88
|
<View
|
|
89
|
+
collapsable={false}
|
|
90
|
+
nativeID="animatedComponent"
|
|
99
91
|
style={
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
undefined,
|
|
109
|
-
]
|
|
92
|
+
Object {
|
|
93
|
+
"backgroundColor": "#ffffff",
|
|
94
|
+
"borderRadius": 999,
|
|
95
|
+
"height": 20.8,
|
|
96
|
+
"left": 0,
|
|
97
|
+
"width": 20.8,
|
|
98
|
+
}
|
|
110
99
|
}
|
|
111
100
|
themeSize="medium"
|
|
112
|
-
|
|
113
|
-
<View
|
|
114
|
-
collapsable={false}
|
|
115
|
-
nativeID="animatedComponent"
|
|
116
|
-
style={
|
|
117
|
-
Object {
|
|
118
|
-
"backgroundColor": "#ffffff",
|
|
119
|
-
"borderRadius": 999,
|
|
120
|
-
"height": 20.8,
|
|
121
|
-
"left": 0,
|
|
122
|
-
"width": 20.8,
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
themeSize="medium"
|
|
126
|
-
/>
|
|
127
|
-
</View>
|
|
101
|
+
/>
|
|
128
102
|
</View>
|
|
129
103
|
`;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import { useTheme } from '@emotion/react';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
StyleProp,
|
|
6
|
-
ViewStyle,
|
|
7
|
-
Animated,
|
|
8
|
-
Easing,
|
|
9
|
-
TouchableWithoutFeedback,
|
|
10
|
-
} from 'react-native';
|
|
4
|
+
import { Animated, Easing, TouchableWithoutFeedback } from 'react-native';
|
|
11
5
|
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
StyledThumbWrapper,
|
|
16
|
-
StyledWrapper,
|
|
17
|
-
} from './StyledSwitch';
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
8
|
+
import { StyledKnot, StyledWrapper, Variant } from './StyledSwitch';
|
|
18
9
|
|
|
19
10
|
export interface SwitchProps {
|
|
20
11
|
/**
|
|
@@ -31,6 +22,7 @@ export interface SwitchProps {
|
|
|
31
22
|
onPress?: () => void;
|
|
32
23
|
/**
|
|
33
24
|
* Size of the switch
|
|
25
|
+
* size is deprecated and will be removed in the next major release.
|
|
34
26
|
*/
|
|
35
27
|
size?: 'small' | 'medium';
|
|
36
28
|
/**
|
|
@@ -43,15 +35,29 @@ export interface SwitchProps {
|
|
|
43
35
|
testID?: string;
|
|
44
36
|
}
|
|
45
37
|
|
|
38
|
+
const getVariant = ({
|
|
39
|
+
disabled,
|
|
40
|
+
checked,
|
|
41
|
+
}: {
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
checked: boolean;
|
|
44
|
+
}): Variant => {
|
|
45
|
+
if (disabled) {
|
|
46
|
+
return checked ? 'disabled-checked' : 'disabled-unchecked';
|
|
47
|
+
}
|
|
48
|
+
return checked ? 'checked' : 'unchecked';
|
|
49
|
+
};
|
|
50
|
+
|
|
46
51
|
const Switch = ({
|
|
47
52
|
size = 'medium',
|
|
48
53
|
disabled = false,
|
|
49
|
-
checked,
|
|
54
|
+
checked = false,
|
|
50
55
|
onPress,
|
|
51
56
|
style,
|
|
52
57
|
testID,
|
|
53
58
|
}: SwitchProps): ReactElement => {
|
|
54
59
|
const theme = useTheme();
|
|
60
|
+
const variant = getVariant({ disabled, checked });
|
|
55
61
|
|
|
56
62
|
const offset = checked
|
|
57
63
|
? theme.__hd__.switch.widths[size] -
|
|
@@ -74,11 +80,8 @@ const Switch = ({
|
|
|
74
80
|
onPress={onPress}
|
|
75
81
|
disabled={disabled}
|
|
76
82
|
>
|
|
77
|
-
<StyledWrapper
|
|
78
|
-
|
|
79
|
-
<StyledThumbWrapper themeSize={size}>
|
|
80
|
-
<StyledKnot themeSize={size} style={{ left: animatedOffset }} />
|
|
81
|
-
</StyledThumbWrapper>
|
|
83
|
+
<StyledWrapper themeVariant={variant} themeSize={size} style={style}>
|
|
84
|
+
<StyledKnot themeSize={size} style={{ left: animatedOffset }} />
|
|
82
85
|
</StyledWrapper>
|
|
83
86
|
</TouchableWithoutFeedback>
|
|
84
87
|
);
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
HeaderTabItemOutlineWrapper,
|
|
15
15
|
} from './StyledScrollableTabs';
|
|
16
16
|
import { useAnimatedValueArray } from './utils';
|
|
17
|
-
import { ItemType, TabsProps, TabType } from '.';
|
|
18
17
|
import { isHeroIcon } from '../Icon/utils';
|
|
19
18
|
import Icon from '../Icon';
|
|
20
19
|
import Typography from '../Typography';
|
|
21
20
|
import Badge from '../Badge';
|
|
21
|
+
import type { ItemType, TabsProps, TabType } from '.';
|
|
22
22
|
|
|
23
23
|
const getTabItem = ({
|
|
24
24
|
item,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Text } from 'react-native';
|
|
3
3
|
import { fireEvent } from '@testing-library/react-native';
|
|
4
4
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
5
|
+
import type { ComponentProps } from 'react';
|
|
5
6
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
6
|
-
import Tabs
|
|
7
|
+
import Tabs from '..';
|
|
7
8
|
import Button from '../../Button';
|
|
9
|
+
import type { TabType } from '..';
|
|
8
10
|
|
|
9
11
|
const TestTabsComponent = (
|
|
10
12
|
props: Omit<
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Text } from 'react-native';
|
|
3
3
|
import { fireEvent } from '@testing-library/react-native';
|
|
4
4
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
5
|
+
import type { ComponentProps } from 'react';
|
|
5
6
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
6
|
-
import Tabs
|
|
7
|
+
import Tabs from '..';
|
|
7
8
|
import Button from '../../Button';
|
|
9
|
+
import type { TabType } from '..';
|
|
8
10
|
|
|
9
11
|
const TestTabsComponent = (
|
|
10
12
|
props: Omit<
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
3
|
-
Animated,
|
|
4
|
-
TouchableWithoutFeedback,
|
|
5
|
-
View,
|
|
6
|
-
StyleProp,
|
|
7
|
-
ViewStyle,
|
|
8
|
-
ViewProps,
|
|
9
|
-
} from 'react-native';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Animated, TouchableWithoutFeedback, View } from 'react-native';
|
|
10
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
11
4
|
import { useTheme } from '@emotion/react';
|
|
12
|
-
import PagerView
|
|
13
|
-
|
|
14
|
-
} from 'react-native
|
|
5
|
+
import PagerView from 'react-native-pager-view';
|
|
6
|
+
import type { ReactNode } from 'react';
|
|
7
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
8
|
+
import type { PagerViewOnPageScrollEventData } from 'react-native-pager-view';
|
|
15
9
|
import Typography from '../Typography';
|
|
16
10
|
import {
|
|
17
11
|
ContentWrapper,
|
|
@@ -22,9 +16,9 @@ import {
|
|
|
22
16
|
HeaderTab,
|
|
23
17
|
} from './StyledTabs';
|
|
24
18
|
import Badge from '../Badge';
|
|
25
|
-
import { IconName } from '../Icon';
|
|
26
19
|
import ActiveTabIndicator from './ActiveTabIndicator';
|
|
27
20
|
import ScrollableTabs from './ScrollableTabs';
|
|
21
|
+
import type { IconName } from '../Icon';
|
|
28
22
|
|
|
29
23
|
export type ItemType =
|
|
30
24
|
| string
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TextInput as RNTextInput, StyleSheet } from 'react-native';
|
|
3
|
+
import type {
|
|
3
4
|
TextInputProps as NativeTextInputProps,
|
|
4
5
|
StyleProp,
|
|
5
6
|
ViewStyle,
|
|
6
7
|
TextStyle,
|
|
7
|
-
TextInput as RNTextInput,
|
|
8
|
-
StyleSheet,
|
|
9
8
|
} from 'react-native';
|
|
10
9
|
import {
|
|
11
10
|
StyledTextInputContainer,
|
|
@@ -15,7 +14,6 @@ import {
|
|
|
15
14
|
StyledAsteriskLabel,
|
|
16
15
|
StyledError,
|
|
17
16
|
StyledTextInput,
|
|
18
|
-
Variant,
|
|
19
17
|
StyledContainer,
|
|
20
18
|
StyledMaxLengthMessage,
|
|
21
19
|
StyledErrorContainer,
|
|
@@ -27,8 +25,10 @@ import {
|
|
|
27
25
|
StyledBorderBackDrop,
|
|
28
26
|
StyledErrorAndMaxLengthContainer,
|
|
29
27
|
} from './StyledTextInput';
|
|
30
|
-
import Icon
|
|
28
|
+
import Icon from '../Icon';
|
|
31
29
|
import { useTheme } from '../../theme';
|
|
30
|
+
import type { Variant } from './StyledTextInput';
|
|
31
|
+
import type { IconName } from '../Icon';
|
|
32
32
|
|
|
33
33
|
export interface TextInputProps extends NativeTextInputProps {
|
|
34
34
|
/**
|