@redis-ui/styles 15.0.0 → 16.1.2
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/dist/commonStyles.js +71 -0
- package/dist/focus-indicator.js +14 -0
- package/dist/hooks/ThemeModeSwitching/SwitchableModeThemeProvider.js +14 -0
- package/dist/hooks/ThemeModeSwitching/ThemeModeSwitching.context.js +15 -0
- package/dist/hooks/ThemeModeSwitching/ThemeModeSwitching.types.js +5 -0
- package/dist/hooks/ThemeModeSwitching/index.js +4 -0
- package/dist/hooks/ThemeModeSwitching/useThemeModeSwitchingManager.js +86 -0
- package/dist/hooks/usePrefersReducedMotion.js +28 -0
- package/dist/hooks/useStorage.js +59 -0
- package/dist/hooks/useTheme.js +6 -0
- package/dist/index.js +12664 -14398
- package/dist/index.umd.cjs +29 -58
- package/dist/themes/index.js +9 -0
- package/dist/themes/themeDark/theme/components/actionIconButton.js +56 -0
- package/dist/themes/themeDark/theme/components/appBar.js +25 -0
- package/dist/themes/themeDark/theme/components/appSelectionMenu.js +46 -0
- package/dist/themes/themeDark/theme/components/autoComplete.js +7 -0
- package/dist/themes/themeDark/theme/components/badge.js +73 -0
- package/dist/themes/themeDark/theme/components/banner.js +14 -0
- package/dist/themes/themeDark/theme/components/boxSelectionGroup.js +49 -0
- package/dist/themes/themeDark/theme/components/breadcrumbs.js +28 -0
- package/dist/themes/themeDark/theme/components/button.js +185 -0
- package/dist/themes/themeDark/theme/components/buttonGroup.js +46 -0
- package/dist/themes/themeDark/theme/components/card.js +40 -0
- package/dist/themes/themeDark/theme/components/checkbox.js +67 -0
- package/dist/themes/themeDark/theme/components/chip.js +60 -0
- package/dist/themes/themeDark/theme/components/chipList.js +21 -0
- package/dist/themes/themeDark/theme/components/countryFlag.js +9 -0
- package/dist/themes/themeDark/theme/components/datePicker.js +67 -0
- package/dist/themes/themeDark/theme/components/drawer.js +28 -0
- package/dist/themes/themeDark/theme/components/filters.js +36 -0
- package/dist/themes/themeDark/theme/components/formField.js +17 -0
- package/dist/themes/themeDark/theme/components/highlightedIcon.js +42 -0
- package/dist/themes/themeDark/theme/components/icon.d.ts +3 -0
- package/dist/themes/themeDark/theme/components/icon.js +14 -0
- package/dist/themes/themeDark/theme/components/iconButton.js +47 -0
- package/dist/themes/themeDark/theme/components/input.js +94 -0
- package/dist/themes/themeDark/theme/components/keyValueList.js +30 -0
- package/dist/themes/themeDark/theme/components/label.js +24 -0
- package/dist/themes/themeDark/theme/components/layouts.js +39 -0
- package/dist/themes/themeDark/theme/components/link.js +73 -0
- package/dist/themes/themeDark/theme/components/loader.js +29 -0
- package/dist/themes/themeDark/theme/components/menu.js +79 -0
- package/dist/themes/themeDark/theme/components/midBar.js +14 -0
- package/dist/themes/themeDark/theme/components/modal.js +31 -0
- package/dist/themes/themeDark/theme/components/moreInfoIcon.js +5 -0
- package/dist/themes/themeDark/theme/components/popover.js +16 -0
- package/dist/themes/themeDark/theme/components/popupCard.js +22 -0
- package/dist/themes/themeDark/theme/components/profileIcon.js +19 -0
- package/dist/themes/themeDark/theme/components/progressBar.js +57 -0
- package/dist/themes/themeDark/theme/components/radio.js +51 -0
- package/dist/themes/themeDark/theme/components/searchBar.js +23 -0
- package/dist/themes/themeDark/theme/components/section.js +48 -0
- package/dist/themes/themeDark/theme/components/select.js +103 -0
- package/dist/themes/themeDark/theme/components/semanticButton.js +203 -0
- package/dist/themes/themeDark/theme/components/semanticContainer.js +43 -0
- package/dist/themes/themeDark/theme/components/semanticIcon.js +11 -0
- package/dist/themes/themeDark/theme/components/sideBar.js +108 -0
- package/dist/themes/themeDark/theme/components/skeleton.js +30 -0
- package/dist/themes/themeDark/theme/components/slider.js +68 -0
- package/dist/themes/themeDark/theme/components/stepper.js +62 -0
- package/dist/themes/themeDark/theme/components/switch.js +55 -0
- package/dist/themes/themeDark/theme/components/table.js +91 -0
- package/dist/themes/themeDark/theme/components/tableHeading.js +26 -0
- package/dist/themes/themeDark/theme/components/tabs.js +89 -0
- package/dist/themes/themeDark/theme/components/textButton.js +195 -0
- package/dist/themes/themeDark/theme/components/themeModeSwitch.js +18 -0
- package/dist/themes/themeDark/theme/components/toast.js +9 -0
- package/dist/themes/themeDark/theme/components/toggleButton.js +59 -0
- package/dist/themes/themeDark/theme/components/tooltip.js +17 -0
- package/dist/themes/themeDark/theme/components/treeView.js +16 -0
- package/dist/themes/themeDark/theme/components/typography.js +79 -0
- package/dist/themes/themeDark/theme/components/windowBar.js +55 -0
- package/dist/themes/themeDark/theme/globals/body.js +9 -0
- package/dist/themes/themeDark/theme/globals/scrollbar.js +12 -0
- package/dist/themes/themeDark/theme.js +134 -0
- package/dist/themes/themeDark/tokens.js +200 -0
- package/dist/themes/themeDark2/theme/components/actionIconButton.js +56 -0
- package/dist/themes/themeDark2/theme/components/appBar.js +25 -0
- package/dist/themes/themeDark2/theme/components/appSelectionMenu.js +46 -0
- package/dist/themes/themeDark2/theme/components/autoComplete.js +7 -0
- package/dist/themes/themeDark2/theme/components/badge.js +73 -0
- package/dist/themes/themeDark2/theme/components/banner.js +14 -0
- package/dist/themes/themeDark2/theme/components/boxSelectionGroup.js +58 -0
- package/dist/themes/themeDark2/theme/components/breadcrumbs.js +28 -0
- package/dist/themes/themeDark2/theme/components/button.js +202 -0
- package/dist/themes/themeDark2/theme/components/buttonGroup.js +46 -0
- package/dist/themes/themeDark2/theme/components/card.js +40 -0
- package/dist/themes/themeDark2/theme/components/checkbox.js +67 -0
- package/dist/themes/themeDark2/theme/components/chip.js +60 -0
- package/dist/themes/themeDark2/theme/components/chipList.js +21 -0
- package/dist/themes/themeDark2/theme/components/countryFlag.js +9 -0
- package/dist/themes/themeDark2/theme/components/datePicker.js +67 -0
- package/dist/themes/themeDark2/theme/components/drawer.js +30 -0
- package/dist/themes/themeDark2/theme/components/filters.js +36 -0
- package/dist/themes/themeDark2/theme/components/formField.js +17 -0
- package/dist/themes/themeDark2/theme/components/highlightedIcon.js +42 -0
- package/dist/themes/themeDark2/theme/components/icon.d.ts +3 -0
- package/dist/themes/themeDark2/theme/components/icon.js +14 -0
- package/dist/themes/themeDark2/theme/components/iconButton.js +49 -0
- package/dist/themes/themeDark2/theme/components/input.js +97 -0
- package/dist/themes/themeDark2/theme/components/keyValueList.js +30 -0
- package/dist/themes/themeDark2/theme/components/label.js +24 -0
- package/dist/themes/themeDark2/theme/components/layouts.js +39 -0
- package/dist/themes/themeDark2/theme/components/link.js +72 -0
- package/dist/themes/themeDark2/theme/components/loader.js +30 -0
- package/dist/themes/themeDark2/theme/components/menu.js +79 -0
- package/dist/themes/themeDark2/theme/components/midBar.js +14 -0
- package/dist/themes/themeDark2/theme/components/modal.js +34 -0
- package/dist/themes/themeDark2/theme/components/moreInfoIcon.js +5 -0
- package/dist/themes/themeDark2/theme/components/popover.js +16 -0
- package/dist/themes/themeDark2/theme/components/popupCard.js +22 -0
- package/dist/themes/themeDark2/theme/components/profileIcon.js +39 -0
- package/dist/themes/themeDark2/theme/components/progressBar.js +57 -0
- package/dist/themes/themeDark2/theme/components/radio.js +51 -0
- package/dist/themes/themeDark2/theme/components/searchBar.js +25 -0
- package/dist/themes/themeDark2/theme/components/section.js +52 -0
- package/dist/themes/themeDark2/theme/components/select.js +104 -0
- package/dist/themes/themeDark2/theme/components/semanticButton.js +250 -0
- package/dist/themes/themeDark2/theme/components/semanticContainer.js +43 -0
- package/dist/themes/themeDark2/theme/components/semanticIcon.js +11 -0
- package/dist/themes/themeDark2/theme/components/sideBar.js +108 -0
- package/dist/themes/themeDark2/theme/components/skeleton.js +30 -0
- package/dist/themes/themeDark2/theme/components/slider.js +68 -0
- package/dist/themes/themeDark2/theme/components/stepper.js +62 -0
- package/dist/themes/themeDark2/theme/components/switch.js +55 -0
- package/dist/themes/themeDark2/theme/components/table.js +91 -0
- package/dist/themes/themeDark2/theme/components/tableHeading.js +26 -0
- package/dist/themes/themeDark2/theme/components/tabs.js +89 -0
- package/dist/themes/themeDark2/theme/components/textButton.js +202 -0
- package/dist/themes/themeDark2/theme/components/themeModeSwitch.js +18 -0
- package/dist/themes/themeDark2/theme/components/toast.js +9 -0
- package/dist/themes/themeDark2/theme/components/toggleButton.js +57 -0
- package/dist/themes/themeDark2/theme/components/tooltip.js +17 -0
- package/dist/themes/themeDark2/theme/components/treeView.js +16 -0
- package/dist/themes/themeDark2/theme/components/typography.js +79 -0
- package/dist/themes/themeDark2/theme/components/windowBar.js +55 -0
- package/dist/themes/themeDark2/theme/globals/body.js +9 -0
- package/dist/themes/themeDark2/theme/globals/scrollbar.js +12 -0
- package/dist/themes/themeDark2/theme.js +134 -0
- package/dist/themes/themeDark2/tokens.js +200 -0
- package/dist/themes/themeLight/theme/components/actionIconButton.js +56 -0
- package/dist/themes/themeLight/theme/components/appBar.js +25 -0
- package/dist/themes/themeLight/theme/components/appSelectionMenu.js +46 -0
- package/dist/themes/themeLight/theme/components/autoComplete.js +7 -0
- package/dist/themes/themeLight/theme/components/badge.js +73 -0
- package/dist/themes/themeLight/theme/components/banner.js +14 -0
- package/dist/themes/themeLight/theme/components/boxSelectionGroup.js +49 -0
- package/dist/themes/themeLight/theme/components/breadcrumbs.js +28 -0
- package/dist/themes/themeLight/theme/components/button.js +182 -0
- package/dist/themes/themeLight/theme/components/buttonGroup.js +46 -0
- package/dist/themes/themeLight/theme/components/card.js +40 -0
- package/dist/themes/themeLight/theme/components/checkbox.js +67 -0
- package/dist/themes/themeLight/theme/components/chip.js +60 -0
- package/dist/themes/themeLight/theme/components/chipList.js +21 -0
- package/dist/themes/themeLight/theme/components/countryFlag.js +9 -0
- package/dist/themes/themeLight/theme/components/datePicker.js +67 -0
- package/dist/themes/themeLight/theme/components/drawer.js +28 -0
- package/dist/themes/themeLight/theme/components/filters.js +36 -0
- package/dist/themes/themeLight/theme/components/formField.js +17 -0
- package/dist/themes/themeLight/theme/components/highlightedIcon.js +42 -0
- package/dist/themes/themeLight/theme/components/icon.d.ts +3 -0
- package/dist/themes/themeLight/theme/components/icon.js +14 -0
- package/dist/themes/themeLight/theme/components/iconButton.js +47 -0
- package/dist/themes/themeLight/theme/components/input.js +94 -0
- package/dist/themes/themeLight/theme/components/keyValueList.js +30 -0
- package/dist/themes/themeLight/theme/components/label.js +24 -0
- package/dist/themes/themeLight/theme/components/layouts.js +39 -0
- package/dist/themes/themeLight/theme/components/link.js +74 -0
- package/dist/themes/themeLight/theme/components/loader.js +29 -0
- package/dist/themes/themeLight/theme/components/menu.js +79 -0
- package/dist/themes/themeLight/theme/components/midBar.js +14 -0
- package/dist/themes/themeLight/theme/components/modal.js +31 -0
- package/dist/themes/themeLight/theme/components/moreInfoIcon.js +5 -0
- package/dist/themes/themeLight/theme/components/popover.js +16 -0
- package/dist/themes/themeLight/theme/components/popupCard.js +22 -0
- package/dist/themes/themeLight/theme/components/profileIcon.js +39 -0
- package/dist/themes/themeLight/theme/components/progressBar.js +57 -0
- package/dist/themes/themeLight/theme/components/radio.js +51 -0
- package/dist/themes/themeLight/theme/components/searchBar.js +23 -0
- package/dist/themes/themeLight/theme/components/section.js +48 -0
- package/dist/themes/themeLight/theme/components/select.js +103 -0
- package/dist/themes/themeLight/theme/components/semanticButton.js +203 -0
- package/dist/themes/themeLight/theme/components/semanticContainer.js +43 -0
- package/dist/themes/themeLight/theme/components/semanticIcon.js +11 -0
- package/dist/themes/themeLight/theme/components/sideBar.js +108 -0
- package/dist/themes/themeLight/theme/components/skeleton.js +30 -0
- package/dist/themes/themeLight/theme/components/slider.js +68 -0
- package/dist/themes/themeLight/theme/components/stepper.js +62 -0
- package/dist/themes/themeLight/theme/components/switch.js +55 -0
- package/dist/themes/themeLight/theme/components/table.js +91 -0
- package/dist/themes/themeLight/theme/components/tableHeading.js +26 -0
- package/dist/themes/themeLight/theme/components/tabs.js +86 -0
- package/dist/themes/themeLight/theme/components/textButton.js +196 -0
- package/dist/themes/themeLight/theme/components/themeModeSwitch.js +18 -0
- package/dist/themes/themeLight/theme/components/toast.js +9 -0
- package/dist/themes/themeLight/theme/components/toggleButton.js +59 -0
- package/dist/themes/themeLight/theme/components/tooltip.js +17 -0
- package/dist/themes/themeLight/theme/components/treeView.js +16 -0
- package/dist/themes/themeLight/theme/components/typography.js +79 -0
- package/dist/themes/themeLight/theme/components/windowBar.js +55 -0
- package/dist/themes/themeLight/theme/globals/body.js +9 -0
- package/dist/themes/themeLight/theme/globals/scrollbar.js +12 -0
- package/dist/themes/themeLight/theme.js +134 -0
- package/dist/themes/themeLight/tokens.js +200 -0
- package/dist/themes/themeLight2/theme/components/actionIconButton.js +56 -0
- package/dist/themes/themeLight2/theme/components/appBar.js +25 -0
- package/dist/themes/themeLight2/theme/components/appSelectionMenu.js +46 -0
- package/dist/themes/themeLight2/theme/components/autoComplete.js +7 -0
- package/dist/themes/themeLight2/theme/components/badge.js +73 -0
- package/dist/themes/themeLight2/theme/components/banner.js +14 -0
- package/dist/themes/themeLight2/theme/components/boxSelectionGroup.js +58 -0
- package/dist/themes/themeLight2/theme/components/breadcrumbs.js +28 -0
- package/dist/themes/themeLight2/theme/components/button.js +202 -0
- package/dist/themes/themeLight2/theme/components/buttonGroup.js +46 -0
- package/dist/themes/themeLight2/theme/components/card.js +40 -0
- package/dist/themes/themeLight2/theme/components/checkbox.js +67 -0
- package/dist/themes/themeLight2/theme/components/chip.js +60 -0
- package/dist/themes/themeLight2/theme/components/chipList.js +21 -0
- package/dist/themes/themeLight2/theme/components/countryFlag.js +9 -0
- package/dist/themes/themeLight2/theme/components/datePicker.js +67 -0
- package/dist/themes/themeLight2/theme/components/drawer.js +30 -0
- package/dist/themes/themeLight2/theme/components/filters.js +36 -0
- package/dist/themes/themeLight2/theme/components/formField.js +17 -0
- package/dist/themes/themeLight2/theme/components/highlightedIcon.js +42 -0
- package/dist/themes/themeLight2/theme/components/icon.d.ts +3 -0
- package/dist/themes/themeLight2/theme/components/icon.js +14 -0
- package/dist/themes/themeLight2/theme/components/iconButton.js +49 -0
- package/dist/themes/themeLight2/theme/components/input.js +97 -0
- package/dist/themes/themeLight2/theme/components/keyValueList.js +30 -0
- package/dist/themes/themeLight2/theme/components/label.js +24 -0
- package/dist/themes/themeLight2/theme/components/layouts.js +39 -0
- package/dist/themes/themeLight2/theme/components/link.js +72 -0
- package/dist/themes/themeLight2/theme/components/loader.js +30 -0
- package/dist/themes/themeLight2/theme/components/menu.js +79 -0
- package/dist/themes/themeLight2/theme/components/midBar.js +14 -0
- package/dist/themes/themeLight2/theme/components/modal.js +34 -0
- package/dist/themes/themeLight2/theme/components/moreInfoIcon.js +5 -0
- package/dist/themes/themeLight2/theme/components/popover.js +16 -0
- package/dist/themes/themeLight2/theme/components/popupCard.js +22 -0
- package/dist/themes/themeLight2/theme/components/profileIcon.js +39 -0
- package/dist/themes/themeLight2/theme/components/progressBar.js +57 -0
- package/dist/themes/themeLight2/theme/components/radio.js +51 -0
- package/dist/themes/themeLight2/theme/components/searchBar.js +25 -0
- package/dist/themes/themeLight2/theme/components/section.js +52 -0
- package/dist/themes/themeLight2/theme/components/select.js +103 -0
- package/dist/themes/themeLight2/theme/components/semanticButton.js +250 -0
- package/dist/themes/themeLight2/theme/components/semanticContainer.js +43 -0
- package/dist/themes/themeLight2/theme/components/semanticIcon.js +11 -0
- package/dist/themes/themeLight2/theme/components/sideBar.js +108 -0
- package/dist/themes/themeLight2/theme/components/skeleton.js +30 -0
- package/dist/themes/themeLight2/theme/components/slider.js +68 -0
- package/dist/themes/themeLight2/theme/components/stepper.js +62 -0
- package/dist/themes/themeLight2/theme/components/switch.js +55 -0
- package/dist/themes/themeLight2/theme/components/table.js +91 -0
- package/dist/themes/themeLight2/theme/components/tableHeading.js +26 -0
- package/dist/themes/themeLight2/theme/components/tabs.js +86 -0
- package/dist/themes/themeLight2/theme/components/textButton.js +203 -0
- package/dist/themes/themeLight2/theme/components/themeModeSwitch.js +18 -0
- package/dist/themes/themeLight2/theme/components/toast.js +9 -0
- package/dist/themes/themeLight2/theme/components/toggleButton.js +57 -0
- package/dist/themes/themeLight2/theme/components/tooltip.js +17 -0
- package/dist/themes/themeLight2/theme/components/treeView.js +16 -0
- package/dist/themes/themeLight2/theme/components/typography.js +79 -0
- package/dist/themes/themeLight2/theme/components/windowBar.js +55 -0
- package/dist/themes/themeLight2/theme/globals/body.js +9 -0
- package/dist/themes/themeLight2/theme/globals/scrollbar.js +12 -0
- package/dist/themes/themeLight2/theme.js +134 -0
- package/dist/themes/themeLight2/tokens.js +200 -0
- package/dist/themes/types/index.js +3 -0
- package/dist/themes/types/theme/components/actionIconButton.types.js +1 -0
- package/dist/themes/types/theme/components/appBar.types.js +1 -0
- package/dist/themes/types/theme/components/appSelectionMenu.types.js +1 -0
- package/dist/themes/types/theme/components/autoComplete.types.js +1 -0
- package/dist/themes/types/theme/components/badge.types.js +1 -0
- package/dist/themes/types/theme/components/banner.types.js +1 -0
- package/dist/themes/types/theme/components/boxSelectionGroup.types.js +1 -0
- package/dist/themes/types/theme/components/breadcrumbs.types.js +1 -0
- package/dist/themes/types/theme/components/button.types.js +1 -0
- package/dist/themes/types/theme/components/buttonGroup.types.js +1 -0
- package/dist/themes/types/theme/components/card.types.d.ts +6 -3
- package/dist/themes/types/theme/components/card.types.js +10 -0
- package/dist/themes/types/theme/components/checkbox.types.js +1 -0
- package/dist/themes/types/theme/components/chip.types.js +1 -0
- package/dist/themes/types/theme/components/chipList.types.js +1 -0
- package/dist/themes/types/theme/components/countryFlag.types.js +1 -0
- package/dist/themes/types/theme/components/datePicker.types.js +1 -0
- package/dist/themes/types/theme/components/drawer.types.js +1 -0
- package/dist/themes/types/theme/components/filters.types.js +1 -0
- package/dist/themes/types/theme/components/formField.types.js +1 -0
- package/dist/themes/types/theme/components/global.types.js +1 -0
- package/dist/themes/types/theme/components/highlightedIcon.types.js +11 -0
- package/dist/themes/types/theme/components/icon.types.d.ts +5 -0
- package/dist/themes/types/theme/components/icon.types.js +10 -0
- package/dist/themes/types/theme/components/iconButton.types.js +1 -0
- package/dist/themes/types/theme/components/index.d.ts +1 -0
- package/dist/themes/types/theme/components/index.js +60 -0
- package/dist/themes/types/theme/components/input.types.js +1 -0
- package/dist/themes/types/theme/components/keyValueList.types.js +1 -0
- package/dist/themes/types/theme/components/label.types.js +1 -0
- package/dist/themes/types/theme/components/layouts.types.js +1 -0
- package/dist/themes/types/theme/components/link.types.js +1 -0
- package/dist/themes/types/theme/components/loader.types.js +1 -0
- package/dist/themes/types/theme/components/menu.types.js +1 -0
- package/dist/themes/types/theme/components/midBar.types.js +1 -0
- package/dist/themes/types/theme/components/modal.types.js +1 -0
- package/dist/themes/types/theme/components/moreInfoIcon.types.js +1 -0
- package/dist/themes/types/theme/components/popover.types.js +1 -0
- package/dist/themes/types/theme/components/popupCard.types.js +1 -0
- package/dist/themes/types/theme/components/profileIcon.types.js +1 -0
- package/dist/themes/types/theme/components/progressBar.types.js +1 -0
- package/dist/themes/types/theme/components/radio.types.js +1 -0
- package/dist/themes/types/theme/components/searchBar.types.js +1 -0
- package/dist/themes/types/theme/components/section.types.js +1 -0
- package/dist/themes/types/theme/components/select.types.js +1 -0
- package/dist/themes/types/theme/components/semanticButton.types.js +1 -0
- package/dist/themes/types/theme/components/semanticContainer.types.js +1 -0
- package/dist/themes/types/theme/components/semanticIcon.types.js +1 -0
- package/dist/themes/types/theme/components/sideBar.types.js +1 -0
- package/dist/themes/types/theme/components/skeleton.types.js +1 -0
- package/dist/themes/types/theme/components/slider.types.js +1 -0
- package/dist/themes/types/theme/components/stepper.types.js +1 -0
- package/dist/themes/types/theme/components/switch.types.js +1 -0
- package/dist/themes/types/theme/components/table.types.js +1 -0
- package/dist/themes/types/theme/components/tableHeading.types.js +1 -0
- package/dist/themes/types/theme/components/tabs.types.js +1 -0
- package/dist/themes/types/theme/components/textButton.types.js +1 -0
- package/dist/themes/types/theme/components/themeModeSwitch.types.js +1 -0
- package/dist/themes/types/theme/components/toast.types.js +1 -0
- package/dist/themes/types/theme/components/toggleButton.types.js +1 -0
- package/dist/themes/types/theme/components/tooltip.types.js +1 -0
- package/dist/themes/types/theme/components/treeView.types.js +1 -0
- package/dist/themes/types/theme/components/typography.types.js +1 -0
- package/dist/themes/types/theme/components/windowBar.types.js +1 -0
- package/dist/themes/types/theme/globals/body.types.js +1 -0
- package/dist/themes/types/theme/globals/index.js +2 -0
- package/dist/themes/types/theme/globals/scrollbar.types.js +1 -0
- package/dist/themes/types/theme/theme.types.d.ts +2 -1
- package/dist/themes/types/theme/theme.types.js +1 -0
- package/dist/themes/types/theme/themeCore.types.js +1 -0
- package/dist/themes/types/theme/tokens.types.js +1 -0
- package/dist/utils.js +76 -0
- package/package.json +6 -5
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
const semanticColors = {
|
|
2
|
+
transparent: '#00000000',
|
|
3
|
+
neutral0: '#ffffff',
|
|
4
|
+
neutral50: '#fafaf9',
|
|
5
|
+
neutral100: '#f8f8f8',
|
|
6
|
+
neutral200: '#e6e6e6',
|
|
7
|
+
neutral300: '#d1d3d4',
|
|
8
|
+
neutral400: '#bcbec0',
|
|
9
|
+
neutral500: '#a7a9ac',
|
|
10
|
+
neutral600: '#939598',
|
|
11
|
+
neutral700: '#6d6e71',
|
|
12
|
+
neutral800: '#58595b',
|
|
13
|
+
neutral900: '#414042',
|
|
14
|
+
neutral950: '#282828',
|
|
15
|
+
primary0: '#eaf6ff',
|
|
16
|
+
primary50: '#afd7ff',
|
|
17
|
+
primary100: '#8cc4fc',
|
|
18
|
+
primary200: '#52a9ff',
|
|
19
|
+
primary300: '#0091ff',
|
|
20
|
+
primary400: '#0070f3',
|
|
21
|
+
primary500: '#0060d1',
|
|
22
|
+
primary600: '#064ea2',
|
|
23
|
+
primary700: '#0a4481',
|
|
24
|
+
primary800: '#0d3868',
|
|
25
|
+
primary900: '#0f3058',
|
|
26
|
+
primary950: '#10243e',
|
|
27
|
+
secondary0: '#ffffff',
|
|
28
|
+
secondary50: '#fcfcfc',
|
|
29
|
+
secondary100: '#f3f3f3',
|
|
30
|
+
secondary200: '#e9e9e9',
|
|
31
|
+
secondary300: '#d9d9d9',
|
|
32
|
+
secondary400: '#b9c2c6',
|
|
33
|
+
secondary500: '#8a99a0',
|
|
34
|
+
secondary600: '#5c707a',
|
|
35
|
+
secondary700: '#2d4754',
|
|
36
|
+
secondary800: '#163341',
|
|
37
|
+
secondary900: '#0d212c',
|
|
38
|
+
secondary950: '#091a23',
|
|
39
|
+
secondary990: '#07151c',
|
|
40
|
+
success0: '#f0fdf4',
|
|
41
|
+
success50: '#dcfce7',
|
|
42
|
+
success100: '#bbf7d0',
|
|
43
|
+
success200: '#86efac',
|
|
44
|
+
success300: '#4ade80',
|
|
45
|
+
success400: '#22c55e',
|
|
46
|
+
success500: '#16a34a',
|
|
47
|
+
success600: '#15803d',
|
|
48
|
+
success700: '#166534',
|
|
49
|
+
success800: '#14532d',
|
|
50
|
+
success900: '#052e16',
|
|
51
|
+
notice0: '#f5f3ff',
|
|
52
|
+
notice50: '#ede9fe',
|
|
53
|
+
notice100: '#ddd6fe',
|
|
54
|
+
notice200: '#c4b5fd',
|
|
55
|
+
notice300: '#a78bfa',
|
|
56
|
+
notice400: '#8b5cf6',
|
|
57
|
+
notice500: '#7c3aed',
|
|
58
|
+
notice600: '#6d28d9',
|
|
59
|
+
notice700: '#5b21b6',
|
|
60
|
+
notice800: '#4c1d95',
|
|
61
|
+
notice900: '#2e1065',
|
|
62
|
+
informative0: '#f0f9ff',
|
|
63
|
+
informative50: '#e0f2fe',
|
|
64
|
+
informative100: '#bae6fd',
|
|
65
|
+
informative200: '#7dd3fc',
|
|
66
|
+
informative300: '#38bdf8',
|
|
67
|
+
informative400: '#0ea5e9',
|
|
68
|
+
informative500: '#0284C7',
|
|
69
|
+
informative600: '#0369a1',
|
|
70
|
+
informative700: '#075985',
|
|
71
|
+
informative800: '#0c4a6e',
|
|
72
|
+
informative900: '#082f49',
|
|
73
|
+
attention0: '#fff8e1',
|
|
74
|
+
attention50: '#fef3c7',
|
|
75
|
+
attention100: '#fde68a',
|
|
76
|
+
attention200: '#facc15',
|
|
77
|
+
attention300: '#f59e0b',
|
|
78
|
+
attention400: '#d97706',
|
|
79
|
+
attention500: '#b45309',
|
|
80
|
+
attention600: '#92400e',
|
|
81
|
+
attention700: '#78350f',
|
|
82
|
+
attention800: '#65280c',
|
|
83
|
+
attention900: '#4a0d03',
|
|
84
|
+
discovery0: '#FEE1F1',
|
|
85
|
+
discovery50: '#FCCAE4',
|
|
86
|
+
discovery100: '#FA94CA',
|
|
87
|
+
discovery200: '#F75FAF',
|
|
88
|
+
discovery300: '#F42995',
|
|
89
|
+
discovery400: '#D90B78',
|
|
90
|
+
discovery500: '#AF0961',
|
|
91
|
+
discovery600: '#830748',
|
|
92
|
+
discovery700: '#570430',
|
|
93
|
+
discovery800: '#2C0218',
|
|
94
|
+
discovery900: '#13010B',
|
|
95
|
+
danger0: '#fff1f1',
|
|
96
|
+
danger50: '#fee2e2',
|
|
97
|
+
danger100: '#fecaca',
|
|
98
|
+
danger200: '#fca5a5',
|
|
99
|
+
danger300: '#f87171',
|
|
100
|
+
danger400: '#ef4444',
|
|
101
|
+
danger500: '#dc2626',
|
|
102
|
+
danger600: '#b91c1c',
|
|
103
|
+
danger700: '#991b1b',
|
|
104
|
+
danger800: '#7f1d1d',
|
|
105
|
+
danger900: '#450a0a'
|
|
106
|
+
};
|
|
107
|
+
export const tokens = {
|
|
108
|
+
semantic: {
|
|
109
|
+
color: {
|
|
110
|
+
text: { ...semanticColors },
|
|
111
|
+
background: { ...semanticColors },
|
|
112
|
+
border: { ...semanticColors },
|
|
113
|
+
icon: { ...semanticColors }
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
core: {
|
|
117
|
+
space: {
|
|
118
|
+
space000: '0',
|
|
119
|
+
space010: '0.1rem',
|
|
120
|
+
space025: '0.2rem',
|
|
121
|
+
space050: '0.4rem',
|
|
122
|
+
space100: '0.8rem',
|
|
123
|
+
space150: '1.2rem',
|
|
124
|
+
space200: '1.6rem',
|
|
125
|
+
space250: '2rem',
|
|
126
|
+
space300: '2.4rem',
|
|
127
|
+
space400: '3.2rem',
|
|
128
|
+
space500: '4rem',
|
|
129
|
+
space550: '4.4rem',
|
|
130
|
+
space600: '4.8rem',
|
|
131
|
+
space800: '6.4rem'
|
|
132
|
+
},
|
|
133
|
+
shadow: {
|
|
134
|
+
shadow1: `0 0 20px #00000033`,
|
|
135
|
+
shadow2: `0 0 20px #0000001A`,
|
|
136
|
+
shadow3: `0 0 1.6rem #0000000f`,
|
|
137
|
+
shadow4: `0px 0px 0px 1px #bcbec0 `,
|
|
138
|
+
shadow100: '1px 0px 6px 0px #0000001f',
|
|
139
|
+
shadow200: '0px 0px 12px 0px #0000000f, 0px 0px 0px 1px #00000008',
|
|
140
|
+
shadow300: '0px -4px 8px 0px #0000000f, 0px 4px 8px 0px #0000000f, 0px 0px 0px 1px #00000005',
|
|
141
|
+
shadow400: '0px 4px 24px 0px #00000029, 0px 0px 0px 1px #00000008',
|
|
142
|
+
shadow500: '0px 0px 32px 0px #00000029, -1px 0px 0px 0px #00000008',
|
|
143
|
+
shadow600: '0px 0px 44px 6px #0000001f, 0px 0px 0px 1px #00000008',
|
|
144
|
+
shadow700: '0px 0px 0px 1px #00000008, 0px 0px 44px 0px #0000001c, 0px 0px 8px 0px #0000001c'
|
|
145
|
+
},
|
|
146
|
+
zIndex: {
|
|
147
|
+
zIndex5: 5,
|
|
148
|
+
zIndex9998: 9998,
|
|
149
|
+
zIndex9999: 9999
|
|
150
|
+
},
|
|
151
|
+
icon: {
|
|
152
|
+
size: {
|
|
153
|
+
XS: '0.8rem',
|
|
154
|
+
S: '1.2rem',
|
|
155
|
+
M: '1.6rem',
|
|
156
|
+
L: '2rem',
|
|
157
|
+
XL: '2.4rem',
|
|
158
|
+
XXL: '3rem',
|
|
159
|
+
'for-text': '1.25em',
|
|
160
|
+
'by-font': '1em'
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
font: {
|
|
164
|
+
fontFamily: {
|
|
165
|
+
regular: 'Geist, Geist Sans, sans-serif',
|
|
166
|
+
sourceCodeProRegular: 'Source Code Pro, monospace'
|
|
167
|
+
},
|
|
168
|
+
fontSize: {
|
|
169
|
+
s8: '0.80rem',
|
|
170
|
+
s10: '1.00rem',
|
|
171
|
+
s12: '1.20rem',
|
|
172
|
+
s13: '1.30rem',
|
|
173
|
+
s14: '1.40rem',
|
|
174
|
+
s15: '1.50rem',
|
|
175
|
+
s16: '1.60rem',
|
|
176
|
+
s18: '1.80rem',
|
|
177
|
+
s20: '2.00rem',
|
|
178
|
+
s22: '2.20rem',
|
|
179
|
+
s24: '2.40rem',
|
|
180
|
+
s26: '2.60rem',
|
|
181
|
+
s27: '2.70rem',
|
|
182
|
+
s28: '2.80rem',
|
|
183
|
+
s32: '3.20rem',
|
|
184
|
+
s40: '4.00rem',
|
|
185
|
+
s44: '4.40rem',
|
|
186
|
+
s52: '5.20rem'
|
|
187
|
+
},
|
|
188
|
+
fontWeight: {
|
|
189
|
+
normal: '400',
|
|
190
|
+
semiBold: '500',
|
|
191
|
+
bold: '600'
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
focus: {
|
|
195
|
+
margin: '2px',
|
|
196
|
+
size: '2px',
|
|
197
|
+
color: semanticColors.primary600
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
export declare const cardVariants: readonly ["primary", "secondary", "informative", "success", "notice", "attention", "danger", "upsell"];
|
|
2
|
+
export type CardVariant = (typeof cardVariants)[number];
|
|
1
3
|
export type CardTheme = {
|
|
2
4
|
width: string;
|
|
3
5
|
height: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
variants: Record<CardVariant, {
|
|
7
|
+
bgColor: string;
|
|
8
|
+
borderColor: string;
|
|
9
|
+
}>;
|
|
7
10
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -19,6 +19,7 @@ export * from './filters.types';
|
|
|
19
19
|
export * from './formField.types';
|
|
20
20
|
export * from './global.types';
|
|
21
21
|
export * from './highlightedIcon.types';
|
|
22
|
+
export * from './icon.types';
|
|
22
23
|
export * from './iconButton.types';
|
|
23
24
|
export * from './input.types';
|
|
24
25
|
export * from './keyValueList.types';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export * from './actionIconButton.types';
|
|
2
|
+
export * from './appBar.types';
|
|
3
|
+
export * from './appSelectionMenu.types';
|
|
4
|
+
export * from './autoComplete.types';
|
|
5
|
+
export * from './badge.types';
|
|
6
|
+
export * from './banner.types';
|
|
7
|
+
export * from './boxSelectionGroup.types';
|
|
8
|
+
export * from './breadcrumbs.types';
|
|
9
|
+
export * from './button.types';
|
|
10
|
+
export * from './buttonGroup.types';
|
|
11
|
+
export * from './card.types';
|
|
12
|
+
export * from './checkbox.types';
|
|
13
|
+
export * from './chip.types';
|
|
14
|
+
export * from './chipList.types';
|
|
15
|
+
export * from './countryFlag.types';
|
|
16
|
+
export * from './datePicker.types';
|
|
17
|
+
export * from './drawer.types';
|
|
18
|
+
export * from './filters.types';
|
|
19
|
+
export * from './formField.types';
|
|
20
|
+
export * from './global.types';
|
|
21
|
+
export * from './highlightedIcon.types';
|
|
22
|
+
export * from './icon.types';
|
|
23
|
+
export * from './iconButton.types';
|
|
24
|
+
export * from './input.types';
|
|
25
|
+
export * from './keyValueList.types';
|
|
26
|
+
export * from './label.types';
|
|
27
|
+
export * from './layouts.types';
|
|
28
|
+
export * from './link.types';
|
|
29
|
+
export * from './loader.types';
|
|
30
|
+
export * from './menu.types';
|
|
31
|
+
export * from './midBar.types';
|
|
32
|
+
export * from './modal.types';
|
|
33
|
+
export * from './moreInfoIcon.types';
|
|
34
|
+
export * from './popover.types';
|
|
35
|
+
export * from './popupCard.types';
|
|
36
|
+
export * from './profileIcon.types';
|
|
37
|
+
export * from './progressBar.types';
|
|
38
|
+
export * from './radio.types';
|
|
39
|
+
export * from './searchBar.types';
|
|
40
|
+
export * from './section.types';
|
|
41
|
+
export * from './select.types';
|
|
42
|
+
export * from './semanticButton.types';
|
|
43
|
+
export * from './semanticContainer.types';
|
|
44
|
+
export * from './semanticIcon.types';
|
|
45
|
+
export * from './sideBar.types';
|
|
46
|
+
export * from './skeleton.types';
|
|
47
|
+
export * from './slider.types';
|
|
48
|
+
export * from './stepper.types';
|
|
49
|
+
export * from './switch.types';
|
|
50
|
+
export * from './table.types';
|
|
51
|
+
export * from './tableHeading.types';
|
|
52
|
+
export * from './tabs.types';
|
|
53
|
+
export * from './textButton.types';
|
|
54
|
+
export * from './themeModeSwitch.types';
|
|
55
|
+
export * from './toast.types';
|
|
56
|
+
export * from './toggleButton.types';
|
|
57
|
+
export * from './tooltip.types';
|
|
58
|
+
export * from './treeView.types';
|
|
59
|
+
export * from './typography.types';
|
|
60
|
+
export * from './windowBar.types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tokens } from './tokens.types';
|
|
2
|
-
import { ActionIconButtonTheme, AppBarTheme, AppSelectionMenuTheme, AutoCompleteTheme, BadgeTheme, BannerTheme, BoxSelectionGroupTheme, BreadcrumbsTheme, ButtonGroupTheme, ButtonTheme, CardTheme, CheckboxTheme, ChipListTheme, ChipTheme, CountryFlagTheme, DatePickerTheme, DrawerTheme, FiltersTheme, FormFieldTheme, HighlightedIconTheme, IconButtonTheme, InputTheme, KeyValueListTheme, LabelTheme, LayoutsTheme, LinkTheme, LoaderTheme, MenuTheme, MidBarTheme, ModalTheme, MoreInfoIconTheme, PopoverTheme, PopupCardTheme, ProfileIconTheme, ProgressBarTheme, RadioTheme, SearchBarTheme, SectionTheme, SelectTheme, SemanticButtonTheme, SemanticContainerTheme, SemanticIconTheme, SideBarTheme, SkeletonTheme, SliderTheme, StepperTheme, SwitchTheme, TableHeadingTheme, TableTheme, TabsTheme, TextButtonTheme, ThemeModeSwitchTheme, ToastTheme, ToggleButtonTheme, TooltipTheme, TreeViewTheme, TypoTheme, WindowBarTheme } from './components';
|
|
2
|
+
import { ActionIconButtonTheme, AppBarTheme, AppSelectionMenuTheme, AutoCompleteTheme, BadgeTheme, BannerTheme, BoxSelectionGroupTheme, BreadcrumbsTheme, ButtonGroupTheme, ButtonTheme, CardTheme, CheckboxTheme, ChipListTheme, ChipTheme, CountryFlagTheme, DatePickerTheme, DrawerTheme, FiltersTheme, FormFieldTheme, HighlightedIconTheme, IconTheme, IconButtonTheme, InputTheme, KeyValueListTheme, LabelTheme, LayoutsTheme, LinkTheme, LoaderTheme, MenuTheme, MidBarTheme, ModalTheme, MoreInfoIconTheme, PopoverTheme, PopupCardTheme, ProfileIconTheme, ProgressBarTheme, RadioTheme, SearchBarTheme, SectionTheme, SelectTheme, SemanticButtonTheme, SemanticContainerTheme, SemanticIconTheme, SideBarTheme, SkeletonTheme, SliderTheme, StepperTheme, SwitchTheme, TableHeadingTheme, TableTheme, TabsTheme, TextButtonTheme, ThemeModeSwitchTheme, ToastTheme, ToggleButtonTheme, TooltipTheme, TreeViewTheme, TypoTheme, WindowBarTheme } from './components';
|
|
3
3
|
import { BodyTheme, ScrollbarTheme } from './globals';
|
|
4
4
|
import { ThemeCore } from './themeCore.types';
|
|
5
5
|
export interface Theme extends ThemeCore, Tokens {
|
|
@@ -24,6 +24,7 @@ export interface Theme extends ThemeCore, Tokens {
|
|
|
24
24
|
filters: FiltersTheme;
|
|
25
25
|
formField: FormFieldTheme;
|
|
26
26
|
highlightedIcon: HighlightedIconTheme;
|
|
27
|
+
icon: IconTheme;
|
|
27
28
|
iconButton: IconButtonTheme;
|
|
28
29
|
input: InputTheme;
|
|
29
30
|
keyValueList: KeyValueListTheme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import colorAlpha from 'color-alpha';
|
|
2
|
+
import { darken, getLuminance, lighten } from 'polished';
|
|
3
|
+
/**
|
|
4
|
+
* This function is intended to be used only within CSS and not for plain color manipulations.
|
|
5
|
+
* Opacity needs to be between 0 and 1.
|
|
6
|
+
*/
|
|
7
|
+
export const withOpacity = (cssColor, opacity) => colorAlpha(cssColor, opacity); // TODO: Replace with color-mix once more widely-used
|
|
8
|
+
// `color-mix(in srgb-linear, ${cssColor} ${opacity*100}%, transparent)`;
|
|
9
|
+
/**
|
|
10
|
+
* Returns a lighter or darker variant of `base`
|
|
11
|
+
* that preserves hue & saturation.
|
|
12
|
+
*
|
|
13
|
+
* @param base Any CSS color string.
|
|
14
|
+
*/
|
|
15
|
+
export function withContrast(base) {
|
|
16
|
+
// TODO: Replace with contrast-color once more widely-used
|
|
17
|
+
const luminance = getLuminance(base);
|
|
18
|
+
const shift = Math.max(Math.abs(luminance - 0.5) * 1.2, 0.3);
|
|
19
|
+
return luminance < 0.5 // dark original?
|
|
20
|
+
? lighten(shift, base) // → lighten
|
|
21
|
+
: darken(shift, base); // → or darken
|
|
22
|
+
}
|
|
23
|
+
/** Groups themes from pairs by mode */
|
|
24
|
+
export const groupThemesByMode = (themePairs) => themePairs.reduce((acc, pair) => {
|
|
25
|
+
acc.light.push(pair.light);
|
|
26
|
+
acc.dark.push(pair.dark);
|
|
27
|
+
return acc;
|
|
28
|
+
}, { light: [], dark: [] });
|
|
29
|
+
/** Makes flat array of themes from pairs */
|
|
30
|
+
export const getThemesFlatList = (themePairs) => themePairs.flatMap((pair) => Object.values(pair));
|
|
31
|
+
/** converts flat theme array to the map by name with theme pair as value */
|
|
32
|
+
export const groupFlatByNameAndMode = (themeList) => themeList.reduce((acc, theme) => {
|
|
33
|
+
const pair = acc[theme.name] || {};
|
|
34
|
+
pair[theme.mode] = theme;
|
|
35
|
+
acc[theme.name] = pair;
|
|
36
|
+
return acc;
|
|
37
|
+
}, {});
|
|
38
|
+
/** converts flat theme array to the map by mode with theme list as value */
|
|
39
|
+
export const groupFlatByMode = (themeList) => themeList.reduce((acc, theme) => {
|
|
40
|
+
acc[theme.mode].push(theme);
|
|
41
|
+
return acc;
|
|
42
|
+
}, { light: [], dark: [] });
|
|
43
|
+
/**
|
|
44
|
+
* Prepares theme list for quick search by existing parameters.
|
|
45
|
+
* Converts flat list to maps by name and mode for quick access.
|
|
46
|
+
*
|
|
47
|
+
* Place default themes first in list. they will be taken if nothing is found.
|
|
48
|
+
* @param themeList - flat array of themes
|
|
49
|
+
*/
|
|
50
|
+
export const prepareThemesForSearch = (themeList) => ({
|
|
51
|
+
groupedByName: groupFlatByNameAndMode(themeList),
|
|
52
|
+
groupedByMode: groupFlatByMode(themeList)
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Quick search for most suitable theme by optional theme name and/or mode.
|
|
56
|
+
* If not found, use your default one.
|
|
57
|
+
*
|
|
58
|
+
* Receives pre-grouped theme lists. Build them statically (out of components and hooks)
|
|
59
|
+
* from flat array of your themes, using `prepareThemesForSearch`
|
|
60
|
+
* @param themes - use `prepareThemesForSearch` to build this (build it statically)
|
|
61
|
+
* @param themeName - theme name, if exists
|
|
62
|
+
* @param themeMode - theme mode, if exists
|
|
63
|
+
*/
|
|
64
|
+
export const findThemeByNameAndMode = (themes, themeName, themeMode) => {
|
|
65
|
+
const themePair = themes.groupedByName[themeName];
|
|
66
|
+
if (themePair) {
|
|
67
|
+
if (themeMode) {
|
|
68
|
+
return themePair[themeMode] || themes.groupedByMode[themeMode]?.[0];
|
|
69
|
+
}
|
|
70
|
+
return themePair.light || themePair.dark;
|
|
71
|
+
}
|
|
72
|
+
if (themeMode) {
|
|
73
|
+
return themes.groupedByMode[themeMode]?.[0];
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
};
|