burne-ui 2.1.2 → 2.1.4
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/README.md +8 -4
- package/cli/burne-ui.js +4 -3
- package/cli/init.js +83 -19
- package/cli/skin-live-slots.json +1 -1
- package/cli/skin-slots.json +2 -0
- package/cli/skin-validate.mjs +83 -2
- package/cli/tailwind.css +20 -0
- package/cli/theme-bridge.css +6 -0
- package/dist/authoring.d.ts +2 -0
- package/dist/authoring.js +8 -0
- package/dist/components/composite/Accordion/accordionStyles.js +1 -1
- package/dist/components/composite/Accordion/useAccordionRootState.js +6 -2
- package/dist/components/composite/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/components/composite/AlertDialog/AlertDialog.js +1 -0
- package/dist/components/composite/AlertDialog/alertDialogAnimations.d.ts +1 -0
- package/dist/components/composite/AlertDialog/alertDialogAnimations.js +1 -0
- package/dist/components/composite/AlertDialog/alertDialogParts.d.ts +5 -7
- package/dist/components/composite/AlertDialog/alertDialogParts.js +92 -37
- package/dist/components/composite/AlertDialog/alertDialogStyles.d.ts +3 -2
- package/dist/components/composite/AlertDialog/alertDialogStyles.js +5 -3
- package/dist/components/composite/AlertDialog/alertDialogTypes.d.ts +8 -8
- package/dist/components/composite/AlertDialog/index.d.ts +4 -6
- package/dist/components/composite/AlertDialog/useAlertDialogRootState.d.ts +1 -1
- package/dist/components/composite/AlertDialog/useAlertDialogRootState.js +13 -1
- package/dist/components/composite/ButtonGroup/ButtonGroup.d.ts +1 -0
- package/dist/components/composite/ButtonGroup/ButtonGroup.js +59 -25
- package/dist/components/composite/ButtonGroup/buttonGroupAPI.d.ts +1 -0
- package/dist/components/composite/ButtonGroup/buttonGroupAPI.js +7 -1
- package/dist/components/composite/ButtonGroup/buttonGroupContext.d.ts +3 -2
- package/dist/components/composite/ButtonGroup/buttonGroupContext.js +4 -3
- package/dist/components/composite/ButtonGroup/buttonGroupStyles.js +1 -1
- package/dist/components/composite/ButtonGroup/buttonGroupTypes.d.ts +3 -1
- package/dist/components/composite/ButtonGroup/index.d.ts +1 -0
- package/dist/components/composite/CheckboxGroup/CheckboxGroup.js +25 -7
- package/dist/components/composite/CheckboxGroup/useCheckboxGroupRootState.d.ts +5 -1
- package/dist/components/composite/CheckboxGroup/useCheckboxGroupRootState.js +74 -23
- package/dist/components/composite/Form/Form.js +6 -0
- package/dist/components/composite/Form/formAPI.d.ts +2 -0
- package/dist/components/composite/Form/formAPI.js +29 -2
- package/dist/components/composite/Form/formContext.js +4 -0
- package/dist/components/composite/Form/formParts.js +20 -6
- package/dist/components/composite/Form/formStyles.js +4 -4
- package/dist/components/composite/Form/useFormControlProps.js +25 -15
- package/dist/components/composite/Form/useFormFieldBinding.js +22 -14
- package/dist/components/composite/Form/useFormRootState.d.ts +2 -1
- package/dist/components/composite/Form/useFormRootState.js +151 -89
- package/dist/components/composite/RadioGroup/RadioGroup.js +30 -10
- package/dist/components/composite/RadioGroup/radioGroupA11y.d.ts +10 -0
- package/dist/components/composite/RadioGroup/radioGroupA11y.js +75 -0
- package/dist/components/composite/RadioGroup/radioGroupTypes.d.ts +2 -2
- package/dist/components/composite/RadioGroup/useRadioGroupRootState.d.ts +7 -1
- package/dist/components/composite/RadioGroup/useRadioGroupRootState.js +105 -34
- package/dist/components/composite/ToggleButtonGroup/ToggleButtonGroup.js +3 -1
- package/dist/components/composite/ToggleButtonGroup/toggleButtonGroupA11y.d.ts +1 -1
- package/dist/components/composite/ToggleButtonGroup/toggleButtonGroupA11y.js +13 -7
- package/dist/components/composite/ToggleButtonGroup/toggleButtonGroupAPI.d.ts +2 -0
- package/dist/components/composite/ToggleButtonGroup/toggleButtonGroupAPI.js +19 -4
- package/dist/components/composite/ToggleButtonGroup/useToggleButtonGroupRootState.js +20 -7
- package/dist/components/composite/utils/optionGroupFieldset.d.ts +1 -1
- package/dist/components/core/Alert/Alert.js +3 -1
- package/dist/components/core/Alert/alertAnimations.js +14 -3
- package/dist/components/core/Alert/alertStyles.d.ts +1 -1
- package/dist/components/core/Alert/alertStyles.js +1 -1
- package/dist/components/core/AppShell/AppShell.js +16 -4
- package/dist/components/core/AppShell/appShellAnimations.js +1 -1
- package/dist/components/core/AppShell/appShellStyles.d.ts +3 -2
- package/dist/components/core/AppShell/appShellStyles.js +8 -2
- package/dist/components/core/AspectRatio/AspectRatio.js +6 -3
- package/dist/components/core/AspectRatio/aspectRatioAnimations.js +1 -1
- package/dist/components/core/AspectRatio/aspectRatioStyles.d.ts +5 -2
- package/dist/components/core/AspectRatio/aspectRatioStyles.js +27 -3
- package/dist/components/core/Avatar/avatarParts.js +26 -6
- package/dist/components/core/Avatar/avatarTypes.d.ts +1 -0
- package/dist/components/core/Avatar/useAvatarRootState.d.ts +1 -0
- package/dist/components/core/Avatar/useAvatarRootState.js +6 -2
- package/dist/components/core/Badge/Badge.js +9 -3
- package/dist/components/core/Badge/badgeA11y.js +6 -0
- package/dist/components/core/Badge/badgeAPI.js +4 -4
- package/dist/components/core/Badge/badgeAnimations.js +18 -3
- package/dist/components/core/Badge/badgeParts.d.ts +1 -1
- package/dist/components/core/Badge/badgeParts.js +6 -3
- package/dist/components/core/Badge/badgeStyles.d.ts +1 -0
- package/dist/components/core/Badge/badgeStyles.js +2 -0
- package/dist/components/core/Badge/badgeTypes.d.ts +2 -0
- package/dist/components/core/Badge/useBadgeRootState.d.ts +1 -0
- package/dist/components/core/Badge/useBadgeRootState.js +2 -1
- package/dist/components/core/Breadcrumbs/breadcrumbsAPI.js +11 -5
- package/dist/components/core/Breadcrumbs/breadcrumbsParts.js +21 -6
- package/dist/components/core/Breadcrumbs/breadcrumbsStyles.js +4 -4
- package/dist/components/core/Button/Button.js +34 -18
- package/dist/components/core/Button/buttonAnimations.d.ts +1 -1
- package/dist/components/core/Button/buttonAnimations.js +18 -7
- package/dist/components/core/Button/buttonParts.js +2 -2
- package/dist/components/core/Button/buttonStyles.d.ts +4 -3
- package/dist/components/core/Button/buttonStyles.js +11 -10
- package/dist/components/core/Button/buttonTypes.d.ts +2 -1
- package/dist/components/core/Button/useButtonRootState.d.ts +2 -1
- package/dist/components/core/Button/useButtonRootState.js +10 -4
- package/dist/components/core/Calendar/Calendar.js +15 -4
- package/dist/components/core/Calendar/calendarAPI.d.ts +10 -6
- package/dist/components/core/Calendar/calendarAPI.js +110 -30
- package/dist/components/core/Calendar/calendarParts.js +173 -72
- package/dist/components/core/Calendar/calendarStyles.d.ts +5 -5
- package/dist/components/core/Calendar/calendarStyles.js +8 -8
- package/dist/components/core/Calendar/calendarTypes.d.ts +8 -0
- package/dist/components/core/Calendar/useCalendarRootState.js +60 -19
- package/dist/components/core/Calendar/useCalendarViewModels.js +6 -6
- package/dist/components/core/Card/Card.d.ts +1 -0
- package/dist/components/core/Card/Card.js +17 -7
- package/dist/components/core/Card/cardAPI.d.ts +1 -0
- package/dist/components/core/Card/cardAPI.js +23 -1
- package/dist/components/core/Card/cardAnimations.d.ts +1 -1
- package/dist/components/core/Card/cardAnimations.js +41 -10
- package/dist/components/core/Card/cardParts.d.ts +1 -1
- package/dist/components/core/Card/cardParts.js +26 -6
- package/dist/components/core/Card/cardStyles.d.ts +5 -4
- package/dist/components/core/Card/cardStyles.js +9 -6
- package/dist/components/core/Card/cardTypes.d.ts +4 -0
- package/dist/components/core/Card/index.d.ts +1 -0
- package/dist/components/core/Checkbox/Checkbox.js +9 -1
- package/dist/components/core/Checkbox/checkboxAPI.d.ts +2 -0
- package/dist/components/core/Checkbox/checkboxAPI.js +36 -0
- package/dist/components/core/Checkbox/checkboxParts.d.ts +5 -4
- package/dist/components/core/Checkbox/checkboxParts.js +74 -48
- package/dist/components/core/Checkbox/checkboxStyles.d.ts +4 -3
- package/dist/components/core/Checkbox/checkboxStyles.js +5 -3
- package/dist/components/core/Checkbox/checkboxTypes.d.ts +2 -0
- package/dist/components/core/Checkbox/index.d.ts +1 -1
- package/dist/components/core/Checkbox/useCheckboxRootState.d.ts +4 -1
- package/dist/components/core/Checkbox/useCheckboxRootState.js +43 -30
- package/dist/components/core/CloseButton/CloseButton.js +2 -1
- package/dist/components/core/CloseButton/closeButtonAnimations.js +38 -9
- package/dist/components/core/CloseButton/closeButtonParts.js +3 -4
- package/dist/components/core/ColorPicker/ColorPicker.js +27 -8
- package/dist/components/core/ColorPicker/ColorSlider.d.ts +2 -0
- package/dist/components/core/ColorPicker/ColorSlider.js +131 -53
- package/dist/components/core/ColorPicker/ColorSwatch.js +22 -4
- package/dist/components/core/ColorPicker/colorPickerAnimations.d.ts +1 -1
- package/dist/components/core/ColorPicker/colorPickerAnimations.js +33 -8
- package/dist/components/core/ColorPicker/colorPickerParts.js +125 -32
- package/dist/components/core/ColorPicker/colorPickerStyles.d.ts +11 -3
- package/dist/components/core/ColorPicker/colorPickerStyles.js +13 -3
- package/dist/components/core/ColorPicker/colorPickerTypes.d.ts +4 -0
- package/dist/components/core/ColorPicker/colorSliderStyles.d.ts +2 -2
- package/dist/components/core/ColorPicker/colorSliderStyles.js +4 -4
- package/dist/components/core/ColorPicker/colorSliderTypes.d.ts +2 -0
- package/dist/components/core/ColorPicker/colorSwatchStyles.d.ts +1 -0
- package/dist/components/core/ColorPicker/colorSwatchStyles.js +4 -0
- package/dist/components/core/ColorPicker/colorUtils.d.ts +2 -1
- package/dist/components/core/ColorPicker/colorUtils.js +33 -10
- package/dist/components/core/ColorPicker/index.d.ts +2 -0
- package/dist/components/core/ColorPicker/useColorPickerRootState.d.ts +3 -1
- package/dist/components/core/ColorPicker/useColorPickerRootState.js +65 -30
- package/dist/components/core/ComboBox/ComboBox.js +13 -1
- package/dist/components/core/ComboBox/comboBoxAnimations.d.ts +3 -2
- package/dist/components/core/ComboBox/comboBoxAnimations.js +5 -2
- package/dist/components/core/ComboBox/comboBoxFieldParts.js +1 -1
- package/dist/components/core/ComboBox/comboBoxParts.d.ts +3 -1
- package/dist/components/core/ComboBox/comboBoxParts.js +114 -28
- package/dist/components/core/ComboBox/comboBoxStyles.d.ts +4 -4
- package/dist/components/core/ComboBox/comboBoxStyles.js +4 -4
- package/dist/components/core/ComboBox/comboBoxTypes.d.ts +5 -0
- package/dist/components/core/ComboBox/useComboBoxInputState.d.ts +3 -2
- package/dist/components/core/ComboBox/useComboBoxInputState.js +130 -62
- package/dist/components/core/ComboBox/useComboBoxRootState.js +44 -18
- package/dist/components/core/Container/Container.js +3 -0
- package/dist/components/core/Container/containerStyles.d.ts +2 -1
- package/dist/components/core/Container/containerStyles.js +2 -1
- package/dist/components/core/ContextMenu/ContextMenu.d.ts +3 -1
- package/dist/components/core/ContextMenu/ContextMenu.js +177 -19
- package/dist/components/core/ContextMenu/contextMenuStyles.d.ts +1 -1
- package/dist/components/core/ContextMenu/contextMenuStyles.js +1 -1
- package/dist/components/core/ContextMenu/index.d.ts +3 -1
- package/dist/components/core/DatePicker/DatePicker.js +8 -3
- package/dist/components/core/DatePicker/datePickerAPI.d.ts +2 -0
- package/dist/components/core/DatePicker/datePickerAPI.js +43 -0
- package/dist/components/core/DatePicker/datePickerAnimations.d.ts +2 -1
- package/dist/components/core/DatePicker/datePickerAnimations.js +9 -5
- package/dist/components/core/DatePicker/datePickerParts.js +29 -5
- package/dist/components/core/DatePicker/datePickerStyles.d.ts +2 -2
- package/dist/components/core/DatePicker/datePickerStyles.js +2 -2
- package/dist/components/core/DatePicker/datePickerTypes.d.ts +2 -0
- package/dist/components/core/DatePicker/useDatePickerRootState.d.ts +2 -0
- package/dist/components/core/DatePicker/useDatePickerRootState.js +63 -24
- package/dist/components/core/Dialog/Dialog.d.ts +1 -1
- package/dist/components/core/Dialog/Dialog.js +2 -0
- package/dist/components/core/Dialog/dialogAnimations.d.ts +1 -0
- package/dist/components/core/Dialog/dialogAnimations.js +1 -0
- package/dist/components/core/Dialog/dialogParts.d.ts +1 -1
- package/dist/components/core/Dialog/dialogParts.js +8 -3
- package/dist/components/core/Dialog/dialogStyles.d.ts +1 -1
- package/dist/components/core/Dialog/dialogStyles.js +2 -2
- package/dist/components/core/Dialog/dialogTypes.d.ts +4 -1
- package/dist/components/core/Dialog/useDialogRootState.d.ts +1 -1
- package/dist/components/core/Dialog/useDialogRootState.js +2 -0
- package/dist/components/core/Disclosure/Disclosure.js +10 -4
- package/dist/components/core/Disclosure/disclosureAnimations.js +7 -5
- package/dist/components/core/Disclosure/disclosureContentPart.js +3 -0
- package/dist/components/core/Disclosure/disclosureParts.js +29 -20
- package/dist/components/core/Disclosure/disclosureStyles.d.ts +1 -1
- package/dist/components/core/Disclosure/disclosureStyles.js +3 -3
- package/dist/components/core/Disclosure/useDisclosureContentDrag.js +3 -1
- package/dist/components/core/Disclosure/useDisclosureGroupRootState.js +17 -7
- package/dist/components/core/Disclosure/useDisclosureRootState.js +12 -12
- package/dist/components/core/Drawer/Drawer.d.ts +1 -1
- package/dist/components/core/Drawer/Drawer.js +2 -0
- package/dist/components/core/Drawer/drawerAnimations.d.ts +1 -0
- package/dist/components/core/Drawer/drawerAnimations.js +1 -0
- package/dist/components/core/Drawer/drawerParts.js +14 -9
- package/dist/components/core/Drawer/drawerStyles.d.ts +1 -1
- package/dist/components/core/Drawer/drawerStyles.js +2 -2
- package/dist/components/core/Drawer/drawerTypes.d.ts +4 -1
- package/dist/components/core/Drawer/useDrawerHandleDrag.d.ts +2 -0
- package/dist/components/core/Drawer/useDrawerHandleDrag.js +117 -35
- package/dist/components/core/Drawer/useDrawerRootState.d.ts +1 -1
- package/dist/components/core/Drawer/useDrawerRootState.js +3 -0
- package/dist/components/core/Dropdown/dropdownA11y.js +4 -1
- package/dist/components/core/Dropdown/dropdownAnimations.d.ts +3 -2
- package/dist/components/core/Dropdown/dropdownAnimations.js +79 -29
- package/dist/components/core/Dropdown/dropdownItemParts.d.ts +3 -1
- package/dist/components/core/Dropdown/dropdownItemParts.js +25 -5
- package/dist/components/core/Dropdown/dropdownParts.js +40 -11
- package/dist/components/core/Dropdown/dropdownStyles.d.ts +3 -3
- package/dist/components/core/Dropdown/dropdownStyles.js +3 -3
- package/dist/components/core/Dropdown/dropdownSubParts.js +47 -16
- package/dist/components/core/Dropdown/dropdownTypes.d.ts +13 -2
- package/dist/components/core/Dropdown/index.d.ts +3 -1
- package/dist/components/core/Dropdown/useDropdownItemState.d.ts +5 -1
- package/dist/components/core/Dropdown/useDropdownItemState.js +3 -1
- package/dist/components/core/Dropdown/useDropdownRootState.js +16 -5
- package/dist/components/core/Expandable/expandableA11y.d.ts +1 -0
- package/dist/components/core/Expandable/expandableA11y.js +5 -0
- package/dist/components/core/Expandable/expandableAPI.d.ts +1 -0
- package/dist/components/core/Expandable/expandableAPI.js +19 -11
- package/dist/components/core/Expandable/expandableAnimations.d.ts +1 -1
- package/dist/components/core/Expandable/expandableAnimations.js +9 -9
- package/dist/components/core/Expandable/expandableParts.js +31 -23
- package/dist/components/core/Expandable/expandableStyles.d.ts +1 -1
- package/dist/components/core/Expandable/expandableStyles.js +1 -1
- package/dist/components/core/Expandable/useExpandableRootState.js +5 -3
- package/dist/components/core/Field/fieldParts.d.ts +2 -2
- package/dist/components/core/Field/fieldParts.js +2 -1
- package/dist/components/core/Field/fieldStyles.js +1 -1
- package/dist/components/core/Grid/Grid.js +3 -0
- package/dist/components/core/Grid/gridStyles.d.ts +2 -1
- package/dist/components/core/Grid/gridStyles.js +2 -1
- package/dist/components/core/Header/Header.js +3 -1
- package/dist/components/core/Header/headerStyles.d.ts +3 -2
- package/dist/components/core/Header/headerStyles.js +9 -2
- package/dist/components/core/HoverCard/hoverCardParts.js +23 -11
- package/dist/components/core/Input/inputAffixParts.js +6 -0
- package/dist/components/core/Input/inputAnimations.js +3 -1
- package/dist/components/core/Input/inputControlParts.js +48 -14
- package/dist/components/core/Input/inputFieldParts.js +1 -1
- package/dist/components/core/Input/inputStyles.d.ts +5 -5
- package/dist/components/core/Input/inputStyles.js +5 -5
- package/dist/components/core/Input/inputTypes.d.ts +1 -0
- package/dist/components/core/Input/useInputRootState.js +2 -1
- package/dist/components/core/Kbd/Kbd.js +3 -1
- package/dist/components/core/Kbd/kbdAnimations.js +16 -4
- package/dist/components/core/Kbd/kbdParts.js +6 -4
- package/dist/components/core/Kbd/kbdStyles.d.ts +1 -1
- package/dist/components/core/Kbd/kbdStyles.js +1 -1
- package/dist/components/core/Kbd/kbdTextPart.js +5 -2
- package/dist/components/core/Kbd/useKbdRootState.js +6 -2
- package/dist/components/core/Label/Label.d.ts +2 -1
- package/dist/components/core/Label/Label.js +8 -1
- package/dist/components/core/Label/labelParts.d.ts +1 -0
- package/dist/components/core/Label/labelTypes.d.ts +3 -1
- package/dist/components/core/Label/useLabelRootState.d.ts +2 -1
- package/dist/components/core/Label/useLabelRootState.js +3 -1
- package/dist/components/core/Link/Link.d.ts +1 -1
- package/dist/components/core/Link/Link.js +38 -25
- package/dist/components/core/Link/linkAPI.d.ts +3 -1
- package/dist/components/core/Link/linkAPI.js +8 -4
- package/dist/components/core/Link/linkAnchorBodyPart.d.ts +2 -2
- package/dist/components/core/Link/linkAnchorBodyPart.js +48 -8
- package/dist/components/core/Link/linkAnimations.d.ts +1 -1
- package/dist/components/core/Link/linkAnimations.js +29 -14
- package/dist/components/core/Link/linkIconSlotPart.d.ts +1 -1
- package/dist/components/core/Link/linkIconSlotPart.js +3 -3
- package/dist/components/core/Link/linkStyles.d.ts +5 -3
- package/dist/components/core/Link/linkStyles.js +6 -3
- package/dist/components/core/Link/linkTypes.d.ts +14 -1
- package/dist/components/core/Link/useLinkRootState.d.ts +2 -0
- package/dist/components/core/ListBox/ListBox.d.ts +1 -0
- package/dist/components/core/ListBox/ListBox.js +2 -0
- package/dist/components/core/ListBox/index.d.ts +1 -0
- package/dist/components/core/ListBox/listBoxAnimations.d.ts +5 -2
- package/dist/components/core/ListBox/listBoxAnimations.js +15 -3
- package/dist/components/core/ListBox/listBoxParts.js +21 -5
- package/dist/components/core/ListBox/listBoxStyles.d.ts +3 -3
- package/dist/components/core/ListBox/listBoxStyles.js +3 -3
- package/dist/components/core/ListBox/listBoxTypes.d.ts +5 -1
- package/dist/components/core/ListBox/useListBoxItemState.d.ts +1 -1
- package/dist/components/core/ListBox/useListBoxRootState.d.ts +1 -1
- package/dist/components/core/ListBox/useListBoxRootState.js +31 -6
- package/dist/components/core/ListBox/useListBoxVirtualWindow.d.ts +1 -0
- package/dist/components/core/ListBox/useListBoxVirtualWindow.js +11 -4
- package/dist/components/core/Loading/Loading.js +1 -1
- package/dist/components/core/Loading/loadingAnimations.d.ts +2 -2
- package/dist/components/core/Loading/loadingAnimations.js +12 -5
- package/dist/components/core/Loading/loadingParts.js +1 -1
- package/dist/components/core/Loading/loadingStyles.js +1 -1
- package/dist/components/core/Meter/Meter.js +21 -3
- package/dist/components/core/Meter/meterAPI.d.ts +4 -0
- package/dist/components/core/Meter/meterAPI.js +13 -2
- package/dist/components/core/Meter/meterParts.js +6 -2
- package/dist/components/core/Meter/meterStyles.d.ts +1 -1
- package/dist/components/core/Meter/meterStyles.js +1 -1
- package/dist/components/core/Meter/meterTypes.d.ts +1 -0
- package/dist/components/core/Meter/useMeterRootState.js +3 -2
- package/dist/components/core/Meter/useMeterTrackState.d.ts +1 -1
- package/dist/components/core/Meter/useMeterTrackState.js +15 -10
- package/dist/components/core/NumberInput/NumberInput.js +13 -2
- package/dist/components/core/NumberInput/numberInputParts.d.ts +4 -1
- package/dist/components/core/NumberInput/numberInputParts.js +30 -4
- package/dist/components/core/NumberInput/numberInputStyles.js +2 -2
- package/dist/components/core/NumberInput/useNumberInputRootState.js +47 -33
- package/dist/components/core/Pagination/paginationAPI.d.ts +4 -1
- package/dist/components/core/Pagination/paginationAPI.js +60 -17
- package/dist/components/core/Pagination/paginationAnimations.js +6 -0
- package/dist/components/core/Pagination/paginationParts.d.ts +1 -1
- package/dist/components/core/Pagination/paginationParts.js +82 -22
- package/dist/components/core/Pagination/paginationStyles.d.ts +7 -6
- package/dist/components/core/Pagination/paginationStyles.js +7 -6
- package/dist/components/core/Pagination/paginationTypes.d.ts +1 -0
- package/dist/components/core/Pagination/usePaginationRootState.js +12 -6
- package/dist/components/core/PinInput/pinInputAnimations.d.ts +6 -1
- package/dist/components/core/PinInput/pinInputAnimations.js +13 -4
- package/dist/components/core/PinInput/pinInputParts.js +84 -20
- package/dist/components/core/PinInput/pinInputStyles.d.ts +1 -1
- package/dist/components/core/PinInput/pinInputStyles.js +2 -2
- package/dist/components/core/PinInput/pinInputTypes.d.ts +4 -0
- package/dist/components/core/PinInput/usePinInputRootState.js +71 -33
- package/dist/components/core/Popover/popoverAnimations.d.ts +1 -0
- package/dist/components/core/Popover/popoverAnimations.js +33 -7
- package/dist/components/core/Popover/popoverParts.js +62 -14
- package/dist/components/core/Popover/popoverStyles.d.ts +1 -1
- package/dist/components/core/Popover/popoverStyles.js +1 -1
- package/dist/components/core/Popover/popoverTypes.d.ts +1 -0
- package/dist/components/core/Popover/usePopoverRootState.js +46 -14
- package/dist/components/core/ProgressBar/ProgressBar.js +21 -3
- package/dist/components/core/ProgressBar/progressBarA11y.d.ts +1 -1
- package/dist/components/core/ProgressBar/progressBarA11y.js +4 -2
- package/dist/components/core/ProgressBar/progressBarAPI.d.ts +4 -0
- package/dist/components/core/ProgressBar/progressBarAPI.js +13 -2
- package/dist/components/core/ProgressBar/progressBarParts.js +6 -2
- package/dist/components/core/ProgressBar/progressBarStyles.d.ts +1 -1
- package/dist/components/core/ProgressBar/progressBarStyles.js +1 -1
- package/dist/components/core/ProgressBar/progressBarTypes.d.ts +3 -0
- package/dist/components/core/ProgressBar/useProgressBarRootState.js +6 -3
- package/dist/components/core/ProgressBar/useProgressBarTrackState.d.ts +1 -1
- package/dist/components/core/ProgressBar/useProgressBarTrackState.js +18 -11
- package/dist/components/core/Radio/Radio.js +6 -1
- package/dist/components/core/Radio/radioParts.js +6 -3
- package/dist/components/core/Radio/radioStyles.d.ts +3 -3
- package/dist/components/core/Radio/radioStyles.js +3 -3
- package/dist/components/core/Radio/radioTypes.d.ts +1 -0
- package/dist/components/core/Radio/useRadioRootState.d.ts +5 -2
- package/dist/components/core/Radio/useRadioRootState.js +80 -36
- package/dist/components/core/Resizable/Resizable.js +185 -20
- package/dist/components/core/Resizable/index.d.ts +1 -0
- package/dist/components/core/Resizable/resizableAnimations.js +1 -1
- package/dist/components/core/Resizable/resizableParts.d.ts +1 -0
- package/dist/components/core/Resizable/resizableParts.js +96 -42
- package/dist/components/core/Resizable/resizableStyles.d.ts +3 -2
- package/dist/components/core/Resizable/resizableStyles.js +3 -2
- package/dist/components/core/Resizable/resizableTypes.d.ts +10 -2
- package/dist/components/core/Ripple/Ripple.js +3 -2
- package/dist/components/core/Ripple/rippleAPI.d.ts +1 -0
- package/dist/components/core/Ripple/rippleAPI.js +7 -0
- package/dist/components/core/Ripple/rippleStyles.d.ts +1 -1
- package/dist/components/core/Ripple/rippleStyles.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.js +1 -1
- package/dist/components/core/ScrollArea/scrollAreaAPI.d.ts +11 -2
- package/dist/components/core/ScrollArea/scrollAreaAPI.js +65 -9
- package/dist/components/core/ScrollArea/scrollAreaParts.js +31 -10
- package/dist/components/core/ScrollArea/scrollAreaStyles.d.ts +1 -1
- package/dist/components/core/ScrollArea/scrollAreaStyles.js +1 -1
- package/dist/components/core/ScrollArea/scrollAreaTypes.d.ts +4 -0
- package/dist/components/core/ScrollArea/useScrollAreaRootState.d.ts +1 -1
- package/dist/components/core/ScrollArea/useScrollAreaRootState.js +49 -10
- package/dist/components/core/SearchInput/SearchInput.js +24 -9
- package/dist/components/core/SearchInput/searchInputAnimations.d.ts +7 -6
- package/dist/components/core/SearchInput/searchInputAnimations.js +23 -18
- package/dist/components/core/SearchInput/searchInputParts.d.ts +2 -2
- package/dist/components/core/SearchInput/searchInputParts.js +22 -10
- package/dist/components/core/SearchInput/searchInputStyles.d.ts +5 -3
- package/dist/components/core/SearchInput/searchInputStyles.js +6 -5
- package/dist/components/core/SearchInput/searchInputTypes.d.ts +1 -0
- package/dist/components/core/SearchInput/useSearchInputRootState.d.ts +3 -3
- package/dist/components/core/SearchInput/useSearchInputRootState.js +52 -34
- package/dist/components/core/Select/Select.js +13 -1
- package/dist/components/core/Select/selectAnimations.d.ts +3 -2
- package/dist/components/core/Select/selectAnimations.js +5 -2
- package/dist/components/core/Select/selectParts.d.ts +3 -1
- package/dist/components/core/Select/selectParts.js +2 -1
- package/dist/components/core/Select/selectStyles.d.ts +3 -3
- package/dist/components/core/Select/selectStyles.js +3 -3
- package/dist/components/core/Select/selectTriggerParts.js +79 -28
- package/dist/components/core/Select/selectTypes.d.ts +1 -0
- package/dist/components/core/Select/useSelectRootState.js +33 -16
- package/dist/components/core/SelectionIndicator/selectionIndicatorAnimations.js +23 -3
- package/dist/components/core/SelectionThumb/SelectionThumb.js +1 -1
- package/dist/components/core/Separator/Separator.d.ts +2 -1
- package/dist/components/core/Separator/Separator.js +3 -1
- package/dist/components/core/Separator/index.d.ts +1 -1
- package/dist/components/core/Separator/separatorStyles.d.ts +2 -2
- package/dist/components/core/Separator/separatorStyles.js +2 -2
- package/dist/components/core/Separator/separatorTypes.d.ts +4 -0
- package/dist/components/core/Sidebar/Sidebar.js +15 -2
- package/dist/components/core/Sidebar/sidebarAnimations.d.ts +2 -2
- package/dist/components/core/Sidebar/sidebarAnimations.js +4 -3
- package/dist/components/core/Sidebar/sidebarStyles.d.ts +2 -1
- package/dist/components/core/Sidebar/sidebarStyles.js +2 -1
- package/dist/components/core/Skeleton/skeletonParts.js +8 -5
- package/dist/components/core/Skeleton/skeletonStyles.d.ts +10 -0
- package/dist/components/core/Skeleton/skeletonStyles.js +20 -0
- package/dist/components/core/Slider/Slider.js +9 -3
- package/dist/components/core/Slider/sliderAPI.d.ts +5 -4
- package/dist/components/core/Slider/sliderAPI.js +86 -42
- package/dist/components/core/Slider/sliderAnimations.d.ts +1 -1
- package/dist/components/core/Slider/sliderAnimations.js +2 -2
- package/dist/components/core/Slider/sliderParts.js +11 -2
- package/dist/components/core/Slider/sliderStyles.d.ts +4 -4
- package/dist/components/core/Slider/sliderStyles.js +18 -6
- package/dist/components/core/Slider/sliderThumbParts.d.ts +2 -0
- package/dist/components/core/Slider/sliderThumbParts.js +16 -4
- package/dist/components/core/Slider/sliderTrackParts.js +10 -4
- package/dist/components/core/Slider/sliderTypes.d.ts +9 -1
- package/dist/components/core/Slider/useSliderRootState.d.ts +3 -2
- package/dist/components/core/Slider/useSliderRootState.js +104 -49
- package/dist/components/core/Slider/useSliderTrackState.js +198 -39
- package/dist/components/core/Stack/Stack.js +3 -0
- package/dist/components/core/Stack/stackStyles.d.ts +2 -1
- package/dist/components/core/Stack/stackStyles.js +2 -1
- package/dist/components/core/Stepper/index.d.ts +10 -1
- package/dist/components/core/Stepper/stepperAPI.d.ts +2 -2
- package/dist/components/core/Stepper/stepperAPI.js +4 -3
- package/dist/components/core/Stepper/stepperAnimations.d.ts +1 -0
- package/dist/components/core/Stepper/stepperAnimations.js +28 -2
- package/dist/components/core/Stepper/stepperParts.d.ts +11 -2
- package/dist/components/core/Stepper/stepperParts.js +38 -9
- package/dist/components/core/Stepper/stepperStyles.js +3 -1
- package/dist/components/core/Stepper/stepperTypes.d.ts +3 -2
- package/dist/components/core/Stepper/useStepperRootState.js +10 -3
- package/dist/components/core/Surface/Surface.js +3 -1
- package/dist/components/core/Switch/Switch.js +12 -1
- package/dist/components/core/Switch/switchAPI.d.ts +2 -0
- package/dist/components/core/Switch/switchAPI.js +18 -1
- package/dist/components/core/Switch/switchAnimations.js +29 -9
- package/dist/components/core/Switch/switchControlParts.js +93 -30
- package/dist/components/core/Switch/switchGeometry.js +2 -2
- package/dist/components/core/Switch/switchSimpleParts.d.ts +2 -1
- package/dist/components/core/Switch/switchSimpleParts.js +3 -1
- package/dist/components/core/Switch/switchStyles.d.ts +3 -3
- package/dist/components/core/Switch/switchStyles.js +3 -3
- package/dist/components/core/Switch/switchTypes.d.ts +8 -0
- package/dist/components/core/Switch/useSwitchRootState.js +54 -17
- package/dist/components/core/Table/Table.d.ts +1 -0
- package/dist/components/core/Table/Table.js +2 -0
- package/dist/components/core/Table/index.d.ts +1 -0
- package/dist/components/core/Table/tableAPI.d.ts +6 -1
- package/dist/components/core/Table/tableAPI.js +73 -5
- package/dist/components/core/Table/tableContext.js +6 -1
- package/dist/components/core/Table/tableParts.js +77 -34
- package/dist/components/core/Table/tableStyles.d.ts +13 -2
- package/dist/components/core/Table/tableStyles.js +26 -3
- package/dist/components/core/Table/tableTypes.d.ts +4 -0
- package/dist/components/core/Table/tableVirtualRows.js +140 -27
- package/dist/components/core/Table/useTableContentState.d.ts +2 -1
- package/dist/components/core/Table/useTableContentState.js +32 -6
- package/dist/components/core/Tabs/tabsA11y.d.ts +4 -3
- package/dist/components/core/Tabs/tabsA11y.js +5 -4
- package/dist/components/core/Tabs/tabsContext.d.ts +5 -0
- package/dist/components/core/Tabs/tabsContext.js +12 -0
- package/dist/components/core/Tabs/tabsPanelPart.js +11 -1
- package/dist/components/core/Tabs/tabsParts.js +70 -32
- package/dist/components/core/Tabs/tabsStyles.d.ts +5 -2
- package/dist/components/core/Tabs/tabsStyles.js +13 -4
- package/dist/components/core/Tabs/tabsTabPart.js +55 -50
- package/dist/components/core/Tabs/tabsTypes.d.ts +2 -2
- package/dist/components/core/Tabs/useSlidingTabIndicator.d.ts +1 -1
- package/dist/components/core/Tabs/useSlidingTabIndicator.js +25 -10
- package/dist/components/core/Tabs/useTabsRootState.js +13 -5
- package/dist/components/core/TagsInput/TagsInput.js +13 -2
- package/dist/components/core/TagsInput/index.d.ts +2 -0
- package/dist/components/core/TagsInput/tagsInputParts.d.ts +6 -2
- package/dist/components/core/TagsInput/tagsInputParts.js +81 -14
- package/dist/components/core/TagsInput/tagsInputStyles.js +2 -2
- package/dist/components/core/TagsInput/tagsInputTypes.d.ts +3 -0
- package/dist/components/core/TagsInput/useTagsInputRootState.js +78 -33
- package/dist/components/core/Text/Text.d.ts +2 -1
- package/dist/components/core/Text/Text.js +3 -1
- package/dist/components/core/Text/index.d.ts +1 -1
- package/dist/components/core/Text/textTypes.d.ts +4 -0
- package/dist/components/core/TextArea/textAreaAnimations.js +5 -3
- package/dist/components/core/TextArea/textAreaParts.js +94 -12
- package/dist/components/core/TextArea/textAreaStyles.d.ts +3 -3
- package/dist/components/core/TextArea/textAreaStyles.js +2 -2
- package/dist/components/core/TextArea/textAreaTypes.d.ts +1 -0
- package/dist/components/core/TextArea/useTextAreaRootState.js +2 -1
- package/dist/components/core/TimeField/TimeField.js +6 -1
- package/dist/components/core/TimeField/timeFieldAnimations.d.ts +3 -2
- package/dist/components/core/TimeField/timeFieldAnimations.js +13 -4
- package/dist/components/core/TimeField/timeFieldParts.js +50 -30
- package/dist/components/core/TimeField/timeFieldStyles.d.ts +1 -1
- package/dist/components/core/TimeField/timeFieldStyles.js +1 -1
- package/dist/components/core/TimeField/timeFieldTypes.d.ts +2 -0
- package/dist/components/core/TimeField/useTimeFieldControlState.d.ts +4 -1
- package/dist/components/core/TimeField/useTimeFieldControlState.js +141 -39
- package/dist/components/core/TimeField/useTimeFieldRootState.js +3 -1
- package/dist/components/core/Toast/toastA11y.js +17 -7
- package/dist/components/core/Toast/toastAPI.d.ts +17 -1
- package/dist/components/core/Toast/toastAPI.js +82 -0
- package/dist/components/core/Toast/toastAnimations.d.ts +1 -1
- package/dist/components/core/Toast/toastAnimations.js +106 -98
- package/dist/components/core/Toast/toastProvider.js +25 -3
- package/dist/components/core/Toast/toastStyles.d.ts +5 -3
- package/dist/components/core/Toast/toastStyles.js +5 -3
- package/dist/components/core/Toast/toastTypes.d.ts +9 -0
- package/dist/components/core/Toast/useToastProviderState.js +61 -6
- package/dist/components/core/ToggleButton/ToggleButton.js +23 -7
- package/dist/components/core/ToggleButton/toggleButtonAnimations.d.ts +4 -2
- package/dist/components/core/ToggleButton/toggleButtonAnimations.js +64 -41
- package/dist/components/core/ToggleButton/toggleButtonStyles.d.ts +2 -1
- package/dist/components/core/ToggleButton/toggleButtonStyles.js +21 -2
- package/dist/components/core/ToggleButton/toggleButtonTypes.d.ts +3 -0
- package/dist/components/core/ToggleButton/useToggleButtonRootState.d.ts +1 -1
- package/dist/components/core/ToggleButton/useToggleButtonRootState.js +4 -7
- package/dist/components/core/Tooltip/tooltipAnimations.js +17 -1
- package/dist/components/core/Tooltip/tooltipParts.js +83 -26
- package/dist/components/core/Tooltip/tooltipPosition.js +57 -32
- package/dist/components/core/Tooltip/tooltipStyles.d.ts +2 -2
- package/dist/components/core/Tooltip/tooltipStyles.js +2 -2
- package/dist/components/core/Tooltip/tooltipTypes.d.ts +5 -0
- package/dist/components/core/Tooltip/useTooltipRootState.js +59 -10
- package/dist/components/core/utils/bodyScrollLock.js +12 -3
- package/dist/components/core/utils/clampNumber.d.ts +1 -1
- package/dist/components/core/utils/clampNumber.js +4 -1
- package/dist/components/core/utils/containedEscape.js +12 -0
- package/dist/components/core/utils/fieldFormDom.d.ts +24 -0
- package/dist/components/core/utils/fieldFormDom.js +37 -2
- package/dist/components/core/utils/focusElement.js +2 -2
- package/dist/components/core/utils/hoverInteractiveLift.d.ts +12 -0
- package/dist/components/core/utils/hoverInteractiveLift.js +43 -2
- package/dist/components/core/utils/inputAffixStyles.js +1 -1
- package/dist/components/core/utils/mergeAsChildProps.d.ts +7 -0
- package/dist/components/core/utils/mergeAsChildProps.js +23 -2
- package/dist/components/core/utils/optionListItemStyles.d.ts +2 -2
- package/dist/components/core/utils/optionListItemStyles.js +2 -2
- package/dist/components/core/utils/overlayLayer.d.ts +39 -0
- package/dist/components/core/utils/overlayLayer.js +164 -2
- package/dist/components/core/utils/overlayTriggerSqueeze.js +5 -4
- package/dist/components/core/utils/portalContainer.d.ts +27 -5
- package/dist/components/core/utils/portalContainer.js +38 -4
- package/dist/components/core/utils/pressRipple.js +2 -1
- package/dist/components/core/utils/readingDirection.js +8 -0
- package/dist/components/core/utils/runOpenAfterSqueeze.d.ts +7 -0
- package/dist/components/core/utils/runOpenAfterSqueeze.js +10 -3
- package/dist/components/core/utils/semanticStatusSurface.js +4 -4
- package/dist/components/core/utils/sizeLayout/panel.js +4 -4
- package/dist/components/core/utils/slotMotion/recipes/loadKitRecipe.js +2 -0
- package/dist/components/core/utils/slotMotion/recipes/switchThumb.js +3 -0
- package/dist/components/core/utils/slotMotion/resolveMotionValue.js +1 -1
- package/dist/components/core/utils/slotMotion/slotMount.js +1 -1
- package/dist/components/core/utils/slotMotion/useBarFillMotion.js +8 -3
- package/dist/components/core/utils/useCollapsibleHeight.js +2 -1
- package/dist/components/core/utils/useConvergeRipples.js +4 -1
- package/dist/components/core/utils/useModalMotion.d.ts +2 -0
- package/dist/components/core/utils/useModalMotion.js +19 -3
- package/dist/components/core/utils/usePressableElementTextMotion.js +4 -5
- package/dist/components/core/utils/useShadowMotion.js +28 -7
- package/dist/index.d.ts +3 -3
- package/dist/skins/resolveVariantVisual.d.ts +1 -1
- package/dist/skins/resolveVariantVisual.js +2 -2
- package/dist/skins/skinContext.js +6 -5
- package/dist/skins/skinLiveSlots.generated.d.ts +1 -1
- package/dist/skins/skinLiveSlots.generated.js +1 -1
- package/dist/skins/skinShell.js +9 -4
- package/dist/skins/skinSlots.generated.d.ts +1 -1
- package/dist/skins/skinSlots.generated.js +2 -0
- package/dist/studio/colorPresets.d.ts +1 -1
- package/dist/studio/colorPresets.js +8 -1
- package/dist/studio.d.ts +1 -1
- package/dist/studio.js +13 -1
- package/dist/theme/namedPalettes.d.ts +12 -0
- package/dist/theme/namedPalettes.js +697 -1
- package/dist/theme/themeDefaults.js +6 -3
- package/dist/tokens/config.d.ts +8 -2
- package/dist/tokens/config.js +15 -2
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.js +9 -0
- package/dist/ui.css +499 -55
- package/dist/utils/cn.js +89 -2
- package/package.json +1 -1
- package/dist/components/composite/utils/useOptionGroupRequiredAnchor.js +0 -17
- package/dist/components/composite/utils/useOptionGroupSingleValue.js +0 -24
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, Children, isValidElement, useRef, useCallback, useMemo } from "react";
|
|
3
|
+
import { forwardRef, Children, isValidElement, useRef, useCallback, useLayoutEffect, useMemo } from "react";
|
|
4
4
|
import { dataVariantProps } from "../utils/dataContract.js";
|
|
5
5
|
import { cn } from "../../../utils/cn.js";
|
|
6
6
|
import { letterFromLabel } from "./avatarAPI.js";
|
|
@@ -11,8 +11,8 @@ import { avatarGroupClass, AVATAR_FALLBACK_TEXT, avatarFallbackClass, avatarImag
|
|
|
11
11
|
import { useMotionPart } from "../utils/slotMotion/useMotionPart.js";
|
|
12
12
|
import { Text } from "../Text/Text.js";
|
|
13
13
|
const AvatarImage = forwardRef(
|
|
14
|
-
function AvatarImage2({ className = "", motion, onLoad, onError, ...rest }, ref) {
|
|
15
|
-
const { imageStatus, onImageLoad, onImageError } = useAvatarContext("Avatar.Image");
|
|
14
|
+
function AvatarImage2({ className = "", motion, onLoad, onError, alt, src, ...rest }, ref) {
|
|
15
|
+
const { imageStatus, onImageLoad, onImageError, resetImageStatus } = useAvatarContext("Avatar.Image");
|
|
16
16
|
const slotClassNames = useAvatarClassNames();
|
|
17
17
|
const scope = useOptionalAvatarMotionScope();
|
|
18
18
|
const imgRef = useRef(null);
|
|
@@ -29,6 +29,25 @@ const AvatarImage = forwardRef(
|
|
|
29
29
|
},
|
|
30
30
|
[setRef]
|
|
31
31
|
);
|
|
32
|
+
useLayoutEffect(() => {
|
|
33
|
+
if (!src) {
|
|
34
|
+
resetImageStatus();
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const img = imgRef.current;
|
|
38
|
+
if (img && img.complete) {
|
|
39
|
+
if (img.naturalWidth > 0) {
|
|
40
|
+
onImageLoad();
|
|
41
|
+
} else {
|
|
42
|
+
onImageError();
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
resetImageStatus();
|
|
46
|
+
}
|
|
47
|
+
return () => {
|
|
48
|
+
resetImageStatus();
|
|
49
|
+
};
|
|
50
|
+
}, [src, onImageLoad, onImageError, resetImageStatus]);
|
|
32
51
|
const mergedOnLoad = useCallback(
|
|
33
52
|
(e) => {
|
|
34
53
|
onLoad?.(e);
|
|
@@ -43,17 +62,18 @@ const AvatarImage = forwardRef(
|
|
|
43
62
|
},
|
|
44
63
|
[onError, onImageError]
|
|
45
64
|
);
|
|
46
|
-
const visible = imageStatus === "loaded";
|
|
65
|
+
const visible = Boolean(src) && imageStatus === "loaded";
|
|
47
66
|
useAvatarImageMotion(scope, visible, imgRef);
|
|
48
67
|
return /* @__PURE__ */ jsx(
|
|
49
68
|
"img",
|
|
50
69
|
{
|
|
51
70
|
ref: bindRef,
|
|
71
|
+
src,
|
|
52
72
|
className: avatarImageClass(visible, cn(slotClassNames.image, className)),
|
|
53
|
-
alt: rest.alt ?? "",
|
|
54
73
|
onLoad: mergedOnLoad,
|
|
55
74
|
onError: mergedOnError,
|
|
56
|
-
...rest
|
|
75
|
+
...rest,
|
|
76
|
+
alt: alt ?? ""
|
|
57
77
|
}
|
|
58
78
|
);
|
|
59
79
|
}
|
|
@@ -24,15 +24,19 @@ function useAvatarRootState({
|
|
|
24
24
|
const onImageError = useCallback(() => {
|
|
25
25
|
setImageStatus("error");
|
|
26
26
|
}, []);
|
|
27
|
+
const resetImageStatus = useCallback(() => {
|
|
28
|
+
setImageStatus("idle");
|
|
29
|
+
}, []);
|
|
27
30
|
const ctx = useMemo(
|
|
28
31
|
() => ({
|
|
29
32
|
size,
|
|
30
33
|
label,
|
|
31
34
|
imageStatus,
|
|
32
35
|
onImageLoad,
|
|
33
|
-
onImageError
|
|
36
|
+
onImageError,
|
|
37
|
+
resetImageStatus
|
|
34
38
|
}),
|
|
35
|
-
[size, label, imageStatus, onImageLoad, onImageError]
|
|
39
|
+
[size, label, imageStatus, onImageLoad, onImageError, resetImageStatus]
|
|
36
40
|
);
|
|
37
41
|
const isCompound = useMemo(() => hasCompoundChildren(children), [children]);
|
|
38
42
|
const hasLabel = avatarHasLabel(label);
|
|
@@ -29,6 +29,8 @@ const BadgeRoot = forwardRef(function Badge({
|
|
|
29
29
|
playInitialState,
|
|
30
30
|
onPointerOver,
|
|
31
31
|
onPointerOut,
|
|
32
|
+
onPointerDown,
|
|
33
|
+
onPointerUp,
|
|
32
34
|
...rest
|
|
33
35
|
}, forwardedRef) {
|
|
34
36
|
const variant = useSkinVariant(variantProp);
|
|
@@ -42,7 +44,8 @@ const BadgeRoot = forwardRef(function Badge({
|
|
|
42
44
|
layoutKind,
|
|
43
45
|
bodyContent,
|
|
44
46
|
iconOnlyBody,
|
|
45
|
-
dataIcon
|
|
47
|
+
dataIcon,
|
|
48
|
+
singleDigit
|
|
46
49
|
} = useBadgeRootState({
|
|
47
50
|
variant,
|
|
48
51
|
status,
|
|
@@ -98,9 +101,10 @@ const BadgeRoot = forwardRef(function Badge({
|
|
|
98
101
|
bodyContent,
|
|
99
102
|
iconOnlyBody,
|
|
100
103
|
dataIcon,
|
|
104
|
+
singleDigit,
|
|
101
105
|
surfaceClass,
|
|
102
106
|
className,
|
|
103
|
-
rest
|
|
107
|
+
rest: { ...rest, onPointerDown, onPointerUp }
|
|
104
108
|
}
|
|
105
109
|
)
|
|
106
110
|
}
|
|
@@ -125,6 +129,7 @@ function BadgeSurface({
|
|
|
125
129
|
bodyContent,
|
|
126
130
|
iconOnlyBody,
|
|
127
131
|
dataIcon,
|
|
132
|
+
singleDigit,
|
|
128
133
|
surfaceClass,
|
|
129
134
|
className,
|
|
130
135
|
rest
|
|
@@ -177,7 +182,8 @@ function BadgeSurface({
|
|
|
177
182
|
shell,
|
|
178
183
|
className,
|
|
179
184
|
rest: paintedRest,
|
|
180
|
-
iconOnlyBody
|
|
185
|
+
iconOnlyBody,
|
|
186
|
+
singleDigit
|
|
181
187
|
}
|
|
182
188
|
);
|
|
183
189
|
}
|
|
@@ -4,6 +4,12 @@ function badgeHasAccessibleName(props) {
|
|
|
4
4
|
return typeof props["aria-label"] === "string" || typeof props["aria-labelledby"] === "string";
|
|
5
5
|
}
|
|
6
6
|
function badgeRootA11yProps(props) {
|
|
7
|
+
if (props["aria-hidden"] !== void 0) {
|
|
8
|
+
return {
|
|
9
|
+
"aria-hidden": props["aria-hidden"],
|
|
10
|
+
role: badgeHasAccessibleName(props) ? "img" : void 0
|
|
11
|
+
};
|
|
12
|
+
}
|
|
7
13
|
if (badgeHasAccessibleName(props)) {
|
|
8
14
|
return { role: "img" };
|
|
9
15
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
3
3
|
import { Children, isValidElement, Fragment } from "react";
|
|
4
|
-
import { cn } from "../../../utils/cn.js";
|
|
5
4
|
import { ensureDecorativeIcon } from "./badgeA11y.js";
|
|
6
5
|
import { BadgeInlineChild } from "./badgeInlineChild.js";
|
|
7
6
|
import { isInlineIconChild, readBadgeInlineIconPosition } from "./badgeInlineIcon.js";
|
|
8
|
-
import { badgeIconSlotClass, BADGE_TEXT_VARIANT, BADGE_TEXT_CLASS } from "./badgeStyles.js";
|
|
7
|
+
import { badgeIconSlotClass, BADGE_SINGLE_DIGIT_TEXT_CLASS, BADGE_TEXT_VARIANT, BADGE_TEXT_CLASS } from "./badgeStyles.js";
|
|
9
8
|
import { Text } from "../Text/Text.js";
|
|
10
9
|
function hasInlineIconChildren(children) {
|
|
11
10
|
return Children.toArray(children).some(isInlineIconChild);
|
|
@@ -94,7 +93,7 @@ function resolveBadgeBody({
|
|
|
94
93
|
as: "span",
|
|
95
94
|
textStyle: BADGE_TEXT_VARIANT[size],
|
|
96
95
|
inheritColor: true,
|
|
97
|
-
className:
|
|
96
|
+
className: BADGE_SINGLE_DIGIT_TEXT_CLASS,
|
|
98
97
|
children: badgeSingleDigitLabel(children)
|
|
99
98
|
}
|
|
100
99
|
) : inlineIconOnly ? inlineBody : resolvedIcon ? /* @__PURE__ */ jsx("span", { className: badgeIconSlotClass(size, iconSlotClass), children: isValidElement(resolvedIcon) ? ensureDecorativeIcon(resolvedIcon) : resolvedIcon }) : children;
|
|
@@ -102,7 +101,8 @@ function resolveBadgeBody({
|
|
|
102
101
|
layoutKind: "iconOnly",
|
|
103
102
|
bodyContent,
|
|
104
103
|
iconOnlyBody,
|
|
105
|
-
dataIcon: void 0
|
|
104
|
+
dataIcon: void 0,
|
|
105
|
+
singleDigit
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
const showIconWithText = Boolean(!inlineIconMode && iconSlot && textSlot);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRef, useCallback, useMemo
|
|
2
|
+
import { useRef, useLayoutEffect, useCallback, useMemo } from "react";
|
|
3
3
|
import { mergeForwardedRef } from "../utils/mergeRefs.js";
|
|
4
4
|
import { useMotionConfig } from "../utils/motionConfigContext.js";
|
|
5
|
-
import { shouldSkipInteractiveHoverLift, initElementShadow, shadowBase } from "../utils/hoverInteractiveLift.js";
|
|
5
|
+
import { isKitHoverLiftRecipe, primeInteractiveScaleRest, shouldSkipInteractiveHoverLift, initElementShadow, shadowBase } from "../utils/hoverInteractiveLift.js";
|
|
6
6
|
import { useSecondLevelShadow, SHADOW_LIFT_MOTION_CLASS, useSecondLevelShadowContainer } from "../utils/useShadowMotion.js";
|
|
7
7
|
import { useBadgeLiftContext, useBadgeMotionScope } from "./badgeContext.js";
|
|
8
8
|
import { overlaySkinMotion, usesKitElevation } from "../../../skins/resolveVariantVisual.js";
|
|
@@ -53,10 +53,20 @@ function useBadgeAnimations({
|
|
|
53
53
|
const kitSurface = usesKitElevation(variant, KIT_BADGE_VARIANTS);
|
|
54
54
|
const splitLift = Boolean(isDirectAnchorChild && liftCtx?.hoverLift && kitSurface);
|
|
55
55
|
const selfLiftEnabled = hoverLift && !splitLift;
|
|
56
|
+
const config = useMotionConfig();
|
|
56
57
|
const restShadow = kitSurface && !splitLift;
|
|
57
58
|
const selfLiftShadow = useSecondLevelShadow(rootRef, restShadow, {
|
|
58
|
-
interactive: false
|
|
59
|
+
interactive: false,
|
|
60
|
+
killMotionOnUnmount: false
|
|
59
61
|
});
|
|
62
|
+
useLayoutEffect(() => {
|
|
63
|
+
if (!restShadow || !selfLiftEnabled) return;
|
|
64
|
+
const enterValue = scope.resolve("root", "enter", rootMotionRef.current);
|
|
65
|
+
const hoverValue = scope.resolve("root", "hoverIn", rootMotionRef.current);
|
|
66
|
+
if ((enterValue == null || enterValue === false) && isKitHoverLiftRecipe(hoverValue)) {
|
|
67
|
+
primeInteractiveScaleRest(rootRef.current, config);
|
|
68
|
+
}
|
|
69
|
+
}, [config, restShadow, scope, selfLiftEnabled, variant]);
|
|
60
70
|
const setMergedRef = useCallback(
|
|
61
71
|
(node) => {
|
|
62
72
|
rootRef.current = node;
|
|
@@ -105,10 +115,15 @@ function useBadgeAnimations({
|
|
|
105
115
|
}, [isDirectAnchorChild, liftCtx, scope, splitLift]);
|
|
106
116
|
const { meaningChild, icon, dot, iconOnly, children } = syncDeps;
|
|
107
117
|
useLayoutEffect(() => {
|
|
118
|
+
let active = true;
|
|
108
119
|
syncDirectChild();
|
|
109
120
|
queueMicrotask(() => {
|
|
121
|
+
if (!active || !rootRef.current) return;
|
|
110
122
|
syncDirectChild();
|
|
111
123
|
});
|
|
124
|
+
return () => {
|
|
125
|
+
active = false;
|
|
126
|
+
};
|
|
112
127
|
}, [
|
|
113
128
|
isDirectAnchorChild,
|
|
114
129
|
liftCtx?.anchorCommitGen,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BadgeDotViewProps, BadgeIconOnlyViewProps, BadgeTextViewProps } from './badgeTypes.js';
|
|
3
3
|
export declare function BadgeDotView({ size, variant, status, shell, className, rest, }: BadgeDotViewProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare function BadgeIconOnlyView({ size, surfaceClass, shell, className, rest, iconOnlyBody, }: BadgeIconOnlyViewProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function BadgeIconOnlyView({ size, surfaceClass, shell, className, rest, iconOnlyBody, singleDigit, }: BadgeIconOnlyViewProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare function BadgeTextView({ size, surfaceClass, shell, className, rest, bodyContent, dataIcon, }: BadgeTextViewProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const BadgeAnchor: import('react').ForwardRefExoticComponent<Omit<import('react').HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
7
7
|
children?: ReactNode;
|
|
@@ -95,7 +95,8 @@ function BadgeIconOnlyView({
|
|
|
95
95
|
shell,
|
|
96
96
|
className,
|
|
97
97
|
rest,
|
|
98
|
-
iconOnlyBody
|
|
98
|
+
iconOnlyBody,
|
|
99
|
+
singleDigit = false
|
|
99
100
|
}) {
|
|
100
101
|
const slotClassNames = useBadgeClassNames();
|
|
101
102
|
const iconInnerCls = badgeIconOnlyViewClass(
|
|
@@ -103,7 +104,7 @@ function BadgeIconOnlyView({
|
|
|
103
104
|
surfaceClass,
|
|
104
105
|
cn(slotClassNames.root, slotClassNames.iconOnly, className)
|
|
105
106
|
);
|
|
106
|
-
return /* @__PURE__ */ jsx(BadgeShell, { ...shell, className: iconInnerCls, rest, withA11y:
|
|
107
|
+
return /* @__PURE__ */ jsx(BadgeShell, { ...shell, className: iconInnerCls, rest, withA11y: !singleDigit, children: iconOnlyBody });
|
|
107
108
|
}
|
|
108
109
|
function BadgeTextView({
|
|
109
110
|
size,
|
|
@@ -134,6 +135,8 @@ const BadgeAnchor = forwardRef(function BadgeAnchor2({
|
|
|
134
135
|
playInitialState,
|
|
135
136
|
onPointerOver: onPointerOverFromProps,
|
|
136
137
|
onPointerOut: onPointerOutFromProps,
|
|
138
|
+
onPointerDown: onPointerDownFromProps,
|
|
139
|
+
onPointerUp: onPointerUpFromProps,
|
|
137
140
|
...rest
|
|
138
141
|
}, ref) {
|
|
139
142
|
const hoverPointerInsideRef = useRef(false);
|
|
@@ -168,7 +171,7 @@ const BadgeAnchor = forwardRef(function BadgeAnchor2({
|
|
|
168
171
|
hoverLift,
|
|
169
172
|
onPointerOverFromProps,
|
|
170
173
|
onPointerOutFromProps,
|
|
171
|
-
rest,
|
|
174
|
+
rest: { ...rest, onPointerDown: onPointerDownFromProps, onPointerUp: onPointerUpFromProps },
|
|
172
175
|
forwardedRef: ref,
|
|
173
176
|
children
|
|
174
177
|
}
|
|
@@ -11,6 +11,7 @@ export declare const BADGE_DOT_DIM: Record<BadgeSize, string>;
|
|
|
11
11
|
export declare const BADGE_TEXT_VARIANT: Record<BadgeSize, TextVariant>;
|
|
12
12
|
/** Same tight line-box as panel titles (`Card.Title` → `leading-none`). */
|
|
13
13
|
export declare const BADGE_TEXT_CLASS = "leading-none";
|
|
14
|
+
export declare const BADGE_SINGLE_DIGIT_TEXT_CLASS = "leading-none tabular-nums";
|
|
14
15
|
export declare const BADGE_ICON_SLOT_SIZE: Record<BadgeSize, string>;
|
|
15
16
|
export declare const BADGE_TEXT_ROW_BASE = "box-border isolate inline-flex max-w-full shrink-0 select-none items-center justify-center truncate rounded-full whitespace-nowrap motion-reduce:transition-none";
|
|
16
17
|
export declare const BADGE_ICON_ONLY_BASE = "box-border isolate inline-flex items-center justify-center rounded-full whitespace-nowrap";
|
|
@@ -41,6 +41,7 @@ const BADGE_TEXT_VARIANT = {
|
|
|
41
41
|
large: "mid"
|
|
42
42
|
};
|
|
43
43
|
const BADGE_TEXT_CLASS = "leading-none";
|
|
44
|
+
const BADGE_SINGLE_DIGIT_TEXT_CLASS = "leading-none tabular-nums";
|
|
44
45
|
const BADGE_ICON_SLOT_SIZE = {
|
|
45
46
|
small: iconSlotSizeClass("small"),
|
|
46
47
|
base: iconSlotSizeClass("small"),
|
|
@@ -153,6 +154,7 @@ export {
|
|
|
153
154
|
BADGE_ICON_SLOT_SIZE,
|
|
154
155
|
BADGE_SHELL_ANCHOR_CHILD_CLASS,
|
|
155
156
|
BADGE_SHELL_SPLIT_OUTER_CLASS,
|
|
157
|
+
BADGE_SINGLE_DIGIT_TEXT_CLASS,
|
|
156
158
|
BADGE_TEXT_CLASS,
|
|
157
159
|
BADGE_TEXT_ROW,
|
|
158
160
|
BADGE_TEXT_ROW_BASE,
|
|
@@ -77,6 +77,7 @@ export type BadgeIconOnlyViewProps = {
|
|
|
77
77
|
className: string;
|
|
78
78
|
rest: HTMLAttributes<HTMLSpanElement>;
|
|
79
79
|
iconOnlyBody: ReactNode;
|
|
80
|
+
singleDigit?: boolean;
|
|
80
81
|
};
|
|
81
82
|
export type BadgeTextViewProps = {
|
|
82
83
|
size: BadgeSize;
|
|
@@ -103,6 +104,7 @@ export type ResolvedBadgeBody = {
|
|
|
103
104
|
bodyContent: ReactNode;
|
|
104
105
|
iconOnlyBody: ReactNode;
|
|
105
106
|
dataIcon: IconPosition | undefined;
|
|
107
|
+
singleDigit?: boolean;
|
|
106
108
|
};
|
|
107
109
|
export type BadgeAnchorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
108
110
|
children?: ReactNode;
|
|
@@ -10,4 +10,5 @@ export declare function useBadgeRootState({ variant: variantProp, status, size,
|
|
|
10
10
|
bodyContent: import('react').ReactNode;
|
|
11
11
|
iconOnlyBody: import('react').ReactNode;
|
|
12
12
|
dataIcon: import('../utils/iconPosition.js').IconPosition | undefined;
|
|
13
|
+
singleDigit: boolean | undefined;
|
|
13
14
|
};
|
|
@@ -57,25 +57,31 @@ function collapsedHiddenItems(items) {
|
|
|
57
57
|
function toCollapsedPieces(items) {
|
|
58
58
|
const n = items.length;
|
|
59
59
|
if (n === 0) return [];
|
|
60
|
+
const hasExplicitCurrent = items.some((item) => item.current === true);
|
|
60
61
|
if (n <= 3) {
|
|
61
62
|
return items.map((item, i) => ({
|
|
62
63
|
kind: "segment",
|
|
63
64
|
item,
|
|
64
|
-
isLast: item.current ?? i === n - 1
|
|
65
|
+
isLast: item.current ?? (!hasExplicitCurrent && i === n - 1)
|
|
65
66
|
}));
|
|
66
67
|
}
|
|
67
68
|
return [
|
|
68
|
-
{ kind: "segment", item: items[0], isLast: false },
|
|
69
|
+
{ kind: "segment", item: items[0], isLast: items[0].current ?? false },
|
|
69
70
|
{ kind: "ellipsis", hiddenItems: collapsedHiddenItems(items) },
|
|
70
|
-
{ kind: "segment", item: items[n - 2], isLast: false },
|
|
71
|
-
{
|
|
71
|
+
{ kind: "segment", item: items[n - 2], isLast: items[n - 2].current ?? false },
|
|
72
|
+
{
|
|
73
|
+
kind: "segment",
|
|
74
|
+
item: items[n - 1],
|
|
75
|
+
isLast: items[n - 1].current ?? !hasExplicitCurrent
|
|
76
|
+
}
|
|
72
77
|
];
|
|
73
78
|
}
|
|
74
79
|
function toExpandedPieces(items) {
|
|
80
|
+
const hasExplicitCurrent = items.some((item) => item.current === true);
|
|
75
81
|
return items.map((item, i) => ({
|
|
76
82
|
kind: "segment",
|
|
77
83
|
item,
|
|
78
|
-
isLast: item.current ?? i === items.length - 1
|
|
84
|
+
isLast: item.current ?? (!hasExplicitCurrent && i === items.length - 1)
|
|
79
85
|
}));
|
|
80
86
|
}
|
|
81
87
|
function breadcrumbListItemKey(piece, idx) {
|
|
@@ -15,6 +15,7 @@ import { breadcrumbChevronClass, breadcrumbsSeparatorClass, breadcrumbsListClass
|
|
|
15
15
|
import { useBreadcrumbsListState } from "./useBreadcrumbsRootState.js";
|
|
16
16
|
import { cn } from "../../../utils/cn.js";
|
|
17
17
|
import { mergeMotionSlotMaps } from "../utils/slotMotion/resolveMotionValue.js";
|
|
18
|
+
import { mergeMotionRootSiblings } from "../utils/slotMotion/motionEvents.js";
|
|
18
19
|
import { Text } from "../Text/Text.js";
|
|
19
20
|
import { useMotionPart } from "../utils/slotMotion/useMotionPart.js";
|
|
20
21
|
function BreadcrumbsItem(_props) {
|
|
@@ -161,7 +162,7 @@ function BreadcrumbSegment({ piece }) {
|
|
|
161
162
|
}
|
|
162
163
|
);
|
|
163
164
|
}
|
|
164
|
-
if (item.href || item.onClick) {
|
|
165
|
+
if (item.href || item.onClick || item.link) {
|
|
165
166
|
return /* @__PURE__ */ jsx(
|
|
166
167
|
InteractiveCrumb,
|
|
167
168
|
{
|
|
@@ -173,6 +174,9 @@ function BreadcrumbSegment({ piece }) {
|
|
|
173
174
|
textClassName: slotClassNames.itemLinkText,
|
|
174
175
|
motion: item.motion,
|
|
175
176
|
motionController: item.motionController,
|
|
177
|
+
motionState: item.motionState,
|
|
178
|
+
motionPayload: item.motionPayload,
|
|
179
|
+
playInitialState: item.playInitialState,
|
|
176
180
|
children: item.label
|
|
177
181
|
}
|
|
178
182
|
);
|
|
@@ -227,10 +231,15 @@ const InteractiveCrumb = forwardRef(
|
|
|
227
231
|
}, forwardedRef) {
|
|
228
232
|
const parentScope = useOptionalBreadcrumbsMotionScope();
|
|
229
233
|
const motionDefaults = useMemo(() => resolveBreadcrumbsItemMotionDefaults(), []);
|
|
230
|
-
const
|
|
234
|
+
const mergedSlots = mergeMotionSlotMaps(
|
|
231
235
|
parentScope?.getRootMotion(),
|
|
232
236
|
motion ? { itemLink: motion } : void 0
|
|
233
237
|
);
|
|
238
|
+
const siblings = mergeMotionRootSiblings({
|
|
239
|
+
events: parentScope?.getEvents(),
|
|
240
|
+
states: parentScope?.getStates()
|
|
241
|
+
});
|
|
242
|
+
const mergedMotion = { ...mergedSlots, ...siblings };
|
|
234
243
|
return /* @__PURE__ */ jsx(
|
|
235
244
|
BreadcrumbsMotionProvider,
|
|
236
245
|
{
|
|
@@ -354,7 +363,12 @@ function BreadcrumbsEllipsisMenu({ hiddenItems }) {
|
|
|
354
363
|
const count = hiddenItems.length;
|
|
355
364
|
const parentScope = useOptionalBreadcrumbsMotionScope();
|
|
356
365
|
const motionDefaults = useMemo(() => resolveBreadcrumbsEllipsisMotionDefaults(), []);
|
|
357
|
-
const
|
|
366
|
+
const mergedSlots = mergeMotionSlotMaps(parentScope?.getRootMotion(), void 0);
|
|
367
|
+
const siblings = mergeMotionRootSiblings({
|
|
368
|
+
events: parentScope?.getEvents(),
|
|
369
|
+
states: parentScope?.getStates()
|
|
370
|
+
});
|
|
371
|
+
const mergedMotion = { ...mergedSlots, ...siblings };
|
|
358
372
|
if (count === 0) return null;
|
|
359
373
|
return /* @__PURE__ */ jsx(BreadcrumbsMotionProvider, { motion: mergedMotion, defaults: motionDefaults, children: /* @__PURE__ */ jsx(
|
|
360
374
|
BreadcrumbsEllipsisMenuSurface,
|
|
@@ -410,12 +424,13 @@ function BreadcrumbsEllipsisMenuSurface({
|
|
|
410
424
|
classNames: {
|
|
411
425
|
popoverBody: breadcrumbsEllipsisPopoverBodyClass(slotClassNames.ellipsisPopover)
|
|
412
426
|
},
|
|
413
|
-
children: hiddenItems.map((item) => {
|
|
414
|
-
const itemKey = item.href ??
|
|
427
|
+
children: hiddenItems.map((item, idx) => {
|
|
428
|
+
const itemKey = `hidden-${idx}-${item.href ?? (typeof item.label === "string" ? item.label : idx)}`;
|
|
415
429
|
return /* @__PURE__ */ jsx(
|
|
416
430
|
BreadcrumbsEllipsisDropdownItem,
|
|
417
431
|
{
|
|
418
432
|
item,
|
|
433
|
+
itemKey,
|
|
419
434
|
className: breadcrumbsDropdownItemClass(
|
|
420
435
|
cn("", slotClassNames.dropdownItem, item.className)
|
|
421
436
|
)
|
|
@@ -429,9 +444,9 @@ function BreadcrumbsEllipsisMenuSurface({
|
|
|
429
444
|
}
|
|
430
445
|
function BreadcrumbsEllipsisDropdownItem({
|
|
431
446
|
item,
|
|
447
|
+
itemKey,
|
|
432
448
|
className
|
|
433
449
|
}) {
|
|
434
|
-
const itemKey = item.href ?? `hidden-${String(item.label)}`;
|
|
435
450
|
if (item.href) {
|
|
436
451
|
return /* @__PURE__ */ jsx(
|
|
437
452
|
Dropdown.Item,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TEXT_COLOR_TRANSITION } from "../utils/hoverVariant.js";
|
|
2
2
|
import { cn } from "../../../utils/cn.js";
|
|
3
3
|
const CRUMB_INTERACTIVE_INNER_CLASS = cn(
|
|
4
|
-
"inline-flex max-w-[min(12rem,46vw)] min-w-0 cursor-pointer truncate rounded-mid px-xsmall py-xsmall text-muted no-underline outline-none focus-ring",
|
|
4
|
+
"inline-flex max-w-[min(12rem,46vw)] min-w-0 cursor-pointer truncate rounded-mid px-xsmall py-xsmall text-muted-foreground no-underline outline-none focus-ring",
|
|
5
5
|
TEXT_COLOR_TRANSITION,
|
|
6
6
|
"hover:text-foreground"
|
|
7
7
|
);
|
|
@@ -10,7 +10,7 @@ const CRUMB_INTERACTIVE_BUTTON_CLASS = cn(
|
|
|
10
10
|
"border-0 bg-transparent font-[inherit]"
|
|
11
11
|
);
|
|
12
12
|
const BREADCRUMBS_ELLIPSIS_TRIGGER_CLASS = cn(
|
|
13
|
-
"inline-flex min-w-0 cursor-pointer rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted outline-none focus-ring",
|
|
13
|
+
"inline-flex min-w-0 cursor-pointer rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted-foreground outline-none focus-ring",
|
|
14
14
|
TEXT_COLOR_TRANSITION,
|
|
15
15
|
"hover:text-foreground aria-expanded:text-foreground"
|
|
16
16
|
);
|
|
@@ -39,10 +39,10 @@ function breadcrumbCurrentClass(className) {
|
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
function breadcrumbStaticClass(className) {
|
|
42
|
-
return cn("max-w-[min(12rem,46vw)] truncate px-xsmall py-xsmall text-muted", className);
|
|
42
|
+
return cn("max-w-[min(12rem,46vw)] truncate px-xsmall py-xsmall text-muted-foreground", className);
|
|
43
43
|
}
|
|
44
44
|
function breadcrumbChevronClass(className) {
|
|
45
|
-
return cn("shrink-0 text-muted opacity-75 icon-small", className);
|
|
45
|
+
return cn("shrink-0 text-muted-foreground opacity-75 icon-small rtl:rotate-180", className);
|
|
46
46
|
}
|
|
47
47
|
function crumbInteractiveInnerClass(className) {
|
|
48
48
|
return cn(CRUMB_INTERACTIVE_INNER_CLASS, className);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, isValidElement, Children, useRef, useMemo, cloneElement } from "react";
|
|
4
|
-
import {
|
|
2
|
+
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, isValidElement, Fragment, Children, useRef, useMemo, cloneElement } from "react";
|
|
4
|
+
import { dataFlag, dataGroupSegment, dataVariantProps } from "../utils/dataContract.js";
|
|
5
5
|
import { mergeAsChildProps } from "../utils/mergeAsChildProps.js";
|
|
6
6
|
import { resolveButtonMotionDefaults, useButtonAnimations } from "./buttonAnimations.js";
|
|
7
7
|
import { buttonHasCompoundPart } from "./buttonAPI.js";
|
|
@@ -48,6 +48,7 @@ function ButtonSurface({
|
|
|
48
48
|
}) {
|
|
49
49
|
const animations = useButtonAnimations({
|
|
50
50
|
variant: state.variant,
|
|
51
|
+
disabled: state.userDisabled,
|
|
51
52
|
blocked: state.blocked,
|
|
52
53
|
groupSegment: state.groupSegment,
|
|
53
54
|
motion,
|
|
@@ -68,6 +69,9 @@ function ButtonSurface({
|
|
|
68
69
|
}
|
|
69
70
|
state.onClick?.(event);
|
|
70
71
|
};
|
|
72
|
+
const rawDataState = rest["data-state"];
|
|
73
|
+
const buttonDataState = state.isLoading ? "loading" : motionState === "success" ? "success" : motionState === "error" ? "error" : motionState === "idle" ? "idle" : rawDataState === "loading" || rawDataState === "success" || rawDataState === "error" || rawDataState === "idle" ? rawDataState : void 0;
|
|
74
|
+
const restTabIndex = rest.tabIndex;
|
|
71
75
|
const contextValue = {
|
|
72
76
|
size: state.size,
|
|
73
77
|
variant: state.variant,
|
|
@@ -80,7 +84,7 @@ function ButtonSurface({
|
|
|
80
84
|
() => buttonHasCompoundPart(contentChildren, "ButtonContent"),
|
|
81
85
|
[contentChildren]
|
|
82
86
|
);
|
|
83
|
-
const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
87
|
+
const inner = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
84
88
|
state.ripple ? /* @__PURE__ */ jsx(
|
|
85
89
|
Ripple,
|
|
86
90
|
{
|
|
@@ -97,24 +101,29 @@ function ButtonSurface({
|
|
|
97
101
|
iconPosition: state.iconPosition
|
|
98
102
|
})
|
|
99
103
|
] });
|
|
100
|
-
return /* @__PURE__ */ jsx(ButtonContextProvider, { value: contextValue, children: asChildElement ?
|
|
101
|
-
|
|
102
|
-
mergeAsChildProps(
|
|
104
|
+
return /* @__PURE__ */ jsx(ButtonContextProvider, { value: contextValue, children: asChildElement ? (() => {
|
|
105
|
+
const mergedAsChild = mergeAsChildProps(
|
|
103
106
|
asChildElement,
|
|
104
107
|
{
|
|
105
108
|
...rest,
|
|
106
109
|
style: mergeSkinSurfaceStyle(state.surfaceStyle, rest.style),
|
|
107
110
|
className: state.buttonClass,
|
|
108
|
-
"data-group-segment": dataGroupSegment(state.groupSegment != null),
|
|
109
111
|
"aria-disabled": state.blocked || void 0,
|
|
110
|
-
|
|
112
|
+
"aria-busy": state.isLoading || void 0,
|
|
113
|
+
...state.blocked ? { tabIndex: -1 } : restTabIndex !== void 0 ? { tabIndex: restTabIndex } : {},
|
|
111
114
|
onPointerOver: animations.pointerHandlers.onPointerOver,
|
|
112
115
|
onPointerOut: animations.pointerHandlers.onPointerOut,
|
|
113
116
|
onPointerDown: animations.handlePointerDown,
|
|
114
117
|
onPointerUp: animations.handlePointerUp,
|
|
115
118
|
onPointerEnter: animations.handlePointerEnter,
|
|
116
119
|
onPointerLeave: animations.handlePointerLeave,
|
|
117
|
-
onKeyDown:
|
|
120
|
+
onKeyDown: (event) => {
|
|
121
|
+
animations.handleKeyDown(event);
|
|
122
|
+
if (!state.blocked && !event.defaultPrevented && !event.repeat && (event.key === " " || event.key === "Spacebar") && event.currentTarget.tagName !== "BUTTON") {
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
event.currentTarget.click();
|
|
125
|
+
}
|
|
126
|
+
},
|
|
118
127
|
onMouseDown,
|
|
119
128
|
onClick: (event) => {
|
|
120
129
|
if (state.blocked) {
|
|
@@ -128,11 +137,17 @@ function ButtonSurface({
|
|
|
128
137
|
size: state.size,
|
|
129
138
|
variant: state.variant,
|
|
130
139
|
status: state.status
|
|
131
|
-
})
|
|
140
|
+
}),
|
|
141
|
+
"data-group-segment": dataGroupSegment(state.groupSegment != null),
|
|
142
|
+
"data-disabled": dataFlag(state.blocked),
|
|
143
|
+
"data-state": buttonDataState
|
|
132
144
|
},
|
|
133
|
-
animations.setRefs
|
|
134
|
-
|
|
135
|
-
|
|
145
|
+
animations.setRefs,
|
|
146
|
+
{ disabled: state.blocked }
|
|
147
|
+
);
|
|
148
|
+
if (state.blocked) mergedAsChild.href = void 0;
|
|
149
|
+
return cloneElement(asChildElement, mergedAsChild);
|
|
150
|
+
})() : /* @__PURE__ */ jsx(
|
|
136
151
|
"button",
|
|
137
152
|
{
|
|
138
153
|
ref: animations.setRefs,
|
|
@@ -156,9 +171,9 @@ function ButtonSurface({
|
|
|
156
171
|
status: state.status
|
|
157
172
|
}),
|
|
158
173
|
"data-group-segment": dataGroupSegment(state.groupSegment != null),
|
|
159
|
-
"data-disabled": state.blocked
|
|
160
|
-
"data-state":
|
|
161
|
-
"aria-busy":
|
|
174
|
+
"data-disabled": dataFlag(state.blocked),
|
|
175
|
+
"data-state": buttonDataState,
|
|
176
|
+
"aria-busy": state.isLoading || void 0,
|
|
162
177
|
children: inner
|
|
163
178
|
}
|
|
164
179
|
) });
|
|
@@ -194,7 +209,7 @@ const ButtonRoot = forwardRef(function Button({
|
|
|
194
209
|
onMouseDown,
|
|
195
210
|
...rest
|
|
196
211
|
}, ref) {
|
|
197
|
-
const asChildElement = asChild && isValidElement(children) && Children.count(children) === 1 ? children : null;
|
|
212
|
+
const asChildElement = asChild && isValidElement(children) && children.type !== Fragment && Children.count(children) === 1 ? children : null;
|
|
198
213
|
const contentChildren = asChildElement ? asChildElement.props.children : children;
|
|
199
214
|
const state = useButtonRootState({
|
|
200
215
|
className,
|
|
@@ -204,6 +219,7 @@ const ButtonRoot = forwardRef(function Button({
|
|
|
204
219
|
size,
|
|
205
220
|
type,
|
|
206
221
|
disabled,
|
|
222
|
+
motionState,
|
|
207
223
|
icon,
|
|
208
224
|
iconPosition,
|
|
209
225
|
ripple,
|
|
@@ -3,7 +3,7 @@ import { ButtonMotion, ButtonVariant, UseButtonAnimationsProps } from './buttonT
|
|
|
3
3
|
export declare function resolveButtonMotionDefaults({ variant, }: {
|
|
4
4
|
variant: ButtonVariant;
|
|
5
5
|
}): ButtonMotion;
|
|
6
|
-
export declare function useButtonAnimations({ variant, blocked, groupSegment, motion, hoverPointerInsideRef, forwardedRef, onPointerEnter, onPointerLeave, onPointerOver, onPointerOut, onPointerDown, onPointerUp, onKeyDown, }: UseButtonAnimationsProps): {
|
|
6
|
+
export declare function useButtonAnimations({ variant, disabled, blocked, groupSegment, motion, hoverPointerInsideRef, forwardedRef, onPointerEnter, onPointerLeave, onPointerOver, onPointerOut, onPointerDown, onPointerUp, onKeyDown, }: UseButtonAnimationsProps): {
|
|
7
7
|
setRefs: (node: HTMLButtonElement | null) => void;
|
|
8
8
|
contentMotionRef: import('react').RefObject<HTMLSpanElement | null>;
|
|
9
9
|
pointerHandlers: {
|