@react-md/core 1.0.0-next.14 → 1.0.0-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CoreProviders.js.map +1 -1
- package/dist/NoSsr.js.map +1 -1
- package/dist/RootHtml.d.ts +0 -2
- package/dist/RootHtml.js +0 -2
- package/dist/RootHtml.js.map +1 -1
- package/dist/SsrProvider.js.map +1 -1
- package/dist/app-bar/AppBar.d.ts +0 -2
- package/dist/app-bar/AppBar.js +0 -2
- package/dist/app-bar/AppBar.js.map +1 -1
- package/dist/app-bar/AppBarTitle.d.ts +8 -7
- package/dist/app-bar/AppBarTitle.js +3 -4
- package/dist/app-bar/AppBarTitle.js.map +1 -1
- package/dist/autocomplete/Autocomplete.js.map +1 -1
- package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -1
- package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -1
- package/dist/autocomplete/FilterAutocompleteOptions.js.map +1 -1
- package/dist/autocomplete/autocompleteStyles.js.map +1 -1
- package/dist/autocomplete/defaults.d.ts +2 -2
- package/dist/autocomplete/defaults.js +3 -3
- package/dist/autocomplete/defaults.js.map +1 -1
- package/dist/autocomplete/types.js.map +1 -1
- package/dist/avatar/Avatar.d.ts +1 -4
- package/dist/avatar/Avatar.js +1 -4
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/avatar/styles.js.map +1 -1
- package/dist/badge/Badge.d.ts +1 -3
- package/dist/badge/Badge.js +0 -2
- package/dist/badge/Badge.js.map +1 -1
- package/dist/box/Box.d.ts +0 -2
- package/dist/box/Box.js +0 -2
- package/dist/box/Box.js.map +1 -1
- package/dist/box/styles.js.map +1 -1
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/button/Button.js.map +1 -1
- package/dist/button/ButtonUnstyled.d.ts +0 -2
- package/dist/button/ButtonUnstyled.js +0 -2
- package/dist/button/ButtonUnstyled.js.map +1 -1
- package/dist/button/FloatingActionButton.js.map +1 -1
- package/dist/button/TooltippedButton.js.map +1 -1
- package/dist/button/buttonStyles.js.map +1 -1
- package/dist/button/buttonUnstyledStyles.js.map +1 -1
- package/dist/card/Card.d.ts +2 -3
- package/dist/card/Card.js +0 -2
- package/dist/card/Card.js.map +1 -1
- package/dist/card/CardContent.d.ts +0 -2
- package/dist/card/CardContent.js +0 -2
- package/dist/card/CardContent.js.map +1 -1
- package/dist/card/CardFooter.d.ts +0 -3
- package/dist/card/CardFooter.js +0 -2
- package/dist/card/CardFooter.js.map +1 -1
- package/dist/card/CardHeader.d.ts +0 -2
- package/dist/card/CardHeader.js +0 -2
- package/dist/card/CardHeader.js.map +1 -1
- package/dist/card/CardSubtitle.d.ts +6 -3
- package/dist/card/CardSubtitle.js +2 -3
- package/dist/card/CardSubtitle.js.map +1 -1
- package/dist/card/CardTitle.d.ts +0 -3
- package/dist/card/CardTitle.js +0 -2
- package/dist/card/CardTitle.js.map +1 -1
- package/dist/card/ClickableCard.js.map +1 -1
- package/dist/card/styles.js +2 -4
- package/dist/card/styles.js.map +1 -1
- package/dist/chip/Chip.d.ts +0 -2
- package/dist/chip/Chip.js +0 -2
- package/dist/chip/Chip.js.map +1 -1
- package/dist/chip/styles.js.map +1 -1
- package/dist/cssUtils.d.ts +1 -1
- package/dist/cssUtils.js.map +1 -1
- package/dist/delegateEvent.js.map +1 -1
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/DialogContainer.d.ts +0 -2
- package/dist/dialog/DialogContainer.js +0 -2
- package/dist/dialog/DialogContainer.js.map +1 -1
- package/dist/dialog/DialogContent.d.ts +3 -3
- package/dist/dialog/DialogContent.js +3 -3
- package/dist/dialog/DialogContent.js.map +1 -1
- package/dist/dialog/DialogFooter.d.ts +2 -3
- package/dist/dialog/DialogFooter.js +2 -3
- package/dist/dialog/DialogFooter.js.map +1 -1
- package/dist/dialog/DialogHeader.d.ts +3 -3
- package/dist/dialog/DialogHeader.js +3 -3
- package/dist/dialog/DialogHeader.js.map +1 -1
- package/dist/dialog/DialogTitle.d.ts +3 -4
- package/dist/dialog/DialogTitle.js +3 -3
- package/dist/dialog/DialogTitle.js.map +1 -1
- package/dist/dialog/FixedDialog.js.map +1 -1
- package/dist/dialog/NestedDialogProvider.d.ts +0 -1
- package/dist/dialog/NestedDialogProvider.js.map +1 -1
- package/dist/dialog/styles.js.map +1 -1
- package/dist/divider/Divider.d.ts +0 -2
- package/dist/divider/Divider.js +0 -2
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/styles.js.map +1 -1
- package/dist/draggable/useDraggable.js.map +1 -1
- package/dist/draggable/utils.js.map +1 -1
- package/dist/expansion-panel/ExpansionList.d.ts +1 -1
- package/dist/expansion-panel/ExpansionList.js +1 -1
- package/dist/expansion-panel/ExpansionList.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanel.d.ts +8 -24
- package/dist/expansion-panel/ExpansionPanel.js +1 -12
- package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanelHeader.d.ts +0 -1
- package/dist/expansion-panel/ExpansionPanelHeader.js +0 -1
- package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
- package/dist/expansion-panel/expansionPanelStyles.d.ts +19 -0
- package/dist/expansion-panel/expansionPanelStyles.js +14 -0
- package/dist/expansion-panel/expansionPanelStyles.js.map +1 -0
- package/dist/expansion-panel/useExpansionList.js.map +1 -1
- package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
- package/dist/focus/useFocusContainer.js.map +1 -1
- package/dist/focus/utils.js.map +1 -1
- package/dist/form/Checkbox.d.ts +0 -1
- package/dist/form/Checkbox.js.map +1 -1
- package/dist/form/Fieldset.d.ts +0 -2
- package/dist/form/Fieldset.js.map +1 -1
- package/dist/form/FileInput.js.map +1 -1
- package/dist/form/Form.js.map +1 -1
- package/dist/form/FormMessage.d.ts +0 -3
- package/dist/form/FormMessage.js +0 -2
- package/dist/form/FormMessage.js.map +1 -1
- package/dist/form/FormMessageContainer.d.ts +0 -1
- package/dist/form/FormMessageContainer.js +0 -1
- package/dist/form/FormMessageContainer.js.map +1 -1
- package/dist/form/FormMessageCounter.d.ts +0 -2
- package/dist/form/FormMessageCounter.js +0 -2
- package/dist/form/FormMessageCounter.js.map +1 -1
- package/dist/form/InputToggle.js.map +1 -1
- package/dist/form/InputToggleIcon.d.ts +0 -2
- package/dist/form/InputToggleIcon.js +0 -2
- package/dist/form/InputToggleIcon.js.map +1 -1
- package/dist/form/Label.d.ts +0 -3
- package/dist/form/Label.js +0 -2
- package/dist/form/Label.js.map +1 -1
- package/dist/form/Legend.d.ts +0 -3
- package/dist/form/Legend.js +0 -2
- package/dist/form/Legend.js.map +1 -1
- package/dist/form/MenuItemCheckbox.d.ts +0 -1
- package/dist/form/MenuItemCheckbox.js.map +1 -1
- package/dist/form/MenuItemFileInput.js.map +1 -1
- package/dist/form/MenuItemInputToggle.js.map +1 -1
- package/dist/form/MenuItemRadio.d.ts +0 -1
- package/dist/form/MenuItemRadio.js.map +1 -1
- package/dist/form/MenuItemSwitch.d.ts +0 -1
- package/dist/form/MenuItemSwitch.js.map +1 -1
- package/dist/form/MenuItemTextField.js.map +1 -1
- package/dist/form/NativeSelect.d.ts +0 -2
- package/dist/form/NativeSelect.js +0 -2
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/OptGroup.js.map +1 -1
- package/dist/form/Option.js.map +1 -1
- package/dist/form/Password.js.map +1 -1
- package/dist/form/Radio.d.ts +0 -1
- package/dist/form/Radio.js.map +1 -1
- package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
- package/dist/form/Select.js.map +1 -1
- package/dist/form/SelectedOption.d.ts +0 -2
- package/dist/form/SelectedOption.js +0 -2
- package/dist/form/SelectedOption.js.map +1 -1
- package/dist/form/Slider.js.map +1 -1
- package/dist/form/SliderContainer.d.ts +0 -2
- package/dist/form/SliderContainer.js +0 -2
- package/dist/form/SliderContainer.js.map +1 -1
- package/dist/form/SliderMark.d.ts +0 -2
- package/dist/form/SliderMark.js +0 -2
- package/dist/form/SliderMark.js.map +1 -1
- package/dist/form/SliderMarkLabel.d.ts +0 -2
- package/dist/form/SliderMarkLabel.js +0 -2
- package/dist/form/SliderMarkLabel.js.map +1 -1
- package/dist/form/SliderThumb.js.map +1 -1
- package/dist/form/SliderTrack.d.ts +0 -2
- package/dist/form/SliderTrack.js +0 -2
- package/dist/form/SliderTrack.js.map +1 -1
- package/dist/form/SliderValueMarks.d.ts +0 -2
- package/dist/form/SliderValueMarks.js +0 -2
- package/dist/form/SliderValueMarks.js.map +1 -1
- package/dist/form/SliderValueTooltip.js.map +1 -1
- package/dist/form/Switch.d.ts +0 -2
- package/dist/form/Switch.js +0 -2
- package/dist/form/Switch.js.map +1 -1
- package/dist/form/SwitchTrack.d.ts +2 -1
- package/dist/form/SwitchTrack.js +2 -1
- package/dist/form/SwitchTrack.js.map +1 -1
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextField.d.ts +0 -2
- package/dist/form/TextField.js +0 -2
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/TextFieldAddon.d.ts +1 -4
- package/dist/form/TextFieldAddon.js +1 -3
- package/dist/form/TextFieldAddon.js.map +1 -1
- package/dist/form/TextFieldContainer.js.map +1 -1
- package/dist/form/fileUtils.js.map +1 -1
- package/dist/form/formConfig.js.map +1 -1
- package/dist/form/formMessageStyles.js.map +1 -1
- package/dist/form/inputToggleStyles.js.map +1 -1
- package/dist/form/menuItemInputToggleStyles.js.map +1 -1
- package/dist/form/nativeSelectStyles.js.map +1 -1
- package/dist/form/optionStyles.js.map +1 -1
- package/dist/form/passwordStyles.js.map +1 -1
- package/dist/form/selectStyles.js.map +1 -1
- package/dist/form/selectUtils.js.map +1 -1
- package/dist/form/sliderUtils.js.map +1 -1
- package/dist/form/switchStyles.js.map +1 -1
- package/dist/form/textAreaStyles.js.map +1 -1
- package/dist/form/textFieldContainerStyles.js.map +1 -1
- package/dist/form/textFieldStyles.js.map +1 -1
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCheckboxGroup.js.map +1 -1
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useEditableCombobox.js.map +1 -1
- package/dist/form/useFileUpload.js.map +1 -1
- package/dist/form/useFormReset.js.map +1 -1
- package/dist/form/useListboxProvider.js.map +1 -1
- package/dist/form/useNumberField.js.map +1 -1
- package/dist/form/useRadioGroup.js.map +1 -1
- package/dist/form/useRangeSlider.js.map +1 -1
- package/dist/form/useResizingTextArea.js.map +1 -1
- package/dist/form/useSelectCombobox.js.map +1 -1
- package/dist/form/useSlider.js.map +1 -1
- package/dist/form/useTextField.js.map +1 -1
- package/dist/form/useTextFieldContainerAddons.js.map +1 -1
- package/dist/form/utils.js.map +1 -1
- package/dist/form/validation.js.map +1 -1
- package/dist/hoverMode/useHoverMode.js.map +1 -1
- package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
- package/dist/icon/FontIcon.d.ts +10 -8
- package/dist/icon/FontIcon.js +1 -7
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/IconRotator.d.ts +0 -2
- package/dist/icon/IconRotator.js +0 -2
- package/dist/icon/IconRotator.js.map +1 -1
- package/dist/icon/MaterialIcon.d.ts +18 -3
- package/dist/icon/MaterialIcon.js +13 -3
- package/dist/icon/MaterialIcon.js.map +1 -1
- package/dist/icon/MaterialSymbol.d.ts +0 -1
- package/dist/icon/MaterialSymbol.js +0 -1
- package/dist/icon/MaterialSymbol.js.map +1 -1
- package/dist/icon/SVGIcon.d.ts +3 -2
- package/dist/icon/SVGIcon.js +0 -2
- package/dist/icon/SVGIcon.js.map +1 -1
- package/dist/icon/TextIconSpacing.d.ts +0 -2
- package/dist/icon/TextIconSpacing.js +0 -2
- package/dist/icon/TextIconSpacing.js.map +1 -1
- package/dist/icon/_icon.scss +2 -2
- package/dist/icon/iconConfig.d.ts +1 -0
- package/dist/icon/iconConfig.js +1 -0
- package/dist/icon/iconConfig.js.map +1 -1
- package/dist/icon/material.d.ts +1 -1
- package/dist/icon/material.js.map +1 -1
- package/dist/icon/materialConfig.js.map +1 -1
- package/dist/icon/styles.js +1 -1
- package/dist/icon/styles.js.map +1 -1
- package/dist/interaction/Ripple.js.map +1 -1
- package/dist/interaction/RippleContainer.d.ts +0 -2
- package/dist/interaction/RippleContainer.js +0 -2
- package/dist/interaction/RippleContainer.js.map +1 -1
- package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
- package/dist/interaction/config.js.map +1 -1
- package/dist/interaction/types.js.map +1 -1
- package/dist/interaction/useElementInteraction.js.map +1 -1
- package/dist/interaction/useHigherContrastChildren.js.map +1 -1
- package/dist/interaction/utils.js.map +1 -1
- package/dist/layout/LayoutAppBar.d.ts +0 -1
- package/dist/layout/LayoutAppBar.js.map +1 -1
- package/dist/layout/LayoutNav.js +1 -2
- package/dist/layout/LayoutNav.js.map +1 -1
- package/dist/layout/LayoutWindowSplitter.d.ts +0 -1
- package/dist/layout/LayoutWindowSplitter.js.map +1 -1
- package/dist/layout/Main.js.map +1 -1
- package/dist/layout/layoutNavStyles.js.map +1 -1
- package/dist/layout/layoutWindowSplitterStyles.js.map +1 -1
- package/dist/layout/mainStyles.js.map +1 -1
- package/dist/layout/useExpandableLayout.js.map +1 -1
- package/dist/layout/useHorizontalLayoutTransition.js +1 -1
- package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
- package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
- package/dist/layout/useLayoutTree.d.ts +2 -2
- package/dist/layout/useLayoutTree.js.map +1 -1
- package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
- package/dist/layout/useMainTabIndex.js.map +1 -1
- package/dist/layout/useResizableLayout.js.map +1 -1
- package/dist/layout/useTemporaryLayout.js.map +1 -1
- package/dist/link/Link.d.ts +2 -6
- package/dist/link/Link.js +1 -4
- package/dist/link/Link.js.map +1 -1
- package/dist/link/SkipToMainContent.d.ts +10 -3
- package/dist/link/SkipToMainContent.js +4 -1
- package/dist/link/SkipToMainContent.js.map +1 -1
- package/dist/link/styles.d.ts +2 -2
- package/dist/link/styles.js.map +1 -1
- package/dist/list/List.d.ts +0 -20
- package/dist/list/List.js +1 -14
- package/dist/list/List.js.map +1 -1
- package/dist/list/ListItem.d.ts +0 -16
- package/dist/list/ListItem.js.map +1 -1
- package/dist/list/ListItemAddon.d.ts +0 -2
- package/dist/list/ListItemAddon.js +0 -2
- package/dist/list/ListItemAddon.js.map +1 -1
- package/dist/list/ListItemChildren.d.ts +0 -2
- package/dist/list/ListItemChildren.js +0 -2
- package/dist/list/ListItemChildren.js.map +1 -1
- package/dist/list/ListItemLink.js.map +1 -1
- package/dist/list/ListItemText.d.ts +0 -2
- package/dist/list/ListItemText.js +0 -2
- package/dist/list/ListItemText.js.map +1 -1
- package/dist/list/ListSubheader.d.ts +3 -2
- package/dist/list/ListSubheader.js +0 -2
- package/dist/list/ListSubheader.js.map +1 -1
- package/dist/list/getListItemHeight.d.ts +2 -2
- package/dist/list/getListItemHeight.js +2 -2
- package/dist/list/getListItemHeight.js.map +1 -1
- package/dist/list/listItemStyles.d.ts +17 -1
- package/dist/list/listItemStyles.js.map +1 -1
- package/dist/list/listStyles.d.ts +18 -0
- package/dist/list/listStyles.js +14 -0
- package/dist/list/listStyles.js.map +1 -0
- package/dist/list/types.d.ts +9 -3
- package/dist/list/types.js +6 -1
- package/dist/list/types.js.map +1 -1
- package/dist/media-queries/AppSizeProvider.d.ts +8 -0
- package/dist/media-queries/AppSizeProvider.js +2 -0
- package/dist/media-queries/AppSizeProvider.js.map +1 -1
- package/dist/media-queries/appSize.d.ts +5 -5
- package/dist/media-queries/appSize.js.map +1 -1
- package/dist/media-queries/useMediaQuery.d.ts +1 -1
- package/dist/media-queries/useMediaQuery.js +1 -1
- package/dist/media-queries/useMediaQuery.js.map +1 -1
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuBar.d.ts +0 -1
- package/dist/menu/MenuBar.js.map +1 -1
- package/dist/menu/MenuButton.d.ts +0 -1
- package/dist/menu/MenuButton.js.map +1 -1
- package/dist/menu/MenuConfigurationProvider.js.map +1 -1
- package/dist/menu/MenuItem.d.ts +0 -1
- package/dist/menu/MenuItem.js.map +1 -1
- package/dist/menu/MenuItemButton.d.ts +0 -1
- package/dist/menu/MenuItemButton.js.map +1 -1
- package/dist/menu/MenuItemCircularProgress.js.map +1 -1
- package/dist/menu/MenuItemGroup.js.map +1 -1
- package/dist/menu/MenuItemSeparator.js.map +1 -1
- package/dist/menu/MenuSheet.js.map +1 -1
- package/dist/menu/MenuVisibilityProvider.js.map +1 -1
- package/dist/menu/MenuWidget.js.map +1 -1
- package/dist/menu/MenuWidgetKeyboardProvider.js.map +1 -1
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/menu/useMenuBarProvider.d.ts +0 -1
- package/dist/menu/useMenuBarProvider.js.map +1 -1
- package/dist/menu/utils.js.map +1 -1
- package/dist/movement/constants.js.map +1 -1
- package/dist/movement/findMatchIndex.js.map +1 -1
- package/dist/movement/types.js.map +1 -1
- package/dist/movement/useKeyboardMovementProvider.d.ts +0 -1
- package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
- package/dist/movement/utils.js.map +1 -1
- package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
- package/dist/navigation/DefaultNavigationRenderer.js.map +1 -1
- package/dist/navigation/NavGroup.d.ts +0 -2
- package/dist/navigation/NavGroup.js +0 -2
- package/dist/navigation/NavGroup.js.map +1 -1
- package/dist/navigation/NavItem.d.ts +0 -2
- package/dist/navigation/NavItem.js +0 -2
- package/dist/navigation/NavItem.js.map +1 -1
- package/dist/navigation/NavItemButton.js.map +1 -1
- package/dist/navigation/NavItemLink.js.map +1 -1
- package/dist/navigation/NavSubheader.d.ts +0 -3
- package/dist/navigation/NavSubheader.js +0 -2
- package/dist/navigation/NavSubheader.js.map +1 -1
- package/dist/navigation/Navigation.js.map +1 -1
- package/dist/navigation/getHrefFromParents.js.map +1 -1
- package/dist/navigation/navGroupStyles.js.map +1 -1
- package/dist/navigation/navItemStyles.js.map +1 -1
- package/dist/navigation/types.js.map +1 -1
- package/dist/navigation/useActiveHeadingId.js.map +1 -1
- package/dist/overlay/Overlay.d.ts +1 -0
- package/dist/overlay/Overlay.js.map +1 -1
- package/dist/overlay/overlayStyles.js.map +1 -1
- package/dist/portal/Portal.d.ts +4 -0
- package/dist/portal/Portal.js.map +1 -1
- package/dist/portal/PortalContainerProvider.d.ts +8 -3
- package/dist/portal/PortalContainerProvider.js +1 -0
- package/dist/portal/PortalContainerProvider.js.map +1 -1
- package/dist/positioning/constants.js.map +1 -1
- package/dist/positioning/createHorizontalPosition.js.map +1 -1
- package/dist/positioning/createVerticalPosition.js.map +1 -1
- package/dist/positioning/getFixedPosition.js.map +1 -1
- package/dist/positioning/types.js.map +1 -1
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/positioning/utils.js.map +1 -1
- package/dist/progress/CircularProgress.d.ts +5 -6
- package/dist/progress/CircularProgress.js +0 -2
- package/dist/progress/CircularProgress.js.map +1 -1
- package/dist/progress/LinearProgress.d.ts +0 -2
- package/dist/progress/LinearProgress.js +0 -2
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/progress/getProgressA11y.js.map +1 -1
- package/dist/progress/types.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemContainer.d.ts +0 -2
- package/dist/responsive-item/ResponsiveItemContainer.js +0 -2
- package/dist/responsive-item/ResponsiveItemContainer.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemOverlay.d.ts +0 -2
- package/dist/responsive-item/ResponsiveItemOverlay.js +0 -2
- package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
- package/dist/responsive-item/styles.js.map +1 -1
- package/dist/scroll/ScrollLock.js.map +1 -1
- package/dist/scroll/getScrollbarWidth.js.map +1 -1
- package/dist/scroll/useScrollLock.js.map +1 -1
- package/dist/searching/caseInsensitive.js.map +1 -1
- package/dist/searching/fuzzy.js.map +1 -1
- package/dist/searching/toSearchQuery.js.map +1 -1
- package/dist/searching/types.js.map +1 -1
- package/dist/searching/useFuzzyMatch.js.map +1 -1
- package/dist/searching/utils.js.map +1 -1
- package/dist/segmented-button/SegmentedButton.js.map +1 -1
- package/dist/segmented-button/SegmentedButtonContainer.d.ts +0 -2
- package/dist/segmented-button/SegmentedButtonContainer.js +0 -2
- package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
- package/dist/segmented-button/segmentedButtonContainerStyles.js.map +1 -1
- package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
- package/dist/sheet/Sheet.d.ts +30 -16
- package/dist/sheet/Sheet.js +24 -14
- package/dist/sheet/Sheet.js.map +1 -1
- package/dist/sheet/styles.d.ts +29 -0
- package/dist/sheet/styles.js +13 -0
- package/dist/sheet/styles.js.map +1 -1
- package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
- package/dist/snackbar/Snackbar.js.map +1 -1
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/snackbar/ToastActionButton.d.ts +0 -1
- package/dist/snackbar/ToastActionButton.js.map +1 -1
- package/dist/snackbar/ToastCloseButton.d.ts +0 -1
- package/dist/snackbar/ToastCloseButton.js.map +1 -1
- package/dist/snackbar/ToastContent.js.map +1 -1
- package/dist/snackbar/ToastManager.js.map +1 -1
- package/dist/snackbar/ToastManagerProvider.js.map +1 -1
- package/dist/snackbar/snackbarStyles.js.map +1 -1
- package/dist/snackbar/toastContentStyles.js.map +1 -1
- package/dist/snackbar/toastStyles.js.map +1 -1
- package/dist/snackbar/useCurrentToastActions.d.ts +0 -1
- package/dist/snackbar/useCurrentToastActions.js.map +1 -1
- package/dist/suspense/CircularProgressSuspense.d.ts +0 -2
- package/dist/suspense/CircularProgressSuspense.js +0 -2
- package/dist/suspense/CircularProgressSuspense.js.map +1 -1
- package/dist/suspense/NullSuspense.d.ts +0 -2
- package/dist/suspense/NullSuspense.js +0 -2
- package/dist/suspense/NullSuspense.js.map +1 -1
- package/dist/table/StickyTableSection.d.ts +23 -0
- package/dist/table/StickyTableSection.js +56 -0
- package/dist/table/StickyTableSection.js.map +1 -0
- package/dist/table/Table.d.ts +1 -1
- package/dist/table/Table.js.map +1 -1
- package/dist/table/TableBody.d.ts +1 -1
- package/dist/table/TableBody.js.map +1 -1
- package/dist/table/TableCell.d.ts +3 -2
- package/dist/table/TableCell.js.map +1 -1
- package/dist/table/TableCellContent.d.ts +1 -5
- package/dist/table/TableCellContent.js +0 -3
- package/dist/table/TableCellContent.js.map +1 -1
- package/dist/table/TableCheckbox.js.map +1 -1
- package/dist/table/TableConfigurationProvider.d.ts +1 -74
- package/dist/table/TableConfigurationProvider.js.map +1 -1
- package/dist/table/TableContainer.js.map +1 -1
- package/dist/table/TableContainerProvider.js.map +1 -1
- package/dist/table/TableFooter.d.ts +8 -17
- package/dist/table/TableFooter.js +17 -80
- package/dist/table/TableFooter.js.map +1 -1
- package/dist/table/TableHeader.d.ts +8 -17
- package/dist/table/TableHeader.js +20 -87
- package/dist/table/TableHeader.js.map +1 -1
- package/dist/table/TableRadio.js.map +1 -1
- package/dist/table/TableRow.d.ts +1 -1
- package/dist/table/TableRow.js.map +1 -1
- package/dist/table/tableCellStyles.d.ts +1 -1
- package/dist/table/tableCellStyles.js.map +1 -1
- package/dist/table/tableContainerStyles.js.map +1 -1
- package/dist/table/tableFooterStyles.js.map +1 -1
- package/dist/table/tableHeaderStyles.js.map +1 -1
- package/dist/table/tableRowStyles.js.map +1 -1
- package/dist/table/tableStyles.js.map +1 -1
- package/dist/table/types.d.ts +89 -9
- package/dist/table/types.js.map +1 -1
- package/dist/table/useStickyTableSection.d.ts +27 -0
- package/dist/table/useStickyTableSection.js +84 -0
- package/dist/table/useStickyTableSection.js.map +1 -0
- package/dist/table/useTableSectionConfig.d.ts +13 -0
- package/dist/table/useTableSectionConfig.js +33 -0
- package/dist/table/useTableSectionConfig.js.map +1 -0
- package/dist/tabs/Tab.d.ts +3 -0
- package/dist/tabs/Tab.js.map +1 -1
- package/dist/tabs/TabList.js.map +1 -1
- package/dist/tabs/TabListScrollButton.js +5 -1
- package/dist/tabs/TabListScrollButton.js.map +1 -1
- package/dist/tabs/_tabs.scss +21 -3
- package/dist/tabs/tabIndicatorStyles.js.map +1 -1
- package/dist/tabs/tabListScrollButtonStyles.d.ts +2 -0
- package/dist/tabs/tabListScrollButtonStyles.js +9 -5
- package/dist/tabs/tabListScrollButtonStyles.js.map +1 -1
- package/dist/tabs/tabListStyles.js.map +1 -1
- package/dist/tabs/tabStyles.js.map +1 -1
- package/dist/tabs/useTabList.d.ts +2 -0
- package/dist/tabs/useTabList.js +4 -2
- package/dist/tabs/useTabList.js.map +1 -1
- package/dist/tabs/useTabs.d.ts +33 -11
- package/dist/tabs/useTabs.js +9 -3
- package/dist/tabs/useTabs.js.map +1 -1
- package/dist/tabs/utils.js.map +1 -1
- package/dist/test-utils/IntersectionObserver.js.map +1 -1
- package/dist/test-utils/ResizeObserver.js.map +1 -1
- package/dist/test-utils/data-testid.d.ts +0 -1
- package/dist/test-utils/data-testid.js.map +1 -1
- package/dist/test-utils/index.js.map +1 -1
- package/dist/test-utils/jest-setup.js.map +1 -1
- package/dist/test-utils/matchMedia.js.map +1 -1
- package/dist/test-utils/polyfills/IntersectionObserver.js.map +1 -1
- package/dist/test-utils/polyfills/ResizeObserver.js.map +1 -1
- package/dist/test-utils/polyfills/TextDecoder.js.map +1 -1
- package/dist/test-utils/polyfills/TextEncoder.js.map +1 -1
- package/dist/test-utils/polyfills/index.js.map +1 -1
- package/dist/test-utils/polyfills/matchMedia.js.map +1 -1
- package/dist/test-utils/polyfills/offsetParent.js.map +1 -1
- package/dist/test-utils/polyfills/scrollIntoView.js.map +1 -1
- package/dist/test-utils/render.js.map +1 -1
- package/dist/test-utils/timers.js.map +1 -1
- package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/_theme.scss +2 -1
- package/dist/theme/colors.js.map +1 -1
- package/dist/theme/cssVars.js.map +1 -1
- package/dist/theme/types.js.map +1 -1
- package/dist/theme/useCSSVariables.js.map +1 -1
- package/dist/theme/useColorScheme.d.ts +0 -1
- package/dist/theme/useColorScheme.js.map +1 -1
- package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
- package/dist/theme/useColorSchemeProvider.js.map +1 -1
- package/dist/theme/usePrefersColorScheme.js.map +1 -1
- package/dist/theme/utils.js.map +1 -1
- package/dist/tooltip/Tooltip.d.ts +20 -9
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
- package/dist/tooltip/constants.js.map +1 -1
- package/dist/tooltip/tooltipStyles.js.map +1 -1
- package/dist/tooltip/useTooltip.d.ts +30 -16
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/tooltip/useTooltipPosition.d.ts +2 -4
- package/dist/tooltip/useTooltipPosition.js.map +1 -1
- package/dist/tooltip/utils.js.map +1 -1
- package/dist/transition/CSSTransition.js.map +1 -1
- package/dist/transition/Collapse.js.map +1 -1
- package/dist/transition/CrossFade.js.map +1 -1
- package/dist/transition/ScaleTransition.js.map +1 -1
- package/dist/transition/SkeletonPlaceholder.js.map +1 -1
- package/dist/transition/Slide.js.map +1 -1
- package/dist/transition/SlideContainer.d.ts +2 -48
- package/dist/transition/SlideContainer.js +2 -48
- package/dist/transition/SlideContainer.js.map +1 -1
- package/dist/transition/collapseStyles.js.map +1 -1
- package/dist/transition/config.js.map +1 -1
- package/dist/transition/maxWidthTransition.js.map +1 -1
- package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
- package/dist/transition/types.d.ts +19 -24
- package/dist/transition/types.js.map +1 -1
- package/dist/transition/useCSSTransition.js.map +1 -1
- package/dist/transition/useCarousel.js.map +1 -1
- package/dist/transition/useCollapseTransition.js.map +1 -1
- package/dist/transition/useCrossFadeTransition.js.map +1 -1
- package/dist/transition/useMaxWidthTransition.js.map +1 -1
- package/dist/transition/useScaleTransition.js.map +1 -1
- package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
- package/dist/transition/useSlideTransition.js.map +1 -1
- package/dist/transition/useTransition.d.ts +1 -0
- package/dist/transition/useTransition.js +1 -0
- package/dist/transition/useTransition.js.map +1 -1
- package/dist/transition/utils.js.map +1 -1
- package/dist/tree/DefaultTreeItemRenderer.d.ts +2 -3
- package/dist/tree/DefaultTreeItemRenderer.js +1 -1
- package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
- package/dist/tree/Tree.d.ts +3 -4
- package/dist/tree/Tree.js.map +1 -1
- package/dist/tree/TreeGroup.js.map +1 -1
- package/dist/tree/TreeItem.d.ts +10 -3
- package/dist/tree/TreeItem.js +5 -2
- package/dist/tree/TreeItem.js.map +1 -1
- package/dist/tree/TreeItemExpander.js.map +1 -1
- package/dist/tree/TreeProvider.js.map +1 -1
- package/dist/tree/styles.js.map +1 -1
- package/dist/tree/types.d.ts +11 -6
- package/dist/tree/types.js +1 -26
- package/dist/tree/types.js.map +1 -1
- package/dist/tree/useTree.d.ts +5 -5
- package/dist/tree/useTree.js.map +1 -1
- package/dist/tree/useTreeExpansion.d.ts +3 -3
- package/dist/tree/useTreeExpansion.js.map +1 -1
- package/dist/tree/useTreeItems.js.map +1 -1
- package/dist/tree/useTreeMovement.js.map +1 -1
- package/dist/tree/useTreeSelection.d.ts +3 -3
- package/dist/tree/useTreeSelection.js.map +1 -1
- package/dist/tree/utils.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typography/SrOnly.d.ts +2 -1
- package/dist/typography/SrOnly.js +2 -1
- package/dist/typography/SrOnly.js.map +1 -1
- package/dist/typography/TextContainer.d.ts +4 -2
- package/dist/typography/TextContainer.js +2 -2
- package/dist/typography/TextContainer.js.map +1 -1
- package/dist/typography/Typography.d.ts +10 -2
- package/dist/typography/Typography.js +3 -2
- package/dist/typography/Typography.js.map +1 -1
- package/dist/typography/WritingDirectionProvider.d.ts +2 -2
- package/dist/typography/WritingDirectionProvider.js +2 -2
- package/dist/typography/WritingDirectionProvider.js.map +1 -1
- package/dist/typography/textContainerStyles.js.map +1 -1
- package/dist/typography/typographyStyles.js.map +1 -1
- package/dist/useAsyncFunction.js.map +1 -1
- package/dist/useDebouncedFunction.js.map +1 -1
- package/dist/useDropzone.js.map +1 -1
- package/dist/useElementSize.js.map +1 -1
- package/dist/useEnsuredId.js.map +1 -1
- package/dist/useEnsuredRef.js.map +1 -1
- package/dist/useEnsuredState.js.map +1 -1
- package/dist/useHtmlClassName.js.map +1 -1
- package/dist/useIntersectionObserver.js.map +1 -1
- package/dist/useIsomorphicLayoutEffect.js.map +1 -1
- package/dist/useLocalStorage.js.map +1 -1
- package/dist/useMutationObserver.js.map +1 -1
- package/dist/useOrientation.js.map +1 -1
- package/dist/usePageInactive.js.map +1 -1
- package/dist/useResizeListener.d.ts +7 -1
- package/dist/useResizeListener.js.map +1 -1
- package/dist/useResizeObserver.d.ts +3 -3
- package/dist/useResizeObserver.js.map +1 -1
- package/dist/useThrottledFunction.js.map +1 -1
- package/dist/useToggle.d.ts +4 -4
- package/dist/useToggle.js +1 -1
- package/dist/useToggle.js.map +1 -1
- package/dist/useUnmounted.js.map +1 -1
- package/dist/useWindowSize.js.map +1 -1
- package/dist/utils/RenderRecursively.js.map +1 -1
- package/dist/utils/alphaNumericSort.js.map +1 -1
- package/dist/utils/applyRef.js.map +1 -1
- package/dist/utils/bem.js.map +1 -1
- package/dist/utils/getClientPosition.js.map +1 -1
- package/dist/utils/getMiddleOfRange.js.map +1 -1
- package/dist/utils/getPercentage.js.map +1 -1
- package/dist/utils/getRangeDefaultValue.js.map +1 -1
- package/dist/utils/getRangeSteps.js.map +1 -1
- package/dist/utils/identity.js.map +1 -1
- package/dist/utils/isElementVisible.js.map +1 -1
- package/dist/utils/loop.js.map +1 -1
- package/dist/utils/nearest.js.map +1 -1
- package/dist/utils/parseCssLengthUnit.js.map +1 -1
- package/dist/utils/randomInt.js.map +1 -1
- package/dist/utils/wait.js.map +1 -1
- package/dist/utils/withinRange.js.map +1 -1
- package/dist/window-splitter/WindowSplitter.d.ts +2 -2
- package/dist/window-splitter/WindowSplitter.js +2 -2
- package/dist/window-splitter/WindowSplitter.js.map +1 -1
- package/dist/window-splitter/useWindowSplitter.js.map +1 -1
- package/package.json +25 -24
- package/src/RootHtml.tsx +0 -2
- package/src/app-bar/AppBar.tsx +0 -2
- package/src/app-bar/AppBarTitle.tsx +8 -6
- package/src/autocomplete/defaults.ts +3 -3
- package/src/avatar/Avatar.tsx +1 -4
- package/src/badge/Badge.tsx +1 -3
- package/src/box/Box.tsx +0 -2
- package/src/button/ButtonUnstyled.tsx +0 -2
- package/src/card/Card.tsx +2 -3
- package/src/card/CardContent.tsx +0 -2
- package/src/card/CardFooter.tsx +0 -2
- package/src/card/CardHeader.tsx +0 -2
- package/src/card/CardSubtitle.tsx +9 -2
- package/src/card/CardTitle.tsx +0 -2
- package/src/card/styles.ts +2 -6
- package/src/chip/Chip.tsx +0 -2
- package/src/cssUtils.ts +1 -1
- package/src/dialog/DialogContainer.tsx +0 -2
- package/src/dialog/DialogContent.tsx +3 -3
- package/src/dialog/DialogFooter.tsx +2 -3
- package/src/dialog/DialogHeader.tsx +3 -3
- package/src/dialog/DialogTitle.tsx +3 -3
- package/src/divider/Divider.tsx +0 -2
- package/src/expansion-panel/ExpansionList.tsx +1 -1
- package/src/expansion-panel/ExpansionPanel.tsx +9 -38
- package/src/expansion-panel/ExpansionPanelHeader.tsx +0 -1
- package/src/expansion-panel/expansionPanelStyles.ts +33 -0
- package/src/form/Fieldset.tsx +0 -2
- package/src/form/FormMessage.tsx +0 -2
- package/src/form/FormMessageContainer.tsx +0 -1
- package/src/form/FormMessageCounter.tsx +0 -2
- package/src/form/InputToggle.tsx +1 -1
- package/src/form/InputToggleIcon.tsx +0 -2
- package/src/form/Label.tsx +0 -2
- package/src/form/Legend.tsx +0 -2
- package/src/form/NativeSelect.tsx +0 -2
- package/src/form/Option.tsx +1 -1
- package/src/form/SelectedOption.tsx +0 -2
- package/src/form/SliderContainer.tsx +0 -2
- package/src/form/SliderMark.tsx +0 -2
- package/src/form/SliderMarkLabel.tsx +0 -2
- package/src/form/SliderTrack.tsx +0 -2
- package/src/form/SliderValueMarks.tsx +0 -2
- package/src/form/Switch.tsx +0 -2
- package/src/form/SwitchTrack.tsx +2 -1
- package/src/form/TextField.tsx +0 -2
- package/src/form/TextFieldAddon.tsx +1 -3
- package/src/icon/FontIcon.tsx +19 -11
- package/src/icon/IconRotator.tsx +0 -2
- package/src/icon/MaterialIcon.tsx +22 -5
- package/src/icon/MaterialSymbol.tsx +0 -1
- package/src/icon/SVGIcon.tsx +3 -2
- package/src/icon/TextIconSpacing.tsx +0 -2
- package/src/icon/iconConfig.tsx +1 -0
- package/src/icon/material.ts +276 -19
- package/src/icon/styles.ts +1 -1
- package/src/interaction/RippleContainer.tsx +0 -2
- package/src/layout/LayoutNav.tsx +3 -2
- package/src/layout/useHorizontalLayoutTransition.ts +1 -1
- package/src/layout/useLayoutTree.ts +2 -2
- package/src/link/Link.tsx +2 -6
- package/src/link/SkipToMainContent.tsx +11 -4
- package/src/link/styles.ts +2 -2
- package/src/list/List.tsx +1 -33
- package/src/list/ListItem.tsx +0 -17
- package/src/list/ListItemAddon.tsx +0 -2
- package/src/list/ListItemChildren.tsx +0 -2
- package/src/list/ListItemText.tsx +0 -2
- package/src/list/ListSubheader.tsx +3 -2
- package/src/list/getListItemHeight.ts +2 -2
- package/src/list/listItemStyles.ts +21 -4
- package/src/list/listStyles.ts +31 -0
- package/src/list/types.ts +9 -3
- package/src/media-queries/AppSizeProvider.tsx +8 -0
- package/src/media-queries/useMediaQuery.ts +1 -1
- package/src/menu/MenuConfigurationProvider.tsx +2 -2
- package/src/navigation/NavGroup.tsx +0 -2
- package/src/navigation/NavItem.tsx +0 -2
- package/src/navigation/NavSubheader.tsx +0 -2
- package/src/overlay/Overlay.tsx +1 -0
- package/src/portal/Portal.tsx +5 -0
- package/src/portal/PortalContainerProvider.tsx +16 -7
- package/src/progress/CircularProgress.tsx +5 -6
- package/src/progress/LinearProgress.tsx +0 -2
- package/src/responsive-item/ResponsiveItemContainer.tsx +0 -2
- package/src/responsive-item/ResponsiveItemOverlay.tsx +0 -2
- package/src/segmented-button/SegmentedButtonContainer.tsx +0 -2
- package/src/sheet/Sheet.tsx +36 -33
- package/src/sheet/styles.ts +50 -0
- package/src/suspense/CircularProgressSuspense.tsx +0 -2
- package/src/suspense/NullSuspense.tsx +0 -2
- package/src/table/StickyTableSection.tsx +91 -0
- package/src/table/Table.tsx +2 -5
- package/src/table/TableBody.tsx +1 -2
- package/src/table/TableCell.tsx +3 -5
- package/src/table/TableCellContent.tsx +1 -6
- package/src/table/TableConfigurationProvider.tsx +1 -86
- package/src/table/TableFooter.tsx +19 -116
- package/src/table/TableHeader.tsx +20 -118
- package/src/table/TableRow.tsx +2 -4
- package/src/table/tableCellStyles.ts +1 -1
- package/src/table/types.ts +105 -10
- package/src/table/useStickyTableSection.tsx +126 -0
- package/src/table/useTableSectionConfig.ts +45 -0
- package/src/tabs/Tab.tsx +3 -0
- package/src/tabs/TabListScrollButton.tsx +9 -2
- package/src/tabs/tabListScrollButtonStyles.ts +9 -5
- package/src/tabs/useTabList.ts +4 -0
- package/src/tabs/useTabs.ts +61 -14
- package/src/test-utils/IntersectionObserver.ts +1 -1
- package/src/tooltip/Tooltip.tsx +24 -8
- package/src/tooltip/useTooltip.ts +52 -27
- package/src/tooltip/useTooltipPosition.ts +2 -4
- package/src/transition/SlideContainer.tsx +2 -48
- package/src/transition/types.ts +23 -27
- package/src/transition/useTransition.ts +1 -0
- package/src/tree/DefaultTreeItemRenderer.tsx +3 -4
- package/src/tree/Tree.tsx +4 -6
- package/src/tree/TreeItem.tsx +11 -4
- package/src/tree/types.ts +16 -6
- package/src/tree/useTree.ts +5 -7
- package/src/tree/useTreeExpansion.ts +3 -3
- package/src/tree/useTreeSelection.ts +3 -3
- package/src/typography/SrOnly.tsx +2 -1
- package/src/typography/TextContainer.tsx +4 -2
- package/src/typography/Typography.tsx +10 -2
- package/src/typography/WritingDirectionProvider.tsx +2 -2
- package/src/useResizeListener.ts +8 -2
- package/src/useResizeObserver.ts +3 -3
- package/src/useToggle.ts +4 -4
- package/src/window-splitter/WindowSplitter.tsx +2 -2
- package/.eslintrc.cjs +0 -26
- package/.stylelintrc.json +0 -14
- package/.swcrc +0 -17
- package/.turbo/turbo-build.log +0 -22
- package/.turbo/turbo-lint.log +0 -12
- package/.turbo/turbo-test.log +0 -5498
- package/.turbo/turbo-typecheck.log +0 -26
- package/CHANGELOG.md +0 -310
- package/coverage/clover.xml +0 -775
- package/coverage/coverage-final.json +0 -5
- package/coverage/lcov-report/autocomplete/Autocomplete.tsx.html +0 -967
- package/coverage/lcov-report/autocomplete/index.html +0 -116
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/button/Button.tsx.html +0 -676
- package/coverage/lcov-report/button/index.html +0 -116
- package/coverage/lcov-report/createHorizontalPosition.ts.html +0 -1075
- package/coverage/lcov-report/createVerticalPosition.ts.html +0 -997
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -161
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/searching/fuzzy.ts.html +0 -607
- package/coverage/lcov-report/searching/index.html +0 -116
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/typography/SrOnly.tsx.html +0 -325
- package/coverage/lcov-report/typography/index.html +0 -116
- package/coverage/lcov-report/utils.ts.html +0 -1225
- package/coverage/lcov.info +0 -836
- package/jest.config.ts +0 -68
- package/jest.setup.ts +0 -3
- package/scripts/copySassFiles.ts +0 -70
- package/scripts/tsconfig.json +0 -18
- package/src/__tests__/NoSsr.node.tsx +0 -26
- package/src/__tests__/NoSsr.tsx +0 -89
- package/src/__tests__/RootHtml.node.tsx +0 -46
- package/src/__tests__/__snapshots__/RootHtml.node.tsx.snap +0 -19
- package/src/__tests__/useAsyncFunction.tsx +0 -124
- package/src/__tests__/useDebouncedFunction.tsx +0 -108
- package/src/__tests__/useDropzone.tsx +0 -131
- package/src/__tests__/useElementSize.tsx +0 -181
- package/src/__tests__/useEnsuredId.tsx +0 -25
- package/src/__tests__/useEnsuredState.tsx +0 -74
- package/src/__tests__/useHtmlClassName.tsx +0 -54
- package/src/__tests__/useLocalStorage.tsx +0 -377
- package/src/__tests__/useOrientation.node.tsx +0 -20
- package/src/__tests__/useOrientation.tsx +0 -63
- package/src/__tests__/useResizeObserver.tsx +0 -258
- package/src/__tests__/useThrottledFunction.tsx +0 -226
- package/src/__tests__/useToggle.tsx +0 -78
- package/src/__tests__/useWindowSize.node.tsx +0 -56
- package/src/__tests__/useWindowSize.tsx +0 -155
- package/src/_box-shadows.scss +0 -219
- package/src/_core.scss +0 -432
- package/src/_utils.scss +0 -348
- package/src/app-bar/__tests__/AppBar.tsx +0 -121
- package/src/app-bar/__tests__/AppBarTitle.tsx +0 -39
- package/src/app-bar/__tests__/__snapshots__/AppBar.tsx.snap +0 -186
- package/src/app-bar/__tests__/__snapshots__/AppBarTitle.tsx.snap +0 -47
- package/src/app-bar/_app-bar.scss +0 -248
- package/src/autocomplete/__tests__/Autocomplete.tsx +0 -458
- package/src/autocomplete/__tests__/__snapshots__/Autocomplete.tsx.snap +0 -144
- package/src/autocomplete/_autocomplete.scss +0 -75
- package/src/avatar/__tests__/Avatar.tsx +0 -75
- package/src/avatar/__tests__/__snapshots__/Avatar.tsx.snap +0 -73
- package/src/avatar/_avatar.scss +0 -157
- package/src/badge/__tests__/Badge.tsx +0 -42
- package/src/badge/__tests__/__snapshots__/Badge.tsx.snap +0 -54
- package/src/badge/_badge.scss +0 -145
- package/src/box/__tests__/Box.tsx +0 -158
- package/src/box/__tests__/__snapshots__/Box.tsx.snap +0 -544
- package/src/box/_box.scss +0 -168
- package/src/button/__tests__/AsyncButton.tsx +0 -211
- package/src/button/__tests__/Button.tsx +0 -198
- package/src/button/__tests__/ButtonUnstyled.tsx +0 -37
- package/src/button/__tests__/TooltippedButton.tsx +0 -60
- package/src/button/__tests__/__snapshots__/AsyncButton.tsx.snap +0 -418
- package/src/button/__tests__/__snapshots__/Button.tsx.snap +0 -573
- package/src/button/__tests__/__snapshots__/ButtonUnstyled.tsx.snap +0 -22
- package/src/button/__tests__/__snapshots__/TooltippedButton.tsx.snap +0 -26
- package/src/button/__tests__/__snapshots__/buttonStyles.ts.snap +0 -11
- package/src/button/__tests__/buttonStyles.ts +0 -15
- package/src/button/_button.scss +0 -330
- package/src/card/__tests__/Card.tsx +0 -37
- package/src/card/__tests__/CardContent.tsx +0 -40
- package/src/card/__tests__/CardFooter.tsx +0 -34
- package/src/card/__tests__/CardHeader.tsx +0 -66
- package/src/card/__tests__/CardSubtitle.tsx +0 -30
- package/src/card/__tests__/CardTitle.tsx +0 -30
- package/src/card/__tests__/ClickableCard.tsx +0 -66
- package/src/card/__tests__/__snapshots__/Card.tsx.snap +0 -40
- package/src/card/__tests__/__snapshots__/CardContent.tsx.snap +0 -50
- package/src/card/__tests__/__snapshots__/CardFooter.tsx.snap +0 -30
- package/src/card/__tests__/__snapshots__/CardHeader.tsx.snap +0 -74
- package/src/card/__tests__/__snapshots__/CardSubtitle.tsx.snap +0 -18
- package/src/card/__tests__/__snapshots__/CardTitle.tsx.snap +0 -18
- package/src/card/__tests__/__snapshots__/ClickableCard.tsx.snap +0 -20
- package/src/card/__tests__/__snapshots__/styles.ts.snap +0 -13
- package/src/card/__tests__/styles.ts +0 -45
- package/src/card/_card.scss +0 -189
- package/src/chip/__tests__/Chip.tsx +0 -327
- package/src/chip/__tests__/__snapshots__/Chip.tsx.snap +0 -597
- package/src/chip/__tests__/__snapshots__/styles.ts.snap +0 -5
- package/src/chip/__tests__/styles.ts +0 -14
- package/src/chip/_chip.scss +0 -324
- package/src/dialog/__tests__/Dialog.tsx +0 -316
- package/src/dialog/__tests__/DialogContent.tsx +0 -53
- package/src/dialog/__tests__/DialogFooter.tsx +0 -70
- package/src/dialog/__tests__/DialogHeader.tsx +0 -37
- package/src/dialog/__tests__/DialogTitle.tsx +0 -41
- package/src/dialog/__tests__/__snapshots__/Dialog.tsx.snap +0 -84
- package/src/dialog/__tests__/__snapshots__/DialogContent.tsx.snap +0 -36
- package/src/dialog/__tests__/__snapshots__/DialogFooter.tsx.snap +0 -186
- package/src/dialog/__tests__/__snapshots__/DialogHeader.tsx.snap +0 -18
- package/src/dialog/__tests__/__snapshots__/DialogTitle.tsx.snap +0 -26
- package/src/dialog/_dialog.scss +0 -273
- package/src/divider/__tests__/Divider.tsx +0 -36
- package/src/divider/__tests__/__snapshots__/Divider.tsx.snap +0 -26
- package/src/divider/_divider.scss +0 -124
- package/src/draggable/__tests__/__snapshots__/useDraggable.tsx.snap +0 -49
- package/src/draggable/__tests__/useDraggable.tsx +0 -540
- package/src/draggable/_draggable.scss +0 -29
- package/src/expansion-panel/__tests__/ExpansionPanel.tsx +0 -290
- package/src/expansion-panel/__tests__/__snapshots__/ExpansionPanel.tsx.snap +0 -197
- package/src/expansion-panel/_expansion-panel.scss +0 -107
- package/src/focus/__tests__/useFocusContainer.tsx +0 -280
- package/src/form/__tests__/Checkbox.tsx +0 -42
- package/src/form/__tests__/Fieldset.tsx +0 -44
- package/src/form/__tests__/FileInput.tsx +0 -120
- package/src/form/__tests__/Label.tsx +0 -69
- package/src/form/__tests__/Legend.tsx +0 -34
- package/src/form/__tests__/MenuItemCheckbox.tsx +0 -53
- package/src/form/__tests__/MenuItemRadio.tsx +0 -53
- package/src/form/__tests__/Radio.tsx +0 -35
- package/src/form/__tests__/Select.tsx +0 -439
- package/src/form/__tests__/Switch.tsx +0 -152
- package/src/form/__tests__/TextArea.tsx +0 -433
- package/src/form/__tests__/TextField.tsx +0 -195
- package/src/form/__tests__/__snapshots__/Checkbox.tsx.snap +0 -99
- package/src/form/__tests__/__snapshots__/Fieldset.tsx.snap +0 -58
- package/src/form/__tests__/__snapshots__/FileInput.tsx.snap +0 -612
- package/src/form/__tests__/__snapshots__/Label.tsx.snap +0 -140
- package/src/form/__tests__/__snapshots__/Legend.tsx.snap +0 -30
- package/src/form/__tests__/__snapshots__/MenuItemCheckbox.tsx.snap +0 -96
- package/src/form/__tests__/__snapshots__/MenuItemRadio.tsx.snap +0 -96
- package/src/form/__tests__/__snapshots__/Radio.tsx.snap +0 -99
- package/src/form/__tests__/__snapshots__/Select.tsx.snap +0 -492
- package/src/form/__tests__/__snapshots__/Switch.tsx.snap +0 -428
- package/src/form/__tests__/__snapshots__/TextArea.tsx.snap +0 -548
- package/src/form/__tests__/__snapshots__/TextField.tsx.snap +0 -279
- package/src/form/__tests__/__snapshots__/useCheckboxGroup.tsx.snap +0 -481
- package/src/form/__tests__/__snapshots__/useRadioGroup.tsx.snap +0 -704
- package/src/form/__tests__/useCheckboxGroup.tsx +0 -292
- package/src/form/__tests__/useFileUpload.tsx +0 -289
- package/src/form/__tests__/useFormReset.tsx +0 -194
- package/src/form/__tests__/useRadioGroup.tsx +0 -227
- package/src/form/__tests__/utils.ts +0 -247
- package/src/form/_form.scss +0 -2190
- package/src/icon/__tests__/FontIcon.tsx +0 -45
- package/src/icon/__tests__/IconRotator.tsx +0 -120
- package/src/icon/__tests__/MaterialIcon.tsx +0 -79
- package/src/icon/__tests__/MaterialSymbol.tsx +0 -100
- package/src/icon/__tests__/SVGIcon.tsx +0 -40
- package/src/icon/__tests__/TextIconSpacing.tsx +0 -108
- package/src/icon/__tests__/__snapshots__/FontIcon.tsx.snap +0 -35
- package/src/icon/__tests__/__snapshots__/IconRotator.tsx.snap +0 -165
- package/src/icon/__tests__/__snapshots__/MaterialIcon.tsx.snap +0 -82
- package/src/icon/__tests__/__snapshots__/MaterialSymbol.tsx.snap +0 -42
- package/src/icon/__tests__/__snapshots__/SVGIcon.tsx.snap +0 -47
- package/src/icon/__tests__/__snapshots__/TextIconSpacing.tsx.snap +0 -101
- package/src/icon/__tests__/__snapshots__/styles.ts.snap +0 -29
- package/src/icon/__tests__/styles.ts +0 -28
- package/src/icon/_icon.scss +0 -213
- package/src/interaction/__tests__/UserInteractionModeProvider.tsx +0 -121
- package/src/interaction/__tests__/__snapshots__/useHigherContrastChildren.tsx.snap +0 -79
- package/src/interaction/__tests__/useHigherContrastChildren.tsx +0 -97
- package/src/interaction/_interaction.scss +0 -436
- package/src/layout/__tests__/LayoutAppBar.tsx +0 -117
- package/src/layout/__tests__/LayoutNav.tsx +0 -78
- package/src/layout/__tests__/LayoutWindowSplitter.tsx +0 -63
- package/src/layout/__tests__/Main.tsx +0 -51
- package/src/layout/__tests__/__snapshots__/LayoutAppBar.tsx.snap +0 -78
- package/src/layout/__tests__/__snapshots__/LayoutNav.tsx.snap +0 -31
- package/src/layout/__tests__/__snapshots__/LayoutWindowSplitter.tsx.snap +0 -60
- package/src/layout/__tests__/__snapshots__/Main.tsx.snap +0 -32
- package/src/layout/__tests__/__snapshots__/useExpandableLayout.tsx.snap +0 -116
- package/src/layout/__tests__/__snapshots__/useLayoutTree.tsx.snap +0 -676
- package/src/layout/__tests__/__snapshots__/useResizableLayout.tsx.snap +0 -95
- package/src/layout/__tests__/__snapshots__/useTemporaryLayout.tsx.snap +0 -141
- package/src/layout/__tests__/useExpandableLayout.tsx +0 -279
- package/src/layout/__tests__/useLayoutTree.tsx +0 -212
- package/src/layout/__tests__/useResizableLayout.tsx +0 -170
- package/src/layout/__tests__/useTemporaryLayout.tsx +0 -109
- package/src/layout/_layout.scss +0 -163
- package/src/link/__tests__/Link.tsx +0 -31
- package/src/link/__tests__/SkipToMainContent.tsx +0 -125
- package/src/link/__tests__/__snapshots__/Link.tsx.snap +0 -20
- package/src/link/__tests__/__snapshots__/SkipToMainContent.tsx.snap +0 -22
- package/src/link/_link.scss +0 -149
- package/src/list/__tests__/List.tsx +0 -58
- package/src/list/__tests__/ListItem.tsx +0 -280
- package/src/list/__tests__/ListItemLink.tsx +0 -89
- package/src/list/__tests__/ListSubheader.tsx +0 -81
- package/src/list/__tests__/__snapshots__/List.tsx.snap +0 -41
- package/src/list/__tests__/__snapshots__/ListItem.tsx.snap +0 -414
- package/src/list/__tests__/__snapshots__/ListItemLink.tsx.snap +0 -73
- package/src/list/__tests__/__snapshots__/ListSubheader.tsx.snap +0 -99
- package/src/list/__tests__/getListItemHeight.ts +0 -176
- package/src/list/_list.scss +0 -322
- package/src/media-queries/__tests__/AppSizeProvider.node.tsx +0 -37
- package/src/media-queries/__tests__/AppSizeProvider.tsx +0 -119
- package/src/media-queries/__tests__/useMediaQuery.node.tsx +0 -20
- package/src/media-queries/__tests__/useMediaQuery.tsx +0 -59
- package/src/media-queries/_media-queries.scss +0 -63
- package/src/menu/__tests__/DropdownMenu.tsx +0 -627
- package/src/menu/__tests__/MenuBar.tsx +0 -354
- package/src/menu/__tests__/MenuItemCircularProgress.tsx +0 -39
- package/src/menu/__tests__/MenuVisibilityProvider.tsx +0 -34
- package/src/menu/__tests__/__snapshots__/DropdownMenu.tsx.snap +0 -292
- package/src/menu/__tests__/__snapshots__/MenuBar.tsx.snap +0 -87
- package/src/menu/__tests__/__snapshots__/MenuItemCircularProgress.tsx.snap +0 -68
- package/src/menu/__tests__/__snapshots__/useContextMenu.tsx.snap +0 -54
- package/src/menu/__tests__/useContextMenu.tsx +0 -41
- package/src/menu/__tests__/utils.ts +0 -121
- package/src/menu/_menu.scss +0 -116
- package/src/movement/__tests__/findMatchIndex.ts +0 -244
- package/src/movement/__tests__/utils.ts +0 -710
- package/src/navigation/__tests__/Navigation.tsx +0 -97
- package/src/navigation/__tests__/__snapshots__/Navigation.tsx.snap +0 -165
- package/src/navigation/_navigation.scss +0 -99
- package/src/overlay/__tests__/Overlay.tsx +0 -198
- package/src/overlay/__tests__/__snapshots__/Overlay.tsx.snap +0 -77
- package/src/overlay/_overlay.scss +0 -74
- package/src/portal/__tests__/PortalContainerProvider.node.tsx +0 -26
- package/src/portal/__tests__/PortalContainerProvider.tsx +0 -84
- package/src/positioning/__tests__/__snapshots__/useFixedPositioning.tsx.snap +0 -87
- package/src/positioning/__tests__/createHorizontalPosition.ts +0 -777
- package/src/positioning/__tests__/createVerticalPosition.ts +0 -464
- package/src/positioning/__tests__/useFixedPositioning.tsx +0 -205
- package/src/positioning/__tests__/utils.ts +0 -1311
- package/src/progress/__tests__/CircularProgress.tsx +0 -153
- package/src/progress/__tests__/LinearProgress.tsx +0 -131
- package/src/progress/__tests__/__snapshots__/CircularProgress.tsx.snap +0 -499
- package/src/progress/__tests__/__snapshots__/LinearProgress.tsx.snap +0 -321
- package/src/progress/__tests__/getProgressA11y.ts +0 -16
- package/src/progress/_progress.scss +0 -577
- package/src/responsive-item/__tests__/ResponsiveItemContainer.tsx +0 -56
- package/src/responsive-item/__tests__/ResponsiveItemOverlay.tsx +0 -66
- package/src/responsive-item/__tests__/__snapshots__/ResponsiveItemContainer.tsx.snap +0 -85
- package/src/responsive-item/__tests__/__snapshots__/ResponsiveItemOverlay.tsx.snap +0 -151
- package/src/responsive-item/__tests__/__snapshots__/styles.ts.snap +0 -9
- package/src/responsive-item/__tests__/styles.ts +0 -32
- package/src/responsive-item/_responsive-item.scss +0 -199
- package/src/searching/__tests__/caseInsensitive.ts +0 -165
- package/src/searching/__tests__/fuzzy.ts +0 -169
- package/src/searching/__tests__/toSearchQuery.ts +0 -21
- package/src/searching/__tests__/useFuzzyMatch.tsx +0 -200
- package/src/segmented-button/__tests__/SegmentedButton.tsx +0 -61
- package/src/segmented-button/__tests__/SegmentedButtonContainer.tsx +0 -38
- package/src/segmented-button/__tests__/__snapshots__/SegmentedButton.tsx.snap +0 -116
- package/src/segmented-button/__tests__/__snapshots__/SegmentedButtonContainer.tsx.snap +0 -22
- package/src/segmented-button/_segmented-button.scss +0 -208
- package/src/sheet/_sheet.scss +0 -189
- package/src/snackbar/__tests__/Snackbar.tsx +0 -85
- package/src/snackbar/__tests__/Toast.tsx +0 -105
- package/src/snackbar/__tests__/ToastActionButton.tsx +0 -112
- package/src/snackbar/__tests__/ToastCloseButton.tsx +0 -140
- package/src/snackbar/__tests__/ToastContent.tsx +0 -88
- package/src/snackbar/__tests__/ToastManagerProvider.tsx +0 -852
- package/src/snackbar/__tests__/__snapshots__/Snackbar.tsx.snap +0 -176
- package/src/snackbar/__tests__/__snapshots__/Toast.tsx.snap +0 -52
- package/src/snackbar/__tests__/__snapshots__/ToastActionButton.tsx.snap +0 -36
- package/src/snackbar/__tests__/__snapshots__/ToastCloseButton.tsx.snap +0 -104
- package/src/snackbar/__tests__/__snapshots__/ToastContent.tsx.snap +0 -26
- package/src/snackbar/__tests__/__snapshots__/ToastManagerProvider.tsx.snap +0 -290
- package/src/snackbar/_snackbar.scss +0 -266
- package/src/suspense/__tests__/CircularProgressSuspense.tsx +0 -90
- package/src/suspense/__tests__/NullSuspense.tsx +0 -46
- package/src/suspense/__tests__/__snapshots__/CircularProgressSuspense.tsx.snap +0 -24
- package/src/table/__tests__/Table.tsx +0 -314
- package/src/table/__tests__/TableBody.tsx +0 -52
- package/src/table/__tests__/TableCheckbox.tsx +0 -89
- package/src/table/__tests__/TableContainer.tsx +0 -31
- package/src/table/__tests__/TableRadio.tsx +0 -112
- package/src/table/__tests__/TableRow.tsx +0 -63
- package/src/table/__tests__/__snapshots__/Table.tsx.snap +0 -2426
- package/src/table/__tests__/__snapshots__/TableBody.tsx.snap +0 -54
- package/src/table/__tests__/__snapshots__/TableCheckbox.tsx.snap +0 -142
- package/src/table/__tests__/__snapshots__/TableContainer.tsx.snap +0 -16
- package/src/table/__tests__/__snapshots__/TableRadio.tsx.snap +0 -138
- package/src/table/__tests__/__snapshots__/TableRow.tsx.snap +0 -56
- package/src/table/__tests__/__snapshots__/tableContainerStyles.ts.snap +0 -3
- package/src/table/__tests__/__snapshots__/tableRowStyles.ts.snap +0 -3
- package/src/table/__tests__/__snapshots__/tableStyles.ts.snap +0 -3
- package/src/table/__tests__/tableContainerStyles.ts +0 -8
- package/src/table/__tests__/tableRowStyles.ts +0 -8
- package/src/table/__tests__/tableStyles.ts +0 -8
- package/src/table/_table.scss +0 -447
- package/src/tabs/__tests__/Tab.tsx +0 -51
- package/src/tabs/__tests__/TabList.tsx +0 -640
- package/src/tabs/__tests__/__snapshots__/Tab.tsx.snap +0 -85
- package/src/tabs/__tests__/__snapshots__/TabList.tsx.snap +0 -51
- package/src/tabs/__tests__/useTabs.tsx +0 -212
- package/src/tabs/_tabs.scss +0 -273
- package/src/test-utils/__tests__/ResizeObserver.ts +0 -171
- package/src/theme/__tests__/LocalStorageColorSchemeProvider.tsx +0 -162
- package/src/theme/__tests__/ThemeProvider.tsx +0 -90
- package/src/theme/__tests__/__snapshots__/useCSSVariables.tsx.snap +0 -27
- package/src/theme/__tests__/__snapshots__/useColorSchemeMetaTag.tsx.snap +0 -15
- package/src/theme/__tests__/useCSSVariables.tsx +0 -177
- package/src/theme/__tests__/useColorSchemeMetaTag.tsx +0 -36
- package/src/theme/__tests__/utils.ts +0 -67
- package/src/theme/_a11y.scss +0 -114
- package/src/theme/_colors.scss +0 -1057
- package/src/theme/_theme.scss +0 -519
- package/src/tooltip/__tests__/Tooltip.tsx +0 -501
- package/src/tooltip/__tests__/TooltipHoverModeProvider.tsx +0 -94
- package/src/tooltip/__tests__/__snapshots__/Tooltip.tsx.snap +0 -34
- package/src/tooltip/__tests__/utils.ts +0 -94
- package/src/tooltip/_tooltip.scss +0 -155
- package/src/transition/__tests__/CSSTransition.tsx +0 -182
- package/src/transition/__tests__/Collapse.tsx +0 -209
- package/src/transition/__tests__/CrossFade.tsx +0 -227
- package/src/transition/__tests__/ScaleTransition.tsx +0 -204
- package/src/transition/__tests__/SkeletonPlaceholder.tsx +0 -72
- package/src/transition/__tests__/__snapshots__/CSSTransition.tsx.snap +0 -145
- package/src/transition/__tests__/__snapshots__/Collapse.tsx.snap +0 -224
- package/src/transition/__tests__/__snapshots__/CrossFade.tsx.snap +0 -240
- package/src/transition/__tests__/__snapshots__/ScaleTransition.tsx.snap +0 -239
- package/src/transition/__tests__/__snapshots__/SkeletonPlaceholder.tsx.snap +0 -24
- package/src/transition/__tests__/__snapshots__/useCollapseTransition.tsx.snap +0 -361
- package/src/transition/__tests__/__snapshots__/useCrossFadeTransition.tsx.snap +0 -258
- package/src/transition/__tests__/__snapshots__/useMaxWidthTransition.tsx.snap +0 -68
- package/src/transition/__tests__/__snapshots__/useScaleTransition.tsx.snap +0 -209
- package/src/transition/__tests__/useCSSTransition.tsx +0 -190
- package/src/transition/__tests__/useCollapseTransition.tsx +0 -316
- package/src/transition/__tests__/useCrossFadeTransition.tsx +0 -229
- package/src/transition/__tests__/useMaxWidthTransition.tsx +0 -123
- package/src/transition/__tests__/useScaleTransition.tsx +0 -212
- package/src/transition/__tests__/useTransition.tsx +0 -569
- package/src/transition/__tests__/utils.ts +0 -620
- package/src/transition/_transition.scss +0 -365
- package/src/tree/__tests__/Tree.tsx +0 -735
- package/src/tree/__tests__/TreeGroup.tsx +0 -76
- package/src/tree/__tests__/TreeItemExpander.tsx +0 -74
- package/src/tree/__tests__/__snapshots__/Tree.tsx.snap +0 -3618
- package/src/tree/__tests__/__snapshots__/TreeItemExpander.tsx.snap +0 -11
- package/src/tree/__tests__/utils.ts +0 -98
- package/src/tree/_tree.scss +0 -176
- package/src/typography/__tests__/SrOnly.tsx +0 -43
- package/src/typography/__tests__/TextContainer.tsx +0 -45
- package/src/typography/__tests__/Typography.tsx +0 -87
- package/src/typography/__tests__/WritingDirectionProvider.node.tsx +0 -27
- package/src/typography/__tests__/WritingDirectionProvider.tsx +0 -119
- package/src/typography/__tests__/__snapshots__/SrOnly.tsx.snap +0 -56
- package/src/typography/__tests__/__snapshots__/TextContainer.tsx.snap +0 -29
- package/src/typography/__tests__/__snapshots__/Typography.tsx.snap +0 -112
- package/src/typography/_typography.scss +0 -399
- package/src/utils/__tests__/RenderRecursively.tsx +0 -87
- package/src/utils/__tests__/__snapshots__/RenderRecursively.tsx.snap +0 -80
- package/src/utils/__tests__/applyRef.ts +0 -30
- package/src/utils/__tests__/bem.ts +0 -54
- package/src/utils/__tests__/getMiddleOfRange.ts +0 -12
- package/src/utils/__tests__/getPercentage.ts +0 -104
- package/src/utils/__tests__/getRangeDefaultValue.ts +0 -47
- package/src/utils/__tests__/getRangeSteps.ts +0 -14
- package/src/utils/__tests__/loop.ts +0 -50
- package/src/utils/__tests__/nearest.ts +0 -83
- package/src/utils/__tests__/parseCssLengthUnit.node.ts +0 -28
- package/src/utils/__tests__/parseCssLengthUnit.ts +0 -47
- package/src/utils/__tests__/wait.ts +0 -12
- package/src/utils/__tests__/withinRange.ts +0 -24
- package/src/window-splitter/_window-splitter.scss +0 -143
- package/tsconfig.json +0 -19
- package/tsconfig.types.json +0 -12
- package/tsdoc.json +0 -14
package/dist/tree/useTree.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
1
|
+
import { type TreeDefaultIds } from "./types.js";
|
|
2
|
+
import { type TreeExpansion } from "./useTreeExpansion.js";
|
|
3
|
+
import { type TreeSelection } from "./useTreeSelection.js";
|
|
4
4
|
/**
|
|
5
5
|
* @since 6.0.0
|
|
6
6
|
*/
|
|
@@ -12,11 +12,11 @@ export interface TreeHookOptions {
|
|
|
12
12
|
/**
|
|
13
13
|
* @defaultValue `[]`
|
|
14
14
|
*/
|
|
15
|
-
defaultExpandedIds?:
|
|
15
|
+
defaultExpandedIds?: TreeDefaultIds;
|
|
16
16
|
/**
|
|
17
17
|
* @defaultValue `[]`
|
|
18
18
|
*/
|
|
19
|
-
defaultSelectedIds?:
|
|
19
|
+
defaultSelectedIds?: TreeDefaultIds;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* @since 6.0.0
|
package/dist/tree/useTree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/tree/useTree.ts"],"sourcesContent":["\"use client\";\nimport type
|
|
1
|
+
{"version":3,"sources":["../../src/tree/useTree.ts"],"sourcesContent":["\"use client\";\nimport { type TreeDefaultIds } from \"./types.js\";\nimport { useTreeExpansion, type TreeExpansion } from \"./useTreeExpansion.js\";\nimport { useTreeSelection, type TreeSelection } from \"./useTreeSelection.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface TreeHookOptions {\n /**\n * @defaultValue `false`\n */\n multiSelect?: boolean;\n\n /**\n * @defaultValue `[]`\n */\n defaultExpandedIds?: TreeDefaultIds;\n\n /**\n * @defaultValue `[]`\n */\n defaultSelectedIds?: TreeDefaultIds;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface TreeImplementation extends TreeSelection, TreeExpansion {}\n\n/**\n * This is a convenience wrapper for the {@link useTreeExpansion} and\n * {@link useTreeSelection} hooks since they will almost always be used together.\n *\n * @example Simple Example\n * ```tsx\n * import type { TreeData } from \"@react-md/core\";\n * import { Tree, useTree } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * const data: TreeData = {\n * // pretend data\n * };\n *\n * function Example(): ReactElement {\n * const tree = useTree();\n *\n * return <Tree {...tree} data={data} aria-label=\"Tree\" />;\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useTree(options: TreeHookOptions = {}): TreeImplementation {\n const {\n multiSelect = false,\n defaultExpandedIds,\n defaultSelectedIds,\n } = options;\n\n return {\n ...useTreeExpansion(defaultExpandedIds),\n ...useTreeSelection(defaultSelectedIds, multiSelect),\n };\n}\n"],"names":["useTreeExpansion","useTreeSelection","useTree","options","multiSelect","defaultExpandedIds","defaultSelectedIds"],"mappings":"AAAA;AAEA,SAASA,gBAAgB,QAA4B,wBAAwB;AAC7E,SAASC,gBAAgB,QAA4B,wBAAwB;AA2B7E;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,SAASC,QAAQC,UAA2B,CAAC,CAAC;IACnD,MAAM,EACJC,cAAc,KAAK,EACnBC,kBAAkB,EAClBC,kBAAkB,EACnB,GAAGH;IAEJ,OAAO;QACL,GAAGH,iBAAiBK,mBAAmB;QACvC,GAAGJ,iBAAiBK,oBAAoBF,YAAY;IACtD;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type UseStateSetter } from "../types.js";
|
|
2
|
+
import { type TreeDefaultIds, type TreeItemIdSet } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* @since 6.0.0 Renamed from `TreeItemExpansion` and uses a Set
|
|
5
5
|
* instead of a list to increase performance. Also renamed `onItemExpansion` to
|
|
@@ -15,4 +15,4 @@ export interface TreeExpansion {
|
|
|
15
15
|
* @since 6.0.0 Renamed from `useTreeItemExpansion` and uses a Set
|
|
16
16
|
* instead of a list to increase performance.
|
|
17
17
|
*/
|
|
18
|
-
export declare function useTreeExpansion(defaultExpandedIds?:
|
|
18
|
+
export declare function useTreeExpansion(defaultExpandedIds?: TreeDefaultIds): TreeExpansion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/tree/useTreeExpansion.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport type
|
|
1
|
+
{"version":3,"sources":["../../src/tree/useTreeExpansion.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport { type UseStateSetter } from \"../types.js\";\nimport { type TreeDefaultIds, type TreeItemIdSet } from \"./types.js\";\n\n/**\n * @since 6.0.0 Renamed from `TreeItemExpansion` and uses a Set\n * instead of a list to increase performance. Also renamed `onItemExpansion` to\n * `toggleTreeItemExpansion` and `onMultiItemExpansion` to\n * `expandMultipleTreeItems`.\n */\nexport interface TreeExpansion {\n expandedIds: TreeItemIdSet;\n toggleTreeItemExpansion(itemId: string): void;\n expandMultipleTreeItems: UseStateSetter<TreeItemIdSet>;\n}\n\n/**\n * @since 6.0.0 Renamed from `useTreeItemExpansion` and uses a Set\n * instead of a list to increase performance.\n */\nexport function useTreeExpansion(\n defaultExpandedIds?: TreeDefaultIds\n): TreeExpansion {\n const [expandedIds, setExpandedIds] = useState<TreeItemIdSet>(() => {\n const defaultIds =\n typeof defaultExpandedIds === \"function\"\n ? defaultExpandedIds()\n : defaultExpandedIds;\n\n return new Set(defaultIds);\n });\n\n const toggleTreeItemExpansion = useCallback((itemId: string) => {\n setExpandedIds((prevExpandedIds) => {\n const expandedIds = new Set(prevExpandedIds);\n if (expandedIds.has(itemId)) {\n expandedIds.delete(itemId);\n } else {\n expandedIds.add(itemId);\n }\n\n return expandedIds;\n });\n }, []);\n\n return {\n expandedIds,\n toggleTreeItemExpansion,\n expandMultipleTreeItems: setExpandedIds,\n };\n}\n"],"names":["useCallback","useState","useTreeExpansion","defaultExpandedIds","expandedIds","setExpandedIds","defaultIds","Set","toggleTreeItemExpansion","itemId","prevExpandedIds","has","delete","add","expandMultipleTreeItems"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAgB9C;;;CAGC,GACD,OAAO,SAASC,iBACdC,kBAAmC;IAEnC,MAAM,CAACC,aAAaC,eAAe,GAAGJ,SAAwB;QAC5D,MAAMK,aACJ,OAAOH,uBAAuB,aAC1BA,uBACAA;QAEN,OAAO,IAAII,IAAID;IACjB;IAEA,MAAME,0BAA0BR,YAAY,CAACS;QAC3CJ,eAAe,CAACK;YACd,MAAMN,cAAc,IAAIG,IAAIG;YAC5B,IAAIN,YAAYO,GAAG,CAACF,SAAS;gBAC3BL,YAAYQ,MAAM,CAACH;YACrB,OAAO;gBACLL,YAAYS,GAAG,CAACJ;YAClB;YAEA,OAAOL;QACT;IACF,GAAG,EAAE;IAEL,OAAO;QACLA;QACAI;QACAM,yBAAyBT;IAC3B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/tree/useTreeItems.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport type {\n TreeItemSorter,\n TreeItemNode,\n TreeData,\n DefaultTreeItemNode,\n} from \"./types.js\";\n\n/**\n * A lookup to find all the child ids for a specific parent. This was added to\n * support the `*` keyboard behavior of opening all tree items at the current\n * level.\n *\n * @since 6.0.0\n * @internal\n */\nexport type TreeItemChildIds = Map<string | null, Set<string>>;\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type RenderableTreeItemNode<\n T extends TreeItemNode = DefaultTreeItemNode,\n> = T & {\n items?: readonly RenderableTreeItemNode<T>[];\n};\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface BuildTreeOptions<T extends TreeItemNode> {\n sort: TreeItemSorter<T>;\n nodes: T[];\n parentId: string | null;\n treeItemChildIds: TreeItemChildIds;\n}\n\n/**\n * This util performantly builds a nested list of tree items from a giant flat\n * list of items by linking items together with the provided `parentId`. This\n * will also recursively build the tree and _hopefully_ all items will be added.\n *\n * @since 6.0.0 Updated to include the {@link TreeItemChildIds}\n */\nexport function buildTree<T extends TreeItemNode>(\n options: BuildTreeOptions<T>\n): readonly RenderableTreeItemNode<T>[] | undefined {\n const { sort, nodes, parentId, treeItemChildIds } = options;\n const childIds = treeItemChildIds.get(parentId) || new Set();\n const childItems: RenderableTreeItemNode<T>[] = [];\n\n // doing a \"reverse\" order filter/move so that the items array shrinks while\n // looping. This makes it so that the entire items array doesn't need to\n // continually be looped through as more items are added to the tree, only the\n // remaining items will have to be looped\n let i = nodes.length;\n while (i > 0) {\n i -= 1;\n if (nodes[i] && nodes[i].parentId === parentId) {\n const [item] = nodes.splice(i, 1);\n childIds.add(item.itemId);\n // shallow cloning so childItems doesn't get applied to the original data\n // set\n childItems.unshift({ ...item });\n }\n }\n\n if (!childItems.length) {\n return undefined;\n }\n\n treeItemChildIds.set(parentId, childIds);\n childItems.forEach((childItem) => {\n childItem.items = buildTree({\n sort,\n nodes,\n parentId: childItem.itemId,\n treeItemChildIds,\n });\n });\n\n return sort(childItems);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface TreeItemOptions<T extends TreeItemNode> {\n data: TreeData<T>;\n sort: TreeItemSorter<T>;\n rootId: string | null;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface TreeItems<T extends TreeItemNode> {\n items: readonly RenderableTreeItemNode<T>[];\n treeItemChildIds: TreeItemChildIds;\n}\n\n/**\n * This is mostly an internal hook, but can be used to build tree-like\n * data structures without the need of the `Tree` component.\n *\n * @since 6.0.0 converted to use an object argument instead of\n * multiple arguments. Also logs any orphaned items that do not have a parent\n */\nexport function useTreeItems<T extends TreeItemNode>(\n options: TreeItemOptions<T>\n): TreeItems<T> {\n const { data, sort, rootId } = options;\n\n return useMemo<TreeItems<T>>(() => {\n const values = Object.values(data);\n const treeItemChildIds = new Map<string, Set<string>>();\n const items = buildTree<T>({\n sort,\n nodes: values,\n parentId: rootId,\n treeItemChildIds,\n });\n\n if (process.env.NODE_ENV !== \"production\" && values.length) {\n /* eslint-disable no-console */\n console.warn(\"The following tree items are orphaned without a parent:\");\n console.warn(values.slice());\n }\n\n return {\n items: items || [],\n treeItemChildIds,\n };\n }, [data, rootId, sort]);\n}\n"],"names":["useMemo","buildTree","options","sort","nodes","parentId","treeItemChildIds","childIds","get","Set","childItems","i","length","item","splice","add","itemId","unshift","undefined","set","forEach","childItem","items","useTreeItems","data","rootId","values","Object","Map","process","env","NODE_ENV","console","warn","slice"],"
|
|
1
|
+
{"version":3,"sources":["../../src/tree/useTreeItems.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport type {\n TreeItemSorter,\n TreeItemNode,\n TreeData,\n DefaultTreeItemNode,\n} from \"./types.js\";\n\n/**\n * A lookup to find all the child ids for a specific parent. This was added to\n * support the `*` keyboard behavior of opening all tree items at the current\n * level.\n *\n * @since 6.0.0\n * @internal\n */\nexport type TreeItemChildIds = Map<string | null, Set<string>>;\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type RenderableTreeItemNode<\n T extends TreeItemNode = DefaultTreeItemNode,\n> = T & {\n items?: readonly RenderableTreeItemNode<T>[];\n};\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface BuildTreeOptions<T extends TreeItemNode> {\n sort: TreeItemSorter<T>;\n nodes: T[];\n parentId: string | null;\n treeItemChildIds: TreeItemChildIds;\n}\n\n/**\n * This util performantly builds a nested list of tree items from a giant flat\n * list of items by linking items together with the provided `parentId`. This\n * will also recursively build the tree and _hopefully_ all items will be added.\n *\n * @since 6.0.0 Updated to include the {@link TreeItemChildIds}\n */\nexport function buildTree<T extends TreeItemNode>(\n options: BuildTreeOptions<T>\n): readonly RenderableTreeItemNode<T>[] | undefined {\n const { sort, nodes, parentId, treeItemChildIds } = options;\n const childIds = treeItemChildIds.get(parentId) || new Set();\n const childItems: RenderableTreeItemNode<T>[] = [];\n\n // doing a \"reverse\" order filter/move so that the items array shrinks while\n // looping. This makes it so that the entire items array doesn't need to\n // continually be looped through as more items are added to the tree, only the\n // remaining items will have to be looped\n let i = nodes.length;\n while (i > 0) {\n i -= 1;\n if (nodes[i] && nodes[i].parentId === parentId) {\n const [item] = nodes.splice(i, 1);\n childIds.add(item.itemId);\n // shallow cloning so childItems doesn't get applied to the original data\n // set\n childItems.unshift({ ...item });\n }\n }\n\n if (!childItems.length) {\n return undefined;\n }\n\n treeItemChildIds.set(parentId, childIds);\n childItems.forEach((childItem) => {\n childItem.items = buildTree({\n sort,\n nodes,\n parentId: childItem.itemId,\n treeItemChildIds,\n });\n });\n\n return sort(childItems);\n}\n\n/**\n * @since 6.0.0\n */\nexport interface TreeItemOptions<T extends TreeItemNode> {\n data: TreeData<T>;\n sort: TreeItemSorter<T>;\n rootId: string | null;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface TreeItems<T extends TreeItemNode> {\n items: readonly RenderableTreeItemNode<T>[];\n treeItemChildIds: TreeItemChildIds;\n}\n\n/**\n * This is mostly an internal hook, but can be used to build tree-like\n * data structures without the need of the `Tree` component.\n *\n * @since 6.0.0 converted to use an object argument instead of\n * multiple arguments. Also logs any orphaned items that do not have a parent\n */\nexport function useTreeItems<T extends TreeItemNode>(\n options: TreeItemOptions<T>\n): TreeItems<T> {\n const { data, sort, rootId } = options;\n\n return useMemo<TreeItems<T>>(() => {\n const values = Object.values(data);\n const treeItemChildIds = new Map<string, Set<string>>();\n const items = buildTree<T>({\n sort,\n nodes: values,\n parentId: rootId,\n treeItemChildIds,\n });\n\n if (process.env.NODE_ENV !== \"production\" && values.length) {\n /* eslint-disable no-console */\n console.warn(\"The following tree items are orphaned without a parent:\");\n console.warn(values.slice());\n }\n\n return {\n items: items || [],\n treeItemChildIds,\n };\n }, [data, rootId, sort]);\n}\n"],"names":["useMemo","buildTree","options","sort","nodes","parentId","treeItemChildIds","childIds","get","Set","childItems","i","length","item","splice","add","itemId","unshift","undefined","set","forEach","childItem","items","useTreeItems","data","rootId","values","Object","Map","process","env","NODE_ENV","console","warn","slice"],"mappings":"AAAA,SAASA,OAAO,QAAQ,QAAQ;AAuChC;;;;;;CAMC,GACD,OAAO,SAASC,UACdC,OAA4B;IAE5B,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,gBAAgB,EAAE,GAAGJ;IACpD,MAAMK,WAAWD,iBAAiBE,GAAG,CAACH,aAAa,IAAII;IACvD,MAAMC,aAA0C,EAAE;IAElD,4EAA4E;IAC5E,wEAAwE;IACxE,8EAA8E;IAC9E,yCAAyC;IACzC,IAAIC,IAAIP,MAAMQ,MAAM;IACpB,MAAOD,IAAI,EAAG;QACZA,KAAK;QACL,IAAIP,KAAK,CAACO,EAAE,IAAIP,KAAK,CAACO,EAAE,CAACN,QAAQ,KAAKA,UAAU;YAC9C,MAAM,CAACQ,KAAK,GAAGT,MAAMU,MAAM,CAACH,GAAG;YAC/BJ,SAASQ,GAAG,CAACF,KAAKG,MAAM;YACxB,yEAAyE;YACzE,MAAM;YACNN,WAAWO,OAAO,CAAC;gBAAE,GAAGJ,IAAI;YAAC;QAC/B;IACF;IAEA,IAAI,CAACH,WAAWE,MAAM,EAAE;QACtB,OAAOM;IACT;IAEAZ,iBAAiBa,GAAG,CAACd,UAAUE;IAC/BG,WAAWU,OAAO,CAAC,CAACC;QAClBA,UAAUC,KAAK,GAAGrB,UAAU;YAC1BE;YACAC;YACAC,UAAUgB,UAAUL,MAAM;YAC1BV;QACF;IACF;IAEA,OAAOH,KAAKO;AACd;AAmBA;;;;;;CAMC,GACD,OAAO,SAASa,aACdrB,OAA2B;IAE3B,MAAM,EAAEsB,IAAI,EAAErB,IAAI,EAAEsB,MAAM,EAAE,GAAGvB;IAE/B,OAAOF,QAAsB;QAC3B,MAAM0B,SAASC,OAAOD,MAAM,CAACF;QAC7B,MAAMlB,mBAAmB,IAAIsB;QAC7B,MAAMN,QAAQrB,UAAa;YACzBE;YACAC,OAAOsB;YACPrB,UAAUoB;YACVnB;QACF;QAEA,IAAIuB,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBAAgBL,OAAOd,MAAM,EAAE;YAC1D,6BAA6B,GAC7BoB,QAAQC,IAAI,CAAC;YACbD,QAAQC,IAAI,CAACP,OAAOQ,KAAK;QAC3B;QAEA,OAAO;YACLZ,OAAOA,SAAS,EAAE;YAClBhB;QACF;IACF,GAAG;QAACkB;QAAMC;QAAQtB;KAAK;AACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/tree/useTreeMovement.ts"],"sourcesContent":["\"use client\";\nimport type {\n FocusEventHandler,\n KeyboardEventHandler,\n MouseEventHandler,\n} from \"react\";\nimport { useRef } from \"react\";\nimport type { KeyboardMovementProviderImplementation } from \"../movement/types.js\";\nimport { useKeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\nimport { getNextFocusableIndex } from \"../movement/utils.js\";\nimport type { NonNullMutableRef } from \"../types.js\";\nimport type { TreeItemMetadataLookup } from \"./TreeProvider.js\";\nimport type { TreeData, TreeItemNode } from \"./types.js\";\nimport type { TreeExpansion } from \"./useTreeExpansion.js\";\nimport type { TreeItemChildIds } from \"./useTreeItems.js\";\n\n/**\n * This helps catch the edge case where the collapse transition has occurred for\n * a tree item group, but the user uses the `ArrowDown` key before it has\n * finished. So to do this:\n *\n * - find the parent group of the tree item\n * - find the tree item that controls the group (the element before the group)\n * - check if the `aria-expanded` state is `\"false\"` meaning it is considered\n * closed\n *\n * @internal\n * @since 6.0.0\n */\nconst isParentItemCollapsing = (item: HTMLElement): boolean =>\n item\n .closest(\"[role='group']\")\n ?.previousElementSibling?.getAttribute(\"aria-expanded\") === \"false\";\n\n/**\n * @since 6.0.0\n * @internal\n */\nconst getVisibleTreeItems = (\n container: HTMLElement\n): readonly HTMLElement[] => {\n const items = [\n ...container.querySelectorAll<HTMLElement>('[role=\"treeitem\"]'),\n ];\n\n return items.filter(\n (item) =>\n // do not include items that have a `hidden` parent group\n item.offsetParent &&\n // do not include items that are about to become hidden\n !isParentItemCollapsing(item)\n );\n};\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface TreeMovementOptions<T extends TreeItemNode> extends TreeExpansion {\n data: TreeData<T>;\n onClick: MouseEventHandler<HTMLUListElement> | undefined;\n onFocus: FocusEventHandler<HTMLUListElement> | undefined;\n onKeyDown: KeyboardEventHandler<HTMLUListElement> | undefined;\n selectedIds: ReadonlySet<string>;\n treeItemChildIds: TreeItemChildIds;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface TreeMovement\n extends KeyboardMovementProviderImplementation<HTMLUListElement> {\n /**\n * This will be mutated by the `TreeItem` component and used to handle\n * keyboard movement.\n */\n metadataLookup: NonNullMutableRef<TreeItemMetadataLookup>;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport function useTreeMovement<T extends TreeItemNode>(\n options: TreeMovementOptions<T>\n): TreeMovement {\n const {\n onClick,\n onFocus,\n onKeyDown,\n data,\n expandedIds,\n selectedIds,\n treeItemChildIds,\n toggleTreeItemExpansion,\n expandMultipleTreeItems,\n } = options;\n\n const metadataLookup = useRef<TreeItemMetadataLookup>({\n expandable: {},\n disabledItems: {},\n elementToItem: {},\n itemToElement: {},\n });\n const movement = useKeyboardMovementProvider({\n onClick,\n onFocus,\n onKeyDown,\n extendKeyDown(movementData) {\n const { event, activeDescendantId, currentFocusIndex, setFocusIndex } =\n movementData;\n const { expandable, disabledItems, elementToItem, itemToElement } =\n metadataLookup.current;\n const itemId = elementToItem[activeDescendantId];\n const item = data[itemId];\n\n /* c8 ignore start */\n if (!item) {\n return;\n }\n /* c8 ignore stop */\n\n const disabled = disabledItems[itemId];\n const expanded = expandedIds.has(itemId);\n\n let flagged = false;\n switch (event.key) {\n case \"ArrowLeft\":\n if (expanded && !disabled) {\n flagged = true;\n toggleTreeItemExpansion(itemId);\n } else if (item.parentId) {\n // do not flag for this case since setFocusIndex already does this\n const parentId = itemToElement[item.parentId];\n const focusables = getVisibleTreeItems(event.currentTarget);\n const index = focusables.findIndex(\n (element) => element.id === parentId\n );\n setFocusIndex(index, focusables);\n }\n\n break;\n case \"ArrowRight\":\n if (expandable[itemId] && !disabled) {\n if (!expanded) {\n flagged = true;\n toggleTreeItemExpansion(itemId);\n } else {\n // do not flag for this case since setFocusIndex already does this\n const focusables = getVisibleTreeItems(event.currentTarget);\n const index = getNextFocusableIndex({\n loopable: false,\n increment: true,\n focusables,\n includeDisabled: true,\n currentFocusIndex: currentFocusIndex.current,\n });\n\n setFocusIndex(index, focusables);\n }\n }\n\n break;\n case \"*\": {\n flagged = true;\n const itemIds = treeItemChildIds.get(item.parentId);\n if (itemIds) {\n const expandableIds = [...itemIds].filter(\n (itemId) => expandable[itemId]\n );\n if (expandableIds.length) {\n expandMultipleTreeItems(\n (prev) => new Set([...prev, ...expandableIds])\n );\n currentFocusIndex.current = -1;\n }\n }\n break;\n }\n }\n\n if (flagged) {\n event.stopPropagation();\n event.preventDefault();\n }\n },\n searchable: true,\n tabIndexBehavior: \"virtual\",\n getFocusableElements: getVisibleTreeItems,\n getDefaultFocusedIndex(options) {\n const { focusables } = options;\n const { elementToItem } = metadataLookup.current;\n\n return focusables.findIndex((element) =>\n selectedIds.has(elementToItem[element.id])\n );\n },\n });\n\n return {\n metadataLookup,\n ...movement,\n };\n}\n"],"names":["useRef","useKeyboardMovementProvider","getNextFocusableIndex","isParentItemCollapsing","item","closest","previousElementSibling","getAttribute","getVisibleTreeItems","container","items","querySelectorAll","filter","offsetParent","useTreeMovement","options","onClick","onFocus","onKeyDown","data","expandedIds","selectedIds","treeItemChildIds","toggleTreeItemExpansion","expandMultipleTreeItems","metadataLookup","expandable","disabledItems","elementToItem","itemToElement","movement","extendKeyDown","movementData","event","activeDescendantId","currentFocusIndex","setFocusIndex","current","itemId","disabled","expanded","has","flagged","key","parentId","focusables","currentTarget","index","findIndex","element","id","loopable","increment","includeDisabled","itemIds","get","expandableIds","length","prev","Set","stopPropagation","preventDefault","searchable","tabIndexBehavior","getFocusableElements","getDefaultFocusedIndex"],"
|
|
1
|
+
{"version":3,"sources":["../../src/tree/useTreeMovement.ts"],"sourcesContent":["\"use client\";\nimport type {\n FocusEventHandler,\n KeyboardEventHandler,\n MouseEventHandler,\n} from \"react\";\nimport { useRef } from \"react\";\nimport type { KeyboardMovementProviderImplementation } from \"../movement/types.js\";\nimport { useKeyboardMovementProvider } from \"../movement/useKeyboardMovementProvider.js\";\nimport { getNextFocusableIndex } from \"../movement/utils.js\";\nimport type { NonNullMutableRef } from \"../types.js\";\nimport type { TreeItemMetadataLookup } from \"./TreeProvider.js\";\nimport type { TreeData, TreeItemNode } from \"./types.js\";\nimport type { TreeExpansion } from \"./useTreeExpansion.js\";\nimport type { TreeItemChildIds } from \"./useTreeItems.js\";\n\n/**\n * This helps catch the edge case where the collapse transition has occurred for\n * a tree item group, but the user uses the `ArrowDown` key before it has\n * finished. So to do this:\n *\n * - find the parent group of the tree item\n * - find the tree item that controls the group (the element before the group)\n * - check if the `aria-expanded` state is `\"false\"` meaning it is considered\n * closed\n *\n * @internal\n * @since 6.0.0\n */\nconst isParentItemCollapsing = (item: HTMLElement): boolean =>\n item\n .closest(\"[role='group']\")\n ?.previousElementSibling?.getAttribute(\"aria-expanded\") === \"false\";\n\n/**\n * @since 6.0.0\n * @internal\n */\nconst getVisibleTreeItems = (\n container: HTMLElement\n): readonly HTMLElement[] => {\n const items = [\n ...container.querySelectorAll<HTMLElement>('[role=\"treeitem\"]'),\n ];\n\n return items.filter(\n (item) =>\n // do not include items that have a `hidden` parent group\n item.offsetParent &&\n // do not include items that are about to become hidden\n !isParentItemCollapsing(item)\n );\n};\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface TreeMovementOptions<T extends TreeItemNode> extends TreeExpansion {\n data: TreeData<T>;\n onClick: MouseEventHandler<HTMLUListElement> | undefined;\n onFocus: FocusEventHandler<HTMLUListElement> | undefined;\n onKeyDown: KeyboardEventHandler<HTMLUListElement> | undefined;\n selectedIds: ReadonlySet<string>;\n treeItemChildIds: TreeItemChildIds;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\ninterface TreeMovement\n extends KeyboardMovementProviderImplementation<HTMLUListElement> {\n /**\n * This will be mutated by the `TreeItem` component and used to handle\n * keyboard movement.\n */\n metadataLookup: NonNullMutableRef<TreeItemMetadataLookup>;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport function useTreeMovement<T extends TreeItemNode>(\n options: TreeMovementOptions<T>\n): TreeMovement {\n const {\n onClick,\n onFocus,\n onKeyDown,\n data,\n expandedIds,\n selectedIds,\n treeItemChildIds,\n toggleTreeItemExpansion,\n expandMultipleTreeItems,\n } = options;\n\n const metadataLookup = useRef<TreeItemMetadataLookup>({\n expandable: {},\n disabledItems: {},\n elementToItem: {},\n itemToElement: {},\n });\n const movement = useKeyboardMovementProvider({\n onClick,\n onFocus,\n onKeyDown,\n extendKeyDown(movementData) {\n const { event, activeDescendantId, currentFocusIndex, setFocusIndex } =\n movementData;\n const { expandable, disabledItems, elementToItem, itemToElement } =\n metadataLookup.current;\n const itemId = elementToItem[activeDescendantId];\n const item = data[itemId];\n\n /* c8 ignore start */\n if (!item) {\n return;\n }\n /* c8 ignore stop */\n\n const disabled = disabledItems[itemId];\n const expanded = expandedIds.has(itemId);\n\n let flagged = false;\n switch (event.key) {\n case \"ArrowLeft\":\n if (expanded && !disabled) {\n flagged = true;\n toggleTreeItemExpansion(itemId);\n } else if (item.parentId) {\n // do not flag for this case since setFocusIndex already does this\n const parentId = itemToElement[item.parentId];\n const focusables = getVisibleTreeItems(event.currentTarget);\n const index = focusables.findIndex(\n (element) => element.id === parentId\n );\n setFocusIndex(index, focusables);\n }\n\n break;\n case \"ArrowRight\":\n if (expandable[itemId] && !disabled) {\n if (!expanded) {\n flagged = true;\n toggleTreeItemExpansion(itemId);\n } else {\n // do not flag for this case since setFocusIndex already does this\n const focusables = getVisibleTreeItems(event.currentTarget);\n const index = getNextFocusableIndex({\n loopable: false,\n increment: true,\n focusables,\n includeDisabled: true,\n currentFocusIndex: currentFocusIndex.current,\n });\n\n setFocusIndex(index, focusables);\n }\n }\n\n break;\n case \"*\": {\n flagged = true;\n const itemIds = treeItemChildIds.get(item.parentId);\n if (itemIds) {\n const expandableIds = [...itemIds].filter(\n (itemId) => expandable[itemId]\n );\n if (expandableIds.length) {\n expandMultipleTreeItems(\n (prev) => new Set([...prev, ...expandableIds])\n );\n currentFocusIndex.current = -1;\n }\n }\n break;\n }\n }\n\n if (flagged) {\n event.stopPropagation();\n event.preventDefault();\n }\n },\n searchable: true,\n tabIndexBehavior: \"virtual\",\n getFocusableElements: getVisibleTreeItems,\n getDefaultFocusedIndex(options) {\n const { focusables } = options;\n const { elementToItem } = metadataLookup.current;\n\n return focusables.findIndex((element) =>\n selectedIds.has(elementToItem[element.id])\n );\n },\n });\n\n return {\n metadataLookup,\n ...movement,\n };\n}\n"],"names":["useRef","useKeyboardMovementProvider","getNextFocusableIndex","isParentItemCollapsing","item","closest","previousElementSibling","getAttribute","getVisibleTreeItems","container","items","querySelectorAll","filter","offsetParent","useTreeMovement","options","onClick","onFocus","onKeyDown","data","expandedIds","selectedIds","treeItemChildIds","toggleTreeItemExpansion","expandMultipleTreeItems","metadataLookup","expandable","disabledItems","elementToItem","itemToElement","movement","extendKeyDown","movementData","event","activeDescendantId","currentFocusIndex","setFocusIndex","current","itemId","disabled","expanded","has","flagged","key","parentId","focusables","currentTarget","index","findIndex","element","id","loopable","increment","includeDisabled","itemIds","get","expandableIds","length","prev","Set","stopPropagation","preventDefault","searchable","tabIndexBehavior","getFocusableElements","getDefaultFocusedIndex"],"mappings":"AAAA;AAMA,SAASA,MAAM,QAAQ,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,6CAA6C;AACzF,SAASC,qBAAqB,QAAQ,uBAAuB;AAO7D;;;;;;;;;;;;CAYC,GACD,MAAMC,yBAAyB,CAACC,OAC9BA,KACGC,OAAO,CAAC,mBACPC,wBAAwBC,aAAa,qBAAqB;AAEhE;;;CAGC,GACD,MAAMC,sBAAsB,CAC1BC;IAEA,MAAMC,QAAQ;WACTD,UAAUE,gBAAgB,CAAc;KAC5C;IAED,OAAOD,MAAME,MAAM,CACjB,CAACR,OACC,yDAAyD;QACzDA,KAAKS,YAAY,IACjB,uDAAuD;QACvD,CAACV,uBAAuBC;AAE9B;AA4BA;;;CAGC,GACD,OAAO,SAASU,gBACdC,OAA+B;IAE/B,MAAM,EACJC,OAAO,EACPC,OAAO,EACPC,SAAS,EACTC,IAAI,EACJC,WAAW,EACXC,WAAW,EACXC,gBAAgB,EAChBC,uBAAuB,EACvBC,uBAAuB,EACxB,GAAGT;IAEJ,MAAMU,iBAAiBzB,OAA+B;QACpD0B,YAAY,CAAC;QACbC,eAAe,CAAC;QAChBC,eAAe,CAAC;QAChBC,eAAe,CAAC;IAClB;IACA,MAAMC,WAAW7B,4BAA4B;QAC3Ce;QACAC;QACAC;QACAa,eAAcC,YAAY;YACxB,MAAM,EAAEC,KAAK,EAAEC,kBAAkB,EAAEC,iBAAiB,EAAEC,aAAa,EAAE,GACnEJ;YACF,MAAM,EAAEN,UAAU,EAAEC,aAAa,EAAEC,aAAa,EAAEC,aAAa,EAAE,GAC/DJ,eAAeY,OAAO;YACxB,MAAMC,SAASV,aAAa,CAACM,mBAAmB;YAChD,MAAM9B,OAAOe,IAAI,CAACmB,OAAO;YAEzB,mBAAmB,GACnB,IAAI,CAAClC,MAAM;gBACT;YACF;YACA,kBAAkB,GAElB,MAAMmC,WAAWZ,aAAa,CAACW,OAAO;YACtC,MAAME,WAAWpB,YAAYqB,GAAG,CAACH;YAEjC,IAAII,UAAU;YACd,OAAQT,MAAMU,GAAG;gBACf,KAAK;oBACH,IAAIH,YAAY,CAACD,UAAU;wBACzBG,UAAU;wBACVnB,wBAAwBe;oBAC1B,OAAO,IAAIlC,KAAKwC,QAAQ,EAAE;wBACxB,kEAAkE;wBAClE,MAAMA,WAAWf,aAAa,CAACzB,KAAKwC,QAAQ,CAAC;wBAC7C,MAAMC,aAAarC,oBAAoByB,MAAMa,aAAa;wBAC1D,MAAMC,QAAQF,WAAWG,SAAS,CAChC,CAACC,UAAYA,QAAQC,EAAE,KAAKN;wBAE9BR,cAAcW,OAAOF;oBACvB;oBAEA;gBACF,KAAK;oBACH,IAAInB,UAAU,CAACY,OAAO,IAAI,CAACC,UAAU;wBACnC,IAAI,CAACC,UAAU;4BACbE,UAAU;4BACVnB,wBAAwBe;wBAC1B,OAAO;4BACL,kEAAkE;4BAClE,MAAMO,aAAarC,oBAAoByB,MAAMa,aAAa;4BAC1D,MAAMC,QAAQ7C,sBAAsB;gCAClCiD,UAAU;gCACVC,WAAW;gCACXP;gCACAQ,iBAAiB;gCACjBlB,mBAAmBA,kBAAkBE,OAAO;4BAC9C;4BAEAD,cAAcW,OAAOF;wBACvB;oBACF;oBAEA;gBACF,KAAK;oBAAK;wBACRH,UAAU;wBACV,MAAMY,UAAUhC,iBAAiBiC,GAAG,CAACnD,KAAKwC,QAAQ;wBAClD,IAAIU,SAAS;4BACX,MAAME,gBAAgB;mCAAIF;6BAAQ,CAAC1C,MAAM,CACvC,CAAC0B,SAAWZ,UAAU,CAACY,OAAO;4BAEhC,IAAIkB,cAAcC,MAAM,EAAE;gCACxBjC,wBACE,CAACkC,OAAS,IAAIC,IAAI;2CAAID;2CAASF;qCAAc;gCAE/CrB,kBAAkBE,OAAO,GAAG,CAAC;4BAC/B;wBACF;wBACA;oBACF;YACF;YAEA,IAAIK,SAAS;gBACXT,MAAM2B,eAAe;gBACrB3B,MAAM4B,cAAc;YACtB;QACF;QACAC,YAAY;QACZC,kBAAkB;QAClBC,sBAAsBxD;QACtByD,wBAAuBlD,OAAO;YAC5B,MAAM,EAAE8B,UAAU,EAAE,GAAG9B;YACvB,MAAM,EAAEa,aAAa,EAAE,GAAGH,eAAeY,OAAO;YAEhD,OAAOQ,WAAWG,SAAS,CAAC,CAACC,UAC3B5B,YAAYoB,GAAG,CAACb,aAAa,CAACqB,QAAQC,EAAE,CAAC;QAE7C;IACF;IAEA,OAAO;QACLzB;QACA,GAAGK,QAAQ;IACb;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type UseStateSetter } from "../types.js";
|
|
2
|
+
import { type TreeDefaultIds, type TreeItemIdSet } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* @since 6.0.0 Renamed from `TreeItemSelection` and uses a Set
|
|
5
5
|
* instead of a list to increase performance. Also renamed `onItemSelect` to
|
|
@@ -17,4 +17,4 @@ export interface TreeSelection {
|
|
|
17
17
|
* @since 6.0.0 Renamed from `useTreeItemSelection` and uses a Set
|
|
18
18
|
* instead of a list to increase performance.
|
|
19
19
|
*/
|
|
20
|
-
export declare function useTreeSelection(defaultSelectedIds?:
|
|
20
|
+
export declare function useTreeSelection(defaultSelectedIds?: TreeDefaultIds, multiSelect?: boolean): Required<TreeSelection>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/tree/useTreeSelection.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport type
|
|
1
|
+
{"version":3,"sources":["../../src/tree/useTreeSelection.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport { type UseStateSetter } from \"../types.js\";\nimport { type TreeDefaultIds, type TreeItemIdSet } from \"./types.js\";\n\n/**\n * @since 6.0.0 Renamed from `TreeItemSelection` and uses a Set\n * instead of a list to increase performance. Also renamed `onItemSelect` to\n * `toggleTreeItemSelection` and `onMultiItemSelect` to\n * `selectMultipleTreeItems`.\n */\nexport interface TreeSelection {\n /** @defaultValue `false` */\n multiSelect?: boolean;\n selectedIds: ReadonlySet<string>;\n toggleTreeItemSelection(itemId: string): void;\n selectMultipleTreeItems: UseStateSetter<TreeItemIdSet>;\n}\n\n/**\n * @since 6.0.0 Renamed from `useTreeItemSelection` and uses a Set\n * instead of a list to increase performance.\n */\nexport function useTreeSelection(\n defaultSelectedIds?: TreeDefaultIds,\n multiSelect = false\n): Required<TreeSelection> {\n const [selectedIds, setSelectedIds] = useState<TreeItemIdSet>(() => {\n const defaultIds =\n typeof defaultSelectedIds === \"function\"\n ? defaultSelectedIds()\n : defaultSelectedIds;\n\n return new Set(defaultIds);\n });\n\n const toggleTreeItemSelection = useCallback(\n (itemId: string) => {\n setSelectedIds((selectedIds) => {\n if (!multiSelect) {\n return selectedIds.has(itemId) ? selectedIds : new Set([itemId]);\n }\n\n const nextSelectedIds = new Set(selectedIds);\n if (selectedIds.has(itemId)) {\n nextSelectedIds.delete(itemId);\n } else {\n nextSelectedIds.add(itemId);\n }\n\n return nextSelectedIds;\n });\n },\n [multiSelect]\n );\n\n return {\n selectedIds,\n multiSelect,\n toggleTreeItemSelection,\n selectMultipleTreeItems: setSelectedIds,\n };\n}\n"],"names":["useCallback","useState","useTreeSelection","defaultSelectedIds","multiSelect","selectedIds","setSelectedIds","defaultIds","Set","toggleTreeItemSelection","itemId","has","nextSelectedIds","delete","add","selectMultipleTreeItems"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAkB9C;;;CAGC,GACD,OAAO,SAASC,iBACdC,kBAAmC,EACnCC,cAAc,KAAK;IAEnB,MAAM,CAACC,aAAaC,eAAe,GAAGL,SAAwB;QAC5D,MAAMM,aACJ,OAAOJ,uBAAuB,aAC1BA,uBACAA;QAEN,OAAO,IAAIK,IAAID;IACjB;IAEA,MAAME,0BAA0BT,YAC9B,CAACU;QACCJ,eAAe,CAACD;YACd,IAAI,CAACD,aAAa;gBAChB,OAAOC,YAAYM,GAAG,CAACD,UAAUL,cAAc,IAAIG,IAAI;oBAACE;iBAAO;YACjE;YAEA,MAAME,kBAAkB,IAAIJ,IAAIH;YAChC,IAAIA,YAAYM,GAAG,CAACD,SAAS;gBAC3BE,gBAAgBC,MAAM,CAACH;YACzB,OAAO;gBACLE,gBAAgBE,GAAG,CAACJ;YACtB;YAEA,OAAOE;QACT;IACF,GACA;QAACR;KAAY;IAGf,OAAO;QACLC;QACAD;QACAK;QACAM,yBAAyBT;IAC3B;AACF"}
|
package/dist/tree/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/tree/utils.ts"],"sourcesContent":["import type { TreeItemNode, TreeData, DefaultTreeItemNode } from \"./types.js\";\n\n/**\n * This will get all the items from the provided itemId up to the root of the\n * tree that can be used for drag and drop behavior or building a breadcrumb\n * list.\n *\n * @param data - The flattened tree data to navigate.\n * @param itemId - The item id to start the search at.\n * @returns an ordered list of the current item followed by all the direct\n * parents of that item.\n * @since 6.0.0 Renamed from `getItemsFrom` to `getTreeItemsFrom`.\n */\nexport function getTreeItemsFrom<T extends TreeItemNode = DefaultTreeItemNode>(\n data: TreeData<T>,\n itemId: string | null\n): readonly T[] {\n const items: T[] = [];\n let currentId = itemId;\n while (currentId) {\n const item = data[currentId];\n currentId = item?.parentId ?? null;\n if (item) {\n items.push(item);\n }\n }\n\n return items;\n}\n\n/**\n * Gets all the child items for a specific parent item id. If the `recursive`\n * argument is enabled, all children of the items will also be returned instead\n * of only the top level items.\n *\n * @param data - Either the flattened tree data or a list of all the tree data\n * to iterate over\n * @param parentId - The parent id to get children of\n * @param recursive - Boolean if the children's children should also be returned\n * @returns a list of all the items for a specific parent item id. Note: if the\n * recursive param is enabled, the list will be ordered so that the children of\n * a item will appear before the next item at the same level. So you either need\n * to sort by `parentId` or something else if you want a specific order.\n * @since 6.0.0 Renamed from `getChildItems` to `getChildTreeItems`.\n */\nexport function getChildTreeItems<T extends TreeItemNode = DefaultTreeItemNode>(\n data: TreeData<T> | readonly T[],\n parentId: string | null,\n recursive = false\n): readonly T[] {\n const items = Array.isArray(data) ? data : Object.values(data);\n\n return items.reduce<T[]>((list, item) => {\n if (parentId !== item.parentId) {\n return list;\n }\n\n return [\n ...list,\n item,\n ...(recursive ? getChildTreeItems(items, item.itemId, recursive) : []),\n ];\n }, []);\n}\n"],"names":["getTreeItemsFrom","data","itemId","items","currentId","item","parentId","push","getChildTreeItems","recursive","Array","isArray","Object","values","reduce","list"],"
|
|
1
|
+
{"version":3,"sources":["../../src/tree/utils.ts"],"sourcesContent":["import type { TreeItemNode, TreeData, DefaultTreeItemNode } from \"./types.js\";\n\n/**\n * This will get all the items from the provided itemId up to the root of the\n * tree that can be used for drag and drop behavior or building a breadcrumb\n * list.\n *\n * @param data - The flattened tree data to navigate.\n * @param itemId - The item id to start the search at.\n * @returns an ordered list of the current item followed by all the direct\n * parents of that item.\n * @since 6.0.0 Renamed from `getItemsFrom` to `getTreeItemsFrom`.\n */\nexport function getTreeItemsFrom<T extends TreeItemNode = DefaultTreeItemNode>(\n data: TreeData<T>,\n itemId: string | null\n): readonly T[] {\n const items: T[] = [];\n let currentId = itemId;\n while (currentId) {\n const item = data[currentId];\n currentId = item?.parentId ?? null;\n if (item) {\n items.push(item);\n }\n }\n\n return items;\n}\n\n/**\n * Gets all the child items for a specific parent item id. If the `recursive`\n * argument is enabled, all children of the items will also be returned instead\n * of only the top level items.\n *\n * @param data - Either the flattened tree data or a list of all the tree data\n * to iterate over\n * @param parentId - The parent id to get children of\n * @param recursive - Boolean if the children's children should also be returned\n * @returns a list of all the items for a specific parent item id. Note: if the\n * recursive param is enabled, the list will be ordered so that the children of\n * a item will appear before the next item at the same level. So you either need\n * to sort by `parentId` or something else if you want a specific order.\n * @since 6.0.0 Renamed from `getChildItems` to `getChildTreeItems`.\n */\nexport function getChildTreeItems<T extends TreeItemNode = DefaultTreeItemNode>(\n data: TreeData<T> | readonly T[],\n parentId: string | null,\n recursive = false\n): readonly T[] {\n const items = Array.isArray(data) ? data : Object.values(data);\n\n return items.reduce<T[]>((list, item) => {\n if (parentId !== item.parentId) {\n return list;\n }\n\n return [\n ...list,\n item,\n ...(recursive ? getChildTreeItems(items, item.itemId, recursive) : []),\n ];\n }, []);\n}\n"],"names":["getTreeItemsFrom","data","itemId","items","currentId","item","parentId","push","getChildTreeItems","recursive","Array","isArray","Object","values","reduce","list"],"mappings":"AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASA,iBACdC,IAAiB,EACjBC,MAAqB;IAErB,MAAMC,QAAa,EAAE;IACrB,IAAIC,YAAYF;IAChB,MAAOE,UAAW;QAChB,MAAMC,OAAOJ,IAAI,CAACG,UAAU;QAC5BA,YAAYC,MAAMC,YAAY;QAC9B,IAAID,MAAM;YACRF,MAAMI,IAAI,CAACF;QACb;IACF;IAEA,OAAOF;AACT;AAEA;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASK,kBACdP,IAAgC,EAChCK,QAAuB,EACvBG,YAAY,KAAK;IAEjB,MAAMN,QAAQO,MAAMC,OAAO,CAACV,QAAQA,OAAOW,OAAOC,MAAM,CAACZ;IAEzD,OAAOE,MAAMW,MAAM,CAAM,CAACC,MAAMV;QAC9B,IAAIC,aAAaD,KAAKC,QAAQ,EAAE;YAC9B,OAAOS;QACT;QAEA,OAAO;eACFA;YACHV;eACII,YAAYD,kBAAkBL,OAAOE,KAAKH,MAAM,EAAEO,aAAa,EAAE;SACtE;IACH,GAAG,EAAE;AACP"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { Dispatch, ReactElement, Ref, SetStateAction } from \"react\";\n\n/**\n * A helper type that allows an optional `ref` to also be applied with a props\n * object even though a `ref` isn't a real prop.\n */\nexport type PropsWithRef<\n Props extends {},\n Element extends HTMLElement,\n> = Props & {\n /**\n * An optional ref that can be applied.\n */\n ref?: Ref<Element>;\n};\n\n/**\n * A simple type that can be used for different components that clone a\n * `className` into a child component.\n */\nexport type ClassNameCloneableChild<T = {}> = ReactElement<\n T & { className?: string }\n>;\n\n/**\n * This type allows you to require at least one of the provided keys. This is\n * super helpful for things like `aria-label` or `aria-labelledby` when it's\n * required for a11y.\n *\n * @see https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist/49725198#49725198\n */\nexport type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n\nexport interface LabelA11y {\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n}\n\n/**\n * A small accessibility helper to ensure that either `aria-label` or\n * `aria-labelledby` have been provided to a component.\n *\n * @example Simple Example\n * ```ts\n * import type { HTMLAttributes, ReactElement } from \"react\";\n * import type { LabelRequiredForA11y } from \"@react-md/core\";\n *\n * type Props = LabelRequiredForA11y<HTMLAttributes<HTMLDivElement>>;\n *\n * function Component(props: Props): ReactElement {\n * return <div {...props} />;\n * }\n *\n * const test1 = <Component />\n * // ^ type error\n * const test2 = <Component aria-label=\"Label\" />\n * const test3 = <Component aria-labelledby=\"some-other-id\" />\n * ```\n */\nexport type LabelRequiredForA11y<Props extends LabelA11y> = RequireAtLeastOne<\n Props,\n keyof LabelA11y\n>;\n\n/**\n * @since 5.0.0\n * @internal\n */\nexport interface NonNullRef<T> {\n readonly current: T;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface NonNullMutableRef<T> {\n current: T;\n}\n\n/** @since 6.0.0 */\nexport type HtmlTagName = keyof JSX.IntrinsicElements;\n\n/**\n * A function to get a string from a generic item.\n *\n * @example Simple Example\n * ```ts\n * interface Item {\n * name: string;\n * }\n *\n * const items: Item[] = [{ name: 'Hello' }, { name: 'World' }];\n *\n * const extractor: TextExtractor<Item> = (item) => item.name;\n * ```\n * @since 6.0.0\n */\nexport type TextExtractor<T> = (item: T) => string;\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type UseStateSetter<T> = Dispatch<SetStateAction<T>>;\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type UseStateInitializer<T> = T | (() => T);\n\n/**\n * @example\n * ```ts\n * type Visibility = UseStateObject<\"visible\", boolean>;\n * // type Visibility = {\n * // visible: boolean;\n * // setVisible: UseStateSetter<boolean>\n * // }\n *\n * type AnotherOne = UseStateObject<\"renderAsSheet\", RenderMenuAsSheet>;\n * // type AnotherOne = {\n * // renderAsSheet: RenderMenuAsSheet;\n * // setRenderAsSheet: UseStateSetter<RenderMenuAsSheet>;\n * // }\n * ```\n * @since 6.0.0\n * @internal\n */\nexport type UseStateObject<Name extends string, Value> = {\n [key in Name]: Value;\n} & {\n [key in `set${Capitalize<Name>}`]: UseStateSetter<Value>;\n};\n\n/**\n * @example\n * ```ts\n * interface Example {\n * value: number;\n * setValue: UseStateSetter<number>;\n * }\n *\n * type WithPrefix = RenameKeysWithPrefix<Example, \"thumb1\">;\n * // type WithPrefix = {\n * // thumb1Value: number;\n * // thumb1SetValue: UseStateSetter<number>;\n * // }\n * ```\n *\n * @since 6.0.0\n * @internal\n */\nexport type RenameKeysWithPrefix<T, Prefix extends string> = {\n [Key in keyof T & string as `${Prefix}${Capitalize<Key>}`]: T[Key];\n};\n\n/**\n * @since 6.0.0\n */\nexport type CssPosition = \"fixed\" | \"sticky\" | \"static\";\n\n/**\n * @since 6.0.0\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyFunction = (...args: any[]) => any | void;\n\n/**\n * @since 6.0.0\n */\nexport type CancelableFunction<F extends AnyFunction> = F & { cancel(): void };\n\n/**\n * @since 6.0.0\n */\nexport interface ElementSize {\n height: number;\n width: number;\n}\n"],"names":[],"
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { Dispatch, ReactElement, Ref, SetStateAction } from \"react\";\n\n/**\n * A helper type that allows an optional `ref` to also be applied with a props\n * object even though a `ref` isn't a real prop.\n */\nexport type PropsWithRef<\n Props extends {},\n Element extends HTMLElement,\n> = Props & {\n /**\n * An optional ref that can be applied.\n */\n ref?: Ref<Element>;\n};\n\n/**\n * A simple type that can be used for different components that clone a\n * `className` into a child component.\n */\nexport type ClassNameCloneableChild<T = {}> = ReactElement<\n T & { className?: string }\n>;\n\n/**\n * This type allows you to require at least one of the provided keys. This is\n * super helpful for things like `aria-label` or `aria-labelledby` when it's\n * required for a11y.\n *\n * @see https://stackoverflow.com/questions/40510611/typescript-interface-require-one-of-two-properties-to-exist/49725198#49725198\n */\nexport type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<\n T,\n Exclude<keyof T, Keys>\n> &\n {\n [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;\n }[Keys];\n\nexport interface LabelA11y {\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n}\n\n/**\n * A small accessibility helper to ensure that either `aria-label` or\n * `aria-labelledby` have been provided to a component.\n *\n * @example Simple Example\n * ```ts\n * import type { HTMLAttributes, ReactElement } from \"react\";\n * import type { LabelRequiredForA11y } from \"@react-md/core\";\n *\n * type Props = LabelRequiredForA11y<HTMLAttributes<HTMLDivElement>>;\n *\n * function Component(props: Props): ReactElement {\n * return <div {...props} />;\n * }\n *\n * const test1 = <Component />\n * // ^ type error\n * const test2 = <Component aria-label=\"Label\" />\n * const test3 = <Component aria-labelledby=\"some-other-id\" />\n * ```\n */\nexport type LabelRequiredForA11y<Props extends LabelA11y> = RequireAtLeastOne<\n Props,\n keyof LabelA11y\n>;\n\n/**\n * @since 5.0.0\n * @internal\n */\nexport interface NonNullRef<T> {\n readonly current: T;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface NonNullMutableRef<T> {\n current: T;\n}\n\n/** @since 6.0.0 */\nexport type HtmlTagName = keyof JSX.IntrinsicElements;\n\n/**\n * A function to get a string from a generic item.\n *\n * @example Simple Example\n * ```ts\n * interface Item {\n * name: string;\n * }\n *\n * const items: Item[] = [{ name: 'Hello' }, { name: 'World' }];\n *\n * const extractor: TextExtractor<Item> = (item) => item.name;\n * ```\n * @since 6.0.0\n */\nexport type TextExtractor<T> = (item: T) => string;\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type UseStateSetter<T> = Dispatch<SetStateAction<T>>;\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport type UseStateInitializer<T> = T | (() => T);\n\n/**\n * @example\n * ```ts\n * type Visibility = UseStateObject<\"visible\", boolean>;\n * // type Visibility = {\n * // visible: boolean;\n * // setVisible: UseStateSetter<boolean>\n * // }\n *\n * type AnotherOne = UseStateObject<\"renderAsSheet\", RenderMenuAsSheet>;\n * // type AnotherOne = {\n * // renderAsSheet: RenderMenuAsSheet;\n * // setRenderAsSheet: UseStateSetter<RenderMenuAsSheet>;\n * // }\n * ```\n * @since 6.0.0\n * @internal\n */\nexport type UseStateObject<Name extends string, Value> = {\n [key in Name]: Value;\n} & {\n [key in `set${Capitalize<Name>}`]: UseStateSetter<Value>;\n};\n\n/**\n * @example\n * ```ts\n * interface Example {\n * value: number;\n * setValue: UseStateSetter<number>;\n * }\n *\n * type WithPrefix = RenameKeysWithPrefix<Example, \"thumb1\">;\n * // type WithPrefix = {\n * // thumb1Value: number;\n * // thumb1SetValue: UseStateSetter<number>;\n * // }\n * ```\n *\n * @since 6.0.0\n * @internal\n */\nexport type RenameKeysWithPrefix<T, Prefix extends string> = {\n [Key in keyof T & string as `${Prefix}${Capitalize<Key>}`]: T[Key];\n};\n\n/**\n * @since 6.0.0\n */\nexport type CssPosition = \"fixed\" | \"sticky\" | \"static\";\n\n/**\n * @since 6.0.0\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyFunction = (...args: any[]) => any | void;\n\n/**\n * @since 6.0.0\n */\nexport type CancelableFunction<F extends AnyFunction> = F & { cancel(): void };\n\n/**\n * @since 6.0.0\n */\nexport interface ElementSize {\n height: number;\n width: number;\n}\n"],"names":[],"mappings":"AAoLA;;CAEC,GACD,WAGC"}
|
|
@@ -19,7 +19,8 @@ export interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {
|
|
|
19
19
|
focusable?: boolean;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* The `SrOnly` component is used to render content that is only visible to
|
|
23
|
+
* screen readers.
|
|
23
24
|
*
|
|
24
25
|
* @example Simple Example
|
|
25
26
|
* ```tsx
|
|
@@ -2,7 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { cssUtils } from "../cssUtils.js";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* The `SrOnly` component is used to render content that is only visible to
|
|
6
|
+
* screen readers.
|
|
6
7
|
*
|
|
7
8
|
* @example Simple Example
|
|
8
9
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/typography/SrOnly.tsx"],"sourcesContent":["import { forwardRef, type ElementType, type HTMLAttributes } from \"react\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport {\n type CustomTypographyComponent,\n type TypographyHTMLElement,\n} from \"./Typography.js\";\n\nexport interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {\n /** @defaultValue `\"span\"` */\n as?: CustomTypographyComponent;\n\n /**\n * Set this to `true` if the content should only be screen reader only text on\n * phones. This is useful for only displaying an icon on phones when there is\n * limited space and then displaying an icon and text on larger devices.\n *\n * @defaultValue `false`\n */\n phoneOnly?: boolean;\n\n /**\n * Set this to `true` if the element should be keyboard focusable.\n *\n * @defaultValue `false`\n */\n focusable?: boolean;\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/typography/SrOnly.tsx"],"sourcesContent":["import { forwardRef, type ElementType, type HTMLAttributes } from \"react\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport {\n type CustomTypographyComponent,\n type TypographyHTMLElement,\n} from \"./Typography.js\";\n\nexport interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {\n /** @defaultValue `\"span\"` */\n as?: CustomTypographyComponent;\n\n /**\n * Set this to `true` if the content should only be screen reader only text on\n * phones. This is useful for only displaying an icon on phones when there is\n * limited space and then displaying an icon and text on larger devices.\n *\n * @defaultValue `false`\n */\n phoneOnly?: boolean;\n\n /**\n * Set this to `true` if the element should be keyboard focusable.\n *\n * @defaultValue `false`\n */\n focusable?: boolean;\n}\n\n/**\n * The `SrOnly` component is used to render content that is only visible to\n * screen readers.\n *\n * @example Simple Example\n * ```tsx\n * import { SrOnly } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <SrOnly>\n * I am only visible to screen readers.\n * </SrOnly>\n * <SrOnly focusable>\n * I am only visible to screen readers but can be focused.\n * </SrOnly>\n * </>\n * );\n * }\n * ```\n */\nexport const SrOnly = forwardRef<TypographyHTMLElement, SrOnlyProps>(\n function SrOnly(props, ref) {\n const {\n as: AsComponent = \"span\",\n className,\n phoneOnly,\n focusable,\n children,\n tabIndex,\n ...remaining\n } = props;\n\n // do some type-casting so ref works\n const Component = AsComponent as ElementType;\n\n return (\n <Component\n {...remaining}\n ref={ref}\n tabIndex={tabIndex ?? (focusable ? 0 : undefined)}\n className={cssUtils({\n srOnly: focusable ? \"focusable\" : phoneOnly ? \"phone\" : true,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","cssUtils","SrOnly","props","ref","as","AsComponent","className","phoneOnly","focusable","children","tabIndex","remaining","Component","undefined","srOnly"],"mappings":";AAAA,SAASA,UAAU,QAA+C,QAAQ;AAC1E,SAASC,QAAQ,QAAQ,iBAAiB;AA2B1C;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,MAAMC,uBAASF,WACpB,SAASE,OAAOC,KAAK,EAAEC,GAAG;IACxB,MAAM,EACJC,IAAIC,cAAc,MAAM,EACxBC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IAEJ,oCAAoC;IACpC,MAAMU,YAAYP;IAElB,qBACE,KAACO;QACE,GAAGD,SAAS;QACbR,KAAKA;QACLO,UAAUA,YAAaF,CAAAA,YAAY,IAAIK,SAAQ;QAC/CP,WAAWN,SAAS;YAClBc,QAAQN,YAAY,cAAcD,YAAY,UAAU;YACxDD;QACF;kBAECG;;AAGP,GACA"}
|
|
@@ -3,12 +3,12 @@ import { type TextContainerClassNameOptions } from "./textContainerStyles.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* @since 6.0.0 Removed the `size` option since there is no longer a
|
|
5
5
|
* different line-length for mobile and desktop.
|
|
6
|
+
* @since 6.0.0 Removed the `clone` prop and the children render function
|
|
7
|
+
* behavior. Use the `textContainer` class name utility instead.
|
|
6
8
|
*/
|
|
7
9
|
export interface TextContainerProps extends HTMLAttributes<HTMLDivElement>, TextContainerClassNameOptions {
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
|
-
* **Server Component**
|
|
11
|
-
*
|
|
12
12
|
* This component should be used to render text based content with an
|
|
13
13
|
* appropriate max line length to optimize legibility.
|
|
14
14
|
*
|
|
@@ -36,5 +36,7 @@ export interface TextContainerProps extends HTMLAttributes<HTMLDivElement>, Text
|
|
|
36
36
|
* element.
|
|
37
37
|
* @since 6.0.0 Removed the `size` option since there is no longer a
|
|
38
38
|
* different line-length for mobile and desktop.
|
|
39
|
+
* @since 6.0.0 Removed the `clone` prop and the children render function
|
|
40
|
+
* behavior. Use the `textContainer` class name utility instead.
|
|
39
41
|
*/
|
|
40
42
|
export declare const TextContainer: import("react").ForwardRefExoticComponent<TextContainerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -2,8 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { textContainer } from "./textContainerStyles.js";
|
|
4
4
|
/**
|
|
5
|
-
* **Server Component**
|
|
6
|
-
*
|
|
7
5
|
* This component should be used to render text based content with an
|
|
8
6
|
* appropriate max line length to optimize legibility.
|
|
9
7
|
*
|
|
@@ -31,6 +29,8 @@ import { textContainer } from "./textContainerStyles.js";
|
|
|
31
29
|
* element.
|
|
32
30
|
* @since 6.0.0 Removed the `size` option since there is no longer a
|
|
33
31
|
* different line-length for mobile and desktop.
|
|
32
|
+
* @since 6.0.0 Removed the `clone` prop and the children render function
|
|
33
|
+
* behavior. Use the `textContainer` class name utility instead.
|
|
34
34
|
*/ export const TextContainer = /*#__PURE__*/ forwardRef(function TextContainer(props, ref) {
|
|
35
35
|
const { className, children, ...remaining } = props;
|
|
36
36
|
return /*#__PURE__*/ _jsx("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/typography/TextContainer.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport {\n textContainer,\n type TextContainerClassNameOptions,\n} from \"./textContainerStyles.js\";\n\n/**\n * @since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n */\nexport interface TextContainerProps\n extends HTMLAttributes<HTMLDivElement>,\n TextContainerClassNameOptions {}\n\n/**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/typography/TextContainer.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport {\n textContainer,\n type TextContainerClassNameOptions,\n} from \"./textContainerStyles.js\";\n\n/**\n * @since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n * @since 6.0.0 Removed the `clone` prop and the children render function\n * behavior. Use the `textContainer` class name utility instead.\n */\nexport interface TextContainerProps\n extends HTMLAttributes<HTMLDivElement>,\n TextContainerClassNameOptions {}\n\n/**\n * This component should be used to render text based content with an\n * appropriate max line length to optimize legibility.\n *\n * @example Simple Example\n * ```tsx\n * import { TextContainer, Typography } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <TextContainer>\n * <Typography type=\"headline-1\">Heading</Typography>\n * <Typography>\n * Pretend this is a giant paragraph of text that wraps multiple lines.\n * </Typography>\n * <Typography>\n * Pretend this is another giant paragraph of text that wraps multiple\n * lines.\n * </Typography>\n * </TextContainer>\n * );\n * }\n * ```\n *\n * @see {@link textContainer} If you only want to apply this class to an\n * element.\n * @since 6.0.0 Removed the `size` option since there is no longer a\n * different line-length for mobile and desktop.\n * @since 6.0.0 Removed the `clone` prop and the children render function\n * behavior. Use the `textContainer` class name utility instead.\n */\nexport const TextContainer = forwardRef<HTMLDivElement, TextContainerProps>(\n function TextContainer(props, ref) {\n const { className, children, ...remaining } = props;\n\n return (\n <div {...remaining} ref={ref} className={textContainer({ className })}>\n {children}\n </div>\n );\n }\n);\n"],"names":["forwardRef","textContainer","TextContainer","props","ref","className","children","remaining","div"],"mappings":";AAAA,SAASA,UAAU,QAA6B,QAAQ;AACxD,SACEC,aAAa,QAER,2BAA2B;AAYlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GACD,OAAO,MAAMC,8BAAgBF,WAC3B,SAASE,cAAcC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGJ;IAE9C,qBACE,KAACK;QAAK,GAAGD,SAAS;QAAEH,KAAKA;QAAKC,WAAWJ,cAAc;YAAEI;QAAU;kBAChEC;;AAGP,GACA"}
|
|
@@ -12,6 +12,11 @@ export type TypographyHTMLElement = HTMLHeadingElement | HTMLParagraphElement |
|
|
|
12
12
|
export type CustomTypographyComponent = ElementType<HTMLAttributes<TypographyHTMLElement> & {
|
|
13
13
|
className: string;
|
|
14
14
|
}>;
|
|
15
|
+
/**
|
|
16
|
+
* @since 6.0.0 Renamed `component` to `as`.
|
|
17
|
+
* @since 6.0.0 Removed the children render function behavior. Use the
|
|
18
|
+
* `typography` class name utility instead.
|
|
19
|
+
*/
|
|
15
20
|
export interface TypographyProps extends HTMLAttributes<TypographyHTMLElement>, TypographyClassNameOptions {
|
|
16
21
|
/**
|
|
17
22
|
* The component to render as when the children are not a render function. If
|
|
@@ -30,12 +35,12 @@ export interface TypographyProps extends HTMLAttributes<TypographyHTMLElement>,
|
|
|
30
35
|
* - `"body-2" -> <p>`
|
|
31
36
|
* - `"caption" -> <caption>`
|
|
32
37
|
* - `"overline" -> <span>`
|
|
38
|
+
*
|
|
39
|
+
* @since 6.0.0 Renamed from `component`
|
|
33
40
|
*/
|
|
34
41
|
as?: CustomTypographyComponent;
|
|
35
42
|
}
|
|
36
43
|
/**
|
|
37
|
-
* **Server Component**
|
|
38
|
-
*
|
|
39
44
|
* Render text with one of the material design typography styles applied and
|
|
40
45
|
* optional styles like font-weight, font-style, text color, etc.
|
|
41
46
|
*
|
|
@@ -73,5 +78,8 @@ export interface TypographyProps extends HTMLAttributes<TypographyHTMLElement>,
|
|
|
73
78
|
* ):
|
|
74
79
|
* }
|
|
75
80
|
* ```
|
|
81
|
+
*
|
|
82
|
+
* @since 6.0.0 Removed the children render function behavior . Use the
|
|
83
|
+
* `typography` class name utility instead.
|
|
76
84
|
*/
|
|
77
85
|
export declare const Typography: import("react").ForwardRefExoticComponent<TypographyProps & import("react").RefAttributes<TypographyHTMLElement>>;
|
|
@@ -30,8 +30,6 @@ import { typography } from "./typographyStyles.js";
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* **Server Component**
|
|
34
|
-
*
|
|
35
33
|
* Render text with one of the material design typography styles applied and
|
|
36
34
|
* optional styles like font-weight, font-style, text color, etc.
|
|
37
35
|
*
|
|
@@ -69,6 +67,9 @@ import { typography } from "./typographyStyles.js";
|
|
|
69
67
|
* ):
|
|
70
68
|
* }
|
|
71
69
|
* ```
|
|
70
|
+
*
|
|
71
|
+
* @since 6.0.0 Removed the children render function behavior . Use the
|
|
72
|
+
* `typography` class name utility instead.
|
|
72
73
|
*/ export const Typography = /*#__PURE__*/ forwardRef(function Typography(props, ref) {
|
|
73
74
|
const { as, type = "body-1", className, margin, fontStyle, fontWeight, textAlign, textColor, textDecoration, textTransform, textOverflow, children, ...remaining } = props;
|
|
74
75
|
const Component = getComponent(as, type);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/typography/Typography.tsx"],"sourcesContent":["import {\n forwardRef,\n type ElementType,\n type HTMLAttributes,\n type ReactElement,\n} from \"react\";\nimport {\n typography,\n type TypographyClassNameOptions,\n type TypographyType,\n} from \"./typographyStyles.js\";\n\n/**\n * A union of the default supported elements that the `Typography` component can\n * be rendered as. This is mostly used for adding the correct `HTMLAttributes`\n * and enabling the forward ref.\n *\n * @since 4.0.0\n */\nexport type TypographyHTMLElement =\n | HTMLHeadingElement\n | HTMLParagraphElement\n | HTMLSpanElement\n | HTMLDivElement\n | HTMLAnchorElement\n | HTMLBodyElement\n | HTMLHtmlElement;\n\n/** @since 6.0.0 */\nexport type CustomTypographyComponent = ElementType<\n HTMLAttributes<TypographyHTMLElement> & { className: string }\n>;\n\n/** @internal */\nfunction getComponent(\n as: CustomTypographyComponent | undefined,\n type: TypographyType\n): ElementType {\n if (as) {\n return as;\n }\n\n switch (type) {\n case \"headline-1\":\n return \"h1\";\n case \"headline-2\":\n return \"h2\";\n case \"headline-3\":\n return \"h3\";\n case \"headline-4\":\n return \"h4\";\n case \"headline-5\":\n return \"h5\";\n case \"headline-6\":\n case \"subtitle-1\":\n case \"subtitle-2\":\n return \"h6\";\n case \"body-1\":\n case \"body-2\":\n return \"p\";\n case \"caption\":\n return \"caption\";\n default:\n return \"span\";\n }\n}\n\nexport interface TypographyProps\n extends HTMLAttributes<TypographyHTMLElement>,\n TypographyClassNameOptions {\n /**\n * The component to render as when the children are not a render function. If\n * this prop is omitted, the component will be determined by the `type` prop\n * where:\n *\n * - `\"headline-1\" -> <h1>`\n * - `\"headline-2\" -> <h2>`\n * - `\"headline-3\" -> <h3>`\n * - `\"headline-4\" -> <h4>`\n * - `\"headline-5\" -> <h5>`\n * - `\"headline-6\" -> <h6>`\n * - `\"subtitle-1\" -> <h5>`\n * - `\"subtitle-2\" -> <h6>`\n * - `\"body-1\" -> <p>`\n * - `\"body-2\" -> <p>`\n * - `\"caption\" -> <caption>`\n * - `\"overline\" -> <span>`\n */\n as?: CustomTypographyComponent;\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/typography/Typography.tsx"],"sourcesContent":["import {\n forwardRef,\n type ElementType,\n type HTMLAttributes,\n type ReactElement,\n} from \"react\";\nimport {\n typography,\n type TypographyClassNameOptions,\n type TypographyType,\n} from \"./typographyStyles.js\";\n\n/**\n * A union of the default supported elements that the `Typography` component can\n * be rendered as. This is mostly used for adding the correct `HTMLAttributes`\n * and enabling the forward ref.\n *\n * @since 4.0.0\n */\nexport type TypographyHTMLElement =\n | HTMLHeadingElement\n | HTMLParagraphElement\n | HTMLSpanElement\n | HTMLDivElement\n | HTMLAnchorElement\n | HTMLBodyElement\n | HTMLHtmlElement;\n\n/** @since 6.0.0 */\nexport type CustomTypographyComponent = ElementType<\n HTMLAttributes<TypographyHTMLElement> & { className: string }\n>;\n\n/** @internal */\nfunction getComponent(\n as: CustomTypographyComponent | undefined,\n type: TypographyType\n): ElementType {\n if (as) {\n return as;\n }\n\n switch (type) {\n case \"headline-1\":\n return \"h1\";\n case \"headline-2\":\n return \"h2\";\n case \"headline-3\":\n return \"h3\";\n case \"headline-4\":\n return \"h4\";\n case \"headline-5\":\n return \"h5\";\n case \"headline-6\":\n case \"subtitle-1\":\n case \"subtitle-2\":\n return \"h6\";\n case \"body-1\":\n case \"body-2\":\n return \"p\";\n case \"caption\":\n return \"caption\";\n default:\n return \"span\";\n }\n}\n\n/**\n * @since 6.0.0 Renamed `component` to `as`.\n * @since 6.0.0 Removed the children render function behavior. Use the\n * `typography` class name utility instead.\n */\nexport interface TypographyProps\n extends HTMLAttributes<TypographyHTMLElement>,\n TypographyClassNameOptions {\n /**\n * The component to render as when the children are not a render function. If\n * this prop is omitted, the component will be determined by the `type` prop\n * where:\n *\n * - `\"headline-1\" -> <h1>`\n * - `\"headline-2\" -> <h2>`\n * - `\"headline-3\" -> <h3>`\n * - `\"headline-4\" -> <h4>`\n * - `\"headline-5\" -> <h5>`\n * - `\"headline-6\" -> <h6>`\n * - `\"subtitle-1\" -> <h5>`\n * - `\"subtitle-2\" -> <h6>`\n * - `\"body-1\" -> <p>`\n * - `\"body-2\" -> <p>`\n * - `\"caption\" -> <caption>`\n * - `\"overline\" -> <span>`\n *\n * @since 6.0.0 Renamed from `component`\n */\n as?: CustomTypographyComponent;\n}\n\n/**\n * Render text with one of the material design typography styles applied and\n * optional styles like font-weight, font-style, text color, etc.\n *\n * @example All Example\n * ```tsx\n * import { Typography } from \"@react-md/core\":\n *\n * export function Example() {\n * return (\n * <>\n * <Typography type=\"headline-1\">Headline 1</Typography>\n * <Typography type=\"headline-2\">Headline 2</Typography>\n * <Typography type=\"headline-3\">Headline 3</Typography>\n * <Typography type=\"headline-4\">Headline 4</Typography>\n * <Typography type=\"headline-5\">Headline 5</Typography>\n * <Typography type=\"headline-6\">Headline 6</Typography>\n * <Typography type=\"subtitle-1\">Subtitle 1</Typography>\n * <Typography type=\"subtitle-2\">Subtitle 2</Typography>\n * <Typography>\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-1\">\n * A paragraph of text.\n * </Typography>\n * <Typography type=\"body-2\">\n * Another paragraph of text.\n * </Typography>\n * <Typography type=\"caption\" component=\"h5\">\n * Caption text\n * </Typography>\n * <Typography type=\"overline\" component=\"h5\">\n * Overline text\n * </Typography>\n * </>\n * ):\n * }\n * ```\n *\n * @since 6.0.0 Removed the children render function behavior . Use the\n * `typography` class name utility instead.\n */\nexport const Typography = forwardRef<TypographyHTMLElement, TypographyProps>(\n function Typography(props, ref): ReactElement {\n const {\n as,\n type = \"body-1\",\n className,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n children,\n ...remaining\n } = props;\n\n const Component = getComponent(as, type);\n return (\n <Component\n {...remaining}\n ref={ref}\n className={typography({\n type,\n margin,\n fontStyle,\n fontWeight,\n textAlign,\n textColor,\n textDecoration,\n textTransform,\n textOverflow,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","typography","getComponent","as","type","Typography","props","ref","className","margin","fontStyle","fontWeight","textAlign","textColor","textDecoration","textTransform","textOverflow","children","remaining","Component"],"mappings":";AAAA,SACEA,UAAU,QAIL,QAAQ;AACf,SACEC,UAAU,QAGL,wBAAwB;AAuB/B,cAAc,GACd,SAASC,aACPC,EAAyC,EACzCC,IAAoB;IAEpB,IAAID,IAAI;QACN,OAAOA;IACT;IAEA,OAAQC;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAiCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCC,GACD,OAAO,MAAMC,2BAAaL,WACxB,SAASK,WAAWC,KAAK,EAAEC,GAAG;IAC5B,MAAM,EACJJ,EAAE,EACFC,OAAO,QAAQ,EACfI,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,SAAS,EACTC,cAAc,EACdC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACR,GAAGC,WACJ,GAAGZ;IAEJ,MAAMa,YAAYjB,aAAaC,IAAIC;IACnC,qBACE,KAACe;QACE,GAAGD,SAAS;QACbX,KAAKA;QACLC,WAAWP,WAAW;YACpBG;YACAK;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAR;QACF;kBAECS;;AAGP,GACA"}
|
|
@@ -68,7 +68,7 @@ export interface WritingDirectionProviderProps {
|
|
|
68
68
|
*
|
|
69
69
|
* In node environments, this will default to `"ltr"`.
|
|
70
70
|
*
|
|
71
|
-
* @since 6.0.0
|
|
71
|
+
* @since 6.0.0 Renamed from `DEFAULT_DIR`
|
|
72
72
|
*/
|
|
73
73
|
export declare const DEFAULT_WRITING_DIRECTION: () => Dir;
|
|
74
74
|
/**
|
|
@@ -144,6 +144,6 @@ export declare const DEFAULT_WRITING_DIRECTION: () => Dir;
|
|
|
144
144
|
* );
|
|
145
145
|
* ```
|
|
146
146
|
*
|
|
147
|
-
* @since 6.0.0
|
|
147
|
+
* @since 6.0.0 Renamed from `Dir`
|
|
148
148
|
*/
|
|
149
149
|
export declare function WritingDirectionProvider(props: WritingDirectionProviderProps): ReactElement;
|
|
@@ -43,7 +43,7 @@ const { Provider } = context;
|
|
|
43
43
|
*
|
|
44
44
|
* In node environments, this will default to `"ltr"`.
|
|
45
45
|
*
|
|
46
|
-
* @since 6.0.0
|
|
46
|
+
* @since 6.0.0 Renamed from `DEFAULT_DIR`
|
|
47
47
|
*/ export const DEFAULT_WRITING_DIRECTION = ()=>{
|
|
48
48
|
let dir = "ltr";
|
|
49
49
|
if (typeof document !== "undefined") {
|
|
@@ -125,7 +125,7 @@ const { Provider } = context;
|
|
|
125
125
|
* );
|
|
126
126
|
* ```
|
|
127
127
|
*
|
|
128
|
-
* @since 6.0.0
|
|
128
|
+
* @since 6.0.0 Renamed from `Dir`
|
|
129
129
|
*/ export function WritingDirectionProvider(props) {
|
|
130
130
|
const { children, defaultDir = DEFAULT_WRITING_DIRECTION } = props;
|
|
131
131
|
const { root } = useContext(context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/typography/WritingDirectionProvider.tsx"],"sourcesContent":["\"use client\";\nimport {\n Children,\n cloneElement,\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { type UseStateInitializer } from \"../types.js\";\n\n/**\n * Note: unlike the `dir` DOM attribute, the `\"auto\"` value is not supported.\n *\n * @since 6.0.0\n */\nexport type Dir = \"ltr\" | \"rtl\";\n\n/** @since 6.0.0 */\nexport type DefaultDir = UseStateInitializer<Dir>;\n\n/** @since 2.3.0 */\nexport interface WritingDirectionContext {\n /**\n * The current writing direction that is being inherited.\n */\n dir: Dir;\n\n /**\n * Toggles the current writing direction for the first parent `Dir` component.\n */\n toggleDir(): void;\n}\n\n/** @internal */\ninterface InheritableContext extends WritingDirectionContext {\n root: boolean;\n}\n\nconst context = createContext<InheritableContext>({\n root: true,\n dir: \"ltr\",\n toggleDir: () => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"Tried to toggle the current writing direction without initializing the `Dir` component.\"\n );\n }\n },\n});\ncontext.displayName = \"WritingDirection\";\nconst { Provider } = context;\n\n/**\n * Gets the writing direction context which provides access to the current `dir`\n * and a `toggleDir` function.\n *\n * @example Manually Changing the Writing Direction\n * ```tsx\n * import { useDir } from \"@react-md/core\";\n *\n * function Example() {\n * const { dir, toggleDir } = useDir();\n *\n * return (\n * <>\n * <p>{`The current dir is: \"${dir}\"`}</p>\n * <button type=\"button\" onClick={toggleDir}>Toggle</button>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useDir(): Readonly<WritingDirectionContext> {\n const { root: _root, ...current } = useContext(context);\n return current;\n}\n\n/** @since 6.0.0 */\nexport interface WritingDirectionProviderProps {\n /**\n * A single ReactElement child. If the `WritingDirection` has a parent\n * `WritingDirection`, the child will have the `dir` prop cloned into this\n * element.\n */\n children: ReactElement<{ dir?: Dir }> | ReactNode;\n\n /**\n * The default writing direction for your app or a subtree. To change the\n * current writing direction, use the `useDir` hook to get access to the\n * current `dir` and the `toggleDir` function.\n *\n * @defaultValue `\"ltr\"`\n * @see {@link DEFAULT_WRITING_DIRECTION}\n */\n defaultDir?: DefaultDir;\n}\n\n/**\n * In the browser, this will default to the `<html>`'s `dir` value if one\n * exists. If the `dir` attribute does not exist, it will default to `\"ltr\"`.\n *\n * In node environments, this will default to `\"ltr\"`.\n *\n * @since 6.0.0
|
|
1
|
+
{"version":3,"sources":["../../src/typography/WritingDirectionProvider.tsx"],"sourcesContent":["\"use client\";\nimport {\n Children,\n cloneElement,\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { type UseStateInitializer } from \"../types.js\";\n\n/**\n * Note: unlike the `dir` DOM attribute, the `\"auto\"` value is not supported.\n *\n * @since 6.0.0\n */\nexport type Dir = \"ltr\" | \"rtl\";\n\n/** @since 6.0.0 */\nexport type DefaultDir = UseStateInitializer<Dir>;\n\n/** @since 2.3.0 */\nexport interface WritingDirectionContext {\n /**\n * The current writing direction that is being inherited.\n */\n dir: Dir;\n\n /**\n * Toggles the current writing direction for the first parent `Dir` component.\n */\n toggleDir(): void;\n}\n\n/** @internal */\ninterface InheritableContext extends WritingDirectionContext {\n root: boolean;\n}\n\nconst context = createContext<InheritableContext>({\n root: true,\n dir: \"ltr\",\n toggleDir: () => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"Tried to toggle the current writing direction without initializing the `Dir` component.\"\n );\n }\n },\n});\ncontext.displayName = \"WritingDirection\";\nconst { Provider } = context;\n\n/**\n * Gets the writing direction context which provides access to the current `dir`\n * and a `toggleDir` function.\n *\n * @example Manually Changing the Writing Direction\n * ```tsx\n * import { useDir } from \"@react-md/core\";\n *\n * function Example() {\n * const { dir, toggleDir } = useDir();\n *\n * return (\n * <>\n * <p>{`The current dir is: \"${dir}\"`}</p>\n * <button type=\"button\" onClick={toggleDir}>Toggle</button>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useDir(): Readonly<WritingDirectionContext> {\n const { root: _root, ...current } = useContext(context);\n return current;\n}\n\n/** @since 6.0.0 */\nexport interface WritingDirectionProviderProps {\n /**\n * A single ReactElement child. If the `WritingDirection` has a parent\n * `WritingDirection`, the child will have the `dir` prop cloned into this\n * element.\n */\n children: ReactElement<{ dir?: Dir }> | ReactNode;\n\n /**\n * The default writing direction for your app or a subtree. To change the\n * current writing direction, use the `useDir` hook to get access to the\n * current `dir` and the `toggleDir` function.\n *\n * @defaultValue `\"ltr\"`\n * @see {@link DEFAULT_WRITING_DIRECTION}\n */\n defaultDir?: DefaultDir;\n}\n\n/**\n * In the browser, this will default to the `<html>`'s `dir` value if one\n * exists. If the `dir` attribute does not exist, it will default to `\"ltr\"`.\n *\n * In node environments, this will default to `\"ltr\"`.\n *\n * @since 6.0.0 Renamed from `DEFAULT_DIR`\n */\nexport const DEFAULT_WRITING_DIRECTION = (): Dir => {\n let dir: Dir = \"ltr\";\n if (typeof document !== \"undefined\") {\n const rootDir = document.documentElement.getAttribute(\"dir\");\n dir = rootDir === \"rtl\" ? \"rtl\" : \"ltr\";\n }\n\n return dir;\n};\n\n/**\n * **Client Component**\n *\n * The `WritingDirection` component is used to handle the current writing\n * direction within your app as well as conditionally updating the writing\n * direction for small sections in your app. When this component is used for the\n * first time near the root of your React component tree, the current direction\n * will be applied to the root `<html>` element. Otherwise the current dir will\n * be cloned into the child element so it can be passed as a prop.\n *\n * Note: Since the `dir` is cloned into the child element, you need to make sure\n * that the child is either a DOM element or the `dir` prop is passed from your\n * custom component.\n *\n * @example Root Setup\n * ```tsx\n * import { createRoot } from \"react-dom/client\";\n * import { WritingDirection } from \"@react-md/core\";\n * import App from \"./App.js\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * root.render(\n * <WritingDirection>\n * <App />\n * </WritingDirection>\n * );\n * ```\n *\n * @example Supporting RTL Languages\n * ```tsx\n * import { createRoot } from \"react-dom/client\";\n * import { WritingDirection } from \"@react-md/core\";\n * import type { Dir } from \"@react-md/core\";\n * import App from \"./App.js\":\n *\n * const container = document.getElementById(\"root\");\n * const root = createRoot(container);\n *\n * // see https://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code\n * const SUPPORTED_RTL_LANGUAGES = [\n * \"ar\",\n * \"arc\",\n * \"ckb\",\n * \"dv\",\n * \"fa\",\n * \"ha\",\n * \"he\",\n * \"khw\",\n * \"ks\",\n * \"ps\",\n * \"sd\",\n * \"ur\",\n * \"uz_AF\",\n * \"ti\",\n * ];\n *\n * const defaultDir = (): Dir => {\n * if (SUPPORTED_RTL_LANGUAGES.includes(navigator.language)) {\n * return \"rtl\"\n * }\n *\n * return \"ltr\";\n * }\n *\n * root.render(\n * <WritingDirection defaultDir={defaultDir}>\n * <App />\n * </WritingDirection>\n * );\n * ```\n *\n * @since 6.0.0 Renamed from `Dir`\n */\nexport function WritingDirectionProvider(\n props: WritingDirectionProviderProps\n): ReactElement {\n const { children, defaultDir = DEFAULT_WRITING_DIRECTION } = props;\n const { root } = useContext(context);\n const [dir, setDir] = useState(defaultDir);\n useEffect(() => {\n if (!root || typeof document === \"undefined\") {\n return;\n }\n\n document.documentElement.setAttribute(\"dir\", dir);\n\n return () => {\n document.documentElement.removeAttribute(\"dir\");\n };\n }, [dir, root]);\n\n const toggleDir = useCallback(() => {\n setDir((prevDir) => (prevDir === \"ltr\" ? \"rtl\" : \"ltr\"));\n }, []);\n\n const value = useMemo<InheritableContext>(\n () => ({ root: false, dir, toggleDir }),\n [dir, toggleDir]\n );\n let child = Children.only(children);\n if (!root && isValidElement<{ dir: Dir }>(child)) {\n child = cloneElement(child, { dir });\n }\n\n return <Provider value={value}>{child}</Provider>;\n}\n"],"names":["Children","cloneElement","createContext","isValidElement","useCallback","useContext","useEffect","useMemo","useState","context","root","dir","toggleDir","process","env","NODE_ENV","Error","displayName","Provider","useDir","_root","current","DEFAULT_WRITING_DIRECTION","document","rootDir","documentElement","getAttribute","WritingDirectionProvider","props","children","defaultDir","setDir","setAttribute","removeAttribute","prevDir","value","child","only"],"mappings":"AAAA;;AACA,SACEA,QAAQ,EACRC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QAGH,QAAQ;AA+Bf,MAAMC,wBAAUP,cAAkC;IAChDQ,MAAM;IACNC,KAAK;IACLC,WAAW;QACT,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,MAAM,IAAIC,MACR;QAEJ;IACF;AACF;AACAP,QAAQQ,WAAW,GAAG;AACtB,MAAM,EAAEC,QAAQ,EAAE,GAAGT;AAErB;;;;;;;;;;;;;;;;;;;;;CAqBC,GACD,OAAO,SAASU;IACd,MAAM,EAAET,MAAMU,KAAK,EAAE,GAAGC,SAAS,GAAGhB,WAAWI;IAC/C,OAAOY;AACT;AAsBA;;;;;;;CAOC,GACD,OAAO,MAAMC,4BAA4B;IACvC,IAAIX,MAAW;IACf,IAAI,OAAOY,aAAa,aAAa;QACnC,MAAMC,UAAUD,SAASE,eAAe,CAACC,YAAY,CAAC;QACtDf,MAAMa,YAAY,QAAQ,QAAQ;IACpC;IAEA,OAAOb;AACT,EAAE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0EC,GACD,OAAO,SAASgB,yBACdC,KAAoC;IAEpC,MAAM,EAAEC,QAAQ,EAAEC,aAAaR,yBAAyB,EAAE,GAAGM;IAC7D,MAAM,EAAElB,IAAI,EAAE,GAAGL,WAAWI;IAC5B,MAAM,CAACE,KAAKoB,OAAO,GAAGvB,SAASsB;IAC/BxB,UAAU;QACR,IAAI,CAACI,QAAQ,OAAOa,aAAa,aAAa;YAC5C;QACF;QAEAA,SAASE,eAAe,CAACO,YAAY,CAAC,OAAOrB;QAE7C,OAAO;YACLY,SAASE,eAAe,CAACQ,eAAe,CAAC;QAC3C;IACF,GAAG;QAACtB;QAAKD;KAAK;IAEd,MAAME,YAAYR,YAAY;QAC5B2B,OAAO,CAACG,UAAaA,YAAY,QAAQ,QAAQ;IACnD,GAAG,EAAE;IAEL,MAAMC,QAAQ5B,QACZ,IAAO,CAAA;YAAEG,MAAM;YAAOC;YAAKC;QAAU,CAAA,GACrC;QAACD;QAAKC;KAAU;IAElB,IAAIwB,QAAQpC,SAASqC,IAAI,CAACR;IAC1B,IAAI,CAACnB,sBAAQP,eAA6BiC,QAAQ;QAChDA,sBAAQnC,aAAamC,OAAO;YAAEzB;QAAI;IACpC;IAEA,qBAAO,KAACO;QAASiB,OAAOA;kBAAQC;;AAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/typography/textContainerStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-line-length\"?: string | number;\n \"--rmd-text-container-padding\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-text-container\");\n\n/**\n * @since 6.0.0\n */\nexport interface TextContainerClassNameOptions {\n /**\n * An optional className to merge with typography text container styles.\n */\n className?: string;\n}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { textContainer, Typography } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <main className={textContainer()}>\n * <Typography type=\"headline-1\">Heading</Typography>\n * <Typography>\n * Pretend this is a giant paragraph of text that wraps multiple lines.\n * </Typography>\n * <Typography>\n * Pretend this is another giant paragraph of text that wraps multiple\n * lines.\n * </Typography>\n * </main>\n * ):\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function textContainer(\n options: TextContainerClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(), className);\n}\n"],"names":["cnb","bem","styles","textContainer","options","className"],"
|
|
1
|
+
{"version":3,"sources":["../../src/typography/textContainerStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-line-length\"?: string | number;\n \"--rmd-text-container-padding\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-text-container\");\n\n/**\n * @since 6.0.0\n */\nexport interface TextContainerClassNameOptions {\n /**\n * An optional className to merge with typography text container styles.\n */\n className?: string;\n}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { textContainer, Typography } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <main className={textContainer()}>\n * <Typography type=\"headline-1\">Heading</Typography>\n * <Typography>\n * Pretend this is a giant paragraph of text that wraps multiple lines.\n * </Typography>\n * <Typography>\n * Pretend this is another giant paragraph of text that wraps multiple\n * lines.\n * </Typography>\n * </main>\n * ):\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function textContainer(\n options: TextContainerClassNameOptions = {}\n): string {\n const { className } = options;\n\n return cnb(styles(), className);\n}\n"],"names":["cnb","bem","styles","textContainer","options","className"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,GAAG,QAAQ,kBAAkB;AAStC,MAAMC,SAASD,IAAI;AAYnB;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,SAASE,cACdC,UAAyC,CAAC,CAAC;IAE3C,MAAM,EAAEC,SAAS,EAAE,GAAGD;IAEtB,OAAOJ,IAAIE,UAAUG;AACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/typography/typographyStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils, type TextCssUtilsOptions } from \"../cssUtils.js\";\n\n/**\n * A union of all the material design provided typography styles. When used with\n * the Typography component, this will generate the correct typography className\n * to apply and determine what component to be rendered as if none was provided.\n *\n * @since 4.0.0\n */\nexport type TypographyType =\n | \"headline-1\"\n | \"headline-2\"\n | \"headline-3\"\n | \"headline-4\"\n | \"headline-5\"\n | \"headline-6\"\n | \"subtitle-1\"\n | \"subtitle-2\"\n | \"body-1\"\n | \"body-2\"\n | \"caption\"\n | \"overline\";\n\n/** @since 6.0.0 */\nexport interface TypographyClassNameOptions extends TextCssUtilsOptions {\n className?: string;\n\n /**\n * @see {@link TypographyType}\n * @defaultValue `\"body-1\"`\n */\n type?: TypographyType;\n}\n\n/** @since 6.0.0 */\nexport type NullableTypographyClassNameOptions = Omit<\n TypographyClassNameOptions,\n \"type\"\n> & {\n /**\n * When using the {@link typography} class name utility, the `type` can be set\n * to `null` to inherit font.\n *\n * @see {@link TypographyType}\n * @defaultValue `\"body-1\"`\n */\n type?: TypographyType | null;\n};\n\n/**\n * Get a typography class name based on different typography options. This is\n * only useful if you are unable to use the {@link Typography} component for\n * some reason.\n *\n * @example Simple Example\n * ```ts\n * import { typography } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <>\n * <h1 className={typography({ type: \"headline-1\" })} />\n * <h2 className={typography({ type: \"headline-2\" })} />\n * <h3 className={typography({ type: \"headline-3\" })} />\n * <h4 className={typography({ type: \"headline-4\" })} />\n * <h5 className={typography({ type: \"headline-5\" })} />\n * <h6 className={typography({ type: \"headline-6\" })} />\n * <h5 className={typography({ type: \"subtitle-1\" })} />\n * <h6 className={typography({ type: \"subtitle-2\" })} />\n * <p className={typography()} />\n * <p className={typography({ type \"body-1\" })} />\n * <p className={typography({ type \"body-1\" })} />\n * <caption className={typography({ type: \"caption\" })} />\n * <span className={typography({ type: \"overline\" })} />\n * </>\n * );\n * }\n * ```\n *\n * @example Applying Additional Styles\n * ```ts\n * import { typography } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <>\n * <h1\n * // only maintain the default margin-bottom\n * className={typography({\n * type: \"headline-1\",\n * margin: \"bottom\",\n * })}\n * />\n *\n * <h2\n * // remove all default margin\n * className={typography({\n * type: \"headline-2\",\n * margin: \"none\",\n * })}\n * />\n *\n * <h3\n * // only maintain the default margin-top\n * className={typography({\n * type: \"headline-3\",\n * margin: \"top\",\n * })}\n * />\n *\n * <p\n * // center the text, set to bold, and only maintain default margin-bottom\n * className={typography({\n * type \"subtitle-1\",\n * align: \"center\",\n * margin: \"bottom\",\n * })}\n * />\n * </>\n * );\n * }\n * ```\n *\n * @see {@link Typography}\n * @param options - An optional object of options used to create the typography\n * class name.\n * @returns a typography class name string\n * @since 6.0.0\n */\nexport function typography(\n options: NullableTypographyClassNameOptions = {}\n): string {\n const { type = \"body-1\" } = options;\n\n // using `&&` instead of `bem` since the latest version of typescript does not\n // support setting the same object key (empty string)\n return cnb(\n \"rmd-typography\",\n type && `rmd-typography--${type}`,\n cssUtils(options)\n );\n}\n"],"names":["cnb","cssUtils","typography","options","type"],"
|
|
1
|
+
{"version":3,"sources":["../../src/typography/typographyStyles.ts"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { cssUtils, type TextCssUtilsOptions } from \"../cssUtils.js\";\n\n/**\n * A union of all the material design provided typography styles. When used with\n * the Typography component, this will generate the correct typography className\n * to apply and determine what component to be rendered as if none was provided.\n *\n * @since 4.0.0\n */\nexport type TypographyType =\n | \"headline-1\"\n | \"headline-2\"\n | \"headline-3\"\n | \"headline-4\"\n | \"headline-5\"\n | \"headline-6\"\n | \"subtitle-1\"\n | \"subtitle-2\"\n | \"body-1\"\n | \"body-2\"\n | \"caption\"\n | \"overline\";\n\n/** @since 6.0.0 */\nexport interface TypographyClassNameOptions extends TextCssUtilsOptions {\n className?: string;\n\n /**\n * @see {@link TypographyType}\n * @defaultValue `\"body-1\"`\n */\n type?: TypographyType;\n}\n\n/** @since 6.0.0 */\nexport type NullableTypographyClassNameOptions = Omit<\n TypographyClassNameOptions,\n \"type\"\n> & {\n /**\n * When using the {@link typography} class name utility, the `type` can be set\n * to `null` to inherit font.\n *\n * @see {@link TypographyType}\n * @defaultValue `\"body-1\"`\n */\n type?: TypographyType | null;\n};\n\n/**\n * Get a typography class name based on different typography options. This is\n * only useful if you are unable to use the {@link Typography} component for\n * some reason.\n *\n * @example Simple Example\n * ```ts\n * import { typography } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <>\n * <h1 className={typography({ type: \"headline-1\" })} />\n * <h2 className={typography({ type: \"headline-2\" })} />\n * <h3 className={typography({ type: \"headline-3\" })} />\n * <h4 className={typography({ type: \"headline-4\" })} />\n * <h5 className={typography({ type: \"headline-5\" })} />\n * <h6 className={typography({ type: \"headline-6\" })} />\n * <h5 className={typography({ type: \"subtitle-1\" })} />\n * <h6 className={typography({ type: \"subtitle-2\" })} />\n * <p className={typography()} />\n * <p className={typography({ type \"body-1\" })} />\n * <p className={typography({ type \"body-1\" })} />\n * <caption className={typography({ type: \"caption\" })} />\n * <span className={typography({ type: \"overline\" })} />\n * </>\n * );\n * }\n * ```\n *\n * @example Applying Additional Styles\n * ```ts\n * import { typography } from \"@react-md/core\";\n *\n * function Example() {\n * return (\n * <>\n * <h1\n * // only maintain the default margin-bottom\n * className={typography({\n * type: \"headline-1\",\n * margin: \"bottom\",\n * })}\n * />\n *\n * <h2\n * // remove all default margin\n * className={typography({\n * type: \"headline-2\",\n * margin: \"none\",\n * })}\n * />\n *\n * <h3\n * // only maintain the default margin-top\n * className={typography({\n * type: \"headline-3\",\n * margin: \"top\",\n * })}\n * />\n *\n * <p\n * // center the text, set to bold, and only maintain default margin-bottom\n * className={typography({\n * type \"subtitle-1\",\n * align: \"center\",\n * margin: \"bottom\",\n * })}\n * />\n * </>\n * );\n * }\n * ```\n *\n * @see {@link Typography}\n * @param options - An optional object of options used to create the typography\n * class name.\n * @returns a typography class name string\n * @since 6.0.0\n */\nexport function typography(\n options: NullableTypographyClassNameOptions = {}\n): string {\n const { type = \"body-1\" } = options;\n\n // using `&&` instead of `bem` since the latest version of typescript does not\n // support setting the same object key (empty string)\n return cnb(\n \"rmd-typography\",\n type && `rmd-typography--${type}`,\n cssUtils(options)\n );\n}\n"],"names":["cnb","cssUtils","typography","options","type"],"mappings":"AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,QAAkC,iBAAiB;AAiDpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+EC,GACD,OAAO,SAASC,WACdC,UAA8C,CAAC,CAAC;IAEhD,MAAM,EAAEC,OAAO,QAAQ,EAAE,GAAGD;IAE5B,8EAA8E;IAC9E,qDAAqD;IACrD,OAAOH,IACL,kBACAI,QAAQ,CAAC,gBAAgB,EAAEA,KAAK,CAAC,EACjCH,SAASE;AAEb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/useAsyncFunction.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport type { NonNullRef, UseStateSetter } from \"./types.js\";\nimport { useUnmounted } from \"./useUnmounted.js\";\n\n/**\n * @since 6.0.0\n */\nexport type AsyncFunction<Args extends unknown[]> = (\n ...args: Args\n) => Promise<void>;\n\n/**\n * @since 6.0.0\n */\nexport type HandleAsyncFunction = <Args extends unknown[]>(\n action: AsyncFunction<Args>\n) => AsyncFunction<Args>;\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncFunctionHookOptions {\n /** @defaultValue `false` */\n disabled?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncFunctionHookImplementation {\n pending: boolean;\n unmounted: NonNullRef<boolean>;\n setPending: UseStateSetter<boolean>;\n handleAsync: HandleAsyncFunction;\n}\n\n/**\n * A simple utility hook for triggering a pending state while an async function\n * is running. This is really only useful if you aren't using something like\n * `react-query`, `@reduxjs/toolkit/query`, `@apollo/client`, etc for API calls\n * which have a built-in pending state for mutations.\n *\n * @example Simple Example (Async Button)\n * ```tsx\n * import type { ButtonProps } from \"@react-md/core\";\n * import { box, Button, CircularProgress, useAsyncFunction } from \"@react-md/core\";\n * import { cnb } from \"cnbuilder\";\n * import type { MouseEvent, ReactElement } from \"react\";\n *\n * import styles from \"./AsyncButton.module.scss\";\n *\n * export interface AsyncButtonProps extends ButtonProps {\n * onClick(event: MouseEvent<HTMLButtonElement>): Promise<void>;\n * }\n *\n * export function AsyncButton(props: AsyncButtonProps): ReactElement {\n * const { onClick, children, theme, className, disabled, ...remaining } = props;\n * const { handleAsync, pending } = useAsyncFunction({ disabled });\n *\n * return (\n * <Button\n * {...remaining}\n * aria-disabled={pending || undefined}\n * disabled={disabled}\n * className={cnb(pending && styles.loading, className)}\n * theme={pending ? \"disabled\" : theme}\n * onClick={handleAsync(onClick)}\n * >\n * {children}\n * {pending && (\n * <span\n * className={box({\n * align: \"center\",\n * disablePadding: true,\n * className: styles.overlay,\n * })}\n * >\n * <CircularProgress />\n * </span>\n * )}\n * </Button>\n * );\n * }\n *\n * // `AsyncButton.module.scss`\n * // hide everything in the button except for the overlay containing the circular\n * // progress\n * .loading > *:not(.overlay) {\n * opacity: 0;\n * }\n *\n * .overlay {\n * border-radius: inherit;\n * box-shadow: inherit;\n * inset: 0;\n * position: absolute;\n * z-index: 1;\n * }\n * ```\n *\n * @example Confirmation Dialog with Overlay\n * ```tsx\n * import {\n * Button,\n * DialogHeader,\n * DialogContent,\n * DialogFooter,\n * Form,\n * useAsyncFunction,\n * } from \"@react-md/core\";\n * import CloseIcon from \"@react-md/material-icons/CloseIcon\";\n * import type { ReactElement } from \"react\";\n * import { useId } from \"react\";\n *\n * interface ExampleProps {\n * hide(); void;\n * submit(): Promise<void>\n * }\n *\n * function Example({ hide, submit }: ExampleProps): ReactElement {\n * const { handleAsync, pending } = useAsyncFunction();\n * const formId = useId();\n *\n * return (\n * <>\n * <DialogHeader>\n * <DialogTitle>Some Title</DialogTitle>\n * <Button aria-label=\"Close\" onClick={hide} disabled={pending}>\n * <CloseIcon />\n * </Button>\n * </DialogHeader>\n * <DialogContent>\n * <Form\n * id={formId}\n * onReset={hide}\n * onSubmit={handleAsync(submit)}\n * >\n * // pretend content\n * </Form>\n * </DialogContent>\n * <DialogFooter>\n * <Button\n * type=\"reset\"\n * form={formId}\n * disabled={pending}\n * >\n * Cancel\n * </Button>\n * <Button\n * type=\"submit\"\n * form={formId}\n * disabled={pending}\n * >\n * Confirm\n * </Button>\n * </DialogFooter>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useAsyncFunction(\n options: AsyncFunctionHookOptions = {}\n): AsyncFunctionHookImplementation {\n const { disabled } = options;\n\n const [pending, setPending] = useState(false);\n const unmounted = useUnmounted();\n\n const handleAsync = useCallback<HandleAsyncFunction>(\n (action) =>\n async (...args) => {\n if (pending || disabled) {\n return;\n }\n\n setPending(true);\n try {\n await action(...args);\n } finally {\n if (!unmounted.current) {\n setPending(false);\n }\n }\n },\n [disabled, pending, unmounted]\n );\n\n return {\n pending,\n unmounted,\n setPending,\n handleAsync,\n };\n}\n"],"names":["useCallback","useState","useUnmounted","useAsyncFunction","options","disabled","pending","setPending","unmounted","handleAsync","action","args","current"],"
|
|
1
|
+
{"version":3,"sources":["../src/useAsyncFunction.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport type { NonNullRef, UseStateSetter } from \"./types.js\";\nimport { useUnmounted } from \"./useUnmounted.js\";\n\n/**\n * @since 6.0.0\n */\nexport type AsyncFunction<Args extends unknown[]> = (\n ...args: Args\n) => Promise<void>;\n\n/**\n * @since 6.0.0\n */\nexport type HandleAsyncFunction = <Args extends unknown[]>(\n action: AsyncFunction<Args>\n) => AsyncFunction<Args>;\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncFunctionHookOptions {\n /** @defaultValue `false` */\n disabled?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncFunctionHookImplementation {\n pending: boolean;\n unmounted: NonNullRef<boolean>;\n setPending: UseStateSetter<boolean>;\n handleAsync: HandleAsyncFunction;\n}\n\n/**\n * A simple utility hook for triggering a pending state while an async function\n * is running. This is really only useful if you aren't using something like\n * `react-query`, `@reduxjs/toolkit/query`, `@apollo/client`, etc for API calls\n * which have a built-in pending state for mutations.\n *\n * @example Simple Example (Async Button)\n * ```tsx\n * import type { ButtonProps } from \"@react-md/core\";\n * import { box, Button, CircularProgress, useAsyncFunction } from \"@react-md/core\";\n * import { cnb } from \"cnbuilder\";\n * import type { MouseEvent, ReactElement } from \"react\";\n *\n * import styles from \"./AsyncButton.module.scss\";\n *\n * export interface AsyncButtonProps extends ButtonProps {\n * onClick(event: MouseEvent<HTMLButtonElement>): Promise<void>;\n * }\n *\n * export function AsyncButton(props: AsyncButtonProps): ReactElement {\n * const { onClick, children, theme, className, disabled, ...remaining } = props;\n * const { handleAsync, pending } = useAsyncFunction({ disabled });\n *\n * return (\n * <Button\n * {...remaining}\n * aria-disabled={pending || undefined}\n * disabled={disabled}\n * className={cnb(pending && styles.loading, className)}\n * theme={pending ? \"disabled\" : theme}\n * onClick={handleAsync(onClick)}\n * >\n * {children}\n * {pending && (\n * <span\n * className={box({\n * align: \"center\",\n * disablePadding: true,\n * className: styles.overlay,\n * })}\n * >\n * <CircularProgress />\n * </span>\n * )}\n * </Button>\n * );\n * }\n *\n * // `AsyncButton.module.scss`\n * // hide everything in the button except for the overlay containing the circular\n * // progress\n * .loading > *:not(.overlay) {\n * opacity: 0;\n * }\n *\n * .overlay {\n * border-radius: inherit;\n * box-shadow: inherit;\n * inset: 0;\n * position: absolute;\n * z-index: 1;\n * }\n * ```\n *\n * @example Confirmation Dialog with Overlay\n * ```tsx\n * import {\n * Button,\n * DialogHeader,\n * DialogContent,\n * DialogFooter,\n * Form,\n * useAsyncFunction,\n * } from \"@react-md/core\";\n * import CloseIcon from \"@react-md/material-icons/CloseIcon\";\n * import type { ReactElement } from \"react\";\n * import { useId } from \"react\";\n *\n * interface ExampleProps {\n * hide(); void;\n * submit(): Promise<void>\n * }\n *\n * function Example({ hide, submit }: ExampleProps): ReactElement {\n * const { handleAsync, pending } = useAsyncFunction();\n * const formId = useId();\n *\n * return (\n * <>\n * <DialogHeader>\n * <DialogTitle>Some Title</DialogTitle>\n * <Button aria-label=\"Close\" onClick={hide} disabled={pending}>\n * <CloseIcon />\n * </Button>\n * </DialogHeader>\n * <DialogContent>\n * <Form\n * id={formId}\n * onReset={hide}\n * onSubmit={handleAsync(submit)}\n * >\n * // pretend content\n * </Form>\n * </DialogContent>\n * <DialogFooter>\n * <Button\n * type=\"reset\"\n * form={formId}\n * disabled={pending}\n * >\n * Cancel\n * </Button>\n * <Button\n * type=\"submit\"\n * form={formId}\n * disabled={pending}\n * >\n * Confirm\n * </Button>\n * </DialogFooter>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useAsyncFunction(\n options: AsyncFunctionHookOptions = {}\n): AsyncFunctionHookImplementation {\n const { disabled } = options;\n\n const [pending, setPending] = useState(false);\n const unmounted = useUnmounted();\n\n const handleAsync = useCallback<HandleAsyncFunction>(\n (action) =>\n async (...args) => {\n if (pending || disabled) {\n return;\n }\n\n setPending(true);\n try {\n await action(...args);\n } finally {\n if (!unmounted.current) {\n setPending(false);\n }\n }\n },\n [disabled, pending, unmounted]\n );\n\n return {\n pending,\n unmounted,\n setPending,\n handleAsync,\n };\n}\n"],"names":["useCallback","useState","useUnmounted","useAsyncFunction","options","disabled","pending","setPending","unmounted","handleAsync","action","args","current"],"mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAE9C,SAASC,YAAY,QAAQ,oBAAoB;AAkCjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8HC,GACD,OAAO,SAASC,iBACdC,UAAoC,CAAC,CAAC;IAEtC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,MAAM,CAACE,SAASC,WAAW,GAAGN,SAAS;IACvC,MAAMO,YAAYN;IAElB,MAAMO,cAAcT,YAClB,CAACU,SACC,OAAO,GAAGC;YACR,IAAIL,WAAWD,UAAU;gBACvB;YACF;YAEAE,WAAW;YACX,IAAI;gBACF,MAAMG,UAAUC;YAClB,SAAU;gBACR,IAAI,CAACH,UAAUI,OAAO,EAAE;oBACtBL,WAAW;gBACb;YACF;QACF,GACF;QAACF;QAAUC;QAASE;KAAU;IAGhC,OAAO;QACLF;QACAE;QACAD;QACAE;IACF;AACF"}
|