@react-md/core 1.0.0-next.13 → 1.0.0-next.14
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 +7 -7
- package/.turbo/turbo-lint.log +12 -0
- package/.turbo/turbo-test.log +5498 -0
- package/.turbo/turbo-typecheck.log +26 -0
- package/CHANGELOG.md +27 -0
- package/coverage/clover.xml +657 -140
- package/coverage/coverage-final.json +4 -4
- package/coverage/lcov-report/autocomplete/Autocomplete.tsx.html +810 -171
- package/coverage/lcov-report/autocomplete/index.html +21 -126
- package/coverage/lcov-report/button/Button.tsx.html +84 -84
- package/coverage/lcov-report/button/index.html +10 -10
- package/coverage/lcov-report/{src/positioning/createHorizontalPosition.ts.html → createHorizontalPosition.ts.html} +137 -137
- package/coverage/lcov-report/{src/positioning/createVerticalPosition.ts.html → createVerticalPosition.ts.html} +77 -77
- package/coverage/lcov-report/index.html +52 -22
- package/coverage/lcov-report/searching/fuzzy.ts.html +80 -83
- package/coverage/lcov-report/searching/index.html +13 -43
- package/coverage/lcov-report/typography/SrOnly.tsx.html +52 -79
- package/coverage/lcov-report/typography/index.html +18 -18
- package/coverage/lcov-report/utils.ts.html +940 -97
- package/coverage/lcov.info +711 -177
- package/dist/_box-shadows.scss +7 -4
- package/dist/_core.scss +5 -1
- package/dist/_utils.scss +3 -3
- package/dist/autocomplete/Autocomplete.d.ts +85 -0
- package/dist/autocomplete/Autocomplete.js +138 -0
- package/dist/autocomplete/Autocomplete.js.map +1 -0
- package/dist/autocomplete/AutocompleteCircularProgress.d.ts +16 -0
- package/dist/autocomplete/AutocompleteCircularProgress.js +15 -0
- package/dist/autocomplete/AutocompleteCircularProgress.js.map +1 -0
- package/dist/autocomplete/AutocompleteDropdownButton.d.ts +32 -0
- package/dist/autocomplete/AutocompleteDropdownButton.js +29 -0
- package/dist/autocomplete/AutocompleteDropdownButton.js.map +1 -0
- package/dist/autocomplete/FilterAutocompleteOptions.d.ts +8 -0
- package/dist/autocomplete/FilterAutocompleteOptions.js +57 -0
- package/dist/autocomplete/FilterAutocompleteOptions.js.map +1 -0
- package/dist/autocomplete/_autocomplete.scss +75 -0
- package/dist/autocomplete/autocompleteStyles.d.ts +32 -0
- package/dist/autocomplete/autocompleteStyles.js +34 -0
- package/dist/autocomplete/autocompleteStyles.js.map +1 -0
- package/dist/autocomplete/defaults.d.ts +21 -0
- package/dist/autocomplete/defaults.js +52 -0
- package/dist/autocomplete/defaults.js.map +1 -0
- package/dist/autocomplete/types.d.ts +103 -0
- package/dist/autocomplete/types.js +5 -0
- package/dist/autocomplete/types.js.map +1 -0
- package/dist/avatar/_avatar.scss +4 -3
- package/dist/button/AsyncButton.js +2 -2
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/draggable/useDraggable.js +2 -13
- package/dist/draggable/useDraggable.js.map +1 -1
- package/dist/form/TextField.d.ts +1 -10
- package/dist/form/TextField.js +1 -2
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/TextFieldAddon.js +5 -2
- package/dist/form/TextFieldAddon.js.map +1 -1
- package/dist/form/_form.scss +81 -40
- package/dist/form/useCombobox.d.ts +6 -6
- package/dist/form/useCombobox.js +1 -1
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useEditableCombobox.js +3 -0
- package/dist/form/useEditableCombobox.js.map +1 -1
- package/dist/form/useTextFieldContainerAddons.d.ts +88 -0
- package/dist/form/useTextFieldContainerAddons.js +85 -0
- package/dist/form/useTextFieldContainerAddons.js.map +1 -0
- package/dist/icon/iconConfig.d.ts +7 -0
- package/dist/icon/iconConfig.js +3 -0
- package/dist/icon/iconConfig.js.map +1 -1
- package/dist/menu/MenuItemCircularProgress.d.ts +2 -2
- package/dist/menu/MenuItemCircularProgress.js +2 -2
- package/dist/menu/MenuItemCircularProgress.js.map +1 -1
- package/dist/positioning/constants.d.ts +1 -1
- package/dist/positioning/constants.js.map +1 -1
- package/dist/positioning/createHorizontalPosition.d.ts +2 -2
- package/dist/positioning/createHorizontalPosition.js.map +1 -1
- package/dist/positioning/createVerticalPosition.d.ts +3 -3
- package/dist/positioning/createVerticalPosition.js.map +1 -1
- package/dist/positioning/getFixedPosition.d.ts +1 -1
- package/dist/positioning/getFixedPosition.js.map +1 -1
- package/dist/positioning/types.d.ts +1 -1
- package/dist/positioning/types.js.map +1 -1
- package/dist/positioning/useFixedPositioning.d.ts +3 -3
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/positioning/utils.d.ts +1 -1
- package/dist/positioning/utils.js.map +1 -1
- package/dist/responsive-item/_responsive-item.scss +4 -1
- package/dist/theme/_theme.scss +4 -4
- package/dist/transition/CrossFade.js +2 -3
- package/dist/transition/CrossFade.js.map +1 -1
- package/dist/transition/useCrossFadeTransition.js +2 -1
- package/dist/transition/useCrossFadeTransition.js.map +1 -1
- package/dist/transition/useScaleTransition.js +2 -1
- package/dist/transition/useScaleTransition.js.map +1 -1
- package/dist/{useAsyncAction.d.ts → useAsyncFunction.d.ts} +10 -10
- package/dist/{useAsyncAction.js → useAsyncFunction.js} +6 -6
- package/dist/useAsyncFunction.js.map +1 -0
- package/dist/useMutationObserver.d.ts +52 -0
- package/dist/useMutationObserver.js +84 -0
- package/dist/useMutationObserver.js.map +1 -0
- package/package.json +16 -16
- package/src/__tests__/{useAsyncAction.tsx → useAsyncFunction.tsx} +3 -3
- package/src/__tests__/useWindowSize.tsx +1 -2
- package/src/_box-shadows.scss +7 -4
- package/src/_core.scss +5 -1
- package/src/_utils.scss +3 -3
- package/src/autocomplete/Autocomplete.tsx +294 -0
- package/src/autocomplete/AutocompleteCircularProgress.tsx +41 -0
- package/src/autocomplete/AutocompleteDropdownButton.tsx +66 -0
- package/src/autocomplete/FilterAutocompleteOptions.tsx +86 -0
- package/src/autocomplete/__tests__/Autocomplete.tsx +458 -0
- package/src/autocomplete/__tests__/__snapshots__/Autocomplete.tsx.snap +144 -0
- package/src/autocomplete/_autocomplete.scss +75 -0
- package/src/autocomplete/autocompleteStyles.ts +78 -0
- package/src/autocomplete/defaults.ts +83 -0
- package/src/autocomplete/types.ts +122 -0
- package/src/avatar/_avatar.scss +4 -3
- package/src/button/AsyncButton.tsx +2 -2
- package/src/draggable/useDraggable.ts +6 -13
- package/src/form/TextField.tsx +0 -13
- package/src/form/TextFieldAddon.tsx +6 -4
- package/src/form/__tests__/__snapshots__/Select.tsx.snap +2 -2
- package/src/form/__tests__/__snapshots__/TextArea.tsx.snap +2 -2
- package/src/form/__tests__/__snapshots__/TextField.tsx.snap +2 -2
- package/src/form/__tests__/useFormReset.tsx +1 -2
- package/src/form/_form.scss +81 -40
- package/src/form/useCombobox.ts +9 -19
- package/src/form/useEditableCombobox.ts +3 -0
- package/src/form/useTextFieldContainerAddons.ts +195 -0
- package/src/icon/iconConfig.tsx +9 -0
- package/src/menu/MenuItemCircularProgress.tsx +2 -2
- package/src/positioning/__tests__/createHorizontalPosition.ts +2 -4
- package/src/positioning/constants.ts +1 -1
- package/src/positioning/createHorizontalPosition.ts +2 -2
- package/src/positioning/createVerticalPosition.ts +3 -3
- package/src/positioning/getFixedPosition.ts +1 -1
- package/src/positioning/types.ts +1 -1
- package/src/positioning/useFixedPositioning.ts +12 -4
- package/src/positioning/utils.ts +1 -1
- package/src/responsive-item/_responsive-item.scss +4 -1
- package/src/suspense/__tests__/CircularProgressSuspense.tsx +4 -4
- package/src/theme/_theme.scss +4 -4
- package/src/transition/CrossFade.tsx +1 -8
- package/src/transition/useCrossFadeTransition.ts +2 -0
- package/src/transition/useScaleTransition.ts +2 -0
- package/src/{useAsyncAction.ts → useAsyncFunction.ts} +15 -15
- package/src/useMutationObserver.ts +118 -0
- package/coverage/lcov-report/AppBar.tsx.html +0 -784
- package/coverage/lcov-report/AsyncButton.tsx.html +0 -649
- package/coverage/lcov-report/AutoComplete.tsx.html +0 -283
- package/coverage/lcov-report/Avatar.tsx.html +0 -472
- package/coverage/lcov-report/Badge.tsx.html +0 -253
- package/coverage/lcov-report/CircularProgress.tsx.html +0 -799
- package/coverage/lcov-report/Collapse.tsx.html +0 -340
- package/coverage/lcov-report/CoreProviders.tsx.html +0 -502
- package/coverage/lcov-report/DefaultNavigationRenderer.tsx.html +0 -298
- package/coverage/lcov-report/DefaultToastRenderer.tsx.html +0 -526
- package/coverage/lcov-report/Dialog.tsx.html +0 -1309
- package/coverage/lcov-report/DialogContent.tsx.html +0 -178
- package/coverage/lcov-report/DialogFooter.tsx.html +0 -169
- package/coverage/lcov-report/ExpansionList.tsx.html +0 -205
- package/coverage/lcov-report/ExpansionPanel.tsx.html +0 -934
- package/coverage/lcov-report/ExpansionPanelHeader.tsx.html +0 -622
- package/coverage/lcov-report/FileInput.tsx.html +0 -733
- package/coverage/lcov-report/FontIcon.tsx.html +0 -265
- package/coverage/lcov-report/IconRotator.tsx.html +0 -322
- package/coverage/lcov-report/InputToggle.tsx.html +0 -1117
- package/coverage/lcov-report/InputToggleIcon.tsx.html +0 -478
- package/coverage/lcov-report/LinearProgress.tsx.html +0 -658
- package/coverage/lcov-report/ListItem.tsx.html +0 -892
- package/coverage/lcov-report/ListItemLink.tsx.html +0 -616
- package/coverage/lcov-report/MaterialIcon.tsx.html +0 -235
- package/coverage/lcov-report/MaterialSymbol.tsx.html +0 -421
- package/coverage/lcov-report/MenuItemCheckbox.tsx.html +0 -223
- package/coverage/lcov-report/MenuItemInputToggle.tsx.html +0 -925
- package/coverage/lcov-report/MenuItemRadio.tsx.html +0 -436
- package/coverage/lcov-report/MenuItemSeparator.tsx.html +0 -223
- package/coverage/lcov-report/MenuItemTextField.tsx.html +0 -289
- package/coverage/lcov-report/NativeSelect.tsx.html +0 -763
- package/coverage/lcov-report/Navigation.tsx.html +0 -358
- package/coverage/lcov-report/Portal.tsx.html +0 -223
- package/coverage/lcov-report/PortalContainerProvider.tsx.html +0 -367
- package/coverage/lcov-report/RootHtml.tsx.html +0 -370
- package/coverage/lcov-report/SVGIcon.tsx.html +0 -445
- package/coverage/lcov-report/SegmentedButton.tsx.html +0 -628
- package/coverage/lcov-report/SegmentedButtonContainer.tsx.html +0 -277
- package/coverage/lcov-report/Select.tsx.html +0 -1411
- package/coverage/lcov-report/SkeletonPlaceholder.tsx.html +0 -613
- package/coverage/lcov-report/Snackbar.tsx.html +0 -610
- package/coverage/lcov-report/SrOnly.tsx.html +0 -328
- package/coverage/lcov-report/Switch.tsx.html +0 -535
- package/coverage/lcov-report/SwitchTrack.tsx.html +0 -262
- package/coverage/lcov-report/Tab.tsx.html +0 -622
- package/coverage/lcov-report/TabList.tsx.html +0 -757
- package/coverage/lcov-report/TabListScrollButton.tsx.html +0 -472
- package/coverage/lcov-report/Table.tsx.html +0 -457
- package/coverage/lcov-report/TableCell.tsx.html +0 -982
- package/coverage/lcov-report/TableCheckbox.tsx.html +0 -709
- package/coverage/lcov-report/TableContainer.tsx.html +0 -220
- package/coverage/lcov-report/TableFooter.tsx.html +0 -502
- package/coverage/lcov-report/TableHeader.tsx.html +0 -541
- package/coverage/lcov-report/TableRadio.tsx.html +0 -670
- package/coverage/lcov-report/TableRow.tsx.html +0 -289
- package/coverage/lcov-report/TextArea.tsx.html +0 -940
- package/coverage/lcov-report/TextField.tsx.html +0 -829
- package/coverage/lcov-report/TextFieldAddon.tsx.html +0 -382
- package/coverage/lcov-report/TextFieldContainer.tsx.html +0 -364
- package/coverage/lcov-report/Toast.tsx.html +0 -868
- package/coverage/lcov-report/ToastCloseButton.tsx.html +0 -340
- package/coverage/lcov-report/ToastManager.tsx.html +0 -1783
- package/coverage/lcov-report/ToastManagerProvider.tsx.html +0 -400
- package/coverage/lcov-report/Tooltip.tsx.html +0 -559
- package/coverage/lcov-report/TooltipHoverModeProvider.tsx.html +0 -253
- package/coverage/lcov-report/Tree.tsx.html +0 -1135
- package/coverage/lcov-report/TreeGroup.tsx.html +0 -313
- package/coverage/lcov-report/Typography.tsx.html +0 -1027
- package/coverage/lcov-report/app-bar/AppBar.tsx.html +0 -928
- package/coverage/lcov-report/app-bar/AppBarTitle.tsx.html +0 -430
- package/coverage/lcov-report/app-bar/index.html +0 -131
- package/coverage/lcov-report/autocomplete/AutoComplete.tsx.html +0 -283
- package/coverage/lcov-report/autocomplete/AutocompleteGeneric.tsx.html +0 -304
- package/coverage/lcov-report/autocomplete/useAutoComplete.ts.html +0 -775
- package/coverage/lcov-report/autocomplete/useAutocomplete.ts.html +0 -1039
- package/coverage/lcov-report/autocomplete/useAutocompleteAgain.ts.html +0 -829
- package/coverage/lcov-report/autocomplete/useAutocompletev2.ts.html +0 -715
- package/coverage/lcov-report/autocomplete/useInlineAutoComplete.ts.html +0 -340
- package/coverage/lcov-report/autocomplete/useInlineAutocomplete.ts.html +0 -454
- package/coverage/lcov-report/autocomplete/useInlineSelection.ts.html +0 -373
- package/coverage/lcov-report/autocomplete/utils.ts.html +0 -196
- package/coverage/lcov-report/avatar/Avatar.tsx.html +0 -535
- package/coverage/lcov-report/avatar/index.html +0 -116
- package/coverage/lcov-report/avatar/styles.ts.html +0 -268
- package/coverage/lcov-report/badge/Badge.tsx.html +0 -364
- package/coverage/lcov-report/badge/index.html +0 -116
- package/coverage/lcov-report/box/Box.tsx.html +0 -562
- package/coverage/lcov-report/box/index.html +0 -131
- package/coverage/lcov-report/box/styles.ts.html +0 -622
- package/coverage/lcov-report/button/AsyncButton.tsx.html +0 -1045
- package/coverage/lcov-report/button/ButtonUnstyled.tsx.html +0 -214
- package/coverage/lcov-report/button/FloatingActionButton.tsx.html +0 -427
- package/coverage/lcov-report/button/TooltippedButton.tsx.html +0 -433
- package/coverage/lcov-report/button/buttonStyles.ts.html +0 -607
- package/coverage/lcov-report/button/buttonUnstyledStyles.ts.html +0 -142
- package/coverage/lcov-report/card/Card.tsx.html +0 -349
- package/coverage/lcov-report/card/CardContent.tsx.html +0 -223
- package/coverage/lcov-report/card/CardHeader.tsx.html +0 -322
- package/coverage/lcov-report/card/ClickableCard.tsx.html +0 -400
- package/coverage/lcov-report/card/index.html +0 -116
- package/coverage/lcov-report/card/styles.ts.html +0 -694
- package/coverage/lcov-report/chip/Chip.tsx.html +0 -1072
- package/coverage/lcov-report/chip/index.html +0 -116
- package/coverage/lcov-report/chip/styles.ts.html +0 -436
- package/coverage/lcov-report/collapseStyles.ts.html +0 -184
- package/coverage/lcov-report/config.ts.html +0 -151
- package/coverage/lcov-report/cssUtils.ts.html +0 -814
- package/coverage/lcov-report/dialog/Dialog.tsx.html +0 -1309
- package/coverage/lcov-report/dialog/DialogContent.tsx.html +0 -178
- package/coverage/lcov-report/dialog/DialogFooter.tsx.html +0 -169
- package/coverage/lcov-report/dialog/DialogHeader.tsx.html +0 -148
- package/coverage/lcov-report/dialog/DialogTitle.tsx.html +0 -256
- package/coverage/lcov-report/dialog/FixedDialog.tsx.html +0 -583
- package/coverage/lcov-report/dialog/index.html +0 -131
- package/coverage/lcov-report/dialog/styles.ts.html +0 -439
- package/coverage/lcov-report/divider/Divider.tsx.html +0 -280
- package/coverage/lcov-report/divider/index.html +0 -116
- package/coverage/lcov-report/draggable/index.html +0 -116
- package/coverage/lcov-report/draggable/useControlledDraggable.ts.html +0 -2131
- package/coverage/lcov-report/draggable/useDraggable.ts.html +0 -2398
- package/coverage/lcov-report/draggable/useDraggableOrig.ts.html +0 -316
- package/coverage/lcov-report/draggable/useLocalStorageDraggable.ts.html +0 -361
- package/coverage/lcov-report/draggable/useLocalStorageDraggableControls.ts.html +0 -487
- package/coverage/lcov-report/draggable/useLocalStorageDraggableLatest.ts.html +0 -334
- package/coverage/lcov-report/draggable/utils.ts.html +0 -808
- package/coverage/lcov-report/expansion-panel/ExpansionList.tsx.html +0 -211
- package/coverage/lcov-report/expansion-panel/ExpansionPanel.tsx.html +0 -943
- package/coverage/lcov-report/expansion-panel/ExpansionPanelHeader.tsx.html +0 -649
- package/coverage/lcov-report/expansion-panel/index.html +0 -146
- package/coverage/lcov-report/expansion-panel/useExpansionPanels.ts.html +0 -928
- package/coverage/lcov-report/filters.ts.html +0 -1045
- package/coverage/lcov-report/findMatchIndex.ts.html +0 -385
- package/coverage/lcov-report/form/AutoComplete.tsx.html +0 -283
- package/coverage/lcov-report/form/FileInput.tsx.html +0 -739
- package/coverage/lcov-report/form/Form.tsx.html +0 -238
- package/coverage/lcov-report/form/FormMessage.tsx.html +0 -322
- package/coverage/lcov-report/form/FormMessageContainer.tsx.html +0 -229
- package/coverage/lcov-report/form/InputToggle.tsx.html +0 -1108
- package/coverage/lcov-report/form/InputToggleIcon.tsx.html +0 -478
- package/coverage/lcov-report/form/Label.tsx.html +0 -442
- package/coverage/lcov-report/form/MenuItemInputToggle.tsx.html +0 -979
- package/coverage/lcov-report/form/MenuItemTextField.tsx.html +0 -289
- package/coverage/lcov-report/form/NativeSelect.tsx.html +0 -826
- package/coverage/lcov-report/form/OptGroup.tsx.html +0 -343
- package/coverage/lcov-report/form/Option.tsx.html +0 -727
- package/coverage/lcov-report/form/Password.tsx.html +0 -721
- package/coverage/lcov-report/form/Radio.tsx.html +0 -169
- package/coverage/lcov-report/form/ResizingTextArea.tsx.html +0 -442
- package/coverage/lcov-report/form/ResizingTextAreaWrapper.tsx.html +0 -310
- package/coverage/lcov-report/form/Select.tsx.html +0 -1456
- package/coverage/lcov-report/form/SelectOriginal.tsx.html +0 -1630
- package/coverage/lcov-report/form/SelectV2.tsx.html +0 -1024
- package/coverage/lcov-report/form/SelectedOption.tsx.html +0 -250
- package/coverage/lcov-report/form/SimpleTextArea.tsx.html +0 -727
- package/coverage/lcov-report/form/Slider.tsx.html +0 -2014
- package/coverage/lcov-report/form/SliderThumb.tsx.html +0 -1030
- package/coverage/lcov-report/form/SliderValueTooltip.tsx.html +0 -319
- package/coverage/lcov-report/form/Switch.tsx.html +0 -535
- package/coverage/lcov-report/form/SwitchTrack.tsx.html +0 -262
- package/coverage/lcov-report/form/TextArea.tsx.html +0 -964
- package/coverage/lcov-report/form/TextArea2.tsx.html +0 -985
- package/coverage/lcov-report/form/TextAreaBackup.tsx.html +0 -1006
- package/coverage/lcov-report/form/TextField.tsx.html +0 -829
- package/coverage/lcov-report/form/fileUtils.ts.html +0 -2155
- package/coverage/lcov-report/form/formMessageStyles.ts.html +0 -238
- package/coverage/lcov-report/form/index.html +0 -146
- package/coverage/lcov-report/form/inputToggleStyles.ts.html +0 -316
- package/coverage/lcov-report/form/selectUtils.ts.html +0 -397
- package/coverage/lcov-report/form/switchStyles.ts.html +0 -172
- package/coverage/lcov-report/form/textAreaStyles.ts.html +0 -382
- package/coverage/lcov-report/form/useAutoComplete.ts.html +0 -787
- package/coverage/lcov-report/form/useCheckboxGroup.ts.html +0 -1087
- package/coverage/lcov-report/form/useCombobox-6-13.ts.html +0 -1054
- package/coverage/lcov-report/form/useCombobox-6-15.ts.html +0 -1048
- package/coverage/lcov-report/form/useCombobox.ts.html +0 -1045
- package/coverage/lcov-report/form/useComboboxBoth.ts.html +0 -85
- package/coverage/lcov-report/form/useComboboxDialog.ts.html +0 -85
- package/coverage/lcov-report/form/useComboboxList.ts.html +0 -418
- package/coverage/lcov-report/form/useComboboxOrig.ts.html +0 -781
- package/coverage/lcov-report/form/useFileUpload.ts.html +0 -1702
- package/coverage/lcov-report/form/useFormReset.ts.html +0 -229
- package/coverage/lcov-report/form/useInlineAutoComplete.ts.html +0 -379
- package/coverage/lcov-report/form/useListboxProvider.ts.html +0 -214
- package/coverage/lcov-report/form/useNumberField.ts.html +0 -1561
- package/coverage/lcov-report/form/useRadioGroup.ts.html +0 -1009
- package/coverage/lcov-report/form/useRangeSlider.ts.html +0 -355
- package/coverage/lcov-report/form/useResizingTextArea.ts.html +0 -631
- package/coverage/lcov-report/form/useResizingTextArea2.ts.html +0 -631
- package/coverage/lcov-report/form/useSelectCombobox.ts.html +0 -499
- package/coverage/lcov-report/form/useSlider.ts.html +0 -421
- package/coverage/lcov-report/form/useTextField.ts.html +0 -2203
- package/coverage/lcov-report/form/utils.ts.html +0 -382
- package/coverage/lcov-report/form/validation.ts.html +0 -886
- package/coverage/lcov-report/getHrefFromParents.ts.html +0 -133
- package/coverage/lcov-report/getListItemHeight.ts.html +0 -298
- package/coverage/lcov-report/hoverMode/index.html +0 -116
- package/coverage/lcov-report/hoverMode/useHoverMode.ts.html +0 -676
- package/coverage/lcov-report/icon/FontIcon.tsx.html +0 -256
- package/coverage/lcov-report/icon/MaterialIcon.tsx.html +0 -235
- package/coverage/lcov-report/icon/index.html +0 -116
- package/coverage/lcov-report/icon/styles.ts.html +0 -586
- package/coverage/lcov-report/iconConfig.tsx.html +0 -973
- package/coverage/lcov-report/inputToggleStyles.ts.html +0 -316
- package/coverage/lcov-report/interaction/ElementInteractionProvider.tsx.html +0 -253
- package/coverage/lcov-report/interaction/UserInteractionModeProvider.tsx.html +0 -679
- package/coverage/lcov-report/interaction/config.ts.html +0 -181
- package/coverage/lcov-report/interaction/index.html +0 -131
- package/coverage/lcov-report/layout/LayoutAppBar.tsx.html +0 -358
- package/coverage/lcov-report/layout/LayoutNav.tsx.html +0 -682
- package/coverage/lcov-report/layout/LayoutWindowSplitter.tsx.html +0 -460
- package/coverage/lcov-report/layout/Main.tsx.html +0 -364
- package/coverage/lcov-report/layout/NavigationLink.tsx.html +0 -334
- package/coverage/lcov-report/layout/NavigationRail.tsx.html +0 -157
- package/coverage/lcov-report/layout/index.html +0 -161
- package/coverage/lcov-report/layout/layoutNavStyles.ts.html +0 -166
- package/coverage/lcov-report/layout/layoutWindowSplitterStyles.ts.html +0 -220
- package/coverage/lcov-report/layout/navigationLinkStyles.ts.html +0 -250
- package/coverage/lcov-report/layout/navigationRailStyles.ts.html +0 -148
- package/coverage/lcov-report/layout/useExpandableLayout.ts.html +0 -928
- package/coverage/lcov-report/layout/useExpandableLayoutAppBarTransition.ts.html +0 -199
- package/coverage/lcov-report/layout/useHorizontalLayoutTransition.ts.html +0 -349
- package/coverage/lcov-report/layout/useLayoutAppBarHeight.ts.html +0 -343
- package/coverage/lcov-report/layout/useLayoutNavigation.ts.html +0 -544
- package/coverage/lcov-report/layout/useLayoutTree.ts.html +0 -691
- package/coverage/lcov-report/layout/useLayoutWindowSplitter.ts.html +0 -517
- package/coverage/lcov-report/layout/useMainTabIndex.ts.html +0 -136
- package/coverage/lcov-report/layout/useResizableLayout.ts.html +0 -328
- package/coverage/lcov-report/layout/useTemporaryLayout.ts.html +0 -589
- package/coverage/lcov-report/link/Link.tsx.html +0 -358
- package/coverage/lcov-report/link/LinkProvider.tsx.html +0 -214
- package/coverage/lcov-report/link/SkipToMainContent.tsx.html +0 -448
- package/coverage/lcov-report/link/index.html +0 -116
- package/coverage/lcov-report/list/List.tsx.html +0 -490
- package/coverage/lcov-report/list/ListItem.tsx.html +0 -886
- package/coverage/lcov-report/list/ListItemAddon.tsx.html +0 -286
- package/coverage/lcov-report/list/ListItemChildren.tsx.html +0 -445
- package/coverage/lcov-report/list/ListItemLink.tsx.html +0 -616
- package/coverage/lcov-report/list/ListItemText.tsx.html +0 -280
- package/coverage/lcov-report/list/ListSubheader.tsx.html +0 -322
- package/coverage/lcov-report/list/index.html +0 -191
- package/coverage/lcov-report/list/listItemStyles.ts.html +0 -703
- package/coverage/lcov-report/materialConfig.ts.html +0 -703
- package/coverage/lcov-report/media-queries/AppSizeProvider.tsx.html +0 -499
- package/coverage/lcov-report/media-queries/appSize.ts.html +0 -445
- package/coverage/lcov-report/media-queries/index.html +0 -116
- package/coverage/lcov-report/media-queries/useMediaQuery.ts.html +0 -244
- package/coverage/lcov-report/media-queries/useMinWidthMediaQuery.ts.html +0 -115
- package/coverage/lcov-report/menu/DropdownMenu.tsx.html +0 -976
- package/coverage/lcov-report/menu/Menu.tsx.html +0 -1894
- package/coverage/lcov-report/menu/MenuConfigurationProvider.tsx.html +0 -637
- package/coverage/lcov-report/menu/MenuItem.tsx.html +0 -292
- package/coverage/lcov-report/menu/MenuItemCircularProgress.tsx.html +0 -433
- package/coverage/lcov-report/menu/MenuItemGroup.tsx.html +0 -382
- package/coverage/lcov-report/menu/MenuSheet.tsx.html +0 -502
- package/coverage/lcov-report/menu/MenuVisibilityProvider.tsx.html +0 -370
- package/coverage/lcov-report/menu/MenuWidget.tsx.html +0 -634
- package/coverage/lcov-report/menu/index.html +0 -116
- package/coverage/lcov-report/menu/menuConfig.ts.html +0 -118
- package/coverage/lcov-report/menu/useContextMenu.ts.html +0 -490
- package/coverage/lcov-report/menuItemInputToggleStyles.ts.html +0 -319
- package/coverage/lcov-report/movement/index.html +0 -116
- package/coverage/lcov-report/movement/useKeyboardMovementProvider.ts.html +0 -1723
- package/coverage/lcov-report/navigation/CollapsibleNavGroup.tsx.html +0 -334
- package/coverage/lcov-report/navigation/DefaultNavigationRenderer.tsx.html +0 -298
- package/coverage/lcov-report/navigation/NavGroup.tsx.html +0 -193
- package/coverage/lcov-report/navigation/NavItem.tsx.html +0 -160
- package/coverage/lcov-report/navigation/NavItemButton.tsx.html +0 -397
- package/coverage/lcov-report/navigation/NavItemLink.tsx.html +0 -574
- package/coverage/lcov-report/navigation/NavSubheader.tsx.html +0 -184
- package/coverage/lcov-report/navigation/Navigation.tsx.html +0 -358
- package/coverage/lcov-report/navigation/getHrefFromParents.ts.html +0 -130
- package/coverage/lcov-report/navigation/index.html +0 -146
- package/coverage/lcov-report/navigation/navGroupStyles.ts.html +0 -148
- package/coverage/lcov-report/navigation/navItemStyles.ts.html +0 -298
- package/coverage/lcov-report/overlay/Overlay.tsx.html +0 -655
- package/coverage/lcov-report/overlay/index.html +0 -116
- package/coverage/lcov-report/positioning/constants.ts.html +0 -463
- package/coverage/lcov-report/positioning/createVerticalPosition.ts.html +0 -1009
- package/coverage/lcov-report/positioning/getFixedPosition.ts.html +0 -616
- package/coverage/lcov-report/positioning/index.html +0 -131
- package/coverage/lcov-report/positioning/useFixedPositioning.ts.html +0 -1321
- package/coverage/lcov-report/progress/CircularProgress.tsx.html +0 -799
- package/coverage/lcov-report/progress/LinearProgress.tsx.html +0 -658
- package/coverage/lcov-report/progress/index.html +0 -116
- package/coverage/lcov-report/searching/caseInsensitive.ts.html +0 -685
- package/coverage/lcov-report/searching/toSearchQuery.ts.html +0 -145
- package/coverage/lcov-report/searching/useFuzzyMatch.ts.html +0 -211
- package/coverage/lcov-report/searching/utils.ts.html +0 -244
- package/coverage/lcov-report/segmented-button/SegmentedButton.tsx.html +0 -628
- package/coverage/lcov-report/segmented-button/SegmentedButtonContainer.tsx.html +0 -259
- package/coverage/lcov-report/segmented-button/index.html +0 -161
- package/coverage/lcov-report/segmented-button/segmentedButtonContainerStyles.ts.html +0 -151
- package/coverage/lcov-report/segmented-button/segmentedButtonStyles.ts.html +0 -199
- package/coverage/lcov-report/segmentedButtonContainerStyles.ts.html +0 -160
- package/coverage/lcov-report/segmentedButtonStyles.ts.html +0 -199
- package/coverage/lcov-report/sheet/Sheet.tsx.html +0 -397
- package/coverage/lcov-report/sheet/index.html +0 -116
- package/coverage/lcov-report/sheet/styles.ts.html +0 -376
- package/coverage/lcov-report/skeletonPlaceholderUtils.ts.html +0 -400
- package/coverage/lcov-report/snackbar/DefaultToastRenderer.tsx.html +0 -529
- package/coverage/lcov-report/snackbar/Snackbar.tsx.html +0 -610
- package/coverage/lcov-report/snackbar/Toast.tsx.html +0 -868
- package/coverage/lcov-report/snackbar/ToastContent.tsx.html +0 -364
- package/coverage/lcov-report/snackbar/ToastManager.tsx.html +0 -1804
- package/coverage/lcov-report/snackbar/ToastManagerProvider.tsx.html +0 -400
- package/coverage/lcov-report/snackbar/index.html +0 -116
- package/coverage/lcov-report/snackbar/snackbarStyles.ts.html +0 -139
- package/coverage/lcov-report/snackbar/toastContentStyles.ts.html +0 -196
- package/coverage/lcov-report/snackbar/toastStyles.ts.html +0 -349
- package/coverage/lcov-report/snackbar/useCurrentToastActions.ts.html +0 -226
- package/coverage/lcov-report/snackbarStyles.ts.html +0 -139
- package/coverage/lcov-report/src/AppSize.tsx.html +0 -247
- package/coverage/lcov-report/src/AppSizeProvider.tsx.html +0 -787
- package/coverage/lcov-report/src/CoreProviders.tsx.html +0 -412
- package/coverage/lcov-report/src/NoSsr.tsx.html +0 -250
- package/coverage/lcov-report/src/NullSsrSuspense.tsx.html +0 -223
- package/coverage/lcov-report/src/RootHtml.tsx.html +0 -370
- package/coverage/lcov-report/src/SsrProvider.tsx.html +0 -211
- package/coverage/lcov-report/src/app-bar/AppBar.tsx.html +0 -937
- package/coverage/lcov-report/src/app-bar/AppBarTitle.tsx.html +0 -445
- package/coverage/lcov-report/src/app-bar/index.html +0 -131
- package/coverage/lcov-report/src/autocomplete/Autocomplete.tsx.html +0 -328
- package/coverage/lcov-report/src/autocomplete/AutocompleteGeneric.tsx.html +0 -304
- package/coverage/lcov-report/src/autocomplete/index.html +0 -221
- package/coverage/lcov-report/src/autocomplete/useAutocomplete.ts.html +0 -1039
- package/coverage/lcov-report/src/autocomplete/useAutocompleteAgain.ts.html +0 -829
- package/coverage/lcov-report/src/autocomplete/useAutocompletev2.ts.html +0 -715
- package/coverage/lcov-report/src/autocomplete/useInlineAutocomplete.ts.html +0 -454
- package/coverage/lcov-report/src/autocomplete/useInlineSelection.ts.html +0 -373
- package/coverage/lcov-report/src/autocomplete/utils.ts.html +0 -196
- package/coverage/lcov-report/src/avatar/Avatar.tsx.html +0 -472
- package/coverage/lcov-report/src/avatar/index.html +0 -131
- package/coverage/lcov-report/src/avatar/styles.ts.html +0 -268
- package/coverage/lcov-report/src/badge/Badge.tsx.html +0 -382
- package/coverage/lcov-report/src/badge/index.html +0 -116
- package/coverage/lcov-report/src/box/Box.tsx.html +0 -541
- package/coverage/lcov-report/src/box/index.html +0 -131
- package/coverage/lcov-report/src/box/styles.ts.html +0 -622
- package/coverage/lcov-report/src/button/AsyncButton.tsx.html +0 -1045
- package/coverage/lcov-report/src/button/Button.tsx.html +0 -688
- package/coverage/lcov-report/src/button/ButtonUnstyled.tsx.html +0 -211
- package/coverage/lcov-report/src/button/FloatingActionButton.tsx.html +0 -382
- package/coverage/lcov-report/src/button/TooltippedButton.tsx.html +0 -445
- package/coverage/lcov-report/src/button/buttonStyles.ts.html +0 -607
- package/coverage/lcov-report/src/button/buttonUnstyledStyles.ts.html +0 -142
- package/coverage/lcov-report/src/button/index.html +0 -116
- package/coverage/lcov-report/src/card/Card.tsx.html +0 -349
- package/coverage/lcov-report/src/card/CardContent.tsx.html +0 -223
- package/coverage/lcov-report/src/card/CardFooter.tsx.html +0 -196
- package/coverage/lcov-report/src/card/CardHeader.tsx.html +0 -319
- package/coverage/lcov-report/src/card/CardSubtitle.tsx.html +0 -250
- package/coverage/lcov-report/src/card/CardTitle.tsx.html +0 -247
- package/coverage/lcov-report/src/card/ClickableCard.tsx.html +0 -400
- package/coverage/lcov-report/src/card/index.html +0 -221
- package/coverage/lcov-report/src/card/styles.ts.html +0 -694
- package/coverage/lcov-report/src/chip/Chip.tsx.html +0 -1102
- package/coverage/lcov-report/src/chip/index.html +0 -131
- package/coverage/lcov-report/src/chip/styles.ts.html +0 -457
- package/coverage/lcov-report/src/cssUtils.ts.html +0 -787
- package/coverage/lcov-report/src/delegateEvent.ts.html +0 -619
- package/coverage/lcov-report/src/dialog/Dialog.tsx.html +0 -1309
- package/coverage/lcov-report/src/dialog/DialogContainer.tsx.html +0 -175
- package/coverage/lcov-report/src/dialog/DialogContent.tsx.html +0 -178
- package/coverage/lcov-report/src/dialog/DialogFooter.tsx.html +0 -169
- package/coverage/lcov-report/src/dialog/DialogHeader.tsx.html +0 -148
- package/coverage/lcov-report/src/dialog/DialogTitle.tsx.html +0 -256
- package/coverage/lcov-report/src/dialog/FixedDialog.tsx.html +0 -577
- package/coverage/lcov-report/src/dialog/NestedDialogProvider.ts.html +0 -127
- package/coverage/lcov-report/src/dialog/index.html +0 -236
- package/coverage/lcov-report/src/dialog/styles.ts.html +0 -439
- package/coverage/lcov-report/src/divider/Divider.tsx.html +0 -274
- package/coverage/lcov-report/src/divider/VerticalDivider.tsx.html +0 -235
- package/coverage/lcov-report/src/divider/index.html +0 -116
- package/coverage/lcov-report/src/divider/styles.ts.html +0 -232
- package/coverage/lcov-report/src/divider/useVerticalDividerHeight.ts.html +0 -301
- package/coverage/lcov-report/src/draggable/index.html +0 -131
- package/coverage/lcov-report/src/draggable/useControlledDraggable.ts.html +0 -2137
- package/coverage/lcov-report/src/draggable/useDraggable.ts.html +0 -2398
- package/coverage/lcov-report/src/draggable/useDraggableOrig.ts.html +0 -316
- package/coverage/lcov-report/src/draggable/useLocalStorageDraggable.ts.html +0 -370
- package/coverage/lcov-report/src/draggable/utils.ts.html +0 -808
- package/coverage/lcov-report/src/expansion-panel/ExpansionList.tsx.html +0 -211
- package/coverage/lcov-report/src/expansion-panel/ExpansionPanel.tsx.html +0 -943
- package/coverage/lcov-report/src/expansion-panel/ExpansionPanelHeader.tsx.html +0 -649
- package/coverage/lcov-report/src/expansion-panel/index.html +0 -176
- package/coverage/lcov-report/src/expansion-panel/useExpansionList.ts.html +0 -322
- package/coverage/lcov-report/src/expansion-panel/useExpansionPanels.ts.html +0 -928
- package/coverage/lcov-report/src/focus/index.html +0 -131
- package/coverage/lcov-report/src/focus/useFocusContainer.ts.html +0 -883
- package/coverage/lcov-report/src/focus/utils.ts.html +0 -544
- package/coverage/lcov-report/src/form/AutoComplete.tsx.html +0 -283
- package/coverage/lcov-report/src/form/Checkbox.tsx.html +0 -160
- package/coverage/lcov-report/src/form/Fieldset.tsx.html +0 -355
- package/coverage/lcov-report/src/form/FileInput.tsx.html +0 -739
- package/coverage/lcov-report/src/form/Form.tsx.html +0 -238
- package/coverage/lcov-report/src/form/FormMessage.tsx.html +0 -322
- package/coverage/lcov-report/src/form/FormMessageContainer.tsx.html +0 -223
- package/coverage/lcov-report/src/form/FormMessageCounter.tsx.html +0 -262
- package/coverage/lcov-report/src/form/FormThemeProvider.tsx.html +0 -313
- package/coverage/lcov-report/src/form/InputToggle.tsx.html +0 -1108
- package/coverage/lcov-report/src/form/InputToggleIcon.tsx.html +0 -478
- package/coverage/lcov-report/src/form/Label.tsx.html +0 -439
- package/coverage/lcov-report/src/form/Legend.tsx.html +0 -199
- package/coverage/lcov-report/src/form/MenuItemCheckbox.tsx.html +0 -223
- package/coverage/lcov-report/src/form/MenuItemFileInput.tsx.html +0 -424
- package/coverage/lcov-report/src/form/MenuItemInputToggle.tsx.html +0 -925
- package/coverage/lcov-report/src/form/MenuItemRadio.tsx.html +0 -436
- package/coverage/lcov-report/src/form/MenuItemSwitch.tsx.html +0 -211
- package/coverage/lcov-report/src/form/MenuItemTextField.tsx.html +0 -289
- package/coverage/lcov-report/src/form/NativeSelect.tsx.html +0 -763
- package/coverage/lcov-report/src/form/OptGroup.tsx.html +0 -343
- package/coverage/lcov-report/src/form/Option.tsx.html +0 -709
- package/coverage/lcov-report/src/form/Password.tsx.html +0 -721
- package/coverage/lcov-report/src/form/Radio.tsx.html +0 -172
- package/coverage/lcov-report/src/form/ResizingTextArea.tsx.html +0 -988
- package/coverage/lcov-report/src/form/ResizingTextAreaWrapper.tsx.html +0 -310
- package/coverage/lcov-report/src/form/Select.tsx.html +0 -1411
- package/coverage/lcov-report/src/form/SelectValue.tsx.html +0 -202
- package/coverage/lcov-report/src/form/SimpleTextArea.tsx.html +0 -694
- package/coverage/lcov-report/src/form/Slider.tsx.html +0 -2008
- package/coverage/lcov-report/src/form/SliderContainer.tsx.html +0 -358
- package/coverage/lcov-report/src/form/SliderMark.tsx.html +0 -208
- package/coverage/lcov-report/src/form/SliderMarkLabel.tsx.html +0 -271
- package/coverage/lcov-report/src/form/SliderThumb.tsx.html +0 -1084
- package/coverage/lcov-report/src/form/SliderTrack.tsx.html +0 -454
- package/coverage/lcov-report/src/form/SliderValueMarks.tsx.html +0 -745
- package/coverage/lcov-report/src/form/SliderValueTooltip.tsx.html +0 -319
- package/coverage/lcov-report/src/form/Switch.tsx.html +0 -535
- package/coverage/lcov-report/src/form/SwitchTrack.tsx.html +0 -262
- package/coverage/lcov-report/src/form/TextArea.tsx.html +0 -1006
- package/coverage/lcov-report/src/form/TextArea2.tsx.html +0 -985
- package/coverage/lcov-report/src/form/TextAreaBackup.tsx.html +0 -985
- package/coverage/lcov-report/src/form/TextField.tsx.html +0 -829
- package/coverage/lcov-report/src/form/TextFieldAddon.tsx.html +0 -382
- package/coverage/lcov-report/src/form/TextFieldContainer.tsx.html +0 -364
- package/coverage/lcov-report/src/form/TextFieldContainerStyles.ts.html +0 -418
- package/coverage/lcov-report/src/form/fileUtils.ts.html +0 -2155
- package/coverage/lcov-report/src/form/formConfig.ts.html +0 -157
- package/coverage/lcov-report/src/form/formMessageStyles.ts.html +0 -238
- package/coverage/lcov-report/src/form/index.html +0 -176
- package/coverage/lcov-report/src/form/inputToggleStyles.ts.html +0 -316
- package/coverage/lcov-report/src/form/menuItemInputToggleStyles.ts.html +0 -319
- package/coverage/lcov-report/src/form/nativeSelectStyles.ts.html +0 -253
- package/coverage/lcov-report/src/form/optionStyles.ts.html +0 -151
- package/coverage/lcov-report/src/form/passwordStyles.ts.html +0 -235
- package/coverage/lcov-report/src/form/selectStyles.ts.html +0 -181
- package/coverage/lcov-report/src/form/selectUtils.ts.html +0 -430
- package/coverage/lcov-report/src/form/sliderUtils.ts.html +0 -790
- package/coverage/lcov-report/src/form/switchStyles.ts.html +0 -172
- package/coverage/lcov-report/src/form/textAreaStyles.ts.html +0 -385
- package/coverage/lcov-report/src/form/textFieldStyles.ts.html +0 -184
- package/coverage/lcov-report/src/form/useAutoComplete.ts.html +0 -787
- package/coverage/lcov-report/src/form/useCheckboxGroup.ts.html +0 -1087
- package/coverage/lcov-report/src/form/useCombobox.ts.html +0 -1540
- package/coverage/lcov-report/src/form/useComboboxBoth.ts.html +0 -85
- package/coverage/lcov-report/src/form/useComboboxDialog.ts.html +0 -85
- package/coverage/lcov-report/src/form/useComboboxList.ts.html +0 -403
- package/coverage/lcov-report/src/form/useComboboxOrig.ts.html +0 -781
- package/coverage/lcov-report/src/form/useEditableCombobox.ts.html +0 -502
- package/coverage/lcov-report/src/form/useFileUpload.ts.html +0 -1702
- package/coverage/lcov-report/src/form/useInlineAutoComplete.ts.html +0 -109
- package/coverage/lcov-report/src/form/useListboxProvider.ts.html +0 -214
- package/coverage/lcov-report/src/form/useNumberField.ts.html +0 -1561
- package/coverage/lcov-report/src/form/useRadioGroup.ts.html +0 -1021
- package/coverage/lcov-report/src/form/useRangeSlider.ts.html +0 -355
- package/coverage/lcov-report/src/form/useResizingTextArea.ts.html +0 -634
- package/coverage/lcov-report/src/form/useResizingTextArea.tsx.html +0 -523
- package/coverage/lcov-report/src/form/useSelectCombobox.ts.html +0 -295
- package/coverage/lcov-report/src/form/useSlider.ts.html +0 -421
- package/coverage/lcov-report/src/form/useTextField.ts.html +0 -2203
- package/coverage/lcov-report/src/form/utils.ts.html +0 -373
- package/coverage/lcov-report/src/form/validation.ts.html +0 -886
- package/coverage/lcov-report/src/hoverMode/index.html +0 -131
- package/coverage/lcov-report/src/hoverMode/useHoverMode.ts.html +0 -676
- package/coverage/lcov-report/src/hoverMode/useHoverModeProvider.ts.html +0 -1018
- package/coverage/lcov-report/src/icon/FontIcon.tsx.html +0 -256
- package/coverage/lcov-report/src/icon/IconProvider.tsx.html +0 -931
- package/coverage/lcov-report/src/icon/IconRotator.tsx.html +0 -322
- package/coverage/lcov-report/src/icon/MaterialIcon.tsx.html +0 -235
- package/coverage/lcov-report/src/icon/MaterialIconsProvider.ts.html +0 -154
- package/coverage/lcov-report/src/icon/MaterialSymbol.tsx.html +0 -421
- package/coverage/lcov-report/src/icon/MaterialSymbolsProvider.tsx.html +0 -757
- package/coverage/lcov-report/src/icon/SVGIcon.tsx.html +0 -445
- package/coverage/lcov-report/src/icon/TextIconSpacing.tsx.html +0 -679
- package/coverage/lcov-report/src/icon/iconConfig.tsx.html +0 -973
- package/coverage/lcov-report/src/icon/index.html +0 -116
- package/coverage/lcov-report/src/icon/material.ts.html +0 -15922
- package/coverage/lcov-report/src/icon/materialConfig.ts.html +0 -703
- package/coverage/lcov-report/src/icon/styles.ts.html +0 -586
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/src/interaction/ElementInteractionProvider.tsx.html +0 -277
- package/coverage/lcov-report/src/interaction/LazyRippleContainer.tsx.html +0 -136
- package/coverage/lcov-report/src/interaction/Ripple.tsx.html +0 -283
- package/coverage/lcov-report/src/interaction/RippleContainer.tsx.html +0 -211
- package/coverage/lcov-report/src/interaction/UserInteractionModeProvider.tsx.html +0 -679
- package/coverage/lcov-report/src/interaction/config.ts.html +0 -181
- package/coverage/lcov-report/src/interaction/index.html +0 -206
- package/coverage/lcov-report/src/interaction/useElementInteraction.ts.html +0 -1474
- package/coverage/lcov-report/src/interaction/useElementInteraction.tsx.html +0 -1513
- package/coverage/lcov-report/src/interaction/useHigherContrastChildren.tsx.html +0 -355
- package/coverage/lcov-report/src/interaction/utils.ts.html +0 -496
- package/coverage/lcov-report/src/layout/DefaultLayoutNavigationItemRenderer.tsx.html +0 -169
- package/coverage/lcov-report/src/layout/DefaultLayoutNavigationMiniItemRenderer.tsx.html +0 -160
- package/coverage/lcov-report/src/layout/Layout.tsx.html +0 -235
- package/coverage/lcov-report/src/layout/LayoutAppBar.tsx.html +0 -364
- package/coverage/lcov-report/src/layout/LayoutAppBarTitle.tsx.html +0 -193
- package/coverage/lcov-report/src/layout/LayoutChildren.tsx.html +0 -718
- package/coverage/lcov-report/src/layout/LayoutCloseNavigationButton.tsx.html +0 -265
- package/coverage/lcov-report/src/layout/LayoutMain.tsx.html +0 -580
- package/coverage/lcov-report/src/layout/LayoutNav.tsx.html +0 -688
- package/coverage/lcov-report/src/layout/LayoutNavToggle.tsx.html +0 -430
- package/coverage/lcov-report/src/layout/LayoutNavigation.tsx.html +0 -445
- package/coverage/lcov-report/src/layout/LayoutNavigationHeader.tsx.html +0 -274
- package/coverage/lcov-report/src/layout/LayoutProvider.tsx.html +0 -706
- package/coverage/lcov-report/src/layout/LayoutTree.tsx.html +0 -331
- package/coverage/lcov-report/src/layout/LayoutWindowSplitter.tsx.html +0 -472
- package/coverage/lcov-report/src/layout/Main.tsx.html +0 -364
- package/coverage/lcov-report/src/layout/MiniLayoutWrapper.tsx.html +0 -541
- package/coverage/lcov-report/src/layout/NavigationLink.tsx.html +0 -334
- package/coverage/lcov-report/src/layout/NavigationRail.tsx.html +0 -157
- package/coverage/lcov-report/src/layout/TemporaryLayout.tsx.html +0 -85
- package/coverage/lcov-report/src/layout/constants.ts.html +0 -169
- package/coverage/lcov-report/src/layout/index.html +0 -146
- package/coverage/lcov-report/src/layout/layoutNavStyles.ts.html +0 -166
- package/coverage/lcov-report/src/layout/layoutWindowSplitterStyles.ts.html +0 -220
- package/coverage/lcov-report/src/layout/mainStyles.ts.html +0 -217
- package/coverage/lcov-report/src/layout/navigationLinkStyles.ts.html +0 -250
- package/coverage/lcov-report/src/layout/navigationRailStyles.ts.html +0 -148
- package/coverage/lcov-report/src/layout/useExpandableLayout.ts.html +0 -742
- package/coverage/lcov-report/src/layout/useHorizontalLayoutTransition.ts.html +0 -349
- package/coverage/lcov-report/src/layout/useLayoutAppBarHeight.ts.html +0 -358
- package/coverage/lcov-report/src/layout/useLayoutNavigation.ts.html +0 -544
- package/coverage/lcov-report/src/layout/useLayoutTree.ts.html +0 -691
- package/coverage/lcov-report/src/layout/useLayoutWindowSplitter.ts.html +0 -496
- package/coverage/lcov-report/src/layout/useMainTabIndex.ts.html +0 -136
- package/coverage/lcov-report/src/layout/useResizableLayout.ts.html +0 -535
- package/coverage/lcov-report/src/layout/useTemporaryLayout.ts.html +0 -589
- package/coverage/lcov-report/src/layout/utils.ts.html +0 -391
- package/coverage/lcov-report/src/link/Link.tsx.html +0 -358
- package/coverage/lcov-report/src/link/LinkProvider.tsx.html +0 -238
- package/coverage/lcov-report/src/link/SkipToMainContent.tsx.html +0 -448
- package/coverage/lcov-report/src/link/index.html +0 -146
- package/coverage/lcov-report/src/link/styles.ts.html +0 -238
- package/coverage/lcov-report/src/list/List.tsx.html +0 -487
- package/coverage/lcov-report/src/list/ListItem.tsx.html +0 -892
- package/coverage/lcov-report/src/list/ListItemAddon.tsx.html +0 -286
- package/coverage/lcov-report/src/list/ListItemChildren.tsx.html +0 -445
- package/coverage/lcov-report/src/list/ListItemLink.tsx.html +0 -616
- package/coverage/lcov-report/src/list/ListItemText.tsx.html +0 -277
- package/coverage/lcov-report/src/list/ListSubheader.tsx.html +0 -319
- package/coverage/lcov-report/src/list/getListItemHeight.ts.html +0 -298
- package/coverage/lcov-report/src/list/index.html +0 -116
- package/coverage/lcov-report/src/list/listItemStyles.ts.html +0 -703
- package/coverage/lcov-report/src/main-layout/DefaultLayoutNavigationItemRenderer.tsx.html +0 -169
- package/coverage/lcov-report/src/main-layout/DefaultLayoutNavigationMiniItemRenderer.tsx.html +0 -160
- package/coverage/lcov-report/src/main-layout/Main.tsx.html +0 -298
- package/coverage/lcov-report/src/main-layout/MainLayout.tsx.html +0 -619
- package/coverage/lcov-report/src/main-layout/MainLayoutAppBar.tsx.html +0 -448
- package/coverage/lcov-report/src/main-layout/MainLayoutNavigationButton.tsx.html +0 -295
- package/coverage/lcov-report/src/main-layout/MainLayoutTitle.tsx.html +0 -184
- package/coverage/lcov-report/src/main-layout/MainNavWindowSplitter.tsx.html +0 -427
- package/coverage/lcov-report/src/main-layout/MainNavigation.tsx.html +0 -568
- package/coverage/lcov-report/src/main-layout/MainNavigationTree.tsx.html +0 -115
- package/coverage/lcov-report/src/main-layout/index.html +0 -296
- package/coverage/lcov-report/src/main-layout/useLayoutNavigation.ts.html +0 -727
- package/coverage/lcov-report/src/main-layout/useMainLayout.ts.html +0 -523
- package/coverage/lcov-report/src/main-layout/useMainLayoutProvider.ts.html +0 -484
- package/coverage/lcov-report/src/main-layout-current/DefaultLayoutNavigationItemRenderer.tsx.html +0 -169
- package/coverage/lcov-report/src/main-layout-current/DefaultLayoutNavigationMiniItemRenderer.tsx.html +0 -160
- package/coverage/lcov-report/src/main-layout-current/Main.tsx.html +0 -265
- package/coverage/lcov-report/src/main-layout-current/MainLayout.tsx.html +0 -739
- package/coverage/lcov-report/src/main-layout-current/MainLayoutAppBar.tsx.html +0 -352
- package/coverage/lcov-report/src/main-layout-current/MainLayoutProvider.ts.html +0 -991
- package/coverage/lcov-report/src/main-layout-current/MainLayoutTitle.tsx.html +0 -184
- package/coverage/lcov-report/src/main-layout-current/MainNavWindowSplitter.tsx.html +0 -520
- package/coverage/lcov-report/src/main-layout-current/MainNavigation.tsx.html +0 -586
- package/coverage/lcov-report/src/main-layout-current/NavigationButton.tsx.html +0 -283
- package/coverage/lcov-report/src/main-layout-current/index.html +0 -266
- package/coverage/lcov-report/src/main-layout-current/useLayoutNavigation.ts.html +0 -727
- package/coverage/lcov-report/src/media-queries/AppSizeProvider.tsx.html +0 -502
- package/coverage/lcov-report/src/media-queries/appSize.ts.html +0 -445
- package/coverage/lcov-report/src/media-queries/index.html +0 -146
- package/coverage/lcov-report/src/media-queries/useMediaQuery.ts.html +0 -244
- package/coverage/lcov-report/src/media-queries/useMinWidthMediaQuery.ts.html +0 -115
- package/coverage/lcov-report/src/menu/DropdownMenu.tsx.html +0 -976
- package/coverage/lcov-report/src/menu/Menu.tsx.html +0 -1870
- package/coverage/lcov-report/src/menu/MenuBar.tsx.html +0 -442
- package/coverage/lcov-report/src/menu/MenuButton.tsx.html +0 -490
- package/coverage/lcov-report/src/menu/MenuConfigurationProvider.tsx.html +0 -637
- package/coverage/lcov-report/src/menu/MenuItem.tsx.html +0 -292
- package/coverage/lcov-report/src/menu/MenuItemButton.tsx.html +0 -580
- package/coverage/lcov-report/src/menu/MenuItemCircularProgress.tsx.html +0 -433
- package/coverage/lcov-report/src/menu/MenuItemGroup.tsx.html +0 -376
- package/coverage/lcov-report/src/menu/MenuItemSeparator.tsx.html +0 -226
- package/coverage/lcov-report/src/menu/MenuSheet.tsx.html +0 -502
- package/coverage/lcov-report/src/menu/MenuVisibilityProvider.tsx.html +0 -370
- package/coverage/lcov-report/src/menu/MenuWidget.tsx.html +0 -631
- package/coverage/lcov-report/src/menu/MenuWidgetKeyboardProvider.tsx.html +0 -190
- package/coverage/lcov-report/src/menu/index.html +0 -116
- package/coverage/lcov-report/src/menu/useContextMenu.ts.html +0 -490
- package/coverage/lcov-report/src/menu/useMenuBarProvider.ts.html +0 -349
- package/coverage/lcov-report/src/menu/utils.ts.html +0 -271
- package/coverage/lcov-report/src/movement/constants.ts.html +0 -193
- package/coverage/lcov-report/src/movement/findMatchIndex.ts.html +0 -385
- package/coverage/lcov-report/src/movement/index.html +0 -116
- package/coverage/lcov-report/src/movement/useKeyboardMovementProvider.ts.html +0 -1687
- package/coverage/lcov-report/src/movement/utils.ts.html +0 -895
- package/coverage/lcov-report/src/navigation/CollapsibleNavGroup.tsx.html +0 -367
- package/coverage/lcov-report/src/navigation/DefaultNavigationRenderer.tsx.html +0 -325
- package/coverage/lcov-report/src/navigation/NavGroup.tsx.html +0 -202
- package/coverage/lcov-report/src/navigation/NavItem.tsx.html +0 -172
- package/coverage/lcov-report/src/navigation/NavSubheader.tsx.html +0 -193
- package/coverage/lcov-report/src/navigation/Navigation.tsx.html +0 -358
- package/coverage/lcov-report/src/navigation/index.html +0 -191
- package/coverage/lcov-report/src/overlay/Overlay.tsx.html +0 -556
- package/coverage/lcov-report/src/overlay/index.html +0 -131
- package/coverage/lcov-report/src/overlay/overlayStyles.ts.html +0 -340
- package/coverage/lcov-report/src/portal/Portal.tsx.html +0 -223
- package/coverage/lcov-report/src/portal/PortalContainerProvider.tsx.html +0 -367
- package/coverage/lcov-report/src/portal/index.html +0 -131
- package/coverage/lcov-report/src/positioning/constants.ts.html +0 -463
- package/coverage/lcov-report/src/positioning/getFixedPosition.ts.html +0 -610
- package/coverage/lcov-report/src/positioning/index.html +0 -191
- package/coverage/lcov-report/src/positioning/useFixedPositioning.ts.html +0 -1339
- package/coverage/lcov-report/src/positioning/utils.ts.html +0 -1225
- package/coverage/lcov-report/src/progress/CircularProgress.tsx.html +0 -799
- package/coverage/lcov-report/src/progress/LinearProgress.tsx.html +0 -658
- package/coverage/lcov-report/src/progress/getProgressA11y.ts.html +0 -160
- package/coverage/lcov-report/src/progress/index.html +0 -146
- package/coverage/lcov-report/src/responsive-item/ResponsiveItemContainer.tsx.html +0 -628
- package/coverage/lcov-report/src/responsive-item/ResponsiveItemOverlay.tsx.html +0 -385
- package/coverage/lcov-report/src/responsive-item/index.html +0 -146
- package/coverage/lcov-report/src/responsive-item/styles.ts.html +0 -259
- package/coverage/lcov-report/src/scroll/ScrollLock.tsx.html +0 -133
- package/coverage/lcov-report/src/scroll/getScrollbarWidth.ts.html +0 -181
- package/coverage/lcov-report/src/scroll/index.html +0 -146
- package/coverage/lcov-report/src/scroll/useScrollLock.ts.html +0 -241
- package/coverage/lcov-report/src/segmented-button/SegmentedButton.tsx.html +0 -619
- package/coverage/lcov-report/src/segmented-button/SegmentedButtonContainer.tsx.html +0 -277
- package/coverage/lcov-report/src/segmented-button/index.html +0 -161
- package/coverage/lcov-report/src/segmented-button/segmentedButtonContainerStyles.ts.html +0 -160
- package/coverage/lcov-report/src/segmented-button/segmentedButtonStyles.ts.html +0 -205
- package/coverage/lcov-report/src/sheet/Sheet.tsx.html +0 -397
- package/coverage/lcov-report/src/sheet/index.html +0 -131
- package/coverage/lcov-report/src/sheet/styles.ts.html +0 -376
- package/coverage/lcov-report/src/snackbar/DefaultToastRenderer.tsx.html +0 -526
- package/coverage/lcov-report/src/snackbar/Snackbar.tsx.html +0 -628
- package/coverage/lcov-report/src/snackbar/Toast.tsx.html +0 -841
- package/coverage/lcov-report/src/snackbar/ToastActionButton.tsx.html +0 -298
- package/coverage/lcov-report/src/snackbar/ToastCloseButton.tsx.html +0 -349
- package/coverage/lcov-report/src/snackbar/ToastContent.tsx.html +0 -364
- package/coverage/lcov-report/src/snackbar/ToastManager.tsx.html +0 -1786
- package/coverage/lcov-report/src/snackbar/ToastManagerProvider.tsx.html +0 -400
- package/coverage/lcov-report/src/snackbar/index.html +0 -281
- package/coverage/lcov-report/src/snackbar/snackbarStyles.ts.html +0 -214
- package/coverage/lcov-report/src/snackbar/toastContentStyles.ts.html +0 -196
- package/coverage/lcov-report/src/snackbar/toastStyles.ts.html +0 -268
- package/coverage/lcov-report/src/snackbar/useCurrentToastActions.ts.html +0 -226
- package/coverage/lcov-report/src/snackbar/useDefaultToastRenderer.ts.html +0 -85
- package/coverage/lcov-report/src/snackbar/useDefaultToastRenderer.tsx.html +0 -394
- package/coverage/lcov-report/src/snackbar/useRemoveToast.ts.html +0 -169
- package/coverage/lcov-report/src/snackbar/useToast.ts.html +0 -184
- package/coverage/lcov-report/src/snackbar/useToastRenderer.ts.html +0 -85
- package/coverage/lcov-report/src/suspense/CircularProgressSuspense.tsx.html +0 -283
- package/coverage/lcov-report/src/suspense/NullSsrSuspense.tsx.html +0 -151
- package/coverage/lcov-report/src/suspense/NullSuspense.tsx.html +0 -202
- package/coverage/lcov-report/src/suspense/index.html +0 -131
- package/coverage/lcov-report/src/table/Table.tsx.html +0 -457
- package/coverage/lcov-report/src/table/TableBody.tsx.html +0 -280
- package/coverage/lcov-report/src/table/TableCell.tsx.html +0 -982
- package/coverage/lcov-report/src/table/TableCellContent.tsx.html +0 -436
- package/coverage/lcov-report/src/table/TableCheckbox.tsx.html +0 -715
- package/coverage/lcov-report/src/table/TableConfigurationProvider.tsx.html +0 -484
- package/coverage/lcov-report/src/table/TableContainer.tsx.html +0 -220
- package/coverage/lcov-report/src/table/TableContainerProvider.tsx.html +0 -193
- package/coverage/lcov-report/src/table/TableFooter.tsx.html +0 -538
- package/coverage/lcov-report/src/table/TableHeader.tsx.html +0 -565
- package/coverage/lcov-report/src/table/TableRadio.tsx.html +0 -676
- package/coverage/lcov-report/src/table/TableRow.tsx.html +0 -289
- package/coverage/lcov-report/src/table/index.html +0 -371
- package/coverage/lcov-report/src/table/tableCellStyles.ts.html +0 -334
- package/coverage/lcov-report/src/table/tableContainerStyles.ts.html +0 -142
- package/coverage/lcov-report/src/table/tableFooterStyles.ts.html +0 -166
- package/coverage/lcov-report/src/table/tableHeaderStyles.ts.html +0 -172
- package/coverage/lcov-report/src/table/tableRowStyles.ts.html +0 -169
- package/coverage/lcov-report/src/table/tableStyles.ts.html +0 -157
- package/coverage/lcov-report/src/tabs/Tab.tsx.html +0 -622
- package/coverage/lcov-report/src/tabs/TabList.tsx.html +0 -796
- package/coverage/lcov-report/src/tabs/TabListScrollButton.tsx.html +0 -490
- package/coverage/lcov-report/src/tabs/index.html +0 -251
- package/coverage/lcov-report/src/tabs/tabIndicatorStyles.ts.html +0 -187
- package/coverage/lcov-report/src/tabs/tabListScrollButtonStyles.ts.html +0 -226
- package/coverage/lcov-report/src/tabs/tabListStyles.ts.html +0 -241
- package/coverage/lcov-report/src/tabs/tabStyles.ts.html +0 -265
- package/coverage/lcov-report/src/tabs/useTabList.ts.html +0 -736
- package/coverage/lcov-report/src/tabs/useTabs.ts.html +0 -1567
- package/coverage/lcov-report/src/tabs/useTabsOriginal.ts.html +0 -760
- package/coverage/lcov-report/src/tabs/utils.ts.html +0 -337
- package/coverage/lcov-report/src/test-utils/IntersectionObserver.ts.html +0 -235
- package/coverage/lcov-report/src/test-utils/ResizeObserver.ts.html +0 -1045
- package/coverage/lcov-report/src/test-utils/data-testid.ts.html +0 -112
- package/coverage/lcov-report/src/test-utils/drag.ts.html +0 -337
- package/coverage/lcov-report/src/test-utils/index.html +0 -116
- package/coverage/lcov-report/src/test-utils/jest-setup.ts.html +0 -124
- package/coverage/lcov-report/src/test-utils/matchMedia.ts.html +0 -679
- package/coverage/lcov-report/src/test-utils/polyfills/IntersectionObserver.ts.html +0 -109
- package/coverage/lcov-report/src/test-utils/polyfills/ResizeObserver.ts.html +0 -100
- package/coverage/lcov-report/src/test-utils/polyfills/TextDecoder.ts.html +0 -106
- package/coverage/lcov-report/src/test-utils/polyfills/TextEncoder.ts.html +0 -100
- package/coverage/lcov-report/src/test-utils/polyfills/index.html +0 -176
- package/coverage/lcov-report/src/test-utils/polyfills/matchMedia.ts.html +0 -109
- package/coverage/lcov-report/src/test-utils/polyfills/offsetParent.ts.html +0 -202
- package/coverage/lcov-report/src/test-utils/polyfills/scrollIntoView.ts.html +0 -112
- package/coverage/lcov-report/src/test-utils/render.tsx.html +0 -220
- package/coverage/lcov-report/src/test-utils/root-html-environment.ts.html +0 -85
- package/coverage/lcov-report/src/test-utils/timers.ts.html +0 -223
- package/coverage/lcov-report/src/test-utils/utils.ts.html +0 -118
- package/coverage/lcov-report/src/theme/ColorSchemeProvider.tsx.html +0 -811
- package/coverage/lcov-report/src/theme/LocalStorageColorSchemeProvider.tsx.html +0 -475
- package/coverage/lcov-report/src/theme/ThemeProvider.tsx.html +0 -1510
- package/coverage/lcov-report/src/theme/colors.ts.html +0 -910
- package/coverage/lcov-report/src/theme/cssVars.ts.html +0 -130
- package/coverage/lcov-report/src/theme/index.html +0 -251
- package/coverage/lcov-report/src/theme/useCSSVariables.ts.html +0 -622
- package/coverage/lcov-report/src/theme/useColorScheme.ts.html +0 -490
- package/coverage/lcov-report/src/theme/useColorSchemeMetaTag.ts.html +0 -244
- package/coverage/lcov-report/src/theme/useColorSchemeProvider.ts.html +0 -433
- package/coverage/lcov-report/src/theme/usePrefersColorScheme.ts.html +0 -121
- package/coverage/lcov-report/src/theme/utils.ts.html +0 -670
- package/coverage/lcov-report/src/tooltip/Tooltip.tsx.html +0 -559
- package/coverage/lcov-report/src/tooltip/TooltipHoverModeProvider.tsx.html +0 -409
- package/coverage/lcov-report/src/tooltip/constants.ts.html +0 -208
- package/coverage/lcov-report/src/tooltip/index.html +0 -206
- package/coverage/lcov-report/src/tooltip/tooltipStyles.ts.html +0 -181
- package/coverage/lcov-report/src/tooltip/useOverflowTooltip.ts.html +0 -364
- package/coverage/lcov-report/src/tooltip/useTooltip.ts.html +0 -2095
- package/coverage/lcov-report/src/tooltip/useTooltipPosition.ts.html +0 -388
- package/coverage/lcov-report/src/tooltip/utils.ts.html +0 -238
- package/coverage/lcov-report/src/transition/CSSTransition.tsx.html +0 -358
- package/coverage/lcov-report/src/transition/Collapse.tsx.html +0 -337
- package/coverage/lcov-report/src/transition/CrossFade.tsx.html +0 -436
- package/coverage/lcov-report/src/transition/ScaleTransition.tsx.html +0 -328
- package/coverage/lcov-report/src/transition/SkeletonPlaceholder.tsx.html +0 -613
- package/coverage/lcov-report/src/transition/Slide.tsx.html +0 -367
- package/coverage/lcov-report/src/transition/SlideContainer.tsx.html +0 -649
- package/coverage/lcov-report/src/transition/collapseStyles.ts.html +0 -184
- package/coverage/lcov-report/src/transition/config.ts.html +0 -187
- package/coverage/lcov-report/src/transition/constants.ts.html +0 -103
- package/coverage/lcov-report/src/transition/index.html +0 -416
- package/coverage/lcov-report/src/transition/maxWidthTransition.ts.html +0 -157
- package/coverage/lcov-report/src/transition/skeletonPlaceholderUtils.ts.html +0 -400
- package/coverage/lcov-report/src/transition/useCSSTransition.ts.html +0 -766
- package/coverage/lcov-report/src/transition/useCarousel.ts.html +0 -835
- package/coverage/lcov-report/src/transition/useCollapseTransition.ts.html +0 -1384
- package/coverage/lcov-report/src/transition/useCrossFadeTransition.ts.html +0 -469
- package/coverage/lcov-report/src/transition/useMaxWidthTransition.ts.html +0 -205
- package/coverage/lcov-report/src/transition/useScaleTransition.ts.html +0 -535
- package/coverage/lcov-report/src/transition/useSkeletonPlaceholder.ts.html +0 -958
- package/coverage/lcov-report/src/transition/useSlideTransition.ts.html +0 -424
- package/coverage/lcov-report/src/transition/useTransition.ts.html +0 -943
- package/coverage/lcov-report/src/transition/utils.ts.html +0 -529
- package/coverage/lcov-report/src/tree/DefaultTreeItemRenderer.tsx.html +0 -313
- package/coverage/lcov-report/src/tree/Tree.tsx.html +0 -1054
- package/coverage/lcov-report/src/tree/TreeGroup.tsx.html +0 -367
- package/coverage/lcov-report/src/tree/TreeItem.tsx.html +0 -1006
- package/coverage/lcov-report/src/tree/TreeItemExpander.tsx.html +0 -355
- package/coverage/lcov-report/src/tree/TreeProvider.tsx.html +0 -679
- package/coverage/lcov-report/src/tree/index.html +0 -116
- package/coverage/lcov-report/src/tree/styles.ts.html +0 -538
- package/coverage/lcov-report/src/tree/useTree.ts.html +0 -289
- package/coverage/lcov-report/src/tree/useTreeExpansion.ts.html +0 -241
- package/coverage/lcov-report/src/tree/useTreeItems.ts.html +0 -496
- package/coverage/lcov-report/src/tree/useTreeMovement.ts.html +0 -700
- package/coverage/lcov-report/src/tree/useTreeSelection.ts.html +0 -274
- package/coverage/lcov-report/src/tree/utils.ts.html +0 -277
- package/coverage/lcov-report/src/typography/SrOnly.tsx.html +0 -328
- package/coverage/lcov-report/src/typography/TextContainer.tsx.html +0 -403
- package/coverage/lcov-report/src/typography/Typography.tsx.html +0 -1027
- package/coverage/lcov-report/src/typography/WritingDirection.tsx.html +0 -775
- package/coverage/lcov-report/src/typography/WritingDirectionProvider.tsx.html +0 -781
- package/coverage/lcov-report/src/typography/index.html +0 -161
- package/coverage/lcov-report/src/useAsyncAction.ts.html +0 -685
- package/coverage/lcov-report/src/useDebounced.ts.html +0 -190
- package/coverage/lcov-report/src/useDebouncedFunction.ts.html +0 -436
- package/coverage/lcov-report/src/useDropzone.ts.html +0 -766
- package/coverage/lcov-report/src/useElementSize.ts.html +0 -409
- package/coverage/lcov-report/src/useEnsuredId.ts.html +0 -175
- package/coverage/lcov-report/src/useEnsuredRef.ts.html +0 -253
- package/coverage/lcov-report/src/useEnsuredState.ts.html +0 -235
- package/coverage/lcov-report/src/useHtmlClassName.ts.html +0 -142
- package/coverage/lcov-report/src/useIntersectionObserver.ts.html +0 -1075
- package/coverage/lcov-report/src/useIsomorphicLayoutEffect.ts.html +0 -130
- package/coverage/lcov-report/src/useLocalStorage.ts.html +0 -1852
- package/coverage/lcov-report/src/useLocalStorageEvents.ts.html +0 -85
- package/coverage/lcov-report/src/useMediaQuery.ts.html +0 -241
- package/coverage/lcov-report/src/useMinWidthMediaQuery.ts.html +0 -115
- package/coverage/lcov-report/src/useMutationObserver.ts.html +0 -310
- package/coverage/lcov-report/src/useOrientation.ts.html +0 -271
- package/coverage/lcov-report/src/usePageInactive.ts.html +0 -448
- package/coverage/lcov-report/src/useResizeListener.ts.html +0 -391
- package/coverage/lcov-report/src/useResizeObserver.ts.html +0 -790
- package/coverage/lcov-report/src/useThrottledFunction.ts.html +0 -484
- package/coverage/lcov-report/src/useToggle.ts.html +0 -253
- package/coverage/lcov-report/src/useUnmounted.ts.html +0 -217
- package/coverage/lcov-report/src/useWindowSize.ts.html +0 -460
- package/coverage/lcov-report/src/utils/RecursiveRender.tsx.html +0 -253
- package/coverage/lcov-report/src/utils/RenderRecursively.tsx.html +0 -790
- package/coverage/lcov-report/src/utils/alphaNumericSort.ts.html +0 -535
- package/coverage/lcov-report/src/utils/applyRef.ts.html +0 -214
- package/coverage/lcov-report/src/utils/bem.ts.html +0 -412
- package/coverage/lcov-report/src/utils/filters.ts.html +0 -1318
- package/coverage/lcov-report/src/utils/getClientPosition.ts.html +0 -226
- package/coverage/lcov-report/src/utils/getMiddleOfRange.ts.html +0 -163
- package/coverage/lcov-report/src/utils/getPercentage.ts.html +0 -253
- package/coverage/lcov-report/src/utils/getRangeDefaultValue.ts.html +0 -169
- package/coverage/lcov-report/src/utils/getRangeSteps.ts.html +0 -157
- package/coverage/lcov-report/src/utils/getUseStateSetterValue.ts.html +0 -85
- package/coverage/lcov-report/src/utils/identity.ts.html +0 -100
- package/coverage/lcov-report/src/utils/index.html +0 -116
- package/coverage/lcov-report/src/utils/isElementVisible.ts.html +0 -214
- package/coverage/lcov-report/src/utils/isValidNumber.ts.html +0 -118
- package/coverage/lcov-report/src/utils/loop.ts.html +0 -262
- package/coverage/lcov-report/src/utils/nearest.ts.html +0 -220
- package/coverage/lcov-report/src/utils/parseCssLengthUnit.ts.html +0 -280
- package/coverage/lcov-report/src/utils/randomInt.ts.html +0 -148
- package/coverage/lcov-report/src/utils/wait.ts.html +0 -139
- package/coverage/lcov-report/src/utils/withinRange.ts.html +0 -184
- package/coverage/lcov-report/src/window-splitter/WindowSplitter.tsx.html +0 -445
- package/coverage/lcov-report/src/window-splitter/index.html +0 -131
- package/coverage/lcov-report/src/window-splitter/useControlledWindowSplitter.ts.html +0 -562
- package/coverage/lcov-report/src/window-splitter/useLocalStorageWindowSplitter.ts.html +0 -331
- package/coverage/lcov-report/src/window-splitter/useWindowSplitter.ts.html +0 -508
- package/coverage/lcov-report/src/window-splitter/useWindowSplitterDefault.ts.html +0 -466
- package/coverage/lcov-report/src/window-splitter/useWindowSplitterMaxValue.ts.html +0 -256
- package/coverage/lcov-report/styles.ts.html +0 -457
- package/coverage/lcov-report/suspense/CircularProgressSuspense.tsx.html +0 -283
- package/coverage/lcov-report/suspense/NullSuspense.tsx.html +0 -202
- package/coverage/lcov-report/suspense/index.html +0 -131
- package/coverage/lcov-report/switchStyles.ts.html +0 -172
- package/coverage/lcov-report/tabIndicatorStyles.ts.html +0 -187
- package/coverage/lcov-report/tabListScrollButtonStyles.ts.html +0 -226
- package/coverage/lcov-report/tabListStyles.ts.html +0 -241
- package/coverage/lcov-report/tabStyles.ts.html +0 -265
- package/coverage/lcov-report/table/Table.tsx.html +0 -526
- package/coverage/lcov-report/table/TableBody.tsx.html +0 -280
- package/coverage/lcov-report/table/TableCell.tsx.html +0 -1180
- package/coverage/lcov-report/table/TableCheckbox.tsx.html +0 -709
- package/coverage/lcov-report/table/TableFooter.tsx.html +0 -508
- package/coverage/lcov-report/table/TableHeader.tsx.html +0 -607
- package/coverage/lcov-report/table/TableRadio.tsx.html +0 -670
- package/coverage/lcov-report/table/TableRow.tsx.html +0 -370
- package/coverage/lcov-report/table/index.html +0 -191
- package/coverage/lcov-report/tableCellStyles.ts.html +0 -334
- package/coverage/lcov-report/tableContainerStyles.ts.html +0 -142
- package/coverage/lcov-report/tableFooterStyles.ts.html +0 -157
- package/coverage/lcov-report/tableHeaderStyles.ts.html +0 -163
- package/coverage/lcov-report/tableRowStyles.ts.html +0 -169
- package/coverage/lcov-report/tableStyles.ts.html +0 -157
- package/coverage/lcov-report/tabs/Tab.tsx.html +0 -592
- package/coverage/lcov-report/tabs/TabList.tsx.html +0 -796
- package/coverage/lcov-report/tabs/TabListScrollButton.tsx.html +0 -472
- package/coverage/lcov-report/tabs/index.html +0 -206
- package/coverage/lcov-report/tabs/tabIndicatorStyles.ts.html +0 -187
- package/coverage/lcov-report/tabs/tabListStyles.ts.html +0 -241
- package/coverage/lcov-report/tabs/tabStyles.ts.html +0 -253
- package/coverage/lcov-report/tabs/useTabList.ts.html +0 -736
- package/coverage/lcov-report/tabs/useTabs.ts.html +0 -1567
- package/coverage/lcov-report/tabs/utils.ts.html +0 -337
- package/coverage/lcov-report/test-utils/index.html +0 -116
- package/coverage/lcov-report/test-utils/jest-setup.ts.html +0 -124
- package/coverage/lcov-report/test-utils/matchMedia.ts.html +0 -667
- package/coverage/lcov-report/test-utils/polyfills/index.html +0 -116
- package/coverage/lcov-report/test-utils/polyfills/matchMedia.ts.html +0 -109
- package/coverage/lcov-report/test-utils/polyfills/offsetParent.ts.html +0 -202
- package/coverage/lcov-report/test-utils/use.ts.html +0 -187
- package/coverage/lcov-report/theme/ColorSchemeProvider.tsx.html +0 -811
- package/coverage/lcov-report/theme/LocalStorageColorSchemeProvider.tsx.html +0 -268
- package/coverage/lcov-report/theme/ThemeProvider.tsx.html +0 -1453
- package/coverage/lcov-report/theme/cssVars.ts.html +0 -130
- package/coverage/lcov-report/theme/index.html +0 -191
- package/coverage/lcov-report/theme/useColorScheme.ts.html +0 -475
- package/coverage/lcov-report/theme/useColorSchemeMetaTag.ts.html +0 -175
- package/coverage/lcov-report/theme/useColorSchemeProvider.ts.html +0 -244
- package/coverage/lcov-report/theme/usePrefersColorScheme.ts.html +0 -103
- package/coverage/lcov-report/tooltip/Tooltip.tsx.html +0 -559
- package/coverage/lcov-report/tooltip/TooltipHoverModeProvider.tsx.html +0 -409
- package/coverage/lcov-report/tooltip/constants.ts.html +0 -208
- package/coverage/lcov-report/tooltip/index.html +0 -116
- package/coverage/lcov-report/tooltip/tooltipStyles.ts.html +0 -181
- package/coverage/lcov-report/tooltip/useOverflowTooltip.ts.html +0 -364
- package/coverage/lcov-report/tooltip/useTooltip.ts.html +0 -2095
- package/coverage/lcov-report/tooltipStyles.ts.html +0 -181
- package/coverage/lcov-report/transition/SkeletonPlaceholder.tsx.html +0 -595
- package/coverage/lcov-report/transition/config.ts.html +0 -187
- package/coverage/lcov-report/transition/index.html +0 -116
- package/coverage/lcov-report/transition/maxWidthTransition.ts.html +0 -157
- package/coverage/lcov-report/transition/skeletonPlaceholderUtils.ts.html +0 -400
- package/coverage/lcov-report/transition/useMaxWidthTransition.ts.html +0 -199
- package/coverage/lcov-report/transition/useScaleTransition.ts.html +0 -535
- package/coverage/lcov-report/transition/useSkeletonPlaceholder.ts.html +0 -952
- package/coverage/lcov-report/transition/useTransition.ts.html +0 -943
- package/coverage/lcov-report/tree/DefaultTreeItemRenderer.tsx.html +0 -301
- package/coverage/lcov-report/tree/Tree.tsx.html +0 -1054
- package/coverage/lcov-report/tree/TreeGroup.tsx.html +0 -370
- package/coverage/lcov-report/tree/TreeItem.tsx.html +0 -1006
- package/coverage/lcov-report/tree/TreeItemExpander.tsx.html +0 -328
- package/coverage/lcov-report/tree/TreeProvider.tsx.html +0 -679
- package/coverage/lcov-report/tree/index.html +0 -116
- package/coverage/lcov-report/tree/styles.ts.html +0 -538
- package/coverage/lcov-report/tree/useTree.ts.html +0 -289
- package/coverage/lcov-report/tree/useTreeExpansion.ts.html +0 -241
- package/coverage/lcov-report/tree/useTreeItems.ts.html +0 -496
- package/coverage/lcov-report/tree/useTreeMovement.ts.html +0 -700
- package/coverage/lcov-report/tree/useTreeSelection.ts.html +0 -274
- package/coverage/lcov-report/tree/utils.ts.html +0 -277
- package/coverage/lcov-report/typography/TextContainer.tsx.html +0 -433
- package/coverage/lcov-report/typography/Typography.tsx.html +0 -1027
- package/coverage/lcov-report/typography/WritingDirection.tsx.html +0 -775
- package/coverage/lcov-report/typography/WritingDirectionProvider.tsx.html +0 -781
- package/coverage/lcov-report/useAutoComplete.ts.html +0 -787
- package/coverage/lcov-report/useCSSTransition.ts.html +0 -763
- package/coverage/lcov-report/useCollapseTransition.ts.html +0 -1384
- package/coverage/lcov-report/useCombobox.ts.html +0 -1513
- package/coverage/lcov-report/useDraggable.ts.html +0 -2458
- package/coverage/lcov-report/useDropzone.ts.html +0 -763
- package/coverage/lcov-report/useEnsuredRef.ts.html +0 -250
- package/coverage/lcov-report/useExpandableLayout.ts.html +0 -802
- package/coverage/lcov-report/useExpansionPanels.ts.html +0 -913
- package/coverage/lcov-report/useHigherContrastChildren.tsx.html +0 -355
- package/coverage/lcov-report/useInlineAutoComplete.ts.html +0 -379
- package/coverage/lcov-report/useLayoutTree.ts.html +0 -691
- package/coverage/lcov-report/useLocalStorage.ts.html +0 -1828
- package/coverage/lcov-report/useMinWidthMediaQuery.ts.html +0 -115
- package/coverage/lcov-report/useMutationObserver.ts.html +0 -310
- package/coverage/lcov-report/useRemoveToast.ts.html +0 -160
- package/coverage/lcov-report/useResizeObserver.ts.html +0 -874
- package/coverage/lcov-report/useResizingTextArea.ts.html +0 -523
- package/coverage/lcov-report/useSelectCombobox.ts.html +0 -295
- package/coverage/lcov-report/useSkeletonPlaceholder.ts.html +0 -952
- package/coverage/lcov-report/useTabList.ts.html +0 -736
- package/coverage/lcov-report/useTabs.ts.html +0 -757
- package/coverage/lcov-report/useThrottledFunction.ts.html +0 -475
- package/coverage/lcov-report/useTooltip.ts.html +0 -2041
- package/coverage/lcov-report/useTransition.ts.html +0 -934
- package/coverage/lcov-report/useTree.ts.html +0 -286
- package/coverage/lcov-report/useWindowSplitter.ts.html +0 -640
- package/coverage/lcov-report/useWindowSplitterMaxValue.ts.html +0 -256
- package/coverage/lcov-report/utils/RecursiveRender.tsx.html +0 -253
- package/coverage/lcov-report/utils/RenderRecursively.tsx.html +0 -688
- package/coverage/lcov-report/utils/alphaNumericSort.ts.html +0 -496
- package/coverage/lcov-report/utils/caseInsensitiveFilter.ts.html +0 -397
- package/coverage/lcov-report/utils/filters.ts.html +0 -1318
- package/coverage/lcov-report/utils/fuzzyFilter.ts.html +0 -241
- package/coverage/lcov-report/utils/index.html +0 -116
- package/coverage/lcov-report/utils/isElementVisible.ts.html +0 -211
- package/coverage/lcov-report/utils/parseCssLengthUnit.ts.html +0 -280
- package/coverage/lcov-report/utils/randomInt.ts.html +0 -148
- package/coverage/lcov-report/utils/searching.ts.html +0 -85
- package/coverage/lcov-report/utils/wait.ts.html +0 -139
- package/coverage/lcov-report/wait.ts.html +0 -139
- package/coverage/lcov-report/window-splitter/WindowSplitter.tsx.html +0 -448
- package/coverage/lcov-report/window-splitter/index.html +0 -116
- package/coverage/lcov-report/window-splitter/useControlledWindowSplitter.ts.html +0 -562
- package/coverage/lcov-report/window-splitter/useLocalStorageWindowSplitter.ts.html +0 -331
- package/coverage/lcov-report/window-splitter/useWindowSplitter.ts.html +0 -640
- package/coverage/lcov-report/window-splitter/useWindowSplitterDefault.ts.html +0 -466
- package/coverage/lcov-report/window-splitter/useWindowSplitterOrig.ts.html +0 -598
- package/dist/useAsyncAction.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/positioning/useFixedPositioning.ts"],"sourcesContent":["\"use client\";\nimport type { CSSProperties, Ref, RefCallback, RefObject } from \"react\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { delegateEvent } from \"../delegateEvent.js\";\nimport type { TransitionCallbacks } from \"../transition/types.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useIsomorphicLayoutEffect } from \"../useIsomorphicLayoutEffect.js\";\nimport { BELOW_CENTER_ANCHOR } from \"./constants.js\";\nimport { getFixedPosition } from \"./getFixedPosition.js\";\nimport type { CalculateFixedPositionOptions } from \"./types.js\";\nimport { isWithinViewport } from \"./utils.js\";\n\nconst noop = (): undefined => undefined;\n\n/**\n * @since 4.0.0\n */\nexport type FixedPositioningTransitionCallbacks = Pick<\n TransitionCallbacks,\n \"onEnter\" | \"onEntering\" | \"onEntered\" | \"onExited\"\n>;\n\n/**\n * This options should be passed to the {@link useCSSTransition} for the styling\n * and positioning to work correctly.\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport interface FixedPositioningTransitionOptions<E extends HTMLElement>\n extends FixedPositioningTransitionCallbacks {\n /** {@inheritDoc TransitionOptions.nodeRef} */\n nodeRef?: Ref<E>;\n}\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport interface FixedPositioningScrollData<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> {\n fixedElement: FixedElement;\n fixedToElement: FixedToElement;\n\n /**\n * Boolean if the {@link fixedToElement} is visible within the viewport.\n */\n visible: boolean;\n}\n\n/**\n * This function is called when the page is scrolled while the fixed element is\n * visible. This is generally used to reposition the fixed element or hide it if\n * it is no longer visible within the viewport.\n *\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @param event - The scroll event\n * @param data - The {@link FixedPositioningScrollData} that can be used for\n * custom scroll behavior.\n * @since 4.0.0\n */\nexport type TransitionScrollCallback<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> = (\n event: Event,\n data: Readonly<FixedPositioningScrollData<FixedToElement, FixedElement>>\n) => void;\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport interface FixedPositioningOptions<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> extends FixedPositioningTransitionOptions<FixedElement>,\n CalculateFixedPositionOptions {\n /**\n * An optional style that will be merged with the fixed positioning required\n * styles.\n *\n * @see {@link FixedPositionStyle}\n */\n style?: CSSProperties;\n\n /**\n * A ref pointing to an element that another element should be fixed to. This\n * **must** be provided for the positioning to work.\n */\n fixedTo: RefObject<FixedToElement>;\n\n /**\n * An optional function that can be used to override positioning options if\n * some options require the element to be in the DOM for specific\n * calculations.\n */\n getFixedPositionOptions?(): CalculateFixedPositionOptions;\n\n /**\n * An optional function to call if the page resizes while the `FixedElement`\n * is visible.\n */\n onResize?: EventListener;\n /** @see {@link TransitionScrollCallback} */\n onScroll?: TransitionScrollCallback<FixedToElement, FixedElement>;\n}\n\n/**\n * @typeParam E - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport interface FixedPositioningHookReturnValue<E extends HTMLElement> {\n /**\n * A ref that should be passed to a component for the fixed positioning\n * behavior to work correctly.\n *\n * This should really only be used if the {@link TransitionOptions} is not\n * being used.\n */\n ref: RefCallback<E>;\n\n /**\n * @see {@link FixedPositionStyle}\n */\n style: CSSProperties;\n\n /**\n * This should really only be used if the {@link transitionOptions} is not\n * being used.\n */\n callbacks: Readonly<Required<FixedPositioningTransitionCallbacks>>;\n\n /**\n * A function that can be called to update the style for the fixed element.\n */\n updateStyle(): void;\n\n /** {@inheritDoc FixedPositioningTransitionOptions} */\n transitionOptions: Readonly<Required<FixedPositioningTransitionOptions<E>>>;\n}\n\n/**\n * This hook is used to attach a temporary (fixed) element to another element\n * within the page. In other words, this is a way to have an element with\n * `position: fixed` as if it were `position: absolute` to a parent element that\n * had `position: relative`.\n *\n * @example Simple Example\n * ```tsx\n * import { ReactElement, useRef, useState } from \"react\";\n * import { Button, useCSSTransition, useFixedPositioning } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const fixedTo = useRef<HTMLButtonElement>(null);\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { style, transitionOptions } = useFixedPositioning({\n * fixedTo,\n * });\n * const { elementProps, rendered } = useCSSTransition({\n * ...transitionOptions,\n * transitionIn,\n * temporary: true,\n * timeout: {\n * enter: 200,\n * exit: 150,\n * },\n * classNames: {\n * enter: \"enter\",\n * enterActive: \"enter--active\",\n * exit: \"exit\",\n * exitActive: \"exit--active\",\n * },\n * });\n *\n * return (\n * <>\n * <Button\n * ref={fixedTo}\n * onClick={() => setTransitionIn(!transitionIn)}\n * >\n * Toggle\n * </Button>\n * {rendered && (\n * <div {...elementProps} style={style}>\n * Fixed Temporary Element\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport function useFixedPositioning<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n>(\n options: FixedPositioningOptions<FixedToElement, FixedElement>\n): FixedPositioningHookReturnValue<FixedElement> {\n const {\n style: propStyle,\n nodeRef,\n fixedTo,\n onEnter = noop,\n onEntering = noop,\n onEntered = noop,\n onExited = noop,\n anchor = BELOW_CENTER_ANCHOR,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions = noop,\n onScroll,\n onResize = noop,\n } = options;\n\n const [active, setActive] = useState(false);\n const [ref, refHandler] = useEnsuredRef(nodeRef);\n const optionsRef = useRef({\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } as const);\n useIsomorphicLayoutEffect(() => {\n optionsRef.current = {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n };\n }, [\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n ]);\n const [style, setStyle] = useState<CSSProperties | undefined>(\n () =>\n getFixedPosition({\n container: ref.current,\n element: fixedTo.current,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n }).style\n );\n\n const updateStyle = useCallback(() => {\n const {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } = optionsRef.current;\n const element = ref.current;\n const container = fixedTo.current;\n const { style } = getFixedPosition({\n container,\n element,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n });\n\n setStyle(style);\n setActive(!!element && !element.hidden);\n\n // Only changing the initialX and initialY should cause the useEffect below\n // to trigger, which is why everything else is set in a ref.\n }, [initialX, initialY]);\n\n useEffect(() => {\n if (!active) {\n return;\n }\n\n const resizeCallback = (event: Event): void => {\n onResize(event);\n updateStyle();\n };\n const scrollCallback = (event: Event): void => {\n const fixedElement = ref.current;\n const fixedToElement = fixedTo.current;\n if (onScroll && fixedElement && fixedToElement) {\n onScroll(event, {\n visible: isWithinViewport({ fixedElement, fixedToElement }),\n fixedElement,\n fixedToElement,\n });\n }\n\n updateStyle();\n };\n\n const resizeHandler = delegateEvent(\"resize\", window, true);\n const scrollHandler = delegateEvent(\"scroll\", window, true, {\n passive: true,\n });\n resizeHandler.add(resizeCallback);\n scrollHandler.add(scrollCallback);\n return () => {\n resizeHandler.remove(resizeCallback);\n scrollHandler.remove(scrollCallback);\n };\n }, [active, fixedTo, onResize, onScroll, ref, updateStyle]);\n\n const callbacks: Required<FixedPositioningTransitionCallbacks> = {\n onEnter(appearing) {\n onEnter(appearing);\n updateStyle();\n },\n onEntering(appearing) {\n onEntering(appearing);\n updateStyle();\n },\n onEntered(appearing) {\n onEntered(appearing);\n updateStyle();\n },\n onExited() {\n onExited();\n setActive(false);\n },\n };\n\n return {\n ref: refHandler,\n style: { ...style, ...propStyle },\n callbacks,\n updateStyle,\n transitionOptions: {\n ...callbacks,\n nodeRef: refHandler,\n },\n };\n}\n"],"names":["useCallback","useEffect","useRef","useState","delegateEvent","useEnsuredRef","useIsomorphicLayoutEffect","BELOW_CENTER_ANCHOR","getFixedPosition","isWithinViewport","noop","undefined","useFixedPositioning","options","style","propStyle","nodeRef","fixedTo","onEnter","onEntering","onEntered","onExited","anchor","disableSwapping","disableVHBounds","initialX","initialY","preventOverlap","transformOrigin","vhMargin","vwMargin","width","xMargin","yMargin","getFixedPositionOptions","onScroll","onResize","active","setActive","ref","refHandler","optionsRef","current","setStyle","container","element","updateStyle","hidden","resizeCallback","event","scrollCallback","fixedElement","fixedToElement","visible","resizeHandler","window","scrollHandler","passive","add","remove","callbacks","appearing","transitionOptions"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AACjE,SAASC,aAAa,QAAQ,sBAAsB;AAEpD,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,yBAAyB,QAAQ,kCAAkC;AAC5E,SAASC,mBAAmB,QAAQ,iBAAiB;AACrD,SAASC,gBAAgB,QAAQ,wBAAwB;AAEzD,SAASC,gBAAgB,QAAQ,aAAa;AAE9C,MAAMC,OAAO,IAAiBC;AAwI9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDC,GACD,OAAO,SAASC,oBAIdC,OAA8D;IAE9D,MAAM,EACJC,OAAOC,SAAS,EAChBC,OAAO,EACPC,OAAO,EACPC,UAAUR,IAAI,EACdS,aAAaT,IAAI,EACjBU,YAAYV,IAAI,EAChBW,WAAWX,IAAI,EACfY,SAASf,mBAAmB,EAC5BgB,eAAe,EACfC,e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SAASwB;QACX;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/positioning/useFixedPositioning.ts"],"sourcesContent":["\"use client\";\nimport {\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type Ref,\n type RefCallback,\n type RefObject,\n} from \"react\";\nimport { delegateEvent } from \"../delegateEvent.js\";\nimport { type TransitionCallbacks } from \"../transition/types.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { useIsomorphicLayoutEffect } from \"../useIsomorphicLayoutEffect.js\";\nimport { BELOW_CENTER_ANCHOR } from \"./constants.js\";\nimport { getFixedPosition } from \"./getFixedPosition.js\";\nimport { type CalculateFixedPositionOptions } from \"./types.js\";\nimport { isWithinViewport } from \"./utils.js\";\n\nconst noop = (): undefined => undefined;\n\n/**\n * @since 4.0.0\n */\nexport type FixedPositioningTransitionCallbacks = Pick<\n TransitionCallbacks,\n \"onEnter\" | \"onEntering\" | \"onEntered\" | \"onExited\"\n>;\n\n/**\n * This options should be passed to the {@link useCSSTransition} for the styling\n * and positioning to work correctly.\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport interface FixedPositioningTransitionOptions<E extends HTMLElement>\n extends FixedPositioningTransitionCallbacks {\n /** {@inheritDoc TransitionOptions.nodeRef} */\n nodeRef?: Ref<E>;\n}\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport interface FixedPositioningScrollData<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> {\n fixedElement: FixedElement;\n fixedToElement: FixedToElement;\n\n /**\n * Boolean if the {@link fixedToElement} is visible within the viewport.\n */\n visible: boolean;\n}\n\n/**\n * This function is called when the page is scrolled while the fixed element is\n * visible. This is generally used to reposition the fixed element or hide it if\n * it is no longer visible within the viewport.\n *\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @param event - The scroll event\n * @param data - The {@link FixedPositioningScrollData} that can be used for\n * custom scroll behavior.\n * @since 4.0.0\n */\nexport type TransitionScrollCallback<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> = (\n event: Event,\n data: Readonly<FixedPositioningScrollData<FixedToElement, FixedElement>>\n) => void;\n\n/**\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport interface FixedPositioningOptions<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n> extends FixedPositioningTransitionOptions<FixedElement>,\n CalculateFixedPositionOptions {\n /**\n * An optional style that will be merged with the fixed positioning required\n * styles.\n *\n * @see {@link FixedPositionStyle}\n */\n style?: CSSProperties;\n\n /**\n * A ref pointing to an element that another element should be fixed to. This\n * **must** be provided for the positioning to work.\n */\n fixedTo: RefObject<FixedToElement>;\n\n /**\n * An optional function that can be used to override positioning options if\n * some options require the element to be in the DOM for specific\n * calculations.\n */\n getFixedPositionOptions?(): CalculateFixedPositionOptions;\n\n /**\n * An optional function to call if the page resizes while the `FixedElement`\n * is visible.\n */\n onResize?: EventListener;\n /** @see {@link TransitionScrollCallback} */\n onScroll?: TransitionScrollCallback<FixedToElement, FixedElement>;\n}\n\n/**\n * @typeParam E - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport interface FixedPositioningHookReturnValue<E extends HTMLElement> {\n /**\n * A ref that should be passed to a component for the fixed positioning\n * behavior to work correctly.\n *\n * This should really only be used if the {@link TransitionOptions} is not\n * being used.\n */\n ref: RefCallback<E>;\n\n /**\n * @see {@link FixedPositionStyle}\n */\n style: CSSProperties;\n\n /**\n * This should really only be used if the {@link transitionOptions} is not\n * being used.\n */\n callbacks: Readonly<Required<FixedPositioningTransitionCallbacks>>;\n\n /**\n * A function that can be called to update the style for the fixed element.\n */\n updateStyle(): void;\n\n /** {@inheritDoc FixedPositioningTransitionOptions} */\n transitionOptions: Readonly<Required<FixedPositioningTransitionOptions<E>>>;\n}\n\n/**\n * This hook is used to attach a temporary (fixed) element to another element\n * within the page. In other words, this is a way to have an element with\n * `position: fixed` as if it were `position: absolute` to a parent element that\n * had `position: relative`.\n *\n * @example Simple Example\n * ```tsx\n * import { ReactElement, useRef, useState } from \"react\";\n * import { Button, useCSSTransition, useFixedPositioning } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const fixedTo = useRef<HTMLButtonElement>(null);\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { style, transitionOptions } = useFixedPositioning({\n * fixedTo,\n * });\n * const { elementProps, rendered } = useCSSTransition({\n * ...transitionOptions,\n * transitionIn,\n * temporary: true,\n * timeout: {\n * enter: 200,\n * exit: 150,\n * },\n * classNames: {\n * enter: \"enter\",\n * enterActive: \"enter--active\",\n * exit: \"exit\",\n * exitActive: \"exit--active\",\n * },\n * });\n *\n * return (\n * <>\n * <Button\n * ref={fixedTo}\n * onClick={() => setTransitionIn(!transitionIn)}\n * >\n * Toggle\n * </Button>\n * {rendered && (\n * <div {...elementProps} style={style}>\n * Fixed Temporary Element\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @typeParam FixedToElement - An HTMLElement type for the static element.\n * @typeParam FixedElement - An HTMLElement type for the fixed element.\n * @since 4.0.0\n */\nexport function useFixedPositioning<\n FixedToElement extends HTMLElement,\n FixedElement extends HTMLElement,\n>(\n options: FixedPositioningOptions<FixedToElement, FixedElement>\n): FixedPositioningHookReturnValue<FixedElement> {\n const {\n style: propStyle,\n nodeRef,\n fixedTo,\n onEnter = noop,\n onEntering = noop,\n onEntered = noop,\n onExited = noop,\n anchor = BELOW_CENTER_ANCHOR,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions = noop,\n onScroll,\n onResize = noop,\n } = options;\n\n const [active, setActive] = useState(false);\n const [ref, refHandler] = useEnsuredRef(nodeRef);\n const optionsRef = useRef({\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } as const);\n useIsomorphicLayoutEffect(() => {\n optionsRef.current = {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n };\n }, [\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n ]);\n const [style, setStyle] = useState<CSSProperties | undefined>(\n () =>\n getFixedPosition({\n container: ref.current,\n element: fixedTo.current,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n }).style\n );\n\n const updateStyle = useCallback(() => {\n const {\n ref,\n fixedTo,\n anchor,\n disableSwapping,\n disableVHBounds,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n getFixedPositionOptions,\n } = optionsRef.current;\n const element = ref.current;\n const container = fixedTo.current;\n const { style } = getFixedPosition({\n container,\n element,\n anchor,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n preventOverlap,\n transformOrigin,\n vhMargin,\n vwMargin,\n width,\n xMargin,\n yMargin,\n ...getFixedPositionOptions(),\n });\n\n setStyle(style);\n setActive(!!element && !element.hidden);\n\n // Only changing the initialX and initialY should cause the useEffect below\n // to trigger, which is why everything else is set in a ref.\n }, [initialX, initialY]);\n\n useEffect(() => {\n if (!active) {\n return;\n }\n\n const resizeCallback = (event: Event): void => {\n onResize(event);\n updateStyle();\n };\n const scrollCallback = (event: Event): void => {\n const fixedElement = ref.current;\n const fixedToElement = fixedTo.current;\n if (onScroll && fixedElement && fixedToElement) {\n onScroll(event, {\n visible: isWithinViewport({ fixedElement, fixedToElement }),\n fixedElement,\n fixedToElement,\n });\n }\n\n updateStyle();\n };\n\n const resizeHandler = delegateEvent(\"resize\", window, true);\n const scrollHandler = delegateEvent(\"scroll\", window, true, {\n passive: true,\n });\n resizeHandler.add(resizeCallback);\n scrollHandler.add(scrollCallback);\n return () => {\n resizeHandler.remove(resizeCallback);\n scrollHandler.remove(scrollCallback);\n };\n }, [active, fixedTo, onResize, onScroll, ref, updateStyle]);\n\n const callbacks: Required<FixedPositioningTransitionCallbacks> = {\n onEnter(appearing) {\n onEnter(appearing);\n updateStyle();\n },\n onEntering(appearing) {\n onEntering(appearing);\n updateStyle();\n },\n onEntered(appearing) {\n onEntered(appearing);\n updateStyle();\n },\n onExited() {\n onExited();\n setActive(false);\n },\n };\n\n return {\n ref: refHandler,\n style: { ...style, ...propStyle },\n callbacks,\n updateStyle,\n transitionOptions: {\n ...callbacks,\n nodeRef: refHandler,\n },\n };\n}\n"],"names":["useCallback","useEffect","useRef","useState","delegateEvent","useEnsuredRef","useIsomorphicLayoutEffect","BELOW_CENTER_ANCHOR","getFixedPosition","isWithinViewport","noop","undefined","useFixedPositioning","options","style","propStyle","nodeRef","fixedTo","onEnter","onEntering","onEntered","onExited","anchor","disableSwapping","disableVHBounds","initialX","initialY","preventOverlap","transformOrigin","vhMargin","vwMargin","width","xMargin","yMargin","getFixedPositionOptions","onScroll","onResize","active","setActive","ref","refHandler","optionsRef","current","setStyle","container","element","updateStyle","hidden","resizeCallback","event","scrollCallback","fixedElement","fixedToElement","visible","resizeHandler","window","scrollHandler","passive","add","remove","callbacks","appearing","transitionOptions"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,gBAAgB;gBAC9CjB,SAASc,OAAO;oBACdI,SAAS5C,iBAAiB;wBAAE0C;wBAAcC;oBAAe;oBACzDD;oBACAC;gBACF;YACF;YAEAN;QACF;QAEA,MAAMQ,gBAAgBlD,cAAc,UAAUmD,QAAQ;QACtD,MAAMC,gBAAgBpD,cAAc,UAAUmD,QAAQ,MAAM;YAC1DE,SAAS;QACX;QACAH,cAAcI,GAAG,CAACV;QAClBQ,cAAcE,GAAG,CAACR;QAClB,OAAO;YACLI,cAAcK,MAAM,CAACX;YACrBQ,cAAcG,MAAM,CAACT;QACvB;IACF,GAAG;QAACb;QAAQpB;QAASmB;QAAUD;QAAUI;QAAKO;KAAY;IAE1D,MAAMc,YAA2D;QAC/D1C,SAAQ2C,SAAS;YACf3C,QAAQ2C;YACRf;QACF;QACA3B,YAAW0C,SAAS;YAClB1C,WAAW0C;YACXf;QACF;QACA1B,WAAUyC,SAAS;YACjBzC,UAAUyC;YACVf;QACF;QACAzB;YACEA;YACAiB,UAAU;QACZ;IACF;IAEA,OAAO;QACLC,KAAKC;QACL1B,OAAO;YAAE,GAAGA,KAAK;YAAE,GAAGC,SAAS;QAAC;QAChC6C;QACAd;QACAgB,mBAAmB;YACjB,GAAGF,SAAS;YACZ5C,SAASwB;QACX;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/positioning/utils.ts"],"sourcesContent":["import type { PositionAnchor } from \"./types.js\";\n\n/** @internal */\nexport interface XCoordConfig {\n xMargin: number;\n elWidth: number;\n initialX?: number;\n containerRect: DOMRect;\n}\n\n/** @internal */\nexport interface YCoordConfig {\n yMargin: number;\n elHeight: number;\n initialY?: number;\n containerRect: DOMRect;\n}\n\ntype Left = number;\ntype Top = number;\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * (outer) left of the container element. So the right bounds of the fixed\n * element will be equal to the left bounds of the container element (before the\n * xMargin is applied).\n *\n * @internal\n */\nexport function getLeftCoord({\n xMargin,\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left) - elWidth - xMargin;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * inner-left of the container element. So the left bounds of both the container\n * and fixed elements will overlap (before the xMargin is applied)\n *\n * @internal\n */\nexport function getInnerLeftCoord({\n xMargin,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left) + xMargin;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * center of the container element. So the center point of the fixed element\n * should be the center point of the container element.\n *\n * Note: Unlike all the other horizontal positioning logic, the center position\n * does not use the xMargin.\n *\n * @internal\n */\nexport function getCenterXCoord({\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n const containerCenter = containerRect.width / 2;\n const elementCenter = elWidth / 2;\n return (initialX ?? containerRect.left + containerCenter) - elementCenter;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * inner-right of the container element. So the right bounds for both the\n * container and fixed elements will overlap (before the xMargin is applied).\n *\n * @internal\n */\nexport function getInnerRightCoord({\n xMargin,\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (\n (initialX ?? containerRect.left + containerRect.width) - elWidth - xMargin\n );\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * (outer) right of the container element. So the left bounds of the fixed\n * element will overlap with the right bounds of the container element (before\n * the xMargin is applied).\n *\n * @internal\n */\nexport function getRightCoord({\n xMargin,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left + containerRect.width) + xMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed above the\n * container element. So the bottom bounds of the fixed element will overlap\n * with the top bounds of the container element (before the yMargin is applied).\n *\n * @internal\n */\nexport function getAboveCoord({\n yMargin,\n initialY,\n elHeight,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top) - elHeight - yMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the top\n * of the container element. So the top bounds for both the container and fixed\n * elements will overlap (before the yMargin is applied).\n *\n * @internal\n */\nexport function getTopCoord({\n yMargin,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top) + yMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed vertically\n * centered relative to the container element. So the vertical center point for\n * the fixed element should overlap the vertical center point of the container\n * element.\n *\n * Note: Unlike all the other vertical positioning logic, the center position\n * does not use the yMargin.\n *\n * @internal\n */\nexport function getCenterYCoord({\n yMargin,\n elHeight,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n const containerCenter = containerRect.height / 2;\n const elementCenter = elHeight / 2;\n return (\n (initialY ?? containerRect.top + containerCenter + yMargin) - elementCenter\n );\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the\n * bottom of the container element. So the top bounds of the fixed element\n * should overlap the bottom bounds of the container element (before the yMargin\n * is applied).\n *\n * @internal\n */\nexport function getBottomCoord({\n yMargin,\n initialY,\n elHeight,\n containerRect,\n}: YCoordConfig): Top {\n return (\n (initialY ?? containerRect.top + containerRect.height) - elHeight - yMargin\n );\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the\n * bottom of the container element. So the bottom bounds of both the container\n * and fixed elements should overlap (before the yMargin is applied).\n *\n * @internal\n */\nexport function getBelowCoord({\n yMargin,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top + containerRect.height) + yMargin;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface TransformOriginOptions extends PositionAnchor {\n transformOriginY?: number;\n}\n\n/**\n * This is a simple util that'll generate a css `transform-origin` string so\n * that the fixed element can animate from the correct point based on the\n * provided anchor.\n *\n * @param options - The anchor that should be used to create the transform origin\n * for.\n * @returns the transform origin string\n * @internal\n */\nexport function getTransformOrigin(options: TransformOriginOptions): string {\n const { transformOriginY: yPosition } = options;\n\n let x = \"0\";\n switch (options.x) {\n case \"right\":\n case \"inner-left\":\n x = \"0\";\n break;\n case \"center\":\n x = \"50%\";\n break;\n case \"left\":\n case \"inner-right\":\n x = \"100%\";\n break;\n default:\n x = \"0\";\n }\n\n let y = \"0\";\n if (typeof yPosition === \"number\") {\n y = `${yPosition}px`;\n } else {\n switch (options.y) {\n case \"above\":\n case \"bottom\":\n y = \"100%\";\n break;\n case \"center\":\n y = \"50%\";\n break;\n case \"below\":\n case \"top\":\n y = \"0\";\n break;\n default:\n y = \"0\";\n }\n }\n\n return `${x} ${y}`;\n}\n\n/**\n * Attempts to find a sizing container based on the provided HTMLElement. By\n * default, the sizing element will just be the provided element unless:\n * - the item has a known role within react-md that can target known classes\n * - the item has a `data-sizing-selector` attribute that is a valid query\n * selector for the nested item.\n *\n * NOTE: The `data-sizing-selector` will be run from the current element instead\n * of the `document`.\n *\n * @param el - The element to find a sizing container for.\n * @returns the sizing container relative to the provided element, or `null` if\n * none could be found.\n * @throws This error will be thrown if using the `data-query-selector` and the\n * query selector does not return an element on the page.\n * @internal\n */\nexport function findSizingContainer(\n el: HTMLElement | null\n): HTMLElement | null {\n if (!el) {\n return null;\n }\n\n if (/(tree|list)item/.test(el.getAttribute(\"role\") || \"\")) {\n const content = el.querySelector(\n \".rmd-tree-item__content, .rmd-item-text\"\n ) as HTMLElement;\n if (content) {\n return content;\n }\n } else if (el.getAttribute(\"type\") === \"file\") {\n const label = document.querySelector<HTMLLabelElement>(`[for=\"${el.id}\"]`);\n if (label) {\n return label;\n }\n }\n\n const data = el.getAttribute(\"data-sizing-selector\");\n if (data) {\n const content = el.querySelector(data) as HTMLElement;\n if (content) {\n return content;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"Unable to find a child element using the `data-sizing-selector`\"\n );\n }\n }\n\n return el;\n}\n\n/**\n * This util is used to get the \"true\" `element.getBoundingClientRect()` that\n * ensures that transitions using transforms don't mess up the sizing so that\n * position calculations are easier to do.\n *\n * @param element - The element to get a rect for.\n * @returns either a DOMRect for the element\n * @internal\n */\nexport function getElementRect(element: HTMLElement): DOMRect {\n const cloned = element.cloneNode(true) as HTMLElement;\n // remove the id so there won't be two elements with the same id on the page\n cloned.removeAttribute(\"id\");\n\n // remove the role just in case the role would alert screen readers once added\n // to the dom\n cloned.removeAttribute(\"role\");\n\n // ensure the cloned node won't shift the page or be visible\n cloned.style.position = \"fixed\";\n cloned.style.visibility = \"hidden\";\n\n // reset positioning to get a \"pure\" calculation. otherwise this will mess up\n // the height and width if the element is able to line wrap.\n cloned.style.left = \"\";\n cloned.style.top = \"\";\n cloned.style.right = \"\";\n cloned.style.bottom = \"\";\n\n // reset transforms so that custom animations don't mess with the sizing\n cloned.style.transform = \"none\";\n\n const parent = element.parentElement || document.body;\n parent.appendChild(cloned);\n\n const rect = cloned.getBoundingClientRect();\n parent.removeChild(cloned);\n\n return rect;\n}\n\n/**\n * @since 4.0.0\n * @internal\n */\ninterface IsWithinViewportOptions {\n fixedElement: HTMLElement;\n fixedToElement: HTMLElement;\n}\n\n/**\n * @since 4.0.0\n * @internal\n */\nexport function isWithinViewport(options: IsWithinViewportOptions): boolean {\n const { fixedElement, fixedToElement } = options;\n const fixedElementRect = fixedElement.getBoundingClientRect();\n const fixedToElementRect = fixedToElement.getBoundingClientRect();\n const vh = window.innerHeight;\n const vw = window.innerWidth;\n const top = Math.min(fixedElementRect.top, fixedToElementRect.top);\n const right = Math.max(fixedElementRect.right, fixedToElementRect.right);\n const bottom = Math.max(fixedElementRect.bottom, fixedToElementRect.bottom);\n const left = Math.min(fixedElementRect.left, fixedToElementRect.left);\n\n return bottom >= 0 && top <= vh && right >= 0 && left <= vw;\n}\n"],"names":["getLeftCoord","xMargin","elWidth","initialX","containerRect","left","getInnerLeftCoord","getCenterXCoord","containerCenter","width","elementCenter","getInnerRightCoord","getRightCoord","getAboveCoord","yMargin","initialY","elHeight","top","getTopCoord","getCenterYCoord","height","getBottomCoord","getBelowCoord","getTransformOrigin","options","transformOriginY","yPosition","x","y","findSizingContainer","el","test","getAttribute","content","querySelector","label","document","id","data","process","env","NODE_ENV","Error","getElementRect","element","cloned","cloneNode","removeAttribute","style","position","visibility","right","bottom","transform","parent","parentElement","body","appendChild","rect","getBoundingClientRect","removeChild","isWithinViewport","fixedElement","fixedToElement","fixedElementRect","fixedToElementRect","vh","window","innerHeight","vw","innerWidth","Math","min","max"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAqBA;;;;;;;CAOC,GACD,OAAO,SAASA,aAAa,EAC3BC,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,aAAa,EACA;IACb,OAAO,AAACD,CAAAA,YAAYC,cAAcC,IAAI,AAAD,IAAKH,UAAUD;AACtD;AAEA;;;;;;CAMC,GACD,OAAO,SAASK,kBAAkB,EAChCL,OAAO,EACPE,QAAQ,EACRC,aAAa,EACA;IACb,OAAO,AAACD,CAAAA,YAAYC,cAAcC,IAAI,AAAD,IAAKJ;AAC5C;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASM,gBAAgB,EAC9BL,OAAO,EACPC,QAAQ,EACRC,aAAa,EACA;IACb,MAAMI,kBAAkBJ,cAAcK,KAAK,GAAG;IAC9C,MAAMC,gBAAgBR,UAAU;IAChC,OAAO,AAACC,CAAAA,YAAYC,cAAcC,IAAI,GAAGG,eAAc,IAAKE;AAC9D;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,mBAAmB,EACjCV,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,aAAa,EACA;IACb,OACE,AAACD,CAAAA,YAAYC,cAAcC,IAAI,GAAGD,cAAcK,KAAK,AAAD,I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;IAEpE,OAAO+C,UAAU,KAAKnC,OAAOiD,MAAMf,SAAS,KAAK9C,QAAQgE;AAC3D"}
|
|
1
|
+
{"version":3,"sources":["../../src/positioning/utils.ts"],"sourcesContent":["import { type PositionAnchor } from \"./types.js\";\n\n/** @internal */\nexport interface XCoordConfig {\n xMargin: number;\n elWidth: number;\n initialX?: number;\n containerRect: DOMRect;\n}\n\n/** @internal */\nexport interface YCoordConfig {\n yMargin: number;\n elHeight: number;\n initialY?: number;\n containerRect: DOMRect;\n}\n\ntype Left = number;\ntype Top = number;\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * (outer) left of the container element. So the right bounds of the fixed\n * element will be equal to the left bounds of the container element (before the\n * xMargin is applied).\n *\n * @internal\n */\nexport function getLeftCoord({\n xMargin,\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left) - elWidth - xMargin;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * inner-left of the container element. So the left bounds of both the container\n * and fixed elements will overlap (before the xMargin is applied)\n *\n * @internal\n */\nexport function getInnerLeftCoord({\n xMargin,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left) + xMargin;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * center of the container element. So the center point of the fixed element\n * should be the center point of the container element.\n *\n * Note: Unlike all the other horizontal positioning logic, the center position\n * does not use the xMargin.\n *\n * @internal\n */\nexport function getCenterXCoord({\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n const containerCenter = containerRect.width / 2;\n const elementCenter = elWidth / 2;\n return (initialX ?? containerRect.left + containerCenter) - elementCenter;\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * inner-right of the container element. So the right bounds for both the\n * container and fixed elements will overlap (before the xMargin is applied).\n *\n * @internal\n */\nexport function getInnerRightCoord({\n xMargin,\n elWidth,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (\n (initialX ?? containerRect.left + containerRect.width) - elWidth - xMargin\n );\n}\n\n/**\n * Creates the `left` style value for an element that should be fixed to the\n * (outer) right of the container element. So the left bounds of the fixed\n * element will overlap with the right bounds of the container element (before\n * the xMargin is applied).\n *\n * @internal\n */\nexport function getRightCoord({\n xMargin,\n initialX,\n containerRect,\n}: XCoordConfig): Left {\n return (initialX ?? containerRect.left + containerRect.width) + xMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed above the\n * container element. So the bottom bounds of the fixed element will overlap\n * with the top bounds of the container element (before the yMargin is applied).\n *\n * @internal\n */\nexport function getAboveCoord({\n yMargin,\n initialY,\n elHeight,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top) - elHeight - yMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the top\n * of the container element. So the top bounds for both the container and fixed\n * elements will overlap (before the yMargin is applied).\n *\n * @internal\n */\nexport function getTopCoord({\n yMargin,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top) + yMargin;\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed vertically\n * centered relative to the container element. So the vertical center point for\n * the fixed element should overlap the vertical center point of the container\n * element.\n *\n * Note: Unlike all the other vertical positioning logic, the center position\n * does not use the yMargin.\n *\n * @internal\n */\nexport function getCenterYCoord({\n yMargin,\n elHeight,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n const containerCenter = containerRect.height / 2;\n const elementCenter = elHeight / 2;\n return (\n (initialY ?? containerRect.top + containerCenter + yMargin) - elementCenter\n );\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the\n * bottom of the container element. So the top bounds of the fixed element\n * should overlap the bottom bounds of the container element (before the yMargin\n * is applied).\n *\n * @internal\n */\nexport function getBottomCoord({\n yMargin,\n initialY,\n elHeight,\n containerRect,\n}: YCoordConfig): Top {\n return (\n (initialY ?? containerRect.top + containerRect.height) - elHeight - yMargin\n );\n}\n\n/**\n * Creates the `top` style value for an element that should be fixed to the\n * bottom of the container element. So the bottom bounds of both the container\n * and fixed elements should overlap (before the yMargin is applied).\n *\n * @internal\n */\nexport function getBelowCoord({\n yMargin,\n initialY,\n containerRect,\n}: YCoordConfig): Top {\n return (initialY ?? containerRect.top + containerRect.height) + yMargin;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface TransformOriginOptions extends PositionAnchor {\n transformOriginY?: number;\n}\n\n/**\n * This is a simple util that'll generate a css `transform-origin` string so\n * that the fixed element can animate from the correct point based on the\n * provided anchor.\n *\n * @param options - The anchor that should be used to create the transform origin\n * for.\n * @returns the transform origin string\n * @internal\n */\nexport function getTransformOrigin(options: TransformOriginOptions): string {\n const { transformOriginY: yPosition } = options;\n\n let x = \"0\";\n switch (options.x) {\n case \"right\":\n case \"inner-left\":\n x = \"0\";\n break;\n case \"center\":\n x = \"50%\";\n break;\n case \"left\":\n case \"inner-right\":\n x = \"100%\";\n break;\n default:\n x = \"0\";\n }\n\n let y = \"0\";\n if (typeof yPosition === \"number\") {\n y = `${yPosition}px`;\n } else {\n switch (options.y) {\n case \"above\":\n case \"bottom\":\n y = \"100%\";\n break;\n case \"center\":\n y = \"50%\";\n break;\n case \"below\":\n case \"top\":\n y = \"0\";\n break;\n default:\n y = \"0\";\n }\n }\n\n return `${x} ${y}`;\n}\n\n/**\n * Attempts to find a sizing container based on the provided HTMLElement. By\n * default, the sizing element will just be the provided element unless:\n * - the item has a known role within react-md that can target known classes\n * - the item has a `data-sizing-selector` attribute that is a valid query\n * selector for the nested item.\n *\n * NOTE: The `data-sizing-selector` will be run from the current element instead\n * of the `document`.\n *\n * @param el - The element to find a sizing container for.\n * @returns the sizing container relative to the provided element, or `null` if\n * none could be found.\n * @throws This error will be thrown if using the `data-query-selector` and the\n * query selector does not return an element on the page.\n * @internal\n */\nexport function findSizingContainer(\n el: HTMLElement | null\n): HTMLElement | null {\n if (!el) {\n return null;\n }\n\n if (/(tree|list)item/.test(el.getAttribute(\"role\") || \"\")) {\n const content = el.querySelector(\n \".rmd-tree-item__content, .rmd-item-text\"\n ) as HTMLElement;\n if (content) {\n return content;\n }\n } else if (el.getAttribute(\"type\") === \"file\") {\n const label = document.querySelector<HTMLLabelElement>(`[for=\"${el.id}\"]`);\n if (label) {\n return label;\n }\n }\n\n const data = el.getAttribute(\"data-sizing-selector\");\n if (data) {\n const content = el.querySelector(data) as HTMLElement;\n if (content) {\n return content;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"Unable to find a child element using the `data-sizing-selector`\"\n );\n }\n }\n\n return el;\n}\n\n/**\n * This util is used to get the \"true\" `element.getBoundingClientRect()` that\n * ensures that transitions using transforms don't mess up the sizing so that\n * position calculations are easier to do.\n *\n * @param element - The element to get a rect for.\n * @returns either a DOMRect for the element\n * @internal\n */\nexport function getElementRect(element: HTMLElement): DOMRect {\n const cloned = element.cloneNode(true) as HTMLElement;\n // remove the id so there won't be two elements with the same id on the page\n cloned.removeAttribute(\"id\");\n\n // remove the role just in case the role would alert screen readers once added\n // to the dom\n cloned.removeAttribute(\"role\");\n\n // ensure the cloned node won't shift the page or be visible\n cloned.style.position = \"fixed\";\n cloned.style.visibility = \"hidden\";\n\n // reset positioning to get a \"pure\" calculation. otherwise this will mess up\n // the height and width if the element is able to line wrap.\n cloned.style.left = \"\";\n cloned.style.top = \"\";\n cloned.style.right = \"\";\n cloned.style.bottom = \"\";\n\n // reset transforms so that custom animations don't mess with the sizing\n cloned.style.transform = \"none\";\n\n const parent = element.parentElement || document.body;\n parent.appendChild(cloned);\n\n const rect = cloned.getBoundingClientRect();\n parent.removeChild(cloned);\n\n return rect;\n}\n\n/**\n * @since 4.0.0\n * @internal\n */\ninterface IsWithinViewportOptions {\n fixedElement: HTMLElement;\n fixedToElement: HTMLElement;\n}\n\n/**\n * @since 4.0.0\n * @internal\n */\nexport function isWithinViewport(options: IsWithinViewportOptions): boolean {\n const { fixedElement, fixedToElement } = options;\n const fixedElementRect = fixedElement.getBoundingClientRect();\n const fixedToElementRect = fixedToElement.getBoundingClientRect();\n const vh = window.innerHeight;\n const vw = window.innerWidth;\n const top = Math.min(fixedElementRect.top, fixedToElementRect.top);\n const right = Math.max(fixedElementRect.right, fixedToElementRect.right);\n const bottom = Math.max(fixedElementRect.bottom, fixedToElementRect.bottom);\n const left = Math.min(fixedElementRect.left, fixedToElementRect.left);\n\n return bottom >= 0 && top <= vh && right >= 0 && left <= vw;\n}\n"],"names":["getLeftCoord","xMargin","elWidth","initialX","containerRect","left","getInnerLeftCoord","getCenterXCoord","containerCenter","width","elementCenter","getInnerRightCoord","getRightCoord","getAboveCoord","yMargin","initialY","elHeight","top","getTopCoord","getCenterYCoord","height","getBottomCoord","getBelowCoord","getTransformOrigin","options","transformOriginY","yPosition","x","y","findSizingContainer","el","test","getAttribute","content","querySelector","label","document","id","data","process","env","NODE_ENV","Error","getElementRect","element","cloned","cloneNode","removeAttribute","style","position","visibility","right","bottom","transform","parent","parentElement","body","appendChild","rect","getBoundingClientRect","removeChild","isWithinViewport","fixedElement","fixedToElement","fixedElementRect","fixedToElementRect","vh","window","innerHeight","vw","innerWidth","Math","min","max"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAqBA;;;;;;;CAOC,GACD,OAAO,SAASA,aAAa,EAC3BC,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,aAAa,EACA;IACb,OAAO,AAACD,CAAAA,YAAYC,cAAcC,IAAI,AAAD,IAAKH,UAAUD;AACtD;AAEA;;;;;;CAMC,GACD,OAAO,SAASK,kBAAkB,EAChCL,OAAO,EACPE,QAAQ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E,GAAGvC;IACzC,MAAMwC,mBAAmBF,aAAaH,qBAAqB;IAC3D,MAAMM,qBAAqBF,eAAeJ,qBAAqB;IAC/D,MAAMO,KAAKC,OAAOC,WAAW;IAC7B,MAAMC,KAAKF,OAAOG,UAAU;IAC5B,MAAMrD,MAAMsD,KAAKC,GAAG,CAACR,iBAAiB/C,GAAG,EAAEgD,mBAAmBhD,GAAG;IACjE,MAAMkC,QAAQoB,KAAKE,GAAG,CAACT,iBAAiBb,KAAK,EAAEc,mBAAmBd,KAAK;IACvE,MAAMC,SAASmB,KAAKE,GAAG,CAACT,iBAAiBZ,MAAM,EAAEa,mBAAmBb,MAAM;IAC1E,MAAM/C,OAAOkE,KAAKC,GAAG,CAACR,iBAAiB3D,IAAI,EAAE4D,mBAAmB5D,IAAI;IAEpE,OAAO+C,UAAU,KAAKnC,OAAOiD,MAAMf,SAAS,KAAK9C,QAAQgE;AAC3D"}
|
|
@@ -126,7 +126,10 @@ $disable-aspect-ratios: not list.length(map.keys($aspect-ratios)) !default;
|
|
|
126
126
|
|
|
127
127
|
@each $suffix, $ratio-list in $aspect-ratios {
|
|
128
128
|
&--#{$suffix} {
|
|
129
|
-
@include aspect-ratio(
|
|
129
|
+
@include aspect-ratio(
|
|
130
|
+
list.nth($ratio-list, 1),
|
|
131
|
+
list.nth($ratio-list, 2)
|
|
132
|
+
);
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
135
|
}
|
package/dist/theme/_theme.scss
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@use "sass:color";
|
|
2
2
|
@use "sass:list";
|
|
3
3
|
@use "sass:map";
|
|
4
|
-
@use "sass:string";
|
|
5
4
|
@use "sass:meta";
|
|
5
|
+
@use "sass:string";
|
|
6
6
|
@use "colors";
|
|
7
7
|
@use "a11y";
|
|
8
8
|
|
|
@@ -456,7 +456,7 @@ $theme-variables: (
|
|
|
456
456
|
"not use material design colors, set #{$fallback} instead to get a correct color for the provided swatch: " +
|
|
457
457
|
"#{$swatch}.";
|
|
458
458
|
@error $error-msg;
|
|
459
|
-
} @else if type-of($fallback-color) != "color" {
|
|
459
|
+
} @else if meta.type-of($fallback-color) != "color" {
|
|
460
460
|
@error "Invalid fallback color: '#{$fallback-color}'. This must be a valid color.";
|
|
461
461
|
} @else {
|
|
462
462
|
@return $fallback-color;
|
|
@@ -482,7 +482,7 @@ $theme-variables: (
|
|
|
482
482
|
} @else {
|
|
483
483
|
$index: 1;
|
|
484
484
|
$found: false;
|
|
485
|
-
@while not $found and $index < length(colors.$available-color-names) {
|
|
485
|
+
@while not $found and $index < list.length(colors.$available-color-names) {
|
|
486
486
|
$suffix: list.nth(colors.$available-color-names, $index);
|
|
487
487
|
$suffix-index: string.index($current-color-name, $suffix);
|
|
488
488
|
@if $suffix-index {
|
|
@@ -500,7 +500,7 @@ $theme-variables: (
|
|
|
500
500
|
|
|
501
501
|
$color-name: "#{$current-color-name}#{if($accent, "-a", "")}-#{$swatch}";
|
|
502
502
|
|
|
503
|
-
@return map
|
|
503
|
+
@return map.get(colors.$color-map, $color-name);
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
@mixin default-system-theme {
|
|
@@ -68,13 +68,12 @@ import { useCrossFadeTransition } from "./useCrossFadeTransition.js";
|
|
|
68
68
|
* @since 4.0.0 Updated for the new CSS Transition API and no longer supports
|
|
69
69
|
* wrapping children in a `<div>`.
|
|
70
70
|
*/ export function CrossFade(props) {
|
|
71
|
-
const { appear = true,
|
|
71
|
+
const { appear = true, children, className, ...options } = props;
|
|
72
72
|
const child = Children.only(children);
|
|
73
73
|
const { elementProps, rendered } = useCrossFadeTransition({
|
|
74
74
|
...options,
|
|
75
75
|
appear,
|
|
76
|
-
className: cnb(child.props.className, className)
|
|
77
|
-
transitionIn
|
|
76
|
+
className: cnb(child.props.className, className)
|
|
78
77
|
});
|
|
79
78
|
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
80
79
|
children: rendered && /*#__PURE__*/ cloneElement(children, elementProps)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transition/CrossFade.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { Children, cloneElement, type ReactElement } from \"react\";\nimport { type CSSTransitionComponentImplementation } from \"./types.js\";\nimport {\n useCrossFadeTransition,\n type CrossFadeTransitionHookOptions,\n} from \"./useCrossFadeTransition.js\";\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API\n */\nexport interface CrossFadeProps<E extends HTMLElement>\n extends CrossFadeTransitionHookOptions<E>,\n CSSTransitionComponentImplementation<E> {\n /**\n * Unlike the {@link useCrossFadeTransition}, the `appear` value is defaulted\n * to `true` so that the transition can occur when the `key` changes.\n *\n * @see {@link CrossFadeTransitionHookOptions.appear}\n * @defaultValue `true`\n */\n appear?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This is a component implementation of the {@link useCrossFadeTransition} hook\n * that implements the `temporary` behavior. Since this component uses the\n * `React.cloneElement` to inject the `ref` and `className` into the `children`,\n * it is recommended to use the hook instead.\n *\n * @example Appear transitions with a React `key`\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import { CrossFade } from \"@react-md/transition\";\n *\n * import Page1 from \"./Page1\";\n * import Page2 from \"./Page2\";\n * import Page3 from \"./Page3\";\n *\n * function Example(): ReactElement {\n * const [page, setPage] = useState(0):\n *\n * let content: ReactNode;\n * switch (page) {\n * case 0:\n * content = <Page1 />\n * break:\n * case 1:\n * content = <Page2 />\n * break;\n * case 2:\n * content = <Page3 />\n * break;\n * default:\n * content = null;\n * }\n *\n * return (\n * <>\n * <Button\n * onClick={() => {\n * setPage(prevPage => {\n * const nextPage = prevPage + 1;\n * if (nextPage > 2) {\n * return 0;\n * }\n *\n * return nextPage;\n * })\n * }}\n * >\n * Change Page\n * </Button>\n * <CrossFade key={page}>\n * <div>{content}</div>\n * </CrossFade>\n * </>\n * );\n * }\n * ```\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API and no longer supports\n * wrapping children in a `<div>`.\n */\nexport function CrossFade<E extends HTMLElement>(\n props: CrossFadeProps<E>\n): ReactElement {\n const {
|
|
1
|
+
{"version":3,"sources":["../../src/transition/CrossFade.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport { Children, cloneElement, type ReactElement } from \"react\";\nimport { type CSSTransitionComponentImplementation } from \"./types.js\";\nimport {\n useCrossFadeTransition,\n type CrossFadeTransitionHookOptions,\n} from \"./useCrossFadeTransition.js\";\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API\n */\nexport interface CrossFadeProps<E extends HTMLElement>\n extends CrossFadeTransitionHookOptions<E>,\n CSSTransitionComponentImplementation<E> {\n /**\n * Unlike the {@link useCrossFadeTransition}, the `appear` value is defaulted\n * to `true` so that the transition can occur when the `key` changes.\n *\n * @see {@link CrossFadeTransitionHookOptions.appear}\n * @defaultValue `true`\n */\n appear?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This is a component implementation of the {@link useCrossFadeTransition} hook\n * that implements the `temporary` behavior. Since this component uses the\n * `React.cloneElement` to inject the `ref` and `className` into the `children`,\n * it is recommended to use the hook instead.\n *\n * @example Appear transitions with a React `key`\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import { CrossFade } from \"@react-md/transition\";\n *\n * import Page1 from \"./Page1\";\n * import Page2 from \"./Page2\";\n * import Page3 from \"./Page3\";\n *\n * function Example(): ReactElement {\n * const [page, setPage] = useState(0):\n *\n * let content: ReactNode;\n * switch (page) {\n * case 0:\n * content = <Page1 />\n * break:\n * case 1:\n * content = <Page2 />\n * break;\n * case 2:\n * content = <Page3 />\n * break;\n * default:\n * content = null;\n * }\n *\n * return (\n * <>\n * <Button\n * onClick={() => {\n * setPage(prevPage => {\n * const nextPage = prevPage + 1;\n * if (nextPage > 2) {\n * return 0;\n * }\n *\n * return nextPage;\n * })\n * }}\n * >\n * Change Page\n * </Button>\n * <CrossFade key={page}>\n * <div>{content}</div>\n * </CrossFade>\n * </>\n * );\n * }\n * ```\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 2.0.0\n * @since 4.0.0 Updated for the new CSS Transition API and no longer supports\n * wrapping children in a `<div>`.\n */\nexport function CrossFade<E extends HTMLElement>(\n props: CrossFadeProps<E>\n): ReactElement {\n const { appear = true, children, className, ...options } = props;\n\n const child = Children.only(children);\n const { elementProps, rendered } = useCrossFadeTransition({\n ...options,\n appear,\n className: cnb(child.props.className, className),\n });\n\n return <>{rendered && cloneElement(children, elementProps)}</>;\n}\n"],"names":["cnb","Children","cloneElement","useCrossFadeTransition","CrossFade","props","appear","children","className","options","child","only","elementProps","rendered"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAASC,QAAQ,EAAEC,YAAY,QAA2B,QAAQ;AAElE,SACEC,sBAAsB,QAEjB,8BAA8B;AAqBrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEC,GACD,OAAO,SAASC,UACdC,KAAwB;IAExB,MAAM,EAAEC,SAAS,IAAI,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,SAAS,GAAGJ;IAE3D,MAAMK,QAAQT,SAASU,IAAI,CAACJ;IAC5B,MAAM,EAAEK,YAAY,EAAEC,QAAQ,EAAE,GAAGV,uBAAuB;QACxD,GAAGM,OAAO;QACVH;QACAE,WAAWR,IAAIU,MAAML,KAAK,CAACG,SAAS,EAAEA;IACxC;IAEA,qBAAO;kBAAGK,0BAAYX,aAAaK,UAAUK;;AAC/C"}
|
|
@@ -67,9 +67,10 @@ import { useCSSTransition } from "./useCSSTransition.js";
|
|
|
67
67
|
* transition.
|
|
68
68
|
* @since 4.0.0
|
|
69
69
|
*/ export function useCrossFadeTransition(options = {}) {
|
|
70
|
-
const { transitionIn = true, timeout = CROSS_FADE_TIMEOUT, classNames = CROSS_FADE_CLASSNAMES, ...cssOptions } = options;
|
|
70
|
+
const { appear = false, transitionIn = true, timeout = CROSS_FADE_TIMEOUT, classNames = CROSS_FADE_CLASSNAMES, ...cssOptions } = options;
|
|
71
71
|
return useCSSTransition({
|
|
72
72
|
...cssOptions,
|
|
73
|
+
appear,
|
|
73
74
|
timeout,
|
|
74
75
|
classNames,
|
|
75
76
|
transitionIn
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transition/useCrossFadeTransition.ts"],"sourcesContent":["\"use client\";\nimport type {\n CSSTransitionClassNames,\n CSSTransitionClassNamesObject,\n CSSTransitionHookReturnValue,\n PreconfiguredCSSTransitionInDefaultedOptions,\n TransitionTimeout,\n TransitionTimeoutObject,\n} from \"./types.js\";\nimport { useCSSTransition } from \"./useCSSTransition.js\";\n\n/**\n * The default cross fade transition classes to use.\n *\n * @since 2.0.0\n */\nexport const CROSS_FADE_CLASSNAMES: Readonly<CSSTransitionClassNamesObject> = {\n appear: \"rmd-cross-fade\",\n appearActive: \"rmd-cross-fade--active\",\n enter: \"rmd-cross-fade\",\n enterActive: \"rmd-cross-fade--active\",\n};\n\n/**\n * The default cross fade transition timeout.\n *\n * @since 2.0.0\n */\nexport const CROSS_FADE_TIMEOUT: Readonly<TransitionTimeoutObject> = {\n appear: 300,\n enter: 300,\n exit: 0,\n};\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport interface CrossFadeTransitionHookOptions<E extends HTMLElement>\n extends PreconfiguredCSSTransitionInDefaultedOptions<E> {\n /**\n * @see {@link TransitionTimeout}\n * @see {@link CROSS_FADE_TIMEOUT}\n * @defaultValue `CROSS_FADE_TIMEOUT`\n */\n timeout?: TransitionTimeout;\n\n /**\n * @see {@link CSSTransitionClassNames}\n * @see {@link CROSS_FADE_CLASSNAMES}\n * @defaultValue `CROSS_FADE_CLASSNAMES`\n */\n classNames?: CSSTransitionClassNames;\n\n /**\n * @see {@link PreconfiguredCSSTransitionInDefaultedOptions.transitionIn}\n * @defaultValue `true`\n */\n transitionIn?: boolean;\n}\n\n/**\n * This hook is used to create a \"cross fade\" transition -- a transition that\n * gradually increases the opacity and transforms the element vertically a short\n * distance. This is generally used for full page transitions when a route\n * changes.\n *\n * @example New Page Transition with the Layout component\n * ```tsx\n * import { ReactElement, ReactNode, useLayoutEffect } from \"react\";\n * import { useLocation } from \"react-router-dom\":\n * import { Layout, useCrossFadeTransition, useLayoutNavigation } from \"@react-md/core\";\n *\n * import { navItems } from \"./navItems\";\n *\n * interface ExampleProps {\n * children: ReactNode;\n * }\n *\n * function Example({ children }: ExampleProps): ReactElement {\n * const { pathname } = useLocation();\n * const { elementProps, transitionTo } = useCrossFadeTransition();\n *\n * const prevPathname = useRef(pathname);\n * useLayoutEffect(() => {\n * if (prevPathname.current === pathname) {\n * return\n * }\n *\n * prevPathname.current = pathname;\n * transitionTo('enter');\n * }, [pathname, transitionTo])\n *\n * return (\n * <Layout\n * {...useLayoutNavigation(navItems, pathname)}\n * appBarTitle=\"My App\"\n * mainProps={elementProps}\n * >\n * {children}\n * </Layout>\n * );\n * }\n * ```\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport function useCrossFadeTransition<E extends HTMLElement>(\n options: CrossFadeTransitionHookOptions<E> = {}\n): CSSTransitionHookReturnValue<E> {\n const {\n transitionIn = true,\n timeout = CROSS_FADE_TIMEOUT,\n classNames = CROSS_FADE_CLASSNAMES,\n ...cssOptions\n } = options;\n\n return useCSSTransition({\n ...cssOptions,\n timeout,\n classNames,\n transitionIn,\n });\n}\n"],"names":["useCSSTransition","CROSS_FADE_CLASSNAMES","appear","appearActive","enter","enterActive","CROSS_FADE_TIMEOUT","exit","useCrossFadeTransition","options","transitionIn","timeout","classNames","cssOptions"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/transition/useCrossFadeTransition.ts"],"sourcesContent":["\"use client\";\nimport type {\n CSSTransitionClassNames,\n CSSTransitionClassNamesObject,\n CSSTransitionHookReturnValue,\n PreconfiguredCSSTransitionInDefaultedOptions,\n TransitionTimeout,\n TransitionTimeoutObject,\n} from \"./types.js\";\nimport { useCSSTransition } from \"./useCSSTransition.js\";\n\n/**\n * The default cross fade transition classes to use.\n *\n * @since 2.0.0\n */\nexport const CROSS_FADE_CLASSNAMES: Readonly<CSSTransitionClassNamesObject> = {\n appear: \"rmd-cross-fade\",\n appearActive: \"rmd-cross-fade--active\",\n enter: \"rmd-cross-fade\",\n enterActive: \"rmd-cross-fade--active\",\n};\n\n/**\n * The default cross fade transition timeout.\n *\n * @since 2.0.0\n */\nexport const CROSS_FADE_TIMEOUT: Readonly<TransitionTimeoutObject> = {\n appear: 300,\n enter: 300,\n exit: 0,\n};\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport interface CrossFadeTransitionHookOptions<E extends HTMLElement>\n extends PreconfiguredCSSTransitionInDefaultedOptions<E> {\n /**\n * @see {@link TransitionTimeout}\n * @see {@link CROSS_FADE_TIMEOUT}\n * @defaultValue `CROSS_FADE_TIMEOUT`\n */\n timeout?: TransitionTimeout;\n\n /**\n * @see {@link CSSTransitionClassNames}\n * @see {@link CROSS_FADE_CLASSNAMES}\n * @defaultValue `CROSS_FADE_CLASSNAMES`\n */\n classNames?: CSSTransitionClassNames;\n\n /**\n * @see {@link PreconfiguredCSSTransitionInDefaultedOptions.transitionIn}\n * @defaultValue `true`\n */\n transitionIn?: boolean;\n}\n\n/**\n * This hook is used to create a \"cross fade\" transition -- a transition that\n * gradually increases the opacity and transforms the element vertically a short\n * distance. This is generally used for full page transitions when a route\n * changes.\n *\n * @example New Page Transition with the Layout component\n * ```tsx\n * import { ReactElement, ReactNode, useLayoutEffect } from \"react\";\n * import { useLocation } from \"react-router-dom\":\n * import { Layout, useCrossFadeTransition, useLayoutNavigation } from \"@react-md/core\";\n *\n * import { navItems } from \"./navItems\";\n *\n * interface ExampleProps {\n * children: ReactNode;\n * }\n *\n * function Example({ children }: ExampleProps): ReactElement {\n * const { pathname } = useLocation();\n * const { elementProps, transitionTo } = useCrossFadeTransition();\n *\n * const prevPathname = useRef(pathname);\n * useLayoutEffect(() => {\n * if (prevPathname.current === pathname) {\n * return\n * }\n *\n * prevPathname.current = pathname;\n * transitionTo('enter');\n * }, [pathname, transitionTo])\n *\n * return (\n * <Layout\n * {...useLayoutNavigation(navItems, pathname)}\n * appBarTitle=\"My App\"\n * mainProps={elementProps}\n * >\n * {children}\n * </Layout>\n * );\n * }\n * ```\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport function useCrossFadeTransition<E extends HTMLElement>(\n options: CrossFadeTransitionHookOptions<E> = {}\n): CSSTransitionHookReturnValue<E> {\n const {\n appear = false,\n transitionIn = true,\n timeout = CROSS_FADE_TIMEOUT,\n classNames = CROSS_FADE_CLASSNAMES,\n ...cssOptions\n } = options;\n\n return useCSSTransition({\n ...cssOptions,\n appear,\n timeout,\n classNames,\n transitionIn,\n });\n}\n"],"names":["useCSSTransition","CROSS_FADE_CLASSNAMES","appear","appearActive","enter","enterActive","CROSS_FADE_TIMEOUT","exit","useCrossFadeTransition","options","transitionIn","timeout","classNames","cssOptions"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AASA,SAASA,gBAAgB,QAAQ,wBAAwB;AAEzD;;;;CAIC,GACD,OAAO,MAAMC,wBAAiE;IAC5EC,QAAQ;IACRC,cAAc;IACdC,OAAO;IACPC,aAAa;AACf,EAAE;AAEF;;;;CAIC,GACD,OAAO,MAAMC,qBAAwD;IACnEJ,QAAQ;IACRE,OAAO;IACPG,MAAM;AACR,EAAE;AA8BF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CC,GACD,OAAO,SAASC,uBACdC,UAA6C,CAAC,CAAC;IAE/C,MAAM,EACJP,SAAS,KAAK,EACdQ,eAAe,IAAI,EACnBC,UAAUL,kBAAkB,EAC5BM,aAAaX,qBAAqB,EAClC,GAAGY,YACJ,GAAGJ;IAEJ,OAAOT,iBAAiB;QACtB,GAAGa,UAAU;QACbX;QACAS;QACAC;QACAF;IACF;AACF"}
|
|
@@ -80,11 +80,12 @@ import { useCSSTransition } from "./useCSSTransition.js";
|
|
|
80
80
|
* transition.
|
|
81
81
|
* @since 4.0.0
|
|
82
82
|
*/ export function useScaleTransition(options) {
|
|
83
|
-
const { timeout = SCALE_TIMEOUT, vertical = false, temporary = true, classNames = vertical ? SCALE_Y_CLASSNAMES : SCALE_CLASSNAMES, ...transitionOptions } = options;
|
|
83
|
+
const { timeout = SCALE_TIMEOUT, vertical = false, temporary = true, exitedHidden = true, classNames = vertical ? SCALE_Y_CLASSNAMES : SCALE_CLASSNAMES, ...transitionOptions } = options;
|
|
84
84
|
return useCSSTransition({
|
|
85
85
|
...transitionOptions,
|
|
86
86
|
timeout,
|
|
87
87
|
temporary,
|
|
88
|
+
exitedHidden,
|
|
88
89
|
classNames
|
|
89
90
|
});
|
|
90
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transition/useScaleTransition.ts"],"sourcesContent":["\"use client\";\nimport type {\n CSSTransitionClassNames,\n CSSTransitionClassNamesObject,\n CSSTransitionHookReturnValue,\n PreconfiguredCSSTransitionOptions,\n TransitionTimeoutObject,\n} from \"./types.js\";\nimport { useCSSTransition } from \"./useCSSTransition.js\";\n\n/**\n * The default {@link CSSTransitionClassNames} for a horizontal scale\n * transition.\n *\n * @since 2.0.0\n * @since 6.0.0 The class names were updated to be prefixed with\n * `rmd-scale-transition`\n */\nexport const SCALE_CLASSNAMES: Readonly<CSSTransitionClassNamesObject> = {\n appear: \"rmd-scale-transition--enter\",\n appearActive: \"rmd-scale-transition--enter-active\",\n enter: \"rmd-scale-transition--enter\",\n enterActive: \"rmd-scale-transition--enter-active\",\n enterDone: \"\",\n exit: \"rmd-scale-transition--exit\",\n exitActive: \"rmd-scale-transition--exit-active\",\n};\n\n/**\n * The default {@link CSSTransitionClassNames} for a vertical scale transition.\n *\n * @since 2.0.0\n * @since 6.0.0 The class names were updated to be prefixed with\n * `rmd-scale-y-transition` and merged with the {@link SCALE_CLASSNAMES}\n */\nexport const SCALE_Y_CLASSNAMES: Readonly<CSSTransitionClassNamesObject> = {\n appear: \"rmd-scale-transition--enter rmd-scale-transition--y-enter\",\n appearActive:\n \"rmd-scale-transition--enter-active rmd-scale-transition--y-enter-active\",\n enter: \"rmd-scale-transition--enter rmd-scale-transition--y-enter\",\n enterActive:\n \"rmd-scale-transition--enter-active rmd-scale-transition--y-enter-active\",\n enterDone: \"\",\n exit: \"rmd-scale-transition--exit rmd-scale-transition--y-exit\",\n exitActive:\n \"rmd-scale-transition--exit-active rmd-scale-transition--y-exit-active\",\n};\n\n/**\n * The default {@link TransitionTimeout} to use for horizontal and vertical\n * scale transitions.\n *\n * @since 2.0.0\n */\nexport const SCALE_TIMEOUT: Readonly<TransitionTimeoutObject> = {\n enter: 200,\n exit: 150,\n};\n\n/**\n * @typeParam E - The HTMLElement type used or the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport interface ScaleTransitionHookOptions<E extends HTMLElement>\n extends PreconfiguredCSSTransitionOptions<E> {\n /**\n * Boolean if the scale transition should be vertical instead of horizontal.\n * This really only changes the default value for the {@link classNames}.\n *\n * @defaultValue `false`\n */\n vertical?: boolean;\n\n /**\n * @see {@link PreconfiguredCSSTransitionOptions.temporary}\n * @defaultValue `true`\n */\n temporary?: boolean;\n\n /**\n * @see {@link vertical}\n * @see {@link SCALE_CLASSNAMES}\n * @see {@link SCALE_Y_CLASSNAMES}\n * @defaultValue `vertical ? SCALE_Y_CLASSNAMES : SCALE_CLASSNAMES`\n */\n classNames?: CSSTransitionClassNames;\n}\n\n/**\n * Implements a scale transition that should generally be used for temporary\n * elements that are positioned via `position: absolute` or `position: fixed`.\n *\n * @example Dropdown Menu Example\n * ```tsx\n * import { ReactElement, useRef, useState } from \"react\";\n * import { Button, useFixedPositioning, useScaleTransition } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const buttonRef = useRef<HTMLButtonElement>(null);\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { style, transitionOptions } = useFixedPositioning({\n * fixedTo: buttonRef,\n * });\n * const { elementProps, rendered } = useScaleTransition({\n * ...transitionOptions,\n * transitionIn,\n * vertical: true,\n * });\n *\n * return (\n * <>\n * <Button ref={buttonRef} onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * {rendered && (\n * <div {...elementProps} style={style}>\n * Some content within a menu\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @typeParam E - The HTMLElement type used or the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport function useScaleTransition<E extends HTMLElement>(\n options: ScaleTransitionHookOptions<E>\n): CSSTransitionHookReturnValue<E> {\n const {\n timeout = SCALE_TIMEOUT,\n vertical = false,\n temporary = true,\n classNames = vertical ? SCALE_Y_CLASSNAMES : SCALE_CLASSNAMES,\n ...transitionOptions\n } = options;\n\n return useCSSTransition({\n ...transitionOptions,\n timeout,\n temporary,\n classNames,\n });\n}\n"],"names":["useCSSTransition","SCALE_CLASSNAMES","appear","appearActive","enter","enterActive","enterDone","exit","exitActive","SCALE_Y_CLASSNAMES","SCALE_TIMEOUT","useScaleTransition","options","timeout","vertical","temporary","classNames","transitionOptions"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/transition/useScaleTransition.ts"],"sourcesContent":["\"use client\";\nimport type {\n CSSTransitionClassNames,\n CSSTransitionClassNamesObject,\n CSSTransitionHookReturnValue,\n PreconfiguredCSSTransitionOptions,\n TransitionTimeoutObject,\n} from \"./types.js\";\nimport { useCSSTransition } from \"./useCSSTransition.js\";\n\n/**\n * The default {@link CSSTransitionClassNames} for a horizontal scale\n * transition.\n *\n * @since 2.0.0\n * @since 6.0.0 The class names were updated to be prefixed with\n * `rmd-scale-transition`\n */\nexport const SCALE_CLASSNAMES: Readonly<CSSTransitionClassNamesObject> = {\n appear: \"rmd-scale-transition--enter\",\n appearActive: \"rmd-scale-transition--enter-active\",\n enter: \"rmd-scale-transition--enter\",\n enterActive: \"rmd-scale-transition--enter-active\",\n enterDone: \"\",\n exit: \"rmd-scale-transition--exit\",\n exitActive: \"rmd-scale-transition--exit-active\",\n};\n\n/**\n * The default {@link CSSTransitionClassNames} for a vertical scale transition.\n *\n * @since 2.0.0\n * @since 6.0.0 The class names were updated to be prefixed with\n * `rmd-scale-y-transition` and merged with the {@link SCALE_CLASSNAMES}\n */\nexport const SCALE_Y_CLASSNAMES: Readonly<CSSTransitionClassNamesObject> = {\n appear: \"rmd-scale-transition--enter rmd-scale-transition--y-enter\",\n appearActive:\n \"rmd-scale-transition--enter-active rmd-scale-transition--y-enter-active\",\n enter: \"rmd-scale-transition--enter rmd-scale-transition--y-enter\",\n enterActive:\n \"rmd-scale-transition--enter-active rmd-scale-transition--y-enter-active\",\n enterDone: \"\",\n exit: \"rmd-scale-transition--exit rmd-scale-transition--y-exit\",\n exitActive:\n \"rmd-scale-transition--exit-active rmd-scale-transition--y-exit-active\",\n};\n\n/**\n * The default {@link TransitionTimeout} to use for horizontal and vertical\n * scale transitions.\n *\n * @since 2.0.0\n */\nexport const SCALE_TIMEOUT: Readonly<TransitionTimeoutObject> = {\n enter: 200,\n exit: 150,\n};\n\n/**\n * @typeParam E - The HTMLElement type used or the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport interface ScaleTransitionHookOptions<E extends HTMLElement>\n extends PreconfiguredCSSTransitionOptions<E> {\n /**\n * Boolean if the scale transition should be vertical instead of horizontal.\n * This really only changes the default value for the {@link classNames}.\n *\n * @defaultValue `false`\n */\n vertical?: boolean;\n\n /**\n * @see {@link PreconfiguredCSSTransitionOptions.temporary}\n * @defaultValue `true`\n */\n temporary?: boolean;\n\n /**\n * @see {@link vertical}\n * @see {@link SCALE_CLASSNAMES}\n * @see {@link SCALE_Y_CLASSNAMES}\n * @defaultValue `vertical ? SCALE_Y_CLASSNAMES : SCALE_CLASSNAMES`\n */\n classNames?: CSSTransitionClassNames;\n}\n\n/**\n * Implements a scale transition that should generally be used for temporary\n * elements that are positioned via `position: absolute` or `position: fixed`.\n *\n * @example Dropdown Menu Example\n * ```tsx\n * import { ReactElement, useRef, useState } from \"react\";\n * import { Button, useFixedPositioning, useScaleTransition } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const buttonRef = useRef<HTMLButtonElement>(null);\n * const [transitionIn, setTransitionIn] = useState(false);\n * const { style, transitionOptions } = useFixedPositioning({\n * fixedTo: buttonRef,\n * });\n * const { elementProps, rendered } = useScaleTransition({\n * ...transitionOptions,\n * transitionIn,\n * vertical: true,\n * });\n *\n * return (\n * <>\n * <Button ref={buttonRef} onClick={() => setTransitionIn(!transitionIn)}>\n * Toggle\n * </Button>\n * {rendered && (\n * <div {...elementProps} style={style}>\n * Some content within a menu\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @typeParam E - The HTMLElement type used or the ref required for the\n * transition.\n * @since 4.0.0\n */\nexport function useScaleTransition<E extends HTMLElement>(\n options: ScaleTransitionHookOptions<E>\n): CSSTransitionHookReturnValue<E> {\n const {\n timeout = SCALE_TIMEOUT,\n vertical = false,\n temporary = true,\n exitedHidden = true,\n classNames = vertical ? SCALE_Y_CLASSNAMES : SCALE_CLASSNAMES,\n ...transitionOptions\n } = options;\n\n return useCSSTransition({\n ...transitionOptions,\n timeout,\n temporary,\n exitedHidden,\n classNames,\n });\n}\n"],"names":["useCSSTransition","SCALE_CLASSNAMES","appear","appearActive","enter","enterActive","enterDone","exit","exitActive","SCALE_Y_CLASSNAMES","SCALE_TIMEOUT","useScaleTransition","options","timeout","vertical","temporary","exitedHidden","classNames","transitionOptions"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAQA,SAASA,gBAAgB,QAAQ,wBAAwB;AAEzD;;;;;;;CAOC,GACD,OAAO,MAAMC,mBAA4D;IACvEC,QAAQ;IACRC,cAAc;IACdC,OAAO;IACPC,aAAa;IACbC,WAAW;IACXC,MAAM;IACNC,YAAY;AACd,EAAE;AAEF;;;;;;CAMC,GACD,OAAO,MAAMC,qBAA8D;IACzEP,QAAQ;IACRC,cACE;IACFC,OAAO;IACPC,aACE;IACFC,WAAW;IACXC,MAAM;IACNC,YACE;AACJ,EAAE;AAEF;;;;;CAKC,GACD,OAAO,MAAME,gBAAmD;IAC9DN,OAAO;IACPG,MAAM;AACR,EAAE;AAgCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCC,GACD,OAAO,SAASI,mBACdC,OAAsC;IAEtC,MAAM,EACJC,UAAUH,aAAa,EACvBI,WAAW,KAAK,EAChBC,YAAY,IAAI,EAChBC,eAAe,IAAI,EACnBC,aAAaH,WAAWL,qBAAqBR,gBAAgB,EAC7D,GAAGiB,mBACJ,GAAGN;IAEJ,OAAOZ,iBAAiB;QACtB,GAAGkB,iBAAiB;QACpBL;QACAE;QACAC;QACAC;IACF;AACF"}
|
|
@@ -2,26 +2,26 @@ import type { NonNullRef, UseStateSetter } from "./types.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* @since 6.0.0
|
|
4
4
|
*/
|
|
5
|
-
export type
|
|
5
|
+
export type AsyncFunction<Args extends unknown[]> = (...args: Args) => Promise<void>;
|
|
6
6
|
/**
|
|
7
7
|
* @since 6.0.0
|
|
8
8
|
*/
|
|
9
|
-
export type
|
|
9
|
+
export type HandleAsyncFunction = <Args extends unknown[]>(action: AsyncFunction<Args>) => AsyncFunction<Args>;
|
|
10
10
|
/**
|
|
11
11
|
* @since 6.0.0
|
|
12
12
|
*/
|
|
13
|
-
export interface
|
|
13
|
+
export interface AsyncFunctionHookOptions {
|
|
14
14
|
/** @defaultValue `false` */
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* @since 6.0.0
|
|
19
19
|
*/
|
|
20
|
-
export interface
|
|
20
|
+
export interface AsyncFunctionHookImplementation {
|
|
21
21
|
pending: boolean;
|
|
22
22
|
unmounted: NonNullRef<boolean>;
|
|
23
23
|
setPending: UseStateSetter<boolean>;
|
|
24
|
-
handleAsync:
|
|
24
|
+
handleAsync: HandleAsyncFunction;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* A simple utility hook for triggering a pending state while an async function
|
|
@@ -32,7 +32,7 @@ export interface AsyncActionImplementation {
|
|
|
32
32
|
* @example Simple Example (Async Button)
|
|
33
33
|
* ```tsx
|
|
34
34
|
* import type { ButtonProps } from "@react-md/core";
|
|
35
|
-
* import { box, Button, CircularProgress,
|
|
35
|
+
* import { box, Button, CircularProgress, useAsyncFunction } from "@react-md/core";
|
|
36
36
|
* import { cnb } from "cnbuilder";
|
|
37
37
|
* import type { MouseEvent, ReactElement } from "react";
|
|
38
38
|
*
|
|
@@ -44,7 +44,7 @@ export interface AsyncActionImplementation {
|
|
|
44
44
|
*
|
|
45
45
|
* export function AsyncButton(props: AsyncButtonProps): ReactElement {
|
|
46
46
|
* const { onClick, children, theme, className, disabled, ...remaining } = props;
|
|
47
|
-
* const { handleAsync, pending } =
|
|
47
|
+
* const { handleAsync, pending } = useAsyncFunction({ disabled });
|
|
48
48
|
*
|
|
49
49
|
* return (
|
|
50
50
|
* <Button
|
|
@@ -95,7 +95,7 @@ export interface AsyncActionImplementation {
|
|
|
95
95
|
* DialogContent,
|
|
96
96
|
* DialogFooter,
|
|
97
97
|
* Form,
|
|
98
|
-
*
|
|
98
|
+
* useAsyncFunction,
|
|
99
99
|
* } from "@react-md/core";
|
|
100
100
|
* import CloseIcon from "@react-md/material-icons/CloseIcon";
|
|
101
101
|
* import type { ReactElement } from "react";
|
|
@@ -107,7 +107,7 @@ export interface AsyncActionImplementation {
|
|
|
107
107
|
* }
|
|
108
108
|
*
|
|
109
109
|
* function Example({ hide, submit }: ExampleProps): ReactElement {
|
|
110
|
-
* const { handleAsync, pending } =
|
|
110
|
+
* const { handleAsync, pending } = useAsyncFunction();
|
|
111
111
|
* const formId = useId();
|
|
112
112
|
*
|
|
113
113
|
* return (
|
|
@@ -150,4 +150,4 @@ export interface AsyncActionImplementation {
|
|
|
150
150
|
*
|
|
151
151
|
* @since 6.0.0
|
|
152
152
|
*/
|
|
153
|
-
export declare function
|
|
153
|
+
export declare function useAsyncFunction(options?: AsyncFunctionHookOptions): AsyncFunctionHookImplementation;
|
|
@@ -10,7 +10,7 @@ import { useUnmounted } from "./useUnmounted.js";
|
|
|
10
10
|
* @example Simple Example (Async Button)
|
|
11
11
|
* ```tsx
|
|
12
12
|
* import type { ButtonProps } from "@react-md/core";
|
|
13
|
-
* import { box, Button, CircularProgress,
|
|
13
|
+
* import { box, Button, CircularProgress, useAsyncFunction } from "@react-md/core";
|
|
14
14
|
* import { cnb } from "cnbuilder";
|
|
15
15
|
* import type { MouseEvent, ReactElement } from "react";
|
|
16
16
|
*
|
|
@@ -22,7 +22,7 @@ import { useUnmounted } from "./useUnmounted.js";
|
|
|
22
22
|
*
|
|
23
23
|
* export function AsyncButton(props: AsyncButtonProps): ReactElement {
|
|
24
24
|
* const { onClick, children, theme, className, disabled, ...remaining } = props;
|
|
25
|
-
* const { handleAsync, pending } =
|
|
25
|
+
* const { handleAsync, pending } = useAsyncFunction({ disabled });
|
|
26
26
|
*
|
|
27
27
|
* return (
|
|
28
28
|
* <Button
|
|
@@ -73,7 +73,7 @@ import { useUnmounted } from "./useUnmounted.js";
|
|
|
73
73
|
* DialogContent,
|
|
74
74
|
* DialogFooter,
|
|
75
75
|
* Form,
|
|
76
|
-
*
|
|
76
|
+
* useAsyncFunction,
|
|
77
77
|
* } from "@react-md/core";
|
|
78
78
|
* import CloseIcon from "@react-md/material-icons/CloseIcon";
|
|
79
79
|
* import type { ReactElement } from "react";
|
|
@@ -85,7 +85,7 @@ import { useUnmounted } from "./useUnmounted.js";
|
|
|
85
85
|
* }
|
|
86
86
|
*
|
|
87
87
|
* function Example({ hide, submit }: ExampleProps): ReactElement {
|
|
88
|
-
* const { handleAsync, pending } =
|
|
88
|
+
* const { handleAsync, pending } = useAsyncFunction();
|
|
89
89
|
* const formId = useId();
|
|
90
90
|
*
|
|
91
91
|
* return (
|
|
@@ -127,7 +127,7 @@ import { useUnmounted } from "./useUnmounted.js";
|
|
|
127
127
|
* ```
|
|
128
128
|
*
|
|
129
129
|
* @since 6.0.0
|
|
130
|
-
*/ export function
|
|
130
|
+
*/ export function useAsyncFunction(options = {}) {
|
|
131
131
|
const { disabled } = options;
|
|
132
132
|
const [pending, setPending] = useState(false);
|
|
133
133
|
const unmounted = useUnmounted();
|
|
@@ -156,4 +156,4 @@ import { useUnmounted } from "./useUnmounted.js";
|
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
//# sourceMappingURL=
|
|
159
|
+
//# sourceMappingURL=useAsyncFunction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/useAsyncFunction.ts"],"sourcesContent":["\"use client\";\nimport { useCallback, useState } from \"react\";\nimport type { NonNullRef, UseStateSetter } from \"./types.js\";\nimport { useUnmounted } from \"./useUnmounted.js\";\n\n/**\n * @since 6.0.0\n */\nexport type AsyncFunction<Args extends unknown[]> = (\n ...args: Args\n) => Promise<void>;\n\n/**\n * @since 6.0.0\n */\nexport type HandleAsyncFunction = <Args extends unknown[]>(\n action: AsyncFunction<Args>\n) => AsyncFunction<Args>;\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncFunctionHookOptions {\n /** @defaultValue `false` */\n disabled?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncFunctionHookImplementation {\n pending: boolean;\n unmounted: NonNullRef<boolean>;\n setPending: UseStateSetter<boolean>;\n handleAsync: HandleAsyncFunction;\n}\n\n/**\n * A simple utility hook for triggering a pending state while an async function\n * is running. This is really only useful if you aren't using something like\n * `react-query`, `@reduxjs/toolkit/query`, `@apollo/client`, etc for API calls\n * which have a built-in pending state for mutations.\n *\n * @example Simple Example (Async Button)\n * ```tsx\n * import type { ButtonProps } from \"@react-md/core\";\n * import { box, Button, CircularProgress, useAsyncFunction } from \"@react-md/core\";\n * import { cnb } from \"cnbuilder\";\n * import type { MouseEvent, ReactElement } from \"react\";\n *\n * import styles from \"./AsyncButton.module.scss\";\n *\n * export interface AsyncButtonProps extends ButtonProps {\n * onClick(event: MouseEvent<HTMLButtonElement>): Promise<void>;\n * }\n *\n * export function AsyncButton(props: AsyncButtonProps): ReactElement {\n * const { onClick, children, theme, className, disabled, ...remaining } = props;\n * const { handleAsync, pending } = useAsyncFunction({ disabled });\n *\n * return (\n * <Button\n * {...remaining}\n * aria-disabled={pending || undefined}\n * disabled={disabled}\n * className={cnb(pending && styles.loading, className)}\n * theme={pending ? \"disabled\" : theme}\n * onClick={handleAsync(onClick)}\n * >\n * {children}\n * {pending && (\n * <span\n * className={box({\n * align: \"center\",\n * disablePadding: true,\n * className: styles.overlay,\n * })}\n * >\n * <CircularProgress />\n * </span>\n * )}\n * </Button>\n * );\n * }\n *\n * // `AsyncButton.module.scss`\n * // hide everything in the button except for the overlay containing the circular\n * // progress\n * .loading > *:not(.overlay) {\n * opacity: 0;\n * }\n *\n * .overlay {\n * border-radius: inherit;\n * box-shadow: inherit;\n * inset: 0;\n * position: absolute;\n * z-index: 1;\n * }\n * ```\n *\n * @example Confirmation Dialog with Overlay\n * ```tsx\n * import {\n * Button,\n * DialogHeader,\n * DialogContent,\n * DialogFooter,\n * Form,\n * useAsyncFunction,\n * } from \"@react-md/core\";\n * import CloseIcon from \"@react-md/material-icons/CloseIcon\";\n * import type { ReactElement } from \"react\";\n * import { useId } from \"react\";\n *\n * interface ExampleProps {\n * hide(); void;\n * submit(): Promise<void>\n * }\n *\n * function Example({ hide, submit }: ExampleProps): ReactElement {\n * const { handleAsync, pending } = useAsyncFunction();\n * const formId = useId();\n *\n * return (\n * <>\n * <DialogHeader>\n * <DialogTitle>Some Title</DialogTitle>\n * <Button aria-label=\"Close\" onClick={hide} disabled={pending}>\n * <CloseIcon />\n * </Button>\n * </DialogHeader>\n * <DialogContent>\n * <Form\n * id={formId}\n * onReset={hide}\n * onSubmit={handleAsync(submit)}\n * >\n * // pretend content\n * </Form>\n * </DialogContent>\n * <DialogFooter>\n * <Button\n * type=\"reset\"\n * form={formId}\n * disabled={pending}\n * >\n * Cancel\n * </Button>\n * <Button\n * type=\"submit\"\n * form={formId}\n * disabled={pending}\n * >\n * Confirm\n * </Button>\n * </DialogFooter>\n * </>\n * );\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function useAsyncFunction(\n options: AsyncFunctionHookOptions = {}\n): AsyncFunctionHookImplementation {\n const { disabled } = options;\n\n const [pending, setPending] = useState(false);\n const unmounted = useUnmounted();\n\n const handleAsync = useCallback<HandleAsyncFunction>(\n (action) =>\n async (...args) => {\n if (pending || disabled) {\n return;\n }\n\n setPending(true);\n try {\n await action(...args);\n } finally {\n if (!unmounted.current) {\n setPending(false);\n }\n }\n },\n [disabled, pending, unmounted]\n );\n\n return {\n pending,\n unmounted,\n setPending,\n handleAsync,\n };\n}\n"],"names":["useCallback","useState","useUnmounted","useAsyncFunction","options","disabled","pending","setPending","unmounted","handleAsync","action","args","current"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAE9C,SAASC,YAAY,QAAQ,oBAAoB;AAkCjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8HC,GACD,OAAO,SAASC,iBACdC,UAAoC,CAAC,CAAC;IAEtC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IAErB,MAAM,CAACE,SAASC,WAAW,GAAGN,SAAS;IACvC,MAAMO,YAAYN;IAElB,MAAMO,cAAcT,YAClB,CAACU,SACC,OAAO,GAAGC;YACR,IAAIL,WAAWD,UAAU;gBACvB;YACF;YAEAE,WAAW;YACX,IAAI;gBACF,MAAMG,UAAUC;YAClB,SAAU;gBACR,IAAI,CAACH,UAAUI,OAAO,EAAE;oBACtBL,WAAW;gBACb;YACF;QACF,GACF;QAACF;QAAUC;QAASE;KAAU;IAGhC,OAAO;QACLF;QACAE;QACAD;QACAE;IACF;AACF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type RefCallback, type Ref } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* @since 6.0.0
|
|
4
|
+
*/
|
|
5
|
+
export interface MutationObserverHookOptions<E extends HTMLElement> extends MutationObserverInit {
|
|
6
|
+
ref?: Ref<E>;
|
|
7
|
+
/**
|
|
8
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/observe#options
|
|
9
|
+
* @defaultValue `!childList && !attributes && !characterData`
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onObserved(mutation: MutationRecord): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The mutation observer is used to track the changes made to the DOM tree.
|
|
16
|
+
*
|
|
17
|
+
* @example Simple Example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { useMutationObserver } from "@react-md/core";
|
|
20
|
+
* import { useCallback, type HTMLAttributes, type ReactElement } from "react";
|
|
21
|
+
*
|
|
22
|
+
* function Example(props: HTMLAttributes<HTMLDivElement>): ReactElement {
|
|
23
|
+
* const { children, ...remaining } = props;
|
|
24
|
+
*
|
|
25
|
+
* const targetRef = useMutationObserver({
|
|
26
|
+
* subtree: true,
|
|
27
|
+
* attributes: true,
|
|
28
|
+
* childList: true,
|
|
29
|
+
* onUpdate: useCallback((mutation) => {
|
|
30
|
+
* switch (mutation.type) {
|
|
31
|
+
* case "childList":
|
|
32
|
+
* console.log("A child node has been added or removed");
|
|
33
|
+
* break;
|
|
34
|
+
* case "attributes":
|
|
35
|
+
* console.log(`The ${mutation.attributeName} attribute was modified`);
|
|
36
|
+
* break
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* }, []),
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* return (
|
|
43
|
+
* <div {...remaining} ref={targetRef}>
|
|
44
|
+
* {children}
|
|
45
|
+
* </div>
|
|
46
|
+
* );
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @since 6.0.0
|
|
51
|
+
*/
|
|
52
|
+
export declare function useMutationObserver<E extends HTMLElement>(options: MutationObserverHookOptions<E>): RefCallback<E>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useEnsuredRef } from "./useEnsuredRef.js";
|
|
3
|
+
/**
|
|
4
|
+
* The mutation observer is used to track the changes made to the DOM tree.
|
|
5
|
+
*
|
|
6
|
+
* @example Simple Example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { useMutationObserver } from "@react-md/core";
|
|
9
|
+
* import { useCallback, type HTMLAttributes, type ReactElement } from "react";
|
|
10
|
+
*
|
|
11
|
+
* function Example(props: HTMLAttributes<HTMLDivElement>): ReactElement {
|
|
12
|
+
* const { children, ...remaining } = props;
|
|
13
|
+
*
|
|
14
|
+
* const targetRef = useMutationObserver({
|
|
15
|
+
* subtree: true,
|
|
16
|
+
* attributes: true,
|
|
17
|
+
* childList: true,
|
|
18
|
+
* onUpdate: useCallback((mutation) => {
|
|
19
|
+
* switch (mutation.type) {
|
|
20
|
+
* case "childList":
|
|
21
|
+
* console.log("A child node has been added or removed");
|
|
22
|
+
* break;
|
|
23
|
+
* case "attributes":
|
|
24
|
+
* console.log(`The ${mutation.attributeName} attribute was modified`);
|
|
25
|
+
* break
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* }, []),
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* return (
|
|
32
|
+
* <div {...remaining} ref={targetRef}>
|
|
33
|
+
* {children}
|
|
34
|
+
* </div>
|
|
35
|
+
* );
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @since 6.0.0
|
|
40
|
+
*/ export function useMutationObserver(options) {
|
|
41
|
+
const { ref, onObserved, attributes, attributeFilter, attributeOldValue, subtree, childList, characterData, characterDataOldValue, disabled = !childList && !attributes && !characterData } = options;
|
|
42
|
+
const [targetNodeRef, refCallback] = useEnsuredRef(ref);
|
|
43
|
+
useEffect(()=>{
|
|
44
|
+
if (disabled) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const observerTarget = targetNodeRef.current;
|
|
48
|
+
if (!observerTarget) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const observer = new MutationObserver((records)=>{
|
|
52
|
+
const [entry] = records;
|
|
53
|
+
if (entry) {
|
|
54
|
+
onObserved(entry);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
observer.observe(observerTarget, {
|
|
58
|
+
attributes,
|
|
59
|
+
attributeFilter,
|
|
60
|
+
attributeOldValue,
|
|
61
|
+
subtree,
|
|
62
|
+
childList,
|
|
63
|
+
characterData,
|
|
64
|
+
characterDataOldValue
|
|
65
|
+
});
|
|
66
|
+
return ()=>{
|
|
67
|
+
observer.disconnect();
|
|
68
|
+
};
|
|
69
|
+
}, [
|
|
70
|
+
attributeFilter,
|
|
71
|
+
attributeOldValue,
|
|
72
|
+
attributes,
|
|
73
|
+
characterData,
|
|
74
|
+
characterDataOldValue,
|
|
75
|
+
childList,
|
|
76
|
+
disabled,
|
|
77
|
+
onObserved,
|
|
78
|
+
subtree,
|
|
79
|
+
targetNodeRef
|
|
80
|
+
]);
|
|
81
|
+
return refCallback;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=useMutationObserver.js.map
|