@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/box/Box.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/box/Box.tsx"],"sourcesContent":["import { type HTMLAttributes,
|
|
1
|
+
{"version":3,"sources":["../../src/box/Box.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactElement, type Ref } from \"react\";\n\nimport { type BoxOptions, boxStyles } from \"./styles.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface BoxProps extends HTMLAttributes<HTMLDivElement>, BoxOptions {\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * The `Box` component is a wrapper around the CSS box model and should solve\n * most of your `flex` and `grid` layout requirements for responsive design.\n * There are pass-through props for all of the box module styling properties\n * available by default.\n *\n * @example Default Styles\n * ```scss\n * .box {\n * align-items: center;\n * display: flex;\n * flex-wrap: wrap;\n * gap: 1rem;\n * padding: 1rem;\n * }\n * ```\n *\n * ```tsx\n * import { Box } from \"@react-md/core/box/Box\";\n * import type { ReactElement } from \"react\";\n *\n * export default function Example(): ReactElement {\n * return (\n * <Box>\n * <div>Thing 1</div>\n * <div>Thing 2</div>\n * <div>Thing 3</div>\n * <div>Thing 4</div>\n * <div>Thing 5</div>\n * </Box>\n * ):\n * }\n * ```\n *\n * @example Default Grid Styles\n * ```scss\n * .box {\n * align-items: center;\n * display: grid;\n * grid-gap: 1rem;\n * grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));\n * padding: 1rem;\n * }\n * ```\n *\n * ```tsx\n * import { Box } from \"@react-md/core/box/Box\";\n * import type { ReactElement } from \"react\";\n *\n * export default function Example(): ReactElement {\n * return (\n * <Box grid>\n * <div>Thing 1</div>\n * <div>Thing 2</div>\n * <div>Thing 3</div>\n * <div>Thing 4</div>\n * <div>Thing 5</div>\n * </Box>\n * ):\n * }\n * ```\n *\n * @example Custom Grid\n * ```scss\n * @use \"@react-md/core\" with (\n * $box-grids: (\n * small: (\n * min: 5rem,\n * ),\n * medium: (\n * min: 7rem,\n * padding: 2rem,\n * gap: 0.5rem,\n * ),\n * )\n * );\n *\n * ```\n *\n * ```tsx\n * import { Box } from \"@react-md/core/box/Box\";\n * import type { ReactElement } from \"react\";\n *\n * export default function Example(): ReactElement {\n * return (\n * <Box grid gridName=\"medium\">\n * <div>Thing 1</div>\n * <div>Thing 2</div>\n * <div>Thing 3</div>\n * <div>Thing 4</div>\n * <div>Thing 5</div>\n * </Box>\n * ):\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/box | Box Demos}\n * @since 6.0.0\n */\nexport const Box = function Box(props: BoxProps): ReactElement {\n const {\n ref,\n style,\n className,\n children,\n align,\n justify,\n stacked,\n reversed,\n grid,\n gridName,\n gridItemSize,\n gridColumns,\n gridAutoRows,\n fullWidth,\n disableGap,\n disableWrap,\n disablePadding,\n ...remaining\n } = props;\n\n return (\n <div\n {...remaining}\n ref={ref}\n {...boxStyles({\n style,\n className,\n align,\n justify,\n stacked,\n reversed,\n grid,\n gridName,\n gridItemSize,\n gridColumns,\n gridAutoRows,\n fullWidth,\n disableGap,\n disableWrap,\n disablePadding,\n })}\n >\n {children}\n </div>\n );\n};\n"],"names":["boxStyles","Box","props","ref","style","className","children","align","justify","stacked","reversed","grid","gridName","gridItemSize","gridColumns","gridAutoRows","fullWidth","disableGap","disableWrap","disablePadding","remaining","div"],"mappings":";AAEA,SAA0BA,SAAS,QAAQ,cAAc;AASzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkGC,GACD,OAAO,MAAMC,MAAM,SAASA,IAAIC,KAAe;IAC7C,MAAM,EACJC,GAAG,EACHC,KAAK,EACLC,SAAS,EACTC,QAAQ,EACRC,KAAK,EACLC,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,IAAI,EACJC,QAAQ,EACRC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,SAAS,EACTC,UAAU,EACVC,WAAW,EACXC,cAAc,EACd,GAAGC,WACJ,GAAGlB;IAEJ,qBACE,KAACmB;QACE,GAAGD,SAAS;QACbjB,KAAKA;QACJ,GAAGH,UAAU;YACZI;YACAC;YACAE;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF,EAAE;kBAEDb;;AAGP,EAAE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type MouseEvent, type ReactNode } from "react";
|
|
1
|
+
import { type MouseEvent, type ReactElement, type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type CircularProgressProps } from "../progress/CircularProgress.js";
|
|
3
3
|
import { type LinearProgressProps } from "../progress/LinearProgress.js";
|
|
4
4
|
import { type PropsWithRef } from "../types.js";
|
|
@@ -11,6 +11,7 @@ export type AsyncButtonLoadingType = "circular-before" | "circular-after" | "cir
|
|
|
11
11
|
* @since 6.0.0
|
|
12
12
|
*/
|
|
13
13
|
export interface AsyncButtonProps extends ButtonProps {
|
|
14
|
+
ref?: Ref<HTMLButtonElement>;
|
|
14
15
|
/**
|
|
15
16
|
* @see {@link progressAriaLabelledBy}
|
|
16
17
|
* @defaultValue `"async-button" + useId()`
|
|
@@ -154,4 +155,4 @@ export interface AsyncButtonProps extends ButtonProps {
|
|
|
154
155
|
* @see {@link https://react-md.dev/components/button#async-button | AsyncButton Demos}
|
|
155
156
|
* @since 6.0.0
|
|
156
157
|
*/
|
|
157
|
-
export declare
|
|
158
|
+
export declare function AsyncButton(props: AsyncButtonProps): ReactElement;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cnb } from "cnbuilder";
|
|
4
|
-
import { forwardRef } from "react";
|
|
5
4
|
import { overlay } from "../overlay/styles.js";
|
|
6
5
|
import { CircularProgress } from "../progress/CircularProgress.js";
|
|
7
6
|
import { LinearProgress } from "../progress/LinearProgress.js";
|
|
@@ -71,8 +70,8 @@ const noop = ()=>{
|
|
|
71
70
|
*
|
|
72
71
|
* @see {@link https://react-md.dev/components/button#async-button | AsyncButton Demos}
|
|
73
72
|
* @since 6.0.0
|
|
74
|
-
*/ export
|
|
75
|
-
const { id: propId, onClick = noop, children, floating = null, theme = floating ? "secondary" : "clear", themeType = floating ? "contained" : "flat", buttonType = floating ? "icon" : "text", className, disabled, loading: propLoading = false, loadingType = "circular-overlay", loadingChildren, loadingDisabledTheme = false, afterAddon: propAfterAddon, beforeAddon: propBeforeAddon, linearProgressProps, circularProgressProps, progressAriaLabel, progressAriaLabelledBy: propProgressAriaLabelledBy, ...remaining } = props;
|
|
73
|
+
*/ export function AsyncButton(props) {
|
|
74
|
+
const { id: propId, ref, onClick = noop, children, floating = null, theme = floating ? "secondary" : "clear", themeType = floating ? "contained" : "flat", buttonType = floating ? "icon" : "text", className, disabled, loading: propLoading = false, loadingType = "circular-overlay", loadingChildren, loadingDisabledTheme = false, afterAddon: propAfterAddon, beforeAddon: propBeforeAddon, linearProgressProps, circularProgressProps, progressAriaLabel, progressAriaLabelledBy: propProgressAriaLabelledBy, ...remaining } = props;
|
|
76
75
|
const id = useEnsuredId(propId, "async-button");
|
|
77
76
|
const { handleAsync, pending } = useAsyncFunction({
|
|
78
77
|
disabled
|
|
@@ -151,6 +150,6 @@ const noop = ()=>{
|
|
|
151
150
|
overlayElement
|
|
152
151
|
]
|
|
153
152
|
});
|
|
154
|
-
}
|
|
153
|
+
}
|
|
155
154
|
|
|
156
155
|
//# sourceMappingURL=AsyncButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/button/AsyncButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport { type MouseEvent, type ReactNode, forwardRef } from \"react\";\n\nimport { type BoxAlignItems } from \"../box/styles.js\";\nimport { overlay } from \"../overlay/styles.js\";\nimport {\n CircularProgress,\n type CircularProgressProps,\n} from \"../progress/CircularProgress.js\";\nimport {\n LinearProgress,\n type LinearProgressProps,\n} from \"../progress/LinearProgress.js\";\nimport { type ProgressTheme } from \"../progress/types.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useAsyncFunction } from \"../useAsyncFunction.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { Button, type ButtonProps } from \"./Button.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport type AsyncButtonLoadingType =\n | \"circular-before\"\n | \"circular-after\"\n | \"circular-overlay\"\n | \"linear-above\"\n | \"linear-below\";\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncButtonProps extends ButtonProps {\n /**\n * @see {@link progressAriaLabelledBy}\n * @defaultValue `\"async-button\" + useId()`\n */\n id?: string;\n\n /**\n * When this is defined and returns a `Promise`, the loading indicator will\n * display until the promise has resolved.\n *\n * @defaultValue `() => {}`\n */\n onClick?: (event: MouseEvent<HTMLButtonElement>) => Promise<void> | void;\n\n /**\n * Set this to `true` to manually display a loading spinner.\n *\n * @defaultValue `false`\n */\n loading?: boolean;\n\n /**\n * - `\"circular-overlay\"` - Covers and hides the button content with a\n * centered circular progress\n * - `\"circular-before\"` - Renders a circular progress bar before the button\n * content which is useful when rendering an icon before the button text.\n * See {@link beforeAddon} as well.\n * - `\"circular-after\"` - Renders a circular progress bar before the button\n * content which is useful when rendering an icon after the button text.\n * See {@link afterAddon} as well.\n * - `\"linear-above\"` - Renders a linear progress bar at the top of the button\n * while still displaying the button contents. Usually looks good for\n * outlined buttons.\n * - `\"linear-below\"` - Renders a linear progress bar at the bottom of the\n * button while still displaying the button contents. Usually looks good for\n * outlined buttons.\n *\n * @defaultValue `\"circular-overlay\"`\n */\n loadingType?: AsyncButtonLoadingType;\n\n /**\n * Optional content to display instead of the default `children` while\n * loading.\n */\n loadingChildren?: ReactNode;\n\n /**\n * Set this to `true` to use the `disabled` theme while loading.\n *\n * @defaultValue `false`\n */\n loadingDisabledTheme?: boolean;\n\n /**\n * This should be used when the {@link loadingType} is set to\n * `\"circular-before\"`, an icon should appear before the other content in\n * the button, and the loading indicator should replace the icon.\n */\n beforeAddon?: ReactNode;\n\n /**\n * This should be used when the {@link loadingType} is set to\n * `\"circular-after\"`, an icon should appear before the other content in\n * the button, and the loading indicator should replace the icon.\n */\n afterAddon?: ReactNode;\n\n /**\n * An optional label to provide to the progressbar.\n *\n * @see {@link progressAriaLabelledBy}\n */\n progressAriaLabel?: string;\n\n /**\n * @see {@link id}\n * @defaultValue `id`\n */\n progressAriaLabelledBy?: string;\n\n /**\n * Any additional props to pass to the `CircularProgress` bar when the\n * {@link loadingType} is one of the circular types.\n */\n linearProgressProps?: PropsWithRef<LinearProgressProps>;\n\n /**\n * Any additional props to pass to the `LinearProgress` bar when the\n * {@link loadingType} is one of the linear types.\n */\n circularProgressProps?: PropsWithRef<CircularProgressProps>;\n}\n\n/**\n * **Client Component**\n *\n * The async button can be used to render a loading indicator within a button\n * during an async task. The loading spinner can be shown either by enabling the\n * `loading` prop or returning a promise from the `onClick` event which will\n * continue to show the loading indicator until the promise has been resolved.\n *\n * @example Async onClick\n * ```tsx\n * import { AsyncButton } from \"@react-md/core/button/AsyncButton\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const [data, setData] = useState(null);\n * return (\n * <AsyncButton\n * type=\"submit\"\n * onClick={async () => {\n * const response = await fetch(\"/my-api\");\n * const json = await response.json();\n * setData(json);\n * }}\n * >\n * Submit\n * </AsyncButton>\n * );\n * }\n * ```\n *\n * @example Manual Loading State\n * ```tsx\n * import { AsyncButton } from \"@react-md/core/button/AsyncButton\";\n * import { useMutation } from \"@tanstack/query\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { isLoading, mutate } = useMutation({\n * mutationFn: (newTodo) => fetch('/todos', {\n * method: \"POST\",\n * body: JSON.stringify(newTodo),\n * }),\n * });\n *\n * return (\n * <AsyncButton\n * type=\"submit\"\n * loading={isLoading}\n * onClick={() => {\n * mutate({ id: Date.now(), title: \"Create example\" });\n * }}\n * >\n * Create Todo\n * </AsyncButton>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/button#async-button | AsyncButton Demos}\n * @since 6.0.0\n */\nexport const AsyncButton = forwardRef<HTMLButtonElement, AsyncButtonProps>(\n function AsyncButton(props, ref) {\n const {\n id: propId,\n onClick = noop,\n children,\n floating = null,\n theme = floating ? \"secondary\" : \"clear\",\n themeType = floating ? \"contained\" : \"flat\",\n buttonType = floating ? \"icon\" : \"text\",\n className,\n disabled,\n loading: propLoading = false,\n loadingType = \"circular-overlay\",\n loadingChildren,\n loadingDisabledTheme = false,\n afterAddon: propAfterAddon,\n beforeAddon: propBeforeAddon,\n linearProgressProps,\n circularProgressProps,\n progressAriaLabel,\n progressAriaLabelledBy: propProgressAriaLabelledBy,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"async-button\");\n const { handleAsync, pending } = useAsyncFunction({ disabled });\n const loading = pending || propLoading;\n\n let progressTheme: ProgressTheme = \"current-color\";\n if (theme === \"clear\" || theme === \"disabled\") {\n progressTheme = \"primary\";\n }\n\n let progressAriaLabelledBy = propProgressAriaLabelledBy;\n if (\n !progressAriaLabel &&\n !linearProgressProps?.[\"aria-label\"] &&\n !linearProgressProps?.[\"aria-labelledby\"] &&\n !circularProgressProps?.[\"aria-label\"] &&\n !circularProgressProps?.[\"aria-labelledby\"]\n ) {\n progressAriaLabelledBy = id;\n }\n\n const progress = loadingType.includes(\"linear\") ? (\n <LinearProgress\n aria-label={progressAriaLabel}\n aria-labelledby={progressAriaLabelledBy as string}\n {...linearProgressProps}\n theme={progressTheme}\n />\n ) : (\n <CircularProgress\n aria-label={progressAriaLabel}\n aria-labelledby={progressAriaLabelledBy as string}\n {...circularProgressProps}\n theme={progressTheme}\n />\n );\n\n let afterAddon = propAfterAddon;\n let beforeAddon = propBeforeAddon;\n let overlayElement: ReactNode;\n let isOverlayCover = false;\n switch (loadingType) {\n case \"circular-before\":\n beforeAddon = loading ? progress : propBeforeAddon;\n break;\n case \"circular-after\":\n afterAddon = loading ? progress : propAfterAddon;\n break;\n case \"circular-overlay\":\n case \"linear-above\":\n case \"linear-below\": {\n let alignItems: BoxAlignItems = \"center\";\n if (loadingType === \"linear-above\") {\n alignItems = \"start\";\n } else if (loadingType === \"linear-below\") {\n alignItems = \"end\";\n } else {\n isOverlayCover = true;\n }\n\n overlayElement = loading && (\n <span\n className={overlay({\n active: true,\n visible: true,\n absolute: true,\n align: alignItems,\n })}\n >\n {progress}\n </span>\n );\n break;\n }\n }\n\n return (\n <Button\n {...remaining}\n aria-disabled={loading || undefined}\n id={id}\n ref={ref}\n disabled={disabled}\n floating={floating}\n className={cnb(\n \"rmd-button--async\",\n loading && isOverlayCover && \"rmd-button--async-overlay\",\n className\n )}\n theme={loading && loadingDisabledTheme ? \"disabled\" : theme}\n themeType={themeType}\n buttonType={buttonType}\n onClick={handleAsync((event) => Promise.resolve(onClick(event)))}\n >\n {beforeAddon}\n {loading && loadingChildren !== undefined ? loadingChildren : children}\n {afterAddon}\n {overlayElement}\n </Button>\n );\n }\n);\n"],"names":["cnb","forwardRef","overlay","CircularProgress","LinearProgress","useAsyncFunction","useEnsuredId","Button","noop","AsyncButton","props","ref","id","propId","onClick","children","floating","theme","themeType","buttonType","className","disabled","loading","propLoading","loadingType","loadingChildren","loadingDisabledTheme","afterAddon","propAfterAddon","beforeAddon","propBeforeAddon","linearProgressProps","circularProgressProps","progressAriaLabel","progressAriaLabelledBy","propProgressAriaLabelledBy","remaining","handleAsync","pending","progressTheme","progress","includes","aria-label","aria-labelledby","overlayElement","isOverlayCover","alignItems","span","active","visible","absolute","align","aria-disabled","undefined","event","Promise","resolve"],"mappings":"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"}
|
|
1
|
+
{"version":3,"sources":["../../src/button/AsyncButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { cnb } from \"cnbuilder\";\nimport {\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nimport { type BoxAlignItems } from \"../box/styles.js\";\nimport { overlay } from \"../overlay/styles.js\";\nimport {\n CircularProgress,\n type CircularProgressProps,\n} from \"../progress/CircularProgress.js\";\nimport {\n LinearProgress,\n type LinearProgressProps,\n} from \"../progress/LinearProgress.js\";\nimport { type ProgressTheme } from \"../progress/types.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { useAsyncFunction } from \"../useAsyncFunction.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { Button, type ButtonProps } from \"./Button.js\";\n\nconst noop = (): void => {\n // do nothing\n};\n\n/**\n * @since 6.0.0\n */\nexport type AsyncButtonLoadingType =\n | \"circular-before\"\n | \"circular-after\"\n | \"circular-overlay\"\n | \"linear-above\"\n | \"linear-below\";\n\n/**\n * @since 6.0.0\n */\nexport interface AsyncButtonProps extends ButtonProps {\n ref?: Ref<HTMLButtonElement>;\n\n /**\n * @see {@link progressAriaLabelledBy}\n * @defaultValue `\"async-button\" + useId()`\n */\n id?: string;\n\n /**\n * When this is defined and returns a `Promise`, the loading indicator will\n * display until the promise has resolved.\n *\n * @defaultValue `() => {}`\n */\n onClick?: (event: MouseEvent<HTMLButtonElement>) => Promise<void> | void;\n\n /**\n * Set this to `true` to manually display a loading spinner.\n *\n * @defaultValue `false`\n */\n loading?: boolean;\n\n /**\n * - `\"circular-overlay\"` - Covers and hides the button content with a\n * centered circular progress\n * - `\"circular-before\"` - Renders a circular progress bar before the button\n * content which is useful when rendering an icon before the button text.\n * See {@link beforeAddon} as well.\n * - `\"circular-after\"` - Renders a circular progress bar before the button\n * content which is useful when rendering an icon after the button text.\n * See {@link afterAddon} as well.\n * - `\"linear-above\"` - Renders a linear progress bar at the top of the button\n * while still displaying the button contents. Usually looks good for\n * outlined buttons.\n * - `\"linear-below\"` - Renders a linear progress bar at the bottom of the\n * button while still displaying the button contents. Usually looks good for\n * outlined buttons.\n *\n * @defaultValue `\"circular-overlay\"`\n */\n loadingType?: AsyncButtonLoadingType;\n\n /**\n * Optional content to display instead of the default `children` while\n * loading.\n */\n loadingChildren?: ReactNode;\n\n /**\n * Set this to `true` to use the `disabled` theme while loading.\n *\n * @defaultValue `false`\n */\n loadingDisabledTheme?: boolean;\n\n /**\n * This should be used when the {@link loadingType} is set to\n * `\"circular-before\"`, an icon should appear before the other content in\n * the button, and the loading indicator should replace the icon.\n */\n beforeAddon?: ReactNode;\n\n /**\n * This should be used when the {@link loadingType} is set to\n * `\"circular-after\"`, an icon should appear before the other content in\n * the button, and the loading indicator should replace the icon.\n */\n afterAddon?: ReactNode;\n\n /**\n * An optional label to provide to the progressbar.\n *\n * @see {@link progressAriaLabelledBy}\n */\n progressAriaLabel?: string;\n\n /**\n * @see {@link id}\n * @defaultValue `id`\n */\n progressAriaLabelledBy?: string;\n\n /**\n * Any additional props to pass to the `CircularProgress` bar when the\n * {@link loadingType} is one of the circular types.\n */\n linearProgressProps?: PropsWithRef<LinearProgressProps>;\n\n /**\n * Any additional props to pass to the `LinearProgress` bar when the\n * {@link loadingType} is one of the linear types.\n */\n circularProgressProps?: PropsWithRef<CircularProgressProps>;\n}\n\n/**\n * **Client Component**\n *\n * The async button can be used to render a loading indicator within a button\n * during an async task. The loading spinner can be shown either by enabling the\n * `loading` prop or returning a promise from the `onClick` event which will\n * continue to show the loading indicator until the promise has been resolved.\n *\n * @example Async onClick\n * ```tsx\n * import { AsyncButton } from \"@react-md/core/button/AsyncButton\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const [data, setData] = useState(null);\n * return (\n * <AsyncButton\n * type=\"submit\"\n * onClick={async () => {\n * const response = await fetch(\"/my-api\");\n * const json = await response.json();\n * setData(json);\n * }}\n * >\n * Submit\n * </AsyncButton>\n * );\n * }\n * ```\n *\n * @example Manual Loading State\n * ```tsx\n * import { AsyncButton } from \"@react-md/core/button/AsyncButton\";\n * import { useMutation } from \"@tanstack/query\";\n * import { useState, type ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * const { isLoading, mutate } = useMutation({\n * mutationFn: (newTodo) => fetch('/todos', {\n * method: \"POST\",\n * body: JSON.stringify(newTodo),\n * }),\n * });\n *\n * return (\n * <AsyncButton\n * type=\"submit\"\n * loading={isLoading}\n * onClick={() => {\n * mutate({ id: Date.now(), title: \"Create example\" });\n * }}\n * >\n * Create Todo\n * </AsyncButton>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/button#async-button | AsyncButton Demos}\n * @since 6.0.0\n */\nexport function AsyncButton(props: AsyncButtonProps): ReactElement {\n const {\n id: propId,\n ref,\n onClick = noop,\n children,\n floating = null,\n theme = floating ? \"secondary\" : \"clear\",\n themeType = floating ? \"contained\" : \"flat\",\n buttonType = floating ? \"icon\" : \"text\",\n className,\n disabled,\n loading: propLoading = false,\n loadingType = \"circular-overlay\",\n loadingChildren,\n loadingDisabledTheme = false,\n afterAddon: propAfterAddon,\n beforeAddon: propBeforeAddon,\n linearProgressProps,\n circularProgressProps,\n progressAriaLabel,\n progressAriaLabelledBy: propProgressAriaLabelledBy,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"async-button\");\n const { handleAsync, pending } = useAsyncFunction({ disabled });\n const loading = pending || propLoading;\n\n let progressTheme: ProgressTheme = \"current-color\";\n if (theme === \"clear\" || theme === \"disabled\") {\n progressTheme = \"primary\";\n }\n\n let progressAriaLabelledBy = propProgressAriaLabelledBy;\n if (\n !progressAriaLabel &&\n !linearProgressProps?.[\"aria-label\"] &&\n !linearProgressProps?.[\"aria-labelledby\"] &&\n !circularProgressProps?.[\"aria-label\"] &&\n !circularProgressProps?.[\"aria-labelledby\"]\n ) {\n progressAriaLabelledBy = id;\n }\n\n const progress = loadingType.includes(\"linear\") ? (\n <LinearProgress\n aria-label={progressAriaLabel}\n aria-labelledby={progressAriaLabelledBy as string}\n {...linearProgressProps}\n theme={progressTheme}\n />\n ) : (\n <CircularProgress\n aria-label={progressAriaLabel}\n aria-labelledby={progressAriaLabelledBy as string}\n {...circularProgressProps}\n theme={progressTheme}\n />\n );\n\n let afterAddon = propAfterAddon;\n let beforeAddon = propBeforeAddon;\n let overlayElement: ReactNode;\n let isOverlayCover = false;\n switch (loadingType) {\n case \"circular-before\":\n beforeAddon = loading ? progress : propBeforeAddon;\n break;\n case \"circular-after\":\n afterAddon = loading ? progress : propAfterAddon;\n break;\n case \"circular-overlay\":\n case \"linear-above\":\n case \"linear-below\": {\n let alignItems: BoxAlignItems = \"center\";\n if (loadingType === \"linear-above\") {\n alignItems = \"start\";\n } else if (loadingType === \"linear-below\") {\n alignItems = \"end\";\n } else {\n isOverlayCover = true;\n }\n\n overlayElement = loading && (\n <span\n className={overlay({\n active: true,\n visible: true,\n absolute: true,\n align: alignItems,\n })}\n >\n {progress}\n </span>\n );\n break;\n }\n }\n\n return (\n <Button\n {...remaining}\n aria-disabled={loading || undefined}\n id={id}\n ref={ref}\n disabled={disabled}\n floating={floating}\n className={cnb(\n \"rmd-button--async\",\n loading && isOverlayCover && \"rmd-button--async-overlay\",\n className\n )}\n theme={loading && loadingDisabledTheme ? \"disabled\" : theme}\n themeType={themeType}\n buttonType={buttonType}\n onClick={handleAsync((event) => Promise.resolve(onClick(event)))}\n >\n {beforeAddon}\n {loading && loadingChildren !== undefined ? loadingChildren : children}\n {afterAddon}\n {overlayElement}\n </Button>\n );\n}\n"],"names":["cnb","overlay","CircularProgress","LinearProgress","useAsyncFunction","useEnsuredId","Button","noop","AsyncButton","props","id","propId","ref","onClick","children","floating","theme","themeType","buttonType","className","disabled","loading","propLoading","loadingType","loadingChildren","loadingDisabledTheme","afterAddon","propAfterAddon","beforeAddon","propBeforeAddon","linearProgressProps","circularProgressProps","progressAriaLabel","progressAriaLabelledBy","propProgressAriaLabelledBy","remaining","handleAsync","pending","progressTheme","progress","includes","aria-label","aria-labelledby","overlayElement","isOverlayCover","alignItems","span","active","visible","absolute","align","aria-disabled","undefined","event","Promise","resolve"],"mappings":"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"}
|
package/dist/button/Button.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes } from "react";
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactElement, type Ref } from "react";
|
|
2
2
|
import { type ComponentWithRippleProps } from "../interaction/types.js";
|
|
3
3
|
import { type PropsWithRef } from "../types.js";
|
|
4
4
|
import { type FloatingActionButtonPosition, type FloatingActionButtonProps } from "./FloatingActionButton.js";
|
|
5
5
|
import { type ButtonClassNameThemeOptions } from "./styles.js";
|
|
6
6
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, ButtonClassNameThemeOptions, ComponentWithRippleProps {
|
|
7
|
+
ref?: Ref<HTMLButtonElement>;
|
|
7
8
|
/** @defaultValue `"button"` */
|
|
8
9
|
type?: "button" | "reset" | "submit";
|
|
9
10
|
/**
|
|
@@ -102,4 +103,4 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, Bu
|
|
|
102
103
|
*
|
|
103
104
|
* @see {@link https://react-md.dev/components/button | Button Demos}
|
|
104
105
|
*/
|
|
105
|
-
export declare
|
|
106
|
+
export declare function Button(props: ButtonProps): ReactElement;
|
package/dist/button/Button.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 { useElementInteraction } from "../interaction/useElementInteraction.js";
|
|
5
4
|
import { useHigherContrastChildren } from "../interaction/useHigherContrastChildren.js";
|
|
6
5
|
import { FloatingActionButton } from "./FloatingActionButton.js";
|
|
@@ -89,8 +88,8 @@ import { button } from "./styles.js";
|
|
|
89
88
|
* ```
|
|
90
89
|
*
|
|
91
90
|
* @see {@link https://react-md.dev/components/button | Button Demos}
|
|
92
|
-
*/ export
|
|
93
|
-
const { type = "button", disabled = false, floating = null, floatingProps, theme = floating ? "secondary" : "clear", themeType = floating ? "contained" : "flat", iconSize, buttonType = floating || iconSize ? "icon" : "text", className, responsive, children: propChildren, onBlur, onClick, onKeyDown, onKeyUp, onMouseDown, onMouseUp, onMouseLeave, onDragStart, onTouchStart, onTouchEnd, onTouchMove, disableRipple, ...remaining } = props;
|
|
91
|
+
*/ export function Button(props) {
|
|
92
|
+
const { ref, type = "button", disabled = false, floating = null, floatingProps, theme = floating ? "secondary" : "clear", themeType = floating ? "contained" : "flat", iconSize, buttonType = floating || iconSize ? "icon" : "text", className, responsive, children: propChildren, onBlur, onClick, onKeyDown, onKeyUp, onMouseDown, onMouseUp, onMouseLeave, onDragStart, onTouchStart, onTouchEnd, onTouchMove, disableRipple, ...remaining } = props;
|
|
94
93
|
const isThemeDisabled = theme === "disabled";
|
|
95
94
|
const ariaDisabled = props["aria-disabled"];
|
|
96
95
|
const { pressed, pressedClassName, ripples, handlers } = useElementInteraction({
|
|
@@ -136,6 +135,6 @@ import { button } from "./styles.js";
|
|
|
136
135
|
]
|
|
137
136
|
})
|
|
138
137
|
});
|
|
139
|
-
}
|
|
138
|
+
}
|
|
140
139
|
|
|
141
140
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/button/Button.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ButtonHTMLAttributes,
|
|
1
|
+
{"version":3,"sources":["../../src/button/Button.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ButtonHTMLAttributes, type ReactElement, type Ref } from \"react\";\n\nimport { type ComponentWithRippleProps } from \"../interaction/types.js\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { useHigherContrastChildren } from \"../interaction/useHigherContrastChildren.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport {\n FloatingActionButton,\n type FloatingActionButtonPosition,\n type FloatingActionButtonProps,\n} from \"./FloatingActionButton.js\";\nimport { type ButtonClassNameThemeOptions, button } from \"./styles.js\";\n\nexport interface ButtonProps\n extends\n ButtonHTMLAttributes<HTMLButtonElement>,\n ButtonClassNameThemeOptions,\n ComponentWithRippleProps {\n ref?: Ref<HTMLButtonElement>;\n\n /** @defaultValue `\"button\"` */\n type?: \"button\" | \"reset\" | \"submit\";\n\n /**\n * The position within the viewport to display the button as a floating action\n * button.\n */\n floating?: FloatingActionButtonPosition;\n\n /**\n * Any additional props to provide the to `FAB` container element when the\n * `floating` prop is provided\n */\n floatingProps?: PropsWithRef<FloatingActionButtonProps>;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <Button\n * onClick={(event) => {\n * // do something\n * }}\n * >\n * Content\n * </Button>\n * );\n * }\n * ```\n *\n * @example Theme Example\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <Button\n * theme=\"primary\"\n * themeType=\"contained\"\n * onClick={(event) => {\n * // do something\n * }}\n * >\n * Content\n * </Button>\n * );\n * }\n * ```\n *\n * @example Icon Button Example\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import FavoriteIcon from \"@react-md/material-icons/FavoriteIcon\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <Button\n * theme=\"secondary\"\n * themeType=\"outline\"\n * buttonType=\"icon\"\n * onClick={(event) => {\n * // do something\n * }}\n * >\n * <FavoriteIcon />\n * </Button>\n * );\n * }\n * ```\n *\n * @example Text Button with icons\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import FavoriteIcon from \"@react-md/material-icons/FavoriteIcon\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <Button\n * onClick={(event) => {\n * // do something\n * }}\n * >\n * <FavoriteIcon />\n * Content\n * </Button>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/button | Button Demos}\n */\nexport function Button(props: ButtonProps): ReactElement {\n const {\n ref,\n type = \"button\",\n disabled = false,\n floating = null,\n floatingProps,\n theme = floating ? \"secondary\" : \"clear\",\n themeType = floating ? \"contained\" : \"flat\",\n iconSize,\n buttonType = floating || iconSize ? \"icon\" : \"text\",\n className,\n responsive,\n children: propChildren,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n disableRipple,\n ...remaining\n } = props;\n const isThemeDisabled = theme === \"disabled\";\n const ariaDisabled = props[\"aria-disabled\"];\n const { pressed, pressedClassName, ripples, handlers } =\n useElementInteraction({\n mode: disableRipple ? \"press\" : undefined,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n disabled:\n disabled ||\n isThemeDisabled ||\n (ariaDisabled && ariaDisabled !== \"false\"),\n });\n\n const children = useHigherContrastChildren(propChildren);\n\n return (\n <FloatingActionButton position={floating} {...floatingProps}>\n <button\n {...remaining}\n // when the theme is set to `\"disabled\"`, the event handlers should be\n // removed so that it behaves like a disabled button. you do not want to\n // actually set the `disabled` attribute since it will lose keyboard\n // focus. this is mostly for supporting circular progress bars within\n // buttons\n {...(isThemeDisabled ? {} : handlers)}\n aria-disabled={isThemeDisabled || remaining[\"aria-disabled\"]}\n disabled={disabled}\n ref={ref}\n type={type}\n className={button({\n theme,\n themeType,\n buttonType,\n disabled,\n responsive,\n iconSize,\n pressed,\n pressedClassName,\n className,\n })}\n >\n {children}\n {ripples}\n </button>\n </FloatingActionButton>\n );\n}\n"],"names":["useElementInteraction","useHigherContrastChildren","FloatingActionButton","button","Button","props","ref","type","disabled","floating","floatingProps","theme","themeType","iconSize","buttonType","className","responsive","children","propChildren","onBlur","onClick","onKeyDown","onKeyUp","onMouseDown","onMouseUp","onMouseLeave","onDragStart","onTouchStart","onTouchEnd","onTouchMove","disableRipple","remaining","isThemeDisabled","ariaDisabled","pressed","pressedClassName","ripples","handlers","mode","undefined","position","aria-disabled"],"mappings":"AAAA;;AAKA,SAASA,qBAAqB,QAAQ,0CAA0C;AAChF,SAASC,yBAAyB,QAAQ,8CAA8C;AAExF,SACEC,oBAAoB,QAGf,4BAA4B;AACnC,SAA2CC,MAAM,QAAQ,cAAc;AAyBvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoFC,GACD,OAAO,SAASC,OAAOC,KAAkB;IACvC,MAAM,EACJC,GAAG,EACHC,OAAO,QAAQ,EACfC,WAAW,KAAK,EAChBC,WAAW,IAAI,EACfC,aAAa,EACbC,QAAQF,WAAW,cAAc,OAAO,EACxCG,YAAYH,WAAW,cAAc,MAAM,EAC3CI,QAAQ,EACRC,aAAaL,YAAYI,WAAW,SAAS,MAAM,EACnDE,SAAS,EACTC,UAAU,EACVC,UAAUC,YAAY,EACtBC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,aAAa,EACb,GAAGC,WACJ,GAAG1B;IACJ,MAAM2B,kBAAkBrB,UAAU;IAClC,MAAMsB,eAAe5B,KAAK,CAAC,gBAAgB;IAC3C,MAAM,EAAE6B,OAAO,EAAEC,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GACpDrC,sBAAsB;QACpBsC,MAAMR,gBAAgB,UAAUS;QAChCpB;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACArB,UACEA,YACAwB,mBACCC,gBAAgBA,iBAAiB;IACtC;IAEF,MAAMhB,WAAWhB,0BAA0BiB;IAE3C,qBACE,KAAChB;QAAqBsC,UAAU/B;QAAW,GAAGC,aAAa;kBACzD,cAAA,MAACP;YACE,GAAG4B,SAAS;YAMZ,GAAIC,kBAAkB,CAAC,IAAIK,QAAQ;YACpCI,iBAAeT,mBAAmBD,SAAS,CAAC,gBAAgB;YAC5DvB,UAAUA;YACVF,KAAKA;YACLC,MAAMA;YACNQ,WAAWZ,OAAO;gBAChBQ;gBACAC;gBACAE;gBACAN;gBACAQ;gBACAH;gBACAqB;gBACAC;gBACApB;YACF;;gBAECE;gBACAmB;;;;AAIT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes } from "react";
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactElement, type Ref } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* The props for the unstyled button are just all the normal button html
|
|
4
4
|
* attributes without the `type` since this component forces the `type="button"`
|
|
@@ -6,7 +6,9 @@ import { type ButtonHTMLAttributes } from "react";
|
|
|
6
6
|
*
|
|
7
7
|
* @since 6.0.0 Renamed from `UnstyledButtonProps`
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export interface ButtonUnstyledProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
|
|
10
|
+
ref?: Ref<HTMLButtonElement>;
|
|
11
|
+
}
|
|
10
12
|
/**
|
|
11
13
|
* A simple wrapper for a `<button type="button">` that applies the unstyled
|
|
12
14
|
* utility class.
|
|
@@ -17,4 +19,4 @@ export type ButtonUnstyledProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>,
|
|
|
17
19
|
* @see {@link buttonUnstyled}
|
|
18
20
|
* @since 6.0.0 Renamed from `UnstyledButton`
|
|
19
21
|
*/
|
|
20
|
-
export declare
|
|
22
|
+
export declare function ButtonUnstyled(props: ButtonUnstyledProps): ReactElement;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import { buttonUnstyled } from "./styles.js";
|
|
4
3
|
/**
|
|
5
4
|
* A simple wrapper for a `<button type="button">` that applies the unstyled
|
|
@@ -10,8 +9,8 @@ import { buttonUnstyled } from "./styles.js";
|
|
|
10
9
|
* @see {@link https://react-md.dev/components/button-unstyled | ButtonUnstyled Demos}
|
|
11
10
|
* @see {@link buttonUnstyled}
|
|
12
11
|
* @since 6.0.0 Renamed from `UnstyledButton`
|
|
13
|
-
*/ export
|
|
14
|
-
const { children, className, ...remaining } = props;
|
|
12
|
+
*/ export function ButtonUnstyled(props) {
|
|
13
|
+
const { ref, children, className, ...remaining } = props;
|
|
15
14
|
return /*#__PURE__*/ _jsx("button", {
|
|
16
15
|
...remaining,
|
|
17
16
|
ref: ref,
|
|
@@ -21,6 +20,6 @@ import { buttonUnstyled } from "./styles.js";
|
|
|
21
20
|
}),
|
|
22
21
|
children: children
|
|
23
22
|
});
|
|
24
|
-
}
|
|
23
|
+
}
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=ButtonUnstyled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/button/ButtonUnstyled.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes,
|
|
1
|
+
{"version":3,"sources":["../../src/button/ButtonUnstyled.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, type ReactElement, type Ref } from \"react\";\n\nimport { buttonUnstyled } from \"./styles.js\";\n\n/**\n * The props for the unstyled button are just all the normal button html\n * attributes without the `type` since this component forces the `type=\"button\"`\n * value.\n *\n * @since 6.0.0 Renamed from `UnstyledButtonProps`\n */\nexport interface ButtonUnstyledProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"type\"\n> {\n ref?: Ref<HTMLButtonElement>;\n}\n\n/**\n * A simple wrapper for a `<button type=\"button\">` that applies the unstyled\n * utility class.\n *\n * Requires the `$disable-unstyled-utility-class` to be `false` to use.\n *\n * @see {@link https://react-md.dev/components/button-unstyled | ButtonUnstyled Demos}\n * @see {@link buttonUnstyled}\n * @since 6.0.0 Renamed from `UnstyledButton`\n */\nexport function ButtonUnstyled(props: ButtonUnstyledProps): ReactElement {\n const { ref, children, className, ...remaining } = props;\n\n return (\n <button\n {...remaining}\n ref={ref}\n type=\"button\"\n className={buttonUnstyled({ className })}\n >\n {children}\n </button>\n );\n}\n"],"names":["buttonUnstyled","ButtonUnstyled","props","ref","children","className","remaining","button","type"],"mappings":";AAEA,SAASA,cAAc,QAAQ,cAAc;AAgB7C;;;;;;;;;CASC,GACD,OAAO,SAASC,eAAeC,KAA0B;IACvD,MAAM,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGC,WAAW,GAAGJ;IAEnD,qBACE,KAACK;QACE,GAAGD,SAAS;QACbH,KAAKA;QACLK,MAAK;QACLH,WAAWL,eAAe;YAAEK;QAAU;kBAErCD;;AAGP"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "react";
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type Ref } from "react";
|
|
2
2
|
declare module "react" {
|
|
3
3
|
interface CSSProperties {
|
|
4
4
|
"--rmd-fab-offset"?: string | number;
|
|
@@ -32,9 +32,10 @@ export interface FloatingActionButtonClassNameOptions {
|
|
|
32
32
|
export declare function fab(options: FloatingActionButtonClassNameOptions): string;
|
|
33
33
|
/** @since 6.0.0 */
|
|
34
34
|
export interface FloatingActionButtonProps extends HTMLAttributes<HTMLSpanElement>, FloatingActionButtonClassNameOptions {
|
|
35
|
+
ref?: Ref<HTMLSpanElement>;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* @since 6.0.0
|
|
38
39
|
* @internal
|
|
39
40
|
*/
|
|
40
|
-
export declare
|
|
41
|
+
export declare function FloatingActionButton(props: FloatingActionButtonProps): ReactElement;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { cnb } from "cnbuilder";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { bem } from "../utils/bem.js";
|
|
5
4
|
const styles = bem("rmd-fab");
|
|
6
5
|
/**
|
|
@@ -21,8 +20,8 @@ const styles = bem("rmd-fab");
|
|
|
21
20
|
/**
|
|
22
21
|
* @since 6.0.0
|
|
23
22
|
* @internal
|
|
24
|
-
*/ export
|
|
25
|
-
const { children, className, position = null, absolute = false, ...remaining } = props;
|
|
23
|
+
*/ export function FloatingActionButton(props) {
|
|
24
|
+
const { ref, children, className, position = null, absolute = false, ...remaining } = props;
|
|
26
25
|
if (!position) {
|
|
27
26
|
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
28
27
|
children: children
|
|
@@ -38,6 +37,6 @@ const styles = bem("rmd-fab");
|
|
|
38
37
|
}),
|
|
39
38
|
children: children
|
|
40
39
|
});
|
|
41
|
-
}
|
|
40
|
+
}
|
|
42
41
|
|
|
43
42
|
//# sourceMappingURL=FloatingActionButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/button/FloatingActionButton.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type HTMLAttributes,
|
|
1
|
+
{"version":3,"sources":["../../src/button/FloatingActionButton.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type HTMLAttributes, type ReactElement, type Ref } from \"react\";\n\nimport { bem } from \"../utils/bem.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-fab-offset\"?: string | number;\n }\n}\n\nconst styles = bem(\"rmd-fab\");\n\n/**\n * The position within the viewport for the floating action button.\n *\n * @since 6.0.0 This was renamed from `FABPosition`\n */\nexport type FloatingActionButtonPosition =\n | \"bottom-left\"\n | \"bottom-right\"\n | \"top-left\"\n | \"top-right\"\n | null;\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport interface FloatingActionButtonClassNameOptions {\n className?: string;\n\n /** @defaultValue `null` */\n position?: FloatingActionButtonPosition;\n\n /**\n * @defaultValue `false`\n */\n absolute?: boolean;\n}\n\n/**\n * FAB = Floating Action Button\n *\n * @since 6.0.0\n * @internal\n */\nexport function fab(options: FloatingActionButtonClassNameOptions): string {\n const { className, position = null, absolute = false } = options;\n\n return cnb(\n styles({\n tl: position === \"top-left\",\n tr: position === \"top-right\",\n bl: position === \"bottom-left\",\n br: position === \"bottom-right\",\n absolute,\n }),\n className\n );\n}\n\n/** @since 6.0.0 */\nexport interface FloatingActionButtonProps\n extends\n HTMLAttributes<HTMLSpanElement>,\n FloatingActionButtonClassNameOptions {\n ref?: Ref<HTMLSpanElement>;\n}\n\n/**\n * @since 6.0.0\n * @internal\n */\nexport function FloatingActionButton(\n props: FloatingActionButtonProps\n): ReactElement {\n const {\n ref,\n children,\n className,\n position = null,\n absolute = false,\n ...remaining\n } = props;\n if (!position) {\n return <>{children}</>;\n }\n\n return (\n <span\n {...remaining}\n ref={ref}\n className={fab({\n className,\n position,\n absolute,\n })}\n >\n {children}\n </span>\n );\n}\n"],"names":["cnb","bem","styles","fab","options","className","position","absolute","tl","tr","bl","br","FloatingActionButton","props","ref","children","remaining","span"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAGhC,SAASC,GAAG,QAAQ,kBAAkB;AAQtC,MAAMC,SAASD,IAAI;AA8BnB;;;;;CAKC,GACD,OAAO,SAASE,IAAIC,OAA6C;IAC/D,MAAM,EAAEC,SAAS,EAAEC,WAAW,IAAI,EAAEC,WAAW,KAAK,EAAE,GAAGH;IAEzD,OAAOJ,IACLE,OAAO;QACLM,IAAIF,aAAa;QACjBG,IAAIH,aAAa;QACjBI,IAAIJ,aAAa;QACjBK,IAAIL,aAAa;QACjBC;IACF,IACAF;AAEJ;AAUA;;;CAGC,GACD,OAAO,SAASO,qBACdC,KAAgC;IAEhC,MAAM,EACJC,GAAG,EACHC,QAAQ,EACRV,SAAS,EACTC,WAAW,IAAI,EACfC,WAAW,KAAK,EAChB,GAAGS,WACJ,GAAGH;IACJ,IAAI,CAACP,UAAU;QACb,qBAAO;sBAAGS;;IACZ;IAEA,qBACE,KAACE;QACE,GAAGD,SAAS;QACbF,KAAKA;QACLT,WAAWF,IAAI;YACbE;YACAC;YACAC;QACF;kBAECQ;;AAGP"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type ReactElement, type ReactNode, type Ref } from "react";
|
|
2
2
|
import { type TooltipProps } from "../tooltip/Tooltip.js";
|
|
3
3
|
import { type ProvidedTooltipProps, type TooltipOptions, type TooltippedElementEventHandlers } from "../tooltip/useTooltip.js";
|
|
4
4
|
import { type ButtonProps } from "./Button.js";
|
|
@@ -7,6 +7,7 @@ import { type ButtonType } from "./styles.js";
|
|
|
7
7
|
* @since 6.0.0
|
|
8
8
|
*/
|
|
9
9
|
export interface TooltippedButtonProps extends ButtonProps {
|
|
10
|
+
ref?: Ref<HTMLButtonElement>;
|
|
10
11
|
/** @defaultValue `"icon"` */
|
|
11
12
|
buttonType?: ButtonType;
|
|
12
13
|
/**
|
|
@@ -60,4 +61,4 @@ export interface TooltippedButtonProps extends ButtonProps {
|
|
|
60
61
|
* @see {@link https://react-md.dev/components/button | Button Demos}
|
|
61
62
|
* @since 6.0.0
|
|
62
63
|
*/
|
|
63
|
-
export declare
|
|
64
|
+
export declare function TooltippedButton(props: TooltippedButtonProps): ReactElement;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { Tooltip } from "../tooltip/Tooltip.js";
|
|
5
4
|
import { useTooltip } from "../tooltip/useTooltip.js";
|
|
6
5
|
import { Button } from "./Button.js";
|
|
@@ -27,8 +26,8 @@ import { Button } from "./Button.js";
|
|
|
27
26
|
*
|
|
28
27
|
* @see {@link https://react-md.dev/components/button | Button Demos}
|
|
29
28
|
* @since 6.0.0
|
|
30
|
-
*/ export
|
|
31
|
-
const { tooltip, tooltipProps, tooltipOptions, buttonType = "icon", onBlur, onFocus, onMouseEnter, onMouseLeave, onTouchStart, onTouchEnd, onContextMenu, ...remaining } = props;
|
|
29
|
+
*/ export function TooltippedButton(props) {
|
|
30
|
+
const { ref, tooltip, tooltipProps, tooltipOptions, buttonType = "icon", onBlur, onFocus, onMouseEnter, onMouseLeave, onTouchStart, onTouchEnd, onContextMenu, ...remaining } = props;
|
|
32
31
|
const { tooltipProps: providedTooltipProps, elementProps } = useTooltip({
|
|
33
32
|
...tooltipOptions,
|
|
34
33
|
disabled: !tooltip || tooltipOptions?.disabled,
|
|
@@ -55,6 +54,6 @@ import { Button } from "./Button.js";
|
|
|
55
54
|
})
|
|
56
55
|
]
|
|
57
56
|
});
|
|
58
|
-
}
|
|
57
|
+
}
|
|
59
58
|
|
|
60
59
|
//# sourceMappingURL=TooltippedButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/button/TooltippedButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode,
|
|
1
|
+
{"version":3,"sources":["../../src/button/TooltippedButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactElement, type ReactNode, type Ref } from \"react\";\n\nimport { Tooltip, type TooltipProps } from \"../tooltip/Tooltip.js\";\nimport {\n type ProvidedTooltipProps,\n type TooltipOptions,\n type TooltippedElementEventHandlers,\n useTooltip,\n} from \"../tooltip/useTooltip.js\";\nimport { Button, type ButtonProps } from \"./Button.js\";\nimport { type ButtonType } from \"./styles.js\";\n\n/**\n * @since 6.0.0\n */\nexport interface TooltippedButtonProps extends ButtonProps {\n ref?: Ref<HTMLButtonElement>;\n\n /** @defaultValue `\"icon\"` */\n buttonType?: ButtonType;\n\n /**\n * The tooltip children to render. When this is falsey, the tooltip event\n * listeners will not be enabled and the tooltip will never display.\n */\n tooltip?: ReactNode;\n\n /**\n * Any additional props to pass to the `Tooltip` component (normally styling\n * props).\n */\n tooltipProps?: Omit<TooltipProps, keyof ProvidedTooltipProps>;\n\n /**\n * Any additional tooltip options to pass to {@link useTooltip}. The most\n * common options would be:\n *\n * ```ts\n * tooltipOptions={{\n * overflowOnly: true,\n *\n * // whatever values you want for these\n * hoverTimeout: 0,\n * leaveTimeout: 150,\n * defaultPosition: \"left\",\n * }}\n * ```\n */\n tooltipOptions?: Omit<TooltipOptions, keyof TooltippedElementEventHandlers>;\n}\n\n/**\n * **Client Component**\n *\n * A simple wrapper around the `Button` and `Tooltip` components to dynamically\n * add tooltips to buttons. The `buttonType` will default to `icon` instead of\n * `text`.\n *\n * @example\n * ```tsx\n * import { TooltippedButton } from \"@react-md/core/button/TooltippedButton\";\n * import FavoriteIcon from \"@react-md/material-icons/FavoriteIcon\";\n *\n * export default function Example(): ReactElement {\n * return (\n * <TooltippedButton tooltip=\"I am a tooltip!\" aria-label=\"Favorite\">\n * <FavoriteIcon />\n * </TooltippedButton>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/button | Button Demos}\n * @since 6.0.0\n */\nexport function TooltippedButton(props: TooltippedButtonProps): ReactElement {\n const {\n ref,\n tooltip,\n tooltipProps,\n tooltipOptions,\n buttonType = \"icon\",\n onBlur,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n onTouchEnd,\n onContextMenu,\n ...remaining\n } = props;\n const { tooltipProps: providedTooltipProps, elementProps } = useTooltip({\n ...tooltipOptions,\n disabled: !tooltip || tooltipOptions?.disabled,\n onBlur,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchEnd,\n onTouchStart,\n onContextMenu,\n });\n\n return (\n <>\n <Button\n {...elementProps}\n {...remaining}\n ref={ref}\n buttonType={buttonType}\n />\n <Tooltip {...providedTooltipProps} {...tooltipProps}>\n {tooltip}\n </Tooltip>\n </>\n );\n}\n"],"names":["Tooltip","useTooltip","Button","TooltippedButton","props","ref","tooltip","tooltipProps","tooltipOptions","buttonType","onBlur","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd","onContextMenu","remaining","providedTooltipProps","elementProps","disabled"],"mappings":"AAAA;;AAIA,SAASA,OAAO,QAA2B,wBAAwB;AACnE,SAIEC,UAAU,QACL,2BAA2B;AAClC,SAASC,MAAM,QAA0B,cAAc;AA0CvD;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,OAAO,SAASC,iBAAiBC,KAA4B;IAC3D,MAAM,EACJC,GAAG,EACHC,OAAO,EACPC,YAAY,EACZC,cAAc,EACdC,aAAa,MAAM,EACnBC,MAAM,EACNC,OAAO,EACPC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,aAAa,EACb,GAAGC,WACJ,GAAGb;IACJ,MAAM,EAAEG,cAAcW,oBAAoB,EAAEC,YAAY,EAAE,GAAGlB,WAAW;QACtE,GAAGO,cAAc;QACjBY,UAAU,CAACd,WAAWE,gBAAgBY;QACtCV;QACAC;QACAC;QACAC;QACAE;QACAD;QACAE;IACF;IAEA,qBACE;;0BACE,KAACd;gBACE,GAAGiB,YAAY;gBACf,GAAGF,SAAS;gBACbZ,KAAKA;gBACLI,YAAYA;;0BAEd,KAACT;gBAAS,GAAGkB,oBAAoB;gBAAG,GAAGX,YAAY;0BAChDD;;;;AAIT"}
|
package/dist/card/Card.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "react";
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type Ref } from "react";
|
|
2
2
|
import { type BoxAlignItems, type BoxOptions } from "../box/styles.js";
|
|
3
3
|
import { type CardClassNameOptions } from "./styles.js";
|
|
4
4
|
/**
|
|
@@ -6,6 +6,7 @@ import { type CardClassNameOptions } from "./styles.js";
|
|
|
6
6
|
* deprecated `raiseable` prop
|
|
7
7
|
*/
|
|
8
8
|
export interface CardProps extends HTMLAttributes<HTMLDivElement>, CardClassNameOptions, Pick<BoxOptions, "align" | "justify" | "fullWidth" | "disableWrap"> {
|
|
9
|
+
ref?: Ref<HTMLDivElement>;
|
|
9
10
|
/** @defaultValue `"stretch"` */
|
|
10
11
|
align?: BoxAlignItems;
|
|
11
12
|
/** @defaultValue `"start"` */
|
|
@@ -50,4 +51,4 @@ export interface CardProps extends HTMLAttributes<HTMLDivElement>, CardClassName
|
|
|
50
51
|
* @since 6.0.0 Uses the `Box` component and displays as `flex` instead of
|
|
51
52
|
* `block`/`inline-block`.
|
|
52
53
|
*/
|
|
53
|
-
export declare
|
|
54
|
+
export declare function Card(props: CardProps): ReactElement;
|
package/dist/card/Card.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import { Box } from "../box/Box.js";
|
|
4
3
|
import { card } from "./styles.js";
|
|
5
4
|
/**
|
|
@@ -40,8 +39,8 @@ import { card } from "./styles.js";
|
|
|
40
39
|
* @since 6.0.0 Removed the deprecated `raiseable` prop
|
|
41
40
|
* @since 6.0.0 Uses the `Box` component and displays as `flex` instead of
|
|
42
41
|
* `block`/`inline-block`.
|
|
43
|
-
*/ export
|
|
44
|
-
const { children, className, align = "stretch", justify = "stretch", bordered, raisable, interactable, ...remaining } = props;
|
|
42
|
+
*/ export function Card(props) {
|
|
43
|
+
const { ref, children, className, align = "stretch", justify = "stretch", bordered, raisable, interactable, ...remaining } = props;
|
|
45
44
|
return /*#__PURE__*/ _jsx(Box, {
|
|
46
45
|
align: align,
|
|
47
46
|
justify: justify,
|
|
@@ -59,6 +58,6 @@ import { card } from "./styles.js";
|
|
|
59
58
|
}),
|
|
60
59
|
children: children
|
|
61
60
|
});
|
|
62
|
-
}
|
|
61
|
+
}
|
|
63
62
|
|
|
64
63
|
//# sourceMappingURL=Card.js.map
|
package/dist/card/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/card/Card.tsx"],"sourcesContent":["import { type HTMLAttributes,
|
|
1
|
+
{"version":3,"sources":["../../src/card/Card.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactElement, type Ref } from \"react\";\n\nimport { Box } from \"../box/Box.js\";\nimport { type BoxAlignItems, type BoxOptions } from \"../box/styles.js\";\nimport { type CardClassNameOptions, card } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Extends the {@link CardClassNameOptions} and removed the\n * deprecated `raiseable` prop\n */\nexport interface CardProps\n extends\n HTMLAttributes<HTMLDivElement>,\n CardClassNameOptions,\n Pick<BoxOptions, \"align\" | \"justify\" | \"fullWidth\" | \"disableWrap\"> {\n ref?: Ref<HTMLDivElement>;\n\n /** @defaultValue `\"stretch\"` */\n align?: BoxAlignItems;\n\n /** @defaultValue `\"start\"` */\n justify?: BoxAlignItems;\n}\n\n/**\n * @example Simple Example\n * ```tsx\n * import { Button } from \"@react-md/core/button/Button\";\n * import { Card } from \"@react-md/core/card/Card\";\n * import { CardContent } from \"@react-md/core/card/CardContent\";\n * import { CardFooter } from \"@react-md/core/card/CardFooter\";\n * import { CardHeader } from \"@react-md/core/card/CardHeader\";\n * import { CardTitle } from \"@react-md/core/card/CardTitle\";\n * import { CardSubtitle } from \"@react-md/core/card/CardSubtitle\";\n * import { Typography } from \"@react-md/core/typography/Typography\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <Card>\n * <CardHeader>\n * <CardTitle>Main Title</CardTitle>\n * <CardSubtitle>A subtitle</CardSubtitle>\n * </CardHeader>\n * <CardContent>\n * <Typography margin=\"none\">\n * Some paragraph of text.\n * </Typography>\n * </CardContent>\n * <CardFooter>\n * <Button>Action 1</Button>\n * <Button>Action 2</Button>\n * </CardFooter>\n * </Card>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/card | Card Demos}\n * @since 6.0.0 Removed the deprecated `raiseable` prop\n * @since 6.0.0 Uses the `Box` component and displays as `flex` instead of\n * `block`/`inline-block`.\n */\nexport function Card(props: CardProps): ReactElement {\n const {\n ref,\n children,\n className,\n align = \"stretch\",\n justify = \"stretch\",\n bordered,\n raisable,\n interactable,\n ...remaining\n } = props;\n\n return (\n <Box\n align={align}\n justify={justify}\n disableWrap\n {...remaining}\n stacked\n disableGap\n disablePadding\n ref={ref}\n className={card({\n className,\n bordered,\n raisable,\n interactable,\n })}\n >\n {children}\n </Box>\n );\n}\n"],"names":["Box","card","Card","props","ref","children","className","align","justify","bordered","raisable","interactable","remaining","disableWrap","stacked","disableGap","disablePadding"],"mappings":";AAEA,SAASA,GAAG,QAAQ,gBAAgB;AAEpC,SAAoCC,IAAI,QAAQ,cAAc;AAoB9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCC,GACD,OAAO,SAASC,KAAKC,KAAgB;IACnC,MAAM,EACJC,GAAG,EACHC,QAAQ,EACRC,SAAS,EACTC,QAAQ,SAAS,EACjBC,UAAU,SAAS,EACnBC,QAAQ,EACRC,QAAQ,EACRC,YAAY,EACZ,GAAGC,WACJ,GAAGT;IAEJ,qBACE,KAACH;QACCO,OAAOA;QACPC,SAASA;QACTK,WAAW;QACV,GAAGD,SAAS;QACbE,OAAO;QACPC,UAAU;QACVC,cAAc;QACdZ,KAAKA;QACLE,WAAWL,KAAK;YACdK;YACAG;YACAC;YACAC;QACF;kBAECN;;AAGP"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { type HTMLAttributes } from "react";
|
|
1
|
+
import { type HTMLAttributes, type ReactElement, type Ref } from "react";
|
|
2
2
|
import { type CardContentClassNameOptions } from "./styles.js";
|
|
3
3
|
/**
|
|
4
4
|
* @since 6.0.0 Renamed `disableExtraPadding` to `disableLastChildPadding` and
|
|
5
5
|
* removed the `disableParagraphMargin` prop.
|
|
6
6
|
*/
|
|
7
7
|
export interface CardContentProps extends HTMLAttributes<HTMLDivElement>, CardContentClassNameOptions {
|
|
8
|
+
ref?: Ref<HTMLDivElement>;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* @see {@link https://react-md.dev/components/card | Card Demos}
|
|
11
12
|
* @since 6.0.0 Renamed `disableExtraPadding` to `disableLastChildPadding` and
|
|
12
13
|
* removed the `disableParagraphMargin` prop.
|
|
13
14
|
*/
|
|
14
|
-
export declare const CardContent:
|
|
15
|
+
export declare const CardContent: (props: CardContentProps) => ReactElement;
|
package/dist/card/CardContent.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import { cardContent } from "./styles.js";
|
|
4
3
|
/**
|
|
5
4
|
* @see {@link https://react-md.dev/components/card | Card Demos}
|
|
6
5
|
* @since 6.0.0 Renamed `disableExtraPadding` to `disableLastChildPadding` and
|
|
7
6
|
* removed the `disableParagraphMargin` prop.
|
|
8
|
-
*/ export const CardContent =
|
|
9
|
-
const { children, className, disablePadding, disableSecondaryColor, disableLastChildPadding, ...remaining } = props;
|
|
7
|
+
*/ export const CardContent = function CardContent(props) {
|
|
8
|
+
const { ref, children, className, disablePadding, disableSecondaryColor, disableLastChildPadding, ...remaining } = props;
|
|
10
9
|
return /*#__PURE__*/ _jsx("div", {
|
|
11
10
|
...remaining,
|
|
12
11
|
ref: ref,
|
|
@@ -18,6 +17,6 @@ import { cardContent } from "./styles.js";
|
|
|
18
17
|
}),
|
|
19
18
|
children: children
|
|
20
19
|
});
|
|
21
|
-
}
|
|
20
|
+
};
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=CardContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/card/CardContent.tsx"],"sourcesContent":["import { type HTMLAttributes,
|
|
1
|
+
{"version":3,"sources":["../../src/card/CardContent.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactElement, type Ref } from \"react\";\n\nimport { type CardContentClassNameOptions, cardContent } from \"./styles.js\";\n\n/**\n * @since 6.0.0 Renamed `disableExtraPadding` to `disableLastChildPadding` and\n * removed the `disableParagraphMargin` prop.\n */\nexport interface CardContentProps\n extends HTMLAttributes<HTMLDivElement>, CardContentClassNameOptions {\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * @see {@link https://react-md.dev/components/card | Card Demos}\n * @since 6.0.0 Renamed `disableExtraPadding` to `disableLastChildPadding` and\n * removed the `disableParagraphMargin` prop.\n */\nexport const CardContent = function CardContent(\n props: CardContentProps\n): ReactElement {\n const {\n ref,\n children,\n className,\n disablePadding,\n disableSecondaryColor,\n disableLastChildPadding,\n ...remaining\n } = props;\n\n return (\n <div\n {...remaining}\n ref={ref}\n className={cardContent({\n className,\n disablePadding,\n disableSecondaryColor,\n disableLastChildPadding,\n })}\n >\n {children}\n </div>\n );\n};\n"],"names":["cardContent","CardContent","props","ref","children","className","disablePadding","disableSecondaryColor","disableLastChildPadding","remaining","div"],"mappings":";AAEA,SAA2CA,WAAW,QAAQ,cAAc;AAW5E;;;;CAIC,GACD,OAAO,MAAMC,cAAc,SAASA,YAClCC,KAAuB;IAEvB,MAAM,EACJC,GAAG,EACHC,QAAQ,EACRC,SAAS,EACTC,cAAc,EACdC,qBAAqB,EACrBC,uBAAuB,EACvB,GAAGC,WACJ,GAAGP;IAEJ,qBACE,KAACQ;QACE,GAAGD,SAAS;QACbN,KAAKA;QACLE,WAAWL,YAAY;YACrBK;YACAC;YACAC;YACAC;QACF;kBAECJ;;AAGP,EAAE"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { type ReactElement, type Ref } from "react";
|
|
1
2
|
import { type BoxProps } from "../box/Box.js";
|
|
2
3
|
import { type BoxJustifyContent } from "../box/styles.js";
|
|
3
4
|
/** @since 6.0.0 */
|
|
4
5
|
export interface CardFooterProps extends BoxProps {
|
|
6
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
7
|
/**
|
|
6
8
|
* @defaultValue `"flex-end"`
|
|
7
9
|
*/
|
|
@@ -14,4 +16,4 @@ export interface CardFooterProps extends BoxProps {
|
|
|
14
16
|
* @see {@link https://react-md.dev/components/card | Card Demos}
|
|
15
17
|
* @since 6.0.0
|
|
16
18
|
*/
|
|
17
|
-
export declare
|
|
19
|
+
export declare function CardFooter(props: CardFooterProps): ReactElement;
|
package/dist/card/CardFooter.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import { Box } from "../box/Box.js";
|
|
4
3
|
import { cardFooter } from "./styles.js";
|
|
5
4
|
/**
|
|
@@ -8,8 +7,8 @@ import { cardFooter } from "./styles.js";
|
|
|
8
7
|
*
|
|
9
8
|
* @see {@link https://react-md.dev/components/card | Card Demos}
|
|
10
9
|
* @since 6.0.0
|
|
11
|
-
*/ export
|
|
12
|
-
const { className, children, justify = "flex-end", ...remaining } = props;
|
|
10
|
+
*/ export function CardFooter(props) {
|
|
11
|
+
const { ref, className, children, justify = "flex-end", ...remaining } = props;
|
|
13
12
|
return /*#__PURE__*/ _jsx(Box, {
|
|
14
13
|
...remaining,
|
|
15
14
|
ref: ref,
|
|
@@ -19,6 +18,6 @@ import { cardFooter } from "./styles.js";
|
|
|
19
18
|
justify: justify,
|
|
20
19
|
children: children
|
|
21
20
|
});
|
|
22
|
-
}
|
|
21
|
+
}
|
|
23
22
|
|
|
24
23
|
//# sourceMappingURL=CardFooter.js.map
|