@adgytec/adgytec-web-ui-components 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +2 -2
- package/dist/assets/CalendarCell.css +1 -1
- package/dist/assets/CalendarMenuItem.css +1 -1
- package/dist/assets/ListTrailingText.css +1 -0
- package/dist/assets/SideSheet.css +1 -1
- package/dist/assets/core7.css +1 -1
- package/dist/chunks/ActionDialog.map +1 -1
- package/dist/chunks/AppBar +42 -42
- package/dist/chunks/AppBar.map +1 -1
- package/dist/chunks/AppBarAction.map +1 -1
- package/dist/chunks/AppBarAvatar.map +1 -1
- package/dist/chunks/AppBarHeadline.map +1 -1
- package/dist/chunks/BaseCalendar +69 -63
- package/dist/chunks/BaseCalendar.map +1 -1
- package/dist/chunks/BottomSheet.map +1 -1
- package/dist/chunks/BottomSheetModal.map +1 -1
- package/dist/chunks/ButtonGroup.map +1 -1
- package/dist/chunks/CalendarCell +25 -39
- package/dist/chunks/CalendarCell.map +1 -1
- package/dist/chunks/CalendarGrid.map +1 -1
- package/dist/chunks/CalendarMenuItem +1 -1
- package/dist/chunks/CalendarMenuItem.map +1 -1
- package/dist/chunks/Card.map +1 -1
- package/dist/chunks/CardIcon.map +1 -1
- package/dist/chunks/CenteredSlider.map +1 -1
- package/dist/chunks/ComboBox.map +1 -1
- package/dist/chunks/ComboBoxPopover.map +1 -1
- package/dist/chunks/ComboBoxTrigger +592 -62
- package/dist/chunks/ComboBoxTrigger.map +1 -1
- package/dist/chunks/ConnectedButtonGroup +13 -10
- package/dist/chunks/ConnectedButtonGroup.map +1 -1
- package/dist/chunks/Dialog.map +1 -1
- package/dist/chunks/Disclosure.map +1 -1
- package/dist/chunks/DisclosureGroup.map +1 -1
- package/dist/chunks/DisclosureHeader.map +1 -1
- package/dist/chunks/DisclosurePanel.map +1 -1
- package/dist/chunks/Divider.map +1 -1
- package/dist/chunks/FieldError.map +1 -1
- package/dist/chunks/GridBackgroundDecorator.map +1 -1
- package/dist/chunks/Icon.map +1 -1
- package/dist/chunks/Input.map +1 -1
- package/dist/chunks/Input2 +2 -1
- package/dist/chunks/Input2.map +1 -1
- package/dist/chunks/ListAction +13 -0
- package/dist/chunks/ListAction.map +1 -0
- package/dist/chunks/ListAvatar.map +1 -1
- package/dist/chunks/ListBox.map +1 -1
- package/dist/chunks/ListIcon.map +1 -1
- package/dist/chunks/ListItem.map +1 -1
- package/dist/chunks/ListLabelText.map +1 -1
- package/dist/chunks/ListMedia.map +1 -1
- package/dist/chunks/ListOverlineText.map +1 -1
- package/dist/chunks/ListSupportingText.map +1 -1
- package/dist/chunks/ListTrailingText +21 -0
- package/dist/chunks/ListTrailingText.map +1 -0
- package/dist/chunks/Loader.map +1 -1
- package/dist/chunks/MenuPopover.map +1 -1
- package/dist/chunks/Modal.map +1 -1
- package/dist/chunks/ModalOverlay.map +1 -1
- package/dist/chunks/Navigation.map +1 -1
- package/dist/chunks/NavigationScrollContainer +5 -2
- package/dist/chunks/NavigationScrollContainer.map +1 -1
- package/dist/chunks/NavigationSection.map +1 -1
- package/dist/chunks/NavigationSectionLabel.map +1 -1
- package/dist/chunks/Popover.map +1 -1
- package/dist/chunks/RadialGlowDecorator.map +1 -1
- package/dist/chunks/Radio.map +1 -1
- package/dist/chunks/RichTooltip.map +1 -1
- package/dist/chunks/RichTooltipActions.map +1 -1
- package/dist/chunks/RichTooltipInfo.map +1 -1
- package/dist/chunks/SearchField.map +1 -1
- package/dist/chunks/SelectPopover.map +1 -1
- package/dist/chunks/SelectTrigger.map +1 -1
- package/dist/chunks/SideSheet +7 -7
- package/dist/chunks/SideSheet.map +1 -1
- package/dist/chunks/SideSheetModal.map +1 -1
- package/dist/chunks/Slider.map +1 -1
- package/dist/chunks/SliderOutput.map +1 -1
- package/dist/chunks/SliderStops +3 -3
- package/dist/chunks/SliderStops.map +1 -1
- package/dist/chunks/SliderThumb.map +1 -1
- package/dist/chunks/Snackbar.map +1 -1
- package/dist/chunks/SplitButton +13 -10
- package/dist/chunks/SplitButton.map +1 -1
- package/dist/chunks/SplitButtonTrigger +8 -7
- package/dist/chunks/SplitButtonTrigger.map +1 -1
- package/dist/chunks/SubmenuPopover.map +1 -1
- package/dist/chunks/Switch.map +1 -1
- package/dist/chunks/Tab.map +1 -1
- package/dist/chunks/TabList.map +1 -1
- package/dist/chunks/TabPanel.map +1 -1
- package/dist/chunks/TabPanels.map +1 -1
- package/dist/chunks/Tabs.map +1 -1
- package/dist/chunks/Tag.map +1 -1
- package/dist/chunks/ThemeSelector +75 -71
- package/dist/chunks/ThemeSelector.map +1 -1
- package/dist/chunks/Toolbar.map +1 -1
- package/dist/chunks/Tooltip.map +1 -1
- package/dist/chunks/base.map +1 -1
- package/dist/chunks/compiler-runtime +2 -2
- package/dist/chunks/compiler-runtime.map +1 -1
- package/dist/chunks/context.map +1 -1
- package/dist/chunks/core +27 -25
- package/dist/chunks/core.map +1 -1
- package/dist/chunks/core2.map +1 -1
- package/dist/chunks/core3.map +1 -1
- package/dist/chunks/core4.map +1 -1
- package/dist/chunks/core5.map +1 -1
- package/dist/chunks/core6 +11 -11
- package/dist/chunks/core6.map +1 -1
- package/dist/chunks/core7.map +1 -1
- package/dist/chunks/core8.map +1 -1
- package/dist/chunks/core9.map +1 -1
- package/dist/chunks/navContext.map +1 -1
- package/dist/chunks/tapTarget.map +1 -1
- package/dist/chunks/types.map +1 -1
- package/dist/chunks/useHover +460 -153
- package/dist/chunks/useHover.map +1 -1
- package/dist/chunks/useSplash +17 -19
- package/dist/chunks/useSplash.map +1 -1
- package/dist/components/AppBar/AppBar/AppBar.d.ts +29 -0
- package/dist/components/AppBar/AppBar/types.d.ts +29 -4
- package/dist/components/AppBar/AppBarAction/AppBarAction.d.ts +19 -1
- package/dist/components/AppBar/AppBarAvatar/AppBarAvatar.d.ts +20 -1
- package/dist/components/AppBar/AppBarHeadline/AppBarHeadline.d.ts +19 -1
- package/dist/components/AppBar/AppBarState/AppBarState.d.ts +28 -2
- package/dist/components/AppBar/AppBarState/context.d.ts +37 -0
- package/dist/components/AppBar/AppBarState/index.js +16 -10
- package/dist/components/AppBar/AppBarState/index.js.map +1 -1
- package/dist/components/AppBar/core/alignment.d.ts +6 -0
- package/dist/components/AppBar/core/context.d.ts +16 -0
- package/dist/components/AppBar/core/index.js.map +1 -1
- package/dist/components/AppBar/core/size.d.ts +13 -0
- package/dist/components/AppBar/index.js +7 -7
- package/dist/components/Button/Button/Button.d.ts +17 -0
- package/dist/components/Button/Button/index.js.map +1 -1
- package/dist/components/Button/Button/types.d.ts +4 -0
- package/dist/components/Button/ButtonGroups/ButtonGroup/ButtonGroup.d.ts +17 -0
- package/dist/components/Button/ButtonGroups/ButtonGroup/types.d.ts +24 -0
- package/dist/components/Button/ButtonGroups/ButtonGroupContext/context.d.ts +22 -0
- package/dist/components/Button/ButtonGroups/ButtonGroupContext/index.js.map +1 -1
- package/dist/components/Button/ButtonGroups/ButtonGroupContext/useButtonGroupContext.d.ts +5 -0
- package/dist/components/Button/ButtonGroups/ButtonGroupContext/useConnectedButtonGroupContext.d.ts +5 -0
- package/dist/components/Button/ButtonGroups/ConnectedButton/ConnectedButton.d.ts +13 -0
- package/dist/components/Button/ButtonGroups/ConnectedButton/types.d.ts +19 -1
- package/dist/components/Button/ButtonGroups/ConnectedButtonGroup/ConnectedButtonGroup.d.ts +18 -0
- package/dist/components/Button/ButtonGroups/ConnectedButtonGroup/types.d.ts +24 -0
- package/dist/components/Button/IconButton/IconButton.d.ts +21 -0
- package/dist/components/Button/IconButton/index.js.map +1 -1
- package/dist/components/Button/IconButton/types.d.ts +4 -0
- package/dist/components/Button/LinkButton/LinkButton.d.ts +15 -0
- package/dist/components/Button/LinkButton/index.js.map +1 -1
- package/dist/components/Button/LinkButton/types.d.ts +4 -0
- package/dist/components/Button/LinkIconButton/LinkIconButton.d.ts +19 -0
- package/dist/components/Button/LinkIconButton/index.js.map +1 -1
- package/dist/components/Button/LinkIconButton/types.d.ts +4 -0
- package/dist/components/Button/SplitButton/SplitButton/SplitButton.d.ts +24 -0
- package/dist/components/Button/SplitButton/SplitButton/types.d.ts +23 -0
- package/dist/components/Button/SplitButton/SplitButtonContext/context.d.ts +11 -0
- package/dist/components/Button/SplitButton/SplitButtonContext/index.js.map +1 -1
- package/dist/components/Button/SplitButton/SplitButtonContext/useSplitButtonContext.d.ts +5 -0
- package/dist/components/Button/SplitButton/SplitButtonPrimary/SplitButtonPrimary.d.ts +15 -0
- package/dist/components/Button/SplitButton/SplitButtonPrimary/index.js +2 -2
- package/dist/components/Button/SplitButton/SplitButtonPrimary/index.js.map +1 -1
- package/dist/components/Button/SplitButton/SplitButtonPrimary/types.d.ts +11 -0
- package/dist/components/Button/SplitButton/SplitButtonTrigger/SplitButtonTrigger.d.ts +19 -0
- package/dist/components/Button/SplitButton/SplitButtonTrigger/types.d.ts +5 -0
- package/dist/components/Button/SplitButton/core/size.d.ts +13 -0
- package/dist/components/Button/ToggleButton/ToggleButton.d.ts +21 -0
- package/dist/components/Button/ToggleButton/index.js.map +1 -1
- package/dist/components/Button/ToggleButton/types.d.ts +14 -0
- package/dist/components/Button/ToggleIconButton/ToggleIconButton.d.ts +21 -0
- package/dist/components/Button/ToggleIconButton/index.js.map +1 -1
- package/dist/components/Button/ToggleIconButton/types.d.ts +9 -0
- package/dist/components/Button/core/button.d.ts +33 -0
- package/dist/components/Button/core/color.d.ts +38 -0
- package/dist/components/Button/core/shape.d.ts +6 -0
- package/dist/components/Button/core/sizes.d.ts +26 -0
- package/dist/components/Button/core/useButtonConfig.d.ts +25 -0
- package/dist/components/Button/core/variant.d.ts +6 -0
- package/dist/components/Button/core/width.d.ts +7 -0
- package/dist/components/Button/core/withTooltip.d.ts +9 -2
- package/dist/components/Calendar/BaseCalendar/BaseCalendar.d.ts +23 -2
- package/dist/components/Calendar/Calendar/Calendar.d.ts +39 -2
- package/dist/components/Calendar/Calendar/index.js +18 -12
- package/dist/components/Calendar/Calendar/index.js.map +1 -1
- package/dist/components/Calendar/CalendarCell/CalendarCell.d.ts +14 -2
- package/dist/components/Calendar/CalendarGrid/CalendarGrid.d.ts +12 -2
- package/dist/components/Calendar/CalendarMenuItem/CalendarMenuItem.d.ts +12 -1
- package/dist/components/Calendar/CalendarMonthMenu/CalendarMonthMenu.d.ts +14 -2
- package/dist/components/Calendar/CalendarMonthMenu/index.js +2 -2
- package/dist/components/Calendar/CalendarMonthMenu/index.js.map +1 -1
- package/dist/components/Calendar/CalendarYearMenu/CalendarYearMenu.d.ts +14 -2
- package/dist/components/Calendar/CalendarYearMenu/index.js.map +1 -1
- package/dist/components/Calendar/RangeCalendar/RangeCalendar.d.ts +40 -2
- package/dist/components/Calendar/RangeCalendar/index.js +19 -15
- package/dist/components/Calendar/RangeCalendar/index.js.map +1 -1
- package/dist/components/Calendar/core/calendar.d.ts +26 -0
- package/dist/components/Calendar/core/useCalendarState.d.ts +15 -0
- package/dist/components/Calendar/index.d.ts +1 -0
- package/dist/components/Calendar/index.js +4 -3
- package/dist/components/Card/Card/Card.d.ts +20 -0
- package/dist/components/Card/Card/types.d.ts +23 -0
- package/dist/components/Card/CardIcon/CardIcon.d.ts +25 -1
- package/dist/components/Decorators/GridBackgroundDecorator/GridBackgroundDecorator.d.ts +46 -7
- package/dist/components/Decorators/RadialGlowDecorator/RadialGlowDecorator.d.ts +53 -6
- package/dist/components/Dialog/ActionDialog/ActionDialog.d.ts +33 -0
- package/dist/components/Dialog/ActionDialog/types.d.ts +28 -2
- package/dist/components/Dialog/Dialog/Dialog.d.ts +32 -1
- package/dist/components/Dialog/Modal/Modal.d.ts +24 -1
- package/dist/components/Dialog/ModalOverlay/ModalOverlay.d.ts +25 -1
- package/dist/components/Dialog/core/context.d.ts +8 -0
- package/dist/components/Dialog/core/index.js.map +1 -1
- package/dist/components/Dialog/core/typography.d.ts +9 -0
- package/dist/components/Disclosure/Disclosure/Disclosure.d.ts +25 -1
- package/dist/components/Disclosure/DisclosureGroup/DisclosureGroup.d.ts +50 -2
- package/dist/components/Disclosure/DisclosureHeader/DisclosureHeader.d.ts +31 -2
- package/dist/components/Disclosure/DisclosurePanel/DisclosurePanel.d.ts +31 -2
- package/dist/components/Disclosure/context/context.d.ts +11 -2
- package/dist/components/Disclosure/context/index.js.map +1 -1
- package/dist/components/Disclosure/context/useDisclosureTypographyContext.d.ts +18 -2
- package/dist/components/Divider/Divider.d.ts +30 -1
- package/dist/components/Icon/Icon.d.ts +29 -0
- package/dist/components/Icon/types.d.ts +28 -0
- package/dist/components/Input/CharacterCount/CharacterCount.d.ts +11 -2
- package/dist/components/Input/CharacterCount/index.js.map +1 -1
- package/dist/components/Input/Checkbox/Checkbox.d.ts +15 -0
- package/dist/components/Input/Checkbox/CheckboxGroup.d.ts +17 -0
- package/dist/components/Input/Checkbox/context.d.ts +10 -2
- package/dist/components/Input/Checkbox/types.d.ts +42 -0
- package/dist/components/Input/DateField/DateField.d.ts +17 -1
- package/dist/components/Input/DateField/index.js.map +1 -1
- package/dist/components/Input/DateField/types.d.ts +4 -0
- package/dist/components/Input/DatePicker/DatePicker/DatePicker.d.ts +17 -1
- package/dist/components/Input/DatePicker/DatePicker/index.js.map +1 -1
- package/dist/components/Input/DatePicker/DatePicker/types.d.ts +10 -0
- package/dist/components/Input/DatePicker/DateRangePicker/DateRangePicker.d.ts +17 -1
- package/dist/components/Input/DatePicker/DateRangePicker/index.js.map +1 -1
- package/dist/components/Input/DatePicker/DateRangePicker/types.d.ts +10 -0
- package/dist/components/Input/DatePicker/core/datePicker.d.ts +3 -0
- package/dist/components/Input/Description/Description.d.ts +12 -1
- package/dist/components/Input/Description/index.js.map +1 -1
- package/dist/components/Input/FieldError/FieldError.d.ts +12 -1
- package/dist/components/Input/Input/Input.d.ts +27 -0
- package/dist/components/Input/Input/InputButton.d.ts +10 -1
- package/dist/components/Input/Input/handleInputButton.d.ts +6 -0
- package/dist/components/Input/Input/types.d.ts +20 -0
- package/dist/components/Input/Label/Label.d.ts +12 -1
- package/dist/components/Input/Label/index.js.map +1 -1
- package/dist/components/Input/Radio/Radio.d.ts +16 -0
- package/dist/components/Input/Radio/RadioGroup.d.ts +17 -0
- package/dist/components/Input/Radio/context.d.ts +10 -2
- package/dist/components/Input/Radio/types.d.ts +40 -0
- package/dist/components/Input/SearchField/SearchField.d.ts +16 -0
- package/dist/components/Input/SearchField/types.d.ts +9 -0
- package/dist/components/Input/Select/ComboBox/ComboBox.d.ts +29 -1
- package/dist/components/Input/Select/ComboBox/context.d.ts +3 -0
- package/dist/components/Input/Select/ComboBox/types.d.ts +9 -0
- package/dist/components/Input/Select/ComboBoxPopover/ComboBoxPopover.d.ts +10 -1
- package/dist/components/Input/Select/ComboBoxTrigger/ComboBoxTrigger.d.ts +10 -2
- package/dist/components/Input/Select/Select/Select.d.ts +29 -1
- package/dist/components/Input/Select/Select/index.js.map +1 -1
- package/dist/components/Input/Select/Select/types.d.ts +4 -0
- package/dist/components/Input/Select/SelectItem/SelectItem.d.ts +19 -0
- package/dist/components/Input/Select/SelectItem/index.js.map +1 -1
- package/dist/components/Input/Select/SelectItem/types.d.ts +9 -0
- package/dist/components/Input/Select/SelectList/SelectList.d.ts +14 -2
- package/dist/components/Input/Select/SelectList/index.js.map +1 -1
- package/dist/components/Input/Select/SelectListSection/SelectListSection.d.ts +4 -1
- package/dist/components/Input/Select/SelectListSection/index.js.map +1 -1
- package/dist/components/Input/Select/SelectListSectionHeader/SelectListSectionHeader.d.ts +3 -0
- package/dist/components/Input/Select/SelectListSectionHeader/index.js.map +1 -1
- package/dist/components/Input/Select/SelectPopover/SelectPopover.d.ts +10 -1
- package/dist/components/Input/Select/SelectTrigger/SelectTrigger.d.ts +10 -1
- package/dist/components/Input/Slider/CenteredSlider/CenteredSlider.d.ts +23 -1
- package/dist/components/Input/Slider/CenteredSlider/types.d.ts +6 -0
- package/dist/components/Input/Slider/RangeSlider/RangeSlider.d.ts +24 -1
- package/dist/components/Input/Slider/RangeSlider/index.js.map +1 -1
- package/dist/components/Input/Slider/RangeSlider/types.d.ts +9 -0
- package/dist/components/Input/Slider/Slider/Slider.d.ts +24 -1
- package/dist/components/Input/Slider/Slider/types.d.ts +13 -0
- package/dist/components/Input/Slider/SliderOutput/SliderOutput.d.ts +19 -1
- package/dist/components/Input/Slider/SliderStops/SliderStops.d.ts +18 -0
- package/dist/components/Input/Slider/SliderStops/core.d.ts +54 -10
- package/dist/components/Input/Slider/SliderStops/types.d.ts +38 -0
- package/dist/components/Input/Slider/SliderThumb/SliderThumb.d.ts +32 -2
- package/dist/components/Input/Slider/SliderThumb/context.d.ts +20 -0
- package/dist/components/Input/Slider/core/color.d.ts +1 -0
- package/dist/components/Input/Slider/core/size.d.ts +12 -0
- package/dist/components/Input/Slider/core/slider.d.ts +44 -0
- package/dist/components/Input/Slider/core/variant.d.ts +10 -0
- package/dist/components/Input/Switch/Switch.d.ts +15 -0
- package/dist/components/Input/Switch/types.d.ts +33 -0
- package/dist/components/Input/TextArea/TextArea.d.ts +19 -0
- package/dist/components/Input/TextArea/index.js.map +1 -1
- package/dist/components/Input/TextArea/types.d.ts +11 -0
- package/dist/components/Input/TimeField/TimeField.d.ts +17 -1
- package/dist/components/Input/TimeField/index.js.map +1 -1
- package/dist/components/Input/TimeField/types.d.ts +4 -0
- package/dist/components/Input/core/input.d.ts +15 -0
- package/dist/components/Input/core/textField.d.ts +13 -0
- package/dist/components/Input/hooks/index.js.map +1 -1
- package/dist/components/Input/hooks/useControllableState.d.ts +17 -2
- package/dist/components/List/ListAction/ListAction.d.ts +23 -1
- package/dist/components/List/ListAction/index.d.ts +1 -1
- package/dist/components/List/ListAction/index.js +2 -0
- package/dist/components/List/ListAvatar/ListAvatar.d.ts +23 -1
- package/dist/components/List/ListBox/ListBox.d.ts +28 -1
- package/dist/components/List/ListBox/types.d.ts +15 -0
- package/dist/components/List/ListIcon/ListIcon.d.ts +19 -1
- package/dist/components/List/ListItem/ListItem.d.ts +34 -0
- package/dist/components/List/ListItem/types.d.ts +21 -0
- package/dist/components/List/ListLabelText/ListLabelText.d.ts +16 -1
- package/dist/components/List/ListMedia/ListMedia.d.ts +20 -0
- package/dist/components/List/ListMedia/types.d.ts +32 -0
- package/dist/components/List/ListOverlineText/ListOverlineText.d.ts +16 -1
- package/dist/components/List/ListSupportingText/ListSupportingText.d.ts +16 -1
- package/dist/components/List/ListTrailingText/ListTrailingText.d.ts +16 -1
- package/dist/components/List/ListTrailingText/index.d.ts +1 -1
- package/dist/components/List/ListTrailingText/index.js +2 -0
- package/dist/components/List/index.js +11 -9
- package/dist/components/Loader/Loader.d.ts +26 -1
- package/dist/components/Menu/Menu/Menu.d.ts +31 -1
- package/dist/components/Menu/Menu/index.js.map +1 -1
- package/dist/components/Menu/Menu/types.d.ts +18 -0
- package/dist/components/Menu/MenuItem/MenuItem.d.ts +22 -0
- package/dist/components/Menu/MenuItem/index.js.map +1 -1
- package/dist/components/Menu/MenuItem/types.d.ts +24 -0
- package/dist/components/Menu/MenuPopover/MenuPopover.d.ts +21 -1
- package/dist/components/Menu/MenuSection/MenuSection.d.ts +23 -1
- package/dist/components/Menu/MenuSection/index.js.map +1 -1
- package/dist/components/Menu/MenuSectionHeader/MenuSectionHeader.d.ts +16 -1
- package/dist/components/Menu/MenuSectionHeader/index.js.map +1 -1
- package/dist/components/Menu/MenuShortcut/MenuShortcut.d.ts +16 -1
- package/dist/components/Menu/MenuShortcut/index.js.map +1 -1
- package/dist/components/Menu/MenuTrailingText/MenuTrailingText.d.ts +16 -1
- package/dist/components/Menu/MenuTrailingText/index.js.map +1 -1
- package/dist/components/Menu/MenuTrigger/MenuTrigger.d.ts +43 -2
- package/dist/components/Menu/MenuTrigger/index.js.map +1 -1
- package/dist/components/Menu/SubmenuPopover/SubmenuPopover.d.ts +22 -1
- package/dist/components/Menu/context/context.d.ts +13 -0
- package/dist/components/Menu/context/index.js.map +1 -1
- package/dist/components/Menu/context/useMenuConfigContext.d.ts +6 -0
- package/dist/components/Menu/core/color.d.ts +20 -0
- package/dist/components/Menu/core/layout.d.ts +17 -0
- package/dist/components/Menu/core/menu.d.ts +18 -0
- package/dist/components/Navigation/Navigation/Navigation.d.ts +28 -0
- package/dist/components/Navigation/Navigation/navContext.d.ts +19 -0
- package/dist/components/Navigation/Navigation/navRenderingContext.d.ts +16 -0
- package/dist/components/Navigation/Navigation/types.d.ts +28 -0
- package/dist/components/Navigation/NavigationItem/NavigationButton/NavigationButton.d.ts +15 -0
- package/dist/components/Navigation/NavigationItem/NavigationButton/index.js.map +1 -1
- package/dist/components/Navigation/NavigationItem/NavigationButton/types.d.ts +9 -0
- package/dist/components/Navigation/NavigationItem/NavigationItemIconRenderer/NavigationItemIconRenderer.d.ts +21 -2
- package/dist/components/Navigation/NavigationItem/NavigationItemIconRenderer/index.js.map +1 -1
- package/dist/components/Navigation/NavigationItem/NavigationLink/NavigationLink.d.ts +15 -0
- package/dist/components/Navigation/NavigationItem/NavigationLink/index.js.map +1 -1
- package/dist/components/Navigation/NavigationItem/NavigationLink/types.d.ts +5 -0
- package/dist/components/Navigation/NavigationItem/core/navigationItem.d.ts +22 -0
- package/dist/components/Navigation/NavigationScrollContainer/NavigationScrollContainer.d.ts +22 -1
- package/dist/components/Navigation/NavigationSection/NavigationSection/NavigationSection.d.ts +24 -1
- package/dist/components/Navigation/NavigationSection/NavigationSectionLabel/NavigationSectionLabel.d.ts +16 -1
- package/dist/components/Navigation/NavigationState/NavigationState.d.ts +27 -2
- package/dist/components/Navigation/NavigationState/context.d.ts +31 -0
- package/dist/components/Navigation/NavigationState/index.d.ts +1 -0
- package/dist/components/Navigation/NavigationState/index.js.map +1 -1
- package/dist/components/Navigation/NavigationState/types.d.ts +12 -0
- package/dist/components/Navigation/SubNavigation/SubNavigation/SubNavigation.d.ts +35 -2
- package/dist/components/Navigation/SubNavigation/SubNavigation/index.js.map +1 -1
- package/dist/components/Navigation/SubNavigation/SubNavigationTrigger/SubNavigationTrigger.d.ts +40 -2
- package/dist/components/Navigation/SubNavigation/SubNavigationTrigger/index.js.map +1 -1
- package/dist/components/Navigation/core/navLabelContext.d.ts +6 -0
- package/dist/components/Navigation/core/navigation.d.ts +9 -0
- package/dist/components/Navigation/core/navigationInfo.d.ts +19 -0
- package/dist/components/Popover/Popover.d.ts +34 -1
- package/dist/components/Sheets/BottomSheet/BottomSheet.d.ts +40 -2
- package/dist/components/Sheets/BottomSheet/index.d.ts +1 -0
- package/dist/components/Sheets/BottomSheet/types.d.ts +37 -0
- package/dist/components/Sheets/BottomSheetModal/BottomSheetModal.d.ts +34 -0
- package/dist/components/Sheets/BottomSheetModal/context.d.ts +10 -0
- package/dist/components/Sheets/BottomSheetModal/types.d.ts +38 -0
- package/dist/components/Sheets/SideSheet/SideSheet.d.ts +46 -0
- package/dist/components/Sheets/SideSheet/SideSheetDialog.d.ts +43 -0
- package/dist/components/Sheets/SideSheet/types.d.ts +96 -2
- package/dist/components/Sheets/SideSheetModal/SideSheetModal.d.ts +34 -0
- package/dist/components/Sheets/SideSheetModal/context.d.ts +13 -0
- package/dist/components/Sheets/SideSheetModal/types.d.ts +49 -0
- package/dist/components/Sheets/core/layout.d.ts +11 -0
- package/dist/components/Snackbar/SnackbarRegion.d.ts +50 -0
- package/dist/components/Snackbar/context.d.ts +38 -0
- package/dist/components/Snackbar/types.d.ts +69 -0
- package/dist/components/Splash/Splash.d.ts +6 -0
- package/dist/components/Splash/types.d.ts +10 -0
- package/dist/components/Splash/useSplash.d.ts +21 -0
- package/dist/components/Tabs/Tab/Tab.d.ts +33 -2
- package/dist/components/Tabs/TabList/TabList.d.ts +42 -1
- package/dist/components/Tabs/TabPanel/TabPanel.d.ts +28 -1
- package/dist/components/Tabs/TabPanels/TabPanels.d.ts +28 -1
- package/dist/components/Tabs/Tabs/Tabs.d.ts +43 -1
- package/dist/components/Tag/Tag.d.ts +37 -0
- package/dist/components/Tag/core.d.ts +6 -0
- package/dist/components/Tag/types.d.ts +48 -2
- package/dist/components/ThemeSelector/ThemeItem.d.ts +46 -2
- package/dist/components/ThemeSelector/ThemeProvider.d.ts +29 -2
- package/dist/components/ThemeSelector/ThemeSelector.d.ts +24 -0
- package/dist/components/ThemeSelector/core.d.ts +58 -0
- package/dist/components/ThemeSelector/index.d.ts +2 -0
- package/dist/components/ThemeSelector/index.js +2 -2
- package/dist/components/ThemeSelector/types.d.ts +69 -2
- package/dist/components/Toolbar/Toolbar.d.ts +47 -0
- package/dist/components/Toolbar/ToolbarToggleButtonGroup.d.ts +35 -1
- package/dist/components/Toolbar/types.d.ts +60 -0
- package/dist/components/Tooltip/RichTooltip/RichTooltip/RichTooltip.d.ts +56 -1
- package/dist/components/Tooltip/RichTooltip/RichTooltipActions/RichTooltipActions.d.ts +27 -1
- package/dist/components/Tooltip/RichTooltip/RichTooltipInfo/RichTooltipInfo/RichTooltipInfo.d.ts +31 -1
- package/dist/components/Tooltip/RichTooltip/RichTooltipInfo/RichTooltipSubhead/RichTooltipSubhead.d.ts +22 -1
- package/dist/components/Tooltip/RichTooltip/RichTooltipInfo/RichTooltipSubhead/index.js.map +1 -1
- package/dist/components/Tooltip/RichTooltip/RichTooltipInfo/RichTooltipText/RichTooltipText.d.ts +26 -1
- package/dist/components/Tooltip/RichTooltip/RichTooltipInfo/RichTooltipText/index.js.map +1 -1
- package/dist/components/Tooltip/Tooltip/Tooltip.d.ts +35 -1
- package/dist/components/Tooltip/TooltipTrigger/TooltipTrigger.d.ts +29 -1
- package/dist/components/Tooltip/TooltipTrigger/index.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +129 -137
- package/dist/index.js.map +1 -1
- package/dist/utils/gradients/gradients.d.ts +97 -0
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/ref/ref.d.ts +35 -2
- package/dist/utils/scroll/scroll.d.ts +67 -4
- package/dist/utils/tapTarget/tapTarget.d.ts +57 -0
- package/dist/utils/theme/build.d.ts +24 -0
- package/dist/utils/theme/types.d.ts +70 -0
- package/dist/utils/theme/useTheme.d.ts +40 -0
- package/dist/utils/typography/base.d.ts +68 -0
- package/dist/utils/typography/core.d.ts +16 -0
- package/dist/utils/typography/fluid.d.ts +36 -0
- package/package.json +23 -25
- package/dist/chunks/useGlobalListeners +0 -294
- package/dist/chunks/useGlobalListeners.map +0 -1
- package/dist/chunks/usePress +0 -535
- package/dist/chunks/usePress.map +0 -1
- package/dist/components/Image/Image.d.ts +0 -2
- package/dist/components/Image/index.d.ts +0 -2
- package/dist/components/Image/index.js +0 -29
- package/dist/components/Image/index.js.map +0 -1
- package/dist/components/Image/types.d.ts +0 -9
- package/dist/utils/form/form.d.ts +0 -13
- package/dist/utils/form/index.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["renderProps","icon","iconSize","handlePress"],"sources":["../../../../src/components/Button/LinkButton/LinkButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Link } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { LinkButtonProps } from \"./types\";\n\nexport const LinkButton: React.FC<LinkButtonProps> = ({\n size,\n shape,\n color,\n tooltip,\n icon,\n children,\n onPress,\n className,\n iconPlacement,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize, buttonIconPlacement } =\n useButtonConfig({\n size,\n shape,\n color,\n iconPlacement,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n return withTooltip(\n <Link\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...baseButtonDataAttrs}\n data-button\n data-link-button\n >\n {(renderProps) => {\n const {\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n ...baseButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = ButtonIconSizeMapping[buttonSize];\n const iconComp = icon && <Icon icon={icon} size={iconSize} />;\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase,\n ButtonLabelTextMapping[buttonSize]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {buttonIconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {buttonIconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </Link>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["renderProps","icon","iconSize","handlePress","_c","require_compiler_runtime","Icon","Splash","useSplash","buttonSizeConfig","ButtonCore","ButtonReset","ButtonIconSizeMapping","buttonColorBase","useButtonConfig","ButtonSizeBase","withTooltip","buttonColorConfig","import_compiler_runtime","LinkButton","$","children","className","color","icon","iconPlacement","onPress","props","shape","size","tooltip","t0","t1","isChildFunc","t2","buttonColor","buttonShape","buttonSize","newButtonBaseDataAttrs","baseButtonDataAttrs","t3","clsx","TapTarget","renderProps","t4","buttonIconPlacement","splashInfo","renderProps_0","dataAttrs","isHovered","isDisabled","isFocused","isFocusVisible","isPressed","iconSize","iconComp","ButtonLabelTextMapping","t5","handlePress","Link","t6"],"sources":["../../../../src/components/Button/LinkButton/LinkButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Link } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { LinkButtonProps } from \"./types\";\n\n/**\n * A link component styled to look and behave like a Material Design 3 button.\n *\n * Used for navigation actions that should visually appear as standard buttons.\n * Renders an accessible anchor element underneath via React Aria's `Link`,\n * supporting native link behaviors (`href`, `target`, `rel`), keyboard activation,\n * ripple splash animations, icons, and tooltips.\n *\n * @example\n * ```tsx\n * <LinkButton href=\"https://example.com\" target=\"_blank\" icon={ExternalLink} iconPlacement=\"end\">\n * Visit Website\n * </LinkButton>\n * ```\n */\nexport const LinkButton: React.FC<LinkButtonProps> = ({\n size,\n shape,\n color,\n tooltip,\n icon,\n children,\n onPress,\n className,\n iconPlacement,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize, buttonIconPlacement } =\n useButtonConfig({\n size,\n shape,\n color,\n iconPlacement,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n return withTooltip(\n <Link\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...baseButtonDataAttrs}\n data-button\n data-link-button\n >\n {(renderProps) => {\n const {\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n ...baseButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = ButtonIconSizeMapping[buttonSize];\n const iconComp = icon && <Icon icon={icon} size={iconSize} />;\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase,\n ButtonLabelTextMapping[buttonSize]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {buttonIconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {buttonIconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </Link>,\n tooltip\n );\n};\n"],"mappings":"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"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Link } from 'react-aria-components';
|
|
2
2
|
import { ButtonBaseProps } from '../core';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the {@link LinkButton} component.
|
|
5
|
+
* Combines React Aria's {@link Link} props with shared {@link ButtonBaseProps}.
|
|
6
|
+
*/
|
|
3
7
|
export interface LinkButtonProps extends React.ComponentPropsWithRef<typeof Link>, ButtonBaseProps {
|
|
4
8
|
}
|
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
import { LinkIconButtonProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A link component styled as a compact Material Design 3 icon button.
|
|
4
|
+
*
|
|
5
|
+
* Used for icon-only navigation actions (such as external social links, repository links,
|
|
6
|
+
* or compact icon navigation). Built on top of React Aria's `Link`.
|
|
7
|
+
*
|
|
8
|
+
* Always provide an accessible `aria-label` or `aria-labelledby` attribute for screen reader accessibility.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <LinkIconButton
|
|
13
|
+
* href="https://github.com"
|
|
14
|
+
* target="_blank"
|
|
15
|
+
* icon={Github}
|
|
16
|
+
* tooltip="GitHub Profile"
|
|
17
|
+
* aria-label="GitHub Profile"
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
2
21
|
export declare const LinkIconButton: React.FC<LinkIconButtonProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Button/LinkIconButton/LinkIconButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Link } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n IconButtonIconSizeMapping,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { LinkIconButtonProps } from \"./types\";\n\nexport const LinkIconButton: React.FC<LinkIconButtonProps> = ({\n size,\n shape,\n color,\n width = \"default\",\n tooltip,\n icon,\n onPress,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize } = useButtonConfig({\n size,\n shape,\n color,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const iconButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-width\": width,\n \"data-icon-button\": true,\n };\n\n return withTooltip(\n <Link\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...iconButtonDataAttrs}\n data-button\n data-link-button\n >\n {({\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n }) => {\n const dataAttrs = {\n ...iconButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = IconButtonIconSizeMapping[buttonSize];\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n {icon && <Icon icon={icon} size={iconSize} />}\n </span>\n );\n }}\n </Link>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["TapTarget","useSplash","buttonSizeConfig","ButtonCore","ButtonReset","buttonColorBase","useButtonConfig","ButtonSizeBase","newButtonBaseDataAttrs","IconButtonIconSizeMapping","withTooltip","buttonColorConfig","LinkIconButton","props","onPress","iconButtonDataAttrs","buttonShape","buttonSize","buttonColor","width","Link","handlePress","clsx","className","renderProps","dataAttrs","isHovered","isDisabled","isFocused","isFocusVisible","isPressed","iconSize","splashInfo","Splash","icon","Icon","tooltip"],"sources":["../../../../src/components/Button/LinkIconButton/LinkIconButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Link } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n IconButtonIconSizeMapping,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { LinkIconButtonProps } from \"./types\";\n\n/**\n * A link component styled as a compact Material Design 3 icon button.\n *\n * Used for icon-only navigation actions (such as external social links, repository links,\n * or compact icon navigation). Built on top of React Aria's `Link`.\n *\n * Always provide an accessible `aria-label` or `aria-labelledby` attribute for screen reader accessibility.\n *\n * @example\n * ```tsx\n * <LinkIconButton\n * href=\"https://github.com\"\n * target=\"_blank\"\n * icon={Github}\n * tooltip=\"GitHub Profile\"\n * aria-label=\"GitHub Profile\"\n * />\n * ```\n */\nexport const LinkIconButton: React.FC<LinkIconButtonProps> = ({\n size,\n shape,\n color,\n width = \"default\",\n tooltip,\n icon,\n onPress,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize } = useButtonConfig({\n size,\n shape,\n color,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const iconButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-width\": width,\n \"data-icon-button\": true,\n };\n\n return withTooltip(\n <Link\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...iconButtonDataAttrs}\n data-button\n data-link-button\n >\n {({\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n }) => {\n const dataAttrs = {\n ...iconButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = IconButtonIconSizeMapping[buttonSize];\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n {icon && <Icon icon={icon} size={iconSize} />}\n </span>\n );\n }}\n </Link>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;AAuCA,IAAaY,KAAiD,EAC1D,SACA,UACA,UACA,WAAQ,WACR,YACA,SACA,YACA,cACA,GAAGC,QACD;CACF,IAAM,EAAE,gBAAa,gBAAa,kBAAeP,EAAgB;EAC7D;EACA;EACA;CACJ,CAAC,GAEK,EAAE,eAAY,mBAAgBL,EAAUa,CAAO,GAQ/CC,IAAsB;EACxB,GAPwBP,EAAuB;GAC/C,OAAOQ;GACP,MAAMC;GACN,OAAOC;EACX,CAGO;EACH,cAAcC;EACd,oBAAoB;CACxB;CAEA,OAAOT,EACH,kBAACU,GAAD;EACI,SAASC;EACT,YAAY,MACRC,EACIlB,GACAJ,GACAE,EAAiBe,CAAU,GAC3BN,EAAkBO,CAAW,GAC7B,OAAOK,KAAc,aACfA,EAAUC,CAAW,IACrBD,CACV;EAEJ,GAAIV;EACJ,GAAIE;EACJ,eAAA;EACA,oBAAA;EAEE,WAAA,EACE,eACA,mBACA,cACA,cACA,mBACE;GACF,IAAMU,IAAY;IACd,GAAGV;IACH,gBAAgBW,KAAa,KAAA;IAC7B,iBAAiBC,KAAc,KAAA;IAC/B,gBAAgBC,KAAa,KAAA;IAC7B,sBAAsBC,KAAkB,KAAA;IACxC,gBAAgBC,KAAa,KAAA;IAC7B,sBAAsB;GAC1B,GAEMC,IAAWtB,EAA0BQ;GAC3C,OACI,kBAAC,QAAD;IACI,WAAWK,EACPnB,GACAE,GACAE,CACJ;IACA,GAAIkB;IANR,UAAA,CAQKO,KAAc,kBAACC,GAAD,EAAQ,GAAID,EAAW,CAAA,GACrCE,KAAQ,kBAACC,GAAD;KAAY;KAAM,MAAMJ;IAAS,CAAA,CACxC;;EAEd;CACE,CAAA,GACNK,CACJ;AACJ"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Link } from 'react-aria-components';
|
|
2
2
|
import { IconButtonBaseProps } from '../core';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the {@link LinkIconButton} component.
|
|
5
|
+
* Combines React Aria's {@link Link} props (omitting `children`) with {@link IconButtonBaseProps}.
|
|
6
|
+
*/
|
|
3
7
|
export interface LinkIconButtonProps extends Omit<React.ComponentPropsWithRef<typeof Link>, "children">, IconButtonBaseProps {
|
|
4
8
|
}
|
|
@@ -1,2 +1,26 @@
|
|
|
1
1
|
import { SplitButtonProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A composite button container implementing Material Design 3 Split Buttons.
|
|
4
|
+
*
|
|
5
|
+
* Couples a primary action button ({@link SplitButtonPrimary}) with an adjacent dropdown menu trigger
|
|
6
|
+
* ({@link SplitButtonTrigger}) inside an accessible React Aria `Toolbar`.
|
|
7
|
+
* Synchronizes size, color variant, disabled, and pending states across both button parts via context.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <SplitButton color="tonal">
|
|
12
|
+
* <SplitButtonPrimary icon={Save} onPress={handleSave}>
|
|
13
|
+
* Save
|
|
14
|
+
* </SplitButtonPrimary>
|
|
15
|
+
* <MenuTrigger>
|
|
16
|
+
* <SplitButtonTrigger aria-label="More save options" />
|
|
17
|
+
* <MenuPopover>
|
|
18
|
+
* <Menu>
|
|
19
|
+
* <MenuItem label="Save as draft" />
|
|
20
|
+
* </Menu>
|
|
21
|
+
* </MenuPopover>
|
|
22
|
+
* </MenuTrigger>
|
|
23
|
+
* </SplitButton>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
2
26
|
export declare const SplitButton: React.FC<SplitButtonProps>;
|
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { Toolbar } from 'react-aria-components';
|
|
3
3
|
import { ButtonSize, SplitButtonColor } from '../../core';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the {@link SplitButton} container component.
|
|
6
|
+
* Extends React Aria's {@link Toolbar} props with split button styling and shared state.
|
|
7
|
+
*/
|
|
4
8
|
export interface SplitButtonProps extends Omit<React.ComponentPropsWithRef<typeof Toolbar>, "orientation" | "children" | "className" | "style"> {
|
|
9
|
+
/**
|
|
10
|
+
* Visual color style variant applied to both primary and trigger buttons.
|
|
11
|
+
*
|
|
12
|
+
* @default "filled"
|
|
13
|
+
*/
|
|
5
14
|
color?: SplitButtonColor;
|
|
15
|
+
/**
|
|
16
|
+
* Size preset applied to both primary and trigger buttons.
|
|
17
|
+
*
|
|
18
|
+
* @default "small"
|
|
19
|
+
*/
|
|
6
20
|
size?: ButtonSize;
|
|
21
|
+
/**
|
|
22
|
+
* Global loading state applied to both primary and trigger buttons.
|
|
23
|
+
*/
|
|
7
24
|
isPending?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Global disabled state applied to both primary and trigger buttons.
|
|
27
|
+
*/
|
|
8
28
|
isDisabled?: boolean;
|
|
29
|
+
/** Primary button and menu trigger components. */
|
|
9
30
|
children?: ReactNode;
|
|
31
|
+
/** Optional CSS class name for the container element. */
|
|
10
32
|
className?: string;
|
|
33
|
+
/** Optional inline styles for the container element. */
|
|
11
34
|
style?: CSSProperties;
|
|
12
35
|
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import { ButtonSize, SplitButtonColor } from '../../core';
|
|
2
|
+
/**
|
|
3
|
+
* Context state shared across all components of a {@link SplitButton}.
|
|
4
|
+
*/
|
|
2
5
|
export type SplitButtonState = {
|
|
6
|
+
/** Whether both primary action and trigger buttons are currently in a pending state. */
|
|
3
7
|
isPending?: boolean;
|
|
8
|
+
/** Whether both primary action and trigger buttons are currently disabled. */
|
|
4
9
|
isDisabled?: boolean;
|
|
10
|
+
/** Uniform size preset for the split button pair. */
|
|
5
11
|
size: ButtonSize;
|
|
12
|
+
/** Visual color style variant applied to both split button parts. */
|
|
6
13
|
color: SplitButtonColor;
|
|
7
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* React Context providing size, color, pending, and disabled state from
|
|
17
|
+
* a parent `SplitButton` container to `SplitButtonPrimary` and `SplitButtonTrigger`.
|
|
18
|
+
*/
|
|
8
19
|
export declare const SplitButtonContext: import('react').Context<SplitButtonState>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Button/SplitButton/SplitButtonContext/context.ts","../../../../../src/components/Button/SplitButton/SplitButtonContext/useSplitButtonContext.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type { ButtonSize, SplitButtonColor } from \"../../core\";\n\nexport type SplitButtonState = {\n isPending?: boolean;\n isDisabled?: boolean;\n\n size: ButtonSize;\n color: SplitButtonColor;\n};\n\nexport const SplitButtonContext = createContext<SplitButtonState>({\n size: \"small\",\n color: \"filled\",\n});\n","import { useContext } from \"react\";\nimport { SplitButtonContext } from \"./context\";\n\nexport function useSplitButtonContext() {\n return useContext(SplitButtonContext);\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","names":["SplitButtonContext","createContext","useSplitButtonContext","useContext"],"sources":["../../../../../src/components/Button/SplitButton/SplitButtonContext/context.ts","../../../../../src/components/Button/SplitButton/SplitButtonContext/useSplitButtonContext.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type { ButtonSize, SplitButtonColor } from \"../../core\";\n\n/**\n * Context state shared across all components of a {@link SplitButton}.\n */\nexport type SplitButtonState = {\n /** Whether both primary action and trigger buttons are currently in a pending state. */\n isPending?: boolean;\n /** Whether both primary action and trigger buttons are currently disabled. */\n isDisabled?: boolean;\n\n /** Uniform size preset for the split button pair. */\n size: ButtonSize;\n /** Visual color style variant applied to both split button parts. */\n color: SplitButtonColor;\n};\n\n/**\n * React Context providing size, color, pending, and disabled state from\n * a parent `SplitButton` container to `SplitButtonPrimary` and `SplitButtonTrigger`.\n */\nexport const SplitButtonContext = createContext<SplitButtonState>({\n size: \"small\",\n color: \"filled\",\n});\n","import { useContext } from \"react\";\nimport { SplitButtonContext } from \"./context\";\n\n/**\n * Accesses the enclosing {@link SplitButtonContext} state.\n *\n * @returns The configuration and state provided by the nearest parent `SplitButton`. Defaults to small/filled if unnested.\n */\nexport function useSplitButtonContext() {\n return useContext(SplitButtonContext);\n}\n"],"mappings":";;AAsBA,IAAaA,IAAqBC,EAAgC;CAC9D,MAAM;CACN,OAAO;AACX,CAAC;;;ACjBD,SAAOC,IAAA;CAAA,OACIC,EAAWH,CAAkB;AAAC"}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accesses the enclosing {@link SplitButtonContext} state.
|
|
3
|
+
*
|
|
4
|
+
* @returns The configuration and state provided by the nearest parent `SplitButton`. Defaults to small/filled if unnested.
|
|
5
|
+
*/
|
|
1
6
|
export declare function useSplitButtonContext(): import('./context').SplitButtonState;
|
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
import { SplitButtonPrimaryProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* The primary action button within a {@link SplitButton}.
|
|
4
|
+
*
|
|
5
|
+
* Inherits visual styling (size and color) and states (disabled, pending)
|
|
6
|
+
* from the parent `SplitButtonContext`.
|
|
7
|
+
* Extends React Aria's `Button` and supports ripple splash animations, icons,
|
|
8
|
+
* loading spinner substitution when pending, and tooltips.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <SplitButtonPrimary icon={Save} onPress={() => handleSave()}>
|
|
13
|
+
* Save
|
|
14
|
+
* </SplitButtonPrimary>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
2
17
|
export declare const SplitButtonPrimary: React.FC<SplitButtonPrimaryProps>;
|
|
@@ -10,10 +10,10 @@ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
|
10
10
|
import { Button as v } from "react-aria-components";
|
|
11
11
|
//#region src/components/Button/SplitButton/SplitButtonPrimary/SplitButtonPrimary.tsx
|
|
12
12
|
var y = ({ tooltip: y, icon: b, children: x, onPress: S, isDisabled: C, isPending: w, className: T, iconPlacement: E = "start", ...D }) => {
|
|
13
|
-
let O = m(), { splashInfo: k, handlePress: A } = i(S), j = typeof x == "function", M = w || O.isPending;
|
|
13
|
+
let O = m(), { splashInfo: k, handlePress: A } = i(S), j = typeof x == "function", M = w || O.isPending, N = C || O.isDisabled;
|
|
14
14
|
return u(/* @__PURE__ */ g(v, {
|
|
15
15
|
onPress: A,
|
|
16
|
-
isDisabled:
|
|
16
|
+
isDisabled: N,
|
|
17
17
|
isPending: M,
|
|
18
18
|
...D,
|
|
19
19
|
className: (t) => h(s, e, p, d(O.color), typeof T == "function" ? T(t) : T),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["renderProps","isDisabled"],"sources":["../../../../../src/components/Button/SplitButton/SplitButtonPrimary/SplitButtonPrimary.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Button as AriaButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Loader } from \"@/components/Loader\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n buttonColorBase,\n buttonColorConfig,\n withTooltip,\n} from \"../../core\";\nimport { SplitButtonPrimaryBase, SplitButtonVariantBase } from \"../core\";\nimport { useSplitButtonContext } from \"../SplitButtonContext\";\nimport type { SplitButtonPrimaryProps } from \"./types\";\n\nexport const SplitButtonPrimary: React.FC<SplitButtonPrimaryProps> = ({\n tooltip,\n icon,\n children,\n onPress,\n isDisabled,\n isPending,\n className,\n iconPlacement = \"start\",\n ...props\n}) => {\n const splitButtonState = useSplitButtonContext();\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const pending = isPending || splitButtonState.isPending;\n const disabled = isDisabled || splitButtonState.isDisabled;\n\n return withTooltip(\n <AriaButton\n onPress={handlePress}\n isDisabled={disabled}\n isPending={pending}\n {...props}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n SplitButtonPrimaryBase,\n buttonColorConfig(splitButtonState.color),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n data-button\n data-split-button-primary\n >\n {(renderProps) => {\n const {\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = ButtonIconSizeMapping[splitButtonState.size];\n const iconComp = renderProps.isPending ? (\n <Loader size={iconSize} />\n ) : (\n icon && <Icon icon={icon} size={iconSize} />\n );\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n SplitButtonVariantBase,\n ButtonLabelTextMapping[splitButtonState.size]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {iconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {iconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </AriaButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["renderProps","isDisabled","AriaButton","TapTarget","Loader","Splash","useSplash","ButtonCore","ButtonReset","ButtonIconSizeMapping","withTooltip","buttonColorConfig","SplitButtonVariantBase","SplitButtonPrimaryBase","SplitButtonPrimary","props","splitButtonState","useSplitButtonContext","onPress","isChildFunc","children","pending","isPending","disabled","isDisabled","Button","handlePress","clsx","className","renderProps","isDisabled_0","renderProps_0","dataAttrs","isHovered","isFocused","isFocusVisible","isPressed","iconSize","iconComp","icon","Icon","buttonColorBase","ButtonLabelTextMapping","splashInfo","iconPlacement","tooltip"],"sources":["../../../../../src/components/Button/SplitButton/SplitButtonPrimary/SplitButtonPrimary.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { Button as AriaButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Loader } from \"@/components/Loader\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n buttonColorBase,\n buttonColorConfig,\n withTooltip,\n} from \"../../core\";\nimport { SplitButtonPrimaryBase, SplitButtonVariantBase } from \"../core\";\nimport { useSplitButtonContext } from \"../SplitButtonContext\";\nimport type { SplitButtonPrimaryProps } from \"./types\";\n\n/**\n * The primary action button within a {@link SplitButton}.\n *\n * Inherits visual styling (size and color) and states (disabled, pending)\n * from the parent `SplitButtonContext`.\n * Extends React Aria's `Button` and supports ripple splash animations, icons,\n * loading spinner substitution when pending, and tooltips.\n *\n * @example\n * ```tsx\n * <SplitButtonPrimary icon={Save} onPress={() => handleSave()}>\n * Save\n * </SplitButtonPrimary>\n * ```\n */\nexport const SplitButtonPrimary: React.FC<SplitButtonPrimaryProps> = ({\n tooltip,\n icon,\n children,\n onPress,\n isDisabled,\n isPending,\n className,\n iconPlacement = \"start\",\n ...props\n}) => {\n const splitButtonState = useSplitButtonContext();\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const pending = isPending || splitButtonState.isPending;\n const disabled = isDisabled || splitButtonState.isDisabled;\n\n return withTooltip(\n <AriaButton\n onPress={handlePress}\n isDisabled={disabled}\n isPending={pending}\n {...props}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n SplitButtonPrimaryBase,\n buttonColorConfig(splitButtonState.color),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n data-button\n data-split-button-primary\n >\n {(renderProps) => {\n const {\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-visual-button\": true,\n };\n\n const iconSize = ButtonIconSizeMapping[splitButtonState.size];\n const iconComp = renderProps.isPending ? (\n <Loader size={iconSize} />\n ) : (\n icon && <Icon icon={icon} size={iconSize} />\n );\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n SplitButtonVariantBase,\n ButtonLabelTextMapping[splitButtonState.size]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {iconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {iconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </AriaButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;;;;AAmCA,IAAac,KAAyD,EAClE,YACA,SACA,aACA,YACA,eACA,cACA,cACA,mBAAgB,SAChB,GAAGC,QACD;CACF,IAAMC,IAAmBC,EAAsB,GAEzC,EAAE,eAAY,mBAAgBX,EAAUY,CAAO,GAC/CC,IAAc,OAAOC,KAAa,YAElCC,IAAUC,KAAaN,EAAiB,WACxCO,IAAWC,KAAcR,EAAiB;CAEhD,OAAON,EACH,kBAACR,GAAD;EACI,SAASwB;EACT,YAAYH;EACZ,WAAWF;EACX,GAAIN;EACJ,YAAY,MACRY,EACInB,GACAL,GACAU,GACAF,EAAkBK,EAAiB,KAAK,GACxC,OAAOY,KAAc,aACfA,EAAUC,CAAW,IACrBD,CACV;EAEJ,eAAA;EACA,6BAAA;EAEE5B,WAAAA,MAAgB;GACd,IAAM,EACF,YAAAC,GACA,mBACA,cACA,cACA,iBACAD,GAEEgC,IAAY;IACd,gBAAgBC,KAAa,KAAA;IAC7B,iBAAiBhC,KAAc,KAAA;IAC/B,gBAAgBiC,KAAa,KAAA;IAC7B,sBAAsBC,KAAkB,KAAA;IACxC,gBAAgBC,KAAa,KAAA;IAC7B,sBAAsB;GAC1B,GAEMC,IAAW5B,EAAsBO,EAAiB,OAClDsB,IAAWtC,EAAY,YACzB,kBAACI,GAAD,EAAQ,MAAMiC,EAAS,CAAA,IAEvBE,KAAQ,kBAACC,GAAD;IAAY;IAAM,MAAMH;GAAS,CAAA;GAG7C,OACI,kBAAC,QAAD;IACI,WAAWV,EACPpB,GACAkC,GACA7B,GACA8B,EAAuB1B,EAAiB,KAC5C;IACA,GAAIgB;IAPR,UAAA;KASKW,KAAc,kBAACtC,GAAD,EAAQ,GAAIsC,EAAW,CAAA;KAErCC,MAAkB,WAAWN;KAE7BnB,IAAcC,EAASpB,CAAW,IAAIoB;KAEtCwB,MAAkB,SAASN;IAC1B;;EAEd;CACQ,CAAA,GACZO,CACJ;AACJ"}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { LucideIcon } from 'lucide-react';
|
|
2
2
|
import { Button } from 'react-aria-components';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the {@link SplitButtonPrimary} component.
|
|
5
|
+
* Extends React Aria's {@link Button} props with tooltip, icon, and icon placement.
|
|
6
|
+
*/
|
|
3
7
|
export interface SplitButtonPrimaryProps extends React.ComponentPropsWithRef<typeof Button> {
|
|
8
|
+
/** Optional tooltip text displayed on hover. */
|
|
4
9
|
tooltip?: string;
|
|
10
|
+
/** An optional icon to display within the button. */
|
|
5
11
|
icon?: LucideIcon;
|
|
12
|
+
/**
|
|
13
|
+
* The position of the icon relative to the text.
|
|
14
|
+
*
|
|
15
|
+
* @default "start"
|
|
16
|
+
*/
|
|
6
17
|
iconPlacement?: "start" | "end";
|
|
7
18
|
}
|
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
import { SplitButtonTriggerProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* The dropdown menu trigger button within a {@link SplitButton}.
|
|
4
|
+
*
|
|
5
|
+
* Renders a chevron icon indicating that more actions are available in an adjacent menu.
|
|
6
|
+
* Inherits visual styling (size and color) and states (disabled, pending) from the parent `SplitButtonContext`.
|
|
7
|
+
* Typically wrapped inside a `MenuTrigger` component alongside a `MenuPopover`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <MenuTrigger>
|
|
12
|
+
* <SplitButtonTrigger aria-label="More options" />
|
|
13
|
+
* <MenuPopover>
|
|
14
|
+
* <Menu>
|
|
15
|
+
* <MenuItem label="Export" />
|
|
16
|
+
* </Menu>
|
|
17
|
+
* </MenuPopover>
|
|
18
|
+
* </MenuTrigger>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
2
21
|
export declare const SplitButtonTrigger: React.FC<SplitButtonTriggerProps>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Button } from 'react-aria-components';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the {@link SplitButtonTrigger} component.
|
|
4
|
+
* Extends React Aria's {@link Button} props (omitting `children`) with tooltip support.
|
|
5
|
+
*/
|
|
2
6
|
export interface SplitButtonTriggerProps extends Omit<React.ComponentPropsWithRef<typeof Button>, "children"> {
|
|
7
|
+
/** Optional tooltip text displayed on hover. */
|
|
3
8
|
tooltip?: string;
|
|
4
9
|
}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { ButtonSize } from '../../core';
|
|
2
|
+
/**
|
|
3
|
+
* Maps each {@link ButtonSize} preset to its corresponding chevron icon size in pixels
|
|
4
|
+
* for {@link SplitButtonTrigger}.
|
|
5
|
+
*/
|
|
2
6
|
export declare const SplitButtonTriggerIconSize: Record<ButtonSize, number>;
|
|
7
|
+
/**
|
|
8
|
+
* Resolves the CSS module class name for a given split button size preset.
|
|
9
|
+
*
|
|
10
|
+
* @param size - The button size preset.
|
|
11
|
+
* @returns The CSS module class name for the split button container size.
|
|
12
|
+
*/
|
|
3
13
|
export declare const splitButtonSizeConfig: (size: ButtonSize) => string;
|
|
14
|
+
/** Base CSS module class name for split button container sizing. */
|
|
4
15
|
export declare const SplitButtonVariantBase: string;
|
|
16
|
+
/** Base CSS module class name for the primary action button part of a split button. */
|
|
5
17
|
export declare const SplitButtonPrimaryBase: string;
|
|
18
|
+
/** Base CSS module class name for the menu trigger button part of a split button. */
|
|
6
19
|
export declare const SplitButtonTriggerBase: string;
|
|
@@ -1,2 +1,23 @@
|
|
|
1
1
|
import { ToggleButtonProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A two-state toggle button implementing Material Design 3 Toggle Button guidelines.
|
|
4
|
+
*
|
|
5
|
+
* Allows users to toggle between active/selected and inactive/unselected states.
|
|
6
|
+
* Supports swapping between `icon` and `selectedIcon` based on current selection state,
|
|
7
|
+
* flexible sizing, shapes, and Material 3 toggle button color variants.
|
|
8
|
+
*
|
|
9
|
+
* Built on top of React Aria's `ToggleButton`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <ToggleButton
|
|
14
|
+
* icon={Bookmark}
|
|
15
|
+
* selectedIcon={BookmarkCheck}
|
|
16
|
+
* isSelected={isBookmarked}
|
|
17
|
+
* onChange={setIsBookmarked}
|
|
18
|
+
* >
|
|
19
|
+
* Bookmark
|
|
20
|
+
* </ToggleButton>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
2
23
|
export declare const ToggleButton: React.FC<ToggleButtonProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["renderProps","iconToRender","iconSize","handlePress"],"sources":["../../../../src/components/Button/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { ToggleButton as AriaToggleButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { ToggleButtonProps } from \"./types\";\n\nexport const ToggleButton: React.FC<ToggleButtonProps> = ({\n size,\n shape,\n color,\n tooltip,\n selectedIcon,\n icon,\n children,\n onPress,\n className,\n iconPlacement,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize, buttonIconPlacement } =\n useButtonConfig({\n size,\n shape,\n color,\n iconPlacement,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const toggleButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-toggle-button\": true,\n };\n\n return withTooltip(\n <AriaToggleButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...toggleButtonDataAttrs}\n data-button\n >\n {(renderProps) => {\n const {\n isSelected,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n ...toggleButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-visual-button\": true,\n };\n\n let iconToRender = icon;\n if (isSelected && selectedIcon) iconToRender = selectedIcon;\n\n const iconSize = ButtonIconSizeMapping[buttonSize];\n\n const iconComp = iconToRender && (\n <Icon icon={iconToRender} size={iconSize} />\n );\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase,\n ButtonLabelTextMapping[buttonSize]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {buttonIconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {buttonIconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </AriaToggleButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["renderProps","iconToRender","iconSize","handlePress","_c","AriaToggleButton","require_compiler_runtime","Icon","Splash","useSplash","buttonSizeConfig","ButtonCore","ButtonReset","ButtonIconSizeMapping","buttonColorBase","useButtonConfig","ButtonSizeBase","withTooltip","buttonColorConfig","ToggleButton$1","import_compiler_runtime","ToggleButton","$","children","className","color","icon","iconPlacement","onPress","props","selectedIcon","shape","size","tooltip","t0","t1","isChildFunc","t2","buttonColor","buttonShape","buttonSize","newButtonBaseDataAttrs","baseButtonDataAttrs","t3","toggleButtonDataAttrs","t4","clsx","TapTarget","renderProps","t5","buttonIconPlacement","splashInfo","renderProps_0","dataAttrs","isHovered","isDisabled","isFocused","isFocusVisible","isPressed","isSelected","iconToRender","iconSize","iconComp","ButtonLabelTextMapping","t6","handlePress","t7"],"sources":["../../../../src/components/Button/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { ToggleButton as AriaToggleButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonIconSizeMapping,\n ButtonLabelTextMapping,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { ToggleButtonProps } from \"./types\";\n\n/**\n * A two-state toggle button implementing Material Design 3 Toggle Button guidelines.\n *\n * Allows users to toggle between active/selected and inactive/unselected states.\n * Supports swapping between `icon` and `selectedIcon` based on current selection state,\n * flexible sizing, shapes, and Material 3 toggle button color variants.\n *\n * Built on top of React Aria's `ToggleButton`.\n *\n * @example\n * ```tsx\n * <ToggleButton\n * icon={Bookmark}\n * selectedIcon={BookmarkCheck}\n * isSelected={isBookmarked}\n * onChange={setIsBookmarked}\n * >\n * Bookmark\n * </ToggleButton>\n * ```\n */\nexport const ToggleButton: React.FC<ToggleButtonProps> = ({\n size,\n shape,\n color,\n tooltip,\n selectedIcon,\n icon,\n children,\n onPress,\n className,\n iconPlacement,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize, buttonIconPlacement } =\n useButtonConfig({\n size,\n shape,\n color,\n iconPlacement,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n const isChildFunc = typeof children === \"function\";\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const toggleButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-toggle-button\": true,\n };\n\n return withTooltip(\n <AriaToggleButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...toggleButtonDataAttrs}\n data-button\n >\n {(renderProps) => {\n const {\n isSelected,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n } = renderProps;\n\n const dataAttrs = {\n ...toggleButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-visual-button\": true,\n };\n\n let iconToRender = icon;\n if (isSelected && selectedIcon) iconToRender = selectedIcon;\n\n const iconSize = ButtonIconSizeMapping[buttonSize];\n\n const iconComp = iconToRender && (\n <Icon icon={iconToRender} size={iconSize} />\n );\n\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase,\n ButtonLabelTextMapping[buttonSize]\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {buttonIconPlacement === \"start\" && iconComp}\n\n {isChildFunc ? children(renderProps) : children}\n\n {buttonIconPlacement === \"end\" && iconComp}\n </span>\n );\n }}\n </AriaToggleButton>,\n tooltip\n );\n};\n"],"mappings":"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"}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { LucideIcon } from 'lucide-react';
|
|
2
2
|
import { ToggleButton } from 'react-aria-components';
|
|
3
3
|
import { ButtonBaseProps, ToggleButtonColor } from '../core';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the {@link ToggleButton} component.
|
|
6
|
+
* Extends React Aria's {@link ToggleButton} props with customized color options and toggle state icon support.
|
|
7
|
+
*/
|
|
4
8
|
export interface ToggleButtonProps extends React.ComponentPropsWithRef<typeof ToggleButton>, Omit<ButtonBaseProps, "color"> {
|
|
9
|
+
/**
|
|
10
|
+
* Optional icon to render when the toggle button is in the selected (`isSelected = true`) state.
|
|
11
|
+
* If omitted, {@link ButtonBaseProps.icon} is used for both selected and unselected states.
|
|
12
|
+
*/
|
|
5
13
|
selectedIcon?: LucideIcon;
|
|
14
|
+
/**
|
|
15
|
+
* Visual color style variant for the toggle button.
|
|
16
|
+
* Note: Does not include `"text"` since toggle buttons require visual container state changes.
|
|
17
|
+
*
|
|
18
|
+
* @default "filled"
|
|
19
|
+
*/
|
|
6
20
|
color?: ToggleButtonColor;
|
|
7
21
|
}
|
|
@@ -1,2 +1,23 @@
|
|
|
1
1
|
import { ToggleIconButtonProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A compact, icon-only toggle button implementing Material Design 3 Toggle Icon Buttons.
|
|
4
|
+
*
|
|
5
|
+
* Allows users to toggle between two states using a single icon button (e.g. mute/unmute, bookmark/unbookmark).
|
|
6
|
+
* Switches between `icon` and `selectedIcon` based on the current selection state.
|
|
7
|
+
*
|
|
8
|
+
* Built on top of React Aria's `ToggleButton`. Always provide an accessible `aria-label`
|
|
9
|
+
* or `aria-labelledby` attribute for screen reader accessibility.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <ToggleIconButton
|
|
14
|
+
* icon={Volume2}
|
|
15
|
+
* selectedIcon={VolumeX}
|
|
16
|
+
* isSelected={isMuted}
|
|
17
|
+
* onChange={setIsMuted}
|
|
18
|
+
* tooltip={isMuted ? "Unmute" : "Mute"}
|
|
19
|
+
* aria-label={isMuted ? "Unmute" : "Mute"}
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
2
23
|
export declare const ToggleIconButton: React.FC<ToggleIconButtonProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Button/ToggleIconButton/ToggleIconButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { ToggleButton as AriaToggleButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n IconButtonIconSizeMapping,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { ToggleIconButtonProps } from \"./types\";\n\nexport const ToggleIconButton: React.FC<ToggleIconButtonProps> = ({\n size,\n shape,\n color,\n width = \"default\",\n tooltip,\n selectedIcon,\n icon,\n onPress,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize } = useButtonConfig({\n size,\n shape,\n color,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const iconButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-width\": width,\n \"data-icon-button\": true,\n \"data-toggle-button\": true,\n };\n\n return withTooltip(\n <AriaToggleButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...iconButtonDataAttrs}\n data-button\n >\n {({\n isSelected,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n }) => {\n const dataAttrs = {\n ...iconButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-visual-button\": true,\n };\n\n let iconToRender = icon;\n if (isSelected && selectedIcon) iconToRender = selectedIcon;\n\n const iconSize = IconButtonIconSizeMapping[buttonSize];\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {iconToRender && (\n <Icon icon={iconToRender} size={iconSize} />\n )}\n </span>\n );\n }}\n </AriaToggleButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["AriaToggleButton","TapTarget","useSplash","buttonSizeConfig","ButtonCore","ButtonReset","buttonColorBase","useButtonConfig","ButtonSizeBase","newButtonBaseDataAttrs","IconButtonIconSizeMapping","withTooltip","buttonColorConfig","ToggleIconButton","props","onPress","iconButtonDataAttrs","buttonShape","buttonSize","buttonColor","width","ToggleButton","handlePress","clsx","className","renderProps","dataAttrs","isHovered","isDisabled","isFocused","isFocusVisible","isPressed","isSelected","iconToRender","icon","selectedIcon","iconSize","splashInfo","Splash","Icon","tooltip"],"sources":["../../../../src/components/Button/ToggleIconButton/ToggleIconButton.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { ToggleButton as AriaToggleButton } from \"react-aria-components\";\nimport { Icon } from \"@/components/Icon\";\nimport { Splash } from \"@/components/Splash/Splash\";\nimport { useSplash } from \"@/components/Splash/useSplash\";\nimport { TapTarget } from \"@/utils/tapTarget\";\nimport {\n ButtonCore,\n ButtonReset,\n ButtonSizeBase,\n buttonColorBase,\n buttonColorConfig,\n buttonSizeConfig,\n IconButtonIconSizeMapping,\n newButtonBaseDataAttrs,\n useButtonConfig,\n withTooltip,\n} from \"../core\";\nimport type { ToggleIconButtonProps } from \"./types\";\n\n/**\n * A compact, icon-only toggle button implementing Material Design 3 Toggle Icon Buttons.\n *\n * Allows users to toggle between two states using a single icon button (e.g. mute/unmute, bookmark/unbookmark).\n * Switches between `icon` and `selectedIcon` based on the current selection state.\n *\n * Built on top of React Aria's `ToggleButton`. Always provide an accessible `aria-label`\n * or `aria-labelledby` attribute for screen reader accessibility.\n *\n * @example\n * ```tsx\n * <ToggleIconButton\n * icon={Volume2}\n * selectedIcon={VolumeX}\n * isSelected={isMuted}\n * onChange={setIsMuted}\n * tooltip={isMuted ? \"Unmute\" : \"Mute\"}\n * aria-label={isMuted ? \"Unmute\" : \"Mute\"}\n * />\n * ```\n */\nexport const ToggleIconButton: React.FC<ToggleIconButtonProps> = ({\n size,\n shape,\n color,\n width = \"default\",\n tooltip,\n selectedIcon,\n icon,\n onPress,\n className,\n ...props\n}) => {\n const { buttonColor, buttonShape, buttonSize } = useButtonConfig({\n size,\n shape,\n color,\n });\n\n const { splashInfo, handlePress } = useSplash(onPress);\n\n const baseButtonDataAttrs = newButtonBaseDataAttrs({\n shape: buttonShape,\n size: buttonSize,\n color: buttonColor,\n });\n\n const iconButtonDataAttrs = {\n ...baseButtonDataAttrs,\n \"data-width\": width,\n \"data-icon-button\": true,\n \"data-toggle-button\": true,\n };\n\n return withTooltip(\n <AriaToggleButton\n onPress={handlePress}\n className={(renderProps) =>\n clsx(\n ButtonReset,\n TapTarget,\n buttonSizeConfig(buttonSize),\n buttonColorConfig(buttonColor),\n typeof className === \"function\"\n ? className(renderProps)\n : className\n )\n }\n {...props}\n {...iconButtonDataAttrs}\n data-button\n >\n {({\n isSelected,\n isDisabled,\n isFocusVisible,\n isFocused,\n isPressed,\n isHovered,\n }) => {\n const dataAttrs = {\n ...iconButtonDataAttrs,\n \"data-hovered\": isHovered || undefined,\n \"data-disabled\": isDisabled || undefined,\n \"data-focused\": isFocused || undefined,\n \"data-focus-visible\": isFocusVisible || undefined,\n \"data-pressed\": isPressed || undefined,\n \"data-selected\": isSelected || undefined,\n \"data-visual-button\": true,\n };\n\n let iconToRender = icon;\n if (isSelected && selectedIcon) iconToRender = selectedIcon;\n\n const iconSize = IconButtonIconSizeMapping[buttonSize];\n return (\n <span\n className={clsx(\n ButtonCore,\n buttonColorBase,\n ButtonSizeBase\n )}\n {...dataAttrs}\n >\n {splashInfo && <Splash {...splashInfo} />}\n\n {iconToRender && (\n <Icon icon={iconToRender} size={iconSize} />\n )}\n </span>\n );\n }}\n </AriaToggleButton>,\n tooltip\n );\n};\n"],"mappings":";;;;;;;;AAyCA,IAAaa,KAAqD,EAC9D,SACA,UACA,UACA,WAAQ,WACR,YACA,iBACA,SACA,YACA,cACA,GAAGC,QACD;CACF,IAAM,EAAE,gBAAa,gBAAa,kBAAeP,EAAgB;EAC7D;EACA;EACA;CACJ,CAAC,GAEK,EAAE,eAAY,mBAAgBL,EAAUa,CAAO,GAQ/CC,IAAsB;EACxB,GAPwBP,EAAuB;GAC/C,OAAOQ;GACP,MAAMC;GACN,OAAOC;EACX,CAGO;EACH,cAAcC;EACd,oBAAoB;EACpB,sBAAsB;CAC1B;CAEA,OAAOT,EACH,kBAACX,GAAD;EACI,SAASsB;EACT,YAAY,MACRC,EACIlB,GACAJ,GACAE,EAAiBe,CAAU,GAC3BN,EAAkBO,CAAW,GAC7B,OAAOK,KAAc,aACfA,EAAUC,CAAW,IACrBD,CACV;EAEJ,GAAIV;EACJ,GAAIE;EACJ,eAAA;EAEE,WAAA,EACE,eACA,eACA,mBACA,cACA,cACA,mBACE;GACF,IAAMU,IAAY;IACd,GAAGV;IACH,gBAAgBW,KAAa,KAAA;IAC7B,iBAAiBC,KAAc,KAAA;IAC/B,gBAAgBC,KAAa,KAAA;IAC7B,sBAAsBC,KAAkB,KAAA;IACxC,gBAAgBC,KAAa,KAAA;IAC7B,iBAAiBC,KAAc,KAAA;IAC/B,sBAAsB;GAC1B,GAEIC,IAAeC;GACnB,AAAIF,KAAcG,MAAc,IAAeA;GAE/C,IAAMC,IAAW1B,EAA0BQ;GAC3C,OACI,kBAAC,QAAD;IACI,WAAWK,EACPnB,GACAE,GACAE,CACJ;IACA,GAAIkB;IANR,UAAA,CAQKW,KAAc,kBAACC,GAAD,EAAQ,GAAID,EAAW,CAAA,GAErCJ,KACG,kBAACM,GAAD;KAAM,MAAMN;KAAc,MAAMG;IAAS,CAAA,CAE3C;;EAEd;CACc,CAAA,GAClBI,CACJ;AACJ"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { LucideIcon } from 'lucide-react';
|
|
2
2
|
import { ToggleButton } from 'react-aria-components';
|
|
3
3
|
import { IconButtonBaseProps } from '../core';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the {@link ToggleIconButton} component.
|
|
6
|
+
* Extends React Aria's {@link ToggleButton} props (omitting `children`) with {@link IconButtonBaseProps}
|
|
7
|
+
* and support for a distinct icon in the selected state.
|
|
8
|
+
*/
|
|
4
9
|
export interface ToggleIconButtonProps extends Omit<React.ComponentPropsWithRef<typeof ToggleButton>, "children">, IconButtonBaseProps {
|
|
10
|
+
/**
|
|
11
|
+
* Optional icon to render when the toggle button is in the selected (`isSelected = true`) state.
|
|
12
|
+
* If omitted, {@link IconButtonBaseProps.icon} is used for both selected and unselected states.
|
|
13
|
+
*/
|
|
5
14
|
selectedIcon?: LucideIcon;
|
|
6
15
|
}
|
|
@@ -3,25 +3,58 @@ import { AllButtonColor, ButtonColor, IconButtonColor } from './color';
|
|
|
3
3
|
import { ButtonShape } from './shape';
|
|
4
4
|
import { ButtonSize } from './sizes';
|
|
5
5
|
import { IconButtonWidth } from './width';
|
|
6
|
+
/**
|
|
7
|
+
* Determines whether an icon inside a button is rendered before or after the text label.
|
|
8
|
+
*
|
|
9
|
+
* - `"start"`: Renders icon at the leading edge (before text).
|
|
10
|
+
* - `"end"`: Renders icon at the trailing edge (after text).
|
|
11
|
+
*/
|
|
6
12
|
export type ButtonIconPlacement = "start" | "end";
|
|
13
|
+
/**
|
|
14
|
+
* Core props shared across standard text/label button components (e.g. `Button`, `LinkButton`).
|
|
15
|
+
*/
|
|
7
16
|
export interface ButtonBaseProps {
|
|
17
|
+
/** Visual style and color scheme of the button. Defaults to `"filled"`. */
|
|
8
18
|
color?: ButtonColor;
|
|
19
|
+
/** Size scale of the button. Defaults to `"small"`. */
|
|
9
20
|
size?: ButtonSize;
|
|
21
|
+
/** Corner rounding style (`"round"` or `"square"`). Defaults to `"round"`. */
|
|
10
22
|
shape?: ButtonShape;
|
|
23
|
+
/** Optional tooltip text displayed on hover/focus. */
|
|
11
24
|
tooltip?: string;
|
|
25
|
+
/** Optional Lucide icon component displayed alongside label text. */
|
|
12
26
|
icon?: LucideIcon;
|
|
27
|
+
/** Icon placement relative to label text (`"start"` or `"end"`). Defaults to `"start"`. */
|
|
13
28
|
iconPlacement?: ButtonIconPlacement;
|
|
14
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Core props shared across icon-only button components (e.g. `IconButton`, `LinkIconButton`).
|
|
32
|
+
*/
|
|
15
33
|
export interface IconButtonBaseProps {
|
|
34
|
+
/** Visual style and color scheme of the icon button. Defaults to `"standard"`. */
|
|
16
35
|
color?: IconButtonColor;
|
|
36
|
+
/** Size scale of the icon button. Defaults to `"small"`. */
|
|
17
37
|
size?: ButtonSize;
|
|
38
|
+
/** Corner rounding style (`"round"` or `"square"`). Defaults to `"round"`. */
|
|
18
39
|
shape?: ButtonShape;
|
|
40
|
+
/** Width variation (`"narrow"`, `"default"`, or `"wide"`). Defaults to `"default"`. */
|
|
19
41
|
width?: IconButtonWidth;
|
|
42
|
+
/** Optional tooltip text displayed on hover/focus. */
|
|
20
43
|
tooltip?: string;
|
|
44
|
+
/** Required Lucide icon component rendered inside the button. */
|
|
21
45
|
icon: LucideIcon;
|
|
22
46
|
}
|
|
47
|
+
/** CSS class resetting default button/link styling (outlines, borders, backgrounds). */
|
|
23
48
|
export declare const ButtonReset: string;
|
|
49
|
+
/** CSS class providing the core layout and flex alignment for button internals. */
|
|
24
50
|
export declare const ButtonCore: string;
|
|
51
|
+
/**
|
|
52
|
+
* Generates standard data attributes (`data-shape`, `data-size`, `data-color`)
|
|
53
|
+
* applied to button DOM nodes for CSS attribute styling.
|
|
54
|
+
*
|
|
55
|
+
* @param options - Shape, size, and color configuration.
|
|
56
|
+
* @returns Object with data attributes for spreading onto elements.
|
|
57
|
+
*/
|
|
25
58
|
export declare function newButtonBaseDataAttrs({ shape, size, color, }: {
|
|
26
59
|
shape: ButtonShape;
|
|
27
60
|
color: AllButtonColor;
|