@react-md/core 6.3.4 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CoreProviders.d.ts +1 -0
- package/dist/CoreProviders.js.map +1 -1
- package/dist/_base.scss +3 -0
- package/dist/_core.scss +1 -0
- package/dist/_utils.scss +15 -7
- package/dist/app-bar/AppBar.js.map +1 -1
- package/dist/app-bar/AppBarTitle.js.map +1 -1
- package/dist/autocomplete/AutocompleteListboxChildren.js.map +1 -1
- package/dist/autocomplete/types.js.map +1 -1
- package/dist/autocomplete/utils.js.map +1 -1
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/button/Button.js.map +1 -1
- package/dist/button/FloatingActionButton.js.map +1 -1
- package/dist/card/Card.js.map +1 -1
- package/dist/card/CardContent.js.map +1 -1
- package/dist/card/ClickableCard.js.map +1 -1
- package/dist/chip/Chip.js.map +1 -1
- package/dist/datetime/NativeDateField.js.map +1 -1
- package/dist/datetime/NativeTimeField.js.map +1 -1
- package/dist/datetime/useDateField.js.map +1 -1
- package/dist/datetime/useTimeField.js.map +1 -1
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/DialogContainer.js.map +1 -1
- package/dist/dialog/DialogContent.js.map +1 -1
- package/dist/dialog/DialogFooter.js.map +1 -1
- package/dist/divider/Divider.js.map +1 -1
- package/dist/draggable/useDraggable.js.map +1 -1
- package/dist/draggable/utils.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
- package/dist/files/FileInput.js.map +1 -1
- package/dist/files/useFileUpload.js.map +1 -1
- package/dist/files/validation.js.map +1 -1
- package/dist/focus/useFocusContainer.js.map +1 -1
- package/dist/form/Fieldset.d.ts +19 -0
- package/dist/form/Fieldset.js +22 -2
- package/dist/form/Fieldset.js.map +1 -1
- package/dist/form/FormMessageContainer.js.map +1 -1
- package/dist/form/FormMessageCounter.js.map +1 -1
- package/dist/form/InputToggle.js.map +1 -1
- package/dist/form/Legend.d.ts +27 -5
- package/dist/form/Legend.js +39 -6
- package/dist/form/Legend.js.map +1 -1
- package/dist/form/Listbox.js.map +1 -1
- package/dist/form/ListboxProvider.js.map +1 -1
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/Password.js.map +1 -1
- package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
- package/dist/form/Select.js.map +1 -1
- package/dist/form/Slider.js.map +1 -1
- package/dist/form/SliderContainer.js.map +1 -1
- package/dist/form/SliderThumb.js.map +1 -1
- package/dist/form/SliderTrack.js.map +1 -1
- package/dist/form/SliderValueMarks.js.map +1 -1
- package/dist/form/Switch.js.map +1 -1
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/TextFieldContainer.js.map +1 -1
- package/dist/form/_fieldset.scss +7 -0
- package/dist/form/_legend.scss +68 -0
- package/dist/form/_text-field.scss +39 -4
- package/dist/form/fieldsetStyles.d.ts +6 -1
- package/dist/form/fieldsetStyles.js +3 -2
- package/dist/form/fieldsetStyles.js.map +1 -1
- package/dist/form/inputToggleStyles.js.map +1 -1
- package/dist/form/labelStyles.d.ts +1 -1
- package/dist/form/labelStyles.js +1 -1
- package/dist/form/labelStyles.js.map +1 -1
- package/dist/form/legendStyles.d.ts +83 -0
- package/dist/form/legendStyles.js +25 -0
- package/dist/form/legendStyles.js.map +1 -0
- package/dist/form/selectUtils.js.map +1 -1
- package/dist/form/textFieldContainerStyles.js.map +1 -1
- package/dist/form/types.d.ts +28 -6
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCheckboxGroup.js.map +1 -1
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useNumberField.js +16 -19
- package/dist/form/useNumberField.js.map +1 -1
- package/dist/form/useRangeSlider.js.map +1 -1
- package/dist/form/useSlider.js.map +1 -1
- package/dist/form/useTextField.js.map +1 -1
- package/dist/hoverMode/useHoverMode.js.map +1 -1
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/IconRotator.js.map +1 -1
- package/dist/icon/MaterialIcon.js.map +1 -1
- package/dist/icon/MaterialSymbol.js.map +1 -1
- package/dist/icon/SVGIcon.js.map +1 -1
- package/dist/icon/config.d.ts +0 -1
- package/dist/icon/config.js +10 -7
- package/dist/icon/config.js.map +1 -1
- package/dist/icon/materialConfig.js.map +1 -1
- package/dist/icon/styles.js.map +1 -1
- package/dist/interaction/UserInteractionModeProvider.js +6 -4
- package/dist/interaction/UserInteractionModeProvider.js.map +1 -1
- package/dist/interaction/types.js.map +1 -1
- package/dist/interaction/useElementInteraction.js.map +1 -1
- package/dist/layout/LayoutAppBar.d.ts +6 -6
- package/dist/layout/LayoutAppBar.js +6 -6
- package/dist/layout/LayoutAppBar.js.map +1 -1
- package/dist/layout/LayoutNav.js.map +1 -1
- package/dist/layout/LayoutWindowSplitter.js.map +1 -1
- package/dist/layout/Main.js.map +1 -1
- package/dist/layout/useExpandableLayout.js +43 -0
- package/dist/layout/useExpandableLayout.js.map +1 -1
- package/dist/layout/useHorizontalLayoutTransition.js.map +1 -1
- package/dist/layout/useLayoutTree.js.map +1 -1
- package/dist/layout/useLayoutWindowSplitter.js.map +1 -1
- package/dist/layout/useResizableLayout.js.map +1 -1
- package/dist/link/Link.js.map +1 -1
- package/dist/link/SkipToMainContent.js +19 -21
- package/dist/link/SkipToMainContent.js.map +1 -1
- package/dist/list/List.js.map +1 -1
- package/dist/list/ListItem.js.map +1 -1
- package/dist/list/ListItemAddon.js.map +1 -1
- package/dist/list/ListItemLink.js.map +1 -1
- package/dist/list/ListSubheader.js.map +1 -1
- package/dist/list/getListItemHeight.js.map +1 -1
- package/dist/list/listItemStyles.js.map +1 -1
- package/dist/list/types.js.map +1 -1
- package/dist/media-queries/AppSizeProvider.d.ts +2 -0
- package/dist/media-queries/AppSizeProvider.js +3 -2
- package/dist/media-queries/AppSizeProvider.js.map +1 -1
- package/dist/media-queries/appSize.d.ts +3 -0
- package/dist/media-queries/appSize.js +3 -1
- package/dist/media-queries/appSize.js.map +1 -1
- package/dist/media-queries/config.d.ts +11 -0
- package/dist/media-queries/config.js +26 -0
- package/dist/media-queries/config.js.map +1 -0
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuItemButton.js.map +1 -1
- package/dist/menu/MenuItemFileInput.js.map +1 -1
- package/dist/menu/MenuItemInputToggle.js.map +1 -1
- package/dist/menu/MenuItemSeparator.js.map +1 -1
- package/dist/menu/MenuVisibilityProvider.js.map +1 -1
- package/dist/menu/MenuWidget.js.map +1 -1
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/movement/types.d.ts +28 -3
- package/dist/movement/types.js.map +1 -1
- package/dist/movement/useKeyboardMovementProvider.js +96 -47
- package/dist/movement/useKeyboardMovementProvider.js.map +1 -1
- package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
- package/dist/navigation/NavItem.js.map +1 -1
- package/dist/navigation/NavItemButton.js.map +1 -1
- package/dist/navigation/NavItemLink.js.map +1 -1
- package/dist/navigation/getTableOfContentsHeadings.js.map +1 -1
- package/dist/navigation/types.js.map +1 -1
- package/dist/overlay/Overlay.js.map +1 -1
- package/dist/positioning/createHorizontalPosition.js.map +1 -1
- package/dist/positioning/createVerticalPosition.js.map +1 -1
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/progress/CircularProgress.js.map +1 -1
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/progress/linearProgressStyles.js.map +1 -1
- package/dist/responsive-item/ResponsiveItem.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
- package/dist/searching/caseInsensitive.js.map +1 -1
- package/dist/segmented-button/SegmentedButton.js.map +1 -1
- package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
- package/dist/segmented-button/segmentedButtonStyles.js.map +1 -1
- package/dist/sheet/Sheet.js.map +1 -1
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/spinbutton/SpinButton.d.ts +16 -0
- package/dist/spinbutton/SpinButton.js +55 -0
- package/dist/spinbutton/SpinButton.js.map +1 -0
- package/dist/spinbutton/SpinButtonGroupProvider.d.ts +17 -0
- package/dist/spinbutton/SpinButtonGroupProvider.js +19 -0
- package/dist/spinbutton/SpinButtonGroupProvider.js.map +1 -0
- package/dist/spinbutton/defaults.d.ts +9 -0
- package/dist/spinbutton/defaults.js +25 -0
- package/dist/spinbutton/defaults.js.map +1 -0
- package/dist/spinbutton/types.d.ts +324 -0
- package/dist/spinbutton/types.js +5 -0
- package/dist/spinbutton/types.js.map +1 -0
- package/dist/spinbutton/useSpinButton.d.ts +5 -0
- package/dist/spinbutton/useSpinButton.js +260 -0
- package/dist/spinbutton/useSpinButton.js.map +1 -0
- package/dist/spinbutton/useSpinButtonGroupProvider.d.ts +27 -0
- package/dist/spinbutton/useSpinButtonGroupProvider.js +49 -0
- package/dist/spinbutton/useSpinButtonGroupProvider.js.map +1 -0
- package/dist/spinbutton/utils/deselectNode.d.ts +5 -0
- package/dist/spinbutton/utils/deselectNode.js +17 -0
- package/dist/spinbutton/utils/deselectNode.js.map +1 -0
- package/dist/spinbutton/utils/resolveInputEvent.d.ts +30 -0
- package/dist/spinbutton/utils/resolveInputEvent.js +53 -0
- package/dist/spinbutton/utils/resolveInputEvent.js.map +1 -0
- package/dist/spinbutton/utils/selectNode.d.ts +5 -0
- package/dist/spinbutton/utils/selectNode.js +15 -0
- package/dist/spinbutton/utils/selectNode.js.map +1 -0
- package/dist/table/StickyTableSection.js.map +1 -1
- package/dist/table/Table.js.map +1 -1
- package/dist/table/TableBody.js.map +1 -1
- package/dist/table/TableCellContent.js.map +1 -1
- package/dist/table/TableCheckbox.js.map +1 -1
- package/dist/table/TableFooter.js.map +1 -1
- package/dist/table/TableHeader.js.map +1 -1
- package/dist/table/TableRadio.js.map +1 -1
- package/dist/table/TableRow.js.map +1 -1
- package/dist/table/useStickyTableSection.js.map +1 -1
- package/dist/tabs/SimpleTabPanel.js.map +1 -1
- package/dist/tabs/SimpleTabPanels.js.map +1 -1
- package/dist/tabs/Tab.js.map +1 -1
- package/dist/tabs/TabList.js.map +1 -1
- package/dist/tabs/TabListScrollButton.js.map +1 -1
- package/dist/tabs/useMaxTabPanelHeight.js.map +1 -1
- package/dist/test-utils/data-testid.js.map +1 -1
- package/dist/test-utils/mocks/match-media.js +5 -5
- package/dist/test-utils/mocks/match-media.js.map +1 -1
- package/dist/test-utils/vitest/timers.d.ts +1 -1
- package/dist/test-utils/vitest/timers.js +1 -1
- package/dist/test-utils/vitest/timers.js.map +1 -1
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/transition/CSSTransition.js.map +1 -1
- package/dist/transition/Collapse.js.map +1 -1
- package/dist/transition/CrossFade.js.map +1 -1
- package/dist/transition/ScaleTransition.js.map +1 -1
- package/dist/transition/SkeletonPlaceholder.js.map +1 -1
- package/dist/transition/Slide.js.map +1 -1
- package/dist/transition/SlideContainer.js.map +1 -1
- package/dist/transition/types.js.map +1 -1
- package/dist/transition/useCollapseTransition.js.map +1 -1
- package/dist/transition/useCrossFadeTransition.js.map +1 -1
- package/dist/transition/useMaxWidthTransition.js.map +1 -1
- package/dist/transition/useScaleTransition.js.map +1 -1
- package/dist/transition/useSkeletonPlaceholder.js.map +1 -1
- package/dist/tree/Tree.js.map +1 -1
- package/dist/tree/TreeItem.js.map +1 -1
- package/dist/tree/TreeProvider.js.map +1 -1
- package/dist/tree/styles.js.map +1 -1
- package/dist/tree/types.js.map +1 -1
- package/dist/tree/useTreeMovement.js.map +1 -1
- package/dist/typography/HighlightTextMark.js.map +1 -1
- package/dist/typography/Mark.js.map +1 -1
- package/dist/typography/TextContainer.js.map +1 -1
- package/dist/typography/Typography.js.map +1 -1
- package/dist/typography/_typography.scss +0 -1
- package/dist/useElementSize.js.map +1 -1
- package/dist/useIntersectionObserver.js.map +1 -1
- package/dist/useMutationObserver.js.map +1 -1
- package/dist/useWindowSize.js.map +1 -1
- package/dist/utils/getNumberOfDigits.d.ts +7 -0
- package/dist/utils/getNumberOfDigits.js +11 -0
- package/dist/utils/getNumberOfDigits.js.map +1 -0
- package/dist/utils/nearest.js +2 -1
- package/dist/utils/nearest.js.map +1 -1
- package/dist/utils/useDevEffect.d.ts +7 -0
- package/dist/utils/useDevEffect.js +8 -0
- package/dist/utils/useDevEffect.js.map +1 -0
- package/dist/window-splitter/WindowSplitter.js +3 -2
- package/dist/window-splitter/WindowSplitter.js.map +1 -1
- package/dist/window-splitter/_window-splitter.scss +60 -12
- package/dist/window-splitter/styles.d.ts +9 -0
- package/dist/window-splitter/styles.js +3 -2
- package/dist/window-splitter/styles.js.map +1 -1
- package/dist/window-splitter/useWindowSplitter.js.map +1 -1
- package/package.json +37 -29
- package/src/CoreProviders.tsx +1 -0
- package/src/app-bar/AppBar.tsx +1 -2
- package/src/app-bar/AppBarTitle.tsx +1 -2
- package/src/autocomplete/AutocompleteListboxChildren.tsx +3 -1
- package/src/autocomplete/types.ts +24 -19
- package/src/autocomplete/utils.ts +9 -6
- package/src/avatar/Avatar.tsx +2 -1
- package/src/button/Button.tsx +2 -1
- package/src/button/FloatingActionButton.tsx +2 -1
- package/src/card/Card.tsx +2 -1
- package/src/card/CardContent.tsx +1 -2
- package/src/card/ClickableCard.tsx +1 -2
- package/src/chip/Chip.tsx +2 -1
- package/src/datetime/NativeDateField.tsx +2 -1
- package/src/datetime/NativeTimeField.tsx +2 -1
- package/src/datetime/useDateField.ts +13 -8
- package/src/datetime/useTimeField.ts +13 -8
- package/src/dialog/Dialog.tsx +2 -1
- package/src/dialog/DialogContainer.tsx +1 -2
- package/src/dialog/DialogContent.tsx +1 -2
- package/src/dialog/DialogFooter.tsx +1 -2
- package/src/divider/Divider.tsx +1 -2
- package/src/draggable/useDraggable.ts +4 -4
- package/src/draggable/utils.ts +4 -2
- package/src/expansion-panel/ExpansionPanelHeader.tsx +1 -2
- package/src/files/FileInput.tsx +2 -1
- package/src/files/useFileUpload.ts +6 -6
- package/src/files/validation.ts +1 -2
- package/src/focus/useFocusContainer.ts +4 -4
- package/src/form/Fieldset.tsx +25 -3
- package/src/form/FormMessageContainer.tsx +1 -2
- package/src/form/FormMessageCounter.tsx +1 -2
- package/src/form/InputToggle.tsx +3 -3
- package/src/form/Legend.tsx +55 -10
- package/src/form/Listbox.tsx +1 -2
- package/src/form/ListboxProvider.ts +3 -2
- package/src/form/NativeSelect.tsx +2 -1
- package/src/form/Password.tsx +4 -2
- package/src/form/ResizingTextAreaWrapper.tsx +1 -2
- package/src/form/Select.tsx +2 -1
- package/src/form/Slider.tsx +2 -1
- package/src/form/SliderContainer.tsx +1 -2
- package/src/form/SliderThumb.tsx +6 -3
- package/src/form/SliderTrack.tsx +2 -1
- package/src/form/SliderValueMarks.tsx +1 -2
- package/src/form/Switch.tsx +2 -1
- package/src/form/TextArea.tsx +1 -2
- package/src/form/TextField.tsx +2 -1
- package/src/form/TextFieldContainer.tsx +1 -2
- package/src/form/fieldsetStyles.ts +18 -3
- package/src/form/inputToggleStyles.ts +4 -2
- package/src/form/labelStyles.ts +1 -1
- package/src/form/legendStyles.ts +132 -0
- package/src/form/selectUtils.ts +3 -2
- package/src/form/textFieldContainerStyles.ts +1 -2
- package/src/form/types.ts +35 -17
- package/src/form/useCheckboxGroup.ts +3 -2
- package/src/form/useCombobox.ts +8 -3
- package/src/form/useNumberField.ts +36 -35
- package/src/form/useRangeSlider.ts +1 -2
- package/src/form/useSlider.ts +1 -2
- package/src/form/useTextField.ts +8 -3
- package/src/hoverMode/useHoverMode.ts +4 -8
- package/src/icon/FontIcon.tsx +1 -2
- package/src/icon/IconRotator.tsx +1 -2
- package/src/icon/MaterialIcon.tsx +2 -1
- package/src/icon/MaterialSymbol.tsx +2 -1
- package/src/icon/SVGIcon.tsx +1 -2
- package/src/icon/config.tsx +10 -7
- package/src/icon/materialConfig.ts +1 -2
- package/src/icon/styles.ts +1 -2
- package/src/interaction/UserInteractionModeProvider.tsx +9 -4
- package/src/interaction/types.ts +1 -2
- package/src/interaction/useElementInteraction.tsx +3 -2
- package/src/layout/LayoutAppBar.tsx +6 -6
- package/src/layout/LayoutNav.tsx +2 -1
- package/src/layout/LayoutWindowSplitter.tsx +2 -1
- package/src/layout/Main.tsx +1 -2
- package/src/layout/useExpandableLayout.ts +63 -5
- package/src/layout/useHorizontalLayoutTransition.ts +1 -2
- package/src/layout/useLayoutTree.ts +2 -2
- package/src/layout/useLayoutWindowSplitter.ts +6 -6
- package/src/layout/useResizableLayout.ts +3 -6
- package/src/link/Link.tsx +1 -2
- package/src/link/SkipToMainContent.tsx +20 -23
- package/src/list/List.tsx +1 -2
- package/src/list/ListItem.tsx +2 -1
- package/src/list/ListItemAddon.tsx +2 -1
- package/src/list/ListItemLink.tsx +2 -1
- package/src/list/ListSubheader.tsx +1 -2
- package/src/list/getListItemHeight.ts +8 -9
- package/src/list/listItemStyles.ts +1 -2
- package/src/list/types.ts +1 -2
- package/src/media-queries/AppSizeProvider.tsx +8 -10
- package/src/media-queries/appSize.ts +3 -0
- package/src/media-queries/config.ts +41 -0
- package/src/menu/DropdownMenu.tsx +4 -5
- package/src/menu/Menu.tsx +2 -1
- package/src/menu/MenuItemButton.tsx +1 -2
- package/src/menu/MenuItemFileInput.tsx +2 -1
- package/src/menu/MenuItemInputToggle.tsx +3 -3
- package/src/menu/MenuItemSeparator.tsx +2 -1
- package/src/menu/MenuVisibilityProvider.tsx +4 -2
- package/src/menu/MenuWidget.tsx +1 -2
- package/src/menu/useContextMenu.ts +4 -2
- package/src/movement/types.ts +52 -13
- package/src/movement/useKeyboardMovementProvider.ts +77 -38
- package/src/navigation/CollapsibleNavGroup.tsx +1 -2
- package/src/navigation/NavItem.tsx +1 -2
- package/src/navigation/NavItemButton.tsx +2 -1
- package/src/navigation/NavItemLink.tsx +2 -1
- package/src/navigation/getTableOfContentsHeadings.ts +1 -2
- package/src/navigation/types.ts +1 -2
- package/src/overlay/Overlay.tsx +2 -1
- package/src/positioning/createHorizontalPosition.ts +10 -12
- package/src/positioning/createVerticalPosition.ts +10 -11
- package/src/positioning/useFixedPositioning.ts +6 -3
- package/src/progress/CircularProgress.tsx +2 -1
- package/src/progress/LinearProgress.tsx +2 -1
- package/src/progress/linearProgressStyles.ts +1 -2
- package/src/responsive-item/ResponsiveItem.tsx +1 -2
- package/src/responsive-item/ResponsiveItemOverlay.tsx +2 -1
- package/src/searching/caseInsensitive.ts +2 -4
- package/src/segmented-button/SegmentedButton.tsx +2 -1
- package/src/segmented-button/SegmentedButtonContainer.tsx +2 -1
- package/src/segmented-button/segmentedButtonStyles.ts +1 -2
- package/src/sheet/Sheet.tsx +1 -2
- package/src/snackbar/Toast.tsx +2 -1
- package/src/spinbutton/SpinButton.tsx +98 -0
- package/src/spinbutton/SpinButtonGroupProvider.tsx +32 -0
- package/src/spinbutton/defaults.ts +45 -0
- package/src/spinbutton/types.ts +413 -0
- package/src/spinbutton/useSpinButton.ts +311 -0
- package/src/spinbutton/useSpinButtonGroupProvider.ts +104 -0
- package/src/spinbutton/utils/deselectNode.ts +17 -0
- package/src/spinbutton/utils/resolveInputEvent.ts +112 -0
- package/src/spinbutton/utils/selectNode.ts +15 -0
- package/src/table/StickyTableSection.tsx +2 -1
- package/src/table/Table.tsx +1 -2
- package/src/table/TableBody.tsx +2 -1
- package/src/table/TableCellContent.tsx +1 -2
- package/src/table/TableCheckbox.tsx +1 -2
- package/src/table/TableFooter.tsx +1 -2
- package/src/table/TableHeader.tsx +1 -2
- package/src/table/TableRadio.tsx +1 -2
- package/src/table/TableRow.tsx +1 -2
- package/src/table/useStickyTableSection.tsx +1 -2
- package/src/tabs/SimpleTabPanel.tsx +2 -1
- package/src/tabs/SimpleTabPanels.tsx +2 -1
- package/src/tabs/Tab.tsx +3 -6
- package/src/tabs/TabList.tsx +2 -1
- package/src/tabs/TabListScrollButton.tsx +1 -2
- package/src/tabs/useMaxTabPanelHeight.ts +7 -4
- package/src/test-utils/data-testid.ts +1 -2
- package/src/test-utils/mocks/match-media.ts +5 -10
- package/src/test-utils/vitest/timers.ts +1 -1
- package/src/tooltip/Tooltip.tsx +2 -1
- package/src/tooltip/TooltipHoverModeProvider.tsx +1 -2
- package/src/tooltip/useTooltip.ts +9 -5
- package/src/transition/CSSTransition.tsx +2 -1
- package/src/transition/Collapse.tsx +4 -2
- package/src/transition/CrossFade.tsx +2 -1
- package/src/transition/ScaleTransition.tsx +2 -1
- package/src/transition/SkeletonPlaceholder.tsx +1 -2
- package/src/transition/Slide.tsx +2 -1
- package/src/transition/SlideContainer.tsx +1 -2
- package/src/transition/types.ts +15 -16
- package/src/transition/useCollapseTransition.ts +6 -5
- package/src/transition/useCrossFadeTransition.ts +3 -2
- package/src/transition/useMaxWidthTransition.ts +1 -2
- package/src/transition/useScaleTransition.ts +3 -2
- package/src/transition/useSkeletonPlaceholder.ts +1 -2
- package/src/tree/Tree.tsx +2 -1
- package/src/tree/TreeItem.tsx +2 -1
- package/src/tree/TreeProvider.tsx +4 -4
- package/src/tree/styles.ts +1 -2
- package/src/tree/types.ts +1 -2
- package/src/tree/useTreeMovement.ts +1 -2
- package/src/typography/HighlightTextMark.tsx +1 -2
- package/src/typography/Mark.tsx +1 -2
- package/src/typography/TextContainer.tsx +1 -2
- package/src/typography/Typography.tsx +1 -2
- package/src/useElementSize.ts +7 -4
- package/src/useIntersectionObserver.ts +3 -2
- package/src/useMutationObserver.ts +3 -2
- package/src/useWindowSize.ts +4 -2
- package/src/utils/getNumberOfDigits.ts +18 -0
- package/src/utils/nearest.ts +2 -1
- package/src/utils/useDevEffect.ts +9 -0
- package/src/window-splitter/WindowSplitter.tsx +5 -2
- package/src/window-splitter/styles.ts +13 -2
- package/src/window-splitter/useWindowSplitter.ts +3 -1
package/src/form/useTextField.ts
CHANGED
|
@@ -125,7 +125,8 @@ export interface TextFieldHookState {
|
|
|
125
125
|
* @since 2.5.0
|
|
126
126
|
*/
|
|
127
127
|
export interface ProvidedFormMessageProps
|
|
128
|
-
extends
|
|
128
|
+
extends
|
|
129
|
+
Pick<FormMessageProps, "id" | "theme" | "children">,
|
|
129
130
|
Required<Pick<TextFieldProps, "error">>,
|
|
130
131
|
Partial<Pick<FormMessageInputLengthCounterProps, "length" | "maxLength">> {}
|
|
131
132
|
|
|
@@ -137,7 +138,9 @@ export interface ProvidedFormMessageProps
|
|
|
137
138
|
*/
|
|
138
139
|
export interface ProvidedTextFieldProps<
|
|
139
140
|
E extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement,
|
|
140
|
-
>
|
|
141
|
+
>
|
|
142
|
+
extends
|
|
143
|
+
TextFieldValidationOptions,
|
|
141
144
|
Required<TextFieldChangeHandlers<E>>,
|
|
142
145
|
Required<Pick<TextFieldProps, "id" | "name" | "value" | "error">>,
|
|
143
146
|
Pick<TextFieldProps, "aria-describedby" | "rightAddon"> {
|
|
@@ -288,7 +291,9 @@ export interface TextFieldHookComponentOptions<
|
|
|
288
291
|
/** @since 2.5.6 */
|
|
289
292
|
export interface TextFieldHookOptions<
|
|
290
293
|
E extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement,
|
|
291
|
-
>
|
|
294
|
+
>
|
|
295
|
+
extends
|
|
296
|
+
TextFieldValidationOptions,
|
|
292
297
|
TextFieldHookComponentOptions<E>,
|
|
293
298
|
TextFieldChangeHandlers<E> {
|
|
294
299
|
/**
|
|
@@ -36,8 +36,7 @@ export interface HoverModeConfigurationOptions extends SimpleHoverModeContext {
|
|
|
36
36
|
/**
|
|
37
37
|
* @since 6.0.0
|
|
38
38
|
*/
|
|
39
|
-
export interface ControlledHoverModeOptions
|
|
40
|
-
extends HoverModeConfigurationOptions {
|
|
39
|
+
export interface ControlledHoverModeOptions extends HoverModeConfigurationOptions {
|
|
41
40
|
setVisible: UseStateSetter<boolean>;
|
|
42
41
|
}
|
|
43
42
|
|
|
@@ -53,16 +52,14 @@ export interface ControlledHoverModeImplementation {
|
|
|
53
52
|
/**
|
|
54
53
|
* @since 6.0.0
|
|
55
54
|
*/
|
|
56
|
-
export interface UncontrolledHoverModeOptions
|
|
57
|
-
extends HoverModeConfigurationOptions {
|
|
55
|
+
export interface UncontrolledHoverModeOptions extends HoverModeConfigurationOptions {
|
|
58
56
|
defaultVisible?: UseStateInitializer<boolean>;
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
/**
|
|
62
60
|
* @since 6.0.0
|
|
63
61
|
*/
|
|
64
|
-
export interface UncontrolledHoverModeImplementation
|
|
65
|
-
extends ControlledHoverModeImplementation {
|
|
62
|
+
export interface UncontrolledHoverModeImplementation extends ControlledHoverModeImplementation {
|
|
66
63
|
visible: boolean;
|
|
67
64
|
setVisible: UseStateSetter<boolean>;
|
|
68
65
|
}
|
|
@@ -70,8 +67,7 @@ export interface UncontrolledHoverModeImplementation
|
|
|
70
67
|
/**
|
|
71
68
|
* @since 6.0.0
|
|
72
69
|
*/
|
|
73
|
-
export interface HoverModeImplementation
|
|
74
|
-
extends ControlledHoverModeImplementation {
|
|
70
|
+
export interface HoverModeImplementation extends ControlledHoverModeImplementation {
|
|
75
71
|
visible?: boolean;
|
|
76
72
|
setVisible?: UseStateSetter<boolean>;
|
|
77
73
|
}
|
package/src/icon/FontIcon.tsx
CHANGED
|
@@ -12,8 +12,7 @@ import { type FontIconClassNameOptions, icon } from "./styles.js";
|
|
|
12
12
|
* `inline` and `theme` props.
|
|
13
13
|
*/
|
|
14
14
|
export interface FontIconProps
|
|
15
|
-
extends HTMLAttributes<HTMLSpanElement>,
|
|
16
|
-
FontIconClassNameOptions {
|
|
15
|
+
extends HTMLAttributes<HTMLSpanElement>, FontIconClassNameOptions {
|
|
17
16
|
/** @defaultValue `true` */
|
|
18
17
|
"aria-hidden"?: AriaAttributes["aria-hidden"];
|
|
19
18
|
|
package/src/icon/IconRotator.tsx
CHANGED
|
@@ -15,8 +15,7 @@ import { type IconRotatorClassNameOptions, iconRotator } from "./styles.js";
|
|
|
15
15
|
* @since 6.0.0 Removed `animate` prop and added `disableTransition`
|
|
16
16
|
*/
|
|
17
17
|
export interface IconRotatorBaseProps
|
|
18
|
-
extends HTMLAttributes<HTMLSpanElement>,
|
|
19
|
-
IconRotatorClassNameOptions {
|
|
18
|
+
extends HTMLAttributes<HTMLSpanElement>, IconRotatorClassNameOptions {
|
|
20
19
|
/**
|
|
21
20
|
* An optional style to apply to the surrounding span when the `forceIconWrap`
|
|
22
21
|
* prop is enabled or the children is not a single react element.
|
|
@@ -6,7 +6,8 @@ import { type MaterialIconClassNameOptions, icon } from "./styles.js";
|
|
|
6
6
|
|
|
7
7
|
/** @since 6.0.0 */
|
|
8
8
|
export interface MaterialIconProps
|
|
9
|
-
extends
|
|
9
|
+
extends
|
|
10
|
+
HTMLAttributes<HTMLSpanElement>,
|
|
10
11
|
Partial<MaterialIconClassNameOptions> {
|
|
11
12
|
/**
|
|
12
13
|
* The icon name to use
|
|
@@ -24,7 +24,8 @@ declare module "react" {
|
|
|
24
24
|
* @since 6.0.0
|
|
25
25
|
*/
|
|
26
26
|
export interface MaterialSymbolProps
|
|
27
|
-
extends
|
|
27
|
+
extends
|
|
28
|
+
HTMLAttributes<HTMLSpanElement>,
|
|
28
29
|
MaterialSymbolCustomization,
|
|
29
30
|
Partial<MaterialSymbolClassNameOptions> {
|
|
30
31
|
/** @defaultValue `true` */
|
package/src/icon/SVGIcon.tsx
CHANGED
|
@@ -6,8 +6,7 @@ import { type SVGIconClassNameOptions, icon } from "./styles.js";
|
|
|
6
6
|
* @since 6.0.0 Added the `inline` and `theme` props.
|
|
7
7
|
*/
|
|
8
8
|
export interface SVGIconProps
|
|
9
|
-
extends HTMLAttributes<SVGSVGElement>,
|
|
10
|
-
SVGIconClassNameOptions {
|
|
9
|
+
extends HTMLAttributes<SVGSVGElement>, SVGIconClassNameOptions {
|
|
11
10
|
/**
|
|
12
11
|
* Boolean if the SVG should gain the `focusable` attribute. This is disabled
|
|
13
12
|
* by default since IE11 and Edge actually default this to true and keyboard's
|
package/src/icon/config.tsx
CHANGED
|
@@ -213,7 +213,6 @@ export type ConfigurableIconName = keyof ConfigurableIcons;
|
|
|
213
213
|
* ICON_CONFIG.upload = <FileUploadIcon />;
|
|
214
214
|
* ```
|
|
215
215
|
*
|
|
216
|
-
*
|
|
217
216
|
* @since 6.0.0
|
|
218
217
|
*/
|
|
219
218
|
export const ICON_CONFIG: ConfiguredIcons = {
|
|
@@ -289,13 +288,17 @@ export const ICON_CONFIG: ConfiguredIcons = {
|
|
|
289
288
|
* @since 6.0.0
|
|
290
289
|
*/
|
|
291
290
|
export function configureIcons(overrides: ConfiguredIcons): void {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
291
|
+
if (process.env.NODE_ENV !== "production") {
|
|
292
|
+
Object.entries(overrides).forEach(([name, value]) => {
|
|
293
|
+
if (!(name in ICON_CONFIG)) {
|
|
294
|
+
throw new Error(`${name} is an invalid react-md icon name.`);
|
|
295
|
+
}
|
|
296
296
|
|
|
297
|
-
|
|
298
|
-
|
|
297
|
+
ICON_CONFIG[name as keyof ConfiguredIcons] = value;
|
|
298
|
+
});
|
|
299
|
+
} else {
|
|
300
|
+
Object.assign(ICON_CONFIG, overrides);
|
|
301
|
+
}
|
|
299
302
|
}
|
|
300
303
|
|
|
301
304
|
/**
|
|
@@ -152,8 +152,7 @@ export type MaterialSymbolConfiguration = Required<MaterialSymbolCustomization>;
|
|
|
152
152
|
* @since 6.0.0
|
|
153
153
|
*/
|
|
154
154
|
export interface MaterialConfiguration
|
|
155
|
-
extends MaterialIconConfiguration,
|
|
156
|
-
MaterialSymbolConfiguration {}
|
|
155
|
+
extends MaterialIconConfiguration, MaterialSymbolConfiguration {}
|
|
157
156
|
|
|
158
157
|
/**
|
|
159
158
|
* @since 6.0.0
|
package/src/icon/styles.ts
CHANGED
|
@@ -87,8 +87,7 @@ export interface MaterialIconClassNameOptions extends SVGIconClassNameOptions {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/** @since 6.0.0 */
|
|
90
|
-
export interface MaterialSymbolClassNameOptions
|
|
91
|
-
extends SVGIconClassNameOptions {
|
|
90
|
+
export interface MaterialSymbolClassNameOptions extends SVGIconClassNameOptions {
|
|
92
91
|
family: MaterialSymbolFamily;
|
|
93
92
|
}
|
|
94
93
|
|
|
@@ -43,6 +43,8 @@ export function useUserInteractionMode(): UserInteractionMode {
|
|
|
43
43
|
/** @internal */
|
|
44
44
|
const TOUCH_TIMEOUT = 1200;
|
|
45
45
|
|
|
46
|
+
const DATE_NOW = (): number => Date.now();
|
|
47
|
+
|
|
46
48
|
export interface UserInteractionModeProviderProps {
|
|
47
49
|
children: ReactNode;
|
|
48
50
|
}
|
|
@@ -84,7 +86,10 @@ export interface UserInteractionModeProviderProps {
|
|
|
84
86
|
export function UserInteractionModeProvider(
|
|
85
87
|
props: UserInteractionModeProviderProps
|
|
86
88
|
): ReactElement {
|
|
87
|
-
const { children } =
|
|
89
|
+
const { children, now = DATE_NOW } =
|
|
90
|
+
props as UserInteractionModeProviderProps & {
|
|
91
|
+
now?: () => number;
|
|
92
|
+
};
|
|
88
93
|
const { __root } = useContext(context);
|
|
89
94
|
if (__root) {
|
|
90
95
|
throw new Error(
|
|
@@ -145,7 +150,7 @@ export function UserInteractionModeProvider(
|
|
|
145
150
|
};
|
|
146
151
|
|
|
147
152
|
const handleTouchStart = (): void => {
|
|
148
|
-
lastTouchTime.current =
|
|
153
|
+
lastTouchTime.current = now();
|
|
149
154
|
isTouchContextMenu.current = false;
|
|
150
155
|
setMode("touch");
|
|
151
156
|
};
|
|
@@ -153,7 +158,7 @@ export function UserInteractionModeProvider(
|
|
|
153
158
|
const handleMouseMove = (): void => {
|
|
154
159
|
if (
|
|
155
160
|
isTouchContextMenu.current ||
|
|
156
|
-
|
|
161
|
+
now() - lastTouchTime.current < TOUCH_TIMEOUT
|
|
157
162
|
) {
|
|
158
163
|
isTouchContextMenu.current = false;
|
|
159
164
|
return;
|
|
@@ -189,7 +194,7 @@ export function UserInteractionModeProvider(
|
|
|
189
194
|
window.removeEventListener("contextmenu", handleContextMenu, true);
|
|
190
195
|
}
|
|
191
196
|
};
|
|
192
|
-
}, [mode]);
|
|
197
|
+
}, [mode, now]);
|
|
193
198
|
|
|
194
199
|
const value = useMemo<UserInteractionModeContext>(
|
|
195
200
|
() => ({
|
package/src/interaction/types.ts
CHANGED
|
@@ -187,8 +187,7 @@ export interface RippleTransitionCallbacks {
|
|
|
187
187
|
* @since 6.0.0
|
|
188
188
|
* @internal
|
|
189
189
|
*/
|
|
190
|
-
export interface ProvidedRippleContainerProps
|
|
191
|
-
extends RippleTransitionCallbacks {
|
|
190
|
+
export interface ProvidedRippleContainerProps extends RippleTransitionCallbacks {
|
|
192
191
|
ripples: RippleStateList;
|
|
193
192
|
}
|
|
194
193
|
|
|
@@ -34,8 +34,9 @@ declare module "react" {
|
|
|
34
34
|
export const PRESSED_CLASS_NAME = "rmd-pressed";
|
|
35
35
|
|
|
36
36
|
/** @since 6.0.0 */
|
|
37
|
-
export interface ElementInteractionOptions<
|
|
38
|
-
extends
|
|
37
|
+
export interface ElementInteractionOptions<
|
|
38
|
+
E extends HTMLElement,
|
|
39
|
+
> extends Partial<ElementInteractionHandlers<E>> {
|
|
39
40
|
/**
|
|
40
41
|
* This can be used to override the {@link INTERACTION_CONFIG.mode}
|
|
41
42
|
*
|
|
@@ -42,21 +42,21 @@ export interface LayoutAppBarProps extends AppBarProps {
|
|
|
42
42
|
*
|
|
43
43
|
* @example Static Height
|
|
44
44
|
* ```scss
|
|
45
|
-
* @use "everything"
|
|
45
|
+
* @use "everything" as *;
|
|
46
46
|
*
|
|
47
47
|
* :root {
|
|
48
|
-
* @include
|
|
48
|
+
* @include layout-set-var(header-height, $app-bar-height);
|
|
49
49
|
* }
|
|
50
50
|
* ```
|
|
51
51
|
*
|
|
52
52
|
* @example Media Query Height Changes
|
|
53
53
|
* ```scss
|
|
54
|
-
* @use "everything"
|
|
54
|
+
* @use "everything" as *;
|
|
55
55
|
*
|
|
56
56
|
* :root {
|
|
57
|
-
* @include
|
|
58
|
-
* @include
|
|
59
|
-
* @include
|
|
57
|
+
* @include layout-set-var(header-height, $app-bar-height);
|
|
58
|
+
* @include tablet-media {
|
|
59
|
+
* @include layout-set-var(header-height, $app-bar-dense-height);
|
|
60
60
|
* }
|
|
61
61
|
* }
|
|
62
62
|
* ```
|
package/src/layout/LayoutNav.tsx
CHANGED
|
@@ -22,7 +22,8 @@ import { layoutNav } from "./layoutNavStyles.js";
|
|
|
22
22
|
* @since 6.0.0
|
|
23
23
|
*/
|
|
24
24
|
export interface LayoutNavProps
|
|
25
|
-
extends
|
|
25
|
+
extends
|
|
26
|
+
HTMLAttributes<HTMLDivElement>,
|
|
26
27
|
BaseSheetClassNameOptions,
|
|
27
28
|
TransitionCallbacks,
|
|
28
29
|
TransitionActions {
|
|
@@ -18,7 +18,8 @@ import {
|
|
|
18
18
|
* @since 6.0.0
|
|
19
19
|
*/
|
|
20
20
|
export interface LayoutWindowSplitterProps
|
|
21
|
-
extends
|
|
21
|
+
extends
|
|
22
|
+
WindowSplitterWidgetProps<HTMLButtonElement>,
|
|
22
23
|
Omit<
|
|
23
24
|
BaseWindowSplitterProps,
|
|
24
25
|
keyof WindowSplitterWidgetProps<HTMLButtonElement>
|
package/src/layout/Main.tsx
CHANGED
|
@@ -27,8 +27,7 @@ export type CustomMainElement = ElementType<
|
|
|
27
27
|
* @since 6.0.0
|
|
28
28
|
*/
|
|
29
29
|
export interface MainProps
|
|
30
|
-
extends HTMLAttributes<HTMLElement>,
|
|
31
|
-
MainClassNameOptions {
|
|
30
|
+
extends HTMLAttributes<HTMLElement>, MainClassNameOptions {
|
|
32
31
|
/**
|
|
33
32
|
* @defaultValue `"main"`
|
|
34
33
|
*/
|
|
@@ -6,10 +6,12 @@ import { useSsr } from "../SsrProvider.js";
|
|
|
6
6
|
import { useAppSize } from "../media-queries/AppSizeProvider.js";
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
8
|
import { type AppSize } from "../media-queries/appSize.js";
|
|
9
|
+
import { MEDIA_QUERY_CONFIG } from "../media-queries/config.js";
|
|
9
10
|
import { useMediaQuery } from "../media-queries/useMediaQuery.js";
|
|
10
11
|
import { type CSSTransitionElementProps } from "../transition/types.js";
|
|
11
12
|
import { type CssPosition, type UseStateInitializer } from "../types.js";
|
|
12
13
|
import { useToggle } from "../useToggle.js";
|
|
14
|
+
import { useDevEffect } from "../utils/useDevEffect.js";
|
|
13
15
|
import { type LayoutNavProps } from "./LayoutNav.js";
|
|
14
16
|
import {
|
|
15
17
|
type HorizontalLayoutTransitionOptions,
|
|
@@ -26,6 +28,8 @@ import {
|
|
|
26
28
|
useTemporaryLayout,
|
|
27
29
|
} from "./useTemporaryLayout.js";
|
|
28
30
|
|
|
31
|
+
let loggedOnce = false;
|
|
32
|
+
|
|
29
33
|
/**
|
|
30
34
|
* @since 6.0.0
|
|
31
35
|
*/
|
|
@@ -78,7 +82,8 @@ export interface ExpandableLayoutOptions extends TemporaryLayoutOptions {
|
|
|
78
82
|
* @since 6.0.0
|
|
79
83
|
*/
|
|
80
84
|
export interface ProvidedLayoutMainProps
|
|
81
|
-
extends
|
|
85
|
+
extends
|
|
86
|
+
ProvidedTemporaryLayoutMainProps,
|
|
82
87
|
CSSTransitionElementProps<HTMLElement> {}
|
|
83
88
|
|
|
84
89
|
/**
|
|
@@ -98,16 +103,14 @@ export type ProvidedLayoutAppBarProps = ProvidedTemporaryLayoutAppBarProps &
|
|
|
98
103
|
/**
|
|
99
104
|
* @since 6.0.0
|
|
100
105
|
*/
|
|
101
|
-
export interface ProvidedExpandableLayoutNavToggleProps
|
|
102
|
-
extends ProvidedLayoutNavToggleProps {
|
|
106
|
+
export interface ProvidedExpandableLayoutNavToggleProps extends ProvidedLayoutNavToggleProps {
|
|
103
107
|
className: string;
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
/**
|
|
107
111
|
* @since 6.0.0
|
|
108
112
|
*/
|
|
109
|
-
export interface ExpandableLayoutImplementation
|
|
110
|
-
extends TemporaryLayoutImplementation {
|
|
113
|
+
export interface ExpandableLayoutImplementation extends TemporaryLayoutImplementation {
|
|
111
114
|
temporary: boolean;
|
|
112
115
|
persistent: boolean;
|
|
113
116
|
expanded: boolean;
|
|
@@ -264,6 +267,61 @@ export function useExpandableLayout(
|
|
|
264
267
|
? isPhone || (temporaryUntil === "desktop" && !isDesktop)
|
|
265
268
|
: !matches;
|
|
266
269
|
|
|
270
|
+
useDevEffect(() => {
|
|
271
|
+
if (process.env.NODE_ENV === "test") {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
let query: string;
|
|
276
|
+
if (temporaryUntil === "tablet" || temporaryUntil === "desktop") {
|
|
277
|
+
const minWidth =
|
|
278
|
+
temporaryUntil === "tablet"
|
|
279
|
+
? MEDIA_QUERY_CONFIG.tabletMinWidth
|
|
280
|
+
: MEDIA_QUERY_CONFIG.desktopMinWidth;
|
|
281
|
+
query = `screen and (min-width: ${minWidth})`;
|
|
282
|
+
} else {
|
|
283
|
+
query = temporaryUntil;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const timeout = window.setTimeout(() => {
|
|
287
|
+
let found = false;
|
|
288
|
+
for (let i = 0; i < document.styleSheets.length; i++) {
|
|
289
|
+
const sheet = document.styleSheets[i];
|
|
290
|
+
|
|
291
|
+
try {
|
|
292
|
+
const rules = sheet.cssRules;
|
|
293
|
+
for (let j = 0; j < rules.length; j++) {
|
|
294
|
+
const rule = rules[j];
|
|
295
|
+
if (
|
|
296
|
+
rule.cssText.includes(".rmd-layout") &&
|
|
297
|
+
rule.cssText.includes(`@media ${query}`)
|
|
298
|
+
) {
|
|
299
|
+
found = true;
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
} catch {
|
|
304
|
+
//
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (!found && !loggedOnce) {
|
|
309
|
+
loggedOnce = true;
|
|
310
|
+
// eslint-disable-next-line no-console
|
|
311
|
+
console.error(
|
|
312
|
+
`The react-md expandable layout has set \`temporaryUntil: "${temporaryUntil}"\` but the corresponding styles have not been found.` +
|
|
313
|
+
" This usually means the `$layout-navigation-breakpoint` or `temporaryUntil` value should be updated match.\n\n" +
|
|
314
|
+
"See https://react-md.dev/getting-started/layout#updating-the-layout-to-be-temporary-until-a-specific-breakpoint-optional " +
|
|
315
|
+
"for more information."
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
}, 3000);
|
|
319
|
+
|
|
320
|
+
return () => {
|
|
321
|
+
window.clearTimeout(timeout);
|
|
322
|
+
};
|
|
323
|
+
}, [temporaryUntil]);
|
|
324
|
+
|
|
267
325
|
return {
|
|
268
326
|
visible,
|
|
269
327
|
temporary,
|
|
@@ -25,8 +25,7 @@ export const DEFAULT_HORIZONTAL_LAYOUT_TRANSITION_CLASSNAMES = {
|
|
|
25
25
|
/**
|
|
26
26
|
* @since 6.0.0
|
|
27
27
|
*/
|
|
28
|
-
export interface HorizontalLayoutTransitionOptions
|
|
29
|
-
extends PreconfiguredCSSTransitionOptions<HTMLElement> {
|
|
28
|
+
export interface HorizontalLayoutTransitionOptions extends PreconfiguredCSSTransitionOptions<HTMLElement> {
|
|
30
29
|
/**
|
|
31
30
|
* @see {@link DEFAULT_SHEET_TIMEOUT}
|
|
32
31
|
* @defaultValue `DEFAULT_SHEET_TIMEOUT`
|
|
@@ -87,8 +87,8 @@ export interface LayoutTreeOptions<
|
|
|
87
87
|
*/
|
|
88
88
|
export interface LayoutTreeImplementation<
|
|
89
89
|
T extends TreeItemNode = DefaultTreeItemNode,
|
|
90
|
-
>
|
|
91
|
-
|
|
90
|
+
>
|
|
91
|
+
extends Pick<TreeProps<T>, "data">, TreeImplementation {}
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
94
|
* Before considering to use a `Tree` for site navigation, it is important to
|
|
@@ -13,8 +13,10 @@ import {
|
|
|
13
13
|
/**
|
|
14
14
|
* @since 6.0.0
|
|
15
15
|
*/
|
|
16
|
-
export interface LayoutWindowSplitterOptions
|
|
17
|
-
|
|
16
|
+
export interface LayoutWindowSplitterOptions extends Omit<
|
|
17
|
+
WindowSplitterOptions,
|
|
18
|
+
"min" | "max"
|
|
19
|
+
> {
|
|
18
20
|
/**
|
|
19
21
|
* @see {@link WindowSplitterOptions.min}
|
|
20
22
|
* @defaultValue `96`
|
|
@@ -51,8 +53,7 @@ export interface LayoutWindowSplitterOptions
|
|
|
51
53
|
/**
|
|
52
54
|
* @since 6.0.0
|
|
53
55
|
*/
|
|
54
|
-
export interface ProvidedLayoutWindowSplitterProps
|
|
55
|
-
extends WindowSplitterWidgetProps<HTMLButtonElement> {
|
|
56
|
+
export interface ProvidedLayoutWindowSplitterProps extends WindowSplitterWidgetProps<HTMLButtonElement> {
|
|
56
57
|
/** @defaultValue {@link WindowSplitterImplementation.value} */
|
|
57
58
|
navWidth: number;
|
|
58
59
|
}
|
|
@@ -60,8 +61,7 @@ export interface ProvidedLayoutWindowSplitterProps
|
|
|
60
61
|
/**
|
|
61
62
|
* @since 6.0.0
|
|
62
63
|
*/
|
|
63
|
-
export interface LayoutWindowSplitterImplementation
|
|
64
|
-
extends WindowSplitterImplementation {
|
|
64
|
+
export interface LayoutWindowSplitterImplementation extends WindowSplitterImplementation {
|
|
65
65
|
splitterProps: ProvidedLayoutWindowSplitterProps;
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -16,8 +16,7 @@ import {
|
|
|
16
16
|
* @since 6.0.0
|
|
17
17
|
*/
|
|
18
18
|
export interface ResizableLayoutOptions
|
|
19
|
-
extends ExpandableLayoutOptions,
|
|
20
|
-
LayoutWindowSplitterOptions {
|
|
19
|
+
extends ExpandableLayoutOptions, LayoutWindowSplitterOptions {
|
|
21
20
|
/**
|
|
22
21
|
* This id will be used as the `aria-controls` prop for the
|
|
23
22
|
* `LayoutWindowSplitter` and should be applied to the `LayoutNav` as an `id`.
|
|
@@ -30,16 +29,14 @@ export interface ResizableLayoutOptions
|
|
|
30
29
|
/**
|
|
31
30
|
* @since 6.0.0
|
|
32
31
|
*/
|
|
33
|
-
export interface ProvidedResizableLayoutNavProps
|
|
34
|
-
extends ProvidedLayoutNavProps {
|
|
32
|
+
export interface ProvidedResizableLayoutNavProps extends ProvidedLayoutNavProps {
|
|
35
33
|
id: string;
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
/**
|
|
39
37
|
* @since 6.0.0
|
|
40
38
|
*/
|
|
41
|
-
export interface ResizableLayoutImplementation
|
|
42
|
-
extends ExpandableLayoutImplementation {
|
|
39
|
+
export interface ResizableLayoutImplementation extends ExpandableLayoutImplementation {
|
|
43
40
|
expandableNavProps: ProvidedResizableLayoutNavProps;
|
|
44
41
|
windowSplitterProps: LayoutWindowSplitterProps;
|
|
45
42
|
}
|
package/src/link/Link.tsx
CHANGED
|
@@ -23,8 +23,7 @@ export type CustomLinkComponent =
|
|
|
23
23
|
* @since 6.0.0 Renamed `flexCentered` to `flex`.
|
|
24
24
|
*/
|
|
25
25
|
export interface LinkProps
|
|
26
|
-
extends AnchorHTMLAttributes<HTMLAnchorElement>,
|
|
27
|
-
LinkClassNameOptions {
|
|
26
|
+
extends AnchorHTMLAttributes<HTMLAnchorElement>, LinkClassNameOptions {
|
|
28
27
|
/**
|
|
29
28
|
* All links **must** have a valid href.
|
|
30
29
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { type ReactNode, forwardRef,
|
|
3
|
+
import { type ReactNode, forwardRef, useRef } from "react";
|
|
4
4
|
|
|
5
|
+
import { useDevEffect } from "../utils/useDevEffect.js";
|
|
5
6
|
import { Link, type LinkProps } from "./Link.js";
|
|
6
7
|
import {
|
|
7
8
|
type SkipToMainContentClassNameOptions,
|
|
@@ -21,8 +22,7 @@ const getMainElement = (mainId: string): HTMLElement | null =>
|
|
|
21
22
|
* @since 6.0.0 The `mainId` is optional
|
|
22
23
|
*/
|
|
23
24
|
export interface SkipToMainContentProps
|
|
24
|
-
extends Omit<LinkProps, "href">,
|
|
25
|
-
SkipToMainContentClassNameOptions {
|
|
25
|
+
extends Omit<LinkProps, "href">, SkipToMainContentClassNameOptions {
|
|
26
26
|
/**
|
|
27
27
|
* @since 6.0.0 Changed default value from `"skip-to-main-content"`
|
|
28
28
|
* @defaultValue `"skip-to-main"`
|
|
@@ -95,30 +95,27 @@ export const SkipToMainContent = forwardRef<
|
|
|
95
95
|
// want to warn the developer about missing main element in development
|
|
96
96
|
// immediately to help prevent errors, but in production this can be lazy
|
|
97
97
|
// initialized only once a keyboard user focuses and clicks this element
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
useEffect(() => {
|
|
101
|
-
mainNodeRef.current = getMainElement(mainId);
|
|
98
|
+
useDevEffect(() => {
|
|
99
|
+
mainNodeRef.current = getMainElement(mainId);
|
|
102
100
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
if (!mainNodeRef.current) {
|
|
102
|
+
const foundMainId = document.querySelector('main,[role="main"]')?.id;
|
|
103
|
+
let message = `Unable to find a main element to focus`;
|
|
104
|
+
if (mainId) {
|
|
105
|
+
message += ` with an id of "${mainId}"`;
|
|
108
106
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
107
|
+
if (foundMainId) {
|
|
108
|
+
message += ` but a main element was found with an id of "${foundMainId}".`;
|
|
112
109
|
}
|
|
113
|
-
if (!foundMainId) {
|
|
114
|
-
message +=
|
|
115
|
-
'. There should be at least one <main> element or an element with role="main" on the page for accessibility.';
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
throw new Error(message);
|
|
119
110
|
}
|
|
120
|
-
|
|
121
|
-
|
|
111
|
+
if (!foundMainId) {
|
|
112
|
+
message +=
|
|
113
|
+
'. There should be at least one <main> element or an element with role="main" on the page for accessibility.';
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
throw new Error(message);
|
|
117
|
+
}
|
|
118
|
+
}, [mainId]);
|
|
122
119
|
|
|
123
120
|
return (
|
|
124
121
|
<Link
|
package/src/list/List.tsx
CHANGED
|
@@ -8,8 +8,7 @@ export type ListElement = HTMLUListElement | HTMLOListElement;
|
|
|
8
8
|
* @since 6.3.1 Extends the ListClassNameOptions
|
|
9
9
|
*/
|
|
10
10
|
export interface ListProps
|
|
11
|
-
extends HTMLAttributes<ListElement>,
|
|
12
|
-
ListClassNameOptions {
|
|
11
|
+
extends HTMLAttributes<ListElement>, ListClassNameOptions {
|
|
13
12
|
/**
|
|
14
13
|
* @defaultValue `"none"`
|
|
15
14
|
*/
|
package/src/list/ListItem.tsx
CHANGED
|
@@ -19,7 +19,8 @@ import { type ListItemChildrenProps } from "./types.js";
|
|
|
19
19
|
* @since 6.3.1 Extends the BaseListItemClassNameOptions
|
|
20
20
|
*/
|
|
21
21
|
export interface ListItemProps
|
|
22
|
-
extends
|
|
22
|
+
extends
|
|
23
|
+
HTMLAttributes<HTMLLIElement>,
|
|
23
24
|
ListItemChildrenProps,
|
|
24
25
|
BaseListItemClassNameOptions,
|
|
25
26
|
ComponentWithRippleProps {
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
} from "./listItemStyles.js";
|
|
11
11
|
|
|
12
12
|
export interface ListItemAddonProps
|
|
13
|
-
extends
|
|
13
|
+
extends
|
|
14
|
+
Omit<TextIconSpacingProps, "icon" | "iconAfter" | "forceIconWrap">,
|
|
14
15
|
ListItemAddonClassNameOptions {
|
|
15
16
|
/**
|
|
16
17
|
* The addon that should be rendered.
|
|
@@ -17,7 +17,8 @@ import { type ListItemClassNameOptions, listItem } from "./listItemStyles.js";
|
|
|
17
17
|
import { type ListItemChildrenProps } from "./types.js";
|
|
18
18
|
|
|
19
19
|
export interface ListItemLinkProps
|
|
20
|
-
extends
|
|
20
|
+
extends
|
|
21
|
+
AnchorHTMLAttributes<HTMLAnchorElement>,
|
|
21
22
|
ListItemClassNameOptions,
|
|
22
23
|
ListItemChildrenProps,
|
|
23
24
|
ComponentWithRippleProps {
|
|
@@ -35,8 +35,7 @@ export function listSubheader(
|
|
|
35
35
|
* @since 6.0.0 The `role` prop defaults to `"presentation"`
|
|
36
36
|
*/
|
|
37
37
|
export interface ListSubheaderProps
|
|
38
|
-
extends HTMLAttributes<HTMLLIElement>,
|
|
39
|
-
ListSubheaderClassNameOptions {
|
|
38
|
+
extends HTMLAttributes<HTMLLIElement>, ListSubheaderClassNameOptions {
|
|
40
39
|
/**
|
|
41
40
|
* @defaultValue `"presentation"`
|
|
42
41
|
*/
|