@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
|
@@ -28,8 +28,8 @@ import { getPartsFromPathname } from "./utils.js";
|
|
|
28
28
|
* }
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
|
-
* @see {@link https://
|
|
32
|
-
* @see {@link https://
|
|
31
|
+
* @see {@link https://react-md.dev/getting-started/layout | Layout Demos}
|
|
32
|
+
* @see {@link https://react-md.dev/components/navigation | Navigation Demos}
|
|
33
33
|
* @since 6.0.0
|
|
34
34
|
*/ export function useNavigationExpansion(options) {
|
|
35
35
|
const { pathname, linkComponent, defaultExpandedItems, disableFollowingPathname } = options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/navigation/useNavigationExpansion.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useMemo, useRef } from \"react\";\n\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\nimport { useReadonlySet } from \"../useReadonlySet.js\";\nimport {\n type NavigationExpansion,\n type NavigationLinkComponent,\n type NavigationRenderData,\n} from \"./types.js\";\nimport { getPartsFromPathname } from \"./utils.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface NavigationExpansionOptions {\n pathname: string;\n linkComponent: NavigationLinkComponent;\n\n /**\n * An optional list or set of items that should be expanded before the user\n * interacts with the navigation items.\n *\n * The default implementation works well with the `DefaultNavigationRenderer`\n * by allowing all \"folders\" (or groups) of items to be expanded by the\n * `pathname`.\n *\n * ```ts\n * const navItems: readonly NavigationItem[] = [\n * {\n * type: \"route\",\n * href: \"/\",\n * children: \"Home\",\n * },\n * {\n * type: \"group\",\n * href: \"/group-1\",\n * children: \"Group 1\",\n * items: [\n * {\n * type: \"group\",\n * href: \"/subgroup-1\",\n * children: \"Subgroup 1\",\n * items: [\n * {\n * type: \"route\",\n * href: \"/route\",\n * children: \"Group 1 > Subgroup 1 > Route\"\n * },\n * ],\n * },\n * {\n * type: \"route\",\n * href: \"/route\",\n * children: \"Group 1 > Route\",\n * },\n * ],\n * },\n * ];\n * ```\n *\n * - `pathname === \"/\"` - No groups expanded\n * - Resolves as `new Set([\"/\"])`\n * - `pathname === \"/group-1/subgroup-1/route\"` - \"Group 1\" and \"Subgroup 1\"\n * are expanded\n * - Resolves as `new Set([\"/\", \"/group-1\", \"/group-1/route\"])`\n */\n defaultExpandedItems?: UseStateInitializer<\n ReadonlySet<string> | readonly string[]\n >;\n\n /**\n * The default behavior is to update the `expandedItems` set as the `pathname`\n * updates to capture anytime the user might navigate to outer routes outside\n * of the `Navigation` component. i.e. Click a link within the page.\n *\n * Set this to `true` to disable this behavior.\n *\n * @defaultValue `false`\n */\n disableFollowingPathname?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface NavigationExpansionImplementation extends NavigationExpansion {\n data: NavigationRenderData;\n setExpandedItems: UseStateSetter<ReadonlySet<string>>;\n}\n\n/**\n * Used to create the `data` prop for the `Navigation` component and handling\n * the expansion of items.\n *\n * @example Main Usage\n * ```tsx\n * \"use client\";\n * import { Navigation } from \"@react-md/core/navigation/Navigation\";\n * import { useNavigationExpansion } from \"@react-md/core/navigation/useNavigationExpansion\";\n * import Link from \"next/link\";\n * import { usePathname } from \"next/navigation.js\";\n * import { type ReactElement } from \"react\";\n *\n * import { navItems } from \"./navItems.js\";\n *\n * export function Example(): ReactElement {\n * const pathname = usePathname();\n * const { data } = useNavigationExpansion({\n * pathname,\n * linkComponent: Link,\n * });\n *\n * return <Navigation data={data} items={navItems} />;\n * }\n * ```\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/navigation/useNavigationExpansion.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useMemo, useRef } from \"react\";\n\nimport { type UseStateInitializer, type UseStateSetter } from \"../types.js\";\nimport { useReadonlySet } from \"../useReadonlySet.js\";\nimport {\n type NavigationExpansion,\n type NavigationLinkComponent,\n type NavigationRenderData,\n} from \"./types.js\";\nimport { getPartsFromPathname } from \"./utils.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface NavigationExpansionOptions {\n pathname: string;\n linkComponent: NavigationLinkComponent;\n\n /**\n * An optional list or set of items that should be expanded before the user\n * interacts with the navigation items.\n *\n * The default implementation works well with the `DefaultNavigationRenderer`\n * by allowing all \"folders\" (or groups) of items to be expanded by the\n * `pathname`.\n *\n * ```ts\n * const navItems: readonly NavigationItem[] = [\n * {\n * type: \"route\",\n * href: \"/\",\n * children: \"Home\",\n * },\n * {\n * type: \"group\",\n * href: \"/group-1\",\n * children: \"Group 1\",\n * items: [\n * {\n * type: \"group\",\n * href: \"/subgroup-1\",\n * children: \"Subgroup 1\",\n * items: [\n * {\n * type: \"route\",\n * href: \"/route\",\n * children: \"Group 1 > Subgroup 1 > Route\"\n * },\n * ],\n * },\n * {\n * type: \"route\",\n * href: \"/route\",\n * children: \"Group 1 > Route\",\n * },\n * ],\n * },\n * ];\n * ```\n *\n * - `pathname === \"/\"` - No groups expanded\n * - Resolves as `new Set([\"/\"])`\n * - `pathname === \"/group-1/subgroup-1/route\"` - \"Group 1\" and \"Subgroup 1\"\n * are expanded\n * - Resolves as `new Set([\"/\", \"/group-1\", \"/group-1/route\"])`\n */\n defaultExpandedItems?: UseStateInitializer<\n ReadonlySet<string> | readonly string[]\n >;\n\n /**\n * The default behavior is to update the `expandedItems` set as the `pathname`\n * updates to capture anytime the user might navigate to outer routes outside\n * of the `Navigation` component. i.e. Click a link within the page.\n *\n * Set this to `true` to disable this behavior.\n *\n * @defaultValue `false`\n */\n disableFollowingPathname?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface NavigationExpansionImplementation extends NavigationExpansion {\n data: NavigationRenderData;\n setExpandedItems: UseStateSetter<ReadonlySet<string>>;\n}\n\n/**\n * Used to create the `data` prop for the `Navigation` component and handling\n * the expansion of items.\n *\n * @example Main Usage\n * ```tsx\n * \"use client\";\n * import { Navigation } from \"@react-md/core/navigation/Navigation\";\n * import { useNavigationExpansion } from \"@react-md/core/navigation/useNavigationExpansion\";\n * import Link from \"next/link\";\n * import { usePathname } from \"next/navigation.js\";\n * import { type ReactElement } from \"react\";\n *\n * import { navItems } from \"./navItems.js\";\n *\n * export function Example(): ReactElement {\n * const pathname = usePathname();\n * const { data } = useNavigationExpansion({\n * pathname,\n * linkComponent: Link,\n * });\n *\n * return <Navigation data={data} items={navItems} />;\n * }\n * ```\n *\n * @see {@link https://react-md.dev/getting-started/layout | Layout Demos}\n * @see {@link https://react-md.dev/components/navigation | Navigation Demos}\n * @since 6.0.0\n */\nexport function useNavigationExpansion(\n options: NavigationExpansionOptions\n): NavigationExpansionImplementation {\n const {\n pathname,\n linkComponent,\n defaultExpandedItems,\n disableFollowingPathname,\n } = options;\n const {\n value: expandedItems,\n setValue: setExpandedItems,\n toggleValue: toggleExpandedItem,\n } = useReadonlySet({\n defaultValue:\n defaultExpandedItems ?? (() => new Set(getPartsFromPathname(pathname))),\n });\n\n const prevPathname = useRef(pathname);\n useEffect(() => {\n if (disableFollowingPathname || pathname === prevPathname.current) {\n return;\n }\n\n prevPathname.current = pathname;\n setExpandedItems((prev) => {\n const next = new Set([...prev, ...getPartsFromPathname(pathname)]);\n if (next.size === prev.size) {\n return prev;\n }\n\n return next;\n });\n }, [disableFollowingPathname, pathname, setExpandedItems]);\n\n const data = useMemo<NavigationRenderData>(\n () => ({\n pathname,\n linkComponent,\n expandedItems,\n toggleExpandedItem,\n }),\n [expandedItems, linkComponent, pathname, toggleExpandedItem]\n );\n\n return {\n data,\n expandedItems,\n setExpandedItems,\n toggleExpandedItem,\n };\n}\n"],"names":["useEffect","useMemo","useRef","useReadonlySet","getPartsFromPathname","useNavigationExpansion","options","pathname","linkComponent","defaultExpandedItems","disableFollowingPathname","value","expandedItems","setValue","setExpandedItems","toggleValue","toggleExpandedItem","defaultValue","Set","prevPathname","current","prev","next","size","data"],"mappings":"AAAA;AAEA,SAASA,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,QAAQ;AAGnD,SAASC,cAAc,QAAQ,uBAAuB;AAMtD,SAASC,oBAAoB,QAAQ,aAAa;AAiFlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BC,GACD,OAAO,SAASC,uBACdC,OAAmC;IAEnC,MAAM,EACJC,QAAQ,EACRC,aAAa,EACbC,oBAAoB,EACpBC,wBAAwB,EACzB,GAAGJ;IACJ,MAAM,EACJK,OAAOC,aAAa,EACpBC,UAAUC,gBAAgB,EAC1BC,aAAaC,kBAAkB,EAChC,GAAGb,eAAe;QACjBc,cACER,wBAAyB,CAAA,IAAM,IAAIS,IAAId,qBAAqBG,UAAS;IACzE;IAEA,MAAMY,eAAejB,OAAOK;IAC5BP,UAAU;QACR,IAAIU,4BAA4BH,aAAaY,aAAaC,OAAO,EAAE;YACjE;QACF;QAEAD,aAAaC,OAAO,GAAGb;QACvBO,iBAAiB,CAACO;YAChB,MAAMC,OAAO,IAAIJ,IAAI;mBAAIG;mBAASjB,qBAAqBG;aAAU;YACjE,IAAIe,KAAKC,IAAI,KAAKF,KAAKE,IAAI,EAAE;gBAC3B,OAAOF;YACT;YAEA,OAAOC;QACT;IACF,GAAG;QAACZ;QAA0BH;QAAUO;KAAiB;IAEzD,MAAMU,OAAOvB,QACX,IAAO,CAAA;YACLM;YACAC;YACAI;YACAI;QACF,CAAA,GACA;QAACJ;QAAeJ;QAAeD;QAAUS;KAAmB;IAG9D,OAAO;QACLQ;QACAZ;QACAE;QACAE;IACF;AACF"}
|
|
@@ -35,7 +35,7 @@ export declare const DEFAULT_GET_HEADING_TEXT: (element: Element) => string;
|
|
|
35
35
|
* }
|
|
36
36
|
* ```
|
|
37
37
|
*
|
|
38
|
-
* @see {@link https://
|
|
38
|
+
* @see {@link https://react-md.dev/hooks/use-table-of-contents-headings | useTableOfContentsHeadings Demos}
|
|
39
39
|
* @since 6.0.0
|
|
40
40
|
*/
|
|
41
41
|
export declare function useTableOfContentsHeadings(options?: TableOfContentsHeadingsOptions): TableOfContentsHeadings;
|
|
@@ -38,7 +38,7 @@ import { getTableOfContentsHeadings } from "./getTableOfContentsHeadings.js";
|
|
|
38
38
|
* }
|
|
39
39
|
* ```
|
|
40
40
|
*
|
|
41
|
-
* @see {@link https://
|
|
41
|
+
* @see {@link https://react-md.dev/hooks/use-table-of-contents-headings | useTableOfContentsHeadings Demos}
|
|
42
42
|
* @since 6.0.0
|
|
43
43
|
*/ export function useTableOfContentsHeadings(options = {}) {
|
|
44
44
|
const { selector = DEFAULT_HEADING_SELECTOR, getDepth = DEFAULT_GET_HEADING_DEPTH, getHeadingText = DEFAULT_GET_HEADING_TEXT } = options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/navigation/useTableOfContentsHeadings.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\n\nimport { useSsr } from \"../SsrProvider.js\";\nimport { getTableOfContentsHeadings } from \"./getTableOfContentsHeadings.js\";\nimport {\n type TableOfContentsHeadings,\n type TableOfContentsHeadingsOptions,\n} from \"./types.js\";\n\n/**\n * This will find all headings that have an `id` that are not part of a `<nav>`\n * element since that should normally be a table of contents component.\n *\n * @since 6.0.0\n */\nexport const DEFAULT_HEADING_SELECTOR =\n \"main :where(:not(nav *)):where(h1[id],h2[id],h3[id],h4[id],h5[id],h6[id])\";\n\n/**\n * This only works for heading elements since it is pretty much:\n * `return parseInt(element.tagName.substring(1))`\n *\n * @since 6.0.0\n */\nexport const DEFAULT_GET_HEADING_DEPTH = (element: Element): number => {\n const depth = parseInt(element.tagName.substring(1));\n return Number.isNaN(depth) ? 0 : depth;\n};\n\n/**\n * @since 6.0.0\n */\nexport const DEFAULT_GET_HEADING_TEXT = (element: Element): string =>\n element.textContent || \"\";\n\n/**\n * The `useTableOfContentsHeadings` should normally be used with the\n * `useActiveHeadingId` hook to generate a table of contents for the current\n * page.\n *\n * @example Example Usage\n * ```tsx\n * import { useActiveHeadingId } from \"@react-md/core/navigation/useActiveHeadingId\";\n * import { useTableOfContentsHeadings } from \"@react-md/core/navigation/useTableOfContentsHeadings\";\n *\n * function Example() {\n * const headings = useTableOfContentsHeadings();\n * const activeHeadingId = useActiveHeadingId({ headings });\n *\n * return <TableOfContents headings={headings} activeHeadingId={activeHeadingId} />;\n * }\n * ```\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/navigation/useTableOfContentsHeadings.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\n\nimport { useSsr } from \"../SsrProvider.js\";\nimport { getTableOfContentsHeadings } from \"./getTableOfContentsHeadings.js\";\nimport {\n type TableOfContentsHeadings,\n type TableOfContentsHeadingsOptions,\n} from \"./types.js\";\n\n/**\n * This will find all headings that have an `id` that are not part of a `<nav>`\n * element since that should normally be a table of contents component.\n *\n * @since 6.0.0\n */\nexport const DEFAULT_HEADING_SELECTOR =\n \"main :where(:not(nav *)):where(h1[id],h2[id],h3[id],h4[id],h5[id],h6[id])\";\n\n/**\n * This only works for heading elements since it is pretty much:\n * `return parseInt(element.tagName.substring(1))`\n *\n * @since 6.0.0\n */\nexport const DEFAULT_GET_HEADING_DEPTH = (element: Element): number => {\n const depth = parseInt(element.tagName.substring(1));\n return Number.isNaN(depth) ? 0 : depth;\n};\n\n/**\n * @since 6.0.0\n */\nexport const DEFAULT_GET_HEADING_TEXT = (element: Element): string =>\n element.textContent || \"\";\n\n/**\n * The `useTableOfContentsHeadings` should normally be used with the\n * `useActiveHeadingId` hook to generate a table of contents for the current\n * page.\n *\n * @example Example Usage\n * ```tsx\n * import { useActiveHeadingId } from \"@react-md/core/navigation/useActiveHeadingId\";\n * import { useTableOfContentsHeadings } from \"@react-md/core/navigation/useTableOfContentsHeadings\";\n *\n * function Example() {\n * const headings = useTableOfContentsHeadings();\n * const activeHeadingId = useActiveHeadingId({ headings });\n *\n * return <TableOfContents headings={headings} activeHeadingId={activeHeadingId} />;\n * }\n * ```\n *\n * @see {@link https://react-md.dev/hooks/use-table-of-contents-headings | useTableOfContentsHeadings Demos}\n * @since 6.0.0\n */\nexport function useTableOfContentsHeadings(\n options: TableOfContentsHeadingsOptions = {}\n): TableOfContentsHeadings {\n const {\n selector = DEFAULT_HEADING_SELECTOR,\n getDepth = DEFAULT_GET_HEADING_DEPTH,\n getHeadingText = DEFAULT_GET_HEADING_TEXT,\n } = options;\n const ssr = useSsr();\n const [headings, setHeadings] = useState(() =>\n getTableOfContentsHeadings({\n ssr,\n selector,\n getDepth,\n getHeadingText,\n })\n );\n useEffect(() => {\n setHeadings(\n getTableOfContentsHeadings({ ssr, selector, getDepth, getHeadingText })\n );\n }, [getDepth, getHeadingText, selector, ssr]);\n\n return headings;\n}\n"],"names":["useEffect","useState","useSsr","getTableOfContentsHeadings","DEFAULT_HEADING_SELECTOR","DEFAULT_GET_HEADING_DEPTH","element","depth","parseInt","tagName","substring","Number","isNaN","DEFAULT_GET_HEADING_TEXT","textContent","useTableOfContentsHeadings","options","selector","getDepth","getHeadingText","ssr","headings","setHeadings"],"mappings":"AAAA;AAEA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,QAAQ;AAE5C,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,0BAA0B,QAAQ,kCAAkC;AAM7E;;;;;CAKC,GACD,OAAO,MAAMC,2BACX,4EAA4E;AAE9E;;;;;CAKC,GACD,OAAO,MAAMC,4BAA4B,CAACC;IACxC,MAAMC,QAAQC,SAASF,QAAQG,OAAO,CAACC,SAAS,CAAC;IACjD,OAAOC,OAAOC,KAAK,CAACL,SAAS,IAAIA;AACnC,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMM,2BAA2B,CAACP,UACvCA,QAAQQ,WAAW,IAAI,GAAG;AAE5B;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,SAASC,2BACdC,UAA0C,CAAC,CAAC;IAE5C,MAAM,EACJC,WAAWb,wBAAwB,EACnCc,WAAWb,yBAAyB,EACpCc,iBAAiBN,wBAAwB,EAC1C,GAAGG;IACJ,MAAMI,MAAMlB;IACZ,MAAM,CAACmB,UAAUC,YAAY,GAAGrB,SAAS,IACvCE,2BAA2B;YACzBiB;YACAH;YACAC;YACAC;QACF;IAEFnB,UAAU;QACRsB,YACEnB,2BAA2B;YAAEiB;YAAKH;YAAUC;YAAUC;QAAe;IAEzE,GAAG;QAACD;QAAUC;QAAgBF;QAAUG;KAAI;IAE5C,OAAOC;AACT"}
|
|
@@ -71,7 +71,7 @@ export interface OverlayProps extends HTMLAttributes<HTMLSpanElement>, CSSTransi
|
|
|
71
71
|
* }
|
|
72
72
|
* ```
|
|
73
73
|
*
|
|
74
|
-
* @see {@link https://
|
|
74
|
+
* @see {@link https://react-md.dev/components/overlay | Overlay Demos}
|
|
75
75
|
* @since 6.0.0 Removed the `onRequestClose` prop in favor of using
|
|
76
76
|
* the `onClick` prop instead.
|
|
77
77
|
*/
|
package/dist/overlay/Overlay.js
CHANGED
|
@@ -27,7 +27,7 @@ import { DEFAULT_OVERLAY_CLASSNAMES, DEFAULT_OVERLAY_TIMEOUT, overlay } from "./
|
|
|
27
27
|
* }
|
|
28
28
|
* ```
|
|
29
29
|
*
|
|
30
|
-
* @see {@link https://
|
|
30
|
+
* @see {@link https://react-md.dev/components/overlay | Overlay Demos}
|
|
31
31
|
* @since 6.0.0 Removed the `onRequestClose` prop in favor of using
|
|
32
32
|
* the `onClick` prop instead.
|
|
33
33
|
*/ export const Overlay = /*#__PURE__*/ forwardRef(function Overlay(props, nodeRef) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/overlay/Overlay.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes, forwardRef } from \"react\";\n\nimport { useSsr } from \"../SsrProvider.js\";\nimport { type BoxAlignItems, type BoxJustifyContent } from \"../box/styles.js\";\nimport { Portal } from \"../portal/Portal.js\";\nimport {\n type CSSTransitionComponentProps,\n type TransitionActions,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\nimport {\n DEFAULT_OVERLAY_CLASSNAMES,\n DEFAULT_OVERLAY_TIMEOUT,\n overlay,\n} from \"./styles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-overlay-background-color\"?: string;\n \"--rmd-overlay-z-index\"?: number;\n }\n}\n\n/**\n * @since 6.0.0 Added `align` and `justify` props.\n * @since 6.0.0 Renamed `hidden` to `noOpacity`.\n */\nexport interface OverlayProps\n extends HTMLAttributes<HTMLSpanElement>,\n CSSTransitionComponentProps,\n TransitionActions {\n /**\n * @defaultValue `\"center\"`\n * @since 6.0.0\n */\n align?: BoxAlignItems;\n\n /**\n * @defaultValue `\"center\"`\n * @since 6.0.0\n */\n justify?: BoxJustifyContent;\n\n /**\n * Set this to `true` for when the overlay should be visible. Toggling this\n * value will trigger the enter/exit animation.\n */\n visible: boolean;\n\n /**\n * Set this to `true` if the overlay should be rendered with an `opacity: 0`\n * and disabling the animation. This is useful if you'd like a \"close on\n * outside click\" behavior.\n *\n * @defaultValue `false`\n */\n noOpacity?: boolean;\n\n /**\n * @see {@link OverlayClassNameOptions.clickable}\n * @defaultValue `!noOpacity`\n */\n clickable?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disablePortal?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Overlay } from \"@react-md/core/overlay/Overlay\";\n * import { useToggle } from \"@react-md/core/useToggle\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { toggle, disable, toggled: visible } = useToggle(false);\n *\n * return (\n * <>\n * <Button onClick={toggle}>Toggle</Button>\n * <Overlay visible={visible} onClick={disable} />\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/overlay/Overlay.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes, forwardRef } from \"react\";\n\nimport { useSsr } from \"../SsrProvider.js\";\nimport { type BoxAlignItems, type BoxJustifyContent } from \"../box/styles.js\";\nimport { Portal } from \"../portal/Portal.js\";\nimport {\n type CSSTransitionComponentProps,\n type TransitionActions,\n} from \"../transition/types.js\";\nimport { useCSSTransition } from \"../transition/useCSSTransition.js\";\nimport {\n DEFAULT_OVERLAY_CLASSNAMES,\n DEFAULT_OVERLAY_TIMEOUT,\n overlay,\n} from \"./styles.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-overlay-background-color\"?: string;\n \"--rmd-overlay-z-index\"?: number;\n }\n}\n\n/**\n * @since 6.0.0 Added `align` and `justify` props.\n * @since 6.0.0 Renamed `hidden` to `noOpacity`.\n */\nexport interface OverlayProps\n extends HTMLAttributes<HTMLSpanElement>,\n CSSTransitionComponentProps,\n TransitionActions {\n /**\n * @defaultValue `\"center\"`\n * @since 6.0.0\n */\n align?: BoxAlignItems;\n\n /**\n * @defaultValue `\"center\"`\n * @since 6.0.0\n */\n justify?: BoxJustifyContent;\n\n /**\n * Set this to `true` for when the overlay should be visible. Toggling this\n * value will trigger the enter/exit animation.\n */\n visible: boolean;\n\n /**\n * Set this to `true` if the overlay should be rendered with an `opacity: 0`\n * and disabling the animation. This is useful if you'd like a \"close on\n * outside click\" behavior.\n *\n * @defaultValue `false`\n */\n noOpacity?: boolean;\n\n /**\n * @see {@link OverlayClassNameOptions.clickable}\n * @defaultValue `!noOpacity`\n */\n clickable?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disablePortal?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Overlay } from \"@react-md/core/overlay/Overlay\";\n * import { useToggle } from \"@react-md/core/useToggle\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { toggle, disable, toggled: visible } = useToggle(false);\n *\n * return (\n * <>\n * <Button onClick={toggle}>Toggle</Button>\n * <Overlay visible={visible} onClick={disable} />\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/overlay | Overlay Demos}\n * @since 6.0.0 Removed the `onRequestClose` prop in favor of using\n * the `onClick` prop instead.\n */\nexport const Overlay = forwardRef<HTMLSpanElement, OverlayProps>(\n function Overlay(props, nodeRef) {\n const {\n children,\n className,\n visible,\n noOpacity = false,\n clickable = !noOpacity,\n temporary = true,\n timeout = DEFAULT_OVERLAY_TIMEOUT,\n classNames = DEFAULT_OVERLAY_CLASSNAMES,\n disableTransition = false,\n align = \"center\",\n justify = \"center\",\n appear,\n enter,\n exit,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n exitedHidden = true,\n disablePortal: propDisablePortal = false,\n ...remaining\n } = props;\n\n const ssr = useSsr();\n const { elementProps, rendered, disablePortal } = useCSSTransition({\n nodeRef,\n transitionIn: visible,\n timeout: noOpacity ? 0 : timeout,\n classNames: noOpacity ? \"\" : classNames,\n className: overlay({\n visible,\n clickable,\n align,\n justify,\n className,\n }),\n appear: appear && !disableTransition && !ssr,\n enter: enter && !disableTransition,\n exit: exit && !disableTransition,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n temporary,\n exitedHidden,\n disablePortal: propDisablePortal,\n });\n\n return (\n <Portal disabled={disablePortal}>\n {rendered && (\n <span {...remaining} {...elementProps}>\n {children}\n </span>\n )}\n </Portal>\n );\n }\n);\n"],"names":["forwardRef","useSsr","Portal","useCSSTransition","DEFAULT_OVERLAY_CLASSNAMES","DEFAULT_OVERLAY_TIMEOUT","overlay","Overlay","props","nodeRef","children","className","visible","noOpacity","clickable","temporary","timeout","classNames","disableTransition","align","justify","appear","enter","exit","onEnter","onEntering","onEntered","onExit","onExiting","onExited","exitedHidden","disablePortal","propDisablePortal","remaining","ssr","elementProps","rendered","transitionIn","disabled","span"],"mappings":"AAAA;;AAEA,SAA8BA,UAAU,QAAQ,QAAQ;AAExD,SAASC,MAAM,QAAQ,oBAAoB;AAE3C,SAASC,MAAM,QAAQ,sBAAsB;AAK7C,SAASC,gBAAgB,QAAQ,oCAAoC;AACrE,SACEC,0BAA0B,EAC1BC,uBAAuB,EACvBC,OAAO,QACF,cAAc;AA6DrB;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,GACD,OAAO,MAAMC,wBAAUP,WACrB,SAASO,QAAQC,KAAK,EAAEC,OAAO;IAC7B,MAAM,EACJC,QAAQ,EACRC,SAAS,EACTC,OAAO,EACPC,YAAY,KAAK,EACjBC,YAAY,CAACD,SAAS,EACtBE,YAAY,IAAI,EAChBC,UAAUX,uBAAuB,EACjCY,aAAab,0BAA0B,EACvCc,oBAAoB,KAAK,EACzBC,QAAQ,QAAQ,EAChBC,UAAU,QAAQ,EAClBC,MAAM,EACNC,KAAK,EACLC,IAAI,EACJC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,eAAe,IAAI,EACnBC,eAAeC,oBAAoB,KAAK,EACxC,GAAGC,WACJ,GAAGzB;IAEJ,MAAM0B,MAAMjC;IACZ,MAAM,EAAEkC,YAAY,EAAEC,QAAQ,EAAEL,aAAa,EAAE,GAAG5B,iBAAiB;QACjEM;QACA4B,cAAczB;QACdI,SAASH,YAAY,IAAIG;QACzBC,YAAYJ,YAAY,KAAKI;QAC7BN,WAAWL,QAAQ;YACjBM;YACAE;YACAK;YACAC;YACAT;QACF;QACAU,QAAQA,UAAU,CAACH,qBAAqB,CAACgB;QACzCZ,OAAOA,SAAS,CAACJ;QACjBK,MAAMA,QAAQ,CAACL;QACfM;QACAC;QACAC;QACAC;QACAC;QACAC;QACAd;QACAe;QACAC,eAAeC;IACjB;IAEA,qBACE,KAAC9B;QAAOoC,UAAUP;kBACfK,0BACC,KAACG;YAAM,GAAGN,SAAS;YAAG,GAAGE,YAAY;sBAClCzB;;;AAKX,GACA"}
|
package/dist/portal/Portal.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export interface PortalProps {
|
|
|
29
29
|
* }
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
|
-
* @see {@link https://
|
|
32
|
+
* @see {@link https://react-md.dev/components/portal | Portal Demos}
|
|
33
33
|
* @see {@link PortalContainerProvider}
|
|
34
34
|
* @see {@link usePortalContainer}
|
|
35
35
|
*/
|
package/dist/portal/Portal.js
CHANGED
|
@@ -18,7 +18,7 @@ import { usePortalContainer } from "./PortalContainerProvider.js";
|
|
|
18
18
|
* }
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
|
-
* @see {@link https://
|
|
21
|
+
* @see {@link https://react-md.dev/components/portal | Portal Demos}
|
|
22
22
|
* @see {@link PortalContainerProvider}
|
|
23
23
|
* @see {@link usePortalContainer}
|
|
24
24
|
*/ export function Portal(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/portal/Portal.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactElement, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { usePortalContainer } from \"./PortalContainerProvider.js\";\n\n/**\n * @since 6.0.0 Removed the `into` and `intoId` props. Use the\n * `PortalContainerProvider` instead.\n */\nexport interface PortalProps {\n children: ReactNode;\n\n /**\n * Setting this to `true` will disable the portal behavior and just render\n * the `children` in the normal DOM tree.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * Portals are a great way to render temporary elements like dialogs, tooltips,\n * and menus at a different port of the DOM. This implementation will render\n * the `children` in the current {@link PortalContainer} element.\n *\n * @example Simple Example\n * ```tsx\n * import { Portal } from \"@react-md/portal\";\n *\n * function Example() {\n * return <Portal><div>Some Content</div></Portal>;\n * }\n * ```\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/portal/Portal.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactElement, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { usePortalContainer } from \"./PortalContainerProvider.js\";\n\n/**\n * @since 6.0.0 Removed the `into` and `intoId` props. Use the\n * `PortalContainerProvider` instead.\n */\nexport interface PortalProps {\n children: ReactNode;\n\n /**\n * Setting this to `true` will disable the portal behavior and just render\n * the `children` in the normal DOM tree.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * Portals are a great way to render temporary elements like dialogs, tooltips,\n * and menus at a different port of the DOM. This implementation will render\n * the `children` in the current {@link PortalContainer} element.\n *\n * @example Simple Example\n * ```tsx\n * import { Portal } from \"@react-md/portal\";\n *\n * function Example() {\n * return <Portal><div>Some Content</div></Portal>;\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/portal | Portal Demos}\n * @see {@link PortalContainerProvider}\n * @see {@link usePortalContainer}\n */\nexport function Portal(props: PortalProps): ReactElement {\n const { children, disabled = false } = props;\n const container = usePortalContainer();\n if (!container || disabled) {\n return <>{disabled && children}</>;\n }\n\n return createPortal(children, container);\n}\n"],"names":["createPortal","usePortalContainer","Portal","props","children","disabled","container"],"mappings":"AAAA;;AAGA,SAASA,YAAY,QAAQ,YAAY;AAEzC,SAASC,kBAAkB,QAAQ,+BAA+B;AAkBlE;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASC,OAAOC,KAAkB;IACvC,MAAM,EAAEC,QAAQ,EAAEC,WAAW,KAAK,EAAE,GAAGF;IACvC,MAAMG,YAAYL;IAClB,IAAI,CAACK,aAAaD,UAAU;QAC1B,qBAAO;sBAAGA,YAAYD;;IACxB;IAEA,qBAAOJ,aAAaI,UAAUE;AAChC"}
|
|
@@ -33,7 +33,7 @@ export interface PortalContainerProviderProps {
|
|
|
33
33
|
* `<div id="rmd-portal-container"></div>` will be added as the last child to
|
|
34
34
|
* the `document.body` and be used as the container element.
|
|
35
35
|
*
|
|
36
|
-
* @see {@link https://
|
|
36
|
+
* @see {@link https://react-md.dev/components/portal | Portal Demos}
|
|
37
37
|
* @see {@link Portal}
|
|
38
38
|
* @since 6.0.0
|
|
39
39
|
*/
|
|
@@ -21,7 +21,7 @@ const { Provider } = context;
|
|
|
21
21
|
* `<div id="rmd-portal-container"></div>` will be added as the last child to
|
|
22
22
|
* the `document.body` and be used as the container element.
|
|
23
23
|
*
|
|
24
|
-
* @see {@link https://
|
|
24
|
+
* @see {@link https://react-md.dev/components/portal | Portal Demos}
|
|
25
25
|
* @see {@link Portal}
|
|
26
26
|
* @since 6.0.0
|
|
27
27
|
*/ export function PortalContainerProvider(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/portal/PortalContainerProvider.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactElement,\n type ReactNode,\n type RefObject,\n createContext,\n useContext,\n useEffect,\n useState,\n} from \"react\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport type PortalContainerNode = Element | DocumentFragment | null;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport type PortalContainer =\n | PortalContainerNode\n | RefObject<PortalContainerNode>;\n\nexport const PORTAL_CONTAINER_ID = \"rmd-portal-container\";\n\nlet portalContainer: PortalContainerNode = null;\n\nconst getPortalContainer = (): PortalContainerNode =>\n typeof window === \"undefined\" ? null : document.body;\n\nconst context = createContext<PortalContainerNode>(getPortalContainer());\ncontext.displayName = \"PortalContainer\";\nconst { Provider } = context;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport function usePortalContainer(): PortalContainerNode {\n return useContext(context);\n}\n\n/** @since 6.0.0 */\nexport interface PortalContainerProviderProps {\n /**\n * An optional container element to use. When this is `undefined`, a\n * `<div id=\"rmd-portal-container\"></div>` will be added as the last child to\n * the `document.body` and be used as the container element.\n */\n container?: PortalContainer;\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component allows for all child `Portal` components to render within the\n * same container element. If a custom `container` element is not provided, a\n * `<div id=\"rmd-portal-container\"></div>` will be added as the last child to\n * the `document.body` and be used as the container element.\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/portal/PortalContainerProvider.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ReactElement,\n type ReactNode,\n type RefObject,\n createContext,\n useContext,\n useEffect,\n useState,\n} from \"react\";\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport type PortalContainerNode = Element | DocumentFragment | null;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport type PortalContainer =\n | PortalContainerNode\n | RefObject<PortalContainerNode>;\n\nexport const PORTAL_CONTAINER_ID = \"rmd-portal-container\";\n\nlet portalContainer: PortalContainerNode = null;\n\nconst getPortalContainer = (): PortalContainerNode =>\n typeof window === \"undefined\" ? null : document.body;\n\nconst context = createContext<PortalContainerNode>(getPortalContainer());\ncontext.displayName = \"PortalContainer\";\nconst { Provider } = context;\n\n/**\n * @internal\n * @since 6.0.0\n */\nexport function usePortalContainer(): PortalContainerNode {\n return useContext(context);\n}\n\n/** @since 6.0.0 */\nexport interface PortalContainerProviderProps {\n /**\n * An optional container element to use. When this is `undefined`, a\n * `<div id=\"rmd-portal-container\"></div>` will be added as the last child to\n * the `document.body` and be used as the container element.\n */\n container?: PortalContainer;\n children: ReactNode;\n}\n\n/**\n * **Client Component**\n *\n * This component allows for all child `Portal` components to render within the\n * same container element. If a custom `container` element is not provided, a\n * `<div id=\"rmd-portal-container\"></div>` will be added as the last child to\n * the `document.body` and be used as the container element.\n *\n * @see {@link https://react-md.dev/components/portal | Portal Demos}\n * @see {@link Portal}\n * @since 6.0.0\n */\nexport function PortalContainerProvider(\n props: PortalContainerProviderProps\n): ReactElement {\n const { container, children } = props;\n const [value, setValue] = useState<PortalContainerNode>(portalContainer);\n useEffect(() => {\n if (container && \"current\" in container) {\n setValue(container.current);\n return;\n }\n\n if (typeof container !== \"undefined\") {\n setValue(container);\n return;\n }\n\n if (!portalContainer) {\n portalContainer = document.createElement(\"div\");\n portalContainer.id = PORTAL_CONTAINER_ID;\n }\n if (!document.body.contains(portalContainer)) {\n document.body.appendChild(portalContainer);\n }\n\n setValue(portalContainer);\n\n return () => {\n if (portalContainer && document.body.contains(portalContainer)) {\n document.body.removeChild(portalContainer);\n }\n };\n }, [container]);\n\n const containerValue =\n (container && \"current\" in container) || !container ? value : container;\n return <Provider value={containerValue}>{children}</Provider>;\n}\n"],"names":["createContext","useContext","useEffect","useState","PORTAL_CONTAINER_ID","portalContainer","getPortalContainer","window","document","body","context","displayName","Provider","usePortalContainer","PortalContainerProvider","props","container","children","value","setValue","current","createElement","id","contains","appendChild","removeChild","containerValue"],"mappings":"AAAA;;AAEA,SAIEA,aAAa,EACbC,UAAU,EACVC,SAAS,EACTC,QAAQ,QACH,QAAQ;AAgBf,OAAO,MAAMC,sBAAsB,uBAAuB;AAE1D,IAAIC,kBAAuC;AAE3C,MAAMC,qBAAqB,IACzB,OAAOC,WAAW,cAAc,OAAOC,SAASC,IAAI;AAEtD,MAAMC,wBAAUV,cAAmCM;AACnDI,QAAQC,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGF;AAErB;;;CAGC,GACD,OAAO,SAASG;IACd,OAAOZ,WAAWS;AACpB;AAaA;;;;;;;;;;;CAWC,GACD,OAAO,SAASI,wBACdC,KAAmC;IAEnC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGF;IAChC,MAAM,CAACG,OAAOC,SAAS,GAAGhB,SAA8BE;IACxDH,UAAU;QACR,IAAIc,aAAa,aAAaA,WAAW;YACvCG,SAASH,UAAUI,OAAO;YAC1B;QACF;QAEA,IAAI,OAAOJ,cAAc,aAAa;YACpCG,SAASH;YACT;QACF;QAEA,IAAI,CAACX,iBAAiB;YACpBA,kBAAkBG,SAASa,aAAa,CAAC;YACzChB,gBAAgBiB,EAAE,GAAGlB;QACvB;QACA,IAAI,CAACI,SAASC,IAAI,CAACc,QAAQ,CAAClB,kBAAkB;YAC5CG,SAASC,IAAI,CAACe,WAAW,CAACnB;QAC5B;QAEAc,SAASd;QAET,OAAO;YACL,IAAIA,mBAAmBG,SAASC,IAAI,CAACc,QAAQ,CAAClB,kBAAkB;gBAC9DG,SAASC,IAAI,CAACgB,WAAW,CAACpB;YAC5B;QACF;IACF,GAAG;QAACW;KAAU;IAEd,MAAMU,iBACJ,AAACV,aAAa,aAAaA,aAAc,CAACA,YAAYE,QAAQF;IAChE,qBAAO,KAACJ;QAASM,OAAOQ;kBAAiBT;;AAC3C"}
|
|
@@ -171,7 +171,7 @@ export interface FixedPositioningImplementation<E extends HTMLElement> {
|
|
|
171
171
|
* }
|
|
172
172
|
* ```
|
|
173
173
|
*
|
|
174
|
-
* @see {@link https://
|
|
174
|
+
* @see {@link https://react-md.dev/hooks/use-fixed-positioning | useFixedPositioning Demos}
|
|
175
175
|
* @typeParam FixedToElement - An HTMLElement type for the static element.
|
|
176
176
|
* @typeParam FixedElement - An HTMLElement type for the fixed element.
|
|
177
177
|
* @since 4.0.0
|
|
@@ -59,7 +59,7 @@ const noop = ()=>undefined;
|
|
|
59
59
|
* }
|
|
60
60
|
* ```
|
|
61
61
|
*
|
|
62
|
-
* @see {@link https://
|
|
62
|
+
* @see {@link https://react-md.dev/hooks/use-fixed-positioning | useFixedPositioning Demos}
|
|
63
63
|
* @typeParam FixedToElement - An HTMLElement type for the static element.
|
|
64
64
|
* @typeParam FixedElement - An HTMLElement type for the fixed element.
|
|
65
65
|
* @since 4.0.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/positioning/useFixedPositioning.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type CSSProperties,\n type Ref,\n type RefCallback,\n type RefObject,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { delegateEvent } from \"../delegateEvent.js\";\nimport { type TransitionCallbacks } from \"../transition/types.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useIsomorphicLayoutEffect } from \"../useIsomorphicLayoutEffect.js\";\nimport { BELOW_CENTER_ANCHOR } from \"./constants.js\";\nimport { getFixedPosition } from \"./getFixedPosition.js\";\nimport {\n type CalculateFixedPositionOptions,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type FixedPositionStyle,\n} from \"./types.js\";\nimport { isWithinViewport } from \"./utils.js\";\n\nconst noop = (): undefined => undefined;\n\n/**\n * @since 4.0.0\n */\nexport type FixedPositioningTransitionCallbacks = Pick<\n TransitionCallbacks,\n \"onEnter\" | \"onEntering\" | \"onEntered\" | \"onExited\"\n>;\n\n/**\n * This options should be passed to the {@link useCSSTransition} for the styling\n * and positioning to work correctly.\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport interface FixedPositioningTransitionOptions<E extends HTMLElement>\n extends FixedPositioningTransitionCallbacks {\n /** {@inheritDoc TransitionOptions.nodeRef} */\n nodeRef?: Ref<E>;\n}\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport interface FixedPositioningScrollData<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> {\n fixedElement: FixedElement;\n fixedToElement: FixedToElement;\n\n /**\n * Boolean if the {@link fixedToElement} is visible within the viewport.\n */\n visible: boolean;\n}\n\n/**\n * This function is called when the page is scrolled while the fixed element is\n * visible. This is generally used to reposition the fixed element or hide it if\n * it is no longer visible within the viewport.\n *\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @param event - The scroll event\n * @param data - The {@link FixedPositioningScrollData} that can be used for\n * custom scroll behavior.\n * @since 4.0.0\n */\nexport type TransitionScrollCallback<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> = (\n event: Event,\n data: Readonly<FixedPositioningScrollData<FixedToElement, FixedElement>>\n) => void;\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport interface FixedPositioningOptions<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> extends FixedPositioningTransitionOptions<FixedElement>,\n CalculateFixedPositionOptions {\n /**\n * An optional style that will be merged with the fixed positioning required\n * styles.\n *\n * @see {@link FixedPositionStyle}\n */\n style?: CSSProperties;\n\n /**\n * A ref pointing to an element that another element should be fixed to. This\n * **must** be provided for the positioning to work.\n */\n fixedTo: RefObject<FixedToElement>;\n\n /**\n * An optional function that can be used to override positioning options if\n * some options require the element to be in the DOM for specific\n * calculations.\n */\n getFixedPositionOptions?: () => CalculateFixedPositionOptions;\n\n /**\n * An optional function to call if the page resizes while the `FixedElement`\n * is visible.\n */\n onResize?: EventListener;\n /** @see {@link TransitionScrollCallback} */\n onScroll?: TransitionScrollCallback<FixedToElement, FixedElement>;\n\n /**\n * Set this to `true` to disable the fixed positioning behavior so it can be\n * customized within CSS or manually instead. This was added mostly to just\n * support rendering menus inline with other content (like autocompletes\n * within a dialog).\n *\n * @defaultValue `false`\n * @since 6.0.0\n */\n disabled?: boolean;\n}\n\n/**\n * @typeParam E - An HTMLElement type for the fixed element.\n * @since 4.0.0\n * @since 6.0.0 Renamed from `FixedPositioningHookReturnValue` to\n * `FixedPositioningImplementation` to match naming conventions.\n */\nexport interface FixedPositioningImplementation<E extends HTMLElement> {\n /**\n * A ref that should be passed to a component for the fixed positioning\n * behavior to work correctly.\n *\n * This should really only be used if the {@link TransitionOptions} is not\n * being used.\n */\n ref: RefCallback<E>;\n\n /**\n * This is the {@link FixedPositionStyle} merged with the\n * {@link FixedPositioningOptions.style}. This will only return `undefined`\n * when {@link FixedPositioningOptions.disabled} is `true` and no `style` was\n * provided.\n */\n style: CSSProperties | undefined;\n\n /**\n * This should really only be used if the {@link transitionOptions} is not\n * being used.\n */\n callbacks: Readonly<Required<FixedPositioningTransitionCallbacks>>;\n\n /**\n * A function that can be called to update the style for the fixed element.\n */\n updateStyle: () => void;\n\n /** {@inheritDoc FixedPositioningTransitionOptions} */\n transitionOptions: Readonly<Required<FixedPositioningTransitionOptions<E>>>;\n}\n\n/**\n * This hook is used to attach a temporary (fixed) element to another element\n * within the page. In other words, this is a way to have an element with\n * `position: fixed` as if it were `position: absolute` to a parent element that\n * had `position: relative`.\n *\n * @example Simple Example\n * ```tsx\n * \"use client\";\n *\n * import { Button } from \"@react-md/core/button/Button\";\n * import { useFixedPositioning } from \"@react-md/core/positioning/useFixedPositioning\";\n * import { useCSSTransition } from \"@react-md/core/transition/useCSSTransition\";\n * import { type ReactElement, useRef, useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const fixedTo = useRef<HTMLButtonElement>(null);\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { style, transitionOptions } = useFixedPositioning({\n * fixedTo,\n * });\n * const { elementProps, rendered } = useCSSTransition({\n * ...transitionOptions,\n * transitionIn,\n * temporary: true,\n * timeout: {\n * enter: 200,\n * exit: 150,\n * },\n * classNames: {\n * enter: \"enter\",\n * enterActive: \"enter--active\",\n * exit: \"exit\",\n * exitActive: \"exit--active\",\n * },\n * });\n *\n * return (\n * <>\n * <Button ref={fixedTo} onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * {rendered && (\n * <div {...elementProps} style={style}>\n * Fixed Temporary Element\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://next.react-md.dev/hooks/use-fixed-positioning | useFixedPositioning Demos}\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport function useFixedPositioning<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n>(\n options: FixedPositioningOptions<FixedToElement, FixedElement>\n): FixedPositioningImplementation<FixedElement> {\n const {\n style: propStyle,\n nodeRef,\n fixedTo,\n disabled,\n onEnter = noop,\n onEntering = noop,\n onEntered = noop,\n onExited = noop,\n anchor = BELOW_CENTER_ANCHOR,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions = noop,\n onScroll,\n onResize = noop,\n } = options;\n\n const [active, setActive] = useState(false);\n const [ref, refHandler] = useEnsuredRef(nodeRef);\n const optionsRef = useRef({\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } as const);\n useIsomorphicLayoutEffect(() => {\n optionsRef.current = {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n };\n }, [\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n ]);\n const [style, setStyle] = useState<CSSProperties | undefined>(\n () =>\n getFixedPosition({\n container: ref.current,\n element: fixedTo.current,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n }).style\n );\n\n const updateStyle = useCallback(() => {\n if (disabled) {\n return;\n }\n\n const {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } = optionsRef.current;\n const element = ref.current;\n const container = fixedTo.current;\n const { style } = getFixedPosition({\n container,\n element,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n });\n\n setStyle(style);\n setActive(!!element && !element.hidden);\n\n // Only changing the initialX, initialY, or disabled should cause the\n // useEffect below to trigger, which is why everything else is set in a ref.\n }, [disabled, initialX, initialY]);\n\n useEffect(() => {\n if (!active || disabled) {\n return;\n }\n\n const resizeCallback = (event: Event): void => {\n onResize(event);\n updateStyle();\n };\n const scrollCallback = (event: Event): void => {\n const fixedElement = ref.current;\n const fixedToElement = fixedTo.current;\n if (onScroll && fixedElement && fixedToElement) {\n onScroll(event, {\n visible: isWithinViewport({ fixedElement, fixedToElement }),\n fixedElement,\n fixedToElement,\n });\n }\n\n updateStyle();\n };\n\n const resizeHandler = delegateEvent(\"resize\", window, true);\n const scrollHandler = delegateEvent(\"scroll\", window, true, {\n passive: true,\n });\n resizeHandler.add(resizeCallback);\n scrollHandler.add(scrollCallback);\n return () => {\n resizeHandler.remove(resizeCallback);\n scrollHandler.remove(scrollCallback);\n };\n }, [active, disabled, fixedTo, onResize, onScroll, ref, updateStyle]);\n\n const callbacks: Required<FixedPositioningTransitionCallbacks> = {\n onEnter(appearing) {\n onEnter(appearing);\n updateStyle();\n },\n onEntering(appearing) {\n onEntering(appearing);\n updateStyle();\n },\n onEntered(appearing) {\n onEntered(appearing);\n updateStyle();\n },\n onExited() {\n onExited();\n setActive(false);\n },\n };\n\n return {\n ref: refHandler,\n style: disabled ? propStyle : { ...style, ...propStyle },\n callbacks,\n updateStyle,\n transitionOptions: {\n ...callbacks,\n nodeRef: refHandler,\n },\n };\n}\n"],"names":["useCallback","useEffect","useRef","useState","delegateEvent","useEnsuredRef","useIsomorphicLayoutEffect","BELOW_CENTER_ANCHOR","getFixedPosition","isWithinViewport","noop","undefined","useFixedPositioning","options","style","propStyle","nodeRef","fixedTo","disabled","onEnter","onEntering","onEntered","onExited","anchor","disableSwapping","disableVHBounds","initialX","initialY","preventOverlap","transformOrigin","vhMargin","vwMargin","width","xMargin","yMargin","getFixedPositionOptions","onScroll","onResize","active","setActive","ref","refHandler","optionsRef","current","setStyle","container","element","updateStyle","hidden","resizeCallback","event","scrollCallback","fixedElement","fixedToElement","visible","resizeHandler","window","scrollHandler","passive","add","remove","callbacks","appearing","transitionOptions"],"mappings":"AAAA;AAEA,SAKEA,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,QAAQ;AAEf,SAASC,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,yBAAyB,QAAQ,kCAAkC;AAC5E,SAASC,mBAAmB,QAAQ,iBAAiB;AACrD,SAASC,gBAAgB,QAAQ,wBAAwB;AAMzD,SAASC,gBAAgB,QAAQ,aAAa;AAE9C,MAAMC,OAAO,IAAiBC;AAwJ9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDC,GACD,OAAO,SAASC,oBAIdC,OAA8D;IAE9D,MAAM,EACJC,OAAOC,SAAS,EAChBC,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,UAAUT,IAAI,EACdU,aAAaV,IAAI,EACjBW,YAAYX,IAAI,EAChBY,WAAWZ,IAAI,EACfa,SAAShB,mBAAmB,EAC5BiB,eAAe,EACfC,eAAe,EACfC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,eAAe,EACfC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,OAAO,EACPC,OAAO,EACPC,0BAA0BzB,IAAI,EAC9B0B,QAAQ,EACRC,WAAW3B,IAAI,EAChB,GAAGG;IAEJ,MAAM,CAACyB,QAAQC,UAAU,GAAGpC,SAAS;IACrC,MAAM,CAACqC,KAAKC,WAAW,GAAGpC,cAAcW;IACxC,MAAM0B,aAAaxC,OAAO;QACxBsC;QACAvB;QACAM;QACAC;QACAC;QACAG;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;IACA7B,0BAA0B;QACxBoC,WAAWC,OAAO,GAAG;YACnBH;YACAvB;YACAM;YACAC;YACAC;YACAG;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF;IACF,GAAG;QACDK;QACAvB;QACAM;QACAC;QACAC;QACAG;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IACD,MAAM,CAACrB,OAAO8B,SAAS,GAAGzC,SACxB,IACEK,iBAAiB;YACfqC,WAAWL,IAAIG,OAAO;YACtBG,SAAS7B,QAAQ0B,OAAO;YACxBpB;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACA,GAAGC,yBAAyB;QAC9B,GAAGrB,KAAK;IAGZ,MAAMiC,cAAc/C,YAAY;QAC9B,IAAIkB,UAAU;YACZ;QACF;QAEA,MAAM,EACJsB,GAAG,EACHvB,OAAO,EACPM,MAAM,EACNC,eAAe,EACfC,eAAe,EACfG,cAAc,EACdC,eAAe,EACfC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,OAAO,EACPC,OAAO,EACPC,uBAAuB,EACxB,GAAGO,WAAWC,OAAO;QACtB,MAAMG,UAAUN,IAAIG,OAAO;QAC3B,MAAME,YAAY5B,QAAQ0B,OAAO;QACjC,MAAM,EAAE7B,KAAK,EAAE,GAAGN,iBAAiB;YACjCqC;YACAC;YACAvB;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACA,GAAGC,yBAAyB;QAC9B;QAEAS,SAAS9B;QACTyB,UAAU,CAAC,CAACO,WAAW,CAACA,QAAQE,MAAM;IAEtC,qEAAqE;IACrE,4EAA4E;IAC9E,GAAG;QAAC9B;QAAUQ;QAAUC;KAAS;IAEjC1B,UAAU;QACR,IAAI,CAACqC,UAAUpB,UAAU;YACvB;QACF;QAEA,MAAM+B,iBAAiB,CAACC;YACtBb,SAASa;YACTH;QACF;QACA,MAAMI,iBAAiB,CAACD;YACtB,MAAME,eAAeZ,IAAIG,OAAO;YAChC,MAAMU,iBAAiBpC,QAAQ0B,OAAO;YACtC,IAAIP,YAAYgB,gBAAgBC,gBAAgB;gBAC9CjB,SAASc,OAAO;oBACdI,SAAS7C,iBAAiB;wBAAE2C;wBAAcC;oBAAe;oBACzDD;oBACAC;gBACF;YACF;YAEAN;QACF;QAEA,MAAMQ,gBAAgBnD,cAAc,UAAUoD,QAAQ;QACtD,MAAMC,gBAAgBrD,cAAc,UAAUoD,QAAQ,MAAM;YAC1DE,SAAS;QACX;QACAH,cAAcI,GAAG,CAACV;QAClBQ,cAAcE,GAAG,CAACR;QAClB,OAAO;YACLI,cAAcK,MAAM,CAACX;YACrBQ,cAAcG,MAAM,CAACT;QACvB;IACF,GAAG;QAACb;QAAQpB;QAAUD;QAASoB;QAAUD;QAAUI;QAAKO;KAAY;IAEpE,MAAMc,YAA2D;QAC/D1C,SAAQ2C,SAAS;YACf3C,QAAQ2C;YACRf;QACF;QACA3B,YAAW0C,SAAS;YAClB1C,WAAW0C;YACXf;QACF;QACA1B,WAAUyC,SAAS;YACjBzC,UAAUyC;YACVf;QACF;QACAzB;YACEA;YACAiB,UAAU;QACZ;IACF;IAEA,OAAO;QACLC,KAAKC;QACL3B,OAAOI,WAAWH,YAAY;YAAE,GAAGD,KAAK;YAAE,GAAGC,SAAS;QAAC;QACvD8C;QACAd;QACAgB,mBAAmB;YACjB,GAAGF,SAAS;YACZ7C,SAASyB;QACX;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/positioning/useFixedPositioning.ts"],"sourcesContent":["\"use client\";\n\nimport {\n type CSSProperties,\n type Ref,\n type RefCallback,\n type RefObject,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { delegateEvent } from \"../delegateEvent.js\";\nimport { type TransitionCallbacks } from \"../transition/types.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useIsomorphicLayoutEffect } from \"../useIsomorphicLayoutEffect.js\";\nimport { BELOW_CENTER_ANCHOR } from \"./constants.js\";\nimport { getFixedPosition } from \"./getFixedPosition.js\";\nimport {\n type CalculateFixedPositionOptions,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type FixedPositionStyle,\n} from \"./types.js\";\nimport { isWithinViewport } from \"./utils.js\";\n\nconst noop = (): undefined => undefined;\n\n/**\n * @since 4.0.0\n */\nexport type FixedPositioningTransitionCallbacks = Pick<\n TransitionCallbacks,\n \"onEnter\" | \"onEntering\" | \"onEntered\" | \"onExited\"\n>;\n\n/**\n * This options should be passed to the {@link useCSSTransition} for the styling\n * and positioning to work correctly.\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport interface FixedPositioningTransitionOptions<E extends HTMLElement>\n extends FixedPositioningTransitionCallbacks {\n /** {@inheritDoc TransitionOptions.nodeRef} */\n nodeRef?: Ref<E>;\n}\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport interface FixedPositioningScrollData<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> {\n fixedElement: FixedElement;\n fixedToElement: FixedToElement;\n\n /**\n * Boolean if the {@link fixedToElement} is visible within the viewport.\n */\n visible: boolean;\n}\n\n/**\n * This function is called when the page is scrolled while the fixed element is\n * visible. This is generally used to reposition the fixed element or hide it if\n * it is no longer visible within the viewport.\n *\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @param event - The scroll event\n * @param data - The {@link FixedPositioningScrollData} that can be used for\n * custom scroll behavior.\n * @since 4.0.0\n */\nexport type TransitionScrollCallback<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> = (\n event: Event,\n data: Readonly<FixedPositioningScrollData<FixedToElement, FixedElement>>\n) => void;\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport interface FixedPositioningOptions<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> extends FixedPositioningTransitionOptions<FixedElement>,\n CalculateFixedPositionOptions {\n /**\n * An optional style that will be merged with the fixed positioning required\n * styles.\n *\n * @see {@link FixedPositionStyle}\n */\n style?: CSSProperties;\n\n /**\n * A ref pointing to an element that another element should be fixed to. This\n * **must** be provided for the positioning to work.\n */\n fixedTo: RefObject<FixedToElement>;\n\n /**\n * An optional function that can be used to override positioning options if\n * some options require the element to be in the DOM for specific\n * calculations.\n */\n getFixedPositionOptions?: () => CalculateFixedPositionOptions;\n\n /**\n * An optional function to call if the page resizes while the `FixedElement`\n * is visible.\n */\n onResize?: EventListener;\n /** @see {@link TransitionScrollCallback} */\n onScroll?: TransitionScrollCallback<FixedToElement, FixedElement>;\n\n /**\n * Set this to `true` to disable the fixed positioning behavior so it can be\n * customized within CSS or manually instead. This was added mostly to just\n * support rendering menus inline with other content (like autocompletes\n * within a dialog).\n *\n * @defaultValue `false`\n * @since 6.0.0\n */\n disabled?: boolean;\n}\n\n/**\n * @typeParam E - An HTMLElement type for the fixed element.\n * @since 4.0.0\n * @since 6.0.0 Renamed from `FixedPositioningHookReturnValue` to\n * `FixedPositioningImplementation` to match naming conventions.\n */\nexport interface FixedPositioningImplementation<E extends HTMLElement> {\n /**\n * A ref that should be passed to a component for the fixed positioning\n * behavior to work correctly.\n *\n * This should really only be used if the {@link TransitionOptions} is not\n * being used.\n */\n ref: RefCallback<E>;\n\n /**\n * This is the {@link FixedPositionStyle} merged with the\n * {@link FixedPositioningOptions.style}. This will only return `undefined`\n * when {@link FixedPositioningOptions.disabled} is `true` and no `style` was\n * provided.\n */\n style: CSSProperties | undefined;\n\n /**\n * This should really only be used if the {@link transitionOptions} is not\n * being used.\n */\n callbacks: Readonly<Required<FixedPositioningTransitionCallbacks>>;\n\n /**\n * A function that can be called to update the style for the fixed element.\n */\n updateStyle: () => void;\n\n /** {@inheritDoc FixedPositioningTransitionOptions} */\n transitionOptions: Readonly<Required<FixedPositioningTransitionOptions<E>>>;\n}\n\n/**\n * This hook is used to attach a temporary (fixed) element to another element\n * within the page. In other words, this is a way to have an element with\n * `position: fixed` as if it were `position: absolute` to a parent element that\n * had `position: relative`.\n *\n * @example Simple Example\n * ```tsx\n * \"use client\";\n *\n * import { Button } from \"@react-md/core/button/Button\";\n * import { useFixedPositioning } from \"@react-md/core/positioning/useFixedPositioning\";\n * import { useCSSTransition } from \"@react-md/core/transition/useCSSTransition\";\n * import { type ReactElement, useRef, useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const fixedTo = useRef<HTMLButtonElement>(null);\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { style, transitionOptions } = useFixedPositioning({\n * fixedTo,\n * });\n * const { elementProps, rendered } = useCSSTransition({\n * ...transitionOptions,\n * transitionIn,\n * temporary: true,\n * timeout: {\n * enter: 200,\n * exit: 150,\n * },\n * classNames: {\n * enter: \"enter\",\n * enterActive: \"enter--active\",\n * exit: \"exit\",\n * exitActive: \"exit--active\",\n * },\n * });\n *\n * return (\n * <>\n * <Button ref={fixedTo} onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * {rendered && (\n * <div {...elementProps} style={style}>\n * Fixed Temporary Element\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/hooks/use-fixed-positioning | useFixedPositioning Demos}\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport function useFixedPositioning<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n>(\n options: FixedPositioningOptions<FixedToElement, FixedElement>\n): FixedPositioningImplementation<FixedElement> {\n const {\n style: propStyle,\n nodeRef,\n fixedTo,\n disabled,\n onEnter = noop,\n onEntering = noop,\n onEntered = noop,\n onExited = noop,\n anchor = BELOW_CENTER_ANCHOR,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions = noop,\n onScroll,\n onResize = noop,\n } = options;\n\n const [active, setActive] = useState(false);\n const [ref, refHandler] = useEnsuredRef(nodeRef);\n const optionsRef = useRef({\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } as const);\n useIsomorphicLayoutEffect(() => {\n optionsRef.current = {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n };\n }, [\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n ]);\n const [style, setStyle] = useState<CSSProperties | undefined>(\n () =>\n getFixedPosition({\n container: ref.current,\n element: fixedTo.current,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n }).style\n );\n\n const updateStyle = useCallback(() => {\n if (disabled) {\n return;\n }\n\n const {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } = optionsRef.current;\n const element = ref.current;\n const container = fixedTo.current;\n const { style } = getFixedPosition({\n container,\n element,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n });\n\n setStyle(style);\n setActive(!!element && !element.hidden);\n\n // Only changing the initialX, initialY, or disabled should cause the\n // useEffect below to trigger, which is why everything else is set in a ref.\n }, [disabled, initialX, initialY]);\n\n useEffect(() => {\n if (!active || disabled) {\n return;\n }\n\n const resizeCallback = (event: Event): void => {\n onResize(event);\n updateStyle();\n };\n const scrollCallback = (event: Event): void => {\n const fixedElement = ref.current;\n const fixedToElement = fixedTo.current;\n if (onScroll && fixedElement && fixedToElement) {\n onScroll(event, {\n visible: isWithinViewport({ fixedElement, fixedToElement }),\n fixedElement,\n fixedToElement,\n });\n }\n\n updateStyle();\n };\n\n const resizeHandler = delegateEvent(\"resize\", window, true);\n const scrollHandler = delegateEvent(\"scroll\", window, true, {\n passive: true,\n });\n resizeHandler.add(resizeCallback);\n scrollHandler.add(scrollCallback);\n return () => {\n resizeHandler.remove(resizeCallback);\n scrollHandler.remove(scrollCallback);\n };\n }, [active, disabled, fixedTo, onResize, onScroll, ref, updateStyle]);\n\n const callbacks: Required<FixedPositioningTransitionCallbacks> = {\n onEnter(appearing) {\n onEnter(appearing);\n updateStyle();\n },\n onEntering(appearing) {\n onEntering(appearing);\n updateStyle();\n },\n onEntered(appearing) {\n onEntered(appearing);\n updateStyle();\n },\n onExited() {\n onExited();\n setActive(false);\n },\n };\n\n return {\n ref: refHandler,\n style: disabled ? propStyle : { ...style, ...propStyle },\n callbacks,\n updateStyle,\n transitionOptions: {\n ...callbacks,\n nodeRef: refHandler,\n },\n };\n}\n"],"names":["useCallback","useEffect","useRef","useState","delegateEvent","useEnsuredRef","useIsomorphicLayoutEffect","BELOW_CENTER_ANCHOR","getFixedPosition","isWithinViewport","noop","undefined","useFixedPositioning","options","style","propStyle","nodeRef","fixedTo","disabled","onEnter","onEntering","onEntered","onExited","anchor","disableSwapping","disableVHBounds","initialX","initialY","preventOverlap","transformOrigin","vhMargin","vwMargin","width","xMargin","yMargin","getFixedPositionOptions","onScroll","onResize","active","setActive","ref","refHandler","optionsRef","current","setStyle","container","element","updateStyle","hidden","resizeCallback","event","scrollCallback","fixedElement","fixedToElement","visible","resizeHandler","window","scrollHandler","passive","add","remove","callbacks","appearing","transitionOptions"],"mappings":"AAAA;AAEA,SAKEA,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,QAAQ;AAEf,SAASC,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,yBAAyB,QAAQ,kCAAkC;AAC5E,SAASC,mBAAmB,QAAQ,iBAAiB;AACrD,SAASC,gBAAgB,QAAQ,wBAAwB;AAMzD,SAASC,gBAAgB,QAAQ,aAAa;AAE9C,MAAMC,OAAO,IAAiBC;AAwJ9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDC,GACD,OAAO,SAASC,oBAIdC,OAA8D;IAE9D,MAAM,EACJC,OAAOC,SAAS,EAChBC,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,UAAUT,IAAI,EACdU,aAAaV,IAAI,EACjBW,YAAYX,IAAI,EAChBY,WAAWZ,IAAI,EACfa,SAAShB,mBAAmB,EAC5BiB,eAAe,EACfC,eAAe,EACfC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,eAAe,EACfC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,OAAO,EACPC,OAAO,EACPC,0BAA0BzB,IAAI,EAC9B0B,QAAQ,EACRC,WAAW3B,IAAI,EAChB,GAAGG;IAEJ,MAAM,CAACyB,QAAQC,UAAU,GAAGpC,SAAS;IACrC,MAAM,CAACqC,KAAKC,WAAW,GAAGpC,cAAcW;IACxC,MAAM0B,aAAaxC,OAAO;QACxBsC;QACAvB;QACAM;QACAC;QACAC;QACAG;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;IACA7B,0BAA0B;QACxBoC,WAAWC,OAAO,GAAG;YACnBH;YACAvB;YACAM;YACAC;YACAC;YACAG;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF;IACF,GAAG;QACDK;QACAvB;QACAM;QACAC;QACAC;QACAG;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IACD,MAAM,CAACrB,OAAO8B,SAAS,GAAGzC,SACxB,IACEK,iBAAiB;YACfqC,WAAWL,IAAIG,OAAO;YACtBG,SAAS7B,QAAQ0B,OAAO;YACxBpB;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACA,GAAGC,yBAAyB;QAC9B,GAAGrB,KAAK;IAGZ,MAAMiC,cAAc/C,YAAY;QAC9B,IAAIkB,UAAU;YACZ;QACF;QAEA,MAAM,EACJsB,GAAG,EACHvB,OAAO,EACPM,MAAM,EACNC,eAAe,EACfC,eAAe,EACfG,cAAc,EACdC,eAAe,EACfC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,OAAO,EACPC,OAAO,EACPC,uBAAuB,EACxB,GAAGO,WAAWC,OAAO;QACtB,MAAMG,UAAUN,IAAIG,OAAO;QAC3B,MAAME,YAAY5B,QAAQ0B,OAAO;QACjC,MAAM,EAAE7B,KAAK,EAAE,GAAGN,iBAAiB;YACjCqC;YACAC;YACAvB;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACA,GAAGC,yBAAyB;QAC9B;QAEAS,SAAS9B;QACTyB,UAAU,CAAC,CAACO,WAAW,CAACA,QAAQE,MAAM;IAEtC,qEAAqE;IACrE,4EAA4E;IAC9E,GAAG;QAAC9B;QAAUQ;QAAUC;KAAS;IAEjC1B,UAAU;QACR,IAAI,CAACqC,UAAUpB,UAAU;YACvB;QACF;QAEA,MAAM+B,iBAAiB,CAACC;YACtBb,SAASa;YACTH;QACF;QACA,MAAMI,iBAAiB,CAACD;YACtB,MAAME,eAAeZ,IAAIG,OAAO;YAChC,MAAMU,iBAAiBpC,QAAQ0B,OAAO;YACtC,IAAIP,YAAYgB,gBAAgBC,gBAAgB;gBAC9CjB,SAASc,OAAO;oBACdI,SAAS7C,iBAAiB;wBAAE2C;wBAAcC;oBAAe;oBACzDD;oBACAC;gBACF;YACF;YAEAN;QACF;QAEA,MAAMQ,gBAAgBnD,cAAc,UAAUoD,QAAQ;QACtD,MAAMC,gBAAgBrD,cAAc,UAAUoD,QAAQ,MAAM;YAC1DE,SAAS;QACX;QACAH,cAAcI,GAAG,CAACV;QAClBQ,cAAcE,GAAG,CAACR;QAClB,OAAO;YACLI,cAAcK,MAAM,CAACX;YACrBQ,cAAcG,MAAM,CAACT;QACvB;IACF,GAAG;QAACb;QAAQpB;QAAUD;QAASoB;QAAUD;QAAUI;QAAKO;KAAY;IAEpE,MAAMc,YAA2D;QAC/D1C,SAAQ2C,SAAS;YACf3C,QAAQ2C;YACRf;QACF;QACA3B,YAAW0C,SAAS;YAClB1C,WAAW0C;YACXf;QACF;QACA1B,WAAUyC,SAAS;YACjBzC,UAAUyC;YACVf;QACF;QACAzB;YACEA;YACAiB,UAAU;QACZ;IACF;IAEA,OAAO;QACLC,KAAKC;QACL3B,OAAOI,WAAWH,YAAY;YAAE,GAAGD,KAAK;YAAE,GAAGC,SAAS;QAAC;QACvD8C;QACAd;QACAgB,mBAAmB;YACjB,GAAGF,SAAS;YACZ7C,SAASyB;QACX;IACF;AACF"}
|
|
@@ -112,7 +112,7 @@ export interface CircularProgressProps extends Omit<HTMLAttributes<HTMLSpanEleme
|
|
|
112
112
|
* }
|
|
113
113
|
* ```
|
|
114
114
|
*
|
|
115
|
-
* @see {@link https://
|
|
115
|
+
* @see {@link https://react-md.dev/components/progress#circular-progress | Progress Demos}
|
|
116
116
|
* @since 6.0.0 Updated the determinate circular progress to no longer
|
|
117
117
|
* rotate while increasing the value and require a label for accessibility.
|
|
118
118
|
*/
|
|
@@ -30,7 +30,7 @@ const styles = bem("rmd-circular-progress");
|
|
|
30
30
|
* }
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
|
-
* @see {@link https://
|
|
33
|
+
* @see {@link https://react-md.dev/components/progress#circular-progress | Progress Demos}
|
|
34
34
|
* @since 6.0.0 Updated the determinate circular progress to no longer
|
|
35
35
|
* rotate while increasing the value and require a label for accessibility.
|
|
36
36
|
*/ export const CircularProgress = /*#__PURE__*/ forwardRef(function CircularProgress(props, ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/progress/CircularProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n type HTMLAttributes,\n forwardRef,\n useMemo,\n} from \"react\";\n\nimport { cssUtils } from \"../cssUtils.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @since 6.0.0 Added the `disableShrink` prop.\n * @since 6.0.0 Renamed `small` to `dense`.\n * @since 6.0.0 Renamed `centered` to `disableCentered`.\n * @since 6.0.0 Removed the `maxRotation` prop since the determinate state no\n * longer rotates while increasing value.\n */\nexport interface CircularProgressProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"id\">,\n ProgressProps {\n /**\n * An optional style to apply to the svg within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n svgStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the svg within the circular progress.\n */\n svgClassName?: string;\n\n /**\n * An optional style to apply to the circle within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n circleStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the circle within the circular progress.\n */\n circleClassName?: string;\n\n /**\n * The radius for the circle. It is generally recommended to have the radius\n * be 1/2 of the viewbox and minus a few more pixels so that there is some\n * surrounding padding. You probably shouldn't really be changing this prop\n * though.\n *\n * @defaultValue `30`\n */\n radius?: number;\n\n /**\n * The center point for the circle. This should be half of the `viewBox` prop\n * 99% of the time and probably won't be changed.\n *\n * @defaultValue `33`\n */\n center?: number;\n\n /**\n * The viewbox for the child svg. I wouldn't recommend changing this value as\n * you will also need to update the `dashoffset` in both Sass and this prop to\n * get the animation to look nice again.\n *\n * @defaultValue `0 0 66 66`\n */\n viewBox?: string;\n\n /**\n * The `stroke-dashoffset` for the circle within the SVG. You probably won't\n * be changing this value that much as it should match the\n * `$rmd-progress-circle-dashoffset` Sass variable. This is really just used\n * to help to create the determinate progress animation.\n *\n * @defaultValue `187`\n */\n dashoffset?: number;\n\n /**\n * Boolean if the circular progress should be centered using left and right\n * margins.\n *\n * @defaultValue `false`\n * @since 6.0.0 Renamed from `centered`\n */\n disableCentered?: boolean;\n\n /**\n * Set to `true` to render as a smaller size.\n *\n * @defaultValue `false`\n * @since 2.3.0\n * @since 6.0.0 Renamed from `small`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the indeterminate behavior to only rotate\n * which will increase performance during CPU-intensive tasks or when many\n * loading spinners are displayed at once on the page.\n *\n * @defaultValue `false`\n * @since 6.0.0\n */\n disableShrink?: boolean;\n}\n\nconst styles = bem(\"rmd-circular-progress\");\n\n/**\n * @example Indeterminate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core/progress/CircularProgress\":\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return <CircularProgress aria-label=\"Loading\" />;\n * }\n * ```\n *\n * @example Determinate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core/progress/CircularProgress\":\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * // a number from 0 - 100\n * const [progress, setProgress] = useState(0);\n *\n * return <CircularProgress aria-label=\"File upload\" value={progress} />;\n * }\n * ```\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/progress/CircularProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n type HTMLAttributes,\n forwardRef,\n useMemo,\n} from \"react\";\n\nimport { cssUtils } from \"../cssUtils.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @since 6.0.0 Added the `disableShrink` prop.\n * @since 6.0.0 Renamed `small` to `dense`.\n * @since 6.0.0 Renamed `centered` to `disableCentered`.\n * @since 6.0.0 Removed the `maxRotation` prop since the determinate state no\n * longer rotates while increasing value.\n */\nexport interface CircularProgressProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"id\">,\n ProgressProps {\n /**\n * An optional style to apply to the svg within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n svgStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the svg within the circular progress.\n */\n svgClassName?: string;\n\n /**\n * An optional style to apply to the circle within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n circleStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the circle within the circular progress.\n */\n circleClassName?: string;\n\n /**\n * The radius for the circle. It is generally recommended to have the radius\n * be 1/2 of the viewbox and minus a few more pixels so that there is some\n * surrounding padding. You probably shouldn't really be changing this prop\n * though.\n *\n * @defaultValue `30`\n */\n radius?: number;\n\n /**\n * The center point for the circle. This should be half of the `viewBox` prop\n * 99% of the time and probably won't be changed.\n *\n * @defaultValue `33`\n */\n center?: number;\n\n /**\n * The viewbox for the child svg. I wouldn't recommend changing this value as\n * you will also need to update the `dashoffset` in both Sass and this prop to\n * get the animation to look nice again.\n *\n * @defaultValue `0 0 66 66`\n */\n viewBox?: string;\n\n /**\n * The `stroke-dashoffset` for the circle within the SVG. You probably won't\n * be changing this value that much as it should match the\n * `$rmd-progress-circle-dashoffset` Sass variable. This is really just used\n * to help to create the determinate progress animation.\n *\n * @defaultValue `187`\n */\n dashoffset?: number;\n\n /**\n * Boolean if the circular progress should be centered using left and right\n * margins.\n *\n * @defaultValue `false`\n * @since 6.0.0 Renamed from `centered`\n */\n disableCentered?: boolean;\n\n /**\n * Set to `true` to render as a smaller size.\n *\n * @defaultValue `false`\n * @since 2.3.0\n * @since 6.0.0 Renamed from `small`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the indeterminate behavior to only rotate\n * which will increase performance during CPU-intensive tasks or when many\n * loading spinners are displayed at once on the page.\n *\n * @defaultValue `false`\n * @since 6.0.0\n */\n disableShrink?: boolean;\n}\n\nconst styles = bem(\"rmd-circular-progress\");\n\n/**\n * @example Indeterminate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core/progress/CircularProgress\":\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return <CircularProgress aria-label=\"Loading\" />;\n * }\n * ```\n *\n * @example Determinate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core/progress/CircularProgress\":\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * // a number from 0 - 100\n * const [progress, setProgress] = useState(0);\n *\n * return <CircularProgress aria-label=\"File upload\" value={progress} />;\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/progress#circular-progress | Progress Demos}\n * @since 6.0.0 Updated the determinate circular progress to no longer\n * rotate while increasing the value and require a label for accessibility.\n */\nexport const CircularProgress = forwardRef<\n HTMLSpanElement,\n LabelRequiredForA11y<CircularProgressProps>\n>(function CircularProgress(props, ref) {\n const {\n id: propId,\n className,\n svgStyle,\n svgClassName,\n circleStyle: propCircleStyle,\n circleClassName,\n value,\n min = 0,\n max = 100,\n radius = 30,\n center = 33,\n viewBox = \"0 0 66 66\",\n theme = \"primary\",\n dense = false,\n dashoffset = 187,\n disableShrink = false,\n disableCentered = false,\n disableTransition = false,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"circular-progress\");\n let progress: number | undefined;\n if (typeof value === \"number\") {\n progress = getPercentage({ min, max, value, validate: true });\n }\n\n const circleStyle = useMemo(() => {\n if (typeof progress !== \"number\") {\n return propCircleStyle;\n }\n\n return {\n ...propCircleStyle,\n strokeDashoffset: dashoffset - dashoffset * progress,\n };\n }, [progress, propCircleStyle, dashoffset]);\n\n const determinate = typeof progress === \"number\";\n const indeterminate = !determinate;\n return (\n <span\n {...remaining}\n id={id}\n ref={ref}\n role=\"progressbar\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={value}\n className={cnb(\n styles({ dense, centered: !disableCentered }),\n theme !== \"current-color\" && cssUtils({ textColor: theme }),\n className\n )}\n >\n <svg\n style={svgStyle}\n className={cnb(\n styles(\"svg\", {\n determinate,\n indeterminate: indeterminate && !disableShrink,\n \"rotate-only\": indeterminate && disableShrink,\n }),\n svgClassName\n )}\n viewBox={viewBox}\n >\n <circle\n style={circleStyle}\n className={cnb(\n styles(\"circle\", {\n animate: !disableTransition && determinate,\n determinate,\n indeterminate: indeterminate && !disableShrink,\n \"rotate-only\": indeterminate && disableShrink,\n }),\n circleClassName\n )}\n r={radius}\n cx={center}\n cy={center}\n />\n </svg>\n </span>\n );\n});\n"],"names":["cnb","forwardRef","useMemo","cssUtils","useEnsuredId","bem","getPercentage","styles","CircularProgress","props","ref","id","propId","className","svgStyle","svgClassName","circleStyle","propCircleStyle","circleClassName","value","min","max","radius","center","viewBox","theme","dense","dashoffset","disableShrink","disableCentered","disableTransition","remaining","progress","validate","strokeDashoffset","determinate","indeterminate","span","role","aria-valuemin","aria-valuemax","aria-valuenow","centered","textColor","svg","style","circle","animate","r","cx","cy"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAGEC,UAAU,EACVC,OAAO,QACF,QAAQ;AAEf,SAASC,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,aAAa,QAAQ,4BAA4B;AAuG1D,MAAMC,SAASF,IAAI;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GACD,OAAO,MAAMG,iCAAmBP,WAG9B,SAASO,iBAAiBC,KAAK,EAAEC,GAAG;IACpC,MAAM,EACJC,IAAIC,MAAM,EACVC,SAAS,EACTC,QAAQ,EACRC,YAAY,EACZC,aAAaC,eAAe,EAC5BC,eAAe,EACfC,KAAK,EACLC,MAAM,CAAC,EACPC,MAAM,GAAG,EACTC,SAAS,EAAE,EACXC,SAAS,EAAE,EACXC,UAAU,WAAW,EACrBC,QAAQ,SAAS,EACjBC,QAAQ,KAAK,EACbC,aAAa,GAAG,EAChBC,gBAAgB,KAAK,EACrBC,kBAAkB,KAAK,EACvBC,oBAAoB,KAAK,EACzB,GAAGC,WACJ,GAAGtB;IAEJ,MAAME,KAAKP,aAAaQ,QAAQ;IAChC,IAAIoB;IACJ,IAAI,OAAOb,UAAU,UAAU;QAC7Ba,WAAW1B,cAAc;YAAEc;YAAKC;YAAKF;YAAOc,UAAU;QAAK;IAC7D;IAEA,MAAMjB,cAAcd,QAAQ;QAC1B,IAAI,OAAO8B,aAAa,UAAU;YAChC,OAAOf;QACT;QAEA,OAAO;YACL,GAAGA,eAAe;YAClBiB,kBAAkBP,aAAaA,aAAaK;QAC9C;IACF,GAAG;QAACA;QAAUf;QAAiBU;KAAW;IAE1C,MAAMQ,cAAc,OAAOH,aAAa;IACxC,MAAMI,gBAAgB,CAACD;IACvB,qBACE,KAACE;QACE,GAAGN,SAAS;QACbpB,IAAIA;QACJD,KAAKA;QACL4B,MAAK;QACLC,iBAAenB;QACfoB,iBAAenB;QACfoB,iBAAetB;QACfN,WAAWb,IACTO,OAAO;YAAEmB;YAAOgB,UAAU,CAACb;QAAgB,IAC3CJ,UAAU,mBAAmBtB,SAAS;YAAEwC,WAAWlB;QAAM,IACzDZ;kBAGF,cAAA,KAAC+B;YACCC,OAAO/B;YACPD,WAAWb,IACTO,OAAO,OAAO;gBACZ4B;gBACAC,eAAeA,iBAAiB,CAACR;gBACjC,eAAeQ,iBAAiBR;YAClC,IACAb;YAEFS,SAASA;sBAET,cAAA,KAACsB;gBACCD,OAAO7B;gBACPH,WAAWb,IACTO,OAAO,UAAU;oBACfwC,SAAS,CAACjB,qBAAqBK;oBAC/BA;oBACAC,eAAeA,iBAAiB,CAACR;oBACjC,eAAeQ,iBAAiBR;gBAClC,IACAV;gBAEF8B,GAAG1B;gBACH2B,IAAI1B;gBACJ2B,IAAI3B;;;;AAKd,GAAG"}
|
|
@@ -66,7 +66,7 @@ export interface LinearProgressProps extends Omit<HTMLAttributes<HTMLSpanElement
|
|
|
66
66
|
* }
|
|
67
67
|
* ```
|
|
68
68
|
*
|
|
69
|
-
* @see {@link https://
|
|
69
|
+
* @see {@link https://react-md.dev/components/progress#linear-progress | Progress Demos}
|
|
70
70
|
* @since 6.0.0 Supports rendering as any of the theme colors and
|
|
71
71
|
* requires a label for accessibility.
|
|
72
72
|
*/
|
|
@@ -30,7 +30,7 @@ const styles = bem("rmd-linear-progress");
|
|
|
30
30
|
* }
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
|
-
* @see {@link https://
|
|
33
|
+
* @see {@link https://react-md.dev/components/progress#linear-progress | Progress Demos}
|
|
34
34
|
* @since 6.0.0 Supports rendering as any of the theme colors and
|
|
35
35
|
* requires a label for accessibility.
|
|
36
36
|
*/ export const LinearProgress = /*#__PURE__*/ forwardRef(function LinearProgress(props, ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/progress/LinearProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n type HTMLAttributes,\n forwardRef,\n useMemo,\n} from \"react\";\n\nimport { cssUtils } from \"../cssUtils.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @since 6.0.0 Added the `theme` prop\n */\nexport interface LinearProgressProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"id\" | \"children\">,\n ProgressProps {\n /**\n * An optional style to apply to the progress bar. This will be merged with\n * the current width or height tracking the progress when a `value` is also\n * provided.\n */\n barStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the progress bar.\n */\n barClassName?: string;\n\n /**\n * Boolean if the progress should be reversed. This will change the progress\n * direction from `left-to-right` to be `right-to-left`. If the current\n * language is a rtl language and this prop is enabled, the direction will\n * still be `left-to-right`.\n *\n * @defaultValue `false`\n */\n reverse?: boolean;\n\n /**\n * Boolean if the progress should be vertical instead of horizontal. When\n * this prop is set, you should also set the `verticalHeight` prop to a height\n * value you want for your progress bar.\n *\n * @defaultValue `false`\n */\n vertical?: boolean;\n\n /**\n * Since there isn't really a good way to have \"auto height\", you'll need to\n * manually set the progress bar's height with this prop to some pixel value.\n * If you'd prefer to set the height in Sass/css, set this value to `null`\n * instead since this value would be passed down as a `height` inline style.\n *\n * @defaultValue `240`\n */\n verticalHeight?: number | null;\n}\n\nconst styles = bem(\"rmd-linear-progress\");\n\n/**\n * @example Indeterminate Example\n * ```tsx\n * import { LinearProgress } from \"@react-md/core/progress/LinearProgress\";\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return <LinearProgress aria-label=\"Loading\" />;\n * }\n * ```\n *\n * @example Determinate Example\n * ```tsx\n * import { LinearProgress } from \"@react-md/core/progress/LinearProgress\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * // a number from 0 - 100\n * const [progress, setProgress] = useState(0);\n *\n * return <LinearProgress aria-label=\"File upload\" value={progress} />;\n * }\n * ```\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/progress/LinearProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n type CSSProperties,\n type HTMLAttributes,\n forwardRef,\n useMemo,\n} from \"react\";\n\nimport { cssUtils } from \"../cssUtils.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @since 6.0.0 Added the `theme` prop\n */\nexport interface LinearProgressProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"id\" | \"children\">,\n ProgressProps {\n /**\n * An optional style to apply to the progress bar. This will be merged with\n * the current width or height tracking the progress when a `value` is also\n * provided.\n */\n barStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the progress bar.\n */\n barClassName?: string;\n\n /**\n * Boolean if the progress should be reversed. This will change the progress\n * direction from `left-to-right` to be `right-to-left`. If the current\n * language is a rtl language and this prop is enabled, the direction will\n * still be `left-to-right`.\n *\n * @defaultValue `false`\n */\n reverse?: boolean;\n\n /**\n * Boolean if the progress should be vertical instead of horizontal. When\n * this prop is set, you should also set the `verticalHeight` prop to a height\n * value you want for your progress bar.\n *\n * @defaultValue `false`\n */\n vertical?: boolean;\n\n /**\n * Since there isn't really a good way to have \"auto height\", you'll need to\n * manually set the progress bar's height with this prop to some pixel value.\n * If you'd prefer to set the height in Sass/css, set this value to `null`\n * instead since this value would be passed down as a `height` inline style.\n *\n * @defaultValue `240`\n */\n verticalHeight?: number | null;\n}\n\nconst styles = bem(\"rmd-linear-progress\");\n\n/**\n * @example Indeterminate Example\n * ```tsx\n * import { LinearProgress } from \"@react-md/core/progress/LinearProgress\";\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return <LinearProgress aria-label=\"Loading\" />;\n * }\n * ```\n *\n * @example Determinate Example\n * ```tsx\n * import { LinearProgress } from \"@react-md/core/progress/LinearProgress\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * // a number from 0 - 100\n * const [progress, setProgress] = useState(0);\n *\n * return <LinearProgress aria-label=\"File upload\" value={progress} />;\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/progress#linear-progress | Progress Demos}\n * @since 6.0.0 Supports rendering as any of the theme colors and\n * requires a label for accessibility.\n */\nexport const LinearProgress = forwardRef<\n HTMLSpanElement,\n LabelRequiredForA11y<LinearProgressProps>\n>(function LinearProgress(props, ref) {\n const {\n id: propId,\n style: propStyle,\n className,\n barStyle: propBarStyle,\n barClassName,\n min = 0,\n max = 100,\n value,\n reverse = false,\n theme = \"primary\",\n disableTransition = false,\n vertical = false,\n verticalHeight = 240,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"linear-progress\");\n const style = useMemo(() => {\n if (!vertical || verticalHeight === null) {\n return propStyle;\n }\n\n return {\n ...propStyle,\n height: verticalHeight,\n };\n }, [propStyle, vertical, verticalHeight]);\n\n let progress: number | undefined;\n if (typeof value === \"number\") {\n progress = getPercentage({ min, max, value, validate: true });\n }\n const barStyle = useMemo(() => {\n if (typeof progress !== \"number\") {\n return propBarStyle;\n }\n\n const key = vertical ? \"height\" : \"width\";\n return {\n ...propBarStyle,\n [key]: `${progress * 100}%`,\n };\n }, [progress, propBarStyle, vertical]);\n\n const determinate = typeof progress === \"number\";\n const indeterminate = !determinate;\n return (\n <span\n {...remaining}\n id={id}\n ref={ref}\n style={style}\n role=\"progressbar\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={value}\n className={cnb(\n styles({\n vertical,\n horizontal: !vertical,\n determinate,\n indeterminate,\n }),\n theme !== \"current-color\" && cssUtils({ textColor: theme }),\n className\n )}\n >\n <span\n style={barStyle}\n className={cnb(\n styles(\"bar\", {\n vertical,\n \"vertical-reverse\": vertical && reverse,\n horizontal: !vertical,\n \"horizontal-reverse\": !vertical && reverse,\n animate: !disableTransition && determinate,\n determinate,\n indeterminate,\n \"determinate-reverse\": determinate && reverse && !vertical,\n \"determinate-vertical-reverse\": determinate && reverse && vertical,\n \"indeterminate-reverse\": indeterminate && reverse && !vertical,\n \"indeterminate-vertical\": indeterminate && vertical,\n \"indeterminate-vertical-reverse\":\n indeterminate && reverse && vertical,\n }),\n barClassName\n )}\n />\n </span>\n );\n});\n"],"names":["cnb","forwardRef","useMemo","cssUtils","useEnsuredId","bem","getPercentage","styles","LinearProgress","props","ref","id","propId","style","propStyle","className","barStyle","propBarStyle","barClassName","min","max","value","reverse","theme","disableTransition","vertical","verticalHeight","remaining","height","progress","validate","key","determinate","indeterminate","span","role","aria-valuemin","aria-valuemax","aria-valuenow","horizontal","textColor","animate"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAGEC,UAAU,EACVC,OAAO,QACF,QAAQ;AAEf,SAASC,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,aAAa,QAAQ,4BAA4B;AAmD1D,MAAMC,SAASF,IAAI;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BC,GACD,OAAO,MAAMG,+BAAiBP,WAG5B,SAASO,eAAeC,KAAK,EAAEC,GAAG;IAClC,MAAM,EACJC,IAAIC,MAAM,EACVC,OAAOC,SAAS,EAChBC,SAAS,EACTC,UAAUC,YAAY,EACtBC,YAAY,EACZC,MAAM,CAAC,EACPC,MAAM,GAAG,EACTC,KAAK,EACLC,UAAU,KAAK,EACfC,QAAQ,SAAS,EACjBC,oBAAoB,KAAK,EACzBC,WAAW,KAAK,EAChBC,iBAAiB,GAAG,EACpB,GAAGC,WACJ,GAAGlB;IAEJ,MAAME,KAAKP,aAAaQ,QAAQ;IAChC,MAAMC,QAAQX,QAAQ;QACpB,IAAI,CAACuB,YAAYC,mBAAmB,MAAM;YACxC,OAAOZ;QACT;QAEA,OAAO;YACL,GAAGA,SAAS;YACZc,QAAQF;QACV;IACF,GAAG;QAACZ;QAAWW;QAAUC;KAAe;IAExC,IAAIG;IACJ,IAAI,OAAOR,UAAU,UAAU;QAC7BQ,WAAWvB,cAAc;YAAEa;YAAKC;YAAKC;YAAOS,UAAU;QAAK;IAC7D;IACA,MAAMd,WAAWd,QAAQ;QACvB,IAAI,OAAO2B,aAAa,UAAU;YAChC,OAAOZ;QACT;QAEA,MAAMc,MAAMN,WAAW,WAAW;QAClC,OAAO;YACL,GAAGR,YAAY;YACf,CAACc,IAAI,EAAE,GAAGF,WAAW,IAAI,CAAC,CAAC;QAC7B;IACF,GAAG;QAACA;QAAUZ;QAAcQ;KAAS;IAErC,MAAMO,cAAc,OAAOH,aAAa;IACxC,MAAMI,gBAAgB,CAACD;IACvB,qBACE,KAACE;QACE,GAAGP,SAAS;QACbhB,IAAIA;QACJD,KAAKA;QACLG,OAAOA;QACPsB,MAAK;QACLC,iBAAejB;QACfkB,iBAAejB;QACfkB,iBAAejB;QACfN,WAAWf,IACTO,OAAO;YACLkB;YACAc,YAAY,CAACd;YACbO;YACAC;QACF,IACAV,UAAU,mBAAmBpB,SAAS;YAAEqC,WAAWjB;QAAM,IACzDR;kBAGF,cAAA,KAACmB;YACCrB,OAAOG;YACPD,WAAWf,IACTO,OAAO,OAAO;gBACZkB;gBACA,oBAAoBA,YAAYH;gBAChCiB,YAAY,CAACd;gBACb,sBAAsB,CAACA,YAAYH;gBACnCmB,SAAS,CAACjB,qBAAqBQ;gBAC/BA;gBACAC;gBACA,uBAAuBD,eAAeV,WAAW,CAACG;gBAClD,gCAAgCO,eAAeV,WAAWG;gBAC1D,yBAAyBQ,iBAAiBX,WAAW,CAACG;gBACtD,0BAA0BQ,iBAAiBR;gBAC3C,kCACEQ,iBAAiBX,WAAWG;YAChC,IACAP;;;AAKV,GAAG"}
|
|
@@ -58,7 +58,7 @@ export interface ResponsiveItemProps extends HTMLAttributes<HTMLSpanElement>, Re
|
|
|
58
58
|
* }
|
|
59
59
|
* ```
|
|
60
60
|
*
|
|
61
|
-
* @see {@link https://
|
|
61
|
+
* @see {@link https://react-md.dev/components/responsive-item | ResponsiveItem Demos}
|
|
62
62
|
* @since 6.0.0 Renamed from `MediaContainer` to
|
|
63
63
|
* `ResponsiveItem` and renders a `<span>` instead of a `<div>`.
|
|
64
64
|
*/
|
|
@@ -48,7 +48,7 @@ import { responsiveItem } from "./responsiveItemStyles.js";
|
|
|
48
48
|
* }
|
|
49
49
|
* ```
|
|
50
50
|
*
|
|
51
|
-
* @see {@link https://
|
|
51
|
+
* @see {@link https://react-md.dev/components/responsive-item | ResponsiveItem Demos}
|
|
52
52
|
* @since 6.0.0 Renamed from `MediaContainer` to
|
|
53
53
|
* `ResponsiveItem` and renders a `<span>` instead of a `<div>`.
|
|
54
54
|
*/ export const ResponsiveItem = /*#__PURE__*/ forwardRef(function ResponsiveItem(props, ref) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/responsive-item/ResponsiveItem.tsx"],"sourcesContent":["import { type HTMLAttributes, forwardRef } from \"react\";\n\nimport {\n type ResponsiveItemClassNameOptions,\n responsiveItem,\n} from \"./responsiveItemStyles.js\";\n\n/**\n * @since 6.0.0 Renamed from `MediaContainerProps` to\n * `ResponsiveItemProps`\n * @since 6.0.0 The `height` and `width` props were removed in favor of the\n * `aspectRatio` prop since the latest typescript string interpolation supports\n * enforcing the correct format.\n * @since 6.0.0 The `auto` prop was removed in favor of the new\n * {@link ResponsiveItemProps.responsive} prop.\n */\nexport interface ResponsiveItemProps\n extends HTMLAttributes<HTMLSpanElement>,\n ResponsiveItemClassNameOptions {}\n\n/**\n * @example Image Example\n * ```tsx\n * import { ResponsiveItem } from \"@react-md/core/responsive-item/ResponsiveItem\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItem>\n * <img alt=\"\" src=\"/some-image.png\" />\n * </ResponsiveItem>\n * );\n * }\n * ```\n *\n * @example Iframe Example\n * ```tsx\n * import { ResponsiveItem } from \"@react-md/core/responsive-item/ResponsiveItem\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItem>\n * <iframe\n * src=\"https://youtube.com/some-video-url\"\n * title=\"Some YouTube video\"\n * allowFullScreen\n * />\n * </ResponsiveItem>\n * );\n * }\n * ```\n *\n * @example Forced Aspect Ratio\n * ```tsx\n * import { ResponsiveItem } from \"@react-md/core/responsive-item/ResponsiveItem\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItem aspectRatio=\"16-9\">\n * <img alt=\"\" src=\"/some-image.png\" />\n * </ResponsiveItem>\n * );\n * }\n * ```\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/responsive-item/ResponsiveItem.tsx"],"sourcesContent":["import { type HTMLAttributes, forwardRef } from \"react\";\n\nimport {\n type ResponsiveItemClassNameOptions,\n responsiveItem,\n} from \"./responsiveItemStyles.js\";\n\n/**\n * @since 6.0.0 Renamed from `MediaContainerProps` to\n * `ResponsiveItemProps`\n * @since 6.0.0 The `height` and `width` props were removed in favor of the\n * `aspectRatio` prop since the latest typescript string interpolation supports\n * enforcing the correct format.\n * @since 6.0.0 The `auto` prop was removed in favor of the new\n * {@link ResponsiveItemProps.responsive} prop.\n */\nexport interface ResponsiveItemProps\n extends HTMLAttributes<HTMLSpanElement>,\n ResponsiveItemClassNameOptions {}\n\n/**\n * @example Image Example\n * ```tsx\n * import { ResponsiveItem } from \"@react-md/core/responsive-item/ResponsiveItem\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItem>\n * <img alt=\"\" src=\"/some-image.png\" />\n * </ResponsiveItem>\n * );\n * }\n * ```\n *\n * @example Iframe Example\n * ```tsx\n * import { ResponsiveItem } from \"@react-md/core/responsive-item/ResponsiveItem\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItem>\n * <iframe\n * src=\"https://youtube.com/some-video-url\"\n * title=\"Some YouTube video\"\n * allowFullScreen\n * />\n * </ResponsiveItem>\n * );\n * }\n * ```\n *\n * @example Forced Aspect Ratio\n * ```tsx\n * import { ResponsiveItem } from \"@react-md/core/responsive-item/ResponsiveItem\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <ResponsiveItem aspectRatio=\"16-9\">\n * <img alt=\"\" src=\"/some-image.png\" />\n * </ResponsiveItem>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/responsive-item | ResponsiveItem Demos}\n * @since 6.0.0 Renamed from `MediaContainer` to\n * `ResponsiveItem` and renders a `<span>` instead of a `<div>`.\n */\nexport const ResponsiveItem = forwardRef<HTMLSpanElement, ResponsiveItemProps>(\n function ResponsiveItem(props, ref) {\n const {\n className,\n fullWidth = false,\n aspectRatio,\n responsive = \"auto\",\n children,\n ...remaining\n } = props;\n\n return (\n <span\n {...remaining}\n ref={ref}\n className={responsiveItem({\n className,\n fullWidth,\n aspectRatio,\n responsive,\n })}\n >\n {children}\n </span>\n );\n }\n);\n"],"names":["forwardRef","responsiveItem","ResponsiveItem","props","ref","className","fullWidth","aspectRatio","responsive","children","remaining","span"],"mappings":";AAAA,SAA8BA,UAAU,QAAQ,QAAQ;AAExD,SAEEC,cAAc,QACT,4BAA4B;AAenC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDC,GACD,OAAO,MAAMC,+BAAiBF,WAC5B,SAASE,eAAeC,KAAK,EAAEC,GAAG;IAChC,MAAM,EACJC,SAAS,EACTC,YAAY,KAAK,EACjBC,WAAW,EACXC,aAAa,MAAM,EACnBC,QAAQ,EACR,GAAGC,WACJ,GAAGP;IAEJ,qBACE,KAACQ;QACE,GAAGD,SAAS;QACbN,KAAKA;QACLC,WAAWJ,eAAe;YACxBI;YACAC;YACAC;YACAC;QACF;kBAECC;;AAGP,GACA"}
|
|
@@ -28,7 +28,7 @@ export interface ResponsiveItemOverlayProps extends HTMLAttributes<HTMLSpanEleme
|
|
|
28
28
|
* }
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
|
-
* @see {@link https://
|
|
31
|
+
* @see {@link https://react-md.dev/components/responsive-item | ResponsiveItem Demos}
|
|
32
32
|
* @see {@link ResponsiveItemOverlayPosition}
|
|
33
33
|
* @since 6.0.0 Renamed from `MediaOverlay` to `ResponsiveItemOverlay`
|
|
34
34
|
* and renders as a `<span>` instead of a `<div>`.
|
|
@@ -23,7 +23,7 @@ import { responsiveItemOverlay } from "./responsiveItemOverlayStyles.js";
|
|
|
23
23
|
* }
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
26
|
-
* @see {@link https://
|
|
26
|
+
* @see {@link https://react-md.dev/components/responsive-item | ResponsiveItem Demos}
|
|
27
27
|
* @see {@link ResponsiveItemOverlayPosition}
|
|
28
28
|
* @since 6.0.0 Renamed from `MediaOverlay` to `ResponsiveItemOverlay`
|
|
29
29
|
* and renders as a `<span>` instead of a `<div>`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/responsive-item/ResponsiveItemOverlay.tsx"],"sourcesContent":["import { type HTMLAttributes, forwardRef } from \"react\";\n\nimport {\n type ResponsiveItemOverlayClassNameOptions,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type ResponsiveItemOverlayPosition,\n responsiveItemOverlay,\n} from \"./responsiveItemOverlayStyles.js\";\n\n/**\n * @since 6.0.0 Renamed from `MediaOverlayProps` to\n * `ResponsiveItemOverlayProps`.\n */\nexport interface ResponsiveItemOverlayProps\n extends HTMLAttributes<HTMLSpanElement>,\n ResponsiveItemOverlayClassNameOptions {}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { CardContent } from \"@react-md/core/card/CardContent\";\n * import { ResponsiveItemOverlay } from \"@react-md/core/responsive-item/ResponsiveItemOverlay\";\n * import { Typography } from \"@react-md/core/typography/Typography\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <CardContent>\n * <img alt=\"\" src=\"/some-image.png\" />\n * <ResponsiveItemOverlay>\n * <Typography type=\"headline-5\" margin=\"none\">\n * This appears at the bottom by default.\n * </Typography>\n * </ResponsiveItemOverlay>\n * </CardContent>\n * );\n * }\n * ```\n *\n * @see {@link https://
|
|
1
|
+
{"version":3,"sources":["../../src/responsive-item/ResponsiveItemOverlay.tsx"],"sourcesContent":["import { type HTMLAttributes, forwardRef } from \"react\";\n\nimport {\n type ResponsiveItemOverlayClassNameOptions,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n type ResponsiveItemOverlayPosition,\n responsiveItemOverlay,\n} from \"./responsiveItemOverlayStyles.js\";\n\n/**\n * @since 6.0.0 Renamed from `MediaOverlayProps` to\n * `ResponsiveItemOverlayProps`.\n */\nexport interface ResponsiveItemOverlayProps\n extends HTMLAttributes<HTMLSpanElement>,\n ResponsiveItemOverlayClassNameOptions {}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { CardContent } from \"@react-md/core/card/CardContent\";\n * import { ResponsiveItemOverlay } from \"@react-md/core/responsive-item/ResponsiveItemOverlay\";\n * import { Typography } from \"@react-md/core/typography/Typography\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <CardContent>\n * <img alt=\"\" src=\"/some-image.png\" />\n * <ResponsiveItemOverlay>\n * <Typography type=\"headline-5\" margin=\"none\">\n * This appears at the bottom by default.\n * </Typography>\n * </ResponsiveItemOverlay>\n * </CardContent>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/responsive-item | ResponsiveItem Demos}\n * @see {@link ResponsiveItemOverlayPosition}\n * @since 6.0.0 Renamed from `MediaOverlay` to `ResponsiveItemOverlay`\n * and renders as a `<span>` instead of a `<div>`.\n */\nexport const ResponsiveItemOverlay = forwardRef<\n HTMLSpanElement,\n ResponsiveItemOverlayProps\n>(function ResponsiveItemOverlay(props, ref) {\n const { className, children, position = \"bottom\", ...remaining } = props;\n\n return (\n <span\n {...remaining}\n ref={ref}\n className={responsiveItemOverlay({ className, position })}\n >\n {children}\n </span>\n );\n});\n"],"names":["forwardRef","responsiveItemOverlay","ResponsiveItemOverlay","props","ref","className","children","position","remaining","span"],"mappings":";AAAA,SAA8BA,UAAU,QAAQ,QAAQ;AAExD,SAIEC,qBAAqB,QAChB,mCAAmC;AAU1C;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BC,GACD,OAAO,MAAMC,sCAAwBF,WAGnC,SAASE,sBAAsBC,KAAK,EAAEC,GAAG;IACzC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,EAAE,GAAGC,WAAW,GAAGL;IAEnE,qBACE,KAACM;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLC,WAAWJ,sBAAsB;YAAEI;YAAWE;QAAS;kBAEtDD;;AAGP,GAAG"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
@use "sass:map";
|
|
7
7
|
@use "sass:math";
|
|
8
8
|
@use "../utils";
|
|
9
|
+
@use "../spacing";
|
|
9
10
|
@use "../theme/colors";
|
|
10
11
|
@use "../theme/theme";
|
|
11
12
|
|
|
@@ -85,7 +86,7 @@ $overlay-z-index: 0 !default;
|
|
|
85
86
|
|
|
86
87
|
/// The default `ResponsiveItemOverlay` padding.
|
|
87
88
|
/// @type Number
|
|
88
|
-
$overlay-padding:
|
|
89
|
+
$overlay-padding: spacing.get-var(md) !default;
|
|
89
90
|
|
|
90
91
|
/// The default width to apply to the `position="left"`, `"position="right"`,
|
|
91
92
|
/// `position="center"`, or `position="absolute-center"`
|
|
@@ -7,7 +7,7 @@ export declare const SCROLLBAR_SIZE_VAR = "--rmd-scrollbar-size";
|
|
|
7
7
|
/**
|
|
8
8
|
* Used to enable scroll locking on the entire page.
|
|
9
9
|
*
|
|
10
|
-
* @see {@link https://
|
|
10
|
+
* @see {@link https://react-md.dev/hooks/use-scroll-lock | useScrollLock Demos}
|
|
11
11
|
* @since 6.0.0 No longer support scroll locking elements other than
|
|
12
12
|
* the `document.body` since it's more reliable to scroll lock with an overlay.
|
|
13
13
|
* @since 6.0.0 Now applies `paddingRight` equal to the current OS's
|
|
@@ -8,7 +8,7 @@ let isLocked = false;
|
|
|
8
8
|
/**
|
|
9
9
|
* Used to enable scroll locking on the entire page.
|
|
10
10
|
*
|
|
11
|
-
* @see {@link https://
|
|
11
|
+
* @see {@link https://react-md.dev/hooks/use-scroll-lock | useScrollLock Demos}
|
|
12
12
|
* @since 6.0.0 No longer support scroll locking elements other than
|
|
13
13
|
* the `document.body` since it's more reliable to scroll lock with an overlay.
|
|
14
14
|
* @since 6.0.0 Now applies `paddingRight` equal to the current OS's
|