@react-md/core 1.0.0-next.7 → 1.0.0-next.9
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/.stylelintrc.json +14 -0
- package/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-lint.log +13 -12
- package/CHANGELOG.md +15 -0
- package/README.md +39 -24
- package/coverage/clover.xml +1013 -529
- package/coverage/coverage-final.json +9 -3
- package/coverage/lcov-report/AutoComplete.tsx.html +283 -0
- package/coverage/lcov-report/MenuItemCheckbox.tsx.html +223 -0
- package/coverage/lcov-report/MenuItemInputToggle.tsx.html +178 -232
- package/coverage/lcov-report/MenuItemRadio.tsx.html +436 -0
- package/coverage/lcov-report/RootHtml.tsx.html +370 -0
- package/coverage/lcov-report/Select.tsx.html +1411 -0
- package/coverage/lcov-report/SrOnly.tsx.html +328 -0
- package/coverage/lcov-report/Typography.tsx.html +1027 -0
- package/coverage/lcov-report/autocomplete/AutoComplete.tsx.html +283 -0
- package/coverage/lcov-report/autocomplete/Autocomplete.tsx.html +283 -0
- package/coverage/lcov-report/autocomplete/index.html +161 -0
- package/coverage/lcov-report/autocomplete/useAutoComplete.ts.html +775 -0
- package/coverage/lcov-report/autocomplete/useAutocomplete.ts.html +775 -0
- package/coverage/lcov-report/autocomplete/useInlineAutoComplete.ts.html +340 -0
- package/coverage/lcov-report/autocomplete/useInlineAutocomplete.ts.html +346 -0
- package/coverage/lcov-report/autocomplete/utils.ts.html +106 -0
- package/coverage/lcov-report/avatar/Avatar.tsx.html +162 -99
- package/coverage/lcov-report/avatar/index.html +19 -34
- package/coverage/lcov-report/avatar/styles.ts.html +1 -1
- package/coverage/lcov-report/button/Button.tsx.html +85 -85
- package/coverage/lcov-report/button/index.html +12 -12
- package/coverage/lcov-report/dialog/DialogFooter.tsx.html +36 -36
- package/coverage/lcov-report/dialog/DialogHeader.tsx.html +26 -26
- package/coverage/lcov-report/dialog/index.html +34 -19
- package/coverage/lcov-report/form/AutoComplete.tsx.html +283 -0
- package/coverage/lcov-report/form/Form.tsx.html +22 -22
- package/coverage/lcov-report/form/OptGroup.tsx.html +169 -166
- package/coverage/lcov-report/form/Option.tsx.html +727 -0
- package/coverage/lcov-report/form/Select.tsx.html +962 -1112
- package/coverage/lcov-report/form/SelectOriginal.tsx.html +1630 -0
- package/coverage/lcov-report/form/SelectV2.tsx.html +1024 -0
- package/coverage/lcov-report/form/SelectedOption.tsx.html +250 -0
- package/coverage/lcov-report/form/index.html +57 -12
- package/coverage/lcov-report/form/selectUtils.ts.html +188 -221
- package/coverage/lcov-report/form/useAutoComplete.ts.html +787 -0
- package/coverage/lcov-report/form/useCombobox.ts.html +454 -460
- package/coverage/lcov-report/form/useComboboxList.ts.html +108 -93
- package/coverage/lcov-report/form/useFormReset.ts.html +229 -0
- package/coverage/lcov-report/form/useInlineAutoComplete.ts.html +379 -0
- package/coverage/lcov-report/form/useSelectCombobox.ts.html +499 -0
- package/coverage/lcov-report/form/utils.ts.html +209 -170
- package/coverage/lcov-report/icon/FontIcon.tsx.html +28 -28
- package/coverage/lcov-report/icon/MaterialIcon.tsx.html +235 -0
- package/coverage/lcov-report/icon/index.html +1 -1
- package/coverage/lcov-report/index.html +32 -32
- package/coverage/lcov-report/media-queries/appSize.ts.html +1 -1
- package/coverage/lcov-report/media-queries/index.html +1 -1
- package/coverage/lcov-report/menu/DropdownMenu.tsx.html +188 -188
- package/coverage/lcov-report/menu/Menu.tsx.html +271 -265
- package/coverage/lcov-report/menu/MenuItem.tsx.html +292 -0
- package/coverage/lcov-report/menu/MenuVisibilityProvider.tsx.html +48 -33
- package/coverage/lcov-report/menu/index.html +45 -15
- package/coverage/lcov-report/menu/useContextMenu.ts.html +490 -0
- package/coverage/lcov-report/menuItemInputToggleStyles.ts.html +319 -0
- package/coverage/lcov-report/movement/index.html +19 -19
- package/coverage/lcov-report/movement/useKeyboardMovementProvider.ts.html +422 -383
- package/coverage/lcov-report/positioning/constants.ts.html +463 -0
- package/coverage/lcov-report/positioning/index.html +30 -30
- package/coverage/lcov-report/positioning/useFixedPositioning.ts.html +1321 -0
- package/coverage/lcov-report/progress/CircularProgress.tsx.html +184 -184
- package/coverage/lcov-report/progress/index.html +19 -34
- package/coverage/lcov-report/searching/caseInsensitive.ts.html +685 -0
- package/coverage/lcov-report/searching/fuzzy.ts.html +610 -0
- package/coverage/lcov-report/searching/index.html +161 -0
- package/coverage/lcov-report/searching/toSearchQuery.ts.html +139 -0
- package/coverage/lcov-report/searching/utils.ts.html +247 -0
- package/coverage/lcov-report/src/CoreProviders.tsx.html +20 -20
- package/coverage/lcov-report/src/NoSsr.tsx.html +1 -1
- package/coverage/lcov-report/src/RootHtml.tsx.html +370 -0
- package/coverage/lcov-report/src/SsrProvider.tsx.html +10 -10
- package/coverage/lcov-report/src/app-bar/AppBar.tsx.html +1 -1
- package/coverage/lcov-report/src/app-bar/AppBarTitle.tsx.html +1 -1
- package/coverage/lcov-report/src/app-bar/index.html +1 -1
- package/coverage/lcov-report/src/avatar/Avatar.tsx.html +1 -1
- package/coverage/lcov-report/src/avatar/index.html +1 -1
- package/coverage/lcov-report/src/avatar/styles.ts.html +1 -1
- package/coverage/lcov-report/src/badge/Badge.tsx.html +1 -1
- package/coverage/lcov-report/src/badge/index.html +1 -1
- package/coverage/lcov-report/src/box/Box.tsx.html +1 -1
- package/coverage/lcov-report/src/box/index.html +1 -1
- package/coverage/lcov-report/src/box/styles.ts.html +1 -1
- package/coverage/lcov-report/src/button/AsyncButton.tsx.html +1 -1
- package/coverage/lcov-report/src/button/Button.tsx.html +1 -1
- package/coverage/lcov-report/src/button/ButtonUnstyled.tsx.html +1 -1
- package/coverage/lcov-report/src/button/FloatingActionButton.tsx.html +1 -1
- package/coverage/lcov-report/src/button/TooltippedButton.tsx.html +1 -1
- package/coverage/lcov-report/src/button/buttonStyles.ts.html +1 -1
- package/coverage/lcov-report/src/button/buttonUnstyledStyles.ts.html +1 -1
- package/coverage/lcov-report/src/button/index.html +1 -1
- package/coverage/lcov-report/src/card/Card.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardContent.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardFooter.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardSubtitle.tsx.html +1 -1
- package/coverage/lcov-report/src/card/CardTitle.tsx.html +1 -1
- package/coverage/lcov-report/src/card/ClickableCard.tsx.html +1 -1
- package/coverage/lcov-report/src/card/index.html +1 -1
- package/coverage/lcov-report/src/card/styles.ts.html +1 -1
- package/coverage/lcov-report/src/chip/Chip.tsx.html +1 -1
- package/coverage/lcov-report/src/chip/index.html +1 -1
- package/coverage/lcov-report/src/chip/styles.ts.html +1 -1
- package/coverage/lcov-report/src/cssUtils.ts.html +53 -53
- package/coverage/lcov-report/src/delegateEvent.ts.html +1 -1
- package/coverage/lcov-report/src/dialog/Dialog.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/DialogContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/DialogContent.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/DialogFooter.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/DialogHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/DialogTitle.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/FixedDialog.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/NestedDialogProvider.ts.html +1 -1
- package/coverage/lcov-report/src/dialog/index.html +1 -1
- package/coverage/lcov-report/src/dialog/styles.ts.html +1 -1
- package/coverage/lcov-report/src/divider/Divider.tsx.html +1 -1
- package/coverage/lcov-report/src/divider/index.html +1 -1
- package/coverage/lcov-report/src/divider/styles.ts.html +1 -1
- package/coverage/lcov-report/src/draggable/index.html +1 -1
- package/coverage/lcov-report/src/draggable/useDraggable.ts.html +1 -1
- package/coverage/lcov-report/src/draggable/utils.ts.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/ExpansionList.tsx.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/ExpansionPanel.tsx.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/ExpansionPanelHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/index.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/useExpansionList.ts.html +1 -1
- package/coverage/lcov-report/src/expansion-panel/useExpansionPanels.ts.html +1 -1
- package/coverage/lcov-report/src/focus/index.html +1 -1
- package/coverage/lcov-report/src/focus/useFocusContainer.ts.html +1 -1
- package/coverage/lcov-report/src/focus/utils.ts.html +1 -1
- package/coverage/lcov-report/src/form/AutoComplete.tsx.html +283 -0
- package/coverage/lcov-report/src/form/Checkbox.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Fieldset.tsx.html +1 -1
- package/coverage/lcov-report/src/form/FileInput.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Form.tsx.html +11 -8
- package/coverage/lcov-report/src/form/FormMessage.tsx.html +1 -1
- package/coverage/lcov-report/src/form/FormMessageContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/form/FormMessageCounter.tsx.html +1 -1
- package/coverage/lcov-report/src/form/InputToggle.tsx.html +1 -1
- package/coverage/lcov-report/src/form/InputToggleIcon.tsx.html +56 -56
- package/coverage/lcov-report/src/form/Label.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Legend.tsx.html +1 -1
- package/coverage/lcov-report/src/form/MenuItemCheckbox.tsx.html +3 -3
- package/coverage/lcov-report/src/form/MenuItemFileInput.tsx.html +1 -1
- package/coverage/lcov-report/src/form/MenuItemInputToggle.tsx.html +178 -232
- package/coverage/lcov-report/src/form/MenuItemRadio.tsx.html +3 -3
- package/coverage/lcov-report/src/form/MenuItemSwitch.tsx.html +1 -1
- package/coverage/lcov-report/src/form/MenuItemTextField.tsx.html +1 -1
- package/coverage/lcov-report/src/form/NativeSelect.tsx.html +1 -1
- package/coverage/lcov-report/src/form/OptGroup.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Option.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Password.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Radio.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Select.tsx.html +894 -1146
- package/coverage/lcov-report/src/form/SelectValue.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Slider.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderMark.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderMarkLabel.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderThumb.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderTrack.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderValueMarks.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderValueTooltip.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Switch.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SwitchTrack.tsx.html +1 -1
- package/coverage/lcov-report/src/form/TextArea.tsx.html +1 -1
- package/coverage/lcov-report/src/form/TextField.tsx.html +1 -1
- package/coverage/lcov-report/src/form/TextFieldAddon.tsx.html +1 -1
- package/coverage/lcov-report/src/form/TextFieldContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/form/TextFieldContainerStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/fileUtils.ts.html +1 -1
- package/coverage/lcov-report/src/form/formConfig.ts.html +1 -1
- package/coverage/lcov-report/src/form/formMessageStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/index.html +30 -900
- package/coverage/lcov-report/src/form/inputToggleStyles.ts.html +30 -30
- package/coverage/lcov-report/src/form/menuItemInputToggleStyles.ts.html +319 -0
- package/coverage/lcov-report/src/form/nativeSelectStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/optionStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/passwordStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/selectStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/selectUtils.ts.html +1 -1
- package/coverage/lcov-report/src/form/sliderUtils.ts.html +1 -1
- package/coverage/lcov-report/src/form/switchStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/textAreaStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/textFieldStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/useAutoComplete.ts.html +787 -0
- package/coverage/lcov-report/src/form/useCheckboxGroup.ts.html +1 -1
- package/coverage/lcov-report/src/form/useCombobox.ts.html +943 -457
- package/coverage/lcov-report/src/form/useEditableCombobox.ts.html +502 -0
- package/coverage/lcov-report/src/form/useFileUpload.ts.html +1 -1
- package/coverage/lcov-report/src/form/useInlineAutoComplete.ts.html +109 -0
- package/coverage/lcov-report/src/form/useListboxProvider.ts.html +1 -1
- package/coverage/lcov-report/src/form/useNumberField.ts.html +1 -1
- package/coverage/lcov-report/src/form/useRadioGroup.ts.html +1 -1
- package/coverage/lcov-report/src/form/useRangeSlider.ts.html +1 -1
- package/coverage/lcov-report/src/form/useResizingTextArea.ts.html +1 -1
- package/coverage/lcov-report/src/form/useSelectCombobox.ts.html +295 -0
- package/coverage/lcov-report/src/form/useSlider.ts.html +1 -1
- package/coverage/lcov-report/src/form/useTextField.ts.html +1 -1
- package/coverage/lcov-report/src/form/utils.ts.html +200 -170
- package/coverage/lcov-report/src/form/validation.ts.html +1 -1
- package/coverage/lcov-report/src/hoverMode/index.html +1 -1
- package/coverage/lcov-report/src/hoverMode/useHoverMode.ts.html +1 -1
- package/coverage/lcov-report/src/hoverMode/useHoverModeProvider.ts.html +1 -1
- package/coverage/lcov-report/src/icon/FontIcon.tsx.html +28 -28
- package/coverage/lcov-report/src/icon/IconRotator.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/MaterialIcon.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/MaterialSymbol.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/SVGIcon.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/TextIconSpacing.tsx.html +51 -51
- package/coverage/lcov-report/src/icon/iconConfig.tsx.html +10 -10
- package/coverage/lcov-report/src/icon/index.html +1 -1
- package/coverage/lcov-report/src/icon/material.ts.html +1 -1
- package/coverage/lcov-report/src/icon/materialConfig.ts.html +1 -1
- package/coverage/lcov-report/src/icon/styles.ts.html +38 -38
- package/coverage/lcov-report/src/index.html +9 -354
- package/coverage/lcov-report/src/interaction/Ripple.tsx.html +1 -1
- package/coverage/lcov-report/src/interaction/RippleContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/interaction/UserInteractionModeProvider.tsx.html +87 -87
- package/coverage/lcov-report/src/interaction/config.ts.html +7 -7
- package/coverage/lcov-report/src/interaction/index.html +1 -1
- package/coverage/lcov-report/src/interaction/useElementInteraction.tsx.html +83 -83
- package/coverage/lcov-report/src/interaction/useHigherContrastChildren.tsx.html +7 -7
- package/coverage/lcov-report/src/interaction/utils.ts.html +1 -1
- package/coverage/lcov-report/src/layout/LayoutAppBar.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/LayoutNav.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/LayoutWindowSplitter.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/Main.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/index.html +1 -1
- package/coverage/lcov-report/src/layout/layoutNavStyles.ts.html +1 -1
- package/coverage/lcov-report/src/layout/layoutWindowSplitterStyles.ts.html +1 -1
- package/coverage/lcov-report/src/layout/mainStyles.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useExpandableLayout.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useHorizontalLayoutTransition.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useLayoutAppBarHeight.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useLayoutTree.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useLayoutWindowSplitter.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useMainTabIndex.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useResizableLayout.ts.html +1 -1
- package/coverage/lcov-report/src/layout/useTemporaryLayout.ts.html +1 -1
- package/coverage/lcov-report/src/link/Link.tsx.html +1 -1
- package/coverage/lcov-report/src/link/SkipToMainContent.tsx.html +1 -1
- package/coverage/lcov-report/src/link/index.html +1 -1
- package/coverage/lcov-report/src/link/styles.ts.html +1 -1
- package/coverage/lcov-report/src/list/List.tsx.html +30 -30
- package/coverage/lcov-report/src/list/ListItem.tsx.html +124 -124
- package/coverage/lcov-report/src/list/ListItemAddon.tsx.html +35 -35
- package/coverage/lcov-report/src/list/ListItemChildren.tsx.html +79 -79
- package/coverage/lcov-report/src/list/ListItemLink.tsx.html +2 -2
- package/coverage/lcov-report/src/list/ListItemText.tsx.html +35 -35
- package/coverage/lcov-report/src/list/ListSubheader.tsx.html +1 -1
- package/coverage/lcov-report/src/list/getListItemHeight.ts.html +44 -47
- package/coverage/lcov-report/src/list/index.html +5 -5
- package/coverage/lcov-report/src/list/listItemStyles.ts.html +65 -65
- package/coverage/lcov-report/src/media-queries/AppSizeProvider.tsx.html +49 -49
- package/coverage/lcov-report/src/media-queries/appSize.ts.html +1 -1
- package/coverage/lcov-report/src/media-queries/index.html +1 -1
- package/coverage/lcov-report/src/media-queries/useMediaQuery.ts.html +24 -24
- package/coverage/lcov-report/src/menu/DropdownMenu.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/Menu.tsx.html +3 -3
- package/coverage/lcov-report/src/menu/MenuBar.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuButton.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuConfigurationProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItem.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItemButton.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItemGroup.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItemSeparator.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuSheet.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuVisibilityProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuWidget.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuWidgetKeyboardProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/index.html +1 -1
- package/coverage/lcov-report/src/menu/useContextMenu.ts.html +1 -1
- package/coverage/lcov-report/src/menu/useMenuBarProvider.ts.html +1 -1
- package/coverage/lcov-report/src/menu/utils.ts.html +1 -1
- package/coverage/lcov-report/src/movement/constants.ts.html +1 -1
- package/coverage/lcov-report/src/movement/findMatchIndex.ts.html +1 -1
- package/coverage/lcov-report/src/movement/index.html +17 -62
- package/coverage/lcov-report/src/movement/useKeyboardMovementProvider.ts.html +1 -1
- package/coverage/lcov-report/src/movement/utils.ts.html +143 -119
- package/coverage/lcov-report/src/overlay/Overlay.tsx.html +1 -1
- package/coverage/lcov-report/src/overlay/index.html +1 -1
- package/coverage/lcov-report/src/overlay/overlayStyles.ts.html +1 -1
- package/coverage/lcov-report/src/portal/Portal.tsx.html +1 -1
- package/coverage/lcov-report/src/portal/PortalContainerProvider.tsx.html +36 -36
- package/coverage/lcov-report/src/portal/index.html +1 -1
- package/coverage/lcov-report/src/positioning/constants.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/createHorizontalPosition.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/createVerticalPosition.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/getFixedPosition.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/index.html +1 -1
- package/coverage/lcov-report/src/positioning/useFixedPositioning.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/utils.ts.html +1 -1
- package/coverage/lcov-report/src/progress/CircularProgress.tsx.html +81 -81
- package/coverage/lcov-report/src/progress/LinearProgress.tsx.html +1 -1
- package/coverage/lcov-report/src/progress/getProgressA11y.ts.html +1 -1
- package/coverage/lcov-report/src/progress/index.html +1 -1
- package/coverage/lcov-report/src/responsive-item/ResponsiveItemContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/responsive-item/ResponsiveItemOverlay.tsx.html +1 -1
- package/coverage/lcov-report/src/responsive-item/index.html +1 -1
- package/coverage/lcov-report/src/responsive-item/styles.ts.html +1 -1
- package/coverage/lcov-report/src/scroll/ScrollLock.tsx.html +1 -1
- package/coverage/lcov-report/src/scroll/getScrollbarWidth.ts.html +1 -1
- package/coverage/lcov-report/src/scroll/index.html +1 -1
- package/coverage/lcov-report/src/scroll/useScrollLock.ts.html +1 -1
- package/coverage/lcov-report/src/segmented-button/SegmentedButton.tsx.html +1 -1
- package/coverage/lcov-report/src/segmented-button/SegmentedButtonContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/segmented-button/index.html +1 -1
- package/coverage/lcov-report/src/segmented-button/segmentedButtonContainerStyles.ts.html +1 -1
- package/coverage/lcov-report/src/segmented-button/segmentedButtonStyles.ts.html +1 -1
- package/coverage/lcov-report/src/sheet/Sheet.tsx.html +1 -1
- package/coverage/lcov-report/src/sheet/index.html +1 -1
- package/coverage/lcov-report/src/sheet/styles.ts.html +1 -1
- package/coverage/lcov-report/src/snackbar/DefaultToastRenderer.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/Snackbar.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/Toast.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastActionButton.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastCloseButton.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastContent.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastManager.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastManagerProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/index.html +1 -1
- package/coverage/lcov-report/src/snackbar/snackbarStyles.ts.html +1 -1
- package/coverage/lcov-report/src/snackbar/toastContentStyles.ts.html +1 -1
- package/coverage/lcov-report/src/snackbar/toastStyles.ts.html +1 -1
- package/coverage/lcov-report/src/snackbar/useCurrentToastActions.ts.html +1 -1
- package/coverage/lcov-report/src/suspense/CircularProgressSuspense.tsx.html +142 -142
- package/coverage/lcov-report/src/suspense/NullSuspense.tsx.html +88 -88
- package/coverage/lcov-report/src/suspense/index.html +32 -32
- package/coverage/lcov-report/src/table/Table.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableBody.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableCell.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableCellContent.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableCheckbox.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableConfigurationProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableContainerProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableFooter.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableRadio.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableRow.tsx.html +1 -1
- package/coverage/lcov-report/src/table/index.html +1 -1
- package/coverage/lcov-report/src/table/tableCellStyles.ts.html +1 -1
- package/coverage/lcov-report/src/table/tableContainerStyles.ts.html +1 -1
- package/coverage/lcov-report/src/table/tableFooterStyles.ts.html +1 -1
- package/coverage/lcov-report/src/table/tableHeaderStyles.ts.html +1 -1
- package/coverage/lcov-report/src/table/tableRowStyles.ts.html +1 -1
- package/coverage/lcov-report/src/table/tableStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/Tab.tsx.html +1 -1
- package/coverage/lcov-report/src/tabs/TabList.tsx.html +1 -1
- package/coverage/lcov-report/src/tabs/TabListScrollButton.tsx.html +1 -1
- package/coverage/lcov-report/src/tabs/index.html +1 -1
- package/coverage/lcov-report/src/tabs/tabIndicatorStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/tabListScrollButtonStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/tabListStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/tabStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/useTabList.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/useTabs.ts.html +1 -1
- package/coverage/lcov-report/src/tabs/utils.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/IntersectionObserver.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/ResizeObserver.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/data-testid.ts.html +18 -6
- package/coverage/lcov-report/src/test-utils/drag.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/index.html +7 -7
- package/coverage/lcov-report/src/test-utils/jest-setup.ts.html +9 -9
- package/coverage/lcov-report/src/test-utils/matchMedia.ts.html +4 -4
- package/coverage/lcov-report/src/test-utils/polyfills/IntersectionObserver.ts.html +4 -4
- package/coverage/lcov-report/src/test-utils/polyfills/ResizeObserver.ts.html +3 -3
- package/coverage/lcov-report/src/test-utils/polyfills/TextDecoder.ts.html +106 -0
- package/coverage/lcov-report/src/test-utils/polyfills/TextEncoder.ts.html +100 -0
- package/coverage/lcov-report/src/test-utils/polyfills/index.html +1 -1
- package/coverage/lcov-report/src/test-utils/polyfills/matchMedia.ts.html +6 -6
- package/coverage/lcov-report/src/test-utils/polyfills/offsetParent.ts.html +14 -14
- package/coverage/lcov-report/src/test-utils/polyfills/scrollIntoView.ts.html +5 -5
- package/coverage/lcov-report/src/test-utils/render.tsx.html +21 -21
- package/coverage/lcov-report/src/test-utils/root-html-environment.ts.html +85 -0
- package/coverage/lcov-report/src/test-utils/timers.ts.html +1 -1
- package/coverage/lcov-report/src/theme/LocalStorageColorSchemeProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/theme/ThemeProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/theme/colors.ts.html +1 -1
- package/coverage/lcov-report/src/theme/cssVars.ts.html +1 -1
- package/coverage/lcov-report/src/theme/index.html +1 -1
- package/coverage/lcov-report/src/theme/useCSSVariables.ts.html +1 -1
- package/coverage/lcov-report/src/theme/useColorScheme.ts.html +1 -1
- package/coverage/lcov-report/src/theme/useColorSchemeMetaTag.ts.html +1 -1
- package/coverage/lcov-report/src/theme/useColorSchemeProvider.ts.html +1 -1
- package/coverage/lcov-report/src/theme/usePrefersColorScheme.ts.html +1 -1
- package/coverage/lcov-report/src/theme/utils.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/Tooltip.tsx.html +1 -1
- package/coverage/lcov-report/src/tooltip/TooltipHoverModeProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/tooltip/constants.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/index.html +1 -1
- package/coverage/lcov-report/src/tooltip/tooltipStyles.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/useTooltip.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/useTooltipPosition.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/utils.ts.html +1 -1
- package/coverage/lcov-report/src/transition/CSSTransition.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/Collapse.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/CrossFade.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/ScaleTransition.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/SkeletonPlaceholder.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/Slide.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/SlideContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/transition/collapseStyles.ts.html +13 -13
- package/coverage/lcov-report/src/transition/config.ts.html +3 -3
- package/coverage/lcov-report/src/transition/index.html +7 -7
- package/coverage/lcov-report/src/transition/maxWidthTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/skeletonPlaceholderUtils.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useCSSTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useCarousel.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useCollapseTransition.ts.html +96 -150
- package/coverage/lcov-report/src/transition/useCrossFadeTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useMaxWidthTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useScaleTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useSkeletonPlaceholder.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useSlideTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useTransition.ts.html +152 -152
- package/coverage/lcov-report/src/transition/utils.ts.html +14 -14
- package/coverage/lcov-report/src/tree/DefaultTreeItemRenderer.tsx.html +1 -1
- package/coverage/lcov-report/src/tree/Tree.tsx.html +1 -1
- package/coverage/lcov-report/src/tree/TreeGroup.tsx.html +45 -45
- package/coverage/lcov-report/src/tree/TreeItem.tsx.html +1 -1
- package/coverage/lcov-report/src/tree/TreeItemExpander.tsx.html +1 -1
- package/coverage/lcov-report/src/tree/TreeProvider.tsx.html +8 -8
- package/coverage/lcov-report/src/tree/index.html +1 -1
- package/coverage/lcov-report/src/tree/styles.ts.html +5 -5
- package/coverage/lcov-report/src/tree/useTree.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTreeExpansion.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTreeItems.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTreeMovement.ts.html +1 -1
- package/coverage/lcov-report/src/tree/useTreeSelection.ts.html +1 -1
- package/coverage/lcov-report/src/tree/utils.ts.html +1 -1
- package/coverage/lcov-report/src/typography/SrOnly.tsx.html +12 -12
- package/coverage/lcov-report/src/typography/TextContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/typography/Typography.tsx.html +94 -94
- package/coverage/lcov-report/src/typography/WritingDirectionProvider.tsx.html +1 -1
- package/coverage/lcov-report/src/typography/index.html +1 -1
- package/coverage/lcov-report/src/useAsyncAction.ts.html +1 -1
- package/coverage/lcov-report/src/useDebouncedFunction.ts.html +1 -1
- package/coverage/lcov-report/src/useDropzone.ts.html +1 -1
- package/coverage/lcov-report/src/useElementSize.ts.html +1 -1
- package/coverage/lcov-report/src/useEnsuredId.ts.html +8 -8
- package/coverage/lcov-report/src/useEnsuredRef.ts.html +11 -11
- package/coverage/lcov-report/src/useEnsuredState.ts.html +16 -16
- package/coverage/lcov-report/src/useHtmlClassName.ts.html +1 -1
- package/coverage/lcov-report/src/useIntersectionObserver.ts.html +1 -1
- package/coverage/lcov-report/src/useIsomorphicLayoutEffect.ts.html +1 -1
- package/coverage/lcov-report/src/useLocalStorage.ts.html +1 -1
- package/coverage/lcov-report/src/useOrientation.ts.html +32 -32
- package/coverage/lcov-report/src/usePageInactive.ts.html +1 -1
- package/coverage/lcov-report/src/useResizeListener.ts.html +1 -1
- package/coverage/lcov-report/src/useResizeObserver.ts.html +23 -23
- package/coverage/lcov-report/src/useThrottledFunction.ts.html +1 -1
- package/coverage/lcov-report/src/useToggle.ts.html +1 -1
- package/coverage/lcov-report/src/useUnmounted.ts.html +1 -1
- package/coverage/lcov-report/src/useWindowSize.ts.html +1 -1
- package/coverage/lcov-report/src/utils/RenderRecursively.tsx.html +1 -1
- package/coverage/lcov-report/src/utils/alphaNumericSort.ts.html +1 -1
- package/coverage/lcov-report/src/utils/applyRef.ts.html +1 -1
- package/coverage/lcov-report/src/utils/bem.ts.html +50 -50
- package/coverage/lcov-report/src/utils/filters.ts.html +357 -84
- package/coverage/lcov-report/src/utils/getClientPosition.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getMiddleOfRange.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getPercentage.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getRangeDefaultValue.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getRangeSteps.ts.html +1 -1
- package/coverage/lcov-report/src/utils/identity.ts.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +13 -268
- package/coverage/lcov-report/src/utils/isElementVisible.ts.html +1 -1
- package/coverage/lcov-report/src/utils/loop.ts.html +1 -1
- package/coverage/lcov-report/src/utils/nearest.ts.html +1 -1
- package/coverage/lcov-report/src/utils/parseCssLengthUnit.ts.html +1 -1
- package/coverage/lcov-report/src/utils/randomInt.ts.html +1 -1
- package/coverage/lcov-report/src/utils/wait.ts.html +1 -1
- package/coverage/lcov-report/src/utils/withinRange.ts.html +1 -1
- package/coverage/lcov-report/src/window-splitter/WindowSplitter.tsx.html +1 -1
- package/coverage/lcov-report/src/window-splitter/index.html +1 -1
- package/coverage/lcov-report/src/window-splitter/useWindowSplitter.ts.html +1 -1
- package/coverage/lcov-report/transition/config.ts.html +5 -5
- package/coverage/lcov-report/transition/index.html +1 -1
- package/coverage/lcov-report/transition/useScaleTransition.ts.html +535 -0
- package/coverage/lcov-report/useAutoComplete.ts.html +787 -0
- package/coverage/lcov-report/useCollapseTransition.ts.html +166 -211
- package/coverage/lcov-report/useCombobox.ts.html +1513 -0
- package/coverage/lcov-report/useInlineAutoComplete.ts.html +379 -0
- package/coverage/lcov-report/useSelectCombobox.ts.html +295 -0
- package/coverage/lcov-report/utils/alphaNumericSort.ts.html +11 -50
- package/coverage/lcov-report/utils/filters.ts.html +1056 -201
- package/coverage/lcov-report/utils/index.html +10 -10
- package/coverage/lcov-report/utils/searching.ts.html +85 -0
- package/coverage/lcov-report/utils.ts.html +109 -277
- package/coverage/lcov.info +900 -363
- package/dist/RootHtml.d.ts +62 -0
- package/dist/RootHtml.js +49 -0
- package/dist/RootHtml.js.map +1 -0
- package/dist/_core.scss +49 -43
- package/dist/avatar/Avatar.d.ts +14 -0
- package/dist/avatar/Avatar.js +5 -2
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/badge/_badge.scss +23 -19
- package/dist/dialog/FixedDialog.d.ts +5 -4
- package/dist/dialog/FixedDialog.js +5 -4
- package/dist/dialog/FixedDialog.js.map +1 -1
- package/dist/form/MenuItemInputToggle.d.ts +2 -15
- package/dist/form/MenuItemInputToggle.js +26 -37
- package/dist/form/MenuItemInputToggle.js.map +1 -1
- package/dist/form/NativeSelect.d.ts +5 -2
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/Option.js +3 -2
- package/dist/form/Option.js.map +1 -1
- package/dist/form/Select.d.ts +105 -15
- package/dist/form/Select.js +160 -249
- package/dist/form/Select.js.map +1 -1
- package/dist/form/SelectedOption.d.ts +21 -0
- package/dist/form/SelectedOption.js +37 -0
- package/dist/form/SelectedOption.js.map +1 -0
- package/dist/form/TextField.d.ts +2 -2
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/_form.scss +47 -29
- package/dist/form/menuItemInputToggleStyles.d.ts +39 -0
- package/dist/form/menuItemInputToggleStyles.js +31 -0
- package/dist/form/menuItemInputToggleStyles.js.map +1 -0
- package/dist/form/selectUtils.d.ts +1 -3
- package/dist/form/selectUtils.js +2 -10
- package/dist/form/selectUtils.js.map +1 -1
- package/dist/form/types.d.ts +6 -6
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCombobox.d.ts +157 -0
- package/dist/form/useCombobox.js +206 -0
- package/dist/form/useCombobox.js.map +1 -0
- package/dist/form/useEditableCombobox.d.ts +15 -0
- package/dist/form/useEditableCombobox.js +101 -0
- package/dist/form/useEditableCombobox.js.map +1 -0
- package/dist/form/useFormReset.d.ts +16 -0
- package/dist/form/useFormReset.js +32 -0
- package/dist/form/useFormReset.js.map +1 -0
- package/dist/form/useListboxProvider.d.ts +1 -0
- package/dist/form/useListboxProvider.js +1 -0
- package/dist/form/useListboxProvider.js.map +1 -1
- package/dist/form/useSelectCombobox.d.ts +17 -0
- package/dist/form/useSelectCombobox.js +36 -0
- package/dist/form/useSelectCombobox.js.map +1 -0
- package/dist/form/utils.d.ts +11 -1
- package/dist/form/utils.js +6 -0
- package/dist/form/utils.js.map +1 -1
- package/dist/icon/_icon.scss +7 -5
- package/dist/index.d.ts +15 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/interaction/_interaction.scss +56 -44
- package/dist/list/types.d.ts +10 -1
- package/dist/list/types.js.map +1 -1
- package/dist/menu/Menu.js +12 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/_menu.scss +1 -0
- package/dist/menu/useContextMenu.d.ts +3 -3
- package/dist/menu/useContextMenu.js +3 -3
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/movement/types.d.ts +40 -21
- package/dist/movement/types.js.map +1 -1
- package/dist/movement/useKeyboardMovementProvider.js +15 -4
- package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
- package/dist/movement/utils.d.ts +7 -2
- package/dist/movement/utils.js +10 -0
- package/dist/movement/utils.js.map +1 -1
- package/dist/positioning/useFixedPositioning.js +0 -8
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/searching/caseInsensitive.d.ts +150 -0
- package/dist/searching/caseInsensitive.js +30 -0
- package/dist/searching/caseInsensitive.js.map +1 -0
- package/dist/searching/fuzzy.d.ts +128 -0
- package/dist/searching/fuzzy.js +54 -0
- package/dist/searching/fuzzy.js.map +1 -0
- package/dist/searching/toSearchQuery.d.ts +5 -0
- package/dist/searching/toSearchQuery.js +13 -0
- package/dist/searching/toSearchQuery.js.map +1 -0
- package/dist/searching/types.d.ts +28 -0
- package/dist/searching/types.js +5 -0
- package/dist/searching/types.js.map +1 -0
- package/dist/searching/utils.d.ts +21 -0
- package/dist/searching/utils.js +28 -0
- package/dist/searching/utils.js.map +1 -0
- package/dist/test-utils/IntersectionObserver.d.ts +12 -0
- package/dist/test-utils/ResizeObserver.d.ts +172 -0
- package/dist/test-utils/data-testid.d.ts +7 -0
- package/dist/test-utils/data-testid.js +1 -0
- package/dist/test-utils/data-testid.js.map +1 -1
- package/dist/test-utils/drag.d.ts +26 -0
- package/dist/test-utils/index.d.ts +7 -0
- package/dist/test-utils/jest-setup.d.ts +1 -0
- package/dist/test-utils/matchMedia.d.ts +101 -0
- package/dist/test-utils/polyfills/IntersectionObserver.d.ts +1 -0
- package/dist/test-utils/polyfills/ResizeObserver.d.ts +1 -0
- package/dist/test-utils/polyfills/TextDecoder.d.ts +1 -0
- package/dist/test-utils/polyfills/TextDecoder.js +8 -0
- package/dist/test-utils/polyfills/TextDecoder.js.map +1 -0
- package/dist/test-utils/polyfills/TextEncoder.d.ts +1 -0
- package/dist/test-utils/polyfills/TextEncoder.js +6 -0
- package/dist/test-utils/polyfills/TextEncoder.js.map +1 -0
- package/dist/test-utils/polyfills/index.d.ts +7 -0
- package/dist/test-utils/polyfills/index.js +2 -0
- package/dist/test-utils/polyfills/index.js.map +1 -1
- package/dist/test-utils/polyfills/matchMedia.d.ts +1 -0
- package/dist/test-utils/polyfills/offsetParent.d.ts +1 -0
- package/dist/test-utils/polyfills/scrollIntoView.d.ts +1 -0
- package/dist/test-utils/render.d.ts +13 -0
- package/dist/test-utils/timers.d.ts +39 -0
- package/dist/theme/_theme.scss +192 -34
- package/dist/transition/useCollapseTransition.d.ts +3 -18
- package/dist/transition/useCollapseTransition.js +1 -10
- package/dist/transition/useCollapseTransition.js.map +1 -1
- package/dist/transition/utils.js +7 -2
- package/dist/transition/utils.js.map +1 -1
- package/dist/typography/SrOnly.d.ts +3 -3
- package/dist/typography/SrOnly.js +4 -4
- package/dist/typography/SrOnly.js.map +1 -1
- package/dist/typography/Typography.d.ts +19 -19
- package/dist/typography/Typography.js +19 -19
- package/dist/typography/Typography.js.map +1 -1
- package/dist/typography/_typography.scss +65 -25
- package/dist/useEnsuredState.d.ts +1 -1
- package/dist/useEnsuredState.js.map +1 -1
- package/dist/utils/alphaNumericSort.d.ts +1 -1
- package/dist/utils/alphaNumericSort.js +2 -10
- package/dist/utils/alphaNumericSort.js.map +1 -1
- package/jest.config.ts +4 -0
- package/package.json +21 -20
- package/src/RootHtml.tsx +95 -0
- package/src/__tests__/RootHtml.node.tsx +46 -0
- package/src/__tests__/__snapshots__/RootHtml.node.tsx.snap +19 -0
- package/src/_core.scss +49 -43
- package/src/avatar/Avatar.tsx +24 -3
- package/src/avatar/__tests__/Avatar.tsx +1 -1
- package/src/avatar/__tests__/__snapshots__/Avatar.tsx.snap +6 -6
- package/src/badge/_badge.scss +23 -19
- package/src/button/__tests__/__snapshots__/Button.tsx.snap +1 -1
- package/src/dialog/FixedDialog.tsx +5 -4
- package/src/form/MenuItemInputToggle.tsx +46 -64
- package/src/form/NativeSelect.tsx +6 -3
- package/src/form/Option.tsx +8 -2
- package/src/form/Select.tsx +251 -335
- package/src/form/SelectedOption.tsx +55 -0
- package/src/form/TextField.tsx +2 -2
- package/src/form/__tests__/MenuItemCheckbox.tsx +53 -0
- package/src/form/__tests__/MenuItemRadio.tsx +53 -0
- package/src/form/__tests__/Select.tsx +439 -0
- package/src/form/__tests__/__snapshots__/FileInput.tsx.snap +23 -23
- package/src/form/__tests__/__snapshots__/MenuItemCheckbox.tsx.snap +96 -0
- package/src/form/__tests__/__snapshots__/MenuItemRadio.tsx.snap +96 -0
- package/src/form/__tests__/__snapshots__/Select.tsx.snap +492 -0
- package/src/form/__tests__/useFormReset.tsx +195 -0
- package/src/form/_form.scss +47 -29
- package/src/form/menuItemInputToggleStyles.ts +78 -0
- package/src/form/selectUtils.ts +3 -14
- package/src/form/types.ts +6 -6
- package/src/form/useCombobox.ts +523 -0
- package/src/form/useEditableCombobox.ts +139 -0
- package/src/form/useFormReset.ts +48 -0
- package/src/form/useListboxProvider.ts +2 -0
- package/src/form/useSelectCombobox.ts +70 -0
- package/src/form/utils.ts +17 -4
- package/src/icon/_icon.scss +7 -5
- package/src/index.ts +15 -1
- package/src/interaction/_interaction.scss +56 -44
- package/src/list/types.ts +12 -1
- package/src/menu/Menu.tsx +9 -1
- package/src/menu/__tests__/__snapshots__/useContextMenu.tsx.snap +54 -0
- package/src/menu/__tests__/useContextMenu.tsx +41 -0
- package/src/menu/_menu.scss +1 -0
- package/src/menu/useContextMenu.ts +3 -3
- package/src/movement/types.ts +50 -25
- package/src/movement/useKeyboardMovementProvider.ts +21 -8
- package/src/movement/utils.ts +12 -2
- package/src/positioning/__tests__/__snapshots__/useFixedPositioning.tsx.snap +0 -32
- package/src/positioning/__tests__/useFixedPositioning.tsx +0 -14
- package/src/positioning/useFixedPositioning.ts +0 -6
- package/src/searching/__tests__/caseInsensitive.ts +165 -0
- package/src/searching/__tests__/fuzzy.ts +169 -0
- package/src/searching/__tests__/toSearchQuery.ts +21 -0
- package/src/searching/caseInsensitive.ts +200 -0
- package/src/searching/fuzzy.ts +175 -0
- package/src/searching/toSearchQuery.ts +18 -0
- package/src/searching/types.ts +34 -0
- package/src/searching/utils.ts +54 -0
- package/src/test-utils/data-testid.ts +5 -1
- package/src/test-utils/polyfills/TextDecoder.ts +7 -0
- package/src/test-utils/polyfills/TextEncoder.ts +5 -0
- package/src/test-utils/polyfills/index.ts +2 -0
- package/src/theme/_theme.scss +192 -34
- package/src/transition/__tests__/utils.ts +25 -0
- package/src/transition/useCollapseTransition.ts +6 -24
- package/src/transition/utils.ts +10 -5
- package/src/typography/SrOnly.tsx +9 -9
- package/src/typography/Typography.tsx +19 -19
- package/src/typography/__tests__/__snapshots__/SrOnly.tsx.snap +5 -5
- package/src/typography/_typography.scss +65 -25
- package/src/useEnsuredState.ts +1 -1
- package/src/utils/alphaNumericSort.ts +3 -16
- package/tsconfig.json +2 -2
- package/tsconfig.types.json +1 -1
- package/dist/form/SelectValue.d.ts +0 -17
- package/dist/form/SelectValue.js +0 -32
- package/dist/form/SelectValue.js.map +0 -1
- package/dist/utils/filters.d.ts +0 -196
- package/dist/utils/filters.js +0 -67
- package/dist/utils/filters.js.map +0 -1
- package/src/form/SelectValue.tsx +0 -39
- package/src/utils/filters.ts +0 -320
package/dist/theme/_theme.scss
CHANGED
|
@@ -37,6 +37,25 @@ $disable-dark-elevation: $color-scheme == light !default;
|
|
|
37
37
|
$disable-default-system-theme: false !default;
|
|
38
38
|
$disable-default-root-theme: false !default;
|
|
39
39
|
|
|
40
|
+
// this should only be used if your application does not use menu, dialog,
|
|
41
|
+
// sheet, card, expansion-panel, select, app-bar (theme="surface")
|
|
42
|
+
$disable-surface-color: false !default;
|
|
43
|
+
$disable-primary-color: false !default;
|
|
44
|
+
$disable-on-primary-color: $disable-primary-color !default;
|
|
45
|
+
$disable-secondary-color: false !default;
|
|
46
|
+
$disable-on-secondary-color: $disable-secondary-color !default;
|
|
47
|
+
$disable-warning-color: false !default;
|
|
48
|
+
$disable-on-warning-color: $disable-warning-color !default;
|
|
49
|
+
$disable-error-color: false !default;
|
|
50
|
+
$disable-on-error-color: $disable-error-color !default;
|
|
51
|
+
$disable-success-color: false !default;
|
|
52
|
+
$disable-on-success-color: $disable-success-color !default;
|
|
53
|
+
$disable-outline-grey-color: false !default;
|
|
54
|
+
$disable-text-primary-color: false !default;
|
|
55
|
+
$disable-text-secondary-color: false !default;
|
|
56
|
+
$disable-text-hint-color: false !default;
|
|
57
|
+
$disable-text-disabled-color: false !default;
|
|
58
|
+
|
|
40
59
|
$primary-color: colors.$blue-500 !default;
|
|
41
60
|
$on-primary-color: a11y.contrast-color($primary-color) !default;
|
|
42
61
|
$secondary-color: colors.$orange-a-400 !default;
|
|
@@ -152,7 +171,79 @@ $theme-variables: (
|
|
|
152
171
|
outline-grey-color
|
|
153
172
|
);
|
|
154
173
|
|
|
174
|
+
@function _is-var-disabled($name) {
|
|
175
|
+
@if $name == surface-color {
|
|
176
|
+
@return $disable-surface-color;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@if $name == primary-color {
|
|
180
|
+
@return $disable-primary-color;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@if $name == on-primary-color {
|
|
184
|
+
@return $disable-on-primary-color;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
@if $name == secondary-color {
|
|
188
|
+
@return $disable-secondary-color;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@if $name == on-secondary-color {
|
|
192
|
+
@return $disable-on-secondary-color;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@if $name == warning-color {
|
|
196
|
+
@return $disable-warning-color;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@if $name == on-warning-color {
|
|
200
|
+
@return $disable-on-warning-color;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@if $name == error-color {
|
|
204
|
+
@return $disable-error-color;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@if $name == on-error-color {
|
|
208
|
+
@return $disable-on-error-color;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@if $name == success-color {
|
|
212
|
+
@return $disable-success-color;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@if $name == on-success-color {
|
|
216
|
+
@return $disable-on-success-color;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@if $name == text-primary-color {
|
|
220
|
+
@return $disable-text-primary-color;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@if $name == text-secondary-color {
|
|
224
|
+
@return $disable-text-secondary-color;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@if $name == text-hint-color {
|
|
228
|
+
@return $disable-text-hint-color;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
@if $name == text-disabled-color {
|
|
232
|
+
@return $disable-text-disabled-color;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@if $name == outline-grey-color {
|
|
236
|
+
@return $disable-outline-grey-color;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@return false;
|
|
240
|
+
}
|
|
241
|
+
|
|
155
242
|
@function theme-get-var($name, $fallback: null) {
|
|
243
|
+
@if _is-var-disabled($name) {
|
|
244
|
+
@return $fallback;
|
|
245
|
+
}
|
|
246
|
+
|
|
156
247
|
$var: utils.get-var-name($theme-variables, $name, "theme");
|
|
157
248
|
|
|
158
249
|
@if $fallback {
|
|
@@ -175,6 +266,10 @@ $theme-variables: (
|
|
|
175
266
|
}
|
|
176
267
|
|
|
177
268
|
@mixin theme-set-var($name, $value-or-theme-name) {
|
|
269
|
+
@if _is-var-disabled($name) {
|
|
270
|
+
@error '"#{$name}" is currently disabled and cannot be changed. Set "$disable-#{$name}-var" to `true` or remove it from the Sass module overrides.';
|
|
271
|
+
}
|
|
272
|
+
|
|
178
273
|
$var: utils.get-var-name($theme-variables, $name, "theme");
|
|
179
274
|
$value: $value-or-theme-name;
|
|
180
275
|
@if list.index($theme-variables, $value-or-theme-name) {
|
|
@@ -186,6 +281,10 @@ $theme-variables: (
|
|
|
186
281
|
}
|
|
187
282
|
|
|
188
283
|
@mixin theme-use-var($property, $name: $property, $fallback: null) {
|
|
284
|
+
@if _is-var-disabled($name) {
|
|
285
|
+
@error '"#{$name}" is currently disabled and cannot be changed. Set "$disable-#{$name}-var" to `true` or remove it from the Sass module overrides.';
|
|
286
|
+
}
|
|
287
|
+
|
|
189
288
|
#{$property}: theme-get-var($name, $fallback);
|
|
190
289
|
}
|
|
191
290
|
|
|
@@ -203,16 +302,27 @@ $theme-variables: (
|
|
|
203
302
|
|
|
204
303
|
@mixin use-light-theme-colors {
|
|
205
304
|
@include theme-set-var(background-color, $light-theme-background-color);
|
|
206
|
-
@if $disable-dark-elevation {
|
|
305
|
+
@if $disable-dark-elevation and not $disable-surface-color {
|
|
207
306
|
@include theme-set-var(surface-color, $light-theme-surface-color);
|
|
208
307
|
}
|
|
209
|
-
@
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
308
|
+
@if not $disable-text-primary-color {
|
|
309
|
+
@include theme-set-var(text-primary-color, $light-theme-text-primary-color);
|
|
310
|
+
}
|
|
311
|
+
@if not $disable-text-secondary-color {
|
|
312
|
+
@include theme-set-var(
|
|
313
|
+
text-secondary-color,
|
|
314
|
+
$light-theme-text-secondary-color
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
@if not $disable-text-hint-color {
|
|
318
|
+
@include theme-set-var(text-hint-color, $light-theme-text-hint-color);
|
|
319
|
+
}
|
|
320
|
+
@if not $disable-text-disabled-color {
|
|
321
|
+
@include theme-set-var(
|
|
322
|
+
text-disabled-color,
|
|
323
|
+
$light-theme-text-disabled-color
|
|
324
|
+
);
|
|
325
|
+
}
|
|
216
326
|
|
|
217
327
|
@if not $disable-dark-elevation and $color-scheme != light {
|
|
218
328
|
@include use-light-theme-elevation-colors;
|
|
@@ -221,16 +331,27 @@ $theme-variables: (
|
|
|
221
331
|
|
|
222
332
|
@mixin use-dark-theme-colors {
|
|
223
333
|
@include theme-set-var(background-color, $dark-theme-background-color);
|
|
224
|
-
@if $disable-dark-elevation {
|
|
334
|
+
@if $disable-dark-elevation and not $disable-surface-color {
|
|
225
335
|
@include theme-set-var(surface-color, $dark-theme-surface-color);
|
|
226
336
|
}
|
|
227
|
-
@
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
337
|
+
@if not $disable-text-primary-color {
|
|
338
|
+
@include theme-set-var(text-primary-color, $dark-theme-text-primary-color);
|
|
339
|
+
}
|
|
340
|
+
@if not $disable-text-secondary-color {
|
|
341
|
+
@include theme-set-var(
|
|
342
|
+
text-secondary-color,
|
|
343
|
+
$dark-theme-text-secondary-color
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
@if not $disable-text-hint-color {
|
|
347
|
+
@include theme-set-var(text-hint-color, $dark-theme-text-hint-color);
|
|
348
|
+
}
|
|
349
|
+
@if not $disable-text-disabled-color {
|
|
350
|
+
@include theme-set-var(
|
|
351
|
+
text-disabled-color,
|
|
352
|
+
$dark-theme-text-disabled-color
|
|
353
|
+
);
|
|
354
|
+
}
|
|
234
355
|
|
|
235
356
|
@if not $disable-dark-elevation {
|
|
236
357
|
@include use-dark-theme-elevation-colors;
|
|
@@ -239,24 +360,52 @@ $theme-variables: (
|
|
|
239
360
|
|
|
240
361
|
@mixin theme-variables {
|
|
241
362
|
@include theme-set-var(background-color, $background-color);
|
|
242
|
-
@if $disable-dark-elevation {
|
|
363
|
+
@if $disable-dark-elevation and not $disable-surface-color {
|
|
243
364
|
@include theme-set-var(surface-color, $surface-color);
|
|
244
365
|
}
|
|
245
366
|
|
|
246
|
-
@
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
@
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
@
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
@
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
@
|
|
259
|
-
|
|
367
|
+
@if not $disable-primary-color {
|
|
368
|
+
@include theme-set-var(primary-color, $primary-color);
|
|
369
|
+
}
|
|
370
|
+
@if not $disable-on-primary-color {
|
|
371
|
+
@include theme-set-var(on-primary-color, $on-primary-color);
|
|
372
|
+
}
|
|
373
|
+
@if not $disable-secondary-color {
|
|
374
|
+
@include theme-set-var(secondary-color, $secondary-color);
|
|
375
|
+
}
|
|
376
|
+
@if not $disable-on-secondary-color {
|
|
377
|
+
@include theme-set-var(on-secondary-color, $on-secondary-color);
|
|
378
|
+
}
|
|
379
|
+
@if not $disable-warning-color {
|
|
380
|
+
@include theme-set-var(warning-color, $warning-color);
|
|
381
|
+
}
|
|
382
|
+
@if not $disable-on-warning-color {
|
|
383
|
+
@include theme-set-var(on-warning-color, $on-warning-color);
|
|
384
|
+
}
|
|
385
|
+
@if not $disable-error-color {
|
|
386
|
+
@include theme-set-var(error-color, $error-color);
|
|
387
|
+
}
|
|
388
|
+
@if not $disable-on-error-color {
|
|
389
|
+
@include theme-set-var(on-error-color, $on-error-color);
|
|
390
|
+
}
|
|
391
|
+
@if not $disable-success-color {
|
|
392
|
+
@include theme-set-var(success-color, $success-color);
|
|
393
|
+
}
|
|
394
|
+
@if not $disable-on-success-color {
|
|
395
|
+
@include theme-set-var(on-success-color, $on-success-color);
|
|
396
|
+
}
|
|
397
|
+
@if not $disable-text-primary-color {
|
|
398
|
+
@include theme-set-var(text-primary-color, $text-primary-color);
|
|
399
|
+
}
|
|
400
|
+
@if not $disable-text-secondary-color {
|
|
401
|
+
@include theme-set-var(text-secondary-color, $text-secondary-color);
|
|
402
|
+
}
|
|
403
|
+
@if not $disable-text-hint-color {
|
|
404
|
+
@include theme-set-var(text-hint-color, $text-hint-color);
|
|
405
|
+
}
|
|
406
|
+
@if not $disable-text-disabled-color {
|
|
407
|
+
@include theme-set-var(text-disabled-color, $text-disabled-color);
|
|
408
|
+
}
|
|
260
409
|
|
|
261
410
|
@if not $disable-dark-elevation {
|
|
262
411
|
@if $color-scheme == dark {
|
|
@@ -268,7 +417,9 @@ $theme-variables: (
|
|
|
268
417
|
|
|
269
418
|
@include theme-set-var(outline-width, $outline-width);
|
|
270
419
|
@include theme-set-var(outline-color, $outline-color);
|
|
271
|
-
@
|
|
420
|
+
@if not $disable-outline-grey-color {
|
|
421
|
+
@include theme-set-var(outline-grey-color, $outline-grey-color);
|
|
422
|
+
}
|
|
272
423
|
}
|
|
273
424
|
|
|
274
425
|
@mixin create-surface($z-value, $disable-colors: $disable-dark-elevation) {
|
|
@@ -278,7 +429,9 @@ $theme-variables: (
|
|
|
278
429
|
@if not $disable-colors {
|
|
279
430
|
@include theme-set-var(background-color, theme-get-var(surface-color));
|
|
280
431
|
@include theme-use-var(background-color);
|
|
281
|
-
@
|
|
432
|
+
@if not $disable-text-primary-color {
|
|
433
|
+
@include theme-use-var(color, text-primary-color);
|
|
434
|
+
}
|
|
282
435
|
}
|
|
283
436
|
}
|
|
284
437
|
|
|
@@ -351,7 +504,12 @@ $theme-variables: (
|
|
|
351
504
|
}
|
|
352
505
|
|
|
353
506
|
@mixin default-system-theme {
|
|
354
|
-
@if not
|
|
507
|
+
@if not
|
|
508
|
+
$disable-default-system-theme and
|
|
509
|
+
$disable-default-root-theme and
|
|
510
|
+
$color-scheme ==
|
|
511
|
+
system
|
|
512
|
+
{
|
|
355
513
|
@media (prefers-color-scheme: dark) {
|
|
356
514
|
:root {
|
|
357
515
|
@content;
|
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from "react";
|
|
2
2
|
import type { CSSTransitionElementProps, CSSTransitionHookReturnValue, PreconfiguredCSSTransitionOptions, TransitionTimeout, TransitionTimeoutObject } from "./types.js";
|
|
3
|
-
/**
|
|
4
|
-
* @remarks \@since 2.0.0
|
|
5
|
-
*/
|
|
6
|
-
export declare const DEFAULT_COLLAPSE_MIN_HEIGHT = 0;
|
|
7
|
-
/**
|
|
8
|
-
* @remarks \@since 2.0.0
|
|
9
|
-
*/
|
|
10
|
-
export declare const DEFAULT_COLLAPSE_MIN_PADDING_TOP = 0;
|
|
11
|
-
/**
|
|
12
|
-
* @remarks \@since 2.0.0
|
|
13
|
-
*/
|
|
14
|
-
export declare const DEFAULT_COLLAPSE_MIN_PADDING_BOTTOM = 0;
|
|
15
3
|
/**
|
|
16
4
|
* @remarks \@since 2.0.0
|
|
17
5
|
*/
|
|
@@ -32,8 +20,7 @@ export interface CollapseConfigurationStyle {
|
|
|
32
20
|
* are all set to `0` (default), the child will be removed from the DOM while
|
|
33
21
|
* collapsed.
|
|
34
22
|
*
|
|
35
|
-
* @
|
|
36
|
-
* @defaultValue `DEFAULT_COLLAPSE_MIN_HEIGHT`
|
|
23
|
+
* @defaultValue `0`
|
|
37
24
|
*/
|
|
38
25
|
minHeight?: number | string;
|
|
39
26
|
/**
|
|
@@ -45,8 +32,7 @@ export interface CollapseConfigurationStyle {
|
|
|
45
32
|
* are all set to `0` (default), the child will be removed from the DOM while
|
|
46
33
|
* collapsed.
|
|
47
34
|
*
|
|
48
|
-
* @
|
|
49
|
-
* @defaultValue `DEFAULT_COLLAPSE_MIN_PADDING_TOP`
|
|
35
|
+
* @defaultValue `0`
|
|
50
36
|
*/
|
|
51
37
|
minPaddingTop?: number | string;
|
|
52
38
|
/**
|
|
@@ -58,8 +44,7 @@ export interface CollapseConfigurationStyle {
|
|
|
58
44
|
* are all set to `0` (default), the child will be removed from the DOM while
|
|
59
45
|
* collapsed.
|
|
60
46
|
*
|
|
61
|
-
* @
|
|
62
|
-
* @defaultValue `DEFAULT_COLLAPSE_MIN_PADDING_BOTTOM`
|
|
47
|
+
* @defaultValue `0`
|
|
63
48
|
*/
|
|
64
49
|
minPaddingBottom?: number | string;
|
|
65
50
|
}
|
|
@@ -9,15 +9,6 @@ import { getElementSizing, getTransitionTimeout } from "./utils.js";
|
|
|
9
9
|
const noop = ()=>{
|
|
10
10
|
// do nothing
|
|
11
11
|
};
|
|
12
|
-
/**
|
|
13
|
-
* @remarks \@since 2.0.0
|
|
14
|
-
*/ export const DEFAULT_COLLAPSE_MIN_HEIGHT = 0;
|
|
15
|
-
/**
|
|
16
|
-
* @remarks \@since 2.0.0
|
|
17
|
-
*/ export const DEFAULT_COLLAPSE_MIN_PADDING_TOP = 0;
|
|
18
|
-
/**
|
|
19
|
-
* @remarks \@since 2.0.0
|
|
20
|
-
*/ export const DEFAULT_COLLAPSE_MIN_PADDING_BOTTOM = 0;
|
|
21
12
|
/**
|
|
22
13
|
* @remarks \@since 2.0.0
|
|
23
14
|
*/ export const DEFAULT_COLLAPSE_TIMEOUT = {
|
|
@@ -119,7 +110,7 @@ const noop = ()=>{
|
|
|
119
110
|
* transition.
|
|
120
111
|
* @remarks \@since 4.0.0
|
|
121
112
|
*/ export function useCollapseTransition(options) {
|
|
122
|
-
const { nodeRef: propNodeRef, style: propStyle, className, transitionIn, timeout = DEFAULT_COLLAPSE_TIMEOUT, minHeight =
|
|
113
|
+
const { nodeRef: propNodeRef, style: propStyle, className, transitionIn, timeout = DEFAULT_COLLAPSE_TIMEOUT, minHeight = 0, minPaddingTop = 0, minPaddingBottom = 0, temporary = minHeight === 0 && minPaddingTop === 0 && minPaddingBottom === 0, appear = false, enter = true, exit = true, onEnter = noop, onEntering = noop, onEntered = noop, onExit = noop, onExiting = noop, onExited = noop } = options;
|
|
123
114
|
const [nodeRef, refCallback] = useEnsuredRef(propNodeRef);
|
|
124
115
|
const [style, setStyle] = useState(()=>{
|
|
125
116
|
if (transitionIn) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transition/useCollapseTransition.ts"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport type { CSSProperties } from \"react\";\nimport { useState } from \"react\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { DISPLAY_NONE_CLASS } from \"../utils/isElementVisible.js\";\nimport { collapse } from \"./collapseStyles.js\";\nimport type {\n CSSTransitionElementProps,\n CSSTransitionHookReturnValue,\n PreconfiguredCSSTransitionOptions,\n TransitionTimeout,\n TransitionTimeoutObject,\n} from \"./types.js\";\nimport { useTransition } from \"./useTransition.js\";\nimport { getElementSizing, getTransitionTimeout } from \"./utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks \\@since 2.0.0\n */\nexport const DEFAULT_COLLAPSE_MIN_HEIGHT = 0;\n\n/**\n * @remarks \\@since 2.0.0\n */\nexport const DEFAULT_COLLAPSE_MIN_PADDING_TOP = 0;\n\n/**\n * @remarks \\@since 2.0.0\n */\nexport const DEFAULT_COLLAPSE_MIN_PADDING_BOTTOM = 0;\n\n/**\n * @remarks \\@since 2.0.0\n */\nexport const DEFAULT_COLLAPSE_TIMEOUT: Readonly<TransitionTimeoutObject> = {\n enter: 250,\n exit: 200,\n};\n\n/**\n * @remarks \\@since 4.0.0\n */\nexport interface CollapseConfigurationStyle {\n /**\n * The minimum height that the collapsed element can be which defaults to `0`.\n * This can either be a number of pixels or a string CSS height value.\n *\n * Setting this value to any non-zero value will allow for the element to\n * shrink to the defined min-height, and then expand to the full height once\n * no longer collapsed.\n *\n * Note: If the `minHeight`, `minPaddingTop`, and `minPaddingBottom` options\n * are all set to `0` (default), the child will be removed from the DOM while\n * collapsed.\n *\n * @see {@link DEFAULT_COLLAPSE_MIN_HEIGHT}\n * @defaultValue `DEFAULT_COLLAPSE_MIN_HEIGHT`\n */\n minHeight?: number | string;\n\n /**\n * The minimum padding-top that the collapsed element can be which defaults to\n * `0`. This can either be a number of pixels or a string CSS `padding-top`\n * value.\n *\n * Note: If the `minHeight`, `minPaddingTop`, and `minPaddingBottom` options\n * are all set to `0` (default), the child will be removed from the DOM while\n * collapsed.\n *\n * @see {@link DEFAULT_COLLAPSE_MIN_PADDING_TOP}\n * @defaultValue `DEFAULT_COLLAPSE_MIN_PADDING_TOP`\n */\n minPaddingTop?: number | string;\n\n /**\n * The minimum padding-bottom that the collapsed element can be which defaults\n * to `0`. This can either be a number of pixels or a string CSS\n * `padding-bottom` value.\n *\n * Note: If the `minHeight`, `minPaddingTop`, and `minPaddingBottom` options\n * are all set to `0` (default), the child will be removed from the DOM while\n * collapsed.\n *\n * @see {@link DEFAULT_COLLAPSE_MIN_PADDING_BOTTOM}\n * @defaultValue `DEFAULT_COLLAPSE_MIN_PADDING_BOTTOM`\n */\n minPaddingBottom?: number | string;\n}\n\n/**\n * @remarks \\@since 4.0.0\n */\nexport interface CollapseStyle extends CollapseConfigurationStyle {\n /**\n * This will only be set when the {@link TransitionStage} is `\"entering\"` or\n * `\"exiting\"` as `\"${timeout}ms\"`.\n */\n transitionDuration?: string;\n}\n\n/**\n * These props (and `ref`) **must** be passed to a DOM element for the collapse\n * transition to work.\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @remarks \\@since 4.0.0\n */\nexport interface CollapseElementProps<E extends HTMLElement>\n extends CSSTransitionElementProps<E> {\n /**\n * A merged styled object required for the collapse transition to work.\n *\n * @see {@link CollapseStyle}\n * @see {@link CollapseTransitionHookOptions.style}\n */\n style: CSSProperties;\n}\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @remarks \\@since 4.0.0\n */\nexport interface CollapseTransitionHookOptions<E extends HTMLElement>\n extends Omit<PreconfiguredCSSTransitionOptions<E>, \"exitedHidden\">,\n CollapseConfigurationStyle {\n /**\n * An optional style to merge with the required collapse transition styles.\n *\n * If any keys from the {@link CollapseStyle} are included in this object,\n * these styles will override and possibly break the collapse transition.\n */\n style?: CSSProperties;\n\n /**\n *\n * @see {@link DEFAULT_COLLAPSE_TIMEOUT}\n * @defaultValue `DEFAULT_COLLAPSE_TIMEOUT`\n */\n timeout?: TransitionTimeout;\n\n /**\n *\n * @defaultValue `minHeight === 0 && minPaddingTop === 0 && minPaddingBottom === 0`\n */\n temporary?: boolean;\n}\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @remarks \\@since 4.0.0\n */\nexport interface CollapseTransitionHookReturnValue<E extends HTMLElement>\n extends CSSTransitionHookReturnValue<E>,\n CollapseElementProps<E> {\n /**\n * This is just a convenience object so that you don't need to destructure as\n * many variables to pass to an element.\n *\n * @example\n * Simple Usage\n * ```tsx\n * const { elementProps, rendered } = useCollapseTransition({\n * // ...options\n * transitionIn,\n * });\n *\n * if (!rendered) {\n * return null\n * }\n *\n * return <div {...elementProps}>{children}</div>;\n *\n * // This is the long-hand version\n * const { ref, style, className, hidden, rendered } = useCollapseTransition({\n * // ...options\n * transitionIn,\n * });\n *\n * if (!rendered) {\n * return null\n * }\n *\n * return (\n * <div\n * ref={ref}\n * style={style}\n * className={className}\n * hidden={hidden}\n * >\n * {children}\n * </div>\n * );\n * ```\n */\n elementProps: Readonly<CollapseElementProps<E>>;\n}\n\n/**\n * This hook is used to create a transition to collapse and expand an element\n * **inline** with other content like an accordion by animating the\n * `max-height`, `padding-top`, and `padding-bottom` CSS properties. The default\n * behavior is to hide the element completely while collapsed, but providing the\n * `minHeight`, `minPaddingTop`, and `minPaddingBottom` options can make this\n * work like a \"See More\"/\"Preview\" type of element\n *\n * @example\n * Simple Example\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import { Button, Typography, useCollapseTransition } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const [collapsed, setCollapsed] = useState(true);\n * const { elementProps, rendered } =\n * useCollapseTransition({\n * transitionIn: !collapsed,\n * // If the collapsible element should maintain state by not unmounting\n * // while collapsed, uncomment this next line\n * // temporary: false,\n * });\n *\n * return (\n * <>\n * <Button onClick={() => setCollapsed(!collapsed)}>\n * Toggle\n * </Button>\n * {rendered && (\n * <div {...elementProps}>\n * <Typography>Stuff that should be collapsed</Typography>\n * <div>Whatever content...</div>\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @example\n * See More Example\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import { Button, IconRotator, Typography, useCollapseTransition } from \"@react-md/core\";\n * import { KeyboardArrowDownSVGIcon } from \"@react-md/material-icons\";\n *\n * import styles from \"./Example.module.scss\";\n * // pretend styles:\n * //\n * // .container {\n * // padding: 1rem;\n * // position: relative;\n * // }\n * //\n * // .button {\n * // position: absolute;\n * // right: 0;\n * // top: 0;\n * // }\n *\n *\n * function Example(): ReactElement {\n * const [collapsed, setCollapsed] = useState(true);\n * const { elementProps } =\n * useCollapseTransition({\n * transitionIn: !collapsed,\n * minHeight: 120,\n * minPaddingTop: 16,\n * className: styles.container,\n * });\n *\n * return (\n * <div {...elementProps}>\n * <Button\n * aria-expanded={!collapsed}\n * aria-label=\"Expand\"\n * onClick={() => setCollapsed(!collapsed)}\n * buttonType=\"icon\"\n * className={styles.button}\n * >\n * <IconRotator rotated={!collapsed}>\n * <KeyboardArrowDownSVGIcon />\n * </IconRotator>\n * </Button>\n * <SomeComponentWithALotOfContent />\n * </div>\n * );\n * }\n * ```\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @remarks \\@since 4.0.0\n */\nexport function useCollapseTransition<E extends HTMLElement>(\n options: CollapseTransitionHookOptions<E>\n): CollapseTransitionHookReturnValue<E> {\n const {\n nodeRef: propNodeRef,\n style: propStyle,\n className,\n transitionIn,\n timeout = DEFAULT_COLLAPSE_TIMEOUT,\n minHeight = DEFAULT_COLLAPSE_MIN_HEIGHT,\n minPaddingTop = DEFAULT_COLLAPSE_MIN_PADDING_TOP,\n minPaddingBottom = DEFAULT_COLLAPSE_MIN_PADDING_BOTTOM,\n temporary = minHeight === 0 &&\n minPaddingTop === 0 &&\n minPaddingBottom === 0,\n appear = false,\n enter = true,\n exit = true,\n onEnter = noop,\n onEntering = noop,\n onEntered = noop,\n onExit = noop,\n onExiting = noop,\n onExited = noop,\n } = options;\n\n const [nodeRef, refCallback] = useEnsuredRef(propNodeRef);\n const [style, setStyle] = useState<CSSProperties | undefined>(() => {\n if (transitionIn) {\n return undefined;\n }\n\n return {\n maxHeight: minHeight,\n paddingTop: minPaddingTop,\n paddingBottom: minPaddingBottom,\n };\n });\n\n const transitionTimeout = getTransitionTimeout({\n timeout,\n appear,\n enter,\n exit,\n });\n\n const { appearing, rendered, ref, stage, transitionTo, disablePortal } =\n useTransition({\n nodeRef: refCallback,\n timeout,\n transitionIn,\n reflow: true,\n appear,\n enter,\n exit,\n temporary,\n onEnter(appearing) {\n onEnter(appearing);\n setStyle({\n maxHeight: minHeight,\n paddingTop: minPaddingTop,\n paddingBottom: minPaddingBottom,\n });\n },\n onEntering(appearing) {\n onEntering(appearing);\n const { maxHeight, paddingTop, paddingBottom } = getElementSizing(\n nodeRef.current\n );\n\n const duration = appearing\n ? transitionTimeout.appear\n : transitionTimeout.enter;\n\n setStyle({\n maxHeight,\n paddingTop,\n paddingBottom,\n transitionDuration: `${duration}ms`,\n });\n },\n onEntered(appearing) {\n onEntered(appearing);\n setStyle(undefined);\n },\n onExit() {\n onExit();\n const { maxHeight, paddingTop, paddingBottom } = getElementSizing(\n nodeRef.current\n );\n\n setStyle({\n maxHeight,\n paddingTop,\n paddingBottom,\n transitionDuration: `${transitionTimeout.exit}ms`,\n });\n },\n onExiting() {\n onExiting();\n setStyle({\n maxHeight: minHeight,\n paddingTop: minPaddingTop,\n paddingBottom: minPaddingBottom,\n transitionDuration: `${transitionTimeout.exit}ms`,\n });\n },\n onExited() {\n onExited();\n setStyle({\n maxHeight: minHeight,\n paddingTop: minPaddingTop,\n paddingBottom: minPaddingBottom,\n });\n },\n });\n const entering = stage === \"enter\" || stage === \"entering\";\n const exiting = stage === \"exit\" || stage === \"exiting\";\n const collapsible =\n transitionTimeout.enter !== 0 || transitionTimeout.exit !== 0;\n\n const elementProps: CollapseElementProps<E> = {\n ref,\n style: { ...style, ...propStyle },\n className:\n cnb(\n className,\n collapsible &&\n collapse({\n enter: entering,\n leave: exiting,\n disableOverflow: !transitionIn || !!style,\n }),\n stage === \"exited\" &&\n minHeight === 0 &&\n minPaddingTop === 0 &&\n minPaddingBottom === 0 &&\n DISPLAY_NONE_CLASS\n ) || undefined,\n };\n\n return {\n ...elementProps,\n stage,\n rendered,\n appearing,\n elementProps,\n transitionTo,\n disablePortal,\n };\n}\n"],"names":["cnb","useState","useEnsuredRef","DISPLAY_NONE_CLASS","collapse","useTransition","getElementSizing","getTransitionTimeout","noop","DEFAULT_COLLAPSE_MIN_HEIGHT","DEFAULT_COLLAPSE_MIN_PADDING_TOP","DEFAULT_COLLAPSE_MIN_PADDING_BOTTOM","DEFAULT_COLLAPSE_TIMEOUT","enter","exit","useCollapseTransition","options","nodeRef","propNodeRef","style","propStyle","className","transitionIn","timeout","minHeight","minPaddingTop","minPaddingBottom","temporary","appear","onEnter","onEntering","onEntered","onExit","onExiting","onExited","refCallback","setStyle","undefined","maxHeight","paddingTop","paddingBottom","transitionTimeout","appearing","rendered","ref","stage","transitionTo","disablePortal","reflow","current","duration","transitionDuration","entering","exiting","collapsible","elementProps","leave","disableOverflow"],"mappings":"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"}
|
|
1
|
+
{"version":3,"sources":["../../src/transition/useCollapseTransition.ts"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport type { CSSProperties } from \"react\";\nimport { useState } from \"react\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { DISPLAY_NONE_CLASS } from \"../utils/isElementVisible.js\";\nimport { collapse } from \"./collapseStyles.js\";\nimport type {\n CSSTransitionElementProps,\n CSSTransitionHookReturnValue,\n PreconfiguredCSSTransitionOptions,\n TransitionTimeout,\n TransitionTimeoutObject,\n} from \"./types.js\";\nimport { useTransition } from \"./useTransition.js\";\nimport { getElementSizing, getTransitionTimeout } from \"./utils.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks \\@since 2.0.0\n */\nexport const DEFAULT_COLLAPSE_TIMEOUT: Readonly<TransitionTimeoutObject> = {\n enter: 250,\n exit: 200,\n};\n\n/**\n * @remarks \\@since 4.0.0\n */\nexport interface CollapseConfigurationStyle {\n /**\n * The minimum height that the collapsed element can be which defaults to `0`.\n * This can either be a number of pixels or a string CSS height value.\n *\n * Setting this value to any non-zero value will allow for the element to\n * shrink to the defined min-height, and then expand to the full height once\n * no longer collapsed.\n *\n * Note: If the `minHeight`, `minPaddingTop`, and `minPaddingBottom` options\n * are all set to `0` (default), the child will be removed from the DOM while\n * collapsed.\n *\n * @defaultValue `0`\n */\n minHeight?: number | string;\n\n /**\n * The minimum padding-top that the collapsed element can be which defaults to\n * `0`. This can either be a number of pixels or a string CSS `padding-top`\n * value.\n *\n * Note: If the `minHeight`, `minPaddingTop`, and `minPaddingBottom` options\n * are all set to `0` (default), the child will be removed from the DOM while\n * collapsed.\n *\n * @defaultValue `0`\n */\n minPaddingTop?: number | string;\n\n /**\n * The minimum padding-bottom that the collapsed element can be which defaults\n * to `0`. This can either be a number of pixels or a string CSS\n * `padding-bottom` value.\n *\n * Note: If the `minHeight`, `minPaddingTop`, and `minPaddingBottom` options\n * are all set to `0` (default), the child will be removed from the DOM while\n * collapsed.\n *\n * @defaultValue `0`\n */\n minPaddingBottom?: number | string;\n}\n\n/**\n * @remarks \\@since 4.0.0\n */\nexport interface CollapseStyle extends CollapseConfigurationStyle {\n /**\n * This will only be set when the {@link TransitionStage} is `\"entering\"` or\n * `\"exiting\"` as `\"${timeout}ms\"`.\n */\n transitionDuration?: string;\n}\n\n/**\n * These props (and `ref`) **must** be passed to a DOM element for the collapse\n * transition to work.\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @remarks \\@since 4.0.0\n */\nexport interface CollapseElementProps<E extends HTMLElement>\n extends CSSTransitionElementProps<E> {\n /**\n * A merged styled object required for the collapse transition to work.\n *\n * @see {@link CollapseStyle}\n * @see {@link CollapseTransitionHookOptions.style}\n */\n style: CSSProperties;\n}\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @remarks \\@since 4.0.0\n */\nexport interface CollapseTransitionHookOptions<E extends HTMLElement>\n extends Omit<PreconfiguredCSSTransitionOptions<E>, \"exitedHidden\">,\n CollapseConfigurationStyle {\n /**\n * An optional style to merge with the required collapse transition styles.\n *\n * If any keys from the {@link CollapseStyle} are included in this object,\n * these styles will override and possibly break the collapse transition.\n */\n style?: CSSProperties;\n\n /**\n *\n * @see {@link DEFAULT_COLLAPSE_TIMEOUT}\n * @defaultValue `DEFAULT_COLLAPSE_TIMEOUT`\n */\n timeout?: TransitionTimeout;\n\n /**\n *\n * @defaultValue `minHeight === 0 && minPaddingTop === 0 && minPaddingBottom === 0`\n */\n temporary?: boolean;\n}\n\n/**\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @remarks \\@since 4.0.0\n */\nexport interface CollapseTransitionHookReturnValue<E extends HTMLElement>\n extends CSSTransitionHookReturnValue<E>,\n CollapseElementProps<E> {\n /**\n * This is just a convenience object so that you don't need to destructure as\n * many variables to pass to an element.\n *\n * @example\n * Simple Usage\n * ```tsx\n * const { elementProps, rendered } = useCollapseTransition({\n * // ...options\n * transitionIn,\n * });\n *\n * if (!rendered) {\n * return null\n * }\n *\n * return <div {...elementProps}>{children}</div>;\n *\n * // This is the long-hand version\n * const { ref, style, className, hidden, rendered } = useCollapseTransition({\n * // ...options\n * transitionIn,\n * });\n *\n * if (!rendered) {\n * return null\n * }\n *\n * return (\n * <div\n * ref={ref}\n * style={style}\n * className={className}\n * hidden={hidden}\n * >\n * {children}\n * </div>\n * );\n * ```\n */\n elementProps: Readonly<CollapseElementProps<E>>;\n}\n\n/**\n * This hook is used to create a transition to collapse and expand an element\n * **inline** with other content like an accordion by animating the\n * `max-height`, `padding-top`, and `padding-bottom` CSS properties. The default\n * behavior is to hide the element completely while collapsed, but providing the\n * `minHeight`, `minPaddingTop`, and `minPaddingBottom` options can make this\n * work like a \"See More\"/\"Preview\" type of element\n *\n * @example\n * Simple Example\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import { Button, Typography, useCollapseTransition } from \"@react-md/core\";\n *\n * function Example(): ReactElement {\n * const [collapsed, setCollapsed] = useState(true);\n * const { elementProps, rendered } =\n * useCollapseTransition({\n * transitionIn: !collapsed,\n * // If the collapsible element should maintain state by not unmounting\n * // while collapsed, uncomment this next line\n * // temporary: false,\n * });\n *\n * return (\n * <>\n * <Button onClick={() => setCollapsed(!collapsed)}>\n * Toggle\n * </Button>\n * {rendered && (\n * <div {...elementProps}>\n * <Typography>Stuff that should be collapsed</Typography>\n * <div>Whatever content...</div>\n * </div>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @example\n * See More Example\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import { Button, IconRotator, Typography, useCollapseTransition } from \"@react-md/core\";\n * import { KeyboardArrowDownSVGIcon } from \"@react-md/material-icons\";\n *\n * import styles from \"./Example.module.scss\";\n * // pretend styles:\n * //\n * // .container {\n * // padding: 1rem;\n * // position: relative;\n * // }\n * //\n * // .button {\n * // position: absolute;\n * // right: 0;\n * // top: 0;\n * // }\n *\n *\n * function Example(): ReactElement {\n * const [collapsed, setCollapsed] = useState(true);\n * const { elementProps } =\n * useCollapseTransition({\n * transitionIn: !collapsed,\n * minHeight: 120,\n * minPaddingTop: 16,\n * className: styles.container,\n * });\n *\n * return (\n * <div {...elementProps}>\n * <Button\n * aria-expanded={!collapsed}\n * aria-label=\"Expand\"\n * onClick={() => setCollapsed(!collapsed)}\n * buttonType=\"icon\"\n * className={styles.button}\n * >\n * <IconRotator rotated={!collapsed}>\n * <KeyboardArrowDownSVGIcon />\n * </IconRotator>\n * </Button>\n * <SomeComponentWithALotOfContent />\n * </div>\n * );\n * }\n * ```\n *\n * @typeParam E - An HTMLElement type used for the ref required for the\n * transition.\n * @remarks \\@since 4.0.0\n */\nexport function useCollapseTransition<E extends HTMLElement>(\n options: CollapseTransitionHookOptions<E>\n): CollapseTransitionHookReturnValue<E> {\n const {\n nodeRef: propNodeRef,\n style: propStyle,\n className,\n transitionIn,\n timeout = DEFAULT_COLLAPSE_TIMEOUT,\n minHeight = 0,\n minPaddingTop = 0,\n minPaddingBottom = 0,\n temporary = minHeight === 0 &&\n minPaddingTop === 0 &&\n minPaddingBottom === 0,\n appear = false,\n enter = true,\n exit = true,\n onEnter = noop,\n onEntering = noop,\n onEntered = noop,\n onExit = noop,\n onExiting = noop,\n onExited = noop,\n } = options;\n\n const [nodeRef, refCallback] = useEnsuredRef(propNodeRef);\n const [style, setStyle] = useState<CSSProperties | undefined>(() => {\n if (transitionIn) {\n return undefined;\n }\n\n return {\n maxHeight: minHeight,\n paddingTop: minPaddingTop,\n paddingBottom: minPaddingBottom,\n };\n });\n\n const transitionTimeout = getTransitionTimeout({\n timeout,\n appear,\n enter,\n exit,\n });\n\n const { appearing, rendered, ref, stage, transitionTo, disablePortal } =\n useTransition({\n nodeRef: refCallback,\n timeout,\n transitionIn,\n reflow: true,\n appear,\n enter,\n exit,\n temporary,\n onEnter(appearing) {\n onEnter(appearing);\n setStyle({\n maxHeight: minHeight,\n paddingTop: minPaddingTop,\n paddingBottom: minPaddingBottom,\n });\n },\n onEntering(appearing) {\n onEntering(appearing);\n const { maxHeight, paddingTop, paddingBottom } = getElementSizing(\n nodeRef.current\n );\n\n const duration = appearing\n ? transitionTimeout.appear\n : transitionTimeout.enter;\n\n setStyle({\n maxHeight,\n paddingTop,\n paddingBottom,\n transitionDuration: `${duration}ms`,\n });\n },\n onEntered(appearing) {\n onEntered(appearing);\n setStyle(undefined);\n },\n onExit() {\n onExit();\n const { maxHeight, paddingTop, paddingBottom } = getElementSizing(\n nodeRef.current\n );\n\n setStyle({\n maxHeight,\n paddingTop,\n paddingBottom,\n transitionDuration: `${transitionTimeout.exit}ms`,\n });\n },\n onExiting() {\n onExiting();\n setStyle({\n maxHeight: minHeight,\n paddingTop: minPaddingTop,\n paddingBottom: minPaddingBottom,\n transitionDuration: `${transitionTimeout.exit}ms`,\n });\n },\n onExited() {\n onExited();\n setStyle({\n maxHeight: minHeight,\n paddingTop: minPaddingTop,\n paddingBottom: minPaddingBottom,\n });\n },\n });\n const entering = stage === \"enter\" || stage === \"entering\";\n const exiting = stage === \"exit\" || stage === \"exiting\";\n const collapsible =\n transitionTimeout.enter !== 0 || transitionTimeout.exit !== 0;\n\n const elementProps: CollapseElementProps<E> = {\n ref,\n style: { ...style, ...propStyle },\n className:\n cnb(\n className,\n collapsible &&\n collapse({\n enter: entering,\n leave: exiting,\n disableOverflow: !transitionIn || !!style,\n }),\n stage === \"exited\" &&\n minHeight === 0 &&\n minPaddingTop === 0 &&\n minPaddingBottom === 0 &&\n DISPLAY_NONE_CLASS\n ) || undefined,\n };\n\n return {\n ...elementProps,\n stage,\n rendered,\n appearing,\n elementProps,\n transitionTo,\n disablePortal,\n };\n}\n"],"names":["cnb","useState","useEnsuredRef","DISPLAY_NONE_CLASS","collapse","useTransition","getElementSizing","getTransitionTimeout","noop","DEFAULT_COLLAPSE_TIMEOUT","enter","exit","useCollapseTransition","options","nodeRef","propNodeRef","style","propStyle","className","transitionIn","timeout","minHeight","minPaddingTop","minPaddingBottom","temporary","appear","onEnter","onEntering","onEntered","onExit","onExiting","onExited","refCallback","setStyle","undefined","maxHeight","paddingTop","paddingBottom","transitionTimeout","appearing","rendered","ref","stage","transitionTo","disablePortal","reflow","current","duration","transitionDuration","entering","exiting","collapsible","elementProps","leave","disableOverflow"],"mappings":"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"}
|
package/dist/transition/utils.js
CHANGED
|
@@ -41,13 +41,18 @@
|
|
|
41
41
|
container.appendChild(cloned);
|
|
42
42
|
maxHeight = cloned.scrollHeight;
|
|
43
43
|
const style = window.getComputedStyle(cloned);
|
|
44
|
+
const isContentBox = style.boxSizing === "content-box";
|
|
44
45
|
if (style.paddingTop) {
|
|
45
46
|
paddingTop = parseFloat(style.paddingTop);
|
|
46
|
-
|
|
47
|
+
if (isContentBox) {
|
|
48
|
+
maxHeight += paddingTop;
|
|
49
|
+
}
|
|
47
50
|
}
|
|
48
51
|
if (style.paddingBottom) {
|
|
49
52
|
paddingBottom = parseFloat(style.paddingBottom);
|
|
50
|
-
|
|
53
|
+
if (isContentBox) {
|
|
54
|
+
maxHeight += paddingBottom;
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
57
|
container.removeChild(cloned);
|
|
53
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transition/utils.ts"],"sourcesContent":["import type {\n CSSTransitionClassNames,\n CSSTransitionClassNamesObject,\n TransitionActions,\n TransitionTimeout,\n TransitionTimeoutObject,\n} from \"./types.js\";\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport interface TransitionTimeoutOptions extends Required<TransitionActions> {\n timeout: TransitionTimeout;\n}\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport function getTransitionTimeout(\n options: Readonly<TransitionTimeoutOptions>\n): Readonly<Required<TransitionTimeoutObject>> {\n const { timeout, appear, enter, exit } = options;\n if (typeof timeout === \"number\") {\n return {\n appear: appear ? timeout : 0,\n enter: enter ? timeout : 0,\n exit: exit ? timeout : 0,\n };\n }\n\n return {\n appear: (appear && (timeout.appear ?? timeout.enter)) || 0,\n enter: (enter && timeout.enter) || 0,\n exit: (exit && timeout.exit) || 0,\n };\n}\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport interface CollapseSizing {\n maxHeight?: number;\n paddingTop?: number;\n paddingBottom?: number;\n}\n\n/**\n * A small util that will find the max-height, padding-top, and padding-bottom\n * for the provided element. This is really used to be able to transition the\n * max-height value since `max-height: auto` does not transition. The only way\n * to get transition is to change max-height values manually.\n *\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport function getElementSizing(element: HTMLElement | null): CollapseSizing {\n let maxHeight;\n let paddingTop;\n let paddingBottom;\n if (element) {\n // clone the element so that the total height and padding can be calculated\n // without being affected by the collapse transition inline styles\n const cloned = element.cloneNode(true) as HTMLElement;\n cloned.style.maxHeight = \"\";\n cloned.style.padding = \"\";\n cloned.style.paddingLeft = element.style.paddingLeft;\n cloned.style.paddingRight = element.style.paddingRight;\n cloned.style.visibility = \"hidden\";\n\n const container = element.parentElement || document.body;\n container.appendChild(cloned);\n maxHeight = cloned.scrollHeight;\n const style = window.getComputedStyle(cloned);\n if (style.paddingTop) {\n paddingTop = parseFloat(style.paddingTop);\n maxHeight
|
|
1
|
+
{"version":3,"sources":["../../src/transition/utils.ts"],"sourcesContent":["import type {\n CSSTransitionClassNames,\n CSSTransitionClassNamesObject,\n TransitionActions,\n TransitionTimeout,\n TransitionTimeoutObject,\n} from \"./types.js\";\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport interface TransitionTimeoutOptions extends Required<TransitionActions> {\n timeout: TransitionTimeout;\n}\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport function getTransitionTimeout(\n options: Readonly<TransitionTimeoutOptions>\n): Readonly<Required<TransitionTimeoutObject>> {\n const { timeout, appear, enter, exit } = options;\n if (typeof timeout === \"number\") {\n return {\n appear: appear ? timeout : 0,\n enter: enter ? timeout : 0,\n exit: exit ? timeout : 0,\n };\n }\n\n return {\n appear: (appear && (timeout.appear ?? timeout.enter)) || 0,\n enter: (enter && timeout.enter) || 0,\n exit: (exit && timeout.exit) || 0,\n };\n}\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport interface CollapseSizing {\n maxHeight?: number;\n paddingTop?: number;\n paddingBottom?: number;\n}\n\n/**\n * A small util that will find the max-height, padding-top, and padding-bottom\n * for the provided element. This is really used to be able to transition the\n * max-height value since `max-height: auto` does not transition. The only way\n * to get transition is to change max-height values manually.\n *\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport function getElementSizing(element: HTMLElement | null): CollapseSizing {\n let maxHeight: number | undefined;\n let paddingTop: number | undefined;\n let paddingBottom: number | undefined;\n if (element) {\n // clone the element so that the total height and padding can be calculated\n // without being affected by the collapse transition inline styles\n const cloned = element.cloneNode(true) as HTMLElement;\n cloned.style.maxHeight = \"\";\n cloned.style.padding = \"\";\n cloned.style.paddingLeft = element.style.paddingLeft;\n cloned.style.paddingRight = element.style.paddingRight;\n cloned.style.visibility = \"hidden\";\n\n const container = element.parentElement || document.body;\n container.appendChild(cloned);\n maxHeight = cloned.scrollHeight;\n const style = window.getComputedStyle(cloned);\n const isContentBox = style.boxSizing === \"content-box\";\n if (style.paddingTop) {\n paddingTop = parseFloat(style.paddingTop);\n if (isContentBox) {\n maxHeight += paddingTop;\n }\n }\n\n if (style.paddingBottom) {\n paddingBottom = parseFloat(style.paddingBottom);\n if (isContentBox) {\n maxHeight += paddingBottom;\n }\n }\n container.removeChild(cloned);\n }\n\n return { maxHeight, paddingTop, paddingBottom };\n}\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport interface TransitionClassNamesOptions extends TransitionTimeoutOptions {\n classNames: CSSTransitionClassNames;\n}\n\n/**\n * @remarks \\@since 4.0.0\n * @internal\n */\nexport function getTransitionClassNames(\n options: TransitionClassNamesOptions\n): Readonly<Required<CSSTransitionClassNamesObject>> {\n const { classNames, ...timeoutOptions } = options;\n const timeout = getTransitionTimeout(timeoutOptions);\n\n if (typeof classNames === \"string\") {\n const { appear, enter, exit } = timeout;\n return {\n appear: appear ? `${classNames}--appear` : \"\",\n appearActive: appear ? `${classNames}--appear-active` : \"\",\n appearDone: \"\",\n enter: enter ? `${classNames}--enter` : \"\",\n enterActive: enter ? `${classNames}--enter-active` : \"\",\n enterDone: \"\",\n exit: exit ? `${classNames}--exit` : \"\",\n exitActive: exit ? `${classNames}--exit-active` : \"\",\n exitDone: \"\",\n };\n }\n\n const {\n enter = \"\",\n enterActive = \"\",\n enterDone = \"\",\n exit = \"\",\n exitActive = \"\",\n exitDone = \"\",\n appear = (timeout.appear && enter) || \"\",\n appearActive = (timeout.appear && enterActive) || \"\",\n appearDone = (timeout.appear && enterDone) || \"\",\n } = classNames;\n\n return {\n appear,\n appearActive,\n appearDone,\n enter,\n enterActive,\n enterDone,\n exit,\n exitActive,\n exitDone,\n };\n}\n"],"names":["getTransitionTimeout","options","timeout","appear","enter","exit","getElementSizing","element","maxHeight","paddingTop","paddingBottom","cloned","cloneNode","style","padding","paddingLeft","paddingRight","visibility","container","parentElement","document","body","appendChild","scrollHeight","window","getComputedStyle","isContentBox","boxSizing","parseFloat","removeChild","getTransitionClassNames","classNames","timeoutOptions","appearActive","appearDone","enterActive","enterDone","exitActive","exitDone"],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { type CustomTypographyComponent, type TypographyHTMLElement
|
|
3
|
-
export interface SrOnlyProps extends
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
import { type CustomTypographyComponent, type TypographyHTMLElement } from "./Typography.js";
|
|
3
|
+
export interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {
|
|
4
4
|
/** @defaultValue `"span"` */
|
|
5
5
|
as?: CustomTypographyComponent;
|
|
6
6
|
/**
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { Typography } from "./Typography.js";
|
|
4
3
|
import { cssUtils } from "../cssUtils.js";
|
|
5
4
|
/**
|
|
6
5
|
* **Server Component**
|
|
@@ -25,10 +24,11 @@ import { cssUtils } from "../cssUtils.js";
|
|
|
25
24
|
* }
|
|
26
25
|
* ```
|
|
27
26
|
*/ export const SrOnly = /*#__PURE__*/ forwardRef(function SrOnly(props, ref) {
|
|
28
|
-
const { as = "span", className, phoneOnly, focusable, children, tabIndex, ...remaining } = props;
|
|
29
|
-
|
|
27
|
+
const { as: AsComponent = "span", className, phoneOnly, focusable, children, tabIndex, ...remaining } = props;
|
|
28
|
+
// do some type-casting so ref works
|
|
29
|
+
const Component = AsComponent;
|
|
30
|
+
return /*#__PURE__*/ _jsx(Component, {
|
|
30
31
|
...remaining,
|
|
31
|
-
as: as,
|
|
32
32
|
ref: ref,
|
|
33
33
|
tabIndex: tabIndex ?? (focusable ? 0 : undefined),
|
|
34
34
|
className: cssUtils({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/typography/SrOnly.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/typography/SrOnly.tsx"],"sourcesContent":["import { forwardRef, type ElementType, type HTMLAttributes } from \"react\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport {\n type CustomTypographyComponent,\n type TypographyHTMLElement,\n} from \"./Typography.js\";\n\nexport interface SrOnlyProps extends HTMLAttributes<TypographyHTMLElement> {\n /** @defaultValue `\"span\"` */\n as?: CustomTypographyComponent;\n\n /**\n * Set this to `true` if the content should only be screen reader only text on\n * phones. This is useful for only displaying an icon on phones when there is\n * limited space and then displaying an icon and text on larger devices.\n *\n * @defaultValue `false`\n */\n phoneOnly?: boolean;\n\n /**\n * Set this to `true` if the element should be keyboard focusable.\n *\n * @defaultValue `false`\n */\n focusable?: boolean;\n}\n\n/**\n * **Server Component**\n *\n * @example\n * Simple Example\n * ```tsx\n * import { SrOnly } from \"@react-md/core\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <SrOnly>\n * I am only visible to screen readers.\n * </SrOnly>\n * <SrOnly focusable>\n * I am only visible to screen readers but can be focused.\n * </SrOnly>\n * </>\n * );\n * }\n * ```\n */\nexport const SrOnly = forwardRef<TypographyHTMLElement, SrOnlyProps>(\n function SrOnly(props, ref) {\n const {\n as: AsComponent = \"span\",\n className,\n phoneOnly,\n focusable,\n children,\n tabIndex,\n ...remaining\n } = props;\n\n // do some type-casting so ref works\n const Component = AsComponent as ElementType;\n\n return (\n <Component\n {...remaining}\n ref={ref}\n tabIndex={tabIndex ?? (focusable ? 0 : undefined)}\n className={cssUtils({\n srOnly: focusable ? \"focusable\" : phoneOnly ? \"phone\" : true,\n className,\n })}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["forwardRef","cssUtils","SrOnly","props","ref","as","AsComponent","className","phoneOnly","focusable","children","tabIndex","remaining","Component","undefined","srOnly"],"mappings":";AAAA,SAASA,UAAU,QAA+C,QAAQ;AAC1E,SAASC,QAAQ,QAAQ,iBAAiB;AA2B1C;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,MAAMC,uBAASF,WACpB,SAASE,OAAOC,KAAK,EAAEC,GAAG;IACxB,MAAM,EACJC,IAAIC,cAAc,MAAM,EACxBC,SAAS,EACTC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IAEJ,oCAAoC;IACpC,MAAMU,YAAYP;IAElB,qBACE,KAACO;QACE,GAAGD,SAAS;QACbR,KAAKA;QACLO,UAAUA,YAAaF,CAAAA,YAAY,IAAIK,SAAQ;QAC/CP,WAAWN,SAAS;YAClBc,QAAQN,YAAY,cAAcD,YAAY,UAAU;YACxDD;QACF;kBAECG;;AAGP,GACA"}
|
|
@@ -36,24 +36,24 @@ export type NullableTypographyClassNameOptions = Omit<TypographyClassNameOptions
|
|
|
36
36
|
* @example
|
|
37
37
|
* Simple Example
|
|
38
38
|
* ```ts
|
|
39
|
-
* import {
|
|
39
|
+
* import { typography } from "@react-md/core";
|
|
40
40
|
*
|
|
41
41
|
* function Example() {
|
|
42
42
|
* return (
|
|
43
43
|
* <>
|
|
44
|
-
* <h1 className={
|
|
45
|
-
* <h2 className={
|
|
46
|
-
* <h3 className={
|
|
47
|
-
* <h4 className={
|
|
48
|
-
* <h5 className={
|
|
49
|
-
* <h6 className={
|
|
50
|
-
* <h5 className={
|
|
51
|
-
* <h6 className={
|
|
52
|
-
* <p className={
|
|
53
|
-
* <p className={
|
|
54
|
-
* <p className={
|
|
55
|
-
* <caption className={
|
|
56
|
-
* <span className={
|
|
44
|
+
* <h1 className={typography({ type: "headline-1" })} />
|
|
45
|
+
* <h2 className={typography({ type: "headline-2" })} />
|
|
46
|
+
* <h3 className={typography({ type: "headline-3" })} />
|
|
47
|
+
* <h4 className={typography({ type: "headline-4" })} />
|
|
48
|
+
* <h5 className={typography({ type: "headline-5" })} />
|
|
49
|
+
* <h6 className={typography({ type: "headline-6" })} />
|
|
50
|
+
* <h5 className={typography({ type: "subtitle-1" })} />
|
|
51
|
+
* <h6 className={typography({ type: "subtitle-2" })} />
|
|
52
|
+
* <p className={typography()} />
|
|
53
|
+
* <p className={typography({ type "body-1" })} />
|
|
54
|
+
* <p className={typography({ type "body-1" })} />
|
|
55
|
+
* <caption className={typography({ type: "caption" })} />
|
|
56
|
+
* <span className={typography({ type: "overline" })} />
|
|
57
57
|
* </>
|
|
58
58
|
* );
|
|
59
59
|
* }
|
|
@@ -62,14 +62,14 @@ export type NullableTypographyClassNameOptions = Omit<TypographyClassNameOptions
|
|
|
62
62
|
* @example
|
|
63
63
|
* Applying Additional Styles
|
|
64
64
|
* ```ts
|
|
65
|
-
* import {
|
|
65
|
+
* import { typography } from "@react-md/core";
|
|
66
66
|
*
|
|
67
67
|
* function Example() {
|
|
68
68
|
* return (
|
|
69
69
|
* <>
|
|
70
70
|
* <h1
|
|
71
71
|
* // only maintain the default margin-bottom
|
|
72
|
-
* className={
|
|
72
|
+
* className={typography({
|
|
73
73
|
* type: "headline-1",
|
|
74
74
|
* margin: "bottom",
|
|
75
75
|
* })}
|
|
@@ -77,7 +77,7 @@ export type NullableTypographyClassNameOptions = Omit<TypographyClassNameOptions
|
|
|
77
77
|
*
|
|
78
78
|
* <h2
|
|
79
79
|
* // remove all default margin
|
|
80
|
-
* className={
|
|
80
|
+
* className={typography({
|
|
81
81
|
* type: "headline-2",
|
|
82
82
|
* margin: "none",
|
|
83
83
|
* })}
|
|
@@ -85,7 +85,7 @@ export type NullableTypographyClassNameOptions = Omit<TypographyClassNameOptions
|
|
|
85
85
|
*
|
|
86
86
|
* <h3
|
|
87
87
|
* // only maintain the default margin-top
|
|
88
|
-
* className={
|
|
88
|
+
* className={typography({
|
|
89
89
|
* type: "headline-3",
|
|
90
90
|
* margin: "top",
|
|
91
91
|
* })}
|
|
@@ -93,7 +93,7 @@ export type NullableTypographyClassNameOptions = Omit<TypographyClassNameOptions
|
|
|
93
93
|
*
|
|
94
94
|
* <p
|
|
95
95
|
* // center the text, set to bold, and only maintain default margin-bottom
|
|
96
|
-
* className={
|
|
96
|
+
* className={typography({
|
|
97
97
|
* type "subtitle-1",
|
|
98
98
|
* align: "center",
|
|
99
99
|
* margin: "bottom",
|