@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,4 +1,3 @@
|
|
|
1
|
-
import { GlobalTheme, Scale, SystemPalette } from './global';
|
|
2
1
|
import getAccordionTheme from './components/accordion';
|
|
3
2
|
import getAlertTheme from './components/alert';
|
|
4
3
|
import getAvatarTheme from './components/avatar';
|
|
@@ -32,6 +31,7 @@ import getTimePickerTheme from './components/timePicker';
|
|
|
32
31
|
import getToastTheme from './components/toast';
|
|
33
32
|
import getToolbarTheme from './components/toolbar';
|
|
34
33
|
import getTypographyTheme from './components/typography';
|
|
34
|
+
import type { GlobalTheme, Scale, SystemPalette } from './global';
|
|
35
35
|
declare type Theme = GlobalTheme & {
|
|
36
36
|
__hd__: {
|
|
37
37
|
accordion: ReturnType<typeof getAccordionTheme>;
|
|
@@ -70,5 +70,5 @@ declare type Theme = GlobalTheme & {
|
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
declare const getTheme: (scale?: Scale, systemPallete?: SystemPalette) => Theme;
|
|
73
|
-
export { Theme };
|
|
74
73
|
export default getTheme;
|
|
74
|
+
export type { Theme };
|
|
@@ -11,4 +11,5 @@ interface Radii {
|
|
|
11
11
|
}
|
|
12
12
|
declare const getBorderWidths: (baseBorderWidth: number) => BorderWidths;
|
|
13
13
|
declare const getRadii: (baseRadius: number) => Radii;
|
|
14
|
-
export {
|
|
14
|
+
export { getBorderWidths, getRadii };
|
|
15
|
+
export type { BorderWidths, Radii };
|
|
@@ -42,4 +42,21 @@ export declare type SystemPalette = {
|
|
|
42
42
|
black: string;
|
|
43
43
|
inactiveBackground: string;
|
|
44
44
|
shadow: string;
|
|
45
|
+
__alpha__globalPrimary: string;
|
|
46
|
+
__alpha__globalSecondary1: string;
|
|
47
|
+
__alpha__globalNeutral3: string;
|
|
48
|
+
__alpha__globalLabel1: string;
|
|
49
|
+
__alpha__globalLabel2: string;
|
|
50
|
+
__alpha__globalLabel3: string;
|
|
51
|
+
__alpha__globalLabel4: string;
|
|
52
|
+
__alpha__globalLabel5: string;
|
|
53
|
+
__alpha__globalLabel6: string;
|
|
54
|
+
__alpha__globalLabel7: string;
|
|
55
|
+
__alpha__globalLabel8: string;
|
|
56
|
+
__alpha__globalLabel9: string;
|
|
57
|
+
__alpha__primary2: string;
|
|
58
|
+
__alpha__secondary1: string;
|
|
59
|
+
__alpha__secondary2: string;
|
|
60
|
+
__alpha__secondary3: string;
|
|
61
|
+
__alpha__secondary4: string;
|
|
45
62
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { scale as defaultScale
|
|
2
|
-
import { SystemPalette } from './colors/types';
|
|
1
|
+
import { scale as defaultScale } from './scale';
|
|
3
2
|
import swagSystemPalette from './colors/swag';
|
|
4
3
|
import workSystemPalette from './colors/work';
|
|
4
|
+
import type { Scale } from './scale';
|
|
5
|
+
import type { SystemPalette } from './colors/types';
|
|
5
6
|
declare const getGlobalTheme: (scale: Scale, systemPalette: SystemPalette) => {
|
|
6
7
|
colors: {
|
|
7
8
|
globalPrimary: string;
|
|
@@ -47,6 +48,23 @@ declare const getGlobalTheme: (scale: Scale, systemPalette: SystemPalette) => {
|
|
|
47
48
|
black: string;
|
|
48
49
|
inactiveBackground: string;
|
|
49
50
|
shadow: string;
|
|
51
|
+
__alpha__globalPrimary: string;
|
|
52
|
+
__alpha__globalSecondary1: string;
|
|
53
|
+
__alpha__globalNeutral3: string;
|
|
54
|
+
__alpha__globalLabel1: string;
|
|
55
|
+
__alpha__globalLabel2: string;
|
|
56
|
+
__alpha__globalLabel3: string;
|
|
57
|
+
__alpha__globalLabel4: string;
|
|
58
|
+
__alpha__globalLabel5: string;
|
|
59
|
+
__alpha__globalLabel6: string;
|
|
60
|
+
__alpha__globalLabel7: string;
|
|
61
|
+
__alpha__globalLabel8: string;
|
|
62
|
+
__alpha__globalLabel9: string;
|
|
63
|
+
__alpha__primary2: string;
|
|
64
|
+
__alpha__secondary1: string;
|
|
65
|
+
__alpha__secondary2: string;
|
|
66
|
+
__alpha__secondary3: string;
|
|
67
|
+
__alpha__secondary4: string;
|
|
50
68
|
};
|
|
51
69
|
fonts: import("./typography").Fonts;
|
|
52
70
|
fontSizes: import("./typography").FontSizes;
|
|
@@ -56,4 +74,5 @@ declare const getGlobalTheme: (scale: Scale, systemPalette: SystemPalette) => {
|
|
|
56
74
|
radii: import("./borders").Radii;
|
|
57
75
|
};
|
|
58
76
|
declare type GlobalTheme = ReturnType<typeof getGlobalTheme>;
|
|
59
|
-
export { GlobalTheme, Scale, SystemPalette
|
|
77
|
+
export type { GlobalTheme, Scale, SystemPalette };
|
|
78
|
+
export { getGlobalTheme, defaultScale, swagSystemPalette, workSystemPalette };
|
|
@@ -18,4 +18,5 @@ declare type LineHeights = FontSizes;
|
|
|
18
18
|
declare const getFonts: (baseFont: string) => Fonts;
|
|
19
19
|
declare const getFontSizes: (baseFontSize: number) => FontSizes;
|
|
20
20
|
declare const getLineHeights: (fontSizes: FontSizes) => LineHeights;
|
|
21
|
-
export {
|
|
21
|
+
export { getFonts, getFontSizes, getLineHeights };
|
|
22
|
+
export type { Fonts, FontSizes, LineHeights };
|
package/types/theme/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import getTheme
|
|
1
|
+
import getTheme from './getTheme';
|
|
2
2
|
import ThemeProvider, { useTheme } from './ThemeProvider';
|
|
3
3
|
import ThemeSwitcher from './ThemeSwitcher';
|
|
4
4
|
import { swagSystemPalette, workSystemPalette } from './global';
|
|
5
|
+
import type { Theme } from './getTheme';
|
|
5
6
|
declare const defaultTheme: Theme;
|
|
6
|
-
export { Theme
|
|
7
|
+
export type { Theme };
|
|
8
|
+
export { getTheme, ThemeProvider, ThemeSwitcher, useTheme, swagSystemPalette, workSystemPalette, };
|
|
7
9
|
export default defaultTheme;
|
package/types/types.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { ToolbarButtonName } from './components/RichTextEditor';
|
|
2
|
+
import type { BottomNavigationTabType } from './components/BottomNavigation';
|
|
3
|
+
import type { IconName } from './components/Icon';
|
|
4
|
+
import type { SingleSelectProps, MultiSelectProps } from './components/Select';
|
|
5
|
+
import type { TabType } from './components/Tabs';
|
|
6
|
+
import type { TextInputProps } from './components/TextInput';
|
|
7
|
+
import type { RichTextEditorRef, RichTextEditorProps } from './components/RichTextEditor';
|
|
8
|
+
import type { Theme } from './theme';
|
|
9
|
+
import type { ListRenderOptionInfo, SectionListRenderOptionInfo } from './components/Select/types';
|
|
9
10
|
export type { BottomNavigationTabType, IconName, SingleSelectProps, MultiSelectProps, ListRenderOptionInfo, SectionListRenderOptionInfo, RichTextEditorProps, RichTextEditorRef, TabType, TextInputProps, Theme, ToolbarButtonName, };
|
package/types/utils/hooks.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const usePrevious: <T>(value: T) => T
|
|
1
|
+
export declare const usePrevious: <T>(value: T) => T;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
-
import { Wrapper, Circle, InnerCircle, Spacer } from '../StyledRadio';
|
|
4
|
-
|
|
5
|
-
describe('Wrapper', () => {
|
|
6
|
-
it.each`
|
|
7
|
-
themeChecked
|
|
8
|
-
${true}
|
|
9
|
-
${false}
|
|
10
|
-
`('has checked style: $themeChecked', ({ themeChecked }) => {
|
|
11
|
-
const { toJSON } = renderWithTheme(<Wrapper themeChecked={themeChecked} />);
|
|
12
|
-
|
|
13
|
-
expect(toJSON()).toMatchSnapshot();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
describe('Circle', () => {
|
|
18
|
-
it.each`
|
|
19
|
-
themeChecked
|
|
20
|
-
${true}
|
|
21
|
-
${false}
|
|
22
|
-
`('has checked style: $themeChecked', ({ themeChecked }) => {
|
|
23
|
-
const { toJSON } = renderWithTheme(<Circle themeChecked={themeChecked} />);
|
|
24
|
-
|
|
25
|
-
expect(toJSON()).toMatchSnapshot();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe('InnerCircle', () => {
|
|
30
|
-
it('has correct style', () => {
|
|
31
|
-
const { toJSON } = renderWithTheme(<InnerCircle />);
|
|
32
|
-
|
|
33
|
-
expect(toJSON()).toMatchSnapshot();
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
describe('Spacer', () => {
|
|
38
|
-
it('has correct style', () => {
|
|
39
|
-
const { toJSON } = renderWithTheme(<Spacer />);
|
|
40
|
-
|
|
41
|
-
expect(toJSON()).toMatchSnapshot();
|
|
42
|
-
});
|
|
43
|
-
});
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Circle has checked style: false 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
style={
|
|
6
|
-
Array [
|
|
7
|
-
Object {
|
|
8
|
-
"alignItems": "center",
|
|
9
|
-
"borderColor": "#000000",
|
|
10
|
-
"borderRadius": 999,
|
|
11
|
-
"borderWidth": 2,
|
|
12
|
-
"height": 20,
|
|
13
|
-
"justifyContent": "center",
|
|
14
|
-
"width": 20,
|
|
15
|
-
},
|
|
16
|
-
undefined,
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
themeChecked={false}
|
|
20
|
-
/>
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
exports[`Circle has checked style: true 1`] = `
|
|
24
|
-
<View
|
|
25
|
-
style={
|
|
26
|
-
Array [
|
|
27
|
-
Object {
|
|
28
|
-
"alignItems": "center",
|
|
29
|
-
"borderColor": "#8505a2",
|
|
30
|
-
"borderRadius": 999,
|
|
31
|
-
"borderWidth": 2,
|
|
32
|
-
"height": 20,
|
|
33
|
-
"justifyContent": "center",
|
|
34
|
-
"width": 20,
|
|
35
|
-
},
|
|
36
|
-
undefined,
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
themeChecked={true}
|
|
40
|
-
/>
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
exports[`InnerCircle has correct style 1`] = `
|
|
44
|
-
<View
|
|
45
|
-
style={
|
|
46
|
-
Array [
|
|
47
|
-
Object {
|
|
48
|
-
"backgroundColor": "#8505a2",
|
|
49
|
-
"borderRadius": 999,
|
|
50
|
-
"height": 10,
|
|
51
|
-
"width": 10,
|
|
52
|
-
},
|
|
53
|
-
undefined,
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
/>
|
|
57
|
-
`;
|
|
58
|
-
|
|
59
|
-
exports[`Spacer has correct style 1`] = `
|
|
60
|
-
<View
|
|
61
|
-
style={
|
|
62
|
-
Array [
|
|
63
|
-
Object {
|
|
64
|
-
"marginTop": 4,
|
|
65
|
-
},
|
|
66
|
-
undefined,
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
/>
|
|
70
|
-
`;
|
|
71
|
-
|
|
72
|
-
exports[`Wrapper has checked style: false 1`] = `
|
|
73
|
-
<View
|
|
74
|
-
accessible={true}
|
|
75
|
-
collapsable={false}
|
|
76
|
-
focusable={false}
|
|
77
|
-
nativeID="animatedComponent"
|
|
78
|
-
onClick={[Function]}
|
|
79
|
-
onResponderGrant={[Function]}
|
|
80
|
-
onResponderMove={[Function]}
|
|
81
|
-
onResponderRelease={[Function]}
|
|
82
|
-
onResponderTerminate={[Function]}
|
|
83
|
-
onResponderTerminationRequest={[Function]}
|
|
84
|
-
onStartShouldSetResponder={[Function]}
|
|
85
|
-
style={
|
|
86
|
-
Object {
|
|
87
|
-
"alignItems": "center",
|
|
88
|
-
"backgroundColor": "#ffffff",
|
|
89
|
-
"borderRadius": 4,
|
|
90
|
-
"flexDirection": "row",
|
|
91
|
-
"justifyContent": "space-between",
|
|
92
|
-
"opacity": 1,
|
|
93
|
-
"padding": 16,
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
/>
|
|
97
|
-
`;
|
|
98
|
-
|
|
99
|
-
exports[`Wrapper has checked style: true 1`] = `
|
|
100
|
-
<View
|
|
101
|
-
accessible={true}
|
|
102
|
-
collapsable={false}
|
|
103
|
-
focusable={false}
|
|
104
|
-
nativeID="animatedComponent"
|
|
105
|
-
onClick={[Function]}
|
|
106
|
-
onResponderGrant={[Function]}
|
|
107
|
-
onResponderMove={[Function]}
|
|
108
|
-
onResponderRelease={[Function]}
|
|
109
|
-
onResponderTerminate={[Function]}
|
|
110
|
-
onResponderTerminationRequest={[Function]}
|
|
111
|
-
onStartShouldSetResponder={[Function]}
|
|
112
|
-
style={
|
|
113
|
-
Object {
|
|
114
|
-
"alignItems": "center",
|
|
115
|
-
"backgroundColor": "#f3e6f6",
|
|
116
|
-
"borderRadius": 4,
|
|
117
|
-
"flexDirection": "row",
|
|
118
|
-
"justifyContent": "space-between",
|
|
119
|
-
"opacity": 1,
|
|
120
|
-
"padding": 16,
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
/>
|
|
124
|
-
`;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import renderWithTheme from '../../../testHelpers/renderWithTheme';
|
|
3
|
-
import {
|
|
4
|
-
StyledWrapper,
|
|
5
|
-
StyledDisabledWrapper,
|
|
6
|
-
StyledThumbWrapper,
|
|
7
|
-
StyledKnot,
|
|
8
|
-
} from '../StyledSwitch';
|
|
9
|
-
|
|
10
|
-
describe('StyledWrapper', () => {
|
|
11
|
-
it('renders correct style', () => {
|
|
12
|
-
const { toJSON } = renderWithTheme(
|
|
13
|
-
<StyledWrapper themeChecked themeSize="medium" />
|
|
14
|
-
);
|
|
15
|
-
expect(toJSON()).toMatchSnapshot();
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
describe('StyledDisabledWrapper', () => {
|
|
20
|
-
it('renders correct style', () => {
|
|
21
|
-
const { toJSON } = renderWithTheme(
|
|
22
|
-
<StyledDisabledWrapper themeSize="medium" />
|
|
23
|
-
);
|
|
24
|
-
expect(toJSON()).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
describe('StyledThumbWrapper', () => {
|
|
29
|
-
it('renders correct style', () => {
|
|
30
|
-
const { toJSON } = renderWithTheme(
|
|
31
|
-
<StyledThumbWrapper themeSize="medium" />
|
|
32
|
-
);
|
|
33
|
-
expect(toJSON()).toMatchSnapshot();
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
describe('StyledKnot', () => {
|
|
38
|
-
it('renders correct style', () => {
|
|
39
|
-
const { toJSON } = renderWithTheme(<StyledKnot themeSize="medium" />);
|
|
40
|
-
expect(toJSON()).toMatchSnapshot();
|
|
41
|
-
});
|
|
42
|
-
});
|