@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,4 @@
|
|
|
1
|
-
import { GlobalTheme } from '../global';
|
|
1
|
+
import type { GlobalTheme } from '../global';
|
|
2
2
|
|
|
3
3
|
const getListTheme = (theme: GlobalTheme) => {
|
|
4
4
|
const colors = {
|
|
@@ -27,8 +27,9 @@ const getListTheme = (theme: GlobalTheme) => {
|
|
|
27
27
|
leadingStatus: theme.radii.rounded,
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const shadows = {
|
|
31
|
+
cardOffset: { width: 0, height: 2 },
|
|
32
|
+
cardElevation: 10,
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const widths = {
|
|
@@ -41,7 +42,7 @@ const getListTheme = (theme: GlobalTheme) => {
|
|
|
41
42
|
cardShadow: 1,
|
|
42
43
|
};
|
|
43
44
|
|
|
44
|
-
return { colors, space, radii,
|
|
45
|
+
return { colors, space, radii, widths, opacity, shadows };
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
export default getListTheme;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { scale } from '../../utils/scale';
|
|
2
|
-
import { GlobalTheme } from '../global';
|
|
2
|
+
import type { GlobalTheme } from '../global';
|
|
3
3
|
|
|
4
4
|
const getRadioTheme = (theme: GlobalTheme) => {
|
|
5
5
|
const colors = {
|
|
6
|
-
circle: theme.colors.
|
|
7
|
-
checkedCircle: theme.colors.primary,
|
|
8
|
-
wrapper: theme.colors.platformBackground,
|
|
9
|
-
checkedWrapper: theme.colors.primaryBackground,
|
|
6
|
+
circle: theme.colors.globalPrimary,
|
|
10
7
|
};
|
|
11
8
|
|
|
12
9
|
const space = {
|
|
13
|
-
wrapperPadding: theme.space.medium, // left padding should be 12 according to the design
|
|
14
10
|
circleLeftMargin: theme.space.small,
|
|
15
11
|
groupTopMargin: theme.space.xsmall,
|
|
16
12
|
};
|
|
@@ -24,11 +20,7 @@ const getRadioTheme = (theme: GlobalTheme) => {
|
|
|
24
20
|
circle: theme.borderWidths.medium,
|
|
25
21
|
};
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
wrapper: theme.radii.base,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
return { sizes, borderWidths, space, colors, radii };
|
|
23
|
+
return { sizes, borderWidths, space, colors };
|
|
32
24
|
};
|
|
33
25
|
|
|
34
26
|
export default getRadioTheme;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { GlobalTheme } from '../global';
|
|
1
|
+
import type { GlobalTheme } from '../global';
|
|
2
2
|
|
|
3
3
|
const getSectionHeadingTheme = (theme: GlobalTheme) => {
|
|
4
4
|
const colors = {
|
|
5
|
-
background: theme.colors.
|
|
5
|
+
background: theme.colors.__alpha__globalNeutral3,
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
const space = {
|
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
import { GlobalTheme } from '../global';
|
|
1
|
+
import type { GlobalTheme } from '../global';
|
|
2
2
|
|
|
3
3
|
const getSpinnerTheme = (theme: GlobalTheme) => {
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const colors = {
|
|
5
|
+
dot1: theme.colors.__alpha__secondary1,
|
|
6
|
+
dot2: theme.colors.__alpha__secondary2,
|
|
7
|
+
dot3: theme.colors.__alpha__secondary3,
|
|
8
|
+
dot4: theme.colors.__alpha__secondary4,
|
|
6
9
|
};
|
|
7
10
|
|
|
8
11
|
const space = {
|
|
9
|
-
spinnerDot:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
spinnerDot: {
|
|
13
|
+
small: theme.space.small,
|
|
14
|
+
medium: theme.space.medium,
|
|
15
|
+
},
|
|
16
|
+
spinnerDotPadding: {
|
|
17
|
+
small: theme.space.xsmall,
|
|
18
|
+
medium: theme.space.small,
|
|
19
|
+
},
|
|
20
|
+
spinnerTextPaddingTop: {
|
|
21
|
+
small: theme.space.xsmall,
|
|
22
|
+
medium: theme.space.small,
|
|
23
|
+
},
|
|
12
24
|
};
|
|
13
25
|
|
|
14
26
|
const radii = {
|
|
15
|
-
default: theme.radii.
|
|
27
|
+
default: theme.radii.rounded,
|
|
16
28
|
};
|
|
17
29
|
|
|
18
|
-
return {
|
|
30
|
+
return { colors, space, radii };
|
|
19
31
|
};
|
|
20
32
|
|
|
21
33
|
export default getSpinnerTheme;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { GlobalTheme } from '../global';
|
|
1
|
+
import type { GlobalTheme } from '../global';
|
|
2
2
|
|
|
3
3
|
const getSwitchTheme = (theme: GlobalTheme) => {
|
|
4
4
|
const colors = {
|
|
5
|
+
backgroundColors: {
|
|
6
|
+
checked: theme.colors.primary,
|
|
7
|
+
unchecked: theme.colors.globalPrimaryLight,
|
|
8
|
+
'disabled-checked': theme.colors.primaryLight,
|
|
9
|
+
'disabled-unchecked': theme.colors.archived,
|
|
10
|
+
},
|
|
5
11
|
thumb: theme.colors.platformBackground,
|
|
6
|
-
active: theme.colors.primary,
|
|
7
|
-
inactive: theme.colors.inactiveBackground,
|
|
8
12
|
};
|
|
9
13
|
|
|
10
14
|
const thumbSizes = {
|
|
@@ -32,10 +36,6 @@ const getSwitchTheme = (theme: GlobalTheme) => {
|
|
|
32
36
|
rounded: theme.radii.rounded,
|
|
33
37
|
};
|
|
34
38
|
|
|
35
|
-
const borderWidths = {
|
|
36
|
-
default: theme.borderWidths.base,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
39
|
return {
|
|
40
40
|
colors,
|
|
41
41
|
thumbSizes,
|
|
@@ -43,7 +43,6 @@ const getSwitchTheme = (theme: GlobalTheme) => {
|
|
|
43
43
|
heights,
|
|
44
44
|
spaces,
|
|
45
45
|
radii,
|
|
46
|
-
borderWidths,
|
|
47
46
|
};
|
|
48
47
|
};
|
|
49
48
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { GlobalTheme } from '../global';
|
|
1
|
+
import type { GlobalTheme } from '../global';
|
|
2
2
|
|
|
3
3
|
const getTabsTheme = (theme: GlobalTheme) => {
|
|
4
4
|
const colors = {
|
|
5
|
-
active: theme.colors.
|
|
5
|
+
active: theme.colors.text,
|
|
6
6
|
inactive: theme.colors.text,
|
|
7
|
-
activeBackground: theme.colors.
|
|
7
|
+
activeBackground: theme.colors.__alpha__secondary4,
|
|
8
8
|
headerBottom: theme.colors.outline,
|
|
9
9
|
text: theme.colors.text,
|
|
10
10
|
};
|
|
@@ -13,6 +13,7 @@ const getTabsTheme = (theme: GlobalTheme) => {
|
|
|
13
13
|
flatListHorizontalPadding: theme.space.small,
|
|
14
14
|
itemHorizontalPadding: theme.space.small,
|
|
15
15
|
itemVerticalPadding: theme.space.small,
|
|
16
|
+
itemMargin: theme.space.smallMedium,
|
|
16
17
|
outlineHorizontalPadding: theme.space.small,
|
|
17
18
|
outlineVerticalPadding: theme.space.xsmall,
|
|
18
19
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlobalTheme } from '../global';
|
|
1
|
+
import type { GlobalTheme } from '../global';
|
|
2
2
|
|
|
3
3
|
const getTagTheme = (theme: GlobalTheme) => {
|
|
4
4
|
const borderWidths = {
|
|
@@ -6,20 +6,20 @@ const getTagTheme = (theme: GlobalTheme) => {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
const colors = {
|
|
9
|
-
default: theme.colors.
|
|
9
|
+
default: theme.colors.__alpha__globalPrimary,
|
|
10
10
|
defaultBackground: undefined,
|
|
11
|
-
primary: theme.colors.
|
|
12
|
-
primaryBackground:
|
|
13
|
-
info: theme.colors.
|
|
14
|
-
infoBackground: theme.colors.
|
|
15
|
-
success: theme.colors.
|
|
16
|
-
successBackground: theme.colors.
|
|
17
|
-
warning: theme.colors.
|
|
18
|
-
warningBackground: theme.colors.
|
|
19
|
-
danger: theme.colors.
|
|
20
|
-
dangerBackground: theme.colors.
|
|
21
|
-
archived: theme.colors.
|
|
22
|
-
archivedBackground: theme.colors.
|
|
11
|
+
primary: theme.colors.__alpha__globalPrimary,
|
|
12
|
+
primaryBackground: undefined,
|
|
13
|
+
info: theme.colors.__alpha__globalLabel4,
|
|
14
|
+
infoBackground: theme.colors.__alpha__globalLabel9,
|
|
15
|
+
success: theme.colors.__alpha__globalLabel3,
|
|
16
|
+
successBackground: theme.colors.__alpha__globalLabel8,
|
|
17
|
+
warning: theme.colors.__alpha__globalLabel2,
|
|
18
|
+
warningBackground: theme.colors.__alpha__globalLabel7,
|
|
19
|
+
danger: theme.colors.__alpha__globalLabel1,
|
|
20
|
+
dangerBackground: theme.colors.__alpha__globalLabel6,
|
|
21
|
+
archived: theme.colors.__alpha__globalLabel5,
|
|
22
|
+
archivedBackground: theme.colors.__alpha__globalNeutral3,
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const fonts = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { scale } from '../../utils/scale';
|
|
2
|
-
import { GlobalTheme } from '../global';
|
|
2
|
+
import type { GlobalTheme } from '../global';
|
|
3
3
|
|
|
4
4
|
const getToastTheme = (theme: GlobalTheme) => {
|
|
5
5
|
const colors = {
|
|
@@ -7,7 +7,10 @@ const getToastTheme = (theme: GlobalTheme) => {
|
|
|
7
7
|
warning: theme.colors.warning,
|
|
8
8
|
error: theme.colors.dangerLight,
|
|
9
9
|
info: theme.colors.infoLight,
|
|
10
|
+
notification: theme.colors.platformBackground,
|
|
11
|
+
snackbar: theme.colors.backgroundDark,
|
|
10
12
|
divider: theme.colors.outline,
|
|
13
|
+
shadow: theme.colors.backgroundDark,
|
|
11
14
|
};
|
|
12
15
|
|
|
13
16
|
const sizes = {
|
|
@@ -15,8 +18,12 @@ const getToastTheme = (theme: GlobalTheme) => {
|
|
|
15
18
|
};
|
|
16
19
|
|
|
17
20
|
const space = {
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
wrapperVerticalPadding: theme.space.large,
|
|
22
|
+
wrapperHorizontalPadding: theme.space.medium,
|
|
23
|
+
contentVerticalPadding: theme.space.smallMedium,
|
|
24
|
+
textHorizontalPadding: theme.space.smallMedium,
|
|
25
|
+
iconLeftPadding: theme.space.smallMedium,
|
|
26
|
+
ctaPadding: theme.space.smallMedium,
|
|
20
27
|
};
|
|
21
28
|
|
|
22
29
|
const radii = {
|
|
@@ -27,7 +34,14 @@ const getToastTheme = (theme: GlobalTheme) => {
|
|
|
27
34
|
base: theme.borderWidths.base,
|
|
28
35
|
};
|
|
29
36
|
|
|
30
|
-
|
|
37
|
+
const shadows = {
|
|
38
|
+
offset: { width: 0, height: 2 },
|
|
39
|
+
opacity: 0.12,
|
|
40
|
+
radius: 4,
|
|
41
|
+
elevation: 4,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return { colors, radii, sizes, space, borderWidths, shadows };
|
|
31
45
|
};
|
|
32
46
|
|
|
33
47
|
export default getToastTheme;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GlobalTheme } from '../global';
|
|
1
|
+
import type { GlobalTheme } from '../global';
|
|
2
2
|
|
|
3
3
|
const getTypographyTheme = (theme: GlobalTheme) => {
|
|
4
4
|
const colors = {
|
|
@@ -23,6 +23,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
|
|
|
23
23
|
medium: theme.fontSizes.medium,
|
|
24
24
|
large: theme.fontSizes.large,
|
|
25
25
|
xlarge: theme.fontSizes.xlarge,
|
|
26
|
+
xxxlarge: theme.fontSizes.xxxlarge,
|
|
26
27
|
xxxxxlarge: theme.fontSizes.xxxxxlarge,
|
|
27
28
|
};
|
|
28
29
|
|
|
@@ -31,6 +32,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
|
|
|
31
32
|
medium: theme.lineHeights.medium,
|
|
32
33
|
large: theme.lineHeights.large,
|
|
33
34
|
xlarge: theme.lineHeights.xlarge,
|
|
35
|
+
xxxlarge: theme.lineHeights.xxxlarge,
|
|
34
36
|
xxxxxlarge: theme.lineHeights.xxxxxlarge,
|
|
35
37
|
};
|
|
36
38
|
|
package/src/theme/getTheme.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GlobalTheme,
|
|
3
|
-
Scale,
|
|
4
|
-
SystemPalette,
|
|
5
|
-
getGlobalTheme,
|
|
6
|
-
defaultScale,
|
|
7
|
-
swagSystemPalette,
|
|
8
|
-
} from './global';
|
|
1
|
+
import { getGlobalTheme, defaultScale, swagSystemPalette } from './global';
|
|
9
2
|
|
|
10
3
|
import getAccordionTheme from './components/accordion';
|
|
11
4
|
import getAlertTheme from './components/alert';
|
|
@@ -40,6 +33,7 @@ import getTimePickerTheme from './components/timePicker';
|
|
|
40
33
|
import getToastTheme from './components/toast';
|
|
41
34
|
import getToolbarTheme from './components/toolbar';
|
|
42
35
|
import getTypographyTheme from './components/typography';
|
|
36
|
+
import type { GlobalTheme, Scale, SystemPalette } from './global';
|
|
43
37
|
|
|
44
38
|
type Theme = GlobalTheme & {
|
|
45
39
|
__hd__: {
|
|
@@ -123,7 +117,6 @@ const getTheme = (
|
|
|
123
117
|
},
|
|
124
118
|
};
|
|
125
119
|
};
|
|
126
|
-
|
|
127
|
-
export { Theme };
|
|
128
|
-
|
|
129
120
|
export default getTheme;
|
|
121
|
+
|
|
122
|
+
export type { Theme };
|
|
@@ -2,15 +2,14 @@ import {
|
|
|
2
2
|
defaultMobilePalette as palette,
|
|
3
3
|
swagPalette,
|
|
4
4
|
} from '@hero-design/colors';
|
|
5
|
-
|
|
6
|
-
import { SystemPalette } from './types';
|
|
5
|
+
import type { SystemPalette } from './types';
|
|
7
6
|
|
|
8
7
|
const swagSystemPalette: SystemPalette = {
|
|
9
8
|
globalPrimary: palette.maasstrichtBlue,
|
|
10
9
|
globalPrimaryLight: palette.maasstrichtBlueLight50,
|
|
11
10
|
globalPrimaryBackground: palette.maasstrichtBlueLight90,
|
|
12
11
|
primary: swagPalette.violet,
|
|
13
|
-
primaryLight: swagPalette.violetLight50,
|
|
12
|
+
primaryLight: swagPalette.violetLight50,
|
|
14
13
|
primaryDark: swagPalette.scarletGumLight30, // DEPRECATED
|
|
15
14
|
primaryBackground: swagPalette.violetLight90,
|
|
16
15
|
primaryBackgroundDark: palette.maasstrichtBlueLight30,
|
|
@@ -49,6 +48,29 @@ const swagSystemPalette: SystemPalette = {
|
|
|
49
48
|
black: palette.black,
|
|
50
49
|
inactiveBackground: palette.maasstrichtBlueLight50,
|
|
51
50
|
shadow: palette.greyLight45, // waiting for new color
|
|
51
|
+
|
|
52
|
+
__alpha__globalPrimary: palette.maasstrichtBlue,
|
|
53
|
+
|
|
54
|
+
__alpha__globalSecondary1: palette.maasstrichtBlueLight30,
|
|
55
|
+
|
|
56
|
+
__alpha__globalNeutral3: palette.greyLight90,
|
|
57
|
+
|
|
58
|
+
__alpha__globalLabel1: palette.vermilion,
|
|
59
|
+
__alpha__globalLabel2: palette.deepSaffron,
|
|
60
|
+
__alpha__globalLabel3: palette.pineGreen,
|
|
61
|
+
__alpha__globalLabel4: palette.ultramarineBlue,
|
|
62
|
+
__alpha__globalLabel5: palette.sonicSilver,
|
|
63
|
+
__alpha__globalLabel6: palette.linen,
|
|
64
|
+
__alpha__globalLabel7: palette.seashell,
|
|
65
|
+
__alpha__globalLabel8: palette.honeydew,
|
|
66
|
+
__alpha__globalLabel9: palette.aliceBlue,
|
|
67
|
+
|
|
68
|
+
__alpha__primary2: swagPalette.mauve,
|
|
69
|
+
|
|
70
|
+
__alpha__secondary1: swagPalette.scarletGumLight30,
|
|
71
|
+
__alpha__secondary2: swagPalette.scarletGumLight50,
|
|
72
|
+
__alpha__secondary3: swagPalette.scarletGumLight80,
|
|
73
|
+
__alpha__secondary4: swagPalette.scarletGumLight90,
|
|
52
74
|
};
|
|
53
75
|
|
|
54
76
|
export default swagSystemPalette;
|
|
@@ -42,4 +42,27 @@ export type SystemPalette = {
|
|
|
42
42
|
black: string;
|
|
43
43
|
inactiveBackground: string;
|
|
44
44
|
shadow: string;
|
|
45
|
+
|
|
46
|
+
__alpha__globalPrimary: string;
|
|
47
|
+
|
|
48
|
+
__alpha__globalSecondary1: string;
|
|
49
|
+
|
|
50
|
+
__alpha__globalNeutral3: string;
|
|
51
|
+
|
|
52
|
+
__alpha__globalLabel1: string;
|
|
53
|
+
__alpha__globalLabel2: string;
|
|
54
|
+
__alpha__globalLabel3: string;
|
|
55
|
+
__alpha__globalLabel4: string;
|
|
56
|
+
__alpha__globalLabel5: string;
|
|
57
|
+
__alpha__globalLabel6: string;
|
|
58
|
+
__alpha__globalLabel7: string;
|
|
59
|
+
__alpha__globalLabel8: string;
|
|
60
|
+
__alpha__globalLabel9: string;
|
|
61
|
+
|
|
62
|
+
__alpha__primary2: string;
|
|
63
|
+
|
|
64
|
+
__alpha__secondary1: string;
|
|
65
|
+
__alpha__secondary2: string;
|
|
66
|
+
__alpha__secondary3: string;
|
|
67
|
+
__alpha__secondary4: string;
|
|
45
68
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { workPalette } from '@hero-design/colors';
|
|
2
|
-
|
|
3
|
-
import { SystemPalette } from './types';
|
|
4
2
|
import swag from './swag';
|
|
3
|
+
import type { SystemPalette } from './types';
|
|
5
4
|
|
|
6
5
|
const workSystemPalette: SystemPalette = {
|
|
7
6
|
...swag,
|
|
@@ -9,6 +8,11 @@ const workSystemPalette: SystemPalette = {
|
|
|
9
8
|
primaryLight: workPalette.goldLight50,
|
|
10
9
|
primaryDark: workPalette.goldLight20,
|
|
11
10
|
primaryBackground: workPalette.goldLight90,
|
|
11
|
+
|
|
12
|
+
__alpha__secondary1: workPalette.goldLight20,
|
|
13
|
+
__alpha__secondary2: workPalette.goldLight50,
|
|
14
|
+
__alpha__secondary3: workPalette.goldLight70,
|
|
15
|
+
__alpha__secondary4: workPalette.goldLight90,
|
|
12
16
|
};
|
|
13
17
|
|
|
14
18
|
export default workSystemPalette;
|
|
@@ -1,11 +1,12 @@
|
|
|
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';
|
|
5
4
|
|
|
6
5
|
import { getFonts, getFontSizes, getLineHeights } from './typography';
|
|
7
6
|
import { getSpace } from './space';
|
|
8
7
|
import { getBorderWidths, getRadii } from './borders';
|
|
8
|
+
import type { Scale } from './scale';
|
|
9
|
+
import type { SystemPalette } from './colors/types';
|
|
9
10
|
|
|
10
11
|
const getGlobalTheme = (scale: Scale, systemPalette: SystemPalette) => {
|
|
11
12
|
const fonts = getFonts(scale.font);
|
|
@@ -30,12 +31,6 @@ const getGlobalTheme = (scale: Scale, systemPalette: SystemPalette) => {
|
|
|
30
31
|
|
|
31
32
|
type GlobalTheme = ReturnType<typeof getGlobalTheme>;
|
|
32
33
|
|
|
33
|
-
export {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
SystemPalette,
|
|
37
|
-
getGlobalTheme,
|
|
38
|
-
defaultScale,
|
|
39
|
-
swagSystemPalette,
|
|
40
|
-
workSystemPalette,
|
|
41
|
-
};
|
|
34
|
+
export type { GlobalTheme, Scale, SystemPalette };
|
|
35
|
+
|
|
36
|
+
export { getGlobalTheme, defaultScale, swagSystemPalette, workSystemPalette };
|
|
@@ -69,11 +69,5 @@ const getLineHeights = (fontSizes: FontSizes): LineHeights => {
|
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
export {
|
|
73
|
-
|
|
74
|
-
FontSizes,
|
|
75
|
-
LineHeights,
|
|
76
|
-
getFonts,
|
|
77
|
-
getFontSizes,
|
|
78
|
-
getLineHeights,
|
|
79
|
-
};
|
|
72
|
+
export { getFonts, getFontSizes, getLineHeights };
|
|
73
|
+
export type { Fonts, FontSizes, LineHeights };
|
package/src/theme/index.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
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
5
|
|
|
6
|
+
import type { Theme } from './getTheme';
|
|
7
|
+
|
|
6
8
|
const defaultTheme = getTheme();
|
|
7
9
|
|
|
10
|
+
export type { Theme };
|
|
11
|
+
|
|
8
12
|
export {
|
|
9
|
-
Theme,
|
|
10
13
|
getTheme,
|
|
11
14
|
ThemeProvider,
|
|
12
15
|
ThemeSwitcher,
|
package/src/types.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
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 {
|
|
7
8
|
RichTextEditorRef,
|
|
8
9
|
RichTextEditorProps,
|
|
9
|
-
ToolbarButtonName,
|
|
10
10
|
} from './components/RichTextEditor';
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
11
|
+
import type { Theme } from './theme';
|
|
12
|
+
import type {
|
|
14
13
|
ListRenderOptionInfo,
|
|
15
14
|
SectionListRenderOptionInfo,
|
|
16
15
|
} from './components/Select/types';
|
package/testUtils/setup.tsx
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "expo/tsconfig.base",
|
|
2
3
|
"compilerOptions": {
|
|
3
4
|
"target": "esnext",
|
|
4
|
-
"declaration": true,
|
|
5
5
|
"outDir": "types",
|
|
6
|
-
"
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"resolveJsonModule": true,
|
|
6
|
+
"declaration": true,
|
|
9
7
|
"jsx": "react-native",
|
|
10
|
-
"
|
|
11
|
-
"allowUnreachableCode": false,
|
|
12
|
-
"noImplicitReturns": true,
|
|
13
|
-
"noImplicitThis": true,
|
|
14
|
-
"noUnusedLocals": true,
|
|
15
|
-
"skipLibCheck": true,
|
|
16
|
-
"types": [
|
|
17
|
-
"jest"
|
|
18
|
-
]
|
|
8
|
+
"types": ["jest"]
|
|
19
9
|
},
|
|
20
|
-
"include": [
|
|
21
|
-
|
|
22
|
-
],
|
|
23
|
-
"exclude": [
|
|
24
|
-
"node_modules"
|
|
25
|
-
],
|
|
26
|
-
"extends": "expo/tsconfig.base"
|
|
27
|
-
}
|
|
10
|
+
"include": ["src"]
|
|
11
|
+
}
|