@react-md/core 1.0.0-next.0 → 1.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +65 -0
- package/coverage/clover.xml +3 -1118
- package/coverage/coverage-final.json +1 -7
- package/coverage/lcov-report/CircularProgress.tsx.html +799 -0
- package/coverage/lcov-report/DefaultToastRenderer.tsx.html +166 -112
- package/coverage/lcov-report/Dialog.tsx.html +1309 -0
- package/coverage/lcov-report/DialogContent.tsx.html +178 -0
- package/coverage/lcov-report/DialogFooter.tsx.html +169 -0
- package/coverage/lcov-report/LinearProgress.tsx.html +658 -0
- package/coverage/lcov-report/MaterialIcon.tsx.html +36 -42
- package/coverage/lcov-report/MaterialSymbol.tsx.html +240 -222
- package/coverage/lcov-report/MenuItemInputToggle.tsx.html +979 -0
- package/coverage/lcov-report/MenuItemSeparator.tsx.html +223 -0
- package/coverage/lcov-report/MenuItemTextField.tsx.html +289 -0
- package/coverage/lcov-report/Snackbar.tsx.html +360 -402
- package/coverage/lcov-report/Switch.tsx.html +535 -0
- package/coverage/lcov-report/SwitchTrack.tsx.html +262 -0
- package/coverage/lcov-report/Table.tsx.html +457 -0
- package/coverage/lcov-report/TableCell.tsx.html +982 -0
- package/coverage/lcov-report/TableCheckbox.tsx.html +709 -0
- package/coverage/lcov-report/TableContainer.tsx.html +220 -0
- package/coverage/lcov-report/TableFooter.tsx.html +502 -0
- package/coverage/lcov-report/TableHeader.tsx.html +541 -0
- package/coverage/lcov-report/TableRadio.tsx.html +670 -0
- package/coverage/lcov-report/TableRow.tsx.html +289 -0
- package/coverage/lcov-report/Toast.tsx.html +868 -0
- package/coverage/lcov-report/ToastManager.tsx.html +1783 -0
- package/coverage/lcov-report/ToastManagerProvider.tsx.html +216 -216
- package/coverage/lcov-report/Tooltip.tsx.html +98 -155
- package/coverage/lcov-report/avatar/Avatar.tsx.html +37 -31
- package/coverage/lcov-report/avatar/index.html +22 -7
- package/coverage/lcov-report/avatar/styles.ts.html +268 -0
- package/coverage/lcov-report/button/AsyncButton.tsx.html +217 -10
- package/coverage/lcov-report/button/Button.tsx.html +95 -83
- package/coverage/lcov-report/button/index.html +12 -12
- package/coverage/lcov-report/config.ts.html +33 -18
- package/coverage/lcov-report/cssUtils.ts.html +143 -65
- package/coverage/lcov-report/dialog/Dialog.tsx.html +170 -167
- package/coverage/lcov-report/dialog/DialogContent.tsx.html +178 -0
- package/coverage/lcov-report/dialog/DialogFooter.tsx.html +169 -0
- package/coverage/lcov-report/dialog/DialogHeader.tsx.html +148 -0
- package/coverage/lcov-report/dialog/DialogTitle.tsx.html +256 -0
- package/coverage/lcov-report/dialog/index.html +18 -33
- package/coverage/lcov-report/dialog/styles.ts.html +439 -0
- package/coverage/lcov-report/form/MenuItemInputToggle.tsx.html +36 -24
- package/coverage/lcov-report/form/MenuItemTextField.tsx.html +12 -9
- package/coverage/lcov-report/form/SliderValueTooltip.tsx.html +319 -0
- package/coverage/lcov-report/form/Switch.tsx.html +310 -385
- package/coverage/lcov-report/form/SwitchTrack.tsx.html +98 -71
- package/coverage/lcov-report/form/index.html +20 -245
- package/coverage/lcov-report/form/switchStyles.ts.html +172 -0
- package/coverage/lcov-report/form/useRadioGroup.ts.html +79 -79
- package/coverage/lcov-report/hoverMode/index.html +116 -0
- package/coverage/lcov-report/hoverMode/useHoverMode.ts.html +676 -0
- package/coverage/lcov-report/icon/FontIcon.tsx.html +37 -46
- package/coverage/lcov-report/icon/index.html +12 -12
- package/coverage/lcov-report/icon/styles.ts.html +41 -104
- package/coverage/lcov-report/iconConfig.tsx.html +973 -0
- package/coverage/lcov-report/index.html +11 -101
- package/coverage/lcov-report/link/Link.tsx.html +358 -0
- package/coverage/lcov-report/link/index.html +20 -20
- package/coverage/lcov-report/list/ListItemLink.tsx.html +29 -35
- package/coverage/lcov-report/list/index.html +8 -38
- package/coverage/lcov-report/materialConfig.ts.html +703 -0
- package/coverage/lcov-report/media-queries/appSize.ts.html +1 -1
- package/coverage/lcov-report/media-queries/index.html +10 -10
- package/coverage/lcov-report/menu/DropdownMenu.tsx.html +976 -0
- package/coverage/lcov-report/menu/Menu.tsx.html +111 -60
- package/coverage/lcov-report/menu/MenuConfigurationProvider.tsx.html +637 -0
- package/coverage/lcov-report/menu/MenuSheet.tsx.html +37 -13
- package/coverage/lcov-report/menu/index.html +35 -65
- package/coverage/lcov-report/menu/menuConfig.ts.html +118 -0
- package/coverage/lcov-report/progress/CircularProgress.tsx.html +799 -0
- package/coverage/lcov-report/progress/LinearProgress.tsx.html +100 -94
- package/coverage/lcov-report/progress/index.html +22 -7
- package/coverage/lcov-report/snackbar/Snackbar.tsx.html +55 -97
- package/coverage/lcov-report/snackbar/Toast.tsx.html +546 -501
- package/coverage/lcov-report/snackbar/ToastManager.tsx.html +269 -269
- package/coverage/lcov-report/snackbar/ToastManagerProvider.tsx.html +23 -23
- package/coverage/lcov-report/snackbar/index.html +59 -14
- package/coverage/lcov-report/snackbar/snackbarStyles.ts.html +12 -87
- package/coverage/lcov-report/snackbar/toastStyles.ts.html +206 -146
- package/coverage/lcov-report/snackbar/useCurrentToastActions.ts.html +226 -0
- package/coverage/lcov-report/snackbarStyles.ts.html +46 -121
- 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/SsrProvider.tsx.html +10 -10
- package/coverage/lcov-report/src/app-bar/AppBar.tsx.html +65 -65
- package/coverage/lcov-report/src/app-bar/AppBarTitle.tsx.html +1 -1
- package/coverage/lcov-report/src/app-bar/index.html +20 -5
- package/coverage/lcov-report/src/avatar/Avatar.tsx.html +36 -27
- package/coverage/lcov-report/src/avatar/index.html +22 -7
- package/coverage/lcov-report/src/avatar/styles.ts.html +77 -8
- 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 +10 -25
- package/coverage/lcov-report/src/box/styles.ts.html +103 -49
- package/coverage/lcov-report/src/button/AsyncButton.tsx.html +833 -284
- package/coverage/lcov-report/src/button/Button.tsx.html +87 -87
- package/coverage/lcov-report/src/button/ButtonUnstyled.tsx.html +1 -1
- package/coverage/lcov-report/src/button/FloatingActionButton.tsx.html +39 -39
- package/coverage/lcov-report/src/button/buttonStyles.ts.html +59 -59
- package/coverage/lcov-report/src/button/buttonUnstyledStyles.ts.html +1 -1
- package/coverage/lcov-report/src/button/index.html +23 -8
- 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/index.html +95 -5
- 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 +68 -59
- package/coverage/lcov-report/src/delegateEvent.ts.html +84 -84
- package/coverage/lcov-report/src/dialog/Dialog.tsx.html +158 -155
- package/coverage/lcov-report/src/dialog/DialogContainer.tsx.html +27 -27
- package/coverage/lcov-report/src/dialog/DialogContent.tsx.html +72 -72
- package/coverage/lcov-report/src/dialog/DialogFooter.tsx.html +14 -14
- package/coverage/lcov-report/src/dialog/DialogHeader.tsx.html +9 -9
- package/coverage/lcov-report/src/dialog/DialogTitle.tsx.html +124 -124
- package/coverage/lcov-report/src/dialog/FixedDialog.tsx.html +1 -1
- package/coverage/lcov-report/src/dialog/NestedDialogProvider.ts.html +3 -3
- package/coverage/lcov-report/src/dialog/index.html +21 -21
- package/coverage/lcov-report/src/dialog/styles.ts.html +61 -61
- package/coverage/lcov-report/src/divider/Divider.tsx.html +24 -24
- package/coverage/lcov-report/src/divider/index.html +21 -6
- package/coverage/lcov-report/src/divider/styles.ts.html +11 -11
- package/coverage/lcov-report/src/draggable/index.html +5 -5
- package/coverage/lcov-report/src/draggable/useDraggable.ts.html +322 -322
- package/coverage/lcov-report/src/draggable/utils.ts.html +81 -81
- 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 +11 -20
- package/coverage/lcov-report/src/expansion-panel/index.html +25 -10
- 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 +23 -23
- package/coverage/lcov-report/src/focus/useFocusContainer.ts.html +142 -121
- package/coverage/lcov-report/src/focus/utils.ts.html +37 -37
- 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 +133 -139
- package/coverage/lcov-report/src/form/Form.tsx.html +1 -1
- package/coverage/lcov-report/src/form/FormMessage.tsx.html +126 -264
- package/coverage/lcov-report/src/form/FormMessageContainer.tsx.html +42 -45
- package/coverage/lcov-report/src/form/FormMessageCounter.tsx.html +1 -1
- package/coverage/lcov-report/src/form/InputToggle.tsx.html +7 -16
- package/coverage/lcov-report/src/form/InputToggleIcon.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Label.tsx.html +102 -102
- package/coverage/lcov-report/src/form/Legend.tsx.html +1 -1
- package/coverage/lcov-report/src/form/MenuItemCheckbox.tsx.html +11 -5
- package/coverage/lcov-report/src/form/MenuItemFileInput.tsx.html +3 -3
- package/coverage/lcov-report/src/form/MenuItemInputToggle.tsx.html +21 -9
- package/coverage/lcov-report/src/form/MenuItemRadio.tsx.html +11 -5
- package/coverage/lcov-report/src/form/MenuItemSwitch.tsx.html +1 -1
- package/coverage/lcov-report/src/form/MenuItemTextField.tsx.html +13 -4
- package/coverage/lcov-report/src/form/NativeSelect.tsx.html +20 -5
- package/coverage/lcov-report/src/form/OptGroup.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Option.tsx.html +4 -4
- package/coverage/lcov-report/src/form/Password.tsx.html +3 -3
- package/coverage/lcov-report/src/form/Radio.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Select.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SelectValue.tsx.html +1 -1
- package/coverage/lcov-report/src/form/Slider.tsx.html +129 -9
- 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 +43 -7
- package/coverage/lcov-report/src/form/SliderTrack.tsx.html +1 -1
- package/coverage/lcov-report/src/form/SliderValueMarks.tsx.html +11 -5
- package/coverage/lcov-report/src/form/SliderValueTooltip.tsx.html +2 -2
- package/coverage/lcov-report/src/form/Switch.tsx.html +310 -373
- package/coverage/lcov-report/src/form/SwitchTrack.tsx.html +99 -69
- package/coverage/lcov-report/src/form/TextArea.tsx.html +21 -9
- package/coverage/lcov-report/src/form/TextField.tsx.html +16 -10
- package/coverage/lcov-report/src/form/TextFieldAddon.tsx.html +14 -26
- package/coverage/lcov-report/src/form/TextFieldContainer.tsx.html +28 -10
- package/coverage/lcov-report/src/form/TextFieldContainerStyles.ts.html +17 -8
- package/coverage/lcov-report/src/form/fileUtils.ts.html +3 -3
- package/coverage/lcov-report/src/form/formConfig.ts.html +18 -18
- package/coverage/lcov-report/src/form/formMessageStyles.ts.html +40 -40
- package/coverage/lcov-report/src/form/index.html +14 -164
- package/coverage/lcov-report/src/form/inputToggleStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/nativeSelectStyles.ts.html +34 -7
- 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 +6 -9
- package/coverage/lcov-report/src/form/sliderUtils.ts.html +20 -14
- package/coverage/lcov-report/src/form/switchStyles.ts.html +68 -68
- package/coverage/lcov-report/src/form/textAreaStyles.ts.html +3 -3
- package/coverage/lcov-report/src/form/textFieldStyles.ts.html +1 -1
- package/coverage/lcov-report/src/form/useCheckboxGroup.ts.html +2 -2
- package/coverage/lcov-report/src/form/useFileUpload.ts.html +28 -19
- package/coverage/lcov-report/src/form/useListboxProvider.ts.html +5 -8
- package/coverage/lcov-report/src/form/useNumberField.ts.html +10 -10
- package/coverage/lcov-report/src/form/useRadioGroup.ts.html +22 -7
- package/coverage/lcov-report/src/form/useRangeSlider.ts.html +3 -3
- package/coverage/lcov-report/src/form/useResizingTextArea.ts.html +523 -0
- package/coverage/lcov-report/src/form/useSlider.ts.html +2 -2
- package/coverage/lcov-report/src/form/useTextField.ts.html +32 -26
- package/coverage/lcov-report/src/form/utils.ts.html +2 -2
- package/coverage/lcov-report/src/form/validation.ts.html +2 -2
- package/coverage/lcov-report/src/hoverMode/index.html +1 -1
- package/coverage/lcov-report/src/hoverMode/useHoverMode.ts.html +95 -95
- package/coverage/lcov-report/src/hoverMode/useHoverModeProvider.ts.html +3 -3
- package/coverage/lcov-report/src/icon/FontIcon.tsx.html +34 -43
- package/coverage/lcov-report/src/icon/IconRotator.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/MaterialIcon.tsx.html +36 -42
- package/coverage/lcov-report/src/icon/MaterialSymbol.tsx.html +240 -222
- package/coverage/lcov-report/src/icon/SVGIcon.tsx.html +1 -1
- package/coverage/lcov-report/src/icon/TextIconSpacing.tsx.html +33 -33
- package/coverage/lcov-report/src/icon/iconConfig.tsx.html +973 -0
- package/coverage/lcov-report/src/icon/index.html +149 -14
- package/coverage/lcov-report/src/icon/material.ts.html +748 -58
- package/coverage/lcov-report/src/icon/materialConfig.ts.html +703 -0
- package/coverage/lcov-report/src/icon/styles.ts.html +47 -110
- package/coverage/lcov-report/src/index.html +8 -8
- package/coverage/lcov-report/src/interaction/Ripple.tsx.html +60 -60
- package/coverage/lcov-report/src/interaction/RippleContainer.tsx.html +41 -47
- package/coverage/lcov-report/src/interaction/UserInteractionModeProvider.tsx.html +240 -240
- package/coverage/lcov-report/src/interaction/config.ts.html +7 -7
- package/coverage/lcov-report/src/interaction/index.html +100 -10
- package/coverage/lcov-report/src/interaction/useElementInteraction.tsx.html +146 -146
- package/coverage/lcov-report/src/interaction/useHigherContrastChildren.tsx.html +17 -17
- package/coverage/lcov-report/src/interaction/utils.ts.html +171 -171
- package/coverage/lcov-report/src/layout/LayoutAppBar.tsx.html +1 -1
- package/coverage/lcov-report/src/layout/LayoutNav.tsx.html +60 -60
- 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 +200 -5
- package/coverage/lcov-report/src/layout/layoutNavStyles.ts.html +5 -5
- 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 +3 -3
- package/coverage/lcov-report/src/link/Link.tsx.html +39 -9
- package/coverage/lcov-report/src/link/SkipToMainContent.tsx.html +1 -1
- package/coverage/lcov-report/src/link/index.html +16 -16
- package/coverage/lcov-report/src/link/styles.ts.html +1 -1
- package/coverage/lcov-report/src/list/List.tsx.html +33 -33
- package/coverage/lcov-report/src/list/ListItem.tsx.html +534 -534
- package/coverage/lcov-report/src/list/ListItemAddon.tsx.html +33 -33
- package/coverage/lcov-report/src/list/ListItemChildren.tsx.html +77 -77
- 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 +33 -33
- package/coverage/lcov-report/src/list/index.html +128 -8
- package/coverage/lcov-report/src/list/listItemStyles.ts.html +1 -1
- package/coverage/lcov-report/src/media-queries/AppSizeProvider.tsx.html +59 -59
- package/coverage/lcov-report/src/media-queries/appSize.ts.html +1 -1
- package/coverage/lcov-report/src/media-queries/index.html +20 -5
- package/coverage/lcov-report/src/media-queries/useMediaQuery.ts.html +24 -24
- package/coverage/lcov-report/src/menu/DropdownMenu.tsx.html +73 -16
- package/coverage/lcov-report/src/menu/Menu.tsx.html +66 -33
- package/coverage/lcov-report/src/menu/MenuBar.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuButton.tsx.html +3 -3
- 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 +3 -3
- package/coverage/lcov-report/src/menu/MenuItemGroup.tsx.html +1 -1
- package/coverage/lcov-report/src/menu/MenuItemSeparator.tsx.html +6 -36
- package/coverage/lcov-report/src/menu/MenuSheet.tsx.html +34 -7
- 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 +69 -24
- 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 +10 -10
- 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 +53 -8
- package/coverage/lcov-report/src/movement/useKeyboardMovementProvider.ts.html +92 -92
- package/coverage/lcov-report/src/movement/utils.ts.html +1 -1
- package/coverage/lcov-report/src/overlay/Overlay.tsx.html +64 -64
- package/coverage/lcov-report/src/overlay/index.html +1 -1
- package/coverage/lcov-report/src/overlay/overlayStyles.ts.html +28 -28
- package/coverage/lcov-report/src/portal/Portal.tsx.html +9 -9
- package/coverage/lcov-report/src/portal/PortalContainerProvider.tsx.html +29 -29
- package/coverage/lcov-report/src/portal/index.html +20 -5
- package/coverage/lcov-report/src/positioning/constants.ts.html +1 -1
- package/coverage/lcov-report/src/positioning/createHorizontalPosition.ts.html +63 -63
- package/coverage/lcov-report/src/positioning/createVerticalPosition.ts.html +65 -65
- package/coverage/lcov-report/src/positioning/getFixedPosition.ts.html +94 -94
- package/coverage/lcov-report/src/positioning/index.html +70 -10
- package/coverage/lcov-report/src/positioning/useFixedPositioning.ts.html +200 -200
- package/coverage/lcov-report/src/positioning/utils.ts.html +111 -111
- package/coverage/lcov-report/src/progress/CircularProgress.tsx.html +501 -456
- package/coverage/lcov-report/src/progress/LinearProgress.tsx.html +419 -338
- package/coverage/lcov-report/src/progress/getProgressA11y.ts.html +1 -1
- package/coverage/lcov-report/src/progress/index.html +32 -32
- 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 +20 -5
- 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 +25 -25
- package/coverage/lcov-report/src/scroll/index.html +5 -5
- package/coverage/lcov-report/src/scroll/useScrollLock.ts.html +27 -27
- package/coverage/lcov-report/src/segmented-button/SegmentedButton.tsx.html +4 -4
- package/coverage/lcov-report/src/segmented-button/SegmentedButtonContainer.tsx.html +29 -8
- package/coverage/lcov-report/src/segmented-button/index.html +50 -5
- package/coverage/lcov-report/src/segmented-button/segmentedButtonContainerStyles.ts.html +15 -6
- 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 +20 -5
- package/coverage/lcov-report/src/sheet/styles.ts.html +28 -28
- package/coverage/lcov-report/src/snackbar/DefaultToastRenderer.tsx.html +8 -5
- package/coverage/lcov-report/src/snackbar/Snackbar.tsx.html +7 -133
- package/coverage/lcov-report/src/snackbar/Toast.tsx.html +2 -2
- package/coverage/lcov-report/src/snackbar/ToastActionButton.tsx.html +1 -1
- package/coverage/lcov-report/src/snackbar/ToastCloseButton.tsx.html +3 -3
- package/coverage/lcov-report/src/snackbar/ToastContent.tsx.html +7 -115
- package/coverage/lcov-report/src/snackbar/ToastManager.tsx.html +1783 -0
- package/coverage/lcov-report/src/snackbar/ToastManagerProvider.tsx.html +16 -1696
- package/coverage/lcov-report/src/snackbar/index.html +159 -9
- package/coverage/lcov-report/src/snackbar/snackbarStyles.ts.html +214 -0
- package/coverage/lcov-report/src/snackbar/toastContentStyles.ts.html +196 -0
- 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 +57 -6
- package/coverage/lcov-report/src/suspense/NullSuspense.tsx.html +1 -1
- package/coverage/lcov-report/src/suspense/index.html +7 -22
- 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 +20 -35
- package/coverage/lcov-report/src/table/TableCellContent.tsx.html +2 -2
- package/coverage/lcov-report/src/table/TableCheckbox.tsx.html +1 -1
- package/coverage/lcov-report/src/table/TableConfigurationProvider.tsx.html +6 -12
- 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/TableRow.tsx.html +1 -1
- package/coverage/lcov-report/src/table/index.html +113 -8
- package/coverage/lcov-report/src/tabs/Tab.tsx.html +69 -69
- package/coverage/lcov-report/src/tabs/TabList.tsx.html +92 -92
- package/coverage/lcov-report/src/tabs/TabListScrollButton.tsx.html +61 -61
- package/coverage/lcov-report/src/tabs/index.html +143 -8
- package/coverage/lcov-report/src/tabs/tabIndicatorStyles.ts.html +157 -0
- package/coverage/lcov-report/src/tabs/tabListScrollButtonStyles.ts.html +226 -0
- package/coverage/lcov-report/src/tabs/tabListStyles.ts.html +241 -0
- package/coverage/lcov-report/src/tabs/tabStyles.ts.html +17 -17
- package/coverage/lcov-report/src/tabs/useTabList.ts.html +94 -94
- package/coverage/lcov-report/src/tabs/useTabs.ts.html +54 -54
- package/coverage/lcov-report/src/tabs/utils.ts.html +3 -3
- 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 +100 -0
- package/coverage/lcov-report/src/test-utils/drag.ts.html +1 -1
- package/coverage/lcov-report/src/test-utils/index.html +114 -9
- package/coverage/lcov-report/src/test-utils/jest-setup.ts.html +21 -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/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/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 +22 -4
- 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 +71 -11
- 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 +58 -58
- package/coverage/lcov-report/src/tooltip/Tooltip.tsx.html +98 -74
- package/coverage/lcov-report/src/tooltip/TooltipHoverModeProvider.tsx.html +60 -6
- package/coverage/lcov-report/src/tooltip/constants.ts.html +1 -1
- package/coverage/lcov-report/src/tooltip/index.html +72 -27
- package/coverage/lcov-report/src/tooltip/tooltipStyles.ts.html +18 -18
- package/coverage/lcov-report/src/tooltip/useOverflowTooltip.ts.html +196 -196
- package/coverage/lcov-report/src/tooltip/useTooltip.ts.html +511 -211
- package/coverage/lcov-report/src/tooltip/useTooltipPosition.ts.html +29 -29
- package/coverage/lcov-report/src/tooltip/utils.ts.html +23 -23
- 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 +46 -46
- 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 +187 -0
- package/coverage/lcov-report/src/transition/index.html +295 -10
- package/coverage/lcov-report/src/transition/maxWidthTransition.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useCSSTransition.ts.html +69 -69
- package/coverage/lcov-report/src/transition/useCarousel.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useCollapseTransition.ts.html +99 -99
- 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 +18 -18
- package/coverage/lcov-report/src/transition/useSkeletonPlaceholder.ts.html +1 -1
- package/coverage/lcov-report/src/transition/useSlideTransition.ts.html +20 -20
- package/coverage/lcov-report/src/transition/useTransition.ts.html +277 -250
- package/coverage/lcov-report/src/transition/utils.ts.html +68 -68
- package/coverage/lcov-report/src/tree/DefaultTreeItemRenderer.tsx.html +2 -2
- package/coverage/lcov-report/src/tree/Tree.tsx.html +24 -36
- package/coverage/lcov-report/src/tree/TreeGroup.tsx.html +45 -45
- package/coverage/lcov-report/src/tree/TreeItem.tsx.html +213 -216
- package/coverage/lcov-report/src/tree/TreeItemExpander.tsx.html +3 -3
- package/coverage/lcov-report/src/tree/TreeProvider.tsx.html +29 -11
- package/coverage/lcov-report/src/tree/index.html +114 -9
- package/coverage/lcov-report/src/tree/styles.ts.html +1 -1
- 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 +10 -13
- 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 +26 -26
- package/coverage/lcov-report/src/typography/TextContainer.tsx.html +1 -1
- package/coverage/lcov-report/src/typography/Typography.tsx.html +71 -71
- package/coverage/lcov-report/src/typography/WritingDirectionProvider.tsx.html +75 -75
- package/coverage/lcov-report/src/typography/index.html +64 -19
- package/coverage/lcov-report/src/useAsyncAction.ts.html +25 -25
- 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/useEnsuredId.ts.html +8 -8
- package/coverage/lcov-report/src/useEnsuredRef.ts.html +22 -19
- package/coverage/lcov-report/src/useEnsuredState.ts.html +18 -18
- package/coverage/lcov-report/src/useHtmlClassName.ts.html +1 -1
- package/coverage/lcov-report/src/useIntersectionObserver.ts.html +32 -32
- package/coverage/lcov-report/src/useIsomorphicLayoutEffect.ts.html +1 -1
- package/coverage/lcov-report/src/useLocalStorage.ts.html +225 -225
- package/coverage/lcov-report/src/useOrientation.ts.html +32 -32
- package/coverage/lcov-report/src/usePageInactive.ts.html +25 -25
- package/coverage/lcov-report/src/useResizeListener.ts.html +1 -1
- package/coverage/lcov-report/src/useResizeObserver.ts.html +28 -28
- package/coverage/lcov-report/src/useThrottledFunction.ts.html +1 -1
- package/coverage/lcov-report/src/useToggle.ts.html +18 -18
- package/coverage/lcov-report/src/useUnmounted.ts.html +11 -11
- 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 +11 -11
- package/coverage/lcov-report/src/utils/bem.ts.html +50 -50
- package/coverage/lcov-report/src/utils/filters.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getClientPosition.ts.html +1 -1
- package/coverage/lcov-report/src/utils/getPercentage.ts.html +36 -36
- 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 +212 -17
- package/coverage/lcov-report/src/utils/isElementVisible.ts.html +14 -14
- 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 +41 -41
- 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/styles.ts.html +134 -320
- package/coverage/lcov-report/switchStyles.ts.html +172 -0
- package/coverage/lcov-report/table/Table.tsx.html +526 -0
- package/coverage/lcov-report/table/TableBody.tsx.html +280 -0
- package/coverage/lcov-report/table/TableCell.tsx.html +159 -168
- package/coverage/lcov-report/table/TableCheckbox.tsx.html +10 -13
- package/coverage/lcov-report/table/TableRadio.tsx.html +670 -0
- package/coverage/lcov-report/table/TableRow.tsx.html +370 -0
- package/coverage/lcov-report/table/index.html +62 -32
- package/coverage/lcov-report/tableCellStyles.ts.html +334 -0
- package/coverage/lcov-report/tableContainerStyles.ts.html +142 -0
- package/coverage/lcov-report/tableFooterStyles.ts.html +157 -0
- package/coverage/lcov-report/tableHeaderStyles.ts.html +163 -0
- package/coverage/lcov-report/tableRowStyles.ts.html +169 -0
- package/coverage/lcov-report/tableStyles.ts.html +157 -0
- package/coverage/lcov-report/tabs/Tab.tsx.html +502 -0
- package/coverage/lcov-report/tabs/TabList.tsx.html +796 -0
- package/coverage/lcov-report/tabs/index.html +62 -17
- package/coverage/lcov-report/tabs/useTabs.ts.html +1567 -0
- package/coverage/lcov-report/tabs/utils.ts.html +337 -0
- package/coverage/lcov-report/test-utils/index.html +20 -20
- package/coverage/lcov-report/test-utils/jest-setup.ts.html +124 -0
- package/coverage/lcov-report/tooltip/Tooltip.tsx.html +98 -74
- package/coverage/lcov-report/tooltip/TooltipHoverModeProvider.tsx.html +167 -11
- package/coverage/lcov-report/tooltip/constants.ts.html +1 -1
- package/coverage/lcov-report/tooltip/index.html +32 -17
- package/coverage/lcov-report/tooltip/tooltipStyles.ts.html +181 -0
- package/coverage/lcov-report/tooltip/useTooltip.ts.html +490 -190
- package/coverage/lcov-report/tooltipStyles.ts.html +181 -0
- package/coverage/lcov-report/transition/config.ts.html +187 -0
- package/coverage/lcov-report/transition/index.html +9 -24
- package/coverage/lcov-report/transition/useTransition.ts.html +943 -0
- package/coverage/lcov-report/tree/Tree.tsx.html +24 -36
- package/coverage/lcov-report/tree/TreeItem.tsx.html +213 -216
- package/coverage/lcov-report/tree/TreeProvider.tsx.html +55 -10
- package/coverage/lcov-report/tree/index.html +14 -59
- package/coverage/lcov-report/typography/Typography.tsx.html +108 -402
- package/coverage/lcov-report/typography/WritingDirectionProvider.tsx.html +781 -0
- package/coverage/lcov-report/typography/index.html +8 -8
- package/coverage/lcov-report/useTooltip.ts.html +651 -375
- package/coverage/lcov-report/useTransition.ts.html +934 -0
- package/coverage/lcov-report/utils/index.html +24 -39
- package/coverage/lcov-report/utils/isElementVisible.ts.html +14 -14
- package/coverage/lcov-report/utils/parseCssLengthUnit.ts.html +19 -19
- package/coverage/lcov.info +0 -1176
- package/dist/_core.scss +39 -2
- package/dist/_utils.scss +57 -0
- package/dist/app-bar/_app-bar.scss +15 -23
- package/dist/avatar/Avatar.d.ts +2 -15
- package/dist/avatar/Avatar.js +3 -2
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/avatar/_avatar.scss +30 -37
- package/dist/avatar/styles.d.ts +20 -2
- package/dist/avatar/styles.js +4 -1
- package/dist/avatar/styles.js.map +1 -1
- package/dist/badge/_badge.scss +71 -44
- package/dist/box/_box.scss +18 -29
- package/dist/button/AsyncButton.d.ts +29 -0
- package/dist/button/AsyncButton.js +14 -1
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/button/_button.scss +50 -62
- package/dist/card/_card.scss +14 -23
- package/dist/chip/_chip.scss +33 -62
- package/dist/chip/styles.d.ts +1 -1
- package/dist/chip/styles.js +3 -4
- package/dist/chip/styles.js.map +1 -1
- package/dist/cssUtils.d.ts +1 -0
- package/dist/cssUtils.js +1 -1
- package/dist/cssUtils.js.map +1 -1
- package/dist/dialog/Dialog.d.ts +1 -1
- package/dist/dialog/Dialog.js +2 -1
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/_dialog.scss +95 -93
- package/dist/divider/Divider.d.ts +0 -1
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/_divider.scss +33 -43
- package/dist/focus/useFocusContainer.d.ts +8 -8
- package/dist/focus/useFocusContainer.js +11 -10
- package/dist/focus/useFocusContainer.js.map +1 -1
- package/dist/form/Label.d.ts +5 -5
- package/dist/form/Label.js.map +1 -1
- package/dist/form/MenuItemInputToggle.js +2 -2
- package/dist/form/MenuItemInputToggle.js.map +1 -1
- package/dist/form/MenuItemTextField.d.ts +2 -0
- package/dist/form/MenuItemTextField.js.map +1 -1
- package/dist/form/Slider.d.ts +41 -5
- package/dist/form/Slider.js +2 -1
- package/dist/form/Slider.js.map +1 -1
- package/dist/form/SliderThumb.d.ts +7 -2
- package/dist/form/SliderThumb.js +4 -2
- package/dist/form/SliderThumb.js.map +1 -1
- package/dist/form/SliderValueMarks.js +1 -1
- package/dist/form/SliderValueMarks.js.map +1 -1
- package/dist/form/SliderValueTooltip.js +1 -1
- package/dist/form/SliderValueTooltip.js.map +1 -1
- package/dist/form/Switch.d.ts +3 -2
- package/dist/form/Switch.js +7 -26
- package/dist/form/Switch.js.map +1 -1
- package/dist/form/SwitchTrack.d.ts +2 -1
- package/dist/form/SwitchTrack.js +8 -4
- package/dist/form/SwitchTrack.js.map +1 -1
- package/dist/form/TextArea.js +1 -1
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextFieldContainerStyles.d.ts +7 -7
- package/dist/form/TextFieldContainerStyles.js.map +1 -1
- package/dist/form/_form.scss +241 -237
- package/dist/form/switchStyles.d.ts +1 -0
- package/dist/form/switchStyles.js +2 -1
- package/dist/form/switchStyles.js.map +1 -1
- package/dist/form/textAreaStyles.d.ts +2 -2
- package/dist/form/textAreaStyles.js.map +1 -1
- package/dist/form/types.d.ts +0 -2
- package/dist/form/types.js.map +1 -1
- package/dist/hoverMode/useHoverMode.d.ts +2 -2
- package/dist/hoverMode/useHoverMode.js +1 -1
- package/dist/hoverMode/useHoverMode.js.map +1 -1
- package/dist/icon/FontIcon.d.ts +2 -1
- package/dist/icon/FontIcon.js +4 -5
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/MaterialIcon.d.ts +2 -2
- package/dist/icon/MaterialIcon.js +3 -6
- package/dist/icon/MaterialIcon.js.map +1 -1
- package/dist/icon/MaterialSymbol.d.ts +15 -8
- package/dist/icon/MaterialSymbol.js +15 -11
- package/dist/icon/MaterialSymbol.js.map +1 -1
- package/dist/icon/_icon.scss +31 -47
- package/dist/icon/iconConfig.js.map +1 -1
- package/dist/icon/material.d.ts +1 -1
- package/dist/icon/material.js.map +1 -1
- package/dist/icon/{MaterialSymbolsProvider.d.ts → materialConfig.d.ts} +25 -14
- package/dist/icon/materialConfig.js +29 -0
- package/dist/icon/materialConfig.js.map +1 -0
- package/dist/icon/styles.d.ts +0 -15
- package/dist/icon/styles.js +2 -4
- package/dist/icon/styles.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/interaction/_interaction.scss +47 -57
- package/dist/layout/_layout.scss +14 -19
- package/dist/link/Link.d.ts +12 -6
- package/dist/link/Link.js +1 -2
- package/dist/link/Link.js.map +1 -1
- package/dist/link/_link.scss +15 -23
- package/dist/list/ListItemLink.d.ts +1 -1
- package/dist/list/ListItemLink.js.map +1 -1
- package/dist/list/_list.scss +53 -63
- package/dist/menu/DropdownMenu.d.ts +12 -1
- package/dist/menu/DropdownMenu.js +13 -4
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.d.ts +8 -0
- package/dist/menu/Menu.js +2 -1
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuItemSeparator.d.ts +1 -2
- package/dist/menu/MenuItemSeparator.js +2 -8
- package/dist/menu/MenuItemSeparator.js.map +1 -1
- package/dist/menu/MenuSheet.d.ts +6 -1
- package/dist/menu/MenuSheet.js.map +1 -1
- package/dist/menu/_menu.scss +16 -27
- package/dist/overlay/_overlay.scss +14 -19
- package/dist/progress/CircularProgress.d.ts +5 -4
- package/dist/progress/CircularProgress.js +3 -3
- package/dist/progress/CircularProgress.js.map +1 -1
- package/dist/progress/LinearProgress.d.ts +7 -5
- package/dist/progress/LinearProgress.js +4 -3
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/progress/_progress.scss +25 -30
- package/dist/segmented-button/_segmented-button.scss +37 -43
- package/dist/sheet/_sheet.scss +24 -42
- package/dist/snackbar/DefaultToastRenderer.js +1 -1
- package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
- package/dist/snackbar/Snackbar.d.ts +1 -3
- package/dist/snackbar/Snackbar.js +2 -3
- package/dist/snackbar/Snackbar.js.map +1 -1
- package/dist/snackbar/Toast.d.ts +1 -1
- package/dist/snackbar/Toast.js +5 -1
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/snackbar/ToastManager.d.ts +2 -1
- package/dist/snackbar/ToastManager.js +1 -1
- package/dist/snackbar/ToastManager.js.map +1 -1
- package/dist/snackbar/_snackbar.scss +15 -23
- package/dist/suspense/CircularProgressSuspense.d.ts +4 -0
- package/dist/suspense/CircularProgressSuspense.js +3 -1
- package/dist/suspense/CircularProgressSuspense.js.map +1 -1
- package/dist/table/Table.d.ts +0 -12
- package/dist/table/Table.js +1 -12
- package/dist/table/Table.js.map +1 -1
- package/dist/table/TableCell.d.ts +13 -38
- package/dist/table/TableCell.js +7 -15
- package/dist/table/TableCell.js.map +1 -1
- package/dist/table/TableCellContent.d.ts +9 -0
- package/dist/table/TableCellContent.js +2 -1
- package/dist/table/TableCellContent.js.map +1 -1
- package/dist/table/TableCheckbox.d.ts +2 -2
- package/dist/table/TableCheckbox.js +3 -3
- package/dist/table/TableCheckbox.js.map +1 -1
- package/dist/table/TableContainer.d.ts +0 -6
- package/dist/table/TableContainer.js +1 -6
- package/dist/table/TableContainer.js.map +1 -1
- package/dist/table/TableFooter.d.ts +7 -1
- package/dist/table/TableFooter.js +17 -16
- package/dist/table/TableFooter.js.map +1 -1
- package/dist/table/TableHeader.d.ts +7 -14
- package/dist/table/TableHeader.js +6 -14
- package/dist/table/TableHeader.js.map +1 -1
- package/dist/table/TableRadio.d.ts +106 -0
- package/dist/table/TableRadio.js +106 -0
- package/dist/table/TableRadio.js.map +1 -0
- package/dist/table/TableRow.d.ts +0 -10
- package/dist/table/TableRow.js +1 -12
- package/dist/table/TableRow.js.map +1 -1
- package/dist/table/_table.scss +71 -88
- package/dist/table/tableCellStyles.d.ts +33 -0
- package/dist/table/tableCellStyles.js +15 -0
- package/dist/table/tableCellStyles.js.map +1 -0
- package/dist/table/tableContainerStyles.d.ts +10 -0
- package/dist/table/tableContainerStyles.js +9 -0
- package/dist/table/tableContainerStyles.js.map +1 -0
- package/dist/table/tableFooterStyles.d.ts +10 -0
- package/dist/table/tableFooterStyles.js +12 -0
- package/dist/table/tableFooterStyles.js.map +1 -0
- package/dist/table/tableHeaderStyles.d.ts +10 -0
- package/dist/table/tableHeaderStyles.js +13 -0
- package/dist/table/tableHeaderStyles.js.map +1 -0
- package/dist/table/tableRowStyles.d.ts +10 -0
- package/dist/table/tableRowStyles.js +14 -0
- package/dist/table/tableRowStyles.js.map +1 -0
- package/dist/table/tableStyles.d.ts +12 -0
- package/dist/table/tableStyles.js +14 -0
- package/dist/table/tableStyles.js.map +1 -0
- package/dist/table/types.d.ts +28 -15
- package/dist/table/types.js.map +1 -1
- package/dist/tabs/_tabs.scss +27 -30
- package/dist/test-utils/data-testid.js +2 -0
- package/dist/test-utils/data-testid.js.map +1 -0
- package/dist/test-utils/jest-setup.js +3 -0
- package/dist/test-utils/jest-setup.js.map +1 -1
- package/dist/theme/ThemeProvider.d.ts +5 -0
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/_theme.scss +31 -89
- package/dist/tooltip/Tooltip.d.ts +13 -6
- package/dist/tooltip/Tooltip.js +2 -2
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/TooltipHoverModeProvider.d.ts +15 -0
- package/dist/tooltip/TooltipHoverModeProvider.js.map +1 -1
- package/dist/tooltip/_tooltip.scss +17 -25
- package/dist/tooltip/tooltipStyles.d.ts +2 -1
- package/dist/tooltip/tooltipStyles.js +2 -2
- package/dist/tooltip/tooltipStyles.js.map +1 -1
- package/dist/tooltip/useTooltip.d.ts +71 -8
- package/dist/tooltip/useTooltip.js +68 -7
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/transition/_transition.scss +38 -37
- package/dist/transition/config.d.ts +22 -0
- package/dist/transition/config.js +16 -0
- package/dist/transition/config.js.map +1 -0
- package/dist/transition/useTransition.js +15 -6
- package/dist/transition/useTransition.js.map +1 -1
- package/dist/tree/DefaultTreeItemRenderer.d.ts +1 -1
- package/dist/tree/DefaultTreeItemRenderer.js.map +1 -1
- package/dist/tree/Tree.d.ts +1 -1
- package/dist/tree/Tree.js +18 -21
- package/dist/tree/Tree.js.map +1 -1
- package/dist/tree/TreeItem.js +1 -3
- package/dist/tree/TreeItem.js.map +1 -1
- package/dist/tree/TreeProvider.d.ts +2 -0
- package/dist/tree/TreeProvider.js +3 -1
- package/dist/tree/TreeProvider.js.map +1 -1
- package/dist/tree/_tree.scss +102 -109
- package/dist/typography/_typography.scss +17 -22
- package/dist/window-splitter/_window-splitter.scss +19 -45
- package/package.json +20 -17
- package/src/__tests__/NoSsr.tsx +5 -5
- package/src/__tests__/useAsyncAction.tsx +14 -6
- package/src/__tests__/useDebouncedFunction.tsx +6 -3
- package/src/__tests__/useDropzone.tsx +10 -10
- package/src/__tests__/useEnsuredId.tsx +5 -5
- package/src/__tests__/useEnsuredState.tsx +1 -2
- package/src/__tests__/useLocalStorage.tsx +21 -21
- package/src/__tests__/useResizeObserver.tsx +2 -0
- package/src/__tests__/useThrottledFunction.tsx +9 -8
- package/src/__tests__/useToggle.tsx +10 -10
- package/src/_core.scss +39 -2
- package/src/_utils.scss +57 -0
- package/src/app-bar/__tests__/AppBar.tsx +15 -15
- package/src/app-bar/__tests__/AppBarTitle.tsx +3 -5
- package/src/app-bar/_app-bar.scss +15 -23
- package/src/avatar/Avatar.tsx +12 -20
- package/src/avatar/__tests__/Avatar.tsx +6 -6
- package/src/avatar/_avatar.scss +30 -37
- package/src/avatar/styles.ts +27 -4
- package/src/badge/__tests__/Badge.tsx +3 -3
- package/src/badge/_badge.scss +71 -44
- package/src/box/_box.scss +18 -29
- package/src/button/AsyncButton.tsx +71 -4
- package/src/button/__tests__/AsyncButton.tsx +2 -0
- package/src/button/__tests__/Button.tsx +12 -12
- package/src/button/__tests__/ButtonUnstyled.tsx +3 -3
- package/src/button/__tests__/__snapshots__/AsyncButton.tsx.snap +31 -8
- package/src/button/_button.scss +50 -62
- package/src/card/__tests__/Card.tsx +3 -3
- package/src/card/__tests__/CardContent.tsx +3 -3
- package/src/card/__tests__/CardFooter.tsx +3 -3
- package/src/card/__tests__/CardHeader.tsx +5 -5
- package/src/card/__tests__/CardSubtitle.tsx +3 -3
- package/src/card/__tests__/CardTitle.tsx +3 -3
- package/src/card/_card.scss +14 -23
- package/src/chip/__tests__/Chip.tsx +20 -22
- package/src/chip/__tests__/__snapshots__/Chip.tsx.snap +3 -3
- package/src/chip/__tests__/__snapshots__/styles.ts.snap +1 -1
- package/src/chip/_chip.scss +33 -62
- package/src/chip/styles.ts +4 -5
- package/src/cssUtils.ts +4 -1
- package/src/dialog/Dialog.tsx +5 -4
- package/src/dialog/__tests__/Dialog.tsx +316 -0
- package/src/dialog/__tests__/DialogContent.tsx +53 -0
- package/src/dialog/__tests__/DialogFooter.tsx +70 -0
- package/src/dialog/__tests__/DialogHeader.tsx +37 -0
- package/src/dialog/__tests__/DialogTitle.tsx +41 -0
- package/src/dialog/__tests__/__snapshots__/Dialog.tsx.snap +84 -0
- package/src/dialog/__tests__/__snapshots__/DialogContent.tsx.snap +36 -0
- package/src/dialog/__tests__/__snapshots__/DialogFooter.tsx.snap +186 -0
- package/src/dialog/__tests__/__snapshots__/DialogHeader.tsx.snap +18 -0
- package/src/dialog/__tests__/__snapshots__/DialogTitle.tsx.snap +26 -0
- package/src/dialog/_dialog.scss +95 -93
- package/src/divider/Divider.tsx +0 -1
- package/src/divider/__tests__/Divider.tsx +3 -3
- package/src/divider/_divider.scss +33 -43
- package/src/draggable/__tests__/useDraggable.tsx +35 -39
- package/src/expansion-panel/__tests__/ExpansionPanel.tsx +28 -23
- package/src/focus/__tests__/useFocusContainer.tsx +280 -0
- package/src/focus/useFocusContainer.ts +17 -10
- package/src/form/Label.tsx +5 -5
- package/src/form/MenuItemInputToggle.tsx +6 -2
- package/src/form/MenuItemTextField.tsx +3 -0
- package/src/form/Slider.tsx +45 -5
- package/src/form/SliderThumb.tsx +15 -3
- package/src/form/SliderValueMarks.tsx +3 -1
- package/src/form/SliderValueTooltip.tsx +1 -1
- package/src/form/Switch.tsx +6 -27
- package/src/form/SwitchTrack.tsx +12 -2
- package/src/form/TextArea.tsx +1 -1
- package/src/form/TextFieldContainerStyles.ts +7 -7
- package/src/form/__tests__/Checkbox.tsx +5 -5
- package/src/form/__tests__/Fieldset.tsx +3 -3
- package/src/form/__tests__/FileInput.tsx +2 -2
- package/src/form/__tests__/Label.tsx +3 -3
- package/src/form/__tests__/Legend.tsx +3 -3
- package/src/form/__tests__/Radio.tsx +3 -3
- package/src/form/__tests__/Switch.tsx +152 -0
- package/src/form/__tests__/__snapshots__/Switch.tsx.snap +428 -0
- package/src/form/__tests__/__snapshots__/useCheckboxGroup.tsx.snap +1 -1
- package/src/form/__tests__/__snapshots__/useRadioGroup.tsx.snap +1 -1
- package/src/form/__tests__/useCheckboxGroup.tsx +33 -33
- package/src/form/__tests__/useFileUpload.tsx +41 -33
- package/src/form/__tests__/useRadioGroup.tsx +25 -25
- package/src/form/_form.scss +241 -237
- package/src/form/switchStyles.ts +3 -3
- package/src/form/textAreaStyles.ts +2 -2
- package/src/form/types.ts +0 -2
- package/src/hoverMode/useHoverMode.ts +4 -4
- package/src/icon/FontIcon.tsx +2 -5
- package/src/icon/MaterialIcon.tsx +4 -6
- package/src/icon/MaterialSymbol.tsx +18 -12
- package/src/icon/__tests__/FontIcon.tsx +7 -11
- package/src/icon/__tests__/IconRotator.tsx +4 -4
- package/src/icon/__tests__/MaterialIcon.tsx +79 -0
- package/src/icon/__tests__/MaterialSymbol.tsx +100 -0
- package/src/icon/__tests__/SVGIcon.tsx +6 -5
- package/src/icon/__tests__/TextIconSpacing.tsx +15 -17
- package/src/icon/__tests__/__snapshots__/IconRotator.tsx.snap +6 -6
- package/src/icon/__tests__/__snapshots__/MaterialIcon.tsx.snap +82 -0
- package/src/icon/__tests__/__snapshots__/MaterialSymbol.tsx.snap +42 -0
- package/src/icon/_icon.scss +31 -47
- package/src/icon/iconConfig.tsx +1 -0
- package/src/icon/material.ts +284 -54
- package/src/icon/{MaterialSymbolsProvider.tsx → materialConfig.ts} +49 -67
- package/src/icon/styles.ts +0 -21
- package/src/index.ts +8 -6
- package/src/interaction/__tests__/UserInteractionModeProvider.tsx +3 -3
- package/src/interaction/_interaction.scss +47 -57
- package/src/layout/__tests__/useExpandableLayout.tsx +12 -1
- package/src/layout/__tests__/useLayoutTree.tsx +6 -1
- package/src/layout/__tests__/useResizableLayout.tsx +13 -1
- package/src/layout/__tests__/useTemporaryLayout.tsx +6 -1
- package/src/layout/_layout.scss +14 -19
- package/src/link/Link.tsx +15 -5
- package/src/link/__tests__/Link.tsx +3 -3
- package/src/link/__tests__/SkipToMainContent.tsx +11 -14
- package/src/link/_link.scss +15 -23
- package/src/list/ListItemLink.tsx +1 -1
- package/src/list/__tests__/List.tsx +7 -7
- package/src/list/__tests__/ListItem.tsx +17 -16
- package/src/list/__tests__/ListItemLink.tsx +7 -7
- package/src/list/__tests__/ListSubheader.tsx +5 -5
- package/src/list/_list.scss +53 -63
- package/src/menu/DropdownMenu.tsx +23 -4
- package/src/menu/Menu.tsx +11 -0
- package/src/menu/MenuItemSeparator.tsx +2 -12
- package/src/menu/MenuSheet.tsx +10 -1
- package/src/menu/__tests__/DropdownMenu.tsx +74 -65
- package/src/menu/__tests__/MenuBar.tsx +57 -48
- package/src/menu/__tests__/MenuVisibilityProvider.tsx +3 -3
- package/src/menu/_menu.scss +16 -27
- package/src/overlay/__tests__/Overlay.tsx +37 -35
- package/src/overlay/_overlay.scss +14 -19
- package/src/portal/__tests__/PortalContainerProvider.node.tsx +1 -0
- package/src/portal/__tests__/PortalContainerProvider.tsx +9 -9
- package/src/positioning/__tests__/useFixedPositioning.tsx +20 -14
- package/src/progress/CircularProgress.tsx +5 -4
- package/src/progress/LinearProgress.tsx +88 -86
- package/src/progress/__tests__/CircularProgress.tsx +49 -27
- package/src/progress/__tests__/LinearProgress.tsx +40 -25
- package/src/progress/__tests__/__snapshots__/CircularProgress.tsx.snap +21 -0
- package/src/progress/__tests__/__snapshots__/LinearProgress.tsx.snap +20 -0
- package/src/progress/_progress.scss +25 -30
- package/src/segmented-button/_segmented-button.scss +37 -43
- package/src/sheet/_sheet.scss +24 -42
- package/src/snackbar/DefaultToastRenderer.tsx +1 -1
- package/src/snackbar/Snackbar.tsx +17 -25
- package/src/snackbar/Toast.tsx +7 -2
- package/src/snackbar/ToastManager.tsx +3 -2
- package/src/snackbar/__tests__/Snackbar.tsx +13 -12
- package/src/snackbar/__tests__/Toast.tsx +8 -3
- package/src/snackbar/__tests__/ToastActionButton.tsx +2 -2
- package/src/snackbar/__tests__/ToastCloseButton.tsx +2 -2
- package/src/snackbar/__tests__/ToastManagerProvider.tsx +28 -42
- package/src/snackbar/__tests__/__snapshots__/Snackbar.tsx.snap +127 -27
- package/src/snackbar/__tests__/__snapshots__/ToastManagerProvider.tsx.snap +23 -8
- package/src/snackbar/_snackbar.scss +15 -23
- package/src/suspense/CircularProgressSuspense.tsx +19 -2
- package/src/table/Table.tsx +1 -24
- package/src/table/TableCell.tsx +22 -85
- package/src/table/TableCellContent.tsx +20 -2
- package/src/table/TableCheckbox.tsx +3 -3
- package/src/table/TableContainer.tsx +1 -8
- package/src/table/TableFooter.tsx +30 -23
- package/src/table/TableHeader.tsx +23 -40
- package/src/table/TableRadio.tsx +195 -0
- package/src/table/TableRow.tsx +1 -28
- package/src/table/__tests__/Table.tsx +4 -10
- package/src/table/__tests__/TableBody.tsx +3 -3
- package/src/table/__tests__/TableCheckbox.tsx +10 -11
- package/src/table/__tests__/TableContainer.tsx +3 -3
- package/src/table/__tests__/TableRadio.tsx +112 -0
- package/src/table/__tests__/TableRow.tsx +4 -10
- package/src/table/__tests__/__snapshots__/Table.tsx.snap +249 -251
- package/src/table/__tests__/__snapshots__/TableBody.tsx.snap +3 -3
- package/src/table/__tests__/__snapshots__/TableCheckbox.tsx.snap +4 -4
- package/src/table/__tests__/__snapshots__/TableRadio.tsx.snap +138 -0
- package/src/table/__tests__/__snapshots__/TableRow.tsx.snap +4 -6
- package/src/table/__tests__/__snapshots__/tableContainerStyles.ts.snap +3 -0
- package/src/table/__tests__/__snapshots__/tableRowStyles.ts.snap +3 -0
- package/src/table/__tests__/__snapshots__/tableStyles.ts.snap +3 -0
- package/src/table/__tests__/tableContainerStyles.ts +8 -0
- package/src/table/__tests__/tableRowStyles.ts +8 -0
- package/src/table/__tests__/tableStyles.ts +8 -0
- package/src/table/_table.scss +71 -88
- package/src/table/tableCellStyles.ts +83 -0
- package/src/table/tableContainerStyles.ts +19 -0
- package/src/table/tableFooterStyles.ts +27 -0
- package/src/table/tableHeaderStyles.ts +29 -0
- package/src/table/tableRowStyles.ts +28 -0
- package/src/table/tableStyles.ts +24 -0
- package/src/table/types.ts +33 -15
- package/src/tabs/__tests__/Tab.tsx +3 -3
- package/src/tabs/__tests__/TabList.tsx +50 -40
- package/src/tabs/__tests__/useTabs.tsx +27 -24
- package/src/tabs/_tabs.scss +27 -30
- package/src/test-utils/data-testid.ts +5 -0
- package/src/test-utils/jest-setup.ts +4 -0
- package/src/theme/ThemeProvider.tsx +6 -0
- package/src/theme/__tests__/LocalStorageColorSchemeProvider.tsx +4 -4
- package/src/theme/__tests__/useCSSVariables.tsx +4 -4
- package/src/theme/_theme.scss +31 -89
- package/src/tooltip/Tooltip.tsx +17 -9
- package/src/tooltip/TooltipHoverModeProvider.tsx +18 -0
- package/src/tooltip/__tests__/Tooltip.tsx +147 -104
- package/src/tooltip/__tests__/TooltipHoverModeProvider.tsx +8 -3
- package/src/tooltip/__tests__/__snapshots__/Tooltip.tsx.snap +0 -33
- package/src/tooltip/_tooltip.scss +17 -25
- package/src/tooltip/tooltipStyles.ts +4 -4
- package/src/tooltip/useTooltip.ts +119 -19
- package/src/transition/__tests__/CSSTransition.tsx +12 -6
- package/src/transition/__tests__/Collapse.tsx +19 -17
- package/src/transition/__tests__/CrossFade.tsx +20 -17
- package/src/transition/__tests__/ScaleTransition.tsx +18 -14
- package/src/transition/__tests__/useCSSTransition.tsx +18 -14
- package/src/transition/__tests__/useCollapseTransition.tsx +25 -21
- package/src/transition/__tests__/useCrossFadeTransition.tsx +20 -16
- package/src/transition/__tests__/useScaleTransition.tsx +18 -12
- package/src/transition/__tests__/useTransition.tsx +165 -68
- package/src/transition/_transition.scss +38 -37
- package/src/transition/config.ts +34 -0
- package/src/transition/useTransition.ts +15 -6
- package/src/tree/DefaultTreeItemRenderer.tsx +1 -1
- package/src/tree/Tree.tsx +20 -24
- package/src/tree/TreeItem.tsx +2 -3
- package/src/tree/TreeProvider.tsx +6 -0
- package/src/tree/__tests__/Tree.tsx +7 -2
- package/src/tree/__tests__/TreeGroup.tsx +1 -0
- package/src/tree/__tests__/TreeItemExpander.tsx +1 -0
- package/src/tree/_tree.scss +102 -109
- package/src/typography/__tests__/TextContainer.tsx +3 -3
- package/src/typography/__tests__/Typography.tsx +10 -12
- package/src/typography/__tests__/WritingDirectionProvider.tsx +7 -7
- package/src/typography/_typography.scss +17 -22
- package/src/window-splitter/_window-splitter.scss +19 -45
- package/dist/divider/VerticalDivider.d.ts +0 -32
- package/dist/divider/VerticalDivider.js +0 -40
- package/dist/divider/VerticalDivider.js.map +0 -1
- package/dist/divider/useVerticalDividerHeight.d.ts +0 -37
- package/dist/divider/useVerticalDividerHeight.js +0 -40
- package/dist/divider/useVerticalDividerHeight.js.map +0 -1
- package/dist/icon/MaterialIconsProvider.d.ts +0 -12
- package/dist/icon/MaterialIconsProvider.js +0 -17
- package/dist/icon/MaterialIconsProvider.js.map +0 -1
- package/dist/icon/MaterialSymbolsProvider.js +0 -60
- package/dist/icon/MaterialSymbolsProvider.js.map +0 -1
- package/dist/link/LinkProvider.d.ts +0 -29
- package/dist/link/LinkProvider.js +0 -26
- package/dist/link/LinkProvider.js.map +0 -1
- package/dist/tooltip/useOverflowTooltip.d.ts +0 -61
- package/dist/tooltip/useOverflowTooltip.js +0 -71
- package/dist/tooltip/useOverflowTooltip.js.map +0 -1
- package/src/divider/VerticalDivider.tsx +0 -50
- package/src/divider/__tests__/VerticalDivider.tsx +0 -35
- package/src/divider/__tests__/__snapshots__/VerticalDivider.tsx.snap +0 -41
- package/src/divider/useVerticalDividerHeight.ts +0 -72
- package/src/icon/MaterialIconsProvider.ts +0 -23
- package/src/link/LinkProvider.tsx +0 -51
- package/src/tooltip/__tests__/useOverflowTooltip.tsx +0 -77
- package/src/tooltip/useOverflowTooltip.ts +0 -93
package/dist/menu/Menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/menu/Menu.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useEffect,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { useFocusContainer } from \"../focus/useFocusContainer.js\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { type ListElement, type ListProps } from \"../list/List.js\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport { type GetDefaultFocusedIndex } from \"../movement/types.js\";\nimport { Portal } from \"../portal/Portal.js\";\nimport { type CalculateFixedPositionOptions } from \"../positioning/types.js\";\nimport {\n useFixedPositioning,\n type FixedPositioningOptions,\n} from \"../positioning/useFixedPositioning.js\";\nimport { useScrollLock } from \"../scroll/useScrollLock.js\";\nimport {\n useScaleTransition,\n type ScaleTransitionHookOptions,\n} from \"../transition/useScaleTransition.js\";\nimport { type LabelRequiredForA11y, type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport {\n MenuConfigurationProvider,\n useMenuConfiguration,\n type MenuConfiguration,\n type MenuOrientationProps,\n} from \"./MenuConfigurationProvider.js\";\nimport { MenuSheet, type MenuSheetConvenienceProps } from \"./MenuSheet.js\";\nimport { MenuWidget } from \"./MenuWidget.js\";\nimport { useMenuBarContext } from \"./useMenuBarProvider.js\";\nimport { getDefaultAnchor } from \"./utils.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-menu-background-color\"?: string;\n \"--rmd-menu-color\"?: string;\n \"--rmd-menu-min-width\"?: string | number;\n \"--rmd-menu-spacing\"?: string | number;\n }\n}\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @remarks \\@since 5.0.0 */\nexport type MenuTransitionProps = Omit<\n ScaleTransitionHookOptions<HTMLDivElement>,\n \"transitionIn\" | \"vertical\" | \"nodeRef\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface MenuConfigurationProps extends CalculateFixedPositionOptions {\n /**\n * @see {@link ScaleTransitionHookOptions.temporary}\n * @defaultValue `true`\n */\n temporary?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disablePortal?: boolean;\n\n /**\n * Boolean if the menu should not gain the elevation styles and should only be\n * set to `true` when rendering within a `Sheet`.\n *\n * @defaultValue `false`\n */\n disableElevation?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * @see {@link FixedPositioningOptions.transformOrigin}\n * @defaultValue `true`\n */\n transformOrigin?: boolean;\n\n /**\n * Boolean if the menu should close if the page is scrolled. The default\n * behavior is to just update the position of the menu relative to the menu\n * button until it can no longer be visible within the viewport.\n *\n * @defaultValue `false`\n */\n closeOnScroll?: boolean;\n\n /**\n * Boolean if the page should no longer be scrollable while the menu is\n * visible.\n *\n * @defaultValue `false`\n */\n preventScroll?: boolean;\n\n /**\n * Boolean if the menu should close instead of repositioning itself if the\n * browser window is resized.\n *\n * @defaultValue `false`\n */\n closeOnResize?: boolean;\n\n /** @see {@link FixedPositioningOptions.getFixedPositionOptions} */\n getFixedPositionOptions?(): CalculateFixedPositionOptions;\n}\n\n/**\n * @remarks\n * \\@since 5.1.0\n * \\@since 6.0.0 Renamed from `MenuListProps` to `MenuListConvenienceProps`\n */\nexport interface MenuListConvenienceProps {\n /**\n * An optional style to provide to the `List` component that surrounds the\n * `MenuItem` within a `Menu`.\n */\n listStyle?: CSSProperties;\n\n /**\n * An optional className to provide to the `List` component that surrounds the\n * `MenuItem` within a `Menu`.\n */\n listClassName?: string;\n\n /**\n * Any additional props to pass to the `List` component that surrounds the\n * `Menu`'s `MenuItem`s.\n */\n listProps?: PropsWithRef<Omit<ListProps, \"horizontal\">, ListElement>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface MenuConvenienceProps extends MenuConfigurationProps {\n /**\n * This can be used to apply additional props to the `Menu` component.\n *\n * Note: You can override the `style` and `className` using\n * {@link menuStyle} and {@link menuClassName} instead for convenience.\n *\n * @example\n * ```tsx\n * <DropdownMenu\n * {...props}\n * menuProps={{\n * style: {\n * // custom inline style\n * },\n * className: \"come-class-name\",\n * getFixedPositionOptions: () => ({\n * preventOverlap: true,\n * }),\n * }}\n * />\n * ```\n */\n menuProps?: PropsWithRef<\n Omit<\n MenuProps,\n | \"children\"\n | \"fixedTo\"\n | \"visible\"\n | \"onRequestClose\"\n | \"getDefaultFocusedIndex\"\n >,\n HTMLDivElement\n >;\n\n /**\n * Convenience prop to apply custom style to the `Menu` component.\n */\n menuStyle?: CSSProperties;\n\n /**\n * Convenience prop to apply custom class name to the `Menu` component.\n */\n menuClassName?: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type MenuFixedPositioningOptions = Omit<\n FixedPositioningOptions<HTMLElement, HTMLDivElement>,\n \"onScroll\" | \"onResize\"\n>;\n\n/**\n * @remarks\n * \\@since 5.0.0\n * \\@since 6.0.0 Updated to use the latest Menu, Transition, and Portal API.\n */\nexport interface MenuProps\n extends HTMLAttributes<HTMLDivElement>,\n MenuConfiguration,\n MenuConfigurationProps,\n MenuFixedPositioningOptions,\n MenuOrientationProps,\n MenuTransitionProps,\n MenuListConvenienceProps,\n MenuSheetConvenienceProps {\n visible: boolean;\n onRequestClose(): void;\n\n /**\n * @defaultValue `\"menu-\" + useId()`\n */\n id?: string;\n\n /**\n * This is used to set the default focus index when the menu is visible.\n *\n * @internal\n */\n getDefaultFocusedIndex?: GetDefaultFocusedIndex;\n\n /**\n * Custom style that should be applied to the menu only while not rendered\n * within a sheet since the {@link style} would be applied to both versions.\n */\n menuStyle?: CSSProperties;\n\n /**\n * Custom class name that should be applied only while not rendered within a\n * sheet.\n */\n menuClassName?: string;\n}\n\n/**\n * **Client Component**\n *\n * This component should generally only be used to implement context menus with\n * the `useContextMenu` hook. Otherwise, the `DropdownMenu` component should be\n * used.\n *\n * @see The `useContextMenu` hook for an example.\n *\n * @remarks\n * \\@since 5.0.0\n * \\@since 6.0.0 Updated this component to implement all the `Menu`\n * functionality instead of requiring the `useMenu` hook and `MenuWidget`\n * component. In addition, the `renderAsSheet` behavior has been moved into this\n * implementation so that the `MenuRenderer` is no longer required and context\n * menus can appear as a `Sheet`.\n */\nexport const Menu = forwardRef<HTMLDivElement, LabelRequiredForA11y<MenuProps>>(\n function Menu(props, propRef) {\n const {\n id: propId,\n style: propStyle,\n role = \"menu\",\n children,\n horizontal: _horizontal,\n sheetHeader: _sheetHeader,\n sheetFooter: _sheetFooter,\n renderAsSheet: _renderAsSheet,\n sheetPosition: _sheetPosition,\n sheetVerticalSize: _sheetVerticalSize,\n sheetProps,\n sheetStyle,\n sheetClassName,\n menuStyle,\n menuClassName,\n disableElevation = false,\n temporary = true,\n tabIndex = -1,\n fixedTo,\n className,\n classNames,\n timeout,\n appear,\n enter,\n exit,\n onEnter,\n onEntering = noop,\n onEntered = noop,\n onExit,\n onExiting,\n onExited = noop,\n onKeyDown = noop,\n listProps,\n listStyle,\n listClassName,\n visible,\n onRequestClose,\n anchor,\n closeOnResize = false,\n closeOnScroll = false,\n preventScroll = false,\n vwMargin,\n vhMargin,\n xMargin,\n yMargin,\n width,\n transformOrigin = true,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n getFixedPositionOptions,\n disablePortal: propDisablePortal,\n disableTransition,\n ...remaining\n } = props;\n const { \"aria-label\": ariaLabel, \"aria-labelledby\": ariaLabelledBy } =\n props;\n\n const id = useEnsuredId(propId, \"menu\");\n const {\n root,\n menubar,\n menuitem,\n activeId,\n animatedOnceRef,\n hoverTimeoutRef,\n disableHoverMode,\n } = useMenuBarContext();\n const {\n horizontal,\n sheetHeader,\n sheetFooter,\n renderAsSheet,\n sheetPosition,\n sheetVerticalSize,\n } = useMenuConfiguration(props);\n const { isPhone } = useAppSize();\n const isSheet =\n renderAsSheet === true || (renderAsSheet === \"phone\" && isPhone);\n\n const entered = useRef(false);\n const cancelUnmountFocus = useRef(false);\n const hideWithoutRefocus = (): void => {\n cancelUnmountFocus.current = true;\n onRequestClose();\n };\n const mode = useUserInteractionMode();\n const mouse = mode === \"mouse\";\n\n const { eventHandlers, transitionOptions } = useFocusContainer({\n nodeRef: propRef,\n activate: visible,\n onKeyDown(event) {\n onKeyDown(event);\n\n // when a menu is within a sheet, it should not trigger the custom\n // keyboard behavior\n if (isSheet) {\n return;\n }\n\n switch (event.key) {\n case \"Escape\":\n // prevent parent components that have an \"Escape\" keypress event\n // from being triggered as well\n event.stopPropagation();\n disableHoverMode();\n onRequestClose();\n break;\n case \"Tab\":\n // since menus are portalled, tab index is kinda broke so just close\n // the menu instead of doing default tab behavior\n event.preventDefault();\n\n if (!menuitem) {\n // pressing the tab key should still cascade close all menus\n event.stopPropagation();\n }\n disableHoverMode();\n onRequestClose();\n break;\n case \"ArrowUp\":\n if (!root && menuitem && horizontal) {\n event.stopPropagation();\n event.preventDefault();\n onRequestClose();\n }\n break;\n case \"ArrowLeft\":\n if (!root && menuitem && !horizontal) {\n event.stopPropagation();\n event.preventDefault();\n onRequestClose();\n }\n break;\n }\n },\n onEntering(appearing) {\n onEntering(appearing);\n entered.current = true;\n },\n onEntered(appearing) {\n onEntered(appearing);\n entered.current = true;\n cancelUnmountFocus.current = false;\n animatedOnceRef.current = true;\n },\n onExited() {\n onExited();\n entered.current = false;\n },\n onExiting,\n disableTransition,\n isFocusTypeDisabled(type) {\n if (role === \"listbox\") {\n return !isSheet;\n }\n\n if (type === \"keyboard\") {\n return isSheet;\n }\n\n const isHoverDisabled = mouse && hoverTimeoutRef.current === 0;\n if (type === \"mount\") {\n return isHoverDisabled;\n }\n\n return (\n isHoverDisabled ||\n cancelUnmountFocus.current ||\n (root && !!activeId && id !== activeId)\n );\n },\n });\n\n const { ref, style, callbacks } = useFixedPositioning({\n ...transitionOptions,\n onEnter,\n style: isSheet ? propStyle : menuStyle,\n fixedTo,\n anchor: getDefaultAnchor({\n anchor,\n menubar,\n menuitem: !root && menuitem,\n horizontal,\n }),\n vwMargin,\n vhMargin,\n xMargin,\n yMargin,\n width,\n transformOrigin,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n getFixedPositionOptions,\n onResize: closeOnResize ? hideWithoutRefocus : undefined,\n onScroll(_event, data) {\n if (!data.visible || closeOnScroll) {\n hideWithoutRefocus();\n }\n },\n });\n const { rendered, disablePortal, elementProps } = useScaleTransition({\n nodeRef: ref,\n className: cnb(!isSheet && menuClassName, className),\n transitionIn: visible,\n vertical: !horizontal,\n temporary,\n timeout: isSheet || disableTransition ? 0 : timeout,\n classNames,\n appear,\n enter,\n exit,\n onExit,\n onExiting: transitionOptions.onExiting,\n exitedHidden: true,\n ...callbacks,\n });\n useScrollLock(visible && preventScroll);\n\n // need to make sure that the useEffect does not refire for hiding on click\n // events because of the `window.requestAnimationFrame`. It'll make it so\n // that menu items that update state are unable to close when clicked\n const hide = useRef(onRequestClose);\n useEffect(() => {\n hide.current = onRequestClose;\n });\n useEffect(() => {\n if (!visible) {\n return;\n }\n\n const callback = (event: globalThis.MouseEvent): void => {\n // this is required for when the transition is disabled\n if (!entered.current) {\n return;\n }\n\n // if the user clicks outside of the menu to close it, the toggle button\n // should not be focused. instead the nearest focusable element from the\n // click event should be focused when Tab or Shift + tab is pressed\n cancelUnmountFocus.current =\n !(event.target instanceof HTMLElement) ||\n !event.target.closest(`[role=\"${role}\"]`);\n\n // this won't be called if `event.stopPropagation()` is called\n hide.current();\n disableHoverMode();\n };\n\n // wait an animation frame so the initial click event that caused the menu\n // to become visible does not immediately close the menu\n const frame = window.requestAnimationFrame(() => {\n window.addEventListener(\"click\", callback);\n });\n\n return () => {\n window.cancelAnimationFrame(frame);\n window.removeEventListener(\"click\", callback);\n };\n }, [disableHoverMode, role, visible]);\n\n return (\n <MenuConfigurationProvider\n horizontal={horizontal}\n renderAsSheet={renderAsSheet}\n sheetFooter={sheetFooter}\n sheetHeader={sheetHeader}\n sheetPosition={sheetPosition}\n sheetVerticalSize={sheetVerticalSize}\n >\n <MenuSheet\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy as string}\n header={sheetHeader}\n footer={sheetFooter}\n position={sheetPosition}\n verticalSize={sheetVerticalSize}\n visible={visible}\n enabled={isSheet}\n onRequestClose={onRequestClose}\n style={sheetStyle}\n className={sheetClassName}\n disablePortal={propDisablePortal}\n temporary={temporary}\n disableTransition={disableTransition}\n {...sheetProps}\n >\n <Portal disabled={isSheet || (propDisablePortal ?? disablePortal)}>\n {(rendered || isSheet) && (\n <MenuWidget\n {...remaining}\n {...elementProps}\n {...eventHandlers}\n id={id}\n role={role}\n style={isSheet ? propStyle : style}\n isSheet={isSheet}\n tabIndex={tabIndex}\n horizontal={horizontal}\n listProps={listProps}\n listStyle={listStyle}\n listClassName={listClassName}\n disableElevation={disableElevation}\n cancelUnmountFocus={cancelUnmountFocus}\n >\n {children}\n </MenuWidget>\n )}\n </Portal>\n </MenuSheet>\n </MenuConfigurationProvider>\n );\n }\n);\n"],"names":["cnb","forwardRef","useEffect","useRef","useFocusContainer","useUserInteractionMode","useAppSize","Portal","useFixedPositioning","useScrollLock","useScaleTransition","useEnsuredId","MenuConfigurationProvider","useMenuConfiguration","MenuSheet","MenuWidget","useMenuBarContext","getDefaultAnchor","noop","Menu","props","propRef","id","propId","style","propStyle","role","children","horizontal","_horizontal","sheetHeader","_sheetHeader","sheetFooter","_sheetFooter","renderAsSheet","_renderAsSheet","sheetPosition","_sheetPosition","sheetVerticalSize","_sheetVerticalSize","sheetProps","sheetStyle","sheetClassName","menuStyle","menuClassName","disableElevation","temporary","tabIndex","fixedTo","className","classNames","timeout","appear","enter","exit","onEnter","onEntering","onEntered","onExit","onExiting","onExited","onKeyDown","listProps","listStyle","listClassName","visible","onRequestClose","anchor","closeOnResize","closeOnScroll","preventScroll","vwMargin","vhMargin","xMargin","yMargin","width","transformOrigin","preventOverlap","disableSwapping","disableVHBounds","initialX","initialY","getFixedPositionOptions","disablePortal","propDisablePortal","disableTransition","remaining","ariaLabel","ariaLabelledBy","root","menubar","menuitem","activeId","animatedOnceRef","hoverTimeoutRef","disableHoverMode","isPhone","isSheet","entered","cancelUnmountFocus","hideWithoutRefocus","current","mode","mouse","eventHandlers","transitionOptions","nodeRef","activate","event","key","stopPropagation","preventDefault","appearing","isFocusTypeDisabled","type","isHoverDisabled","ref","callbacks","onResize","undefined","onScroll","_event","data","rendered","elementProps","transitionIn","vertical","exitedHidden","hide","callback","target","HTMLElement","closest","frame","window","requestAnimationFrame","addEventListener","cancelAnimationFrame","removeEventListener","aria-label","aria-labelledby","header","footer","position","verticalSize","enabled","disabled"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,EACVC,SAAS,EACTC,MAAM,QAGD,QAAQ;AACf,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,sBAAsB,QAAQ,gDAAgD;AAEvF,SAASC,UAAU,QAAQ,sCAAsC;AAEjE,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,SACEC,mBAAmB,QAEd,wCAAwC;AAC/C,SAASC,aAAa,QAAQ,6BAA6B;AAC3D,SACEC,kBAAkB,QAEb,sCAAsC;AAE7C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SACEC,yBAAyB,EACzBC,oBAAoB,QAGf,iCAAiC;AACxC,SAASC,SAAS,QAAw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YACXuC,mBAAmBA;YAClB,GAAG7C,UAAU;sBAEd,cAAA,KAACjC;gBAAO2I,UAAUjD,WAAYb,CAAAA,qBAAqBD,aAAY;0BAC5D,AAACwC,CAAAA,YAAY1B,OAAM,mBAClB,KAAClF;oBACE,GAAGuE,SAAS;oBACZ,GAAGsC,YAAY;oBACf,GAAGpB,aAAa;oBACjBlF,IAAIA;oBACJI,MAAMA;oBACNF,OAAOyE,UAAUxE,YAAYD;oBAC7ByE,SAASA;oBACTlD,UAAUA;oBACVnB,YAAYA;oBACZkC,WAAWA;oBACXC,WAAWA;oBACXC,eAAeA;oBACfnB,kBAAkBA;oBAClBsD,oBAAoBA;8BAEnBxE;;;;;AAOf,GACA"}
|
|
1
|
+
{"version":3,"sources":["../../src/menu/Menu.tsx"],"sourcesContent":["\"use client\";\nimport { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useEffect,\n useRef,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { type FloatingActionButtonPosition } from \"../button/FloatingActionButton.jsx\";\nimport { useFocusContainer } from \"../focus/useFocusContainer.js\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { type ListElement, type ListProps } from \"../list/List.js\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport { type GetDefaultFocusedIndex } from \"../movement/types.js\";\nimport { Portal } from \"../portal/Portal.js\";\nimport { type CalculateFixedPositionOptions } from \"../positioning/types.js\";\nimport {\n useFixedPositioning,\n type FixedPositioningOptions,\n} from \"../positioning/useFixedPositioning.js\";\nimport { useScrollLock } from \"../scroll/useScrollLock.js\";\nimport {\n useScaleTransition,\n type ScaleTransitionHookOptions,\n} from \"../transition/useScaleTransition.js\";\nimport { type LabelRequiredForA11y, type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport {\n MenuConfigurationProvider,\n useMenuConfiguration,\n type MenuConfiguration,\n type MenuOrientationProps,\n} from \"./MenuConfigurationProvider.js\";\nimport { MenuSheet, type MenuSheetConvenienceProps } from \"./MenuSheet.js\";\nimport { MenuWidget } from \"./MenuWidget.js\";\nimport { useMenuBarContext } from \"./useMenuBarProvider.js\";\nimport { getDefaultAnchor } from \"./utils.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-menu-background-color\"?: string;\n \"--rmd-menu-color\"?: string;\n \"--rmd-menu-min-width\"?: string | number;\n \"--rmd-menu-spacing\"?: string | number;\n }\n}\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @remarks \\@since 5.0.0 */\nexport type MenuTransitionProps = Omit<\n ScaleTransitionHookOptions<HTMLDivElement>,\n \"transitionIn\" | \"vertical\" | \"nodeRef\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface MenuConfigurationProps extends CalculateFixedPositionOptions {\n /**\n * @see {@link ScaleTransitionHookOptions.temporary}\n * @defaultValue `true`\n */\n temporary?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disablePortal?: boolean;\n\n /**\n * Boolean if the menu should not gain the elevation styles and should only be\n * set to `true` when rendering within a `Sheet`.\n *\n * @defaultValue `false`\n */\n disableElevation?: boolean;\n\n /**\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * @see {@link FixedPositioningOptions.transformOrigin}\n * @defaultValue `true`\n */\n transformOrigin?: boolean;\n\n /**\n * Boolean if the menu should close if the page is scrolled. The default\n * behavior is to just update the position of the menu relative to the menu\n * button until it can no longer be visible within the viewport.\n *\n * @defaultValue `false`\n */\n closeOnScroll?: boolean;\n\n /**\n * Boolean if the page should no longer be scrollable while the menu is\n * visible.\n *\n * @defaultValue `false`\n */\n preventScroll?: boolean;\n\n /**\n * Boolean if the menu should close instead of repositioning itself if the\n * browser window is resized.\n *\n * @defaultValue `false`\n */\n closeOnResize?: boolean;\n\n /** @see {@link FixedPositioningOptions.getFixedPositionOptions} */\n getFixedPositionOptions?(): CalculateFixedPositionOptions;\n}\n\n/**\n * @remarks\n * \\@since 5.1.0\n * \\@since 6.0.0 Renamed from `MenuListProps` to `MenuListConvenienceProps`\n */\nexport interface MenuListConvenienceProps {\n /**\n * An optional style to provide to the `List` component that surrounds the\n * `MenuItem` within a `Menu`.\n */\n listStyle?: CSSProperties;\n\n /**\n * An optional className to provide to the `List` component that surrounds the\n * `MenuItem` within a `Menu`.\n */\n listClassName?: string;\n\n /**\n * Any additional props to pass to the `List` component that surrounds the\n * `Menu`'s `MenuItem`s.\n */\n listProps?: PropsWithRef<Omit<ListProps, \"horizontal\">, ListElement>;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface MenuConvenienceProps extends MenuConfigurationProps {\n /**\n * This can be used to apply additional props to the `Menu` component.\n *\n * Note: You can override the `style` and `className` using\n * {@link menuStyle} and {@link menuClassName} instead for convenience.\n *\n * @example\n * ```tsx\n * <DropdownMenu\n * {...props}\n * menuProps={{\n * style: {\n * // custom inline style\n * },\n * className: \"come-class-name\",\n * getFixedPositionOptions: () => ({\n * preventOverlap: true,\n * }),\n * }}\n * />\n * ```\n */\n menuProps?: PropsWithRef<\n Omit<\n MenuProps,\n | \"children\"\n | \"fixedTo\"\n | \"visible\"\n | \"onRequestClose\"\n | \"getDefaultFocusedIndex\"\n >,\n HTMLDivElement\n >;\n\n /**\n * Convenience prop to apply custom style to the `Menu` component.\n */\n menuStyle?: CSSProperties;\n\n /**\n * Convenience prop to apply custom class name to the `Menu` component.\n */\n menuClassName?: string;\n}\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type MenuFixedPositioningOptions = Omit<\n FixedPositioningOptions<HTMLElement, HTMLDivElement>,\n \"onScroll\" | \"onResize\"\n>;\n\n/**\n * @remarks\n * \\@since 5.0.0\n * \\@since 6.0.0 Updated to use the latest Menu, Transition, and Portal API.\n */\nexport interface MenuProps\n extends HTMLAttributes<HTMLDivElement>,\n MenuConfiguration,\n MenuConfigurationProps,\n MenuFixedPositioningOptions,\n MenuOrientationProps,\n MenuTransitionProps,\n MenuListConvenienceProps,\n MenuSheetConvenienceProps {\n visible: boolean;\n onRequestClose(): void;\n\n /**\n * @defaultValue `\"menu-\" + useId()`\n */\n id?: string;\n\n /**\n * This is used to set the default focus index when the menu is visible.\n *\n * @internal\n */\n getDefaultFocusedIndex?: GetDefaultFocusedIndex;\n\n /**\n * Custom style that should be applied to the menu only while not rendered\n * within a sheet since the {@link style} would be applied to both versions.\n */\n menuStyle?: CSSProperties;\n\n /**\n * Custom class name that should be applied only while not rendered within a\n * sheet.\n */\n menuClassName?: string;\n\n /**\n * @internal\n *\n * This is only used to update the default anchor when the DropdownMenu's\n * toggle is a floating action button.\n */\n floating?: FloatingActionButtonPosition;\n}\n\n/**\n * **Client Component**\n *\n * This component should generally only be used to implement context menus with\n * the `useContextMenu` hook. Otherwise, the `DropdownMenu` component should be\n * used.\n *\n * @see The `useContextMenu` hook for an example.\n *\n * @remarks\n * \\@since 5.0.0\n * \\@since 6.0.0 Updated this component to implement all the `Menu`\n * functionality instead of requiring the `useMenu` hook and `MenuWidget`\n * component. In addition, the `renderAsSheet` behavior has been moved into this\n * implementation so that the `MenuRenderer` is no longer required and context\n * menus can appear as a `Sheet`.\n */\nexport const Menu = forwardRef<HTMLDivElement, LabelRequiredForA11y<MenuProps>>(\n function Menu(props, propRef) {\n const {\n id: propId,\n style: propStyle,\n role = \"menu\",\n children,\n horizontal: _horizontal,\n sheetHeader: _sheetHeader,\n sheetFooter: _sheetFooter,\n renderAsSheet: _renderAsSheet,\n sheetPosition: _sheetPosition,\n sheetVerticalSize: _sheetVerticalSize,\n sheetProps,\n sheetStyle,\n sheetClassName,\n menuStyle,\n menuClassName,\n disableElevation = false,\n temporary = true,\n tabIndex = -1,\n fixedTo,\n className,\n classNames,\n timeout,\n appear,\n enter,\n exit,\n onEnter,\n onEntering = noop,\n onEntered = noop,\n onExit,\n onExiting,\n onExited = noop,\n onKeyDown = noop,\n listProps,\n listStyle,\n listClassName,\n visible,\n onRequestClose,\n floating,\n anchor,\n closeOnResize = false,\n closeOnScroll = false,\n preventScroll = false,\n vwMargin,\n vhMargin,\n xMargin,\n yMargin,\n width,\n transformOrigin = true,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n getFixedPositionOptions,\n disablePortal: propDisablePortal,\n disableTransition,\n ...remaining\n } = props;\n const { \"aria-label\": ariaLabel, \"aria-labelledby\": ariaLabelledBy } =\n props;\n\n const id = useEnsuredId(propId, \"menu\");\n const {\n root,\n menubar,\n menuitem,\n activeId,\n animatedOnceRef,\n hoverTimeoutRef,\n disableHoverMode,\n } = useMenuBarContext();\n const {\n horizontal,\n sheetHeader,\n sheetFooter,\n renderAsSheet,\n sheetPosition,\n sheetVerticalSize,\n } = useMenuConfiguration(props);\n const { isPhone } = useAppSize();\n const isSheet =\n renderAsSheet === true || (renderAsSheet === \"phone\" && isPhone);\n\n const entered = useRef(false);\n const cancelUnmountFocus = useRef(false);\n const hideWithoutRefocus = (): void => {\n cancelUnmountFocus.current = true;\n onRequestClose();\n };\n const mode = useUserInteractionMode();\n const mouse = mode === \"mouse\";\n\n const { eventHandlers, transitionOptions } = useFocusContainer({\n nodeRef: propRef,\n activate: visible,\n onKeyDown(event) {\n onKeyDown(event);\n\n // when a menu is within a sheet, it should not trigger the custom\n // keyboard behavior\n if (isSheet) {\n return;\n }\n\n switch (event.key) {\n case \"Escape\":\n // prevent parent components that have an \"Escape\" keypress event\n // from being triggered as well\n event.stopPropagation();\n disableHoverMode();\n onRequestClose();\n break;\n case \"Tab\":\n // since menus are portalled, tab index is kinda broke so just close\n // the menu instead of doing default tab behavior\n event.preventDefault();\n\n if (!menuitem) {\n // pressing the tab key should still cascade close all menus\n event.stopPropagation();\n }\n disableHoverMode();\n onRequestClose();\n break;\n case \"ArrowUp\":\n if (!root && menuitem && horizontal) {\n event.stopPropagation();\n event.preventDefault();\n onRequestClose();\n }\n break;\n case \"ArrowLeft\":\n if (!root && menuitem && !horizontal) {\n event.stopPropagation();\n event.preventDefault();\n onRequestClose();\n }\n break;\n }\n },\n onEntering(appearing) {\n onEntering(appearing);\n entered.current = true;\n },\n onEntered(appearing) {\n onEntered(appearing);\n entered.current = true;\n cancelUnmountFocus.current = false;\n animatedOnceRef.current = true;\n },\n onExited() {\n onExited();\n entered.current = false;\n },\n onExiting,\n disableTransition,\n isFocusTypeDisabled(type) {\n if (role === \"listbox\") {\n return !isSheet;\n }\n\n if (type === \"keyboard\") {\n return isSheet;\n }\n\n const isHoverDisabled = mouse && hoverTimeoutRef.current === 0;\n if (type === \"mount\") {\n return isHoverDisabled;\n }\n\n return (\n isHoverDisabled ||\n cancelUnmountFocus.current ||\n (root && !!activeId && id !== activeId)\n );\n },\n });\n\n const { ref, style, callbacks } = useFixedPositioning({\n ...transitionOptions,\n onEnter,\n style: isSheet ? propStyle : menuStyle,\n fixedTo,\n anchor: getDefaultAnchor({\n anchor,\n menubar,\n floating,\n menuitem: !root && menuitem,\n horizontal,\n }),\n vwMargin,\n vhMargin,\n xMargin,\n yMargin,\n width,\n transformOrigin,\n preventOverlap,\n disableSwapping,\n disableVHBounds,\n initialX,\n initialY,\n getFixedPositionOptions,\n onResize: closeOnResize ? hideWithoutRefocus : undefined,\n onScroll(_event, data) {\n if (!data.visible || closeOnScroll) {\n hideWithoutRefocus();\n }\n },\n });\n const { rendered, disablePortal, elementProps } = useScaleTransition({\n nodeRef: ref,\n className: cnb(!isSheet && menuClassName, className),\n transitionIn: visible,\n vertical: !horizontal,\n temporary,\n timeout: isSheet || disableTransition ? 0 : timeout,\n classNames,\n appear,\n enter,\n exit,\n onExit,\n onExiting: transitionOptions.onExiting,\n exitedHidden: true,\n ...callbacks,\n });\n useScrollLock(visible && preventScroll);\n\n // need to make sure that the useEffect does not refire for hiding on click\n // events because of the `window.requestAnimationFrame`. It'll make it so\n // that menu items that update state are unable to close when clicked\n const hide = useRef(onRequestClose);\n useEffect(() => {\n hide.current = onRequestClose;\n });\n useEffect(() => {\n if (!visible) {\n return;\n }\n\n const callback = (event: globalThis.MouseEvent): void => {\n // this is required for when the transition is disabled\n if (!entered.current) {\n return;\n }\n\n // if the user clicks outside of the menu to close it, the toggle button\n // should not be focused. instead the nearest focusable element from the\n // click event should be focused when Tab or Shift + tab is pressed\n cancelUnmountFocus.current =\n !(event.target instanceof HTMLElement) ||\n !event.target.closest(`[role=\"${role}\"]`);\n\n // this won't be called if `event.stopPropagation()` is called\n hide.current();\n disableHoverMode();\n };\n\n // wait an animation frame so the initial click event that caused the menu\n // to become visible does not immediately close the menu\n const frame = window.requestAnimationFrame(() => {\n window.addEventListener(\"click\", callback);\n });\n\n return () => {\n window.cancelAnimationFrame(frame);\n window.removeEventListener(\"click\", callback);\n };\n }, [disableHoverMode, role, visible]);\n\n return (\n <MenuConfigurationProvider\n horizontal={horizontal}\n renderAsSheet={renderAsSheet}\n sheetFooter={sheetFooter}\n sheetHeader={sheetHeader}\n sheetPosition={sheetPosition}\n sheetVerticalSize={sheetVerticalSize}\n >\n <MenuSheet\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy as string}\n header={sheetHeader}\n footer={sheetFooter}\n position={sheetPosition}\n verticalSize={sheetVerticalSize}\n visible={visible}\n enabled={isSheet}\n onRequestClose={onRequestClose}\n style={sheetStyle}\n className={sheetClassName}\n disablePortal={propDisablePortal}\n temporary={temporary}\n disableTransition={disableTransition}\n {...sheetProps}\n >\n <Portal disabled={isSheet || (propDisablePortal ?? disablePortal)}>\n {(rendered || isSheet) && (\n <MenuWidget\n {...remaining}\n {...elementProps}\n {...eventHandlers}\n id={id}\n role={role}\n style={isSheet ? propStyle : style}\n isSheet={isSheet}\n tabIndex={tabIndex}\n horizontal={horizontal}\n listProps={listProps}\n listStyle={listStyle}\n listClassName={listClassName}\n disableElevation={disableElevation}\n cancelUnmountFocus={cancelUnmountFocus}\n >\n {children}\n </MenuWidget>\n )}\n </Portal>\n </MenuSheet>\n </MenuConfigurationProvider>\n );\n }\n);\n"],"names":["cnb","forwardRef","useEffect","useRef","useFocusContainer","useUserInteractionMode","useAppSize","Portal","useFixedPositioning","useScrollLock","useScaleTransition","useEnsuredId","MenuConfigurationProvider","useMenuConfiguration","MenuSheet","MenuWidget","useMenuBarContext","getDefaultAnchor","noop","Menu","props","propRef","id","propId","style","propStyle","role","children","horizontal","_horizontal","sheetHeader","_sheetHeader","sheetFooter","_sheetFooter","renderAsSheet","_renderAsSheet","sheetPosition","_sheetPosition","sheetVerticalSize","_sheetVerticalSize","sheetProps","sheetStyle","sheetClassName","menuStyle","menuClassName","disableElevation","temporary","tabIndex","fixedTo","className","classNames","timeout","appear","enter","exit","onEnter","onEntering","onEntered","onExit","onExiting","onExited","onKeyDown","listProps","listStyle","listClassName","visible","onRequestClose","floating","anchor","closeOnResize","closeOnScroll","preventScroll","vwMargin","vhMargin","xMargin","yMargin","width","transformOrigin","preventOverlap","disableSwapping","disableVHBounds","initialX","initialY","getFixedPositionOptions","disablePortal","propDisablePortal","disableTransition","remaining","ariaLabel","ariaLabelledBy","root","menubar","menuitem","activeId","animatedOnceRef","hoverTimeoutRef","disableHoverMode","isPhone","isSheet","entered","cancelUnmountFocus","hideWithoutRefocus","current","mode","mouse","eventHandlers","transitionOptions","nodeRef","activate","event","key","stopPropagation","preventDefault","appearing","isFocusTypeDisabled","type","isHoverDisabled","ref","callbacks","onResize","undefined","onScroll","_event","data","rendered","elementProps","transitionIn","vertical","exitedHidden","hide","callback","target","HTMLElement","closest","frame","window","requestAnimationFrame","addEventListener","cancelAnimationFrame","removeEventListener","aria-label","aria-labelledby","header","footer","position","verticalSize","enabled","disabled"],"mappings":"AAAA;;AACA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,EACVC,SAAS,EACTC,MAAM,QAGD,QAAQ;AAEf,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,sBAAsB,QAAQ,gDAAgD;AAEvF,SAASC,UAAU,QAAQ,sCAAsC;AAEjE,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,SACEC,mBAAmB,QAEd,wCAAwC;AAC/C,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D;YACZqD,mBAAiBpD;YACjBqD,QAAQhH;YACRiH,QAAQ/G;YACRgH,UAAU5G;YACV6G,cAAc3G;YACd2B,SAASA;YACTiF,SAAShD;YACThC,gBAAgBA;YAChB1C,OAAOiB;YACPQ,WAAWP;YACX0C,eAAeC;YACfvC,WAAWA;YACXwC,mBAAmBA;YAClB,GAAG9C,UAAU;sBAEd,cAAA,KAACjC;gBAAO4I,UAAUjD,WAAYb,CAAAA,qBAAqBD,aAAY;0BAC5D,AAACwC,CAAAA,YAAY1B,OAAM,mBAClB,KAACnF;oBACE,GAAGwE,SAAS;oBACZ,GAAGsC,YAAY;oBACf,GAAGpB,aAAa;oBACjBnF,IAAIA;oBACJI,MAAMA;oBACNF,OAAO0E,UAAUzE,YAAYD;oBAC7B0E,SAASA;oBACTnD,UAAUA;oBACVnB,YAAYA;oBACZkC,WAAWA;oBACXC,WAAWA;oBACXC,eAAeA;oBACfnB,kBAAkBA;oBAClBuD,oBAAoBA;8BAEnBzE;;;;;AAOf,GACA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes } from "react";
|
|
2
2
|
import { type DividerProps } from "../divider/Divider.js";
|
|
3
|
-
import { type VerticalDividerProps } from "../divider/VerticalDivider.js";
|
|
4
3
|
/** @remarks \@since 5.0.0 */
|
|
5
|
-
export interface MenuItemSeparatorProps extends HTMLAttributes<HTMLLIElement>, Pick<DividerProps, "inset" | "vertical"
|
|
4
|
+
export interface MenuItemSeparatorProps extends HTMLAttributes<HTMLLIElement>, Pick<DividerProps, "inset" | "vertical"> {
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
8
7
|
* **Client Component**
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { divider } from "../divider/styles.js";
|
|
5
|
-
import { useVerticalDividerHeight } from "../divider/useVerticalDividerHeight.js";
|
|
6
5
|
import { useMenuConfiguration } from "./MenuConfigurationProvider.js";
|
|
7
6
|
/**
|
|
8
7
|
* **Client Component**
|
|
@@ -13,18 +12,13 @@ import { useMenuConfiguration } from "./MenuConfigurationProvider.js";
|
|
|
13
12
|
*
|
|
14
13
|
* @remarks \@since 5.0.0 Renders as an `<li>` instead of a `<div>` or `<hr />`.
|
|
15
14
|
*/ export const MenuItemSeparator = /*#__PURE__*/ forwardRef(function MenuItemSeparator(props, ref) {
|
|
16
|
-
const {
|
|
15
|
+
const { className, inset, vertical: propVertical, children, ...remaining } = props;
|
|
17
16
|
const horizontal = useMenuConfiguration().horizontal;
|
|
18
17
|
const vertical = propVertical ?? horizontal;
|
|
19
|
-
const heightProps = useVerticalDividerHeight({
|
|
20
|
-
ref,
|
|
21
|
-
style,
|
|
22
|
-
maxHeight: vertical ? maxHeight ?? 1 : 0
|
|
23
|
-
});
|
|
24
18
|
return /*#__PURE__*/ _jsx("li", {
|
|
25
19
|
...remaining,
|
|
26
|
-
...heightProps,
|
|
27
20
|
"aria-orientation": vertical ? "vertical" : undefined,
|
|
21
|
+
ref: ref,
|
|
28
22
|
role: "separator",
|
|
29
23
|
className: divider({
|
|
30
24
|
inset: inset && !vertical,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/menu/MenuItemSeparator.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { type DividerProps } from \"../divider/Divider.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/menu/MenuItemSeparator.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef, type HTMLAttributes } from \"react\";\nimport { type DividerProps } from \"../divider/Divider.js\";\nimport { divider } from \"../divider/styles.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\n\n/** @remarks \\@since 5.0.0 */\nexport interface MenuItemSeparatorProps\n extends HTMLAttributes<HTMLLIElement>,\n Pick<DividerProps, \"inset\" | \"vertical\"> {}\n\n/**\n * **Client Component**\n *\n * This component renders a `<li role=\"separator\">` with the divider styles. It\n * will also automatically render itself vertically instead of horizontally if\n * the menu is rendering horizontally.\n *\n * @remarks \\@since 5.0.0 Renders as an `<li>` instead of a `<div>` or `<hr />`.\n */\nexport const MenuItemSeparator = forwardRef<\n HTMLLIElement,\n MenuItemSeparatorProps\n>(function MenuItemSeparator(props, ref) {\n const {\n className,\n inset,\n vertical: propVertical,\n children,\n ...remaining\n } = props;\n\n const horizontal = useMenuConfiguration().horizontal;\n const vertical = propVertical ?? horizontal;\n\n return (\n <li\n {...remaining}\n aria-orientation={vertical ? \"vertical\" : undefined}\n ref={ref}\n role=\"separator\"\n className={divider({ inset: inset && !vertical, vertical, className })}\n >\n {children}\n </li>\n );\n});\n"],"names":["forwardRef","divider","useMenuConfiguration","MenuItemSeparator","props","ref","className","inset","vertical","propVertical","children","remaining","horizontal","li","aria-orientation","undefined","role"],"mappings":"AAAA;;AACA,SAASA,UAAU,QAA6B,QAAQ;AAExD,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,oBAAoB,QAAQ,iCAAiC;AAOtE;;;;;;;;CAQC,GACD,OAAO,MAAMC,kCAAoBH,WAG/B,SAASG,kBAAkBC,KAAK,EAAEC,GAAG;IACrC,MAAM,EACJC,SAAS,EACTC,KAAK,EACLC,UAAUC,YAAY,EACtBC,QAAQ,EACR,GAAGC,WACJ,GAAGP;IAEJ,MAAMQ,aAAaV,uBAAuBU,UAAU;IACpD,MAAMJ,WAAWC,gBAAgBG;IAEjC,qBACE,KAACC;QACE,GAAGF,SAAS;QACbG,oBAAkBN,WAAW,aAAaO;QAC1CV,KAAKA;QACLW,MAAK;QACLV,WAAWL,QAAQ;YAAEM,OAAOA,SAAS,CAACC;YAAUA;YAAUF;QAAU;kBAEnEI;;AAGP,GAAG"}
|
package/dist/menu/MenuSheet.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import { type CSSProperties, type ReactElement, type ReactNode } from "react";
|
|
|
2
2
|
import { type BaseSheetProps } from "../sheet/Sheet.js";
|
|
3
3
|
import { type LabelRequiredForA11y, type PropsWithRef } from "../types.js";
|
|
4
4
|
import { type RenderMenuAsSheet } from "./MenuConfigurationProvider.js";
|
|
5
|
+
/**
|
|
6
|
+
* @remarks \@since 6.0.0
|
|
7
|
+
*/
|
|
8
|
+
export type MenuSheetConfigurableProps = Omit<BaseSheetProps, "visible" | "onRequestClose">;
|
|
5
9
|
/**
|
|
6
10
|
* @remarks \@since 6.0.0
|
|
7
11
|
*/
|
|
@@ -22,11 +26,12 @@ export interface MenuSheetConvenienceProps {
|
|
|
22
26
|
* // custom inline style
|
|
23
27
|
* },
|
|
24
28
|
* className: "come-class-name",
|
|
29
|
+
* horizontalSize: "touch",
|
|
25
30
|
* }}
|
|
26
31
|
* />
|
|
27
32
|
* ```
|
|
28
33
|
*/
|
|
29
|
-
sheetProps?: PropsWithRef<
|
|
34
|
+
sheetProps?: PropsWithRef<MenuSheetConfigurableProps, HTMLDivElement>;
|
|
30
35
|
/**
|
|
31
36
|
* Convenience prop to apply custom style to the `Sheet` component when the
|
|
32
37
|
* `Menu` is being rendered as a `Sheet`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/menu/MenuSheet.tsx"],"sourcesContent":["\"use client\";\nimport { type CSSProperties, type ReactElement, type ReactNode } from \"react\";\nimport { Sheet, type BaseSheetProps } from \"../sheet/Sheet.js\";\nimport { type LabelRequiredForA11y, type PropsWithRef } from \"../types.js\";\nimport { type RenderMenuAsSheet } from \"./MenuConfigurationProvider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface MenuSheetConvenienceProps {\n /**\n * This can be used to apply additional props to the `Sheet` component when\n * the `Menu` is being rendered as a `Sheet`.\n *\n * Note: You can override the `style` and `className` using\n * {@link sheetStyle} and {@link sheetClassName} instead for convenience.\n *\n * @example\n * ```tsx\n * <Menu\n * {...props}\n * sheetProps={{\n * style: {\n * // custom inline style\n * },\n * className: \"come-class-name\",\n * }}\n * />\n * ```\n */\n sheetProps?: PropsWithRef<
|
|
1
|
+
{"version":3,"sources":["../../src/menu/MenuSheet.tsx"],"sourcesContent":["\"use client\";\nimport { type CSSProperties, type ReactElement, type ReactNode } from \"react\";\nimport { Sheet, type BaseSheetProps } from \"../sheet/Sheet.js\";\nimport { type LabelRequiredForA11y, type PropsWithRef } from \"../types.js\";\nimport { type RenderMenuAsSheet } from \"./MenuConfigurationProvider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport type MenuSheetConfigurableProps = Omit<\n BaseSheetProps,\n \"visible\" | \"onRequestClose\"\n>;\n\n/**\n * @remarks \\@since 6.0.0\n */\nexport interface MenuSheetConvenienceProps {\n /**\n * This can be used to apply additional props to the `Sheet` component when\n * the `Menu` is being rendered as a `Sheet`.\n *\n * Note: You can override the `style` and `className` using\n * {@link sheetStyle} and {@link sheetClassName} instead for convenience.\n *\n * @example\n * ```tsx\n * <Menu\n * {...props}\n * sheetProps={{\n * style: {\n * // custom inline style\n * },\n * className: \"come-class-name\",\n * horizontalSize: \"touch\",\n * }}\n * />\n * ```\n */\n sheetProps?: PropsWithRef<MenuSheetConfigurableProps, HTMLDivElement>;\n\n /**\n * Convenience prop to apply custom style to the `Sheet` component when the\n * `Menu` is being rendered as a `Sheet`.\n */\n sheetStyle?: CSSProperties;\n\n /**\n * Convenience prop to apply custom class name to the `Sheet` component when\n * the `Menu` is being rendered as a `Sheet`.\n */\n sheetClassName?: string;\n}\n\n/**\n * @internal\n * @remarks\n * \\@since 5.0.0\n * \\@since 6.0.0 Updated to use the latest menu API.\n */\nexport interface MenuSheetProps extends BaseSheetProps {\n /** {@inheritDoc MenuConfiguration.sheetHeader} */\n header?: ReactNode;\n /** {@inheritDoc MenuConfiguration.sheetFooter} */\n footer?: ReactNode;\n children: ReactNode;\n\n /** @remarks \\@since 6.0.0 */\n enabled: RenderMenuAsSheet;\n}\n\n/**\n * **Client Component**\n *\n * Implements a `Menu` using the `Sheet` component that probably shouldn't\n * really be used externally.\n *\n * @internal\n * @remarks\n * \\@since 5.0.0\n * \\@since 6.0.0 Added the `enabled` prop and does not render a custom `Menu`\n * implementation.\n */\nexport function MenuSheet(\n props: LabelRequiredForA11y<MenuSheetProps>\n): ReactElement {\n const {\n header,\n footer,\n children,\n onClick = noop,\n overlayProps,\n enabled,\n ...remaining\n } = props;\n const { onRequestClose } = props;\n\n if (!enabled) {\n return <>{children}</>;\n }\n\n return (\n <Sheet\n {...remaining}\n onClick={(event) => {\n onClick(event);\n\n // Prevent closing parent sheet/menus if an element in the header or\n // footer is clicked\n if (\n !(event.target instanceof HTMLElement) ||\n event.target\n .closest('.rmd-menu,[role=\"dialog\"]')\n ?.getAttribute(\"role\") === \"dialog\"\n ) {\n event.stopPropagation();\n }\n }}\n overlayProps={{\n ...overlayProps,\n onClick: (event) => {\n overlayProps?.onClick?.(event);\n\n // prevent closing parent menus if the overlay element is clicked.\n event.stopPropagation();\n onRequestClose();\n },\n }}\n >\n {header}\n {children}\n {footer}\n </Sheet>\n );\n}\n"],"names":["Sheet","noop","MenuSheet","props","header","footer","children","onClick","overlayProps","enabled","remaining","onRequestClose","event","target","HTMLElement","closest","getAttribute","stopPropagation"],"mappings":"AAAA;;AAEA,SAASA,KAAK,QAA6B,oBAAoB;AAI/D,MAAMC,OAAO;AACX,aAAa;AACf;AAmEA;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,UACdC,KAA2C;IAE3C,MAAM,EACJC,MAAM,EACNC,MAAM,EACNC,QAAQ,EACRC,UAAUN,IAAI,EACdO,YAAY,EACZC,OAAO,EACP,GAAGC,WACJ,GAAGP;IACJ,MAAM,EAAEQ,cAAc,EAAE,GAAGR;IAE3B,IAAI,CAACM,SAAS;QACZ,qBAAO;sBAAGH;;IACZ;IAEA,qBACE,MAACN;QACE,GAAGU,SAAS;QACbH,SAAS,CAACK;YACRL,QAAQK;YAER,oEAAoE;YACpE,oBAAoB;YACpB,IACE,CAAEA,CAAAA,MAAMC,MAAM,YAAYC,WAAU,KACpCF,MAAMC,MAAM,CACTE,OAAO,CAAC,8BACPC,aAAa,YAAY,UAC7B;gBACAJ,MAAMK,eAAe;YACvB;QACF;QACAT,cAAc;YACZ,GAAGA,YAAY;YACfD,SAAS,CAACK;gBACRJ,cAAcD,UAAUK;gBAExB,kEAAkE;gBAClEA,MAAMK,eAAe;gBACrBN;YACF;QACF;;YAECP;YACAE;YACAD;;;AAGP"}
|
package/dist/menu/_menu.scss
CHANGED
|
@@ -20,41 +20,21 @@ $min-width: 7rem !default;
|
|
|
20
20
|
|
|
21
21
|
$spacing: 1rem !default;
|
|
22
22
|
|
|
23
|
-
$
|
|
24
|
-
background-color: (
|
|
25
|
-
var: --rmd-menu-background-color,
|
|
26
|
-
value: $background-color,
|
|
27
|
-
),
|
|
28
|
-
color: (
|
|
29
|
-
var: --rmd-menu-color,
|
|
30
|
-
value: $color,
|
|
31
|
-
),
|
|
32
|
-
min-width: (
|
|
33
|
-
var: --rmd-menu-min-width,
|
|
34
|
-
value: $min-width,
|
|
35
|
-
),
|
|
36
|
-
spacing: (
|
|
37
|
-
var: --rmd-menu-spacing,
|
|
38
|
-
value: $spacing,
|
|
39
|
-
),
|
|
40
|
-
);
|
|
23
|
+
$variables: (background-color, color, min-width, spacing);
|
|
41
24
|
|
|
42
25
|
@function get-var($name, $fallback: null) {
|
|
43
|
-
$
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
@if $value {
|
|
48
|
-
@return var(#{$var}, #{$value});
|
|
26
|
+
$var: utils.get-var-name($variables, $name, "menu");
|
|
27
|
+
@if $fallback {
|
|
28
|
+
@return var(#{$var}, #{$fallback});
|
|
49
29
|
}
|
|
50
30
|
|
|
51
31
|
@return var(#{$var});
|
|
52
32
|
}
|
|
53
33
|
|
|
54
34
|
@mixin set-var($name, $value) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
35
|
+
@if $value {
|
|
36
|
+
#{utils.get-var-name($variables, $name, "menu")}: #{$value};
|
|
37
|
+
}
|
|
58
38
|
}
|
|
59
39
|
|
|
60
40
|
@mixin use-var($property, $name: $property, $fallback: null) {
|
|
@@ -122,6 +102,15 @@ $var-lookup: (
|
|
|
122
102
|
}
|
|
123
103
|
}
|
|
124
104
|
|
|
105
|
+
@mixin variables {
|
|
106
|
+
@if not $disable-everything {
|
|
107
|
+
@include set-var(background-color, $background-color);
|
|
108
|
+
@include set-var(color, $color);
|
|
109
|
+
@include set-var(min-width, $min-width);
|
|
110
|
+
@include set-var(spacing, $spacing);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
125
114
|
@mixin styles {
|
|
126
115
|
@if not $disable-everything {
|
|
127
116
|
@include menu-styles;
|
|
@@ -9,39 +9,34 @@ $z-index: utils.$temporary-element-z-index !default;
|
|
|
9
9
|
$transition-duration: transition.$linear-duration !default;
|
|
10
10
|
$transition-timing-function: transition.$linear-timing-function !default;
|
|
11
11
|
|
|
12
|
-
$
|
|
13
|
-
background-color: (
|
|
14
|
-
var: --rmd-overlay-background-color,
|
|
15
|
-
value: $background-color,
|
|
16
|
-
),
|
|
17
|
-
z-index: (
|
|
18
|
-
var: --rmd-overlay-z-index,
|
|
19
|
-
value: $z-index,
|
|
20
|
-
),
|
|
21
|
-
);
|
|
12
|
+
$variables: (background-color, z-index);
|
|
22
13
|
|
|
23
14
|
@function get-var($name, $fallback: null) {
|
|
24
|
-
$
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@if $value {
|
|
29
|
-
@return var(#{$var}, #{$value});
|
|
15
|
+
$var: utils.get-var-name($variables, $name, "overlay");
|
|
16
|
+
@if $fallback {
|
|
17
|
+
@return var(#{$var}, #{$fallback});
|
|
30
18
|
}
|
|
31
19
|
|
|
32
20
|
@return var(#{$var});
|
|
33
21
|
}
|
|
34
22
|
|
|
35
23
|
@mixin set-var($name, $value) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
@if $value {
|
|
25
|
+
#{utils.get-var-name($variables, $name, "overlay")}: #{$value};
|
|
26
|
+
}
|
|
39
27
|
}
|
|
40
28
|
|
|
41
29
|
@mixin use-var($property, $name: $property, $fallback: null) {
|
|
42
30
|
#{$property}: get-var($name, $fallback);
|
|
43
31
|
}
|
|
44
32
|
|
|
33
|
+
@mixin variables {
|
|
34
|
+
@if not $disable-everything {
|
|
35
|
+
@include set-var(background-color, $background-color);
|
|
36
|
+
@include set-var(z-index, $z-index);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
45
40
|
@mixin styles {
|
|
46
41
|
@if not $disable-everything {
|
|
47
42
|
.rmd-overlay {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties, type HTMLAttributes } from "react";
|
|
2
|
+
import { type LabelRequiredForA11y } from "../types.js";
|
|
2
3
|
import { type ProgressProps } from "./types.js";
|
|
3
4
|
/**
|
|
4
5
|
* @remarks \@since 6.0.0
|
|
@@ -97,7 +98,7 @@ export interface CircularProgressProps extends Omit<HTMLAttributes<HTMLSpanEleme
|
|
|
97
98
|
* import { type ReactElement } from "react";
|
|
98
99
|
*
|
|
99
100
|
* function Example(): ReactElement {
|
|
100
|
-
* return <CircularProgress />;
|
|
101
|
+
* return <CircularProgress aria-label="Loading" />;
|
|
101
102
|
* }
|
|
102
103
|
* ```
|
|
103
104
|
*
|
|
@@ -111,11 +112,11 @@ export interface CircularProgressProps extends Omit<HTMLAttributes<HTMLSpanEleme
|
|
|
111
112
|
* // a number from 0 - 100
|
|
112
113
|
* const [progress, setProgress] = useState(0);
|
|
113
114
|
*
|
|
114
|
-
* return <CircularProgress value={progress} />;
|
|
115
|
+
* return <CircularProgress aria-label="File upload" value={progress} />;
|
|
115
116
|
* }
|
|
116
117
|
* ```
|
|
117
118
|
*
|
|
118
119
|
* @remarks \@since 6.0.0 Updated the determinate circular progress to no longer
|
|
119
|
-
* rotate while increasing the value.
|
|
120
|
+
* rotate while increasing the value and require a label for accessibility.
|
|
120
121
|
*/
|
|
121
|
-
export declare const CircularProgress: import("react").ForwardRefExoticComponent<CircularProgressProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
122
|
+
export declare const CircularProgress: import("react").ForwardRefExoticComponent<LabelRequiredForA11y<CircularProgressProps> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -16,7 +16,7 @@ const styles = bem("rmd-circular-progress");
|
|
|
16
16
|
* import { type ReactElement } from "react";
|
|
17
17
|
*
|
|
18
18
|
* function Example(): ReactElement {
|
|
19
|
-
* return <CircularProgress />;
|
|
19
|
+
* return <CircularProgress aria-label="Loading" />;
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -30,12 +30,12 @@ const styles = bem("rmd-circular-progress");
|
|
|
30
30
|
* // a number from 0 - 100
|
|
31
31
|
* const [progress, setProgress] = useState(0);
|
|
32
32
|
*
|
|
33
|
-
* return <CircularProgress value={progress} />;
|
|
33
|
+
* return <CircularProgress aria-label="File upload" value={progress} />;
|
|
34
34
|
* }
|
|
35
35
|
* ```
|
|
36
36
|
*
|
|
37
37
|
* @remarks \@since 6.0.0 Updated the determinate circular progress to no longer
|
|
38
|
-
* rotate while increasing the value.
|
|
38
|
+
* rotate while increasing the value and require a label for accessibility.
|
|
39
39
|
*/ export const CircularProgress = /*#__PURE__*/ forwardRef(function CircularProgress(props, ref) {
|
|
40
40
|
const { id: propId, className, svgStyle, svgClassName, circleStyle: propCircleStyle, circleClassName, value, min = 0, max = 100, radius = 30, center = 33, viewBox = "0 0 66 66", theme = "primary", dense = false, dashoffset = 187, disableShrink = false, disableCentered = false, disableTransition = false, ...remaining } = props;
|
|
41
41
|
const id = useEnsuredId(propId, "circular-progress");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/progress/CircularProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useMemo,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0\n * Removed the `determinateRotateDegrees` prop since the determinate state no\n * longer rotates while increasing value.\n * Added the `disableShrink` prop.\n * Renamed the `small` prop to `dense` to match other components.\n */\nexport interface CircularProgressProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"id\">,\n ProgressProps {\n /**\n * An optional style to apply to the svg within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n svgStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the svg within the circular progress.\n */\n svgClassName?: string;\n\n /**\n * An optional style to apply to the circle within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n circleStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the circle within the circular progress.\n */\n circleClassName?: string;\n\n /**\n * The radius for the circle. It is generally recommended to have the radius\n * be 1/2 of the viewbox and minus a few more pixels so that there is some\n * surrounding padding. You probably shouldn't really be changing this prop\n * though.\n *\n * @defaultValue `30`\n */\n radius?: number;\n\n /**\n * The center point for the circle. This should be half of the `viewBox` prop\n * 99% of the time and probably won't be changed.\n *\n * @defaultValue `33`\n */\n center?: number;\n\n /**\n * The viewbox for the child svg. I wouldn't recommend changing this value as\n * you will also need to update the `dashoffset` in both Sass and this prop to\n * get the animation to look nice again.\n *\n * @defaultValue `0 0 66 66`\n */\n viewBox?: string;\n\n /**\n * The `stroke-dashoffset` for the circle within the SVG. You probably won't\n * be changing this value that much as it should match the\n * `$rmd-progress-circle-dashoffset` Sass variable. This is really just used\n * to help to create the determinate progress animation.\n *\n * @defaultValue `187`\n */\n dashoffset?: number;\n\n /**\n * Boolean if the circular progress should be centered using left and right\n * margins.\n *\n * @defaultValue `false`\n */\n disableCentered?: boolean;\n\n /**\n * Set to `true` to render as a smaller size.\n *\n * @defaultValue `false`\n * @remarks\n * \\@since 2.3.0\n * \\@since 6.0.0 Renamed from `small`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the indeterminate behavior to only rotate\n * which will increase performance during CPU-intensive tasks or when many\n * loading spinners are displayed at once on the page.\n *\n * @defaultValue `false`\n * @remarks \\@since 6.0.0\n */\n disableShrink?: boolean;\n}\n\nconst styles = bem(\"rmd-circular-progress\");\n\n/**\n * **Server Component**\n *\n * @example\n * Indeterminate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core\":\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return <CircularProgress />;\n * }\n * ```\n *\n * @example\n * Determinate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core\":\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * // a number from 0 - 100\n * const [progress, setProgress] = useState(0);\n *\n * return <CircularProgress value={progress} />;\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Updated the determinate circular progress to no longer\n * rotate while increasing the value.\n */\nexport const CircularProgress = forwardRef<\n HTMLSpanElement,\n CircularProgressProps
|
|
1
|
+
{"version":3,"sources":["../../src/progress/CircularProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useMemo,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0\n * Removed the `determinateRotateDegrees` prop since the determinate state no\n * longer rotates while increasing value.\n * Added the `disableShrink` prop.\n * Renamed the `small` prop to `dense` to match other components.\n */\nexport interface CircularProgressProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"id\">,\n ProgressProps {\n /**\n * An optional style to apply to the svg within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n svgStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the svg within the circular progress.\n */\n svgClassName?: string;\n\n /**\n * An optional style to apply to the circle within the circular progress. The\n * values of this style object will be merged with the current determinate\n * style (if it exists).\n */\n circleStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the circle within the circular progress.\n */\n circleClassName?: string;\n\n /**\n * The radius for the circle. It is generally recommended to have the radius\n * be 1/2 of the viewbox and minus a few more pixels so that there is some\n * surrounding padding. You probably shouldn't really be changing this prop\n * though.\n *\n * @defaultValue `30`\n */\n radius?: number;\n\n /**\n * The center point for the circle. This should be half of the `viewBox` prop\n * 99% of the time and probably won't be changed.\n *\n * @defaultValue `33`\n */\n center?: number;\n\n /**\n * The viewbox for the child svg. I wouldn't recommend changing this value as\n * you will also need to update the `dashoffset` in both Sass and this prop to\n * get the animation to look nice again.\n *\n * @defaultValue `0 0 66 66`\n */\n viewBox?: string;\n\n /**\n * The `stroke-dashoffset` for the circle within the SVG. You probably won't\n * be changing this value that much as it should match the\n * `$rmd-progress-circle-dashoffset` Sass variable. This is really just used\n * to help to create the determinate progress animation.\n *\n * @defaultValue `187`\n */\n dashoffset?: number;\n\n /**\n * Boolean if the circular progress should be centered using left and right\n * margins.\n *\n * @defaultValue `false`\n */\n disableCentered?: boolean;\n\n /**\n * Set to `true` to render as a smaller size.\n *\n * @defaultValue `false`\n * @remarks\n * \\@since 2.3.0\n * \\@since 6.0.0 Renamed from `small`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the indeterminate behavior to only rotate\n * which will increase performance during CPU-intensive tasks or when many\n * loading spinners are displayed at once on the page.\n *\n * @defaultValue `false`\n * @remarks \\@since 6.0.0\n */\n disableShrink?: boolean;\n}\n\nconst styles = bem(\"rmd-circular-progress\");\n\n/**\n * **Server Component**\n *\n * @example\n * Indeterminate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core\":\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return <CircularProgress aria-label=\"Loading\" />;\n * }\n * ```\n *\n * @example\n * Determinate Example\n * ```tsx\n * import { CircularProgress } from \"@react-md/core\":\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * // a number from 0 - 100\n * const [progress, setProgress] = useState(0);\n *\n * return <CircularProgress aria-label=\"File upload\" value={progress} />;\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Updated the determinate circular progress to no longer\n * rotate while increasing the value and require a label for accessibility.\n */\nexport const CircularProgress = forwardRef<\n HTMLSpanElement,\n LabelRequiredForA11y<CircularProgressProps>\n>(function CircularProgress(props, ref) {\n const {\n id: propId,\n className,\n svgStyle,\n svgClassName,\n circleStyle: propCircleStyle,\n circleClassName,\n value,\n min = 0,\n max = 100,\n radius = 30,\n center = 33,\n viewBox = \"0 0 66 66\",\n theme = \"primary\",\n dense = false,\n dashoffset = 187,\n disableShrink = false,\n disableCentered = false,\n disableTransition = false,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"circular-progress\");\n let progress: number | undefined;\n if (typeof value === \"number\") {\n progress = getPercentage({ min, max, value, validate: true });\n }\n\n const circleStyle = useMemo(() => {\n if (typeof progress !== \"number\") {\n return propCircleStyle;\n }\n\n return {\n ...propCircleStyle,\n strokeDashoffset: dashoffset - dashoffset * progress,\n };\n }, [progress, propCircleStyle, dashoffset]);\n\n const determinate = typeof progress === \"number\";\n const indeterminate = !determinate;\n return (\n <span\n {...remaining}\n id={id}\n ref={ref}\n role=\"progressbar\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={value}\n className={cnb(\n styles({ dense, centered: !disableCentered }),\n theme !== \"current-color\" && cssUtils({ textColor: theme }),\n className\n )}\n >\n <svg\n style={svgStyle}\n className={cnb(\n styles(\"svg\", {\n determinate,\n indeterminate: indeterminate && !disableShrink,\n \"rotate-only\": indeterminate && disableShrink,\n }),\n svgClassName\n )}\n viewBox={viewBox}\n >\n <circle\n style={circleStyle}\n className={cnb(\n styles(\"circle\", {\n animate: !disableTransition && determinate,\n determinate,\n indeterminate: indeterminate && !disableShrink,\n \"rotate-only\": indeterminate && disableShrink,\n }),\n circleClassName\n )}\n r={radius}\n cx={center}\n cy={center}\n />\n </svg>\n </span>\n );\n});\n"],"names":["cnb","forwardRef","useMemo","cssUtils","useEnsuredId","bem","getPercentage","styles","CircularProgress","props","ref","id","propId","className","svgStyle","svgClassName","circleStyle","propCircleStyle","circleClassName","value","min","max","radius","center","viewBox","theme","dense","dashoffset","disableShrink","disableCentered","disableTransition","remaining","progress","validate","strokeDashoffset","determinate","indeterminate","span","role","aria-valuemin","aria-valuemax","aria-valuenow","centered","textColor","svg","style","circle","animate","r","cx","cy"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,EACVC,OAAO,QAGF,QAAQ;AACf,SAASC,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,aAAa,QAAQ,4BAA4B;AAuG1D,MAAMC,SAASF,IAAI;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GACD,OAAO,MAAMG,iCAAmBP,WAG9B,SAASO,iBAAiBC,KAAK,EAAEC,GAAG;IACpC,MAAM,EACJC,IAAIC,MAAM,EACVC,SAAS,EACTC,QAAQ,EACRC,YAAY,EACZC,aAAaC,eAAe,EAC5BC,eAAe,EACfC,KAAK,EACLC,MAAM,CAAC,EACPC,MAAM,GAAG,EACTC,SAAS,EAAE,EACXC,SAAS,EAAE,EACXC,UAAU,WAAW,EACrBC,QAAQ,SAAS,EACjBC,QAAQ,KAAK,EACbC,aAAa,GAAG,EAChBC,gBAAgB,KAAK,EACrBC,kBAAkB,KAAK,EACvBC,oBAAoB,KAAK,EACzB,GAAGC,WACJ,GAAGtB;IAEJ,MAAME,KAAKP,aAAaQ,QAAQ;IAChC,IAAIoB;IACJ,IAAI,OAAOb,UAAU,UAAU;QAC7Ba,WAAW1B,cAAc;YAAEc;YAAKC;YAAKF;YAAOc,UAAU;QAAK;IAC7D;IAEA,MAAMjB,cAAcd,QAAQ;QAC1B,IAAI,OAAO8B,aAAa,UAAU;YAChC,OAAOf;QACT;QAEA,OAAO;YACL,GAAGA,eAAe;YAClBiB,kBAAkBP,aAAaA,aAAaK;QAC9C;IACF,GAAG;QAACA;QAAUf;QAAiBU;KAAW;IAE1C,MAAMQ,cAAc,OAAOH,aAAa;IACxC,MAAMI,gBAAgB,CAACD;IACvB,qBACE,KAACE;QACE,GAAGN,SAAS;QACbpB,IAAIA;QACJD,KAAKA;QACL4B,MAAK;QACLC,iBAAenB;QACfoB,iBAAenB;QACfoB,iBAAetB;QACfN,WAAWb,IACTO,OAAO;YAAEmB;YAAOgB,UAAU,CAACb;QAAgB,IAC3CJ,UAAU,mBAAmBtB,SAAS;YAAEwC,WAAWlB;QAAM,IACzDZ;kBAGF,cAAA,KAAC+B;YACCC,OAAO/B;YACPD,WAAWb,IACTO,OAAO,OAAO;gBACZ4B;gBACAC,eAAeA,iBAAiB,CAACR;gBACjC,eAAeQ,iBAAiBR;YAClC,IACAb;YAEFS,SAASA;sBAET,cAAA,KAACsB;gBACCD,OAAO7B;gBACPH,WAAWb,IACTO,OAAO,UAAU;oBACfwC,SAAS,CAACjB,qBAAqBK;oBAC/BA;oBACAC,eAAeA,iBAAiB,CAACR;oBACjC,eAAeQ,iBAAiBR;gBAClC,IACAV;gBAEF8B,GAAG1B;gBACH2B,IAAI1B;gBACJ2B,IAAI3B;;;;AAKd,GAAG"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type CSSProperties, type HTMLAttributes } from "react";
|
|
2
|
+
import { type LabelRequiredForA11y } from "../types.js";
|
|
2
3
|
import { type ProgressProps } from "./types.js";
|
|
3
4
|
/**
|
|
4
5
|
* @remarks \@since 6.0.0 Added the `theme` prop
|
|
5
6
|
*/
|
|
6
|
-
export interface LinearProgressProps extends Omit<HTMLAttributes<
|
|
7
|
+
export interface LinearProgressProps extends Omit<HTMLAttributes<HTMLSpanElement>, "id" | "children">, ProgressProps {
|
|
7
8
|
/**
|
|
8
9
|
* An optional style to apply to the progress bar. This will be merged with
|
|
9
10
|
* the current width or height tracking the progress when a `value` is also
|
|
@@ -51,7 +52,7 @@ export interface LinearProgressProps extends Omit<HTMLAttributes<HTMLDivElement>
|
|
|
51
52
|
* import { type ReactElement } from "react";
|
|
52
53
|
*
|
|
53
54
|
* function Example(): ReactElement {
|
|
54
|
-
* return <LinearProgress />;
|
|
55
|
+
* return <LinearProgress aria-label="Loading" />;
|
|
55
56
|
* }
|
|
56
57
|
* ```
|
|
57
58
|
*
|
|
@@ -65,10 +66,11 @@ export interface LinearProgressProps extends Omit<HTMLAttributes<HTMLDivElement>
|
|
|
65
66
|
* // a number from 0 - 100
|
|
66
67
|
* const [progress, setProgress] = useState(0);
|
|
67
68
|
*
|
|
68
|
-
* return <LinearProgress value={progress} />;
|
|
69
|
+
* return <LinearProgress aria-label="File upload" value={progress} />;
|
|
69
70
|
* }
|
|
70
71
|
* ```
|
|
71
72
|
*
|
|
72
|
-
* @remarks \@since 6.0.0 Supports rendering as any of the theme colors
|
|
73
|
+
* @remarks \@since 6.0.0 Supports rendering as any of the theme colors and
|
|
74
|
+
* requires a label for accessibility.
|
|
73
75
|
*/
|
|
74
|
-
export declare const LinearProgress: import("react").ForwardRefExoticComponent<LinearProgressProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
76
|
+
export declare const LinearProgress: import("react").ForwardRefExoticComponent<LabelRequiredForA11y<LinearProgressProps> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -16,7 +16,7 @@ const styles = bem("rmd-linear-progress");
|
|
|
16
16
|
* import { type ReactElement } from "react";
|
|
17
17
|
*
|
|
18
18
|
* function Example(): ReactElement {
|
|
19
|
-
* return <LinearProgress />;
|
|
19
|
+
* return <LinearProgress aria-label="Loading" />;
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -30,11 +30,12 @@ const styles = bem("rmd-linear-progress");
|
|
|
30
30
|
* // a number from 0 - 100
|
|
31
31
|
* const [progress, setProgress] = useState(0);
|
|
32
32
|
*
|
|
33
|
-
* return <LinearProgress value={progress} />;
|
|
33
|
+
* return <LinearProgress aria-label="File upload" value={progress} />;
|
|
34
34
|
* }
|
|
35
35
|
* ```
|
|
36
36
|
*
|
|
37
|
-
* @remarks \@since 6.0.0 Supports rendering as any of the theme colors
|
|
37
|
+
* @remarks \@since 6.0.0 Supports rendering as any of the theme colors and
|
|
38
|
+
* requires a label for accessibility.
|
|
38
39
|
*/ export const LinearProgress = /*#__PURE__*/ forwardRef(function LinearProgress(props, ref) {
|
|
39
40
|
const { id: propId, style: propStyle, className, barStyle: propBarStyle, barClassName, min = 0, max = 100, value, reverse = false, theme = "primary", disableTransition = false, vertical = false, verticalHeight = 240, ...remaining } = props;
|
|
40
41
|
const id = useEnsuredId(propId, "linear-progress");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/progress/LinearProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useMemo,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0 Added the `theme` prop\n */\nexport interface LinearProgressProps\n extends Omit<HTMLAttributes<
|
|
1
|
+
{"version":3,"sources":["../../src/progress/LinearProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n forwardRef,\n useMemo,\n type CSSProperties,\n type HTMLAttributes,\n} from \"react\";\nimport { cssUtils } from \"../cssUtils.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { getPercentage } from \"../utils/getPercentage.js\";\nimport { type ProgressProps } from \"./types.js\";\n\n/**\n * @remarks \\@since 6.0.0 Added the `theme` prop\n */\nexport interface LinearProgressProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"id\" | \"children\">,\n ProgressProps {\n /**\n * An optional style to apply to the progress bar. This will be merged with\n * the current width or height tracking the progress when a `value` is also\n * provided.\n */\n barStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the progress bar.\n */\n barClassName?: string;\n\n /**\n * Boolean if the progress should be reversed. This will change the progress\n * direction from `left-to-right` to be `right-to-left`. If the current\n * language is a rtl language and this prop is enabled, the direction will\n * still be `left-to-right`.\n *\n * @defaultValue `false`\n */\n reverse?: boolean;\n\n /**\n * Boolean if the progress should be vertical instead of horizontal. When\n * this prop is set, you should also set the `verticalHeight` prop to a height\n * value you want for your progress bar.\n *\n * @defaultValue `false`\n */\n vertical?: boolean;\n\n /**\n * Since there isn't really a good way to have \"auto height\", you'll need to\n * manually set the progress bar's height with this prop to some pixel value.\n * If you'd prefer to set the height in Sass/css, set this value to `null`\n * instead since this value would be passed down as a `height` inline style.\n *\n * @defaultValue `240`\n */\n verticalHeight?: number | null;\n}\n\nconst styles = bem(\"rmd-linear-progress\");\n\n/**\n * **Server Component**\n *\n * @example\n * Indeterminate Example\n * ```tsx\n * import { LinearProgress } from \"@react-md/core\";\n * import { type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return <LinearProgress aria-label=\"Loading\" />;\n * }\n * ```\n *\n * @example\n * Determinate Example\n * ```tsx\n * import { LinearProgress } from \"@react-md/core\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * // a number from 0 - 100\n * const [progress, setProgress] = useState(0);\n *\n * return <LinearProgress aria-label=\"File upload\" value={progress} />;\n * }\n * ```\n *\n * @remarks \\@since 6.0.0 Supports rendering as any of the theme colors and\n * requires a label for accessibility.\n */\nexport const LinearProgress = forwardRef<\n HTMLSpanElement,\n LabelRequiredForA11y<LinearProgressProps>\n>(function LinearProgress(props, ref) {\n const {\n id: propId,\n style: propStyle,\n className,\n barStyle: propBarStyle,\n barClassName,\n min = 0,\n max = 100,\n value,\n reverse = false,\n theme = \"primary\",\n disableTransition = false,\n vertical = false,\n verticalHeight = 240,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"linear-progress\");\n const style = useMemo(() => {\n if (!vertical || verticalHeight === null) {\n return propStyle;\n }\n\n return {\n ...propStyle,\n height: verticalHeight,\n };\n }, [propStyle, vertical, verticalHeight]);\n\n let progress: number | undefined;\n if (typeof value === \"number\") {\n progress = getPercentage({ min, max, value, validate: true });\n }\n const barStyle = useMemo(() => {\n if (typeof progress !== \"number\") {\n return propBarStyle;\n }\n\n const key = vertical ? \"height\" : \"width\";\n return {\n ...propBarStyle,\n [key]: `${progress * 100}%`,\n };\n }, [progress, propBarStyle, vertical]);\n\n const determinate = typeof progress === \"number\";\n const indeterminate = !determinate;\n return (\n <span\n {...remaining}\n id={id}\n ref={ref}\n style={style}\n role=\"progressbar\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={value}\n className={cnb(\n styles({\n vertical,\n horizontal: !vertical,\n determinate,\n indeterminate,\n }),\n theme !== \"current-color\" && cssUtils({ textColor: theme }),\n className\n )}\n >\n <span\n style={barStyle}\n className={cnb(\n styles(\"bar\", {\n vertical,\n \"vertical-reverse\": vertical && reverse,\n horizontal: !vertical,\n \"horizontal-reverse\": !vertical && reverse,\n animate: !disableTransition && determinate,\n determinate,\n indeterminate,\n \"determinate-reverse\": determinate && reverse && !vertical,\n \"determinate-vertical-reverse\": determinate && reverse && vertical,\n \"indeterminate-reverse\": indeterminate && reverse && !vertical,\n \"indeterminate-vertical\": indeterminate && vertical,\n \"indeterminate-vertical-reverse\":\n indeterminate && reverse && vertical,\n }),\n barClassName\n )}\n />\n </span>\n );\n});\n"],"names":["cnb","forwardRef","useMemo","cssUtils","useEnsuredId","bem","getPercentage","styles","LinearProgress","props","ref","id","propId","style","propStyle","className","barStyle","propBarStyle","barClassName","min","max","value","reverse","theme","disableTransition","vertical","verticalHeight","remaining","height","progress","validate","key","determinate","indeterminate","span","role","aria-valuemin","aria-valuemax","aria-valuenow","horizontal","textColor","animate"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SACEC,UAAU,EACVC,OAAO,QAGF,QAAQ;AACf,SAASC,QAAQ,QAAQ,iBAAiB;AAE1C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,aAAa,QAAQ,4BAA4B;AAmD1D,MAAMC,SAASF,IAAI;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GACD,OAAO,MAAMG,+BAAiBP,WAG5B,SAASO,eAAeC,KAAK,EAAEC,GAAG;IAClC,MAAM,EACJC,IAAIC,MAAM,EACVC,OAAOC,SAAS,EAChBC,SAAS,EACTC,UAAUC,YAAY,EACtBC,YAAY,EACZC,MAAM,CAAC,EACPC,MAAM,GAAG,EACTC,KAAK,EACLC,UAAU,KAAK,EACfC,QAAQ,SAAS,EACjBC,oBAAoB,KAAK,EACzBC,WAAW,KAAK,EAChBC,iBAAiB,GAAG,EACpB,GAAGC,WACJ,GAAGlB;IAEJ,MAAME,KAAKP,aAAaQ,QAAQ;IAChC,MAAMC,QAAQX,QAAQ;QACpB,IAAI,CAACuB,YAAYC,mBAAmB,MAAM;YACxC,OAAOZ;QACT;QAEA,OAAO;YACL,GAAGA,SAAS;YACZc,QAAQF;QACV;IACF,GAAG;QAACZ;QAAWW;QAAUC;KAAe;IAExC,IAAIG;IACJ,IAAI,OAAOR,UAAU,UAAU;QAC7BQ,WAAWvB,cAAc;YAAEa;YAAKC;YAAKC;YAAOS,UAAU;QAAK;IAC7D;IACA,MAAMd,WAAW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