@react-md/core 1.0.0-next.12 → 1.0.0-next.13
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/.turbo/turbo-build.log +22 -22
- package/CHANGELOG.md +30 -0
- package/coverage/clover.xml +255 -3
- package/coverage/coverage-final.json +5 -1
- package/coverage/lcov-report/DefaultNavigationRenderer.tsx.html +298 -0
- package/coverage/lcov-report/Navigation.tsx.html +358 -0
- package/coverage/lcov-report/app-bar/AppBar.tsx.html +125 -134
- package/coverage/lcov-report/app-bar/AppBarTitle.tsx.html +54 -75
- package/coverage/lcov-report/app-bar/index.html +24 -9
- package/coverage/lcov-report/autocomplete/Autocomplete.tsx.html +34 -181
- package/coverage/lcov-report/autocomplete/AutocompleteGeneric.tsx.html +1 -1
- package/coverage/lcov-report/autocomplete/index.html +11 -11
- package/coverage/lcov-report/autocomplete/useAutocomplete.ts.html +102 -336
- package/coverage/lcov-report/autocomplete/useAutocompleteAgain.ts.html +1 -1
- package/coverage/lcov-report/autocomplete/useAutocompletev2.ts.html +1 -1
- package/coverage/lcov-report/autocomplete/useInlineAutocomplete.ts.html +31 -7
- package/coverage/lcov-report/autocomplete/useInlineSelection.ts.html +67 -4
- package/coverage/lcov-report/autocomplete/utils.ts.html +1 -1
- package/coverage/lcov-report/box/Box.tsx.html +115 -103
- package/coverage/lcov-report/box/index.html +22 -7
- package/coverage/lcov-report/box/styles.ts.html +622 -0
- package/coverage/lcov-report/button/Button.tsx.html +93 -105
- package/coverage/lcov-report/button/TooltippedButton.tsx.html +55 -67
- package/coverage/lcov-report/button/index.html +10 -10
- package/coverage/lcov-report/form/Form.tsx.html +18 -18
- package/coverage/lcov-report/form/Radio.tsx.html +8 -14
- package/coverage/lcov-report/form/index.html +35 -95
- package/coverage/lcov-report/form/useRadioGroup.ts.html +68 -80
- package/coverage/lcov-report/getHrefFromParents.ts.html +133 -0
- package/coverage/lcov-report/icon/FontIcon.tsx.html +65 -65
- package/coverage/lcov-report/icon/index.html +19 -19
- package/coverage/lcov-report/index.html +41 -11
- package/coverage/lcov-report/layout/LayoutNav.tsx.html +74 -86
- package/coverage/lcov-report/layout/Main.tsx.html +47 -38
- package/coverage/lcov-report/layout/index.html +54 -9
- package/coverage/lcov-report/layout/useExpandableLayout.ts.html +275 -89
- package/coverage/lcov-report/layout/useHorizontalLayoutTransition.ts.html +18 -18
- package/coverage/lcov-report/media-queries/AppSizeProvider.tsx.html +79 -64
- package/coverage/lcov-report/media-queries/index.html +18 -18
- package/coverage/lcov-report/navigation/CollapsibleNavGroup.tsx.html +334 -0
- package/coverage/lcov-report/navigation/DefaultNavigationRenderer.tsx.html +298 -0
- package/coverage/lcov-report/navigation/NavGroup.tsx.html +193 -0
- package/coverage/lcov-report/navigation/NavItem.tsx.html +160 -0
- package/coverage/lcov-report/navigation/NavItemButton.tsx.html +397 -0
- package/coverage/lcov-report/navigation/NavItemLink.tsx.html +574 -0
- package/coverage/lcov-report/navigation/NavSubheader.tsx.html +184 -0
- package/coverage/lcov-report/navigation/Navigation.tsx.html +358 -0
- package/coverage/lcov-report/navigation/getHrefFromParents.ts.html +130 -0
- package/coverage/lcov-report/navigation/index.html +146 -0
- package/coverage/lcov-report/navigation/navGroupStyles.ts.html +148 -0
- package/coverage/lcov-report/navigation/navItemStyles.ts.html +298 -0
- package/coverage/lcov-report/sheet/Sheet.tsx.html +50 -56
- package/coverage/lcov-report/sheet/index.html +8 -8
- package/coverage/lcov-report/snackbar/DefaultToastRenderer.tsx.html +307 -304
- package/coverage/lcov-report/snackbar/ToastManager.tsx.html +377 -356
- package/coverage/lcov-report/snackbar/index.html +16 -106
- package/coverage/lcov-report/src/autocomplete/Autocomplete.tsx.html +56 -92
- package/coverage/lcov-report/src/autocomplete/AutocompleteGeneric.tsx.html +1 -1
- package/coverage/lcov-report/src/autocomplete/index.html +11 -11
- package/coverage/lcov-report/src/autocomplete/useAutocomplete.ts.html +513 -111
- package/coverage/lcov-report/src/autocomplete/useAutocompleteAgain.ts.html +7 -7
- package/coverage/lcov-report/src/autocomplete/useAutocompletev2.ts.html +1 -1
- package/coverage/lcov-report/src/autocomplete/useInlineAutocomplete.ts.html +32 -8
- package/coverage/lcov-report/src/autocomplete/useInlineSelection.ts.html +146 -14
- package/coverage/lcov-report/src/autocomplete/utils.ts.html +1 -1
- package/coverage/lcov-report/src/divider/Divider.tsx.html +6 -9
- package/coverage/lcov-report/src/divider/index.html +8 -23
- package/coverage/lcov-report/src/icon/FontIcon.tsx.html +29 -29
- package/coverage/lcov-report/src/icon/index.html +1 -1
- package/coverage/lcov-report/src/index.html +21 -21
- package/coverage/lcov-report/src/layout/LayoutAppBar.tsx.html +33 -42
- package/coverage/lcov-report/src/layout/Main.tsx.html +33 -36
- package/coverage/lcov-report/src/layout/index.html +15 -195
- package/coverage/lcov-report/src/layout/useLayoutAppBarHeight.ts.html +37 -46
- package/coverage/lcov-report/src/list/List.tsx.html +39 -42
- package/coverage/lcov-report/src/list/index.html +10 -130
- package/coverage/lcov-report/src/navigation/CollapsibleNavGroup.tsx.html +367 -0
- package/coverage/lcov-report/src/navigation/DefaultNavigationRenderer.tsx.html +325 -0
- package/coverage/lcov-report/src/navigation/NavGroup.tsx.html +202 -0
- package/coverage/lcov-report/src/navigation/NavItem.tsx.html +172 -0
- package/coverage/lcov-report/src/navigation/NavSubheader.tsx.html +193 -0
- package/coverage/lcov-report/src/navigation/Navigation.tsx.html +358 -0
- package/coverage/lcov-report/src/navigation/index.html +191 -0
- package/coverage/lcov-report/src/tree/Tree.tsx.html +12 -24
- package/coverage/lcov-report/src/tree/index.html +18 -18
- package/coverage/lcov-report/src/useElementSize.ts.html +115 -40
- package/coverage/lcov-report/src/useMutationObserver.ts.html +310 -0
- package/coverage/lcov-report/src/utils/RenderRecursively.tsx.html +151 -52
- package/coverage/lcov-report/src/utils/index.html +10 -10
- package/coverage/lcov-report/test-utils/index.html +21 -21
- package/coverage/lcov-report/test-utils/matchMedia.ts.html +98 -95
- package/coverage/lcov-report/transition/config.ts.html +7 -7
- package/coverage/lcov-report/transition/index.html +1 -1
- package/coverage/lcov-report/useExpandableLayout.ts.html +171 -105
- package/coverage/lcov-report/useMutationObserver.ts.html +310 -0
- package/coverage/lcov-report/utils/index.html +16 -16
- package/coverage/lcov-report/utils/isElementVisible.ts.html +21 -24
- package/coverage/lcov.info +302 -0
- package/dist/CoreProviders.d.ts +3 -3
- package/dist/CoreProviders.js +1 -1
- package/dist/CoreProviders.js.map +1 -1
- package/dist/NoSsr.d.ts +3 -4
- package/dist/NoSsr.js +2 -3
- package/dist/NoSsr.js.map +1 -1
- package/dist/RootHtml.d.ts +3 -4
- package/dist/RootHtml.js +2 -3
- package/dist/RootHtml.js.map +1 -1
- package/dist/SsrProvider.d.ts +3 -3
- package/dist/SsrProvider.js +2 -2
- package/dist/SsrProvider.js.map +1 -1
- package/dist/_core.scss +5 -0
- package/dist/app-bar/AppBar.d.ts +11 -14
- package/dist/app-bar/AppBar.js +3 -5
- package/dist/app-bar/AppBar.js.map +1 -1
- package/dist/app-bar/AppBarTitle.d.ts +7 -9
- package/dist/app-bar/AppBarTitle.js +4 -6
- package/dist/app-bar/AppBarTitle.js.map +1 -1
- package/dist/avatar/Avatar.d.ts +5 -6
- package/dist/avatar/Avatar.js +2 -3
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/avatar/styles.d.ts +4 -4
- package/dist/avatar/styles.js +2 -2
- package/dist/avatar/styles.js.map +1 -1
- package/dist/badge/Badge.d.ts +4 -6
- package/dist/badge/Badge.js +3 -5
- package/dist/badge/Badge.js.map +1 -1
- package/dist/box/Box.d.ts +6 -9
- package/dist/box/Box.js +14 -9
- package/dist/box/Box.js.map +1 -1
- package/dist/box/_box.scss +1 -1
- package/dist/box/styles.d.ts +9 -9
- package/dist/box/styles.js +1 -1
- package/dist/box/styles.js.map +1 -1
- package/dist/button/AsyncButton.d.ts +5 -7
- package/dist/button/AsyncButton.js +3 -5
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/button/Button.d.ts +4 -8
- package/dist/button/Button.js +4 -8
- package/dist/button/Button.js.map +1 -1
- package/dist/button/ButtonUnstyled.d.ts +2 -2
- package/dist/button/ButtonUnstyled.js +1 -1
- package/dist/button/ButtonUnstyled.js.map +1 -1
- package/dist/button/FloatingActionButton.d.ts +5 -5
- package/dist/button/FloatingActionButton.js +2 -2
- package/dist/button/FloatingActionButton.js.map +1 -1
- package/dist/button/TooltippedButton.d.ts +2 -2
- package/dist/button/TooltippedButton.js +2 -5
- package/dist/button/TooltippedButton.js.map +1 -1
- package/dist/button/buttonStyles.d.ts +3 -3
- package/dist/button/buttonStyles.js +1 -1
- package/dist/button/buttonStyles.js.map +1 -1
- package/dist/button/buttonUnstyledStyles.d.ts +2 -2
- package/dist/button/buttonUnstyledStyles.js +1 -1
- package/dist/button/buttonUnstyledStyles.js.map +1 -1
- package/dist/card/Card.d.ts +3 -4
- package/dist/card/Card.js +2 -3
- package/dist/card/Card.js.map +1 -1
- package/dist/card/CardContent.d.ts +2 -4
- package/dist/card/CardContent.js +1 -2
- package/dist/card/CardContent.js.map +1 -1
- package/dist/card/CardFooter.d.ts +2 -2
- package/dist/card/CardFooter.js +1 -1
- package/dist/card/CardFooter.js.map +1 -1
- package/dist/card/CardHeader.d.ts +10 -12
- package/dist/card/CardHeader.js +6 -7
- package/dist/card/CardHeader.js.map +1 -1
- package/dist/card/CardSubtitle.d.ts +2 -2
- package/dist/card/CardSubtitle.js +1 -1
- package/dist/card/CardSubtitle.js.map +1 -1
- package/dist/card/CardTitle.d.ts +2 -2
- package/dist/card/CardTitle.js +1 -1
- package/dist/card/CardTitle.js.map +1 -1
- package/dist/card/ClickableCard.d.ts +3 -4
- package/dist/card/ClickableCard.js +2 -3
- package/dist/card/ClickableCard.js.map +1 -1
- package/dist/card/styles.d.ts +15 -15
- package/dist/card/styles.js +7 -7
- package/dist/card/styles.js.map +1 -1
- package/dist/chip/Chip.d.ts +10 -14
- package/dist/chip/Chip.js +4 -7
- package/dist/chip/Chip.js.map +1 -1
- package/dist/chip/styles.d.ts +4 -4
- package/dist/chip/styles.js +2 -2
- package/dist/chip/styles.js.map +1 -1
- package/dist/cssUtils.d.ts +10 -10
- package/dist/cssUtils.js +1 -1
- package/dist/cssUtils.js.map +1 -1
- package/dist/dialog/Dialog.d.ts +5 -6
- package/dist/dialog/Dialog.js +4 -5
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/DialogContainer.d.ts +2 -2
- package/dist/dialog/DialogContainer.js +1 -1
- package/dist/dialog/DialogContainer.js.map +1 -1
- package/dist/dialog/DialogTitle.d.ts +1 -1
- package/dist/dialog/DialogTitle.js.map +1 -1
- package/dist/dialog/FixedDialog.d.ts +1 -2
- package/dist/dialog/FixedDialog.js +1 -2
- package/dist/dialog/FixedDialog.js.map +1 -1
- package/dist/dialog/styles.d.ts +9 -9
- package/dist/dialog/styles.js +4 -4
- package/dist/dialog/styles.js.map +1 -1
- package/dist/divider/Divider.d.ts +2 -3
- package/dist/divider/Divider.js +1 -2
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/styles.d.ts +2 -2
- package/dist/divider/styles.js +1 -1
- package/dist/divider/styles.js.map +1 -1
- package/dist/draggable/useDraggable.d.ts +17 -18
- package/dist/draggable/useDraggable.js +2 -2
- package/dist/draggable/useDraggable.js.map +1 -1
- package/dist/draggable/utils.d.ts +2 -2
- package/dist/draggable/utils.js +1 -1
- package/dist/draggable/utils.js.map +1 -1
- package/dist/expansion-panel/ExpansionList.d.ts +2 -2
- 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 -9
- package/dist/expansion-panel/ExpansionPanel.js +2 -3
- package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanelHeader.d.ts +3 -4
- package/dist/expansion-panel/ExpansionPanelHeader.js +2 -3
- package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
- package/dist/expansion-panel/useExpansionList.d.ts +5 -6
- package/dist/expansion-panel/useExpansionList.js +4 -5
- package/dist/expansion-panel/useExpansionList.js.map +1 -1
- package/dist/expansion-panel/useExpansionPanels.d.ts +9 -14
- package/dist/expansion-panel/useExpansionPanels.js +3 -6
- package/dist/expansion-panel/useExpansionPanels.js.map +1 -1
- package/dist/focus/useFocusContainer.d.ts +9 -10
- package/dist/focus/useFocusContainer.js +2 -3
- package/dist/focus/useFocusContainer.js.map +1 -1
- package/dist/focus/utils.d.ts +4 -5
- package/dist/focus/utils.js +3 -4
- package/dist/focus/utils.js.map +1 -1
- package/dist/form/Checkbox.d.ts +1 -2
- package/dist/form/Checkbox.js +1 -2
- package/dist/form/Checkbox.js.map +1 -1
- package/dist/form/Fieldset.d.ts +5 -6
- package/dist/form/Fieldset.js +2 -3
- package/dist/form/Fieldset.js.map +1 -1
- package/dist/form/FileInput.d.ts +6 -7
- package/dist/form/FileInput.js +3 -4
- package/dist/form/FileInput.js.map +1 -1
- package/dist/form/FormMessageContainer.d.ts +2 -2
- package/dist/form/FormMessageContainer.js +1 -1
- package/dist/form/FormMessageContainer.js.map +1 -1
- package/dist/form/FormMessageCounter.d.ts +4 -6
- package/dist/form/FormMessageCounter.js +2 -3
- package/dist/form/FormMessageCounter.js.map +1 -1
- package/dist/form/InputToggle.d.ts +11 -12
- package/dist/form/InputToggle.js +1 -1
- package/dist/form/InputToggle.js.map +1 -1
- package/dist/form/InputToggleIcon.d.ts +4 -6
- package/dist/form/InputToggleIcon.js +2 -3
- package/dist/form/InputToggleIcon.js.map +1 -1
- package/dist/form/Label.d.ts +2 -2
- package/dist/form/Label.js +2 -2
- package/dist/form/Label.js.map +1 -1
- package/dist/form/Legend.d.ts +2 -2
- package/dist/form/Legend.js +1 -1
- package/dist/form/Legend.js.map +1 -1
- package/dist/form/MenuItemCheckbox.d.ts +2 -3
- package/dist/form/MenuItemCheckbox.js +2 -3
- package/dist/form/MenuItemCheckbox.js.map +1 -1
- package/dist/form/MenuItemFileInput.d.ts +3 -5
- package/dist/form/MenuItemFileInput.js +2 -3
- package/dist/form/MenuItemFileInput.js.map +1 -1
- package/dist/form/MenuItemInputToggle.d.ts +7 -9
- package/dist/form/MenuItemInputToggle.js +1 -1
- package/dist/form/MenuItemInputToggle.js.map +1 -1
- package/dist/form/MenuItemRadio.d.ts +3 -5
- package/dist/form/MenuItemRadio.js +3 -5
- package/dist/form/MenuItemRadio.js.map +1 -1
- package/dist/form/MenuItemSwitch.d.ts +2 -3
- package/dist/form/MenuItemSwitch.js +2 -3
- package/dist/form/MenuItemSwitch.js.map +1 -1
- package/dist/form/MenuItemTextField.d.ts +2 -2
- package/dist/form/MenuItemTextField.js +1 -1
- package/dist/form/MenuItemTextField.js.map +1 -1
- package/dist/form/NativeSelect.d.ts +3 -5
- package/dist/form/NativeSelect.js +2 -4
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/OptGroup.d.ts +3 -4
- package/dist/form/OptGroup.js +2 -3
- package/dist/form/OptGroup.js.map +1 -1
- package/dist/form/Option.d.ts +5 -7
- package/dist/form/Option.js +3 -4
- package/dist/form/Option.js.map +1 -1
- package/dist/form/Password.d.ts +7 -13
- package/dist/form/Password.js +1 -2
- package/dist/form/Password.js.map +1 -1
- package/dist/form/Radio.d.ts +1 -2
- package/dist/form/Radio.js +1 -2
- package/dist/form/Radio.js.map +1 -1
- package/dist/form/ResizingTextAreaWrapper.d.ts +2 -2
- package/dist/form/ResizingTextAreaWrapper.js +1 -1
- package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
- package/dist/form/Select.d.ts +6 -9
- package/dist/form/Select.js +3 -5
- package/dist/form/Select.js.map +1 -1
- package/dist/form/SelectedOption.d.ts +2 -2
- package/dist/form/SelectedOption.js +1 -1
- package/dist/form/SelectedOption.js.map +1 -1
- package/dist/form/Slider.d.ts +16 -25
- package/dist/form/Slider.js.map +1 -1
- package/dist/form/SliderContainer.d.ts +6 -9
- package/dist/form/SliderContainer.js +2 -3
- package/dist/form/SliderContainer.js.map +1 -1
- package/dist/form/SliderMark.d.ts +2 -2
- package/dist/form/SliderMark.js +1 -1
- package/dist/form/SliderMark.js.map +1 -1
- package/dist/form/SliderMarkLabel.d.ts +3 -3
- package/dist/form/SliderMarkLabel.js +1 -1
- package/dist/form/SliderMarkLabel.js.map +1 -1
- package/dist/form/SliderThumb.d.ts +6 -8
- package/dist/form/SliderThumb.js +3 -4
- package/dist/form/SliderThumb.js.map +1 -1
- package/dist/form/SliderTrack.d.ts +4 -6
- package/dist/form/SliderTrack.js +2 -3
- package/dist/form/SliderTrack.js.map +1 -1
- package/dist/form/SliderValueMarks.d.ts +7 -9
- package/dist/form/SliderValueMarks.js +1 -1
- package/dist/form/SliderValueMarks.js.map +1 -1
- package/dist/form/SliderValueTooltip.d.ts +4 -6
- package/dist/form/SliderValueTooltip.js +2 -3
- package/dist/form/SliderValueTooltip.js.map +1 -1
- package/dist/form/Switch.d.ts +3 -4
- package/dist/form/Switch.js +2 -3
- package/dist/form/Switch.js.map +1 -1
- package/dist/form/TextArea.d.ts +2 -3
- package/dist/form/TextArea.js +1 -2
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextField.d.ts +7 -10
- package/dist/form/TextField.js +2 -4
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/TextFieldAddon.d.ts +3 -3
- package/dist/form/TextFieldAddon.js +1 -1
- package/dist/form/TextFieldAddon.js.map +1 -1
- package/dist/form/fileUtils.d.ts +33 -36
- package/dist/form/fileUtils.js +14 -14
- package/dist/form/fileUtils.js.map +1 -1
- package/dist/form/formConfig.d.ts +2 -2
- package/dist/form/formConfig.js +2 -2
- package/dist/form/formConfig.js.map +1 -1
- package/dist/form/formMessageStyles.d.ts +5 -5
- package/dist/form/formMessageStyles.js +3 -3
- package/dist/form/formMessageStyles.js.map +1 -1
- package/dist/form/inputToggleStyles.d.ts +3 -3
- package/dist/form/inputToggleStyles.js +1 -1
- package/dist/form/inputToggleStyles.js.map +1 -1
- package/dist/form/menuItemInputToggleStyles.d.ts +8 -8
- package/dist/form/menuItemInputToggleStyles.js +4 -4
- package/dist/form/menuItemInputToggleStyles.js.map +1 -1
- package/dist/form/nativeSelectStyles.d.ts +4 -4
- package/dist/form/nativeSelectStyles.js +2 -2
- package/dist/form/nativeSelectStyles.js.map +1 -1
- package/dist/form/optionStyles.d.ts +2 -2
- package/dist/form/optionStyles.js +1 -1
- package/dist/form/optionStyles.js.map +1 -1
- package/dist/form/passwordStyles.d.ts +4 -4
- package/dist/form/passwordStyles.js +1 -1
- package/dist/form/passwordStyles.js.map +1 -1
- package/dist/form/selectStyles.d.ts +2 -2
- package/dist/form/selectStyles.js +1 -1
- package/dist/form/selectStyles.js.map +1 -1
- package/dist/form/selectUtils.d.ts +3 -3
- package/dist/form/selectUtils.js +2 -2
- package/dist/form/selectUtils.js.map +1 -1
- package/dist/form/sliderUtils.d.ts +9 -9
- package/dist/form/sliderUtils.js +4 -4
- package/dist/form/sliderUtils.js.map +1 -1
- package/dist/form/switchStyles.d.ts +2 -2
- package/dist/form/switchStyles.js +1 -1
- package/dist/form/switchStyles.js.map +1 -1
- package/dist/form/textAreaStyles.d.ts +4 -4
- package/dist/form/textAreaStyles.js +2 -2
- package/dist/form/textAreaStyles.js.map +1 -1
- package/dist/form/textFieldContainerStyles.d.ts +2 -2
- package/dist/form/textFieldContainerStyles.js +1 -1
- package/dist/form/textFieldContainerStyles.js.map +1 -1
- package/dist/form/textFieldStyles.d.ts +2 -2
- package/dist/form/textFieldStyles.js +1 -1
- package/dist/form/textFieldStyles.js.map +1 -1
- package/dist/form/types.d.ts +10 -10
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCheckboxGroup.d.ts +15 -20
- package/dist/form/useCheckboxGroup.js.map +1 -1
- package/dist/form/useCombobox.d.ts +16 -16
- package/dist/form/useCombobox.js +2 -2
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useEditableCombobox.d.ts +3 -3
- package/dist/form/useEditableCombobox.js +1 -1
- package/dist/form/useEditableCombobox.js.map +1 -1
- package/dist/form/useFileUpload.d.ts +7 -8
- package/dist/form/useFileUpload.js +1 -1
- package/dist/form/useFileUpload.js.map +1 -1
- package/dist/form/useFormReset.d.ts +2 -2
- package/dist/form/useFormReset.js +1 -1
- package/dist/form/useFormReset.js.map +1 -1
- package/dist/form/useListboxProvider.d.ts +3 -3
- package/dist/form/useListboxProvider.js +2 -2
- package/dist/form/useListboxProvider.js.map +1 -1
- package/dist/form/useNumberField.d.ts +17 -25
- package/dist/form/useNumberField.js.map +1 -1
- package/dist/form/useRadioGroup.d.ts +12 -15
- package/dist/form/useRadioGroup.js +2 -3
- package/dist/form/useRadioGroup.js.map +1 -1
- package/dist/form/useRangeSlider.d.ts +8 -11
- package/dist/form/useRangeSlider.js +3 -5
- package/dist/form/useRangeSlider.js.map +1 -1
- package/dist/form/useSelectCombobox.d.ts +3 -3
- package/dist/form/useSelectCombobox.js +1 -1
- package/dist/form/useSelectCombobox.js.map +1 -1
- package/dist/form/useSlider.d.ts +7 -9
- package/dist/form/useSlider.js +3 -5
- package/dist/form/useSlider.js.map +1 -1
- package/dist/form/useTextField.d.ts +22 -31
- package/dist/form/useTextField.js.map +1 -1
- package/dist/form/utils.d.ts +7 -8
- package/dist/form/utils.js +5 -6
- package/dist/form/utils.js.map +1 -1
- package/dist/form/validation.d.ts +16 -16
- package/dist/form/validation.js +7 -7
- package/dist/form/validation.js.map +1 -1
- package/dist/hoverMode/useHoverMode.d.ts +9 -10
- package/dist/hoverMode/useHoverMode.js.map +1 -1
- package/dist/hoverMode/useHoverModeProvider.d.ts +11 -15
- package/dist/hoverMode/useHoverModeProvider.js +3 -4
- package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
- package/dist/icon/FontIcon.d.ts +1 -1
- package/dist/icon/FontIcon.js +1 -1
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/IconRotator.d.ts +1 -1
- package/dist/icon/IconRotator.js.map +1 -1
- package/dist/icon/MaterialIcon.d.ts +2 -2
- package/dist/icon/MaterialIcon.js +1 -1
- package/dist/icon/MaterialIcon.js.map +1 -1
- package/dist/icon/MaterialSymbol.d.ts +3 -4
- package/dist/icon/MaterialSymbol.js +2 -3
- package/dist/icon/MaterialSymbol.js.map +1 -1
- package/dist/icon/SVGIcon.d.ts +0 -1
- package/dist/icon/SVGIcon.js.map +1 -1
- package/dist/icon/TextIconSpacing.d.ts +3 -5
- package/dist/icon/TextIconSpacing.js +2 -4
- package/dist/icon/TextIconSpacing.js.map +1 -1
- package/dist/icon/iconConfig.d.ts +14 -16
- package/dist/icon/iconConfig.js +5 -7
- package/dist/icon/iconConfig.js.map +1 -1
- package/dist/icon/material.d.ts +4 -4
- package/dist/icon/material.js +1 -1
- package/dist/icon/material.js.map +1 -1
- package/dist/icon/materialConfig.d.ts +12 -12
- package/dist/icon/materialConfig.js +2 -2
- package/dist/icon/materialConfig.js.map +1 -1
- package/dist/icon/styles.d.ts +8 -8
- package/dist/icon/styles.js +2 -2
- package/dist/icon/styles.js.map +1 -1
- package/dist/interaction/UserInteractionModeProvider.d.ts +1 -2
- package/dist/interaction/UserInteractionModeProvider.js +1 -2
- package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
- package/dist/interaction/config.d.ts +2 -2
- package/dist/interaction/config.js +1 -1
- package/dist/interaction/config.js.map +1 -1
- package/dist/interaction/types.d.ts +8 -8
- package/dist/interaction/types.js +1 -1
- package/dist/interaction/types.js.map +1 -1
- package/dist/interaction/useElementInteraction.d.ts +6 -7
- package/dist/interaction/useElementInteraction.js +3 -4
- package/dist/interaction/useElementInteraction.js.map +1 -1
- package/dist/interaction/useHigherContrastChildren.d.ts +2 -3
- package/dist/interaction/useHigherContrastChildren.js +2 -3
- package/dist/interaction/useHigherContrastChildren.js.map +1 -1
- package/dist/layout/LayoutAppBar.d.ts +4 -7
- package/dist/layout/LayoutAppBar.js +3 -6
- package/dist/layout/LayoutAppBar.js.map +1 -1
- package/dist/layout/LayoutNav.d.ts +4 -6
- package/dist/layout/LayoutNav.js +3 -5
- package/dist/layout/LayoutNav.js.map +1 -1
- package/dist/layout/LayoutWindowSplitter.d.ts +3 -4
- package/dist/layout/LayoutWindowSplitter.js +2 -3
- package/dist/layout/LayoutWindowSplitter.js.map +1 -1
- package/dist/layout/Main.d.ts +4 -5
- package/dist/layout/Main.js +2 -3
- package/dist/layout/Main.js.map +1 -1
- package/dist/layout/_layout.scss +12 -1
- package/dist/layout/layoutNavStyles.d.ts +2 -2
- package/dist/layout/layoutNavStyles.js +1 -1
- package/dist/layout/layoutNavStyles.js.map +1 -1
- package/dist/layout/layoutWindowSplitterStyles.d.ts +2 -2
- package/dist/layout/layoutWindowSplitterStyles.js +1 -1
- package/dist/layout/layoutWindowSplitterStyles.js.map +1 -1
- package/dist/layout/mainStyles.d.ts +2 -2
- package/dist/layout/mainStyles.js +1 -1
- package/dist/layout/mainStyles.js.map +1 -1
- package/dist/layout/useExpandableLayout.d.ts +66 -14
- package/dist/layout/useExpandableLayout.js +50 -5
- package/dist/layout/useExpandableLayout.js.map +1 -1
- package/dist/layout/useHorizontalLayoutTransition.d.ts +4 -4
- package/dist/layout/useHorizontalLayoutTransition.js +2 -2
- package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
- package/dist/layout/useLayoutAppBarHeight.d.ts +7 -9
- package/dist/layout/useLayoutAppBarHeight.js +7 -8
- package/dist/layout/useLayoutAppBarHeight.js.map +1 -1
- package/dist/layout/useLayoutTree.d.ts +6 -6
- package/dist/layout/useLayoutTree.js +1 -1
- package/dist/layout/useLayoutTree.js.map +1 -1
- package/dist/layout/useLayoutWindowSplitter.d.ts +5 -6
- package/dist/layout/useLayoutWindowSplitter.js +2 -3
- package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
- package/dist/layout/useMainTabIndex.d.ts +1 -1
- package/dist/layout/useMainTabIndex.js +1 -1
- package/dist/layout/useMainTabIndex.js.map +1 -1
- package/dist/layout/useResizableLayout.d.ts +54 -8
- package/dist/layout/useResizableLayout.js +51 -5
- package/dist/layout/useResizableLayout.js.map +1 -1
- package/dist/layout/useTemporaryLayout.d.ts +12 -12
- package/dist/layout/useTemporaryLayout.js +1 -1
- package/dist/layout/useTemporaryLayout.js.map +1 -1
- package/dist/link/Link.d.ts +10 -13
- package/dist/link/Link.js +5 -7
- package/dist/link/Link.js.map +1 -1
- package/dist/link/SkipToMainContent.d.ts +2 -4
- package/dist/link/SkipToMainContent.js +1 -2
- package/dist/link/SkipToMainContent.js.map +1 -1
- package/dist/link/styles.d.ts +4 -4
- package/dist/link/styles.js +2 -2
- package/dist/link/styles.js.map +1 -1
- package/dist/list/List.d.ts +3 -4
- package/dist/list/List.js +2 -3
- package/dist/list/List.js.map +1 -1
- package/dist/list/ListItem.d.ts +4 -6
- package/dist/list/ListItem.js +2 -4
- package/dist/list/ListItem.js.map +1 -1
- package/dist/list/ListItemChildren.d.ts +1 -2
- package/dist/list/ListItemChildren.js +1 -2
- package/dist/list/ListItemChildren.js.map +1 -1
- package/dist/list/ListSubheader.d.ts +3 -3
- package/dist/list/ListSubheader.js +1 -1
- package/dist/list/ListSubheader.js.map +1 -1
- package/dist/list/getListItemHeight.d.ts +1 -1
- package/dist/list/getListItemHeight.js.map +1 -1
- package/dist/list/listItemStyles.d.ts +9 -9
- package/dist/list/listItemStyles.js +3 -3
- package/dist/list/listItemStyles.js.map +1 -1
- package/dist/list/types.d.ts +11 -11
- package/dist/list/types.js.map +1 -1
- package/dist/media-queries/AppSizeProvider.d.ts +1 -2
- package/dist/media-queries/AppSizeProvider.js +1 -2
- package/dist/media-queries/AppSizeProvider.js.map +1 -1
- package/dist/media-queries/useMediaQuery.d.ts +2 -3
- package/dist/media-queries/useMediaQuery.js +2 -3
- package/dist/media-queries/useMediaQuery.js.map +1 -1
- package/dist/menu/DropdownMenu.d.ts +7 -11
- package/dist/menu/DropdownMenu.js +4 -7
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.d.ts +10 -13
- package/dist/menu/Menu.js +2 -3
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuBar.d.ts +3 -4
- package/dist/menu/MenuBar.js +3 -4
- package/dist/menu/MenuBar.js.map +1 -1
- package/dist/menu/MenuButton.d.ts +8 -8
- package/dist/menu/MenuButton.js +2 -2
- package/dist/menu/MenuButton.js.map +1 -1
- package/dist/menu/MenuConfigurationProvider.d.ts +8 -8
- package/dist/menu/MenuConfigurationProvider.js +5 -5
- package/dist/menu/MenuConfigurationProvider.js.map +1 -1
- package/dist/menu/MenuItem.d.ts +2 -2
- package/dist/menu/MenuItem.js +1 -1
- package/dist/menu/MenuItem.js.map +1 -1
- package/dist/menu/MenuItemButton.d.ts +2 -2
- package/dist/menu/MenuItemButton.js +1 -1
- package/dist/menu/MenuItemButton.js.map +1 -1
- package/dist/menu/MenuItemCircularProgress.d.ts +3 -4
- package/dist/menu/MenuItemCircularProgress.js +2 -3
- package/dist/menu/MenuItemCircularProgress.js.map +1 -1
- package/dist/menu/MenuItemGroup.d.ts +3 -4
- package/dist/menu/MenuItemGroup.js +2 -3
- package/dist/menu/MenuItemGroup.js.map +1 -1
- package/dist/menu/MenuItemSeparator.d.ts +2 -2
- package/dist/menu/MenuItemSeparator.js +1 -1
- package/dist/menu/MenuItemSeparator.js.map +1 -1
- package/dist/menu/MenuSheet.d.ts +7 -9
- package/dist/menu/MenuSheet.js +2 -3
- package/dist/menu/MenuSheet.js.map +1 -1
- package/dist/menu/MenuVisibilityProvider.d.ts +6 -8
- package/dist/menu/MenuVisibilityProvider.js +5 -6
- package/dist/menu/MenuVisibilityProvider.js.map +1 -1
- package/dist/menu/MenuWidget.d.ts +2 -2
- package/dist/menu/MenuWidget.js +1 -1
- package/dist/menu/MenuWidget.js.map +1 -1
- package/dist/menu/MenuWidgetKeyboardProvider.d.ts +2 -2
- package/dist/menu/MenuWidgetKeyboardProvider.js +1 -1
- package/dist/menu/MenuWidgetKeyboardProvider.js.map +1 -1
- package/dist/menu/useContextMenu.d.ts +8 -12
- package/dist/menu/useContextMenu.js +3 -5
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/menu/useMenuBarProvider.d.ts +6 -6
- package/dist/menu/useMenuBarProvider.js +3 -3
- package/dist/menu/useMenuBarProvider.js.map +1 -1
- package/dist/menu/utils.d.ts +2 -2
- package/dist/menu/utils.js +1 -1
- package/dist/menu/utils.js.map +1 -1
- package/dist/movement/constants.d.ts +3 -3
- package/dist/movement/constants.js +3 -3
- package/dist/movement/constants.js.map +1 -1
- package/dist/movement/types.d.ts +16 -17
- package/dist/movement/types.js +1 -1
- package/dist/movement/types.js.map +1 -1
- package/dist/movement/useKeyboardMovementProvider.d.ts +5 -8
- package/dist/movement/useKeyboardMovementProvider.js +6 -9
- package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
- package/dist/movement/utils.d.ts +13 -13
- package/dist/movement/utils.js +10 -10
- package/dist/movement/utils.js.map +1 -1
- package/dist/navigation/CollapsibleNavGroup.d.ts +29 -0
- package/dist/navigation/CollapsibleNavGroup.js +49 -0
- package/dist/navigation/CollapsibleNavGroup.js.map +1 -0
- package/dist/navigation/DefaultNavigationRenderer.d.ts +22 -0
- package/dist/navigation/DefaultNavigationRenderer.js +58 -0
- package/dist/navigation/DefaultNavigationRenderer.js.map +1 -0
- package/dist/navigation/NavGroup.d.ts +18 -0
- package/dist/navigation/NavGroup.js +29 -0
- package/dist/navigation/NavGroup.js.map +1 -0
- package/dist/navigation/NavItem.d.ts +17 -0
- package/dist/navigation/NavItem.js +24 -0
- package/dist/navigation/NavItem.js.map +1 -0
- package/dist/navigation/NavItemButton.d.ts +26 -0
- package/dist/navigation/NavItemButton.js +65 -0
- package/dist/navigation/NavItemButton.js.map +1 -0
- package/dist/navigation/NavItemLink.d.ts +40 -0
- package/dist/navigation/NavItemLink.js +88 -0
- package/dist/navigation/NavItemLink.js.map +1 -0
- package/dist/navigation/NavSubheader.d.ts +16 -0
- package/dist/navigation/NavSubheader.js +26 -0
- package/dist/navigation/NavSubheader.js.map +1 -0
- package/dist/navigation/Navigation.d.ts +31 -0
- package/dist/navigation/Navigation.js +46 -0
- package/dist/navigation/Navigation.js.map +1 -0
- package/dist/navigation/_navigation.scss +99 -0
- package/dist/navigation/getHrefFromParents.d.ts +5 -0
- package/dist/navigation/getHrefFromParents.js +13 -0
- package/dist/navigation/getHrefFromParents.js.map +1 -0
- package/dist/navigation/navGroupStyles.d.ts +11 -0
- package/dist/navigation/navGroupStyles.js +13 -0
- package/dist/navigation/navGroupStyles.js.map +1 -0
- package/dist/navigation/navItemStyles.d.ts +33 -0
- package/dist/navigation/navItemStyles.js +31 -0
- package/dist/navigation/navItemStyles.js.map +1 -0
- package/dist/navigation/types.d.ts +137 -0
- package/dist/navigation/types.js +5 -0
- package/dist/navigation/types.js.map +1 -0
- package/dist/navigation/useActiveHeadingId.d.ts +54 -0
- package/dist/navigation/useActiveHeadingId.js +117 -0
- package/dist/navigation/useActiveHeadingId.js.map +1 -0
- package/dist/overlay/Overlay.d.ts +5 -6
- package/dist/overlay/Overlay.js +2 -3
- package/dist/overlay/Overlay.js.map +1 -1
- package/dist/overlay/overlayStyles.d.ts +4 -4
- package/dist/overlay/overlayStyles.js +3 -3
- package/dist/overlay/overlayStyles.js.map +1 -1
- package/dist/portal/Portal.d.ts +1 -2
- package/dist/portal/Portal.js +1 -2
- package/dist/portal/Portal.js.map +1 -1
- package/dist/portal/PortalContainerProvider.d.ts +4 -4
- package/dist/portal/PortalContainerProvider.js +2 -2
- package/dist/portal/PortalContainerProvider.js.map +1 -1
- package/dist/positioning/createVerticalPosition.d.ts +1 -1
- package/dist/positioning/createVerticalPosition.js.map +1 -1
- package/dist/positioning/getFixedPosition.js +1 -1
- package/dist/positioning/getFixedPosition.js.map +1 -1
- package/dist/positioning/types.d.ts +4 -4
- package/dist/positioning/types.js.map +1 -1
- package/dist/positioning/useFixedPositioning.d.ts +8 -9
- package/dist/positioning/useFixedPositioning.js +2 -3
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/positioning/utils.d.ts +3 -3
- package/dist/positioning/utils.js +1 -1
- package/dist/positioning/utils.js.map +1 -1
- package/dist/progress/CircularProgress.d.ts +7 -10
- package/dist/progress/CircularProgress.js +3 -5
- package/dist/progress/CircularProgress.js.map +1 -1
- package/dist/progress/LinearProgress.d.ts +4 -6
- package/dist/progress/LinearProgress.js +3 -5
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/progress/types.d.ts +5 -5
- package/dist/progress/types.js +1 -1
- package/dist/progress/types.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemContainer.d.ts +10 -15
- package/dist/responsive-item/ResponsiveItemContainer.js +5 -8
- package/dist/responsive-item/ResponsiveItemContainer.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemOverlay.d.ts +6 -7
- package/dist/responsive-item/ResponsiveItemOverlay.js +3 -4
- package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
- package/dist/responsive-item/styles.d.ts +2 -2
- package/dist/responsive-item/styles.js +1 -1
- package/dist/responsive-item/styles.js.map +1 -1
- package/dist/scroll/ScrollLock.d.ts +1 -1
- package/dist/scroll/ScrollLock.js +1 -1
- package/dist/scroll/ScrollLock.js.map +1 -1
- package/dist/scroll/useScrollLock.d.ts +2 -3
- package/dist/scroll/useScrollLock.js +2 -3
- package/dist/scroll/useScrollLock.js.map +1 -1
- package/dist/searching/caseInsensitive.d.ts +9 -13
- package/dist/searching/caseInsensitive.js +1 -1
- package/dist/searching/caseInsensitive.js.map +1 -1
- package/dist/searching/fuzzy.d.ts +4 -5
- package/dist/searching/fuzzy.js +1 -1
- package/dist/searching/fuzzy.js.map +1 -1
- package/dist/searching/toSearchQuery.d.ts +1 -1
- package/dist/searching/toSearchQuery.js +1 -1
- package/dist/searching/toSearchQuery.js.map +1 -1
- package/dist/searching/types.d.ts +2 -2
- package/dist/searching/types.js +1 -1
- package/dist/searching/types.js.map +1 -1
- package/dist/searching/useFuzzyMatch.d.ts +3 -3
- package/dist/searching/useFuzzyMatch.js +1 -1
- package/dist/searching/useFuzzyMatch.js.map +1 -1
- package/dist/searching/utils.d.ts +3 -3
- package/dist/searching/utils.js +2 -2
- package/dist/searching/utils.js.map +1 -1
- package/dist/segmented-button/SegmentedButton.d.ts +3 -4
- package/dist/segmented-button/SegmentedButton.js +2 -3
- package/dist/segmented-button/SegmentedButton.js.map +1 -1
- package/dist/segmented-button/SegmentedButtonContainer.d.ts +3 -4
- package/dist/segmented-button/SegmentedButtonContainer.js +2 -3
- package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
- package/dist/segmented-button/segmentedButtonContainerStyles.d.ts +2 -2
- package/dist/segmented-button/segmentedButtonContainerStyles.js +1 -1
- package/dist/segmented-button/segmentedButtonContainerStyles.js.map +1 -1
- package/dist/segmented-button/segmentedButtonStyles.d.ts +2 -2
- package/dist/segmented-button/segmentedButtonStyles.js +1 -1
- package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
- package/dist/sheet/Sheet.d.ts +1 -1
- package/dist/sheet/Sheet.js.map +1 -1
- package/dist/sheet/styles.d.ts +3 -3
- package/dist/sheet/styles.js +1 -1
- package/dist/sheet/styles.js.map +1 -1
- package/dist/snackbar/DefaultToastRenderer.d.ts +2 -2
- package/dist/snackbar/DefaultToastRenderer.js +1 -1
- package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
- package/dist/snackbar/Snackbar.d.ts +3 -4
- package/dist/snackbar/Snackbar.js +2 -3
- package/dist/snackbar/Snackbar.js.map +1 -1
- package/dist/snackbar/Toast.d.ts +3 -3
- package/dist/snackbar/Toast.js +1 -1
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/snackbar/ToastActionButton.d.ts +2 -2
- package/dist/snackbar/ToastActionButton.js +1 -1
- package/dist/snackbar/ToastActionButton.js.map +1 -1
- package/dist/snackbar/ToastCloseButton.d.ts +2 -2
- package/dist/snackbar/ToastCloseButton.js +1 -1
- package/dist/snackbar/ToastCloseButton.js.map +1 -1
- package/dist/snackbar/ToastContent.d.ts +2 -2
- package/dist/snackbar/ToastContent.js +1 -1
- package/dist/snackbar/ToastContent.js.map +1 -1
- package/dist/snackbar/ToastManager.d.ts +17 -18
- package/dist/snackbar/ToastManager.js +21 -19
- package/dist/snackbar/ToastManager.js.map +1 -1
- package/dist/snackbar/ToastManagerProvider.d.ts +6 -6
- package/dist/snackbar/ToastManagerProvider.js +5 -5
- package/dist/snackbar/ToastManagerProvider.js.map +1 -1
- package/dist/snackbar/snackbarStyles.d.ts +4 -5
- package/dist/snackbar/snackbarStyles.js +1 -1
- package/dist/snackbar/snackbarStyles.js.map +1 -1
- package/dist/snackbar/toastContentStyles.d.ts +2 -2
- package/dist/snackbar/toastContentStyles.js +1 -1
- package/dist/snackbar/toastContentStyles.js.map +1 -1
- package/dist/snackbar/toastStyles.d.ts +2 -2
- package/dist/snackbar/toastStyles.js +1 -1
- package/dist/snackbar/toastStyles.js.map +1 -1
- package/dist/snackbar/useCurrentToastActions.d.ts +3 -3
- package/dist/snackbar/useCurrentToastActions.js +2 -2
- package/dist/snackbar/useCurrentToastActions.js.map +1 -1
- package/dist/suspense/CircularProgressSuspense.d.ts +3 -4
- package/dist/suspense/CircularProgressSuspense.js +2 -3
- package/dist/suspense/CircularProgressSuspense.js.map +1 -1
- package/dist/suspense/NullSuspense.d.ts +3 -4
- package/dist/suspense/NullSuspense.js +2 -3
- package/dist/suspense/NullSuspense.js.map +1 -1
- package/dist/table/Table.d.ts +1 -2
- package/dist/table/Table.js +1 -2
- package/dist/table/Table.js.map +1 -1
- package/dist/table/TableCell.d.ts +7 -7
- package/dist/table/TableCell.js.map +1 -1
- package/dist/table/TableCellContent.d.ts +3 -3
- package/dist/table/TableCellContent.js.map +1 -1
- package/dist/table/TableCheckbox.d.ts +11 -15
- package/dist/table/TableCheckbox.js +4 -6
- package/dist/table/TableCheckbox.js.map +1 -1
- package/dist/table/TableContainerProvider.d.ts +3 -3
- package/dist/table/TableContainerProvider.js +2 -2
- package/dist/table/TableContainerProvider.js.map +1 -1
- package/dist/table/TableFooter.d.ts +2 -2
- package/dist/table/TableFooter.js +1 -1
- package/dist/table/TableFooter.js.map +1 -1
- package/dist/table/TableHeader.d.ts +2 -2
- package/dist/table/TableHeader.js +1 -1
- package/dist/table/TableHeader.js.map +1 -1
- package/dist/table/TableRadio.d.ts +7 -9
- package/dist/table/TableRadio.js +2 -3
- package/dist/table/TableRadio.js.map +1 -1
- package/dist/table/tableCellStyles.d.ts +2 -2
- package/dist/table/tableCellStyles.js +1 -1
- package/dist/table/tableCellStyles.js.map +1 -1
- package/dist/table/tableContainerStyles.d.ts +2 -2
- package/dist/table/tableContainerStyles.js +1 -1
- package/dist/table/tableContainerStyles.js.map +1 -1
- package/dist/table/tableFooterStyles.d.ts +1 -1
- package/dist/table/tableFooterStyles.js.map +1 -1
- package/dist/table/tableHeaderStyles.d.ts +2 -2
- package/dist/table/tableHeaderStyles.js +1 -1
- package/dist/table/tableHeaderStyles.js.map +1 -1
- package/dist/table/tableRowStyles.d.ts +2 -2
- package/dist/table/tableRowStyles.js +1 -1
- package/dist/table/tableRowStyles.js.map +1 -1
- package/dist/table/tableStyles.d.ts +2 -2
- package/dist/table/tableStyles.js +1 -1
- package/dist/table/tableStyles.js.map +1 -1
- package/dist/table/types.d.ts +7 -9
- package/dist/table/types.js +1 -1
- package/dist/table/types.js.map +1 -1
- package/dist/tabs/Tab.d.ts +4 -4
- package/dist/tabs/Tab.js +1 -1
- package/dist/tabs/Tab.js.map +1 -1
- package/dist/tabs/TabList.d.ts +2 -2
- package/dist/tabs/TabList.js +1 -1
- package/dist/tabs/TabList.js.map +1 -1
- package/dist/tabs/TabListScrollButton.d.ts +3 -3
- package/dist/tabs/TabListScrollButton.js +1 -1
- package/dist/tabs/TabListScrollButton.js.map +1 -1
- package/dist/tabs/tabIndicatorStyles.d.ts +2 -2
- package/dist/tabs/tabIndicatorStyles.js +1 -1
- package/dist/tabs/tabIndicatorStyles.js.map +1 -1
- package/dist/tabs/tabListScrollButtonStyles.d.ts +4 -4
- package/dist/tabs/tabListScrollButtonStyles.js +2 -2
- package/dist/tabs/tabListScrollButtonStyles.js.map +1 -1
- package/dist/tabs/tabListStyles.d.ts +2 -2
- package/dist/tabs/tabListStyles.js +1 -1
- package/dist/tabs/tabListStyles.js.map +1 -1
- package/dist/tabs/tabStyles.d.ts +2 -2
- package/dist/tabs/tabStyles.js +1 -1
- package/dist/tabs/tabStyles.js.map +1 -1
- package/dist/tabs/useTabs.d.ts +15 -20
- package/dist/tabs/useTabs.js +1 -1
- package/dist/tabs/useTabs.js.map +1 -1
- package/dist/tabs/utils.d.ts +3 -3
- package/dist/tabs/utils.js +1 -1
- package/dist/tabs/utils.js.map +1 -1
- package/dist/test-utils/ResizeObserver.d.ts +9 -11
- package/dist/test-utils/ResizeObserver.js +6 -8
- package/dist/test-utils/ResizeObserver.js.map +1 -1
- package/dist/test-utils/matchMedia.d.ts +13 -17
- package/dist/test-utils/matchMedia.js +9 -11
- package/dist/test-utils/matchMedia.js.map +1 -1
- package/dist/test-utils/render.d.ts +2 -2
- package/dist/test-utils/render.js +1 -1
- package/dist/test-utils/render.js.map +1 -1
- package/dist/test-utils/timers.d.ts +2 -3
- package/dist/test-utils/timers.js +2 -3
- package/dist/test-utils/timers.js.map +1 -1
- package/dist/theme/LocalStorageColorSchemeProvider.d.ts +2 -2
- package/dist/theme/LocalStorageColorSchemeProvider.js +1 -1
- package/dist/theme/LocalStorageColorSchemeProvider.js.map +1 -1
- package/dist/theme/ThemeProvider.d.ts +17 -20
- package/dist/theme/ThemeProvider.js +7 -8
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/types.d.ts +3 -3
- package/dist/theme/types.js +1 -1
- package/dist/theme/types.js.map +1 -1
- package/dist/theme/useCSSVariables.d.ts +7 -9
- package/dist/theme/useCSSVariables.js +1 -1
- package/dist/theme/useCSSVariables.js.map +1 -1
- package/dist/theme/useColorScheme.d.ts +6 -7
- package/dist/theme/useColorScheme.js +2 -3
- package/dist/theme/useColorScheme.js.map +1 -1
- package/dist/theme/useColorSchemeMetaTag.d.ts +2 -2
- package/dist/theme/useColorSchemeMetaTag.js +1 -1
- package/dist/theme/useColorSchemeMetaTag.js.map +1 -1
- package/dist/theme/useColorSchemeProvider.d.ts +2 -2
- package/dist/theme/useColorSchemeProvider.js.map +1 -1
- package/dist/theme/usePrefersColorScheme.d.ts +1 -1
- package/dist/theme/usePrefersColorScheme.js +1 -1
- package/dist/theme/usePrefersColorScheme.js.map +1 -1
- package/dist/theme/utils.d.ts +1 -1
- package/dist/theme/utils.js +1 -1
- package/dist/theme/utils.js.map +1 -1
- package/dist/tooltip/Tooltip.d.ts +3 -5
- package/dist/tooltip/Tooltip.js +1 -2
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/TooltipHoverModeProvider.d.ts +5 -6
- package/dist/tooltip/TooltipHoverModeProvider.js +3 -4
- package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
- package/dist/tooltip/constants.d.ts +9 -9
- package/dist/tooltip/constants.js +9 -9
- package/dist/tooltip/constants.js.map +1 -1
- package/dist/tooltip/tooltipStyles.d.ts +2 -2
- package/dist/tooltip/tooltipStyles.js +1 -1
- package/dist/tooltip/tooltipStyles.js.map +1 -1
- package/dist/tooltip/useTooltip.d.ts +18 -26
- package/dist/tooltip/useTooltip.js +4 -7
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/tooltip/useTooltipPosition.d.ts +4 -4
- package/dist/tooltip/useTooltipPosition.js +1 -1
- package/dist/tooltip/useTooltipPosition.js.map +1 -1
- package/dist/transition/CSSTransition.d.ts +3 -4
- package/dist/transition/CSSTransition.js +2 -3
- package/dist/transition/CSSTransition.js.map +1 -1
- package/dist/transition/Collapse.d.ts +5 -8
- package/dist/transition/Collapse.js +3 -5
- package/dist/transition/Collapse.js.map +1 -1
- package/dist/transition/CrossFade.d.ts +5 -8
- package/dist/transition/CrossFade.js +3 -5
- package/dist/transition/CrossFade.js.map +1 -1
- package/dist/transition/ScaleTransition.d.ts +7 -10
- package/dist/transition/ScaleTransition.js +4 -6
- package/dist/transition/ScaleTransition.js.map +1 -1
- package/dist/transition/SkeletonPlaceholder.d.ts +4 -6
- package/dist/transition/SkeletonPlaceholder.js +3 -5
- package/dist/transition/SkeletonPlaceholder.js.map +1 -1
- package/dist/transition/Slide.d.ts +2 -2
- package/dist/transition/Slide.js +1 -1
- package/dist/transition/Slide.js.map +1 -1
- package/dist/transition/SlideContainer.d.ts +9 -13
- package/dist/transition/SlideContainer.js +4 -6
- package/dist/transition/SlideContainer.js.map +1 -1
- package/dist/transition/collapseStyles.d.ts +2 -2
- package/dist/transition/collapseStyles.js +1 -1
- package/dist/transition/collapseStyles.js.map +1 -1
- package/dist/transition/config.d.ts +2 -2
- package/dist/transition/config.js +2 -2
- package/dist/transition/config.js.map +1 -1
- package/dist/transition/skeletonPlaceholderUtils.d.ts +3 -3
- package/dist/transition/skeletonPlaceholderUtils.js +2 -2
- package/dist/transition/skeletonPlaceholderUtils.js.map +1 -1
- package/dist/transition/types.d.ts +34 -37
- package/dist/transition/types.js +1 -1
- package/dist/transition/types.js.map +1 -1
- package/dist/transition/useCSSTransition.d.ts +4 -7
- package/dist/transition/useCSSTransition.js +4 -7
- package/dist/transition/useCSSTransition.js.map +1 -1
- package/dist/transition/useCarousel.d.ts +6 -7
- package/dist/transition/useCarousel.js +2 -3
- package/dist/transition/useCarousel.js.map +1 -1
- package/dist/transition/useCollapseTransition.d.ts +10 -13
- package/dist/transition/useCollapseTransition.js +4 -6
- package/dist/transition/useCollapseTransition.js.map +1 -1
- package/dist/transition/useCrossFadeTransition.d.ts +5 -6
- package/dist/transition/useCrossFadeTransition.js +4 -5
- package/dist/transition/useCrossFadeTransition.js.map +1 -1
- package/dist/transition/useMaxWidthTransition.d.ts +2 -2
- package/dist/transition/useMaxWidthTransition.js +1 -1
- package/dist/transition/useMaxWidthTransition.js.map +1 -1
- package/dist/transition/useScaleTransition.d.ts +8 -11
- package/dist/transition/useScaleTransition.js +7 -10
- package/dist/transition/useScaleTransition.js.map +1 -1
- package/dist/transition/useSkeletonPlaceholder.d.ts +6 -10
- package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
- package/dist/transition/useSlideTransition.d.ts +5 -6
- package/dist/transition/useSlideTransition.js +4 -5
- package/dist/transition/useSlideTransition.js.map +1 -1
- package/dist/transition/useTransition.d.ts +1 -1
- package/dist/transition/useTransition.js +1 -1
- package/dist/transition/useTransition.js.map +1 -1
- package/dist/transition/utils.d.ts +6 -6
- package/dist/transition/utils.js +3 -3
- package/dist/transition/utils.js.map +1 -1
- package/dist/tree/DefaultTreeItemRenderer.d.ts +1 -1
- package/dist/tree/DefaultTreeItemRenderer.js +1 -1
- package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
- package/dist/tree/Tree.d.ts +7 -11
- package/dist/tree/Tree.js +4 -6
- package/dist/tree/Tree.js.map +1 -1
- package/dist/tree/TreeGroup.d.ts +3 -3
- package/dist/tree/TreeGroup.js +1 -1
- package/dist/tree/TreeGroup.js.map +1 -1
- package/dist/tree/TreeItem.d.ts +3 -4
- package/dist/tree/TreeItem.js +2 -3
- package/dist/tree/TreeItem.js.map +1 -1
- package/dist/tree/TreeItemExpander.d.ts +2 -2
- package/dist/tree/TreeItemExpander.js +1 -1
- package/dist/tree/TreeItemExpander.js.map +1 -1
- package/dist/tree/TreeProvider.d.ts +6 -6
- package/dist/tree/TreeProvider.js +2 -2
- package/dist/tree/TreeProvider.js.map +1 -1
- package/dist/tree/styles.d.ts +10 -10
- package/dist/tree/styles.js +5 -5
- package/dist/tree/styles.js.map +1 -1
- package/dist/tree/types.d.ts +6 -7
- package/dist/tree/types.js.map +1 -1
- package/dist/tree/useTree.d.ts +4 -5
- package/dist/tree/useTree.js +2 -3
- package/dist/tree/useTree.js.map +1 -1
- package/dist/tree/useTreeExpansion.d.ts +2 -2
- package/dist/tree/useTreeExpansion.js +1 -1
- package/dist/tree/useTreeExpansion.js.map +1 -1
- package/dist/tree/useTreeItems.d.ts +7 -7
- package/dist/tree/useTreeItems.js +2 -2
- package/dist/tree/useTreeItems.js.map +1 -1
- package/dist/tree/useTreeMovement.d.ts +3 -3
- package/dist/tree/useTreeMovement.js +3 -3
- package/dist/tree/useTreeMovement.js.map +1 -1
- package/dist/tree/useTreeSelection.d.ts +2 -2
- package/dist/tree/useTreeSelection.js +1 -1
- package/dist/tree/useTreeSelection.js.map +1 -1
- package/dist/tree/utils.d.ts +2 -2
- package/dist/tree/utils.js +2 -2
- package/dist/tree/utils.js.map +1 -1
- package/dist/types.d.ts +14 -16
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typography/SrOnly.d.ts +1 -2
- package/dist/typography/SrOnly.js +1 -2
- package/dist/typography/SrOnly.js.map +1 -1
- package/dist/typography/TextContainer.d.ts +3 -4
- package/dist/typography/TextContainer.js +2 -3
- package/dist/typography/TextContainer.js.map +1 -1
- package/dist/typography/Typography.d.ts +3 -4
- package/dist/typography/Typography.js +1 -2
- package/dist/typography/Typography.js.map +1 -1
- package/dist/typography/WritingDirectionProvider.d.ts +10 -13
- package/dist/typography/WritingDirectionProvider.js +6 -9
- package/dist/typography/WritingDirectionProvider.js.map +1 -1
- package/dist/typography/textContainerStyles.d.ts +3 -4
- package/dist/typography/textContainerStyles.js +2 -3
- package/dist/typography/textContainerStyles.js.map +1 -1
- package/dist/typography/typographyStyles.d.ts +6 -8
- package/dist/typography/typographyStyles.js +3 -5
- package/dist/typography/typographyStyles.js.map +1 -1
- package/dist/useAsyncAction.d.ts +7 -9
- package/dist/useAsyncAction.js +3 -5
- package/dist/useAsyncAction.js.map +1 -1
- package/dist/useDebouncedFunction.d.ts +3 -4
- package/dist/useDebouncedFunction.js +2 -3
- package/dist/useDebouncedFunction.js.map +1 -1
- package/dist/useDropzone.d.ts +9 -14
- package/dist/useDropzone.js +4 -7
- package/dist/useDropzone.js.map +1 -1
- package/dist/useElementSize.d.ts +26 -5
- package/dist/useElementSize.js +7 -5
- package/dist/useElementSize.js.map +1 -1
- package/dist/useEnsuredId.d.ts +2 -3
- package/dist/useEnsuredId.js +2 -3
- package/dist/useEnsuredId.js.map +1 -1
- package/dist/useEnsuredRef.d.ts +3 -4
- package/dist/useEnsuredRef.js +2 -3
- package/dist/useEnsuredRef.js.map +1 -1
- package/dist/useEnsuredState.d.ts +2 -2
- package/dist/useEnsuredState.js +1 -1
- package/dist/useEnsuredState.js.map +1 -1
- package/dist/useHtmlClassName.d.ts +1 -1
- package/dist/useHtmlClassName.js +1 -1
- package/dist/useHtmlClassName.js.map +1 -1
- package/dist/useIntersectionObserver.d.ts +13 -20
- package/dist/useIntersectionObserver.js +2 -3
- package/dist/useIntersectionObserver.js.map +1 -1
- package/dist/useLocalStorage.d.ts +17 -22
- package/dist/useLocalStorage.js +9 -13
- package/dist/useLocalStorage.js.map +1 -1
- package/dist/usePageInactive.d.ts +3 -3
- package/dist/usePageInactive.js +1 -1
- package/dist/usePageInactive.js.map +1 -1
- package/dist/useResizeListener.d.ts +3 -4
- package/dist/useResizeListener.js +2 -3
- package/dist/useResizeListener.js.map +1 -1
- package/dist/useResizeObserver.d.ts +8 -10
- package/dist/useResizeObserver.js +4 -5
- package/dist/useResizeObserver.js.map +1 -1
- package/dist/useThrottledFunction.d.ts +3 -4
- package/dist/useThrottledFunction.js +2 -3
- package/dist/useThrottledFunction.js.map +1 -1
- package/dist/useToggle.d.ts +2 -3
- package/dist/useToggle.js +1 -2
- package/dist/useToggle.js.map +1 -1
- package/dist/useUnmounted.d.ts +2 -3
- package/dist/useUnmounted.js +2 -3
- package/dist/useUnmounted.js.map +1 -1
- package/dist/useWindowSize.d.ts +3 -4
- package/dist/useWindowSize.js +2 -3
- package/dist/useWindowSize.js.map +1 -1
- package/dist/utils/RenderRecursively.d.ts +26 -7
- package/dist/utils/RenderRecursively.js +19 -3
- package/dist/utils/RenderRecursively.js.map +1 -1
- package/dist/utils/alphaNumericSort.d.ts +6 -11
- package/dist/utils/alphaNumericSort.js +1 -1
- package/dist/utils/alphaNumericSort.js.map +1 -1
- package/dist/utils/applyRef.d.ts +1 -2
- package/dist/utils/applyRef.js +1 -2
- package/dist/utils/applyRef.js.map +1 -1
- package/dist/utils/bem.d.ts +2 -3
- package/dist/utils/bem.js +2 -3
- package/dist/utils/bem.js.map +1 -1
- package/dist/utils/getClientPosition.d.ts +4 -4
- package/dist/utils/getClientPosition.js +2 -2
- package/dist/utils/getClientPosition.js.map +1 -1
- package/dist/utils/getMiddleOfRange.d.ts +2 -2
- package/dist/utils/getMiddleOfRange.js +1 -1
- package/dist/utils/getMiddleOfRange.js.map +1 -1
- package/dist/utils/getPercentage.d.ts +3 -4
- package/dist/utils/getPercentage.js +3 -4
- package/dist/utils/getPercentage.js.map +1 -1
- package/dist/utils/getRangeDefaultValue.d.ts +2 -2
- package/dist/utils/getRangeDefaultValue.js +1 -1
- package/dist/utils/getRangeDefaultValue.js.map +1 -1
- package/dist/utils/getRangeSteps.d.ts +3 -4
- package/dist/utils/getRangeSteps.js +3 -4
- package/dist/utils/getRangeSteps.js.map +1 -1
- package/dist/utils/identity.d.ts +1 -1
- package/dist/utils/identity.js +1 -1
- package/dist/utils/identity.js.map +1 -1
- package/dist/utils/isElementVisible.d.ts +3 -4
- package/dist/utils/isElementVisible.js +3 -4
- package/dist/utils/isElementVisible.js.map +1 -1
- package/dist/utils/loop.d.ts +2 -2
- package/dist/utils/loop.js +2 -2
- package/dist/utils/loop.js.map +1 -1
- package/dist/utils/nearest.d.ts +3 -4
- package/dist/utils/nearest.js +3 -4
- package/dist/utils/nearest.js.map +1 -1
- package/dist/utils/parseCssLengthUnit.d.ts +2 -4
- package/dist/utils/parseCssLengthUnit.js +2 -4
- package/dist/utils/parseCssLengthUnit.js.map +1 -1
- package/dist/utils/randomInt.d.ts +2 -2
- package/dist/utils/randomInt.js +2 -2
- package/dist/utils/randomInt.js.map +1 -1
- package/dist/utils/wait.d.ts +2 -3
- package/dist/utils/wait.js +2 -3
- package/dist/utils/wait.js.map +1 -1
- package/dist/utils/withinRange.d.ts +3 -4
- package/dist/utils/withinRange.js +3 -4
- package/dist/utils/withinRange.js.map +1 -1
- package/dist/window-splitter/WindowSplitter.d.ts +5 -5
- package/dist/window-splitter/WindowSplitter.js +2 -2
- package/dist/window-splitter/WindowSplitter.js.map +1 -1
- package/dist/window-splitter/useWindowSplitter.d.ts +6 -7
- package/dist/window-splitter/useWindowSplitter.js +2 -3
- package/dist/window-splitter/useWindowSplitter.js.map +1 -1
- package/package.json +19 -13
- package/src/CoreProviders.tsx +3 -3
- package/src/NoSsr.tsx +3 -4
- package/src/RootHtml.tsx +3 -4
- package/src/SsrProvider.tsx +3 -3
- package/src/_core.scss +5 -0
- package/src/app-bar/AppBar.tsx +11 -14
- package/src/app-bar/AppBarTitle.tsx +7 -9
- package/src/avatar/Avatar.tsx +5 -6
- package/src/avatar/__tests__/Avatar.tsx +1 -1
- package/src/avatar/styles.ts +4 -4
- package/src/badge/Badge.tsx +4 -6
- package/src/box/Box.tsx +16 -9
- package/src/box/__tests__/Box.tsx +158 -0
- package/src/box/__tests__/__snapshots__/Box.tsx.snap +544 -0
- package/src/box/_box.scss +1 -1
- package/src/box/styles.ts +9 -9
- package/src/button/AsyncButton.tsx +5 -7
- package/src/button/Button.tsx +4 -8
- package/src/button/ButtonUnstyled.tsx +2 -2
- package/src/button/FloatingActionButton.tsx +5 -5
- package/src/button/TooltippedButton.tsx +9 -13
- package/src/button/buttonStyles.ts +3 -3
- package/src/button/buttonUnstyledStyles.ts +2 -2
- package/src/card/Card.tsx +3 -4
- package/src/card/CardContent.tsx +2 -4
- package/src/card/CardFooter.tsx +2 -2
- package/src/card/CardHeader.tsx +10 -12
- package/src/card/CardSubtitle.tsx +2 -2
- package/src/card/CardTitle.tsx +2 -2
- package/src/card/ClickableCard.tsx +3 -4
- package/src/card/styles.ts +15 -15
- package/src/chip/Chip.tsx +10 -14
- package/src/chip/styles.ts +4 -4
- package/src/cssUtils.ts +10 -10
- package/src/dialog/Dialog.tsx +5 -6
- package/src/dialog/DialogContainer.tsx +2 -2
- package/src/dialog/DialogTitle.tsx +1 -1
- package/src/dialog/FixedDialog.tsx +1 -2
- package/src/dialog/styles.ts +9 -9
- package/src/divider/Divider.tsx +2 -3
- package/src/divider/styles.ts +2 -2
- package/src/draggable/useDraggable.ts +18 -19
- package/src/draggable/utils.ts +2 -2
- package/src/expansion-panel/ExpansionList.tsx +2 -2
- package/src/expansion-panel/ExpansionPanel.tsx +8 -9
- package/src/expansion-panel/ExpansionPanelHeader.tsx +3 -4
- package/src/expansion-panel/useExpansionList.ts +6 -7
- package/src/expansion-panel/useExpansionPanels.ts +9 -14
- package/src/focus/useFocusContainer.ts +9 -10
- package/src/focus/utils.ts +4 -5
- package/src/form/Checkbox.tsx +1 -2
- package/src/form/Fieldset.tsx +5 -6
- package/src/form/FileInput.tsx +6 -7
- package/src/form/FormMessageContainer.tsx +2 -2
- package/src/form/FormMessageCounter.tsx +4 -6
- package/src/form/InputToggle.tsx +11 -12
- package/src/form/InputToggleIcon.tsx +4 -6
- package/src/form/Label.tsx +2 -2
- package/src/form/Legend.tsx +2 -2
- package/src/form/MenuItemCheckbox.tsx +2 -3
- package/src/form/MenuItemFileInput.tsx +3 -5
- package/src/form/MenuItemInputToggle.tsx +7 -9
- package/src/form/MenuItemRadio.tsx +3 -5
- package/src/form/MenuItemSwitch.tsx +2 -3
- package/src/form/MenuItemTextField.tsx +2 -2
- package/src/form/NativeSelect.tsx +3 -5
- package/src/form/OptGroup.tsx +3 -4
- package/src/form/Option.tsx +5 -7
- package/src/form/Password.tsx +7 -13
- package/src/form/Radio.tsx +1 -2
- package/src/form/ResizingTextAreaWrapper.tsx +2 -2
- package/src/form/Select.tsx +6 -9
- package/src/form/SelectedOption.tsx +2 -2
- package/src/form/Slider.tsx +16 -25
- package/src/form/SliderContainer.tsx +6 -9
- package/src/form/SliderMark.tsx +2 -2
- package/src/form/SliderMarkLabel.tsx +3 -3
- package/src/form/SliderThumb.tsx +8 -10
- package/src/form/SliderTrack.tsx +4 -6
- package/src/form/SliderValueMarks.tsx +7 -9
- package/src/form/SliderValueTooltip.tsx +4 -6
- package/src/form/Switch.tsx +3 -4
- package/src/form/TextArea.tsx +2 -3
- package/src/form/TextField.tsx +7 -10
- package/src/form/TextFieldAddon.tsx +3 -3
- package/src/form/fileUtils.ts +33 -36
- package/src/form/formConfig.ts +2 -2
- package/src/form/formMessageStyles.ts +5 -5
- package/src/form/inputToggleStyles.ts +3 -3
- package/src/form/menuItemInputToggleStyles.ts +8 -8
- package/src/form/nativeSelectStyles.ts +4 -4
- package/src/form/optionStyles.ts +2 -2
- package/src/form/passwordStyles.ts +4 -4
- package/src/form/selectStyles.ts +2 -2
- package/src/form/selectUtils.ts +4 -4
- package/src/form/sliderUtils.ts +9 -9
- package/src/form/switchStyles.ts +2 -2
- package/src/form/textAreaStyles.ts +4 -4
- package/src/form/textFieldContainerStyles.ts +2 -2
- package/src/form/textFieldStyles.ts +2 -2
- package/src/form/types.ts +10 -10
- package/src/form/useCheckboxGroup.ts +15 -20
- package/src/form/useCombobox.ts +18 -16
- package/src/form/useEditableCombobox.ts +3 -3
- package/src/form/useFileUpload.ts +7 -8
- package/src/form/useFormReset.ts +2 -2
- package/src/form/useListboxProvider.ts +3 -3
- package/src/form/useNumberField.ts +17 -25
- package/src/form/useRadioGroup.ts +14 -18
- package/src/form/useRangeSlider.ts +8 -11
- package/src/form/useSelectCombobox.ts +3 -3
- package/src/form/useSlider.ts +7 -9
- package/src/form/useTextField.ts +22 -31
- package/src/form/utils.ts +7 -8
- package/src/form/validation.ts +18 -18
- package/src/hoverMode/useHoverMode.ts +9 -10
- package/src/hoverMode/useHoverModeProvider.ts +11 -15
- package/src/icon/FontIcon.tsx +1 -1
- package/src/icon/IconRotator.tsx +1 -1
- package/src/icon/MaterialIcon.tsx +2 -2
- package/src/icon/MaterialSymbol.tsx +3 -4
- package/src/icon/SVGIcon.tsx +0 -1
- package/src/icon/TextIconSpacing.tsx +3 -5
- package/src/icon/iconConfig.tsx +14 -16
- package/src/icon/material.ts +4 -4
- package/src/icon/materialConfig.ts +12 -12
- package/src/icon/styles.ts +8 -8
- package/src/interaction/UserInteractionModeProvider.tsx +1 -2
- package/src/interaction/config.ts +2 -2
- package/src/interaction/types.ts +8 -8
- package/src/interaction/useElementInteraction.tsx +6 -7
- package/src/interaction/useHigherContrastChildren.tsx +2 -3
- package/src/layout/LayoutAppBar.tsx +4 -7
- package/src/layout/LayoutNav.tsx +4 -6
- package/src/layout/LayoutWindowSplitter.tsx +3 -4
- package/src/layout/Main.tsx +4 -5
- package/src/layout/__tests__/LayoutAppBar.tsx +23 -0
- package/src/layout/__tests__/useExpandableLayout.tsx +8 -0
- package/src/layout/_layout.scss +12 -1
- package/src/layout/layoutNavStyles.ts +2 -2
- package/src/layout/layoutWindowSplitterStyles.ts +2 -2
- package/src/layout/mainStyles.ts +2 -2
- package/src/layout/useExpandableLayout.ts +85 -23
- package/src/layout/useHorizontalLayoutTransition.ts +8 -8
- package/src/layout/useLayoutAppBarHeight.ts +10 -13
- package/src/layout/useLayoutTree.ts +10 -10
- package/src/layout/useLayoutWindowSplitter.ts +5 -6
- package/src/layout/useMainTabIndex.ts +1 -1
- package/src/layout/useResizableLayout.ts +54 -8
- package/src/layout/useTemporaryLayout.ts +12 -13
- package/src/link/Link.tsx +10 -13
- package/src/link/SkipToMainContent.tsx +2 -4
- package/src/link/styles.ts +4 -4
- package/src/list/List.tsx +3 -4
- package/src/list/ListItem.tsx +4 -6
- package/src/list/ListItemChildren.tsx +1 -2
- package/src/list/ListSubheader.tsx +3 -3
- package/src/list/getListItemHeight.ts +1 -1
- package/src/list/listItemStyles.ts +9 -9
- package/src/list/types.ts +11 -11
- package/src/media-queries/AppSizeProvider.tsx +1 -2
- package/src/media-queries/useMediaQuery.ts +2 -3
- package/src/menu/DropdownMenu.tsx +7 -11
- package/src/menu/Menu.tsx +10 -13
- package/src/menu/MenuBar.tsx +3 -4
- package/src/menu/MenuButton.tsx +8 -8
- package/src/menu/MenuConfigurationProvider.tsx +10 -10
- package/src/menu/MenuItem.tsx +2 -2
- package/src/menu/MenuItemButton.tsx +2 -2
- package/src/menu/MenuItemCircularProgress.tsx +3 -4
- package/src/menu/MenuItemGroup.tsx +3 -4
- package/src/menu/MenuItemSeparator.tsx +2 -2
- package/src/menu/MenuSheet.tsx +7 -9
- package/src/menu/MenuVisibilityProvider.tsx +8 -10
- package/src/menu/MenuWidget.tsx +2 -2
- package/src/menu/MenuWidgetKeyboardProvider.tsx +2 -2
- package/src/menu/useContextMenu.ts +8 -12
- package/src/menu/useMenuBarProvider.ts +6 -6
- package/src/menu/utils.ts +2 -2
- package/src/movement/constants.ts +3 -3
- package/src/movement/types.ts +16 -17
- package/src/movement/useKeyboardMovementProvider.ts +6 -9
- package/src/movement/utils.ts +13 -13
- package/src/navigation/CollapsibleNavGroup.tsx +94 -0
- package/src/navigation/DefaultNavigationRenderer.tsx +71 -0
- package/src/navigation/NavGroup.tsx +39 -0
- package/src/navigation/NavItem.tsx +29 -0
- package/src/navigation/NavItemButton.tsx +104 -0
- package/src/navigation/NavItemLink.tsx +163 -0
- package/src/navigation/NavSubheader.tsx +36 -0
- package/src/navigation/Navigation.tsx +91 -0
- package/src/navigation/__tests__/Navigation.tsx +97 -0
- package/src/navigation/__tests__/__snapshots__/Navigation.tsx.snap +165 -0
- package/src/navigation/_navigation.scss +99 -0
- package/src/navigation/getHrefFromParents.ts +15 -0
- package/src/navigation/navGroupStyles.ts +21 -0
- package/src/navigation/navItemStyles.ts +71 -0
- package/src/navigation/types.ts +166 -0
- package/src/navigation/useActiveHeadingId.ts +190 -0
- package/src/overlay/Overlay.tsx +5 -6
- package/src/overlay/overlayStyles.ts +4 -4
- package/src/portal/Portal.tsx +1 -2
- package/src/portal/PortalContainerProvider.tsx +4 -4
- package/src/positioning/createVerticalPosition.ts +1 -1
- package/src/positioning/getFixedPosition.ts +1 -1
- package/src/positioning/types.ts +4 -4
- package/src/positioning/useFixedPositioning.ts +8 -9
- package/src/positioning/utils.ts +3 -3
- package/src/progress/CircularProgress.tsx +7 -10
- package/src/progress/LinearProgress.tsx +4 -6
- package/src/progress/types.ts +5 -5
- package/src/responsive-item/ResponsiveItemContainer.tsx +10 -15
- package/src/responsive-item/ResponsiveItemOverlay.tsx +6 -7
- package/src/responsive-item/styles.ts +2 -2
- package/src/scroll/ScrollLock.tsx +1 -1
- package/src/scroll/useScrollLock.ts +2 -3
- package/src/searching/caseInsensitive.ts +9 -13
- package/src/searching/fuzzy.ts +4 -5
- package/src/searching/toSearchQuery.ts +1 -1
- package/src/searching/types.ts +2 -2
- package/src/searching/useFuzzyMatch.ts +3 -3
- package/src/searching/utils.ts +3 -3
- package/src/segmented-button/SegmentedButton.tsx +3 -4
- package/src/segmented-button/SegmentedButtonContainer.tsx +3 -4
- package/src/segmented-button/segmentedButtonContainerStyles.ts +2 -2
- package/src/segmented-button/segmentedButtonStyles.ts +2 -2
- package/src/sheet/Sheet.tsx +1 -1
- package/src/sheet/styles.ts +3 -3
- package/src/snackbar/DefaultToastRenderer.tsx +2 -2
- package/src/snackbar/Snackbar.tsx +3 -4
- package/src/snackbar/Toast.tsx +3 -3
- package/src/snackbar/ToastActionButton.tsx +2 -2
- package/src/snackbar/ToastCloseButton.tsx +2 -2
- package/src/snackbar/ToastContent.tsx +2 -2
- package/src/snackbar/ToastManager.tsx +30 -24
- package/src/snackbar/ToastManagerProvider.tsx +6 -6
- package/src/snackbar/__tests__/ToastManagerProvider.tsx +34 -0
- package/src/snackbar/__tests__/__snapshots__/ToastManagerProvider.tsx.snap +21 -21
- package/src/snackbar/snackbarStyles.ts +4 -5
- package/src/snackbar/toastContentStyles.ts +2 -2
- package/src/snackbar/toastStyles.ts +2 -2
- package/src/snackbar/useCurrentToastActions.ts +3 -3
- package/src/suspense/CircularProgressSuspense.tsx +3 -4
- package/src/suspense/NullSuspense.tsx +3 -4
- package/src/table/Table.tsx +1 -2
- package/src/table/TableCell.tsx +7 -7
- package/src/table/TableCellContent.tsx +3 -3
- package/src/table/TableCheckbox.tsx +11 -15
- package/src/table/TableContainerProvider.tsx +3 -3
- package/src/table/TableFooter.tsx +2 -2
- package/src/table/TableHeader.tsx +2 -2
- package/src/table/TableRadio.tsx +7 -9
- package/src/table/tableCellStyles.ts +2 -2
- package/src/table/tableContainerStyles.ts +2 -2
- package/src/table/tableFooterStyles.ts +1 -1
- package/src/table/tableHeaderStyles.ts +2 -2
- package/src/table/tableRowStyles.ts +2 -2
- package/src/table/tableStyles.ts +2 -2
- package/src/table/types.ts +7 -9
- package/src/tabs/Tab.tsx +4 -4
- package/src/tabs/TabList.tsx +2 -2
- package/src/tabs/TabListScrollButton.tsx +3 -3
- package/src/tabs/tabIndicatorStyles.ts +2 -2
- package/src/tabs/tabListScrollButtonStyles.ts +4 -4
- package/src/tabs/tabListStyles.ts +2 -2
- package/src/tabs/tabStyles.ts +2 -2
- package/src/tabs/useTabs.ts +16 -21
- package/src/tabs/utils.ts +3 -3
- package/src/test-utils/ResizeObserver.ts +9 -11
- package/src/test-utils/matchMedia.ts +13 -17
- package/src/test-utils/render.tsx +2 -2
- package/src/test-utils/timers.ts +2 -3
- package/src/theme/LocalStorageColorSchemeProvider.tsx +2 -2
- package/src/theme/ThemeProvider.tsx +18 -21
- package/src/theme/types.ts +3 -3
- package/src/theme/useCSSVariables.ts +8 -10
- package/src/theme/useColorScheme.ts +6 -7
- package/src/theme/useColorSchemeMetaTag.ts +2 -2
- package/src/theme/useColorSchemeProvider.ts +2 -2
- package/src/theme/usePrefersColorScheme.ts +1 -1
- package/src/theme/utils.ts +1 -1
- package/src/tooltip/Tooltip.tsx +3 -5
- package/src/tooltip/TooltipHoverModeProvider.tsx +5 -6
- package/src/tooltip/constants.ts +9 -9
- package/src/tooltip/tooltipStyles.ts +2 -2
- package/src/tooltip/useTooltip.ts +18 -26
- package/src/tooltip/useTooltipPosition.ts +4 -4
- package/src/transition/CSSTransition.tsx +3 -4
- package/src/transition/Collapse.tsx +5 -8
- package/src/transition/CrossFade.tsx +5 -8
- package/src/transition/ScaleTransition.tsx +7 -10
- package/src/transition/SkeletonPlaceholder.tsx +4 -6
- package/src/transition/Slide.tsx +2 -2
- package/src/transition/SlideContainer.tsx +9 -13
- package/src/transition/collapseStyles.ts +2 -2
- package/src/transition/config.ts +2 -2
- package/src/transition/skeletonPlaceholderUtils.ts +3 -3
- package/src/transition/types.ts +34 -37
- package/src/transition/useCSSTransition.ts +4 -7
- package/src/transition/useCarousel.ts +6 -7
- package/src/transition/useCollapseTransition.ts +10 -13
- package/src/transition/useCrossFadeTransition.ts +5 -6
- package/src/transition/useMaxWidthTransition.ts +2 -2
- package/src/transition/useScaleTransition.ts +8 -11
- package/src/transition/useSkeletonPlaceholder.ts +6 -10
- package/src/transition/useSlideTransition.ts +5 -6
- package/src/transition/useTransition.ts +1 -1
- package/src/transition/utils.ts +6 -6
- package/src/tree/DefaultTreeItemRenderer.tsx +1 -1
- package/src/tree/Tree.tsx +8 -12
- package/src/tree/TreeGroup.tsx +3 -3
- package/src/tree/TreeItem.tsx +3 -4
- package/src/tree/TreeItemExpander.tsx +2 -2
- package/src/tree/TreeProvider.tsx +6 -6
- package/src/tree/styles.ts +10 -10
- package/src/tree/types.ts +6 -7
- package/src/tree/useTree.ts +4 -5
- package/src/tree/useTreeExpansion.ts +2 -2
- package/src/tree/useTreeItems.ts +7 -7
- package/src/tree/useTreeMovement.ts +5 -5
- package/src/tree/useTreeSelection.ts +2 -2
- package/src/tree/utils.ts +2 -2
- package/src/types.ts +14 -16
- package/src/typography/SrOnly.tsx +1 -2
- package/src/typography/TextContainer.tsx +3 -4
- package/src/typography/Typography.tsx +3 -4
- package/src/typography/WritingDirectionProvider.tsx +10 -13
- package/src/typography/textContainerStyles.ts +3 -4
- package/src/typography/typographyStyles.ts +6 -8
- package/src/useAsyncAction.ts +7 -9
- package/src/useDebouncedFunction.ts +3 -4
- package/src/useDropzone.ts +9 -14
- package/src/useElementSize.ts +31 -6
- package/src/useEnsuredId.ts +2 -3
- package/src/useEnsuredRef.ts +3 -4
- package/src/useEnsuredState.ts +2 -2
- package/src/useHtmlClassName.ts +1 -1
- package/src/useIntersectionObserver.ts +13 -20
- package/src/useLocalStorage.ts +17 -22
- package/src/usePageInactive.ts +3 -3
- package/src/useResizeListener.ts +3 -4
- package/src/useResizeObserver.ts +8 -10
- package/src/useThrottledFunction.ts +3 -4
- package/src/useToggle.ts +2 -3
- package/src/useUnmounted.ts +2 -3
- package/src/useWindowSize.ts +3 -4
- package/src/utils/RenderRecursively.tsx +42 -9
- package/src/utils/__tests__/RenderRecursively.tsx +1 -1
- package/src/utils/alphaNumericSort.ts +6 -11
- package/src/utils/applyRef.ts +1 -2
- package/src/utils/bem.ts +2 -3
- package/src/utils/getClientPosition.ts +4 -4
- package/src/utils/getMiddleOfRange.ts +2 -2
- package/src/utils/getPercentage.ts +3 -4
- package/src/utils/getRangeDefaultValue.ts +2 -2
- package/src/utils/getRangeSteps.ts +3 -4
- package/src/utils/identity.ts +1 -1
- package/src/utils/isElementVisible.ts +3 -4
- package/src/utils/loop.ts +2 -2
- package/src/utils/nearest.ts +3 -4
- package/src/utils/parseCssLengthUnit.ts +2 -4
- package/src/utils/randomInt.ts +2 -2
- package/src/utils/wait.ts +2 -3
- package/src/utils/withinRange.ts +3 -4
- package/src/window-splitter/WindowSplitter.tsx +5 -5
- package/src/window-splitter/useWindowSplitter.ts +6 -7
- package/tsdoc.json +14 -0
- package/.turbo/turbo-lint.log +0 -12
- package/.turbo/turbo-typecheck.log +0 -4
- package/dist/index.d.ts +0 -346
- package/dist/index.js +0 -347
- package/dist/index.js.map +0 -1
- package/src/index.ts +0 -349
|
@@ -16,8 +16,7 @@ const { Provider } = context;
|
|
|
16
16
|
* Gets the writing direction context which provides access to the current `dir`
|
|
17
17
|
* and a `toggleDir` function.
|
|
18
18
|
*
|
|
19
|
-
* @example
|
|
20
|
-
* Manually Changing the Writing Direction
|
|
19
|
+
* @example Manually Changing the Writing Direction
|
|
21
20
|
* ```tsx
|
|
22
21
|
* import { useDir } from "@react-md/core";
|
|
23
22
|
*
|
|
@@ -33,7 +32,7 @@ const { Provider } = context;
|
|
|
33
32
|
* }
|
|
34
33
|
* ```
|
|
35
34
|
*
|
|
36
|
-
* @
|
|
35
|
+
* @since 6.0.0
|
|
37
36
|
*/ export function useDir() {
|
|
38
37
|
const { root: _root, ...current } = useContext(context);
|
|
39
38
|
return current;
|
|
@@ -44,7 +43,7 @@ const { Provider } = context;
|
|
|
44
43
|
*
|
|
45
44
|
* In node environments, this will default to `"ltr"`.
|
|
46
45
|
*
|
|
47
|
-
* @
|
|
46
|
+
* @since 6.0.0
|
|
48
47
|
*/ export const DEFAULT_WRITING_DIRECTION = ()=>{
|
|
49
48
|
let dir = "ltr";
|
|
50
49
|
if (typeof document !== "undefined") {
|
|
@@ -67,8 +66,7 @@ const { Provider } = context;
|
|
|
67
66
|
* that the child is either a DOM element or the `dir` prop is passed from your
|
|
68
67
|
* custom component.
|
|
69
68
|
*
|
|
70
|
-
* @example
|
|
71
|
-
* Root Setup
|
|
69
|
+
* @example Root Setup
|
|
72
70
|
* ```tsx
|
|
73
71
|
* import { createRoot } from "react-dom/client";
|
|
74
72
|
* import { WritingDirection } from "@react-md/core";
|
|
@@ -84,8 +82,7 @@ const { Provider } = context;
|
|
|
84
82
|
* );
|
|
85
83
|
* ```
|
|
86
84
|
*
|
|
87
|
-
* @example
|
|
88
|
-
* Supporting RTL Languages
|
|
85
|
+
* @example Supporting RTL Languages
|
|
89
86
|
* ```tsx
|
|
90
87
|
* import { createRoot } from "react-dom/client";
|
|
91
88
|
* import { WritingDirection } from "@react-md/core";
|
|
@@ -128,7 +125,7 @@ const { Provider } = context;
|
|
|
128
125
|
* );
|
|
129
126
|
* ```
|
|
130
127
|
*
|
|
131
|
-
* @
|
|
128
|
+
* @since 6.0.0
|
|
132
129
|
*/ export function WritingDirectionProvider(props) {
|
|
133
130
|
const { children, defaultDir = DEFAULT_WRITING_DIRECTION } = props;
|
|
134
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 * @
|
|
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\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\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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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"}
|
|
@@ -5,7 +5,7 @@ declare module "react" {
|
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* @
|
|
8
|
+
* @since 6.0.0
|
|
9
9
|
*/
|
|
10
10
|
export interface TextContainerClassNameOptions {
|
|
11
11
|
/**
|
|
@@ -14,8 +14,7 @@ export interface TextContainerClassNameOptions {
|
|
|
14
14
|
className?: string;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* @example
|
|
18
|
-
* Simple Example
|
|
17
|
+
* @example Simple Example
|
|
19
18
|
* ```tsx
|
|
20
19
|
* import { textContainer, Typography } from "@react-md/core";
|
|
21
20
|
*
|
|
@@ -35,6 +34,6 @@ export interface TextContainerClassNameOptions {
|
|
|
35
34
|
* }
|
|
36
35
|
* ```
|
|
37
36
|
*
|
|
38
|
-
* @
|
|
37
|
+
* @since 6.0.0
|
|
39
38
|
*/
|
|
40
39
|
export declare function textContainer(options?: TextContainerClassNameOptions): string;
|
|
@@ -2,8 +2,7 @@ import { cnb } from "cnbuilder";
|
|
|
2
2
|
import { bem } from "../utils/bem.js";
|
|
3
3
|
const styles = bem("rmd-text-container");
|
|
4
4
|
/**
|
|
5
|
-
* @example
|
|
6
|
-
* Simple Example
|
|
5
|
+
* @example Simple Example
|
|
7
6
|
* ```tsx
|
|
8
7
|
* import { textContainer, Typography } from "@react-md/core";
|
|
9
8
|
*
|
|
@@ -23,7 +22,7 @@ const styles = bem("rmd-text-container");
|
|
|
23
22
|
* }
|
|
24
23
|
* ```
|
|
25
24
|
*
|
|
26
|
-
* @
|
|
25
|
+
* @since 6.0.0
|
|
27
26
|
*/ export function textContainer(options = {}) {
|
|
28
27
|
const { className } = options;
|
|
29
28
|
return cnb(styles(), className);
|
|
@@ -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 * @
|
|
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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","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"}
|
|
@@ -4,10 +4,10 @@ import { type TextCssUtilsOptions } from "../cssUtils.js";
|
|
|
4
4
|
* the Typography component, this will generate the correct typography className
|
|
5
5
|
* to apply and determine what component to be rendered as if none was provided.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
7
|
+
* @since 4.0.0
|
|
8
8
|
*/
|
|
9
9
|
export type TypographyType = "headline-1" | "headline-2" | "headline-3" | "headline-4" | "headline-5" | "headline-6" | "subtitle-1" | "subtitle-2" | "body-1" | "body-2" | "caption" | "overline";
|
|
10
|
-
/** @
|
|
10
|
+
/** @since 6.0.0 */
|
|
11
11
|
export interface TypographyClassNameOptions extends TextCssUtilsOptions {
|
|
12
12
|
className?: string;
|
|
13
13
|
/**
|
|
@@ -16,7 +16,7 @@ export interface TypographyClassNameOptions extends TextCssUtilsOptions {
|
|
|
16
16
|
*/
|
|
17
17
|
type?: TypographyType;
|
|
18
18
|
}
|
|
19
|
-
/** @
|
|
19
|
+
/** @since 6.0.0 */
|
|
20
20
|
export type NullableTypographyClassNameOptions = Omit<TypographyClassNameOptions, "type"> & {
|
|
21
21
|
/**
|
|
22
22
|
* When using the {@link typography} class name utility, the `type` can be set
|
|
@@ -32,8 +32,7 @@ export type NullableTypographyClassNameOptions = Omit<TypographyClassNameOptions
|
|
|
32
32
|
* only useful if you are unable to use the {@link Typography} component for
|
|
33
33
|
* some reason.
|
|
34
34
|
*
|
|
35
|
-
* @example
|
|
36
|
-
* Simple Example
|
|
35
|
+
* @example Simple Example
|
|
37
36
|
* ```ts
|
|
38
37
|
* import { typography } from "@react-md/core";
|
|
39
38
|
*
|
|
@@ -58,8 +57,7 @@ export type NullableTypographyClassNameOptions = Omit<TypographyClassNameOptions
|
|
|
58
57
|
* }
|
|
59
58
|
* ```
|
|
60
59
|
*
|
|
61
|
-
* @example
|
|
62
|
-
* Applying Additional Styles
|
|
60
|
+
* @example Applying Additional Styles
|
|
63
61
|
* ```ts
|
|
64
62
|
* import { typography } from "@react-md/core";
|
|
65
63
|
*
|
|
@@ -107,6 +105,6 @@ export type NullableTypographyClassNameOptions = Omit<TypographyClassNameOptions
|
|
|
107
105
|
* @param options - An optional object of options used to create the typography
|
|
108
106
|
* class name.
|
|
109
107
|
* @returns a typography class name string
|
|
110
|
-
* @
|
|
108
|
+
* @since 6.0.0
|
|
111
109
|
*/
|
|
112
110
|
export declare function typography(options?: NullableTypographyClassNameOptions): string;
|
|
@@ -5,8 +5,7 @@ import { cssUtils } from "../cssUtils.js";
|
|
|
5
5
|
* only useful if you are unable to use the {@link Typography} component for
|
|
6
6
|
* some reason.
|
|
7
7
|
*
|
|
8
|
-
* @example
|
|
9
|
-
* Simple Example
|
|
8
|
+
* @example Simple Example
|
|
10
9
|
* ```ts
|
|
11
10
|
* import { typography } from "@react-md/core";
|
|
12
11
|
*
|
|
@@ -31,8 +30,7 @@ import { cssUtils } from "../cssUtils.js";
|
|
|
31
30
|
* }
|
|
32
31
|
* ```
|
|
33
32
|
*
|
|
34
|
-
* @example
|
|
35
|
-
* Applying Additional Styles
|
|
33
|
+
* @example Applying Additional Styles
|
|
36
34
|
* ```ts
|
|
37
35
|
* import { typography } from "@react-md/core";
|
|
38
36
|
*
|
|
@@ -80,7 +78,7 @@ import { cssUtils } from "../cssUtils.js";
|
|
|
80
78
|
* @param options - An optional object of options used to create the typography
|
|
81
79
|
* class name.
|
|
82
80
|
* @returns a typography class name string
|
|
83
|
-
* @
|
|
81
|
+
* @since 6.0.0
|
|
84
82
|
*/ export function typography(options = {}) {
|
|
85
83
|
const { type = "body-1" } = options;
|
|
86
84
|
// using `&&` instead of `bem` since the latest version of typescript does not
|
|
@@ -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 * @
|
|
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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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"}
|
package/dist/useAsyncAction.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import type { NonNullRef, UseStateSetter } from "./types.js";
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @since 6.0.0
|
|
4
4
|
*/
|
|
5
5
|
export type AsyncActionFunction<Args extends unknown[]> = (...args: Args) => Promise<void>;
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
7
|
+
* @since 6.0.0
|
|
8
8
|
*/
|
|
9
9
|
export type HandleAsyncAction = <Args extends unknown[]>(action: AsyncActionFunction<Args>) => AsyncActionFunction<Args>;
|
|
10
10
|
/**
|
|
11
|
-
* @
|
|
11
|
+
* @since 6.0.0
|
|
12
12
|
*/
|
|
13
13
|
export interface AsyncActionOptions {
|
|
14
14
|
/** @defaultValue `false` */
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* @
|
|
18
|
+
* @since 6.0.0
|
|
19
19
|
*/
|
|
20
20
|
export interface AsyncActionImplementation {
|
|
21
21
|
pending: boolean;
|
|
@@ -29,8 +29,7 @@ export interface AsyncActionImplementation {
|
|
|
29
29
|
* `react-query`, `@reduxjs/toolkit/query`, `@apollo/client`, etc for API calls
|
|
30
30
|
* which have a built-in pending state for mutations.
|
|
31
31
|
*
|
|
32
|
-
* @example
|
|
33
|
-
* Simple Example (Async Button)
|
|
32
|
+
* @example Simple Example (Async Button)
|
|
34
33
|
* ```tsx
|
|
35
34
|
* import type { ButtonProps } from "@react-md/core";
|
|
36
35
|
* import { box, Button, CircularProgress, useAsyncAction } from "@react-md/core";
|
|
@@ -88,8 +87,7 @@ export interface AsyncActionImplementation {
|
|
|
88
87
|
* }
|
|
89
88
|
* ```
|
|
90
89
|
*
|
|
91
|
-
* @example
|
|
92
|
-
* Confirmation Dialog with Overlay
|
|
90
|
+
* @example Confirmation Dialog with Overlay
|
|
93
91
|
* ```tsx
|
|
94
92
|
* import {
|
|
95
93
|
* Button,
|
|
@@ -150,6 +148,6 @@ export interface AsyncActionImplementation {
|
|
|
150
148
|
* }
|
|
151
149
|
* ```
|
|
152
150
|
*
|
|
153
|
-
* @
|
|
151
|
+
* @since 6.0.0
|
|
154
152
|
*/
|
|
155
153
|
export declare function useAsyncAction(options?: AsyncActionOptions): AsyncActionImplementation;
|
package/dist/useAsyncAction.js
CHANGED
|
@@ -7,8 +7,7 @@ import { useUnmounted } from "./useUnmounted.js";
|
|
|
7
7
|
* `react-query`, `@reduxjs/toolkit/query`, `@apollo/client`, etc for API calls
|
|
8
8
|
* which have a built-in pending state for mutations.
|
|
9
9
|
*
|
|
10
|
-
* @example
|
|
11
|
-
* Simple Example (Async Button)
|
|
10
|
+
* @example Simple Example (Async Button)
|
|
12
11
|
* ```tsx
|
|
13
12
|
* import type { ButtonProps } from "@react-md/core";
|
|
14
13
|
* import { box, Button, CircularProgress, useAsyncAction } from "@react-md/core";
|
|
@@ -66,8 +65,7 @@ import { useUnmounted } from "./useUnmounted.js";
|
|
|
66
65
|
* }
|
|
67
66
|
* ```
|
|
68
67
|
*
|
|
69
|
-
* @example
|
|
70
|
-
* Confirmation Dialog with Overlay
|
|
68
|
+
* @example Confirmation Dialog with Overlay
|
|
71
69
|
* ```tsx
|
|
72
70
|
* import {
|
|
73
71
|
* Button,
|
|
@@ -128,7 +126,7 @@ import { useUnmounted } from "./useUnmounted.js";
|
|
|
128
126
|
* }
|
|
129
127
|
* ```
|
|
130
128
|
*
|
|
131
|
-
* @
|
|
129
|
+
* @since 6.0.0
|
|
132
130
|
*/ export function useAsyncAction(options = {}) {
|
|
133
131
|
const { disabled } = options;
|
|
134
132
|
const [pending, setPending] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/useAsyncAction.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport type { NonNullRef, UseStateSetter } from \"./types.js\";\nimport { useUnmounted } from \"./useUnmounted.js\";\n\n/**\n * @
|
|
1
|
+
{"version":3,"sources":["../src/useAsyncAction.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 AsyncActionFunction<Args extends unknown[]> = (\n ...args: Args\n) => Promise<void>;\n\n/**\n * @since 6.0.0\n */\nexport type HandleAsyncAction = <Args extends unknown[]>(\n action: AsyncActionFunction<Args>\n) => AsyncActionFunction<Args>;\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncActionOptions {\n /** @defaultValue `false` */\n disabled?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncActionImplementation {\n pending: boolean;\n unmounted: NonNullRef<boolean>;\n setPending: UseStateSetter<boolean>;\n handleAsync: HandleAsyncAction;\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, useAsyncAction } 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 } = useAsyncAction({ 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 * useAsyncAction,\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 } = useAsyncAction();\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 useAsyncAction(\n options: AsyncActionOptions = {}\n): AsyncActionImplementation {\n const { disabled } = options;\n\n const [pending, setPending] = useState(false);\n const unmounted = useUnmounted();\n\n const handleAsync = useCallback<HandleAsyncAction>(\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","useAsyncAction","options","disabled","pending","setPending","unmounted","handleAsync","action","args","current"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAE9C,SAASC,YAAY,QAAQ,oBAAoB;AAkCjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8HC,GACD,OAAO,SAASC,eACdC,UAA8B,CAAC,CAAC;IAEhC,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"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { type CancelableFunction, type AnyFunction } from "./types.js";
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @since 6.0.0
|
|
4
4
|
*/
|
|
5
5
|
export type DebouncedFunction<F extends AnyFunction> = CancelableFunction<(...args: Parameters<F>) => void>;
|
|
6
6
|
/**
|
|
7
7
|
* Creates a function that will only be called if it has not been called again
|
|
8
8
|
* for X milliseconds.
|
|
9
9
|
*
|
|
10
|
-
* @example
|
|
11
|
-
* Debounced Search API Requests
|
|
10
|
+
* @example Debounced Search API Requests
|
|
12
11
|
* ```tsx
|
|
13
12
|
* import { TextField, useDebouncedFunction, useUnmounted } from "@react-md/core";
|
|
14
13
|
* import { useState } from "react";
|
|
@@ -78,6 +77,6 @@ export type DebouncedFunction<F extends AnyFunction> = CancelableFunction<(...ar
|
|
|
78
77
|
*
|
|
79
78
|
* @see `useThrottledFunction` for throttle behavior instead. (Call a
|
|
80
79
|
* function at most once every X milliseconds).
|
|
81
|
-
* @
|
|
80
|
+
* @since 6.0.0
|
|
82
81
|
*/
|
|
83
82
|
export declare function useDebouncedFunction<F extends AnyFunction>(func: F, wait: number): DebouncedFunction<F>;
|
|
@@ -5,8 +5,7 @@ import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.js";
|
|
|
5
5
|
* Creates a function that will only be called if it has not been called again
|
|
6
6
|
* for X milliseconds.
|
|
7
7
|
*
|
|
8
|
-
* @example
|
|
9
|
-
* Debounced Search API Requests
|
|
8
|
+
* @example Debounced Search API Requests
|
|
10
9
|
* ```tsx
|
|
11
10
|
* import { TextField, useDebouncedFunction, useUnmounted } from "@react-md/core";
|
|
12
11
|
* import { useState } from "react";
|
|
@@ -76,7 +75,7 @@ import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.js";
|
|
|
76
75
|
*
|
|
77
76
|
* @see `useThrottledFunction` for throttle behavior instead. (Call a
|
|
78
77
|
* function at most once every X milliseconds).
|
|
79
|
-
* @
|
|
78
|
+
* @since 6.0.0
|
|
80
79
|
*/ export function useDebouncedFunction(func, wait) {
|
|
81
80
|
const timeout = useRef();
|
|
82
81
|
const funcRef = useRef(func);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/useDebouncedFunction.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useMemo, useRef } from \"react\";\nimport { type CancelableFunction, type AnyFunction } from \"./types.js\";\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect.js\";\n\n/**\n * @
|
|
1
|
+
{"version":3,"sources":["../src/useDebouncedFunction.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useMemo, useRef } from \"react\";\nimport { type CancelableFunction, type AnyFunction } from \"./types.js\";\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect.js\";\n\n/**\n * @since 6.0.0\n */\nexport type DebouncedFunction<F extends AnyFunction> = CancelableFunction<\n (...args: Parameters<F>) => void\n>;\n\n/**\n * Creates a function that will only be called if it has not been called again\n * for X milliseconds.\n *\n * @example Debounced Search API Requests\n * ```tsx\n * import { TextField, useDebouncedFunction, useUnmounted } from \"@react-md/core\";\n * import { useState } from \"react\";\n * import type { ReactElement } from \"react\";\n *\n * interface State {\n * error?: unknown\n * loading: boolean;\n * results?: {\n * // pretend some search results\n * id: string;\n * name: string;\n * }[];\n * }\n *\n * function Example(): ReactElement {\n * const [state, setState] = useState<State>({\n * loading: false,\n * });\n * // this is only required for async actions\n * const unmounted = useUnmounted();\n *\n * // A new search request will be fired once every 500ms as the user types.\n * // can't use the event here since React uses synthetic events\n * const search = useDebouncedFunction(async (q: string) => {\n * setState({\n * loading: true,\n * error: undefined,\n * results: undefined,\n * });\n *\n * try {\n * const response = await fetch('/search', {\n * method: 'POST',\n * headers: {\n * 'Content-Type': 'application/json',\n * },\n * body: JSON.stringify({ q }),\n * });\n * const json = await response.json();\n *\n * if (!unmounted.current) {\n * setState({\n * loading: false,\n * results: json,\n * });\n * }\n * } catch (error) {\n * if (!unmounted.current) {\n * setState({\n * error,\n * loading: false,\n * });\n * }\n * }\n * }, 500);\n *\n * return (\n * <TextField\n * type=\"search\"\n * label=\"Search\"\n * onChange={(event) => search(event.currentTarget.value)}\n * />\n * );\n * }\n * ```\n *\n * @see `useThrottledFunction` for throttle behavior instead. (Call a\n * function at most once every X milliseconds).\n * @since 6.0.0\n */\nexport function useDebouncedFunction<F extends AnyFunction>(\n func: F,\n wait: number\n): DebouncedFunction<F> {\n const timeout = useRef<number | undefined>();\n const funcRef = useRef(func);\n useIsomorphicLayoutEffect(() => {\n funcRef.current = func;\n });\n\n useEffect(() => {\n return () => {\n window.clearTimeout(timeout.current);\n };\n }, []);\n\n return useMemo(() => {\n const debounced: DebouncedFunction<F> = (...args) => {\n window.clearTimeout(timeout.current);\n timeout.current = window.setTimeout(() => {\n funcRef.current(...args);\n }, wait);\n };\n debounced.cancel = () => window.clearTimeout(timeout.current);\n\n return debounced;\n }, [wait]);\n}\n"],"names":["useEffect","useMemo","useRef","useIsomorphicLayoutEffect","useDebouncedFunction","func","wait","timeout","funcRef","current","window","clearTimeout","debounced","args","setTimeout","cancel"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,QAAQ;AAEnD,SAASC,yBAAyB,QAAQ,iCAAiC;AAS3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2EC,GACD,OAAO,SAASC,qBACdC,IAAO,EACPC,IAAY;IAEZ,MAAMC,UAAUL;IAChB,MAAMM,UAAUN,OAAOG;IACvBF,0BAA0B;QACxBK,QAAQC,OAAO,GAAGJ;IACpB;IAEAL,UAAU;QACR,OAAO;YACLU,OAAOC,YAAY,CAACJ,QAAQE,OAAO;QACrC;IACF,GAAG,EAAE;IAEL,OAAOR,QAAQ;QACb,MAAMW,YAAkC,CAAC,GAAGC;YAC1CH,OAAOC,YAAY,CAACJ,QAAQE,OAAO;YACnCF,QAAQE,OAAO,GAAGC,OAAOI,UAAU,CAAC;gBAClCN,QAAQC,OAAO,IAAII;YACrB,GAAGP;QACL;QACAM,UAAUG,MAAM,GAAG,IAAML,OAAOC,YAAY,CAACJ,QAAQE,OAAO;QAE5D,OAAOG;IACT,GAAG;QAACN;KAAK;AACX"}
|
package/dist/useDropzone.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { DragEvent } from "react";
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
4
|
-
*
|
|
5
|
-
* \@since 6.0.0 The element type is dynamically inferred on each handler
|
|
3
|
+
* @since 5.1.3
|
|
4
|
+
* @since 6.0.0 The element type is dynamically inferred on each handler
|
|
6
5
|
* instead of the `DropzoneHandlers` type.
|
|
7
6
|
*/
|
|
8
7
|
export interface DropzoneHandlers {
|
|
@@ -12,7 +11,7 @@ export interface DropzoneHandlers {
|
|
|
12
11
|
onDragLeave?<E extends HTMLElement>(event: DragEvent<E>): void;
|
|
13
12
|
}
|
|
14
13
|
/**
|
|
15
|
-
* @
|
|
14
|
+
* @since 6.0.0
|
|
16
15
|
*/
|
|
17
16
|
export interface DropzoneOptions extends DropzoneHandlers {
|
|
18
17
|
/**
|
|
@@ -25,9 +24,8 @@ export interface DropzoneOptions extends DropzoneHandlers {
|
|
|
25
24
|
disableDragging?: boolean;
|
|
26
25
|
}
|
|
27
26
|
/**
|
|
28
|
-
* @
|
|
29
|
-
*
|
|
30
|
-
* \@since 6.0.0 Returns an object instead of an ordered array of
|
|
27
|
+
* @since 2.9.0
|
|
28
|
+
* @since 6.0.0 Returns an object instead of an ordered array of
|
|
31
29
|
* `[isOver: boolean, dropzoneHandlers: DropzoneHandlers]`. Also returns a new
|
|
32
30
|
* `isDragging` state.
|
|
33
31
|
*/
|
|
@@ -52,8 +50,7 @@ export interface DropzoneHookReturnValue {
|
|
|
52
50
|
dropzoneHandlers: Required<DropzoneHandlers>;
|
|
53
51
|
}
|
|
54
52
|
/**
|
|
55
|
-
* @example
|
|
56
|
-
* Simple Example
|
|
53
|
+
* @example Simple Example
|
|
57
54
|
* ```tsx
|
|
58
55
|
* import { useDropzone, useFileUpload } from "@react-md/core"
|
|
59
56
|
* import type { CSSProperties, ReactElement } from "react";
|
|
@@ -82,8 +79,7 @@ export interface DropzoneHookReturnValue {
|
|
|
82
79
|
* }
|
|
83
80
|
* ```
|
|
84
81
|
*
|
|
85
|
-
* @example
|
|
86
|
-
* Dragging Example
|
|
82
|
+
* @example Dragging Example
|
|
87
83
|
* ```tsx
|
|
88
84
|
* import { useDropzone, useFileUpload } from "@react-md/core"
|
|
89
85
|
* import type { CSSProperties, ReactElement } from "react";
|
|
@@ -120,8 +116,7 @@ export interface DropzoneHookReturnValue {
|
|
|
120
116
|
* }
|
|
121
117
|
* ```
|
|
122
118
|
*
|
|
123
|
-
* @
|
|
124
|
-
*
|
|
125
|
-
* \@since 6.0.0 Supports document-level dragging flag;
|
|
119
|
+
* @since 2.9.0
|
|
120
|
+
* @since 6.0.0 Supports document-level dragging flag;
|
|
126
121
|
*/
|
|
127
122
|
export declare function useDropzone(options: DropzoneOptions): DropzoneHookReturnValue;
|
package/dist/useDropzone.js
CHANGED
|
@@ -4,8 +4,7 @@ const noop = ()=>{
|
|
|
4
4
|
// do nothing
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
* @example
|
|
8
|
-
* Simple Example
|
|
7
|
+
* @example Simple Example
|
|
9
8
|
* ```tsx
|
|
10
9
|
* import { useDropzone, useFileUpload } from "@react-md/core"
|
|
11
10
|
* import type { CSSProperties, ReactElement } from "react";
|
|
@@ -34,8 +33,7 @@ const noop = ()=>{
|
|
|
34
33
|
* }
|
|
35
34
|
* ```
|
|
36
35
|
*
|
|
37
|
-
* @example
|
|
38
|
-
* Dragging Example
|
|
36
|
+
* @example Dragging Example
|
|
39
37
|
* ```tsx
|
|
40
38
|
* import { useDropzone, useFileUpload } from "@react-md/core"
|
|
41
39
|
* import type { CSSProperties, ReactElement } from "react";
|
|
@@ -72,9 +70,8 @@ const noop = ()=>{
|
|
|
72
70
|
* }
|
|
73
71
|
* ```
|
|
74
72
|
*
|
|
75
|
-
* @
|
|
76
|
-
*
|
|
77
|
-
* \@since 6.0.0 Supports document-level dragging flag;
|
|
73
|
+
* @since 2.9.0
|
|
74
|
+
* @since 6.0.0 Supports document-level dragging flag;
|
|
78
75
|
*/ export function useDropzone(options) {
|
|
79
76
|
const { onDrop, onDragOver = noop, onDragEnter = noop, onDragLeave = noop, disableDragging = false } = options;
|
|
80
77
|
const [isOver, setOver] = useState(false);
|
package/dist/useDropzone.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/useDropzone.ts"],"sourcesContent":["\"use client\";\nimport type { DragEvent } from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @
|
|
1
|
+
{"version":3,"sources":["../src/useDropzone.ts"],"sourcesContent":["\"use client\";\nimport type { DragEvent } from \"react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 5.1.3\n * @since 6.0.0 The element type is dynamically inferred on each handler\n * instead of the `DropzoneHandlers` type.\n */\nexport interface DropzoneHandlers {\n onDrop<E extends HTMLElement>(event: DragEvent<E>): void;\n onDragEnter?<E extends HTMLElement>(event: DragEvent<E>): void;\n onDragOver?<E extends HTMLElement>(event: DragEvent<E>): void;\n onDragLeave?<E extends HTMLElement>(event: DragEvent<E>): void;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface DropzoneOptions extends DropzoneHandlers {\n /**\n * Set this to `true` if you do not need to capture drag events from outside\n * the window. i.e. Dragging files into the dropzone.\n *\n * @defaultValue `false`\n * @see {@link DropzoneHookReturnValue.isDragging}\n */\n disableDragging?: boolean;\n}\n\n/**\n * @since 2.9.0\n * @since 6.0.0 Returns an object instead of an ordered array of\n * `[isOver: boolean, dropzoneHandlers: DropzoneHandlers]`. Also returns a new\n * `isDragging` state.\n */\nexport interface DropzoneHookReturnValue {\n /**\n * This will be `true` when the user is dragging something over the dropzone\n * target.\n */\n isOver: boolean;\n\n /**\n * This will be `true` when the user is dragging anything within the document.\n * The main use case for this is detecting when a user is dragging a file into\n * the document so you can help highlight the dropzone area.\n *\n * This will always be `false` if {@link DropzoneOptions.disableDragging} is\n * `true`.\n */\n isDragging: boolean;\n\n /**\n * The event handlers that should be passed to the dropzone target.\n */\n dropzoneHandlers: Required<DropzoneHandlers>;\n}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { useDropzone, useFileUpload } from \"@react-md/core\"\n * import type { CSSProperties, ReactElement } from \"react\";\n *\n * const style: CSSProperties = {\n * border: '1px solid blue',\n * };\n *\n * function Example(): ReactElement {\n * const { onDrop } = useFileUpload()\n * const { isOver, dropzoneHandlers } = useDropzone({\n * onDrop(event) {\n * // normally use the `onDrop` behavior from `useFileUpload` to upload\n * // files:\n * // onDrop(event);\n * },\n * disableDragging: true,\n * });\n *\n * return (\n * <div {...dropzoneHandlers} style={isOver ? style : {}}>\n * Drag and drop some files!\n * {isOver && <UploadSVGIcon />}\n * </div>\n * );\n * }\n * ```\n *\n * @example Dragging Example\n * ```tsx\n * import { useDropzone, useFileUpload } from \"@react-md/core\"\n * import type { CSSProperties, ReactElement } from \"react\";\n *\n * const draggingStyle: CSSProperties = {\n * backgroundColor: \"orange\",\n * };\n * const overStyle: CSSProperties = {\n * border: '1px solid blue',\n * };\n *\n * function Example(): ReactElement {\n * const { onDrop } = useFileUpload()\n * const { isOver, isDragging, dropzoneHandlers } = useDropzone({\n * onDrop(event) {\n * // normally use the `onDrop` behavior from `useFileUpload` to upload\n * // files:\n * // onDrop(event);\n * },\n * });\n *\n * return (\n * <div\n * {...dropzoneHandlers}\n * style={{\n * ...(isDragging && draggingStyle),\n * ...(isOver && overStyle),\n * }}\n * >\n * Drag and drop some files!\n * {isOver && <UploadSVGIcon />}\n * </div>\n * );\n * }\n * ```\n *\n * @since 2.9.0\n * @since 6.0.0 Supports document-level dragging flag;\n */\nexport function useDropzone(options: DropzoneOptions): DropzoneHookReturnValue {\n const {\n onDrop,\n onDragOver = noop,\n onDragEnter = noop,\n onDragLeave = noop,\n disableDragging = false,\n } = options;\n\n const [isOver, setOver] = useState(false);\n const [isDragging, setDragging] = useState(false);\n const draggingTimeout = useRef<number | undefined>();\n\n useEffect(() => {\n if (disableDragging) {\n return;\n }\n\n const startDragging = (): void => {\n setDragging(true);\n };\n\n // Browsers sometimes don't trigger a dragleave event for the entire\n // document, so we have to work around that by using the `dragover` event\n // instead. The `dragover` event will continually fire within the window\n // until the user drops the file or moves the file outside of the window.\n //\n // So we can consider the\n const handler = (): void => {\n window.clearTimeout(draggingTimeout.current);\n draggingTimeout.current = window.setTimeout(() => {\n setDragging(false);\n }, 100);\n };\n\n window.addEventListener(\"dragenter\", startDragging);\n window.addEventListener(\"dragover\", handler);\n return () => {\n window.clearTimeout(draggingTimeout.current);\n window.removeEventListener(\"dragenter\", startDragging);\n window.removeEventListener(\"dragover\", handler);\n };\n }, [disableDragging]);\n\n return {\n isOver,\n isDragging,\n dropzoneHandlers: {\n // Note: need to call `event.stopPropagation()` and\n // `event.preventDefault())` for each of these handlers to prevent the\n // default browser behavior when dropping. Only calling within `onDrop`\n // does not work.\n //\n // i.e. dropping an image would preview that image in the current\n // window/tab instead of triggering the drop event.\n onDrop(event) {\n event.preventDefault();\n event.stopPropagation();\n\n window.clearTimeout(draggingTimeout.current);\n onDrop(event);\n setOver(false);\n setDragging(false);\n },\n onDragOver(event) {\n event.preventDefault();\n event.stopPropagation();\n\n window.clearTimeout(draggingTimeout.current);\n onDragOver(event);\n setOver(true);\n },\n onDragEnter(event) {\n event.preventDefault();\n event.stopPropagation();\n\n onDragEnter(event);\n setOver(true);\n },\n onDragLeave(event) {\n event.preventDefault();\n event.stopPropagation();\n\n onDragLeave(event);\n setOver(false);\n },\n },\n };\n}\n"],"names":["useEffect","useRef","useState","noop","useDropzone","options","onDrop","onDragOver","onDragEnter","onDragLeave","disableDragging","isOver","setOver","isDragging","setDragging","draggingTimeout","startDragging","handler","window","clearTimeout","current","setTimeout","addEventListener","removeEventListener","dropzoneHandlers","event","preventDefault","stopPropagation"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAEpD,MAAMC,OAAO;AACX,aAAa;AACf;AAyDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqEC,GACD,OAAO,SAASC,YAAYC,OAAwB;IAClD,MAAM,EACJC,MAAM,EACNC,aAAaJ,IAAI,EACjBK,cAAcL,IAAI,EAClBM,cAAcN,IAAI,EAClBO,kBAAkB,KAAK,EACxB,GAAGL;IAEJ,MAAM,CAACM,QAAQC,QAAQ,GAAGV,SAAS;IACnC,MAAM,CAACW,YAAYC,YAAY,GAAGZ,SAAS;IAC3C,MAAMa,kBAAkBd;IAExBD,UAAU;QACR,IAAIU,iBAAiB;YACnB;QACF;QAEA,MAAMM,gBAAgB;YACpBF,YAAY;QACd;QAEA,oEAAoE;QACpE,yEAAyE;QACzE,wEAAwE;QACxE,yEAAyE;QACzE,EAAE;QACF,yBAAyB;QACzB,MAAMG,UAAU;YACdC,OAAOC,YAAY,CAACJ,gBAAgBK,OAAO;YAC3CL,gBAAgBK,OAAO,GAAGF,OAAOG,UAAU,CAAC;gBAC1CP,YAAY;YACd,GAAG;QACL;QAEAI,OAAOI,gBAAgB,CAAC,aAAaN;QACrCE,OAAOI,gBAAgB,CAAC,YAAYL;QACpC,OAAO;YACLC,OAAOC,YAAY,CAACJ,gBAAgBK,OAAO;YAC3CF,OAAOK,mBAAmB,CAAC,aAAaP;YACxCE,OAAOK,mBAAmB,CAAC,YAAYN;QACzC;IACF,GAAG;QAACP;KAAgB;IAEpB,OAAO;QACLC;QACAE;QACAW,kBAAkB;YAChB,mDAAmD;YACnD,sEAAsE;YACtE,uEAAuE;YACvE,iBAAiB;YACjB,EAAE;YACF,iEAAiE;YACjE,mDAAmD;YACnDlB,QAAOmB,KAAK;gBACVA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBT,OAAOC,YAAY,CAACJ,gBAAgBK,OAAO;gBAC3Cd,OAAOmB;gBACPb,QAAQ;gBACRE,YAAY;YACd;YACAP,YAAWkB,KAAK;gBACdA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBT,OAAOC,YAAY,CAACJ,gBAAgBK,OAAO;gBAC3Cb,WAAWkB;gBACXb,QAAQ;YACV;YACAJ,aAAYiB,KAAK;gBACfA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBnB,YAAYiB;gBACZb,QAAQ;YACV;YACAH,aAAYgB,KAAK;gBACfA,MAAMC,cAAc;gBACpBD,MAAME,eAAe;gBAErBlB,YAAYgB;gBACZb,QAAQ;YACV;QACF;IACF;AACF"}
|