@react-md/core 1.0.0-next.16 → 1.0.0-next.17
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/_box-shadows.scss +76 -0
- package/dist/_colors.scss +279 -277
- package/dist/_core.scss +107 -16
- package/dist/_object-fit.scss +86 -0
- package/dist/_utils.scss +246 -72
- package/dist/app-bar/AppBar.d.ts +1 -90
- package/dist/app-bar/AppBar.js +1 -40
- package/dist/app-bar/AppBar.js.map +1 -1
- package/dist/app-bar/AppBarTitle.d.ts +1 -27
- package/dist/app-bar/AppBarTitle.js +1 -15
- package/dist/app-bar/AppBarTitle.js.map +1 -1
- package/dist/app-bar/_app-bar.scss +156 -25
- package/dist/app-bar/styles.d.ts +117 -0
- package/dist/app-bar/styles.js +55 -0
- package/dist/app-bar/styles.js.map +1 -0
- package/dist/autocomplete/Autocomplete.d.ts +8 -79
- package/dist/autocomplete/Autocomplete.js +112 -83
- package/dist/autocomplete/Autocomplete.js.map +1 -1
- package/dist/autocomplete/AutocompleteChip.d.ts +8 -0
- package/dist/autocomplete/AutocompleteChip.js +34 -0
- package/dist/autocomplete/AutocompleteChip.js.map +1 -0
- package/dist/autocomplete/AutocompleteCircularProgress.d.ts +5 -11
- package/dist/autocomplete/AutocompleteCircularProgress.js +4 -0
- package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -1
- package/dist/autocomplete/AutocompleteClearButton.d.ts +9 -0
- package/dist/autocomplete/AutocompleteClearButton.js +29 -0
- package/dist/autocomplete/AutocompleteClearButton.js.map +1 -0
- package/dist/autocomplete/AutocompleteDropdownButton.d.ts +4 -26
- package/dist/autocomplete/AutocompleteDropdownButton.js +5 -1
- package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -1
- package/dist/autocomplete/AutocompleteListboxChildren.d.ts +22 -0
- package/dist/autocomplete/AutocompleteListboxChildren.js +37 -0
- package/dist/autocomplete/AutocompleteListboxChildren.js.map +1 -0
- package/dist/autocomplete/_autocomplete.scss +362 -34
- package/dist/autocomplete/autocompleteStyles.d.ts +22 -0
- package/dist/autocomplete/autocompleteStyles.js +17 -8
- package/dist/autocomplete/autocompleteStyles.js.map +1 -1
- package/dist/autocomplete/defaults.d.ts +9 -9
- package/dist/autocomplete/defaults.js +13 -13
- package/dist/autocomplete/defaults.js.map +1 -1
- package/dist/autocomplete/types.d.ts +554 -56
- package/dist/autocomplete/types.js.map +1 -1
- package/dist/autocomplete/useAutocomplete.d.ts +22 -0
- package/dist/autocomplete/useAutocomplete.js +281 -0
- package/dist/autocomplete/useAutocomplete.js.map +1 -0
- package/dist/autocomplete/utils.d.ts +81 -0
- package/dist/autocomplete/utils.js +108 -0
- package/dist/autocomplete/utils.js.map +1 -0
- package/dist/avatar/_avatar.scss +93 -2
- package/dist/badge/Badge.d.ts +1 -20
- package/dist/badge/Badge.js +1 -14
- package/dist/badge/Badge.js.map +1 -1
- package/dist/badge/_badge.scss +90 -3
- package/dist/badge/styles.d.ts +26 -0
- package/dist/badge/styles.js +18 -0
- package/dist/badge/styles.js.map +1 -0
- package/dist/box/Box.js +2 -1
- package/dist/box/Box.js.map +1 -1
- package/dist/box/_box.scss +130 -17
- package/dist/box/styles.d.ts +6 -0
- package/dist/box/styles.js +2 -1
- package/dist/box/styles.js.map +1 -1
- package/dist/button/AsyncButton.d.ts +1 -1
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/button/Button.d.ts +2 -1
- package/dist/button/Button.js +2 -1
- package/dist/button/Button.js.map +1 -1
- package/dist/button/_button.scss +157 -25
- package/dist/card/Card.d.ts +16 -0
- package/dist/card/Card.js +11 -3
- package/dist/card/Card.js.map +1 -1
- package/dist/card/ClickableCard.d.ts +2 -1
- package/dist/card/ClickableCard.js +5 -2
- package/dist/card/ClickableCard.js.map +1 -1
- package/dist/card/_card.scss +90 -19
- package/dist/card/styles.d.ts +0 -7
- package/dist/card/styles.js +2 -3
- package/dist/card/styles.js.map +1 -1
- package/dist/chip/Chip.d.ts +2 -1
- package/dist/chip/Chip.js +2 -1
- package/dist/chip/Chip.js.map +1 -1
- package/dist/chip/_chip.scss +42 -20
- package/dist/chip/styles.d.ts +12 -10
- package/dist/chip/styles.js.map +1 -1
- package/dist/cssUtils.js.map +1 -1
- package/dist/delegateEvent.d.ts +2 -2
- package/dist/delegateEvent.js.map +1 -1
- package/dist/dialog/Dialog.d.ts +8 -21
- package/dist/dialog/Dialog.js +27 -27
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/FixedDialog.d.ts +1 -3
- package/dist/dialog/FixedDialog.js +0 -8
- package/dist/dialog/FixedDialog.js.map +1 -1
- package/dist/dialog/_dialog.scss +67 -13
- package/dist/dialog/styles.d.ts +56 -0
- package/dist/dialog/styles.js +29 -2
- package/dist/dialog/styles.js.map +1 -1
- package/dist/divider/Divider.d.ts +0 -11
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/_divider.scss +7 -1
- package/dist/divider/styles.d.ts +11 -0
- package/dist/divider/styles.js.map +1 -1
- package/dist/draggable/useDraggable.d.ts +6 -6
- package/dist/draggable/useDraggable.js.map +1 -1
- package/dist/draggable/utils.d.ts +3 -3
- package/dist/draggable/utils.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanel.d.ts +1 -1
- package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
- package/dist/expansion-panel/_expansion-panel.scss +5 -1
- package/dist/expansion-panel/useExpansionPanels.js +12 -24
- package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
- package/dist/{form → files}/FileInput.d.ts +3 -6
- package/dist/{form → files}/FileInput.js +3 -6
- package/dist/files/FileInput.js.map +1 -0
- package/dist/files/_files.scss +22 -0
- package/dist/files/styles.d.ts +5 -0
- package/dist/files/styles.js +7 -0
- package/dist/files/styles.js.map +1 -0
- package/dist/{form → files}/useFileUpload.d.ts +7 -9
- package/dist/{form → files}/useFileUpload.js +5 -7
- package/dist/files/useFileUpload.js.map +1 -0
- package/dist/files/utils.d.ts +169 -0
- package/dist/files/utils.js +114 -0
- package/dist/files/utils.js.map +1 -0
- package/dist/{form/fileUtils.d.ts → files/validation.d.ts} +9 -174
- package/dist/{form/fileUtils.js → files/validation.js} +9 -134
- package/dist/files/validation.js.map +1 -0
- package/dist/focus/useFocusContainer.d.ts +2 -2
- package/dist/focus/useFocusContainer.js.map +1 -1
- package/dist/focus/utils.js.map +1 -1
- package/dist/form/FormMessage.js.map +1 -1
- package/dist/form/FormMessageContainer.js +4 -2
- package/dist/form/FormMessageContainer.js.map +1 -1
- package/dist/form/InputToggle.d.ts +2 -1
- package/dist/form/InputToggle.js +2 -1
- package/dist/form/InputToggle.js.map +1 -1
- package/dist/form/InputToggleIcon.js.map +1 -1
- package/dist/form/Label.js +2 -2
- package/dist/form/Label.js.map +1 -1
- package/dist/form/Listbox.d.ts +24 -0
- package/dist/form/Listbox.js +46 -0
- package/dist/form/Listbox.js.map +1 -0
- package/dist/form/ListboxProvider.d.ts +21 -0
- package/dist/form/{useListboxProvider.js → ListboxProvider.js} +1 -1
- package/dist/form/ListboxProvider.js.map +1 -0
- package/dist/form/MenuItemTextField.js +1 -2
- package/dist/form/MenuItemTextField.js.map +1 -1
- package/dist/form/NativeSelect.js +7 -4
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/Option.d.ts +49 -10
- package/dist/form/Option.js +11 -9
- package/dist/form/Option.js.map +1 -1
- package/dist/form/Password.js.map +1 -1
- package/dist/form/Select.d.ts +2 -2
- package/dist/form/Select.js +81 -85
- package/dist/form/Select.js.map +1 -1
- package/dist/form/Slider.d.ts +4 -4
- package/dist/form/Slider.js +6 -2
- package/dist/form/Slider.js.map +1 -1
- package/dist/form/SliderThumb.d.ts +3 -3
- package/dist/form/SliderThumb.js.map +1 -1
- package/dist/form/SliderValueMarks.d.ts +2 -2
- package/dist/form/SliderValueMarks.js.map +1 -1
- package/dist/form/SliderValueTooltip.js.map +1 -1
- package/dist/form/TextArea.js +1 -2
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextField.js +1 -2
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/TextFieldContainer.js +1 -2
- package/dist/form/TextFieldContainer.js.map +1 -1
- package/dist/form/_form.scss +186 -121
- package/dist/form/formMessageContainerStyles.d.ts +10 -0
- package/dist/form/formMessageContainerStyles.js +11 -0
- package/dist/form/formMessageContainerStyles.js.map +1 -0
- package/dist/form/inputToggleStyles.js.map +1 -1
- package/dist/form/optionStyles.d.ts +1 -0
- package/dist/form/optionStyles.js +2 -2
- package/dist/form/optionStyles.js.map +1 -1
- package/dist/form/selectUtils.js.map +1 -1
- package/dist/form/sliderUtils.d.ts +1 -1
- package/dist/form/sliderUtils.js.map +1 -1
- package/dist/form/textFieldContainerStyles.d.ts +0 -2
- package/dist/form/textFieldContainerStyles.js +1 -2
- package/dist/form/textFieldContainerStyles.js.map +1 -1
- package/dist/form/types.d.ts +3 -10
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCheckboxGroup.d.ts +17 -17
- package/dist/form/useCheckboxGroup.js +9 -17
- package/dist/form/useCheckboxGroup.js.map +1 -1
- package/dist/form/useCombobox.d.ts +56 -21
- package/dist/form/useCombobox.js +19 -4
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useEditableCombobox.d.ts +24 -4
- package/dist/form/useEditableCombobox.js +5 -0
- package/dist/form/useEditableCombobox.js.map +1 -1
- package/dist/form/useNumberField.js.map +1 -1
- package/dist/form/useRadioGroup.d.ts +6 -6
- package/dist/form/useRadioGroup.js.map +1 -1
- package/dist/form/useResizingTextArea.js.map +1 -1
- package/dist/form/useSelectCombobox.d.ts +3 -4
- package/dist/form/useSelectCombobox.js.map +1 -1
- package/dist/form/useTextField.d.ts +1 -1
- package/dist/form/useTextField.js.map +1 -1
- package/dist/form/useTextFieldContainerAddons.js.map +1 -1
- package/dist/hoverMode/useHoverMode.d.ts +3 -3
- package/dist/hoverMode/useHoverMode.js.map +1 -1
- package/dist/hoverMode/useHoverModeProvider.d.ts +4 -4
- package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
- package/dist/icon/_icon.scss +151 -2
- package/dist/icon/iconConfig.d.ts +10 -0
- package/dist/icon/iconConfig.js +7 -0
- package/dist/icon/iconConfig.js.map +1 -1
- package/dist/icon/materialConfig.js.map +1 -1
- package/dist/icon/styles.js.map +1 -1
- package/dist/interaction/UserInteractionModeProvider.d.ts +5 -5
- package/dist/interaction/UserInteractionModeProvider.js +12 -8
- package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
- package/dist/interaction/types.d.ts +20 -2
- package/dist/interaction/types.js.map +1 -1
- package/dist/interaction/useElementInteraction.d.ts +7 -1
- package/dist/interaction/useElementInteraction.js +1 -2
- package/dist/interaction/useElementInteraction.js.map +1 -1
- package/dist/interaction/utils.d.ts +2 -2
- package/dist/interaction/utils.js +2 -2
- package/dist/interaction/utils.js.map +1 -1
- package/dist/layout/LayoutWindowSplitter.js.map +1 -1
- package/dist/layout/_layout.scss +23 -10
- package/dist/layout/useExpandableLayout.d.ts +3 -3
- package/dist/layout/useExpandableLayout.js.map +1 -1
- package/dist/layout/useLayoutAppBarHeight.d.ts +2 -3
- package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
- package/dist/layout/useTemporaryLayout.d.ts +2 -2
- package/dist/layout/useTemporaryLayout.js.map +1 -1
- package/dist/link/SkipToMainContent.js.map +1 -1
- package/dist/list/ListItem.d.ts +2 -1
- package/dist/list/ListItem.js +2 -1
- package/dist/list/ListItem.js.map +1 -1
- package/dist/list/ListItemChildren.js.map +1 -1
- package/dist/list/ListItemLink.d.ts +2 -1
- package/dist/list/ListItemLink.js +2 -1
- package/dist/list/ListItemLink.js.map +1 -1
- package/dist/list/_list.scss +6 -5
- package/dist/media-queries/_media-queries.scss +12 -0
- package/dist/media-queries/appSize.js.map +1 -1
- package/dist/media-queries/useMediaQuery.js +3 -1
- package/dist/media-queries/useMediaQuery.js.map +1 -1
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.d.ts +8 -3
- package/dist/menu/Menu.js +2 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuItemButton.js +6 -2
- package/dist/menu/MenuItemButton.js.map +1 -1
- package/dist/menu/useContextMenu.d.ts +3 -3
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/movement/types.d.ts +5 -5
- package/dist/movement/types.js.map +1 -1
- package/dist/navigation/CollapsibleNavGroup.d.ts +5 -3
- package/dist/navigation/CollapsibleNavGroup.js +3 -4
- package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
- package/dist/navigation/DefaultNavigationRenderer.d.ts +1 -2
- package/dist/navigation/DefaultNavigationRenderer.js +6 -2
- package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
- package/dist/navigation/NavItemButton.d.ts +1 -1
- package/dist/navigation/NavItemButton.js +1 -0
- package/dist/navigation/NavItemButton.js.map +1 -1
- package/dist/navigation/NavItemLink.d.ts +3 -2
- package/dist/navigation/NavItemLink.js +6 -2
- package/dist/navigation/NavItemLink.js.map +1 -1
- package/dist/navigation/NavSubheader.d.ts +2 -3
- package/dist/navigation/NavSubheader.js.map +1 -1
- package/dist/navigation/Navigation.d.ts +1 -1
- package/dist/navigation/Navigation.js.map +1 -1
- package/dist/navigation/_navigation.scss +6 -5
- package/dist/navigation/types.d.ts +54 -6
- package/dist/navigation/types.js.map +1 -1
- package/dist/navigation/useActiveHeadingId.d.ts +1 -1
- package/dist/navigation/useActiveHeadingId.js.map +1 -1
- package/dist/navigation/useNavigationExpansion.d.ts +104 -0
- package/dist/navigation/useNavigationExpansion.js +77 -0
- package/dist/navigation/useNavigationExpansion.js.map +1 -0
- package/dist/navigation/utils.d.ts +13 -0
- package/dist/navigation/utils.js +36 -0
- package/dist/navigation/utils.js.map +1 -0
- package/dist/objectFit.d.ts +69 -0
- package/dist/objectFit.js +52 -0
- package/dist/objectFit.js.map +1 -0
- package/dist/overlay/_overlay.scss +2 -1
- package/dist/positioning/useFixedPositioning.d.ts +17 -4
- package/dist/positioning/useFixedPositioning.js +10 -5
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/positioning/utils.js.map +1 -1
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/progress/_progress.scss +20 -14
- package/dist/responsive-item/ResponsiveItem.d.ts +64 -0
- package/dist/responsive-item/ResponsiveItem.js +68 -0
- package/dist/responsive-item/ResponsiveItem.js.map +1 -0
- package/dist/responsive-item/ResponsiveItemOverlay.d.ts +1 -19
- package/dist/responsive-item/ResponsiveItemOverlay.js +1 -12
- package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
- package/dist/responsive-item/_responsive-item.scss +110 -133
- package/dist/responsive-item/responsiveItemOverlayStyles.d.ts +19 -0
- package/dist/responsive-item/responsiveItemOverlayStyles.js +14 -0
- package/dist/responsive-item/responsiveItemOverlayStyles.js.map +1 -0
- package/dist/responsive-item/responsiveItemStyles.d.ts +52 -0
- package/dist/responsive-item/responsiveItemStyles.js +15 -0
- package/dist/responsive-item/responsiveItemStyles.js.map +1 -0
- package/dist/scroll/useScrollLock.d.ts +5 -0
- package/dist/scroll/useScrollLock.js.map +1 -1
- package/dist/searching/utils.d.ts +2 -2
- package/dist/searching/utils.js.map +1 -1
- package/dist/segmented-button/SegmentedButton.d.ts +2 -1
- package/dist/segmented-button/SegmentedButton.js +2 -1
- package/dist/segmented-button/SegmentedButton.js.map +1 -1
- package/dist/segmented-button/_segmented-button.scss +6 -6
- package/dist/sheet/_sheet.scss +18 -6
- package/dist/snackbar/ToastManager.js +15 -5
- package/dist/snackbar/ToastManager.js.map +1 -1
- package/dist/snackbar/_snackbar.scss +30 -17
- package/dist/snackbar/useCurrentToastActions.d.ts +5 -5
- package/dist/snackbar/useCurrentToastActions.js.map +1 -1
- package/dist/table/_table.scss +15 -3
- package/dist/table/tableCellStyles.d.ts +7 -3
- package/dist/table/tableCellStyles.js +2 -2
- package/dist/table/tableCellStyles.js.map +1 -1
- package/dist/tabs/Tab.d.ts +2 -1
- package/dist/tabs/Tab.js +2 -1
- package/dist/tabs/Tab.js.map +1 -1
- package/dist/tabs/TabList.d.ts +2 -2
- package/dist/tabs/TabList.js.map +1 -1
- package/dist/tabs/TabListScrollButton.d.ts +1 -1
- package/dist/tabs/TabListScrollButton.js +1 -1
- package/dist/tabs/TabListScrollButton.js.map +1 -1
- package/dist/tabs/_tabs.scss +30 -9
- package/dist/tabs/getTabListScrollToOptions.d.ts +18 -0
- package/dist/tabs/getTabListScrollToOptions.js +19 -0
- package/dist/tabs/getTabListScrollToOptions.js.map +1 -0
- package/dist/tabs/tabStyles.d.ts +3 -0
- package/dist/tabs/tabStyles.js.map +1 -1
- package/dist/tabs/useTabList.d.ts +1 -8
- package/dist/tabs/useTabList.js +1 -0
- package/dist/tabs/useTabList.js.map +1 -1
- package/dist/tabs/useTabs.d.ts +6 -6
- package/dist/tabs/useTabs.js.map +1 -1
- package/dist/tabs/utils.d.ts +0 -18
- package/dist/tabs/utils.js +0 -15
- package/dist/tabs/utils.js.map +1 -1
- package/dist/test-utils/matchMedia.d.ts +1 -1
- package/dist/test-utils/matchMedia.js +4 -4
- package/dist/test-utils/matchMedia.js.map +1 -1
- package/dist/test-utils/polyfills/TextDecoder.js +0 -1
- package/dist/test-utils/polyfills/TextDecoder.js.map +1 -1
- package/dist/test-utils/timers.d.ts +9 -5
- package/dist/test-utils/timers.js +5 -5
- package/dist/test-utils/timers.js.map +1 -1
- package/dist/theme/LocalStorageColorSchemeProvider.d.ts +1 -1
- package/dist/theme/LocalStorageColorSchemeProvider.js +2 -1
- package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
- package/dist/theme/ThemeProvider.js +3 -1
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/_a11y.scss +77 -13
- package/dist/theme/_colors.scss +279 -277
- package/dist/theme/_theme.scss +308 -37
- package/dist/theme/isColorScheme.d.ts +16 -0
- package/dist/theme/isColorScheme.js +19 -0
- package/dist/theme/isColorScheme.js.map +1 -0
- package/dist/theme/types.d.ts +53 -1
- package/dist/theme/types.js +1 -23
- package/dist/theme/types.js.map +1 -1
- package/dist/theme/useCSSVariables.d.ts +2 -19
- package/dist/theme/useCSSVariables.js.map +1 -1
- package/dist/theme/useColorScheme.d.ts +1 -35
- package/dist/theme/useColorScheme.js.map +1 -1
- package/dist/theme/useColorSchemeMetaTag.d.ts +1 -1
- package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
- package/dist/theme/useColorSchemeProvider.d.ts +1 -1
- package/dist/theme/useColorSchemeProvider.js +1 -1
- package/dist/theme/useColorSchemeProvider.js.map +1 -1
- package/dist/theme/{usePrefersColorScheme.js → usePrefersDarkScheme.js} +1 -1
- package/dist/theme/usePrefersDarkScheme.js.map +1 -0
- package/dist/theme/utils.js.map +1 -1
- package/dist/tooltip/useTooltip.d.ts +14 -9
- package/dist/tooltip/useTooltip.js +2 -1
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/transition/_transition.scss +16 -9
- package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
- package/dist/transition/types.d.ts +1 -1
- package/dist/transition/types.js.map +1 -1
- package/dist/transition/useCarousel.d.ts +3 -3
- package/dist/transition/useCarousel.js.map +1 -1
- package/dist/transition/useCollapseTransition.js.map +1 -1
- package/dist/transition/useTransition.js +1 -0
- package/dist/transition/useTransition.js.map +1 -1
- package/dist/transition/utils.js.map +1 -1
- package/dist/tree/TreeItem.d.ts +2 -1
- package/dist/tree/TreeItem.js +4 -3
- package/dist/tree/TreeItem.js.map +1 -1
- package/dist/tree/TreeItemExpander.js.map +1 -1
- package/dist/tree/_tree.scss +8 -6
- package/dist/tree/useTreeExpansion.d.ts +1 -1
- package/dist/tree/useTreeExpansion.js +6 -18
- package/dist/tree/useTreeExpansion.js.map +1 -1
- package/dist/tree/useTreeSelection.d.ts +1 -1
- package/dist/tree/useTreeSelection.js +7 -25
- package/dist/tree/useTreeSelection.js.map +1 -1
- package/dist/tree/utils.d.ts +1 -1
- package/dist/tree/utils.js.map +1 -1
- package/dist/types.d.ts +12 -4
- package/dist/types.js.map +1 -1
- package/dist/typography/WritingDirectionProvider.d.ts +1 -1
- package/dist/typography/WritingDirectionProvider.js.map +1 -1
- package/dist/typography/_typography.scss +94 -37
- package/dist/typography/typographyStyles.js.map +1 -1
- package/dist/useDebouncedFunction.d.ts +1 -5
- package/dist/useDebouncedFunction.js +3 -1
- package/dist/useDebouncedFunction.js.map +1 -1
- package/dist/useDropzone.d.ts +4 -4
- package/dist/useDropzone.js.map +1 -1
- package/dist/useEnsuredId.js.map +1 -1
- package/dist/useIntersectionObserver.d.ts +5 -5
- package/dist/useIntersectionObserver.js.map +1 -1
- package/dist/useLocalStorage.d.ts +3 -3
- package/dist/useLocalStorage.js +1 -1
- package/dist/useLocalStorage.js.map +1 -1
- package/dist/useMutationObserver.d.ts +1 -1
- package/dist/useMutationObserver.js.map +1 -1
- package/dist/useOrientation.js +3 -1
- package/dist/useOrientation.js.map +1 -1
- package/dist/usePageInactive.d.ts +2 -2
- package/dist/usePageInactive.js.map +1 -1
- package/dist/useReadonlySet.d.ts +76 -0
- package/dist/useReadonlySet.js +72 -0
- package/dist/useReadonlySet.js.map +1 -0
- package/dist/useResizeListener.d.ts +1 -1
- package/dist/useResizeListener.js.map +1 -1
- package/dist/useThrottledFunction.d.ts +1 -5
- package/dist/useThrottledFunction.js +3 -1
- package/dist/useThrottledFunction.js.map +1 -1
- package/dist/useToggle.d.ts +3 -3
- package/dist/useToggle.js.map +1 -1
- package/dist/utils/RenderRecursively.d.ts +1 -1
- package/dist/utils/RenderRecursively.js.map +1 -1
- package/dist/utils/alphaNumericSort.d.ts +1 -1
- package/dist/utils/alphaNumericSort.js.map +1 -1
- package/dist/utils/bem.js.map +1 -1
- package/dist/utils/debounce.d.ts +5 -0
- package/dist/utils/debounce.js +17 -0
- package/dist/utils/debounce.js.map +1 -0
- package/dist/utils/nearest.js.map +1 -1
- package/dist/utils/parseCssLengthUnit.js.map +1 -1
- package/dist/utils/throttle.d.ts +5 -0
- package/dist/utils/throttle.js +30 -0
- package/dist/utils/throttle.js.map +1 -0
- package/dist/utils/wait.js +3 -1
- package/dist/utils/wait.js.map +1 -1
- package/dist/window-splitter/WindowSplitter.d.ts +37 -15
- package/dist/window-splitter/WindowSplitter.js +38 -17
- package/dist/window-splitter/WindowSplitter.js.map +1 -1
- package/dist/window-splitter/_window-splitter.scss +32 -14
- package/dist/window-splitter/styles.d.ts +14 -0
- package/dist/window-splitter/styles.js +18 -0
- package/dist/window-splitter/styles.js.map +1 -0
- package/package.json +24 -23
- package/src/app-bar/AppBar.tsx +1 -170
- package/src/app-bar/AppBarTitle.tsx +1 -44
- package/src/app-bar/styles.ts +206 -0
- package/src/autocomplete/Autocomplete.tsx +194 -211
- package/src/autocomplete/AutocompleteChip.tsx +48 -0
- package/src/autocomplete/AutocompleteCircularProgress.tsx +6 -17
- package/src/autocomplete/AutocompleteClearButton.tsx +44 -0
- package/src/autocomplete/AutocompleteDropdownButton.tsx +16 -37
- package/src/autocomplete/AutocompleteListboxChildren.tsx +68 -0
- package/src/autocomplete/autocompleteStyles.ts +48 -9
- package/src/autocomplete/defaults.ts +26 -17
- package/src/autocomplete/types.ts +744 -61
- package/src/autocomplete/useAutocomplete.ts +428 -0
- package/src/autocomplete/utils.ts +211 -0
- package/src/badge/Badge.tsx +1 -39
- package/src/badge/styles.ts +45 -0
- package/src/box/Box.tsx +11 -9
- package/src/box/styles.ts +14 -5
- package/src/button/AsyncButton.tsx +1 -1
- package/src/button/Button.tsx +5 -1
- package/src/card/Card.tsx +35 -4
- package/src/card/ClickableCard.tsx +9 -2
- package/src/card/styles.ts +1 -10
- package/src/chip/Chip.tsx +6 -1
- package/src/chip/styles.ts +12 -10
- package/src/delegateEvent.ts +5 -5
- package/src/dialog/Dialog.tsx +48 -61
- package/src/dialog/FixedDialog.tsx +1 -11
- package/src/dialog/styles.ts +97 -0
- package/src/divider/Divider.tsx +0 -12
- package/src/divider/styles.ts +12 -0
- package/src/draggable/useDraggable.ts +17 -10
- package/src/draggable/utils.ts +3 -3
- package/src/expansion-panel/ExpansionPanel.tsx +1 -1
- package/src/expansion-panel/useExpansionPanels.ts +18 -27
- package/src/{form → files}/FileInput.tsx +7 -15
- package/src/files/styles.ts +10 -0
- package/src/{form → files}/useFileUpload.ts +30 -34
- package/src/files/utils.ts +234 -0
- package/src/{form/fileUtils.ts → files/validation.ts} +13 -242
- package/src/focus/useFocusContainer.ts +16 -8
- package/src/form/FormMessageContainer.tsx +2 -2
- package/src/form/InputToggle.tsx +5 -1
- package/src/form/Label.tsx +18 -18
- package/src/form/Listbox.tsx +87 -0
- package/src/form/ListboxProvider.ts +37 -0
- package/src/form/MenuItemTextField.tsx +1 -2
- package/src/form/NativeSelect.tsx +14 -10
- package/src/form/Option.tsx +74 -22
- package/src/form/Select.tsx +89 -85
- package/src/form/Slider.tsx +14 -11
- package/src/form/SliderThumb.tsx +4 -4
- package/src/form/SliderValueMarks.tsx +4 -4
- package/src/form/TextArea.tsx +6 -8
- package/src/form/TextField.tsx +0 -2
- package/src/form/TextFieldContainer.tsx +9 -11
- package/src/form/formMessageContainerStyles.ts +22 -0
- package/src/form/optionStyles.ts +7 -2
- package/src/form/sliderUtils.ts +1 -1
- package/src/form/textFieldContainerStyles.ts +9 -14
- package/src/form/types.ts +3 -11
- package/src/form/useCheckboxGroup.ts +28 -36
- package/src/form/useCombobox.ts +86 -38
- package/src/form/useEditableCombobox.ts +43 -8
- package/src/form/useRadioGroup.ts +6 -6
- package/src/form/useSelectCombobox.ts +4 -4
- package/src/form/useTextField.ts +1 -1
- package/src/hoverMode/useHoverMode.ts +3 -3
- package/src/hoverMode/useHoverModeProvider.ts +4 -4
- package/src/icon/iconConfig.tsx +12 -0
- package/src/interaction/UserInteractionModeProvider.tsx +12 -8
- package/src/interaction/types.ts +21 -2
- package/src/interaction/useElementInteraction.tsx +9 -2
- package/src/interaction/utils.ts +7 -7
- package/src/layout/useExpandableLayout.ts +3 -3
- package/src/layout/useLayoutAppBarHeight.ts +3 -4
- package/src/layout/useTemporaryLayout.ts +2 -2
- package/src/list/ListItem.tsx +5 -1
- package/src/list/ListItemLink.tsx +5 -1
- package/src/media-queries/useMediaQuery.ts +2 -1
- package/src/menu/Menu.tsx +11 -3
- package/src/menu/MenuItemButton.tsx +7 -1
- package/src/menu/useContextMenu.ts +3 -3
- package/src/movement/types.ts +5 -5
- package/src/navigation/CollapsibleNavGroup.tsx +16 -8
- package/src/navigation/DefaultNavigationRenderer.tsx +8 -6
- package/src/navigation/NavItemButton.tsx +2 -1
- package/src/navigation/NavItemLink.tsx +11 -3
- package/src/navigation/NavSubheader.tsx +1 -1
- package/src/navigation/Navigation.tsx +1 -1
- package/src/navigation/types.ts +60 -10
- package/src/navigation/useActiveHeadingId.ts +1 -1
- package/src/navigation/useNavigationExpansion.ts +170 -0
- package/src/navigation/utils.ts +47 -0
- package/src/objectFit.ts +88 -0
- package/src/positioning/useFixedPositioning.ts +34 -11
- package/src/responsive-item/ResponsiveItem.tsx +96 -0
- package/src/responsive-item/ResponsiveItemOverlay.tsx +6 -46
- package/src/responsive-item/responsiveItemOverlayStyles.ts +46 -0
- package/src/responsive-item/responsiveItemStyles.ts +81 -0
- package/src/scroll/useScrollLock.ts +6 -0
- package/src/searching/utils.ts +3 -3
- package/src/segmented-button/SegmentedButton.tsx +5 -1
- package/src/snackbar/ToastManager.tsx +16 -5
- package/src/snackbar/useCurrentToastActions.ts +5 -5
- package/src/table/tableCellStyles.ts +10 -6
- package/src/tabs/Tab.tsx +4 -1
- package/src/tabs/TabList.tsx +2 -2
- package/src/tabs/TabListScrollButton.tsx +4 -4
- package/src/tabs/getTabListScrollToOptions.ts +37 -0
- package/src/tabs/tabStyles.ts +4 -0
- package/src/tabs/useTabList.ts +2 -9
- package/src/tabs/useTabs.ts +6 -6
- package/src/tabs/utils.ts +0 -38
- package/src/test-utils/matchMedia.ts +5 -5
- package/src/test-utils/polyfills/TextDecoder.ts +0 -1
- package/src/test-utils/timers.ts +10 -7
- package/src/theme/LocalStorageColorSchemeProvider.tsx +4 -4
- package/src/theme/ThemeProvider.tsx +3 -3
- package/src/theme/isColorScheme.ts +22 -0
- package/src/theme/types.ts +67 -1
- package/src/theme/useCSSVariables.ts +7 -30
- package/src/theme/useColorScheme.ts +1 -40
- package/src/theme/useColorSchemeMetaTag.ts +1 -1
- package/src/theme/useColorSchemeProvider.ts +2 -2
- package/src/tooltip/useTooltip.ts +17 -9
- package/src/transition/types.ts +1 -1
- package/src/transition/useCarousel.ts +3 -3
- package/src/transition/useTransition.ts +1 -0
- package/src/tree/TreeItem.tsx +7 -1
- package/src/tree/TreeItemExpander.tsx +1 -1
- package/src/tree/useTreeExpansion.ts +7 -25
- package/src/tree/useTreeSelection.ts +8 -32
- package/src/tree/utils.ts +6 -2
- package/src/types.ts +20 -4
- package/src/typography/WritingDirectionProvider.tsx +1 -1
- package/src/useDebouncedFunction.ts +4 -9
- package/src/useDropzone.ts +4 -4
- package/src/useIntersectionObserver.ts +5 -5
- package/src/useLocalStorage.ts +6 -6
- package/src/useMutationObserver.ts +1 -1
- package/src/useOrientation.ts +3 -1
- package/src/usePageInactive.ts +2 -2
- package/src/useReadonlySet.ts +122 -0
- package/src/useResizeListener.ts +1 -1
- package/src/useThrottledFunction.ts +6 -9
- package/src/useToggle.ts +3 -3
- package/src/utils/RenderRecursively.tsx +1 -1
- package/src/utils/alphaNumericSort.ts +1 -1
- package/src/utils/debounce.ts +22 -0
- package/src/utils/throttle.ts +38 -0
- package/src/utils/wait.ts +5 -1
- package/src/window-splitter/WindowSplitter.tsx +38 -43
- package/src/window-splitter/styles.ts +42 -0
- package/dist/autocomplete/FilterAutocompleteOptions.d.ts +0 -8
- package/dist/autocomplete/FilterAutocompleteOptions.js +0 -57
- package/dist/autocomplete/FilterAutocompleteOptions.js.map +0 -1
- package/dist/dialog/DialogContainer.d.ts +0 -14
- package/dist/dialog/DialogContainer.js +0 -20
- package/dist/dialog/DialogContainer.js.map +0 -1
- package/dist/form/FileInput.js.map +0 -1
- package/dist/form/fileUtils.js.map +0 -1
- package/dist/form/useFileUpload.js.map +0 -1
- package/dist/form/useListboxProvider.d.ts +0 -31
- package/dist/form/useListboxProvider.js.map +0 -1
- package/dist/navigation/getHrefFromParents.d.ts +0 -5
- package/dist/navigation/getHrefFromParents.js +0 -13
- package/dist/navigation/getHrefFromParents.js.map +0 -1
- package/dist/responsive-item/ResponsiveItemContainer.d.ts +0 -115
- package/dist/responsive-item/ResponsiveItemContainer.js +0 -80
- package/dist/responsive-item/ResponsiveItemContainer.js.map +0 -1
- package/dist/responsive-item/styles.d.ts +0 -34
- package/dist/responsive-item/styles.js +0 -17
- package/dist/responsive-item/styles.js.map +0 -1
- package/dist/theme/usePrefersColorScheme.js.map +0 -1
- package/src/autocomplete/FilterAutocompleteOptions.tsx +0 -86
- package/src/dialog/DialogContainer.tsx +0 -28
- package/src/form/useListboxProvider.ts +0 -45
- package/src/navigation/getHrefFromParents.ts +0 -15
- package/src/responsive-item/ResponsiveItemContainer.tsx +0 -174
- package/src/responsive-item/styles.ts +0 -58
- /package/dist/theme/{usePrefersColorScheme.d.ts → usePrefersDarkScheme.d.ts} +0 -0
- /package/src/theme/{usePrefersColorScheme.ts → usePrefersDarkScheme.ts} +0 -0
package/dist/theme/_theme.scss
CHANGED
|
@@ -8,113 +8,278 @@
|
|
|
8
8
|
|
|
9
9
|
@use "../utils";
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
// This defines the total color scheme for your app and can be either:
|
|
12
|
+
// - `light`
|
|
13
|
+
// - `dark`
|
|
14
|
+
// - `system`
|
|
15
|
+
//
|
|
16
|
+
// Setting this value to `system` will default to a light theme unless the user
|
|
17
|
+
// has set their preferred color scheme to dark on their OS.
|
|
18
|
+
//
|
|
19
|
+
// If this value is changed from the default `light` value, the
|
|
20
|
+
// `colorSchemeMode` on the `CoreProviders` component should be updated to
|
|
21
|
+
// match the new value.
|
|
22
|
+
//
|
|
23
|
+
// @type string
|
|
22
24
|
$color-scheme: light !default;
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
// The dark elevation feature is generally recommended to keep enabled since it
|
|
27
|
+
// helps with visibility when your app is using the dark color scheme either
|
|
28
|
+
// through `$color-scheme: dark` or `using the `use-dark-theme mixin. When this
|
|
29
|
+
// feature is enabled, the `background-color` for surfaces will gradually
|
|
30
|
+
// become lighter the higher their `z-value` is with the material design box
|
|
31
|
+
// shadows.
|
|
32
|
+
//
|
|
33
|
+
// If this is set to `false`, all surfaces will mimic the light theme and have
|
|
34
|
+
// a single surface color.
|
|
35
|
+
//
|
|
36
|
+
// @type boolean
|
|
33
37
|
$disable-dark-elevation: $color-scheme == light !default;
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
// Set this to `true` if you do not want the initial bundle to include the
|
|
40
|
+
// `@media (prefers-color-scheme: dark)` styles.
|
|
41
|
+
//
|
|
42
|
+
// @type boolean
|
|
37
43
|
$disable-default-system-theme: false !default;
|
|
44
|
+
|
|
45
|
+
// Set this to `true` if you do not want the initial bundle to include the
|
|
46
|
+
// `:root { ... variables ... }` styles.
|
|
47
|
+
//
|
|
48
|
+
// @type boolean
|
|
38
49
|
$disable-default-root-theme: false !default;
|
|
39
50
|
|
|
40
|
-
//
|
|
51
|
+
// This should only be used if your application does not use menu, dialog,
|
|
41
52
|
// sheet, card, expansion-panel, select, app-bar (theme="surface")
|
|
53
|
+
//
|
|
54
|
+
// @type boolean
|
|
42
55
|
$disable-surface-color: false !default;
|
|
56
|
+
|
|
57
|
+
// Set to `true` if you don't want to create a primary color variable.
|
|
58
|
+
// @type boolean
|
|
43
59
|
$disable-primary-color: false !default;
|
|
60
|
+
|
|
61
|
+
// Set to `true` if you don't want to create a on-primary color variable.
|
|
62
|
+
// @type boolean
|
|
44
63
|
$disable-on-primary-color: $disable-primary-color !default;
|
|
64
|
+
|
|
65
|
+
// Set to `true` if you don't want to create a secondary color variable.
|
|
66
|
+
// @type boolean
|
|
45
67
|
$disable-secondary-color: false !default;
|
|
68
|
+
|
|
69
|
+
// Set to `true` if you don't want to create a on-secondary color variable.
|
|
70
|
+
// @type boolean
|
|
46
71
|
$disable-on-secondary-color: $disable-secondary-color !default;
|
|
72
|
+
|
|
73
|
+
// Set to `true` if you don't want to create a warning color variable.
|
|
74
|
+
// @type boolean
|
|
47
75
|
$disable-warning-color: false !default;
|
|
76
|
+
|
|
77
|
+
// Set to `true` if you don't want to create a on-warning color variable.
|
|
78
|
+
// @type boolean
|
|
48
79
|
$disable-on-warning-color: $disable-warning-color !default;
|
|
80
|
+
|
|
81
|
+
// Set to `true` if you don't want to create a error color variable.
|
|
82
|
+
// @type boolean
|
|
49
83
|
$disable-error-color: false !default;
|
|
84
|
+
|
|
85
|
+
// Set to `true` if you don't want to create a on-error color variable.
|
|
86
|
+
// @type boolean
|
|
50
87
|
$disable-on-error-color: $disable-error-color !default;
|
|
88
|
+
|
|
89
|
+
// Set to `true` if you don't want to create a success color variable.
|
|
90
|
+
// @type boolean
|
|
51
91
|
$disable-success-color: false !default;
|
|
92
|
+
|
|
93
|
+
// Set to `true` if you don't want to create a on-success color variable.
|
|
94
|
+
// @type boolean
|
|
52
95
|
$disable-on-success-color: $disable-success-color !default;
|
|
96
|
+
|
|
97
|
+
// Set to `true` if you don't want to create a outline grey color variable.
|
|
98
|
+
// @type boolean
|
|
53
99
|
$disable-outline-grey-color: false !default;
|
|
100
|
+
|
|
101
|
+
// Set to `true` if you don't want to create a text-primary color variable.
|
|
102
|
+
// @type boolean
|
|
54
103
|
$disable-text-primary-color: false !default;
|
|
104
|
+
|
|
105
|
+
// Set to `true` if you don't want to create a text-secondary color variable.
|
|
106
|
+
// @type boolean
|
|
55
107
|
$disable-text-secondary-color: false !default;
|
|
108
|
+
|
|
109
|
+
// Set to `true` if you don't want to create a text-hint color variable.
|
|
110
|
+
// @type boolean
|
|
56
111
|
$disable-text-hint-color: false !default;
|
|
112
|
+
|
|
113
|
+
// Set to `true` if you don't want to create a text-disabled color variable.
|
|
114
|
+
// @type boolean
|
|
57
115
|
$disable-text-disabled-color: false !default;
|
|
58
116
|
|
|
117
|
+
// The primary theme color to use throughout the app.
|
|
118
|
+
// @type Color
|
|
59
119
|
$primary-color: colors.$blue-500 !default;
|
|
120
|
+
|
|
121
|
+
// An accessible text color to use when the primary color is a background.
|
|
122
|
+
// @type Color
|
|
60
123
|
$on-primary-color: a11y.contrast-color($primary-color) !default;
|
|
124
|
+
|
|
125
|
+
// The secondary theme color to use throughout the app.
|
|
126
|
+
// @type Color
|
|
61
127
|
$secondary-color: colors.$orange-a-400 !default;
|
|
128
|
+
|
|
129
|
+
// An accessible text color to use when the secondary color is a background.
|
|
130
|
+
// @type Color
|
|
62
131
|
$on-secondary-color: a11y.contrast-color($secondary-color) !default;
|
|
132
|
+
|
|
133
|
+
// The warning color to use throughout the app.
|
|
134
|
+
// @type Color
|
|
63
135
|
$warning-color: colors.$deep-orange-a-400 !default;
|
|
136
|
+
|
|
137
|
+
// An accessible text color to use when the warning color is a background.
|
|
138
|
+
// @type Color
|
|
64
139
|
$on-warning-color: a11y.contrast-color($warning-color) !default;
|
|
140
|
+
|
|
141
|
+
// The error color to use throughout the app.
|
|
142
|
+
// @type Color
|
|
65
143
|
$error-color: colors.$red-500 !default;
|
|
144
|
+
|
|
145
|
+
// An accessible text color to use when the error color is a background.
|
|
146
|
+
// @type Color
|
|
66
147
|
$on-error-color: a11y.contrast-color($error-color) !default;
|
|
148
|
+
|
|
149
|
+
// The success color to use throughout the app.
|
|
150
|
+
// @type Color
|
|
67
151
|
$success-color: colors.$green-a-700 !default;
|
|
152
|
+
|
|
153
|
+
// An accessible text color to use when the success color is a background.
|
|
154
|
+
// @type Color
|
|
68
155
|
$on-success-color: a11y.contrast-color($success-color) !default;
|
|
69
156
|
|
|
157
|
+
// The default outline-width to apply for focus, borders, etc
|
|
158
|
+
// @type number
|
|
70
159
|
$outline-width: 0.0625em !default;
|
|
160
|
+
|
|
161
|
+
// The color to use for the outline.
|
|
162
|
+
// @type Color
|
|
71
163
|
$outline-color: currentcolor !default;
|
|
164
|
+
|
|
165
|
+
// The color to use when the outline should be grey.
|
|
166
|
+
// @type Color
|
|
72
167
|
$outline-grey-color: #999 !default;
|
|
73
168
|
|
|
169
|
+
// The root background color (html) when using the light theme.
|
|
170
|
+
// @type Color
|
|
74
171
|
$light-theme-background-color: #fafafa !default;
|
|
172
|
+
|
|
173
|
+
// The background color to apply for surfaces/temporary elements when using the
|
|
174
|
+
// light theme. So things like dialogs and menus.
|
|
175
|
+
// @type Color
|
|
75
176
|
$light-theme-surface-color: #fff !default;
|
|
177
|
+
|
|
178
|
+
// The primary text color when using the light theme.
|
|
179
|
+
// @type Color
|
|
76
180
|
$light-theme-text-primary-color: color.adjust(#000, $lightness: 13%) !default;
|
|
181
|
+
|
|
182
|
+
// The secondary text color when using the light theme.
|
|
183
|
+
// @type Color
|
|
77
184
|
$light-theme-text-secondary-color: color.adjust(#000, $lightness: 46%) !default;
|
|
185
|
+
|
|
186
|
+
// The hint text color when using the light theme.
|
|
187
|
+
// @type Color
|
|
78
188
|
$light-theme-text-hint-color: color.adjust(#000, $lightness: 66%) !default;
|
|
189
|
+
|
|
190
|
+
// The disabled text color when using the light theme.
|
|
191
|
+
// @type Color
|
|
79
192
|
$light-theme-text-disabled-color: color.adjust(#000, $lightness: 62%) !default;
|
|
80
193
|
|
|
194
|
+
// The background color to apply for surfaces/temporary elements when using the
|
|
195
|
+
// dark theme. So things like dialogs and menus.
|
|
196
|
+
// @type Color
|
|
81
197
|
$dark-theme-background-color: #121212 !default;
|
|
198
|
+
|
|
199
|
+
// The default surface background color to apply for surfaces/temporary elements
|
|
200
|
+
// when using the dark theme.
|
|
201
|
+
//
|
|
202
|
+
// This value is a bit different than the light theme variant since dark mode
|
|
203
|
+
// supports an "elevation mode" where each surface gains a different background
|
|
204
|
+
// color depending on its elevation.
|
|
205
|
+
//
|
|
206
|
+
// @type Color
|
|
82
207
|
$dark-theme-surface-color: if($disable-dark-elevation, #424242, null) !default;
|
|
208
|
+
|
|
209
|
+
// The primary text color when using the dark theme.
|
|
210
|
+
// @type Color
|
|
83
211
|
$dark-theme-text-primary-color: color.adjust(#fff, $lightness: -15%) !default;
|
|
212
|
+
|
|
213
|
+
// The secondary text color when using the dark theme.
|
|
214
|
+
// @type Color
|
|
84
215
|
$dark-theme-text-secondary-color: color.adjust(#fff, $lightness: -30%) !default;
|
|
216
|
+
|
|
217
|
+
// The hint text color when using the dark theme.
|
|
218
|
+
// @type Color
|
|
85
219
|
$dark-theme-text-hint-color: color.adjust(#fff, $lightness: -50%) !default;
|
|
220
|
+
|
|
221
|
+
// The disabled text color when using the dark theme.
|
|
222
|
+
// @type Color
|
|
86
223
|
$dark-theme-text-disabled-color: color.adjust(#fff, $lightness: -50%) !default;
|
|
87
224
|
|
|
225
|
+
// Used to provide the correct color based on the `$color-scheme` setting.
|
|
226
|
+
//
|
|
227
|
+
// @param {Color} light-color - The light theme color
|
|
228
|
+
// @param {Color} dark-color - The dark theme color
|
|
229
|
+
// @returns {Color} The correct color depending on the `$color-scheme`
|
|
88
230
|
@function get-default-color($light-color, $dark-color) {
|
|
89
231
|
@return if($color-scheme == dark, $dark-color, $light-color);
|
|
90
232
|
}
|
|
91
233
|
|
|
234
|
+
// The default background color
|
|
235
|
+
// @type Color
|
|
92
236
|
$background-color: get-default-color(
|
|
93
237
|
$light-theme-background-color,
|
|
94
238
|
$dark-theme-background-color
|
|
95
239
|
) !default;
|
|
240
|
+
|
|
241
|
+
// The default surface color
|
|
242
|
+
// @type Color
|
|
96
243
|
$surface-color: get-default-color(
|
|
97
244
|
$light-theme-surface-color,
|
|
98
245
|
$dark-theme-surface-color
|
|
99
246
|
) !default;
|
|
247
|
+
|
|
248
|
+
// The default text primary color
|
|
249
|
+
// @type Color
|
|
100
250
|
$text-primary-color: get-default-color(
|
|
101
251
|
$light-theme-text-primary-color,
|
|
102
252
|
$dark-theme-text-primary-color
|
|
103
253
|
) !default;
|
|
254
|
+
|
|
255
|
+
// The default text secondary color
|
|
256
|
+
// @type Color
|
|
104
257
|
$text-secondary-color: get-default-color(
|
|
105
258
|
$light-theme-text-secondary-color,
|
|
106
259
|
$dark-theme-text-secondary-color
|
|
107
260
|
) !default;
|
|
261
|
+
|
|
262
|
+
// The default text hint color
|
|
263
|
+
// @type Color
|
|
108
264
|
$text-hint-color: get-default-color(
|
|
109
265
|
$light-theme-text-hint-color,
|
|
110
266
|
$dark-theme-text-hint-color
|
|
111
267
|
) !default;
|
|
268
|
+
|
|
269
|
+
// The default text disabled color
|
|
270
|
+
// @type Color
|
|
112
271
|
$text-disabled-color: get-default-color(
|
|
113
272
|
$light-theme-text-disabled-color,
|
|
114
273
|
$dark-theme-text-disabled-color
|
|
115
274
|
) !default;
|
|
116
275
|
|
|
117
|
-
|
|
276
|
+
// This is a Map for all the supported material design elevations (0 - 24) and
|
|
277
|
+
// the background color to use for that elevation. Check out
|
|
278
|
+
// {@link $dark-elevation-colors} and {@link $custom-dark-elevation-colors} for
|
|
279
|
+
// how to change these values.;
|
|
280
|
+
//
|
|
281
|
+
// @type Map
|
|
282
|
+
$default-dark-elevation-colors: (
|
|
118
283
|
0: $dark-theme-background-color,
|
|
119
284
|
1: #1f1f1f,
|
|
120
285
|
2: #242424,
|
|
@@ -140,14 +305,70 @@ $dark-elevation-colors: (
|
|
|
140
305
|
22: #353535,
|
|
141
306
|
23: #353535,
|
|
142
307
|
24: #383838,
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
// This Map can be used to override the {@link $default-dark-elevation-colors}
|
|
311
|
+
// with new values if you only want to change a few values.
|
|
312
|
+
//
|
|
313
|
+
// @example
|
|
314
|
+
// ```scss
|
|
315
|
+
// @use "@react-md/core" with (
|
|
316
|
+
// $custom-dark-elevation-colors: (
|
|
317
|
+
// 1: #000,
|
|
318
|
+
// 2: #1f1f1f,
|
|
319
|
+
// )
|
|
320
|
+
// );
|
|
321
|
+
// ```
|
|
322
|
+
//
|
|
323
|
+
// @type Map
|
|
324
|
+
$custom-dark-elevation-colors: () !default;
|
|
325
|
+
|
|
326
|
+
// This Map can be used to completely configure the dark elevation colors and
|
|
327
|
+
// remove unused elevations.
|
|
328
|
+
//
|
|
329
|
+
// Elevations:
|
|
330
|
+
//
|
|
331
|
+
// - 0 - Root background color
|
|
332
|
+
// - 1 - Raisable card starting elevation, Switch ball
|
|
333
|
+
// - 2 - Sheet default elevation
|
|
334
|
+
// - 4 - Sticky table header/footer inactive styles
|
|
335
|
+
// - 8 - Raisable card ending elevation, Raisable chip, Menu
|
|
336
|
+
// - 12 - Solid chip background color
|
|
337
|
+
// - 16 - Dialogs, Sheet raised elevation
|
|
338
|
+
//
|
|
339
|
+
// @example Used Colors Only
|
|
340
|
+
// ```scss
|
|
341
|
+
// @use "@react-md/core" with (
|
|
342
|
+
// $dark-elevation-colors: (
|
|
343
|
+
// 0: #121212,
|
|
344
|
+
// 1: #1f1f1f,
|
|
345
|
+
// 2: #242424,
|
|
346
|
+
// 4: #282828,
|
|
347
|
+
// 8: #2f2f2f,
|
|
348
|
+
// 12: #333,
|
|
349
|
+
// 16: #353535,
|
|
350
|
+
// )
|
|
351
|
+
// );
|
|
352
|
+
// ```
|
|
353
|
+
//
|
|
354
|
+
// @type Map
|
|
355
|
+
$dark-elevation-colors: map.merge(
|
|
356
|
+
$default-dark-elevation-colors,
|
|
357
|
+
$custom-dark-elevation-colors
|
|
143
358
|
) !default;
|
|
144
359
|
|
|
360
|
+
// Used to just ensure that the user overrides the `$color-scheme` with a
|
|
361
|
+
// supported value
|
|
362
|
+
// @internal
|
|
145
363
|
$_validated_color_scheme: utils.validate(
|
|
146
364
|
(light dark system),
|
|
147
365
|
$color-scheme,
|
|
148
366
|
"$color-scheme"
|
|
149
367
|
);
|
|
150
368
|
|
|
369
|
+
// The available configurable css variables and mostly used internally for the
|
|
370
|
+
// `get-var`, `set-var`, and `use-var` utils.
|
|
371
|
+
// @type List
|
|
151
372
|
$theme-variables: (
|
|
152
373
|
background-color,
|
|
153
374
|
on-background-color,
|
|
@@ -171,6 +392,9 @@ $theme-variables: (
|
|
|
171
392
|
outline-grey-color
|
|
172
393
|
);
|
|
173
394
|
|
|
395
|
+
// @internal
|
|
396
|
+
// $param {string} name - The variable name
|
|
397
|
+
// @returns {boolean} the feature flag value
|
|
174
398
|
@function _is-var-disabled($name) {
|
|
175
399
|
@if $name == surface-color {
|
|
176
400
|
@return $disable-surface-color;
|
|
@@ -239,6 +463,29 @@ $theme-variables: (
|
|
|
239
463
|
@return false;
|
|
240
464
|
}
|
|
241
465
|
|
|
466
|
+
// @param {number} z-value - The dark elevation value
|
|
467
|
+
// @returns {string} the dark elevation color var name
|
|
468
|
+
@function _dark-elevation-color($z-value) {
|
|
469
|
+
@return "--rmd-dark-elevation-color-#{$z-value}";
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// @param {number} z-value - The dark elevation value
|
|
473
|
+
// @returns {string} the dark elevation color var
|
|
474
|
+
@function get-dark-elevation-color($z-value) {
|
|
475
|
+
@return var(#{_dark-elevation-color($z-value)});
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// @param {number} z-value - The dark elevation value
|
|
479
|
+
// @param {string} value - The value to set
|
|
480
|
+
@mixin set-dark-elevation-color($z-value, $value) {
|
|
481
|
+
@if $value {
|
|
482
|
+
#{_dark-elevation-color($z-value)}: #{$value};
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// @param {string} name - The supported variable name
|
|
487
|
+
// @param {any} fallback - An optional fallback value
|
|
488
|
+
// @returns {string} a `var()` statement
|
|
242
489
|
@function theme-get-var($name, $fallback: null) {
|
|
243
490
|
@if _is-var-disabled($name) {
|
|
244
491
|
@return $fallback;
|
|
@@ -253,21 +500,12 @@ $theme-variables: (
|
|
|
253
500
|
@return var(#{$var});
|
|
254
501
|
}
|
|
255
502
|
|
|
256
|
-
@
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
@function get-dark-elevation-color($z-value) {
|
|
261
|
-
@return var(#{_dark-elevation-color($z-value)});
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
@mixin set-dark-elevation-color($z-value, $value) {
|
|
265
|
-
#{_dark-elevation-color($z-value)}: #{$value};
|
|
266
|
-
}
|
|
267
|
-
|
|
503
|
+
// @param {string} name - The supported variable name
|
|
504
|
+
// @param {any} value-or-theme-name - The value to set the variable to. Supports `null` which
|
|
505
|
+
// will just be a no-op.
|
|
268
506
|
@mixin theme-set-var($name, $value-or-theme-name) {
|
|
269
507
|
@if _is-var-disabled($name) {
|
|
270
|
-
@error '"#{$name}" is currently disabled and cannot be changed. Set "$disable-#{$name}
|
|
508
|
+
@error '"#{$name}" is currently disabled and cannot be changed. Set "$disable-#{$name}" to `false` or remove it from the Sass module overrides.';
|
|
271
509
|
}
|
|
272
510
|
|
|
273
511
|
$var: utils.get-var-name($theme-variables, $name, "theme");
|
|
@@ -280,6 +518,10 @@ $theme-variables: (
|
|
|
280
518
|
#{$var}: #{$value};
|
|
281
519
|
}
|
|
282
520
|
|
|
521
|
+
// @param {string} property - The css property to apply the variable to
|
|
522
|
+
// @param {string} name - The supported variable name
|
|
523
|
+
// @param {any} fallback - An optional fallback value if the variable has not
|
|
524
|
+
// been set
|
|
283
525
|
@mixin theme-use-var($property, $name: $property, $fallback: null) {
|
|
284
526
|
@if _is-var-disabled($name) {
|
|
285
527
|
@error '"#{$name}" is currently disabled and cannot be changed. Set "$disable-#{$name}-var" to `true` or remove it from the Sass module overrides.';
|
|
@@ -288,18 +530,22 @@ $theme-variables: (
|
|
|
288
530
|
#{$property}: theme-get-var($name, $fallback);
|
|
289
531
|
}
|
|
290
532
|
|
|
533
|
+
// This makes it so that the dark elevation colors are not applied when using
|
|
534
|
+
// the light theme.
|
|
291
535
|
@mixin use-light-theme-elevation-colors {
|
|
292
536
|
@each $z-value, $background-color in $dark-elevation-colors {
|
|
293
537
|
@include set-dark-elevation-color($z-value, $light-theme-surface-color);
|
|
294
538
|
}
|
|
295
539
|
}
|
|
296
540
|
|
|
541
|
+
// This applies all the dark elevation colors for the dark theme.
|
|
297
542
|
@mixin use-dark-theme-elevation-colors {
|
|
298
543
|
@each $z-value, $background-color in $dark-elevation-colors {
|
|
299
544
|
@include set-dark-elevation-color($z-value, $background-color);
|
|
300
545
|
}
|
|
301
546
|
}
|
|
302
547
|
|
|
548
|
+
// Creates all the css variables for the light theme respecting feature flags
|
|
303
549
|
@mixin use-light-theme-colors {
|
|
304
550
|
@include theme-set-var(background-color, $light-theme-background-color);
|
|
305
551
|
@if $disable-dark-elevation and not $disable-surface-color {
|
|
@@ -329,6 +575,7 @@ $theme-variables: (
|
|
|
329
575
|
}
|
|
330
576
|
}
|
|
331
577
|
|
|
578
|
+
// Creates all the css variables for the dark theme respecting feature flags
|
|
332
579
|
@mixin use-dark-theme-colors {
|
|
333
580
|
@include theme-set-var(background-color, $dark-theme-background-color);
|
|
334
581
|
@if $disable-dark-elevation and not $disable-surface-color {
|
|
@@ -358,6 +605,7 @@ $theme-variables: (
|
|
|
358
605
|
}
|
|
359
606
|
}
|
|
360
607
|
|
|
608
|
+
// Creates all the default theme css variables respecting feature flags
|
|
361
609
|
@mixin theme-variables {
|
|
362
610
|
@include theme-set-var(background-color, $background-color);
|
|
363
611
|
@if $disable-dark-elevation and not $disable-surface-color {
|
|
@@ -423,6 +671,12 @@ $theme-variables: (
|
|
|
423
671
|
}
|
|
424
672
|
}
|
|
425
673
|
|
|
674
|
+
// Creates a new theme surface by conditionally updating theme background and
|
|
675
|
+
// text colors for the elevation.
|
|
676
|
+
//
|
|
677
|
+
// @param {number} z-value - The material design elevation (0 - 24)
|
|
678
|
+
// @param {boolean} disable-colors - Set to `true` if the `background-color` and
|
|
679
|
+
// `color` should not be updated.
|
|
426
680
|
@mixin create-surface($z-value, $disable-colors: $disable-dark-elevation) {
|
|
427
681
|
@if not $disable-dark-elevation {
|
|
428
682
|
@include theme-set-var(surface-color, get-dark-elevation-color($z-value));
|
|
@@ -436,6 +690,20 @@ $theme-variables: (
|
|
|
436
690
|
}
|
|
437
691
|
}
|
|
438
692
|
|
|
693
|
+
// This is used to get another material design color with a different swatch or
|
|
694
|
+
// accent.
|
|
695
|
+
//
|
|
696
|
+
// @param {string} color - The material design color name
|
|
697
|
+
// @param {number} swatch - This should be: `100`, `200`, `300`, `400`, `500`,
|
|
698
|
+
// `600`, `700`, `800`, or `900`. When `$accent` is set to `true`, it should be:
|
|
699
|
+
// `100`, `200`, `400`, or `700`
|
|
700
|
+
// @param {boolean} accent - Set to `true` to get an accent color instead of a
|
|
701
|
+
// main color.
|
|
702
|
+
// @param {Color|null} fallback-color - A color to use if the `$color` is not a
|
|
703
|
+
// material design color. Mostly for internal usage.
|
|
704
|
+
// @param {string} fallback-name - Used internally to provide a better error
|
|
705
|
+
// message if a `$fallback-color` was not provided.
|
|
706
|
+
// @returns {Color|null} The swatch or fallback color
|
|
439
707
|
@function get-swatch(
|
|
440
708
|
$color,
|
|
441
709
|
$swatch,
|
|
@@ -504,6 +772,9 @@ $theme-variables: (
|
|
|
504
772
|
@return map.get(colors.$color-map, $color-name);
|
|
505
773
|
}
|
|
506
774
|
|
|
775
|
+
// Generates the default `@media (prefers-color-scheme: dark)` styles if the
|
|
776
|
+
// `$disable-default-system-theme` and `$disable-default-root-theme` are both
|
|
777
|
+
// `false` and the `$color-scheme` has been set to `system`.
|
|
507
778
|
@mixin default-system-theme {
|
|
508
779
|
@if not
|
|
509
780
|
$disable-default-system-theme and
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ColorSchemeMode, type ColorScheme } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A type assertion helper to check if a value is a valid {@link ColorScheme}
|
|
4
|
+
* when it is pulled from unknown sources (like local storage).
|
|
5
|
+
*
|
|
6
|
+
* @since 6.0.0
|
|
7
|
+
*/
|
|
8
|
+
export declare function isColorScheme(value: unknown): value is ColorScheme;
|
|
9
|
+
/**
|
|
10
|
+
* A type assertion helper to check if a value is a valid
|
|
11
|
+
* {@link ColorSchemeMode} when it is pulled from unknown sources (like local
|
|
12
|
+
* storage).
|
|
13
|
+
*
|
|
14
|
+
* @since 6.0.0
|
|
15
|
+
*/
|
|
16
|
+
export declare function isColorSchemeMode(value: unknown): value is ColorSchemeMode;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A type assertion helper to check if a value is a valid {@link ColorScheme}
|
|
3
|
+
* when it is pulled from unknown sources (like local storage).
|
|
4
|
+
*
|
|
5
|
+
* @since 6.0.0
|
|
6
|
+
*/ export function isColorScheme(value) {
|
|
7
|
+
return value === "light" || value === "dark";
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A type assertion helper to check if a value is a valid
|
|
11
|
+
* {@link ColorSchemeMode} when it is pulled from unknown sources (like local
|
|
12
|
+
* storage).
|
|
13
|
+
*
|
|
14
|
+
* @since 6.0.0
|
|
15
|
+
*/ export function isColorSchemeMode(value) {
|
|
16
|
+
return isColorScheme(value) || value === "system";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=isColorScheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/theme/isColorScheme.ts"],"sourcesContent":["import { type ColorSchemeMode, type ColorScheme } from \"./types.js\";\n\n/**\n * A type assertion helper to check if a value is a valid {@link ColorScheme}\n * when it is pulled from unknown sources (like local storage).\n *\n * @since 6.0.0\n */\nexport function isColorScheme(value: unknown): value is ColorScheme {\n return value === \"light\" || value === \"dark\";\n}\n\n/**\n * A type assertion helper to check if a value is a valid\n * {@link ColorSchemeMode} when it is pulled from unknown sources (like local\n * storage).\n *\n * @since 6.0.0\n */\nexport function isColorSchemeMode(value: unknown): value is ColorSchemeMode {\n return isColorScheme(value) || value === \"system\";\n}\n"],"names":["isColorScheme","value","isColorSchemeMode"],"mappings":"AAEA;;;;;CAKC,GACD,OAAO,SAASA,cAAcC,KAAc;IAC1C,OAAOA,UAAU,WAAWA,UAAU;AACxC;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,kBAAkBD,KAAc;IAC9C,OAAOD,cAAcC,UAAUA,UAAU;AAC3C"}
|
package/dist/theme/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
import { type UseStateSetter } from "../types.js";
|
|
2
3
|
/**
|
|
3
4
|
* @since 6.0.0
|
|
4
5
|
*/
|
|
@@ -32,3 +33,54 @@ export type DefinedCustomProperty<Property = keyof CSSProperties> = Property ext
|
|
|
32
33
|
* @since 6.0.0
|
|
33
34
|
*/
|
|
34
35
|
export type DefinedCSSVariableName = DefinedCustomProperty;
|
|
36
|
+
/**
|
|
37
|
+
* @since 6.0.0
|
|
38
|
+
*/
|
|
39
|
+
export interface CSSVariable<Name extends CSSVariableName = DefinedCSSVariableName> {
|
|
40
|
+
name: Name;
|
|
41
|
+
value: string | number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @since 6.0.0
|
|
45
|
+
*/
|
|
46
|
+
export type CSSVariablesProperties<Name extends CSSVariableName = DefinedCSSVariableName> = {
|
|
47
|
+
[key in Name]?: string | number;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* @since 6.0.0
|
|
51
|
+
*/
|
|
52
|
+
export type ReadonlyCSSVariableList<Name extends CSSVariableName = DefinedCSSVariableName> = readonly Readonly<CSSVariable<Name>>[];
|
|
53
|
+
/** @since 6.0.0 */
|
|
54
|
+
export type ColorScheme = "light" | "dark";
|
|
55
|
+
/** @since 6.0.0 */
|
|
56
|
+
export type ColorSchemeMode = ColorScheme | "system";
|
|
57
|
+
/**
|
|
58
|
+
* @since 6.0.0
|
|
59
|
+
*/
|
|
60
|
+
export interface ColorSchemeModeBehavior {
|
|
61
|
+
/**
|
|
62
|
+
* The current color scheme mode that is being used by your app that should
|
|
63
|
+
* default to the `$color-scheme` SCSS variable. If the
|
|
64
|
+
* {@link setColorSchemeMode} is called, this will update to that new value.
|
|
65
|
+
*
|
|
66
|
+
* TODO: Figure out how to document this
|
|
67
|
+
*
|
|
68
|
+
* - `colorScheme` - only `light` or `dark` -- only useful when the `colorSchemeMode` is set to `system`
|
|
69
|
+
* - `colorSchemeMode` - current **user** defined color scheme behavior? should default to `$color-scheme`, but will change based on `setColorSchemeMode`
|
|
70
|
+
*/
|
|
71
|
+
colorSchemeMode: ColorSchemeMode;
|
|
72
|
+
/**
|
|
73
|
+
* A function to update the color scheme.
|
|
74
|
+
*
|
|
75
|
+
* @see {@link useColorScheme} for an example usage
|
|
76
|
+
*/
|
|
77
|
+
setColorSchemeMode: UseStateSetter<ColorSchemeMode>;
|
|
78
|
+
}
|
|
79
|
+
/** @since 6.0.0 */
|
|
80
|
+
export interface ColorSchemeContext extends ColorSchemeModeBehavior {
|
|
81
|
+
/**
|
|
82
|
+
* The current color scheme that is being used. This is only useful when the
|
|
83
|
+
* {@link colorSchemeMode} is set to `"system"`.
|
|
84
|
+
*/
|
|
85
|
+
colorScheme: ColorScheme;
|
|
86
|
+
}
|
package/dist/theme/types.js
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a utility type that can be used to auto-complete and type-check css
|
|
3
|
-
* variables that are defined through module augmentation.
|
|
4
|
-
*
|
|
5
|
-
* ```ts
|
|
6
|
-
* declare module "react" {
|
|
7
|
-
* interface CSSProperties {
|
|
8
|
-
* "--custom-property"?: number | string;
|
|
9
|
-
* }
|
|
10
|
-
* }
|
|
11
|
-
*
|
|
12
|
-
* // will no longer throw a type error. also the `--custom-property` will
|
|
13
|
-
* // appear as an auto-complete item
|
|
14
|
-
* const style: CSSProperties = {
|
|
15
|
-
* "--custom-property": "red",
|
|
16
|
-
* };
|
|
17
|
-
*
|
|
18
|
-
* // `DefinedCSSVariableName` will also include `--custom-property` with all
|
|
19
|
-
* // defined react-md custom properties
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @since 6.0.0
|
|
23
|
-
*/ export { };
|
|
1
|
+
/** @since 6.0.0 */ export { };
|
|
24
2
|
|
|
25
3
|
//# sourceMappingURL=types.js.map
|
package/dist/theme/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/theme/types.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"sources":["../../src/theme/types.ts"],"sourcesContent":["import { type CSSProperties } from \"react\";\nimport { type UseStateSetter } from \"../types.js\";\n\n/**\n * @since 6.0.0\n */\nexport type CSSVariableName = `--${string}`;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport type DefinedCustomProperty<Property = keyof CSSProperties> =\n Property extends CSSVariableName ? Property : never;\n\n/**\n * This is a utility type that can be used to auto-complete and type-check css\n * variables that are defined through module augmentation.\n *\n * ```ts\n * declare module \"react\" {\n * interface CSSProperties {\n * \"--custom-property\"?: number | string;\n * }\n * }\n *\n * // will no longer throw a type error. also the `--custom-property` will\n * // appear as an auto-complete item\n * const style: CSSProperties = {\n * \"--custom-property\": \"red\",\n * };\n *\n * // `DefinedCSSVariableName` will also include `--custom-property` with all\n * // defined react-md custom properties\n * ```\n *\n * @since 6.0.0\n */\nexport type DefinedCSSVariableName = DefinedCustomProperty;\n\n/**\n * @since 6.0.0\n */\nexport interface CSSVariable<\n Name extends CSSVariableName = DefinedCSSVariableName,\n> {\n name: Name;\n value: string | number;\n}\n\n/**\n * @since 6.0.0\n */\nexport type CSSVariablesProperties<\n Name extends CSSVariableName = DefinedCSSVariableName,\n> = {\n [key in Name]?: string | number;\n};\n\n/**\n * @since 6.0.0\n */\nexport type ReadonlyCSSVariableList<\n Name extends CSSVariableName = DefinedCSSVariableName,\n> = readonly Readonly<CSSVariable<Name>>[];\n\n/** @since 6.0.0 */\nexport type ColorScheme = \"light\" | \"dark\";\n\n/** @since 6.0.0 */\nexport type ColorSchemeMode = ColorScheme | \"system\";\n\n/**\n * @since 6.0.0\n */\nexport interface ColorSchemeModeBehavior {\n /**\n * The current color scheme mode that is being used by your app that should\n * default to the `$color-scheme` SCSS variable. If the\n * {@link setColorSchemeMode} is called, this will update to that new value.\n *\n * TODO: Figure out how to document this\n *\n * - `colorScheme` - only `light` or `dark` -- only useful when the `colorSchemeMode` is set to `system`\n * - `colorSchemeMode` - current **user** defined color scheme behavior? should default to `$color-scheme`, but will change based on `setColorSchemeMode`\n */\n colorSchemeMode: ColorSchemeMode;\n\n /**\n * A function to update the color scheme.\n *\n * @see {@link useColorScheme} for an example usage\n */\n setColorSchemeMode: UseStateSetter<ColorSchemeMode>;\n}\n\n/** @since 6.0.0 */\nexport interface ColorSchemeContext extends ColorSchemeModeBehavior {\n /**\n * The current color scheme that is being used. This is only useful when the\n * {@link colorSchemeMode} is set to `\"system\"`.\n */\n colorScheme: ColorScheme;\n}\n"],"names":[],"mappings":"AAgGA,iBAAiB,GACjB,WAMC"}
|