@react-md/core 6.5.1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_utils.scss +3 -0
- package/dist/app-bar/AppBar.d.ts +3 -2
- package/dist/app-bar/AppBar.js +3 -4
- package/dist/app-bar/AppBar.js.map +1 -1
- package/dist/app-bar/AppBarTitle.d.ts +3 -1
- package/dist/app-bar/AppBarTitle.js +3 -4
- package/dist/app-bar/AppBarTitle.js.map +1 -1
- package/dist/autocomplete/AutocompleteChip.d.ts +2 -1
- package/dist/autocomplete/AutocompleteChip.js +3 -4
- package/dist/autocomplete/AutocompleteChip.js.map +1 -1
- package/dist/autocomplete/types.d.ts +1 -0
- package/dist/autocomplete/types.js.map +1 -1
- package/dist/autocomplete/utils.d.ts +4 -4
- package/dist/autocomplete/utils.js.map +1 -1
- package/dist/avatar/Avatar.d.ts +3 -2
- package/dist/avatar/Avatar.js +3 -4
- package/dist/avatar/Avatar.js.map +1 -1
- package/dist/badge/Badge.d.ts +3 -2
- package/dist/badge/Badge.js +3 -4
- package/dist/badge/Badge.js.map +1 -1
- package/dist/box/Box.d.ts +3 -2
- package/dist/box/Box.js +3 -4
- package/dist/box/Box.js.map +1 -1
- package/dist/button/AsyncButton.d.ts +3 -2
- package/dist/button/AsyncButton.js +3 -4
- package/dist/button/AsyncButton.js.map +1 -1
- package/dist/button/Button.d.ts +3 -2
- package/dist/button/Button.js +3 -4
- package/dist/button/Button.js.map +1 -1
- package/dist/button/ButtonUnstyled.d.ts +5 -3
- package/dist/button/ButtonUnstyled.js +3 -4
- package/dist/button/ButtonUnstyled.js.map +1 -1
- package/dist/button/FloatingActionButton.d.ts +3 -2
- package/dist/button/FloatingActionButton.js +3 -4
- package/dist/button/FloatingActionButton.js.map +1 -1
- package/dist/button/TooltippedButton.d.ts +3 -2
- package/dist/button/TooltippedButton.js +3 -4
- package/dist/button/TooltippedButton.js.map +1 -1
- package/dist/card/Card.d.ts +3 -2
- package/dist/card/Card.js +3 -4
- package/dist/card/Card.js.map +1 -1
- package/dist/card/CardContent.d.ts +3 -2
- package/dist/card/CardContent.js +3 -4
- package/dist/card/CardContent.js.map +1 -1
- package/dist/card/CardFooter.d.ts +3 -1
- package/dist/card/CardFooter.js +3 -4
- package/dist/card/CardFooter.js.map +1 -1
- package/dist/card/CardHeader.d.ts +3 -2
- package/dist/card/CardHeader.js +3 -4
- package/dist/card/CardHeader.js.map +1 -1
- package/dist/card/CardSubtitle.d.ts +3 -1
- package/dist/card/CardSubtitle.js +3 -4
- package/dist/card/CardSubtitle.js.map +1 -1
- package/dist/card/CardTitle.d.ts +3 -1
- package/dist/card/CardTitle.js +3 -4
- package/dist/card/CardTitle.js.map +1 -1
- package/dist/card/ClickableCard.d.ts +3 -2
- package/dist/card/ClickableCard.js +3 -4
- package/dist/card/ClickableCard.js.map +1 -1
- package/dist/chip/Chip.d.ts +4 -2
- package/dist/chip/Chip.js +4 -4
- package/dist/chip/Chip.js.map +1 -1
- package/dist/datetime/NativeDateField.d.ts +3 -1
- package/dist/datetime/NativeDateField.js +3 -4
- package/dist/datetime/NativeDateField.js.map +1 -1
- package/dist/datetime/NativeTimeField.d.ts +3 -1
- package/dist/datetime/NativeTimeField.js +3 -4
- package/dist/datetime/NativeTimeField.js.map +1 -1
- package/dist/dialog/Dialog.d.ts +3 -2
- package/dist/dialog/Dialog.js +4 -4
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/DialogContainer.d.ts +3 -2
- package/dist/dialog/DialogContainer.js +3 -4
- package/dist/dialog/DialogContainer.js.map +1 -1
- package/dist/dialog/DialogContent.d.ts +3 -2
- package/dist/dialog/DialogContent.js +3 -4
- package/dist/dialog/DialogContent.js.map +1 -1
- package/dist/dialog/DialogFooter.d.ts +3 -2
- package/dist/dialog/DialogFooter.js +3 -4
- package/dist/dialog/DialogFooter.js.map +1 -1
- package/dist/dialog/DialogHeader.d.ts +3 -1
- package/dist/dialog/DialogHeader.js +3 -4
- package/dist/dialog/DialogHeader.js.map +1 -1
- package/dist/dialog/DialogTitle.d.ts +3 -1
- package/dist/dialog/DialogTitle.js +3 -4
- package/dist/dialog/DialogTitle.js.map +1 -1
- package/dist/dialog/FixedDialog.d.ts +4 -3
- package/dist/dialog/FixedDialog.js +4 -4
- package/dist/dialog/FixedDialog.js.map +1 -1
- package/dist/divider/Divider.d.ts +3 -2
- package/dist/divider/Divider.js +3 -4
- package/dist/divider/Divider.js.map +1 -1
- package/dist/draggable/useDraggable.d.ts +3 -3
- package/dist/draggable/useDraggable.js.map +1 -1
- package/dist/draggable/utils.d.ts +1 -1
- package/dist/draggable/utils.js.map +1 -1
- package/dist/expansion-panel/ExpansionList.d.ts +3 -2
- package/dist/expansion-panel/ExpansionList.js +3 -4
- package/dist/expansion-panel/ExpansionList.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanel.d.ts +3 -2
- package/dist/expansion-panel/ExpansionPanel.js +3 -4
- package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
- package/dist/expansion-panel/ExpansionPanelHeader.d.ts +3 -2
- package/dist/expansion-panel/ExpansionPanelHeader.js +3 -4
- package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
- package/dist/files/FileInput.d.ts +3 -2
- package/dist/files/FileInput.js +3 -4
- package/dist/files/FileInput.js.map +1 -1
- package/dist/focus/useFocusContainer.d.ts +1 -1
- package/dist/focus/useFocusContainer.js.map +1 -1
- package/dist/form/Checkbox.d.ts +2 -1
- package/dist/form/Checkbox.js +4 -4
- package/dist/form/Checkbox.js.map +1 -1
- package/dist/form/Fieldset.d.ts +3 -2
- package/dist/form/Fieldset.js +3 -4
- package/dist/form/Fieldset.js.map +1 -1
- package/dist/form/Form.d.ts +3 -2
- package/dist/form/Form.js +3 -4
- package/dist/form/Form.js.map +1 -1
- package/dist/form/FormMessage.d.ts +8 -2
- package/dist/form/FormMessage.js +3 -4
- package/dist/form/FormMessage.js.map +1 -1
- package/dist/form/FormMessageContainer.d.ts +5 -4
- package/dist/form/FormMessageContainer.js +3 -4
- package/dist/form/FormMessageContainer.js.map +1 -1
- package/dist/form/FormMessageCounter.d.ts +3 -2
- package/dist/form/FormMessageCounter.js +3 -4
- package/dist/form/FormMessageCounter.js.map +1 -1
- package/dist/form/InputToggle.d.ts +3 -2
- package/dist/form/InputToggle.js +3 -4
- package/dist/form/InputToggle.js.map +1 -1
- package/dist/form/InputToggleIcon.d.ts +3 -2
- package/dist/form/InputToggleIcon.js +3 -4
- package/dist/form/InputToggleIcon.js.map +1 -1
- package/dist/form/Label.d.ts +2 -1
- package/dist/form/Label.js +3 -4
- package/dist/form/Label.js.map +1 -1
- package/dist/form/Legend.d.ts +3 -1
- package/dist/form/Legend.js +3 -4
- package/dist/form/Legend.js.map +1 -1
- package/dist/form/NativeSelect.d.ts +3 -2
- package/dist/form/NativeSelect.js +3 -4
- package/dist/form/NativeSelect.js.map +1 -1
- package/dist/form/OptGroup.d.ts +3 -2
- package/dist/form/OptGroup.js +3 -4
- package/dist/form/OptGroup.js.map +1 -1
- package/dist/form/Option.d.ts +3 -2
- package/dist/form/Option.js +4 -4
- package/dist/form/Option.js.map +1 -1
- package/dist/form/Password.d.ts +2 -2
- package/dist/form/Password.js +3 -4
- package/dist/form/Password.js.map +1 -1
- package/dist/form/Radio.d.ts +2 -1
- package/dist/form/Radio.js +4 -4
- package/dist/form/Radio.js.map +1 -1
- package/dist/form/ResizingTextAreaWrapper.d.ts +3 -2
- package/dist/form/ResizingTextAreaWrapper.js +3 -4
- package/dist/form/ResizingTextAreaWrapper.js.map +1 -1
- package/dist/form/SliderContainer.d.ts +3 -2
- package/dist/form/SliderContainer.js +3 -4
- package/dist/form/SliderContainer.js.map +1 -1
- package/dist/form/SliderThumb.d.ts +3 -2
- package/dist/form/SliderThumb.js +4 -4
- package/dist/form/SliderThumb.js.map +1 -1
- package/dist/form/SliderTrack.d.ts +3 -2
- package/dist/form/SliderTrack.js +3 -4
- package/dist/form/SliderTrack.js.map +1 -1
- package/dist/form/Switch.d.ts +3 -2
- package/dist/form/Switch.js +3 -4
- package/dist/form/Switch.js.map +1 -1
- package/dist/form/SwitchTrack.d.ts +3 -2
- package/dist/form/SwitchTrack.js +3 -4
- package/dist/form/SwitchTrack.js.map +1 -1
- package/dist/form/TextArea.d.ts +3 -2
- package/dist/form/TextArea.js +3 -4
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextField.d.ts +3 -2
- package/dist/form/TextField.js +3 -4
- package/dist/form/TextField.js.map +1 -1
- package/dist/form/TextFieldAddon.d.ts +2 -1
- package/dist/form/TextFieldAddon.js +3 -4
- package/dist/form/TextFieldAddon.js.map +1 -1
- package/dist/form/TextFieldContainer.d.ts +3 -2
- package/dist/form/TextFieldContainer.js +3 -4
- package/dist/form/TextFieldContainer.js.map +1 -1
- package/dist/form/sliderUtils.d.ts +1 -1
- package/dist/form/sliderUtils.js.map +1 -1
- package/dist/form/types.d.ts +11 -5
- package/dist/form/types.js.map +1 -1
- package/dist/form/useCombobox.d.ts +6 -6
- package/dist/form/useCombobox.js.map +1 -1
- package/dist/form/useFormReset.d.ts +1 -1
- package/dist/form/useFormReset.js.map +1 -1
- package/dist/form/useTextField.d.ts +4 -4
- package/dist/form/useTextField.js.map +1 -1
- package/dist/hoverMode/useHoverMode.js +1 -1
- package/dist/hoverMode/useHoverMode.js.map +1 -1
- package/dist/hoverMode/useHoverModeProvider.d.ts +5 -5
- package/dist/hoverMode/useHoverModeProvider.js +1 -1
- package/dist/hoverMode/useHoverModeProvider.js.map +1 -1
- package/dist/icon/FontIcon.d.ts +3 -2
- package/dist/icon/FontIcon.js +3 -4
- package/dist/icon/FontIcon.js.map +1 -1
- package/dist/icon/IconRotator.d.ts +3 -2
- package/dist/icon/IconRotator.js +4 -4
- package/dist/icon/IconRotator.js.map +1 -1
- package/dist/icon/MaterialIcon.d.ts +3 -2
- package/dist/icon/MaterialIcon.js +3 -4
- package/dist/icon/MaterialIcon.js.map +1 -1
- package/dist/icon/MaterialSymbol.d.ts +3 -2
- package/dist/icon/MaterialSymbol.js +3 -4
- package/dist/icon/MaterialSymbol.js.map +1 -1
- package/dist/icon/SVGIcon.d.ts +3 -2
- package/dist/icon/SVGIcon.js +3 -4
- package/dist/icon/SVGIcon.js.map +1 -1
- package/dist/layout/LayoutAppBar.d.ts +3 -1
- package/dist/layout/LayoutAppBar.js +3 -4
- package/dist/layout/LayoutAppBar.js.map +1 -1
- package/dist/layout/LayoutNav.d.ts +3 -2
- package/dist/layout/LayoutNav.js +3 -4
- package/dist/layout/LayoutNav.js.map +1 -1
- package/dist/layout/LayoutWindowSplitter.d.ts +4 -2
- package/dist/layout/LayoutWindowSplitter.js +4 -4
- package/dist/layout/LayoutWindowSplitter.js.map +1 -1
- package/dist/layout/Main.d.ts +4 -3
- package/dist/layout/Main.js +3 -4
- package/dist/layout/Main.js.map +1 -1
- package/dist/link/Link.d.ts +10 -2
- package/dist/link/Link.js +4 -4
- package/dist/link/Link.js.map +1 -1
- package/dist/link/SkipToMainContent.d.ts +3 -2
- package/dist/link/SkipToMainContent.js +4 -4
- package/dist/link/SkipToMainContent.js.map +1 -1
- package/dist/list/List.d.ts +3 -2
- package/dist/list/List.js +3 -4
- package/dist/list/List.js.map +1 -1
- package/dist/list/ListItem.d.ts +3 -2
- package/dist/list/ListItem.js +3 -4
- package/dist/list/ListItem.js.map +1 -1
- package/dist/list/ListItemLink.d.ts +3 -2
- package/dist/list/ListItemLink.js +3 -4
- package/dist/list/ListItemLink.js.map +1 -1
- package/dist/list/ListItemText.d.ts +3 -2
- package/dist/list/ListItemText.js +3 -4
- package/dist/list/ListItemText.js.map +1 -1
- package/dist/list/ListSubheader.d.ts +3 -2
- package/dist/list/ListSubheader.js +3 -4
- package/dist/list/ListSubheader.js.map +1 -1
- package/dist/menu/DropdownMenu.js.map +1 -1
- package/dist/menu/Menu.d.ts +4 -2
- package/dist/menu/Menu.js +5 -4
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/MenuBar.d.ts +3 -1
- package/dist/menu/MenuBar.js +3 -4
- package/dist/menu/MenuBar.js.map +1 -1
- package/dist/menu/MenuButton.d.ts +2 -1
- package/dist/menu/MenuButton.js +3 -4
- package/dist/menu/MenuButton.js.map +1 -1
- package/dist/menu/MenuItem.d.ts +3 -1
- package/dist/menu/MenuItem.js +3 -4
- package/dist/menu/MenuItem.js.map +1 -1
- package/dist/menu/MenuItemButton.d.ts +2 -1
- package/dist/menu/MenuItemButton.js +4 -4
- package/dist/menu/MenuItemButton.js.map +1 -1
- package/dist/menu/MenuItemCheckbox.d.ts +2 -1
- package/dist/menu/MenuItemCheckbox.js +4 -4
- package/dist/menu/MenuItemCheckbox.js.map +1 -1
- package/dist/menu/MenuItemCircularProgress.d.ts +3 -2
- package/dist/menu/MenuItemCircularProgress.js +3 -4
- package/dist/menu/MenuItemCircularProgress.js.map +1 -1
- package/dist/menu/MenuItemFileInput.d.ts +2 -2
- package/dist/menu/MenuItemFileInput.js +3 -4
- package/dist/menu/MenuItemFileInput.js.map +1 -1
- package/dist/menu/MenuItemGroup.d.ts +3 -3
- package/dist/menu/MenuItemGroup.js +4 -4
- package/dist/menu/MenuItemGroup.js.map +1 -1
- package/dist/menu/MenuItemInputToggle.d.ts +3 -2
- package/dist/menu/MenuItemInputToggle.js +3 -4
- package/dist/menu/MenuItemInputToggle.js.map +1 -1
- package/dist/menu/MenuItemRadio.d.ts +3 -1
- package/dist/menu/MenuItemRadio.js +4 -4
- package/dist/menu/MenuItemRadio.js.map +1 -1
- package/dist/menu/MenuItemSeparator.d.ts +3 -2
- package/dist/menu/MenuItemSeparator.js +3 -4
- package/dist/menu/MenuItemSeparator.js.map +1 -1
- package/dist/menu/MenuItemSwitch.d.ts +2 -1
- package/dist/menu/MenuItemSwitch.js +4 -4
- package/dist/menu/MenuItemSwitch.js.map +1 -1
- package/dist/menu/MenuItemTextField.d.ts +2 -2
- package/dist/menu/MenuItemTextField.js +3 -4
- package/dist/menu/MenuItemTextField.js.map +1 -1
- package/dist/menu/MenuVisibilityProvider.d.ts +3 -3
- package/dist/menu/MenuVisibilityProvider.js.map +1 -1
- package/dist/menu/MenuWidget.d.ts +4 -4
- package/dist/menu/MenuWidget.js +4 -4
- package/dist/menu/MenuWidget.js.map +1 -1
- package/dist/menu/useContextMenu.d.ts +4 -4
- package/dist/menu/useContextMenu.js.map +1 -1
- package/dist/movement/types.d.ts +5 -5
- package/dist/movement/types.js.map +1 -1
- package/dist/navigation/CollapsibleNavGroup.d.ts +2 -2
- package/dist/navigation/CollapsibleNavGroup.js +3 -4
- package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
- package/dist/navigation/NavGroup.d.ts +3 -2
- package/dist/navigation/NavGroup.js +3 -4
- package/dist/navigation/NavGroup.js.map +1 -1
- package/dist/navigation/NavItem.d.ts +3 -2
- package/dist/navigation/NavItem.js +3 -4
- package/dist/navigation/NavItem.js.map +1 -1
- package/dist/navigation/NavItemButton.d.ts +2 -2
- package/dist/navigation/NavItemButton.js +3 -4
- package/dist/navigation/NavItemButton.js.map +1 -1
- package/dist/navigation/NavItemLink.d.ts +3 -2
- package/dist/navigation/NavItemLink.js +4 -4
- package/dist/navigation/NavItemLink.js.map +1 -1
- package/dist/navigation/NavSubheader.d.ts +2 -1
- package/dist/navigation/NavSubheader.js +3 -4
- package/dist/navigation/NavSubheader.js.map +1 -1
- package/dist/navigation/Navigation.d.ts +1 -1
- package/dist/navigation/Navigation.js +1 -1
- package/dist/navigation/Navigation.js.map +1 -1
- package/dist/navigation/types.d.ts +5 -2
- package/dist/navigation/types.js.map +1 -1
- package/dist/navigation/useActiveHeadingId.js +1 -1
- package/dist/navigation/useActiveHeadingId.js.map +1 -1
- package/dist/overlay/Overlay.d.ts +3 -2
- package/dist/overlay/Overlay.js +3 -4
- package/dist/overlay/Overlay.js.map +1 -1
- package/dist/positioning/useFixedPositioning.d.ts +1 -1
- package/dist/positioning/useFixedPositioning.js.map +1 -1
- package/dist/progress/CircularProgress.d.ts +2 -2
- package/dist/progress/CircularProgress.js +4 -4
- package/dist/progress/CircularProgress.js.map +1 -1
- package/dist/progress/LinearProgress.d.ts +2 -2
- package/dist/progress/LinearProgress.js +4 -4
- package/dist/progress/LinearProgress.js.map +1 -1
- package/dist/progress/types.d.ts +2 -0
- package/dist/progress/types.js.map +1 -1
- package/dist/responsive-item/ResponsiveItem.d.ts +3 -2
- package/dist/responsive-item/ResponsiveItem.js +3 -4
- package/dist/responsive-item/ResponsiveItem.js.map +1 -1
- package/dist/responsive-item/ResponsiveItemOverlay.d.ts +3 -2
- package/dist/responsive-item/ResponsiveItemOverlay.js +3 -4
- package/dist/responsive-item/ResponsiveItemOverlay.js.map +1 -1
- package/dist/segmented-button/SegmentedButton.d.ts +3 -2
- package/dist/segmented-button/SegmentedButton.js +3 -4
- package/dist/segmented-button/SegmentedButton.js.map +1 -1
- package/dist/segmented-button/SegmentedButtonContainer.d.ts +4 -3
- package/dist/segmented-button/SegmentedButtonContainer.js +4 -5
- package/dist/segmented-button/SegmentedButtonContainer.js.map +1 -1
- package/dist/sheet/Sheet.d.ts +2 -1
- package/dist/sheet/Sheet.js +3 -4
- package/dist/sheet/Sheet.js.map +1 -1
- package/dist/snackbar/Snackbar.d.ts +3 -2
- package/dist/snackbar/Snackbar.js +3 -4
- package/dist/snackbar/Snackbar.js.map +1 -1
- package/dist/snackbar/Toast.d.ts +3 -2
- package/dist/snackbar/Toast.js +4 -4
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/snackbar/ToastActionButton.d.ts +2 -1
- package/dist/snackbar/ToastActionButton.js +3 -4
- package/dist/snackbar/ToastActionButton.js.map +1 -1
- package/dist/snackbar/ToastCloseButton.d.ts +2 -1
- package/dist/snackbar/ToastCloseButton.js +3 -4
- package/dist/snackbar/ToastCloseButton.js.map +1 -1
- package/dist/snackbar/ToastContent.d.ts +3 -2
- package/dist/snackbar/ToastContent.js +4 -4
- package/dist/snackbar/ToastContent.js.map +1 -1
- package/dist/spinbutton/SpinButton.d.ts +4 -3
- package/dist/spinbutton/SpinButton.js +3 -4
- package/dist/spinbutton/SpinButton.js.map +1 -1
- package/dist/spinbutton/types.d.ts +1 -1
- package/dist/spinbutton/types.js.map +1 -1
- package/dist/table/StickyTableSection.d.ts +3 -2
- package/dist/table/StickyTableSection.js +3 -4
- package/dist/table/StickyTableSection.js.map +1 -1
- package/dist/table/Table.d.ts +3 -2
- package/dist/table/Table.js +4 -4
- package/dist/table/Table.js.map +1 -1
- package/dist/table/TableBody.d.ts +3 -2
- package/dist/table/TableBody.js +4 -4
- package/dist/table/TableBody.js.map +1 -1
- package/dist/table/TableCell.d.ts +3 -2
- package/dist/table/TableCell.js +3 -4
- package/dist/table/TableCell.js.map +1 -1
- package/dist/table/TableCellContent.d.ts +3 -2
- package/dist/table/TableCellContent.js +3 -4
- package/dist/table/TableCellContent.js.map +1 -1
- package/dist/table/TableCheckbox.d.ts +3 -2
- package/dist/table/TableCheckbox.js +3 -4
- package/dist/table/TableCheckbox.js.map +1 -1
- package/dist/table/TableContainer.d.ts +5 -3
- package/dist/table/TableContainer.js +4 -4
- package/dist/table/TableContainer.js.map +1 -1
- package/dist/table/TableContainerProvider.d.ts +1 -1
- package/dist/table/TableContainerProvider.js.map +1 -1
- package/dist/table/TableFooter.d.ts +3 -2
- package/dist/table/TableFooter.js +4 -5
- package/dist/table/TableFooter.js.map +1 -1
- package/dist/table/TableHeader.d.ts +3 -2
- package/dist/table/TableHeader.js +4 -5
- package/dist/table/TableHeader.js.map +1 -1
- package/dist/table/TableRadio.d.ts +3 -2
- package/dist/table/TableRadio.js +3 -4
- package/dist/table/TableRadio.js.map +1 -1
- package/dist/table/TableRow.d.ts +3 -2
- package/dist/table/TableRow.js +3 -4
- package/dist/table/TableRow.js.map +1 -1
- package/dist/tabs/SimpleTabPanel.d.ts +3 -2
- package/dist/tabs/SimpleTabPanel.js +3 -4
- package/dist/tabs/SimpleTabPanel.js.map +1 -1
- package/dist/tabs/SimpleTabPanels.d.ts +3 -2
- package/dist/tabs/SimpleTabPanels.js +3 -4
- package/dist/tabs/SimpleTabPanels.js.map +1 -1
- package/dist/tabs/TabList.d.ts +3 -2
- package/dist/tabs/TabList.js +4 -4
- package/dist/tabs/TabList.js.map +1 -1
- package/dist/tabs/TabListScrollButton.d.ts +3 -2
- package/dist/tabs/TabListScrollButton.js +4 -4
- package/dist/tabs/TabListScrollButton.js.map +1 -1
- package/dist/tabs/useTabList.d.ts +2 -2
- package/dist/tabs/useTabList.js.map +1 -1
- package/dist/theme/useCSSVariables.d.ts +1 -1
- package/dist/theme/useCSSVariables.js.map +1 -1
- package/dist/tooltip/Tooltip.d.ts +3 -2
- package/dist/tooltip/Tooltip.js +3 -4
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/useTooltip.d.ts +3 -3
- package/dist/tooltip/useTooltip.js.map +1 -1
- package/dist/transition/SkeletonPlaceholder.d.ts +3 -2
- package/dist/transition/SkeletonPlaceholder.js +3 -4
- package/dist/transition/SkeletonPlaceholder.js.map +1 -1
- package/dist/transition/Slide.d.ts +3 -2
- package/dist/transition/Slide.js +3 -4
- package/dist/transition/Slide.js.map +1 -1
- package/dist/transition/SlideContainer.d.ts +3 -2
- package/dist/transition/SlideContainer.js +3 -4
- package/dist/transition/SlideContainer.js.map +1 -1
- package/dist/tree/TreeGroup.d.ts +2 -2
- package/dist/tree/TreeGroup.js +3 -4
- package/dist/tree/TreeGroup.js.map +1 -1
- package/dist/tree/TreeProvider.d.ts +2 -3
- package/dist/tree/TreeProvider.js.map +1 -1
- package/dist/tree/useTreeMovement.d.ts +6 -7
- package/dist/tree/useTreeMovement.js.map +1 -1
- package/dist/types.d.ts +1 -15
- package/dist/types.js.map +1 -1
- package/dist/typography/Mark.d.ts +3 -2
- package/dist/typography/Mark.js +3 -4
- package/dist/typography/Mark.js.map +1 -1
- package/dist/typography/SrOnly.d.ts +3 -2
- package/dist/typography/SrOnly.js +3 -4
- package/dist/typography/SrOnly.js.map +1 -1
- package/dist/typography/TextContainer.d.ts +3 -2
- package/dist/typography/TextContainer.js +3 -4
- package/dist/typography/TextContainer.js.map +1 -1
- package/dist/typography/Typography.d.ts +3 -2
- package/dist/typography/Typography.js +3 -4
- package/dist/typography/Typography.js.map +1 -1
- package/dist/useAsyncFunction.d.ts +3 -2
- package/dist/useAsyncFunction.js.map +1 -1
- package/dist/useDebouncedFunction.js +1 -1
- package/dist/useDebouncedFunction.js.map +1 -1
- package/dist/useDropzone.js +1 -1
- package/dist/useDropzone.js.map +1 -1
- package/dist/useEnsuredRef.d.ts +3 -3
- package/dist/useEnsuredRef.js +1 -1
- package/dist/useEnsuredRef.js.map +1 -1
- package/dist/useThrottledFunction.js +3 -3
- package/dist/useThrottledFunction.js.map +1 -1
- package/dist/useUnmounted.d.ts +2 -2
- package/dist/useUnmounted.js.map +1 -1
- package/dist/utils/applyRef.d.ts +1 -1
- package/dist/utils/applyRef.js.map +1 -1
- package/dist/window-splitter/WindowSplitter.d.ts +3 -2
- package/dist/window-splitter/WindowSplitter.js +3 -4
- package/dist/window-splitter/WindowSplitter.js.map +1 -1
- package/package.json +9 -9
- package/src/app-bar/AppBar.tsx +54 -54
- package/src/app-bar/AppBarTitle.tsx +29 -27
- package/src/autocomplete/AutocompleteChip.tsx +4 -6
- package/src/autocomplete/types.ts +2 -0
- package/src/autocomplete/utils.ts +4 -4
- package/src/avatar/Avatar.tsx +47 -45
- package/src/badge/Badge.tsx +17 -11
- package/src/box/Box.tsx +51 -50
- package/src/button/AsyncButton.tsx +125 -119
- package/src/button/Button.tsx +74 -73
- package/src/button/ButtonUnstyled.tsx +9 -9
- package/src/button/FloatingActionButton.tsx +9 -7
- package/src/button/TooltippedButton.tsx +6 -6
- package/src/card/Card.tsx +36 -35
- package/src/card/CardContent.tsx +31 -28
- package/src/card/CardFooter.tsx +22 -16
- package/src/card/CardHeader.tsx +36 -30
- package/src/card/CardSubtitle.tsx +8 -6
- package/src/card/CardTitle.tsx +26 -25
- package/src/card/ClickableCard.tsx +57 -54
- package/src/chip/Chip.tsx +122 -120
- package/src/datetime/NativeDateField.tsx +7 -7
- package/src/datetime/NativeTimeField.tsx +7 -7
- package/src/dialog/Dialog.tsx +156 -150
- package/src/dialog/DialogContainer.tsx +35 -29
- package/src/dialog/DialogContent.tsx +26 -19
- package/src/dialog/DialogFooter.tsx +22 -19
- package/src/dialog/DialogHeader.tsx +24 -23
- package/src/dialog/DialogTitle.tsx +27 -26
- package/src/dialog/FixedDialog.tsx +70 -69
- package/src/divider/Divider.tsx +32 -26
- package/src/draggable/useDraggable.ts +3 -6
- package/src/draggable/utils.ts +1 -1
- package/src/expansion-panel/ExpansionList.tsx +24 -19
- package/src/expansion-panel/ExpansionPanel.tsx +11 -6
- package/src/expansion-panel/ExpansionPanelHeader.tsx +9 -6
- package/src/files/FileInput.tsx +79 -79
- package/src/focus/useFocusContainer.ts +1 -1
- package/src/form/Checkbox.tsx +6 -6
- package/src/form/Fieldset.tsx +33 -28
- package/src/form/Form.tsx +26 -25
- package/src/form/FormMessage.tsx +13 -7
- package/src/form/FormMessageContainer.tsx +12 -9
- package/src/form/FormMessageCounter.tsx +8 -7
- package/src/form/InputToggle.tsx +105 -107
- package/src/form/InputToggleIcon.tsx +12 -6
- package/src/form/Label.tsx +40 -41
- package/src/form/Legend.tsx +44 -43
- package/src/form/NativeSelect.tsx +116 -114
- package/src/form/OptGroup.tsx +15 -15
- package/src/form/Option.tsx +123 -122
- package/src/form/Password.tsx +66 -67
- package/src/form/Radio.tsx +6 -6
- package/src/form/ResizingTextAreaWrapper.tsx +7 -6
- package/src/form/SliderContainer.tsx +35 -29
- package/src/form/SliderThumb.tsx +8 -6
- package/src/form/SliderTrack.tsx +80 -80
- package/src/form/Switch.tsx +80 -79
- package/src/form/SwitchTrack.tsx +35 -34
- package/src/form/TextArea.tsx +167 -165
- package/src/form/TextField.tsx +106 -104
- package/src/form/TextFieldAddon.tsx +33 -32
- package/src/form/TextFieldContainer.tsx +8 -6
- package/src/form/sliderUtils.ts +1 -1
- package/src/form/types.ts +15 -5
- package/src/form/useCombobox.ts +6 -10
- package/src/form/useFormReset.ts +1 -1
- package/src/form/useTextField.ts +4 -4
- package/src/hoverMode/useHoverMode.ts +1 -1
- package/src/hoverMode/useHoverModeProvider.ts +13 -8
- package/src/icon/FontIcon.tsx +32 -30
- package/src/icon/IconRotator.tsx +30 -28
- package/src/icon/MaterialIcon.tsx +36 -30
- package/src/icon/MaterialSymbol.tsx +50 -44
- package/src/icon/SVGIcon.tsx +47 -41
- package/src/layout/LayoutAppBar.tsx +23 -28
- package/src/layout/LayoutNav.tsx +68 -62
- package/src/layout/LayoutWindowSplitter.tsx +9 -7
- package/src/layout/Main.tsx +30 -29
- package/src/link/Link.tsx +16 -11
- package/src/link/SkipToMainContent.tsx +6 -6
- package/src/list/List.tsx +31 -29
- package/src/list/ListItem.tsx +126 -125
- package/src/list/ListItemLink.tsx +128 -126
- package/src/list/ListItemText.tsx +42 -37
- package/src/list/ListSubheader.tsx +27 -26
- package/src/menu/DropdownMenu.tsx +2 -2
- package/src/menu/Menu.tsx +327 -326
- package/src/menu/MenuBar.tsx +51 -50
- package/src/menu/MenuButton.tsx +69 -70
- package/src/menu/MenuItem.tsx +37 -37
- package/src/menu/MenuItemButton.tsx +132 -133
- package/src/menu/MenuItemCheckbox.tsx +6 -7
- package/src/menu/MenuItemCircularProgress.tsx +13 -6
- package/src/menu/MenuItemFileInput.tsx +4 -6
- package/src/menu/MenuItemGroup.tsx +18 -18
- package/src/menu/MenuItemInputToggle.tsx +8 -6
- package/src/menu/MenuItemRadio.tsx +6 -6
- package/src/menu/MenuItemSeparator.tsx +7 -7
- package/src/menu/MenuItemSwitch.tsx +6 -6
- package/src/menu/MenuItemTextField.tsx +5 -7
- package/src/menu/MenuVisibilityProvider.tsx +3 -2
- package/src/menu/MenuWidget.tsx +123 -119
- package/src/menu/useContextMenu.ts +7 -4
- package/src/movement/types.ts +5 -9
- package/src/navigation/CollapsibleNavGroup.tsx +10 -6
- package/src/navigation/NavGroup.tsx +18 -19
- package/src/navigation/NavItem.tsx +16 -11
- package/src/navigation/NavItemButton.tsx +69 -66
- package/src/navigation/NavItemLink.tsx +102 -100
- package/src/navigation/NavSubheader.tsx +14 -16
- package/src/navigation/Navigation.tsx +1 -1
- package/src/navigation/types.ts +13 -4
- package/src/navigation/useActiveHeadingId.ts +1 -1
- package/src/overlay/Overlay.tsx +66 -65
- package/src/positioning/useFixedPositioning.ts +1 -1
- package/src/progress/CircularProgress.tsx +6 -6
- package/src/progress/LinearProgress.tsx +6 -6
- package/src/progress/types.ts +4 -0
- package/src/responsive-item/ResponsiveItem.tsx +29 -28
- package/src/responsive-item/ResponsiveItemOverlay.tsx +9 -8
- package/src/segmented-button/SegmentedButton.tsx +11 -6
- package/src/segmented-button/SegmentedButtonContainer.tsx +14 -8
- package/src/sheet/Sheet.tsx +42 -43
- package/src/snackbar/Snackbar.tsx +44 -38
- package/src/snackbar/Toast.tsx +110 -109
- package/src/snackbar/ToastActionButton.tsx +6 -6
- package/src/snackbar/ToastCloseButton.tsx +4 -6
- package/src/snackbar/ToastContent.tsx +56 -49
- package/src/spinbutton/SpinButton.tsx +9 -8
- package/src/spinbutton/types.ts +1 -1
- package/src/table/StickyTableSection.tsx +8 -6
- package/src/table/Table.tsx +47 -41
- package/src/table/TableBody.tsx +46 -42
- package/src/table/TableCell.tsx +83 -81
- package/src/table/TableCellContent.tsx +11 -6
- package/src/table/TableCheckbox.tsx +6 -6
- package/src/table/TableContainer.tsx +31 -26
- package/src/table/TableContainerProvider.ts +1 -1
- package/src/table/TableFooter.tsx +7 -12
- package/src/table/TableHeader.tsx +15 -9
- package/src/table/TableRadio.tsx +59 -58
- package/src/table/TableRow.tsx +34 -33
- package/src/tabs/SimpleTabPanel.tsx +18 -13
- package/src/tabs/SimpleTabPanels.tsx +11 -7
- package/src/tabs/TabList.tsx +106 -105
- package/src/tabs/TabListScrollButton.tsx +9 -6
- package/src/tabs/useTabList.ts +2 -2
- package/src/theme/useCSSVariables.ts +1 -1
- package/src/tooltip/Tooltip.tsx +61 -61
- package/src/tooltip/useTooltip.ts +2 -3
- package/src/transition/SkeletonPlaceholder.tsx +8 -6
- package/src/transition/Slide.tsx +54 -48
- package/src/transition/SlideContainer.tsx +16 -16
- package/src/tree/TreeGroup.tsx +54 -55
- package/src/tree/TreeProvider.tsx +2 -2
- package/src/tree/useTreeMovement.ts +6 -6
- package/src/types.ts +1 -16
- package/src/typography/Mark.tsx +16 -11
- package/src/typography/SrOnly.tsx +41 -35
- package/src/typography/TextContainer.tsx +12 -12
- package/src/typography/Typography.tsx +42 -41
- package/src/useAsyncFunction.ts +3 -3
- package/src/useDebouncedFunction.ts +1 -1
- package/src/useDropzone.ts +1 -1
- package/src/useEnsuredRef.ts +3 -3
- package/src/useThrottledFunction.ts +3 -3
- package/src/useUnmounted.ts +2 -4
- package/src/utils/applyRef.ts +2 -2
- package/src/window-splitter/WindowSplitter.tsx +6 -6
package/dist/menu/MenuBar.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { type ReactElement, type Ref } from "react";
|
|
1
2
|
import { type ListProps } from "../list/List.js";
|
|
2
3
|
export interface MenuBarProps extends Omit<ListProps, "role"> {
|
|
4
|
+
ref?: Ref<HTMLUListElement>;
|
|
3
5
|
/**
|
|
4
6
|
* @defaultValue `true`
|
|
5
7
|
*/
|
|
@@ -59,4 +61,4 @@ export interface MenuBarProps extends Omit<ListProps, "role"> {
|
|
|
59
61
|
* @since 5.0.0
|
|
60
62
|
* @since 6.0.0 Combined with the previous `MenuBarWidget`
|
|
61
63
|
*/
|
|
62
|
-
export declare
|
|
64
|
+
export declare function MenuBar(props: MenuBarProps): ReactElement;
|
package/dist/menu/MenuBar.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { List } from "../list/List.js";
|
|
5
4
|
import { KeyboardMovementProvider, useKeyboardMovementProvider } from "../movement/useKeyboardMovementProvider.js";
|
|
6
5
|
import { MenuBarProvider, useMenuBarProvider } from "./useMenuBarProvider.js";
|
|
@@ -40,8 +39,8 @@ import { MenuBarProvider, useMenuBarProvider } from "./useMenuBarProvider.js";
|
|
|
40
39
|
* @see {@link https://react-md.dev/components/menu | Menu Demos}
|
|
41
40
|
* @since 5.0.0
|
|
42
41
|
* @since 6.0.0 Combined with the previous `MenuBarWidget`
|
|
43
|
-
*/ export
|
|
44
|
-
const { onClick, onFocus, onKeyDown, horizontal = true, hoverTimeout, children, ...remaining } = props;
|
|
42
|
+
*/ export function MenuBar(props) {
|
|
43
|
+
const { ref, onClick, onFocus, onKeyDown, horizontal = true, hoverTimeout, children, ...remaining } = props;
|
|
45
44
|
const menuBarContext = useMenuBarProvider({
|
|
46
45
|
root: true,
|
|
47
46
|
menubar: true,
|
|
@@ -77,6 +76,6 @@ import { MenuBarProvider, useMenuBarProvider } from "./useMenuBarProvider.js";
|
|
|
77
76
|
})
|
|
78
77
|
})
|
|
79
78
|
});
|
|
80
|
-
}
|
|
79
|
+
}
|
|
81
80
|
|
|
82
81
|
//# sourceMappingURL=MenuBar.js.map
|
package/dist/menu/MenuBar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/menu/MenuBar.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/menu/MenuBar.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactElement, type Ref } from \"react\";\n\nimport { List, type ListProps } from \"../list/List.js\";\nimport {\n KeyboardMovementProvider,\n useKeyboardMovementProvider,\n} from \"../movement/useKeyboardMovementProvider.js\";\nimport { MenuBarProvider, useMenuBarProvider } from \"./useMenuBarProvider.js\";\n\nexport interface MenuBarProps extends Omit<ListProps, \"role\"> {\n ref?: Ref<HTMLUListElement>;\n\n /**\n * @defaultValue `true`\n */\n horizontal?: boolean;\n\n /**\n * Set this to a number greater than 0 to allow opening dropdown menus within\n * the menubar after hovering for the duration in milliseconds. Once a menu\n * becomes visible within the menubar, all subsequent menus will become\n * visible immediately on hover as well until the hover mode is ended.\n *\n * For example:\n *\n * - `0` - the dropdown menus become visible immediately on hover\n * - `1000` - the first dropdown menu becomes visible after hovering for 1\n * second\n * - `undefined` - the hover mode can only be activate after a click with\n * mouse, touch, or keyboard\n *\n * @defaultValue `undefined`\n */\n hoverTimeout?: number;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { DropdownMenu } from \"@react-md/core/menu/DropdownMenu\";\n * import { MenuBar } from \"@react-md/core/menu/MenuBar\";\n * import { MenuItem } from \"@react-md/core/menu/MenuItem\";\n * import type { ReactElement } from \"react\";\n *\n * export function SimpleExample(): ReactElement {\n * return (\n * <MenuBar>\n * <DropdownMenu buttonChildren=\"Item 1\">\n * <MenuItem>Menu Item 1</MenuItem>\n * <MenuItem>Menu Item 2</MenuItem>\n * <MenuItem>Menu Item 3</MenuItem>\n * </DropdownMenu>\n * <DropdownMenu buttonChildren=\"Item 2\">\n * <MenuItem>Menu Item 1</MenuItem>\n * <MenuItem>Menu Item 2</MenuItem>\n * <MenuItem>Menu Item 3</MenuItem>\n * </DropdownMenu>\n * <DropdownMenu buttonChildren=\"Item 3\">\n * <MenuItem>Menu Item 1</MenuItem>\n * <MenuItem>Menu Item 2</MenuItem>\n * <MenuItem>Menu Item 4</MenuItem>\n * </DropdownMenu>\n * </MenuBar>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/menu | Menu Demos}\n * @since 5.0.0\n * @since 6.0.0 Combined with the previous `MenuBarWidget`\n */\nexport function MenuBar(props: MenuBarProps): ReactElement {\n const {\n ref,\n onClick,\n onFocus,\n onKeyDown,\n horizontal = true,\n hoverTimeout,\n children,\n ...remaining\n } = props;\n const menuBarContext = useMenuBarProvider({\n root: true,\n menubar: true,\n hoverTimeout,\n });\n const { activeId, enableHoverMode } = menuBarContext;\n const { movementProps, movementContext } = useKeyboardMovementProvider({\n ref,\n onClick,\n onFocus,\n onKeyDown,\n loopable: true,\n searchable: true,\n horizontal,\n includeDisabled: true,\n tabIndexBehavior: \"roving\",\n onFocusChange(event) {\n if (activeId) {\n enableHoverMode(event.element.id);\n }\n },\n });\n\n return (\n <KeyboardMovementProvider value={movementContext}>\n <MenuBarProvider value={menuBarContext}>\n <List\n {...remaining}\n {...movementProps}\n role=\"menubar\"\n horizontal={horizontal}\n >\n {children}\n </List>\n </MenuBarProvider>\n </KeyboardMovementProvider>\n );\n}\n"],"names":["List","KeyboardMovementProvider","useKeyboardMovementProvider","MenuBarProvider","useMenuBarProvider","MenuBar","props","ref","onClick","onFocus","onKeyDown","horizontal","hoverTimeout","children","remaining","menuBarContext","root","menubar","activeId","enableHoverMode","movementProps","movementContext","loopable","searchable","includeDisabled","tabIndexBehavior","onFocusChange","event","element","id","value","role"],"mappings":"AAAA;;AAIA,SAASA,IAAI,QAAwB,kBAAkB;AACvD,SACEC,wBAAwB,EACxBC,2BAA2B,QACtB,6CAA6C;AACpD,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,0BAA0B;AA6B9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCC,GACD,OAAO,SAASC,QAAQC,KAAmB;IACzC,MAAM,EACJC,GAAG,EACHC,OAAO,EACPC,OAAO,EACPC,SAAS,EACTC,aAAa,IAAI,EACjBC,YAAY,EACZC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IACJ,MAAMS,iBAAiBX,mBAAmB;QACxCY,MAAM;QACNC,SAAS;QACTL;IACF;IACA,MAAM,EAAEM,QAAQ,EAAEC,eAAe,EAAE,GAAGJ;IACtC,MAAM,EAAEK,aAAa,EAAEC,eAAe,EAAE,GAAGnB,4BAA4B;QACrEK;QACAC;QACAC;QACAC;QACAY,UAAU;QACVC,YAAY;QACZZ;QACAa,iBAAiB;QACjBC,kBAAkB;QAClBC,eAAcC,KAAK;YACjB,IAAIT,UAAU;gBACZC,gBAAgBQ,MAAMC,OAAO,CAACC,EAAE;YAClC;QACF;IACF;IAEA,qBACE,KAAC5B;QAAyB6B,OAAOT;kBAC/B,cAAA,KAAClB;YAAgB2B,OAAOf;sBACtB,cAAA,KAACf;gBACE,GAAGc,SAAS;gBACZ,GAAGM,aAAa;gBACjBW,MAAK;gBACLpB,YAAYA;0BAEXE;;;;AAKX"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
1
2
|
import { type ButtonProps } from "../button/Button.js";
|
|
2
3
|
import { type IconRotatorProps } from "../icon/IconRotator.js";
|
|
3
4
|
import { type TextIconSpacingProps } from "../icon/TextIconSpacing.js";
|
|
@@ -39,4 +40,4 @@ export interface MenuButtonProps extends ButtonProps, BaseMenuButtonProps {
|
|
|
39
40
|
* @since 5.0.0
|
|
40
41
|
* @since 6.0.0 See {@link BaseMenuButtonProps} for breaking changes.
|
|
41
42
|
*/
|
|
42
|
-
export declare
|
|
43
|
+
export declare function MenuButton(props: MenuButtonProps): ReactElement;
|
package/dist/menu/MenuButton.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { Button } from "../button/Button.js";
|
|
5
4
|
import { IconRotator } from "../icon/IconRotator.js";
|
|
6
5
|
import { getIcon } from "../icon/config.js";
|
|
@@ -20,8 +19,8 @@ const noop = ()=>{
|
|
|
20
19
|
* @see {@link https://react-md.dev/components/menu | Menu Demos}
|
|
21
20
|
* @since 5.0.0
|
|
22
21
|
* @since 6.0.0 See {@link BaseMenuButtonProps} for breaking changes.
|
|
23
|
-
*/ export
|
|
24
|
-
const { id: propId, onClick = noop, onKeyDown = noop, icon: propIcon, iconAfter = true, iconRotatorProps, floating, buttonType = floating ? "icon" : "text", disableDropdownIcon = buttonType === "icon", children, ...remaining } = props;
|
|
22
|
+
*/ export function MenuButton(props) {
|
|
23
|
+
const { ref, id: propId, onClick = noop, onKeyDown = noop, icon: propIcon, iconAfter = true, iconRotatorProps, floating, buttonType = floating ? "icon" : "text", disableDropdownIcon = buttonType === "icon", children, ...remaining } = props;
|
|
25
24
|
const id = useEnsuredId(propId, "menubutton");
|
|
26
25
|
const { visible, setVisible, defaultFocusIndex } = useMenuVisibility();
|
|
27
26
|
const { renderAsSheet } = useMenuConfiguration();
|
|
@@ -72,6 +71,6 @@ const noop = ()=>{
|
|
|
72
71
|
iconAfter && icon
|
|
73
72
|
]
|
|
74
73
|
});
|
|
75
|
-
}
|
|
74
|
+
}
|
|
76
75
|
|
|
77
76
|
//# sourceMappingURL=MenuButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/menu/MenuButton.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/menu/MenuButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactElement } from \"react\";\n\nimport { Button, type ButtonProps } from \"../button/Button.js\";\nimport { IconRotator, type IconRotatorProps } from \"../icon/IconRotator.js\";\nimport { type TextIconSpacingProps } from \"../icon/TextIconSpacing.js\";\nimport { getIcon } from \"../icon/config.js\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\nimport { useMenuVisibility } from \"./MenuVisibilityProvider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/** @since 5.0.0 */\nexport type MenuButtonTextIconSpacingProps = Pick<\n TextIconSpacingProps,\n \"icon\" | \"iconAfter\"\n>;\n\n/** @since 5.0.0 */\nexport type MenuButtonIconRotatorProps = Omit<\n IconRotatorProps,\n \"children\" | \"rotated\"\n>;\n\n/**\n * @since 5.0.0\n * @since 6.0.0 No longer extends the {@link ButtonProps}, no longer\n * requires an `id`, and no longer supports `textIconSpacingProps`.\n */\nexport interface BaseMenuButtonProps extends MenuButtonTextIconSpacingProps {\n /**\n * Any additional props to pass to the {@link IconRotator} component that\n * surrounds the {@link buttonChildren}\n */\n iconRotatorProps?: Readonly<MenuButtonIconRotatorProps>;\n\n /**\n * Boolean if the dropdown icon should be included with the button children.\n *\n * @defaultValue `buttonType === \"icon\"`\n */\n disableDropdownIcon?: boolean;\n}\n\n/**\n * @since 5.0.0\n * @since 6.0.0 See {@link BaseMenuButtonProps} for breaking changes.\n */\nexport interface MenuButtonProps extends ButtonProps, BaseMenuButtonProps {}\n\n/**\n * **Client Component**\n *\n * An internal component that handles rendering a button for the `DropdownMenu`\n * while implementing the correct accessibility and keyboard movement.\n *\n * @see {@link https://react-md.dev/components/menu | Menu Demos}\n * @since 5.0.0\n * @since 6.0.0 See {@link BaseMenuButtonProps} for breaking changes.\n */\nexport function MenuButton(props: MenuButtonProps): ReactElement {\n const {\n ref,\n id: propId,\n onClick = noop,\n onKeyDown = noop,\n icon: propIcon,\n iconAfter = true,\n iconRotatorProps,\n floating,\n buttonType = floating ? \"icon\" : \"text\",\n disableDropdownIcon = buttonType === \"icon\",\n children,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"menubutton\");\n const { visible, setVisible, defaultFocusIndex } = useMenuVisibility();\n const { renderAsSheet } = useMenuConfiguration();\n const { isPhone } = useAppSize();\n const isSheet =\n renderAsSheet === true || (renderAsSheet === \"phone\" && isPhone);\n\n const dropdownIcon = getIcon(\"dropdown\", propIcon);\n let icon = propIcon;\n if (!disableDropdownIcon) {\n icon = (\n <IconRotator {...iconRotatorProps} rotated={visible}>\n {dropdownIcon}\n </IconRotator>\n );\n }\n\n return (\n <Button\n {...remaining}\n aria-haspopup={isSheet ? \"dialog\" : \"menu\"}\n aria-expanded={visible || undefined}\n id={id}\n ref={ref}\n floating={floating}\n buttonType={buttonType}\n onClick={(event) => {\n onClick(event);\n\n defaultFocusIndex.current = 0;\n setVisible((prevVisible) => !prevVisible);\n }}\n onKeyDown={(event) => {\n onKeyDown(event);\n\n switch (event.key) {\n case \"ArrowDown\":\n event.preventDefault();\n event.stopPropagation();\n defaultFocusIndex.current = 0;\n setVisible(true);\n break;\n case \"ArrowUp\":\n event.preventDefault();\n event.stopPropagation();\n defaultFocusIndex.current = -1;\n setVisible(true);\n break;\n }\n }}\n >\n {!iconAfter && icon}\n {children}\n {iconAfter && icon}\n </Button>\n );\n}\n"],"names":["Button","IconRotator","getIcon","useAppSize","useEnsuredId","useMenuConfiguration","useMenuVisibility","noop","MenuButton","props","ref","id","propId","onClick","onKeyDown","icon","propIcon","iconAfter","iconRotatorProps","floating","buttonType","disableDropdownIcon","children","remaining","visible","setVisible","defaultFocusIndex","renderAsSheet","isPhone","isSheet","dropdownIcon","rotated","aria-haspopup","aria-expanded","undefined","event","current","prevVisible","key","preventDefault","stopPropagation"],"mappings":"AAAA;;AAIA,SAASA,MAAM,QAA0B,sBAAsB;AAC/D,SAASC,WAAW,QAA+B,yBAAyB;AAE5E,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,sCAAsC;AACjE,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,iCAAiC;AACtE,SAASC,iBAAiB,QAAQ,8BAA8B;AAEhE,MAAMC,OAAO;AACX,aAAa;AACf;AAwCA;;;;;;;;;CASC,GACD,OAAO,SAASC,WAAWC,KAAsB;IAC/C,MAAM,EACJC,GAAG,EACHC,IAAIC,MAAM,EACVC,UAAUN,IAAI,EACdO,YAAYP,IAAI,EAChBQ,MAAMC,QAAQ,EACdC,YAAY,IAAI,EAChBC,gBAAgB,EAChBC,QAAQ,EACRC,aAAaD,WAAW,SAAS,MAAM,EACvCE,sBAAsBD,eAAe,MAAM,EAC3CE,QAAQ,EACR,GAAGC,WACJ,GAAGd;IACJ,MAAME,KAAKP,aAAaQ,QAAQ;IAChC,MAAM,EAAEY,OAAO,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GAAGpB;IACnD,MAAM,EAAEqB,aAAa,EAAE,GAAGtB;IAC1B,MAAM,EAAEuB,OAAO,EAAE,GAAGzB;IACpB,MAAM0B,UACJF,kBAAkB,QAASA,kBAAkB,WAAWC;IAE1D,MAAME,eAAe5B,QAAQ,YAAYc;IACzC,IAAID,OAAOC;IACX,IAAI,CAACK,qBAAqB;QACxBN,qBACE,KAACd;YAAa,GAAGiB,gBAAgB;YAAEa,SAASP;sBACzCM;;IAGP;IAEA,qBACE,MAAC9B;QACE,GAAGuB,SAAS;QACbS,iBAAeH,UAAU,WAAW;QACpCI,iBAAeT,WAAWU;QAC1BvB,IAAIA;QACJD,KAAKA;QACLS,UAAUA;QACVC,YAAYA;QACZP,SAAS,CAACsB;YACRtB,QAAQsB;YAERT,kBAAkBU,OAAO,GAAG;YAC5BX,WAAW,CAACY,cAAgB,CAACA;QAC/B;QACAvB,WAAW,CAACqB;YACVrB,UAAUqB;YAEV,OAAQA,MAAMG,GAAG;gBACf,KAAK;oBACHH,MAAMI,cAAc;oBACpBJ,MAAMK,eAAe;oBACrBd,kBAAkBU,OAAO,GAAG;oBAC5BX,WAAW;oBACX;gBACF,KAAK;oBACHU,MAAMI,cAAc;oBACpBJ,MAAMK,eAAe;oBACrBd,kBAAkBU,OAAO,GAAG,CAAC;oBAC7BX,WAAW;oBACX;YACJ;QACF;;YAEC,CAACR,aAAaF;YACdO;YACAL,aAAaF;;;AAGpB"}
|
package/dist/menu/MenuItem.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { type ReactElement, type Ref } from "react";
|
|
1
2
|
import { type ListItemProps } from "../list/ListItem.js";
|
|
2
3
|
/**
|
|
3
4
|
* @since 5.0.0
|
|
4
5
|
*/
|
|
5
6
|
export interface MenuItemProps extends Omit<ListItemProps, "role"> {
|
|
7
|
+
ref?: Ref<HTMLLIElement>;
|
|
6
8
|
/**
|
|
7
9
|
* @defaultValue `"menuitem"`
|
|
8
10
|
*/
|
|
@@ -22,4 +24,4 @@ export interface MenuItemProps extends Omit<ListItemProps, "role"> {
|
|
|
22
24
|
* @see {@link https://react-md.dev/components/menu | Menu Demos}
|
|
23
25
|
* @since 5.0.0
|
|
24
26
|
*/
|
|
25
|
-
export declare
|
|
27
|
+
export declare function MenuItem(props: MenuItemProps): ReactElement;
|
package/dist/menu/MenuItem.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cnb } from "cnbuilder";
|
|
4
|
-
import { forwardRef } from "react";
|
|
5
4
|
import { ListItem } from "../list/ListItem.js";
|
|
6
5
|
import { useKeyboardMovementContext } from "../movement/useKeyboardMovementProvider.js";
|
|
7
6
|
import { useEnsuredId } from "../useEnsuredId.js";
|
|
@@ -14,8 +13,8 @@ import { useEnsuredId } from "../useEnsuredId.js";
|
|
|
14
13
|
*
|
|
15
14
|
* @see {@link https://react-md.dev/components/menu | Menu Demos}
|
|
16
15
|
* @since 5.0.0
|
|
17
|
-
*/ export
|
|
18
|
-
const { id: propId, role = "menuitem", tabIndex: propTabIndex, children, className, ...remaining } = props;
|
|
16
|
+
*/ export function MenuItem(props) {
|
|
17
|
+
const { ref, id: propId, role = "menuitem", tabIndex: propTabIndex, children, className, ...remaining } = props;
|
|
19
18
|
const id = useEnsuredId(propId, "menuitem");
|
|
20
19
|
const { tabIndexBehavior, activeDescendantId } = useKeyboardMovementContext();
|
|
21
20
|
const focused = id === activeDescendantId;
|
|
@@ -32,6 +31,6 @@ import { useEnsuredId } from "../useEnsuredId.js";
|
|
|
32
31
|
className: cnb("rmd-menu-item", tabIndexBehavior === "virtual" && focused && "rmd-menu-item--focused", className),
|
|
33
32
|
children: children
|
|
34
33
|
});
|
|
35
|
-
}
|
|
34
|
+
}
|
|
36
35
|
|
|
37
36
|
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/menu/MenuItem.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/menu/MenuItem.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { type ReactElement, type Ref } from \"react\";\n\nimport { ListItem, type ListItemProps } from \"../list/ListItem.js\";\nimport { useKeyboardMovementContext } from \"../movement/useKeyboardMovementProvider.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\n\n/**\n * @since 5.0.0\n */\nexport interface MenuItemProps extends Omit<ListItemProps, \"role\"> {\n ref?: Ref<HTMLLIElement>;\n\n /**\n * @defaultValue `\"menuitem\"`\n */\n role?: string;\n\n /**\n * @defaultValue `-1`\n */\n tabIndex?: number;\n}\n\n/**\n * **Client Component**\n *\n * This component is used as an \"action\" within a `Menu`/`DropdownMenu` that\n * implements some keyboard focus behavior. This component should generally have\n * an `onClick` event handler.\n *\n * @see {@link https://react-md.dev/components/menu | Menu Demos}\n * @since 5.0.0\n */\nexport function MenuItem(props: MenuItemProps): ReactElement {\n const {\n ref,\n id: propId,\n role = \"menuitem\",\n tabIndex: propTabIndex,\n children,\n className,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"menuitem\");\n const { tabIndexBehavior, activeDescendantId } = useKeyboardMovementContext();\n const focused = id === activeDescendantId;\n let tabIndex = propTabIndex ?? -1;\n if (tabIndexBehavior === \"roving\" && focused) {\n tabIndex = 0;\n }\n\n return (\n <ListItem\n {...remaining}\n id={id}\n ref={ref}\n role={role}\n tabIndex={tabIndex}\n className={cnb(\n \"rmd-menu-item\",\n tabIndexBehavior === \"virtual\" && focused && \"rmd-menu-item--focused\",\n className\n )}\n >\n {children}\n </ListItem>\n );\n}\n"],"names":["cnb","ListItem","useKeyboardMovementContext","useEnsuredId","MenuItem","props","ref","id","propId","role","tabIndex","propTabIndex","children","className","remaining","tabIndexBehavior","activeDescendantId","focused"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAGhC,SAASC,QAAQ,QAA4B,sBAAsB;AACnE,SAASC,0BAA0B,QAAQ,6CAA6C;AACxF,SAASC,YAAY,QAAQ,qBAAqB;AAmBlD;;;;;;;;;CASC,GACD,OAAO,SAASC,SAASC,KAAoB;IAC3C,MAAM,EACJC,GAAG,EACHC,IAAIC,MAAM,EACVC,OAAO,UAAU,EACjBC,UAAUC,YAAY,EACtBC,QAAQ,EACRC,SAAS,EACT,GAAGC,WACJ,GAAGT;IAEJ,MAAME,KAAKJ,aAAaK,QAAQ;IAChC,MAAM,EAAEO,gBAAgB,EAAEC,kBAAkB,EAAE,GAAGd;IACjD,MAAMe,UAAUV,OAAOS;IACvB,IAAIN,WAAWC,gBAAgB,CAAC;IAChC,IAAII,qBAAqB,YAAYE,SAAS;QAC5CP,WAAW;IACb;IAEA,qBACE,KAACT;QACE,GAAGa,SAAS;QACbP,IAAIA;QACJD,KAAKA;QACLG,MAAMA;QACNC,UAAUA;QACVG,WAAWb,IACT,iBACAe,qBAAqB,aAAaE,WAAW,0BAC7CJ;kBAGDD;;AAGP"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
1
2
|
import { type BaseMenuButtonProps } from "./MenuButton.js";
|
|
2
3
|
import { type MenuItemProps } from "./MenuItem.js";
|
|
3
4
|
/**
|
|
@@ -15,4 +16,4 @@ export interface MenuItemButtonProps extends BaseMenuButtonProps, MenuItemProps
|
|
|
15
16
|
* @internal
|
|
16
17
|
* @since 5.0.0
|
|
17
18
|
*/
|
|
18
|
-
export declare
|
|
19
|
+
export declare function MenuItemButton(props: MenuItemButtonProps): ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useEffect } from "react";
|
|
4
4
|
import { useHoverMode } from "../hoverMode/useHoverMode.js";
|
|
5
5
|
import { IconRotator } from "../icon/IconRotator.js";
|
|
6
6
|
import { getIcon } from "../icon/config.js";
|
|
@@ -22,8 +22,8 @@ const noop = ()=>{
|
|
|
22
22
|
*
|
|
23
23
|
* @internal
|
|
24
24
|
* @since 5.0.0
|
|
25
|
-
*/ export
|
|
26
|
-
const { id: propId, children, height: propHeight, onClick = noop, onKeyDown = noop, onMouseEnter = noop, onMouseLeave = noop, rightAddon: propRightAddon, iconRotatorProps, disableDropdownIcon = propRightAddon !== undefined, ...remaining } = props;
|
|
25
|
+
*/ export function MenuItemButton(props) {
|
|
26
|
+
const { ref, id: propId, children, height: propHeight, onClick = noop, onKeyDown = noop, onMouseEnter = noop, onMouseLeave = noop, rightAddon: propRightAddon, iconRotatorProps, disableDropdownIcon = propRightAddon !== undefined, ...remaining } = props;
|
|
27
27
|
const { disabled } = props;
|
|
28
28
|
const id = useEnsuredId(propId, "menuitem");
|
|
29
29
|
const mode = useUserInteractionMode();
|
|
@@ -124,6 +124,6 @@ const noop = ()=>{
|
|
|
124
124
|
},
|
|
125
125
|
children: children
|
|
126
126
|
});
|
|
127
|
-
}
|
|
127
|
+
}
|
|
128
128
|
|
|
129
129
|
//# sourceMappingURL=MenuItemButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/menu/MenuItemButton.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/menu/MenuItemButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactElement, useEffect } from \"react\";\n\nimport { useHoverMode } from \"../hoverMode/useHoverMode.js\";\nimport { IconRotator } from \"../icon/IconRotator.js\";\nimport { getIcon } from \"../icon/config.js\";\nimport { useUserInteractionMode } from \"../interaction/UserInteractionModeProvider.js\";\nimport { useAppSize } from \"../media-queries/AppSizeProvider.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { type BaseMenuButtonProps } from \"./MenuButton.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\nimport { MenuItem, type MenuItemProps } from \"./MenuItem.js\";\nimport { useMenuVisibility } from \"./MenuVisibilityProvider.js\";\nimport { useMenuBarContext } from \"./useMenuBarProvider.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @internal\n * @since 5.0.0\n */\nexport interface MenuItemButtonProps\n extends BaseMenuButtonProps, MenuItemProps {}\n\n/**\n * **Client Component**\n *\n * This is just an internal component that handles rendering a submenu as a\n * menuitem for a `DropdownMenu` with a conditional dropdown icon.\n *\n * @internal\n * @since 5.0.0\n */\nexport function MenuItemButton(props: MenuItemButtonProps): ReactElement {\n const {\n ref,\n id: propId,\n children,\n height: propHeight,\n onClick = noop,\n onKeyDown = noop,\n onMouseEnter = noop,\n onMouseLeave = noop,\n rightAddon: propRightAddon,\n iconRotatorProps,\n disableDropdownIcon = propRightAddon !== undefined,\n ...remaining\n } = props;\n const { disabled } = props;\n\n const id = useEnsuredId(propId, \"menuitem\");\n const mode = useUserInteractionMode();\n const { renderAsSheet } = useMenuConfiguration();\n const { isPhone } = useAppSize();\n const isSheet =\n renderAsSheet === true || (renderAsSheet === \"phone\" && isPhone);\n const {\n root,\n menubar,\n activeId,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n clearDisableTimer,\n leaveTimeoutRef,\n hoverTimeoutRef,\n } = useMenuBarContext();\n const { visible, setVisible, defaultFocusIndex } = useMenuVisibility();\n const { startShowFlow, clearVisibilityTimeout } = useHoverMode({\n setVisible,\n enableHoverMode,\n disableHoverMode,\n startDisableTimer,\n leaveTimeoutRef,\n hoverTimeoutRef,\n clearDisableTimer,\n });\n const { horizontal } = useMenuConfiguration();\n\n useEffect(() => {\n setVisible(id === activeId);\n }, [activeId, defaultFocusIndex, id, menubar, setVisible]);\n\n let height = propHeight;\n let rightAddon = propRightAddon;\n const dropdownIcon = getIcon(root ? \"dropdown\" : \"forward\");\n if (!disableDropdownIcon) {\n if (!height && !props.leftAddon) {\n height = \"normal\";\n }\n\n rightAddon = (\n <IconRotator {...iconRotatorProps} rotated={visible}>\n {dropdownIcon}\n </IconRotator>\n );\n }\n\n const updateVisibility = (nextVisible: boolean, focusIndex = 0): void => {\n defaultFocusIndex.current = focusIndex;\n setVisible(nextVisible);\n if (!menubar) {\n return;\n }\n\n if (nextVisible) {\n enableHoverMode(id);\n } else {\n disableHoverMode();\n }\n };\n\n return (\n <MenuItem\n {...remaining}\n aria-haspopup={isSheet ? \"dialog\" : \"menu\"}\n aria-expanded={visible || undefined}\n id={id}\n ref={ref}\n rightAddon={rightAddon}\n onClick={(event) => {\n onClick(event);\n\n event.stopPropagation();\n updateVisibility(!visible);\n }}\n onKeyDown={(event) => {\n onKeyDown(event);\n\n switch (event.key) {\n case \"ArrowDown\":\n if (horizontal || root) {\n event.preventDefault();\n event.stopPropagation();\n updateVisibility(true);\n }\n break;\n case \"ArrowRight\":\n if (!horizontal && !root) {\n event.preventDefault();\n event.stopPropagation();\n updateVisibility(true);\n }\n break;\n }\n }}\n onMouseEnter={(event) => {\n onMouseEnter(event);\n if (mode === \"touch\" || disabled || !menubar) {\n return;\n }\n\n defaultFocusIndex.current = 0;\n startShowFlow(id);\n }}\n onMouseLeave={(event) => {\n onMouseLeave(event);\n if (mode === \"touch\" || disabled || !menubar) {\n return;\n }\n\n clearVisibilityTimeout();\n }}\n >\n {children}\n </MenuItem>\n );\n}\n"],"names":["useEffect","useHoverMode","IconRotator","getIcon","useUserInteractionMode","useAppSize","useEnsuredId","useMenuConfiguration","MenuItem","useMenuVisibility","useMenuBarContext","noop","MenuItemButton","props","ref","id","propId","children","height","propHeight","onClick","onKeyDown","onMouseEnter","onMouseLeave","rightAddon","propRightAddon","iconRotatorProps","disableDropdownIcon","undefined","remaining","disabled","mode","renderAsSheet","isPhone","isSheet","root","menubar","activeId","enableHoverMode","disableHoverMode","startDisableTimer","clearDisableTimer","leaveTimeoutRef","hoverTimeoutRef","visible","setVisible","defaultFocusIndex","startShowFlow","clearVisibilityTimeout","horizontal","dropdownIcon","leftAddon","rotated","updateVisibility","nextVisible","focusIndex","current","aria-haspopup","aria-expanded","event","stopPropagation","key","preventDefault"],"mappings":"AAAA;;AAEA,SAA4BA,SAAS,QAAQ,QAAQ;AAErD,SAASC,YAAY,QAAQ,+BAA+B;AAC5D,SAASC,WAAW,QAAQ,yBAAyB;AACrD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,sBAAsB,QAAQ,gDAAgD;AACvF,SAASC,UAAU,QAAQ,sCAAsC;AACjE,SAASC,YAAY,QAAQ,qBAAqB;AAElD,SAASC,oBAAoB,QAAQ,iCAAiC;AACtE,SAASC,QAAQ,QAA4B,gBAAgB;AAC7D,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,iBAAiB,QAAQ,0BAA0B;AAE5D,MAAMC,OAAO;AACX,aAAa;AACf;AASA;;;;;;;;CAQC,GACD,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EACJC,GAAG,EACHC,IAAIC,MAAM,EACVC,QAAQ,EACRC,QAAQC,UAAU,EAClBC,UAAUT,IAAI,EACdU,YAAYV,IAAI,EAChBW,eAAeX,IAAI,EACnBY,eAAeZ,IAAI,EACnBa,YAAYC,cAAc,EAC1BC,gBAAgB,EAChBC,sBAAsBF,mBAAmBG,SAAS,EAClD,GAAGC,WACJ,GAAGhB;IACJ,MAAM,EAAEiB,QAAQ,EAAE,GAAGjB;IAErB,MAAME,KAAKT,aAAaU,QAAQ;IAChC,MAAMe,OAAO3B;IACb,MAAM,EAAE4B,aAAa,EAAE,GAAGzB;IAC1B,MAAM,EAAE0B,OAAO,EAAE,GAAG5B;IACpB,MAAM6B,UACJF,kBAAkB,QAASA,kBAAkB,WAAWC;IAC1D,MAAM,EACJE,IAAI,EACJC,OAAO,EACPC,QAAQ,EACRC,eAAe,EACfC,gBAAgB,EAChBC,iBAAiB,EACjBC,iBAAiB,EACjBC,eAAe,EACfC,eAAe,EAChB,GAAGjC;IACJ,MAAM,EAAEkC,OAAO,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GAAGrC;IACnD,MAAM,EAAEsC,aAAa,EAAEC,sBAAsB,EAAE,GAAG/C,aAAa;QAC7D4C;QACAP;QACAC;QACAC;QACAE;QACAC;QACAF;IACF;IACA,MAAM,EAAEQ,UAAU,EAAE,GAAG1C;IAEvBP,UAAU;QACR6C,WAAW9B,OAAOsB;IACpB,GAAG;QAACA;QAAUS;QAAmB/B;QAAIqB;QAASS;KAAW;IAEzD,IAAI3B,SAASC;IACb,IAAIK,aAAaC;IACjB,MAAMyB,eAAe/C,QAAQgC,OAAO,aAAa;IACjD,IAAI,CAACR,qBAAqB;QACxB,IAAI,CAACT,UAAU,CAACL,MAAMsC,SAAS,EAAE;YAC/BjC,SAAS;QACX;QAEAM,2BACE,KAACtB;YAAa,GAAGwB,gBAAgB;YAAE0B,SAASR;sBACzCM;;IAGP;IAEA,MAAMG,mBAAmB,CAACC,aAAsBC,aAAa,CAAC;QAC5DT,kBAAkBU,OAAO,GAAGD;QAC5BV,WAAWS;QACX,IAAI,CAAClB,SAAS;YACZ;QACF;QAEA,IAAIkB,aAAa;YACfhB,gBAAgBvB;QAClB,OAAO;YACLwB;QACF;IACF;IAEA,qBACE,KAAC/B;QACE,GAAGqB,SAAS;QACb4B,iBAAevB,UAAU,WAAW;QACpCwB,iBAAed,WAAWhB;QAC1Bb,IAAIA;QACJD,KAAKA;QACLU,YAAYA;QACZJ,SAAS,CAACuC;YACRvC,QAAQuC;YAERA,MAAMC,eAAe;YACrBP,iBAAiB,CAACT;QACpB;QACAvB,WAAW,CAACsC;YACVtC,UAAUsC;YAEV,OAAQA,MAAME,GAAG;gBACf,KAAK;oBACH,IAAIZ,cAAcd,MAAM;wBACtBwB,MAAMG,cAAc;wBACpBH,MAAMC,eAAe;wBACrBP,iBAAiB;oBACnB;oBACA;gBACF,KAAK;oBACH,IAAI,CAACJ,cAAc,CAACd,MAAM;wBACxBwB,MAAMG,cAAc;wBACpBH,MAAMC,eAAe;wBACrBP,iBAAiB;oBACnB;oBACA;YACJ;QACF;QACA/B,cAAc,CAACqC;YACbrC,aAAaqC;YACb,IAAI5B,SAAS,WAAWD,YAAY,CAACM,SAAS;gBAC5C;YACF;YAEAU,kBAAkBU,OAAO,GAAG;YAC5BT,cAAchC;QAChB;QACAQ,cAAc,CAACoC;YACbpC,aAAaoC;YACb,IAAI5B,SAAS,WAAWD,YAAY,CAACM,SAAS;gBAC5C;YACF;YAEAY;QACF;kBAEC/B;;AAGP"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
1
2
|
import { type MenuItemCheckboxProps } from "./MenuItemInputToggle.js";
|
|
2
3
|
/**
|
|
3
4
|
* **Client Component**
|
|
@@ -31,4 +32,4 @@ import { type MenuItemCheckboxProps } from "./MenuItemInputToggle.js";
|
|
|
31
32
|
* @see {@link https://react-md.dev/components/menu#menuitemcheckbox-example | DropdownMenu Demos}
|
|
32
33
|
* @since 2.8.0
|
|
33
34
|
*/
|
|
34
|
-
export declare
|
|
35
|
+
export declare function MenuItemCheckbox(props: MenuItemCheckboxProps): ReactElement;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { MenuItemInputToggle } from "./MenuItemInputToggle.js";
|
|
5
4
|
/**
|
|
6
5
|
* **Client Component**
|
|
@@ -33,12 +32,13 @@ import { MenuItemInputToggle } from "./MenuItemInputToggle.js";
|
|
|
33
32
|
*
|
|
34
33
|
* @see {@link https://react-md.dev/components/menu#menuitemcheckbox-example | DropdownMenu Demos}
|
|
35
34
|
* @since 2.8.0
|
|
36
|
-
*/ export
|
|
35
|
+
*/ export function MenuItemCheckbox(props) {
|
|
36
|
+
const { ref, ...remaining } = props;
|
|
37
37
|
return /*#__PURE__*/ _jsx(MenuItemInputToggle, {
|
|
38
|
-
...
|
|
38
|
+
...remaining,
|
|
39
39
|
ref: ref,
|
|
40
40
|
type: "checkbox"
|
|
41
41
|
});
|
|
42
|
-
}
|
|
42
|
+
}
|
|
43
43
|
|
|
44
44
|
//# sourceMappingURL=MenuItemCheckbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/menu/MenuItemCheckbox.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/menu/MenuItemCheckbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactElement } from \"react\";\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { type ICON_CONFIG } from \"../icon/config.js\";\nimport {\n type MenuItemCheckboxProps,\n MenuItemInputToggle,\n} from \"./MenuItemInputToggle.js\";\n\n/**\n * **Client Component**\n *\n * This is a simple wrapper for the {@link MenuItemInputToggle} component to\n * render it as a checkbox and pulling the checkbox icon from the\n * {@link ICON_CONFIG}.\n *\n * @example Simple Example\n * ```tsx\n * import { DropdownMenu } from \"@react-md/core/menu/DropdownMenu\";\n * import { MenuItemCheckbox } from \"@react-md/core/menu/MenuItemCheckbox\";\n * import { ReactElement, useState } from \"react\";\n *\n * function Example(): ReactElement {\n * const [checked, setChecked] = useState(false);\n *\n * return (\n * <DropdownMenu buttonChildren=\"Button\">\n * <MenuItemCheckbox\n * checked={checked}\n * onCheckedChange={(nextChecked) => setChecked(nextChecked)}\n * >\n * Checkbox\n * </MenuItemCheckbox>\n * </DropdownMenu>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/menu#menuitemcheckbox-example | DropdownMenu Demos}\n * @since 2.8.0\n */\nexport function MenuItemCheckbox(props: MenuItemCheckboxProps): ReactElement {\n const { ref, ...remaining } = props;\n\n return <MenuItemInputToggle {...remaining} ref={ref} type=\"checkbox\" />;\n}\n"],"names":["MenuItemInputToggle","MenuItemCheckbox","props","ref","remaining","type"],"mappings":"AAAA;;AAMA,SAEEA,mBAAmB,QACd,2BAA2B;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BC,GACD,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EAAEC,GAAG,EAAE,GAAGC,WAAW,GAAGF;IAE9B,qBAAO,KAACF;QAAqB,GAAGI,SAAS;QAAED,KAAKA;QAAKE,MAAK;;AAC5D"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type HTMLAttributes, type ReactNode } from "react";
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type ListItemChildrenProps, type ListItemHeight } from "../list/types.js";
|
|
3
3
|
import { type CircularProgressProps } from "../progress/CircularProgress.js";
|
|
4
4
|
/**
|
|
5
5
|
* @since 6.0.0
|
|
6
6
|
*/
|
|
7
7
|
export interface MenuItemCircularProgressProps extends CircularProgressProps {
|
|
8
|
+
ref?: Ref<HTMLLIElement>;
|
|
8
9
|
/** @defaultValue `"Loading"` */
|
|
9
10
|
"aria-label"?: string;
|
|
10
11
|
/** @defaultValue `"none"` */
|
|
@@ -54,4 +55,4 @@ export interface MenuItemCircularProgressProps extends CircularProgressProps {
|
|
|
54
55
|
*
|
|
55
56
|
* @since 6.0.0
|
|
56
57
|
*/
|
|
57
|
-
export declare
|
|
58
|
+
export declare function MenuItemCircularProgress(props: MenuItemCircularProgressProps): ReactElement;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cnb } from "cnbuilder";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { ListItemChildren } from "../list/ListItemChildren.js";
|
|
5
4
|
import { listItem } from "../list/listItemStyles.js";
|
|
6
5
|
import { CircularProgress } from "../progress/CircularProgress.js";
|
|
@@ -40,8 +39,8 @@ import { CircularProgress } from "../progress/CircularProgress.js";
|
|
|
40
39
|
* ```
|
|
41
40
|
*
|
|
42
41
|
* @since 6.0.0
|
|
43
|
-
*/ export
|
|
44
|
-
const { "aria-label": propAriaLabel, "aria-labelledby": ariaLabelledBy, role = "none", className, height, leftAddon, rightAddon, liProps, listItemChildrenProps, ...remaining } = props;
|
|
42
|
+
*/ export function MenuItemCircularProgress(props) {
|
|
43
|
+
const { ref, "aria-label": propAriaLabel, "aria-labelledby": ariaLabelledBy, role = "none", className, height, leftAddon, rightAddon, liProps, listItemChildrenProps, ...remaining } = props;
|
|
45
44
|
let ariaLabel = propAriaLabel;
|
|
46
45
|
if (!ariaLabel && !ariaLabelledBy) {
|
|
47
46
|
ariaLabel = "Loading";
|
|
@@ -66,6 +65,6 @@ import { CircularProgress } from "../progress/CircularProgress.js";
|
|
|
66
65
|
})
|
|
67
66
|
})
|
|
68
67
|
});
|
|
69
|
-
}
|
|
68
|
+
}
|
|
70
69
|
|
|
71
70
|
//# sourceMappingURL=MenuItemCircularProgress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/menu/MenuItemCircularProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/menu/MenuItemCircularProgress.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport {\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nimport { ListItemChildren } from \"../list/ListItemChildren.js\";\nimport { listItem } from \"../list/listItemStyles.js\";\nimport {\n type ListItemChildrenProps,\n type ListItemHeight,\n} from \"../list/types.js\";\nimport {\n CircularProgress,\n type CircularProgressProps,\n} from \"../progress/CircularProgress.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface MenuItemCircularProgressProps extends CircularProgressProps {\n ref?: Ref<HTMLLIElement>;\n\n /** @defaultValue `\"Loading\"` */\n \"aria-label\"?: string;\n\n /** @defaultValue `\"none\"` */\n role?: string;\n\n /** @defaultValue `true` */\n dense?: boolean;\n\n liProps?: HTMLAttributes<HTMLLIElement>;\n height?: ListItemHeight;\n leftAddon?: ReactNode;\n rightAddon?: ReactNode;\n listItemChildrenProps?: ListItemChildrenProps;\n}\n\n/**\n * @example Simple Example\n * ```tsx\n * \"use client\";\n * import { DropdownMenu } from \"@react-md/core/menu/DropdownMenu\";\n * import { MenuItem } from \"@react-md/core/menu/MenuItem\";\n * import { MenuItemCircularProgress } from \"@react-md/core/menu/MenuItemCircularProgress\";\n * import { useAsyncFunction } from \"@react-md/core/useAsyncFunction\";\n *\n * function Example() {\n * const { handleAsync, pending } = useAsyncFunction();\n * const [visible, setVisible] = useState(false);\n *\n * return (\n * <DropdownMenu buttonChildren=\"Options\" visible={visible} setVisible={setVisible}>\n * {pending && <MenuItemCircularProgress />}\n * <MenuItem\n * onClick={handleAsync(async (event) => {\n * // prevent menu from closing until action completes\n * event.stopPropagation()\n *\n * // do something async\n * await ...\n *\n * // close menu once completed\n * setVisible(false)\n * })}\n * >\n * Some Action\n * </MenuItem>\n * </DropdownMenu>\n * )\n * }\n * ```\n *\n * @since 6.0.0\n */\nexport function MenuItemCircularProgress(\n props: MenuItemCircularProgressProps\n): ReactElement {\n const {\n ref,\n \"aria-label\": propAriaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n role = \"none\",\n className,\n height,\n leftAddon,\n rightAddon,\n liProps,\n listItemChildrenProps,\n ...remaining\n } = props;\n let ariaLabel = propAriaLabel;\n if (!ariaLabel && !ariaLabelledBy) {\n ariaLabel = \"Loading\";\n }\n\n return (\n <li\n {...liProps}\n ref={ref}\n role={role}\n className={cnb(listItem({ height, className }), liProps?.className)}\n >\n <ListItemChildren\n {...listItemChildrenProps}\n leftAddon={leftAddon}\n rightAddon={rightAddon}\n >\n <CircularProgress\n aria-label={ariaLabel as string}\n aria-labelledby={ariaLabelledBy}\n dense\n {...remaining}\n />\n </ListItemChildren>\n </li>\n );\n}\n"],"names":["cnb","ListItemChildren","listItem","CircularProgress","MenuItemCircularProgress","props","ref","propAriaLabel","ariaLabelledBy","role","className","height","leftAddon","rightAddon","liProps","listItemChildrenProps","remaining","ariaLabel","li","aria-label","aria-labelledby","dense"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAQhC,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,QAAQ,QAAQ,4BAA4B;AAKrD,SACEC,gBAAgB,QAEX,kCAAkC;AAwBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCC,GACD,OAAO,SAASC,yBACdC,KAAoC;IAEpC,MAAM,EACJC,GAAG,EACH,cAAcC,aAAa,EAC3B,mBAAmBC,cAAc,EACjCC,OAAO,MAAM,EACbC,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,qBAAqB,EACrB,GAAGC,WACJ,GAAGX;IACJ,IAAIY,YAAYV;IAChB,IAAI,CAACU,aAAa,CAACT,gBAAgB;QACjCS,YAAY;IACd;IAEA,qBACE,KAACC;QACE,GAAGJ,OAAO;QACXR,KAAKA;QACLG,MAAMA;QACNC,WAAWV,IAAIE,SAAS;YAAES;YAAQD;QAAU,IAAII,SAASJ;kBAEzD,cAAA,KAACT;YACE,GAAGc,qBAAqB;YACzBH,WAAWA;YACXC,YAAYA;sBAEZ,cAAA,KAACV;gBACCgB,cAAYF;gBACZG,mBAAiBZ;gBACjBa,KAAK;gBACJ,GAAGL,SAAS;;;;AAKvB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChangeEventHandler, type InputHTMLAttributes } from "react";
|
|
1
|
+
import { type ChangeEventHandler, type InputHTMLAttributes, type ReactElement } from "react";
|
|
2
2
|
import { type MenuItemProps } from "./MenuItem.js";
|
|
3
3
|
/**
|
|
4
4
|
* @since 6.0.0 Removed most of the shared `FileInputProps` from this
|
|
@@ -41,4 +41,4 @@ export interface MenuItemFileInputProps extends Omit<MenuItemProps, "onChange">,
|
|
|
41
41
|
* menu item. This allows the menu to be closed immediately when this menu item
|
|
42
42
|
* is clicked.
|
|
43
43
|
*/
|
|
44
|
-
export declare
|
|
44
|
+
export declare function MenuItemFileInput(props: MenuItemFileInputProps): ReactElement;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { getIcon } from "../icon/config.js";
|
|
5
4
|
import { useEnsuredId } from "../useEnsuredId.js";
|
|
6
5
|
import { MenuItem } from "./MenuItem.js";
|
|
@@ -17,8 +16,8 @@ const noop = ()=>{
|
|
|
17
16
|
* @since 6.0.0 No longer creates an invisible file input element within the
|
|
18
17
|
* menu item. This allows the menu to be closed immediately when this menu item
|
|
19
18
|
* is clicked.
|
|
20
|
-
*/ export
|
|
21
|
-
const { id: propId, onClick = noop, onChange, accept, capture, multiple, children, leftAddon: propLeftAddon, preventMenuHideOnClick = false, ...remaining } = props;
|
|
19
|
+
*/ export function MenuItemFileInput(props) {
|
|
20
|
+
const { ref, id: propId, onClick = noop, onChange, accept, capture, multiple, children, leftAddon: propLeftAddon, preventMenuHideOnClick = false, ...remaining } = props;
|
|
22
21
|
const id = useEnsuredId(propId, "menu-item");
|
|
23
22
|
const leftAddon = getIcon("upload", propLeftAddon);
|
|
24
23
|
return /*#__PURE__*/ _jsx(MenuItem, {
|
|
@@ -54,6 +53,6 @@ const noop = ()=>{
|
|
|
54
53
|
},
|
|
55
54
|
children: children
|
|
56
55
|
});
|
|
57
|
-
}
|
|
56
|
+
}
|
|
58
57
|
|
|
59
58
|
//# sourceMappingURL=MenuItemFileInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/menu/MenuItemFileInput.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ChangeEventHandler,\n type InputHTMLAttributes,\n
|
|
1
|
+
{"version":3,"sources":["../../src/menu/MenuItemFileInput.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ChangeEventHandler,\n type InputHTMLAttributes,\n type ReactElement,\n} from \"react\";\n\nimport { getIcon } from \"../icon/config.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { MenuItem, type MenuItemProps } from \"./MenuItem.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0 Removed most of the shared `FileInputProps` from this\n * implementation.\n */\nexport interface MenuItemFileInputProps\n extends\n Omit<MenuItemProps, \"onChange\">,\n Pick<\n InputHTMLAttributes<HTMLInputElement>,\n \"accept\" | \"capture\" | \"multiple\"\n > {\n /**\n * A change event handler that should do something with the selected files.\n * Usually the `onChange` returned by `useFileUpload` or:\n *\n * ```ts\n * onChange={(event) => {\n * const { files } = event.currentTarget;\n * // do something with files\n * }}\n * ```\n *\n * This is actually a native `Event` and not a `SyntheticEvent` because the\n * file input is created through `document.createElement` instead of `React`.\n * You can still access the files through `event.currentTarget.files` like\n * normal.\n */\n onChange: ChangeEventHandler<HTMLInputElement>;\n\n /**\n * Set this to `true` if the `Menu` should not close when the file input's\n * menu item is clicked.\n *\n * @defaultValue `false`\n */\n preventMenuHideOnClick?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * A wrapper for the `<input type=\"file\">` element that works within menus.\n *\n * @see {@link https://react-md.dev/components/menu#menuitemfileinput-example | DropdownMenu Demos}\n * @since 5.0.0\n * @since 6.0.0 No longer creates an invisible file input element within the\n * menu item. This allows the menu to be closed immediately when this menu item\n * is clicked.\n */\nexport function MenuItemFileInput(props: MenuItemFileInputProps): ReactElement {\n const {\n ref,\n id: propId,\n onClick = noop,\n onChange,\n accept,\n capture,\n multiple,\n children,\n leftAddon: propLeftAddon,\n preventMenuHideOnClick = false,\n ...remaining\n } = props;\n\n const id = useEnsuredId(propId, \"menu-item\");\n const leftAddon = getIcon(\"upload\", propLeftAddon);\n\n return (\n <MenuItem\n {...remaining}\n id={id}\n ref={ref}\n leftAddon={leftAddon}\n onClick={(event) => {\n onClick(event);\n\n if (preventMenuHideOnClick) {\n event.stopPropagation();\n }\n\n // Since the menu closes when the menu item is clicked causing the\n // elements to be removed from the DOM, a normal `<input type=\"file\" />`\n // can't be used. Instead, create a temporary file input element and\n // click it to trigger the file upload behavior.\n let input: HTMLInputElement | null = document.createElement(\"input\");\n input.type = \"file\";\n if (accept) {\n input.accept = accept;\n }\n if (multiple) {\n input.multiple = multiple;\n }\n if (capture) {\n input.capture = capture === true ? \"\" : capture;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n input.addEventListener(\"change\", onChange);\n input.click();\n input = null;\n }}\n >\n {children}\n </MenuItem>\n );\n}\n"],"names":["getIcon","useEnsuredId","MenuItem","noop","MenuItemFileInput","props","ref","id","propId","onClick","onChange","accept","capture","multiple","children","leftAddon","propLeftAddon","preventMenuHideOnClick","remaining","event","stopPropagation","input","document","createElement","type","addEventListener","click"],"mappings":"AAAA;;AAQA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,QAAQ,QAA4B,gBAAgB;AAE7D,MAAMC,OAAO;AACX,aAAa;AACf;AAwCA;;;;;;;;;;CAUC,GACD,OAAO,SAASC,kBAAkBC,KAA6B;IAC7D,MAAM,EACJC,GAAG,EACHC,IAAIC,MAAM,EACVC,UAAUN,IAAI,EACdO,QAAQ,EACRC,MAAM,EACNC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,WAAWC,aAAa,EACxBC,yBAAyB,KAAK,EAC9B,GAAGC,WACJ,GAAGb;IAEJ,MAAME,KAAKN,aAAaO,QAAQ;IAChC,MAAMO,YAAYf,QAAQ,UAAUgB;IAEpC,qBACE,KAACd;QACE,GAAGgB,SAAS;QACbX,IAAIA;QACJD,KAAKA;QACLS,WAAWA;QACXN,SAAS,CAACU;YACRV,QAAQU;YAER,IAAIF,wBAAwB;gBAC1BE,MAAMC,eAAe;YACvB;YAEA,kEAAkE;YAClE,wEAAwE;YACxE,oEAAoE;YACpE,gDAAgD;YAChD,IAAIC,QAAiCC,SAASC,aAAa,CAAC;YAC5DF,MAAMG,IAAI,GAAG;YACb,IAAIb,QAAQ;gBACVU,MAAMV,MAAM,GAAGA;YACjB;YACA,IAAIE,UAAU;gBACZQ,MAAMR,QAAQ,GAAGA;YACnB;YACA,IAAID,SAAS;gBACXS,MAAMT,OAAO,GAAGA,YAAY,OAAO,KAAKA;YAC1C;YAEA,6DAA6D;YAC7D,mBAAmB;YACnBS,MAAMI,gBAAgB,CAAC,UAAUf;YACjCW,MAAMK,KAAK;YACXL,QAAQ;QACV;kBAECP;;AAGP"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import { type
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type ListProps } from "../list/List.js";
|
|
3
3
|
import { type LabelRequiredForA11y } from "../types.js";
|
|
4
4
|
/** @since 5.0.0 */
|
|
5
5
|
export type MenuItemGroupProps = LabelRequiredForA11y<Omit<ListProps, "role">> & {
|
|
@@ -70,4 +70,4 @@ export type MenuItemGroupProps = LabelRequiredForA11y<Omit<ListProps, "role">> &
|
|
|
70
70
|
* @see {@link https://react-md.dev/components/menu | Menu Demos}
|
|
71
71
|
* @since 5.0.0
|
|
72
72
|
*/
|
|
73
|
-
export declare
|
|
73
|
+
export declare function MenuItemGroup(props: MenuItemGroupProps): ReactElement;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cnb } from "cnbuilder";
|
|
4
|
-
import { forwardRef } from "react";
|
|
5
4
|
import { List } from "../list/List.js";
|
|
6
5
|
import { useMenuConfiguration } from "./MenuConfigurationProvider.js";
|
|
7
6
|
/**
|
|
@@ -68,16 +67,17 @@ import { useMenuConfiguration } from "./MenuConfigurationProvider.js";
|
|
|
68
67
|
*
|
|
69
68
|
* @see {@link https://react-md.dev/components/menu | Menu Demos}
|
|
70
69
|
* @since 5.0.0
|
|
71
|
-
*/ export
|
|
70
|
+
*/ export function MenuItemGroup(props) {
|
|
71
|
+
const { ref, children, className, ...remaining } = props;
|
|
72
72
|
const { horizontal } = useMenuConfiguration(props);
|
|
73
73
|
return /*#__PURE__*/ _jsx(List, {
|
|
74
|
-
...
|
|
74
|
+
...remaining,
|
|
75
75
|
ref: ref,
|
|
76
76
|
role: "group",
|
|
77
77
|
className: cnb("rmd-menu-item-group", className),
|
|
78
78
|
horizontal: horizontal,
|
|
79
79
|
children: children
|
|
80
80
|
});
|
|
81
|
-
}
|
|
81
|
+
}
|
|
82
82
|
|
|
83
83
|
//# sourceMappingURL=MenuItemGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/menu/MenuItemGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { type
|
|
1
|
+
{"version":3,"sources":["../../src/menu/MenuItemGroup.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { type ReactElement, type ReactNode } from \"react\";\n\nimport { List, type ListProps } from \"../list/List.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { useMenuConfiguration } from \"./MenuConfigurationProvider.js\";\n\n/** @since 5.0.0 */\nexport type MenuItemGroupProps = LabelRequiredForA11y<\n Omit<ListProps, \"role\">\n> & {\n children: ReactNode;\n};\n\n/**\n * **Client Component**\n *\n * If a menu or menubar contains more than one group of menuitemradio elements,\n * or if the menu contains one group and other, unrelated menu items, authors\n * SHOULD nest each set of related menuitemradio elements in an element using\n * the group role, and authors SHOULD delimit the group from other menu items\n * with an element using the separator role.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio}\n *\n * @example Simple Example\n * ```tsx\n * import { ReactElement, useState } from \"react\";\n * import { DropdownMenu } from \"@react-md/core/menu/DropdownMenu\";\n * import { MenuItemGroup } from \"@react-md/core/menu/MenuItemGroup\";\n * import { MenuItemRadio } from \"@react-md/core/menu/MenuItemRadio\";\n * import { MenuItemSeparator } from \"@react-md/core/menu/MenuItemSeparator\";\n * import { MenuItemSwitch } from \"@react-md/core/menu/MenuItemSwitch\";\n *\n * function Example(): ReactElement {\n * const [value, setValue] = useState(\"value1\");\n * const [checked, setChecked] = useState(false);\n *\n * return (\n * <DropdownMenu id=\"dropdown-menu-id\" buttonChildren=\"Button\">\n * <MenuItemSwitch\n * id=\"switch-id\"\n * checked={checked}\n * onCheckedChange={nextChecked => setChecked(nextChecked)}\n * >\n * Light mode\n * </MenuItemSwitch>\n * <MenuItemSeparator />\n * <MenuItemGroup aria-label=\"My Group Label\">\n * <MenuItemRadio\n * id=\"radio-1\"\n * checked={value === \"value1\"}\n * onCheckedChange={() => setValue(\"value1\")}\n * >\n * Radio 1\n * </MenuItemRadio>\n * <MenuItemRadio\n * id=\"radio-2\"\n * checked={value === \"value2\"}\n * onCheckedChange={() => setValue(\"value2\")}\n * >\n * Radio 2\n * </MenuItemRadio>\n * <MenuItemRadio\n * id=\"radio-3\"\n * checked={value === \"value3\"}\n * onCheckedChange={() => setValue(\"value3\")}\n * >\n * Radio 3\n * </MenuItemRadio>\n * </MenuItemGroup>\n * </DropdownMenu>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/menu | Menu Demos}\n * @since 5.0.0\n */\nexport function MenuItemGroup(props: MenuItemGroupProps): ReactElement {\n const { ref, children, className, ...remaining } = props;\n const { horizontal } = useMenuConfiguration(props);\n\n return (\n <List\n {...remaining}\n ref={ref}\n role=\"group\"\n className={cnb(\"rmd-menu-item-group\", className)}\n horizontal={horizontal}\n >\n {children}\n </List>\n );\n}\n"],"names":["cnb","List","useMenuConfiguration","MenuItemGroup","props","ref","children","className","remaining","horizontal","role"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAGhC,SAASC,IAAI,QAAwB,kBAAkB;AAEvD,SAASC,oBAAoB,QAAQ,iCAAiC;AAStE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEC,GACD,OAAO,SAASC,cAAcC,KAAyB;IACrD,MAAM,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,WAAW,GAAGJ;IACnD,MAAM,EAAEK,UAAU,EAAE,GAAGP,qBAAqBE;IAE5C,qBACE,KAACH;QACE,GAAGO,SAAS;QACbH,KAAKA;QACLK,MAAK;QACLH,WAAWP,IAAI,uBAAuBO;QACtCE,YAAYA;kBAEXH;;AAGP"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CSSProperties, type HTMLAttributes, type MouseEvent, type ReactNode } from "react";
|
|
1
|
+
import { type CSSProperties, type HTMLAttributes, type MouseEvent, type ReactElement, type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type ConfigurableInputToggleIconProps, type IndeterminateCheckboxProps } from "../form/InputToggle.js";
|
|
3
3
|
import { type InputToggleSize } from "../form/inputToggleStyles.js";
|
|
4
4
|
import { type ListItemAddonPosition, type ListItemAddonType, type ListItemChildrenTextProps, type ListItemHeight } from "../list/types.js";
|
|
@@ -9,6 +9,7 @@ import { type PropsWithRef } from "../types.js";
|
|
|
9
9
|
export type MenuItemInputToggleCheckedCallback = (checked: boolean, event: MouseEvent<HTMLLIElement>) => void;
|
|
10
10
|
/** @since 2.8.0 */
|
|
11
11
|
export interface BaseMenuItemInputToggleProps extends HTMLAttributes<HTMLLIElement>, ConfigurableInputToggleIconProps, ListItemChildrenTextProps {
|
|
12
|
+
ref?: Ref<HTMLLIElement>;
|
|
12
13
|
checked: boolean;
|
|
13
14
|
onCheckedChange: MenuItemInputToggleCheckedCallback;
|
|
14
15
|
/**
|
|
@@ -87,4 +88,4 @@ export type MenuItemInputToggleProps = (MenuItemCheckboxProps & {
|
|
|
87
88
|
* @see {@link MenuItemSwitch} for switch examples
|
|
88
89
|
* @since 2.8.0
|
|
89
90
|
*/
|
|
90
|
-
export declare
|
|
91
|
+
export declare function MenuItemInputToggle(props: MenuItemInputToggleProps): ReactElement;
|