@react-md/core 1.0.0-next.16 → 1.0.0-next.18
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 +45 -22
- 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} +11 -176
- package/dist/{form/fileUtils.js → files/validation.js} +10 -135
- 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/SelectedOption.js +2 -1
- package/dist/form/SelectedOption.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 +193 -124
- 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/FontIcon.d.ts +4 -2
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/TextIconSpacing.d.ts +3 -1
- package/dist/icon/TextIconSpacing.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/ResizeObserver.d.ts +11 -12
- package/dist/test-utils/ResizeObserver.js +11 -12
- package/dist/test-utils/ResizeObserver.js.map +1 -1
- package/dist/test-utils/matchMedia.d.ts +3 -3
- package/dist/test-utils/matchMedia.js +6 -6
- 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 +86 -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/useResizeObserver.d.ts +19 -0
- package/dist/useResizeObserver.js +19 -0
- package/dist/useResizeObserver.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 +2 -2
- package/dist/utils/RenderRecursively.js.map +1 -1
- package/dist/utils/alphaNumericSort.d.ts +5 -5
- package/dist/utils/alphaNumericSort.js.map +1 -1
- package/dist/utils/bem.d.ts +1 -1
- package/dist/utils/bem.js +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 +25 -24
- 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} +15 -244
- 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/SelectedOption.tsx +2 -0
- 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/FontIcon.tsx +4 -2
- package/src/icon/TextIconSpacing.tsx +1 -1
- 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/ResizeObserver.ts +11 -12
- package/src/test-utils/matchMedia.ts +7 -7
- 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/useResizeObserver.ts +19 -0
- package/src/useThrottledFunction.ts +6 -9
- package/src/useToggle.ts +3 -3
- package/src/utils/RenderRecursively.tsx +2 -2
- package/src/utils/alphaNumericSort.ts +5 -5
- package/src/utils/bem.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
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cnb } from "cnbuilder";
|
|
3
2
|
import { forwardRef } from "react";
|
|
4
3
|
import { Typography } from "../typography/Typography.js";
|
|
5
|
-
import {
|
|
6
|
-
const styles = bem("rmd-app-bar-title");
|
|
7
|
-
/**
|
|
8
|
-
* Apply the `className`s for a `AppBarTitle` component. This will be type-safe
|
|
9
|
-
* if using typescript.
|
|
10
|
-
*
|
|
11
|
-
* @since 6.0.0
|
|
12
|
-
*/ export function appBarTitle(options = {}) {
|
|
13
|
-
const { className, keyline = "small" } = options;
|
|
14
|
-
return cnb(styles({
|
|
15
|
-
keyline: keyline == "list",
|
|
16
|
-
"nav-keyline": keyline === "nav"
|
|
17
|
-
}), className);
|
|
18
|
-
}
|
|
4
|
+
import { appBarTitle } from "./styles.js";
|
|
19
5
|
/**
|
|
20
6
|
* @example Updating the Keyline
|
|
21
7
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/app-bar/AppBarTitle.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/app-bar/AppBarTitle.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { type TextOverflow } from \"../cssUtils.js\";\nimport { Typography, type TypographyProps } from \"../typography/Typography.js\";\nimport { type TypographyType } from \"../typography/typographyStyles.js\";\nimport { type AppBarTitleClassNameOptions, appBarTitle } from \"./styles.js\";\n\n/**\n * @since 6.0.0 The `keyline` prop was changed from a boolean to a type\n * union of different keylines: {@link AppBarTitleKeyline}\n * @since 6.0.0 The `noWrap` prop was removed in favor of the `textOverflow`\n * prop inherited through the base `Typography` component. The `textOverflow`\n * will default to `\"ellipsis\"` which is new as well.\n */\nexport interface AppBarTitleProps\n extends TypographyProps,\n AppBarTitleClassNameOptions {\n /** @defaultValue `\"headline-6\"` */\n type?: TypographyType;\n\n /**\n * @defaultValue `\"ellipsis\"`\n */\n textOverflow?: TextOverflow;\n}\n\n/**\n * @example Updating the Keyline\n * ```tsx\n * import { AppBar, AppBarTitle } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <AppBar>\n * <AppBarTitle keyline=\"nav\">\n * Offset as if there was a nav button to the left\n * </AppBarTitle>\n * </AppBar>\n * );\n * }\n * ```\n *\n * @since 6.0.0 The `keyline` prop was changed from a boolean to a type\n * union of different keylines: {@link AppBarTitleKeyline}\n * @since 6.0.0 The `noWrap` prop was removed in favor of the `textOverflow`\n * prop inherited through the base `Typography` component. The `textOverflow`\n * will default to `\"ellipsis\"` which is new as well.\n */\nexport const AppBarTitle = forwardRef<HTMLHeadingElement, AppBarTitleProps>(\n function AppBarTitle(props, ref) {\n const {\n type = \"headline-6\",\n keyline = \"small\",\n children,\n className,\n textOverflow = \"ellipsis\",\n ...remaining\n } = props;\n return (\n <Typography\n {...remaining}\n ref={ref}\n type={type}\n className={appBarTitle({\n keyline,\n className,\n })}\n textOverflow={textOverflow}\n >\n {children}\n </Typography>\n );\n }\n);\n"],"names":["forwardRef","Typography","appBarTitle","AppBarTitle","props","ref","type","keyline","children","className","textOverflow","remaining"],"mappings":";AAAA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SAASC,UAAU,QAA8B,8BAA8B;AAE/E,SAA2CC,WAAW,QAAQ,cAAc;AAqB5E;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,MAAMC,4BAAcH,WACzB,SAASG,YAAYC,KAAK,EAAEC,GAAG;IAC7B,MAAM,EACJC,OAAO,YAAY,EACnBC,UAAU,OAAO,EACjBC,QAAQ,EACRC,SAAS,EACTC,eAAe,UAAU,EACzB,GAAGC,WACJ,GAAGP;IACJ,qBACE,KAACH;QACE,GAAGU,SAAS;QACbN,KAAKA;QACLC,MAAMA;QACNG,WAAWP,YAAY;YACrBK;YACAE;QACF;QACAC,cAAcA;kBAEbF;;AAGP,GACA"}
|
|
@@ -9,63 +9,165 @@
|
|
|
9
9
|
@use "../button/button";
|
|
10
10
|
@use "../typography/typography";
|
|
11
11
|
|
|
12
|
+
// Set to `true` to disable all the styles
|
|
13
|
+
// @type boolean
|
|
12
14
|
$disable-everything: false !default;
|
|
15
|
+
|
|
16
|
+
// Set to `true` to only disable the `position: fixed` styles
|
|
17
|
+
// @type boolean
|
|
13
18
|
$disable-fixed: false !default;
|
|
19
|
+
|
|
20
|
+
// Set to `true` to only disable the `position: fixed` styles
|
|
21
|
+
// @type boolean
|
|
14
22
|
$disable-sticky: false !default;
|
|
23
|
+
|
|
24
|
+
// Set to `true` to only disable the `position: fixed` styles
|
|
25
|
+
// @type boolean
|
|
15
26
|
$disable-surface-theme: $disable-everything !default;
|
|
16
|
-
|
|
27
|
+
|
|
28
|
+
// Set to `true` to only disable the dense height styles
|
|
29
|
+
// @type boolean
|
|
30
|
+
$disable-dense: false !default;
|
|
31
|
+
|
|
32
|
+
// Set to `true` to only disable the prominent height styles
|
|
33
|
+
// @type boolean
|
|
17
34
|
$disable-prominent-theme: false !default;
|
|
18
|
-
|
|
35
|
+
|
|
36
|
+
// Set to `true` to only disable the prominent-dense height styles
|
|
37
|
+
// @type boolean
|
|
38
|
+
$disable-prominent-dense: false !default;
|
|
39
|
+
|
|
40
|
+
// Set to `true` to disable the styles that offset the app bar based on a
|
|
41
|
+
// visible scrollbar.
|
|
42
|
+
//
|
|
43
|
+
// @type boolean
|
|
19
44
|
$disable-scrollbar-offset: false !default;
|
|
45
|
+
|
|
46
|
+
// Set to `true` to only disable the styles for offsetting the app bar for a
|
|
47
|
+
// visible toolbar while `position: static`.
|
|
48
|
+
//
|
|
49
|
+
// @type boolean
|
|
20
50
|
$disable-static-scrollbar-offset: false !default;
|
|
21
|
-
$disable-primary-interaction-colors: interaction.$light-surface-base-background-color
|
|
22
|
-
== interaction.$dark-surface-base-background-color !default;
|
|
23
|
-
$disable-secondary-interaction-colors: interaction.$light-surface-base-background-color
|
|
24
|
-
== interaction.$dark-surface-base-background-color !default;
|
|
25
51
|
|
|
52
|
+
// Set to `true` to only disable the app bar title styles
|
|
53
|
+
// @type boolean
|
|
26
54
|
$disable-title: false !default;
|
|
27
55
|
|
|
56
|
+
// Sets the `gap` css property to apply spacing between each item.
|
|
57
|
+
// @type number
|
|
28
58
|
$gap: 0.25rem !default;
|
|
59
|
+
|
|
60
|
+
// The default height for an app bar
|
|
61
|
+
// @type number
|
|
29
62
|
$height: 3.5rem !default;
|
|
63
|
+
|
|
64
|
+
// @type number
|
|
30
65
|
$dense-height: 3rem !default;
|
|
66
|
+
|
|
67
|
+
// @type number
|
|
31
68
|
$prominent-height: $height * 2 !default;
|
|
69
|
+
|
|
70
|
+
// @type number
|
|
32
71
|
$prominent-dense-height: $dense-height * 2 !default;
|
|
33
72
|
|
|
73
|
+
// The z-index to use when the app bar is `position: fixed`
|
|
74
|
+
// @type number
|
|
34
75
|
$fixed-z-index: 10 !default;
|
|
76
|
+
|
|
77
|
+
// This should be a number from 0 to 24 representing the material design
|
|
78
|
+
// elevation. It is used to generate the correct surface styles with box shadow.
|
|
79
|
+
// @type number
|
|
35
80
|
$fixed-elevation: 2 !default;
|
|
81
|
+
|
|
82
|
+
// Allows the app bar to be fixed to the top and bottom of the viewport. If you
|
|
83
|
+
// don't need support for one, remove it from the list.
|
|
84
|
+
//
|
|
85
|
+
// @example Removing Top Fixed Position
|
|
86
|
+
// ```scss
|
|
87
|
+
// @use "react-md/core" with (
|
|
88
|
+
// $app-bar-fixed-positions: (bottom)
|
|
89
|
+
// );
|
|
90
|
+
// ```
|
|
91
|
+
//
|
|
92
|
+
// @type List
|
|
36
93
|
$fixed-positions: top bottom !default;
|
|
37
94
|
|
|
95
|
+
// The background color to use when `theme="surface"` and using the global light
|
|
96
|
+
// theme
|
|
97
|
+
// @type Color
|
|
38
98
|
$light-theme-surface-background-color: theme.$light-theme-surface-color !default;
|
|
99
|
+
|
|
100
|
+
// The text color to use when `theme="surface"` and using the global light theme
|
|
101
|
+
// @type Color
|
|
39
102
|
$light-theme-surface-color: a11y.contrast-color(
|
|
40
103
|
$light-theme-surface-background-color
|
|
41
104
|
) !default;
|
|
105
|
+
|
|
106
|
+
// The background color to use when `theme="surface"` and using the global dark
|
|
107
|
+
// theme
|
|
108
|
+
// @type Color
|
|
42
109
|
$dark-theme-surface-background-color: if(
|
|
43
110
|
theme.$disable-dark-elevation,
|
|
44
111
|
theme.$dark-theme-surface-color,
|
|
45
112
|
map.get(theme.$dark-elevation-colors, $fixed-elevation)
|
|
46
113
|
) !default;
|
|
114
|
+
|
|
115
|
+
// The text color to use when `theme="surface"` and using the global dark theme
|
|
116
|
+
// @type Color
|
|
47
117
|
$dark-theme-surface-color: #fff !default;
|
|
48
118
|
|
|
119
|
+
// The default `theme="surface"` background color. You normally don't want to
|
|
120
|
+
// change this value.
|
|
121
|
+
// @type Color
|
|
49
122
|
$surface-background-color: theme.get-default-color(
|
|
50
123
|
$light-theme-surface-background-color,
|
|
51
124
|
$dark-theme-surface-background-color
|
|
52
125
|
) !default;
|
|
126
|
+
|
|
127
|
+
// The default `theme="surface"` text color. You normally don't want to change
|
|
128
|
+
// this value.
|
|
129
|
+
// @type Color
|
|
53
130
|
$surface-color: theme.get-default-color(
|
|
54
131
|
$light-theme-surface-color,
|
|
55
132
|
$dark-theme-surface-color
|
|
56
133
|
) !default;
|
|
57
134
|
|
|
135
|
+
// Horizontal padding for the app bar
|
|
136
|
+
// @type number|string
|
|
58
137
|
$horizontal-padding: 0.25rem !default;
|
|
138
|
+
|
|
139
|
+
// Vertical padding for the app bar
|
|
140
|
+
// @type number|string
|
|
59
141
|
$vertical-padding: 0 !default;
|
|
60
142
|
|
|
143
|
+
// This value is used to align the first element (normally a button) nicely with
|
|
144
|
+
// other elements on the page.
|
|
145
|
+
//
|
|
146
|
+
// @type number|string
|
|
61
147
|
$keyline: 1rem !default;
|
|
148
|
+
|
|
149
|
+
// This value is used to align the `AppBarTitle` with other elements on the page
|
|
150
|
+
// (like `ListItem`).
|
|
151
|
+
// @type number|string
|
|
62
152
|
$title-keyline: 4.5rem !default;
|
|
153
|
+
|
|
154
|
+
// This is used to align a a nav button with an `AppBarTitle` nicely in the
|
|
155
|
+
// `AppBar`.
|
|
156
|
+
//
|
|
63
157
|
// 3rem is the icon-button's default size. can't use the variables since it's
|
|
64
158
|
// based on font-size now and `em`
|
|
159
|
+
//
|
|
160
|
+
// @type number|string
|
|
65
161
|
$nav-keyline: $title-keyline - $horizontal-padding - $gap - 3rem !default;
|
|
66
162
|
|
|
163
|
+
// The available configurable css variables and mostly used internally for the
|
|
164
|
+
// `get-var`, `set-var`, and `use-var` utils.
|
|
165
|
+
// @type List
|
|
67
166
|
$variables: (height, surface-background-color, surface-color);
|
|
68
167
|
|
|
168
|
+
// @param {string} name - The supported variable name
|
|
169
|
+
// @param {any} fallback - An optional fallback value
|
|
170
|
+
// @returns {string} a `var()` statement
|
|
69
171
|
@function get-var($name, $fallback: null) {
|
|
70
172
|
$var: utils.get-var-name($variables, $name, "app-bar");
|
|
71
173
|
@if $fallback {
|
|
@@ -75,16 +177,24 @@ $variables: (height, surface-background-color, surface-color);
|
|
|
75
177
|
@return var(#{$var});
|
|
76
178
|
}
|
|
77
179
|
|
|
180
|
+
// @param {string} name - The supported variable name
|
|
181
|
+
// @param {any} value - The value to set the variable to. Supports `null` which
|
|
182
|
+
// will just be a no-op.
|
|
78
183
|
@mixin set-var($name, $value) {
|
|
79
184
|
@if $value {
|
|
80
185
|
#{utils.get-var-name($variables, $name, "app-bar")}: #{$value};
|
|
81
186
|
}
|
|
82
187
|
}
|
|
83
188
|
|
|
189
|
+
// @param {string} property - The css property to apply the variable to
|
|
190
|
+
// @param {string} name - The supported variable name
|
|
191
|
+
// @param {any} fallback - An optional fallback value if the variable has not
|
|
192
|
+
// been set
|
|
84
193
|
@mixin use-var($property, $name: $property, $fallback: null) {
|
|
85
194
|
#{$property}: get-var($name, $fallback);
|
|
86
195
|
}
|
|
87
196
|
|
|
197
|
+
// Applies the light the variables based on feature flags
|
|
88
198
|
@mixin use-light-theme {
|
|
89
199
|
@if not $disable-surface-theme {
|
|
90
200
|
@include set-var(
|
|
@@ -95,6 +205,7 @@ $variables: (height, surface-background-color, surface-color);
|
|
|
95
205
|
}
|
|
96
206
|
}
|
|
97
207
|
|
|
208
|
+
// Applies the dark the variables based on feature flags
|
|
98
209
|
@mixin use-dark-theme {
|
|
99
210
|
@if not $disable-surface-theme {
|
|
100
211
|
@include set-var(
|
|
@@ -105,10 +216,14 @@ $variables: (height, surface-background-color, surface-color);
|
|
|
105
216
|
}
|
|
106
217
|
}
|
|
107
218
|
|
|
219
|
+
// Applies the dense height variables
|
|
108
220
|
@mixin dense {
|
|
109
|
-
@
|
|
221
|
+
@if $dense-height {
|
|
222
|
+
@include set-var(height, $dense-height);
|
|
223
|
+
}
|
|
110
224
|
}
|
|
111
225
|
|
|
226
|
+
// Conditionally applies the css variables based on feature flags
|
|
112
227
|
@mixin variables {
|
|
113
228
|
@if not $disable-everything {
|
|
114
229
|
@include set-var(height, $height);
|
|
@@ -117,6 +232,10 @@ $variables: (height, surface-background-color, surface-color);
|
|
|
117
232
|
}
|
|
118
233
|
}
|
|
119
234
|
|
|
235
|
+
// Generates all the styles based on feature flags.
|
|
236
|
+
//
|
|
237
|
+
// @param {boolean} disable-layer - Set this to `true` to disable the
|
|
238
|
+
// layer behavior
|
|
120
239
|
@mixin styles($disable-layer: false) {
|
|
121
240
|
@if not $disable-everything {
|
|
122
241
|
@include utils.optional-layer(app-bar, $disable-layer) {
|
|
@@ -125,9 +244,9 @@ $variables: (height, surface-background-color, surface-color);
|
|
|
125
244
|
}
|
|
126
245
|
|
|
127
246
|
.rmd-app-bar {
|
|
128
|
-
@include use-var(height);
|
|
129
247
|
@include box.set-var(gap, $gap);
|
|
130
248
|
@include box.set-var(padding, $vertical-padding $horizontal-padding);
|
|
249
|
+
@include use-var(height);
|
|
131
250
|
|
|
132
251
|
// since app bars can appear a lot in full page dialogs, setting these flex
|
|
133
252
|
// values allows it be be a direct replacement of the `DialogHeader`
|
|
@@ -179,21 +298,21 @@ $variables: (height, surface-background-color, surface-color);
|
|
|
179
298
|
padding: 0;
|
|
180
299
|
}
|
|
181
300
|
|
|
182
|
-
@if not $disable-dense
|
|
301
|
+
@if not $disable-dense {
|
|
183
302
|
&--dense {
|
|
184
|
-
|
|
303
|
+
height: $dense-height;
|
|
185
304
|
}
|
|
186
305
|
}
|
|
187
306
|
|
|
188
307
|
@if not $disable-prominent-theme {
|
|
189
308
|
&--prominent {
|
|
190
|
-
|
|
309
|
+
height: $prominent-height;
|
|
191
310
|
}
|
|
192
311
|
}
|
|
193
312
|
|
|
194
|
-
@if not $disable-prominent-dense
|
|
313
|
+
@if not $disable-prominent-dense {
|
|
195
314
|
&--prominent-dense {
|
|
196
|
-
|
|
315
|
+
height: $prominent-dense-height;
|
|
197
316
|
}
|
|
198
317
|
}
|
|
199
318
|
|
|
@@ -206,13 +325,13 @@ $variables: (height, surface-background-color, surface-color);
|
|
|
206
325
|
|
|
207
326
|
@if not $disable-scrollbar-offset {
|
|
208
327
|
&--scrollbar-offset {
|
|
209
|
-
@include utils.rtl {
|
|
210
|
-
margin-right: calc(-1 * #{utils.scrollbar-size()});
|
|
211
|
-
}
|
|
212
|
-
|
|
213
328
|
padding-right: calc(
|
|
214
329
|
#{$horizontal-padding} + #{utils.scrollbar-size()}
|
|
215
330
|
);
|
|
331
|
+
|
|
332
|
+
@include utils.rtl {
|
|
333
|
+
margin-right: calc(-1 * #{utils.scrollbar-size()});
|
|
334
|
+
}
|
|
216
335
|
}
|
|
217
336
|
|
|
218
337
|
@if not $disable-static-scrollbar-offset {
|
|
@@ -225,21 +344,33 @@ $variables: (height, surface-background-color, surface-color);
|
|
|
225
344
|
|
|
226
345
|
@if not $disable-title {
|
|
227
346
|
.rmd-app-bar-title {
|
|
228
|
-
|
|
347
|
+
$title-h-margin: $keyline - $horizontal-padding;
|
|
348
|
+
$title-keyline-h-margin: $title-keyline - $horizontal-padding;
|
|
229
349
|
|
|
230
350
|
flex: 1 1 auto;
|
|
231
|
-
margin
|
|
232
|
-
margin-top: 0;
|
|
351
|
+
margin: 0 auto 0 $title-h-margin;
|
|
233
352
|
|
|
234
353
|
&--keyline {
|
|
235
|
-
|
|
236
|
-
margin-left,
|
|
237
|
-
$title-keyline - $horizontal-padding
|
|
238
|
-
);
|
|
354
|
+
margin-left: $title-keyline-h-margin;
|
|
239
355
|
}
|
|
240
356
|
|
|
241
357
|
&--nav-keyline {
|
|
242
|
-
|
|
358
|
+
margin-left: $nav-keyline;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
@include utils.rtl {
|
|
362
|
+
margin-left: 0;
|
|
363
|
+
margin-right: $title-h-margin;
|
|
364
|
+
|
|
365
|
+
&--keyline {
|
|
366
|
+
margin-left: 0;
|
|
367
|
+
margin-right: $title-keyline-h-margin;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
&--nav-keyline {
|
|
371
|
+
margin-left: 0;
|
|
372
|
+
margin-right: $nav-keyline;
|
|
373
|
+
}
|
|
243
374
|
}
|
|
244
375
|
}
|
|
245
376
|
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { type BoxOptions } from "../box/styles.js";
|
|
2
|
+
import { type BackgroundColor } from "../cssUtils.js";
|
|
3
|
+
import { type CssPosition } from "../types.js";
|
|
4
|
+
declare module "react" {
|
|
5
|
+
interface CSSProperties {
|
|
6
|
+
"--rmd-app-bar-height"?: string | number;
|
|
7
|
+
"--rmd-app-bar-background-color"?: string;
|
|
8
|
+
"--rmd-app-bar-color"?: string;
|
|
9
|
+
"--rmd-app-bar-surface-background-color"?: string;
|
|
10
|
+
"--rmd-app-bar-surface-color"?: string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export type AppBarPosition = "top" | "bottom";
|
|
14
|
+
/**
|
|
15
|
+
* - `"clear"` - the background color will be transparent
|
|
16
|
+
* - `"primary"` - defaults to the current primary theme color
|
|
17
|
+
* - `"secondary"` - defaults to the current secondary theme color
|
|
18
|
+
* - `"surface"` - this will use the current surface background color which
|
|
19
|
+
* defaults to `#fff` for light themes, `#242424` for dark themes, and
|
|
20
|
+
* `#424242` for dark themes when the `$disable-dark-elevation` is set to
|
|
21
|
+
* `true`
|
|
22
|
+
*
|
|
23
|
+
* The default dark theme surface color also depends on the `$fixed-elevation`
|
|
24
|
+
* value.
|
|
25
|
+
*/
|
|
26
|
+
export type AppBarTheme = BackgroundColor | "clear";
|
|
27
|
+
/**
|
|
28
|
+
* - `"auto"` - the height will be determined by the height of the content
|
|
29
|
+
* - `"normal"` - defaults to `3.5rem` (`$height`)
|
|
30
|
+
* - `"prominent"` - defaults to `7rem` (`$prominent-height`)
|
|
31
|
+
* - `"dense"` - defaults to `3rem` (`$dense-height`)
|
|
32
|
+
* - `"prominent-dense"` - defaults to `6rem` (`$prominent-dense-height`)
|
|
33
|
+
*/
|
|
34
|
+
export type AppBarHeight = "auto" | "normal" | "prominent" | "dense" | "prominent-dense";
|
|
35
|
+
/** @since 6.0.0 */
|
|
36
|
+
export interface AppBarClassNameOptions extends Omit<BoxOptions, "fullWidth"> {
|
|
37
|
+
className?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Set this to `"fixed"` or `"sticky"` to set `position: fixed;` or
|
|
40
|
+
* `position: sticky;` to the app bar. The default position will be static and
|
|
41
|
+
* inline with other content.
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue `'static'`
|
|
44
|
+
*/
|
|
45
|
+
position?: CssPosition;
|
|
46
|
+
/**
|
|
47
|
+
* The position within the page to "fix" the `AppBar` when the `fixed` prop is
|
|
48
|
+
* enabled.
|
|
49
|
+
*
|
|
50
|
+
* @defaultValue `"top"`
|
|
51
|
+
*/
|
|
52
|
+
pagePosition?: AppBarPosition;
|
|
53
|
+
/**
|
|
54
|
+
* Set this to `true` to remove the box-shadow.
|
|
55
|
+
*
|
|
56
|
+
* @defaultValue `false`
|
|
57
|
+
*/
|
|
58
|
+
disableElevation?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The theme to apply to the `AppBar`.
|
|
61
|
+
*
|
|
62
|
+
* @defaultValue `"primary"`
|
|
63
|
+
* @see {@link AppBarTheme}
|
|
64
|
+
*/
|
|
65
|
+
theme?: AppBarTheme;
|
|
66
|
+
/**
|
|
67
|
+
* @defaultValue `stacked ? "auto" : "normal"`
|
|
68
|
+
* @see {@link AppBarHeight}
|
|
69
|
+
*/
|
|
70
|
+
height?: AppBarHeight;
|
|
71
|
+
/** @see {@link CssUtilsOptions.surfaceColor} */
|
|
72
|
+
surfaceColor?: "light" | "dark";
|
|
73
|
+
/**
|
|
74
|
+
* Set this to `true` if the app bar's positioning and width should be
|
|
75
|
+
* changed whenever the scrollbar is visible on the page. This defaults to
|
|
76
|
+
* `true` when the {@link position} prop is `true` so that once dialogs and menus
|
|
77
|
+
* become visible the contents in the app bar do not need to be repainted.
|
|
78
|
+
*
|
|
79
|
+
* @since 6.0.0
|
|
80
|
+
* @defaultValue `position === "fixed"`
|
|
81
|
+
*/
|
|
82
|
+
scrollbarOffset?: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Apply the `className`s for a tree component. This will be type-safe if using
|
|
86
|
+
* typescript.
|
|
87
|
+
*
|
|
88
|
+
* @since 6.0.0
|
|
89
|
+
*/
|
|
90
|
+
export declare function appBar(options?: AppBarClassNameOptions): string;
|
|
91
|
+
/**
|
|
92
|
+
* - `"small"` - the first character in the title will be `1rem` (`$keyline`)
|
|
93
|
+
* from the edge of the app bar horizontally
|
|
94
|
+
* - `"nav"` - this should be set when there is a nav button before the title so
|
|
95
|
+
* that the first character in the title will be `4.5rem` (`title-keyline`)
|
|
96
|
+
* - `"list"` - this should be used when the title should align with the list
|
|
97
|
+
* item keyline and there is no nav icon before.
|
|
98
|
+
*
|
|
99
|
+
* @since 6.0.0
|
|
100
|
+
*/
|
|
101
|
+
export type AppBarTitleKeyline = "small" | "nav" | "list";
|
|
102
|
+
/** @since 6.0.0 */
|
|
103
|
+
export interface AppBarTitleClassNameOptions {
|
|
104
|
+
className?: string;
|
|
105
|
+
/**
|
|
106
|
+
* @defaultValue `"small"`
|
|
107
|
+
* @see {@link AppBarTitleKeyline}
|
|
108
|
+
*/
|
|
109
|
+
keyline?: AppBarTitleKeyline;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Apply the `className`s for a `AppBarTitle` component. This will be type-safe
|
|
113
|
+
* if using typescript.
|
|
114
|
+
*
|
|
115
|
+
* @since 6.0.0
|
|
116
|
+
*/
|
|
117
|
+
export declare function appBarTitle(options?: AppBarTitleClassNameOptions): string;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { cnb } from "cnbuilder";
|
|
2
|
+
import { box } from "../box/styles.js";
|
|
3
|
+
import { cssUtils } from "../cssUtils.js";
|
|
4
|
+
import { bem } from "../utils/bem.js";
|
|
5
|
+
const styles = bem("rmd-app-bar");
|
|
6
|
+
const titleStyles = bem("rmd-app-bar-title");
|
|
7
|
+
/**
|
|
8
|
+
* Apply the `className`s for a tree component. This will be type-safe if using
|
|
9
|
+
* typescript.
|
|
10
|
+
*
|
|
11
|
+
* @since 6.0.0
|
|
12
|
+
*/ export function appBar(options = {}) {
|
|
13
|
+
const { className, theme = "primary", stacked, height = stacked ? "auto" : "normal", position = "static", pagePosition = "top", scrollbarOffset = position === "fixed", align, grid, gridColumns, gridName, justify, reversed, surfaceColor, disableWrap = true, disablePadding, disableElevation } = options;
|
|
14
|
+
const surface = theme === "surface";
|
|
15
|
+
const clear = theme === "clear";
|
|
16
|
+
return cnb(styles({
|
|
17
|
+
surface,
|
|
18
|
+
[height]: height !== "normal",
|
|
19
|
+
fixed: position !== "static",
|
|
20
|
+
stacked,
|
|
21
|
+
sticky: position === "sticky",
|
|
22
|
+
[pagePosition]: position !== "static",
|
|
23
|
+
elevated: position !== "static" && !disableElevation,
|
|
24
|
+
"scrollbar-offset": scrollbarOffset,
|
|
25
|
+
"static-scrollbar-offset": position === "static" && scrollbarOffset
|
|
26
|
+
}), box({
|
|
27
|
+
align,
|
|
28
|
+
stacked,
|
|
29
|
+
fullWidth: true,
|
|
30
|
+
grid,
|
|
31
|
+
gridColumns,
|
|
32
|
+
gridName,
|
|
33
|
+
justify,
|
|
34
|
+
reversed,
|
|
35
|
+
disableWrap,
|
|
36
|
+
disablePadding
|
|
37
|
+
}), cssUtils({
|
|
38
|
+
backgroundColor: !surface && !clear ? theme : undefined,
|
|
39
|
+
surfaceColor
|
|
40
|
+
}), className);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Apply the `className`s for a `AppBarTitle` component. This will be type-safe
|
|
44
|
+
* if using typescript.
|
|
45
|
+
*
|
|
46
|
+
* @since 6.0.0
|
|
47
|
+
*/ export function appBarTitle(options = {}) {
|
|
48
|
+
const { className, keyline = "small" } = options;
|
|
49
|
+
return cnb(titleStyles({
|
|
50
|
+
keyline: keyline == "list",
|
|
51
|
+
"nav-keyline": keyline === "nav"
|
|
52
|
+
}), className);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/app-bar/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type BoxOptions, box } from \"../box/styles.js\";\nimport { type BackgroundColor, cssUtils } from \"../cssUtils.js\";\nimport { type CssPosition } from \"../types.js\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-app-bar-height\"?: string | number;\n \"--rmd-app-bar-background-color\"?: string;\n \"--rmd-app-bar-color\"?: string;\n \"--rmd-app-bar-surface-background-color\"?: string;\n \"--rmd-app-bar-surface-color\"?: string;\n }\n}\n\nconst styles = bem(\"rmd-app-bar\");\nconst titleStyles = bem(\"rmd-app-bar-title\");\n\nexport type AppBarPosition = \"top\" | \"bottom\";\n\n/**\n * - `\"clear\"` - the background color will be transparent\n * - `\"primary\"` - defaults to the current primary theme color\n * - `\"secondary\"` - defaults to the current secondary theme color\n * - `\"surface\"` - this will use the current surface background color which\n * defaults to `#fff` for light themes, `#242424` for dark themes, and\n * `#424242` for dark themes when the `$disable-dark-elevation` is set to\n * `true`\n *\n * The default dark theme surface color also depends on the `$fixed-elevation`\n * value.\n */\nexport type AppBarTheme = BackgroundColor | \"clear\";\n\n/**\n * - `\"auto\"` - the height will be determined by the height of the content\n * - `\"normal\"` - defaults to `3.5rem` (`$height`)\n * - `\"prominent\"` - defaults to `7rem` (`$prominent-height`)\n * - `\"dense\"` - defaults to `3rem` (`$dense-height`)\n * - `\"prominent-dense\"` - defaults to `6rem` (`$prominent-dense-height`)\n */\nexport type AppBarHeight =\n | \"auto\"\n | \"normal\"\n | \"prominent\"\n | \"dense\"\n | \"prominent-dense\";\n\n/** @since 6.0.0 */\nexport interface AppBarClassNameOptions extends Omit<BoxOptions, \"fullWidth\"> {\n className?: string;\n\n /**\n * Set this to `\"fixed\"` or `\"sticky\"` to set `position: fixed;` or\n * `position: sticky;` to the app bar. The default position will be static and\n * inline with other content.\n *\n * @defaultValue `'static'`\n */\n position?: CssPosition;\n\n /**\n * The position within the page to \"fix\" the `AppBar` when the `fixed` prop is\n * enabled.\n *\n * @defaultValue `\"top\"`\n */\n pagePosition?: AppBarPosition;\n\n /**\n * Set this to `true` to remove the box-shadow.\n *\n * @defaultValue `false`\n */\n disableElevation?: boolean;\n\n /**\n * The theme to apply to the `AppBar`.\n *\n * @defaultValue `\"primary\"`\n * @see {@link AppBarTheme}\n */\n theme?: AppBarTheme;\n\n /**\n * @defaultValue `stacked ? \"auto\" : \"normal\"`\n * @see {@link AppBarHeight}\n */\n height?: AppBarHeight;\n\n /** @see {@link CssUtilsOptions.surfaceColor} */\n surfaceColor?: \"light\" | \"dark\";\n\n /**\n * Set this to `true` if the app bar's positioning and width should be\n * changed whenever the scrollbar is visible on the page. This defaults to\n * `true` when the {@link position} prop is `true` so that once dialogs and menus\n * become visible the contents in the app bar do not need to be repainted.\n *\n * @since 6.0.0\n * @defaultValue `position === \"fixed\"`\n */\n scrollbarOffset?: boolean;\n}\n\n/**\n * Apply the `className`s for a tree component. This will be type-safe if using\n * typescript.\n *\n * @since 6.0.0\n */\nexport function appBar(options: AppBarClassNameOptions = {}): string {\n const {\n className,\n theme = \"primary\",\n stacked,\n height = stacked ? \"auto\" : \"normal\",\n position = \"static\",\n pagePosition = \"top\",\n scrollbarOffset = position === \"fixed\",\n align,\n grid,\n gridColumns,\n gridName,\n justify,\n reversed,\n surfaceColor,\n disableWrap = true,\n disablePadding,\n disableElevation,\n } = options;\n const surface = theme === \"surface\";\n const clear = theme === \"clear\";\n\n return cnb(\n styles({\n surface,\n [height]: height !== \"normal\",\n fixed: position !== \"static\",\n stacked,\n sticky: position === \"sticky\",\n [pagePosition]: position !== \"static\",\n elevated: position !== \"static\" && !disableElevation,\n \"scrollbar-offset\": scrollbarOffset,\n \"static-scrollbar-offset\": position === \"static\" && scrollbarOffset,\n }),\n box({\n align,\n stacked,\n fullWidth: true,\n grid,\n gridColumns,\n gridName,\n justify,\n reversed,\n disableWrap,\n disablePadding,\n }),\n cssUtils({\n backgroundColor: !surface && !clear ? theme : undefined,\n surfaceColor,\n }),\n className\n );\n}\n\n/**\n * - `\"small\"` - the first character in the title will be `1rem` (`$keyline`)\n * from the edge of the app bar horizontally\n * - `\"nav\"` - this should be set when there is a nav button before the title so\n * that the first character in the title will be `4.5rem` (`title-keyline`)\n * - `\"list\"` - this should be used when the title should align with the list\n * item keyline and there is no nav icon before.\n *\n * @since 6.0.0\n */\nexport type AppBarTitleKeyline = \"small\" | \"nav\" | \"list\";\n\n/** @since 6.0.0 */\nexport interface AppBarTitleClassNameOptions {\n className?: string;\n\n /**\n * @defaultValue `\"small\"`\n * @see {@link AppBarTitleKeyline}\n */\n keyline?: AppBarTitleKeyline;\n}\n\n/**\n * Apply the `className`s for a `AppBarTitle` component. This will be type-safe\n * if using typescript.\n *\n * @since 6.0.0\n */\nexport function appBarTitle(options: AppBarTitleClassNameOptions = {}): string {\n const { className, keyline = \"small\" } = options;\n return cnb(\n titleStyles({\n keyline: keyline == \"list\",\n \"nav-keyline\": keyline === \"nav\",\n }),\n className\n );\n}\n"],"names":["cnb","box","cssUtils","bem","styles","titleStyles","appBar","options","className","theme","stacked","height","position","pagePosition","scrollbarOffset","align","grid","gridColumns","gridName","justify","reversed","surfaceColor","disableWrap","disablePadding","disableElevation","surface","clear","fixed","sticky","elevated","fullWidth","backgroundColor","undefined","appBarTitle","keyline"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAA0BC,GAAG,QAAQ,mBAAmB;AACxD,SAA+BC,QAAQ,QAAQ,iBAAiB;AAEhE,SAASC,GAAG,QAAQ,kBAAkB;AAYtC,MAAMC,SAASD,IAAI;AACnB,MAAME,cAAcF,IAAI;AAyFxB;;;;;CAKC,GACD,OAAO,SAASG,OAAOC,UAAkC,CAAC,CAAC;IACzD,MAAM,EACJC,SAAS,EACTC,QAAQ,SAAS,EACjBC,OAAO,EACPC,SAASD,UAAU,SAAS,QAAQ,EACpCE,WAAW,QAAQ,EACnBC,eAAe,KAAK,EACpBC,kBAAkBF,aAAa,OAAO,EACtCG,KAAK,EACLC,IAAI,EACJC,WAAW,EACXC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,YAAY,EACZC,cAAc,IAAI,EAClBC,cAAc,EACdC,gBAAgB,EACjB,GAAGjB;IACJ,MAAMkB,UAAUhB,UAAU;IAC1B,MAAMiB,QAAQjB,UAAU;IAExB,OAAOT,IACLI,OAAO;QACLqB;QACA,CAACd,OAAO,EAAEA,WAAW;QACrBgB,OAAOf,aAAa;QACpBF;QACAkB,QAAQhB,aAAa;QACrB,CAACC,aAAa,EAAED,aAAa;QAC7BiB,UAAUjB,aAAa,YAAY,CAACY;QACpC,oBAAoBV;QACpB,2BAA2BF,aAAa,YAAYE;IACtD,IACAb,IAAI;QACFc;QACAL;QACAoB,WAAW;QACXd;QACAC;QACAC;QACAC;QACAC;QACAE;QACAC;IACF,IACArB,SAAS;QACP6B,iBAAiB,CAACN,WAAW,CAACC,QAAQjB,QAAQuB;QAC9CX;IACF,IACAb;AAEJ;AAyBA;;;;;CAKC,GACD,OAAO,SAASyB,YAAY1B,UAAuC,CAAC,CAAC;IACnE,MAAM,EAAEC,SAAS,EAAE0B,UAAU,OAAO,EAAE,GAAG3B;IACzC,OAAOP,IACLK,YAAY;QACV6B,SAASA,WAAW;QACpB,eAAeA,YAAY;IAC7B,IACA1B;AAEJ"}
|
|
@@ -1,85 +1,14 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
3
|
-
import { type ConfigurableComboboxMenuProps } from "../form/useCombobox.js";
|
|
4
|
-
import { type KeyboardMovementFocusChangeEventHandler } from "../movement/types.js";
|
|
5
|
-
import { type PropsWithRef, type TextExtractor } from "../types.js";
|
|
6
|
-
import { type AutocompleteCircularProgressProps } from "./AutocompleteCircularProgress.js";
|
|
7
|
-
import { type ConfigurableAutocompleteDropdownButtonProps } from "./AutocompleteDropdownButton.js";
|
|
8
|
-
import { type AutocompleteMenuLabel, type AutocompleteOptionsProps } from "./types.js";
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import { type AutocompleteMultiSelectProps, type AutocompleteOption, type AutocompleteSingleSelectProps } from "./types.js";
|
|
9
3
|
/**
|
|
4
|
+
* This is the single select autocomplete implementation.
|
|
5
|
+
*
|
|
10
6
|
* @since 6.0.0
|
|
11
7
|
*/
|
|
12
|
-
export
|
|
13
|
-
/** @defaultValue `"list"` */
|
|
14
|
-
"aria-autocomplete"?: AriaAttributes["aria-autocomplete"];
|
|
15
|
-
inputRef?: Ref<HTMLInputElement>;
|
|
16
|
-
value?: string;
|
|
17
|
-
defaultValue?: string;
|
|
18
|
-
/**
|
|
19
|
-
* An `aria-label` to pass to the `Menu` component that describes the list of
|
|
20
|
-
* {@link options}. Either this or the {@link menuLabelledBy} are required for
|
|
21
|
-
* accessibility.
|
|
22
|
-
*/
|
|
23
|
-
menuLabel?: string;
|
|
24
|
-
/**
|
|
25
|
-
* An `aria-labelledby` to pass to the `Menu` component that describes the
|
|
26
|
-
* list of {@link options}. Either this or the {@link menuLabel} are required
|
|
27
|
-
* for accessibility.
|
|
28
|
-
*/
|
|
29
|
-
menuLabelledBy?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Any additional props that should be passed to the `Menu` component.
|
|
32
|
-
*/
|
|
33
|
-
menuProps?: PropsWithRef<ConfigurableComboboxMenuProps & {
|
|
34
|
-
id?: string;
|
|
35
|
-
}, HTMLDivElement>;
|
|
36
|
-
/**
|
|
37
|
-
* This prop should only be used when `aria-autocomplete` is set to
|
|
38
|
-
* `"inline"` or `"both"`.
|
|
39
|
-
*/
|
|
40
|
-
onFocusChange?: KeyboardMovementFocusChangeEventHandler;
|
|
41
|
-
/**
|
|
42
|
-
* This can be used to add any custom styling, change the icon, change the
|
|
43
|
-
* label, etc for the dropdown button.
|
|
44
|
-
*
|
|
45
|
-
* @example Simple Example
|
|
46
|
-
* ```tsx
|
|
47
|
-
* dropdownButtonProps={{
|
|
48
|
-
* "aria-label": "Open",
|
|
49
|
-
* className: styles.dropdownButton,
|
|
50
|
-
* icon: <MyCustomDropdownIcon />,
|
|
51
|
-
* }}
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
dropdownButtonProps?: ConfigurableAutocompleteDropdownButtonProps;
|
|
55
|
-
/**
|
|
56
|
-
* Set this to `true` to remove the {@link DropdownButton} from being rendered
|
|
57
|
-
* after the input element.
|
|
58
|
-
*
|
|
59
|
-
* @defaultValue `false`
|
|
60
|
-
*/
|
|
61
|
-
disableDropdownButton?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Set this to `true` to disable a `<CircularProgress />` after the input and
|
|
64
|
-
* before the `<DropdownButton />`.
|
|
65
|
-
*
|
|
66
|
-
* @defaultValue `false`
|
|
67
|
-
*/
|
|
68
|
-
loading?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* @defaultValue `{ "aria-label": "Loading", ...loadingProps }`
|
|
71
|
-
*/
|
|
72
|
-
loadingProps?: AutocompleteCircularProgressProps;
|
|
73
|
-
}
|
|
8
|
+
export declare function Autocomplete<Option extends AutocompleteOption>(props: AutocompleteSingleSelectProps<Option>): ReactElement;
|
|
74
9
|
/**
|
|
10
|
+
* This is the multiselect autocomplete implementation.
|
|
11
|
+
*
|
|
75
12
|
* @since 6.0.0
|
|
76
13
|
*/
|
|
77
|
-
export declare function Autocomplete<
|
|
78
|
-
label: string;
|
|
79
|
-
}>(props: AutocompleteMenuLabel<Omit<AutocompleteProps<T>, "extractor">>): ReactElement;
|
|
80
|
-
/**
|
|
81
|
-
* @since 6.0.0
|
|
82
|
-
*/
|
|
83
|
-
export declare function Autocomplete<T>(props: AutocompleteMenuLabel<AutocompleteProps<T> & {
|
|
84
|
-
extractor: TextExtractor<T>;
|
|
85
|
-
}>): ReactElement;
|
|
14
|
+
export declare function Autocomplete<Option extends AutocompleteOption>(props: AutocompleteMultiSelectProps<Option>): ReactElement;
|