@react-md/core 6.5.2 → 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/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
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import { segmentedButtonContainer } from "./segmentedButtonContainerStyles.js";
|
|
4
3
|
/**
|
|
5
4
|
* Simple wrapper `div` to apply the segmented button container styles. You can
|
|
@@ -11,7 +10,7 @@ import { segmentedButtonContainer } from "./segmentedButtonContainerStyles.js";
|
|
|
11
10
|
* import { segmentedButtonContainer } from "@react-md/core/segmented-button/SegmentedButtonContainer";
|
|
12
11
|
* import type { ReactElement } from "react";
|
|
13
12
|
*
|
|
14
|
-
* import { CustomWrapperComponent } from "./CustomWrapperComponent.
|
|
13
|
+
* import { CustomWrapperComponent } from "./CustomWrapperComponent.js";
|
|
15
14
|
*
|
|
16
15
|
* function Example(): ReactElement {
|
|
17
16
|
* return (
|
|
@@ -26,8 +25,8 @@ import { segmentedButtonContainer } from "./segmentedButtonContainerStyles.js";
|
|
|
26
25
|
*
|
|
27
26
|
* @see {@link https://react-md.dev/components/segmented-button | SegmentedButton Demos}
|
|
28
27
|
* @since 6.0.0
|
|
29
|
-
*/ export
|
|
30
|
-
const { className, disableFullWidth, children, ...remaining } = props;
|
|
28
|
+
*/ export function SegmentedButtonContainer(props) {
|
|
29
|
+
const { ref, className, disableFullWidth, children, ...remaining } = props;
|
|
31
30
|
return /*#__PURE__*/ _jsx("div", {
|
|
32
31
|
...remaining,
|
|
33
32
|
ref: ref,
|
|
@@ -37,6 +36,6 @@ import { segmentedButtonContainer } from "./segmentedButtonContainerStyles.js";
|
|
|
37
36
|
}),
|
|
38
37
|
children: children
|
|
39
38
|
});
|
|
40
|
-
}
|
|
39
|
+
}
|
|
41
40
|
|
|
42
41
|
//# sourceMappingURL=SegmentedButtonContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/segmented-button/SegmentedButtonContainer.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/segmented-button/SegmentedButtonContainer.tsx"],"sourcesContent":["import {\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nimport {\n type SegmentedButtonContainerClassNameOptions,\n segmentedButtonContainer,\n} from \"./segmentedButtonContainerStyles.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface SegmentedButtonContainerProps\n extends\n HTMLAttributes<HTMLDivElement>,\n SegmentedButtonContainerClassNameOptions {\n ref?: Ref<HTMLDivElement>;\n\n children: ReactNode;\n}\n\n/**\n * Simple wrapper `div` to apply the segmented button container styles. You can\n * just use the {@link segmentedButtonContainer} util function instead.\n *\n * @example Without This Component\n * ```tsx\n * import { SegmentedButton } from \"@react-md/core/segmented-button/SegmentedButton\";\n * import { segmentedButtonContainer } from \"@react-md/core/segmented-button/SegmentedButtonContainer\";\n * import type { ReactElement } from \"react\";\n *\n * import { CustomWrapperComponent } from \"./CustomWrapperComponent.js\";\n *\n * function Example(): ReactElement {\n * return (\n * <CustomWrapperComponent className={segmentedButtonContainer()}>\n * <SegmentedButton>One</SegmentedButton>\n * <SegmentedButton>Two</SegmentedButton>\n * <SegmentedButton>Three</SegmentedButton>\n * </CustomWrapperComponent>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/segmented-button | SegmentedButton Demos}\n * @since 6.0.0\n */\nexport function SegmentedButtonContainer(\n props: SegmentedButtonContainerProps\n): ReactElement {\n const { ref, className, disableFullWidth, children, ...remaining } = props;\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={segmentedButtonContainer({\n className,\n disableFullWidth,\n })}\n >\n {children}\n </div>\n );\n}\n"],"names":["segmentedButtonContainer","SegmentedButtonContainer","props","ref","className","disableFullWidth","children","remaining","div"],"mappings":";AAOA,SAEEA,wBAAwB,QACnB,sCAAsC;AAc7C;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,GACD,OAAO,SAASC,yBACdC,KAAoC;IAEpC,MAAM,EAAEC,GAAG,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,QAAQ,EAAE,GAAGC,WAAW,GAAGL;IAErE,qBACE,KAACM;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLC,WAAWJ,yBAAyB;YAClCI;YACAC;QACF;kBAECC;;AAGP"}
|
package/dist/sheet/Sheet.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
1
2
|
import { type BaseDialogProps } from "../dialog/Dialog.js";
|
|
2
3
|
import { type LabelRequiredForA11y } from "../types.js";
|
|
3
4
|
import { type BaseSheetClassNameOptions } from "./styles.js";
|
|
@@ -51,4 +52,4 @@ export type SheetProps = LabelRequiredForA11y<BaseSheetProps>;
|
|
|
51
52
|
*
|
|
52
53
|
* @see {@link https://react-md.dev/components/sheet | Sheet Demos}
|
|
53
54
|
*/
|
|
54
|
-
export declare
|
|
55
|
+
export declare function Sheet(props: SheetProps): ReactElement;
|
package/dist/sheet/Sheet.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 { Dialog } from "../dialog/Dialog.js";
|
|
5
4
|
import { DEFAULT_SHEET_CLASSNAMES, DEFAULT_SHEET_TIMEOUT, sheet } from "./styles.js";
|
|
6
5
|
/**
|
|
@@ -31,8 +30,8 @@ import { DEFAULT_SHEET_CLASSNAMES, DEFAULT_SHEET_TIMEOUT, sheet } from "./styles
|
|
|
31
30
|
* ```
|
|
32
31
|
*
|
|
33
32
|
* @see {@link https://react-md.dev/components/sheet | Sheet Demos}
|
|
34
|
-
*/ export
|
|
35
|
-
const { role = "dialog", className, position = "left", horizontalSize = "media", verticalSize = "recommended", timeout = DEFAULT_SHEET_TIMEOUT, classNames = DEFAULT_SHEET_CLASSNAMES, visible, temporary = true, exitedHidden = true, raised, children, ...remaining } = props;
|
|
33
|
+
*/ export function Sheet(props) {
|
|
34
|
+
const { ref, role = "dialog", className, position = "left", horizontalSize = "media", verticalSize = "recommended", timeout = DEFAULT_SHEET_TIMEOUT, classNames = DEFAULT_SHEET_CLASSNAMES, visible, temporary = true, exitedHidden = true, raised, children, ...remaining } = props;
|
|
36
35
|
const { disableOverlay } = props;
|
|
37
36
|
return /*#__PURE__*/ _jsx(Dialog, {
|
|
38
37
|
...remaining,
|
|
@@ -53,6 +52,6 @@ import { DEFAULT_SHEET_CLASSNAMES, DEFAULT_SHEET_TIMEOUT, sheet } from "./styles
|
|
|
53
52
|
}),
|
|
54
53
|
children: children
|
|
55
54
|
});
|
|
56
|
-
}
|
|
55
|
+
}
|
|
57
56
|
|
|
58
57
|
//# sourceMappingURL=Sheet.js.map
|
package/dist/sheet/Sheet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/sheet/Sheet.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/sheet/Sheet.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactElement } from \"react\";\n\nimport { type BaseDialogProps, Dialog } from \"../dialog/Dialog.js\";\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport {\n type BaseSheetClassNameOptions,\n DEFAULT_SHEET_CLASSNAMES,\n DEFAULT_SHEET_TIMEOUT,\n sheet,\n} from \"./styles.js\";\n\n/**\n * @since 6.0.0\n */\nexport type SheetDialogProps = Omit<BaseDialogProps, \"role\" | \"type\" | \"modal\">;\n\n/**\n * @since 6.0.0 extends the `SheetDialogProps` instead of `AllowedDialogProps`\n * and exports the `SheetDialogProps`.\n */\nexport interface BaseSheetProps\n extends SheetDialogProps, BaseSheetClassNameOptions {\n /**\n * @defaultValue `\"dialog\"`\n */\n role?: \"dialog\" | \"menu\" | \"none\";\n\n /**\n * @defaultValue `true`\n * @see {@link SheetDialogProps.exitedHidden}\n * @since 6.0.0\n */\n exitedHidden?: boolean;\n}\n\nexport type SheetProps = LabelRequiredForA11y<BaseSheetProps>;\n\n/**\n * **Client Component**\n *\n * The `Sheet` component is a {@link Dialog} that is fixed to the top, right,\n * bottom, or left of the viewport.\n *\n * @example Simple Example\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Sheet } from \"@react-md/core/sheet/Sheet\";\n * import { useToggle } from \"@react-md/core/useToggle\";\n * import { type ReactElement } from \"react\";\n *\n * export function Example(): ReactElement {\n * const { toggled, disable, enable } = useToggle();\n *\n * return (\n * <>\n * <Button onClick={enable}>Show</Button>\n * <Sheet aria-label=\"Customization\" visible={toggled} onRequestClose={disable}>\n * Whatever Content\n * </Sheet>\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/sheet | Sheet Demos}\n */\nexport function Sheet(props: SheetProps): ReactElement {\n const {\n ref,\n role = \"dialog\",\n className,\n position = \"left\",\n horizontalSize = \"media\",\n verticalSize = \"recommended\",\n timeout = DEFAULT_SHEET_TIMEOUT,\n classNames = DEFAULT_SHEET_CLASSNAMES,\n visible,\n temporary = true,\n exitedHidden = true,\n raised,\n children,\n ...remaining\n } = props;\n const { disableOverlay } = props;\n\n return (\n <Dialog\n {...remaining}\n ref={ref}\n role={role}\n type=\"custom\"\n timeout={timeout}\n classNames={classNames}\n visible={visible}\n temporary={temporary}\n exitedHidden={exitedHidden}\n className={sheet({\n raised: raised ?? !disableOverlay,\n position,\n horizontalSize,\n verticalSize,\n className,\n })}\n >\n {children}\n </Dialog>\n );\n}\n"],"names":["Dialog","DEFAULT_SHEET_CLASSNAMES","DEFAULT_SHEET_TIMEOUT","sheet","Sheet","props","ref","role","className","position","horizontalSize","verticalSize","timeout","classNames","visible","temporary","exitedHidden","raised","children","remaining","disableOverlay","type"],"mappings":"AAAA;;AAIA,SAA+BA,MAAM,QAAQ,sBAAsB;AAEnE,SAEEC,wBAAwB,EACxBC,qBAAqB,EACrBC,KAAK,QACA,cAAc;AA4BrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BC,GACD,OAAO,SAASC,MAAMC,KAAiB;IACrC,MAAM,EACJC,GAAG,EACHC,OAAO,QAAQ,EACfC,SAAS,EACTC,WAAW,MAAM,EACjBC,iBAAiB,OAAO,EACxBC,eAAe,aAAa,EAC5BC,UAAUV,qBAAqB,EAC/BW,aAAaZ,wBAAwB,EACrCa,OAAO,EACPC,YAAY,IAAI,EAChBC,eAAe,IAAI,EACnBC,MAAM,EACNC,QAAQ,EACR,GAAGC,WACJ,GAAGd;IACJ,MAAM,EAAEe,cAAc,EAAE,GAAGf;IAE3B,qBACE,KAACL;QACE,GAAGmB,SAAS;QACbb,KAAKA;QACLC,MAAMA;QACNc,MAAK;QACLT,SAASA;QACTC,YAAYA;QACZC,SAASA;QACTC,WAAWA;QACXC,cAAcA;QACdR,WAAWL,MAAM;YACfc,QAAQA,UAAU,CAACG;YACnBX;YACAC;YACAC;YACAH;QACF;kBAECU;;AAGP"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentType, type HTMLAttributes } from "react";
|
|
1
|
+
import { type ComponentType, type HTMLAttributes, type ReactElement, type Ref } from "react";
|
|
2
2
|
import { type ToastRendererProps } from "./DefaultToastRenderer.js";
|
|
3
3
|
import { type ConfigurableToastProps } from "./Toast.js";
|
|
4
4
|
import { type SnackbarPosition } from "./snackbarStyles.js";
|
|
@@ -6,6 +6,7 @@ import { type SnackbarPosition } from "./snackbarStyles.js";
|
|
|
6
6
|
* @since 6.0.0 The `id` prop is optional
|
|
7
7
|
*/
|
|
8
8
|
export interface SnackbarProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
ref?: Ref<HTMLDivElement>;
|
|
9
10
|
/** @defaultValue `"snackbar-" + useId()` */
|
|
10
11
|
id?: string;
|
|
11
12
|
/**
|
|
@@ -130,4 +131,4 @@ export interface SnackbarProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
130
131
|
* @since 6.0.0 Rewritten to use a new API that supports adding toasts
|
|
131
132
|
* outside of React components and rendering multiple toasts at once.
|
|
132
133
|
*/
|
|
133
|
-
export declare
|
|
134
|
+
export declare function Snackbar(props: SnackbarProps): ReactElement;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createElement as _createElement } from "react";
|
|
4
|
-
import { forwardRef } from "react";
|
|
5
4
|
import { Portal } from "../portal/Portal.js";
|
|
6
5
|
import { useEnsuredId } from "../useEnsuredId.js";
|
|
7
6
|
import { DefaultToastRenderer } from "./DefaultToastRenderer.js";
|
|
@@ -38,8 +37,8 @@ import { snackbar } from "./snackbarStyles.js";
|
|
|
38
37
|
* implementation.
|
|
39
38
|
* @since 6.0.0 Rewritten to use a new API that supports adding toasts
|
|
40
39
|
* outside of React components and rendering multiple toasts at once.
|
|
41
|
-
*/ export
|
|
42
|
-
const { id: propId, className, limit = 1, absolute, position = "bottom", renderToast: RenderToast = DefaultToastRenderer, disablePortal, toastDefaults, ...remaining } = props;
|
|
40
|
+
*/ export function Snackbar(props) {
|
|
41
|
+
const { ref, id: propId, className, limit = 1, absolute, position = "bottom", renderToast: RenderToast = DefaultToastRenderer, disablePortal, toastDefaults, ...remaining } = props;
|
|
43
42
|
const id = useEnsuredId(propId, "snackbar");
|
|
44
43
|
const queue = useToastQueue(limit);
|
|
45
44
|
return /*#__PURE__*/ _jsx(Portal, {
|
|
@@ -60,6 +59,6 @@ import { snackbar } from "./snackbarStyles.js";
|
|
|
60
59
|
}))
|
|
61
60
|
})
|
|
62
61
|
});
|
|
63
|
-
}
|
|
62
|
+
}
|
|
64
63
|
|
|
65
64
|
//# sourceMappingURL=Snackbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/snackbar/Snackbar.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/snackbar/Snackbar.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type ComponentType,\n type HTMLAttributes,\n type ReactElement,\n type Ref,\n} from \"react\";\n\nimport { Portal } from \"../portal/Portal.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport {\n DefaultToastRenderer,\n type ToastRendererProps,\n} from \"./DefaultToastRenderer.js\";\nimport { type ConfigurableToastProps } from \"./Toast.js\";\nimport { useToastQueue } from \"./ToastManagerProvider.js\";\nimport { type SnackbarPosition, snackbar } from \"./snackbarStyles.js\";\n\n/**\n * @since 6.0.0 The `id` prop is optional\n */\nexport interface SnackbarProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n\n /** @defaultValue `\"snackbar-\" + useId()` */\n id?: string;\n\n /**\n * Set this to the number of toasts that can be visible within the snackbar at\n * the same time. Any toasts added after this value will be added into the\n * queue to be shown.\n *\n * @defaultValue `1`\n */\n limit?: number;\n\n /**\n * Set this to `true` if the snackbar should use absolute positioning so it\n * can be fixed within a `position: relative` container instead of the entire\n * viewport.\n *\n * @defaultValue `false`\n */\n absolute?: boolean;\n\n /** @defaultValue `\"bottom\"` */\n position?: SnackbarPosition;\n\n /** @defaultValue `false` */\n disablePortal?: boolean;\n\n /**\n * This can be used to create a custom toast implementation.\n *\n * @example\n * ```ts\n * import { Snackbar } from \"@react-md/core/snackbar/Snackbar\";\n * import { Toast } from \"@react-md/core/snackbar/Toast\";\n * import { ToastContent } from \"@react-md/core/snackbar/ToastContent\";\n * import { type ToastRendererProps } from \"@react-md/core/snackbar/DefaultToastRenderer\";\n * import { useToastManager } from \"@react-md/core/snackbar/ToastManagerProvider\";\n * import { type ReactElement } from \"react\";\n *\n * function CustomToast(props: CustomToastRendererProps): ReactElement {\n * // Pretend like we don't need anything else from the toast since the\n * // custom behavior is related to the `toastId`\n * const { toastId, visible, duplicates, visibleTime } = props;\n *\n * const toastManager = useToastManager();\n *\n * // Note: If you want to rely on the `action` and `closeButton` behavior,\n * // you must also wrap the `Toast` with:\n * // <RemoveToastProvider value={() => toastManager.removeToast(toastId, true)}>\n *\n * return (\n * <Toast\n * theme={isError(toastId) ? \"error\" : \"surface\"}\n * visible={visible}\n * onEntered={() => {\n * toastManager.startRemoveTimeout(toastId);\n * }}\n * onExited={() => {\n * toastManager.removeToast(toastId, false)\n * }}\n * disableContentWrapper\n * >\n * <ToastContent>\n * <TranslateMessage id={toastId} />\n * </ToastContent>\n * {isActionable(toastId) && (\n * <Button\n * onClick={async () => {\n * await someApiCall();\n * toastManager.removeToast(toastId, true);\n * }}\n * >\n * Dismiss\n * </Button>\n * )}\n * </Toast>\n * );\n * }\n *\n * function Example(): ReactElement {\n * return <Snackbar renderToast={CustomToast} />\n * }\n * ```\n *\n * @see {@link DefaultToastRenderer}\n * @defaultValue `DefaultToastRenderer`\n */\n renderToast?: ComponentType<ToastRendererProps>;\n\n /**\n * Optional props that should be passed to each `Toast` from the `Snackbar`.\n * This is a great way to enforce each toast having a close button, a custom\n * class name, theme, etc.\n *\n * @see {@link DefaultToastRenderer}\n */\n toastDefaults?: ConfigurableToastProps;\n}\n\n/**\n * **Client Component**\n *\n * @example Super Simple Example\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Snackbar } from \"@react-md/core/snackbar/Snackbar\";\n * import { addToast } from \"@react-md/core/snackbar/ToastManager\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <>\n * <Button\n * onClick={() => {\n * addToast({ children: \"A new toast!\" });\n * }}\n * >\n * Toast!\n * </Button>\n * <Snackbar />\n * </>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}\n * @see {@link SnackbarProps.renderToast} for creating a custom toast\n * implementation.\n * @since 6.0.0 Rewritten to use a new API that supports adding toasts\n * outside of React components and rendering multiple toasts at once.\n */\nexport function Snackbar(props: SnackbarProps): ReactElement {\n const {\n ref,\n id: propId,\n className,\n limit = 1,\n absolute,\n position = \"bottom\",\n renderToast: RenderToast = DefaultToastRenderer,\n disablePortal,\n toastDefaults,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"snackbar\");\n const queue = useToastQueue(limit);\n\n return (\n <Portal disabled={disablePortal}>\n {queue.length > 0 && (\n <div\n {...remaining}\n id={id}\n ref={ref}\n className={snackbar({ absolute, position, className })}\n >\n {queue.map((toast) => (\n <RenderToast\n {...toast}\n key={toast.toastId}\n toastDefaults={toastDefaults}\n />\n ))}\n </div>\n )}\n </Portal>\n );\n}\n"],"names":["Portal","useEnsuredId","DefaultToastRenderer","useToastQueue","snackbar","Snackbar","props","ref","id","propId","className","limit","absolute","position","renderToast","RenderToast","disablePortal","toastDefaults","remaining","queue","disabled","length","div","map","toast","key","toastId"],"mappings":"AAAA;;;AASA,SAASA,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SACEC,oBAAoB,QAEf,4BAA4B;AAEnC,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAAgCC,QAAQ,QAAQ,sBAAsB;AA2GtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BC,GACD,OAAO,SAASC,SAASC,KAAoB;IAC3C,MAAM,EACJC,GAAG,EACHC,IAAIC,MAAM,EACVC,SAAS,EACTC,QAAQ,CAAC,EACTC,QAAQ,EACRC,WAAW,QAAQ,EACnBC,aAAaC,cAAcb,oBAAoB,EAC/Cc,aAAa,EACbC,aAAa,EACb,GAAGC,WACJ,GAAGZ;IACJ,MAAME,KAAKP,aAAaQ,QAAQ;IAChC,MAAMU,QAAQhB,cAAcQ;IAE5B,qBACE,KAACX;QAAOoB,UAAUJ;kBACfG,MAAME,MAAM,GAAG,mBACd,KAACC;YACE,GAAGJ,SAAS;YACbV,IAAIA;YACJD,KAAKA;YACLG,WAAWN,SAAS;gBAAEQ;gBAAUC;gBAAUH;YAAU;sBAEnDS,MAAMI,GAAG,CAAC,CAACC,sBACV,eAACT;oBACE,GAAGS,KAAK;oBACTC,KAAKD,MAAME,OAAO;oBAClBT,eAAeA;;;;AAO7B"}
|
package/dist/snackbar/Toast.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AriaRole, type HTMLAttributes, type ReactElement, type ReactNode } from "react";
|
|
1
|
+
import { type AriaRole, type HTMLAttributes, type ReactElement, type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type ButtonProps } from "../button/Button.js";
|
|
3
3
|
import { type CSSTransitionClassNames, type TransitionCallbacks, type TransitionTimeout } from "../transition/types.js";
|
|
4
4
|
import { type PropsWithRef } from "../types.js";
|
|
@@ -8,6 +8,7 @@ import { type BaseToastClasNameOptions } from "./toastStyles.js";
|
|
|
8
8
|
* @since 6.0.0
|
|
9
9
|
*/
|
|
10
10
|
export interface ConfigurableToastProps extends HTMLAttributes<HTMLDivElement>, BaseToastClasNameOptions, TransitionCallbacks {
|
|
11
|
+
ref?: Ref<HTMLDivElement>;
|
|
11
12
|
/**
|
|
12
13
|
* Note: this default value will only be generated in the `Toast` component.
|
|
13
14
|
*
|
|
@@ -99,4 +100,4 @@ export interface ToastProps extends ConfigurableToastProps {
|
|
|
99
100
|
* @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}
|
|
100
101
|
* @since 6.0.0
|
|
101
102
|
*/
|
|
102
|
-
export declare
|
|
103
|
+
export declare function Toast(props: ToastProps): ReactElement | null;
|
package/dist/snackbar/Toast.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { isValidElement } from "react";
|
|
4
4
|
import { useScaleTransition } from "../transition/useScaleTransition.js";
|
|
5
5
|
import { useEnsuredId } from "../useEnsuredId.js";
|
|
6
6
|
import { ToastActionButton } from "./ToastActionButton.js";
|
|
@@ -15,8 +15,8 @@ import { toast } from "./toastStyles.js";
|
|
|
15
15
|
*
|
|
16
16
|
* @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}
|
|
17
17
|
* @since 6.0.0
|
|
18
|
-
*/ export
|
|
19
|
-
const { id: propId, className, timeout, classNames, theme = "surface", action: propAction, actionButton: propActionButton, paused, visible, closeIcon: propCloseIcon, closeButtonProps, closeButton = !!closeButtonProps, contentProps, disableToastContent, stacked, multiline, onEnter, onEntering, onEntered, onExit, onExiting, onExited, children, ...remaining } = props;
|
|
18
|
+
*/ export function Toast(props) {
|
|
19
|
+
const { ref, id: propId, className, timeout, classNames, theme = "surface", action: propAction, actionButton: propActionButton, paused, visible, closeIcon: propCloseIcon, closeButtonProps, closeButton = !!closeButtonProps, contentProps, disableToastContent, stacked, multiline, onEnter, onEntering, onEntered, onExit, onExiting, onExited, children, ...remaining } = props;
|
|
20
20
|
const id = useEnsuredId(propId, "toast");
|
|
21
21
|
let actionButton = propActionButton;
|
|
22
22
|
if (propAction) {
|
|
@@ -93,6 +93,6 @@ import { toast } from "./toastStyles.js";
|
|
|
93
93
|
})
|
|
94
94
|
]
|
|
95
95
|
});
|
|
96
|
-
}
|
|
96
|
+
}
|
|
97
97
|
|
|
98
98
|
//# sourceMappingURL=Toast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/snackbar/Toast.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type AriaRole,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n
|
|
1
|
+
{"version":3,"sources":["../../src/snackbar/Toast.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type AriaRole,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n isValidElement,\n} from \"react\";\n\nimport { type ButtonProps } from \"../button/Button.js\";\nimport {\n type CSSTransitionClassNames,\n type TransitionCallbacks,\n type TransitionTimeout,\n} from \"../transition/types.js\";\nimport { useScaleTransition } from \"../transition/useScaleTransition.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { ToastActionButton } from \"./ToastActionButton.js\";\nimport { ToastCloseButton } from \"./ToastCloseButton.js\";\nimport { ToastContent, type ToastContentProps } from \"./ToastContent.js\";\nimport { type BaseToastClasNameOptions, toast } from \"./toastStyles.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface ConfigurableToastProps\n extends\n HTMLAttributes<HTMLDivElement>,\n BaseToastClasNameOptions,\n TransitionCallbacks {\n ref?: Ref<HTMLDivElement>;\n\n /**\n * Note: this default value will only be generated in the `Toast` component.\n *\n * @defaultValue `\"toast-\" + useId()`\n */\n id?: string;\n\n /**\n * Note: This is set while creating the toast.\n *\n * @defaultValue `visibleTime === null ? \"alert\" : \"status\"`\n */\n role?: AriaRole;\n\n /**\n * Set this to `true` to stack the content above the {@link action}. It is not\n * recommended to enable this prop if the {@link closeButton} is enabled.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * If this is not provided, a `ResizeObserver` will be used to determine if\n * there are multiple lines of content.\n */\n multiline?: boolean;\n\n /**\n * When this is a string or React element, it will be rendered as the\n * `children` within a `Button`\n */\n action?: ButtonProps | ReactElement | string;\n\n /**\n * This can be used to replace the custom action button behavior.\n */\n actionButton?: ReactNode;\n\n /**\n * @defaultValue `getIcon(\"close\")`\n */\n closeIcon?: ReactNode;\n\n /**\n * Set this to `true` if a close button should be rendered to the right of the\n * `children`.\n *\n * @defaultValue `!!closeButtonProps`\n */\n closeButton?: boolean;\n\n /**\n * Use this prop to override most of the close button behavior. The\n */\n closeButtonProps?: ButtonProps;\n\n /**\n * Any additional props that should be provided to the `<div>` that surrounds\n * the toast `children`.\n */\n contentProps?: PropsWithRef<ToastContentProps>;\n\n /**\n * Set this to `true` if the `children` for the toast should no longer be\n * wrapped in an additional `<div>` that applies some toast layout styles.\n * This should normally only be used for custom `Toast` implementations.\n *\n * @see the `Snackbar`'s `renderToast` prop for an example.\n */\n disableToastContent?: boolean;\n\n /**\n * The toast's transition timeout for entering and exiting. This is **not**\n * how long the toast should remain visible.\n *\n * @defaultValue `SCALE_TIMEOUT`\n */\n timeout?: TransitionTimeout;\n\n /**\n * The toast's transition class names for entering and exiting.\n *\n * @defaultValue `SCALE_CLASSNAMES`\n */\n classNames?: CSSTransitionClassNames;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface ToastProps extends ConfigurableToastProps {\n paused?: boolean;\n visible: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This component is just used for toast styling and does not implement any of\n * the visibility behavior.\n *\n * @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}\n * @since 6.0.0\n */\nexport function Toast(props: ToastProps): ReactElement | null {\n const {\n ref,\n id: propId,\n className,\n timeout,\n classNames,\n theme = \"surface\",\n action: propAction,\n actionButton: propActionButton,\n paused,\n visible,\n closeIcon: propCloseIcon,\n closeButtonProps,\n closeButton = !!closeButtonProps,\n contentProps,\n disableToastContent,\n stacked,\n multiline,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n children,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"toast\");\n\n let actionButton = propActionButton;\n if (propAction) {\n let overrides: ButtonProps = {};\n let buttonChildren: ReactNode;\n // have to use `any` to correctly filter out all react elements\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isValidElement<any>(propAction) || typeof propAction !== \"object\") {\n buttonChildren = propAction;\n } else {\n ({ children: buttonChildren, ...overrides } = propAction);\n }\n\n actionButton = (\n <ToastActionButton\n theme={theme === \"surface\" ? \"secondary\" : \"clear\"}\n reordered={stacked && closeButton}\n {...overrides}\n >\n {buttonChildren}\n </ToastActionButton>\n );\n }\n\n let closeIcon = propCloseIcon;\n if (closeButtonProps?.children !== undefined) {\n closeIcon = closeButtonProps.children;\n }\n\n const action = !!actionButton;\n const reordered = stacked && action && closeButton;\n const { elementProps, rendered } = useScaleTransition({\n appear: true,\n nodeRef: ref,\n className: toast({\n className,\n theme,\n action,\n paused,\n stacked,\n reordered,\n closeButton,\n }),\n timeout,\n classNames,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n temporary: true,\n transitionIn: visible,\n exitedHidden: true,\n });\n\n // this might get rid of the weird popping-back-in for a split second\n // that sometimes happens on mobile firefox\n if (!rendered) {\n return null;\n }\n\n return (\n <div {...remaining} {...elementProps} id={id}>\n <ToastContent\n action={action}\n stacked={stacked}\n multiline={multiline}\n closeButton={closeButton}\n disableWrapper={disableToastContent}\n {...contentProps}\n >\n {children}\n </ToastContent>\n {actionButton}\n {closeButton && (\n <ToastCloseButton reordered={reordered} {...closeButtonProps}>\n {closeIcon}\n </ToastCloseButton>\n )}\n </div>\n );\n}\n"],"names":["isValidElement","useScaleTransition","useEnsuredId","ToastActionButton","ToastCloseButton","ToastContent","toast","Toast","props","ref","id","propId","className","timeout","classNames","theme","action","propAction","actionButton","propActionButton","paused","visible","closeIcon","propCloseIcon","closeButtonProps","closeButton","contentProps","disableToastContent","stacked","multiline","onEnter","onEntering","onEntered","onExit","onExiting","onExited","children","remaining","overrides","buttonChildren","reordered","undefined","elementProps","rendered","appear","nodeRef","temporary","transitionIn","exitedHidden","div","disableWrapper"],"mappings":"AAAA;;AAEA,SAMEA,cAAc,QACT,QAAQ;AAQf,SAASC,kBAAkB,QAAQ,sCAAsC;AAEzE,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,YAAY,QAAgC,oBAAoB;AACzE,SAAwCC,KAAK,QAAQ,mBAAmB;AA4GxE;;;;;;;;CAQC,GACD,OAAO,SAASC,MAAMC,KAAiB;IACrC,MAAM,EACJC,GAAG,EACHC,IAAIC,MAAM,EACVC,SAAS,EACTC,OAAO,EACPC,UAAU,EACVC,QAAQ,SAAS,EACjBC,QAAQC,UAAU,EAClBC,cAAcC,gBAAgB,EAC9BC,MAAM,EACNC,OAAO,EACPC,WAAWC,aAAa,EACxBC,gBAAgB,EAChBC,cAAc,CAAC,CAACD,gBAAgB,EAChCE,YAAY,EACZC,mBAAmB,EACnBC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACR,GAAGC,WACJ,GAAG7B;IACJ,MAAME,KAAKR,aAAaS,QAAQ;IAEhC,IAAIO,eAAeC;IACnB,IAAIF,YAAY;QACd,IAAIqB,YAAyB,CAAC;QAC9B,IAAIC;QACJ,+DAA+D;QAC/D,8DAA8D;QAC9D,kBAAIvC,eAAoBiB,eAAe,OAAOA,eAAe,UAAU;YACrEsB,iBAAiBtB;QACnB,OAAO;YACJ,CAAA,EAAEmB,UAAUG,cAAc,EAAE,GAAGD,WAAW,GAAGrB,UAAS;QACzD;QAEAC,6BACE,KAACf;YACCY,OAAOA,UAAU,YAAY,cAAc;YAC3CyB,WAAWZ,WAAWH;YACrB,GAAGa,SAAS;sBAEZC;;IAGP;IAEA,IAAIjB,YAAYC;IAChB,IAAIC,kBAAkBY,aAAaK,WAAW;QAC5CnB,YAAYE,iBAAiBY,QAAQ;IACvC;IAEA,MAAMpB,SAAS,CAAC,CAACE;IACjB,MAAMsB,YAAYZ,WAAWZ,UAAUS;IACvC,MAAM,EAAEiB,YAAY,EAAEC,QAAQ,EAAE,GAAG1C,mBAAmB;QACpD2C,QAAQ;QACRC,SAASpC;QACTG,WAAWN,MAAM;YACfM;YACAG;YACAC;YACAI;YACAQ;YACAY;YACAf;QACF;QACAZ;QACAC;QACAgB;QACAC;QACAC;QACAC;QACAC;QACAC;QACAW,WAAW;QACXC,cAAc1B;QACd2B,cAAc;IAChB;IAEA,qEAAqE;IACrE,2CAA2C;IAC3C,IAAI,CAACL,UAAU;QACb,OAAO;IACT;IAEA,qBACE,MAACM;QAAK,GAAGZ,SAAS;QAAG,GAAGK,YAAY;QAAEhC,IAAIA;;0BACxC,KAACL;gBACCW,QAAQA;gBACRY,SAASA;gBACTC,WAAWA;gBACXJ,aAAaA;gBACbyB,gBAAgBvB;gBACf,GAAGD,YAAY;0BAEfU;;YAEFlB;YACAO,6BACC,KAACrB;gBAAiBoC,WAAWA;gBAAY,GAAGhB,gBAAgB;0BACzDF;;;;AAKX"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
1
2
|
import { type ButtonProps } from "../button/Button.js";
|
|
2
3
|
import { type ButtonTheme } from "../button/styles.js";
|
|
3
4
|
/**
|
|
@@ -24,4 +25,4 @@ export interface ToastActionButtonProps extends ButtonProps {
|
|
|
24
25
|
* @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}
|
|
25
26
|
* @since 6.0.0
|
|
26
27
|
*/
|
|
27
|
-
export declare const ToastActionButton:
|
|
28
|
+
export declare const ToastActionButton: (props: ToastActionButtonProps) => 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 { Button } from "../button/Button.js";
|
|
6
5
|
import { bem } from "../utils/bem.js";
|
|
7
6
|
import { useCurrentToastActions } from "./useCurrentToastActions.js";
|
|
@@ -17,8 +16,8 @@ const noop = ()=>{
|
|
|
17
16
|
*
|
|
18
17
|
* @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}
|
|
19
18
|
* @since 6.0.0
|
|
20
|
-
*/ export const ToastActionButton =
|
|
21
|
-
const { className, children, theme = "secondary", onClick = noop, reordered, ...remaining } = props;
|
|
19
|
+
*/ export const ToastActionButton = function ToastActionButton(props) {
|
|
20
|
+
const { ref, className, children, theme = "secondary", onClick = noop, reordered, ...remaining } = props;
|
|
22
21
|
const { removeToast } = useCurrentToastActions();
|
|
23
22
|
return /*#__PURE__*/ _jsx(Button, {
|
|
24
23
|
...remaining,
|
|
@@ -36,6 +35,6 @@ const noop = ()=>{
|
|
|
36
35
|
}), className),
|
|
37
36
|
children: children
|
|
38
37
|
});
|
|
39
|
-
}
|
|
38
|
+
};
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=ToastActionButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/snackbar/ToastActionButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/snackbar/ToastActionButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { type ReactElement } from \"react\";\n\nimport { Button, type ButtonProps } from \"../button/Button.js\";\nimport { type ButtonTheme } from \"../button/styles.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { useCurrentToastActions } from \"./useCurrentToastActions.js\";\n\nconst styles = bem(\"rmd-toast-action\");\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport interface ToastActionButtonProps extends ButtonProps {\n /** @defaultValue `\"secondary\"` */\n theme?: ButtonTheme;\n\n /**\n * Set this to `true` when there is a close button visible and the content is\n * stacked. This will update the styles so the button renders in the bottom\n * right below the content and close button.\n *\n * @defaultValue `false`\n */\n reordered?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This button will automatically close the toast when clicked unless\n * `event.stopPropagation()` is called from the `onClick` prop.\n *\n * @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}\n * @since 6.0.0\n */\nexport const ToastActionButton = function ToastActionButton(\n props: ToastActionButtonProps\n): ReactElement {\n const {\n ref,\n className,\n children,\n theme = \"secondary\",\n onClick = noop,\n reordered,\n ...remaining\n } = props;\n const { removeToast } = useCurrentToastActions();\n\n return (\n <Button\n {...remaining}\n ref={ref}\n onClick={(event) => {\n onClick(event);\n if (event.isPropagationStopped()) {\n return;\n }\n\n removeToast(true);\n }}\n theme={theme}\n className={cnb(styles({ reordered }), className)}\n >\n {children}\n </Button>\n );\n};\n"],"names":["cnb","Button","bem","useCurrentToastActions","styles","noop","ToastActionButton","props","ref","className","children","theme","onClick","reordered","remaining","removeToast","event","isPropagationStopped"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAGhC,SAASC,MAAM,QAA0B,sBAAsB;AAE/D,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,sBAAsB,QAAQ,8BAA8B;AAErE,MAAMC,SAASF,IAAI;AACnB,MAAMG,OAAO;AACX,aAAa;AACf;AAmBA;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,SAASA,kBACxCC,KAA6B;IAE7B,MAAM,EACJC,GAAG,EACHC,SAAS,EACTC,QAAQ,EACRC,QAAQ,WAAW,EACnBC,UAAUP,IAAI,EACdQ,SAAS,EACT,GAAGC,WACJ,GAAGP;IACJ,MAAM,EAAEQ,WAAW,EAAE,GAAGZ;IAExB,qBACE,KAACF;QACE,GAAGa,SAAS;QACbN,KAAKA;QACLI,SAAS,CAACI;YACRJ,QAAQI;YACR,IAAIA,MAAMC,oBAAoB,IAAI;gBAChC;YACF;YAEAF,YAAY;QACd;QACAJ,OAAOA;QACPF,WAAWT,IAAII,OAAO;YAAES;QAAU,IAAIJ;kBAErCC;;AAGP,EAAE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
1
2
|
import { type ButtonProps } from "../button/Button.js";
|
|
2
3
|
import { type ButtonType } from "../button/styles.js";
|
|
3
4
|
/**
|
|
@@ -31,4 +32,4 @@ export interface ToastCloseButtonProps extends ButtonProps {
|
|
|
31
32
|
* @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}
|
|
32
33
|
* @since 6.0.0
|
|
33
34
|
*/
|
|
34
|
-
export declare
|
|
35
|
+
export declare function ToastCloseButton(props: ToastCloseButtonProps): 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 { Button } from "../button/Button.js";
|
|
6
5
|
import { getIcon } from "../icon/config.js";
|
|
7
6
|
import { bem } from "../utils/bem.js";
|
|
@@ -18,8 +17,8 @@ const noop = ()=>{
|
|
|
18
17
|
*
|
|
19
18
|
* @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}
|
|
20
19
|
* @since 6.0.0
|
|
21
|
-
*/ export
|
|
22
|
-
const { buttonType = "icon-square", "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel = buttonType !== "text" && !ariaLabelledBy ? "Close" : undefined, children: propChildren, className, onClick = noop, reordered, ...remaining } = props;
|
|
20
|
+
*/ export function ToastCloseButton(props) {
|
|
21
|
+
const { ref, buttonType = "icon-square", "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel = buttonType !== "text" && !ariaLabelledBy ? "Close" : undefined, children: propChildren, className, onClick = noop, reordered, ...remaining } = props;
|
|
23
22
|
const children = getIcon("close", propChildren);
|
|
24
23
|
const { removeToast } = useCurrentToastActions();
|
|
25
24
|
return /*#__PURE__*/ _jsx(Button, {
|
|
@@ -40,6 +39,6 @@ const noop = ()=>{
|
|
|
40
39
|
buttonType: buttonType,
|
|
41
40
|
children: children
|
|
42
41
|
});
|
|
43
|
-
}
|
|
42
|
+
}
|
|
44
43
|
|
|
45
44
|
//# sourceMappingURL=ToastCloseButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/snackbar/ToastCloseButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/snackbar/ToastCloseButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { type ReactElement } from \"react\";\n\nimport { Button, type ButtonProps } from \"../button/Button.js\";\nimport { type ButtonType } from \"../button/styles.js\";\nimport { getIcon } from \"../icon/config.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { useCurrentToastActions } from \"./useCurrentToastActions.js\";\n\nconst styles = bem(\"rmd-toast-x\");\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport interface ToastCloseButtonProps extends ButtonProps {\n /**\n * Note: This default value will only be used if the {@link buttonType} is not\n * `\"text\"` and an `aria-labelledby` is not provided.\n *\n * @defaultValue `\"Close\"`\n */\n \"aria-label\"?: string;\n\n /** @defaultValue `\"icon-square\"` */\n buttonType?: ButtonType;\n\n /**\n * Set this to `true` when there is a close button visible and the content is\n * stacked. This will update the styles so the button renders next to the\n * content and above the action button.\n *\n * @defaultValue `false`\n */\n reordered?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * This button will automatically close the toast when clicked unless\n * `event.stopPropagation()` is called from the `onClick` prop.\n *\n * @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}\n * @since 6.0.0\n */\nexport function ToastCloseButton(props: ToastCloseButtonProps): ReactElement {\n const {\n ref,\n buttonType = \"icon-square\",\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-label\": ariaLabel = buttonType !== \"text\" && !ariaLabelledBy\n ? \"Close\"\n : undefined,\n children: propChildren,\n className,\n onClick = noop,\n reordered,\n ...remaining\n } = props;\n\n const children = getIcon(\"close\", propChildren);\n const { removeToast } = useCurrentToastActions();\n\n return (\n <Button\n {...remaining}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={ref}\n onClick={(event) => {\n onClick(event);\n if (event.isPropagationStopped()) {\n return;\n }\n\n removeToast(true);\n }}\n className={cnb(styles({ reordered }), className)}\n buttonType={buttonType}\n >\n {children}\n </Button>\n );\n}\n"],"names":["cnb","Button","getIcon","bem","useCurrentToastActions","styles","noop","ToastCloseButton","props","ref","buttonType","ariaLabelledBy","ariaLabel","undefined","children","propChildren","className","onClick","reordered","remaining","removeToast","aria-label","aria-labelledby","event","isPropagationStopped"],"mappings":"AAAA;;AAEA,SAASA,GAAG,QAAQ,YAAY;AAGhC,SAASC,MAAM,QAA0B,sBAAsB;AAE/D,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,sBAAsB,QAAQ,8BAA8B;AAErE,MAAMC,SAASF,IAAI;AACnB,MAAMG,OAAO;AACX,aAAa;AACf;AA2BA;;;;;;;;CAQC,GACD,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EACJC,GAAG,EACHC,aAAa,aAAa,EAC1B,mBAAmBC,cAAc,EACjC,cAAcC,YAAYF,eAAe,UAAU,CAACC,iBAChD,UACAE,SAAS,EACbC,UAAUC,YAAY,EACtBC,SAAS,EACTC,UAAUX,IAAI,EACdY,SAAS,EACT,GAAGC,WACJ,GAAGX;IAEJ,MAAMM,WAAWZ,QAAQ,SAASa;IAClC,MAAM,EAAEK,WAAW,EAAE,GAAGhB;IAExB,qBACE,KAACH;QACE,GAAGkB,SAAS;QACbE,cAAYT;QACZU,mBAAiBX;QACjBF,KAAKA;QACLQ,SAAS,CAACM;YACRN,QAAQM;YACR,IAAIA,MAAMC,oBAAoB,IAAI;gBAChC;YACF;YAEAJ,YAAY;QACd;QACAJ,WAAWhB,IAAIK,OAAO;YAAEa;QAAU,IAAIF;QACtCN,YAAYA;kBAEXI;;AAGP"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "react";
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type Ref } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* @since 6.0.0
|
|
4
4
|
*/
|
|
5
5
|
export interface ToastContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
ref?: Ref<HTMLDivElement>;
|
|
6
7
|
/** @defaultValue `false` */
|
|
7
8
|
action?: boolean;
|
|
8
9
|
/** @defaultValue `false` */
|
|
@@ -31,4 +32,4 @@ export interface ToastContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
31
32
|
* @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}
|
|
32
33
|
* @since 6.0.0
|
|
33
34
|
*/
|
|
34
|
-
export declare
|
|
35
|
+
export declare function ToastContent(props: ToastContentProps): ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
4
|
import { useResizeObserver } from "../useResizeObserver.js";
|
|
5
5
|
import { toastContent } from "./toastContentStyles.js";
|
|
6
6
|
/**
|
|
@@ -8,8 +8,8 @@ import { toastContent } from "./toastContentStyles.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}
|
|
10
10
|
* @since 6.0.0
|
|
11
|
-
*/ export
|
|
12
|
-
const { className, children, action, stacked, multiline: propMultiline, closeButton, disableWrapper, ...remaining } = props;
|
|
11
|
+
*/ export function ToastContent(props) {
|
|
12
|
+
const { ref, className, children, action, stacked, multiline: propMultiline, closeButton, disableWrapper, ...remaining } = props;
|
|
13
13
|
const [isMultiline, setMultiline] = useState(false);
|
|
14
14
|
const nodeRef = useResizeObserver({
|
|
15
15
|
ref,
|
|
@@ -43,6 +43,6 @@ import { toastContent } from "./toastContentStyles.js";
|
|
|
43
43
|
}),
|
|
44
44
|
children: children
|
|
45
45
|
});
|
|
46
|
-
}
|
|
46
|
+
}
|
|
47
47
|
|
|
48
48
|
//# sourceMappingURL=ToastContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/snackbar/ToastContent.tsx"],"sourcesContent":["\"use client\";\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/snackbar/ToastContent.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type HTMLAttributes,\n type ReactElement,\n type Ref,\n useCallback,\n useState,\n} from \"react\";\n\nimport { useResizeObserver } from \"../useResizeObserver.js\";\nimport { toastContent } from \"./toastContentStyles.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface ToastContentProps extends HTMLAttributes<HTMLDivElement> {\n ref?: Ref<HTMLDivElement>;\n\n /** @defaultValue `false` */\n action?: boolean;\n\n /** @defaultValue `false` */\n stacked?: boolean;\n\n /**\n * Set this to `true` if you know that the {@link children} span multiple\n * lines. When this is omitted, a `ResizeObserver` will be used to\n * automatically detect multiline content.\n */\n multiline?: boolean;\n\n /** @defaultValue `false` */\n closeButton?: boolean;\n\n /**\n * Set this to `true` if you do not want to wrap the `children` in a `<div>`\n * that applies some toast layout styles. This should really only be used for\n * custom `Toast` implementations.\n *\n * @internal\n * @defaultValue `false`\n */\n disableWrapper?: boolean;\n}\n\n/**\n * **Client Component**\n *\n * @see {@link https://react-md.dev/components/snackbar | Snackbar Demos}\n * @since 6.0.0\n */\nexport function ToastContent(props: ToastContentProps): ReactElement {\n const {\n ref,\n className,\n children,\n action,\n stacked,\n multiline: propMultiline,\n closeButton,\n disableWrapper,\n ...remaining\n } = props;\n\n const [isMultiline, setMultiline] = useState(false);\n const nodeRef = useResizeObserver({\n ref,\n disabled: disableWrapper || typeof propMultiline === \"boolean\",\n disableWidth: true,\n onUpdate: useCallback((entry) => {\n const element = entry.target;\n const style = globalThis.getComputedStyle(element);\n const lineHeight = Number.parseFloat(style.lineHeight);\n if (Number.isNaN(lineHeight)) {\n return;\n }\n\n setMultiline(element.scrollHeight > lineHeight);\n }, []),\n });\n const multiline = propMultiline ?? isMultiline;\n\n if (disableWrapper) {\n return <>{children}</>;\n }\n\n return (\n <div\n {...remaining}\n ref={nodeRef}\n className={toastContent({\n action,\n stacked,\n multiline,\n closeButton,\n className,\n })}\n >\n {children}\n </div>\n );\n}\n"],"names":["useCallback","useState","useResizeObserver","toastContent","ToastContent","props","ref","className","children","action","stacked","multiline","propMultiline","closeButton","disableWrapper","remaining","isMultiline","setMultiline","nodeRef","disabled","disableWidth","onUpdate","entry","element","target","style","globalThis","getComputedStyle","lineHeight","Number","parseFloat","isNaN","scrollHeight","div"],"mappings":"AAAA;;AAEA,SAIEA,WAAW,EACXC,QAAQ,QACH,QAAQ;AAEf,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,SAASC,YAAY,QAAQ,0BAA0B;AAmCvD;;;;;CAKC,GACD,OAAO,SAASC,aAAaC,KAAwB;IACnD,MAAM,EACJC,GAAG,EACHC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,OAAO,EACPC,WAAWC,aAAa,EACxBC,WAAW,EACXC,cAAc,EACd,GAAGC,WACJ,GAAGV;IAEJ,MAAM,CAACW,aAAaC,aAAa,GAAGhB,SAAS;IAC7C,MAAMiB,UAAUhB,kBAAkB;QAChCI;QACAa,UAAUL,kBAAkB,OAAOF,kBAAkB;QACrDQ,cAAc;QACdC,UAAUrB,YAAY,CAACsB;YACrB,MAAMC,UAAUD,MAAME,MAAM;YAC5B,MAAMC,QAAQC,WAAWC,gBAAgB,CAACJ;YAC1C,MAAMK,aAAaC,OAAOC,UAAU,CAACL,MAAMG,UAAU;YACrD,IAAIC,OAAOE,KAAK,CAACH,aAAa;gBAC5B;YACF;YAEAX,aAAaM,QAAQS,YAAY,GAAGJ;QACtC,GAAG,EAAE;IACP;IACA,MAAMjB,YAAYC,iBAAiBI;IAEnC,IAAIF,gBAAgB;QAClB,qBAAO;sBAAGN;;IACZ;IAEA,qBACE,KAACyB;QACE,GAAGlB,SAAS;QACbT,KAAKY;QACLX,WAAWJ,aAAa;YACtBM;YACAC;YACAC;YACAE;YACAN;QACF;kBAECC;;AAGP"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "react";
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type Ref } from "react";
|
|
2
2
|
import { type LabelRequiredForA11y } from "../types.js";
|
|
3
|
-
import { type SpinButtonOptions
|
|
3
|
+
import { type SpinButtonOptions } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* @since 6.4.0
|
|
6
6
|
*/
|
|
7
7
|
export interface SpinButtonProps extends Omit<HTMLAttributes<HTMLDivElement>, keyof SpinButtonOptions>, Omit<SpinButtonOptions<HTMLDivElement>, "ref" | "children"> {
|
|
8
|
+
ref?: Ref<HTMLDivElement>;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* The `SpinButton` component can be used as a simple wrapper around the
|
|
@@ -13,4 +14,4 @@ export interface SpinButtonProps extends Omit<HTMLAttributes<HTMLDivElement>, ke
|
|
|
13
14
|
*
|
|
14
15
|
* @since 6.4.0
|
|
15
16
|
*/
|
|
16
|
-
export declare
|
|
17
|
+
export declare function SpinButton(props: LabelRequiredForA11y<SpinButtonProps>): 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 { defaultGetSpinButtonTextContent } from "./defaults.js";
|
|
5
4
|
import { useSpinButton } from "./useSpinButton.js";
|
|
6
5
|
/**
|
|
@@ -9,8 +8,8 @@ import { useSpinButton } from "./useSpinButton.js";
|
|
|
9
8
|
* only the rendering behavior is required.
|
|
10
9
|
*
|
|
11
10
|
* @since 6.4.0
|
|
12
|
-
*/ export
|
|
13
|
-
const { id, min, max, minDigits, maxDigits, step, form, error, disabled, readOnly, required, fallback, mappings, value, defaultValue, onValueChange, getValueText, getTextContent = defaultGetSpinButtonTextContent, placeholderChar, defaultKeyboardValue, ...remaining } = props;
|
|
11
|
+
*/ export function SpinButton(props) {
|
|
12
|
+
const { ref, id, min, max, minDigits, maxDigits, step, form, error, disabled, readOnly, required, fallback, mappings, value, defaultValue, onValueChange, getValueText, getTextContent = defaultGetSpinButtonTextContent, placeholderChar, defaultKeyboardValue, ...remaining } = props;
|
|
14
13
|
const valueProps = {
|
|
15
14
|
value,
|
|
16
15
|
defaultValue
|
|
@@ -50,6 +49,6 @@ import { useSpinButton } from "./useSpinButton.js";
|
|
|
50
49
|
placeholderChar
|
|
51
50
|
})
|
|
52
51
|
});
|
|
53
|
-
}
|
|
52
|
+
}
|
|
54
53
|
|
|
55
54
|
//# sourceMappingURL=SpinButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/spinbutton/SpinButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes,
|
|
1
|
+
{"version":3,"sources":["../../src/spinbutton/SpinButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes, type ReactElement, type Ref } from \"react\";\n\nimport { type LabelRequiredForA11y } from \"../types.js\";\nimport { defaultGetSpinButtonTextContent } from \"./defaults.js\";\nimport {\n type SpinButtonOptions,\n type SpinButtonUncontrolledValueOptions,\n} from \"./types.js\";\nimport { useSpinButton } from \"./useSpinButton.js\";\n\n/**\n * @since 6.4.0\n */\nexport interface SpinButtonProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, keyof SpinButtonOptions>,\n Omit<SpinButtonOptions<HTMLDivElement>, \"ref\" | \"children\"> {\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * The `SpinButton` component can be used as a simple wrapper around the\n * {@link useSpinButton} hook if it should be rendered within a `<div>` and\n * only the rendering behavior is required.\n *\n * @since 6.4.0\n */\nexport function SpinButton(\n props: LabelRequiredForA11y<SpinButtonProps>\n): ReactElement {\n const {\n ref,\n id,\n min,\n max,\n minDigits,\n maxDigits,\n step,\n form,\n error,\n disabled,\n readOnly,\n required,\n fallback,\n mappings,\n value,\n defaultValue,\n onValueChange,\n getValueText,\n getTextContent = defaultGetSpinButtonTextContent,\n placeholderChar,\n defaultKeyboardValue,\n ...remaining\n } = props;\n\n const valueProps = {\n value,\n defaultValue,\n } as SpinButtonUncontrolledValueOptions<HTMLDivElement>;\n\n const { value: currentValue, spinButtonProps } = useSpinButton({\n id,\n ref,\n min,\n max,\n minDigits,\n maxDigits,\n step,\n form,\n fallback,\n mappings,\n error,\n disabled,\n readOnly,\n required,\n ...valueProps,\n onValueChange,\n getValueText,\n getTextContent,\n placeholderChar,\n defaultKeyboardValue,\n });\n\n return (\n <div {...remaining} {...spinButtonProps}>\n {getTextContent({\n min,\n max,\n minDigits,\n maxDigits,\n value: currentValue,\n fallback,\n placeholderChar,\n })}\n </div>\n );\n}\n"],"names":["defaultGetSpinButtonTextContent","useSpinButton","SpinButton","props","ref","id","min","max","minDigits","maxDigits","step","form","error","disabled","readOnly","required","fallback","mappings","value","defaultValue","onValueChange","getValueText","getTextContent","placeholderChar","defaultKeyboardValue","remaining","valueProps","currentValue","spinButtonProps","div"],"mappings":"AAAA;;AAKA,SAASA,+BAA+B,QAAQ,gBAAgB;AAKhE,SAASC,aAAa,QAAQ,qBAAqB;AAYnD;;;;;;CAMC,GACD,OAAO,SAASC,WACdC,KAA4C;IAE5C,MAAM,EACJC,GAAG,EACHC,EAAE,EACFC,GAAG,EACHC,GAAG,EACHC,SAAS,EACTC,SAAS,EACTC,IAAI,EACJC,IAAI,EACJC,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,YAAY,EACZC,aAAa,EACbC,YAAY,EACZC,iBAAiBtB,+BAA+B,EAChDuB,eAAe,EACfC,oBAAoB,EACpB,GAAGC,WACJ,GAAGtB;IAEJ,MAAMuB,aAAa;QACjBR;QACAC;IACF;IAEA,MAAM,EAAED,OAAOS,YAAY,EAAEC,eAAe,EAAE,GAAG3B,cAAc;QAC7DI;QACAD;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAK;QACAC;QACAL;QACAC;QACAC;QACAC;QACA,GAAGW,UAAU;QACbN;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,qBACE,KAACK;QAAK,GAAGJ,SAAS;QAAG,GAAGG,eAAe;kBACpCN,eAAe;YACdhB;YACAC;YACAC;YACAC;YACAS,OAAOS;YACPX;YACAO;QACF;;AAGN"}
|
|
@@ -319,6 +319,6 @@ export interface ProvidedSpinButtonProps<E extends HTMLElement = HTMLDivElement>
|
|
|
319
319
|
export interface SpinButtonImplementation<E extends HTMLElement = HTMLDivElement> {
|
|
320
320
|
value: SpinButtonValue;
|
|
321
321
|
setValue: (value: SpinButtonValue) => void;
|
|
322
|
-
spinButtonRef: RefObject<E>;
|
|
322
|
+
spinButtonRef: RefObject<E | null>;
|
|
323
323
|
spinButtonProps: Readonly<ProvidedSpinButtonProps<E>>;
|
|
324
324
|
}
|