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 { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
-
import { dataVariantProps } from "../utils/dataContract.js";
|
|
3
|
+
import { dataFlag, dataVariantProps } from "../utils/dataContract.js";
|
|
4
4
|
import { useLinkClassNames, useOptionalLinkMotionScope } from "./linkContext.js";
|
|
5
5
|
import { LinkDefaultIcon } from "./linkDefaultIconPart.js";
|
|
6
6
|
import { LinkIconSlot } from "./linkIconSlotPart.js";
|
|
@@ -16,6 +16,8 @@ function LinkBodyContent({
|
|
|
16
16
|
endIcon,
|
|
17
17
|
startIconClassName,
|
|
18
18
|
endIconClassName,
|
|
19
|
+
startIconMotion,
|
|
20
|
+
endIconMotion,
|
|
19
21
|
startIconRef,
|
|
20
22
|
endIconRef,
|
|
21
23
|
startIconMuted,
|
|
@@ -24,10 +26,9 @@ function LinkBodyContent({
|
|
|
24
26
|
usesDefaultAtEnd
|
|
25
27
|
}) {
|
|
26
28
|
const slotClassNames = useLinkClassNames();
|
|
27
|
-
const { setRef: setTextRef
|
|
29
|
+
const { setRef: setTextRef } = useMotionPart({
|
|
28
30
|
scope: useOptionalLinkMotionScope(),
|
|
29
|
-
slot: "text"
|
|
30
|
-
pointerPhases: true
|
|
31
|
+
slot: "text"
|
|
31
32
|
});
|
|
32
33
|
const resolvedStart = startIcon ?? (usesDefaultAtStart ? /* @__PURE__ */ jsx(LinkDefaultIcon, {}) : null);
|
|
33
34
|
const resolvedEnd = endIcon ?? (usesDefaultAtEnd ? /* @__PURE__ */ jsx(LinkDefaultIcon, {}) : null);
|
|
@@ -40,13 +41,15 @@ function LinkBodyContent({
|
|
|
40
41
|
slot: "iconStart",
|
|
41
42
|
slotClass: slotClassNames.iconStart,
|
|
42
43
|
className: startIconClassName,
|
|
44
|
+
motion: startIconMotion,
|
|
43
45
|
forwardedRef: startIconRef,
|
|
44
46
|
children: resolvedStart
|
|
45
47
|
}
|
|
46
48
|
) : null,
|
|
47
|
-
/* @__PURE__ */ jsx(
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
48
50
|
Text,
|
|
49
51
|
{
|
|
52
|
+
ref: setTextRef,
|
|
50
53
|
as: "span",
|
|
51
54
|
textStyle: textVariant,
|
|
52
55
|
inheritColor: true,
|
|
@@ -56,7 +59,7 @@ function LinkBodyContent({
|
|
|
56
59
|
}),
|
|
57
60
|
children: textChildren
|
|
58
61
|
}
|
|
59
|
-
)
|
|
62
|
+
),
|
|
60
63
|
resolvedEnd ? /* @__PURE__ */ jsx(
|
|
61
64
|
LinkIconSlot,
|
|
62
65
|
{
|
|
@@ -65,6 +68,7 @@ function LinkBodyContent({
|
|
|
65
68
|
slot: "iconEnd",
|
|
66
69
|
slotClass: slotClassNames.iconEnd,
|
|
67
70
|
className: endIconClassName,
|
|
71
|
+
motion: endIconMotion,
|
|
68
72
|
forwardedRef: endIconRef,
|
|
69
73
|
children: resolvedEnd
|
|
70
74
|
}
|
|
@@ -73,6 +77,7 @@ function LinkBodyContent({
|
|
|
73
77
|
}
|
|
74
78
|
function LinkAnchorBody({
|
|
75
79
|
href,
|
|
80
|
+
disabled = false,
|
|
76
81
|
size,
|
|
77
82
|
underline,
|
|
78
83
|
textVariant,
|
|
@@ -81,6 +86,8 @@ function LinkAnchorBody({
|
|
|
81
86
|
endIcon,
|
|
82
87
|
startIconClassName,
|
|
83
88
|
endIconClassName,
|
|
89
|
+
startIconMotion,
|
|
90
|
+
endIconMotion,
|
|
84
91
|
startIconRef,
|
|
85
92
|
endIconRef,
|
|
86
93
|
startIconMuted,
|
|
@@ -93,6 +100,10 @@ function LinkAnchorBody({
|
|
|
93
100
|
handlePointerLeave,
|
|
94
101
|
pointerHandlers,
|
|
95
102
|
handleKeyDown,
|
|
103
|
+
onClick,
|
|
104
|
+
onAuxClick,
|
|
105
|
+
tabIndex,
|
|
106
|
+
"aria-disabled": ariaDisabledProp,
|
|
96
107
|
...rest
|
|
97
108
|
}) {
|
|
98
109
|
const slotClassNames = useLinkClassNames();
|
|
@@ -100,17 +111,44 @@ function LinkAnchorBody({
|
|
|
100
111
|
"a",
|
|
101
112
|
{
|
|
102
113
|
ref: setAnchorRef,
|
|
103
|
-
href,
|
|
114
|
+
href: disabled ? void 0 : href,
|
|
115
|
+
"aria-disabled": disabled ? true : ariaDisabledProp,
|
|
116
|
+
tabIndex: disabled ? -1 : tabIndex,
|
|
104
117
|
className: linkAnchorClass({
|
|
118
|
+
disabled,
|
|
105
119
|
slotClass: slotClassNames.root,
|
|
106
120
|
className
|
|
107
121
|
}),
|
|
108
122
|
onPointerEnter: handlePointerEnter,
|
|
109
123
|
onPointerLeave: handlePointerLeave,
|
|
110
|
-
|
|
124
|
+
onClick: (event) => {
|
|
125
|
+
if (disabled) {
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
event.stopPropagation();
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
onClick?.(event);
|
|
131
|
+
},
|
|
132
|
+
onAuxClick: (event) => {
|
|
133
|
+
if (disabled) {
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
event.stopPropagation();
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
onAuxClick?.(event);
|
|
139
|
+
},
|
|
140
|
+
onKeyDown: (event) => {
|
|
141
|
+
if (disabled && (event.key === "Enter" || event.key === " " || event.key === "Spacebar")) {
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
event.stopPropagation();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
handleKeyDown(event);
|
|
147
|
+
},
|
|
111
148
|
...rest,
|
|
112
149
|
...pointerHandlers,
|
|
113
150
|
...dataVariantProps({ size }),
|
|
151
|
+
"data-disabled": dataFlag(disabled),
|
|
114
152
|
children: /* @__PURE__ */ jsx(
|
|
115
153
|
LinkBodyContent,
|
|
116
154
|
{
|
|
@@ -122,6 +160,8 @@ function LinkAnchorBody({
|
|
|
122
160
|
endIcon,
|
|
123
161
|
startIconClassName,
|
|
124
162
|
endIconClassName,
|
|
163
|
+
startIconMotion,
|
|
164
|
+
endIconMotion,
|
|
125
165
|
startIconRef,
|
|
126
166
|
endIconRef,
|
|
127
167
|
startIconMuted,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { KeyboardEvent, PointerEvent } from 'react';
|
|
2
2
|
import { LinkMotion, UseLinkAnimationsProps } from './linkTypes.js';
|
|
3
3
|
export declare function resolveLinkMotionDefaults(): LinkMotion;
|
|
4
|
-
export declare function useLinkAnimations({ forwardedRef, onPointerEnter, onPointerLeave, onPointerOver, onPointerOut, onPointerDown, onPointerUp, onKeyDown, }: UseLinkAnimationsProps): {
|
|
4
|
+
export declare function useLinkAnimations({ disabled, forwardedRef, onPointerEnter, onPointerLeave, onPointerOver, onPointerOut, onPointerDown, onPointerUp, onKeyDown, }: UseLinkAnimationsProps): {
|
|
5
5
|
setAnchorRef: (node: HTMLAnchorElement | null) => void;
|
|
6
6
|
handlePointerEnter: (e: PointerEvent<HTMLAnchorElement>) => void;
|
|
7
7
|
handlePointerLeave: (e: PointerEvent<HTMLAnchorElement>) => void;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { clearMotionTransform } from "../utils/gsapMotion.js";
|
|
3
|
+
import { useRef, useCallback, useEffect, useMemo } from "react";
|
|
3
4
|
import { shouldSkipInteractiveHoverLift, isInteractivePressKey } from "../utils/hoverInteractiveLift.js";
|
|
4
5
|
import { mergeForwardedRef } from "../utils/mergeRefs.js";
|
|
5
6
|
import { useLinkMotionScope } from "./linkContext.js";
|
|
6
7
|
import { bindLiftRecipes } from "../utils/slotMotion/recipes/bindLift.js";
|
|
8
|
+
import { killStoredMotion } from "../utils/slotMotion/runMotionPhase.js";
|
|
7
9
|
import { useMotionPointerPhases } from "../utils/slotMotion/useMotionPointerPhases.js";
|
|
8
10
|
import { mergeMotionPointerHandlers } from "../utils/slotMotion/useMotionPart.js";
|
|
9
11
|
bindLiftRecipes();
|
|
@@ -18,6 +20,7 @@ function resolveLinkMotionDefaults() {
|
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
22
|
function useLinkAnimations({
|
|
23
|
+
disabled = false,
|
|
21
24
|
forwardedRef,
|
|
22
25
|
onPointerEnter,
|
|
23
26
|
onPointerLeave,
|
|
@@ -27,6 +30,7 @@ function useLinkAnimations({
|
|
|
27
30
|
onPointerUp,
|
|
28
31
|
onKeyDown
|
|
29
32
|
}) {
|
|
33
|
+
const enabled = !disabled;
|
|
30
34
|
const anchorRef = useRef(null);
|
|
31
35
|
const scope = useLinkMotionScope();
|
|
32
36
|
const rootMotionRef = useRef(scope.getRootMotion()?.root);
|
|
@@ -39,19 +43,30 @@ function useLinkAnimations({
|
|
|
39
43
|
},
|
|
40
44
|
[forwardedRef, scope]
|
|
41
45
|
);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (enabled) return;
|
|
48
|
+
for (const reg of scope.getRegistrations()) {
|
|
49
|
+
killStoredMotion(reg.node);
|
|
50
|
+
clearMotionTransform(reg.node);
|
|
51
|
+
}
|
|
52
|
+
}, [enabled, scope]);
|
|
42
53
|
const playRoot = useCallback(
|
|
43
54
|
(phase) => {
|
|
55
|
+
if (!enabled) return;
|
|
44
56
|
const el = anchorRef.current;
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
if (el) {
|
|
58
|
+
const partMotion = rootMotionRef.current;
|
|
59
|
+
const value = scope.resolve("root", phase, partMotion);
|
|
60
|
+
if (value !== void 0) {
|
|
61
|
+
scope.play("root", phase, { partMotion, el });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
void scope.playBroadcast(phase, { exclude: ["root"] });
|
|
50
65
|
},
|
|
51
|
-
[scope]
|
|
66
|
+
[enabled, scope]
|
|
52
67
|
);
|
|
53
68
|
const motionPointer = useMotionPointerPhases({
|
|
54
|
-
enabled
|
|
69
|
+
enabled,
|
|
55
70
|
targetRef: anchorRef,
|
|
56
71
|
skipHover: shouldSkipInteractiveHoverLift,
|
|
57
72
|
onHoverIn: () => playRoot("hoverIn"),
|
|
@@ -69,18 +84,18 @@ function useLinkAnimations({
|
|
|
69
84
|
const handlePointerDown = useCallback(
|
|
70
85
|
(e) => {
|
|
71
86
|
onPointerDown?.(e);
|
|
72
|
-
if (e.defaultPrevented) return;
|
|
87
|
+
if (!enabled || e.defaultPrevented) return;
|
|
73
88
|
playRoot("pressIn");
|
|
74
89
|
},
|
|
75
|
-
[onPointerDown, playRoot]
|
|
90
|
+
[enabled, onPointerDown, playRoot]
|
|
76
91
|
);
|
|
77
92
|
const handlePointerUp = useCallback(
|
|
78
93
|
(e) => {
|
|
79
94
|
onPointerUp?.(e);
|
|
80
|
-
if (e.defaultPrevented) return;
|
|
95
|
+
if (!enabled || e.defaultPrevented) return;
|
|
81
96
|
playRoot("pressOut");
|
|
82
97
|
},
|
|
83
|
-
[onPointerUp, playRoot]
|
|
98
|
+
[enabled, onPointerUp, playRoot]
|
|
84
99
|
);
|
|
85
100
|
const handlePointerEnter = useCallback(
|
|
86
101
|
(e) => {
|
|
@@ -97,10 +112,10 @@ function useLinkAnimations({
|
|
|
97
112
|
const handleKeyDown = useCallback(
|
|
98
113
|
(e) => {
|
|
99
114
|
onKeyDown?.(e);
|
|
100
|
-
if (e.defaultPrevented || !isInteractivePressKey(e)) return;
|
|
115
|
+
if (!enabled || e.defaultPrevented || !isInteractivePressKey(e)) return;
|
|
101
116
|
playRoot("pressIn");
|
|
102
117
|
},
|
|
103
|
-
[onKeyDown, playRoot]
|
|
118
|
+
[enabled, onKeyDown, playRoot]
|
|
104
119
|
);
|
|
105
120
|
const pointerHandlers = useMemo(
|
|
106
121
|
() => ({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { LinkIconSlotProps } from './linkTypes.js';
|
|
2
|
-
export declare function LinkIconSlot({ children, size, muted, slotClass, className, forwardedRef, slot, }: LinkIconSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function LinkIconSlot({ children, size, muted, slotClass, className, motion, forwardedRef, slot, }: LinkIconSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,13 +12,14 @@ function LinkIconSlot({
|
|
|
12
12
|
muted = false,
|
|
13
13
|
slotClass,
|
|
14
14
|
className,
|
|
15
|
+
motion,
|
|
15
16
|
forwardedRef,
|
|
16
17
|
slot
|
|
17
18
|
}) {
|
|
18
|
-
const { setRef
|
|
19
|
+
const { setRef } = useMotionPart({
|
|
19
20
|
scope: useOptionalLinkMotionScope(),
|
|
20
21
|
slot,
|
|
21
|
-
|
|
22
|
+
motion
|
|
22
23
|
});
|
|
23
24
|
return /* @__PURE__ */ jsx(
|
|
24
25
|
"span",
|
|
@@ -26,7 +27,6 @@ function LinkIconSlot({
|
|
|
26
27
|
ref: mergeRefs(forwardedRef, setRef),
|
|
27
28
|
className: cn(linkIconSlotClass({ size, muted, slotClass }), className),
|
|
28
29
|
"aria-hidden": LINK_ICON_SLOT_ARIA_HIDDEN,
|
|
29
|
-
...pointerHandlers,
|
|
30
30
|
children
|
|
31
31
|
}
|
|
32
32
|
);
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { TextVariant } from '../Text/index.js';
|
|
2
2
|
import { LinkSize } from './linkTypes.js';
|
|
3
|
-
export declare const LINK_ANCHOR_CLASS = "group/link inline-flex max-w-full min-w-0 items-center gap-xsmall rounded-mid no-underline outline-none w-fit text-foreground focus-ring";
|
|
3
|
+
export declare const LINK_ANCHOR_CLASS = "group/link inline-flex max-w-full min-w-0 items-center gap-xsmall rounded-mid no-underline outline-none w-fit text-foreground focus-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:cursor-not-allowed";
|
|
4
|
+
export declare const LINK_DISABLED_CLASS = "pointer-events-none opacity-50 cursor-not-allowed";
|
|
4
5
|
export declare const LINK_TEXT_BASE_CLASS = "min-w-0 truncate font-w-mid";
|
|
5
6
|
export declare const LINK_TEXT_UNDERLINE_CLASS = "underline decoration-current/70 underline-offset-[0.2em]";
|
|
6
|
-
export declare const LINK_ICON_MUTED_CLASS = "text-muted group-hover/link:text-foreground group-focus-visible/link:text-foreground";
|
|
7
|
+
export declare const LINK_ICON_MUTED_CLASS = "text-muted-foreground group-hover/link:text-foreground group-focus-visible/link:text-foreground";
|
|
7
8
|
export declare const LINK_ICON_FOREGROUND_CLASS = "text-foreground";
|
|
8
9
|
export declare const LINK_DEFAULT_ICON_ROTATE_CLASS = "rotate-[-45deg]";
|
|
9
10
|
export declare const LINK_TEXT_VARIANT: Record<LinkSize, TextVariant>;
|
|
10
11
|
export declare const LINK_ICON_SIZE_CLASS: Record<LinkSize, string>;
|
|
11
|
-
export declare function linkAnchorClass({ slotClass, className, }: {
|
|
12
|
+
export declare function linkAnchorClass({ disabled, slotClass, className, }: {
|
|
13
|
+
disabled?: boolean;
|
|
12
14
|
slotClass?: string;
|
|
13
15
|
className?: string;
|
|
14
16
|
}): string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { TEXT_COLOR_TRANSITION } from "../utils/hoverVariant.js";
|
|
2
2
|
import { cn } from "../../../utils/cn.js";
|
|
3
3
|
import { ICON_SLOT_CLASS, iconSlotSizeClass } from "../utils/sizeLayout/iconSlot.js";
|
|
4
|
-
const LINK_ANCHOR_CLASS = "group/link inline-flex max-w-full min-w-0 items-center gap-xsmall rounded-mid no-underline outline-none w-fit text-foreground focus-ring";
|
|
4
|
+
const LINK_ANCHOR_CLASS = "group/link inline-flex max-w-full min-w-0 items-center gap-xsmall rounded-mid no-underline outline-none w-fit text-foreground focus-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:cursor-not-allowed";
|
|
5
|
+
const LINK_DISABLED_CLASS = "pointer-events-none opacity-50 cursor-not-allowed";
|
|
5
6
|
const LINK_TEXT_BASE_CLASS = "min-w-0 truncate font-w-mid";
|
|
6
7
|
const LINK_TEXT_UNDERLINE_CLASS = "underline decoration-current/70 underline-offset-[0.2em]";
|
|
7
|
-
const LINK_ICON_MUTED_CLASS = "text-muted group-hover/link:text-foreground group-focus-visible/link:text-foreground";
|
|
8
|
+
const LINK_ICON_MUTED_CLASS = "text-muted-foreground group-hover/link:text-foreground group-focus-visible/link:text-foreground";
|
|
8
9
|
const LINK_ICON_FOREGROUND_CLASS = "text-foreground";
|
|
9
10
|
const LINK_DEFAULT_ICON_ROTATE_CLASS = "rotate-[-45deg]";
|
|
10
11
|
const LINK_TEXT_VARIANT = {
|
|
@@ -20,10 +21,11 @@ const LINK_ICON_SIZE_CLASS = {
|
|
|
20
21
|
large: iconSlotSizeClass("large")
|
|
21
22
|
};
|
|
22
23
|
function linkAnchorClass({
|
|
24
|
+
disabled,
|
|
23
25
|
slotClass,
|
|
24
26
|
className
|
|
25
27
|
}) {
|
|
26
|
-
return cn(LINK_ANCHOR_CLASS, slotClass, className);
|
|
28
|
+
return cn(LINK_ANCHOR_CLASS, disabled && LINK_DISABLED_CLASS, slotClass, className);
|
|
27
29
|
}
|
|
28
30
|
function linkTextClass({
|
|
29
31
|
underline,
|
|
@@ -54,6 +56,7 @@ function linkDefaultIconClass() {
|
|
|
54
56
|
export {
|
|
55
57
|
LINK_ANCHOR_CLASS,
|
|
56
58
|
LINK_DEFAULT_ICON_ROTATE_CLASS,
|
|
59
|
+
LINK_DISABLED_CLASS,
|
|
57
60
|
LINK_ICON_FOREGROUND_CLASS,
|
|
58
61
|
LINK_ICON_MUTED_CLASS,
|
|
59
62
|
LINK_ICON_SIZE_CLASS,
|
|
@@ -30,6 +30,7 @@ type LinkSharedProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "children"
|
|
|
30
30
|
children?: ReactNode;
|
|
31
31
|
size?: LinkSize;
|
|
32
32
|
underline?: boolean;
|
|
33
|
+
disabled?: boolean;
|
|
33
34
|
icon?: ReactNode;
|
|
34
35
|
/** @default "start" */
|
|
35
36
|
iconPosition?: IconPosition;
|
|
@@ -52,21 +53,28 @@ export type LinkProps = (LinkSharedProps & {
|
|
|
52
53
|
/** Merge Link styles onto the single child (router `Link`, custom `<a>`). */
|
|
53
54
|
asChild: true;
|
|
54
55
|
href?: string;
|
|
56
|
+
}) | (LinkSharedProps & {
|
|
57
|
+
asChild?: false;
|
|
58
|
+
disabled: true;
|
|
59
|
+
href?: string;
|
|
55
60
|
}) | (LinkSharedProps & {
|
|
56
61
|
asChild?: false;
|
|
57
62
|
href: string;
|
|
58
63
|
});
|
|
59
64
|
export type LinkIconProps = {
|
|
65
|
+
position?: IconPosition;
|
|
60
66
|
iconPosition?: IconPosition;
|
|
61
67
|
children?: ReactNode;
|
|
62
68
|
/** Extra classes on the icon wrapper. */
|
|
63
69
|
className?: string;
|
|
70
|
+
motion?: Prettify<LinkPartMotion>;
|
|
64
71
|
ref?: Ref<HTMLSpanElement>;
|
|
65
72
|
};
|
|
66
73
|
export type ResolvedLinkIconSlot = {
|
|
67
74
|
node: ReactNode | "default";
|
|
68
75
|
muted: boolean;
|
|
69
76
|
className?: string;
|
|
77
|
+
motion?: LinkPartMotion;
|
|
70
78
|
ref?: Ref<HTMLSpanElement>;
|
|
71
79
|
};
|
|
72
80
|
export type ResolvedLinkCompoundBody = {
|
|
@@ -93,6 +101,8 @@ export type LinkBodyContentProps = {
|
|
|
93
101
|
endIcon: ReactNode | null;
|
|
94
102
|
startIconClassName?: string;
|
|
95
103
|
endIconClassName?: string;
|
|
104
|
+
startIconMotion?: LinkPartMotion;
|
|
105
|
+
endIconMotion?: LinkPartMotion;
|
|
96
106
|
startIconRef?: Ref<HTMLSpanElement>;
|
|
97
107
|
endIconRef?: Ref<HTMLSpanElement>;
|
|
98
108
|
startIconMuted: boolean;
|
|
@@ -101,7 +111,8 @@ export type LinkBodyContentProps = {
|
|
|
101
111
|
usesDefaultAtEnd: boolean;
|
|
102
112
|
};
|
|
103
113
|
export type LinkAnchorBodyProps = LinkBodyContentProps & {
|
|
104
|
-
href
|
|
114
|
+
href?: string;
|
|
115
|
+
disabled?: boolean;
|
|
105
116
|
className?: string;
|
|
106
117
|
setAnchorRef: (node: HTMLAnchorElement | null) => void;
|
|
107
118
|
handlePointerEnter: (event: PointerEvent<HTMLAnchorElement>) => void;
|
|
@@ -120,10 +131,12 @@ export type LinkIconSlotProps = {
|
|
|
120
131
|
muted?: boolean;
|
|
121
132
|
slotClass?: string;
|
|
122
133
|
className?: string;
|
|
134
|
+
motion?: LinkPartMotion;
|
|
123
135
|
forwardedRef?: Ref<HTMLSpanElement>;
|
|
124
136
|
slot: "iconStart" | "iconEnd";
|
|
125
137
|
};
|
|
126
138
|
export type UseLinkAnimationsProps = {
|
|
139
|
+
disabled?: boolean;
|
|
127
140
|
forwardedRef: ForwardedRef<HTMLAnchorElement>;
|
|
128
141
|
onPointerEnter?: (event: PointerEvent<HTMLAnchorElement>) => void;
|
|
129
142
|
onPointerLeave?: (event: PointerEvent<HTMLAnchorElement>) => void;
|
|
@@ -5,6 +5,8 @@ export declare function useLinkRootState({ size, underline, icon, iconPosition,
|
|
|
5
5
|
endIcon: import('react').ReactNode | null;
|
|
6
6
|
startIconClassName?: string;
|
|
7
7
|
endIconClassName?: string;
|
|
8
|
+
startIconMotion?: import('./linkTypes.js').LinkPartMotion;
|
|
9
|
+
endIconMotion?: import('./linkTypes.js').LinkPartMotion;
|
|
8
10
|
startIconRef?: import('react').Ref<HTMLSpanElement>;
|
|
9
11
|
endIconRef?: import('react').Ref<HTMLSpanElement>;
|
|
10
12
|
startIconMuted: boolean;
|
|
@@ -13,6 +13,7 @@ export declare const ListBoxRoot: import('react').ForwardRefExoticComponent<Omit
|
|
|
13
13
|
values?: string[];
|
|
14
14
|
defaultValues?: string[];
|
|
15
15
|
onValuesChange?: (values: string[]) => void;
|
|
16
|
+
disallowEmptySelection?: boolean;
|
|
16
17
|
disabled?: boolean;
|
|
17
18
|
activeValue?: string | null;
|
|
18
19
|
onActiveValueChange?: (value: string | null) => void;
|
|
@@ -23,6 +23,7 @@ const ListBoxRoot = forwardRef(function ListBoxRoot2({
|
|
|
23
23
|
values,
|
|
24
24
|
defaultValues,
|
|
25
25
|
onValuesChange,
|
|
26
|
+
disallowEmptySelection,
|
|
26
27
|
disabled,
|
|
27
28
|
activeValue,
|
|
28
29
|
onActiveValueChange,
|
|
@@ -47,6 +48,7 @@ const ListBoxRoot = forwardRef(function ListBoxRoot2({
|
|
|
47
48
|
values,
|
|
48
49
|
defaultValues,
|
|
49
50
|
onValuesChange,
|
|
51
|
+
disallowEmptySelection,
|
|
50
52
|
disabled,
|
|
51
53
|
activeValue,
|
|
52
54
|
onActiveValueChange,
|
|
@@ -11,6 +11,7 @@ export declare const ListBox: import('react').ForwardRefExoticComponent<Omit<imp
|
|
|
11
11
|
values?: string[];
|
|
12
12
|
defaultValues?: string[];
|
|
13
13
|
onValuesChange?: (values: string[]) => void;
|
|
14
|
+
disallowEmptySelection?: boolean;
|
|
14
15
|
disabled?: boolean;
|
|
15
16
|
activeValue?: string | null;
|
|
16
17
|
onActiveValueChange?: (value: string | null) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ForwardedRef, RefObject, PointerEvent as ReactPointerEvent } from 'react';
|
|
2
2
|
import { MotionScopeValue } from '../utils/slotMotion/index.js';
|
|
3
|
-
import { ListBoxMotion, ListBoxPartMotion } from './listBoxTypes.js';
|
|
3
|
+
import { ListBoxActiveSource, ListBoxMotion, ListBoxPartMotion } from './listBoxTypes.js';
|
|
4
4
|
export declare function resolveListBoxMotionDefaults(): ListBoxMotion;
|
|
5
5
|
export type ListBoxMotionSlot = keyof ListBoxMotion;
|
|
6
6
|
export declare function useListBoxSlotMotion<T extends HTMLElement>(slot: Exclude<ListBoxMotionSlot, "item">, { motion, forwardedRef, onPointerOver, onPointerOut, onPointerDown, onPointerUp, }?: {
|
|
@@ -23,9 +23,12 @@ export declare function useListBoxSlotMotion<T extends HTMLElement>(slot: Exclud
|
|
|
23
23
|
export declare function playListBoxItemPress(scope: MotionScopeValue, el: HTMLElement | null): void;
|
|
24
24
|
/**
|
|
25
25
|
* Highlight the active option with a class. No React `isActive` on every row.
|
|
26
|
+
* Scrolls into view only on keyboard / initial / programmatic changes — never on pointer hover.
|
|
26
27
|
*/
|
|
27
|
-
export declare function useListBoxActiveOptionHighlight({ listId, activeValue, rootRef, }: {
|
|
28
|
+
export declare function useListBoxActiveOptionHighlight({ listId, activeValue, rootRef, activeChangeSourceRef, virtualRangeKey, }: {
|
|
28
29
|
listId: string;
|
|
29
30
|
activeValue: string | null;
|
|
30
31
|
rootRef: RefObject<HTMLElement | null>;
|
|
32
|
+
activeChangeSourceRef?: RefObject<ListBoxActiveSource>;
|
|
33
|
+
virtualRangeKey?: string;
|
|
31
34
|
}): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useLayoutEffect } from "react";
|
|
2
|
+
import { useRef, useLayoutEffect } from "react";
|
|
3
3
|
import { prefersReducedMotion } from "../utils/reducedMotion.js";
|
|
4
4
|
import { listBoxOptionId } from "./listBoxA11y.js";
|
|
5
5
|
import { useOptionalListBoxMotionScope } from "./listBoxContext.js";
|
|
@@ -49,8 +49,11 @@ function playListBoxItemPress(scope, el) {
|
|
|
49
49
|
function useListBoxActiveOptionHighlight({
|
|
50
50
|
listId,
|
|
51
51
|
activeValue,
|
|
52
|
-
rootRef
|
|
52
|
+
rootRef,
|
|
53
|
+
activeChangeSourceRef,
|
|
54
|
+
virtualRangeKey
|
|
53
55
|
}) {
|
|
56
|
+
const prevActiveValueRef = useRef(null);
|
|
54
57
|
useLayoutEffect(() => {
|
|
55
58
|
const root = rootRef.current;
|
|
56
59
|
if (!root) return;
|
|
@@ -59,12 +62,21 @@ function useListBoxActiveOptionHighlight({
|
|
|
59
62
|
)) {
|
|
60
63
|
el.classList.remove("listbox-option-active", "bg-default-hover");
|
|
61
64
|
}
|
|
65
|
+
const activeChanged = activeValue !== prevActiveValueRef.current;
|
|
66
|
+
prevActiveValueRef.current = activeValue;
|
|
67
|
+
const source = activeChangeSourceRef?.current ?? "keyboard";
|
|
68
|
+
if (activeChanged && activeChangeSourceRef) {
|
|
69
|
+
activeChangeSourceRef.current = "keyboard";
|
|
70
|
+
}
|
|
62
71
|
if (!activeValue) return;
|
|
63
72
|
const option = document.getElementById(listBoxOptionId(listId, activeValue));
|
|
64
73
|
if (option && root.contains(option)) {
|
|
65
74
|
option.classList.add("listbox-option-active", "bg-default-hover");
|
|
75
|
+
if (activeChanged && source !== "pointer") {
|
|
76
|
+
option.scrollIntoView?.({ block: "nearest" });
|
|
77
|
+
}
|
|
66
78
|
}
|
|
67
|
-
}, [activeValue, listId, rootRef]);
|
|
79
|
+
}, [activeChangeSourceRef, activeValue, listId, rootRef, virtualRangeKey]);
|
|
68
80
|
}
|
|
69
81
|
export {
|
|
70
82
|
playListBoxItemPress,
|
|
@@ -12,7 +12,7 @@ import { useOptionListItemContext, OptionListItemContextProvider } from "../util
|
|
|
12
12
|
import { OptionListItemIndicatorShell, OptionListItemIcon, OptionListItemHint, OptionListItemLabel } from "../utils/optionListItemParts.js";
|
|
13
13
|
import { useBurneLabel } from "../../../theme/BurneLabelsProvider.js";
|
|
14
14
|
import { listBoxOptionId, listBoxActiveOptionId } from "./listBoxA11y.js";
|
|
15
|
-
import { resolveListBoxItemIndicatorClassNames, resolveListBoxIndicatorSize, nextListBoxKeyValue, listBoxPreferredInitialActiveValue, listBoxCatalogTypeahead, listBoxTypeaheadLabels } from "./listBoxAPI.js";
|
|
15
|
+
import { resolveListBoxItemIndicatorClassNames, resolveListBoxIndicatorSize, nextListBoxKeyValue, listBoxPreferredInitialActiveValue, listBoxCatalogTypeahead, listBoxTypeaheadLabels, listBoxCatalogEdge } from "./listBoxAPI.js";
|
|
16
16
|
import { useListBoxSlotMotion, useListBoxActiveOptionHighlight, playListBoxItemPress, resolveListBoxMotionDefaults } from "./listBoxAnimations.js";
|
|
17
17
|
import { useListBox, useListBoxClassNames, useListBoxSectionLabelRegister, ListBoxSectionLabelProvider, useListBoxMotionScope, useListBoxActiveValue, useOptionalListBoxMotionScope, ListBoxMotionProvider } from "./listBoxContext.js";
|
|
18
18
|
import { listBoxEmptyClass, listBoxSeparatorClass, listBoxHeaderTextClass, listBoxHeaderClass, listBoxSectionClass, listBoxRootClass, listBoxItemClass } from "./listBoxStyles.js";
|
|
@@ -46,6 +46,8 @@ const ListBoxRootShell = forwardRef(function ListBoxRootShell2({
|
|
|
46
46
|
const motionScope = useListBoxMotionScope();
|
|
47
47
|
const {
|
|
48
48
|
setActiveValue,
|
|
49
|
+
activeChangeSourceRef,
|
|
50
|
+
selected,
|
|
49
51
|
selectItem,
|
|
50
52
|
multiple,
|
|
51
53
|
disabled,
|
|
@@ -53,7 +55,7 @@ const ListBoxRootShell = forwardRef(function ListBoxRootShell2({
|
|
|
53
55
|
size
|
|
54
56
|
} = useListBox("ListBox");
|
|
55
57
|
const activeValue = useListBoxActiveValue();
|
|
56
|
-
const { frame, catalog, setScrollNode } = useListBoxVirtualWindow({
|
|
58
|
+
const { frame, catalog, setScrollNode, rangeKey } = useListBoxVirtualWindow({
|
|
57
59
|
enabled: virtualized,
|
|
58
60
|
itemSizeProp: virtualItemSize,
|
|
59
61
|
size,
|
|
@@ -67,7 +69,13 @@ const ListBoxRootShell = forwardRef(function ListBoxRootShell2({
|
|
|
67
69
|
},
|
|
68
70
|
[setScrollNode]
|
|
69
71
|
);
|
|
70
|
-
useListBoxActiveOptionHighlight({
|
|
72
|
+
useListBoxActiveOptionHighlight({
|
|
73
|
+
listId,
|
|
74
|
+
activeValue,
|
|
75
|
+
rootRef,
|
|
76
|
+
activeChangeSourceRef,
|
|
77
|
+
virtualRangeKey: rangeKey
|
|
78
|
+
});
|
|
71
79
|
const typeaheadRef = useLazyRef(createTypeaheadBufferState);
|
|
72
80
|
const handleKeyDown = useCallback(
|
|
73
81
|
(event) => {
|
|
@@ -142,10 +150,18 @@ const ListBoxRootShell = forwardRef(function ListBoxRootShell2({
|
|
|
142
150
|
onFocus?.(event);
|
|
143
151
|
if (event.defaultPrevented || !standaloneKeyboard || disabled) return;
|
|
144
152
|
if (activeValue) return;
|
|
153
|
+
if (catalog) {
|
|
154
|
+
const selectedMatch = catalog.find(
|
|
155
|
+
(opt) => !opt.disabled && selected.has(opt.value)
|
|
156
|
+
);
|
|
157
|
+
const initial2 = selectedMatch?.value ?? listBoxCatalogEdge(catalog, "start");
|
|
158
|
+
if (initial2) setActiveValue(initial2);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
145
161
|
const initial = listBoxPreferredInitialActiveValue(event.currentTarget);
|
|
146
162
|
if (initial) setActiveValue(initial);
|
|
147
163
|
},
|
|
148
|
-
[activeValue, disabled, onFocus, setActiveValue, standaloneKeyboard]
|
|
164
|
+
[activeValue, catalog, disabled, onFocus, selected, setActiveValue, standaloneKeyboard]
|
|
149
165
|
);
|
|
150
166
|
const tabIndex = tabIndexProp ?? (standaloneKeyboard && !disabled ? 0 : void 0);
|
|
151
167
|
const studioRootRef = useStudioSlotRef("listBox.root", motionScope);
|
|
@@ -468,7 +484,7 @@ function ListBoxItemSurface({
|
|
|
468
484
|
(event) => {
|
|
469
485
|
onPointerEnter?.(event);
|
|
470
486
|
if (disabled) return;
|
|
471
|
-
setActiveValue(value);
|
|
487
|
+
setActiveValue(value, "pointer");
|
|
472
488
|
},
|
|
473
489
|
[disabled, onPointerEnter, setActiveValue, value]
|
|
474
490
|
);
|
|
@@ -5,13 +5,13 @@ export declare const LISTBOX_VIRTUAL_FRAME_CLASS = "relative w-full shrink-0";
|
|
|
5
5
|
export declare const LISTBOX_VIRTUAL_WINDOW_CLASS = "absolute inset-x-0 top-0";
|
|
6
6
|
export declare const LISTBOX_SECTION_CLASS = "flex min-w-0 flex-col gap-xsmall";
|
|
7
7
|
export declare const LISTBOX_HEADER_CLASS = "px-mid text-start";
|
|
8
|
-
export declare const LISTBOX_HEADER_TEXT_CLASS = "text-muted";
|
|
8
|
+
export declare const LISTBOX_HEADER_TEXT_CLASS = "text-muted-foreground";
|
|
9
9
|
export declare const LISTBOX_SEPARATOR_CLASS = "my-xsmall h-0 w-full shrink-0 border-t-token";
|
|
10
|
-
export declare const LISTBOX_EMPTY_CLASS = "px-large py-small text-center text-muted";
|
|
10
|
+
export declare const LISTBOX_EMPTY_CLASS = "px-large py-small text-center text-muted-foreground";
|
|
11
11
|
export declare const LISTBOX_ITEM_BASE_CLASS = "w-full min-w-0 rounded-mid text-start outline-none";
|
|
12
12
|
export declare const LISTBOX_ITEM_PAD: Record<ListBoxSize, string>;
|
|
13
13
|
export declare const LISTBOX_ITEM_INTERACTIVE_CLASS = "cursor-pointer text-foreground focus-ring";
|
|
14
|
-
export declare const LISTBOX_ITEM_DISABLED_CLASS = "cursor-not-allowed bg-transparent text-muted opacity-45";
|
|
14
|
+
export declare const LISTBOX_ITEM_DISABLED_CLASS = "cursor-not-allowed bg-transparent text-muted-foreground opacity-45";
|
|
15
15
|
export declare function listBoxRootClass({ variant, slotClass, className, virtualized, }: {
|
|
16
16
|
variant: ListBoxVariant;
|
|
17
17
|
slotClass?: string;
|
|
@@ -9,9 +9,9 @@ const LISTBOX_VIRTUAL_FRAME_CLASS = "relative w-full shrink-0";
|
|
|
9
9
|
const LISTBOX_VIRTUAL_WINDOW_CLASS = "absolute inset-x-0 top-0";
|
|
10
10
|
const LISTBOX_SECTION_CLASS = "flex min-w-0 flex-col gap-xsmall";
|
|
11
11
|
const LISTBOX_HEADER_CLASS = "px-mid text-start";
|
|
12
|
-
const LISTBOX_HEADER_TEXT_CLASS = "text-muted";
|
|
12
|
+
const LISTBOX_HEADER_TEXT_CLASS = "text-muted-foreground";
|
|
13
13
|
const LISTBOX_SEPARATOR_CLASS = "my-xsmall h-0 w-full shrink-0 border-t-token";
|
|
14
|
-
const LISTBOX_EMPTY_CLASS = "px-large py-small text-center text-muted";
|
|
14
|
+
const LISTBOX_EMPTY_CLASS = "px-large py-small text-center text-muted-foreground";
|
|
15
15
|
const LISTBOX_ITEM_BASE_CLASS = "w-full min-w-0 rounded-mid text-start outline-none";
|
|
16
16
|
const LISTBOX_ITEM_PAD = {
|
|
17
17
|
small: cn(CONTROL_SIZE_LAYOUT.small.padX, CONTROL_SIZE_LAYOUT.small.padY),
|
|
@@ -20,7 +20,7 @@ const LISTBOX_ITEM_PAD = {
|
|
|
20
20
|
large: cn(CONTROL_SIZE_LAYOUT.large.padX, CONTROL_SIZE_LAYOUT.large.padY)
|
|
21
21
|
};
|
|
22
22
|
const LISTBOX_ITEM_INTERACTIVE_CLASS = "cursor-pointer text-foreground focus-ring";
|
|
23
|
-
const LISTBOX_ITEM_DISABLED_CLASS = "cursor-not-allowed bg-transparent text-muted opacity-45";
|
|
23
|
+
const LISTBOX_ITEM_DISABLED_CLASS = "cursor-not-allowed bg-transparent text-muted-foreground opacity-45";
|
|
24
24
|
function listBoxRootClass({
|
|
25
25
|
variant,
|
|
26
26
|
slotClass,
|
|
@@ -53,13 +53,15 @@ export type ListBoxMotion = {
|
|
|
53
53
|
empty?: ListBoxPartMotion;
|
|
54
54
|
separator?: ListBoxPartMotion;
|
|
55
55
|
};
|
|
56
|
+
export type ListBoxActiveSource = "keyboard" | "pointer";
|
|
56
57
|
export type ListBoxContextValue = {
|
|
57
58
|
listId: string;
|
|
58
59
|
size: ListBoxSize;
|
|
59
60
|
multiple: boolean;
|
|
60
61
|
selected: Set<string>;
|
|
61
62
|
selectItem: (value: string) => void;
|
|
62
|
-
setActiveValue: (value: string | null) => void;
|
|
63
|
+
setActiveValue: (value: string | null, source?: ListBoxActiveSource) => void;
|
|
64
|
+
activeChangeSourceRef: React.RefObject<ListBoxActiveSource>;
|
|
63
65
|
indicatorMode: "radio" | "multi";
|
|
64
66
|
disabled?: boolean;
|
|
65
67
|
/**
|
|
@@ -83,6 +85,8 @@ export type ListBoxProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "on
|
|
|
83
85
|
values?: string[];
|
|
84
86
|
defaultValues?: string[];
|
|
85
87
|
onValuesChange?: (values: string[]) => void;
|
|
88
|
+
/** Prevent deselecting the last selected item on click/Enter. */
|
|
89
|
+
disallowEmptySelection?: boolean;
|
|
86
90
|
disabled?: boolean;
|
|
87
91
|
activeValue?: string | null;
|
|
88
92
|
onActiveValueChange?: (value: string | null) => void;
|
|
@@ -14,5 +14,5 @@ export declare function useListBoxItemState({ children, label, hint, icon, indic
|
|
|
14
14
|
optionId: string;
|
|
15
15
|
indicatorMode: "radio" | "multi";
|
|
16
16
|
selectItem: (value: string) => void;
|
|
17
|
-
setActiveValue: (value: string | null) => void;
|
|
17
|
+
setActiveValue: (value: string | null, source?: import('./listBoxTypes.js').ListBoxActiveSource) => void;
|
|
18
18
|
};
|