@hero-design/rn 7.18.1 → 7.20.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.json +6 -1
- package/.turbo/turbo-build.log +2 -2
- package/es/index.js +726 -336
- package/lib/index.js +727 -336
- package/package.json +4 -4
- 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 +8 -7
- package/src/components/Alert/__tests__/__snapshots__/index.spec.tsx.snap +140 -19
- package/src/components/Alert/__tests__/index.spec.tsx +21 -0
- package/src/components/Alert/index.tsx +18 -9
- package/src/components/Avatar/StyledAvatar.tsx +2 -1
- package/src/components/Avatar/index.tsx +4 -3
- 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/Box/StyledBox.tsx +54 -0
- package/src/components/Box/__tests__/__snapshots__/index.spec.tsx.snap +605 -0
- package/src/components/Box/__tests__/helpers.spec.ts +14 -0
- package/src/components/Box/__tests__/index.spec.tsx +155 -0
- package/src/components/Box/config.ts +201 -0
- package/src/components/Box/helpers.ts +10 -0
- package/src/components/Box/index.tsx +13 -0
- package/src/components/Box/types.ts +38 -0
- 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/Calendar/__tests__/index.spec.tsx +13 -17
- package/src/components/Card/DataCard/StyledDataCard.tsx +8 -2
- package/src/components/Card/DataCard/__tests__/StyledDataCard.spec.tsx +1 -0
- package/src/components/Card/DataCard/__tests__/__snapshots__/StyledDataCard.spec.tsx.snap +16 -0
- package/src/components/Card/DataCard/index.tsx +4 -3
- package/src/components/Card/StyledCard.tsx +12 -19
- package/src/components/Card/__tests__/__snapshots__/index.spec.tsx.snap +147 -0
- package/src/components/Card/__tests__/index.spec.tsx +18 -0
- package/src/components/Card/index.tsx +9 -3
- 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/helpers.ts +3 -4
- 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 +11 -11
- 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 +8 -15
- package/src/components/RichTextEditor/index.tsx +6 -6
- package/src/components/SectionHeading/__tests__/__snapshots__/StyledHeading.spec.tsx.snap +1 -1
- package/src/components/SectionHeading/__tests__/__snapshots__/index.spec.tsx.snap +4 -4
- 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__/OptionList.spec.tsx.snap +22 -20
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +609 -589
- 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__/OptionList.spec.tsx.snap +22 -20
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +606 -586
- 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/AnimatedSpinner.tsx +7 -7
- package/src/components/Spinner/StyledSpinner.tsx +26 -20
- package/src/components/Spinner/__tests__/AnimatedSpinner.spec.tsx +1 -1
- package/src/components/Spinner/__tests__/StyledSpinner.spec.tsx +32 -16
- package/src/components/Spinner/__tests__/__snapshots__/AnimatedSpinner.spec.tsx.snap +14 -12
- package/src/components/Spinner/__tests__/__snapshots__/StyledSpinner.spec.tsx.snap +273 -31
- package/src/components/Spinner/__tests__/__snapshots__/index.spec.tsx.snap +14 -12
- package/src/components/Spinner/index.tsx +13 -5
- 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 +10 -5
- package/src/components/Tabs/StyledScrollableTabs.tsx +6 -5
- package/src/components/Tabs/StyledTabs.tsx +6 -0
- package/src/components/Tabs/TabWithBadge.tsx +68 -0
- package/src/components/Tabs/__tests__/ScrollableTabs.spec.tsx +17 -2
- package/src/components/Tabs/__tests__/TabWithBadge.spec.tsx +48 -0
- package/src/components/Tabs/__tests__/__snapshots__/ScrollableTabs.spec.tsx.snap +205 -43
- package/src/components/Tabs/__tests__/__snapshots__/TabWithBadge.spec.tsx.snap +165 -0
- package/src/components/Tabs/__tests__/__snapshots__/index.spec.tsx.snap +135 -34
- package/src/components/Tabs/__tests__/index.spec.tsx +16 -2
- package/src/components/Tabs/index.tsx +17 -16
- package/src/components/Tag/StyledTag.tsx +1 -11
- package/src/components/Tag/__tests__/__snapshots__/Tag.spec.tsx.snap +4 -4
- package/src/components/Tag/index.tsx +3 -3
- package/src/components/TextInput/__tests__/index.spec.tsx +10 -14
- 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 +16 -15
- package/src/components/Toast/Toast.tsx +36 -10
- package/src/components/Toast/ToastContainer.tsx +2 -2
- package/src/components/Toast/ToastContext.ts +1 -1
- package/src/components/Toast/ToastProvider.tsx +20 -19
- package/src/components/Toast/__tests__/Toast.spec.tsx +17 -0
- package/src/components/Toast/__tests__/ToastContainer.spec.tsx +1 -1
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +299 -19
- package/src/components/Toast/types.ts +18 -4
- 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/StyledText.tsx +7 -1
- package/src/components/Typography/Text/__tests__/StyledText.spec.tsx +1 -0
- package/src/components/Typography/Text/__tests__/__snapshots__/StyledText.spec.tsx.snap +22 -0
- package/src/components/Typography/Text/index.tsx +10 -3
- package/src/index.ts +2 -0
- package/src/testHelpers/renderWithTheme.tsx +2 -1
- package/src/theme/ThemeProvider.ts +1 -1
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +100 -49
- package/src/theme/components/.eslintrc.json +10 -0
- package/src/theme/components/accordion.ts +1 -1
- package/src/theme/components/alert.ts +6 -2
- package/src/theme/components/avatar.ts +3 -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 +7 -8
- 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 +2 -2
- package/src/theme/components/select.ts +1 -1
- package/src/theme/components/spinner.ts +20 -8
- package/src/theme/components/switch.ts +7 -8
- package/src/theme/components/tabs.ts +4 -3
- package/src/theme/components/tag.ts +14 -14
- package/src/theme/components/textInput.ts +1 -1
- package/src/theme/components/toast.ts +18 -4
- package/src/theme/components/toolbar.ts +1 -1
- package/src/theme/components/typography.ts +3 -1
- package/src/theme/getTheme.ts +4 -11
- package/src/theme/global/borders.ts +2 -1
- package/src/theme/global/colors/swag.ts +25 -3
- package/src/theme/global/colors/types.ts +23 -0
- package/src/theme/global/colors/work.ts +6 -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 +5 -21
- package/types/components/Accordion/AccordionItem.d.ts +3 -3
- package/types/components/Accordion/StyledAccordion.d.ts +14 -14
- package/types/components/Accordion/index.d.ts +3 -2
- package/types/components/Alert/StyledAlert.d.ts +18 -17
- package/types/components/Alert/index.d.ts +4 -4
- package/types/components/Avatar/StyledAvatar.d.ts +16 -16
- package/types/components/Avatar/index.d.ts +3 -3
- package/types/components/Badge/Status.d.ts +2 -2
- package/types/components/Badge/StyledBadge.d.ts +7 -7
- package/types/components/Badge/index.d.ts +2 -1
- package/types/components/BottomNavigation/StyledBottomNavigation.d.ts +21 -21
- 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 +2 -2
- package/types/components/BottomSheet/StyledBottomSheet.d.ts +21 -20
- package/types/components/BottomSheet/index.d.ts +2 -2
- package/types/components/Box/StyledBox.d.ts +15 -0
- package/types/components/{Radio/__tests__/StyledRadio.spec.d.ts → Box/__tests__/helpers.spec.d.ts} +0 -0
- package/types/components/{Switch/__tests__/StyledHeading.spec.d.ts → Box/__tests__/index.spec.d.ts} +0 -0
- package/types/components/Box/config.d.ts +170 -0
- package/types/components/Box/helpers.d.ts +1 -0
- package/types/components/Box/index.d.ts +5 -0
- package/types/components/Box/types.d.ts +31 -0
- 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 +10 -9
- package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +19 -18
- package/types/components/Button/UtilityButton/StyledUtilityButton.d.ts +8 -8
- 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 +27 -26
- package/types/components/Calendar/helpers.d.ts +2 -2
- package/types/components/Card/DataCard/StyledDataCard.d.ts +7 -7
- package/types/components/Card/DataCard/index.d.ts +3 -3
- package/types/components/Card/StyledCard.d.ts +7 -6
- package/types/components/Card/index.d.ts +7 -3
- package/types/components/Checkbox/StyledCheckbox.d.ts +24 -6
- package/types/components/Checkbox/index.d.ts +11 -3
- package/types/components/Collapse/StyledCollapse.d.ts +8 -8
- package/types/components/Collapse/index.d.ts +2 -2
- package/types/components/ContentNavigator/StyledContentNavigator.d.ts +5 -5
- 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 +5 -4
- package/types/components/DatePicker/index.d.ts +1 -1
- package/types/components/DatePicker/types.d.ts +1 -1
- package/types/components/Divider/StyledDivider.d.ts +5 -5
- 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 +21 -20
- package/types/components/Drawer/index.d.ts +1 -1
- package/types/components/Empty/StyledEmpty.d.ts +12 -12
- 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 +14 -13
- package/types/components/FAB/ActionGroup/StyledActionItem.d.ts +10 -9
- 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 +11 -10
- package/types/components/Icon/AnimatedIcon.d.ts +1 -1
- package/types/components/Icon/HeroIcon/index.d.ts +3 -3
- 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/List/StyledBasicListItem.d.ts +14 -14
- package/types/components/List/StyledListItem.d.ts +23 -23
- package/types/components/PinInput/PinCell.d.ts +1 -1
- package/types/components/PinInput/StyledPinInput.d.ts +30 -30
- 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 +8 -7
- package/types/components/Progress/StyledProgressCircle.d.ts +21 -20
- 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 +11 -21
- package/types/components/RichTextEditor/EditorToolbar.d.ts +1 -1
- package/types/components/RichTextEditor/MentionList.d.ts +1 -1
- package/types/components/RichTextEditor/RichTextEditor.d.ts +3 -2
- package/types/components/RichTextEditor/StyledRichTextEditor.d.ts +6 -6
- package/types/components/RichTextEditor/StyledToolbar.d.ts +9 -9
- package/types/components/RichTextEditor/index.d.ts +5 -4
- package/types/components/SectionHeading/StyledHeading.d.ts +9 -9
- package/types/components/SectionHeading/index.d.ts +3 -3
- package/types/components/Select/MultiSelect/Option.d.ts +2 -2
- 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 +2 -2
- 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/StyledSelect.d.ts +11 -11
- package/types/components/Select/helpers.d.ts +2 -2
- package/types/components/Select/index.d.ts +4 -3
- package/types/components/Select/types.d.ts +3 -3
- package/types/components/Spinner/AnimatedSpinner.d.ts +3 -1
- package/types/components/Spinner/StyledSpinner.d.ts +16 -13
- package/types/components/Spinner/index.d.ts +7 -3
- package/types/components/Switch/StyledSwitch.d.ts +8 -23
- package/types/components/Switch/__tests__/StyledSwitch.spec.d.ts +1 -0
- package/types/components/Switch/index.d.ts +3 -2
- package/types/components/Tabs/ScrollableTabs.d.ts +1 -1
- package/types/components/Tabs/StyledScrollableTabs.d.ts +24 -22
- package/types/components/Tabs/StyledTabs.d.ts +26 -20
- package/types/components/Tabs/TabWithBadge.d.ts +17 -0
- package/types/components/Tabs/__tests__/TabWithBadge.spec.d.ts +1 -0
- package/types/components/Tabs/index.d.ts +4 -2
- package/types/components/Tag/StyledTag.d.ts +6 -6
- package/types/components/Tag/index.d.ts +2 -2
- package/types/components/TextInput/StyledTextInput.d.ts +44 -44
- package/types/components/TextInput/index.d.ts +8 -8
- package/types/components/TimePicker/StyledTimePicker.d.ts +5 -4
- 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 +21 -19
- 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 +5 -4
- package/types/components/Toolbar/StyledToolbar.d.ts +11 -10
- 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/StyledText.d.ts +4 -4
- package/types/components/Typography/Text/index.d.ts +3 -3
- package/types/index.d.ts +2 -1
- package/types/testHelpers/renderWithTheme.d.ts +2 -2
- package/types/theme/ThemeProvider.d.ts +1 -1
- package/types/theme/ThemeSwitcher.d.ts +1 -1
- package/types/theme/components/accordion.d.ts +1 -1
- package/types/theme/components/alert.d.ts +6 -2
- package/types/theme/components/avatar.d.ts +3 -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 +7 -8
- 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 +18 -6
- package/types/theme/components/switch.d.ts +7 -6
- package/types/theme/components/tabs.d.ts +2 -1
- package/types/theme/components/tag.d.ts +3 -3
- package/types/theme/components/textInput.d.ts +1 -1
- package/types/theme/components/toast.d.ts +19 -3
- package/types/theme/components/toolbar.d.ts +1 -1
- package/types/theme/components/typography.d.ts +3 -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/types.d.ts +17 -0
- package/types/theme/global/colors/work.d.ts +1 -1
- package/types/theme/global/index.d.ts +22 -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/types/utils/hooks.d.ts +1 -1
- 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
|
@@ -178,28 +178,6 @@ exports[`Tabs renders correctly 1`] = `
|
|
|
178
178
|
>
|
|
179
179
|
Work
|
|
180
180
|
</Text>
|
|
181
|
-
<View
|
|
182
|
-
collapsable={false}
|
|
183
|
-
nativeID="animatedComponent"
|
|
184
|
-
style={
|
|
185
|
-
Object {
|
|
186
|
-
"backgroundColor": "#de350b",
|
|
187
|
-
"borderRadius": 999,
|
|
188
|
-
"height": 8,
|
|
189
|
-
"opacity": 0,
|
|
190
|
-
"position": "absolute",
|
|
191
|
-
"right": -2,
|
|
192
|
-
"top": -2,
|
|
193
|
-
"transform": Array [
|
|
194
|
-
Object {
|
|
195
|
-
"scale": 0.5,
|
|
196
|
-
},
|
|
197
|
-
],
|
|
198
|
-
"width": 8,
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
themeIntent="danger"
|
|
202
|
-
/>
|
|
203
181
|
</View>
|
|
204
182
|
</View>
|
|
205
183
|
<View
|
|
@@ -246,6 +224,59 @@ exports[`Tabs renders correctly 1`] = `
|
|
|
246
224
|
>
|
|
247
225
|
Personal
|
|
248
226
|
</Text>
|
|
227
|
+
</View>
|
|
228
|
+
</View>
|
|
229
|
+
<View
|
|
230
|
+
accessible={true}
|
|
231
|
+
focusable={true}
|
|
232
|
+
onClick={[Function]}
|
|
233
|
+
onResponderGrant={[Function]}
|
|
234
|
+
onResponderMove={[Function]}
|
|
235
|
+
onResponderRelease={[Function]}
|
|
236
|
+
onResponderTerminate={[Function]}
|
|
237
|
+
onResponderTerminationRequest={[Function]}
|
|
238
|
+
onStartShouldSetResponder={[Function]}
|
|
239
|
+
style={
|
|
240
|
+
Array [
|
|
241
|
+
Object {
|
|
242
|
+
"alignItems": "center",
|
|
243
|
+
"flex": 1,
|
|
244
|
+
"paddingVertical": 8,
|
|
245
|
+
},
|
|
246
|
+
undefined,
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
>
|
|
250
|
+
<View
|
|
251
|
+
style={
|
|
252
|
+
Object {
|
|
253
|
+
"paddingHorizontal": 8,
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
testID="deprecated-badge"
|
|
257
|
+
>
|
|
258
|
+
<Text
|
|
259
|
+
numberOfLines={1}
|
|
260
|
+
style={
|
|
261
|
+
Array [
|
|
262
|
+
Object {
|
|
263
|
+
"color": "#001f23",
|
|
264
|
+
"fontFamily": "BeVietnamPro-Regular",
|
|
265
|
+
"fontSize": 14,
|
|
266
|
+
"letterSpacing": 0.42,
|
|
267
|
+
"lineHeight": 22,
|
|
268
|
+
},
|
|
269
|
+
Object {
|
|
270
|
+
"color": "#001f23",
|
|
271
|
+
},
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
themeFontSize="medium"
|
|
275
|
+
themeFontWeight="regular"
|
|
276
|
+
themeIntent="body"
|
|
277
|
+
>
|
|
278
|
+
Home
|
|
279
|
+
</Text>
|
|
249
280
|
<View
|
|
250
281
|
collapsable={false}
|
|
251
282
|
nativeID="animatedComponent"
|
|
@@ -254,13 +285,13 @@ exports[`Tabs renders correctly 1`] = `
|
|
|
254
285
|
"backgroundColor": "#de350b",
|
|
255
286
|
"borderRadius": 999,
|
|
256
287
|
"height": 8,
|
|
257
|
-
"opacity":
|
|
288
|
+
"opacity": 1,
|
|
258
289
|
"position": "absolute",
|
|
259
290
|
"right": -2,
|
|
260
291
|
"top": -2,
|
|
261
292
|
"transform": Array [
|
|
262
293
|
Object {
|
|
263
|
-
"scale":
|
|
294
|
+
"scale": 1,
|
|
264
295
|
},
|
|
265
296
|
],
|
|
266
297
|
"width": 8,
|
|
@@ -291,7 +322,17 @@ exports[`Tabs renders correctly 1`] = `
|
|
|
291
322
|
]
|
|
292
323
|
}
|
|
293
324
|
>
|
|
294
|
-
<View
|
|
325
|
+
<View
|
|
326
|
+
style={
|
|
327
|
+
Array [
|
|
328
|
+
Object {
|
|
329
|
+
"alignItems": "center",
|
|
330
|
+
"flexDirection": "row",
|
|
331
|
+
},
|
|
332
|
+
undefined,
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
>
|
|
295
336
|
<Text
|
|
296
337
|
numberOfLines={1}
|
|
297
338
|
style={
|
|
@@ -312,30 +353,50 @@ exports[`Tabs renders correctly 1`] = `
|
|
|
312
353
|
themeFontWeight="regular"
|
|
313
354
|
themeIntent="body"
|
|
314
355
|
>
|
|
315
|
-
|
|
356
|
+
Wallet
|
|
316
357
|
</Text>
|
|
317
358
|
<View
|
|
318
359
|
collapsable={false}
|
|
319
360
|
nativeID="animatedComponent"
|
|
320
361
|
style={
|
|
321
362
|
Object {
|
|
322
|
-
"
|
|
363
|
+
"alignItems": "center",
|
|
364
|
+
"backgroundColor": "#4568fb",
|
|
323
365
|
"borderRadius": 999,
|
|
324
|
-
"height":
|
|
366
|
+
"height": 20,
|
|
367
|
+
"justifyContent": "center",
|
|
368
|
+
"marginLeft": 4,
|
|
369
|
+
"minWidth": 20,
|
|
325
370
|
"opacity": 1,
|
|
326
|
-
"
|
|
327
|
-
"right": -2,
|
|
328
|
-
"top": -2,
|
|
371
|
+
"paddingHorizontal": 8,
|
|
329
372
|
"transform": Array [
|
|
330
373
|
Object {
|
|
331
374
|
"scale": 1,
|
|
332
375
|
},
|
|
333
376
|
],
|
|
334
|
-
"width": 8,
|
|
335
377
|
}
|
|
336
378
|
}
|
|
337
|
-
themeIntent="
|
|
338
|
-
|
|
379
|
+
themeIntent="info"
|
|
380
|
+
themePadding="wideContent"
|
|
381
|
+
>
|
|
382
|
+
<Text
|
|
383
|
+
style={
|
|
384
|
+
Array [
|
|
385
|
+
Object {
|
|
386
|
+
"color": "#ffffff",
|
|
387
|
+
"fontFamily": "BeVietnamPro-SemiBold",
|
|
388
|
+
"fontSize": 12,
|
|
389
|
+
"includeFontPadding": false,
|
|
390
|
+
"textAlign": "center",
|
|
391
|
+
"textAlignVertical": "center",
|
|
392
|
+
},
|
|
393
|
+
undefined,
|
|
394
|
+
]
|
|
395
|
+
}
|
|
396
|
+
>
|
|
397
|
+
50
|
|
398
|
+
</Text>
|
|
399
|
+
</View>
|
|
339
400
|
</View>
|
|
340
401
|
</View>
|
|
341
402
|
</View>
|
|
@@ -487,6 +548,46 @@ exports[`Tabs renders correctly 1`] = `
|
|
|
487
548
|
</Text>
|
|
488
549
|
</View>
|
|
489
550
|
</View>
|
|
551
|
+
<View
|
|
552
|
+
collapsable={false}
|
|
553
|
+
style={
|
|
554
|
+
Object {
|
|
555
|
+
"bottom": 0,
|
|
556
|
+
"left": 0,
|
|
557
|
+
"position": "absolute",
|
|
558
|
+
"right": 0,
|
|
559
|
+
"top": 0,
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
>
|
|
563
|
+
<View
|
|
564
|
+
accessibilityElementsHidden={true}
|
|
565
|
+
collapsable={false}
|
|
566
|
+
importantForAccessibility="no-hide-descendants"
|
|
567
|
+
pointerEvents="none"
|
|
568
|
+
style={
|
|
569
|
+
Array [
|
|
570
|
+
Object {
|
|
571
|
+
"flex": 1,
|
|
572
|
+
},
|
|
573
|
+
Array [
|
|
574
|
+
undefined,
|
|
575
|
+
Object {
|
|
576
|
+
"bottom": 0,
|
|
577
|
+
"left": 0,
|
|
578
|
+
"position": "absolute",
|
|
579
|
+
"right": 0,
|
|
580
|
+
"top": 0,
|
|
581
|
+
},
|
|
582
|
+
],
|
|
583
|
+
]
|
|
584
|
+
}
|
|
585
|
+
>
|
|
586
|
+
<Text>
|
|
587
|
+
Wallet Screen
|
|
588
|
+
</Text>
|
|
589
|
+
</View>
|
|
590
|
+
</View>
|
|
490
591
|
</RNCViewPager>
|
|
491
592
|
</View>
|
|
492
593
|
</RNCSafeAreaProvider>
|
|
@@ -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<
|
|
@@ -30,6 +32,15 @@ const TestTabsComponent = (
|
|
|
30
32
|
component: <Text>Home Screen</Text>,
|
|
31
33
|
showBadge: true,
|
|
32
34
|
},
|
|
35
|
+
{
|
|
36
|
+
key: 'wallet',
|
|
37
|
+
activeItem: 'Wallet',
|
|
38
|
+
component: <Text>Wallet Screen</Text>,
|
|
39
|
+
badge: {
|
|
40
|
+
type: 'counter',
|
|
41
|
+
value: 50,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
33
44
|
];
|
|
34
45
|
|
|
35
46
|
return (
|
|
@@ -69,6 +80,9 @@ describe('Tabs', () => {
|
|
|
69
80
|
expect(getByText('Home Screen')).toBeDefined();
|
|
70
81
|
fireEvent.press(getByText('Move to Work'));
|
|
71
82
|
expect(getByText('Work Screen')).toBeDefined();
|
|
83
|
+
fireEvent.press(getByText('Wallet'));
|
|
84
|
+
expect(getByText('Wallet Screen')).toBeDefined();
|
|
85
|
+
expect(getByText('50')).toBeDefined();
|
|
72
86
|
});
|
|
73
87
|
|
|
74
88
|
it('renders correctly with lazy preloaded', () => {
|
|
@@ -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,
|
|
@@ -21,10 +15,11 @@ import {
|
|
|
21
15
|
TabScreen,
|
|
22
16
|
HeaderTab,
|
|
23
17
|
} from './StyledTabs';
|
|
24
|
-
import Badge from '../Badge';
|
|
25
|
-
import { IconName } from '../Icon';
|
|
26
18
|
import ActiveTabIndicator from './ActiveTabIndicator';
|
|
27
19
|
import ScrollableTabs from './ScrollableTabs';
|
|
20
|
+
import TabWithBadge from './TabWithBadge';
|
|
21
|
+
import type { BadgeConfigType } from './TabWithBadge';
|
|
22
|
+
import { IconName } from '../Icon';
|
|
28
23
|
|
|
29
24
|
export type ItemType =
|
|
30
25
|
| string
|
|
@@ -38,6 +33,7 @@ export type TabType = {
|
|
|
38
33
|
component: ReactNode;
|
|
39
34
|
testID?: string;
|
|
40
35
|
showBadge?: boolean;
|
|
36
|
+
badge?: BadgeConfigType;
|
|
41
37
|
};
|
|
42
38
|
|
|
43
39
|
export interface TabsProps extends ViewProps {
|
|
@@ -142,7 +138,8 @@ const Tabs = ({
|
|
|
142
138
|
testID,
|
|
143
139
|
activeItem,
|
|
144
140
|
inactiveItem: originalInactiveItem,
|
|
145
|
-
showBadge
|
|
141
|
+
showBadge,
|
|
142
|
+
badge,
|
|
146
143
|
} = tab;
|
|
147
144
|
|
|
148
145
|
const active = selectedTabKey === key;
|
|
@@ -162,7 +159,11 @@ const Tabs = ({
|
|
|
162
159
|
testID={testID}
|
|
163
160
|
>
|
|
164
161
|
<HeaderTabItem>
|
|
165
|
-
<
|
|
162
|
+
<TabWithBadge
|
|
163
|
+
showBadge={showBadge}
|
|
164
|
+
config={badge}
|
|
165
|
+
tabItem={tabItem}
|
|
166
|
+
/>
|
|
166
167
|
</HeaderTabItem>
|
|
167
168
|
</TouchableWithoutFeedback>
|
|
168
169
|
);
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { View, Text } from 'react-native';
|
|
2
2
|
import styled from '@emotion/native';
|
|
3
3
|
|
|
4
|
-
const BACKGROUND_INTENTS = {
|
|
5
|
-
default: 'defaultBackground',
|
|
6
|
-
primary: 'primaryBackground',
|
|
7
|
-
info: 'infoBackground',
|
|
8
|
-
success: 'successBackground',
|
|
9
|
-
warning: 'warningBackground',
|
|
10
|
-
danger: 'dangerBackground',
|
|
11
|
-
archived: 'archivedBackground',
|
|
12
|
-
} as const;
|
|
13
|
-
|
|
14
4
|
type ThemeIntent =
|
|
15
5
|
| 'default'
|
|
16
6
|
| 'primary'
|
|
@@ -27,7 +17,7 @@ const StyledView = styled(View)<{ themeIntent: ThemeIntent }>(
|
|
|
27
17
|
paddingVertical: theme.__hd__.tag.space.verticalPadding,
|
|
28
18
|
paddingHorizontal: theme.__hd__.tag.space.horizontalPadding,
|
|
29
19
|
borderColor: theme.__hd__.tag.colors[themeIntent],
|
|
30
|
-
backgroundColor: theme.__hd__.tag.colors[
|
|
20
|
+
backgroundColor: theme.__hd__.tag.colors[`${themeIntent}Background`],
|
|
31
21
|
})
|
|
32
22
|
);
|
|
33
23
|
|
|
@@ -43,8 +43,8 @@ exports[`Tag has archived style when intent is primary 1`] = `
|
|
|
43
43
|
style={
|
|
44
44
|
Array [
|
|
45
45
|
Object {
|
|
46
|
-
"backgroundColor":
|
|
47
|
-
"borderColor": "#
|
|
46
|
+
"backgroundColor": undefined,
|
|
47
|
+
"borderColor": "#001f23",
|
|
48
48
|
"borderRadius": 4,
|
|
49
49
|
"borderWidth": 1,
|
|
50
50
|
"paddingHorizontal": 8,
|
|
@@ -59,7 +59,7 @@ exports[`Tag has archived style when intent is primary 1`] = `
|
|
|
59
59
|
style={
|
|
60
60
|
Array [
|
|
61
61
|
Object {
|
|
62
|
-
"color": "#
|
|
62
|
+
"color": "#001f23",
|
|
63
63
|
"fontFamily": "BeVietnamPro-SemiBold",
|
|
64
64
|
"fontSize": 12,
|
|
65
65
|
"includeFontPadding": false,
|
|
@@ -233,7 +233,7 @@ exports[`Tag has warning style when intent is warning 1`] = `
|
|
|
233
233
|
style={
|
|
234
234
|
Array [
|
|
235
235
|
Object {
|
|
236
|
-
"backgroundColor": "#
|
|
236
|
+
"backgroundColor": "#fff6eb",
|
|
237
237
|
"borderColor": "#ffa234",
|
|
238
238
|
"borderRadius": 4,
|
|
239
239
|
"borderWidth": 1,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
3
3
|
import { StyledView, StyledText } from './StyledTag';
|
|
4
4
|
|
|
5
5
|
interface TagProps extends ViewProps {
|
|
@@ -11,8 +11,8 @@ interface TagProps extends ViewProps {
|
|
|
11
11
|
* Visual intent color to apply to Tag.
|
|
12
12
|
*/
|
|
13
13
|
intent?:
|
|
14
|
-
| 'default'
|
|
15
14
|
| 'primary'
|
|
15
|
+
| 'default' // Will be deprecated in the future
|
|
16
16
|
| 'info'
|
|
17
17
|
| 'success'
|
|
18
18
|
| 'warning'
|
|
@@ -30,7 +30,7 @@ interface TagProps extends ViewProps {
|
|
|
30
30
|
|
|
31
31
|
const Tag = ({
|
|
32
32
|
content,
|
|
33
|
-
intent = '
|
|
33
|
+
intent = 'primary',
|
|
34
34
|
style,
|
|
35
35
|
testID,
|
|
36
36
|
...nativeProps
|
|
@@ -259,20 +259,16 @@ describe('TextInput', () => {
|
|
|
259
259
|
|
|
260
260
|
describe('disabled', () => {
|
|
261
261
|
it('renders correctly', () => {
|
|
262
|
-
const {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
value="100"
|
|
273
|
-
testID="disabled-text-input"
|
|
274
|
-
/>
|
|
275
|
-
);
|
|
262
|
+
const { toJSON, queryAllByTestId, queryAllByText, getByTestId } =
|
|
263
|
+
renderWithTheme(
|
|
264
|
+
<TextInput
|
|
265
|
+
label="Amount (AUD)"
|
|
266
|
+
required
|
|
267
|
+
disabled
|
|
268
|
+
value="100"
|
|
269
|
+
testID="disabled-text-input"
|
|
270
|
+
/>
|
|
271
|
+
);
|
|
276
272
|
|
|
277
273
|
expect(toJSON()).toMatchSnapshot();
|
|
278
274
|
expect(queryAllByText('Amount (AUD)')).toHaveLength(1);
|
|
@@ -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
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import type { ViewProps } from 'react-native';
|
|
3
4
|
|
|
4
5
|
const StyledPickerWrapper = styled(View)<ViewProps>(({ theme }) => ({
|
|
5
6
|
height: theme.__hd__.timePicker.sizes.height,
|
|
@@ -4,7 +4,7 @@ import { TouchableOpacity, View } from 'react-native';
|
|
|
4
4
|
import formatTime from 'date-fns/fp/format';
|
|
5
5
|
|
|
6
6
|
import TextInput from '../TextInput';
|
|
7
|
-
import { TimePickerProps } from './types';
|
|
7
|
+
import type { TimePickerProps } from './types';
|
|
8
8
|
|
|
9
9
|
const TimePickerAndroid = ({
|
|
10
10
|
value,
|
|
@@ -7,7 +7,7 @@ import BottomSheet from '../BottomSheet';
|
|
|
7
7
|
import TextInput from '../TextInput';
|
|
8
8
|
import Typography from '../Typography';
|
|
9
9
|
import { StyledPickerWrapper } from './StyledTimePicker';
|
|
10
|
-
import { TimePickerProps } from './types';
|
|
10
|
+
import type { TimePickerProps } from './types';
|
|
11
11
|
|
|
12
12
|
const TimePickerIOS = ({
|
|
13
13
|
value,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { fireEvent } from '@testing-library/react-native';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ModalProps } from 'react-native';
|
|
4
|
-
|
|
3
|
+
import type { ModalProps } from 'react-native';
|
|
5
4
|
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
6
5
|
import TimePickerIOS from '../TimePickerIOS';
|
|
7
6
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import TimePickerAndroid from './TimePickerAndroid';
|
|
4
4
|
import TimePickerIOS from './TimePickerIOS';
|
|
5
|
-
import { TimePickerProps } from './types';
|
|
5
|
+
import type { TimePickerProps } from './types';
|
|
6
6
|
|
|
7
7
|
const TimePicker = (props: TimePickerProps) => {
|
|
8
8
|
if (Platform.OS === 'ios') {
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
View,
|
|
8
|
-
ViewProps,
|
|
9
|
-
} from 'react-native';
|
|
2
|
+
import { Animated, StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import type { ComponentProps } from 'react';
|
|
4
|
+
import type { ViewProps } from 'react-native';
|
|
5
|
+
import { IntentType } from './types';
|
|
10
6
|
|
|
11
7
|
const ToastContainerWrapper = styled(View)<{ position: 'top' | 'bottom' }>(
|
|
12
8
|
({ theme, position }) => ({
|
|
13
9
|
...StyleSheet.absoluteFillObject,
|
|
14
|
-
paddingHorizontal: theme.__hd__.toast.space.
|
|
15
|
-
paddingVertical: theme.__hd__.toast.space.
|
|
10
|
+
paddingHorizontal: theme.__hd__.toast.space.wrapperVerticalPadding,
|
|
11
|
+
paddingVertical: theme.__hd__.toast.space.wrapperHorizontalPadding,
|
|
16
12
|
flexDirection: position === 'bottom' ? 'column-reverse' : 'column',
|
|
17
13
|
elevation: 9999,
|
|
18
14
|
})
|
|
@@ -20,27 +16,32 @@ const ToastContainerWrapper = styled(View)<{ position: 'top' | 'bottom' }>(
|
|
|
20
16
|
|
|
21
17
|
const Container = styled(Animated.View)<{
|
|
22
18
|
themeVariant: 'default' | 'round';
|
|
23
|
-
themeIntent:
|
|
19
|
+
themeIntent: IntentType;
|
|
24
20
|
}>(({ theme, themeVariant, themeIntent }) => ({
|
|
25
21
|
borderRadius: themeVariant === 'round' ? theme.__hd__.toast.radii.default : 0,
|
|
26
22
|
backgroundColor: theme.__hd__.toast.colors[themeIntent],
|
|
27
23
|
minHeight: theme.__hd__.toast.sizes.height,
|
|
28
24
|
flexDirection: 'row',
|
|
25
|
+
shadowColor: theme.__hd__.toast.colors.shadow,
|
|
26
|
+
shadowOffset: theme.__hd__.toast.shadows.offset,
|
|
27
|
+
shadowRadius: theme.__hd__.toast.shadows.radius,
|
|
28
|
+
shadowOpacity: theme.__hd__.toast.shadows.opacity,
|
|
29
|
+
elevation: theme.__hd__.toast.shadows.elevation,
|
|
29
30
|
}));
|
|
30
31
|
|
|
31
32
|
const IconContainer = styled(View)<ViewProps>(({ theme }) => ({
|
|
32
33
|
alignItems: 'center',
|
|
33
|
-
paddingLeft: theme.__hd__.toast.space.
|
|
34
|
+
paddingLeft: theme.__hd__.toast.space.iconLeftPadding,
|
|
34
35
|
}));
|
|
35
36
|
|
|
36
37
|
const TextContainer = styled(View)<ViewProps>(({ theme }) => ({
|
|
37
|
-
paddingHorizontal: theme.__hd__.toast.space.
|
|
38
|
+
paddingHorizontal: theme.__hd__.toast.space.textHorizontalPadding,
|
|
38
39
|
flex: 1,
|
|
39
40
|
}));
|
|
40
41
|
|
|
41
42
|
const ContentContainer = styled(View)<{ showDivider: boolean }>(
|
|
42
43
|
({ theme, showDivider }) => ({
|
|
43
|
-
paddingVertical: theme.__hd__.toast.space.
|
|
44
|
+
paddingVertical: theme.__hd__.toast.space.contentVerticalPadding,
|
|
44
45
|
flex: 1,
|
|
45
46
|
borderRightWidth: showDivider ? theme.__hd__.toast.borderWidths.base : 0,
|
|
46
47
|
borderColor: theme.__hd__.toast.colors.divider,
|
|
@@ -51,7 +52,7 @@ const ContentContainer = styled(View)<{ showDivider: boolean }>(
|
|
|
51
52
|
const CTAWrapper = styled(TouchableOpacity)<
|
|
52
53
|
ComponentProps<typeof TouchableOpacity>
|
|
53
54
|
>(({ theme }) => ({
|
|
54
|
-
paddingHorizontal: theme.__hd__.
|
|
55
|
+
paddingHorizontal: theme.__hd__.toast.space.ctaPadding,
|
|
55
56
|
justifyContent: 'center',
|
|
56
57
|
}));
|
|
57
58
|
|