@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`StyledSpinnerContainer renders correctly 1`] = `
|
|
3
|
+
exports[`StyledSpinnerContainer renders correctly in medium size 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
6
|
Array [
|
|
@@ -39,6 +39,7 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
|
|
|
39
39
|
]
|
|
40
40
|
}
|
|
41
41
|
themePosition="top"
|
|
42
|
+
themeSize="medium"
|
|
42
43
|
>
|
|
43
44
|
<View
|
|
44
45
|
collapsable={false}
|
|
@@ -46,16 +47,16 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
|
|
|
46
47
|
style={
|
|
47
48
|
Array [
|
|
48
49
|
Object {
|
|
49
|
-
"backgroundColor": "#
|
|
50
|
-
"borderRadius":
|
|
50
|
+
"backgroundColor": "#795e90",
|
|
51
|
+
"borderRadius": 999,
|
|
51
52
|
"height": 16,
|
|
52
|
-
"opacity": 1,
|
|
53
53
|
"width": 16,
|
|
54
54
|
},
|
|
55
55
|
Object {},
|
|
56
56
|
]
|
|
57
57
|
}
|
|
58
58
|
themePosition="topLeft"
|
|
59
|
+
themeSize="medium"
|
|
59
60
|
/>
|
|
60
61
|
<View
|
|
61
62
|
collapsable={false}
|
|
@@ -63,17 +64,17 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
|
|
|
63
64
|
style={
|
|
64
65
|
Array [
|
|
65
66
|
Object {
|
|
66
|
-
"backgroundColor": "#
|
|
67
|
-
"borderRadius":
|
|
67
|
+
"backgroundColor": "#a08cb0",
|
|
68
|
+
"borderRadius": 999,
|
|
68
69
|
"height": 16,
|
|
69
70
|
"marginLeft": 8,
|
|
70
|
-
"opacity": 0.7,
|
|
71
71
|
"width": 16,
|
|
72
72
|
},
|
|
73
73
|
Object {},
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
76
|
themePosition="topRight"
|
|
77
|
+
themeSize="medium"
|
|
77
78
|
/>
|
|
78
79
|
</View>
|
|
79
80
|
<View
|
|
@@ -89,6 +90,7 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
|
|
|
89
90
|
]
|
|
90
91
|
}
|
|
91
92
|
themePosition="bottom"
|
|
93
|
+
themeSize="medium"
|
|
92
94
|
>
|
|
93
95
|
<View
|
|
94
96
|
collapsable={false}
|
|
@@ -96,16 +98,16 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
|
|
|
96
98
|
style={
|
|
97
99
|
Array [
|
|
98
100
|
Object {
|
|
99
|
-
"backgroundColor": "#
|
|
100
|
-
"borderRadius":
|
|
101
|
+
"backgroundColor": "#d9d1df",
|
|
102
|
+
"borderRadius": 999,
|
|
101
103
|
"height": 16,
|
|
102
|
-
"opacity": 0.5,
|
|
103
104
|
"width": 16,
|
|
104
105
|
},
|
|
105
106
|
Object {},
|
|
106
107
|
]
|
|
107
108
|
}
|
|
108
109
|
themePosition="bottomLeft"
|
|
110
|
+
themeSize="medium"
|
|
109
111
|
/>
|
|
110
112
|
<View
|
|
111
113
|
collapsable={false}
|
|
@@ -113,24 +115,156 @@ exports[`StyledSpinnerContainer renders correctly 1`] = `
|
|
|
113
115
|
style={
|
|
114
116
|
Array [
|
|
115
117
|
Object {
|
|
116
|
-
"backgroundColor": "#
|
|
117
|
-
"borderRadius":
|
|
118
|
+
"backgroundColor": "#ece8ef",
|
|
119
|
+
"borderRadius": 999,
|
|
118
120
|
"height": 16,
|
|
119
121
|
"marginLeft": 8,
|
|
120
|
-
"opacity": 0.3,
|
|
121
122
|
"width": 16,
|
|
122
123
|
},
|
|
123
124
|
Object {},
|
|
124
125
|
]
|
|
125
126
|
}
|
|
126
127
|
themePosition="bottomRight"
|
|
128
|
+
themeSize="medium"
|
|
127
129
|
/>
|
|
128
130
|
</View>
|
|
129
131
|
</View>
|
|
130
132
|
</View>
|
|
131
133
|
`;
|
|
132
134
|
|
|
133
|
-
exports[`
|
|
135
|
+
exports[`StyledSpinnerContainer renders correctly in small size 1`] = `
|
|
136
|
+
<View
|
|
137
|
+
style={
|
|
138
|
+
Array [
|
|
139
|
+
Object {
|
|
140
|
+
"alignItems": "center",
|
|
141
|
+
"height": "100%",
|
|
142
|
+
"justifyContent": "center",
|
|
143
|
+
},
|
|
144
|
+
undefined,
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
>
|
|
148
|
+
<View
|
|
149
|
+
collapsable={false}
|
|
150
|
+
nativeID="animatedComponent"
|
|
151
|
+
style={
|
|
152
|
+
Object {
|
|
153
|
+
"transform": Array [
|
|
154
|
+
Object {
|
|
155
|
+
"rotate": "0deg",
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
>
|
|
161
|
+
<View
|
|
162
|
+
collapsable={false}
|
|
163
|
+
nativeID="animatedComponent"
|
|
164
|
+
style={
|
|
165
|
+
Array [
|
|
166
|
+
Object {
|
|
167
|
+
"flexDirection": "row",
|
|
168
|
+
"marginBottom": 4,
|
|
169
|
+
},
|
|
170
|
+
Object {},
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
themePosition="top"
|
|
174
|
+
themeSize="small"
|
|
175
|
+
>
|
|
176
|
+
<View
|
|
177
|
+
collapsable={false}
|
|
178
|
+
nativeID="animatedComponent"
|
|
179
|
+
style={
|
|
180
|
+
Array [
|
|
181
|
+
Object {
|
|
182
|
+
"backgroundColor": "#795e90",
|
|
183
|
+
"borderRadius": 999,
|
|
184
|
+
"height": 8,
|
|
185
|
+
"width": 8,
|
|
186
|
+
},
|
|
187
|
+
Object {},
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
themePosition="topLeft"
|
|
191
|
+
themeSize="small"
|
|
192
|
+
/>
|
|
193
|
+
<View
|
|
194
|
+
collapsable={false}
|
|
195
|
+
nativeID="animatedComponent"
|
|
196
|
+
style={
|
|
197
|
+
Array [
|
|
198
|
+
Object {
|
|
199
|
+
"backgroundColor": "#a08cb0",
|
|
200
|
+
"borderRadius": 999,
|
|
201
|
+
"height": 8,
|
|
202
|
+
"marginLeft": 4,
|
|
203
|
+
"width": 8,
|
|
204
|
+
},
|
|
205
|
+
Object {},
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
themePosition="topRight"
|
|
209
|
+
themeSize="small"
|
|
210
|
+
/>
|
|
211
|
+
</View>
|
|
212
|
+
<View
|
|
213
|
+
collapsable={false}
|
|
214
|
+
nativeID="animatedComponent"
|
|
215
|
+
style={
|
|
216
|
+
Array [
|
|
217
|
+
Object {
|
|
218
|
+
"flexDirection": "row",
|
|
219
|
+
"marginBottom": 0,
|
|
220
|
+
},
|
|
221
|
+
Object {},
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
themePosition="bottom"
|
|
225
|
+
themeSize="small"
|
|
226
|
+
>
|
|
227
|
+
<View
|
|
228
|
+
collapsable={false}
|
|
229
|
+
nativeID="animatedComponent"
|
|
230
|
+
style={
|
|
231
|
+
Array [
|
|
232
|
+
Object {
|
|
233
|
+
"backgroundColor": "#d9d1df",
|
|
234
|
+
"borderRadius": 999,
|
|
235
|
+
"height": 8,
|
|
236
|
+
"width": 8,
|
|
237
|
+
},
|
|
238
|
+
Object {},
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
themePosition="bottomLeft"
|
|
242
|
+
themeSize="small"
|
|
243
|
+
/>
|
|
244
|
+
<View
|
|
245
|
+
collapsable={false}
|
|
246
|
+
nativeID="animatedComponent"
|
|
247
|
+
style={
|
|
248
|
+
Array [
|
|
249
|
+
Object {
|
|
250
|
+
"backgroundColor": "#ece8ef",
|
|
251
|
+
"borderRadius": 999,
|
|
252
|
+
"height": 8,
|
|
253
|
+
"marginLeft": 4,
|
|
254
|
+
"width": 8,
|
|
255
|
+
},
|
|
256
|
+
Object {},
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
themePosition="bottomRight"
|
|
260
|
+
themeSize="small"
|
|
261
|
+
/>
|
|
262
|
+
</View>
|
|
263
|
+
</View>
|
|
264
|
+
</View>
|
|
265
|
+
`;
|
|
266
|
+
|
|
267
|
+
exports[`StyledSpinnerRow renders correctly when position is bottom, and size is medium 1`] = `
|
|
134
268
|
<View
|
|
135
269
|
style={
|
|
136
270
|
Array [
|
|
@@ -142,10 +276,27 @@ exports[`StyledSpinnerRow renders correctly when position is bottom 1`] = `
|
|
|
142
276
|
]
|
|
143
277
|
}
|
|
144
278
|
themePosition="bottom"
|
|
279
|
+
themeSize="medium"
|
|
145
280
|
/>
|
|
146
281
|
`;
|
|
147
282
|
|
|
148
|
-
exports[`StyledSpinnerRow renders correctly when position is
|
|
283
|
+
exports[`StyledSpinnerRow renders correctly when position is bottom, and size is small 1`] = `
|
|
284
|
+
<View
|
|
285
|
+
style={
|
|
286
|
+
Array [
|
|
287
|
+
Object {
|
|
288
|
+
"flexDirection": "row",
|
|
289
|
+
"marginBottom": 0,
|
|
290
|
+
},
|
|
291
|
+
undefined,
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
themePosition="bottom"
|
|
295
|
+
themeSize="small"
|
|
296
|
+
/>
|
|
297
|
+
`;
|
|
298
|
+
|
|
299
|
+
exports[`StyledSpinnerRow renders correctly when position is top, and size is medium 1`] = `
|
|
149
300
|
<View
|
|
150
301
|
style={
|
|
151
302
|
Array [
|
|
@@ -157,79 +308,170 @@ exports[`StyledSpinnerRow renders correctly when position is top 1`] = `
|
|
|
157
308
|
]
|
|
158
309
|
}
|
|
159
310
|
themePosition="top"
|
|
311
|
+
themeSize="medium"
|
|
312
|
+
/>
|
|
313
|
+
`;
|
|
314
|
+
|
|
315
|
+
exports[`StyledSpinnerRow renders correctly when position is top, and size is small 1`] = `
|
|
316
|
+
<View
|
|
317
|
+
style={
|
|
318
|
+
Array [
|
|
319
|
+
Object {
|
|
320
|
+
"flexDirection": "row",
|
|
321
|
+
"marginBottom": 4,
|
|
322
|
+
},
|
|
323
|
+
undefined,
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
themePosition="top"
|
|
327
|
+
themeSize="small"
|
|
160
328
|
/>
|
|
161
329
|
`;
|
|
162
330
|
|
|
163
|
-
exports[`StyledSpinnerText renders correctly when position is bottomLeft 1`] = `
|
|
331
|
+
exports[`StyledSpinnerText renders correctly when position is bottomLeft, size is medium 1`] = `
|
|
164
332
|
<View
|
|
165
333
|
style={
|
|
166
334
|
Array [
|
|
167
335
|
Object {
|
|
168
|
-
"backgroundColor": "#
|
|
169
|
-
"borderRadius":
|
|
336
|
+
"backgroundColor": "#d9d1df",
|
|
337
|
+
"borderRadius": 999,
|
|
170
338
|
"height": 16,
|
|
171
|
-
"opacity": 0.5,
|
|
172
339
|
"width": 16,
|
|
173
340
|
},
|
|
174
341
|
undefined,
|
|
175
342
|
]
|
|
176
343
|
}
|
|
177
344
|
themePosition="bottomLeft"
|
|
345
|
+
themeSize="medium"
|
|
346
|
+
/>
|
|
347
|
+
`;
|
|
348
|
+
|
|
349
|
+
exports[`StyledSpinnerText renders correctly when position is bottomLeft, size is small 1`] = `
|
|
350
|
+
<View
|
|
351
|
+
style={
|
|
352
|
+
Array [
|
|
353
|
+
Object {
|
|
354
|
+
"backgroundColor": "#d9d1df",
|
|
355
|
+
"borderRadius": 999,
|
|
356
|
+
"height": 8,
|
|
357
|
+
"width": 8,
|
|
358
|
+
},
|
|
359
|
+
undefined,
|
|
360
|
+
]
|
|
361
|
+
}
|
|
362
|
+
themePosition="bottomLeft"
|
|
363
|
+
themeSize="small"
|
|
178
364
|
/>
|
|
179
365
|
`;
|
|
180
366
|
|
|
181
|
-
exports[`StyledSpinnerText renders correctly when position is bottomRight 1`] = `
|
|
367
|
+
exports[`StyledSpinnerText renders correctly when position is bottomRight, size is medium 1`] = `
|
|
182
368
|
<View
|
|
183
369
|
style={
|
|
184
370
|
Array [
|
|
185
371
|
Object {
|
|
186
|
-
"backgroundColor": "#
|
|
187
|
-
"borderRadius":
|
|
372
|
+
"backgroundColor": "#ece8ef",
|
|
373
|
+
"borderRadius": 999,
|
|
188
374
|
"height": 16,
|
|
189
375
|
"marginLeft": 8,
|
|
190
|
-
"opacity": 0.3,
|
|
191
376
|
"width": 16,
|
|
192
377
|
},
|
|
193
378
|
undefined,
|
|
194
379
|
]
|
|
195
380
|
}
|
|
196
381
|
themePosition="bottomRight"
|
|
382
|
+
themeSize="medium"
|
|
197
383
|
/>
|
|
198
384
|
`;
|
|
199
385
|
|
|
200
|
-
exports[`StyledSpinnerText renders correctly when position is
|
|
386
|
+
exports[`StyledSpinnerText renders correctly when position is bottomRight, size is small 1`] = `
|
|
201
387
|
<View
|
|
202
388
|
style={
|
|
203
389
|
Array [
|
|
204
390
|
Object {
|
|
205
|
-
"backgroundColor": "#
|
|
206
|
-
"borderRadius":
|
|
391
|
+
"backgroundColor": "#ece8ef",
|
|
392
|
+
"borderRadius": 999,
|
|
393
|
+
"height": 8,
|
|
394
|
+
"marginLeft": 4,
|
|
395
|
+
"width": 8,
|
|
396
|
+
},
|
|
397
|
+
undefined,
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
themePosition="bottomRight"
|
|
401
|
+
themeSize="small"
|
|
402
|
+
/>
|
|
403
|
+
`;
|
|
404
|
+
|
|
405
|
+
exports[`StyledSpinnerText renders correctly when position is topLeft, size is medium 1`] = `
|
|
406
|
+
<View
|
|
407
|
+
style={
|
|
408
|
+
Array [
|
|
409
|
+
Object {
|
|
410
|
+
"backgroundColor": "#795e90",
|
|
411
|
+
"borderRadius": 999,
|
|
207
412
|
"height": 16,
|
|
208
|
-
"opacity": 1,
|
|
209
413
|
"width": 16,
|
|
210
414
|
},
|
|
211
415
|
undefined,
|
|
212
416
|
]
|
|
213
417
|
}
|
|
214
418
|
themePosition="topLeft"
|
|
419
|
+
themeSize="medium"
|
|
215
420
|
/>
|
|
216
421
|
`;
|
|
217
422
|
|
|
218
|
-
exports[`StyledSpinnerText renders correctly when position is
|
|
423
|
+
exports[`StyledSpinnerText renders correctly when position is topLeft, size is small 1`] = `
|
|
219
424
|
<View
|
|
220
425
|
style={
|
|
221
426
|
Array [
|
|
222
427
|
Object {
|
|
223
|
-
"backgroundColor": "#
|
|
224
|
-
"borderRadius":
|
|
428
|
+
"backgroundColor": "#795e90",
|
|
429
|
+
"borderRadius": 999,
|
|
430
|
+
"height": 8,
|
|
431
|
+
"width": 8,
|
|
432
|
+
},
|
|
433
|
+
undefined,
|
|
434
|
+
]
|
|
435
|
+
}
|
|
436
|
+
themePosition="topLeft"
|
|
437
|
+
themeSize="small"
|
|
438
|
+
/>
|
|
439
|
+
`;
|
|
440
|
+
|
|
441
|
+
exports[`StyledSpinnerText renders correctly when position is topRight, size is medium 1`] = `
|
|
442
|
+
<View
|
|
443
|
+
style={
|
|
444
|
+
Array [
|
|
445
|
+
Object {
|
|
446
|
+
"backgroundColor": "#a08cb0",
|
|
447
|
+
"borderRadius": 999,
|
|
225
448
|
"height": 16,
|
|
226
449
|
"marginLeft": 8,
|
|
227
|
-
"opacity": 0.7,
|
|
228
450
|
"width": 16,
|
|
229
451
|
},
|
|
230
452
|
undefined,
|
|
231
453
|
]
|
|
232
454
|
}
|
|
233
455
|
themePosition="topRight"
|
|
456
|
+
themeSize="medium"
|
|
457
|
+
/>
|
|
458
|
+
`;
|
|
459
|
+
|
|
460
|
+
exports[`StyledSpinnerText renders correctly when position is topRight, size is small 1`] = `
|
|
461
|
+
<View
|
|
462
|
+
style={
|
|
463
|
+
Array [
|
|
464
|
+
Object {
|
|
465
|
+
"backgroundColor": "#a08cb0",
|
|
466
|
+
"borderRadius": 999,
|
|
467
|
+
"height": 8,
|
|
468
|
+
"marginLeft": 4,
|
|
469
|
+
"width": 8,
|
|
470
|
+
},
|
|
471
|
+
undefined,
|
|
472
|
+
]
|
|
473
|
+
}
|
|
474
|
+
themePosition="topRight"
|
|
475
|
+
themeSize="small"
|
|
234
476
|
/>
|
|
235
477
|
`;
|
|
@@ -48,6 +48,7 @@ exports[`Spinner renders correctly 1`] = `
|
|
|
48
48
|
]
|
|
49
49
|
}
|
|
50
50
|
themePosition="top"
|
|
51
|
+
themeSize="medium"
|
|
51
52
|
>
|
|
52
53
|
<View
|
|
53
54
|
collapsable={false}
|
|
@@ -55,16 +56,16 @@ exports[`Spinner renders correctly 1`] = `
|
|
|
55
56
|
style={
|
|
56
57
|
Array [
|
|
57
58
|
Object {
|
|
58
|
-
"backgroundColor": "#
|
|
59
|
-
"borderRadius":
|
|
59
|
+
"backgroundColor": "#795e90",
|
|
60
|
+
"borderRadius": 999,
|
|
60
61
|
"height": 16,
|
|
61
|
-
"opacity": 1,
|
|
62
62
|
"width": 16,
|
|
63
63
|
},
|
|
64
64
|
Object {},
|
|
65
65
|
]
|
|
66
66
|
}
|
|
67
67
|
themePosition="topLeft"
|
|
68
|
+
themeSize="medium"
|
|
68
69
|
/>
|
|
69
70
|
<View
|
|
70
71
|
collapsable={false}
|
|
@@ -72,17 +73,17 @@ exports[`Spinner renders correctly 1`] = `
|
|
|
72
73
|
style={
|
|
73
74
|
Array [
|
|
74
75
|
Object {
|
|
75
|
-
"backgroundColor": "#
|
|
76
|
-
"borderRadius":
|
|
76
|
+
"backgroundColor": "#a08cb0",
|
|
77
|
+
"borderRadius": 999,
|
|
77
78
|
"height": 16,
|
|
78
79
|
"marginLeft": 8,
|
|
79
|
-
"opacity": 0.7,
|
|
80
80
|
"width": 16,
|
|
81
81
|
},
|
|
82
82
|
Object {},
|
|
83
83
|
]
|
|
84
84
|
}
|
|
85
85
|
themePosition="topRight"
|
|
86
|
+
themeSize="medium"
|
|
86
87
|
/>
|
|
87
88
|
</View>
|
|
88
89
|
<View
|
|
@@ -98,6 +99,7 @@ exports[`Spinner renders correctly 1`] = `
|
|
|
98
99
|
]
|
|
99
100
|
}
|
|
100
101
|
themePosition="bottom"
|
|
102
|
+
themeSize="medium"
|
|
101
103
|
>
|
|
102
104
|
<View
|
|
103
105
|
collapsable={false}
|
|
@@ -105,16 +107,16 @@ exports[`Spinner renders correctly 1`] = `
|
|
|
105
107
|
style={
|
|
106
108
|
Array [
|
|
107
109
|
Object {
|
|
108
|
-
"backgroundColor": "#
|
|
109
|
-
"borderRadius":
|
|
110
|
+
"backgroundColor": "#d9d1df",
|
|
111
|
+
"borderRadius": 999,
|
|
110
112
|
"height": 16,
|
|
111
|
-
"opacity": 0.5,
|
|
112
113
|
"width": 16,
|
|
113
114
|
},
|
|
114
115
|
Object {},
|
|
115
116
|
]
|
|
116
117
|
}
|
|
117
118
|
themePosition="bottomLeft"
|
|
119
|
+
themeSize="medium"
|
|
118
120
|
/>
|
|
119
121
|
<View
|
|
120
122
|
collapsable={false}
|
|
@@ -122,17 +124,17 @@ exports[`Spinner renders correctly 1`] = `
|
|
|
122
124
|
style={
|
|
123
125
|
Array [
|
|
124
126
|
Object {
|
|
125
|
-
"backgroundColor": "#
|
|
126
|
-
"borderRadius":
|
|
127
|
+
"backgroundColor": "#ece8ef",
|
|
128
|
+
"borderRadius": 999,
|
|
127
129
|
"height": 16,
|
|
128
130
|
"marginLeft": 8,
|
|
129
|
-
"opacity": 0.3,
|
|
130
131
|
"width": 16,
|
|
131
132
|
},
|
|
132
133
|
Object {},
|
|
133
134
|
]
|
|
134
135
|
}
|
|
135
136
|
themePosition="bottomRight"
|
|
137
|
+
themeSize="medium"
|
|
136
138
|
/>
|
|
137
139
|
</View>
|
|
138
140
|
</View>
|
|
@@ -1,20 +1,28 @@
|
|
|
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
|
|
|
7
7
|
interface SpinnerProps extends ViewProps {
|
|
8
|
+
/**
|
|
9
|
+
* Size of Spinner.
|
|
10
|
+
*/
|
|
11
|
+
size?: 'small' | 'medium';
|
|
8
12
|
/**
|
|
9
13
|
* Testing id of the component.
|
|
10
14
|
*/
|
|
11
15
|
testID?: string;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
|
-
const Spinner = ({
|
|
18
|
+
const Spinner = ({
|
|
19
|
+
testID,
|
|
20
|
+
size = 'medium',
|
|
21
|
+
...nativeProps
|
|
22
|
+
}: SpinnerProps): ReactElement => (
|
|
15
23
|
<StyledView {...nativeProps}>
|
|
16
24
|
<StyledSpinnerContainer testID={testID}>
|
|
17
|
-
<AnimatedSpinner />
|
|
25
|
+
<AnimatedSpinner size={size} />
|
|
18
26
|
</StyledSpinnerContainer>
|
|
19
27
|
</StyledView>
|
|
20
28
|
);
|
|
@@ -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
|
+
});
|