@react-md/core 1.0.0-next.14 → 1.0.0-next.16
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/CoreProviders.js.map +1 -1
- package/dist/NoSsr.js.map +1 -1
- package/dist/RootHtml.d.ts +0 -2
- package/dist/RootHtml.js +0 -2
- package/dist/RootHtml.js.map +1 -1
- package/dist/SsrProvider.js.map +1 -1
- package/dist/app-bar/AppBar.d.ts +0 -2
- package/dist/app-bar/AppBar.js +0 -2
- package/dist/app-bar/AppBar.js.map +1 -1
- package/dist/app-bar/AppBarTitle.d.ts +8 -7
- package/dist/app-bar/AppBarTitle.js +3 -4
- package/dist/app-bar/AppBarTitle.js.map +1 -1
- package/dist/autocomplete/Autocomplete.js.map +1 -1
- package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -1
- package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -1
- package/dist/autocomplete/FilterAutocompleteOptions.js.map +1 -1
- package/dist/autocomplete/autocompleteStyles.js.map +1 -1
- package/dist/autocomplete/defaults.d.ts +2 -2
- package/dist/autocomplete/defaults.js +3 -3
- package/dist/autocomplete/defaults.js.map +1 -1
- package/dist/autocomplete/types.js.map +1 -1
- package/dist/avatar/Avatar.d.ts +1 -4
- package/dist/avatar/Avatar.js +1 -4
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/avatar/styles.js.map +1 -1
- package/dist/badge/Badge.d.ts +1 -3
- package/dist/badge/Badge.js +0 -2
- package/dist/badge/Badge.js.map +1 -1
- package/dist/box/Box.d.ts +0 -2
- package/dist/box/Box.js +0 -2
- package/dist/box/Box.js.map +1 -1
- package/dist/box/styles.js.map +1 -1
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/button/Button.js.map +1 -1
- package/dist/button/ButtonUnstyled.d.ts +0 -2
- package/dist/button/ButtonUnstyled.js +0 -2
- package/dist/button/ButtonUnstyled.js.map +1 -1
- package/dist/button/FloatingActionButton.js.map +1 -1
- package/dist/button/TooltippedButton.js.map +1 -1
- package/dist/button/buttonStyles.js.map +1 -1
- package/dist/button/buttonUnstyledStyles.js.map +1 -1
- package/dist/card/Card.d.ts +2 -3
- package/dist/card/Card.js +0 -2
- package/dist/card/Card.js.map +1 -1
- package/dist/card/CardContent.d.ts +0 -2
- package/dist/card/CardContent.js +0 -2
- package/dist/card/CardContent.js.map +1 -1
- package/dist/card/CardFooter.d.ts +0 -3
- package/dist/card/CardFooter.js +0 -2
- package/dist/card/CardFooter.js.map +1 -1
- package/dist/card/CardHeader.d.ts +0 -2
- package/dist/card/CardHeader.js +0 -2
- package/dist/card/CardHeader.js.map +1 -1
- package/dist/card/CardSubtitle.d.ts +6 -3
- package/dist/card/CardSubtitle.js +2 -3
- package/dist/card/CardSubtitle.js.map +1 -1
- package/dist/card/CardTitle.d.ts +0 -3
- package/dist/card/CardTitle.js +0 -2
- package/dist/card/CardTitle.js.map +1 -1
- package/dist/card/ClickableCard.js.map +1 -1
- package/dist/card/styles.js +2 -4
- package/dist/card/styles.js.map +1 -1
- package/dist/chip/Chip.d.ts +0 -2
- package/dist/chip/Chip.js +0 -2
- package/dist/chip/Chip.js.map +1 -1
- package/dist/chip/styles.js.map +1 -1
- package/dist/cssUtils.d.ts +1 -1
- package/dist/cssUtils.js.map +1 -1
- package/dist/delegateEvent.js.map +1 -1
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/DialogContainer.d.ts +0 -2
- package/dist/dialog/DialogContainer.js +0 -2
- package/dist/dialog/DialogContainer.js.map +1 -1
- package/dist/dialog/DialogContent.d.ts +3 -3
- package/dist/dialog/DialogContent.js +3 -3
- package/dist/dialog/DialogContent.js.map +1 -1
- package/dist/dialog/DialogFooter.d.ts +2 -3
- package/dist/dialog/DialogFooter.js +2 -3
- package/dist/dialog/DialogFooter.js.map +1 -1
- package/dist/dialog/DialogHeader.d.ts +3 -3
- package/dist/dialog/DialogHeader.js +3 -3
- package/dist/dialog/DialogHeader.js.map +1 -1
- package/dist/dialog/DialogTitle.d.ts +3 -4
- package/dist/dialog/DialogTitle.js +3 -3
- package/dist/dialog/DialogTitle.js.map +1 -1
- package/dist/dialog/FixedDialog.js.map +1 -1
- package/dist/dialog/NestedDialogProvider.d.ts +0 -1
- package/dist/dialog/NestedDialogProvider.js.map +1 -1
- package/dist/dialog/styles.js.map +1 -1
- package/dist/divider/Divider.d.ts +0 -2
- package/dist/divider/Divider.js +0 -2
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/styles.js.map +1 -1
- package/dist/draggable/useDraggable.js.map +1 -1
- package/dist/draggable/utils.js.map +1 -1
- package/dist/expansion-panel/ExpansionList.d.ts +1 -1
- package/dist/expansion-panel/ExpansionList.js +1 -1
- package/dist/expansion-panel/ExpansionList.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanel.d.ts +8 -24
- package/dist/expansion-panel/ExpansionPanel.js +1 -12
- package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanelHeader.d.ts +0 -1
- package/dist/expansion-panel/ExpansionPanelHeader.js +0 -1
- package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
- package/dist/expansion-panel/expansionPanelStyles.d.ts +19 -0
- package/dist/expansion-panel/expansionPanelStyles.js +14 -0
- package/dist/expansion-panel/expansionPanelStyles.js.map +1 -0
- package/dist/expansion-panel/useExpansionList.js.map +1 -1
- package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
- package/dist/focus/useFocusContainer.js.map +1 -1
- package/dist/focus/utils.js.map +1 -1
- package/dist/form/Checkbox.d.ts +0 -1
- package/dist/form/Checkbox.js.map +1 -1
- package/dist/form/Fieldset.d.ts +0 -2
- package/dist/form/Fieldset.js.map +1 -1
- package/dist/form/FileInput.js.map +1 -1
- package/dist/form/Form.js.map +1 -1
- package/dist/form/FormMessage.d.ts +0 -3
- package/dist/form/FormMessage.js +0 -2
- package/dist/form/FormMessage.js.map +1 -1
- package/dist/form/FormMessageContainer.d.ts +0 -1
- package/dist/form/FormMessageContainer.js +0 -1
- package/dist/form/FormMessageContainer.js.map +1 -1
- package/dist/form/FormMessageCounter.d.ts +0 -2
- package/dist/form/FormMessageCounter.js +0 -2
- package/dist/form/FormMessageCounter.js.map +1 -1
- package/dist/form/InputToggle.js.map +1 -1
- package/dist/form/InputToggleIcon.d.ts +0 -2
- package/dist/form/InputToggleIcon.js +0 -2
- package/dist/form/InputToggleIcon.js.map +1 -1
- package/dist/form/Label.d.ts +0 -3
- package/dist/form/Label.js +0 -2
- package/dist/form/Label.js.map +1 -1
- package/dist/form/Legend.d.ts +0 -3
- package/dist/form/Legend.js +0 -2
- package/dist/form/Legend.js.map +1 -1
- package/dist/form/MenuItemCheckbox.d.ts +0 -1
- package/dist/form/MenuItemCheckbox.js.map +1 -1
- package/dist/form/MenuItemFileInput.js.map +1 -1
- package/dist/form/MenuItemInputToggle.js.map +1 -1
- package/dist/form/MenuItemRadio.d.ts +0 -1
- package/dist/form/MenuItemRadio.js.map +1 -1
- package/dist/form/MenuItemSwitch.d.ts +0 -1
- package/dist/form/MenuItemSwitch.js.map +1 -1
- package/dist/form/MenuItemTextField.js.map +1 -1
- package/dist/form/NativeSelect.d.ts +0 -2
- package/dist/form/NativeSelect.js +0 -2
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/OptGroup.js.map +1 -1
- package/dist/form/Option.js.map +1 -1
- package/dist/form/Password.js.map +1 -1
- package/dist/form/Radio.d.ts +0 -1
- package/dist/form/Radio.js.map +1 -1
- package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
- package/dist/form/Select.js.map +1 -1
- package/dist/form/SelectedOption.d.ts +0 -2
- package/dist/form/SelectedOption.js +0 -2
- package/dist/form/SelectedOption.js.map +1 -1
- package/dist/form/Slider.js.map +1 -1
- package/dist/form/SliderContainer.d.ts +0 -2
- package/dist/form/SliderContainer.js +0 -2
- package/dist/form/SliderContainer.js.map +1 -1
- package/dist/form/SliderMark.d.ts +0 -2
- package/dist/form/SliderMark.js +0 -2
- package/dist/form/SliderMark.js.map +1 -1
- package/dist/form/SliderMarkLabel.d.ts +0 -2
- package/dist/form/SliderMarkLabel.js +0 -2
- package/dist/form/SliderMarkLabel.js.map +1 -1
- package/dist/form/SliderThumb.js.map +1 -1
- package/dist/form/SliderTrack.d.ts +0 -2
- package/dist/form/SliderTrack.js +0 -2
- package/dist/form/SliderTrack.js.map +1 -1
- package/dist/form/SliderValueMarks.d.ts +0 -2
- package/dist/form/SliderValueMarks.js +0 -2
- package/dist/form/SliderValueMarks.js.map +1 -1
- package/dist/form/SliderValueTooltip.js.map +1 -1
- package/dist/form/Switch.d.ts +0 -2
- package/dist/form/Switch.js +0 -2
- package/dist/form/Switch.js.map +1 -1
- package/dist/form/SwitchTrack.d.ts +2 -1
- package/dist/form/SwitchTrack.js +2 -1
- package/dist/form/SwitchTrack.js.map +1 -1
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextField.d.ts +0 -2
- package/dist/form/TextField.js +0 -2
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/TextFieldAddon.d.ts +1 -4
- package/dist/form/TextFieldAddon.js +1 -3
- package/dist/form/TextFieldAddon.js.map +1 -1
- package/dist/form/TextFieldContainer.js.map +1 -1
- package/dist/form/fileUtils.js.map +1 -1
- package/dist/form/formConfig.js.map +1 -1
- package/dist/form/formMessageStyles.js.map +1 -1
- package/dist/form/inputToggleStyles.js.map +1 -1
- package/dist/form/menuItemInputToggleStyles.js.map +1 -1
- package/dist/form/nativeSelectStyles.js.map +1 -1
- package/dist/form/optionStyles.js.map +1 -1
- package/dist/form/passwordStyles.js.map +1 -1
- package/dist/form/selectStyles.js.map +1 -1
- package/dist/form/selectUtils.js.map +1 -1
- package/dist/form/sliderUtils.js.map +1 -1
- package/dist/form/switchStyles.js.map +1 -1
- package/dist/form/textAreaStyles.js.map +1 -1
- package/dist/form/textFieldContainerStyles.js.map +1 -1
- package/dist/form/textFieldStyles.js.map +1 -1
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCheckboxGroup.js.map +1 -1
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useEditableCombobox.js.map +1 -1
- package/dist/form/useFileUpload.js.map +1 -1
- package/dist/form/useFormReset.js.map +1 -1
- package/dist/form/useListboxProvider.js.map +1 -1
- package/dist/form/useNumberField.js.map +1 -1
- package/dist/form/useRadioGroup.js.map +1 -1
- package/dist/form/useRangeSlider.js.map +1 -1
- package/dist/form/useResizingTextArea.js.map +1 -1
- package/dist/form/useSelectCombobox.js.map +1 -1
- package/dist/form/useSlider.js.map +1 -1
- package/dist/form/useTextField.js.map +1 -1
- package/dist/form/useTextFieldContainerAddons.js.map +1 -1
- package/dist/form/utils.js.map +1 -1
- package/dist/form/validation.js.map +1 -1
- package/dist/hoverMode/useHoverMode.js.map +1 -1
- package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
- package/dist/icon/FontIcon.d.ts +10 -8
- package/dist/icon/FontIcon.js +1 -7
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/IconRotator.d.ts +0 -2
- package/dist/icon/IconRotator.js +0 -2
- package/dist/icon/IconRotator.js.map +1 -1
- package/dist/icon/MaterialIcon.d.ts +18 -3
- package/dist/icon/MaterialIcon.js +13 -3
- package/dist/icon/MaterialIcon.js.map +1 -1
- package/dist/icon/MaterialSymbol.d.ts +0 -1
- package/dist/icon/MaterialSymbol.js +0 -1
- package/dist/icon/MaterialSymbol.js.map +1 -1
- package/dist/icon/SVGIcon.d.ts +3 -2
- package/dist/icon/SVGIcon.js +0 -2
- package/dist/icon/SVGIcon.js.map +1 -1
- package/dist/icon/TextIconSpacing.d.ts +0 -2
- package/dist/icon/TextIconSpacing.js +0 -2
- package/dist/icon/TextIconSpacing.js.map +1 -1
- package/dist/icon/_icon.scss +2 -2
- package/dist/icon/iconConfig.d.ts +1 -0
- package/dist/icon/iconConfig.js +1 -0
- package/dist/icon/iconConfig.js.map +1 -1
- package/dist/icon/material.d.ts +1 -1
- package/dist/icon/material.js.map +1 -1
- package/dist/icon/materialConfig.js.map +1 -1
- package/dist/icon/styles.js +1 -1
- package/dist/icon/styles.js.map +1 -1
- package/dist/interaction/Ripple.js.map +1 -1
- package/dist/interaction/RippleContainer.d.ts +0 -2
- package/dist/interaction/RippleContainer.js +0 -2
- package/dist/interaction/RippleContainer.js.map +1 -1
- package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
- package/dist/interaction/config.js.map +1 -1
- package/dist/interaction/types.js.map +1 -1
- package/dist/interaction/useElementInteraction.js.map +1 -1
- package/dist/interaction/useHigherContrastChildren.js.map +1 -1
- package/dist/interaction/utils.js.map +1 -1
- package/dist/layout/LayoutAppBar.d.ts +0 -1
- package/dist/layout/LayoutAppBar.js.map +1 -1
- package/dist/layout/LayoutNav.js +1 -2
- package/dist/layout/LayoutNav.js.map +1 -1
- package/dist/layout/LayoutWindowSplitter.d.ts +0 -1
- package/dist/layout/LayoutWindowSplitter.js.map +1 -1
- package/dist/layout/Main.js.map +1 -1
- package/dist/layout/layoutNavStyles.js.map +1 -1
- package/dist/layout/layoutWindowSplitterStyles.js.map +1 -1
- package/dist/layout/mainStyles.js.map +1 -1
- package/dist/layout/useExpandableLayout.js.map +1 -1
- package/dist/layout/useHorizontalLayoutTransition.js +1 -1
- package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
- package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
- package/dist/layout/useLayoutTree.d.ts +2 -2
- package/dist/layout/useLayoutTree.js.map +1 -1
- package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
- package/dist/layout/useMainTabIndex.js.map +1 -1
- package/dist/layout/useResizableLayout.js.map +1 -1
- package/dist/layout/useTemporaryLayout.js.map +1 -1
- package/dist/link/Link.d.ts +2 -6
- package/dist/link/Link.js +1 -4
- package/dist/link/Link.js.map +1 -1
- package/dist/link/SkipToMainContent.d.ts +10 -3
- package/dist/link/SkipToMainContent.js +4 -1
- package/dist/link/SkipToMainContent.js.map +1 -1
- package/dist/link/styles.d.ts +2 -2
- package/dist/link/styles.js.map +1 -1
- package/dist/list/List.d.ts +0 -20
- package/dist/list/List.js +1 -14
- package/dist/list/List.js.map +1 -1
- package/dist/list/ListItem.d.ts +0 -16
- package/dist/list/ListItem.js.map +1 -1
- package/dist/list/ListItemAddon.d.ts +0 -2
- package/dist/list/ListItemAddon.js +0 -2
- package/dist/list/ListItemAddon.js.map +1 -1
- package/dist/list/ListItemChildren.d.ts +0 -2
- package/dist/list/ListItemChildren.js +0 -2
- package/dist/list/ListItemChildren.js.map +1 -1
- package/dist/list/ListItemLink.js.map +1 -1
- package/dist/list/ListItemText.d.ts +0 -2
- package/dist/list/ListItemText.js +0 -2
- package/dist/list/ListItemText.js.map +1 -1
- package/dist/list/ListSubheader.d.ts +3 -2
- package/dist/list/ListSubheader.js +0 -2
- package/dist/list/ListSubheader.js.map +1 -1
- package/dist/list/getListItemHeight.d.ts +2 -2
- package/dist/list/getListItemHeight.js +2 -2
- package/dist/list/getListItemHeight.js.map +1 -1
- package/dist/list/listItemStyles.d.ts +17 -1
- package/dist/list/listItemStyles.js.map +1 -1
- package/dist/list/listStyles.d.ts +18 -0
- package/dist/list/listStyles.js +14 -0
- package/dist/list/listStyles.js.map +1 -0
- package/dist/list/types.d.ts +9 -3
- package/dist/list/types.js +6 -1
- package/dist/list/types.js.map +1 -1
- package/dist/media-queries/AppSizeProvider.d.ts +8 -0
- package/dist/media-queries/AppSizeProvider.js +2 -0
- package/dist/media-queries/AppSizeProvider.js.map +1 -1
- package/dist/media-queries/appSize.d.ts +5 -5
- package/dist/media-queries/appSize.js.map +1 -1
- package/dist/media-queries/useMediaQuery.d.ts +1 -1
- package/dist/media-queries/useMediaQuery.js +1 -1
- package/dist/media-queries/useMediaQuery.js.map +1 -1
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuBar.d.ts +0 -1
- package/dist/menu/MenuBar.js.map +1 -1
- package/dist/menu/MenuButton.d.ts +0 -1
- package/dist/menu/MenuButton.js.map +1 -1
- package/dist/menu/MenuConfigurationProvider.js.map +1 -1
- package/dist/menu/MenuItem.d.ts +0 -1
- package/dist/menu/MenuItem.js.map +1 -1
- package/dist/menu/MenuItemButton.d.ts +0 -1
- package/dist/menu/MenuItemButton.js.map +1 -1
- package/dist/menu/MenuItemCircularProgress.js.map +1 -1
- package/dist/menu/MenuItemGroup.js.map +1 -1
- package/dist/menu/MenuItemSeparator.js.map +1 -1
- package/dist/menu/MenuSheet.js.map +1 -1
- package/dist/menu/MenuVisibilityProvider.js.map +1 -1
- package/dist/menu/MenuWidget.js.map +1 -1
- package/dist/menu/MenuWidgetKeyboardProvider.js.map +1 -1
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/menu/useMenuBarProvider.d.ts +0 -1
- package/dist/menu/useMenuBarProvider.js.map +1 -1
- package/dist/menu/utils.js.map +1 -1
- package/dist/movement/constants.js.map +1 -1
- package/dist/movement/findMatchIndex.js.map +1 -1
- package/dist/movement/types.js.map +1 -1
- package/dist/movement/useKeyboardMovementProvider.d.ts +0 -1
- package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
- package/dist/movement/utils.js.map +1 -1
- package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
- package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
- package/dist/navigation/NavGroup.d.ts +0 -2
- package/dist/navigation/NavGroup.js +0 -2
- package/dist/navigation/NavGroup.js.map +1 -1
- package/dist/navigation/NavItem.d.ts +0 -2
- package/dist/navigation/NavItem.js +0 -2
- package/dist/navigation/NavItem.js.map +1 -1
- package/dist/navigation/NavItemButton.js.map +1 -1
- package/dist/navigation/NavItemLink.js.map +1 -1
- package/dist/navigation/NavSubheader.d.ts +0 -3
- package/dist/navigation/NavSubheader.js +0 -2
- package/dist/navigation/NavSubheader.js.map +1 -1
- package/dist/navigation/Navigation.js.map +1 -1
- package/dist/navigation/getHrefFromParents.js.map +1 -1
- package/dist/navigation/navGroupStyles.js.map +1 -1
- package/dist/navigation/navItemStyles.js.map +1 -1
- package/dist/navigation/types.js.map +1 -1
- package/dist/navigation/useActiveHeadingId.js.map +1 -1
- package/dist/overlay/Overlay.d.ts +1 -0
- package/dist/overlay/Overlay.js.map +1 -1
- package/dist/overlay/overlayStyles.js.map +1 -1
- package/dist/portal/Portal.d.ts +4 -0
- package/dist/portal/Portal.js.map +1 -1
- package/dist/portal/PortalContainerProvider.d.ts +8 -3
- package/dist/portal/PortalContainerProvider.js +1 -0
- package/dist/portal/PortalContainerProvider.js.map +1 -1
- package/dist/positioning/constants.js.map +1 -1
- package/dist/positioning/createHorizontalPosition.js.map +1 -1
- package/dist/positioning/createVerticalPosition.js.map +1 -1
- package/dist/positioning/getFixedPosition.js.map +1 -1
- package/dist/positioning/types.js.map +1 -1
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/positioning/utils.js.map +1 -1
- package/dist/progress/CircularProgress.d.ts +5 -6
- package/dist/progress/CircularProgress.js +0 -2
- package/dist/progress/CircularProgress.js.map +1 -1
- package/dist/progress/LinearProgress.d.ts +0 -2
- package/dist/progress/LinearProgress.js +0 -2
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/progress/getProgressA11y.js.map +1 -1
- package/dist/progress/types.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemContainer.d.ts +0 -2
- package/dist/responsive-item/ResponsiveItemContainer.js +0 -2
- package/dist/responsive-item/ResponsiveItemContainer.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemOverlay.d.ts +0 -2
- package/dist/responsive-item/ResponsiveItemOverlay.js +0 -2
- package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
- package/dist/responsive-item/styles.js.map +1 -1
- package/dist/scroll/ScrollLock.js.map +1 -1
- package/dist/scroll/getScrollbarWidth.js.map +1 -1
- package/dist/scroll/useScrollLock.js.map +1 -1
- package/dist/searching/caseInsensitive.js.map +1 -1
- package/dist/searching/fuzzy.js.map +1 -1
- package/dist/searching/toSearchQuery.js.map +1 -1
- package/dist/searching/types.js.map +1 -1
- package/dist/searching/useFuzzyMatch.js.map +1 -1
- package/dist/searching/utils.js.map +1 -1
- package/dist/segmented-button/SegmentedButton.js.map +1 -1
- package/dist/segmented-button/SegmentedButtonContainer.d.ts +0 -2
- package/dist/segmented-button/SegmentedButtonContainer.js +0 -2
- package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
- package/dist/segmented-button/segmentedButtonContainerStyles.js.map +1 -1
- package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
- package/dist/sheet/Sheet.d.ts +30 -16
- package/dist/sheet/Sheet.js +24 -14
- package/dist/sheet/Sheet.js.map +1 -1
- package/dist/sheet/styles.d.ts +29 -0
- package/dist/sheet/styles.js +13 -0
- package/dist/sheet/styles.js.map +1 -1
- package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
- package/dist/snackbar/Snackbar.js.map +1 -1
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/snackbar/ToastActionButton.d.ts +0 -1
- package/dist/snackbar/ToastActionButton.js.map +1 -1
- package/dist/snackbar/ToastCloseButton.d.ts +0 -1
- package/dist/snackbar/ToastCloseButton.js.map +1 -1
- package/dist/snackbar/ToastContent.js.map +1 -1
- package/dist/snackbar/ToastManager.js.map +1 -1
- package/dist/snackbar/ToastManagerProvider.js.map +1 -1
- package/dist/snackbar/snackbarStyles.js.map +1 -1
- package/dist/snackbar/toastContentStyles.js.map +1 -1
- package/dist/snackbar/toastStyles.js.map +1 -1
- package/dist/snackbar/useCurrentToastActions.d.ts +0 -1
- package/dist/snackbar/useCurrentToastActions.js.map +1 -1
- package/dist/suspense/CircularProgressSuspense.d.ts +0 -2
- package/dist/suspense/CircularProgressSuspense.js +0 -2
- package/dist/suspense/CircularProgressSuspense.js.map +1 -1
- package/dist/suspense/NullSuspense.d.ts +0 -2
- package/dist/suspense/NullSuspense.js +0 -2
- package/dist/suspense/NullSuspense.js.map +1 -1
- package/dist/table/StickyTableSection.d.ts +23 -0
- package/dist/table/StickyTableSection.js +56 -0
- package/dist/table/StickyTableSection.js.map +1 -0
- package/dist/table/Table.d.ts +1 -1
- package/dist/table/Table.js.map +1 -1
- package/dist/table/TableBody.d.ts +1 -1
- package/dist/table/TableBody.js.map +1 -1
- package/dist/table/TableCell.d.ts +3 -2
- package/dist/table/TableCell.js.map +1 -1
- package/dist/table/TableCellContent.d.ts +1 -5
- package/dist/table/TableCellContent.js +0 -3
- package/dist/table/TableCellContent.js.map +1 -1
- package/dist/table/TableCheckbox.js.map +1 -1
- package/dist/table/TableConfigurationProvider.d.ts +1 -74
- package/dist/table/TableConfigurationProvider.js.map +1 -1
- package/dist/table/TableContainer.js.map +1 -1
- package/dist/table/TableContainerProvider.js.map +1 -1
- package/dist/table/TableFooter.d.ts +8 -17
- package/dist/table/TableFooter.js +17 -80
- package/dist/table/TableFooter.js.map +1 -1
- package/dist/table/TableHeader.d.ts +8 -17
- package/dist/table/TableHeader.js +20 -87
- package/dist/table/TableHeader.js.map +1 -1
- package/dist/table/TableRadio.js.map +1 -1
- package/dist/table/TableRow.d.ts +1 -1
- package/dist/table/TableRow.js.map +1 -1
- package/dist/table/tableCellStyles.d.ts +1 -1
- package/dist/table/tableCellStyles.js.map +1 -1
- package/dist/table/tableContainerStyles.js.map +1 -1
- package/dist/table/tableFooterStyles.js.map +1 -1
- package/dist/table/tableHeaderStyles.js.map +1 -1
- package/dist/table/tableRowStyles.js.map +1 -1
- package/dist/table/tableStyles.js.map +1 -1
- package/dist/table/types.d.ts +89 -9
- package/dist/table/types.js.map +1 -1
- package/dist/table/useStickyTableSection.d.ts +27 -0
- package/dist/table/useStickyTableSection.js +84 -0
- package/dist/table/useStickyTableSection.js.map +1 -0
- package/dist/table/useTableSectionConfig.d.ts +13 -0
- package/dist/table/useTableSectionConfig.js +33 -0
- package/dist/table/useTableSectionConfig.js.map +1 -0
- package/dist/tabs/Tab.d.ts +3 -0
- package/dist/tabs/Tab.js.map +1 -1
- package/dist/tabs/TabList.js.map +1 -1
- package/dist/tabs/TabListScrollButton.js +5 -1
- package/dist/tabs/TabListScrollButton.js.map +1 -1
- package/dist/tabs/_tabs.scss +21 -3
- package/dist/tabs/tabIndicatorStyles.js.map +1 -1
- package/dist/tabs/tabListScrollButtonStyles.d.ts +2 -0
- package/dist/tabs/tabListScrollButtonStyles.js +9 -5
- package/dist/tabs/tabListScrollButtonStyles.js.map +1 -1
- package/dist/tabs/tabListStyles.js.map +1 -1
- package/dist/tabs/tabStyles.js.map +1 -1
- package/dist/tabs/useTabList.d.ts +2 -0
- package/dist/tabs/useTabList.js +4 -2
- package/dist/tabs/useTabList.js.map +1 -1
- package/dist/tabs/useTabs.d.ts +33 -11
- package/dist/tabs/useTabs.js +9 -3
- package/dist/tabs/useTabs.js.map +1 -1
- package/dist/tabs/utils.js.map +1 -1
- package/dist/test-utils/IntersectionObserver.js.map +1 -1
- package/dist/test-utils/ResizeObserver.js.map +1 -1
- package/dist/test-utils/data-testid.d.ts +0 -1
- package/dist/test-utils/data-testid.js.map +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/jest-setup.js.map +1 -1
- package/dist/test-utils/matchMedia.js.map +1 -1
- package/dist/test-utils/polyfills/IntersectionObserver.js.map +1 -1
- package/dist/test-utils/polyfills/ResizeObserver.js.map +1 -1
- package/dist/test-utils/polyfills/TextDecoder.js.map +1 -1
- package/dist/test-utils/polyfills/TextEncoder.js.map +1 -1
- package/dist/test-utils/polyfills/index.js.map +1 -1
- package/dist/test-utils/polyfills/matchMedia.js.map +1 -1
- package/dist/test-utils/polyfills/offsetParent.js.map +1 -1
- package/dist/test-utils/polyfills/scrollIntoView.js.map +1 -1
- package/dist/test-utils/render.js.map +1 -1
- package/dist/test-utils/timers.js.map +1 -1
- package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/_theme.scss +2 -1
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/cssVars.js.map +1 -1
- package/dist/theme/types.js.map +1 -1
- package/dist/theme/useCSSVariables.js.map +1 -1
- package/dist/theme/useColorScheme.d.ts +0 -1
- package/dist/theme/useColorScheme.js.map +1 -1
- package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
- package/dist/theme/useColorSchemeProvider.js.map +1 -1
- package/dist/theme/usePrefersColorScheme.js.map +1 -1
- package/dist/theme/utils.js.map +1 -1
- package/dist/tooltip/Tooltip.d.ts +20 -9
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
- package/dist/tooltip/constants.js.map +1 -1
- package/dist/tooltip/tooltipStyles.js.map +1 -1
- package/dist/tooltip/useTooltip.d.ts +30 -16
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/tooltip/useTooltipPosition.d.ts +2 -4
- package/dist/tooltip/useTooltipPosition.js.map +1 -1
- package/dist/tooltip/utils.js.map +1 -1
- package/dist/transition/CSSTransition.js.map +1 -1
- package/dist/transition/Collapse.js.map +1 -1
- package/dist/transition/CrossFade.js.map +1 -1
- package/dist/transition/ScaleTransition.js.map +1 -1
- package/dist/transition/SkeletonPlaceholder.js.map +1 -1
- package/dist/transition/Slide.js.map +1 -1
- package/dist/transition/SlideContainer.d.ts +2 -48
- package/dist/transition/SlideContainer.js +2 -48
- package/dist/transition/SlideContainer.js.map +1 -1
- package/dist/transition/collapseStyles.js.map +1 -1
- package/dist/transition/config.js.map +1 -1
- package/dist/transition/maxWidthTransition.js.map +1 -1
- package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
- package/dist/transition/types.d.ts +19 -24
- package/dist/transition/types.js.map +1 -1
- package/dist/transition/useCSSTransition.js.map +1 -1
- package/dist/transition/useCarousel.js.map +1 -1
- package/dist/transition/useCollapseTransition.js.map +1 -1
- package/dist/transition/useCrossFadeTransition.js.map +1 -1
- package/dist/transition/useMaxWidthTransition.js.map +1 -1
- package/dist/transition/useScaleTransition.js.map +1 -1
- package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
- package/dist/transition/useSlideTransition.js.map +1 -1
- package/dist/transition/useTransition.d.ts +1 -0
- 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/DefaultTreeItemRenderer.d.ts +2 -3
- package/dist/tree/DefaultTreeItemRenderer.js +1 -1
- package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
- package/dist/tree/Tree.d.ts +3 -4
- package/dist/tree/Tree.js.map +1 -1
- package/dist/tree/TreeGroup.js.map +1 -1
- package/dist/tree/TreeItem.d.ts +10 -3
- package/dist/tree/TreeItem.js +5 -2
- package/dist/tree/TreeItem.js.map +1 -1
- package/dist/tree/TreeItemExpander.js.map +1 -1
- package/dist/tree/TreeProvider.js.map +1 -1
- package/dist/tree/styles.js.map +1 -1
- package/dist/tree/types.d.ts +11 -6
- package/dist/tree/types.js +1 -26
- package/dist/tree/types.js.map +1 -1
- package/dist/tree/useTree.d.ts +5 -5
- package/dist/tree/useTree.js.map +1 -1
- package/dist/tree/useTreeExpansion.d.ts +3 -3
- package/dist/tree/useTreeExpansion.js.map +1 -1
- package/dist/tree/useTreeItems.js.map +1 -1
- package/dist/tree/useTreeMovement.js.map +1 -1
- package/dist/tree/useTreeSelection.d.ts +3 -3
- package/dist/tree/useTreeSelection.js.map +1 -1
- package/dist/tree/utils.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typography/SrOnly.d.ts +2 -1
- package/dist/typography/SrOnly.js +2 -1
- package/dist/typography/SrOnly.js.map +1 -1
- package/dist/typography/TextContainer.d.ts +4 -2
- package/dist/typography/TextContainer.js +2 -2
- package/dist/typography/TextContainer.js.map +1 -1
- package/dist/typography/Typography.d.ts +10 -2
- package/dist/typography/Typography.js +3 -2
- package/dist/typography/Typography.js.map +1 -1
- package/dist/typography/WritingDirectionProvider.d.ts +2 -2
- package/dist/typography/WritingDirectionProvider.js +2 -2
- package/dist/typography/WritingDirectionProvider.js.map +1 -1
- package/dist/typography/textContainerStyles.js.map +1 -1
- package/dist/typography/typographyStyles.js.map +1 -1
- package/dist/useAsyncFunction.js.map +1 -1
- package/dist/useDebouncedFunction.js.map +1 -1
- package/dist/useDropzone.js.map +1 -1
- package/dist/useElementSize.js.map +1 -1
- package/dist/useEnsuredId.js.map +1 -1
- package/dist/useEnsuredRef.js.map +1 -1
- package/dist/useEnsuredState.js.map +1 -1
- package/dist/useHtmlClassName.js.map +1 -1
- package/dist/useIntersectionObserver.js.map +1 -1
- package/dist/useIsomorphicLayoutEffect.js.map +1 -1
- package/dist/useLocalStorage.js.map +1 -1
- package/dist/useMutationObserver.js.map +1 -1
- package/dist/useOrientation.js.map +1 -1
- package/dist/usePageInactive.js.map +1 -1
- package/dist/useResizeListener.d.ts +7 -1
- package/dist/useResizeListener.js.map +1 -1
- package/dist/useResizeObserver.d.ts +3 -3
- package/dist/useResizeObserver.js.map +1 -1
- package/dist/useThrottledFunction.js.map +1 -1
- package/dist/useToggle.d.ts +4 -4
- package/dist/useToggle.js +1 -1
- package/dist/useToggle.js.map +1 -1
- package/dist/useUnmounted.js.map +1 -1
- package/dist/useWindowSize.js.map +1 -1
- package/dist/utils/RenderRecursively.js.map +1 -1
- package/dist/utils/alphaNumericSort.js.map +1 -1
- package/dist/utils/applyRef.js.map +1 -1
- package/dist/utils/bem.js.map +1 -1
- package/dist/utils/getClientPosition.js.map +1 -1
- package/dist/utils/getMiddleOfRange.js.map +1 -1
- package/dist/utils/getPercentage.js.map +1 -1
- package/dist/utils/getRangeDefaultValue.js.map +1 -1
- package/dist/utils/getRangeSteps.js.map +1 -1
- package/dist/utils/identity.js.map +1 -1
- package/dist/utils/isElementVisible.js.map +1 -1
- package/dist/utils/loop.js.map +1 -1
- package/dist/utils/nearest.js.map +1 -1
- package/dist/utils/parseCssLengthUnit.js.map +1 -1
- package/dist/utils/randomInt.js.map +1 -1
- package/dist/utils/wait.js.map +1 -1
- package/dist/utils/withinRange.js.map +1 -1
- package/dist/window-splitter/WindowSplitter.d.ts +2 -2
- package/dist/window-splitter/WindowSplitter.js +2 -2
- package/dist/window-splitter/WindowSplitter.js.map +1 -1
- package/dist/window-splitter/useWindowSplitter.js.map +1 -1
- package/package.json +25 -24
- package/src/RootHtml.tsx +0 -2
- package/src/app-bar/AppBar.tsx +0 -2
- package/src/app-bar/AppBarTitle.tsx +8 -6
- package/src/autocomplete/defaults.ts +3 -3
- package/src/avatar/Avatar.tsx +1 -4
- package/src/badge/Badge.tsx +1 -3
- package/src/box/Box.tsx +0 -2
- package/src/button/ButtonUnstyled.tsx +0 -2
- package/src/card/Card.tsx +2 -3
- package/src/card/CardContent.tsx +0 -2
- package/src/card/CardFooter.tsx +0 -2
- package/src/card/CardHeader.tsx +0 -2
- package/src/card/CardSubtitle.tsx +9 -2
- package/src/card/CardTitle.tsx +0 -2
- package/src/card/styles.ts +2 -6
- package/src/chip/Chip.tsx +0 -2
- package/src/cssUtils.ts +1 -1
- package/src/dialog/DialogContainer.tsx +0 -2
- package/src/dialog/DialogContent.tsx +3 -3
- package/src/dialog/DialogFooter.tsx +2 -3
- package/src/dialog/DialogHeader.tsx +3 -3
- package/src/dialog/DialogTitle.tsx +3 -3
- package/src/divider/Divider.tsx +0 -2
- package/src/expansion-panel/ExpansionList.tsx +1 -1
- package/src/expansion-panel/ExpansionPanel.tsx +9 -38
- package/src/expansion-panel/ExpansionPanelHeader.tsx +0 -1
- package/src/expansion-panel/expansionPanelStyles.ts +33 -0
- package/src/form/Fieldset.tsx +0 -2
- package/src/form/FormMessage.tsx +0 -2
- package/src/form/FormMessageContainer.tsx +0 -1
- package/src/form/FormMessageCounter.tsx +0 -2
- package/src/form/InputToggle.tsx +1 -1
- package/src/form/InputToggleIcon.tsx +0 -2
- package/src/form/Label.tsx +0 -2
- package/src/form/Legend.tsx +0 -2
- package/src/form/NativeSelect.tsx +0 -2
- package/src/form/Option.tsx +1 -1
- package/src/form/SelectedOption.tsx +0 -2
- package/src/form/SliderContainer.tsx +0 -2
- package/src/form/SliderMark.tsx +0 -2
- package/src/form/SliderMarkLabel.tsx +0 -2
- package/src/form/SliderTrack.tsx +0 -2
- package/src/form/SliderValueMarks.tsx +0 -2
- package/src/form/Switch.tsx +0 -2
- package/src/form/SwitchTrack.tsx +2 -1
- package/src/form/TextField.tsx +0 -2
- package/src/form/TextFieldAddon.tsx +1 -3
- package/src/icon/FontIcon.tsx +19 -11
- package/src/icon/IconRotator.tsx +0 -2
- package/src/icon/MaterialIcon.tsx +22 -5
- package/src/icon/MaterialSymbol.tsx +0 -1
- package/src/icon/SVGIcon.tsx +3 -2
- package/src/icon/TextIconSpacing.tsx +0 -2
- package/src/icon/iconConfig.tsx +1 -0
- package/src/icon/material.ts +276 -19
- package/src/icon/styles.ts +1 -1
- package/src/interaction/RippleContainer.tsx +0 -2
- package/src/layout/LayoutNav.tsx +3 -2
- package/src/layout/useHorizontalLayoutTransition.ts +1 -1
- package/src/layout/useLayoutTree.ts +2 -2
- package/src/link/Link.tsx +2 -6
- package/src/link/SkipToMainContent.tsx +11 -4
- package/src/link/styles.ts +2 -2
- package/src/list/List.tsx +1 -33
- package/src/list/ListItem.tsx +0 -17
- package/src/list/ListItemAddon.tsx +0 -2
- package/src/list/ListItemChildren.tsx +0 -2
- package/src/list/ListItemText.tsx +0 -2
- package/src/list/ListSubheader.tsx +3 -2
- package/src/list/getListItemHeight.ts +2 -2
- package/src/list/listItemStyles.ts +21 -4
- package/src/list/listStyles.ts +31 -0
- package/src/list/types.ts +9 -3
- package/src/media-queries/AppSizeProvider.tsx +8 -0
- package/src/media-queries/useMediaQuery.ts +1 -1
- package/src/menu/MenuConfigurationProvider.tsx +2 -2
- package/src/navigation/NavGroup.tsx +0 -2
- package/src/navigation/NavItem.tsx +0 -2
- package/src/navigation/NavSubheader.tsx +0 -2
- package/src/overlay/Overlay.tsx +1 -0
- package/src/portal/Portal.tsx +5 -0
- package/src/portal/PortalContainerProvider.tsx +16 -7
- package/src/progress/CircularProgress.tsx +5 -6
- package/src/progress/LinearProgress.tsx +0 -2
- package/src/responsive-item/ResponsiveItemContainer.tsx +0 -2
- package/src/responsive-item/ResponsiveItemOverlay.tsx +0 -2
- package/src/segmented-button/SegmentedButtonContainer.tsx +0 -2
- package/src/sheet/Sheet.tsx +36 -33
- package/src/sheet/styles.ts +50 -0
- package/src/suspense/CircularProgressSuspense.tsx +0 -2
- package/src/suspense/NullSuspense.tsx +0 -2
- package/src/table/StickyTableSection.tsx +91 -0
- package/src/table/Table.tsx +2 -5
- package/src/table/TableBody.tsx +1 -2
- package/src/table/TableCell.tsx +3 -5
- package/src/table/TableCellContent.tsx +1 -6
- package/src/table/TableConfigurationProvider.tsx +1 -86
- package/src/table/TableFooter.tsx +19 -116
- package/src/table/TableHeader.tsx +20 -118
- package/src/table/TableRow.tsx +2 -4
- package/src/table/tableCellStyles.ts +1 -1
- package/src/table/types.ts +105 -10
- package/src/table/useStickyTableSection.tsx +126 -0
- package/src/table/useTableSectionConfig.ts +45 -0
- package/src/tabs/Tab.tsx +3 -0
- package/src/tabs/TabListScrollButton.tsx +9 -2
- package/src/tabs/tabListScrollButtonStyles.ts +9 -5
- package/src/tabs/useTabList.ts +4 -0
- package/src/tabs/useTabs.ts +61 -14
- package/src/test-utils/IntersectionObserver.ts +1 -1
- package/src/tooltip/Tooltip.tsx +24 -8
- package/src/tooltip/useTooltip.ts +52 -27
- package/src/tooltip/useTooltipPosition.ts +2 -4
- package/src/transition/SlideContainer.tsx +2 -48
- package/src/transition/types.ts +23 -27
- package/src/transition/useTransition.ts +1 -0
- package/src/tree/DefaultTreeItemRenderer.tsx +3 -4
- package/src/tree/Tree.tsx +4 -6
- package/src/tree/TreeItem.tsx +11 -4
- package/src/tree/types.ts +16 -6
- package/src/tree/useTree.ts +5 -7
- package/src/tree/useTreeExpansion.ts +3 -3
- package/src/tree/useTreeSelection.ts +3 -3
- package/src/typography/SrOnly.tsx +2 -1
- package/src/typography/TextContainer.tsx +4 -2
- package/src/typography/Typography.tsx +10 -2
- package/src/typography/WritingDirectionProvider.tsx +2 -2
- package/src/useResizeListener.ts +8 -2
- package/src/useResizeObserver.ts +3 -3
- package/src/useToggle.ts +4 -4
- package/src/window-splitter/WindowSplitter.tsx +2 -2
- package/.eslintrc.cjs +0 -26
- package/.stylelintrc.json +0 -14
- package/.swcrc +0 -17
- package/.turbo/turbo-build.log +0 -22
- package/.turbo/turbo-lint.log +0 -12
- package/.turbo/turbo-test.log +0 -5498
- package/.turbo/turbo-typecheck.log +0 -26
- package/CHANGELOG.md +0 -310
- package/coverage/clover.xml +0 -775
- package/coverage/coverage-final.json +0 -5
- package/coverage/lcov-report/autocomplete/Autocomplete.tsx.html +0 -967
- package/coverage/lcov-report/autocomplete/index.html +0 -116
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/button/Button.tsx.html +0 -676
- package/coverage/lcov-report/button/index.html +0 -116
- package/coverage/lcov-report/createHorizontalPosition.ts.html +0 -1075
- package/coverage/lcov-report/createVerticalPosition.ts.html +0 -997
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -161
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/searching/fuzzy.ts.html +0 -607
- package/coverage/lcov-report/searching/index.html +0 -116
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/typography/SrOnly.tsx.html +0 -325
- package/coverage/lcov-report/typography/index.html +0 -116
- package/coverage/lcov-report/utils.ts.html +0 -1225
- package/coverage/lcov.info +0 -836
- package/jest.config.ts +0 -68
- package/jest.setup.ts +0 -3
- package/scripts/copySassFiles.ts +0 -70
- package/scripts/tsconfig.json +0 -18
- package/src/__tests__/NoSsr.node.tsx +0 -26
- package/src/__tests__/NoSsr.tsx +0 -89
- package/src/__tests__/RootHtml.node.tsx +0 -46
- package/src/__tests__/__snapshots__/RootHtml.node.tsx.snap +0 -19
- package/src/__tests__/useAsyncFunction.tsx +0 -124
- package/src/__tests__/useDebouncedFunction.tsx +0 -108
- package/src/__tests__/useDropzone.tsx +0 -131
- package/src/__tests__/useElementSize.tsx +0 -181
- package/src/__tests__/useEnsuredId.tsx +0 -25
- package/src/__tests__/useEnsuredState.tsx +0 -74
- package/src/__tests__/useHtmlClassName.tsx +0 -54
- package/src/__tests__/useLocalStorage.tsx +0 -377
- package/src/__tests__/useOrientation.node.tsx +0 -20
- package/src/__tests__/useOrientation.tsx +0 -63
- package/src/__tests__/useResizeObserver.tsx +0 -258
- package/src/__tests__/useThrottledFunction.tsx +0 -226
- package/src/__tests__/useToggle.tsx +0 -78
- package/src/__tests__/useWindowSize.node.tsx +0 -56
- package/src/__tests__/useWindowSize.tsx +0 -155
- package/src/_box-shadows.scss +0 -219
- package/src/_core.scss +0 -432
- package/src/_utils.scss +0 -348
- package/src/app-bar/__tests__/AppBar.tsx +0 -121
- package/src/app-bar/__tests__/AppBarTitle.tsx +0 -39
- package/src/app-bar/__tests__/__snapshots__/AppBar.tsx.snap +0 -186
- package/src/app-bar/__tests__/__snapshots__/AppBarTitle.tsx.snap +0 -47
- package/src/app-bar/_app-bar.scss +0 -248
- package/src/autocomplete/__tests__/Autocomplete.tsx +0 -458
- package/src/autocomplete/__tests__/__snapshots__/Autocomplete.tsx.snap +0 -144
- package/src/autocomplete/_autocomplete.scss +0 -75
- package/src/avatar/__tests__/Avatar.tsx +0 -75
- package/src/avatar/__tests__/__snapshots__/Avatar.tsx.snap +0 -73
- package/src/avatar/_avatar.scss +0 -157
- package/src/badge/__tests__/Badge.tsx +0 -42
- package/src/badge/__tests__/__snapshots__/Badge.tsx.snap +0 -54
- package/src/badge/_badge.scss +0 -145
- package/src/box/__tests__/Box.tsx +0 -158
- package/src/box/__tests__/__snapshots__/Box.tsx.snap +0 -544
- package/src/box/_box.scss +0 -168
- package/src/button/__tests__/AsyncButton.tsx +0 -211
- package/src/button/__tests__/Button.tsx +0 -198
- package/src/button/__tests__/ButtonUnstyled.tsx +0 -37
- package/src/button/__tests__/TooltippedButton.tsx +0 -60
- package/src/button/__tests__/__snapshots__/AsyncButton.tsx.snap +0 -418
- package/src/button/__tests__/__snapshots__/Button.tsx.snap +0 -573
- package/src/button/__tests__/__snapshots__/ButtonUnstyled.tsx.snap +0 -22
- package/src/button/__tests__/__snapshots__/TooltippedButton.tsx.snap +0 -26
- package/src/button/__tests__/__snapshots__/buttonStyles.ts.snap +0 -11
- package/src/button/__tests__/buttonStyles.ts +0 -15
- package/src/button/_button.scss +0 -330
- package/src/card/__tests__/Card.tsx +0 -37
- package/src/card/__tests__/CardContent.tsx +0 -40
- package/src/card/__tests__/CardFooter.tsx +0 -34
- package/src/card/__tests__/CardHeader.tsx +0 -66
- package/src/card/__tests__/CardSubtitle.tsx +0 -30
- package/src/card/__tests__/CardTitle.tsx +0 -30
- package/src/card/__tests__/ClickableCard.tsx +0 -66
- package/src/card/__tests__/__snapshots__/Card.tsx.snap +0 -40
- package/src/card/__tests__/__snapshots__/CardContent.tsx.snap +0 -50
- package/src/card/__tests__/__snapshots__/CardFooter.tsx.snap +0 -30
- package/src/card/__tests__/__snapshots__/CardHeader.tsx.snap +0 -74
- package/src/card/__tests__/__snapshots__/CardSubtitle.tsx.snap +0 -18
- package/src/card/__tests__/__snapshots__/CardTitle.tsx.snap +0 -18
- package/src/card/__tests__/__snapshots__/ClickableCard.tsx.snap +0 -20
- package/src/card/__tests__/__snapshots__/styles.ts.snap +0 -13
- package/src/card/__tests__/styles.ts +0 -45
- package/src/card/_card.scss +0 -189
- package/src/chip/__tests__/Chip.tsx +0 -327
- package/src/chip/__tests__/__snapshots__/Chip.tsx.snap +0 -597
- package/src/chip/__tests__/__snapshots__/styles.ts.snap +0 -5
- package/src/chip/__tests__/styles.ts +0 -14
- package/src/chip/_chip.scss +0 -324
- package/src/dialog/__tests__/Dialog.tsx +0 -316
- package/src/dialog/__tests__/DialogContent.tsx +0 -53
- package/src/dialog/__tests__/DialogFooter.tsx +0 -70
- package/src/dialog/__tests__/DialogHeader.tsx +0 -37
- package/src/dialog/__tests__/DialogTitle.tsx +0 -41
- package/src/dialog/__tests__/__snapshots__/Dialog.tsx.snap +0 -84
- package/src/dialog/__tests__/__snapshots__/DialogContent.tsx.snap +0 -36
- package/src/dialog/__tests__/__snapshots__/DialogFooter.tsx.snap +0 -186
- package/src/dialog/__tests__/__snapshots__/DialogHeader.tsx.snap +0 -18
- package/src/dialog/__tests__/__snapshots__/DialogTitle.tsx.snap +0 -26
- package/src/dialog/_dialog.scss +0 -273
- package/src/divider/__tests__/Divider.tsx +0 -36
- package/src/divider/__tests__/__snapshots__/Divider.tsx.snap +0 -26
- package/src/divider/_divider.scss +0 -124
- package/src/draggable/__tests__/__snapshots__/useDraggable.tsx.snap +0 -49
- package/src/draggable/__tests__/useDraggable.tsx +0 -540
- package/src/draggable/_draggable.scss +0 -29
- package/src/expansion-panel/__tests__/ExpansionPanel.tsx +0 -290
- package/src/expansion-panel/__tests__/__snapshots__/ExpansionPanel.tsx.snap +0 -197
- package/src/expansion-panel/_expansion-panel.scss +0 -107
- package/src/focus/__tests__/useFocusContainer.tsx +0 -280
- package/src/form/__tests__/Checkbox.tsx +0 -42
- package/src/form/__tests__/Fieldset.tsx +0 -44
- package/src/form/__tests__/FileInput.tsx +0 -120
- package/src/form/__tests__/Label.tsx +0 -69
- package/src/form/__tests__/Legend.tsx +0 -34
- package/src/form/__tests__/MenuItemCheckbox.tsx +0 -53
- package/src/form/__tests__/MenuItemRadio.tsx +0 -53
- package/src/form/__tests__/Radio.tsx +0 -35
- package/src/form/__tests__/Select.tsx +0 -439
- package/src/form/__tests__/Switch.tsx +0 -152
- package/src/form/__tests__/TextArea.tsx +0 -433
- package/src/form/__tests__/TextField.tsx +0 -195
- package/src/form/__tests__/__snapshots__/Checkbox.tsx.snap +0 -99
- package/src/form/__tests__/__snapshots__/Fieldset.tsx.snap +0 -58
- package/src/form/__tests__/__snapshots__/FileInput.tsx.snap +0 -612
- package/src/form/__tests__/__snapshots__/Label.tsx.snap +0 -140
- package/src/form/__tests__/__snapshots__/Legend.tsx.snap +0 -30
- package/src/form/__tests__/__snapshots__/MenuItemCheckbox.tsx.snap +0 -96
- package/src/form/__tests__/__snapshots__/MenuItemRadio.tsx.snap +0 -96
- package/src/form/__tests__/__snapshots__/Radio.tsx.snap +0 -99
- package/src/form/__tests__/__snapshots__/Select.tsx.snap +0 -492
- package/src/form/__tests__/__snapshots__/Switch.tsx.snap +0 -428
- package/src/form/__tests__/__snapshots__/TextArea.tsx.snap +0 -548
- package/src/form/__tests__/__snapshots__/TextField.tsx.snap +0 -279
- package/src/form/__tests__/__snapshots__/useCheckboxGroup.tsx.snap +0 -481
- package/src/form/__tests__/__snapshots__/useRadioGroup.tsx.snap +0 -704
- package/src/form/__tests__/useCheckboxGroup.tsx +0 -292
- package/src/form/__tests__/useFileUpload.tsx +0 -289
- package/src/form/__tests__/useFormReset.tsx +0 -194
- package/src/form/__tests__/useRadioGroup.tsx +0 -227
- package/src/form/__tests__/utils.ts +0 -247
- package/src/form/_form.scss +0 -2190
- package/src/icon/__tests__/FontIcon.tsx +0 -45
- package/src/icon/__tests__/IconRotator.tsx +0 -120
- package/src/icon/__tests__/MaterialIcon.tsx +0 -79
- package/src/icon/__tests__/MaterialSymbol.tsx +0 -100
- package/src/icon/__tests__/SVGIcon.tsx +0 -40
- package/src/icon/__tests__/TextIconSpacing.tsx +0 -108
- package/src/icon/__tests__/__snapshots__/FontIcon.tsx.snap +0 -35
- package/src/icon/__tests__/__snapshots__/IconRotator.tsx.snap +0 -165
- package/src/icon/__tests__/__snapshots__/MaterialIcon.tsx.snap +0 -82
- package/src/icon/__tests__/__snapshots__/MaterialSymbol.tsx.snap +0 -42
- package/src/icon/__tests__/__snapshots__/SVGIcon.tsx.snap +0 -47
- package/src/icon/__tests__/__snapshots__/TextIconSpacing.tsx.snap +0 -101
- package/src/icon/__tests__/__snapshots__/styles.ts.snap +0 -29
- package/src/icon/__tests__/styles.ts +0 -28
- package/src/icon/_icon.scss +0 -213
- package/src/interaction/__tests__/UserInteractionModeProvider.tsx +0 -121
- package/src/interaction/__tests__/__snapshots__/useHigherContrastChildren.tsx.snap +0 -79
- package/src/interaction/__tests__/useHigherContrastChildren.tsx +0 -97
- package/src/interaction/_interaction.scss +0 -436
- package/src/layout/__tests__/LayoutAppBar.tsx +0 -117
- package/src/layout/__tests__/LayoutNav.tsx +0 -78
- package/src/layout/__tests__/LayoutWindowSplitter.tsx +0 -63
- package/src/layout/__tests__/Main.tsx +0 -51
- package/src/layout/__tests__/__snapshots__/LayoutAppBar.tsx.snap +0 -78
- package/src/layout/__tests__/__snapshots__/LayoutNav.tsx.snap +0 -31
- package/src/layout/__tests__/__snapshots__/LayoutWindowSplitter.tsx.snap +0 -60
- package/src/layout/__tests__/__snapshots__/Main.tsx.snap +0 -32
- package/src/layout/__tests__/__snapshots__/useExpandableLayout.tsx.snap +0 -116
- package/src/layout/__tests__/__snapshots__/useLayoutTree.tsx.snap +0 -676
- package/src/layout/__tests__/__snapshots__/useResizableLayout.tsx.snap +0 -95
- package/src/layout/__tests__/__snapshots__/useTemporaryLayout.tsx.snap +0 -141
- package/src/layout/__tests__/useExpandableLayout.tsx +0 -279
- package/src/layout/__tests__/useLayoutTree.tsx +0 -212
- package/src/layout/__tests__/useResizableLayout.tsx +0 -170
- package/src/layout/__tests__/useTemporaryLayout.tsx +0 -109
- package/src/layout/_layout.scss +0 -163
- package/src/link/__tests__/Link.tsx +0 -31
- package/src/link/__tests__/SkipToMainContent.tsx +0 -125
- package/src/link/__tests__/__snapshots__/Link.tsx.snap +0 -20
- package/src/link/__tests__/__snapshots__/SkipToMainContent.tsx.snap +0 -22
- package/src/link/_link.scss +0 -149
- package/src/list/__tests__/List.tsx +0 -58
- package/src/list/__tests__/ListItem.tsx +0 -280
- package/src/list/__tests__/ListItemLink.tsx +0 -89
- package/src/list/__tests__/ListSubheader.tsx +0 -81
- package/src/list/__tests__/__snapshots__/List.tsx.snap +0 -41
- package/src/list/__tests__/__snapshots__/ListItem.tsx.snap +0 -414
- package/src/list/__tests__/__snapshots__/ListItemLink.tsx.snap +0 -73
- package/src/list/__tests__/__snapshots__/ListSubheader.tsx.snap +0 -99
- package/src/list/__tests__/getListItemHeight.ts +0 -176
- package/src/list/_list.scss +0 -322
- package/src/media-queries/__tests__/AppSizeProvider.node.tsx +0 -37
- package/src/media-queries/__tests__/AppSizeProvider.tsx +0 -119
- package/src/media-queries/__tests__/useMediaQuery.node.tsx +0 -20
- package/src/media-queries/__tests__/useMediaQuery.tsx +0 -59
- package/src/media-queries/_media-queries.scss +0 -63
- package/src/menu/__tests__/DropdownMenu.tsx +0 -627
- package/src/menu/__tests__/MenuBar.tsx +0 -354
- package/src/menu/__tests__/MenuItemCircularProgress.tsx +0 -39
- package/src/menu/__tests__/MenuVisibilityProvider.tsx +0 -34
- package/src/menu/__tests__/__snapshots__/DropdownMenu.tsx.snap +0 -292
- package/src/menu/__tests__/__snapshots__/MenuBar.tsx.snap +0 -87
- package/src/menu/__tests__/__snapshots__/MenuItemCircularProgress.tsx.snap +0 -68
- package/src/menu/__tests__/__snapshots__/useContextMenu.tsx.snap +0 -54
- package/src/menu/__tests__/useContextMenu.tsx +0 -41
- package/src/menu/__tests__/utils.ts +0 -121
- package/src/menu/_menu.scss +0 -116
- package/src/movement/__tests__/findMatchIndex.ts +0 -244
- package/src/movement/__tests__/utils.ts +0 -710
- package/src/navigation/__tests__/Navigation.tsx +0 -97
- package/src/navigation/__tests__/__snapshots__/Navigation.tsx.snap +0 -165
- package/src/navigation/_navigation.scss +0 -99
- package/src/overlay/__tests__/Overlay.tsx +0 -198
- package/src/overlay/__tests__/__snapshots__/Overlay.tsx.snap +0 -77
- package/src/overlay/_overlay.scss +0 -74
- package/src/portal/__tests__/PortalContainerProvider.node.tsx +0 -26
- package/src/portal/__tests__/PortalContainerProvider.tsx +0 -84
- package/src/positioning/__tests__/__snapshots__/useFixedPositioning.tsx.snap +0 -87
- package/src/positioning/__tests__/createHorizontalPosition.ts +0 -777
- package/src/positioning/__tests__/createVerticalPosition.ts +0 -464
- package/src/positioning/__tests__/useFixedPositioning.tsx +0 -205
- package/src/positioning/__tests__/utils.ts +0 -1311
- package/src/progress/__tests__/CircularProgress.tsx +0 -153
- package/src/progress/__tests__/LinearProgress.tsx +0 -131
- package/src/progress/__tests__/__snapshots__/CircularProgress.tsx.snap +0 -499
- package/src/progress/__tests__/__snapshots__/LinearProgress.tsx.snap +0 -321
- package/src/progress/__tests__/getProgressA11y.ts +0 -16
- package/src/progress/_progress.scss +0 -577
- package/src/responsive-item/__tests__/ResponsiveItemContainer.tsx +0 -56
- package/src/responsive-item/__tests__/ResponsiveItemOverlay.tsx +0 -66
- package/src/responsive-item/__tests__/__snapshots__/ResponsiveItemContainer.tsx.snap +0 -85
- package/src/responsive-item/__tests__/__snapshots__/ResponsiveItemOverlay.tsx.snap +0 -151
- package/src/responsive-item/__tests__/__snapshots__/styles.ts.snap +0 -9
- package/src/responsive-item/__tests__/styles.ts +0 -32
- package/src/responsive-item/_responsive-item.scss +0 -199
- package/src/searching/__tests__/caseInsensitive.ts +0 -165
- package/src/searching/__tests__/fuzzy.ts +0 -169
- package/src/searching/__tests__/toSearchQuery.ts +0 -21
- package/src/searching/__tests__/useFuzzyMatch.tsx +0 -200
- package/src/segmented-button/__tests__/SegmentedButton.tsx +0 -61
- package/src/segmented-button/__tests__/SegmentedButtonContainer.tsx +0 -38
- package/src/segmented-button/__tests__/__snapshots__/SegmentedButton.tsx.snap +0 -116
- package/src/segmented-button/__tests__/__snapshots__/SegmentedButtonContainer.tsx.snap +0 -22
- package/src/segmented-button/_segmented-button.scss +0 -208
- package/src/sheet/_sheet.scss +0 -189
- package/src/snackbar/__tests__/Snackbar.tsx +0 -85
- package/src/snackbar/__tests__/Toast.tsx +0 -105
- package/src/snackbar/__tests__/ToastActionButton.tsx +0 -112
- package/src/snackbar/__tests__/ToastCloseButton.tsx +0 -140
- package/src/snackbar/__tests__/ToastContent.tsx +0 -88
- package/src/snackbar/__tests__/ToastManagerProvider.tsx +0 -852
- package/src/snackbar/__tests__/__snapshots__/Snackbar.tsx.snap +0 -176
- package/src/snackbar/__tests__/__snapshots__/Toast.tsx.snap +0 -52
- package/src/snackbar/__tests__/__snapshots__/ToastActionButton.tsx.snap +0 -36
- package/src/snackbar/__tests__/__snapshots__/ToastCloseButton.tsx.snap +0 -104
- package/src/snackbar/__tests__/__snapshots__/ToastContent.tsx.snap +0 -26
- package/src/snackbar/__tests__/__snapshots__/ToastManagerProvider.tsx.snap +0 -290
- package/src/snackbar/_snackbar.scss +0 -266
- package/src/suspense/__tests__/CircularProgressSuspense.tsx +0 -90
- package/src/suspense/__tests__/NullSuspense.tsx +0 -46
- package/src/suspense/__tests__/__snapshots__/CircularProgressSuspense.tsx.snap +0 -24
- package/src/table/__tests__/Table.tsx +0 -314
- package/src/table/__tests__/TableBody.tsx +0 -52
- package/src/table/__tests__/TableCheckbox.tsx +0 -89
- package/src/table/__tests__/TableContainer.tsx +0 -31
- package/src/table/__tests__/TableRadio.tsx +0 -112
- package/src/table/__tests__/TableRow.tsx +0 -63
- package/src/table/__tests__/__snapshots__/Table.tsx.snap +0 -2426
- package/src/table/__tests__/__snapshots__/TableBody.tsx.snap +0 -54
- package/src/table/__tests__/__snapshots__/TableCheckbox.tsx.snap +0 -142
- package/src/table/__tests__/__snapshots__/TableContainer.tsx.snap +0 -16
- package/src/table/__tests__/__snapshots__/TableRadio.tsx.snap +0 -138
- package/src/table/__tests__/__snapshots__/TableRow.tsx.snap +0 -56
- package/src/table/__tests__/__snapshots__/tableContainerStyles.ts.snap +0 -3
- package/src/table/__tests__/__snapshots__/tableRowStyles.ts.snap +0 -3
- package/src/table/__tests__/__snapshots__/tableStyles.ts.snap +0 -3
- package/src/table/__tests__/tableContainerStyles.ts +0 -8
- package/src/table/__tests__/tableRowStyles.ts +0 -8
- package/src/table/__tests__/tableStyles.ts +0 -8
- package/src/table/_table.scss +0 -447
- package/src/tabs/__tests__/Tab.tsx +0 -51
- package/src/tabs/__tests__/TabList.tsx +0 -640
- package/src/tabs/__tests__/__snapshots__/Tab.tsx.snap +0 -85
- package/src/tabs/__tests__/__snapshots__/TabList.tsx.snap +0 -51
- package/src/tabs/__tests__/useTabs.tsx +0 -212
- package/src/tabs/_tabs.scss +0 -273
- package/src/test-utils/__tests__/ResizeObserver.ts +0 -171
- package/src/theme/__tests__/LocalStorageColorSchemeProvider.tsx +0 -162
- package/src/theme/__tests__/ThemeProvider.tsx +0 -90
- package/src/theme/__tests__/__snapshots__/useCSSVariables.tsx.snap +0 -27
- package/src/theme/__tests__/__snapshots__/useColorSchemeMetaTag.tsx.snap +0 -15
- package/src/theme/__tests__/useCSSVariables.tsx +0 -177
- package/src/theme/__tests__/useColorSchemeMetaTag.tsx +0 -36
- package/src/theme/__tests__/utils.ts +0 -67
- package/src/theme/_a11y.scss +0 -114
- package/src/theme/_colors.scss +0 -1057
- package/src/theme/_theme.scss +0 -519
- package/src/tooltip/__tests__/Tooltip.tsx +0 -501
- package/src/tooltip/__tests__/TooltipHoverModeProvider.tsx +0 -94
- package/src/tooltip/__tests__/__snapshots__/Tooltip.tsx.snap +0 -34
- package/src/tooltip/__tests__/utils.ts +0 -94
- package/src/tooltip/_tooltip.scss +0 -155
- package/src/transition/__tests__/CSSTransition.tsx +0 -182
- package/src/transition/__tests__/Collapse.tsx +0 -209
- package/src/transition/__tests__/CrossFade.tsx +0 -227
- package/src/transition/__tests__/ScaleTransition.tsx +0 -204
- package/src/transition/__tests__/SkeletonPlaceholder.tsx +0 -72
- package/src/transition/__tests__/__snapshots__/CSSTransition.tsx.snap +0 -145
- package/src/transition/__tests__/__snapshots__/Collapse.tsx.snap +0 -224
- package/src/transition/__tests__/__snapshots__/CrossFade.tsx.snap +0 -240
- package/src/transition/__tests__/__snapshots__/ScaleTransition.tsx.snap +0 -239
- package/src/transition/__tests__/__snapshots__/SkeletonPlaceholder.tsx.snap +0 -24
- package/src/transition/__tests__/__snapshots__/useCollapseTransition.tsx.snap +0 -361
- package/src/transition/__tests__/__snapshots__/useCrossFadeTransition.tsx.snap +0 -258
- package/src/transition/__tests__/__snapshots__/useMaxWidthTransition.tsx.snap +0 -68
- package/src/transition/__tests__/__snapshots__/useScaleTransition.tsx.snap +0 -209
- package/src/transition/__tests__/useCSSTransition.tsx +0 -190
- package/src/transition/__tests__/useCollapseTransition.tsx +0 -316
- package/src/transition/__tests__/useCrossFadeTransition.tsx +0 -229
- package/src/transition/__tests__/useMaxWidthTransition.tsx +0 -123
- package/src/transition/__tests__/useScaleTransition.tsx +0 -212
- package/src/transition/__tests__/useTransition.tsx +0 -569
- package/src/transition/__tests__/utils.ts +0 -620
- package/src/transition/_transition.scss +0 -365
- package/src/tree/__tests__/Tree.tsx +0 -735
- package/src/tree/__tests__/TreeGroup.tsx +0 -76
- package/src/tree/__tests__/TreeItemExpander.tsx +0 -74
- package/src/tree/__tests__/__snapshots__/Tree.tsx.snap +0 -3618
- package/src/tree/__tests__/__snapshots__/TreeItemExpander.tsx.snap +0 -11
- package/src/tree/__tests__/utils.ts +0 -98
- package/src/tree/_tree.scss +0 -176
- package/src/typography/__tests__/SrOnly.tsx +0 -43
- package/src/typography/__tests__/TextContainer.tsx +0 -45
- package/src/typography/__tests__/Typography.tsx +0 -87
- package/src/typography/__tests__/WritingDirectionProvider.node.tsx +0 -27
- package/src/typography/__tests__/WritingDirectionProvider.tsx +0 -119
- package/src/typography/__tests__/__snapshots__/SrOnly.tsx.snap +0 -56
- package/src/typography/__tests__/__snapshots__/TextContainer.tsx.snap +0 -29
- package/src/typography/__tests__/__snapshots__/Typography.tsx.snap +0 -112
- package/src/typography/_typography.scss +0 -399
- package/src/utils/__tests__/RenderRecursively.tsx +0 -87
- package/src/utils/__tests__/__snapshots__/RenderRecursively.tsx.snap +0 -80
- package/src/utils/__tests__/applyRef.ts +0 -30
- package/src/utils/__tests__/bem.ts +0 -54
- package/src/utils/__tests__/getMiddleOfRange.ts +0 -12
- package/src/utils/__tests__/getPercentage.ts +0 -104
- package/src/utils/__tests__/getRangeDefaultValue.ts +0 -47
- package/src/utils/__tests__/getRangeSteps.ts +0 -14
- package/src/utils/__tests__/loop.ts +0 -50
- package/src/utils/__tests__/nearest.ts +0 -83
- package/src/utils/__tests__/parseCssLengthUnit.node.ts +0 -28
- package/src/utils/__tests__/parseCssLengthUnit.ts +0 -47
- package/src/utils/__tests__/wait.ts +0 -12
- package/src/utils/__tests__/withinRange.ts +0 -24
- package/src/window-splitter/_window-splitter.scss +0 -143
- package/tsconfig.json +0 -19
- package/tsconfig.types.json +0 -12
- package/tsdoc.json +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/icon/materialConfig.ts"],"sourcesContent":["import { type CSSProperties } from \"react\";\nimport {\n type MaterialIconFamily,\n type MaterialSymbolFamily,\n} from \"./material.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialIconCustomization {\n /**\n * @defaultValue `\"filled\"`\n */\n iconFamily?: MaterialIconFamily;\n}\n\n/**\n * @since 6.0.0\n */\nexport type MaterialIconConfiguration = Required<MaterialIconCustomization>;\n\n/**\n * Fill gives you the ability to modify the default icon style. A single icon\n * can render both unfilled and filled states.\n *\n * To convey a state transition, use the fill axis for animation or\n * interaction. The values are 0 for default or 1 for completely filled. Along\n * with the weight axis, the fill also impacts the look of the icon.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolFill = 0 | 1;\n\n/**\n * Weight defines the symbol’s stroke weight, with a range of weights between\n * thin (100) and bold (700). Weight can also affect the overall size of the\n * symbol.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700;\n\n/**\n * Weight and grade affect a symbol’s thickness. Adjustments to grade are more\n * granular than adjustments to weight and have a small impact on the size of\n * the symbol.\n *\n * Grade is also available in some text fonts. You can match grade levels\n * between text and symbols for a harmonious visual effect. For example, if\n * the text font has a -25 grade value, the symbols can match it with a\n * suitable value, say -25.\n *\n * You can use grade for different needs:\n *\n * - Low emphasis (e.g. -25 grade): To reduce glare for a light symbol on a\n * dark background, use a low grade.\n * - High emphasis (e.g. 200 grade): To highlight a symbol, increase the\n * positive grade.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolGrade = -25 | 0 | 200;\n\n/**\n * Optical Sizes range from 20dp to 48dp.\n *\n * For the image to look the same at different sizes, the stroke weight\n * (thickness) changes as the icon size scales. Optical Size offers a way to\n * automatically adjust the stroke weight when you increase or decrease the\n * symbol size.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolOpticalSize = 20 | 24 | 40 | 48;\n\n/**\n * The comments for each customizable part was copied from\n * https://fonts.google.com/icons?icon.set=Material+Symbols and clicking the\n * info icon next to each property.\n *\n * @see https://fonts.google.com/icons?icon.set=Material+Symbols\n * @since 6.0.0\n */\nexport interface MaterialSymbolCustomization {\n /**\n * Fill gives you the ability to modify the default icon style. A single icon\n * can render both unfilled and filled states.\n *\n * To convey a state transition, use the fill axis for animation or\n * interaction. The values are 0 for default or 1 for completely filled. Along\n * with the weight axis, the fill also impacts the look of the icon.\n *\n * @defaultValue `0`\n */\n fill?: MaterialSymbolFill;\n\n /**\n * Weight defines the symbol’s stroke weight, with a range of weights between\n * thin (100) and bold (700). Weight can also affect the overall size of the\n * symbol.\n *\n * @defaultValue `400`\n */\n weight?: MaterialSymbolWeight;\n\n /**\n * Weight and grade affect a symbol’s thickness. Adjustments to grade are more\n * granular than adjustments to weight and have a small impact on the size of\n * the symbol.\n *\n * Grade is also available in some text fonts. You can match grade levels\n * between text and symbols for a harmonious visual effect. For example, if\n * the text font has a -25 grade value, the symbols can match it with a\n * suitable value, say -25.\n *\n * You can use grade for different needs:\n *\n * - Low emphasis (e.g. -25 grade): To reduce glare for a light symbol on a\n * dark background, use a low grade.\n * - High emphasis (e.g. 200 grade): To highlight a symbol, increase the\n * positive grade.\n *\n * @defaultValue `0`\n */\n grade?: MaterialSymbolGrade;\n\n /**\n * Optical Sizes range from 20dp to 48dp.\n *\n * For the image to look the same at different sizes, the stroke weight\n * (thickness) changes as the icon size scales. Optical Size offers a way to\n * automatically adjust the stroke weight when you increase or decrease the\n * symbol size.\n *\n * @defaultValue `48`\n */\n opticalSize?: MaterialSymbolOpticalSize;\n\n /**\n * @defaultValue `\"outlined\"`\n */\n family?: MaterialSymbolFamily;\n}\n\n/**\n * @since 6.0.0\n */\nexport type MaterialSymbolConfiguration = Required<MaterialSymbolCustomization>;\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialConfiguration\n extends MaterialIconConfiguration,\n MaterialSymbolConfiguration {}\n\n/**\n * @since 6.0.0\n */\nexport const MATERIAL_CONFIG: MaterialConfiguration = {\n fill: 0,\n weight: 400,\n grade: 0,\n opticalSize: 48,\n iconFamily: \"filled\",\n family: \"outlined\",\n};\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialSymbolFontVariationSettings {\n style?: CSSProperties;\n family: MaterialSymbolFamily;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport function getFontVariationSettings(\n options: MaterialSymbolCustomization & { style?: CSSProperties }\n): MaterialSymbolFontVariationSettings {\n let { style } = options;\n const {\n fill = MATERIAL_CONFIG.fill,\n grade = MATERIAL_CONFIG.grade,\n opticalSize = MATERIAL_CONFIG.opticalSize,\n weight = MATERIAL_CONFIG.weight,\n family: symbolFamily = MATERIAL_CONFIG.family,\n } = options;\n if (\n !style?.fontVariationSettings &&\n (fill !== MATERIAL_CONFIG.fill ||\n grade !== MATERIAL_CONFIG.grade ||\n opticalSize !== MATERIAL_CONFIG.opticalSize ||\n weight !== MATERIAL_CONFIG.weight)\n ) {\n style = {\n ...style,\n fontVariationSettings: `\"FILL\" ${fill}, \"wght\" ${weight}, \"GRAD\" ${grade}, \"opsz\" ${opticalSize}`,\n };\n }\n\n return { family: symbolFamily, style };\n}\n"],"names":["MATERIAL_CONFIG","fill","weight","grade","opticalSize","iconFamily","family","getFontVariationSettings","options","style","symbolFamily","fontVariationSettings"],"
|
|
1
|
+
{"version":3,"sources":["../../src/icon/materialConfig.ts"],"sourcesContent":["import { type CSSProperties } from \"react\";\nimport {\n type MaterialIconFamily,\n type MaterialSymbolFamily,\n} from \"./material.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialIconCustomization {\n /**\n * @defaultValue `\"filled\"`\n */\n iconFamily?: MaterialIconFamily;\n}\n\n/**\n * @since 6.0.0\n */\nexport type MaterialIconConfiguration = Required<MaterialIconCustomization>;\n\n/**\n * Fill gives you the ability to modify the default icon style. A single icon\n * can render both unfilled and filled states.\n *\n * To convey a state transition, use the fill axis for animation or\n * interaction. The values are 0 for default or 1 for completely filled. Along\n * with the weight axis, the fill also impacts the look of the icon.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolFill = 0 | 1;\n\n/**\n * Weight defines the symbol’s stroke weight, with a range of weights between\n * thin (100) and bold (700). Weight can also affect the overall size of the\n * symbol.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700;\n\n/**\n * Weight and grade affect a symbol’s thickness. Adjustments to grade are more\n * granular than adjustments to weight and have a small impact on the size of\n * the symbol.\n *\n * Grade is also available in some text fonts. You can match grade levels\n * between text and symbols for a harmonious visual effect. For example, if\n * the text font has a -25 grade value, the symbols can match it with a\n * suitable value, say -25.\n *\n * You can use grade for different needs:\n *\n * - Low emphasis (e.g. -25 grade): To reduce glare for a light symbol on a\n * dark background, use a low grade.\n * - High emphasis (e.g. 200 grade): To highlight a symbol, increase the\n * positive grade.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolGrade = -25 | 0 | 200;\n\n/**\n * Optical Sizes range from 20dp to 48dp.\n *\n * For the image to look the same at different sizes, the stroke weight\n * (thickness) changes as the icon size scales. Optical Size offers a way to\n * automatically adjust the stroke weight when you increase or decrease the\n * symbol size.\n *\n * @since 6.0.0\n */\nexport type MaterialSymbolOpticalSize = 20 | 24 | 40 | 48;\n\n/**\n * The comments for each customizable part was copied from\n * https://fonts.google.com/icons?icon.set=Material+Symbols and clicking the\n * info icon next to each property.\n *\n * @see https://fonts.google.com/icons?icon.set=Material+Symbols\n * @since 6.0.0\n */\nexport interface MaterialSymbolCustomization {\n /**\n * Fill gives you the ability to modify the default icon style. A single icon\n * can render both unfilled and filled states.\n *\n * To convey a state transition, use the fill axis for animation or\n * interaction. The values are 0 for default or 1 for completely filled. Along\n * with the weight axis, the fill also impacts the look of the icon.\n *\n * @defaultValue `0`\n */\n fill?: MaterialSymbolFill;\n\n /**\n * Weight defines the symbol’s stroke weight, with a range of weights between\n * thin (100) and bold (700). Weight can also affect the overall size of the\n * symbol.\n *\n * @defaultValue `400`\n */\n weight?: MaterialSymbolWeight;\n\n /**\n * Weight and grade affect a symbol’s thickness. Adjustments to grade are more\n * granular than adjustments to weight and have a small impact on the size of\n * the symbol.\n *\n * Grade is also available in some text fonts. You can match grade levels\n * between text and symbols for a harmonious visual effect. For example, if\n * the text font has a -25 grade value, the symbols can match it with a\n * suitable value, say -25.\n *\n * You can use grade for different needs:\n *\n * - Low emphasis (e.g. -25 grade): To reduce glare for a light symbol on a\n * dark background, use a low grade.\n * - High emphasis (e.g. 200 grade): To highlight a symbol, increase the\n * positive grade.\n *\n * @defaultValue `0`\n */\n grade?: MaterialSymbolGrade;\n\n /**\n * Optical Sizes range from 20dp to 48dp.\n *\n * For the image to look the same at different sizes, the stroke weight\n * (thickness) changes as the icon size scales. Optical Size offers a way to\n * automatically adjust the stroke weight when you increase or decrease the\n * symbol size.\n *\n * @defaultValue `48`\n */\n opticalSize?: MaterialSymbolOpticalSize;\n\n /**\n * @defaultValue `\"outlined\"`\n */\n family?: MaterialSymbolFamily;\n}\n\n/**\n * @since 6.0.0\n */\nexport type MaterialSymbolConfiguration = Required<MaterialSymbolCustomization>;\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialConfiguration\n extends MaterialIconConfiguration,\n MaterialSymbolConfiguration {}\n\n/**\n * @since 6.0.0\n */\nexport const MATERIAL_CONFIG: MaterialConfiguration = {\n fill: 0,\n weight: 400,\n grade: 0,\n opticalSize: 48,\n iconFamily: \"filled\",\n family: \"outlined\",\n};\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialSymbolFontVariationSettings {\n style?: CSSProperties;\n family: MaterialSymbolFamily;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport function getFontVariationSettings(\n options: MaterialSymbolCustomization & { style?: CSSProperties }\n): MaterialSymbolFontVariationSettings {\n let { style } = options;\n const {\n fill = MATERIAL_CONFIG.fill,\n grade = MATERIAL_CONFIG.grade,\n opticalSize = MATERIAL_CONFIG.opticalSize,\n weight = MATERIAL_CONFIG.weight,\n family: symbolFamily = MATERIAL_CONFIG.family,\n } = options;\n if (\n !style?.fontVariationSettings &&\n (fill !== MATERIAL_CONFIG.fill ||\n grade !== MATERIAL_CONFIG.grade ||\n opticalSize !== MATERIAL_CONFIG.opticalSize ||\n weight !== MATERIAL_CONFIG.weight)\n ) {\n style = {\n ...style,\n fontVariationSettings: `\"FILL\" ${fill}, \"wght\" ${weight}, \"GRAD\" ${grade}, \"opsz\" ${opticalSize}`,\n };\n }\n\n return { family: symbolFamily, style };\n}\n"],"names":["MATERIAL_CONFIG","fill","weight","grade","opticalSize","iconFamily","family","getFontVariationSettings","options","style","symbolFamily","fontVariationSettings"],"mappings":"AA4JA;;CAEC,GACD,OAAO,MAAMA,kBAAyC;IACpDC,MAAM;IACNC,QAAQ;IACRC,OAAO;IACPC,aAAa;IACbC,YAAY;IACZC,QAAQ;AACV,EAAE;AAUF;;;CAGC,GACD,OAAO,SAASC,yBACdC,OAAgE;IAEhE,IAAI,EAAEC,KAAK,EAAE,GAAGD;IAChB,MAAM,EACJP,OAAOD,gBAAgBC,IAAI,EAC3BE,QAAQH,gBAAgBG,KAAK,EAC7BC,cAAcJ,gBAAgBI,WAAW,EACzCF,SAASF,gBAAgBE,MAAM,EAC/BI,QAAQI,eAAeV,gBAAgBM,MAAM,EAC9C,GAAGE;IACJ,IACE,CAACC,OAAOE,yBACPV,CAAAA,SAASD,gBAAgBC,IAAI,IAC5BE,UAAUH,gBAAgBG,KAAK,IAC/BC,gBAAgBJ,gBAAgBI,WAAW,IAC3CF,WAAWF,gBAAgBE,MAAM,AAAD,GAClC;QACAO,QAAQ;YACN,GAAGA,KAAK;YACRE,uBAAuB,CAAC,OAAO,EAAEV,KAAK,SAAS,EAAEC,OAAO,SAAS,EAAEC,MAAM,SAAS,EAAEC,YAAY,CAAC;QACnG;IACF;IAEA,OAAO;QAAEE,QAAQI;QAAcD;IAAM;AACvC"}
|
package/dist/icon/styles.js
CHANGED
|
@@ -16,7 +16,7 @@ const rotatorStyles = bem("rmd-icon-rotator");
|
|
|
16
16
|
svg: isSvg,
|
|
17
17
|
font: isFont || isMaterial,
|
|
18
18
|
symbol: isSymbol,
|
|
19
|
-
|
|
19
|
+
vam: inline,
|
|
20
20
|
dense
|
|
21
21
|
}), isSymbol && `material-symbols-${family}`, isMaterial && `material-icons${family === "filled" ? "" : `-${family === "rounded" ? "round" : family}`}`, cssUtils({
|
|
22
22
|
textColor: theme
|
package/dist/icon/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/icon/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils, type TextColor, type ThemeColor } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\nimport type { MaterialIconFamily, MaterialSymbolFamily } from \"./material.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-icon-color\"?: string;\n \"--rmd-icon-size\"?: string | number;\n \"--rmd-icon-spacing\"?: string | number;\n \"--rmd-icon-rotate-from\"?: string | number;\n \"--rmd-icon-rotate-to\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-icon\");\nconst rotatorStyles = bem(\"rmd-icon-rotator\");\n\n/** @since 6.0.0 */\nexport interface SVGIconClassNameOptions {\n className?: string;\n\n /**\n * An optional theme color to apply to the icon. When this is `undefined`, the\n * default icon color will be used instead.\n *\n * - `primary -> $primary-color`\n * - `secondary -> $secondary-color`\n * - `warning -> $warning-color`\n * - `success -> $success-color`\n * - `error -> $error-color`\n * - `text-primary -> $text-primary-color`\n * - `text-secondary -> $text-primary-color`\n * - `text-hint -> $text-hint-color`\n * - `text-disabled -> $text-disabled-color`\n */\n theme?: ThemeColor | TextColor;\n\n /**\n * Boolean if the font icon should use the dense spec.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` if the icon should display inline with other text (like\n * a paragraph) by applying `vertical-align: bottom`.\n *\n * @example\n * ```tsx\n * <Typography>\n * <InfoIcon inline className=\"rmd-icon--before\" />\n * Some additional information around xyz.\n * </Typography>\n * ```\n *\n * @defaultValue `false`\n */\n inline?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface FontIconClassNameOptions extends SVGIconClassNameOptions {\n /**\n * The font icon class name to use.\n *\n * @defaultValue `\"material-icons\"`\n */\n iconClassName?: string;\n}\n\n/** @since 6.0.0 */\nexport interface MaterialIconClassNameOptions extends SVGIconClassNameOptions {\n family: MaterialIconFamily;\n}\n\n/** @since 6.0.0 */\nexport interface MaterialSymbolClassNameOptions\n extends SVGIconClassNameOptions {\n family: MaterialSymbolFamily;\n}\n\n/** @since 6.0.0 */\nexport type IconClassNameOptions =\n | ({ type: \"font\" } & FontIconClassNameOptions)\n | ({ type: \"svg\" } & SVGIconClassNameOptions)\n | ({ type: \"material\" } & MaterialIconClassNameOptions)\n | ({ type: \"symbol\" } & MaterialSymbolClassNameOptions);\n\n/**\n *\n * @since 6.0.0\n */\nexport function icon(options: IconClassNameOptions): string {\n const {\n className,\n type,\n theme,\n family = \"\",\n dense = false,\n inline = false,\n iconClassName,\n } = options as FontIconClassNameOptions &\n SVGIconClassNameOptions & {\n type: \"font\" | \"svg\" | \"symbol\" | \"material\";\n family?: MaterialIconFamily;\n };\n\n const isFont = type === \"font\";\n const isSvg = type === \"svg\";\n const isSymbol = type === \"symbol\";\n const isMaterial = type === \"material\";\n\n return cnb(\n styles({\n svg: isSvg,\n font: isFont || isMaterial,\n symbol: isSymbol,\n
|
|
1
|
+
{"version":3,"sources":["../../src/icon/styles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils, type TextColor, type ThemeColor } from \"../cssUtils.js\";\nimport { bem } from \"../utils/bem.js\";\nimport type { MaterialIconFamily, MaterialSymbolFamily } from \"./material.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-icon-color\"?: string;\n \"--rmd-icon-size\"?: string | number;\n \"--rmd-icon-spacing\"?: string | number;\n \"--rmd-icon-rotate-from\"?: string | number;\n \"--rmd-icon-rotate-to\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-icon\");\nconst rotatorStyles = bem(\"rmd-icon-rotator\");\n\n/** @since 6.0.0 */\nexport interface SVGIconClassNameOptions {\n className?: string;\n\n /**\n * An optional theme color to apply to the icon. When this is `undefined`, the\n * default icon color will be used instead.\n *\n * - `primary -> $primary-color`\n * - `secondary -> $secondary-color`\n * - `warning -> $warning-color`\n * - `success -> $success-color`\n * - `error -> $error-color`\n * - `text-primary -> $text-primary-color`\n * - `text-secondary -> $text-primary-color`\n * - `text-hint -> $text-hint-color`\n * - `text-disabled -> $text-disabled-color`\n */\n theme?: ThemeColor | TextColor;\n\n /**\n * Boolean if the font icon should use the dense spec.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` if the icon should display inline with other text (like\n * a paragraph) by applying `vertical-align: bottom`.\n *\n * @example\n * ```tsx\n * <Typography>\n * <InfoIcon inline className=\"rmd-icon--before\" />\n * Some additional information around xyz.\n * </Typography>\n * ```\n *\n * @defaultValue `false`\n */\n inline?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface FontIconClassNameOptions extends SVGIconClassNameOptions {\n /**\n * The font icon class name to use.\n *\n * @defaultValue `\"material-icons\"`\n */\n iconClassName?: string;\n}\n\n/** @since 6.0.0 */\nexport interface MaterialIconClassNameOptions extends SVGIconClassNameOptions {\n family: MaterialIconFamily;\n}\n\n/** @since 6.0.0 */\nexport interface MaterialSymbolClassNameOptions\n extends SVGIconClassNameOptions {\n family: MaterialSymbolFamily;\n}\n\n/** @since 6.0.0 */\nexport type IconClassNameOptions =\n | ({ type: \"font\" } & FontIconClassNameOptions)\n | ({ type: \"svg\" } & SVGIconClassNameOptions)\n | ({ type: \"material\" } & MaterialIconClassNameOptions)\n | ({ type: \"symbol\" } & MaterialSymbolClassNameOptions);\n\n/**\n *\n * @since 6.0.0\n */\nexport function icon(options: IconClassNameOptions): string {\n const {\n className,\n type,\n theme,\n family = \"\",\n dense = false,\n inline = false,\n iconClassName,\n } = options as FontIconClassNameOptions &\n SVGIconClassNameOptions & {\n type: \"font\" | \"svg\" | \"symbol\" | \"material\";\n family?: MaterialIconFamily;\n };\n\n const isFont = type === \"font\";\n const isSvg = type === \"svg\";\n const isSymbol = type === \"symbol\";\n const isMaterial = type === \"material\";\n\n return cnb(\n styles({\n svg: isSvg,\n font: isFont || isMaterial,\n symbol: isSymbol,\n vam: inline,\n dense,\n }),\n isSymbol && `material-symbols-${family}`,\n isMaterial &&\n `material-icons${\n family === \"filled\" ? \"\" : `-${family === \"rounded\" ? \"round\" : family}`\n }`,\n cssUtils({\n textColor: theme,\n }),\n iconClassName,\n className\n );\n}\n\n/** @since 6.0.0 */\nexport interface IconRotatorClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the icon is currently rotated.\n */\n rotated: boolean;\n\n /**\n * Boolean if changing the {@link rotated} state should no longer transition.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n}\n\n/**\n *\n * @since 6.0.0\n */\nexport function iconRotator(options: IconRotatorClassNameOptions): string {\n const { className, rotated, disableTransition = false } = options;\n\n return cnb(\n rotatorStyles({\n animate: !disableTransition,\n rotated,\n }),\n className\n );\n}\n"],"names":["cnb","cssUtils","bem","styles","rotatorStyles","icon","options","className","type","theme","family","dense","inline","iconClassName","isFont","isSvg","isSymbol","isMaterial","svg","font","symbol","vam","textColor","iconRotator","rotated","disableTransition","animate"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAAyC,iBAAiB;AAC3E,SAASC,GAAG,QAAQ,kBAAkB;AAatC,MAAMC,SAASD,IAAI;AACnB,MAAME,gBAAgBF,IAAI;AA0E1B;;;CAGC,GACD,OAAO,SAASG,KAAKC,OAA6B;IAChD,MAAM,EACJC,SAAS,EACTC,IAAI,EACJC,KAAK,EACLC,SAAS,EAAE,EACXC,QAAQ,KAAK,EACbC,SAAS,KAAK,EACdC,aAAa,EACd,GAAGP;IAMJ,MAAMQ,SAASN,SAAS;IACxB,MAAMO,QAAQP,SAAS;IACvB,MAAMQ,WAAWR,SAAS;IAC1B,MAAMS,aAAaT,SAAS;IAE5B,OAAOR,IACLG,OAAO;QACLe,KAAKH;QACLI,MAAML,UAAUG;QAChBG,QAAQJ;QACRK,KAAKT;QACLD;IACF,IACAK,YAAY,CAAC,iBAAiB,EAAEN,OAAO,CAAC,EACxCO,cACE,CAAC,cAAc,EACbP,WAAW,WAAW,KAAK,CAAC,CAAC,EAAEA,WAAW,YAAY,UAAUA,OAAO,CAAC,CACzE,CAAC,EACJT,SAAS;QACPqB,WAAWb;IACb,IACAI,eACAN;AAEJ;AAmBA;;;CAGC,GACD,OAAO,SAASgB,YAAYjB,OAAoC;IAC9D,MAAM,EAAEC,SAAS,EAAEiB,OAAO,EAAEC,oBAAoB,KAAK,EAAE,GAAGnB;IAE1D,OAAON,IACLI,cAAc;QACZsB,SAAS,CAACD;QACVD;IACF,IACAjB;AAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/interaction/Ripple.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { type ReactElement } from \"react\";\nimport {\n type CSSTransitionClassNames,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\nimport { type RippleState, type RippleTransitionCallbacks } from \"./types.js\";\n\n/** @internal */\nexport const DEFAULT_RIPPLE_CLASSNAMES: Readonly<CSSTransitionClassNames> = {\n enter: \"rmd-ripple--animating\",\n enterActive: \"rmd-ripple--scaling\",\n enterDone: \"rmd-ripple--animating rmd-ripple--scaling\",\n exit: \"rmd-ripple--animating rmd-ripple--scaling\",\n exitActive: \"rmd-ripple--fading\",\n};\n\n/** @internal */\nexport const DEFAULT_RIPPLE_TIMEOUT: Readonly<TransitionTimeout> = {\n enter: 150,\n exit: 300,\n};\n\n/** @internal */\nexport interface RippleProps extends RippleTransitionCallbacks {\n className?: string;\n timeout?: TransitionTimeout;\n classNames?: CSSTransitionClassNames;\n ripple: RippleState;\n}\n\n/**\n * **Client Component**\n *\n * This component should only be used by the `RippleContainer` component.\n *\n * @internal\n */\nexport function Ripple(props: RippleProps): ReactElement {\n const {\n className,\n timeout = DEFAULT_RIPPLE_TIMEOUT,\n classNames = DEFAULT_RIPPLE_CLASSNAMES,\n ripple,\n onEntered,\n onExited,\n } = props;\n const { style, exiting } = ripple;\n const { elementProps, rendered } = useCSSTransition({\n appear: true,\n className: cnb(\"rmd-ripple\", className),\n transitionIn: !exiting,\n timeout,\n classNames,\n onEntered() {\n onEntered(ripple);\n },\n onExited() {\n onExited(ripple);\n },\n });\n\n return <>{rendered && <span style={style} {...elementProps} />}</>;\n}\n"],"names":["cnb","useCSSTransition","DEFAULT_RIPPLE_CLASSNAMES","enter","enterActive","enterDone","exit","exitActive","DEFAULT_RIPPLE_TIMEOUT","Ripple","props","className","timeout","classNames","ripple","onEntered","onExited","style","exiting","elementProps","rendered","appear","transitionIn","span"],"
|
|
1
|
+
{"version":3,"sources":["../../src/interaction/Ripple.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { type ReactElement } from \"react\";\nimport {\n type CSSTransitionClassNames,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\nimport { type RippleState, type RippleTransitionCallbacks } from \"./types.js\";\n\n/** @internal */\nexport const DEFAULT_RIPPLE_CLASSNAMES: Readonly<CSSTransitionClassNames> = {\n enter: \"rmd-ripple--animating\",\n enterActive: \"rmd-ripple--scaling\",\n enterDone: \"rmd-ripple--animating rmd-ripple--scaling\",\n exit: \"rmd-ripple--animating rmd-ripple--scaling\",\n exitActive: \"rmd-ripple--fading\",\n};\n\n/** @internal */\nexport const DEFAULT_RIPPLE_TIMEOUT: Readonly<TransitionTimeout> = {\n enter: 150,\n exit: 300,\n};\n\n/** @internal */\nexport interface RippleProps extends RippleTransitionCallbacks {\n className?: string;\n timeout?: TransitionTimeout;\n classNames?: CSSTransitionClassNames;\n ripple: RippleState;\n}\n\n/**\n * **Client Component**\n *\n * This component should only be used by the `RippleContainer` component.\n *\n * @internal\n */\nexport function Ripple(props: RippleProps): ReactElement {\n const {\n className,\n timeout = DEFAULT_RIPPLE_TIMEOUT,\n classNames = DEFAULT_RIPPLE_CLASSNAMES,\n ripple,\n onEntered,\n onExited,\n } = props;\n const { style, exiting } = ripple;\n const { elementProps, rendered } = useCSSTransition({\n appear: true,\n className: cnb(\"rmd-ripple\", className),\n transitionIn: !exiting,\n timeout,\n classNames,\n onEntered() {\n onEntered(ripple);\n },\n onExited() {\n onExited(ripple);\n },\n });\n\n return <>{rendered && <span style={style} {...elementProps} />}</>;\n}\n"],"names":["cnb","useCSSTransition","DEFAULT_RIPPLE_CLASSNAMES","enter","enterActive","enterDone","exit","exitActive","DEFAULT_RIPPLE_TIMEOUT","Ripple","props","className","timeout","classNames","ripple","onEntered","onExited","style","exiting","elementProps","rendered","appear","transitionIn","span"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAMhC,SAASC,gBAAgB,QAAQ,oCAAoC;AAGrE,cAAc,GACd,OAAO,MAAMC,4BAA+D;IAC1EC,OAAO;IACPC,aAAa;IACbC,WAAW;IACXC,MAAM;IACNC,YAAY;AACd,EAAE;AAEF,cAAc,GACd,OAAO,MAAMC,yBAAsD;IACjEL,OAAO;IACPG,MAAM;AACR,EAAE;AAUF;;;;;;CAMC,GACD,OAAO,SAASG,OAAOC,KAAkB;IACvC,MAAM,EACJC,SAAS,EACTC,UAAUJ,sBAAsB,EAChCK,aAAaX,yBAAyB,EACtCY,MAAM,EACNC,SAAS,EACTC,QAAQ,EACT,GAAGN;IACJ,MAAM,EAAEO,KAAK,EAAEC,OAAO,EAAE,GAAGJ;IAC3B,MAAM,EAAEK,YAAY,EAAEC,QAAQ,EAAE,GAAGnB,iBAAiB;QAClDoB,QAAQ;QACRV,WAAWX,IAAI,cAAcW;QAC7BW,cAAc,CAACJ;QACfN;QACAC;QACAE;YACEA,UAAUD;QACZ;QACAE;YACEA,SAASF;QACX;IACF;IAEA,qBAAO;kBAAGM,0BAAY,KAACG;YAAKN,OAAOA;YAAQ,GAAGE,YAAY;;;AAC5D"}
|
|
@@ -11,8 +11,6 @@ export interface RippleContainerProps extends ProvidedRippleContainerProps {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* **Server Component**
|
|
15
|
-
*
|
|
16
14
|
* This component should generally only be used internally within `react-md`
|
|
17
15
|
* unless you are implementing a custom component interaction with
|
|
18
16
|
* `useElementInteraction`.
|
|
@@ -2,8 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { cnb } from "cnbuilder";
|
|
3
3
|
import { Ripple } from "./Ripple.js";
|
|
4
4
|
/**
|
|
5
|
-
* **Server Component**
|
|
6
|
-
*
|
|
7
5
|
* This component should generally only be used internally within `react-md`
|
|
8
6
|
* unless you are implementing a custom component interaction with
|
|
9
7
|
* `useElementInteraction`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/interaction/RippleContainer.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type ReactElement } from \"react\";\nimport { Ripple } from \"./Ripple.js\";\nimport { type ProvidedRippleContainerProps } from \"./types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-ripple-inset\"?: string | number;\n \"--rmd-ripple-border-radius\"?: string | number;\n }\n}\n\n/** @internal */\nexport interface RippleContainerProps extends ProvidedRippleContainerProps {\n className?: string;\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/interaction/RippleContainer.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type ReactElement } from \"react\";\nimport { Ripple } from \"./Ripple.js\";\nimport { type ProvidedRippleContainerProps } from \"./types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-ripple-inset\"?: string | number;\n \"--rmd-ripple-border-radius\"?: string | number;\n }\n}\n\n/** @internal */\nexport interface RippleContainerProps extends ProvidedRippleContainerProps {\n className?: string;\n}\n\n/**\n * This component should generally only be used internally within `react-md`\n * unless you are implementing a custom component interaction with\n * `useElementInteraction`.\n *\n * @see {@link useElementInteraction} for example usage.\n */\nexport function RippleContainer(props: RippleContainerProps): ReactElement {\n const { className, ripples, onEntered, onExited } = props;\n\n return (\n <span className={cnb(\"rmd-ripple-container\", className)}>\n {ripples.map((ripple) => (\n <Ripple\n key={ripple.startTime}\n ripple={ripple}\n onEntered={onEntered}\n onExited={onExited}\n />\n ))}\n </span>\n );\n}\n"],"names":["cnb","Ripple","RippleContainer","props","className","ripples","onEntered","onExited","span","map","ripple","startTime"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAEhC,SAASC,MAAM,QAAQ,cAAc;AAerC;;;;;;CAMC,GACD,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,SAAS,EAAEC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGJ;IAEpD,qBACE,KAACK;QAAKJ,WAAWJ,IAAI,wBAAwBI;kBAC1CC,QAAQI,GAAG,CAAC,CAACC,uBACZ,KAACT;gBAECS,QAAQA;gBACRJ,WAAWA;gBACXC,UAAUA;eAHLG,OAAOC,SAAS;;AAQ/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/interaction/UserInteractionModeProvider.tsx"],"sourcesContent":["\"use client\";\nimport {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactElement,\n type ReactNode,\n} from \"react\";\n\n/**\n * This is the current mode for how your user is interacting with your app. This\n * will be used to determine which type of state styles should be applied at the\n * time of interacting with an element on your page.\n *\n * @defaultValue `\"mouse\"`\n */\nexport type UserInteractionMode = \"keyboard\" | \"mouse\" | \"touch\";\n\n/** @internal */\ninterface UserInteractionModeContext {\n __root: boolean;\n mode: UserInteractionMode;\n}\n\nconst context = createContext<UserInteractionModeContext>({\n __root: false,\n mode: \"mouse\",\n});\ncontext.displayName = \"UserInteractionMode\";\nconst { Provider } = context;\n\n/**\n * @returns the current user interaction mode\n */\nexport function useUserInteractionMode(): UserInteractionMode {\n return useContext(context).mode;\n}\n\n/** @internal */\nconst TOUCH_TIMEOUT = 1200;\n\nexport interface UserInteractionModeProviderProps {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to determine how a user is interacting with your app\n * to update component functionality and applying the following class names to\n * the `document.body`:\n *\n * - `\"mouse-mode\"`\n * - `\"keyboard-mode\"`\n * - `\"touch-mode\"`\n *\n * Within `react-md`, these classes are used for the following behavior:\n * - only display `:focus` outlines while in `\"keyboard-mode\"`\n * - do not display `:hover` effects while in `\"touch-mode\"`\n *\n * @example Mount at the root of your app\n * ```tsx\n * import { createRoot } from \"react-dom/client\";\n * import { UserInteractionModeProvider } from \"@react-md/core\";\n * import App from \"./App\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * root.render(\n * <UserInteractionModeProvider>\n * <App />\n * </UserInteractionModeProvider>\n * );\n * ```\n *\n * @throws \"The `UserInteractionModeProvider` cannot be mounted multiple times.\"\n * if this component is mounted multiple times in your app.\n */\nexport function UserInteractionModeProvider(\n props: UserInteractionModeProviderProps\n): ReactElement {\n const { children } = props;\n const { __root } = useContext(context);\n if (__root) {\n throw new Error(\n \"The `UserInteractionModeProvider` cannot be mounted multiple times.\"\n );\n }\n\n const [mode, setMode] = useState<UserInteractionMode>(\"mouse\");\n const lastTouchTime = useRef(0);\n const isTouchContextMenu = useRef(false);\n\n /**\n * This effect helps determine the current interaction mode by attaching the\n * required event listeners to the window. The `mode` will always be defaulted\n * to `mouse` at first since it has the least possibilities of causing errors\n * with styles since the mouse-only styles are normally just `:hover` effects.\n *\n * ## Switching between modes:\n *\n * ### While in `mouse` mode:\n *\n * - any `keydown` event will switch to `keyboard` mode\n * - this does have the side effect of meta keys also causing the switch over,\n * but it feels fine since it helps show the current focus in the document\n * as well\n * - any `touchstart` event will switch to `touch` mode\n *\n * ### While in `keyboard` mode:\n *\n * - any `mousedown` event will switch to `mouse` mode\n * - it is perfectly okay to move the mouse while in keyboard mode, but still\n * want to keep the keyboard styles until the user actually starts clicking\n * - any `touchstart` event will switch to `touch` mode\n *\n * ### While in `touch` mode:\n *\n * - any `mousemove` event will switch to `mouse` mode, but **only** if there\n * hasn't been a `contextmenu` event within the last `1.2s`\n * - you can really only switch back to `mouse` mode if you are using the\n * devtools to emulate devices OR using a touch-desktop. I don't know how\n * common this really is though.\n * - touching the screen will always fire a `mousemove` event (which is why\n * the `:hover` styles are normally with `rmd-utils-mouse-only`) and even\n * after the `contextmenu` event. Normally want to go back to `mouse` mode\n * when the mouse re-enters the `window`\n *\n * Note: It's currently impossible to switch from `touch` to `keyboard`\n * immediately. You'd first need to switch to `mouse` and then to `keyboard`. I\n * don't really know of any use-cases other than the weird touch-desktop stuff\n * and I have no experience using them.\n */\n useEffect(() => {\n const enableMouseMode = (): void => setMode(\"mouse\");\n const enableKeyboardMode = (): void => setMode(\"keyboard\");\n\n const handleTouchStart = (): void => {\n lastTouchTime.current = Date.now();\n isTouchContextMenu.current = false;\n setMode(\"touch\");\n };\n\n const handleMouseMove = (): void => {\n if (\n isTouchContextMenu.current ||\n Date.now() - lastTouchTime.current < TOUCH_TIMEOUT\n ) {\n isTouchContextMenu.current = false;\n return;\n }\n\n enableMouseMode();\n };\n const handleContextMenu = (): void => {\n isTouchContextMenu.current = true;\n };\n\n const className = `${mode}-mode`;\n document.body.classList.add(className);\n window.addEventListener(\"touchstart\", handleTouchStart, true);\n if (mode === \"mouse\") {\n window.addEventListener(\"keydown\", enableKeyboardMode, true);\n } else if (mode === \"keyboard\") {\n window.addEventListener(\"mousedown\", enableMouseMode, true);\n } else {\n window.addEventListener(\"mousemove\", handleMouseMove, true);\n window.addEventListener(\"contextmenu\", handleContextMenu, true);\n }\n\n return () => {\n document.body.classList.remove(className);\n window.removeEventListener(\"touchstart\", handleTouchStart, true);\n if (mode === \"mouse\") {\n window.removeEventListener(\"keydown\", enableKeyboardMode, true);\n } else if (mode === \"keyboard\") {\n window.removeEventListener(\"mousedown\", enableMouseMode, true);\n } else {\n window.removeEventListener(\"mousemove\", handleMouseMove, true);\n window.removeEventListener(\"contextmenu\", handleContextMenu, true);\n }\n };\n }, [mode]);\n\n const value = useMemo<UserInteractionModeContext>(\n () => ({\n mode,\n __root: true,\n }),\n [mode]\n );\n return <Provider value={value}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useEffect","useMemo","useRef","useState","context","__root","mode","displayName","Provider","useUserInteractionMode","TOUCH_TIMEOUT","UserInteractionModeProvider","props","children","Error","setMode","lastTouchTime","isTouchContextMenu","enableMouseMode","enableKeyboardMode","handleTouchStart","current","Date","now","handleMouseMove","handleContextMenu","className","document","body","classList","add","window","addEventListener","remove","removeEventListener","value"],"
|
|
1
|
+
{"version":3,"sources":["../../src/interaction/UserInteractionModeProvider.tsx"],"sourcesContent":["\"use client\";\nimport {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactElement,\n type ReactNode,\n} from \"react\";\n\n/**\n * This is the current mode for how your user is interacting with your app. This\n * will be used to determine which type of state styles should be applied at the\n * time of interacting with an element on your page.\n *\n * @defaultValue `\"mouse\"`\n */\nexport type UserInteractionMode = \"keyboard\" | \"mouse\" | \"touch\";\n\n/** @internal */\ninterface UserInteractionModeContext {\n __root: boolean;\n mode: UserInteractionMode;\n}\n\nconst context = createContext<UserInteractionModeContext>({\n __root: false,\n mode: \"mouse\",\n});\ncontext.displayName = \"UserInteractionMode\";\nconst { Provider } = context;\n\n/**\n * @returns the current user interaction mode\n */\nexport function useUserInteractionMode(): UserInteractionMode {\n return useContext(context).mode;\n}\n\n/** @internal */\nconst TOUCH_TIMEOUT = 1200;\n\nexport interface UserInteractionModeProviderProps {\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to determine how a user is interacting with your app\n * to update component functionality and applying the following class names to\n * the `document.body`:\n *\n * - `\"mouse-mode\"`\n * - `\"keyboard-mode\"`\n * - `\"touch-mode\"`\n *\n * Within `react-md`, these classes are used for the following behavior:\n * - only display `:focus` outlines while in `\"keyboard-mode\"`\n * - do not display `:hover` effects while in `\"touch-mode\"`\n *\n * @example Mount at the root of your app\n * ```tsx\n * import { createRoot } from \"react-dom/client\";\n * import { UserInteractionModeProvider } from \"@react-md/core\";\n * import App from \"./App\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * root.render(\n * <UserInteractionModeProvider>\n * <App />\n * </UserInteractionModeProvider>\n * );\n * ```\n *\n * @throws \"The `UserInteractionModeProvider` cannot be mounted multiple times.\"\n * if this component is mounted multiple times in your app.\n */\nexport function UserInteractionModeProvider(\n props: UserInteractionModeProviderProps\n): ReactElement {\n const { children } = props;\n const { __root } = useContext(context);\n if (__root) {\n throw new Error(\n \"The `UserInteractionModeProvider` cannot be mounted multiple times.\"\n );\n }\n\n const [mode, setMode] = useState<UserInteractionMode>(\"mouse\");\n const lastTouchTime = useRef(0);\n const isTouchContextMenu = useRef(false);\n\n /**\n * This effect helps determine the current interaction mode by attaching the\n * required event listeners to the window. The `mode` will always be defaulted\n * to `mouse` at first since it has the least possibilities of causing errors\n * with styles since the mouse-only styles are normally just `:hover` effects.\n *\n * ## Switching between modes:\n *\n * ### While in `mouse` mode:\n *\n * - any `keydown` event will switch to `keyboard` mode\n * - this does have the side effect of meta keys also causing the switch over,\n * but it feels fine since it helps show the current focus in the document\n * as well\n * - any `touchstart` event will switch to `touch` mode\n *\n * ### While in `keyboard` mode:\n *\n * - any `mousedown` event will switch to `mouse` mode\n * - it is perfectly okay to move the mouse while in keyboard mode, but still\n * want to keep the keyboard styles until the user actually starts clicking\n * - any `touchstart` event will switch to `touch` mode\n *\n * ### While in `touch` mode:\n *\n * - any `mousemove` event will switch to `mouse` mode, but **only** if there\n * hasn't been a `contextmenu` event within the last `1.2s`\n * - you can really only switch back to `mouse` mode if you are using the\n * devtools to emulate devices OR using a touch-desktop. I don't know how\n * common this really is though.\n * - touching the screen will always fire a `mousemove` event (which is why\n * the `:hover` styles are normally with `rmd-utils-mouse-only`) and even\n * after the `contextmenu` event. Normally want to go back to `mouse` mode\n * when the mouse re-enters the `window`\n *\n * Note: It's currently impossible to switch from `touch` to `keyboard`\n * immediately. You'd first need to switch to `mouse` and then to `keyboard`. I\n * don't really know of any use-cases other than the weird touch-desktop stuff\n * and I have no experience using them.\n */\n useEffect(() => {\n const enableMouseMode = (): void => setMode(\"mouse\");\n const enableKeyboardMode = (): void => setMode(\"keyboard\");\n\n const handleTouchStart = (): void => {\n lastTouchTime.current = Date.now();\n isTouchContextMenu.current = false;\n setMode(\"touch\");\n };\n\n const handleMouseMove = (): void => {\n if (\n isTouchContextMenu.current ||\n Date.now() - lastTouchTime.current < TOUCH_TIMEOUT\n ) {\n isTouchContextMenu.current = false;\n return;\n }\n\n enableMouseMode();\n };\n const handleContextMenu = (): void => {\n isTouchContextMenu.current = true;\n };\n\n const className = `${mode}-mode`;\n document.body.classList.add(className);\n window.addEventListener(\"touchstart\", handleTouchStart, true);\n if (mode === \"mouse\") {\n window.addEventListener(\"keydown\", enableKeyboardMode, true);\n } else if (mode === \"keyboard\") {\n window.addEventListener(\"mousedown\", enableMouseMode, true);\n } else {\n window.addEventListener(\"mousemove\", handleMouseMove, true);\n window.addEventListener(\"contextmenu\", handleContextMenu, true);\n }\n\n return () => {\n document.body.classList.remove(className);\n window.removeEventListener(\"touchstart\", handleTouchStart, true);\n if (mode === \"mouse\") {\n window.removeEventListener(\"keydown\", enableKeyboardMode, true);\n } else if (mode === \"keyboard\") {\n window.removeEventListener(\"mousedown\", enableMouseMode, true);\n } else {\n window.removeEventListener(\"mousemove\", handleMouseMove, true);\n window.removeEventListener(\"contextmenu\", handleContextMenu, true);\n }\n };\n }, [mode]);\n\n const value = useMemo<UserInteractionModeContext>(\n () => ({\n mode,\n __root: true,\n }),\n [mode]\n );\n return <Provider value={value}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useEffect","useMemo","useRef","useState","context","__root","mode","displayName","Provider","useUserInteractionMode","TOUCH_TIMEOUT","UserInteractionModeProvider","props","children","Error","setMode","lastTouchTime","isTouchContextMenu","enableMouseMode","enableKeyboardMode","handleTouchStart","current","Date","now","handleMouseMove","handleContextMenu","className","document","body","classList","add","window","addEventListener","remove","removeEventListener","value"],"mappings":"AAAA;;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAGH,QAAQ;AAiBf,MAAMC,wBAAUN,cAA0C;IACxDO,QAAQ;IACRC,MAAM;AACR;AACAF,QAAQG,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGJ;AAErB;;CAEC,GACD,OAAO,SAASK;IACd,OAAOV,WAAWK,SAASE,IAAI;AACjC;AAEA,cAAc,GACd,MAAMI,gBAAgB;AAMtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,GACD,OAAO,SAASC,4BACdC,KAAuC;IAEvC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IACrB,MAA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C,WAAWf,oBAAoB;YAC5D,OAAO,IAAIb,SAAS,YAAY;gBAC9ByB,OAAOG,mBAAmB,CAAC,aAAahB,iBAAiB;YAC3D,OAAO;gBACLa,OAAOG,mBAAmB,CAAC,aAAaV,iBAAiB;gBACzDO,OAAOG,mBAAmB,CAAC,eAAeT,mBAAmB;YAC/D;QACF;IACF,GAAG;QAACnB;KAAK;IAET,MAAM6B,QAAQlC,QACZ,IAAO,CAAA;YACLK;YACAD,QAAQ;QACV,CAAA,GACA;QAACC;KAAK;IAER,qBAAO,KAACE;QAAS2B,OAAOA;kBAAQtB;;AAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/interaction/config.ts"],"sourcesContent":["import { type ElementInteractionMode } from \"./types.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface ElementInteractionConfiguration {\n mode: ElementInteractionMode;\n higherContrast: boolean;\n}\n\n// NOTE: Uses get/set for test mocking\n\nlet mode: ElementInteractionMode = \"ripple\";\nlet higherContrast = true;\n\n/**\n * @since 6.0.0\n */\nexport const INTERACTION_CONFIG: ElementInteractionConfiguration = {\n get mode() {\n return mode;\n },\n set mode(nextMode: ElementInteractionMode) {\n mode = nextMode;\n },\n get higherContrast() {\n return higherContrast;\n },\n set higherContrast(nextHigherContrast) {\n higherContrast = nextHigherContrast;\n },\n};\n"],"names":["mode","higherContrast","INTERACTION_CONFIG","nextMode","nextHigherContrast"],"
|
|
1
|
+
{"version":3,"sources":["../../src/interaction/config.ts"],"sourcesContent":["import { type ElementInteractionMode } from \"./types.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface ElementInteractionConfiguration {\n mode: ElementInteractionMode;\n higherContrast: boolean;\n}\n\n// NOTE: Uses get/set for test mocking\n\nlet mode: ElementInteractionMode = \"ripple\";\nlet higherContrast = true;\n\n/**\n * @since 6.0.0\n */\nexport const INTERACTION_CONFIG: ElementInteractionConfiguration = {\n get mode() {\n return mode;\n },\n set mode(nextMode: ElementInteractionMode) {\n mode = nextMode;\n },\n get higherContrast() {\n return higherContrast;\n },\n set higherContrast(nextHigherContrast) {\n higherContrast = nextHigherContrast;\n },\n};\n"],"names":["mode","higherContrast","INTERACTION_CONFIG","nextMode","nextHigherContrast"],"mappings":"AAUA,sCAAsC;AAEtC,IAAIA,OAA+B;AACnC,IAAIC,iBAAiB;AAErB;;CAEC,GACD,OAAO,MAAMC,qBAAsD;IACjE,IAAIF,QAAO;QACT,OAAOA;IACT;IACA,IAAIA,MAAKG,SAAkC;QACzCH,OAAOG;IACT;IACA,IAAIF,kBAAiB;QACnB,OAAOA;IACT;IACA,IAAIA,gBAAeG,mBAAoB;QACrCH,iBAAiBG;IACnB;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/interaction/types.ts"],"sourcesContent":["import type {\n DragEventHandler,\n FocusEventHandler,\n KeyboardEventHandler,\n MouseEventHandler,\n TouchEventHandler,\n} from \"react\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-ripple-background-color\"?: string;\n \"--rmd-interaction-background-color\"?: string;\n \"--rmd-hover-background-color\"?: string;\n \"--rmd-focus-background-color\"?: string;\n \"--rmd-press-background-color\"?: string;\n \"--rmd-selected-background-color\"?: string;\n \"--rmd-focus-color\"?: string;\n \"--rmd-focus-width\"?: string | number;\n }\n}\n\n/**\n * This is used to provide feedback to the user that they are interacting with\n * elements on the page. It is recommended to not set this to `\"none\"` unless\n * you will implement your own version.\n *\n * When this is set to `\"press\"`, the `background-color` for the element will\n * become slightly darker while the user:\n * - is holding the mouse down on the element\n * - holding the enter or space key on the element\n * - holding their finger on the element for touch devices\n *\n * The `background-color` will transition in and out based on the pressed state.\n *\n * When this is set to `\"ripple\"`, a water droplet type of animation will appear\n * from the current coordinates of the mouse or touch event within the element.\n * Keyboard events will just trigger the animation from the center of the\n * element. Once the user stops pressing the element, the animation will start\n * to fade out.\n *\n * Note: this should match the `$interaction-mode` SCSS variable.\n *\n * @defaultValue `\"ripple\"`\n * @since 6.0.0\n */\nexport type ElementInteractionMode = \"ripple\" | \"press\" | \"none\";\n\n/** @since 6.0.0 */\nexport interface ElementInteractionHandlers<E extends HTMLElement> {\n onBlur: FocusEventHandler<E>;\n\n /**\n * The click event handler is is only used to display a ripple for\n * `<button type=\"submit\" />` since pressing enter on form elements should\n * submit the form. This ripple is really just to help show that the form has\n * been submitted.\n */\n onClick: MouseEventHandler<E>;\n\n /**\n * The keydown event handler is used to either activate the `pressed` state\n * for the element or start the ripple animation when the `enter` or `space`\n * keys are pressed. It will also trigger a click event for elements that do\n * not support this natively (`<button>`, `<a>`).\n *\n * When the space key is pressed, `event.preventDefault()` will also be called\n * to prevent the page from scrolling.\n */\n onKeyDown: KeyboardEventHandler<E>;\n\n /**\n * The keyup event handler is used to either deactivate the `pressed` state\n * for the element or start the exit animation for the ripple if the ripple\n * was activated by the keydown event.\n */\n onKeyUp: KeyboardEventHandler<E>;\n\n /**\n * The mousedown event handler is used to either activate the `pressed` state\n * for the element or start the ripple animation.\n */\n onMouseDown: MouseEventHandler<E>;\n\n /**\n * The mouseup event handler is used to either deactivate the `pressed` state\n * for the element or start the exit animation for the ripple if the ripple\n * was activated by the mousedown event.\n */\n onMouseUp: MouseEventHandler<E>;\n\n /**\n * The mouseleave event handler will remove all ripples and prevent any other\n * interactions if the current {@link UserInteractionMode} is `\"mouse\"`.\n *\n * The ripples have to be cancelled since the user might release the mouse\n * outside of the element which would never trigger the `onMouseUp` flow.\n */\n onMouseLeave: MouseEventHandler<E>;\n\n /**\n * The dragstart event handler will remove the ripples and prevent any other\n * interactions.\n */\n onDragStart: DragEventHandler<E>;\n\n /**\n * The touchstart event handler is used to either activate the `pressed` state\n * for the element or start the ripple animation.\n */\n onTouchStart: TouchEventHandler<E>;\n\n /**\n * The touchend event handler is used to either deactivate the `pressed`\n * state for the element or start the exit animation for the ripple if the\n * ripple was activated by the touchstart event.\n */\n onTouchEnd: TouchEventHandler<E>;\n\n /**\n * The touchmove event handler will remove all ripples and prevent any other\n * interactions if the current {@link UserInteractionMode} is `\"touch\"`.\n */\n onTouchMove: TouchEventHandler<E>;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface RippleStyle {\n readonly left: number;\n readonly top: number;\n readonly height: number;\n readonly width: number;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface RippleState {\n readonly style: RippleStyle;\n readonly exiting: boolean;\n readonly entered: boolean;\n readonly startTime: number;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type RippleStateList = readonly RippleState[];\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface RippleTransitionCallbacks {\n onEntered(ripple: RippleState): void;\n onExited(ripple: RippleState): void;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface ProvidedRippleContainerProps\n extends RippleTransitionCallbacks {\n ripples: RippleStateList;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface ElementInteractionState {\n pressed: boolean;\n ripples: RippleStateList;\n}\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../../src/interaction/types.ts"],"sourcesContent":["import type {\n DragEventHandler,\n FocusEventHandler,\n KeyboardEventHandler,\n MouseEventHandler,\n TouchEventHandler,\n} from \"react\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-ripple-background-color\"?: string;\n \"--rmd-interaction-background-color\"?: string;\n \"--rmd-hover-background-color\"?: string;\n \"--rmd-focus-background-color\"?: string;\n \"--rmd-press-background-color\"?: string;\n \"--rmd-selected-background-color\"?: string;\n \"--rmd-focus-color\"?: string;\n \"--rmd-focus-width\"?: string | number;\n }\n}\n\n/**\n * This is used to provide feedback to the user that they are interacting with\n * elements on the page. It is recommended to not set this to `\"none\"` unless\n * you will implement your own version.\n *\n * When this is set to `\"press\"`, the `background-color` for the element will\n * become slightly darker while the user:\n * - is holding the mouse down on the element\n * - holding the enter or space key on the element\n * - holding their finger on the element for touch devices\n *\n * The `background-color` will transition in and out based on the pressed state.\n *\n * When this is set to `\"ripple\"`, a water droplet type of animation will appear\n * from the current coordinates of the mouse or touch event within the element.\n * Keyboard events will just trigger the animation from the center of the\n * element. Once the user stops pressing the element, the animation will start\n * to fade out.\n *\n * Note: this should match the `$interaction-mode` SCSS variable.\n *\n * @defaultValue `\"ripple\"`\n * @since 6.0.0\n */\nexport type ElementInteractionMode = \"ripple\" | \"press\" | \"none\";\n\n/** @since 6.0.0 */\nexport interface ElementInteractionHandlers<E extends HTMLElement> {\n onBlur: FocusEventHandler<E>;\n\n /**\n * The click event handler is is only used to display a ripple for\n * `<button type=\"submit\" />` since pressing enter on form elements should\n * submit the form. This ripple is really just to help show that the form has\n * been submitted.\n */\n onClick: MouseEventHandler<E>;\n\n /**\n * The keydown event handler is used to either activate the `pressed` state\n * for the element or start the ripple animation when the `enter` or `space`\n * keys are pressed. It will also trigger a click event for elements that do\n * not support this natively (`<button>`, `<a>`).\n *\n * When the space key is pressed, `event.preventDefault()` will also be called\n * to prevent the page from scrolling.\n */\n onKeyDown: KeyboardEventHandler<E>;\n\n /**\n * The keyup event handler is used to either deactivate the `pressed` state\n * for the element or start the exit animation for the ripple if the ripple\n * was activated by the keydown event.\n */\n onKeyUp: KeyboardEventHandler<E>;\n\n /**\n * The mousedown event handler is used to either activate the `pressed` state\n * for the element or start the ripple animation.\n */\n onMouseDown: MouseEventHandler<E>;\n\n /**\n * The mouseup event handler is used to either deactivate the `pressed` state\n * for the element or start the exit animation for the ripple if the ripple\n * was activated by the mousedown event.\n */\n onMouseUp: MouseEventHandler<E>;\n\n /**\n * The mouseleave event handler will remove all ripples and prevent any other\n * interactions if the current {@link UserInteractionMode} is `\"mouse\"`.\n *\n * The ripples have to be cancelled since the user might release the mouse\n * outside of the element which would never trigger the `onMouseUp` flow.\n */\n onMouseLeave: MouseEventHandler<E>;\n\n /**\n * The dragstart event handler will remove the ripples and prevent any other\n * interactions.\n */\n onDragStart: DragEventHandler<E>;\n\n /**\n * The touchstart event handler is used to either activate the `pressed` state\n * for the element or start the ripple animation.\n */\n onTouchStart: TouchEventHandler<E>;\n\n /**\n * The touchend event handler is used to either deactivate the `pressed`\n * state for the element or start the exit animation for the ripple if the\n * ripple was activated by the touchstart event.\n */\n onTouchEnd: TouchEventHandler<E>;\n\n /**\n * The touchmove event handler will remove all ripples and prevent any other\n * interactions if the current {@link UserInteractionMode} is `\"touch\"`.\n */\n onTouchMove: TouchEventHandler<E>;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface RippleStyle {\n readonly left: number;\n readonly top: number;\n readonly height: number;\n readonly width: number;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface RippleState {\n readonly style: RippleStyle;\n readonly exiting: boolean;\n readonly entered: boolean;\n readonly startTime: number;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type RippleStateList = readonly RippleState[];\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface RippleTransitionCallbacks {\n onEntered(ripple: RippleState): void;\n onExited(ripple: RippleState): void;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface ProvidedRippleContainerProps\n extends RippleTransitionCallbacks {\n ripples: RippleStateList;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface ElementInteractionState {\n pressed: boolean;\n ripples: RippleStateList;\n}\n"],"names":[],"mappings":"AA2KA;;;CAGC,GACD,WAGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/interaction/useElementInteraction.tsx"],"sourcesContent":["\"use client\";\nimport type {\n FocusEvent,\n KeyboardEvent,\n MouseEvent,\n ReactElement,\n TouchEvent,\n} from \"react\";\nimport { useCallback, useReducer, useRef } from \"react\";\nimport { RippleContainer } from \"./RippleContainer.js\";\nimport { useUserInteractionMode } from \"./UserInteractionModeProvider.js\";\nimport { INTERACTION_CONFIG } from \"./config.js\";\nimport type {\n ElementInteractionHandlers,\n ElementInteractionState,\n RippleState,\n RippleStyle,\n} from \"./types.js\";\nimport { getRippleStyle, releaseRipple, updateRipplesState } from \"./utils.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-surface-inset\"?: string | number;\n \"--rmd-surface-border-radius\"?: string | number;\n }\n}\n\n/** @since 6.0.0 */\nexport const PRESSED_CLASS_NAME = \"rmd-pressed\";\n\n/** @since 6.0.0 */\nexport interface ElementInteractionOptions<E extends HTMLElement>\n extends Partial<ElementInteractionHandlers<E>> {\n /**\n * Boolean if the element is currently disabled which will prevent any of the\n * element interaction states from happening.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface ElementInteractionHookReturnValue<E extends HTMLElement> {\n /**\n * The event handlers required for element interaction.\n */\n handlers: Readonly<ElementInteractionHandlers<E>>;\n\n /**\n * Boolean if the element is currently pressed. This will always be `false` if\n * the {@link ElementInteractionMode} is set to `\"none\"`\n */\n pressed: boolean;\n\n /**\n * This will be set to {@link PRESSED_CLASS_NAME} only when {@link pressed} is\n * `true` and the {@link ElementInteractionMode} is set to `\"press\"`. It will\n * be `undefined` otherwise.\n */\n pressedClassName: string | undefined;\n\n /**\n * The ripple click/touch interaction. This will be `undefined` when the {@link ElementInteractionMode}\n * is set to `\"none\"` or `\"press\"`.\n */\n ripples?: ReactElement;\n}\n\ntype ElementInteractionAction =\n | { type: \"press\"; style?: RippleStyle; programmatic?: boolean }\n | { type: \"release\" | \"cancel\" }\n | { type: \"entered\" | \"exited\"; ripple: RippleState };\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * This hook is used to apply the required element interaction based on the\n * {@link ElementInteractionMode} and should generally be used internally only.\n *\n * @example Providing Element Interaction\n * ```tsx\n * import { useElementInteraction } from \"@react-md/core\";\n * import { cnb } from \"cnbuilder\";\n * import type { ReactElement } from \"react\";\n *\n * import styles from \"./CustomComponent.module.scss\";\n *\n * interface Props extends HTMLAttributes<HTMLDivElement> {\n * disabled?: boolean;\n * }\n *\n * function CustomComponent(props: Props): ReactElement {\n * const {\n * disabled = false,\n * className,\n * onBlur,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchMove,\n * onTouchEnd,\n * ...remaining,\n * } = props;\n *\n * const { handlers, pressed, ripples } =\n * useElementInteraction({\n * disabled,\n * // pass remaining props so that if any event handlers were provided to\n * // the component, they will be merged with the element interaction\n * // handlers\n * onBlur,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchMove,\n * onTouchEnd,\n * })\n *\n * return (\n * <div\n * {...remaining}\n * {...handlers}\n * aria-disabled={disabled}\n * role=\"button\"\n * className={cnb(styles.button, pressed && styles.pressed)}\n * tabIndex={disabled ? undefined : 0}\n * >\n * {children}\n * {ripples}\n * </div>\n * );\n * }\n * ```\n *\n * @param options - An object of {@link ElementInteractionOptions} that is used\n * to merge event handlers or disable the interactions.\n * @returns the {@link ElementInteractionHookReturnValue}\n * @since 6.0.0 Touch interactions were removed since it never looked\n * good if the user touched a clickable element right before scrolling. The\n * ripple effect will only be fired on click now for touch devices.\n */\nexport function useElementInteraction<E extends HTMLElement>(\n options: ElementInteractionOptions<E> = {}\n): ElementInteractionHookReturnValue<E> {\n const {\n onBlur = noop,\n onClick = noop,\n onMouseDown = noop,\n onMouseUp = noop,\n onMouseLeave = noop,\n onKeyUp = noop,\n onKeyDown = noop,\n onTouchStart = noop,\n onTouchEnd = noop,\n onTouchMove = noop,\n onDragStart = noop,\n disabled = false,\n } = options;\n\n const { mode } = INTERACTION_CONFIG;\n\n const holding = useRef(false);\n const disableClick = useRef(false);\n const userMode = useUserInteractionMode();\n const isInteractionDisabled = disabled || mode === \"none\";\n const [state, dispatch] = useReducer(\n function reducer(\n state: ElementInteractionState,\n action: ElementInteractionAction\n ): ElementInteractionState {\n switch (action.type) {\n case \"press\": {\n const { style } = action;\n let { ripples } = state;\n if (style) {\n ripples = [\n ...ripples,\n {\n style,\n entered: false,\n exiting: false,\n startTime: Date.now(),\n },\n ];\n }\n\n return {\n pressed: true,\n ripples,\n };\n }\n case \"cancel\":\n // Note: unlike previous react-md versions, this will immediately\n // remove ALL ripple effects instead of trying to fade out. this seems\n // much nicer for touch devices when they are trying to scroll\n return {\n pressed: false,\n ripples: [],\n };\n case \"release\": {\n if (mode === \"press\") {\n return { ...state, pressed: false };\n }\n\n return releaseRipple(state);\n }\n case \"entered\":\n return updateRipplesState({\n type: \"entered\",\n state,\n ripple: action.ripple,\n holding: holding.current,\n });\n case \"exited\":\n return updateRipplesState({\n type: \"exited\",\n state,\n ripple: action.ripple,\n holding: holding.current,\n });\n\n default:\n return state;\n }\n },\n { pressed: false, ripples: [] }\n );\n const { pressed } = state;\n\n let ripples: ReactElement | undefined;\n if (mode == \"ripple\") {\n ripples = (\n <RippleContainer\n ripples={state.ripples}\n onEntered={(ripple) => {\n dispatch({ type: \"entered\", ripple });\n }}\n onExited={(ripple) => {\n dispatch({ type: \"exited\", ripple });\n }}\n />\n );\n }\n\n return {\n pressed,\n pressedClassName:\n pressed && mode === \"press\" ? PRESSED_CLASS_NAME : undefined,\n ripples,\n handlers: {\n onBlur: useCallback(\n (event: FocusEvent<E>) => {\n onBlur(event);\n if (holding.current) {\n holding.current = false;\n dispatch({ type: \"release\" });\n }\n },\n [onBlur]\n ),\n onClick: useCallback(\n (event: MouseEvent<E>) => {\n if (disabled) {\n return;\n }\n\n onClick(event);\n if (\n event.isPropagationStopped() ||\n userMode === \"touch\" ||\n mode !== \"ripple\" ||\n disableClick.current ||\n holding.current ||\n document.activeElement === event.currentTarget\n ) {\n disableClick.current = false;\n return;\n }\n\n dispatch({\n type: \"press\",\n style: getRippleStyle(event, true),\n });\n },\n [disabled, mode, onClick, userMode]\n ),\n onMouseDown: useCallback(\n (event: MouseEvent<E>) => {\n onMouseDown(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"mouse\" ||\n event.shiftKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.altKey ||\n event.button !== 0\n ) {\n return;\n }\n\n // prevent text selection on double click\n // https://stackoverflow.com/a/43321596\n if (event.detail > 1) {\n event.preventDefault();\n }\n\n holding.current = true;\n disableClick.current = true;\n let style: RippleStyle | undefined;\n if (mode === \"ripple\") {\n style = getRippleStyle(event, false);\n }\n\n dispatch({ type: \"press\", style });\n },\n [onMouseDown, isInteractionDisabled, userMode, mode]\n ),\n onMouseUp: useCallback(\n (event: MouseEvent<E>) => {\n onMouseUp(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onMouseUp]\n ),\n onMouseLeave: useCallback(\n (event: MouseEvent<E>) => {\n onMouseLeave(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"mouse\" ||\n !holding.current\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n [isInteractionDisabled, onMouseLeave, userMode]\n ),\n onDragStart(event) {\n onDragStart(event);\n if (\n event.isPropagationStopped() ||\n !holding.current ||\n userMode !== \"mouse\"\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n onKeyDown: useCallback(\n (event: KeyboardEvent<E>) => {\n onKeyDown(event);\n const { key } = event;\n const { tagName } = event.currentTarget;\n\n if (\n event.isPropagationStopped() ||\n userMode !== \"keyboard\" ||\n disabled ||\n (key !== \" \" && key !== \"Enter\") ||\n // links do not support clicking on space\n (key === \" \" && tagName === \"A\") ||\n // inputs submit a form instead of clicking on enter\n (key === \"Enter\" && tagName === \"INPUT\")\n ) {\n return;\n }\n\n // stop propagation since we're starting to do custom event behavior\n // to click the element for everything except elements that the\n // browser clicks natively\n event.stopPropagation();\n\n if (tagName !== \"BUTTON\" && tagName !== \"A\") {\n if (key === \" \") {\n // prevent the pager from scrolling\n event.preventDefault();\n }\n\n event.currentTarget.click();\n }\n\n if (holding.current || isInteractionDisabled) {\n return;\n }\n\n holding.current = true;\n dispatch({ type: \"press\", style: getRippleStyle(event, false) });\n },\n [disabled, isInteractionDisabled, onKeyDown, userMode]\n ),\n onKeyUp: useCallback(\n (event: KeyboardEvent<E>) => {\n onKeyUp(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"keyboard\" ||\n !holding.current\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onKeyUp, userMode]\n ),\n onTouchStart: useCallback(\n (event: TouchEvent<E>) => {\n onTouchStart(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = true;\n let style: RippleStyle | undefined;\n if (mode === \"ripple\") {\n style = getRippleStyle(event, false);\n }\n\n dispatch({ type: \"press\", style });\n },\n [mode, isInteractionDisabled, onTouchStart]\n ),\n onTouchEnd: useCallback(\n (event: TouchEvent<E>) => {\n onTouchEnd(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onTouchEnd]\n ),\n onTouchMove: useCallback(\n (event: TouchEvent<E>) => {\n onTouchMove(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n [isInteractionDisabled, onTouchMove]\n ),\n },\n };\n}\n"],"names":["useCallback","useReducer","useRef","RippleContainer","useUserInteractionMode","INTERACTION_CONFIG","getRippleStyle","releaseRipple","updateRipplesState","PRESSED_CLASS_NAME","noop","useElementInteraction","options","onBlur","onClick","onMouseDown","onMouseUp","onMouseLeave","onKeyUp","onKeyDown","onTouchStart","onTouchEnd","onTouchMove","onDragStart","disabled","mode","holding","disableClick","userMode","isInteractionDisabled","state","dispatch","reducer","action","type","style","ripples","entered","exiting","startTime","Date","now","pressed","ripple","current","onEntered","onExited","pressedClassName","undefined","handlers","event","isPropagationStopped","document","activeElement","currentTarget","shiftKey","ctrlKey","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BAAuBP;aAAY;QAExC;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/interaction/useElementInteraction.tsx"],"sourcesContent":["\"use client\";\nimport type {\n FocusEvent,\n KeyboardEvent,\n MouseEvent,\n ReactElement,\n TouchEvent,\n} from \"react\";\nimport { useCallback, useReducer, useRef } from \"react\";\nimport { RippleContainer } from \"./RippleContainer.js\";\nimport { useUserInteractionMode } from \"./UserInteractionModeProvider.js\";\nimport { INTERACTION_CONFIG } from \"./config.js\";\nimport type {\n ElementInteractionHandlers,\n ElementInteractionState,\n RippleState,\n RippleStyle,\n} from \"./types.js\";\nimport { getRippleStyle, releaseRipple, updateRipplesState } from \"./utils.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-surface-inset\"?: string | number;\n \"--rmd-surface-border-radius\"?: string | number;\n }\n}\n\n/** @since 6.0.0 */\nexport const PRESSED_CLASS_NAME = \"rmd-pressed\";\n\n/** @since 6.0.0 */\nexport interface ElementInteractionOptions<E extends HTMLElement>\n extends Partial<ElementInteractionHandlers<E>> {\n /**\n * Boolean if the element is currently disabled which will prevent any of the\n * element interaction states from happening.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n}\n\n/** @since 6.0.0 */\nexport interface ElementInteractionHookReturnValue<E extends HTMLElement> {\n /**\n * The event handlers required for element interaction.\n */\n handlers: Readonly<ElementInteractionHandlers<E>>;\n\n /**\n * Boolean if the element is currently pressed. This will always be `false` if\n * the {@link ElementInteractionMode} is set to `\"none\"`\n */\n pressed: boolean;\n\n /**\n * This will be set to {@link PRESSED_CLASS_NAME} only when {@link pressed} is\n * `true` and the {@link ElementInteractionMode} is set to `\"press\"`. It will\n * be `undefined` otherwise.\n */\n pressedClassName: string | undefined;\n\n /**\n * The ripple click/touch interaction. This will be `undefined` when the {@link ElementInteractionMode}\n * is set to `\"none\"` or `\"press\"`.\n */\n ripples?: ReactElement;\n}\n\ntype ElementInteractionAction =\n | { type: \"press\"; style?: RippleStyle; programmatic?: boolean }\n | { type: \"release\" | \"cancel\" }\n | { type: \"entered\" | \"exited\"; ripple: RippleState };\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * This hook is used to apply the required element interaction based on the\n * {@link ElementInteractionMode} and should generally be used internally only.\n *\n * @example Providing Element Interaction\n * ```tsx\n * import { useElementInteraction } from \"@react-md/core\";\n * import { cnb } from \"cnbuilder\";\n * import type { ReactElement } from \"react\";\n *\n * import styles from \"./CustomComponent.module.scss\";\n *\n * interface Props extends HTMLAttributes<HTMLDivElement> {\n * disabled?: boolean;\n * }\n *\n * function CustomComponent(props: Props): ReactElement {\n * const {\n * disabled = false,\n * className,\n * onBlur,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchMove,\n * onTouchEnd,\n * ...remaining,\n * } = props;\n *\n * const { handlers, pressed, ripples } =\n * useElementInteraction({\n * disabled,\n * // pass remaining props so that if any event handlers were provided to\n * // the component, they will be merged with the element interaction\n * // handlers\n * onBlur,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchMove,\n * onTouchEnd,\n * })\n *\n * return (\n * <div\n * {...remaining}\n * {...handlers}\n * aria-disabled={disabled}\n * role=\"button\"\n * className={cnb(styles.button, pressed && styles.pressed)}\n * tabIndex={disabled ? undefined : 0}\n * >\n * {children}\n * {ripples}\n * </div>\n * );\n * }\n * ```\n *\n * @param options - An object of {@link ElementInteractionOptions} that is used\n * to merge event handlers or disable the interactions.\n * @returns the {@link ElementInteractionHookReturnValue}\n * @since 6.0.0 Touch interactions were removed since it never looked\n * good if the user touched a clickable element right before scrolling. The\n * ripple effect will only be fired on click now for touch devices.\n */\nexport function useElementInteraction<E extends HTMLElement>(\n options: ElementInteractionOptions<E> = {}\n): ElementInteractionHookReturnValue<E> {\n const {\n onBlur = noop,\n onClick = noop,\n onMouseDown = noop,\n onMouseUp = noop,\n onMouseLeave = noop,\n onKeyUp = noop,\n onKeyDown = noop,\n onTouchStart = noop,\n onTouchEnd = noop,\n onTouchMove = noop,\n onDragStart = noop,\n disabled = false,\n } = options;\n\n const { mode } = INTERACTION_CONFIG;\n\n const holding = useRef(false);\n const disableClick = useRef(false);\n const userMode = useUserInteractionMode();\n const isInteractionDisabled = disabled || mode === \"none\";\n const [state, dispatch] = useReducer(\n function reducer(\n state: ElementInteractionState,\n action: ElementInteractionAction\n ): ElementInteractionState {\n switch (action.type) {\n case \"press\": {\n const { style } = action;\n let { ripples } = state;\n if (style) {\n ripples = [\n ...ripples,\n {\n style,\n entered: false,\n exiting: false,\n startTime: Date.now(),\n },\n ];\n }\n\n return {\n pressed: true,\n ripples,\n };\n }\n case \"cancel\":\n // Note: unlike previous react-md versions, this will immediately\n // remove ALL ripple effects instead of trying to fade out. this seems\n // much nicer for touch devices when they are trying to scroll\n return {\n pressed: false,\n ripples: [],\n };\n case \"release\": {\n if (mode === \"press\") {\n return { ...state, pressed: false };\n }\n\n return releaseRipple(state);\n }\n case \"entered\":\n return updateRipplesState({\n type: \"entered\",\n state,\n ripple: action.ripple,\n holding: holding.current,\n });\n case \"exited\":\n return updateRipplesState({\n type: \"exited\",\n state,\n ripple: action.ripple,\n holding: holding.current,\n });\n\n default:\n return state;\n }\n },\n { pressed: false, ripples: [] }\n );\n const { pressed } = state;\n\n let ripples: ReactElement | undefined;\n if (mode == \"ripple\") {\n ripples = (\n <RippleContainer\n ripples={state.ripples}\n onEntered={(ripple) => {\n dispatch({ type: \"entered\", ripple });\n }}\n onExited={(ripple) => {\n dispatch({ type: \"exited\", ripple });\n }}\n />\n );\n }\n\n return {\n pressed,\n pressedClassName:\n pressed && mode === \"press\" ? PRESSED_CLASS_NAME : undefined,\n ripples,\n handlers: {\n onBlur: useCallback(\n (event: FocusEvent<E>) => {\n onBlur(event);\n if (holding.current) {\n holding.current = false;\n dispatch({ type: \"release\" });\n }\n },\n [onBlur]\n ),\n onClick: useCallback(\n (event: MouseEvent<E>) => {\n if (disabled) {\n return;\n }\n\n onClick(event);\n if (\n event.isPropagationStopped() ||\n userMode === \"touch\" ||\n mode !== \"ripple\" ||\n disableClick.current ||\n holding.current ||\n document.activeElement === event.currentTarget\n ) {\n disableClick.current = false;\n return;\n }\n\n dispatch({\n type: \"press\",\n style: getRippleStyle(event, true),\n });\n },\n [disabled, mode, onClick, userMode]\n ),\n onMouseDown: useCallback(\n (event: MouseEvent<E>) => {\n onMouseDown(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"mouse\" ||\n event.shiftKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.altKey ||\n event.button !== 0\n ) {\n return;\n }\n\n // prevent text selection on double click\n // https://stackoverflow.com/a/43321596\n if (event.detail > 1) {\n event.preventDefault();\n }\n\n holding.current = true;\n disableClick.current = true;\n let style: RippleStyle | undefined;\n if (mode === \"ripple\") {\n style = getRippleStyle(event, false);\n }\n\n dispatch({ type: \"press\", style });\n },\n [onMouseDown, isInteractionDisabled, userMode, mode]\n ),\n onMouseUp: useCallback(\n (event: MouseEvent<E>) => {\n onMouseUp(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onMouseUp]\n ),\n onMouseLeave: useCallback(\n (event: MouseEvent<E>) => {\n onMouseLeave(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"mouse\" ||\n !holding.current\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n [isInteractionDisabled, onMouseLeave, userMode]\n ),\n onDragStart(event) {\n onDragStart(event);\n if (\n event.isPropagationStopped() ||\n !holding.current ||\n userMode !== \"mouse\"\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n onKeyDown: useCallback(\n (event: KeyboardEvent<E>) => {\n onKeyDown(event);\n const { key } = event;\n const { tagName } = event.currentTarget;\n\n if (\n event.isPropagationStopped() ||\n userMode !== \"keyboard\" ||\n disabled ||\n (key !== \" \" && key !== \"Enter\") ||\n // links do not support clicking on space\n (key === \" \" && tagName === \"A\") ||\n // inputs submit a form instead of clicking on enter\n (key === \"Enter\" && tagName === \"INPUT\")\n ) {\n return;\n }\n\n // stop propagation since we're starting to do custom event behavior\n // to click the element for everything except elements that the\n // browser clicks natively\n event.stopPropagation();\n\n if (tagName !== \"BUTTON\" && tagName !== \"A\") {\n if (key === \" \") {\n // prevent the pager from scrolling\n event.preventDefault();\n }\n\n event.currentTarget.click();\n }\n\n if (holding.current || isInteractionDisabled) {\n return;\n }\n\n holding.current = true;\n dispatch({ type: \"press\", style: getRippleStyle(event, false) });\n },\n [disabled, isInteractionDisabled, onKeyDown, userMode]\n ),\n onKeyUp: useCallback(\n (event: KeyboardEvent<E>) => {\n onKeyUp(event);\n if (\n event.isPropagationStopped() ||\n isInteractionDisabled ||\n userMode !== \"keyboard\" ||\n !holding.current\n ) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onKeyUp, userMode]\n ),\n onTouchStart: useCallback(\n (event: TouchEvent<E>) => {\n onTouchStart(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = true;\n let style: RippleStyle | undefined;\n if (mode === \"ripple\") {\n style = getRippleStyle(event, false);\n }\n\n dispatch({ type: \"press\", style });\n },\n [mode, isInteractionDisabled, onTouchStart]\n ),\n onTouchEnd: useCallback(\n (event: TouchEvent<E>) => {\n onTouchEnd(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"release\" });\n },\n [isInteractionDisabled, onTouchEnd]\n ),\n onTouchMove: useCallback(\n (event: TouchEvent<E>) => {\n onTouchMove(event);\n if (event.isPropagationStopped() || isInteractionDisabled) {\n return;\n }\n\n holding.current = false;\n dispatch({ type: \"cancel\" });\n },\n [isInteractionDisabled, onTouchMove]\n ),\n },\n };\n}\n"],"names":["useCallback","useReducer","useRef","RippleContainer","useUserInteractionMode","INTERACTION_CONFIG","getRippleStyle","releaseRipple","updateRipplesState","PRESSED_CLASS_NAME","noop","useElementInteraction","options","onBlur","onClick","onMouseDown","onMouseUp","onMouseLeave","onKeyUp","onKeyDown","onTouchStart","onTouchEnd","onTouchMove","onDragStart","disabled","mode","holding","disableClick","userMode","isInteractionDisabled","state","dispatch","reducer","action","type","style","ripples","entered","exiting","startTime","Date","now","pressed","ripple","current","onEntered","onExited","pressedClassName","undefined","handlers","event","isPropagationStopped","document","activeElement","currentTarget","shiftKey","ctrlKey","metaKey","altKey","button","detail","preventDefault","key","tagName","stopPropagation","click"],"mappings":"AAAA;;AAQA,SAASA,WAAW,EAAEC,UAAU,EAAEC,MAAM,QAAQ,QAAQ;AACxD,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,sBAAsB,QAAQ,mCAAmC;AAC1E,SAASC,kBAAkB,QAAQ,cAAc;AAOjD,SAASC,cAAc,EAAEC,aAAa,EAAEC,kBAAkB,QAAQ,aAAa;AAS/E,iBAAiB,GACjB,OAAO,MAAMC,qBAAqB,cAAc;AA8ChD,MAAMC,OAAO;AACX,aAAa;AACf;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyEC,GACD,OAAO,SAASC,sBACdC,UAAwC,CAAC,CAAC;IAE1C,MAAM,EACJC,SAASH,IAAI,EACbI,UAAUJ,IAAI,EACdK,cAAcL,IAAI,EAClBM,YAAYN,IAAI,EAChBO,eAAeP,IAAI,EACnBQ,UAAUR,IAAI,EACdS,YAAYT,IAAI,EAChBU,eAAeV,IAAI,EACnBW,aAAaX,IAAI,EACjBY,cAAcZ,IAAI,EAClBa,cAAcb,IAAI,EAClBc,WAAW,KAAK,EACjB,GAAGZ;IAEJ,MAAM,EAAEa,IAAI,EAAE,GAAGpB;IAEj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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/interaction/useHigherContrastChildren.tsx"],"sourcesContent":["import { Children, type ReactNode } from \"react\";\nimport { INTERACTION_CONFIG } from \"./config.js\";\n\n/**\n * This hook is used to wrap any `number` and `string` children with a `<span>`\n * so that the ripple/hover/focus background colors do not cause the text to\n * become dimmed.\n *\n * If the {@link INTERACTION_CONFIG.higherContrast} is set to `false`, this hook\n * will just return the `children` unmodified.\n *\n * Note: This should generally be used with the {@link useElementInteraction}\n * hook.\n *\n * @example Simple Example\n * ```tsx\n * import {\n * useElementInteraction,\n * useHigherContrastChildren,\n * } from \"@react-md/core\";\n * import type { ButtonHTMLAttributes, ReactElement, ReactNode } from \"react\";\n *\n * function Example(props: ButtonHTMLAttributes<HTMLButtonElement>): ReactElement {\n * const {\n * children: propChildren,\n * disabled = false,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchEnd,\n * onTouchMove,\n * ...remaining\n * } = props;\n * const { pressedClassName, ripples, handlers } =\n * useElementInteraction({\n * disabled,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchEnd,\n * onTouchMove,\n * });\n *\n * const children = useHigherContrastChildren(propChildren)\n *\n * return (\n * <button {...remaining} {...handlers} className={pressedClassName}>\n * {children}\n * {ripples}\n * </button>\n * );\n * }\n * ```\n *\n * @param propChildren - The children to conditionally wrap in spans.\n * @param disable - Manually disable this functionality even if the higher\n * contrast mode is enabled. This is really used within `ListItem`s so there\n * aren't unneeded `<span>`s for string/number children when there are addons.\n * @returns the children to render\n * @since 6.0.0\n * @internal\n */\nexport function useHigherContrastChildren(\n propChildren: ReactNode,\n disable = false\n): ReactNode {\n if (!INTERACTION_CONFIG.higherContrast || disable) {\n return propChildren;\n }\n\n // Note: This will fail if the child is wrapped in a Fragment, but that use\n // case doesn't matter to me\n return Children.map(propChildren, (child) => {\n const t = typeof child;\n if (t === \"string\" || t === \"number\") {\n return <span>{child}</span>;\n }\n\n return child;\n });\n}\n"],"names":["Children","INTERACTION_CONFIG","useHigherContrastChildren","propChildren","disable","higherContrast","map","child","t","span"],"
|
|
1
|
+
{"version":3,"sources":["../../src/interaction/useHigherContrastChildren.tsx"],"sourcesContent":["import { Children, type ReactNode } from \"react\";\nimport { INTERACTION_CONFIG } from \"./config.js\";\n\n/**\n * This hook is used to wrap any `number` and `string` children with a `<span>`\n * so that the ripple/hover/focus background colors do not cause the text to\n * become dimmed.\n *\n * If the {@link INTERACTION_CONFIG.higherContrast} is set to `false`, this hook\n * will just return the `children` unmodified.\n *\n * Note: This should generally be used with the {@link useElementInteraction}\n * hook.\n *\n * @example Simple Example\n * ```tsx\n * import {\n * useElementInteraction,\n * useHigherContrastChildren,\n * } from \"@react-md/core\";\n * import type { ButtonHTMLAttributes, ReactElement, ReactNode } from \"react\";\n *\n * function Example(props: ButtonHTMLAttributes<HTMLButtonElement>): ReactElement {\n * const {\n * children: propChildren,\n * disabled = false,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchEnd,\n * onTouchMove,\n * ...remaining\n * } = props;\n * const { pressedClassName, ripples, handlers } =\n * useElementInteraction({\n * disabled,\n * onClick,\n * onKeyDown,\n * onKeyUp,\n * onMouseDown,\n * onMouseUp,\n * onMouseLeave,\n * onTouchStart,\n * onTouchEnd,\n * onTouchMove,\n * });\n *\n * const children = useHigherContrastChildren(propChildren)\n *\n * return (\n * <button {...remaining} {...handlers} className={pressedClassName}>\n * {children}\n * {ripples}\n * </button>\n * );\n * }\n * ```\n *\n * @param propChildren - The children to conditionally wrap in spans.\n * @param disable - Manually disable this functionality even if the higher\n * contrast mode is enabled. This is really used within `ListItem`s so there\n * aren't unneeded `<span>`s for string/number children when there are addons.\n * @returns the children to render\n * @since 6.0.0\n * @internal\n */\nexport function useHigherContrastChildren(\n propChildren: ReactNode,\n disable = false\n): ReactNode {\n if (!INTERACTION_CONFIG.higherContrast || disable) {\n return propChildren;\n }\n\n // Note: This will fail if the child is wrapped in a Fragment, but that use\n // case doesn't matter to me\n return Children.map(propChildren, (child) => {\n const t = typeof child;\n if (t === \"string\" || t === \"number\") {\n return <span>{child}</span>;\n }\n\n return child;\n });\n}\n"],"names":["Children","INTERACTION_CONFIG","useHigherContrastChildren","propChildren","disable","higherContrast","map","child","t","span"],"mappings":";AAAA,SAASA,QAAQ,QAAwB,QAAQ;AACjD,SAASC,kBAAkB,QAAQ,cAAc;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEC,GACD,OAAO,SAASC,0BACdC,YAAuB,EACvBC,UAAU,KAAK;IAEf,IAAI,CAACH,mBAAmBI,cAAc,IAAID,SAAS;QACjD,OAAOD;IACT;IAEA,2EAA2E;IAC3E,4BAA4B;IAC5B,OAAOH,SAASM,GAAG,CAACH,cAAc,CAACI;QACjC,MAAMC,IAAI,OAAOD;QACjB,IAAIC,MAAM,YAAYA,MAAM,UAAU;YACpC,qBAAO,KAACC;0BAAMF;;QAChB;QAEA,OAAOA;IACT;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/interaction/utils.ts"],"sourcesContent":["import type { KeyboardEvent, MouseEvent, TouchEvent } from \"react\";\nimport { findSizingContainer } from \"../positioning/utils.js\";\nimport type {\n ElementInteractionState,\n RippleState,\n RippleStyle,\n} from \"./types.js\";\n\n/** @internal */\nfunction calcHypotenuse(a: number, b: number): number {\n return Math.sqrt(a * a + b * b);\n}\n\n/**\n * Gets the current radius for a ripple based on the x and y page dimensions\n * as well as the size of the element.\n *\n * This is really just in a separate file so I can easily mock this and write\n * tests.\n *\n * @internal\n */\nfunction getRadius(\n x: number,\n y: number,\n offsetWidth: number,\n offsetHeight: number\n): number {\n return Math.max(\n calcHypotenuse(x, y),\n calcHypotenuse(offsetWidth - x, y),\n calcHypotenuse(offsetWidth - x, offsetHeight - y),\n calcHypotenuse(x, offsetHeight - y)\n );\n}\n\n/** @internal */\nexport function getRippleStyle(\n event:\n | MouseEvent<HTMLElement>\n | TouchEvent<HTMLElement>\n | KeyboardEvent<HTMLElement>,\n programmatic: boolean\n): RippleStyle {\n const element =\n findSizingContainer(event.currentTarget) || event.currentTarget;\n const rect = element.getBoundingClientRect();\n const { left, top, height, width } = rect;\n\n let x: number;\n let y: number;\n if (\"key\" in event || programmatic) {\n x = width / 2;\n y = height / 2;\n } else {\n let pageX: number;\n let pageY: number;\n if (\"touches\" in event) {\n ({ pageX, pageY } = event.touches[0]);\n } else {\n ({ pageX, pageY } = event);\n }\n\n x = pageX - (left + window.pageXOffset);\n y = pageY - (top + window.pageYOffset);\n }\n\n const radius = getRadius(x, y, width, height);\n const size = radius * 2;\n\n return {\n left: x - radius,\n top: y - radius,\n height: size,\n width: size,\n };\n}\n\n/**\n * This is used to set the `exiting` state after a normal \"touch\" duration.\n * 300ms seemed like a good threshold since it is the majority of the scaling\n * duration (450ms)\n */\nconst ENTER_DELAY = 300;\n\n/** @internal */\nexport function releaseRipple(\n state: ElementInteractionState\n): ElementInteractionState {\n // find the first non-exiting ripple which should now be released\n const i = state.ripples.findIndex((ripple) => !ripple.exiting);\n if (i === -1) {\n return state;\n }\n\n const ripples = state.ripples.slice();\n const ripple = ripples[i];\n ripples[i] = {\n ...ripple,\n exiting: ripple.entered || Date.now() - ripple.startTime > ENTER_DELAY,\n };\n return { pressed: false, ripples };\n}\n\n/** @internal */\ninterface UpdateRipplesStateOptions {\n type: \"entered\" | \"exited\";\n state: ElementInteractionState;\n ripple: RippleState;\n holding: boolean;\n}\n\n/** @internal */\nexport function updateRipplesState(\n options: UpdateRipplesStateOptions\n): ElementInteractionState {\n const { type, ripple, state, holding } = options;\n\n const rippleIndex = state.ripples.findIndex((r) => r === ripple);\n if (rippleIndex === -1) {\n return state;\n }\n\n const ripples = state.ripples.slice();\n if (type === \"exited\") {\n ripples.splice(rippleIndex, 1);\n } else {\n const exiting = !holding || Date.now() - ripple.startTime > ENTER_DELAY;\n ripples[rippleIndex] = {\n ...ripple,\n exiting,\n entered: true,\n };\n }\n\n return { ...state, ripples };\n}\n"],"names":["findSizingContainer","calcHypotenuse","a","b","Math","sqrt","getRadius","x","y","offsetWidth","offsetHeight","max","getRippleStyle","event","programmatic","element","currentTarget","rect","getBoundingClientRect","left","top","height","width","pageX","pageY","touches","window","pageXOffset","pageYOffset","radius","size","ENTER_DELAY","releaseRipple","state","i","ripples","findIndex","ripple","exiting","slice","entered","Date","now","startTime","pressed","updateRipplesState","options","type","holding","rippleIndex","r","splice"],"
|
|
1
|
+
{"version":3,"sources":["../../src/interaction/utils.ts"],"sourcesContent":["import type { KeyboardEvent, MouseEvent, TouchEvent } from \"react\";\nimport { findSizingContainer } from \"../positioning/utils.js\";\nimport type {\n ElementInteractionState,\n RippleState,\n RippleStyle,\n} from \"./types.js\";\n\n/** @internal */\nfunction calcHypotenuse(a: number, b: number): number {\n return Math.sqrt(a * a + b * b);\n}\n\n/**\n * Gets the current radius for a ripple based on the x and y page dimensions\n * as well as the size of the element.\n *\n * This is really just in a separate file so I can easily mock this and write\n * tests.\n *\n * @internal\n */\nfunction getRadius(\n x: number,\n y: number,\n offsetWidth: number,\n offsetHeight: number\n): number {\n return Math.max(\n calcHypotenuse(x, y),\n calcHypotenuse(offsetWidth - x, y),\n calcHypotenuse(offsetWidth - x, offsetHeight - y),\n calcHypotenuse(x, offsetHeight - y)\n );\n}\n\n/** @internal */\nexport function getRippleStyle(\n event:\n | MouseEvent<HTMLElement>\n | TouchEvent<HTMLElement>\n | KeyboardEvent<HTMLElement>,\n programmatic: boolean\n): RippleStyle {\n const element =\n findSizingContainer(event.currentTarget) || event.currentTarget;\n const rect = element.getBoundingClientRect();\n const { left, top, height, width } = rect;\n\n let x: number;\n let y: number;\n if (\"key\" in event || programmatic) {\n x = width / 2;\n y = height / 2;\n } else {\n let pageX: number;\n let pageY: number;\n if (\"touches\" in event) {\n ({ pageX, pageY } = event.touches[0]);\n } else {\n ({ pageX, pageY } = event);\n }\n\n x = pageX - (left + window.pageXOffset);\n y = pageY - (top + window.pageYOffset);\n }\n\n const radius = getRadius(x, y, width, height);\n const size = radius * 2;\n\n return {\n left: x - radius,\n top: y - radius,\n height: size,\n width: size,\n };\n}\n\n/**\n * This is used to set the `exiting` state after a normal \"touch\" duration.\n * 300ms seemed like a good threshold since it is the majority of the scaling\n * duration (450ms)\n */\nconst ENTER_DELAY = 300;\n\n/** @internal */\nexport function releaseRipple(\n state: ElementInteractionState\n): ElementInteractionState {\n // find the first non-exiting ripple which should now be released\n const i = state.ripples.findIndex((ripple) => !ripple.exiting);\n if (i === -1) {\n return state;\n }\n\n const ripples = state.ripples.slice();\n const ripple = ripples[i];\n ripples[i] = {\n ...ripple,\n exiting: ripple.entered || Date.now() - ripple.startTime > ENTER_DELAY,\n };\n return { pressed: false, ripples };\n}\n\n/** @internal */\ninterface UpdateRipplesStateOptions {\n type: \"entered\" | \"exited\";\n state: ElementInteractionState;\n ripple: RippleState;\n holding: boolean;\n}\n\n/** @internal */\nexport function updateRipplesState(\n options: UpdateRipplesStateOptions\n): ElementInteractionState {\n const { type, ripple, state, holding } = options;\n\n const rippleIndex = state.ripples.findIndex((r) => r === ripple);\n if (rippleIndex === -1) {\n return state;\n }\n\n const ripples = state.ripples.slice();\n if (type === \"exited\") {\n ripples.splice(rippleIndex, 1);\n } else {\n const exiting = !holding || Date.now() - ripple.startTime > ENTER_DELAY;\n ripples[rippleIndex] = {\n ...ripple,\n exiting,\n entered: true,\n };\n }\n\n return { ...state, ripples };\n}\n"],"names":["findSizingContainer","calcHypotenuse","a","b","Math","sqrt","getRadius","x","y","offsetWidth","offsetHeight","max","getRippleStyle","event","programmatic","element","currentTarget","rect","getBoundingClientRect","left","top","height","width","pageX","pageY","touches","window","pageXOffset","pageYOffset","radius","size","ENTER_DELAY","releaseRipple","state","i","ripples","findIndex","ripple","exiting","slice","entered","Date","now","startTime","pressed","updateRipplesState","options","type","holding","rippleIndex","r","splice"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,0BAA0B;AAO9D,cAAc,GACd,SAASC,eAAeC,CAAS,EAAEC,CAAS;IAC1C,OAAOC,KAAKC,IAAI,CAACH,IAAIA,IAAIC,IAAIA;AAC/B;AAEA;;;;;;;;CAQC,GACD,SAASG,UACPC,CAAS,EACTC,CAAS,EACTC,WAAmB,EACnBC,YAAoB;IAEpB,OAAON,KAAKO,GAAG,CACbV,eAAeM,GAAGC,IAClBP,eAAeQ,cAAcF,GAAGC,IAChCP,eAAeQ,cAAcF,GAAGG,eAAeF,IAC/CP,eAAeM,GAAGG,eAAeF;AAErC;AAEA,cAAc,GACd,OAAO,SAASI,eACdC,KAG8B,EAC9BC,YAAqB;IAErB,MAAMC,UACJf,oBAAoBa,MAAMG,aAAa,KAAKH,MAAMG,aAAa;IACjE,MAAMC,OAAOF,QAAQG,qBAAqB;IAC1C,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,MAAM,EAAEC,KAAK,EAAE,GAAGL;IAErC,IAAIV;IACJ,IAAIC;IACJ,IAAI,SAASK,SAASC,cAAc;QAClCP,IAAIe,QAAQ;QACZd,IAAIa,SAAS;IACf,OAAO;QACL,IAAIE;QACJ,IAAIC;QACJ,IAAI,aAAaX,OAAO;YACrB,CAAA,EAAEU,KAAK,EAAEC,KAAK,EAAE,GAAGX,MAAMY,OAAO,CAAC,EAAE,AAAD;QACrC,OAAO;YACJ,CAAA,EAAEF,KAAK,EAAEC,KAAK,EAAE,GAAGX,KAAI;QAC1B;QAEAN,IAAIgB,QAASJ,CAAAA,OAAOO,OAAOC,WAAW,AAAD;QACrCnB,IAAIgB,QAASJ,CAAAA,MAAMM,OAAOE,WAAW,AAAD;IACtC;IAEA,MAAMC,SAASvB,UAAUC,GAAGC,GAAGc,OAAOD;IACtC,MAAMS,OAA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"],"sourcesContent":["\"use client\";\nimport { forwardRef } from \"react\";\nimport {\n AppBar,\n type AppBarProps,\n type CustomAppBarComponent,\n} from \"../app-bar/AppBar.js\";\nimport {\n SkipToMainContent,\n type SkipToMainContentProps,\n} from \"../link/SkipToMainContent.js\";\nimport { useCSSVariables } from \"../theme/useCSSVariables.js\";\nimport { type CssPosition, type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useLayoutAppBarHeight } from \"./useLayoutAppBarHeight.js\";\n\n/**\n * @since 6.0.0 Only supports `AppBar` + `SkipToMainContent` props\n */\nexport interface LayoutAppBarProps extends AppBarProps {\n /** @defaultValue `\"header\"` */\n as?: CustomAppBarComponent;\n\n /** @defaultValue `\"fixed\"` */\n position?: CssPosition;\n\n /**\n * Any additional props to pass to the {@link SkipToMainContent} component.\n */\n skipProps?: PropsWithRef<SkipToMainContentProps, HTMLAnchorElement>;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to dynamically update the `--rmd-layout-header-offset`\n * based on the current height of this app bar. If you are concerned about\n * javascript bundle size, it is recommended to configure this variable in SCSS\n * instead.\n *\n * @example Static Height\n * ```scss\n * @use \"everything\";\n *\n * :root {\n * @include everything.layout-set-var(header-height, everything.$app-bar-height);\n * }\n * ```\n *\n * @example Media Query Height Changes\n * ```scss\n * @use \"everything\";\n *\n * :root {\n * @include everything.layout-set-var(header-height, everything.$app-bar-height);\n * @include everything.tablet-media {\n * @include everything.layout-set-var(header-height, everything.$app-bar-dense-height);\n * }\n * }\n * ```\n *\n * @since 6.0.0 This component no longer renders the `LayoutNavToggle` and\n * `LayoutAppBarTitle` since they no longer exist. The only purpose of this\n * component is to dynamically set the `--rmd-layout-header-height` variable.\n */\nexport const LayoutAppBar = forwardRef<HTMLDivElement, LayoutAppBarProps>(\n function LayoutAppBar(props, ref) {\n const {\n as = \"header\",\n id: propId,\n position = \"fixed\",\n skipProps,\n children,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"layout-header\");\n const { appBarRef, variables } = useLayoutAppBarHeight(ref);\n useCSSVariables(variables);\n\n return (\n <AppBar\n {...remaining}\n id={id}\n as={as}\n ref={appBarRef}\n position={position}\n >\n <SkipToMainContent {...skipProps} />\n {children}\n </AppBar>\n );\n }\n);\n"],"names":["forwardRef","AppBar","SkipToMainContent","useCSSVariables","useEnsuredId","useLayoutAppBarHeight","LayoutAppBar","props","ref","as","id","propId","position","skipProps","children","remaining","appBarRef","variables"],"
|
|
1
|
+
{"version":3,"sources":["../../src/layout/LayoutAppBar.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef } from \"react\";\nimport {\n AppBar,\n type AppBarProps,\n type CustomAppBarComponent,\n} from \"../app-bar/AppBar.js\";\nimport {\n SkipToMainContent,\n type SkipToMainContentProps,\n} from \"../link/SkipToMainContent.js\";\nimport { useCSSVariables } from \"../theme/useCSSVariables.js\";\nimport { type CssPosition, type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useLayoutAppBarHeight } from \"./useLayoutAppBarHeight.js\";\n\n/**\n * @since 6.0.0 Only supports `AppBar` + `SkipToMainContent` props\n */\nexport interface LayoutAppBarProps extends AppBarProps {\n /** @defaultValue `\"header\"` */\n as?: CustomAppBarComponent;\n\n /** @defaultValue `\"fixed\"` */\n position?: CssPosition;\n\n /**\n * Any additional props to pass to the {@link SkipToMainContent} component.\n */\n skipProps?: PropsWithRef<SkipToMainContentProps, HTMLAnchorElement>;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to dynamically update the `--rmd-layout-header-offset`\n * based on the current height of this app bar. If you are concerned about\n * javascript bundle size, it is recommended to configure this variable in SCSS\n * instead.\n *\n * @example Static Height\n * ```scss\n * @use \"everything\";\n *\n * :root {\n * @include everything.layout-set-var(header-height, everything.$app-bar-height);\n * }\n * ```\n *\n * @example Media Query Height Changes\n * ```scss\n * @use \"everything\";\n *\n * :root {\n * @include everything.layout-set-var(header-height, everything.$app-bar-height);\n * @include everything.tablet-media {\n * @include everything.layout-set-var(header-height, everything.$app-bar-dense-height);\n * }\n * }\n * ```\n *\n * @since 6.0.0 This component no longer renders the `LayoutNavToggle` and\n * `LayoutAppBarTitle` since they no longer exist. The only purpose of this\n * component is to dynamically set the `--rmd-layout-header-height` variable.\n */\nexport const LayoutAppBar = forwardRef<HTMLDivElement, LayoutAppBarProps>(\n function LayoutAppBar(props, ref) {\n const {\n as = \"header\",\n id: propId,\n position = \"fixed\",\n skipProps,\n children,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"layout-header\");\n const { appBarRef, variables } = useLayoutAppBarHeight(ref);\n useCSSVariables(variables);\n\n return (\n <AppBar\n {...remaining}\n id={id}\n as={as}\n ref={appBarRef}\n position={position}\n >\n <SkipToMainContent {...skipProps} />\n {children}\n </AppBar>\n );\n }\n);\n"],"names":["forwardRef","AppBar","SkipToMainContent","useCSSVariables","useEnsuredId","useLayoutAppBarHeight","LayoutAppBar","props","ref","as","id","propId","position","skipProps","children","remaining","appBarRef","variables"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAAQ,QAAQ;AACnC,SACEC,MAAM,QAGD,uBAAuB;AAC9B,SACEC,iBAAiB,QAEZ,+BAA+B;AACtC,SAASC,eAAe,QAAQ,8BAA8B;AAE9D,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,qBAAqB,QAAQ,6BAA6B;AAkBnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCC,GACD,OAAO,MAAMC,6BAAeN,WAC1B,SAASM,aAAaC,KAAK,EAAEC,GAAG;IAC9B,MAAM,EACJC,KAAK,QAAQ,EACbC,IAAIC,MAAM,EACVC,WAAW,OAAO,EAClBC,SAAS,EACTC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IACJ,MAAMG,KAAKN,aAAaO,QAAQ;IAChC,MAAM,EAAEK,SAAS,EAAEC,SAAS,EAAE,GAAGZ,sBAAsBG;IACvDL,gBAAgBc;IAEhB,qBACE,MAAChB;QACE,GAAGc,SAAS;QACbL,IAAIA;QACJD,IAAIA;QACJD,KAAKQ;QACLJ,UAAUA;;0BAEV,KAACV;gBAAmB,GAAGW,SAAS;;YAC/BC;;;AAGP,GACA"}
|
package/dist/layout/LayoutNav.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cnb } from "cnbuilder";
|
|
4
4
|
import { forwardRef } from "react";
|
|
5
|
-
import { DEFAULT_SHEET_CLASSNAMES, DEFAULT_SHEET_TIMEOUT } from "../sheet/
|
|
6
|
-
import { sheet } from "../sheet/styles.js";
|
|
5
|
+
import { DEFAULT_SHEET_CLASSNAMES, DEFAULT_SHEET_TIMEOUT, sheet } from "../sheet/styles.js";
|
|
7
6
|
import { useCSSTransition } from "../transition/useCSSTransition.js";
|
|
8
7
|
import { layoutNav } from "./layoutNavStyles.js";
|
|
9
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/LayoutNav.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport {\n DEFAULT_SHEET_CLASSNAMES,\n DEFAULT_SHEET_TIMEOUT,\n
|
|
1
|
+
{"version":3,"sources":["../../src/layout/LayoutNav.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport {\n DEFAULT_SHEET_CLASSNAMES,\n DEFAULT_SHEET_TIMEOUT,\n sheet,\n type BaseSheetClassNameOptions,\n} from \"../sheet/styles.js\";\nimport {\n type CSSTransitionClassNames,\n type TransitionActions,\n type TransitionCallbacks,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\nimport { layoutNav } from \"./layoutNavStyles.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface LayoutNavProps\n extends HTMLAttributes<HTMLDivElement>,\n BaseSheetClassNameOptions,\n TransitionCallbacks,\n TransitionActions {\n children: ReactNode;\n\n /**\n * The component to render as.\n *\n * @defaultValue `\"nav\"`\n */\n as?: \"nav\" | \"div\";\n\n /**\n * Set this to `true` to display the navigation.\n */\n expanded: boolean;\n\n /**\n * Set this to `true` to force the navigation to appear below the fixed app\n * bar.\n *\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n\n /** @defaultValue {@link DEFAULT_SHEET_TIMEOUT} */\n timeout?: TransitionTimeout;\n /** @defaultValue {@link DEFAULT_SHEET_CLASSNAMES} */\n classNames?: CSSTransitionClassNames;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to render a persistent navigation on the left of the\n * page. There is some built-in functionality to support resizing with the\n * `LayoutWindowSplitter` and expandable layouts. Do not use this component for\n * temporary navigation and instead use a `Sheet`.\n *\n * @example Full Height Layout\n * ```tsx\n * \"use client\";\n * import {\n * LayoutAppBar,\n * LayoutNav,\n * Main,\n * useHorizontalLayoutTransition,\n * } from \"@react-md/core\";\n * import type { ReactElement, PropsWithChildren } from \"react\";\n *\n * function Layout({ children }: PropsWithChildren): ReactElement {\n * const { elementProps } = useHorizontalLayoutTransition({\n * transitionIn: true,\n * });\n *\n * return (\n * <>\n * <LayoutAppBar {...elementProps}>\n * <YourAppBarContent />\n * </LayoutAppBar>\n * <LayoutNav expanded>\n * <YourNavigationComponent />\n * </LayoutNav>\n * <Main navOffset appBarOffset {...elementProps}>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @example Toggleable Layout\n * ```tsx\n * \"use client\";\n * import {\n * LayoutNav,\n * Main,\n * useHorizontalLayoutTransition,\n * useToggle,\n * } from \"@react-md/core\";\n * import MenuIcon from \"@react-md/material-icons/MenuIcon\";\n * import { cnb } from \"cnbuilder\";\n * import type { ReactElement, PropsWithChildren } from \"react\";\n *\n * function Layout({ children }: PropsWithChildren): ReactElement {\n * const { toggled: expanded, toggle } = useToggle();\n * const { elementProps } = useHorizontalLayoutTransition({\n * transitionIn: expanded,\n * });\n *\n * return (\n * <>\n * <LayoutAppBar {...elementProps}>\n * <Button\n * aria-label=\"Navigation\"\n * onClick={toggle}\n * buttonType=\"icon\"\n * >\n * <MenuIcon />\n * </Button>\n * <YourAppBarContent />\n * </LayoutAppBar>\n * <LayoutNav expanded>\n * <YourNavigationComponent />\n * </LayoutNav>\n * <Main navOffset={expanded} appBarOffset {...elementProps}>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport const LayoutNav = forwardRef<HTMLDivElement, LayoutNavProps>(\n function LayoutNav(props, ref) {\n const {\n as: Component = \"nav\",\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = Component == \"nav\" && !ariaLabelledBy\n ? \"Navigation\"\n : undefined,\n expanded,\n children,\n className,\n timeout = DEFAULT_SHEET_TIMEOUT,\n classNames = DEFAULT_SHEET_CLASSNAMES,\n appear,\n enter,\n exit,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExited,\n onExiting,\n appBarOffset,\n ...remaining\n } = props;\n const { elementProps } = useCSSTransition({\n nodeRef: ref,\n timeout,\n className: cnb(\n layoutNav({ appBarOffset }),\n sheet({\n className,\n horizontalSize: \"none\",\n disableOverlay: true,\n })\n ),\n classNames,\n enter,\n exit,\n appear,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExited,\n onExiting,\n exitedHidden: true,\n transitionIn: expanded,\n });\n\n return (\n <Component\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n {...remaining}\n {...elementProps}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["cnb","forwardRef","DEFAULT_SHEET_CLASSNAMES","DEFAULT_SHEET_TIMEOUT","sheet","useCSSTransition","layoutNav","LayoutNav","props","ref","as","Component","ariaLabelledBy","ariaLabel","undefined","expanded","children","className","timeout","classNames","appear","enter","exit","onEnter","onEntering","onEntered","onExit","onExited","onExiting","appBarOffset","remaining","elementProps","nodeRef","horizontalSize","disableOverlay","exitedHidden","transitionIn","aria-label","aria-labelledby"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,UAAU,QAA6C,QAAQ;AACxE,SACEC,wBAAwB,EACxBC,qBAAqB,EACrBC,KAAK,QAEA,qBAAqB;AAO5B,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,SAAS,QAAQ,uBAAuB;AAsCjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmFC,GACD,OAAO,MAAMC,0BAAYN,WACvB,SAASM,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,IAAIC,YAAY,KAAK,EACrB,mBAAmBC,cAAc,EACjC,cAAcC,YAAYF,aAAa,SAAS,CAACC,iBAC7C,eACAE,SAAS,EACbC,QAAQ,EACRC,QAAQ,EACRC,SAAS,EACTC,UAAUf,qBAAqB,EAC/BgB,aAAajB,wBAAwB,EACrCkB,MAAM,EACNC,KAAK,EACLC,IAAI,EACJC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZ,GAAGC,WACJ,GAAGtB;IACJ,MAAM,EAAEuB,YAAY,EAAE,GAAG1B,iBAAiB;QACxC2B,SAASvB;QACTS;QACAD,WAAWjB,IACTM,UAAU;YAAEuB;QAAa,IACzBzB,MAAM;YACJa;YACAgB,gBAAgB;YAChBC,gBAAgB;QAClB;QAEFf;QACAE;QACAC;QACAF;QACAG;QACAC;QACAC;QACAC;QACAC;QACAC;QACAO,cAAc;QACdC,cAAcrB;IAChB;IAEA,qBACE,KAACJ;QACC0B,cAAYxB;QACZyB,mBAAiB1B;QAChB,GAAGkB,SAAS;QACZ,GAAGC,YAAY;kBAEff;;AAGP,GACA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { type BaseWindowSplitterProps } from "../window-splitter/WindowSplitter.js";
|
|
3
2
|
import { type WindowSplitterWidgetProps } from "../window-splitter/useWindowSplitter.js";
|
|
4
3
|
import { type LayoutWindowSplitterClassNameOptions } from "./layoutWindowSplitterStyles.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/LayoutWindowSplitter.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useMemo } from \"react\";\nimport { type DefinedCSSVariableName } from \"../theme/types.js\";\nimport { useCSSVariables } from \"../theme/useCSSVariables.js\";\nimport {\n WindowSplitter,\n type BaseWindowSplitterProps,\n} from \"../window-splitter/WindowSplitter.js\";\nimport { type WindowSplitterWidgetProps } from \"../window-splitter/useWindowSplitter.js\";\nimport {\n layoutWindowSplitter,\n type LayoutWindowSplitterClassNameOptions,\n} from \"./layoutWindowSplitterStyles.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface LayoutWindowSplitterProps\n extends WindowSplitterWidgetProps<HTMLButtonElement>,\n Omit<\n BaseWindowSplitterProps,\n keyof WindowSplitterWidgetProps<HTMLButtonElement>\n >,\n LayoutWindowSplitterClassNameOptions {\n /** @defaultValue `\"Resize Navigation\"` */\n \"aria-label\"?: string;\n\n /**\n * The current navigation width (in px).\n */\n navWidth: number;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to resize the `LayoutNav` component.\n *\n * @see {@link useResizableExpandableLayout} for a default implementation for\n * this component.\n *\n * @example Dynamic Resizing\n * ```tsx\n * import {\n * LayoutNav,\n * LayoutWindowSplitter,\n * Main,\n * NoSsr,\n * useWindowSize,\n * useWindowSplitter,\n * } from \"@react-md/core\";\n * import type { ReactElement, PropsWithChildren } from \"react\"\n *\n * function MyWindowSplitter(): ReactElement {\n * const { width } = useWindowSize({ disableHeight: true });\n * const min = 96;\n * const max = Math.max(600, width * .7);\n *\n * const { value, splitterProps } = useWindowSplitter({\n * min,\n * max,\n * defaultValue: 256,\n * });\n *\n * return (\n * <LayoutWindowSplitter\n * aria-controls=\"layout-nav-id\"\n * {...splitterProps}\n * value={value}\n * />\n * );\n * }\n *\n * function Layout({ children }: PropsWithChildren): ReactElement {\n * return (\n * <>\n * <LayoutNav id=\"layout-nav\" {...otherProps}>\n * <YourNavigation />\n * </LayoutNav>\n * // only required when using SSR\n * <NoSsr>\n * <MyWindowSplitter />\n * </NoSsr>\n * <Main navOffset>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport const LayoutWindowSplitter = forwardRef<\n HTMLButtonElement,\n LayoutWindowSplitterProps\n>(function LayoutWindowSplitter(props, ref) {\n const {\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = ariaLabelledBy ? undefined : \"Resize Navigation\",\n appBarOffset,\n disableResponsive,\n className,\n navWidth,\n ...remaining\n } = props;\n\n useCSSVariables<DefinedCSSVariableName>(\n useMemo(\n () => [{ name: \"--rmd-layout-size\", value: `${navWidth}px` }],\n [navWidth]\n )\n );\n\n return (\n <WindowSplitter\n {...remaining}\n ref={ref}\n aria-label={ariaLabel as string}\n aria-labelledby={ariaLabelledBy}\n className={layoutWindowSplitter({\n appBarOffset,\n disableResponsive,\n className,\n })}\n />\n );\n});\n"],"names":["forwardRef","useMemo","useCSSVariables","WindowSplitter","layoutWindowSplitter","LayoutWindowSplitter","props","ref","ariaLabelledBy","ariaLabel","undefined","appBarOffset","disableResponsive","className","navWidth","remaining","name","value","aria-label","aria-labelledby"],"
|
|
1
|
+
{"version":3,"sources":["../../src/layout/LayoutWindowSplitter.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, useMemo } from \"react\";\nimport { type DefinedCSSVariableName } from \"../theme/types.js\";\nimport { useCSSVariables } from \"../theme/useCSSVariables.js\";\nimport {\n WindowSplitter,\n type BaseWindowSplitterProps,\n} from \"../window-splitter/WindowSplitter.js\";\nimport { type WindowSplitterWidgetProps } from \"../window-splitter/useWindowSplitter.js\";\nimport {\n layoutWindowSplitter,\n type LayoutWindowSplitterClassNameOptions,\n} from \"./layoutWindowSplitterStyles.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface LayoutWindowSplitterProps\n extends WindowSplitterWidgetProps<HTMLButtonElement>,\n Omit<\n BaseWindowSplitterProps,\n keyof WindowSplitterWidgetProps<HTMLButtonElement>\n >,\n LayoutWindowSplitterClassNameOptions {\n /** @defaultValue `\"Resize Navigation\"` */\n \"aria-label\"?: string;\n\n /**\n * The current navigation width (in px).\n */\n navWidth: number;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to resize the `LayoutNav` component.\n *\n * @see {@link useResizableExpandableLayout} for a default implementation for\n * this component.\n *\n * @example Dynamic Resizing\n * ```tsx\n * import {\n * LayoutNav,\n * LayoutWindowSplitter,\n * Main,\n * NoSsr,\n * useWindowSize,\n * useWindowSplitter,\n * } from \"@react-md/core\";\n * import type { ReactElement, PropsWithChildren } from \"react\"\n *\n * function MyWindowSplitter(): ReactElement {\n * const { width } = useWindowSize({ disableHeight: true });\n * const min = 96;\n * const max = Math.max(600, width * .7);\n *\n * const { value, splitterProps } = useWindowSplitter({\n * min,\n * max,\n * defaultValue: 256,\n * });\n *\n * return (\n * <LayoutWindowSplitter\n * aria-controls=\"layout-nav-id\"\n * {...splitterProps}\n * value={value}\n * />\n * );\n * }\n *\n * function Layout({ children }: PropsWithChildren): ReactElement {\n * return (\n * <>\n * <LayoutNav id=\"layout-nav\" {...otherProps}>\n * <YourNavigation />\n * </LayoutNav>\n * // only required when using SSR\n * <NoSsr>\n * <MyWindowSplitter />\n * </NoSsr>\n * <Main navOffset>\n * {children}\n * </Main>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport const LayoutWindowSplitter = forwardRef<\n HTMLButtonElement,\n LayoutWindowSplitterProps\n>(function LayoutWindowSplitter(props, ref) {\n const {\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = ariaLabelledBy ? undefined : \"Resize Navigation\",\n appBarOffset,\n disableResponsive,\n className,\n navWidth,\n ...remaining\n } = props;\n\n useCSSVariables<DefinedCSSVariableName>(\n useMemo(\n () => [{ name: \"--rmd-layout-size\", value: `${navWidth}px` }],\n [navWidth]\n )\n );\n\n return (\n <WindowSplitter\n {...remaining}\n ref={ref}\n aria-label={ariaLabel as string}\n aria-labelledby={ariaLabelledBy}\n className={layoutWindowSplitter({\n appBarOffset,\n disableResponsive,\n className,\n })}\n />\n );\n});\n"],"names":["forwardRef","useMemo","useCSSVariables","WindowSplitter","layoutWindowSplitter","LayoutWindowSplitter","props","ref","ariaLabelledBy","ariaLabel","undefined","appBarOffset","disableResponsive","className","navWidth","remaining","name","value","aria-label","aria-labelledby"],"mappings":"AAAA;;AACA,SAASA,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AAE5C,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SACEC,cAAc,QAET,uCAAuC;AAE9C,SACEC,oBAAoB,QAEf,kCAAkC;AAqBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DC,GACD,OAAO,MAAMC,qCAAuBL,WAGlC,SAASK,qBAAqBC,KAAK,EAAEC,GAAG;IACxC,MAAM,EACJ,mBAAmBC,cAAc,EACjC,cAAcC,YAAYD,iBAAiBE,YAAY,mBAAmB,EAC1EC,YAAY,EACZC,iBAAiB,EACjBC,SAAS,EACTC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IAEJJ,gBACED,QACE,IAAM;YAAC;gBAAEe,MAAM;gBAAqBC,OAAO,CAAC,EAAEH,SAAS,EAAE,CAAC;YAAC;SAAE,EAC7D;QAACA;KAAS;IAId,qBACE,KAACX;QACE,GAAGY,SAAS;QACbR,KAAKA;QACLW,cAAYT;QACZU,mBAAiBX;QACjBK,WAAWT,qBAAqB;YAC9BO;YACAC;YACAC;QACF;;AAGN,GAAG"}
|
package/dist/layout/Main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/Main.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n type ElementType,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { main, type MainClassNameOptions } from \"./mainStyles.js\";\nimport { useMainTabIndex } from \"./useMainTabIndex.js\";\n\n/**\n * @since 6.0.0\n */\nexport type CustomMainElement = ElementType<\n HTMLAttributes<HTMLElement> & {\n ref: Ref<HTMLElement>;\n className?: string;\n tabIndex?: number;\n }\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface MainProps\n extends HTMLAttributes<HTMLElement>,\n MainClassNameOptions {\n /**\n * @defaultValue `\"main\"`\n */\n as?: CustomMainElement;\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component is really only used to dynamically set the `tabIndex` to `-1`\n * while using a keyboard for the `SkipToMainContent` component's focus behavior\n * to work correctly. If you don't need that functionality, use the {@link main}\n * style utility instead.\n *\n * @example Styles Only\n * ```tsx\n * import { main as mainStyles } from \"@react-md/core\":\n *\n * function MyCustomMainElement({ children }) {\n * return (\n * <main\n * className={mainStyles({\n * navOffset: true,\n * appBarOffset: true,\n * })}\n * >\n * {children}\n * </main>\n * );\n * }\n * ```\n *\n * @since 6.0.0 Renamed from `LayoutMain` removed a lot of\n * functionality to keep this component simple.\n */\nexport const Main = forwardRef<HTMLElement, MainProps>(\n function Main(props, ref) {\n const {\n as: Component = \"main\",\n id: propId,\n className,\n children,\n tabIndex: propTabIndex,\n navOffset,\n appBarOffset,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"main\");\n const tabIndex = useMainTabIndex(propTabIndex);\n\n return (\n <Component\n {...remaining}\n id={id}\n ref={ref}\n className={main({ navOffset, appBarOffset, className })}\n tabIndex={tabIndex}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","main","useMainTabIndex","Main","props","ref","as","Component","id","propId","className","children","tabIndex","propTabIndex","navOffset","appBarOffset","remaining"],"
|
|
1
|
+
{"version":3,"sources":["../../src/layout/Main.tsx"],"sourcesContent":["\"use client\";\nimport {\n forwardRef,\n type ElementType,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { main, type MainClassNameOptions } from \"./mainStyles.js\";\nimport { useMainTabIndex } from \"./useMainTabIndex.js\";\n\n/**\n * @since 6.0.0\n */\nexport type CustomMainElement = ElementType<\n HTMLAttributes<HTMLElement> & {\n ref: Ref<HTMLElement>;\n className?: string;\n tabIndex?: number;\n }\n>;\n\n/**\n * @since 6.0.0\n */\nexport interface MainProps\n extends HTMLAttributes<HTMLElement>,\n MainClassNameOptions {\n /**\n * @defaultValue `\"main\"`\n */\n as?: CustomMainElement;\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component is really only used to dynamically set the `tabIndex` to `-1`\n * while using a keyboard for the `SkipToMainContent` component's focus behavior\n * to work correctly. If you don't need that functionality, use the {@link main}\n * style utility instead.\n *\n * @example Styles Only\n * ```tsx\n * import { main as mainStyles } from \"@react-md/core\":\n *\n * function MyCustomMainElement({ children }) {\n * return (\n * <main\n * className={mainStyles({\n * navOffset: true,\n * appBarOffset: true,\n * })}\n * >\n * {children}\n * </main>\n * );\n * }\n * ```\n *\n * @since 6.0.0 Renamed from `LayoutMain` removed a lot of\n * functionality to keep this component simple.\n */\nexport const Main = forwardRef<HTMLElement, MainProps>(\n function Main(props, ref) {\n const {\n as: Component = \"main\",\n id: propId,\n className,\n children,\n tabIndex: propTabIndex,\n navOffset,\n appBarOffset,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"main\");\n const tabIndex = useMainTabIndex(propTabIndex);\n\n return (\n <Component\n {...remaining}\n id={id}\n ref={ref}\n className={main({ navOffset, appBarOffset, className })}\n tabIndex={tabIndex}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","main","useMainTabIndex","Main","props","ref","as","Component","id","propId","className","children","tabIndex","propTabIndex","navOffset","appBarOffset","remaining"],"mappings":"AAAA;;AACA,SACEA,UAAU,QAKL,QAAQ;AACf,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,IAAI,QAAmC,kBAAkB;AAClE,SAASC,eAAe,QAAQ,uBAAuB;AA0BvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,MAAMC,qBAAOJ,WAClB,SAASI,KAAKC,KAAK,EAAEC,GAAG;IACtB,MAAM,EACJC,IAAIC,YAAY,MAAM,EACtBC,IAAIC,MAAM,EACVC,SAAS,EACTC,QAAQ,EACRC,UAAUC,YAAY,EACtBC,SAAS,EACTC,YAAY,EACZ,GAAGC,WACJ,GAAGZ;IACJ,MAAMI,KAAKR,aAAaS,QAAQ;IAChC,MAAMG,WAAWV,gBAAgBW;IAEjC,qBACE,KAACN;QACE,GAAGS,SAAS;QACbR,IAAIA;QACJH,KAAKA;QACLK,WAAWT,KAAK;YAAEa;YAAWC;YAAcL;QAAU;QACrDE,UAAUA;kBAETD;;AAGP,GACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/layoutNavStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-nav\");\n\n/**\n * @since 6.0.0\n */\nexport interface LayoutNavClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` if the nav should appear below the fixed app bar.\n *\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function layoutNav(options: LayoutNavClassNameOptions = {}): string {\n const { className, appBarOffset } = options;\n\n return cnb(styles({ \"offset-v\": appBarOffset }), className);\n}\n"],"names":["cnb","bem","styles","layoutNav","options","className","appBarOffset"],"
|
|
1
|
+
{"version":3,"sources":["../../src/layout/layoutNavStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-nav\");\n\n/**\n * @since 6.0.0\n */\nexport interface LayoutNavClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` if the nav should appear below the fixed app bar.\n *\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function layoutNav(options: LayoutNavClassNameOptions = {}): string {\n const { className, appBarOffset } = options;\n\n return cnb(styles({ \"offset-v\": appBarOffset }), className);\n}\n"],"names":["cnb","bem","styles","layoutNav","options","className","appBarOffset"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AAgBnB;;CAEC,GACD,OAAO,SAASE,UAAUC,UAAqC,CAAC,CAAC;IAC/D,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAE,GAAGF;IAEpC,OAAOJ,IAAIE,OAAO;QAAE,YAAYI;IAAa,IAAID;AACnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/layoutWindowSplitterStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-splitter\");\n\n/**\n * @since 6.0.0\n */\nexport interface LayoutWindowSplitterClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` if the window splitter should stop below the fixed app\n * bar.\n *\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n\n /**\n * Set this to `true` if the window splitter should no longer automatically be\n * hidden on for any viewport below the `$layout-navigation-breakpoint`\n * (default phone).\n *\n * @defaultValue `false`\n */\n disableResponsive?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function layoutWindowSplitter(\n options: LayoutWindowSplitterClassNameOptions = {}\n): string {\n const { className, appBarOffset, disableResponsive } = options;\n\n return cnb(\n styles({\n \"offset-v\": appBarOffset,\n responsive: !disableResponsive,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","layoutWindowSplitter","options","className","appBarOffset","disableResponsive","responsive"],"
|
|
1
|
+
{"version":3,"sources":["../../src/layout/layoutWindowSplitterStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-splitter\");\n\n/**\n * @since 6.0.0\n */\nexport interface LayoutWindowSplitterClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` if the window splitter should stop below the fixed app\n * bar.\n *\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n\n /**\n * Set this to `true` if the window splitter should no longer automatically be\n * hidden on for any viewport below the `$layout-navigation-breakpoint`\n * (default phone).\n *\n * @defaultValue `false`\n */\n disableResponsive?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function layoutWindowSplitter(\n options: LayoutWindowSplitterClassNameOptions = {}\n): string {\n const { className, appBarOffset, disableResponsive } = options;\n\n return cnb(\n styles({\n \"offset-v\": appBarOffset,\n responsive: !disableResponsive,\n }),\n className\n );\n}\n"],"names":["cnb","bem","styles","layoutWindowSplitter","options","className","appBarOffset","disableResponsive","responsive"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AA0BnB;;CAEC,GACD,OAAO,SAASE,qBACdC,UAAgD,CAAC,CAAC;IAElD,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAEC,iBAAiB,EAAE,GAAGH;IAEvD,OAAOJ,IACLE,OAAO;QACL,YAAYI;QACZE,YAAY,CAACD;IACf,IACAF;AAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/mainStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-main\");\n\n/**\n * @since 6.0.0\n */\nexport interface MainClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to apply `margin-left` equal to the current navigation\n * width. If you want this value to animate, use the `useMainClassName` hook\n * instead.\n *\n * @defaultValue `false`\n */\n navOffset?: boolean;\n\n /**\n * Set this to `true` to apply `padding-top` equal to the height of the main\n * app bar so that content is not covered.\n *\n * @see {@link useLayoutAppBarHeight}\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function main(options: MainClassNameOptions = {}): string {\n const { navOffset, appBarOffset, className } = options;\n\n return cnb(\n styles({\n \"offset-v\": appBarOffset,\n }),\n navOffset && \"rmd-layout-h--active\",\n className\n );\n}\n"],"names":["cnb","bem","styles","main","options","navOffset","appBarOffset","className"],"
|
|
1
|
+
{"version":3,"sources":["../../src/layout/mainStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\nconst styles = bem(\"rmd-layout-main\");\n\n/**\n * @since 6.0.0\n */\nexport interface MainClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to apply `margin-left` equal to the current navigation\n * width. If you want this value to animate, use the `useMainClassName` hook\n * instead.\n *\n * @defaultValue `false`\n */\n navOffset?: boolean;\n\n /**\n * Set this to `true` to apply `padding-top` equal to the height of the main\n * app bar so that content is not covered.\n *\n * @see {@link useLayoutAppBarHeight}\n * @defaultValue `false`\n */\n appBarOffset?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function main(options: MainClassNameOptions = {}): string {\n const { navOffset, appBarOffset, className } = options;\n\n return cnb(\n styles({\n \"offset-v\": appBarOffset,\n }),\n navOffset && \"rmd-layout-h--active\",\n className\n );\n}\n"],"names":["cnb","bem","styles","main","options","navOffset","appBarOffset","className"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAEtC,MAAMC,SAASD,IAAI;AA2BnB;;CAEC,GACD,OAAO,SAASE,KAAKC,UAAgC,CAAC,CAAC;IACrD,MAAM,EAAEC,SAAS,EAAEC,YAAY,EAAEC,SAAS,EAAE,GAAGH;IAE/C,OAAOJ,IACLE,OAAO;QACL,YAAYI;IACd,IACAD,aAAa,wBACbE;AAEJ"}
|