@react-md/core 6.0.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CoreProviders.d.ts +1 -1
- package/dist/CoreProviders.js +1 -1
- package/dist/CoreProviders.js.map +1 -1
- package/dist/SsrProvider.d.ts +1 -1
- package/dist/SsrProvider.js +1 -1
- package/dist/SsrProvider.js.map +1 -1
- package/dist/_base.scss +6 -2
- package/dist/_border-radius.scss +92 -0
- package/dist/_core.scss +2 -0
- package/dist/_spacing.scss +86 -0
- package/dist/app-bar/_app-bar.scss +9 -7
- package/dist/app-bar/styles.js +1 -1
- package/dist/app-bar/styles.js.map +1 -1
- package/dist/autocomplete/Autocomplete.d.ts +2 -2
- package/dist/autocomplete/Autocomplete.js +1 -1
- package/dist/autocomplete/Autocomplete.js.map +1 -1
- package/dist/autocomplete/AutocompleteChip.d.ts +1 -1
- package/dist/autocomplete/AutocompleteChip.js +1 -1
- package/dist/autocomplete/AutocompleteChip.js.map +1 -1
- package/dist/autocomplete/AutocompleteCircularProgress.d.ts +1 -1
- package/dist/autocomplete/AutocompleteCircularProgress.js +1 -1
- package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -1
- package/dist/autocomplete/AutocompleteClearButton.d.ts +1 -1
- package/dist/autocomplete/AutocompleteClearButton.js +1 -1
- package/dist/autocomplete/AutocompleteClearButton.js.map +1 -1
- package/dist/autocomplete/AutocompleteDropdownButton.d.ts +1 -1
- package/dist/autocomplete/AutocompleteDropdownButton.js +1 -1
- package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -1
- package/dist/autocomplete/_autocomplete.scss +8 -5
- package/dist/autocomplete/useAutocomplete.d.ts +3 -3
- package/dist/autocomplete/useAutocomplete.js +2 -1
- package/dist/autocomplete/useAutocomplete.js.map +1 -1
- package/dist/avatar/Avatar.d.ts +1 -1
- package/dist/avatar/Avatar.js +1 -1
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/avatar/_avatar.scss +3 -3
- package/dist/badge/Badge.d.ts +1 -1
- package/dist/badge/Badge.js +1 -1
- package/dist/badge/Badge.js.map +1 -1
- package/dist/badge/_badge.scss +10 -2
- package/dist/box/Box.d.ts +1 -1
- package/dist/box/Box.js +1 -1
- package/dist/box/Box.js.map +1 -1
- package/dist/box/_box.scss +78 -11
- package/dist/button/AsyncButton.d.ts +1 -1
- package/dist/button/AsyncButton.js +1 -1
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/button/Button.d.ts +1 -1
- package/dist/button/Button.js +1 -1
- package/dist/button/Button.js.map +1 -1
- package/dist/button/ButtonUnstyled.d.ts +1 -1
- package/dist/button/ButtonUnstyled.js +1 -1
- package/dist/button/ButtonUnstyled.js.map +1 -1
- package/dist/button/TooltippedButton.d.ts +1 -1
- package/dist/button/TooltippedButton.js +1 -1
- package/dist/button/TooltippedButton.js.map +1 -1
- package/dist/button/_button.scss +21 -11
- package/dist/card/Card.d.ts +1 -1
- package/dist/card/Card.js +1 -1
- package/dist/card/Card.js.map +1 -1
- package/dist/card/CardContent.d.ts +1 -1
- package/dist/card/CardContent.js +1 -1
- package/dist/card/CardContent.js.map +1 -1
- package/dist/card/CardFooter.d.ts +1 -1
- package/dist/card/CardFooter.js +1 -1
- package/dist/card/CardFooter.js.map +1 -1
- package/dist/card/CardHeader.d.ts +1 -1
- package/dist/card/CardHeader.js +1 -1
- package/dist/card/CardHeader.js.map +1 -1
- package/dist/card/CardSubtitle.d.ts +1 -1
- package/dist/card/CardSubtitle.js +1 -1
- package/dist/card/CardSubtitle.js.map +1 -1
- package/dist/card/CardTitle.d.ts +1 -1
- package/dist/card/CardTitle.js +1 -1
- package/dist/card/CardTitle.js.map +1 -1
- package/dist/card/ClickableCard.d.ts +1 -1
- package/dist/card/ClickableCard.js +1 -1
- package/dist/card/ClickableCard.js.map +1 -1
- package/dist/card/_card.scss +9 -7
- package/dist/chip/Chip.d.ts +1 -1
- package/dist/chip/Chip.js +1 -1
- package/dist/chip/Chip.js.map +1 -1
- package/dist/chip/_chip.scss +9 -7
- package/dist/dialog/Dialog.d.ts +1 -1
- package/dist/dialog/Dialog.js +1 -1
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/DialogContent.d.ts +1 -1
- package/dist/dialog/DialogContent.js +1 -1
- package/dist/dialog/DialogContent.js.map +1 -1
- package/dist/dialog/DialogFooter.d.ts +1 -1
- package/dist/dialog/DialogFooter.js +1 -1
- package/dist/dialog/DialogFooter.js.map +1 -1
- package/dist/dialog/DialogHeader.d.ts +1 -1
- package/dist/dialog/DialogHeader.js +1 -1
- package/dist/dialog/DialogHeader.js.map +1 -1
- package/dist/dialog/DialogTitle.d.ts +1 -1
- package/dist/dialog/DialogTitle.js +1 -1
- package/dist/dialog/DialogTitle.js.map +1 -1
- package/dist/dialog/FixedDialog.d.ts +1 -1
- package/dist/dialog/FixedDialog.js +1 -1
- package/dist/dialog/FixedDialog.js.map +1 -1
- package/dist/dialog/_dialog.scss +7 -6
- package/dist/divider/Divider.d.ts +1 -1
- package/dist/divider/Divider.js +1 -1
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/_divider.scss +3 -2
- package/dist/draggable/useDraggable.d.ts +1 -1
- package/dist/draggable/useDraggable.js +1 -1
- package/dist/draggable/useDraggable.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 +1 -1
- package/dist/expansion-panel/ExpansionPanel.js +1 -1
- package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanelHeader.d.ts +1 -1
- package/dist/expansion-panel/ExpansionPanelHeader.js +1 -1
- package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
- package/dist/expansion-panel/_expansion-panel.scss +4 -3
- package/dist/expansion-panel/useExpansionList.d.ts +1 -1
- package/dist/expansion-panel/useExpansionList.js +1 -1
- package/dist/expansion-panel/useExpansionList.js.map +1 -1
- package/dist/expansion-panel/useExpansionPanels.d.ts +1 -1
- package/dist/expansion-panel/useExpansionPanels.js +1 -1
- package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
- package/dist/files/FileInput.d.ts +1 -1
- package/dist/files/FileInput.js +1 -1
- package/dist/files/FileInput.js.map +1 -1
- package/dist/files/useFileUpload.d.ts +2 -2
- package/dist/files/useFileUpload.js +2 -2
- package/dist/files/useFileUpload.js.map +1 -1
- package/dist/form/Checkbox.d.ts +1 -1
- package/dist/form/Checkbox.js +1 -1
- package/dist/form/Checkbox.js.map +1 -1
- package/dist/form/Fieldset.d.ts +1 -1
- package/dist/form/Fieldset.js +1 -1
- package/dist/form/Fieldset.js.map +1 -1
- package/dist/form/Form.d.ts +1 -1
- package/dist/form/Form.js +1 -1
- package/dist/form/Form.js.map +1 -1
- package/dist/form/FormMessage.d.ts +1 -1
- package/dist/form/FormMessage.js +1 -1
- package/dist/form/FormMessage.js.map +1 -1
- package/dist/form/FormMessageContainer.d.ts +1 -1
- package/dist/form/FormMessageContainer.js +1 -1
- package/dist/form/FormMessageContainer.js.map +1 -1
- package/dist/form/FormMessageCounter.d.ts +2 -2
- package/dist/form/FormMessageCounter.js +2 -2
- package/dist/form/FormMessageCounter.js.map +1 -1
- package/dist/form/InputToggle.d.ts +2 -2
- package/dist/form/InputToggle.js +2 -2
- package/dist/form/InputToggle.js.map +1 -1
- package/dist/form/Label.d.ts +3 -3
- package/dist/form/Label.js +3 -3
- package/dist/form/Label.js.map +1 -1
- package/dist/form/Legend.d.ts +1 -1
- package/dist/form/Legend.js +1 -1
- package/dist/form/Legend.js.map +1 -1
- package/dist/form/NativeSelect.d.ts +1 -1
- package/dist/form/NativeSelect.js +1 -1
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/OptGroup.d.ts +1 -1
- package/dist/form/OptGroup.js +1 -1
- package/dist/form/OptGroup.js.map +1 -1
- package/dist/form/Option.d.ts +1 -1
- package/dist/form/Option.js +1 -1
- package/dist/form/Option.js.map +1 -1
- package/dist/form/Password.d.ts +1 -1
- package/dist/form/Password.js +1 -1
- package/dist/form/Password.js.map +1 -1
- package/dist/form/Radio.d.ts +1 -1
- package/dist/form/Radio.js +1 -1
- package/dist/form/Radio.js.map +1 -1
- package/dist/form/Select.d.ts +1 -1
- package/dist/form/Select.js +1 -1
- package/dist/form/Select.js.map +1 -1
- package/dist/form/Slider.d.ts +1 -1
- package/dist/form/Slider.js.map +1 -1
- package/dist/form/Switch.d.ts +1 -1
- package/dist/form/Switch.js +1 -1
- package/dist/form/Switch.js.map +1 -1
- package/dist/form/TextArea.d.ts +1 -1
- package/dist/form/TextArea.js +2 -2
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextField.d.ts +1 -1
- package/dist/form/TextField.js +1 -1
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/_form-message.scss +4 -3
- package/dist/form/_input-toggle.scss +2 -1
- package/dist/form/_label.scss +3 -2
- package/dist/form/_password.scss +2 -1
- package/dist/form/_select.scss +4 -4
- package/dist/form/_slider.scss +4 -3
- package/dist/form/_switch.scss +2 -1
- package/dist/form/_text-area.scss +3 -2
- package/dist/form/_text-field.scss +20 -16
- package/dist/form/useCheckboxGroup.d.ts +8 -8
- package/dist/form/useCheckboxGroup.js +2 -2
- package/dist/form/useCheckboxGroup.js.map +1 -1
- package/dist/form/useCombobox.js +1 -0
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useNumberField.d.ts +2 -2
- package/dist/form/useNumberField.js +2 -2
- package/dist/form/useNumberField.js.map +1 -1
- package/dist/form/useRadioGroup.d.ts +4 -4
- package/dist/form/useRadioGroup.js +2 -2
- package/dist/form/useRadioGroup.js.map +1 -1
- package/dist/form/useRangeSlider.d.ts +1 -1
- package/dist/form/useRangeSlider.js +1 -1
- package/dist/form/useRangeSlider.js.map +1 -1
- package/dist/form/useSlider.d.ts +1 -1
- package/dist/form/useSlider.js +1 -1
- package/dist/form/useSlider.js.map +1 -1
- package/dist/form/useTextField.d.ts +4 -4
- package/dist/form/useTextField.js +2 -2
- package/dist/form/useTextField.js.map +1 -1
- package/dist/form/utils.js +1 -0
- package/dist/form/utils.js.map +1 -1
- package/dist/icon/FontIcon.d.ts +1 -1
- package/dist/icon/FontIcon.js +1 -1
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/IconRotator.d.ts +1 -1
- package/dist/icon/IconRotator.js +1 -1
- package/dist/icon/IconRotator.js.map +1 -1
- package/dist/icon/MaterialIcon.d.ts +2 -2
- package/dist/icon/MaterialIcon.js +2 -2
- package/dist/icon/MaterialIcon.js.map +1 -1
- package/dist/icon/MaterialSymbol.d.ts +2 -2
- package/dist/icon/MaterialSymbol.js +2 -2
- package/dist/icon/MaterialSymbol.js.map +1 -1
- package/dist/icon/SVGIcon.d.ts +1 -1
- package/dist/icon/SVGIcon.js +1 -1
- package/dist/icon/SVGIcon.js.map +1 -1
- package/dist/icon/TextIconSpacing.d.ts +1 -1
- package/dist/icon/TextIconSpacing.js +1 -1
- package/dist/icon/TextIconSpacing.js.map +1 -1
- package/dist/icon/_icon.scss +2 -1
- package/dist/interaction/useElementInteraction.js +1 -1
- package/dist/interaction/useElementInteraction.js.map +1 -1
- package/dist/layout/LayoutAppBar.d.ts +1 -1
- package/dist/layout/LayoutAppBar.js +1 -1
- package/dist/layout/LayoutAppBar.js.map +1 -1
- package/dist/layout/LayoutNav.d.ts +1 -1
- package/dist/layout/LayoutNav.js +2 -2
- package/dist/layout/LayoutNav.js.map +1 -1
- package/dist/layout/LayoutWindowSplitter.d.ts +1 -1
- package/dist/layout/LayoutWindowSplitter.js +1 -1
- package/dist/layout/LayoutWindowSplitter.js.map +1 -1
- package/dist/layout/Main.d.ts +1 -1
- package/dist/layout/Main.js +1 -1
- package/dist/layout/Main.js.map +1 -1
- package/dist/layout/useExpandableLayout.d.ts +1 -1
- package/dist/layout/useExpandableLayout.js +1 -1
- package/dist/layout/useExpandableLayout.js.map +1 -1
- package/dist/layout/useHorizontalLayoutTransition.d.ts +1 -1
- package/dist/layout/useHorizontalLayoutTransition.js +1 -1
- package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
- package/dist/layout/useLayoutAppBarHeight.d.ts +1 -1
- package/dist/layout/useLayoutAppBarHeight.js +1 -1
- package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
- package/dist/layout/useLayoutTree.d.ts +3 -3
- package/dist/layout/useLayoutTree.js +3 -3
- package/dist/layout/useLayoutTree.js.map +1 -1
- package/dist/layout/useLayoutWindowSplitter.d.ts +1 -1
- package/dist/layout/useLayoutWindowSplitter.js +1 -1
- package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
- package/dist/layout/useMainTabIndex.js +1 -0
- package/dist/layout/useMainTabIndex.js.map +1 -1
- package/dist/layout/useResizableLayout.d.ts +1 -1
- package/dist/layout/useResizableLayout.js +1 -1
- package/dist/layout/useResizableLayout.js.map +1 -1
- package/dist/layout/useTemporaryLayout.d.ts +1 -1
- package/dist/layout/useTemporaryLayout.js +1 -1
- package/dist/layout/useTemporaryLayout.js.map +1 -1
- package/dist/link/Link.d.ts +1 -1
- package/dist/link/Link.js +1 -1
- package/dist/link/Link.js.map +1 -1
- package/dist/link/SkipToMainContent.d.ts +1 -1
- package/dist/link/SkipToMainContent.js +1 -1
- package/dist/link/SkipToMainContent.js.map +1 -1
- package/dist/link/_link.scss +3 -2
- package/dist/list/List.d.ts +1 -1
- package/dist/list/List.js +1 -1
- package/dist/list/List.js.map +1 -1
- package/dist/list/ListItem.d.ts +1 -1
- package/dist/list/ListItem.js +1 -1
- package/dist/list/ListItem.js.map +1 -1
- package/dist/list/ListItemChildren.d.ts +1 -1
- package/dist/list/ListItemChildren.js +1 -1
- package/dist/list/ListItemChildren.js.map +1 -1
- package/dist/list/ListItemLink.d.ts +1 -1
- package/dist/list/ListItemLink.js +1 -1
- package/dist/list/ListItemLink.js.map +1 -1
- package/dist/list/ListSubheader.d.ts +1 -1
- package/dist/list/ListSubheader.js +1 -1
- package/dist/list/ListSubheader.js.map +1 -1
- package/dist/list/_list.scss +7 -6
- package/dist/media-queries/AppSizeProvider.d.ts +2 -2
- package/dist/media-queries/AppSizeProvider.js +2 -2
- package/dist/media-queries/AppSizeProvider.js.map +1 -1
- package/dist/media-queries/useMediaQuery.d.ts +2 -2
- package/dist/media-queries/useMediaQuery.js +2 -2
- package/dist/media-queries/useMediaQuery.js.map +1 -1
- package/dist/menu/DropdownMenu.d.ts +1 -1
- package/dist/menu/DropdownMenu.js +2 -1
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.d.ts +1 -1
- package/dist/menu/Menu.js +1 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuBar.d.ts +1 -1
- package/dist/menu/MenuBar.js +1 -1
- package/dist/menu/MenuBar.js.map +1 -1
- package/dist/menu/MenuButton.d.ts +1 -1
- package/dist/menu/MenuButton.js +1 -1
- package/dist/menu/MenuButton.js.map +1 -1
- package/dist/menu/MenuItem.d.ts +1 -1
- package/dist/menu/MenuItem.js +1 -1
- package/dist/menu/MenuItem.js.map +1 -1
- package/dist/menu/MenuItemCheckbox.d.ts +1 -1
- package/dist/menu/MenuItemCheckbox.js +1 -1
- package/dist/menu/MenuItemCheckbox.js.map +1 -1
- package/dist/menu/MenuItemFileInput.d.ts +1 -1
- package/dist/menu/MenuItemFileInput.js +1 -1
- package/dist/menu/MenuItemFileInput.js.map +1 -1
- package/dist/menu/MenuItemGroup.d.ts +1 -1
- package/dist/menu/MenuItemGroup.js +1 -1
- package/dist/menu/MenuItemGroup.js.map +1 -1
- package/dist/menu/MenuItemInputToggle.d.ts +1 -1
- package/dist/menu/MenuItemInputToggle.js +1 -1
- package/dist/menu/MenuItemInputToggle.js.map +1 -1
- package/dist/menu/MenuItemRadio.d.ts +1 -1
- package/dist/menu/MenuItemRadio.js +1 -1
- package/dist/menu/MenuItemRadio.js.map +1 -1
- package/dist/menu/MenuItemSeparator.d.ts +1 -1
- package/dist/menu/MenuItemSeparator.js +1 -1
- package/dist/menu/MenuItemSeparator.js.map +1 -1
- package/dist/menu/MenuItemSwitch.d.ts +1 -1
- package/dist/menu/MenuItemSwitch.js +1 -1
- package/dist/menu/MenuItemSwitch.js.map +1 -1
- package/dist/menu/MenuItemTextField.d.ts +1 -1
- package/dist/menu/MenuItemTextField.js +1 -1
- package/dist/menu/MenuItemTextField.js.map +1 -1
- package/dist/menu/_menu.scss +2 -1
- package/dist/menu/useContextMenu.d.ts +1 -1
- package/dist/menu/useContextMenu.js +1 -1
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/navigation/CollapsibleNavGroup.d.ts +1 -1
- package/dist/navigation/CollapsibleNavGroup.js +1 -1
- package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
- package/dist/navigation/DefaultNavigationRenderer.d.ts +1 -1
- package/dist/navigation/DefaultNavigationRenderer.js +1 -1
- package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
- package/dist/navigation/NavGroup.d.ts +1 -1
- package/dist/navigation/NavGroup.js +1 -1
- package/dist/navigation/NavGroup.js.map +1 -1
- package/dist/navigation/NavItem.d.ts +1 -1
- package/dist/navigation/NavItem.js +1 -1
- package/dist/navigation/NavItem.js.map +1 -1
- package/dist/navigation/NavItemButton.d.ts +1 -1
- package/dist/navigation/NavItemButton.js +1 -1
- package/dist/navigation/NavItemButton.js.map +1 -1
- package/dist/navigation/NavItemLink.d.ts +1 -1
- package/dist/navigation/NavItemLink.js +1 -1
- package/dist/navigation/NavItemLink.js.map +1 -1
- package/dist/navigation/NavSubheader.d.ts +1 -1
- package/dist/navigation/NavSubheader.js +1 -1
- package/dist/navigation/NavSubheader.js.map +1 -1
- package/dist/navigation/Navigation.d.ts +1 -1
- package/dist/navigation/Navigation.js +1 -1
- package/dist/navigation/Navigation.js.map +1 -1
- package/dist/navigation/_navigation.scss +5 -3
- package/dist/navigation/useActiveHeadingId.d.ts +1 -1
- package/dist/navigation/useActiveHeadingId.js +1 -1
- package/dist/navigation/useActiveHeadingId.js.map +1 -1
- package/dist/navigation/useNavigationExpansion.d.ts +2 -2
- package/dist/navigation/useNavigationExpansion.js +2 -2
- package/dist/navigation/useNavigationExpansion.js.map +1 -1
- package/dist/navigation/useTableOfContentsHeadings.d.ts +1 -1
- package/dist/navigation/useTableOfContentsHeadings.js +1 -1
- package/dist/navigation/useTableOfContentsHeadings.js.map +1 -1
- package/dist/overlay/Overlay.d.ts +1 -1
- package/dist/overlay/Overlay.js +1 -1
- package/dist/overlay/Overlay.js.map +1 -1
- package/dist/portal/Portal.d.ts +1 -1
- package/dist/portal/Portal.js +1 -1
- package/dist/portal/Portal.js.map +1 -1
- package/dist/portal/PortalContainerProvider.d.ts +1 -1
- package/dist/portal/PortalContainerProvider.js +1 -1
- package/dist/portal/PortalContainerProvider.js.map +1 -1
- package/dist/positioning/useFixedPositioning.d.ts +1 -1
- package/dist/positioning/useFixedPositioning.js +1 -1
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/progress/CircularProgress.d.ts +1 -1
- package/dist/progress/CircularProgress.js +1 -1
- package/dist/progress/CircularProgress.js.map +1 -1
- package/dist/progress/LinearProgress.d.ts +1 -1
- package/dist/progress/LinearProgress.js +1 -1
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/responsive-item/ResponsiveItem.d.ts +1 -1
- package/dist/responsive-item/ResponsiveItem.js +1 -1
- package/dist/responsive-item/ResponsiveItem.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemOverlay.d.ts +1 -1
- package/dist/responsive-item/ResponsiveItemOverlay.js +1 -1
- package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
- package/dist/responsive-item/_responsive-item.scss +2 -1
- package/dist/scroll/useScrollLock.d.ts +1 -1
- package/dist/scroll/useScrollLock.js +1 -1
- package/dist/scroll/useScrollLock.js.map +1 -1
- package/dist/segmented-button/SegmentedButton.d.ts +1 -1
- package/dist/segmented-button/SegmentedButton.js +1 -1
- package/dist/segmented-button/SegmentedButton.js.map +1 -1
- package/dist/segmented-button/SegmentedButtonContainer.d.ts +1 -1
- package/dist/segmented-button/SegmentedButtonContainer.js +1 -1
- package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
- package/dist/segmented-button/_segmented-button.scss +20 -13
- package/dist/sheet/Sheet.d.ts +1 -1
- package/dist/sheet/Sheet.js +1 -1
- package/dist/sheet/Sheet.js.map +1 -1
- package/dist/sheet/_sheet.scss +2 -1
- package/dist/snackbar/DefaultToastRenderer.d.ts +1 -1
- package/dist/snackbar/DefaultToastRenderer.js +1 -1
- package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
- package/dist/snackbar/Snackbar.d.ts +1 -1
- package/dist/snackbar/Snackbar.js +1 -1
- package/dist/snackbar/Snackbar.js.map +1 -1
- package/dist/snackbar/Toast.d.ts +1 -1
- package/dist/snackbar/Toast.js +1 -1
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/snackbar/ToastActionButton.d.ts +1 -1
- package/dist/snackbar/ToastActionButton.js +1 -1
- package/dist/snackbar/ToastActionButton.js.map +1 -1
- package/dist/snackbar/ToastCloseButton.d.ts +1 -1
- package/dist/snackbar/ToastCloseButton.js +1 -1
- package/dist/snackbar/ToastCloseButton.js.map +1 -1
- package/dist/snackbar/ToastContent.d.ts +1 -1
- package/dist/snackbar/ToastContent.js +1 -1
- package/dist/snackbar/ToastContent.js.map +1 -1
- package/dist/snackbar/ToastManager.d.ts +1 -1
- package/dist/snackbar/ToastManager.js +1 -1
- package/dist/snackbar/ToastManager.js.map +1 -1
- package/dist/snackbar/ToastManagerProvider.d.ts +1 -1
- package/dist/snackbar/ToastManagerProvider.js +1 -1
- package/dist/snackbar/ToastManagerProvider.js.map +1 -1
- package/dist/snackbar/_snackbar.scss +12 -10
- package/dist/snackbar/useCurrentToastActions.d.ts +1 -1
- package/dist/snackbar/useCurrentToastActions.js +1 -1
- package/dist/snackbar/useCurrentToastActions.js.map +1 -1
- package/dist/storage/useStorage.d.ts +1 -1
- package/dist/storage/useStorage.js +1 -1
- package/dist/storage/useStorage.js.map +1 -1
- package/dist/suspense/CircularProgressSuspense.d.ts +1 -1
- package/dist/suspense/CircularProgressSuspense.js +1 -1
- package/dist/suspense/CircularProgressSuspense.js.map +1 -1
- package/dist/suspense/NullSuspense.d.ts +1 -1
- package/dist/suspense/NullSuspense.js +1 -1
- package/dist/suspense/NullSuspense.js.map +1 -1
- package/dist/table/StickyTableSection.d.ts +2 -2
- package/dist/table/StickyTableSection.js +2 -2
- package/dist/table/StickyTableSection.js.map +1 -1
- package/dist/table/Table.d.ts +1 -1
- package/dist/table/Table.js +1 -1
- package/dist/table/Table.js.map +1 -1
- package/dist/table/TableBody.d.ts +1 -1
- package/dist/table/TableBody.js +1 -1
- package/dist/table/TableBody.js.map +1 -1
- package/dist/table/TableCell.d.ts +1 -1
- package/dist/table/TableCell.js +1 -1
- package/dist/table/TableCell.js.map +1 -1
- package/dist/table/TableCheckbox.d.ts +1 -1
- package/dist/table/TableCheckbox.js +1 -1
- package/dist/table/TableCheckbox.js.map +1 -1
- package/dist/table/TableContainer.d.ts +1 -1
- package/dist/table/TableContainer.js +1 -1
- package/dist/table/TableContainer.js.map +1 -1
- package/dist/table/TableFooter.d.ts +1 -1
- package/dist/table/TableFooter.js +1 -1
- package/dist/table/TableFooter.js.map +1 -1
- package/dist/table/TableHeader.d.ts +1 -1
- package/dist/table/TableHeader.js +1 -1
- package/dist/table/TableHeader.js.map +1 -1
- package/dist/table/TableRadio.d.ts +1 -1
- package/dist/table/TableRadio.js +1 -1
- package/dist/table/TableRadio.js.map +1 -1
- package/dist/table/TableRow.d.ts +1 -1
- package/dist/table/TableRow.js +1 -1
- package/dist/table/TableRow.js.map +1 -1
- package/dist/table/_table.scss +5 -4
- package/dist/tabs/SimpleTabPanel.d.ts +2 -2
- package/dist/tabs/SimpleTabPanel.js +2 -2
- package/dist/tabs/SimpleTabPanel.js.map +1 -1
- package/dist/tabs/SimpleTabPanels.d.ts +2 -2
- package/dist/tabs/SimpleTabPanels.js +2 -2
- package/dist/tabs/SimpleTabPanels.js.map +1 -1
- package/dist/tabs/Tab.d.ts +1 -1
- package/dist/tabs/Tab.js +1 -1
- package/dist/tabs/Tab.js.map +1 -1
- package/dist/tabs/TabList.d.ts +1 -1
- package/dist/tabs/TabList.js +1 -1
- package/dist/tabs/TabList.js.map +1 -1
- package/dist/tabs/_tabs.scss +7 -4
- package/dist/tabs/useTabs.d.ts +4 -4
- package/dist/tabs/useTabs.js +2 -1
- package/dist/tabs/useTabs.js.map +1 -1
- package/dist/theme/LocalStorageColorSchemeProvider.d.ts +2 -2
- package/dist/theme/LocalStorageColorSchemeProvider.js +2 -2
- package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
- package/dist/theme/ThemeProvider.d.ts +1 -1
- package/dist/theme/ThemeProvider.js +1 -1
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/useColorSchemeProvider.js +1 -0
- package/dist/theme/useColorSchemeProvider.js.map +1 -1
- package/dist/theme/utils.js +2 -2
- package/dist/theme/utils.js.map +1 -1
- package/dist/tooltip/Tooltip.d.ts +1 -1
- package/dist/tooltip/Tooltip.js +1 -1
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/TooltipHoverModeProvider.d.ts +1 -1
- package/dist/tooltip/TooltipHoverModeProvider.js +1 -1
- package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
- package/dist/tooltip/_tooltip.scss +52 -25
- package/dist/tooltip/useTooltip.d.ts +1 -1
- package/dist/tooltip/useTooltip.js +1 -1
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/transition/CSSTransition.d.ts +1 -1
- package/dist/transition/CSSTransition.js +1 -1
- package/dist/transition/CSSTransition.js.map +1 -1
- package/dist/transition/Collapse.d.ts +1 -1
- package/dist/transition/Collapse.js +1 -1
- package/dist/transition/Collapse.js.map +1 -1
- package/dist/transition/CrossFade.d.ts +1 -1
- package/dist/transition/CrossFade.js +1 -1
- package/dist/transition/CrossFade.js.map +1 -1
- package/dist/transition/ScaleTransition.d.ts +1 -1
- package/dist/transition/ScaleTransition.js +1 -1
- package/dist/transition/ScaleTransition.js.map +1 -1
- package/dist/transition/SkeletonPlaceholder.d.ts +1 -1
- package/dist/transition/SkeletonPlaceholder.js +1 -1
- package/dist/transition/SkeletonPlaceholder.js.map +1 -1
- package/dist/transition/Slide.d.ts +1 -1
- package/dist/transition/Slide.js +1 -1
- package/dist/transition/Slide.js.map +1 -1
- package/dist/transition/SlideContainer.d.ts +1 -1
- package/dist/transition/SlideContainer.js +1 -1
- package/dist/transition/SlideContainer.js.map +1 -1
- package/dist/transition/_transition.scss +2 -1
- package/dist/transition/useCSSTransition.d.ts +2 -2
- package/dist/transition/useCSSTransition.js +2 -2
- package/dist/transition/useCSSTransition.js.map +1 -1
- package/dist/transition/useCarousel.d.ts +1 -1
- package/dist/transition/useCarousel.js +1 -1
- package/dist/transition/useCarousel.js.map +1 -1
- package/dist/transition/useCollapseTransition.d.ts +2 -2
- package/dist/transition/useCollapseTransition.js +2 -2
- package/dist/transition/useCollapseTransition.js.map +1 -1
- package/dist/transition/useCrossFadeTransition.d.ts +2 -2
- package/dist/transition/useCrossFadeTransition.js +2 -2
- package/dist/transition/useCrossFadeTransition.js.map +1 -1
- package/dist/transition/useScaleTransition.d.ts +2 -2
- package/dist/transition/useScaleTransition.js +2 -2
- package/dist/transition/useScaleTransition.js.map +1 -1
- package/dist/transition/useSkeletonPlaceholder.d.ts +2 -2
- package/dist/transition/useSkeletonPlaceholder.js +2 -2
- package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
- package/dist/transition/useSlideTransition.d.ts +1 -1
- package/dist/transition/useSlideTransition.js +1 -1
- package/dist/transition/useSlideTransition.js.map +1 -1
- package/dist/transition/useTransition.d.ts +1 -1
- package/dist/transition/useTransition.js +1 -1
- package/dist/transition/useTransition.js.map +1 -1
- package/dist/tree/DefaultTreeItemRenderer.d.ts +1 -1
- package/dist/tree/DefaultTreeItemRenderer.js +1 -1
- package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
- package/dist/tree/Tree.d.ts +1 -1
- package/dist/tree/Tree.js +1 -1
- package/dist/tree/Tree.js.map +1 -1
- package/dist/tree/TreeItem.d.ts +1 -1
- package/dist/tree/TreeItem.js +1 -1
- package/dist/tree/TreeItem.js.map +1 -1
- package/dist/tree/_tree.scss +1 -1
- package/dist/tree/useTree.d.ts +1 -1
- package/dist/tree/useTree.js +1 -1
- package/dist/tree/useTree.js.map +1 -1
- package/dist/tree/useTreeExpansion.d.ts +1 -1
- package/dist/tree/useTreeExpansion.js +1 -1
- package/dist/tree/useTreeExpansion.js.map +1 -1
- package/dist/tree/useTreeItems.d.ts +1 -1
- package/dist/tree/useTreeItems.js +1 -1
- package/dist/tree/useTreeItems.js.map +1 -1
- package/dist/tree/useTreeSelection.d.ts +1 -1
- package/dist/tree/useTreeSelection.js +1 -1
- package/dist/tree/useTreeSelection.js.map +1 -1
- package/dist/typography/HighlightText.d.ts +1 -1
- package/dist/typography/HighlightText.js +1 -1
- package/dist/typography/HighlightText.js.map +1 -1
- package/dist/typography/Mark.d.ts +1 -1
- package/dist/typography/Mark.js +1 -1
- package/dist/typography/Mark.js.map +1 -1
- package/dist/typography/SrOnly.d.ts +1 -1
- package/dist/typography/SrOnly.js +1 -1
- package/dist/typography/SrOnly.js.map +1 -1
- package/dist/typography/TextContainer.d.ts +1 -1
- package/dist/typography/TextContainer.js +1 -1
- package/dist/typography/TextContainer.js.map +1 -1
- package/dist/typography/Typography.d.ts +1 -1
- package/dist/typography/Typography.js +1 -1
- package/dist/typography/Typography.js.map +1 -1
- package/dist/typography/WritingDirectionProvider.d.ts +1 -1
- package/dist/typography/WritingDirectionProvider.js +1 -1
- package/dist/typography/WritingDirectionProvider.js.map +1 -1
- package/dist/useEnsuredState.d.ts +1 -0
- package/dist/useEnsuredState.js +5 -3
- package/dist/useEnsuredState.js.map +1 -1
- package/dist/utils/RenderRecursively.d.ts +1 -1
- package/dist/utils/RenderRecursively.js +1 -1
- package/dist/utils/RenderRecursively.js.map +1 -1
- package/dist/utils/bem.js +1 -1
- package/dist/utils/bem.js.map +1 -1
- package/dist/utils/parseCssLengthUnit.js +3 -0
- package/dist/utils/parseCssLengthUnit.js.map +1 -1
- package/dist/window-splitter/WindowSplitter.d.ts +1 -1
- package/dist/window-splitter/WindowSplitter.js +1 -1
- package/dist/window-splitter/WindowSplitter.js.map +1 -1
- package/package.json +10 -10
- package/src/CoreProviders.tsx +1 -1
- package/src/SsrProvider.tsx +1 -1
- package/src/app-bar/styles.ts +1 -1
- package/src/autocomplete/Autocomplete.tsx +3 -3
- package/src/autocomplete/AutocompleteChip.tsx +1 -1
- package/src/autocomplete/AutocompleteCircularProgress.tsx +1 -1
- package/src/autocomplete/AutocompleteClearButton.tsx +1 -1
- package/src/autocomplete/AutocompleteDropdownButton.tsx +1 -1
- package/src/autocomplete/useAutocomplete.ts +5 -4
- package/src/avatar/Avatar.tsx +1 -1
- package/src/badge/Badge.tsx +1 -1
- package/src/box/Box.tsx +1 -1
- package/src/button/AsyncButton.tsx +1 -1
- package/src/button/Button.tsx +1 -1
- package/src/button/ButtonUnstyled.tsx +1 -1
- package/src/button/TooltippedButton.tsx +1 -1
- package/src/card/Card.tsx +1 -1
- package/src/card/CardContent.tsx +1 -1
- package/src/card/CardFooter.tsx +1 -1
- package/src/card/CardHeader.tsx +1 -1
- package/src/card/CardSubtitle.tsx +1 -1
- package/src/card/CardTitle.tsx +1 -1
- package/src/card/ClickableCard.tsx +1 -1
- package/src/chip/Chip.tsx +1 -1
- package/src/dialog/Dialog.tsx +1 -1
- package/src/dialog/DialogContent.tsx +1 -1
- package/src/dialog/DialogFooter.tsx +1 -1
- package/src/dialog/DialogHeader.tsx +1 -1
- package/src/dialog/DialogTitle.tsx +1 -1
- package/src/dialog/FixedDialog.tsx +1 -1
- package/src/divider/Divider.tsx +1 -1
- package/src/draggable/useDraggable.ts +1 -1
- package/src/expansion-panel/ExpansionList.tsx +1 -1
- package/src/expansion-panel/ExpansionPanel.tsx +1 -1
- package/src/expansion-panel/ExpansionPanelHeader.tsx +1 -1
- package/src/expansion-panel/useExpansionList.ts +1 -1
- package/src/expansion-panel/useExpansionPanels.ts +1 -1
- package/src/files/FileInput.tsx +1 -1
- package/src/files/useFileUpload.ts +2 -2
- package/src/form/Checkbox.tsx +1 -1
- package/src/form/Fieldset.tsx +1 -1
- package/src/form/Form.tsx +1 -1
- package/src/form/FormMessage.tsx +1 -1
- package/src/form/FormMessageContainer.tsx +1 -1
- package/src/form/FormMessageCounter.tsx +2 -2
- package/src/form/InputToggle.tsx +2 -2
- package/src/form/Label.tsx +3 -3
- package/src/form/Legend.tsx +1 -1
- package/src/form/NativeSelect.tsx +1 -1
- package/src/form/OptGroup.tsx +1 -1
- package/src/form/Option.tsx +1 -1
- package/src/form/Password.tsx +1 -1
- package/src/form/Radio.tsx +1 -1
- package/src/form/Select.tsx +1 -1
- package/src/form/Slider.tsx +1 -1
- package/src/form/Switch.tsx +1 -1
- package/src/form/TextArea.tsx +2 -2
- package/src/form/TextField.tsx +1 -1
- package/src/form/useCheckboxGroup.ts +10 -10
- package/src/form/useCombobox.ts +1 -0
- package/src/form/useNumberField.ts +4 -4
- package/src/form/useRadioGroup.ts +6 -6
- package/src/form/useRangeSlider.ts +1 -1
- package/src/form/useSlider.ts +1 -1
- package/src/form/useTextField.ts +6 -6
- package/src/form/utils.ts +1 -0
- package/src/icon/FontIcon.tsx +1 -1
- package/src/icon/IconRotator.tsx +1 -1
- package/src/icon/MaterialIcon.tsx +2 -2
- package/src/icon/MaterialSymbol.tsx +2 -2
- package/src/icon/SVGIcon.tsx +1 -1
- package/src/icon/TextIconSpacing.tsx +1 -1
- package/src/interaction/useElementInteraction.tsx +1 -1
- package/src/layout/LayoutAppBar.tsx +1 -1
- package/src/layout/LayoutNav.tsx +2 -2
- package/src/layout/LayoutWindowSplitter.tsx +1 -1
- package/src/layout/Main.tsx +1 -1
- package/src/layout/useExpandableLayout.ts +1 -1
- package/src/layout/useHorizontalLayoutTransition.ts +1 -1
- package/src/layout/useLayoutAppBarHeight.ts +1 -1
- package/src/layout/useLayoutTree.ts +3 -3
- package/src/layout/useLayoutWindowSplitter.ts +1 -1
- package/src/layout/useMainTabIndex.ts +1 -0
- package/src/layout/useResizableLayout.ts +1 -1
- package/src/layout/useTemporaryLayout.ts +1 -1
- package/src/link/Link.tsx +1 -1
- package/src/link/SkipToMainContent.tsx +1 -1
- package/src/list/List.tsx +1 -1
- package/src/list/ListItem.tsx +1 -1
- package/src/list/ListItemChildren.tsx +1 -1
- package/src/list/ListItemLink.tsx +1 -1
- package/src/list/ListSubheader.tsx +1 -1
- package/src/media-queries/AppSizeProvider.tsx +2 -2
- package/src/media-queries/useMediaQuery.ts +2 -2
- package/src/menu/DropdownMenu.tsx +2 -1
- package/src/menu/Menu.tsx +1 -1
- package/src/menu/MenuBar.tsx +1 -1
- package/src/menu/MenuButton.tsx +1 -1
- package/src/menu/MenuItem.tsx +1 -1
- package/src/menu/MenuItemCheckbox.tsx +1 -1
- package/src/menu/MenuItemFileInput.tsx +1 -1
- package/src/menu/MenuItemGroup.tsx +1 -1
- package/src/menu/MenuItemInputToggle.tsx +1 -1
- package/src/menu/MenuItemRadio.tsx +1 -1
- package/src/menu/MenuItemSeparator.tsx +1 -1
- package/src/menu/MenuItemSwitch.tsx +1 -1
- package/src/menu/MenuItemTextField.tsx +1 -1
- package/src/menu/useContextMenu.ts +1 -1
- package/src/navigation/CollapsibleNavGroup.tsx +1 -1
- package/src/navigation/DefaultNavigationRenderer.tsx +1 -1
- package/src/navigation/NavGroup.tsx +1 -1
- package/src/navigation/NavItem.tsx +1 -1
- package/src/navigation/NavItemButton.tsx +1 -1
- package/src/navigation/NavItemLink.tsx +1 -1
- package/src/navigation/NavSubheader.tsx +1 -1
- package/src/navigation/Navigation.tsx +1 -1
- package/src/navigation/useActiveHeadingId.ts +1 -1
- package/src/navigation/useNavigationExpansion.ts +2 -2
- package/src/navigation/useTableOfContentsHeadings.ts +1 -1
- package/src/overlay/Overlay.tsx +1 -1
- package/src/portal/Portal.tsx +1 -1
- package/src/portal/PortalContainerProvider.tsx +1 -1
- package/src/positioning/useFixedPositioning.ts +1 -1
- package/src/progress/CircularProgress.tsx +1 -1
- package/src/progress/LinearProgress.tsx +1 -1
- package/src/responsive-item/ResponsiveItem.tsx +1 -1
- package/src/responsive-item/ResponsiveItemOverlay.tsx +1 -1
- package/src/scroll/useScrollLock.ts +1 -1
- package/src/segmented-button/SegmentedButton.tsx +1 -1
- package/src/segmented-button/SegmentedButtonContainer.tsx +1 -1
- package/src/sheet/Sheet.tsx +1 -1
- package/src/snackbar/DefaultToastRenderer.tsx +1 -1
- package/src/snackbar/Snackbar.tsx +1 -1
- package/src/snackbar/Toast.tsx +1 -1
- package/src/snackbar/ToastActionButton.tsx +1 -1
- package/src/snackbar/ToastCloseButton.tsx +1 -1
- package/src/snackbar/ToastContent.tsx +1 -1
- package/src/snackbar/ToastManager.ts +1 -1
- package/src/snackbar/ToastManagerProvider.tsx +1 -1
- package/src/snackbar/useCurrentToastActions.ts +1 -1
- package/src/storage/useStorage.ts +1 -1
- package/src/suspense/CircularProgressSuspense.tsx +1 -1
- package/src/suspense/NullSuspense.tsx +1 -1
- package/src/table/StickyTableSection.tsx +2 -2
- package/src/table/Table.tsx +1 -1
- package/src/table/TableBody.tsx +1 -1
- package/src/table/TableCell.tsx +1 -1
- package/src/table/TableCheckbox.tsx +1 -1
- package/src/table/TableContainer.tsx +1 -1
- package/src/table/TableFooter.tsx +1 -1
- package/src/table/TableHeader.tsx +1 -1
- package/src/table/TableRadio.tsx +1 -1
- package/src/table/TableRow.tsx +1 -1
- package/src/tabs/SimpleTabPanel.tsx +2 -2
- package/src/tabs/SimpleTabPanels.tsx +2 -2
- package/src/tabs/Tab.tsx +1 -1
- package/src/tabs/TabList.tsx +1 -1
- package/src/tabs/useTabs.ts +6 -5
- package/src/theme/LocalStorageColorSchemeProvider.tsx +2 -2
- package/src/theme/ThemeProvider.tsx +1 -1
- package/src/theme/useColorSchemeProvider.ts +1 -0
- package/src/theme/utils.ts +2 -1
- package/src/tooltip/Tooltip.tsx +1 -1
- package/src/tooltip/TooltipHoverModeProvider.tsx +1 -1
- package/src/tooltip/useTooltip.ts +1 -1
- package/src/transition/CSSTransition.tsx +1 -1
- package/src/transition/Collapse.tsx +1 -1
- package/src/transition/CrossFade.tsx +1 -1
- package/src/transition/ScaleTransition.tsx +1 -1
- package/src/transition/SkeletonPlaceholder.tsx +1 -1
- package/src/transition/Slide.tsx +1 -1
- package/src/transition/SlideContainer.tsx +1 -1
- package/src/transition/useCSSTransition.ts +2 -2
- package/src/transition/useCarousel.ts +1 -1
- package/src/transition/useCollapseTransition.ts +2 -2
- package/src/transition/useCrossFadeTransition.ts +2 -2
- package/src/transition/useScaleTransition.ts +2 -2
- package/src/transition/useSkeletonPlaceholder.ts +2 -2
- package/src/transition/useSlideTransition.ts +1 -1
- package/src/transition/useTransition.ts +1 -1
- package/src/tree/DefaultTreeItemRenderer.tsx +1 -1
- package/src/tree/Tree.tsx +1 -1
- package/src/tree/TreeItem.tsx +1 -1
- package/src/tree/useTree.ts +1 -1
- package/src/tree/useTreeExpansion.ts +1 -1
- package/src/tree/useTreeItems.ts +1 -1
- package/src/tree/useTreeSelection.ts +1 -1
- package/src/typography/HighlightText.tsx +1 -1
- package/src/typography/Mark.tsx +1 -1
- package/src/typography/SrOnly.tsx +1 -1
- package/src/typography/TextContainer.tsx +1 -1
- package/src/typography/Typography.tsx +1 -1
- package/src/typography/WritingDirectionProvider.tsx +1 -1
- package/src/useEnsuredState.ts +6 -3
- package/src/utils/RenderRecursively.tsx +1 -1
- package/src/utils/bem.ts +1 -1
- package/src/utils/parseCssLengthUnit.ts +4 -0
- package/src/window-splitter/WindowSplitter.tsx +1 -1
package/dist/form/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/form/utils.ts"],"sourcesContent":["import { type KeyboardEvent } from \"react\";\n\n/**\n * This util should be used to implement the native \"Enter\" keypress behavior\n * for \"fake\" form components to submit the form if exists.\n *\n * The way this will work will be:\n * - attempt to find a form by querying for a parent form element. if no parent\n * form element can be found, try to use the `formId` in a\n * `document.getElementById`\n * - if a form element is found, find the submit button within the form. If\n * there are no submit buttons within the form, try to find a submit button in\n * the document that is linked to this form by `form={formId}`\n * - if the submit button was found, click it to trigger the form submit\n * behavior\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n * @internal\n * @since 2.7.0\n * @since 6.0.0 No longer returns a boolean, added the `formId` parameter, and\n * moved into the form package.\n * @since 6.0.0 Uses `form.requestSubmit` instead of clicking the submit button\n */\nexport function tryToSubmitRelatedForm<E extends HTMLElement>(\n event: KeyboardEvent<E>,\n formId: string | undefined\n): void {\n const { currentTarget } = event;\n let form: HTMLElement | null = null;\n if (formId) {\n form = document.getElementById(formId);\n } else {\n form = currentTarget.closest(\"form\");\n }\n\n if (!form || !(form instanceof HTMLFormElement)) {\n return;\n }\n\n formId = formId || form.id;\n let submit = form.querySelector<HTMLButtonElement>('[type=\"submit\"]');\n if (!submit && formId) {\n submit = document.querySelector<HTMLButtonElement>(\n `[type=\"submit\"][form=\"${formId}\"]`\n );\n }\n\n form.requestSubmit(submit);\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport type EditableHTMLElement = HTMLInputElement | HTMLTextAreaElement;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport type ChangeableHTMLElement = EditableHTMLElement | HTMLSelectElement;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport function isChangeableHTMLElement(\n element: Element | null\n): element is ChangeableHTMLElement {\n return !!element && \"value\" in element;\n}\n\n/**\n * This is used to trigger a change event for a form element.\n *\n * @internal\n * @see https://stackoverflow.com/a/46012210\n * @since 6.0.0\n */\nexport function triggerManualChangeEvent(\n element: ChangeableHTMLElement | null,\n value: string | number\n): void {\n if (!element) {\n return;\n }\n\n const prototype = Object.getPrototypeOf(element);\n const setter = Object.getOwnPropertyDescriptor(prototype, \"value\")?.set;\n if (!setter) {\n return;\n }\n\n setter.call(element, value);\n const event = new Event(\"input\", { bubbles: true });\n element.dispatchEvent(event);\n}\n"],"names":["tryToSubmitRelatedForm","event","formId","currentTarget","form","document","getElementById","closest","HTMLFormElement","id","submit","querySelector","requestSubmit","isChangeableHTMLElement","element","triggerManualChangeEvent","value","prototype","Object","getPrototypeOf","setter","getOwnPropertyDescriptor","set","call","Event","bubbles","dispatchEvent"],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,SAASA,uBACdC,KAAuB,EACvBC,MAA0B;IAE1B,MAAM,EAAEC,aAAa,EAAE,GAAGF;IAC1B,IAAIG,OAA2B;IAC/B,IAAIF,QAAQ;QACVE,OAAOC,SAASC,cAAc,CAACJ;IACjC,OAAO;QACLE,OAAOD,cAAcI,OAAO,CAAC;IAC/B;IAEA,IAAI,CAACH,QAAQ,CAAEA,CAAAA,gBAAgBI,eAAc,GAAI;QAC/C;IACF;
|
|
1
|
+
{"version":3,"sources":["../../src/form/utils.ts"],"sourcesContent":["import { type KeyboardEvent } from \"react\";\n\n/**\n * This util should be used to implement the native \"Enter\" keypress behavior\n * for \"fake\" form components to submit the form if exists.\n *\n * The way this will work will be:\n * - attempt to find a form by querying for a parent form element. if no parent\n * form element can be found, try to use the `formId` in a\n * `document.getElementById`\n * - if a form element is found, find the submit button within the form. If\n * there are no submit buttons within the form, try to find a submit button in\n * the document that is linked to this form by `form={formId}`\n * - if the submit button was found, click it to trigger the form submit\n * behavior\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/requestSubmit\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n * @internal\n * @since 2.7.0\n * @since 6.0.0 No longer returns a boolean, added the `formId` parameter, and\n * moved into the form package.\n * @since 6.0.0 Uses `form.requestSubmit` instead of clicking the submit button\n */\nexport function tryToSubmitRelatedForm<E extends HTMLElement>(\n event: KeyboardEvent<E>,\n formId: string | undefined\n): void {\n const { currentTarget } = event;\n let form: HTMLElement | null = null;\n if (formId) {\n form = document.getElementById(formId);\n } else {\n form = currentTarget.closest(\"form\");\n }\n\n if (!form || !(form instanceof HTMLFormElement)) {\n return;\n }\n\n // eslint-disable-next-line no-param-reassign\n formId = formId || form.id;\n let submit = form.querySelector<HTMLButtonElement>('[type=\"submit\"]');\n if (!submit && formId) {\n submit = document.querySelector<HTMLButtonElement>(\n `[type=\"submit\"][form=\"${formId}\"]`\n );\n }\n\n form.requestSubmit(submit);\n}\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport type EditableHTMLElement = HTMLInputElement | HTMLTextAreaElement;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport type ChangeableHTMLElement = EditableHTMLElement | HTMLSelectElement;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport function isChangeableHTMLElement(\n element: Element | null\n): element is ChangeableHTMLElement {\n return !!element && \"value\" in element;\n}\n\n/**\n * This is used to trigger a change event for a form element.\n *\n * @internal\n * @see https://stackoverflow.com/a/46012210\n * @since 6.0.0\n */\nexport function triggerManualChangeEvent(\n element: ChangeableHTMLElement | null,\n value: string | number\n): void {\n if (!element) {\n return;\n }\n\n const prototype = Object.getPrototypeOf(element);\n const setter = Object.getOwnPropertyDescriptor(prototype, \"value\")?.set;\n if (!setter) {\n return;\n }\n\n setter.call(element, value);\n const event = new Event(\"input\", { bubbles: true });\n element.dispatchEvent(event);\n}\n"],"names":["tryToSubmitRelatedForm","event","formId","currentTarget","form","document","getElementById","closest","HTMLFormElement","id","submit","querySelector","requestSubmit","isChangeableHTMLElement","element","triggerManualChangeEvent","value","prototype","Object","getPrototypeOf","setter","getOwnPropertyDescriptor","set","call","Event","bubbles","dispatchEvent"],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,SAASA,uBACdC,KAAuB,EACvBC,MAA0B;IAE1B,MAAM,EAAEC,aAAa,EAAE,GAAGF;IAC1B,IAAIG,OAA2B;IAC/B,IAAIF,QAAQ;QACVE,OAAOC,SAASC,cAAc,CAACJ;IACjC,OAAO;QACLE,OAAOD,cAAcI,OAAO,CAAC;IAC/B;IAEA,IAAI,CAACH,QAAQ,CAAEA,CAAAA,gBAAgBI,eAAc,GAAI;QAC/C;IACF;IAEA,6CAA6C;IAC7CN,SAASA,UAAUE,KAAKK,EAAE;IAC1B,IAAIC,SAASN,KAAKO,aAAa,CAAoB;IACnD,IAAI,CAACD,UAAUR,QAAQ;QACrBQ,SAASL,SAASM,aAAa,CAC7B,CAAC,sBAAsB,EAAET,OAAO,EAAE,CAAC;IAEvC;IAEAE,KAAKQ,aAAa,CAACF;AACrB;AAcA;;;CAGC,GACD,OAAO,SAASG,wBACdC,OAAuB;IAEvB,OAAO,CAAC,CAACA,WAAW,WAAWA;AACjC;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,yBACdD,OAAqC,EACrCE,KAAsB;IAEtB,IAAI,CAACF,SAAS;QACZ;IACF;IAEA,MAAMG,YAAYC,OAAOC,cAAc,CAACL;IACxC,MAAMM,SAASF,OAAOG,wBAAwB,CAACJ,WAAW,UAAUK;IACpE,IAAI,CAACF,QAAQ;QACX;IACF;IAEAA,OAAOG,IAAI,CAACT,SAASE;IACrB,MAAMf,QAAQ,IAAIuB,MAAM,SAAS;QAAEC,SAAS;IAAK;IACjDX,QAAQY,aAAa,CAACzB;AACxB"}
|
package/dist/icon/FontIcon.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export interface FontIconProps extends HTMLAttributes<HTMLSpanElement>, FontIcon
|
|
|
22
22
|
* The default is to use the `material-icons` library, but others can be used as
|
|
23
23
|
* well.
|
|
24
24
|
*
|
|
25
|
-
* @see {@link https://
|
|
25
|
+
* @see {@link https://react-md.dev/components/icon | Icon Demos}
|
|
26
26
|
* @since 6.0.0 Switched from `<i>` to `<span>` element and removed
|
|
27
27
|
* the `forceSize`/`forceFontSize` props.
|
|
28
28
|
*/
|
package/dist/icon/FontIcon.js
CHANGED
|
@@ -6,7 +6,7 @@ import { icon } from "./styles.js";
|
|
|
6
6
|
* The default is to use the `material-icons` library, but others can be used as
|
|
7
7
|
* well.
|
|
8
8
|
*
|
|
9
|
-
* @see {@link https://
|
|
9
|
+
* @see {@link https://react-md.dev/components/icon | Icon Demos}
|
|
10
10
|
* @since 6.0.0 Switched from `<i>` to `<span>` element and removed
|
|
11
11
|
* the `forceSize`/`forceFontSize` props.
|
|
12
12
|
*/ export const FontIcon = /*#__PURE__*/ forwardRef(function FontIcon(props, ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/icon/FontIcon.tsx"],"sourcesContent":["import {\n type AriaAttributes,\n type HTMLAttributes,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport { type FontIconClassNameOptions, icon } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Removed the `forceSize`/`forceFontSize` props and added the\n * `inline` and `theme` props.\n */\nexport interface FontIconProps\n extends HTMLAttributes<HTMLSpanElement>,\n FontIconClassNameOptions {\n /** @defaultValue `true` */\n \"aria-hidden\"?: AriaAttributes[\"aria-hidden\"];\n\n /**\n * Any children to render to create the font icon. This is required for\n * material-icons. For example:\n *\n * ```tsx\n * <FontIcon>clear</FontIcon>\n * ```\n */\n children?: ReactNode;\n}\n\n/**\n * The `FontIcon` component is used for rendering a font-icon library's icon.\n * The default is to use the `material-icons` library, but others can be used as\n * well.\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/icon/FontIcon.tsx"],"sourcesContent":["import {\n type AriaAttributes,\n type HTMLAttributes,\n type ReactNode,\n forwardRef,\n} from \"react\";\n\nimport { type FontIconClassNameOptions, icon } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Removed the `forceSize`/`forceFontSize` props and added the\n * `inline` and `theme` props.\n */\nexport interface FontIconProps\n extends HTMLAttributes<HTMLSpanElement>,\n FontIconClassNameOptions {\n /** @defaultValue `true` */\n \"aria-hidden\"?: AriaAttributes[\"aria-hidden\"];\n\n /**\n * Any children to render to create the font icon. This is required for\n * material-icons. For example:\n *\n * ```tsx\n * <FontIcon>clear</FontIcon>\n * ```\n */\n children?: ReactNode;\n}\n\n/**\n * The `FontIcon` component is used for rendering a font-icon library's icon.\n * The default is to use the `material-icons` library, but others can be used as\n * well.\n *\n * @see {@link https://react-md.dev/components/icon | Icon Demos}\n * @since 6.0.0 Switched from `<i>` to `<span>` element and removed\n * the `forceSize`/`forceFontSize` props.\n */\nexport const FontIcon = forwardRef<HTMLElement, FontIconProps>(\n function FontIcon(props, ref) {\n const {\n \"aria-hidden\": ariaHidden = true,\n iconClassName = \"material-icons\",\n dense = false,\n theme,\n className,\n children,\n ...remaining\n } = props;\n\n return (\n <span\n {...remaining}\n aria-hidden={ariaHidden}\n ref={ref}\n className={icon({\n type: \"font\",\n dense,\n theme,\n className,\n iconClassName,\n })}\n >\n {children}\n </span>\n );\n }\n);\n"],"names":["forwardRef","icon","FontIcon","props","ref","ariaHidden","iconClassName","dense","theme","className","children","remaining","span","aria-hidden","type"],"mappings":";AAAA,SAIEA,UAAU,QACL,QAAQ;AAEf,SAAwCC,IAAI,QAAQ,cAAc;AAuBlE;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAWF,WACtB,SAASE,SAASC,KAAK,EAAEC,GAAG;IAC1B,MAAM,EACJ,eAAeC,aAAa,IAAI,EAChCC,gBAAgB,gBAAgB,EAChCC,QAAQ,KAAK,EACbC,KAAK,EACLC,SAAS,EACTC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IAEJ,qBACE,KAACS;QACE,GAAGD,SAAS;QACbE,eAAaR;QACbD,KAAKA;QACLK,WAAWR,KAAK;YACda,MAAM;YACNP;YACAC;YACAC;YACAH;QACF;kBAECI;;AAGP,GACA"}
|
|
@@ -30,6 +30,6 @@ export interface IconRotatorProps extends IconRotatorBaseProps {
|
|
|
30
30
|
* The `IconRotator` is a simple component that is used to rotate an icon from a
|
|
31
31
|
* one degrees to another.
|
|
32
32
|
*
|
|
33
|
-
* @see {@link https://
|
|
33
|
+
* @see {@link https://react-md.dev/components/icon-rotator | IconRotator Demos}
|
|
34
34
|
*/
|
|
35
35
|
export declare const IconRotator: import("react").ForwardRefExoticComponent<IconRotatorProps & import("react").RefAttributes<HTMLSpanElement>>;
|
package/dist/icon/IconRotator.js
CHANGED
|
@@ -6,7 +6,7 @@ import { iconRotator } from "./styles.js";
|
|
|
6
6
|
* The `IconRotator` is a simple component that is used to rotate an icon from a
|
|
7
7
|
* one degrees to another.
|
|
8
8
|
*
|
|
9
|
-
* @see {@link https://
|
|
9
|
+
* @see {@link https://react-md.dev/components/icon-rotator | IconRotator Demos}
|
|
10
10
|
*/ export const IconRotator = /*#__PURE__*/ forwardRef(function IconRotator(props, ref) {
|
|
11
11
|
const { className: propClassName, rotated, children, forceIconWrap = false, disableTransition = false, ...remaining } = props;
|
|
12
12
|
const className = iconRotator({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/icon/IconRotator.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n Children,\n type HTMLAttributes,\n type ReactNode,\n cloneElement,\n forwardRef,\n isValidElement,\n} from \"react\";\n\nimport { type IconRotatorClassNameOptions, iconRotator } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Removed `animate` prop and added `disableTransition`\n */\nexport interface IconRotatorBaseProps\n extends HTMLAttributes<HTMLSpanElement>,\n IconRotatorClassNameOptions {\n /**\n * An optional style to apply to the surrounding span when the `forceIconWrap`\n * prop is enabled or the children is not a single react element.\n */\n style?: CSSProperties;\n\n /**\n * Boolean if the child icon should be \"forcefully\" wrapped in a `<span>`\n * element. This should be enabled if you have a custom icon that does not\n * pass the `className` prop down.\n *\n * @defaultValue `false`\n */\n forceIconWrap?: boolean;\n}\n\nexport interface IconRotatorProps extends IconRotatorBaseProps {\n /**\n * The icon that should be rotated. If this is a valid React Element, the\n * class names will be cloned into that icon, otherwise the icon will be\n * wrapped in a span with the correct class names applied.\n */\n children: ReactNode;\n}\n\n/**\n * The `IconRotator` is a simple component that is used to rotate an icon from a\n * one degrees to another.\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/icon/IconRotator.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n Children,\n type HTMLAttributes,\n type ReactNode,\n cloneElement,\n forwardRef,\n isValidElement,\n} from \"react\";\n\nimport { type IconRotatorClassNameOptions, iconRotator } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Removed `animate` prop and added `disableTransition`\n */\nexport interface IconRotatorBaseProps\n extends HTMLAttributes<HTMLSpanElement>,\n IconRotatorClassNameOptions {\n /**\n * An optional style to apply to the surrounding span when the `forceIconWrap`\n * prop is enabled or the children is not a single react element.\n */\n style?: CSSProperties;\n\n /**\n * Boolean if the child icon should be \"forcefully\" wrapped in a `<span>`\n * element. This should be enabled if you have a custom icon that does not\n * pass the `className` prop down.\n *\n * @defaultValue `false`\n */\n forceIconWrap?: boolean;\n}\n\nexport interface IconRotatorProps extends IconRotatorBaseProps {\n /**\n * The icon that should be rotated. If this is a valid React Element, the\n * class names will be cloned into that icon, otherwise the icon will be\n * wrapped in a span with the correct class names applied.\n */\n children: ReactNode;\n}\n\n/**\n * The `IconRotator` is a simple component that is used to rotate an icon from a\n * one degrees to another.\n *\n * @see {@link https://react-md.dev/components/icon-rotator | IconRotator Demos}\n */\nexport const IconRotator = forwardRef<HTMLSpanElement, IconRotatorProps>(\n function IconRotator(props, ref) {\n const {\n className: propClassName,\n rotated,\n children,\n forceIconWrap = false,\n disableTransition = false,\n ...remaining\n } = props;\n\n const className = iconRotator({\n rotated,\n className: propClassName,\n disableTransition,\n });\n if (!forceIconWrap && isValidElement<{ className?: string }>(children)) {\n const child = Children.only(children);\n return cloneElement(child, {\n className: cnb(className, child.props.className),\n });\n }\n\n return (\n <span {...remaining} ref={ref} className={className}>\n {children}\n </span>\n );\n }\n);\n"],"names":["cnb","Children","cloneElement","forwardRef","isValidElement","iconRotator","IconRotator","props","ref","className","propClassName","rotated","children","forceIconWrap","disableTransition","remaining","child","only","span"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAEEC,QAAQ,EAGRC,YAAY,EACZC,UAAU,EACVC,cAAc,QACT,QAAQ;AAEf,SAA2CC,WAAW,QAAQ,cAAc;AAiC5E;;;;;CAKC,GACD,OAAO,MAAMC,4BAAcH,WACzB,SAASG,YAAYC,KAAK,EAAEC,GAAG;IAC7B,MAAM,EACJC,WAAWC,aAAa,EACxBC,OAAO,EACPC,QAAQ,EACRC,gBAAgB,KAAK,EACrBC,oBAAoB,KAAK,EACzB,GAAGC,WACJ,GAAGR;IAEJ,MAAME,YAAYJ,YAAY;QAC5BM;QACAF,WAAWC;QACXI;IACF;IACA,IAAI,CAACD,+BAAiBT,eAAuCQ,WAAW;QACtE,MAAMI,QAAQf,SAASgB,IAAI,CAACL;QAC5B,qBAAOV,aAAac,OAAO;YACzBP,WAAWT,IAAIS,WAAWO,MAAMT,KAAK,CAACE,SAAS;QACjD;IACF;IAEA,qBACE,KAACS;QAAM,GAAGH,SAAS;QAAEP,KAAKA;QAAKC,WAAWA;kBACvCG;;AAGP,GACA"}
|
|
@@ -26,8 +26,8 @@ export interface MaterialIconProps extends HTMLAttributes<HTMLSpanElement>, Part
|
|
|
26
26
|
* <MaterialIcon name="wifi" family="two-tone" dense theme="warning" />
|
|
27
27
|
* ```
|
|
28
28
|
*
|
|
29
|
-
* @see {@link https://
|
|
30
|
-
* @see {@link https://
|
|
29
|
+
* @see {@link https://react-md.dev/components/icon | Icon Demos}
|
|
30
|
+
* @see {@link https://react-md.dev/components/material-icons|Available Material Icons}
|
|
31
31
|
* @since 6.0.0
|
|
32
32
|
*/
|
|
33
33
|
export declare const MaterialIcon: import("react").ForwardRefExoticComponent<MaterialIconProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -15,8 +15,8 @@ import { icon } from "./styles.js";
|
|
|
15
15
|
* <MaterialIcon name="wifi" family="two-tone" dense theme="warning" />
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
|
-
* @see {@link https://
|
|
19
|
-
* @see {@link https://
|
|
18
|
+
* @see {@link https://react-md.dev/components/icon | Icon Demos}
|
|
19
|
+
* @see {@link https://react-md.dev/components/material-icons|Available Material Icons}
|
|
20
20
|
* @since 6.0.0
|
|
21
21
|
*/ export const MaterialIcon = /*#__PURE__*/ forwardRef(function MaterialIcon(props, ref) {
|
|
22
22
|
const { "aria-hidden": ariaHidden = true, name, family = MATERIAL_CONFIG.iconFamily, theme, dense, className, ...remaining } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/icon/MaterialIcon.tsx"],"sourcesContent":["import { type AriaAttributes, type HTMLAttributes, forwardRef } from \"react\";\n\nimport { type MaterialIconFamily, type MaterialIconName } from \"./material.js\";\nimport { MATERIAL_CONFIG } from \"./materialConfig.js\";\nimport { type MaterialIconClassNameOptions, icon } from \"./styles.js\";\n\n/** @since 6.0.0 */\nexport interface MaterialIconProps\n extends HTMLAttributes<HTMLSpanElement>,\n Partial<MaterialIconClassNameOptions> {\n /**\n * The icon name to use\n */\n name: MaterialIconName;\n\n /** @defaultValue `true` */\n \"aria-hidden\"?: AriaAttributes[\"aria-hidden\"];\n\n /** @defaultValue `MATERIAL_CONFIG.iconFamily` */\n family?: MaterialIconFamily;\n children?: never;\n}\n\n/**\n * The `MaterialIcon` component is used for rendering a material icon using the\n * Google Fonts stylesheet (handled separately). This is mostly a convenience\n * wrapper around the `FontIcon` that will catch typos for the supported icon\n * names.\n *\n * @example Simple Example\n * ```tsx\n * <MaterialIcon name=\"3k\" />\n * <MaterialIcon name=\"favorite\" theme=\"primary\" />\n * <MaterialIcon name=\"wifi\" family=\"two-tone\" dense theme=\"warning\" />\n * ```\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/icon/MaterialIcon.tsx"],"sourcesContent":["import { type AriaAttributes, type HTMLAttributes, forwardRef } from \"react\";\n\nimport { type MaterialIconFamily, type MaterialIconName } from \"./material.js\";\nimport { MATERIAL_CONFIG } from \"./materialConfig.js\";\nimport { type MaterialIconClassNameOptions, icon } from \"./styles.js\";\n\n/** @since 6.0.0 */\nexport interface MaterialIconProps\n extends HTMLAttributes<HTMLSpanElement>,\n Partial<MaterialIconClassNameOptions> {\n /**\n * The icon name to use\n */\n name: MaterialIconName;\n\n /** @defaultValue `true` */\n \"aria-hidden\"?: AriaAttributes[\"aria-hidden\"];\n\n /** @defaultValue `MATERIAL_CONFIG.iconFamily` */\n family?: MaterialIconFamily;\n children?: never;\n}\n\n/**\n * The `MaterialIcon` component is used for rendering a material icon using the\n * Google Fonts stylesheet (handled separately). This is mostly a convenience\n * wrapper around the `FontIcon` that will catch typos for the supported icon\n * names.\n *\n * @example Simple Example\n * ```tsx\n * <MaterialIcon name=\"3k\" />\n * <MaterialIcon name=\"favorite\" theme=\"primary\" />\n * <MaterialIcon name=\"wifi\" family=\"two-tone\" dense theme=\"warning\" />\n * ```\n *\n * @see {@link https://react-md.dev/components/icon | Icon Demos}\n * @see {@link https://react-md.dev/components/material-icons|Available Material Icons}\n * @since 6.0.0\n */\nexport const MaterialIcon = forwardRef<HTMLSpanElement, MaterialIconProps>(\n function MaterialIcon(props, ref) {\n const {\n \"aria-hidden\": ariaHidden = true,\n name,\n family = MATERIAL_CONFIG.iconFamily,\n theme,\n dense,\n className,\n ...remaining\n } = props;\n\n return (\n <span\n {...remaining}\n aria-hidden={ariaHidden}\n ref={ref}\n className={icon({\n type: \"material\",\n family,\n theme,\n dense,\n className,\n })}\n >\n {name}\n </span>\n );\n }\n);\n"],"names":["forwardRef","MATERIAL_CONFIG","icon","MaterialIcon","props","ref","ariaHidden","name","family","iconFamily","theme","dense","className","remaining","span","aria-hidden","type"],"mappings":";AAAA,SAAmDA,UAAU,QAAQ,QAAQ;AAG7E,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAA4CC,IAAI,QAAQ,cAAc;AAmBtE;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,MAAMC,6BAAeH,WAC1B,SAASG,aAAaC,KAAK,EAAEC,GAAG;IAC9B,MAAM,EACJ,eAAeC,aAAa,IAAI,EAChCC,IAAI,EACJC,SAASP,gBAAgBQ,UAAU,EACnCC,KAAK,EACLC,KAAK,EACLC,SAAS,EACT,GAAGC,WACJ,GAAGT;IAEJ,qBACE,KAACU;QACE,GAAGD,SAAS;QACbE,eAAaT;QACbD,KAAKA;QACLO,WAAWV,KAAK;YACdc,MAAM;YACNR;YACAE;YACAC;YACAC;QACF;kBAECL;;AAGP,GACA"}
|
|
@@ -49,8 +49,8 @@ export interface MaterialSymbolProps extends HTMLAttributes<HTMLSpanElement>, Ma
|
|
|
49
49
|
* root.render(<App />);
|
|
50
50
|
* ```
|
|
51
51
|
*
|
|
52
|
-
* @see {@link https://
|
|
53
|
-
* @see {@link https://
|
|
52
|
+
* @see {@link https://react-md.dev/components/icon | Icon Demos}
|
|
53
|
+
* @see {@link https://react-md.dev/components/material-icons|Available Material Icons}
|
|
54
54
|
* @since 6.0.0
|
|
55
55
|
*/
|
|
56
56
|
export declare const MaterialSymbol: import("react").ForwardRefExoticComponent<MaterialSymbolProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -32,8 +32,8 @@ import { icon } from "./styles.js";
|
|
|
32
32
|
* root.render(<App />);
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
|
-
* @see {@link https://
|
|
36
|
-
* @see {@link https://
|
|
35
|
+
* @see {@link https://react-md.dev/components/icon | Icon Demos}
|
|
36
|
+
* @see {@link https://react-md.dev/components/material-icons|Available Material Icons}
|
|
37
37
|
* @since 6.0.0
|
|
38
38
|
*/ export const MaterialSymbol = /*#__PURE__*/ forwardRef(function MaterialSymbol(props, ref) {
|
|
39
39
|
const { "aria-hidden": ariaHidden = true, className, name: symbol, style: propStyle, family: propFamily, fill, weight, grade, opticalSize, theme, dense, ...remaining } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/icon/MaterialSymbol.tsx"],"sourcesContent":["import { type AriaAttributes, type HTMLAttributes, forwardRef } from \"react\";\n\nimport { type MaterialSymbolName } from \"./material.js\";\nimport {\n type MaterialSymbolCustomization,\n type MaterialSymbolFill,\n type MaterialSymbolGrade,\n type MaterialSymbolOpticalSize,\n type MaterialSymbolWeight,\n getFontVariationSettings,\n} from \"./materialConfig.js\";\nimport { type MaterialSymbolClassNameOptions, icon } from \"./styles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-symbol-fill\"?: MaterialSymbolFill;\n \"--rmd-symbol-wght\"?: MaterialSymbolWeight;\n \"--rmd-symbol-grad\"?: MaterialSymbolGrade;\n \"--rmd-symbol-opsz\"?: MaterialSymbolOpticalSize;\n }\n}\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialSymbolProps\n extends HTMLAttributes<HTMLSpanElement>,\n MaterialSymbolCustomization,\n Partial<MaterialSymbolClassNameOptions> {\n /** @defaultValue `true` */\n \"aria-hidden\"?: AriaAttributes[\"aria-hidden\"];\n name: MaterialSymbolName;\n children?: never;\n}\n\n/**\n * This is a convenience component that provides autocomplete for all the\n * available material symbols via the `name` prop.\n *\n * Note: You might notice IDE slowdowns for files that use this component since\n * there are so many icons available. If it becomes an issue, just stop using\n * this component and define the icons inline instead.\n *\n * @example Simple Example\n * ```tsx\n * import { MaterialSymbol } from \"@react-md/core/icon/MaterialSymbol\";\n * import type { ReactElement } from \"react\";\n * import { createRoot } from \"react-dom/client\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <MaterialSymbol symbol=\"close\" />\n * <MaterialSymbol symbol=\"tune\" type=\"outline\" />\n *\n * <MaterialSymbol symbol=\"add\" type=\"round\" />\n * <MaterialSymbol symbol=\"air\" type=\"sharp\" />\n * </>\n * );\n * }\n *\n * const root = createRoot(document.getElementById(\"root\"));\n * root.render(<App />);\n * ```\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/icon/MaterialSymbol.tsx"],"sourcesContent":["import { type AriaAttributes, type HTMLAttributes, forwardRef } from \"react\";\n\nimport { type MaterialSymbolName } from \"./material.js\";\nimport {\n type MaterialSymbolCustomization,\n type MaterialSymbolFill,\n type MaterialSymbolGrade,\n type MaterialSymbolOpticalSize,\n type MaterialSymbolWeight,\n getFontVariationSettings,\n} from \"./materialConfig.js\";\nimport { type MaterialSymbolClassNameOptions, icon } from \"./styles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-symbol-fill\"?: MaterialSymbolFill;\n \"--rmd-symbol-wght\"?: MaterialSymbolWeight;\n \"--rmd-symbol-grad\"?: MaterialSymbolGrade;\n \"--rmd-symbol-opsz\"?: MaterialSymbolOpticalSize;\n }\n}\n\n/**\n * @since 6.0.0\n */\nexport interface MaterialSymbolProps\n extends HTMLAttributes<HTMLSpanElement>,\n MaterialSymbolCustomization,\n Partial<MaterialSymbolClassNameOptions> {\n /** @defaultValue `true` */\n \"aria-hidden\"?: AriaAttributes[\"aria-hidden\"];\n name: MaterialSymbolName;\n children?: never;\n}\n\n/**\n * This is a convenience component that provides autocomplete for all the\n * available material symbols via the `name` prop.\n *\n * Note: You might notice IDE slowdowns for files that use this component since\n * there are so many icons available. If it becomes an issue, just stop using\n * this component and define the icons inline instead.\n *\n * @example Simple Example\n * ```tsx\n * import { MaterialSymbol } from \"@react-md/core/icon/MaterialSymbol\";\n * import type { ReactElement } from \"react\";\n * import { createRoot } from \"react-dom/client\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <MaterialSymbol symbol=\"close\" />\n * <MaterialSymbol symbol=\"tune\" type=\"outline\" />\n *\n * <MaterialSymbol symbol=\"add\" type=\"round\" />\n * <MaterialSymbol symbol=\"air\" type=\"sharp\" />\n * </>\n * );\n * }\n *\n * const root = createRoot(document.getElementById(\"root\"));\n * root.render(<App />);\n * ```\n *\n * @see {@link https://react-md.dev/components/icon | Icon Demos}\n * @see {@link https://react-md.dev/components/material-icons|Available Material Icons}\n * @since 6.0.0\n */\nexport const MaterialSymbol = forwardRef<HTMLSpanElement, MaterialSymbolProps>(\n function MaterialSymbol(props, ref) {\n const {\n \"aria-hidden\": ariaHidden = true,\n className,\n name: symbol,\n style: propStyle,\n family: propFamily,\n fill,\n weight,\n grade,\n opticalSize,\n theme,\n dense,\n ...remaining\n } = props;\n const { style, family } = getFontVariationSettings({\n style: propStyle,\n fill,\n weight,\n grade,\n opticalSize,\n family: propFamily,\n });\n\n return (\n <span\n {...remaining}\n aria-hidden={ariaHidden}\n ref={ref}\n style={style}\n className={icon({\n type: \"symbol\",\n family,\n theme,\n dense,\n className,\n })}\n >\n {symbol}\n </span>\n );\n }\n);\n"],"names":["forwardRef","getFontVariationSettings","icon","MaterialSymbol","props","ref","ariaHidden","className","name","symbol","style","propStyle","family","propFamily","fill","weight","grade","opticalSize","theme","dense","remaining","span","aria-hidden","type"],"mappings":";AAAA,SAAmDA,UAAU,QAAQ,QAAQ;AAG7E,SAMEC,wBAAwB,QACnB,sBAAsB;AAC7B,SAA8CC,IAAI,QAAQ,cAAc;AAwBxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,GACD,OAAO,MAAMC,+BAAiBH,WAC5B,SAASG,eAAeC,KAAK,EAAEC,GAAG;IAChC,MAAM,EACJ,eAAeC,aAAa,IAAI,EAChCC,SAAS,EACTC,MAAMC,MAAM,EACZC,OAAOC,SAAS,EAChBC,QAAQC,UAAU,EAClBC,IAAI,EACJC,MAAM,EACNC,KAAK,EACLC,WAAW,EACXC,KAAK,EACLC,KAAK,EACL,GAAGC,WACJ,GAAGhB;IACJ,MAAM,EAAEM,KAAK,EAAEE,MAAM,EAAE,GAAGX,yBAAyB;QACjDS,OAAOC;QACPG;QACAC;QACAC;QACAC;QACAL,QAAQC;IACV;IAEA,qBACE,KAACQ;QACE,GAAGD,SAAS;QACbE,eAAahB;QACbD,KAAKA;QACLK,OAAOA;QACPH,WAAWL,KAAK;YACdqB,MAAM;YACNX;YACAM;YACAC;YACAZ;QACF;kBAECE;;AAGP,GACA"}
|
package/dist/icon/SVGIcon.d.ts
CHANGED
|
@@ -68,6 +68,6 @@ export interface SVGIconProps extends HTMLAttributes<SVGSVGElement>, SVGIconClas
|
|
|
68
68
|
* The `SVGIcon` component is used to render inline SVG icons or SVG icons in a
|
|
69
69
|
* sprite map as an icon.
|
|
70
70
|
*
|
|
71
|
-
* @see {@link https://
|
|
71
|
+
* @see {@link https://react-md.dev/components/icon | Icon Demos}
|
|
72
72
|
*/
|
|
73
73
|
export declare const SVGIcon: import("react").ForwardRefExoticComponent<SVGIconProps & import("react").RefAttributes<SVGSVGElement>>;
|
package/dist/icon/SVGIcon.js
CHANGED
|
@@ -5,7 +5,7 @@ import { icon } from "./styles.js";
|
|
|
5
5
|
* The `SVGIcon` component is used to render inline SVG icons or SVG icons in a
|
|
6
6
|
* sprite map as an icon.
|
|
7
7
|
*
|
|
8
|
-
* @see {@link https://
|
|
8
|
+
* @see {@link https://react-md.dev/components/icon | Icon Demos}
|
|
9
9
|
*/ export const SVGIcon = /*#__PURE__*/ forwardRef(function SVGIcon(props, ref) {
|
|
10
10
|
const { "aria-hidden": ariaHidden = true, focusable = "false", use, xmlns = use ? "http://www.w3.org/2000/svg" : undefined, viewBox = "0 0 24 24", dense = false, className, theme, inline, children: propChildren, ...remaining } = props;
|
|
11
11
|
let children = propChildren;
|
package/dist/icon/SVGIcon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/icon/SVGIcon.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport { type SVGIconClassNameOptions, icon } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Added the `inline` and `theme` props.\n */\nexport interface SVGIconProps\n extends HTMLAttributes<SVGSVGElement>,\n SVGIconClassNameOptions {\n /**\n * Boolean if the SVG should gain the `focusable` attribute. This is disabled\n * by default since IE11 and Edge actually default this to true and keyboard's\n * will tab focus all SVGs.\n *\n * @defaultValue `false`\n */\n focusable?: \"false\" | \"true\" | boolean;\n\n /**\n * The `viewBox` attribute allows you to specify that a given set of graphics\n * stretch to fit a particular container element.\n *\n * The value of the `viewBox` attribute is a list of four numbers min-x,\n * min-y, width and height, separated by white space and/or a comma, which\n * specify a rectangle in user space which should be mapped to the bounds of\n * the viewport established by the given element, taking into account\n * attribute `preserveAspectRatio`.\n *\n * Negative values for width or height are not permitted and a value of zero\n * disables rendering of the element. An optional `viewbox` for the SVG.\n *\n * For example, if the SVG element is 250 (width) by 200 (height) and you\n * provide `viewBox=\"0 0 25 20\"`, the coordinates inside the SVG will go from\n * the top left corner (0, 0) to the bottom right (25, 20) and each unit will\n * be worth `10px`.\n *\n * @defaultValue `\"0 0 24 24\"`\n */\n viewBox?: string;\n\n /**\n * An optional `xmlns` string to provide. The `use` prop will not work without\n * this prop defined.\n *\n *\n * Note: The default value will be `undefined` unless the {@link use} prop is\n * defined.\n *\n * @defaultValue `\"http://www.w3.org/2000/svg\"`\n */\n xmlns?: string;\n\n /**\n * This should be a link to a part of an SVG sprite map. So normally one of\n * the following:\n * - `'#some-custom-svg'`\n * - `'/images/spritemap.svg#some-custom-svg'`\n *\n * This prop **should not** be used with the `children` prop as only one will\n * be rendered.\n *\n *\n * NOTE: IE **does not support** external SVGs. Please see the demo for more\n * details.\n */\n use?: string;\n\n /**\n * Any `<svg>` children to render to create your icon. This can not be used\n * with the `use` prop.\n */\n children?: ReactNode;\n}\n\n/**\n * The `SVGIcon` component is used to render inline SVG icons or SVG icons in a\n * sprite map as an icon.\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/icon/SVGIcon.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport { type SVGIconClassNameOptions, icon } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Added the `inline` and `theme` props.\n */\nexport interface SVGIconProps\n extends HTMLAttributes<SVGSVGElement>,\n SVGIconClassNameOptions {\n /**\n * Boolean if the SVG should gain the `focusable` attribute. This is disabled\n * by default since IE11 and Edge actually default this to true and keyboard's\n * will tab focus all SVGs.\n *\n * @defaultValue `false`\n */\n focusable?: \"false\" | \"true\" | boolean;\n\n /**\n * The `viewBox` attribute allows you to specify that a given set of graphics\n * stretch to fit a particular container element.\n *\n * The value of the `viewBox` attribute is a list of four numbers min-x,\n * min-y, width and height, separated by white space and/or a comma, which\n * specify a rectangle in user space which should be mapped to the bounds of\n * the viewport established by the given element, taking into account\n * attribute `preserveAspectRatio`.\n *\n * Negative values for width or height are not permitted and a value of zero\n * disables rendering of the element. An optional `viewbox` for the SVG.\n *\n * For example, if the SVG element is 250 (width) by 200 (height) and you\n * provide `viewBox=\"0 0 25 20\"`, the coordinates inside the SVG will go from\n * the top left corner (0, 0) to the bottom right (25, 20) and each unit will\n * be worth `10px`.\n *\n * @defaultValue `\"0 0 24 24\"`\n */\n viewBox?: string;\n\n /**\n * An optional `xmlns` string to provide. The `use` prop will not work without\n * this prop defined.\n *\n *\n * Note: The default value will be `undefined` unless the {@link use} prop is\n * defined.\n *\n * @defaultValue `\"http://www.w3.org/2000/svg\"`\n */\n xmlns?: string;\n\n /**\n * This should be a link to a part of an SVG sprite map. So normally one of\n * the following:\n * - `'#some-custom-svg'`\n * - `'/images/spritemap.svg#some-custom-svg'`\n *\n * This prop **should not** be used with the `children` prop as only one will\n * be rendered.\n *\n *\n * NOTE: IE **does not support** external SVGs. Please see the demo for more\n * details.\n */\n use?: string;\n\n /**\n * Any `<svg>` children to render to create your icon. This can not be used\n * with the `use` prop.\n */\n children?: ReactNode;\n}\n\n/**\n * The `SVGIcon` component is used to render inline SVG icons or SVG icons in a\n * sprite map as an icon.\n *\n * @see {@link https://react-md.dev/components/icon | Icon Demos}\n */\nexport const SVGIcon = forwardRef<SVGSVGElement, SVGIconProps>(\n function SVGIcon(props, ref) {\n const {\n \"aria-hidden\": ariaHidden = true,\n focusable = \"false\",\n use,\n xmlns = use ? \"http://www.w3.org/2000/svg\" : undefined,\n viewBox = \"0 0 24 24\",\n dense = false,\n className,\n theme,\n inline,\n children: propChildren,\n ...remaining\n } = props;\n\n let children = propChildren;\n if (!children && use) {\n children = <use xlinkHref={use} />;\n }\n\n return (\n <svg\n {...remaining}\n aria-hidden={ariaHidden}\n ref={ref}\n className={icon({\n type: \"svg\",\n dense,\n theme,\n inline,\n className,\n })}\n focusable={focusable}\n xmlns={xmlns}\n viewBox={viewBox}\n >\n {children}\n </svg>\n );\n }\n);\n"],"names":["forwardRef","icon","SVGIcon","props","ref","ariaHidden","focusable","use","xmlns","undefined","viewBox","dense","className","theme","inline","children","propChildren","remaining","xlinkHref","svg","aria-hidden","type"],"mappings":";AAAA,SAA8CA,UAAU,QAAQ,QAAQ;AAExE,SAAuCC,IAAI,QAAQ,cAAc;AAyEjE;;;;;CAKC,GACD,OAAO,MAAMC,wBAAUF,WACrB,SAASE,QAAQC,KAAK,EAAEC,GAAG;IACzB,MAAM,EACJ,eAAeC,aAAa,IAAI,EAChCC,YAAY,OAAO,EACnBC,GAAG,EACHC,QAAQD,MAAM,+BAA+BE,SAAS,EACtDC,UAAU,WAAW,EACrBC,QAAQ,KAAK,EACbC,SAAS,EACTC,KAAK,EACLC,MAAM,EACNC,UAAUC,YAAY,EACtB,GAAGC,WACJ,GAAGd;IAEJ,IAAIY,WAAWC;IACf,IAAI,CAACD,YAAYR,KAAK;QACpBQ,yBAAW,KAACR;YAAIW,WAAWX;;IAC7B;IAEA,qBACE,KAACY;QACE,GAAGF,SAAS;QACbG,eAAaf;QACbD,KAAKA;QACLQ,WAAWX,KAAK;YACdoB,MAAM;YACNV;YACAE;YACAC;YACAF;QACF;QACAN,WAAWA;QACXE,OAAOA;QACPE,SAASA;kBAERK;;AAGP,GACA"}
|
|
@@ -120,6 +120,6 @@ export interface TextIconSpacingProps {
|
|
|
120
120
|
* }
|
|
121
121
|
* ```
|
|
122
122
|
*
|
|
123
|
-
* @see {@link https://
|
|
123
|
+
* @see {@link https://react-md.dev/components/text-icon-spacing | TextIconSpacing Demos}
|
|
124
124
|
*/
|
|
125
125
|
export declare function TextIconSpacing(props: TextIconSpacingProps): ReactElement;
|
|
@@ -35,7 +35,7 @@ import { Children, cloneElement, isValidElement } from "react";
|
|
|
35
35
|
* }
|
|
36
36
|
* ```
|
|
37
37
|
*
|
|
38
|
-
* @see {@link https://
|
|
38
|
+
* @see {@link https://react-md.dev/components/text-icon-spacing | TextIconSpacing Demos}
|
|
39
39
|
*/ export function TextIconSpacing(props) {
|
|
40
40
|
const { className, icon: propIcon, children = null, stacked = false, iconAfter = false, flexReverse = false, forceIconWrap = false, beforeClassName = "rmd-icon--before", afterClassName = "rmd-icon--after", aboveClassName = "rmd-icon--above", belowClassName = "rmd-icon--below" } = props;
|
|
41
41
|
if (!propIcon) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/icon/TextIconSpacing.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n Children,\n type ReactElement,\n type ReactNode,\n cloneElement,\n isValidElement,\n} from \"react\";\n\nexport interface TextIconSpacingProps {\n /**\n * An optional className to apply to the surrounding `<span>` when the\n * `forceIconWrap` prop is enabled or the icon is not a valid React Element.\n * If the `forceIconWrap` prop is not enabled, it will be cloned into the icon\n * instead.\n */\n className?: string;\n\n /**\n * An optional icon to display with a text button. This is invalid for icon\n * buttons. If this is a single element, a new class name will be cloned into\n * the element to get correct spacing so if you have a custom icon element,\n * you **must** also pass that class name down. If you are using one of the\n * react-md icon component packages, this is handled automatically.\n *\n * If this is not a valid react element, the icon will be wrapped in a\n * `<span>` instead with the class names applied.\n */\n icon?: ReactElement<{ className?: string }> | ReactNode;\n\n /**\n * Boolean if the icon should appear after the text instead of before.\n *\n * @defaultValue `false`\n */\n iconAfter?: boolean;\n\n /**\n * The children to render before or after the provided icon. This is defaulted\n * to `null` so that providing a `null` icon will correctly render without\n * React crashing.\n *\n * @defaultValue `null`\n */\n children?: ReactNode;\n\n /**\n * The class name to use for an icon that is placed before text.\n *\n * @defaultValue `\"rmd-icon--before\"`\n */\n beforeClassName?: string;\n\n /**\n * The class name to use for an icon that is placed after text.\n *\n * @defaultValue `\"rmd-icon--after\"`\n */\n afterClassName?: string;\n\n /**\n * The class name to use for an icon that is placed before above the text.\n * This is used when the `stacked` prop is enabled and the `iconAfter` prop is\n * disabled or omitted.\n *\n * @defaultValue `\"rmd-icon--above\"`\n */\n aboveClassName?: string;\n\n /**\n * The class name to use for an icon that is placed before above the text.\n * This is used when the `stacked` prop is enabled and the `iconAfter` prop is\n * enabled.\n *\n * @defaultValue `\"rmd-icon--below\"`\n */\n belowClassName?: string;\n\n /**\n * Boolean if the icon should be forced into a `<span>` with the class names\n * applied instead of attempting to clone into the provided icon.\n *\n * @defaultValue `false`\n */\n forceIconWrap?: boolean;\n\n /**\n * Boolean if the icon and text should be stacked instead of inline. Note:\n * You'll normally want to update the container element to have\n * `display: flex` and `flex-direction: column` for this to work.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * Boolean if the icon and content are in a `column-reverse` or `row-reverse`\n * `flex-direction`. This will swap the different classnames as needed.\n *\n * @since 2.5.0\n * @defaultValue `false`\n */\n flexReverse?: boolean;\n}\n\n/**\n * Note: This component **must** be rendered within a flex container unless the\n * {@link TextIconSpacingProps.forceIconWrap} is set to `true`.\n *\n * @example Simple Example\n * ```tsx\n * import { FontIcon } from \"@react-md/core/icon/FontIcon\";\n * import { TextIconSpacing } from \"@react-md/core/icon/TextIconSpacing\"\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextIconSpacing icon={<FontIcon>favorite</FontIcon>}>\n * Favorite\n * </TextIconSpacing>\n * );\n * }\n * ```\n *\n * @example Stacked Example\n * ```tsx\n * import { FontIcon } from \"@react-md/core/icon/FontIcon\";\n * import { TextIconSpacing } from \"@react-md/core/icon/TextIconSpacing\"\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextIconSpacing icon={<FontIcon>favorite</FontIcon>} stacked>\n * Favorite\n * </TextIconSpacing>\n * );\n * }\n * ```\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/icon/TextIconSpacing.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n Children,\n type ReactElement,\n type ReactNode,\n cloneElement,\n isValidElement,\n} from \"react\";\n\nexport interface TextIconSpacingProps {\n /**\n * An optional className to apply to the surrounding `<span>` when the\n * `forceIconWrap` prop is enabled or the icon is not a valid React Element.\n * If the `forceIconWrap` prop is not enabled, it will be cloned into the icon\n * instead.\n */\n className?: string;\n\n /**\n * An optional icon to display with a text button. This is invalid for icon\n * buttons. If this is a single element, a new class name will be cloned into\n * the element to get correct spacing so if you have a custom icon element,\n * you **must** also pass that class name down. If you are using one of the\n * react-md icon component packages, this is handled automatically.\n *\n * If this is not a valid react element, the icon will be wrapped in a\n * `<span>` instead with the class names applied.\n */\n icon?: ReactElement<{ className?: string }> | ReactNode;\n\n /**\n * Boolean if the icon should appear after the text instead of before.\n *\n * @defaultValue `false`\n */\n iconAfter?: boolean;\n\n /**\n * The children to render before or after the provided icon. This is defaulted\n * to `null` so that providing a `null` icon will correctly render without\n * React crashing.\n *\n * @defaultValue `null`\n */\n children?: ReactNode;\n\n /**\n * The class name to use for an icon that is placed before text.\n *\n * @defaultValue `\"rmd-icon--before\"`\n */\n beforeClassName?: string;\n\n /**\n * The class name to use for an icon that is placed after text.\n *\n * @defaultValue `\"rmd-icon--after\"`\n */\n afterClassName?: string;\n\n /**\n * The class name to use for an icon that is placed before above the text.\n * This is used when the `stacked` prop is enabled and the `iconAfter` prop is\n * disabled or omitted.\n *\n * @defaultValue `\"rmd-icon--above\"`\n */\n aboveClassName?: string;\n\n /**\n * The class name to use for an icon that is placed before above the text.\n * This is used when the `stacked` prop is enabled and the `iconAfter` prop is\n * enabled.\n *\n * @defaultValue `\"rmd-icon--below\"`\n */\n belowClassName?: string;\n\n /**\n * Boolean if the icon should be forced into a `<span>` with the class names\n * applied instead of attempting to clone into the provided icon.\n *\n * @defaultValue `false`\n */\n forceIconWrap?: boolean;\n\n /**\n * Boolean if the icon and text should be stacked instead of inline. Note:\n * You'll normally want to update the container element to have\n * `display: flex` and `flex-direction: column` for this to work.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * Boolean if the icon and content are in a `column-reverse` or `row-reverse`\n * `flex-direction`. This will swap the different classnames as needed.\n *\n * @since 2.5.0\n * @defaultValue `false`\n */\n flexReverse?: boolean;\n}\n\n/**\n * Note: This component **must** be rendered within a flex container unless the\n * {@link TextIconSpacingProps.forceIconWrap} is set to `true`.\n *\n * @example Simple Example\n * ```tsx\n * import { FontIcon } from \"@react-md/core/icon/FontIcon\";\n * import { TextIconSpacing } from \"@react-md/core/icon/TextIconSpacing\"\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextIconSpacing icon={<FontIcon>favorite</FontIcon>}>\n * Favorite\n * </TextIconSpacing>\n * );\n * }\n * ```\n *\n * @example Stacked Example\n * ```tsx\n * import { FontIcon } from \"@react-md/core/icon/FontIcon\";\n * import { TextIconSpacing } from \"@react-md/core/icon/TextIconSpacing\"\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextIconSpacing icon={<FontIcon>favorite</FontIcon>} stacked>\n * Favorite\n * </TextIconSpacing>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/text-icon-spacing | TextIconSpacing Demos}\n */\nexport function TextIconSpacing(props: TextIconSpacingProps): ReactElement {\n const {\n className,\n icon: propIcon,\n children = null,\n stacked = false,\n iconAfter = false,\n flexReverse = false,\n forceIconWrap = false,\n beforeClassName = \"rmd-icon--before\",\n afterClassName = \"rmd-icon--after\",\n aboveClassName = \"rmd-icon--above\",\n belowClassName = \"rmd-icon--below\",\n } = props;\n\n if (!propIcon) {\n return <>{children}</>;\n }\n\n const isAfter = flexReverse ? !iconAfter : iconAfter;\n const baseClassName = cnb(\n {\n [beforeClassName]: !stacked && !isAfter,\n [afterClassName]: !stacked && isAfter,\n [aboveClassName]: stacked && !isAfter,\n [belowClassName]: stacked && isAfter,\n },\n className\n );\n\n let iconEl = propIcon;\n let content = children;\n if (!forceIconWrap && isValidElement<{ className?: string }>(propIcon)) {\n const icon = Children.only(propIcon);\n iconEl = cloneElement(icon, {\n className: cnb(baseClassName, icon.props.className),\n });\n } else if (propIcon) {\n iconEl = (\n <span className={cnb(\"rmd-text-icon-spacing\", baseClassName)}>\n {propIcon}\n </span>\n );\n }\n\n if (iconEl) {\n content = (\n <>\n {!iconAfter && iconEl}\n {children}\n {iconAfter && iconEl}\n </>\n );\n }\n\n return <>{content}</>;\n}\n"],"names":["cnb","Children","cloneElement","isValidElement","TextIconSpacing","props","className","icon","propIcon","children","stacked","iconAfter","flexReverse","forceIconWrap","beforeClassName","afterClassName","aboveClassName","belowClassName","isAfter","baseClassName","iconEl","content","only","span"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,QAAQ,EAGRC,YAAY,EACZC,cAAc,QACT,QAAQ;AAkGf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCC,GACD,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EACJC,SAAS,EACTC,MAAMC,QAAQ,EACdC,WAAW,IAAI,EACfC,UAAU,KAAK,EACfC,YAAY,KAAK,EACjBC,cAAc,KAAK,EACnBC,gBAAgB,KAAK,EACrBC,kBAAkB,kBAAkB,EACpCC,iBAAiB,iBAAiB,EAClCC,iBAAiB,iBAAiB,EAClCC,iBAAiB,iBAAiB,EACnC,GAAGZ;IAEJ,IAAI,CAACG,UAAU;QACb,qBAAO;sBAAGC;;IACZ;IAEA,MAAMS,UAAUN,cAAc,CAACD,YAAYA;IAC3C,MAAMQ,gBAAgBnB,IACpB;QACE,CAACc,gBAAgB,EAAE,CAACJ,WAAW,CAACQ;QAChC,CAACH,eAAe,EAAE,CAACL,WAAWQ;QAC9B,CAACF,eAAe,EAAEN,WAAW,CAACQ;QAC9B,CAACD,eAAe,EAAEP,WAAWQ;IAC/B,GACAZ;IAGF,IAAIc,SAASZ;IACb,IAAIa,UAAUZ;IACd,IAAI,CAACI,+BAAiBV,eAAuCK,WAAW;QACtE,MAAMD,OAAON,SAASqB,IAAI,CAACd;QAC3BY,uBAASlB,aAAaK,MAAM;YAC1BD,WAAWN,IAAImB,eAAeZ,KAAKF,KAAK,CAACC,SAAS;QACpD;IACF,OAAO,IAAIE,UAAU;QACnBY,uBACE,KAACG;YAAKjB,WAAWN,IAAI,yBAAyBmB;sBAC3CX;;IAGP;IAEA,IAAIY,QAAQ;QACVC,wBACE;;gBACG,CAACV,aAAaS;gBACdX;gBACAE,aAAaS;;;IAGpB;IAEA,qBAAO;kBAAGC;;AACZ"}
|
package/dist/icon/_icon.scss
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
////
|
|
4
4
|
|
|
5
5
|
@use "sass:color";
|
|
6
|
+
@use "../spacing";
|
|
6
7
|
@use "../theme/theme";
|
|
7
8
|
@use "../transition/transition";
|
|
8
9
|
@use "../utils";
|
|
@@ -162,7 +163,7 @@ $_validated_optical-size: utils.validate(
|
|
|
162
163
|
/// should be separated from other content.
|
|
163
164
|
///
|
|
164
165
|
/// @type Number
|
|
165
|
-
$spacing:
|
|
166
|
+
$spacing: spacing.get-var(sm) !default;
|
|
166
167
|
|
|
167
168
|
/// The default `IconRotator` starting position
|
|
168
169
|
/// @type String
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/interaction/useElementInteraction.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type FocusEvent,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type TouchEvent,\n useCallback,\n useReducer,\n useRef,\n} from \"react\";\n\nimport { RippleContainer } from \"./RippleContainer.js\";\nimport { useUserInteractionMode } from \"./UserInteractionModeProvider.js\";\nimport { INTERACTION_CONFIG } from \"./config.js\";\nimport {\n type ElementInteractionHandlers,\n type ElementInteractionMode,\n type ElementInteractionState,\n type RippleState,\n type 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 * This can be used to override the {@link INTERACTION_CONFIG.mode}\n *\n * @defaultValue `INTERACTION_CONFIG.mode`\n */\n mode?: ElementInteractionMode;\n\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 ElementInteractionImplementation<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/interaction/useElementInteraction\";\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 } = 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 ElementInteractionImplementation}\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): ElementInteractionImplementation<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 mode = INTERACTION_CONFIG.mode,\n disabled = false,\n } = options;\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","mode","disabled","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":"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"}
|
|
1
|
+
{"version":3,"sources":["../../src/interaction/useElementInteraction.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type FocusEvent,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type TouchEvent,\n useCallback,\n useReducer,\n useRef,\n} from \"react\";\n\nimport { RippleContainer } from \"./RippleContainer.js\";\nimport { useUserInteractionMode } from \"./UserInteractionModeProvider.js\";\nimport { INTERACTION_CONFIG } from \"./config.js\";\nimport {\n type ElementInteractionHandlers,\n type ElementInteractionMode,\n type ElementInteractionState,\n type RippleState,\n type 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 * This can be used to override the {@link INTERACTION_CONFIG.mode}\n *\n * @defaultValue `INTERACTION_CONFIG.mode`\n */\n mode?: ElementInteractionMode;\n\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 ElementInteractionImplementation<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/interaction/useElementInteraction\";\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 } = 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 ElementInteractionImplementation}\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): ElementInteractionImplementation<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 mode = INTERACTION_CONFIG.mode,\n disabled = false,\n } = options;\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","mode","disabled","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":"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"}
|
|
@@ -43,7 +43,7 @@ export interface LayoutAppBarProps extends AppBarProps {
|
|
|
43
43
|
* }
|
|
44
44
|
* ```
|
|
45
45
|
*
|
|
46
|
-
* @see {@link https://
|
|
46
|
+
* @see {@link https://react-md.dev/getting-started/layout | Layout Demos}
|
|
47
47
|
* @since 6.0.0 This component no longer renders the `LayoutNavToggle` and
|
|
48
48
|
* `LayoutAppBarTitle` since they no longer exist. The only purpose of this
|
|
49
49
|
* component is to dynamically set the `--rmd-layout-header-height` variable.
|
|
@@ -35,7 +35,7 @@ import { useLayoutAppBarHeight } from "./useLayoutAppBarHeight.js";
|
|
|
35
35
|
* }
|
|
36
36
|
* ```
|
|
37
37
|
*
|
|
38
|
-
* @see {@link https://
|
|
38
|
+
* @see {@link https://react-md.dev/getting-started/layout | Layout Demos}
|
|
39
39
|
* @since 6.0.0 This component no longer renders the `LayoutNavToggle` and
|
|
40
40
|
* `LayoutAppBarTitle` since they no longer exist. The only purpose of this
|
|
41
41
|
* component is to dynamically set the `--rmd-layout-header-height` variable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/LayoutAppBar.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\n\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 * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/layout/LayoutAppBar.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\n\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 * @see {@link https://react-md.dev/getting-started/layout | Layout Demos}\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;;AAEA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,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"}
|
|
@@ -106,7 +106,7 @@ export interface LayoutNavProps extends HTMLAttributes<HTMLDivElement>, BaseShee
|
|
|
106
106
|
* }
|
|
107
107
|
* ```
|
|
108
108
|
*
|
|
109
|
-
* @see {@link https://
|
|
109
|
+
* @see {@link https://react-md.dev/getting-started/layout | Layout Demos}
|
|
110
110
|
* @since 6.0.0
|
|
111
111
|
*/
|
|
112
112
|
export declare const LayoutNav: import("react").ForwardRefExoticComponent<LayoutNavProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/layout/LayoutNav.js
CHANGED
|
@@ -83,10 +83,10 @@ import { layoutNav } from "./layoutNavStyles.js";
|
|
|
83
83
|
* }
|
|
84
84
|
* ```
|
|
85
85
|
*
|
|
86
|
-
* @see {@link https://
|
|
86
|
+
* @see {@link https://react-md.dev/getting-started/layout | Layout Demos}
|
|
87
87
|
* @since 6.0.0
|
|
88
88
|
*/ export const LayoutNav = /*#__PURE__*/ forwardRef(function LayoutNav(props, ref) {
|
|
89
|
-
const { as: Component = "nav", "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel = Component
|
|
89
|
+
const { as: Component = "nav", "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel = Component === "nav" && !ariaLabelledBy ? "Navigation" : undefined, expanded, children, className, timeout = DEFAULT_SHEET_TIMEOUT, classNames = DEFAULT_SHEET_CLASSNAMES, appear, enter, exit, onEnter, onEntering, onEntered, onExit, onExited, onExiting, appBarOffset, ...remaining } = props;
|
|
90
90
|
const { elementProps } = useCSSTransition({
|
|
91
91
|
nodeRef: ref,
|
|
92
92
|
timeout,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/LayoutNav.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport {\n type BaseSheetClassNameOptions,\n DEFAULT_SHEET_CLASSNAMES,\n DEFAULT_SHEET_TIMEOUT,\n sheet,\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 { LayoutAppBar } from \"@react-md/core/layout/LayoutAppBar\";\n * import { LayoutNav } from \"@react-md/core/layout/LayoutNav\";\n * import { Main } from \"@react-md/core/layout/Main\";\n * import { useHorizontalLayoutTransition } from \"@react-md/core/layout/useHorizontalLayoutTransition\";\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 { LayoutAppBar } from \"@react-md/core/layout/LayoutAppBar\";\n * import { Main } from \"@react-md/core/layout/Main\";\n * import { useHorizontalLayoutTransition } from \"@react-md/core/layout/useHorizontalLayoutTransition\";\n * import { useToggle } from \"@react-md/core/useToggle\";\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 * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/layout/LayoutNav.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport {\n type BaseSheetClassNameOptions,\n DEFAULT_SHEET_CLASSNAMES,\n DEFAULT_SHEET_TIMEOUT,\n sheet,\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 { LayoutAppBar } from \"@react-md/core/layout/LayoutAppBar\";\n * import { LayoutNav } from \"@react-md/core/layout/LayoutNav\";\n * import { Main } from \"@react-md/core/layout/Main\";\n * import { useHorizontalLayoutTransition } from \"@react-md/core/layout/useHorizontalLayoutTransition\";\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 { LayoutAppBar } from \"@react-md/core/layout/LayoutAppBar\";\n * import { Main } from \"@react-md/core/layout/Main\";\n * import { useHorizontalLayoutTransition } from \"@react-md/core/layout/useHorizontalLayoutTransition\";\n * import { useToggle } from \"@react-md/core/useToggle\";\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 * @see {@link https://react-md.dev/getting-started/layout | Layout Demos}\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 raised: false,\n horizontalSize: \"none\",\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","raised","horizontalSize","exitedHidden","transitionIn","aria-label","aria-labelledby"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAA8CC,UAAU,QAAQ,QAAQ;AAExE,SAEEC,wBAAwB,EACxBC,qBAAqB,EACrBC,KAAK,QACA,qBAAqB;AAO5B,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SAASC,SAAS,QAAQ,uBAAuB;AAsCjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgFC,GACD,OAAO,MAAMC,0BAAYN,WACvB,SAASM,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,IAAIC,YAAY,KAAK,EACrB,mBAAmBC,cAAc,EACjC,cAAcC,YAAYF,cAAc,SAAS,CAACC,iBAC9C,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,QAAQ;YACRC,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"}
|
|
@@ -68,7 +68,7 @@ export interface LayoutWindowSplitterProps extends WindowSplitterWidgetProps<HTM
|
|
|
68
68
|
* }
|
|
69
69
|
* ```
|
|
70
70
|
*
|
|
71
|
-
* @see {@link https://
|
|
71
|
+
* @see {@link https://react-md.dev/getting-started/layout | Layout Demos}
|
|
72
72
|
* @since 6.0.0
|
|
73
73
|
*/
|
|
74
74
|
export declare const LayoutWindowSplitter: import("react").ForwardRefExoticComponent<Omit<LayoutWindowSplitterProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -60,7 +60,7 @@ import { layoutWindowSplitter } from "./layoutWindowSplitterStyles.js";
|
|
|
60
60
|
* }
|
|
61
61
|
* ```
|
|
62
62
|
*
|
|
63
|
-
* @see {@link https://
|
|
63
|
+
* @see {@link https://react-md.dev/getting-started/layout | Layout Demos}
|
|
64
64
|
* @since 6.0.0
|
|
65
65
|
*/ export const LayoutWindowSplitter = /*#__PURE__*/ forwardRef(function LayoutWindowSplitter(props, ref) {
|
|
66
66
|
const { "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel = ariaLabelledBy ? undefined : "Resize Navigation", appBarOffset, disableResponsive, className, navWidth, ...remaining } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/LayoutWindowSplitter.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, useMemo } from \"react\";\n\nimport { type DefinedCSSVariableName } from \"../theme/types.js\";\nimport { useCSSVariables } from \"../theme/useCSSVariables.js\";\nimport {\n type BaseWindowSplitterProps,\n WindowSplitter,\n} from \"../window-splitter/WindowSplitter.js\";\nimport { type WindowSplitterWidgetProps } from \"../window-splitter/useWindowSplitter.js\";\nimport {\n type LayoutWindowSplitterClassNameOptions,\n layoutWindowSplitter,\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 { LayoutNav } from \"@react-md/core/layout/LayoutNav\";\n * import { LayoutWindowSplitter } from \"@react-md/core/layout/LayoutWindowSplitter\";\n * import { Main } from \"@react-md/core/layout/Main\";\n * import { NoSsr } from \"@react-md/core/NoSsr\";\n * import { useWindowSplitter } from \"@react-md/core/window-splitter/useWindowSplitter\";\n * import { useWindowSize } from \"@react-md/core/useWindowSize\";\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 * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/layout/LayoutWindowSplitter.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, useMemo } from \"react\";\n\nimport { type DefinedCSSVariableName } from \"../theme/types.js\";\nimport { useCSSVariables } from \"../theme/useCSSVariables.js\";\nimport {\n type BaseWindowSplitterProps,\n WindowSplitter,\n} from \"../window-splitter/WindowSplitter.js\";\nimport { type WindowSplitterWidgetProps } from \"../window-splitter/useWindowSplitter.js\";\nimport {\n type LayoutWindowSplitterClassNameOptions,\n layoutWindowSplitter,\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 { LayoutNav } from \"@react-md/core/layout/LayoutNav\";\n * import { LayoutWindowSplitter } from \"@react-md/core/layout/LayoutWindowSplitter\";\n * import { Main } from \"@react-md/core/layout/Main\";\n * import { NoSsr } from \"@react-md/core/NoSsr\";\n * import { useWindowSplitter } from \"@react-md/core/window-splitter/useWindowSplitter\";\n * import { useWindowSize } from \"@react-md/core/useWindowSize\";\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 * @see {@link https://react-md.dev/getting-started/layout | Layout Demos}\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;;AAEA,SAASA,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AAG5C,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,SAEEC,cAAc,QACT,uCAAuC;AAE9C,SAEEC,oBAAoB,QACf,kCAAkC;AAqBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DC,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,GAAGH,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"}
|