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
|
@@ -3,19 +3,21 @@ import { ToggleButtonMotion, ToggleButtonVariant, UseToggleButtonAnimationsProps
|
|
|
3
3
|
export declare function resolveToggleButtonMotionDefaults({ variant, }: {
|
|
4
4
|
variant: ToggleButtonVariant;
|
|
5
5
|
}): ToggleButtonMotion;
|
|
6
|
-
export declare function useToggleButtonAnimations({ disabled, variant, groupSegment, forwardedRef, pressed, motion, hoverPointerInsideRef, onReleaseStartRef, onFillStart, onPointerEnter, onPointerLeave, onPointerOver, onPointerOut, onPointerDown, onPointerUp, onKeyDown, }: UseToggleButtonAnimationsProps): {
|
|
6
|
+
export declare function useToggleButtonAnimations({ disabled, variant, groupSegment, forwardedRef, pressed, motion, hoverPointerInsideRef, onReleaseStartRef, onFillStart, onPointerEnter, onPointerLeave, onPointerOver, onPointerOut, onPointerDown, onPointerUp, onPointerCancel, onKeyDown, onKeyUp, onBlur, }: UseToggleButtonAnimationsProps): {
|
|
7
7
|
setRefs: (node: HTMLButtonElement | null) => void;
|
|
8
8
|
contentMotionRef: import('react').RefObject<HTMLSpanElement | null>;
|
|
9
9
|
handlePointerEnter: (e: PointerEvent<HTMLButtonElement>) => void;
|
|
10
10
|
handlePointerLeave: (e: PointerEvent<HTMLButtonElement>) => void;
|
|
11
11
|
handlePointerDown: (e: PointerEvent<HTMLButtonElement>) => void;
|
|
12
12
|
handlePointerUp: (e: PointerEvent<HTMLButtonElement>) => void;
|
|
13
|
+
handlePointerCancel: (e: PointerEvent<HTMLButtonElement>) => void;
|
|
13
14
|
handleKeyDown: (e: KeyboardEvent<HTMLButtonElement>) => void;
|
|
15
|
+
handleKeyUp: (e: KeyboardEvent<HTMLButtonElement>) => void;
|
|
16
|
+
handleBlur: (e: React.FocusEvent<HTMLButtonElement>) => void;
|
|
14
17
|
pointerHandlers: {
|
|
15
18
|
onPointerOver: (e: PointerEvent<HTMLButtonElement>) => void;
|
|
16
19
|
onPointerOut: (e: PointerEvent<HTMLButtonElement>) => void;
|
|
17
20
|
};
|
|
18
21
|
bindFillRef: (node: HTMLElement | null) => void;
|
|
19
|
-
queueFillOnClick: (next: boolean) => void;
|
|
20
22
|
displayPressed: boolean;
|
|
21
23
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { killMotion, clearMotionTransform } from "../utils/gsapMotion.js";
|
|
3
|
-
import { useRef, useCallback,
|
|
4
|
-
import { initElementShadow, shadowNone, shouldSkipInteractiveHoverLift, isInteractivePressKey } from "../utils/hoverInteractiveLift.js";
|
|
3
|
+
import { useRef, useCallback, useLayoutEffect, useMemo, useEffect } from "react";
|
|
4
|
+
import { initElementShadow, shadowNone, isKitHoverLiftRecipe, primeInteractiveScaleRest, shouldSkipInteractiveHoverLift, isInteractivePressKey } from "../utils/hoverInteractiveLift.js";
|
|
5
5
|
import { mergeForwardedRef } from "../utils/mergeRefs.js";
|
|
6
6
|
import { isMotionFeatureEnabledFor } from "../utils/motionConfig.js";
|
|
7
7
|
import { useMotionConfig } from "../utils/motionConfigContext.js";
|
|
@@ -64,13 +64,15 @@ function useToggleButtonAnimations({
|
|
|
64
64
|
onPointerOut,
|
|
65
65
|
onPointerDown,
|
|
66
66
|
onPointerUp,
|
|
67
|
-
|
|
67
|
+
onPointerCancel,
|
|
68
|
+
onKeyDown,
|
|
69
|
+
onKeyUp,
|
|
70
|
+
onBlur
|
|
68
71
|
}) {
|
|
69
72
|
const config = useMotionConfig();
|
|
70
73
|
const fillRef = useRef(null);
|
|
71
74
|
const deferFillFromPressRef = useRef(false);
|
|
72
|
-
const
|
|
73
|
-
const pressReleaseStartedRef = useRef(false);
|
|
75
|
+
const latestPressedRef = useRef(pressed);
|
|
74
76
|
const scope = useToggleButtonMotionScope();
|
|
75
77
|
const rootMotionRef = useRef(motion?.root);
|
|
76
78
|
rootMotionRef.current = motion?.root;
|
|
@@ -99,24 +101,17 @@ function useToggleButtonAnimations({
|
|
|
99
101
|
playFill
|
|
100
102
|
}
|
|
101
103
|
);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const runPendingFill = useCallback(() => {
|
|
108
|
-
const next = pendingFillRef.current;
|
|
109
|
-
if (next === null) return;
|
|
110
|
-
pendingFillRef.current = null;
|
|
104
|
+
useLayoutEffect(() => {
|
|
105
|
+
latestPressedRef.current = pressed;
|
|
106
|
+
}, [pressed]);
|
|
107
|
+
const releasePressFillCoordination = useCallback(() => {
|
|
108
|
+
if (!deferFillFromPressRef.current) return;
|
|
111
109
|
deferFillFromPressRef.current = false;
|
|
112
|
-
animateTo(
|
|
110
|
+
animateTo(latestPressedRef.current);
|
|
113
111
|
}, [animateTo]);
|
|
114
|
-
onReleaseStartRef.current =
|
|
115
|
-
pressReleaseStartedRef.current = true;
|
|
116
|
-
runPendingFill();
|
|
117
|
-
};
|
|
112
|
+
onReleaseStartRef.current = releasePressFillCoordination;
|
|
118
113
|
const reduceMotion = prefersReducedMotion();
|
|
119
|
-
const shouldCoordinateFill = !disabled && !reduceMotion;
|
|
114
|
+
const shouldCoordinateFill = !disabled && !reduceMotion && isMotionFeatureEnabledFor(config, "enablePressSqueeze");
|
|
120
115
|
const useContentRef = Boolean(groupSegment);
|
|
121
116
|
const hasHoverShadow = usesKitElevation(variant, KIT_TOGGLE_BUTTON_VARIANTS) && !useContentRef;
|
|
122
117
|
const enabled = !disabled;
|
|
@@ -139,11 +134,19 @@ function useToggleButtonAnimations({
|
|
|
139
134
|
[hasHoverShadow]
|
|
140
135
|
);
|
|
141
136
|
useLayoutEffect(() => {
|
|
142
|
-
if (!enabled ||
|
|
143
|
-
|
|
144
|
-
|
|
137
|
+
if (!enabled || useContentRef) return;
|
|
138
|
+
if (hoverPointerInsideRef.current) return;
|
|
139
|
+
const el = btnRef.current;
|
|
140
|
+
if (btnShadow) initElementShadow(el, shadowNone());
|
|
141
|
+
const enterValue = scope.resolve("root", "enter", rootMotionRef.current);
|
|
142
|
+
const hoverValue = scope.resolve("root", "hoverIn", rootMotionRef.current);
|
|
143
|
+
if ((enterValue == null || enterValue === false) && isKitHoverLiftRecipe(hoverValue)) {
|
|
144
|
+
primeInteractiveScaleRest(el, config);
|
|
145
|
+
}
|
|
146
|
+
}, [btnShadow, config, enabled, hoverPointerInsideRef, scope, useContentRef, variant]);
|
|
145
147
|
useEffect(() => {
|
|
146
148
|
if (enabled) return;
|
|
149
|
+
releasePressFillCoordination();
|
|
147
150
|
hoverPointerInsideRef.current = false;
|
|
148
151
|
const el = btnRef.current;
|
|
149
152
|
const content = contentMotionRef.current;
|
|
@@ -157,7 +160,18 @@ function useToggleButtonAnimations({
|
|
|
157
160
|
killMotion(content);
|
|
158
161
|
content.style.transform = "";
|
|
159
162
|
}
|
|
160
|
-
}, [enabled, hoverPointerInsideRef]);
|
|
163
|
+
}, [enabled, hoverPointerInsideRef, releasePressFillCoordination]);
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
const onGlobalRelease = () => {
|
|
166
|
+
releasePressFillCoordination();
|
|
167
|
+
};
|
|
168
|
+
window.addEventListener("pointerup", onGlobalRelease);
|
|
169
|
+
window.addEventListener("pointercancel", onGlobalRelease);
|
|
170
|
+
return () => {
|
|
171
|
+
window.removeEventListener("pointerup", onGlobalRelease);
|
|
172
|
+
window.removeEventListener("pointercancel", onGlobalRelease);
|
|
173
|
+
};
|
|
174
|
+
}, [releasePressFillCoordination]);
|
|
161
175
|
useEffect(() => {
|
|
162
176
|
const contentRef = contentMotionRef;
|
|
163
177
|
const fill = fillRef;
|
|
@@ -197,8 +211,6 @@ function useToggleButtonAnimations({
|
|
|
197
211
|
const beginPressFillCoordination = useCallback(() => {
|
|
198
212
|
if (!shouldCoordinateFill) return;
|
|
199
213
|
deferFillFromPressRef.current = true;
|
|
200
|
-
pressReleaseStartedRef.current = false;
|
|
201
|
-
pendingFillRef.current = null;
|
|
202
214
|
}, [shouldCoordinateFill]);
|
|
203
215
|
const handlePointerDown = useCallback(
|
|
204
216
|
(e) => {
|
|
@@ -215,10 +227,18 @@ function useToggleButtonAnimations({
|
|
|
215
227
|
const handlePointerUp = useCallback(
|
|
216
228
|
(e) => {
|
|
217
229
|
onPointerUp?.(e);
|
|
230
|
+
releasePressFillCoordination();
|
|
218
231
|
if (!enabled || e.defaultPrevented) return;
|
|
219
232
|
playRoot("pressOut");
|
|
220
233
|
},
|
|
221
|
-
[enabled, onPointerUp, playRoot]
|
|
234
|
+
[enabled, onPointerUp, playRoot, releasePressFillCoordination]
|
|
235
|
+
);
|
|
236
|
+
const handlePointerCancel = useCallback(
|
|
237
|
+
(e) => {
|
|
238
|
+
onPointerCancel?.(e);
|
|
239
|
+
releasePressFillCoordination();
|
|
240
|
+
},
|
|
241
|
+
[onPointerCancel, releasePressFillCoordination]
|
|
222
242
|
);
|
|
223
243
|
const handlePointerEnter = useCallback(
|
|
224
244
|
(e) => {
|
|
@@ -229,9 +249,9 @@ function useToggleButtonAnimations({
|
|
|
229
249
|
const handlePointerLeave = useCallback(
|
|
230
250
|
(e) => {
|
|
231
251
|
onPointerLeave?.(e);
|
|
232
|
-
|
|
252
|
+
releasePressFillCoordination();
|
|
233
253
|
},
|
|
234
|
-
[
|
|
254
|
+
[onPointerLeave, releasePressFillCoordination]
|
|
235
255
|
);
|
|
236
256
|
const handleKeyDown = useCallback(
|
|
237
257
|
(e) => {
|
|
@@ -245,18 +265,19 @@ function useToggleButtonAnimations({
|
|
|
245
265
|
},
|
|
246
266
|
[beginPressFillCoordination, enabled, onKeyDown, playRoot, scope]
|
|
247
267
|
);
|
|
248
|
-
const
|
|
249
|
-
(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
268
|
+
const handleKeyUp = useCallback(
|
|
269
|
+
(e) => {
|
|
270
|
+
onKeyUp?.(e);
|
|
271
|
+
releasePressFillCoordination();
|
|
272
|
+
},
|
|
273
|
+
[onKeyUp, releasePressFillCoordination]
|
|
274
|
+
);
|
|
275
|
+
const handleBlur = useCallback(
|
|
276
|
+
(e) => {
|
|
277
|
+
onBlur?.(e);
|
|
278
|
+
releasePressFillCoordination();
|
|
258
279
|
},
|
|
259
|
-
[
|
|
280
|
+
[onBlur, releasePressFillCoordination]
|
|
260
281
|
);
|
|
261
282
|
return {
|
|
262
283
|
setRefs,
|
|
@@ -265,10 +286,12 @@ function useToggleButtonAnimations({
|
|
|
265
286
|
handlePointerLeave,
|
|
266
287
|
handlePointerDown,
|
|
267
288
|
handlePointerUp,
|
|
289
|
+
handlePointerCancel,
|
|
268
290
|
handleKeyDown,
|
|
291
|
+
handleKeyUp,
|
|
292
|
+
handleBlur,
|
|
269
293
|
pointerHandlers: hoverHandlers,
|
|
270
294
|
bindFillRef,
|
|
271
|
-
queueFillOnClick,
|
|
272
295
|
displayPressed
|
|
273
296
|
};
|
|
274
297
|
}
|
|
@@ -12,7 +12,8 @@ export declare const TOGGLE_BUTTON_FILL_BASE_CLASS = "pointer-events-none absolu
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function toggleButtonFillClipClass(groupSegment: ButtonGroupSegment | undefined, variant: ToggleButtonVariant): string;
|
|
14
14
|
export declare const TOGGLE_BUTTON_CONTENT_BASE_CLASS = "relative z-[1] inline-flex w-full min-w-0 items-center justify-center gap-xsmall";
|
|
15
|
-
|
|
15
|
+
/** Marker so overlay press scales this node, not the segment shell that paints the fill. */
|
|
16
|
+
export declare const TOGGLE_BUTTON_CONTENT_GROUP_MOTION_CLASS = "button-group-motion origin-center";
|
|
16
17
|
export declare const TOGGLE_BUTTON_ICON_SLOT_CLASS = "icon-slot inline-flex shrink-0 items-center justify-center";
|
|
17
18
|
export declare const TOGGLE_BUTTON_LABEL_LAYER_CLASS = "inline-flex w-full min-w-0 items-center gap-xsmall";
|
|
18
19
|
export declare const TOGGLE_BUTTON_TEXT_CLASS = "min-w-0 shrink";
|
|
@@ -16,6 +16,25 @@ function toggleButtonHoverVariant(variant) {
|
|
|
16
16
|
if (variant === "outline" || variant === "ghost") return "transparent-hover";
|
|
17
17
|
return "default";
|
|
18
18
|
}
|
|
19
|
+
const TOGGLE_BUTTON_PRESSED_FILL_HOVER_CLASS = {
|
|
20
|
+
"bg-primary-tint": "group-hover/toggle:bg-primary-tint/80",
|
|
21
|
+
"bg-primary": "group-hover/toggle:bg-primary/80",
|
|
22
|
+
"bg-secondary": "group-hover/toggle:bg-secondary/80",
|
|
23
|
+
"bg-tertiary": "group-hover/toggle:bg-tertiary/80",
|
|
24
|
+
"bg-muted": "group-hover/toggle:bg-muted/80",
|
|
25
|
+
"bg-surface": "group-hover/toggle:bg-surface/80",
|
|
26
|
+
"bg-danger": "group-hover/toggle:bg-danger/80",
|
|
27
|
+
"bg-success": "group-hover/toggle:bg-success/80",
|
|
28
|
+
"bg-info": "group-hover/toggle:bg-info/80",
|
|
29
|
+
"bg-warning": "group-hover/toggle:bg-warning/80",
|
|
30
|
+
"bg-surface-tint-danger": "group-hover/toggle:bg-surface-tint-danger/80",
|
|
31
|
+
"bg-surface-tint-success": "group-hover/toggle:bg-surface-tint-success/80",
|
|
32
|
+
"bg-surface-tint-info": "group-hover/toggle:bg-surface-tint-info/80",
|
|
33
|
+
"bg-surface-tint-warning": "group-hover/toggle:bg-surface-tint-warning/80"
|
|
34
|
+
};
|
|
35
|
+
function toggleButtonPressedFillHoverClass(fillColor) {
|
|
36
|
+
return TOGGLE_BUTTON_PRESSED_FILL_HOVER_CLASS[fillColor] ?? "group-hover/toggle:opacity-80";
|
|
37
|
+
}
|
|
19
38
|
function toggleButtonIdleFillHoverClass(variant) {
|
|
20
39
|
return variant === "outline" || variant === "ghost" ? "group-hover/toggle:bg-transparent-hover" : "group-hover/toggle:bg-default-hover";
|
|
21
40
|
}
|
|
@@ -34,7 +53,7 @@ function toggleButtonFillClipClass(groupSegment, variant) {
|
|
|
34
53
|
);
|
|
35
54
|
}
|
|
36
55
|
const TOGGLE_BUTTON_CONTENT_BASE_CLASS = "relative z-[1] inline-flex w-full min-w-0 items-center justify-center gap-xsmall";
|
|
37
|
-
const TOGGLE_BUTTON_CONTENT_GROUP_MOTION_CLASS = "origin-center";
|
|
56
|
+
const TOGGLE_BUTTON_CONTENT_GROUP_MOTION_CLASS = "button-group-motion origin-center";
|
|
38
57
|
const TOGGLE_BUTTON_ICON_SLOT_CLASS = "icon-slot inline-flex shrink-0 items-center justify-center";
|
|
39
58
|
const TOGGLE_BUTTON_LABEL_LAYER_CLASS = "inline-flex w-full min-w-0 items-center gap-xsmall";
|
|
40
59
|
const TOGGLE_BUTTON_TEXT_CLASS = "min-w-0 shrink";
|
|
@@ -65,7 +84,7 @@ function toggleButtonFillClass({
|
|
|
65
84
|
TOGGLE_BUTTON_FILL_BASE_CLASS,
|
|
66
85
|
fillColor,
|
|
67
86
|
SURFACE_COLOR_TRANSITION,
|
|
68
|
-
pressed ?
|
|
87
|
+
pressed ? toggleButtonPressedFillHoverClass(fillColor) : toggleButtonIdleFillHoverClass(visual.key),
|
|
69
88
|
roundingClass,
|
|
70
89
|
slotClass
|
|
71
90
|
);
|
|
@@ -130,5 +130,8 @@ export type UseToggleButtonAnimationsProps = {
|
|
|
130
130
|
onPointerOut?: PointerEventHandler<HTMLButtonElement>;
|
|
131
131
|
onPointerDown?: PointerEventHandler<HTMLButtonElement>;
|
|
132
132
|
onPointerUp?: PointerEventHandler<HTMLButtonElement>;
|
|
133
|
+
onPointerCancel?: PointerEventHandler<HTMLButtonElement>;
|
|
133
134
|
onKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
|
|
135
|
+
onKeyUp?: KeyboardEventHandler<HTMLButtonElement>;
|
|
136
|
+
onBlur?: React.FocusEventHandler<HTMLButtonElement>;
|
|
134
137
|
};
|
|
@@ -31,6 +31,6 @@ export declare function useToggleButtonRootState({ value: itemValue, groupSegmen
|
|
|
31
31
|
tabIndex: 0 | -1 | undefined;
|
|
32
32
|
isCompound: boolean;
|
|
33
33
|
children: import('react').ReactNode;
|
|
34
|
-
handleClick: (e: React.MouseEvent<HTMLButtonElement
|
|
34
|
+
handleClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
35
35
|
handleFocus: (e: FocusEvent<HTMLButtonElement>) => void;
|
|
36
36
|
};
|
|
@@ -40,17 +40,14 @@ function useToggleButtonRootState({
|
|
|
40
40
|
const roundingClass = toggleButtonRoundingClass(groupSegment, size);
|
|
41
41
|
const isCompound = useMemo(() => hasToggleButtonCompoundChildren(children), [children]);
|
|
42
42
|
const handleClick = useCallback(
|
|
43
|
-
(e
|
|
43
|
+
(e) => {
|
|
44
44
|
onClick?.(e);
|
|
45
45
|
if (e.defaultPrevented || disabled) return;
|
|
46
46
|
if (inGroup && itemValue != null) {
|
|
47
|
-
const nextPressed = groupCtx.type === "single" ? true : !groupCtx.isSelected(itemValue);
|
|
48
47
|
groupCtx.select(itemValue);
|
|
49
|
-
queueFillOnClick(nextPressed);
|
|
50
48
|
return;
|
|
51
49
|
}
|
|
52
50
|
const next = !pressed;
|
|
53
|
-
queueFillOnClick(next);
|
|
54
51
|
setLocalPressed(next);
|
|
55
52
|
onPressedChange?.(next);
|
|
56
53
|
},
|
|
@@ -68,10 +65,10 @@ function useToggleButtonRootState({
|
|
|
68
65
|
const handleFocus = useCallback(
|
|
69
66
|
(e) => {
|
|
70
67
|
onFocus?.(e);
|
|
71
|
-
if (e.defaultPrevented || !inGroup || itemValue == null) return;
|
|
68
|
+
if (e.defaultPrevented || disabled || !inGroup || itemValue == null) return;
|
|
72
69
|
groupCtx.setRovingValue(itemValue);
|
|
73
70
|
},
|
|
74
|
-
[groupCtx, inGroup, itemValue, onFocus]
|
|
71
|
+
[disabled, groupCtx, inGroup, itemValue, onFocus]
|
|
75
72
|
);
|
|
76
73
|
return {
|
|
77
74
|
itemValue,
|
|
@@ -90,7 +87,7 @@ function useToggleButtonRootState({
|
|
|
90
87
|
role: toggleButtonRole({ inGroup, isSingleGroup }),
|
|
91
88
|
ariaPressed: toggleButtonAriaPressed({ inGroup, isSingleGroup, pressed }),
|
|
92
89
|
ariaChecked: toggleButtonAriaChecked({ inGroup, isSingleGroup, pressed }),
|
|
93
|
-
tabIndex: inGroup ? groupCtx.tabIndexFor(itemValue) : void 0,
|
|
90
|
+
tabIndex: disabled ? void 0 : inGroup ? groupCtx.tabIndexFor(itemValue) : void 0,
|
|
94
91
|
isCompound,
|
|
95
92
|
children,
|
|
96
93
|
handleClick,
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRef, useLayoutEffect } from "react";
|
|
3
|
+
import { killMotion } from "../utils/gsapMotion.js";
|
|
4
|
+
import { isReducedModalMotion, applyReducedPortalMotion } from "../utils/modalSurfaceMotion.js";
|
|
5
|
+
import { useMotionConfig } from "../utils/motionConfigContext.js";
|
|
6
|
+
import { prefersReducedMotion } from "../utils/reducedMotion.js";
|
|
3
7
|
import { overlaySkinMotion } from "../../../skins/resolveVariantVisual.js";
|
|
4
8
|
import { KIT_TOOLTIP_VARIANTS } from "./tooltipTypes.js";
|
|
5
9
|
import { bindPortalRecipes } from "../utils/slotMotion/recipes/bindPortal.js";
|
|
@@ -21,6 +25,7 @@ function useTooltipPortalMotion({
|
|
|
21
25
|
setPortalMounted,
|
|
22
26
|
scope
|
|
23
27
|
}) {
|
|
28
|
+
const config = useMotionConfig();
|
|
24
29
|
const enterFrameRef = useRef(0);
|
|
25
30
|
const enterGenRef = useRef(0);
|
|
26
31
|
useLayoutEffect(() => {
|
|
@@ -28,6 +33,17 @@ function useTooltipPortalMotion({
|
|
|
28
33
|
const el = scope.getTarget("content");
|
|
29
34
|
if (!el) return void 0;
|
|
30
35
|
const cancelEnterFrame = () => invalidateEnterFrame(enterFrameRef, enterGenRef);
|
|
36
|
+
if (isReducedModalMotion(config, prefersReducedMotion())) {
|
|
37
|
+
killMotion(el);
|
|
38
|
+
if (open) {
|
|
39
|
+
applyReducedPortalMotion(el);
|
|
40
|
+
} else {
|
|
41
|
+
setPortalMounted(false);
|
|
42
|
+
}
|
|
43
|
+
return () => {
|
|
44
|
+
cancelEnterFrame();
|
|
45
|
+
};
|
|
46
|
+
}
|
|
31
47
|
if (open) {
|
|
32
48
|
const gen = ++enterGenRef.current;
|
|
33
49
|
scope.play("content", "enter", { el });
|
|
@@ -63,7 +79,7 @@ function useTooltipPortalMotion({
|
|
|
63
79
|
return () => {
|
|
64
80
|
leaveWait.kill();
|
|
65
81
|
};
|
|
66
|
-
}, [open, portalMounted, scope, setPortalMounted]);
|
|
82
|
+
}, [config, open, portalMounted, scope, setPortalMounted]);
|
|
67
83
|
}
|
|
68
84
|
export {
|
|
69
85
|
TOOLTIP_MOTION_DEFAULTS,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, useMemo, useCallback, Children, isValidElement, cloneElement, useRef, useState, useLayoutEffect } from "react";
|
|
3
|
+
import { forwardRef, useMemo, useCallback, Children, isValidElement, cloneElement, useRef, useState, useLayoutEffect, useEffect } from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import { SEMANTIC_STATUS_ICONS } from "../utils/semanticStatusIcons.js";
|
|
6
6
|
import { burneLightThemePortalProps } from "../utils/burneLightTheme.js";
|
|
7
7
|
import { dataOpenState, dataVariantProps } from "../utils/dataContract.js";
|
|
8
8
|
import { bindOverlayReflow } from "../utils/bindOverlayReflow.js";
|
|
9
|
-
import {
|
|
9
|
+
import { OverlayLayerProvider } from "../utils/overlayLayer.js";
|
|
10
|
+
import { resolveFloatingPortalContainer, applyFloatingPortalPosition } from "../utils/portalContainer.js";
|
|
11
|
+
import { isRtlElement } from "../utils/readingDirection.js";
|
|
10
12
|
import { useSkinVariant, useSkinSurfaceStyle, mergeSkinSurfaceStyle, useSkinRegistryRevision, useApplySkinPortal } from "../../../skins/skinContext.js";
|
|
11
13
|
import { messageBannerDescriptionCellClass, messageBannerTitleCellClass } from "../utils/messageBannerGridLayout.js";
|
|
12
14
|
import { mergeAsChildProps } from "../utils/mergeAsChildProps.js";
|
|
@@ -295,15 +297,21 @@ const TooltipTrigger = forwardRef(
|
|
|
295
297
|
...rest
|
|
296
298
|
}, ref) {
|
|
297
299
|
const slotClassNames = useTooltipClassNames();
|
|
298
|
-
const { scheduleShow, hide, tooltipId, open, triggerRef } = useTooltipContext("Tooltip.Trigger");
|
|
300
|
+
const { scheduleShow, leaveTrigger, hide, tooltipId, open, triggerRef } = useTooltipContext("Tooltip.Trigger");
|
|
299
301
|
const triggerHandlers = useMemo(
|
|
300
302
|
() => ({
|
|
301
|
-
onPointerEnter: () =>
|
|
302
|
-
|
|
303
|
+
onPointerEnter: (e) => {
|
|
304
|
+
if (e.pointerType === "touch") return;
|
|
305
|
+
scheduleShow();
|
|
306
|
+
},
|
|
307
|
+
onPointerLeave: (e) => {
|
|
308
|
+
if (e.pointerType === "touch") return;
|
|
309
|
+
leaveTrigger();
|
|
310
|
+
},
|
|
303
311
|
onFocus: () => scheduleShow(),
|
|
304
312
|
onBlur: () => hide()
|
|
305
313
|
}),
|
|
306
|
-
[hide, scheduleShow]
|
|
314
|
+
[hide, leaveTrigger, scheduleShow]
|
|
307
315
|
);
|
|
308
316
|
const mergedRef = useCallback(
|
|
309
317
|
(node) => {
|
|
@@ -330,7 +338,8 @@ const TooltipTrigger = forwardRef(
|
|
|
330
338
|
onBlur
|
|
331
339
|
}),
|
|
332
340
|
className: cn(slotClassNames.trigger, className),
|
|
333
|
-
"aria-describedby": mergeDescribedBy(childDescribedBy, tooltipId, open)
|
|
341
|
+
"aria-describedby": mergeDescribedBy(childDescribedBy, tooltipId, open),
|
|
342
|
+
"data-state": dataOpenState(open)
|
|
334
343
|
},
|
|
335
344
|
mergedRef
|
|
336
345
|
)
|
|
@@ -354,6 +363,7 @@ const TooltipTrigger = forwardRef(
|
|
|
354
363
|
onBlur
|
|
355
364
|
}),
|
|
356
365
|
...rest,
|
|
366
|
+
"data-state": dataOpenState(open),
|
|
357
367
|
children
|
|
358
368
|
}
|
|
359
369
|
);
|
|
@@ -437,6 +447,8 @@ function TooltipContentHost({
|
|
|
437
447
|
collisionPadding,
|
|
438
448
|
avoidCollisions,
|
|
439
449
|
portalContainer: portalContainerProp,
|
|
450
|
+
onPointerEnter,
|
|
451
|
+
onPointerLeave,
|
|
440
452
|
forwardedRef,
|
|
441
453
|
...rest
|
|
442
454
|
}) {
|
|
@@ -454,19 +466,52 @@ function TooltipContentHost({
|
|
|
454
466
|
avoidCollisions: avoidCollisionsFromRoot,
|
|
455
467
|
icon,
|
|
456
468
|
triggerRef,
|
|
469
|
+
contentRef,
|
|
470
|
+
layerId,
|
|
471
|
+
holdContent,
|
|
472
|
+
leaveContent,
|
|
457
473
|
portalContainer: portalContainerFromRoot
|
|
458
474
|
} = useTooltipContext("Tooltip.Content");
|
|
475
|
+
const effectiveContainer = portalContainerProp ?? portalContainerFromRoot;
|
|
459
476
|
const tipRef = useRef(null);
|
|
460
477
|
const [portalMounted, setPortalMounted] = useState(false);
|
|
461
478
|
const [resolvedSide, setResolvedSide] = useState(side);
|
|
479
|
+
const [resolvedHost, setResolvedHost] = useState(
|
|
480
|
+
() => resolveFloatingPortalContainer(effectiveContainer, null)
|
|
481
|
+
);
|
|
482
|
+
const [portalMeta, setPortalMeta] = useState({});
|
|
462
483
|
useApplySkinPortal(tipRef, portalMounted);
|
|
463
484
|
if (open && !portalMounted) {
|
|
464
485
|
setPortalMounted(true);
|
|
465
486
|
}
|
|
487
|
+
const syncPortalHost = useCallback(() => {
|
|
488
|
+
const trigger = triggerRef.current;
|
|
489
|
+
const next = resolveFloatingPortalContainer(effectiveContainer, trigger);
|
|
490
|
+
setResolvedHost((prev) => prev === next ? prev : next);
|
|
491
|
+
const nextTheme = burneLightThemePortalProps(trigger)["data-theme"];
|
|
492
|
+
const dirAncestor = trigger?.closest?.("[dir]");
|
|
493
|
+
const rawDir = dirAncestor && dirAncestor !== document.documentElement ? dirAncestor.getAttribute("dir") : null;
|
|
494
|
+
const nextDir = rawDir === "rtl" || rawDir === "ltr" ? rawDir : trigger && isRtlElement(trigger) ? "rtl" : void 0;
|
|
495
|
+
setPortalMeta(
|
|
496
|
+
(prev) => prev.theme === nextTheme && prev.dir === nextDir ? prev : { theme: nextTheme, dir: nextDir }
|
|
497
|
+
);
|
|
498
|
+
}, [effectiveContainer, triggerRef]);
|
|
499
|
+
useLayoutEffect(() => {
|
|
500
|
+
if (!open && !portalMounted) return;
|
|
501
|
+
syncPortalHost();
|
|
502
|
+
}, [open, portalMounted, syncPortalHost]);
|
|
503
|
+
useEffect(() => {
|
|
504
|
+
if (!open) return;
|
|
505
|
+
syncPortalHost();
|
|
506
|
+
}, [open, syncPortalHost]);
|
|
466
507
|
const motionScope = useTooltipMotionScope();
|
|
467
|
-
const setTipRef = useCallback(
|
|
468
|
-
|
|
469
|
-
|
|
508
|
+
const setTipRef = useCallback(
|
|
509
|
+
(node2) => {
|
|
510
|
+
tipRef.current = node2;
|
|
511
|
+
contentRef.current = node2;
|
|
512
|
+
},
|
|
513
|
+
[contentRef]
|
|
514
|
+
);
|
|
470
515
|
const parts = Children.toArray(children);
|
|
471
516
|
const customArrow = parts.find(
|
|
472
517
|
(child) => isValidElement(child) && isTooltipArrowElement(child)
|
|
@@ -478,37 +523,36 @@ function TooltipContentHost({
|
|
|
478
523
|
const trigger = triggerRef.current;
|
|
479
524
|
const tip = tipRef.current;
|
|
480
525
|
if (!trigger || !tip) return;
|
|
526
|
+
const resolvedAlign2 = align ?? alignFromRoot;
|
|
481
527
|
const placement = computeTooltipPlacement(
|
|
482
528
|
trigger.getBoundingClientRect(),
|
|
483
529
|
tip.getBoundingClientRect(),
|
|
484
530
|
sideProp ?? side,
|
|
485
531
|
offsetProp ?? offsetFromRoot ?? TOOLTIP_DEFAULT_OFFSET,
|
|
486
532
|
{
|
|
487
|
-
align:
|
|
533
|
+
align: resolvedAlign2,
|
|
488
534
|
collisionPadding: collisionPadding ?? collisionPaddingFromRoot,
|
|
489
535
|
avoidCollisions: avoidCollisions ?? avoidCollisionsFromRoot
|
|
490
536
|
}
|
|
491
537
|
);
|
|
538
|
+
const activeHost = resolveFloatingPortalContainer(effectiveContainer, trigger) ?? resolvedHost;
|
|
492
539
|
setResolvedSide(placement.resolvedSide);
|
|
493
540
|
applyFloatingPortalPosition(
|
|
494
541
|
tip,
|
|
495
542
|
placement,
|
|
496
|
-
|
|
543
|
+
activeHost
|
|
497
544
|
);
|
|
498
545
|
tip.style.transform = "";
|
|
499
|
-
}, [align, alignFromRoot, avoidCollisions, avoidCollisionsFromRoot, collisionPadding, collisionPaddingFromRoot, offsetFromRoot, offsetProp,
|
|
546
|
+
}, [align, alignFromRoot, avoidCollisions, avoidCollisionsFromRoot, collisionPadding, collisionPaddingFromRoot, effectiveContainer, offsetFromRoot, offsetProp, resolvedHost, side, sideProp, triggerRef]);
|
|
500
547
|
useLayoutEffect(() => {
|
|
501
548
|
if (!open || !portalMounted) return;
|
|
502
549
|
reposition();
|
|
503
550
|
const raf = window.requestAnimationFrame(() => reposition());
|
|
504
551
|
const unbindReflow = bindOverlayReflow(reposition);
|
|
505
552
|
const tip = tipRef.current;
|
|
506
|
-
const host = resolvePortalContainer(
|
|
507
|
-
portalContainerProp ?? portalContainerFromRoot
|
|
508
|
-
);
|
|
509
553
|
const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(() => reposition()) : null;
|
|
510
554
|
if (tip && ro) ro.observe(tip);
|
|
511
|
-
if (
|
|
555
|
+
if (resolvedHost && resolvedHost !== document.body && ro) ro.observe(resolvedHost);
|
|
512
556
|
return () => {
|
|
513
557
|
window.cancelAnimationFrame(raf);
|
|
514
558
|
unbindReflow();
|
|
@@ -517,8 +561,7 @@ function TooltipContentHost({
|
|
|
517
561
|
}, [
|
|
518
562
|
open,
|
|
519
563
|
portalMounted,
|
|
520
|
-
|
|
521
|
-
portalContainerProp,
|
|
564
|
+
resolvedHost,
|
|
522
565
|
reposition,
|
|
523
566
|
children,
|
|
524
567
|
showArrow
|
|
@@ -531,11 +574,14 @@ function TooltipContentHost({
|
|
|
531
574
|
});
|
|
532
575
|
if (!portalMounted) return null;
|
|
533
576
|
if (typeof document === "undefined") return null;
|
|
534
|
-
const portalHost =
|
|
535
|
-
portalContainerProp ?? portalContainerFromRoot
|
|
536
|
-
);
|
|
577
|
+
const portalHost = resolveFloatingPortalContainer(effectiveContainer, triggerRef.current) ?? resolvedHost;
|
|
537
578
|
if (!portalHost) return null;
|
|
538
|
-
const
|
|
579
|
+
const liveTheme = burneLightThemePortalProps(triggerRef.current)["data-theme"] ?? portalMeta.theme;
|
|
580
|
+
const portalTheme = liveTheme ? { "data-theme": liveTheme } : {};
|
|
581
|
+
const triggerDirAncestor = triggerRef.current?.closest?.("[dir]");
|
|
582
|
+
const rawTriggerDir = triggerDirAncestor && triggerDirAncestor !== document.documentElement ? triggerDirAncestor.getAttribute("dir") : null;
|
|
583
|
+
const portalDir = rawTriggerDir === "rtl" || rawTriggerDir === "ltr" ? rawTriggerDir : portalMeta.dir ?? (triggerRef.current && isRtlElement(triggerRef.current) ? "rtl" : void 0);
|
|
584
|
+
const resolvedAlign = align ?? alignFromRoot ?? "center";
|
|
539
585
|
const bubble = /* @__PURE__ */ jsx(
|
|
540
586
|
TooltipPanel,
|
|
541
587
|
{
|
|
@@ -548,10 +594,11 @@ function TooltipContentHost({
|
|
|
548
594
|
children: bodyChildren.length === 1 ? bodyChildren[0] : bodyChildren
|
|
549
595
|
}
|
|
550
596
|
);
|
|
551
|
-
const node = /* @__PURE__ */ jsx(TooltipResolvedSideContext.Provider, { value: resolvedSide, children: /* @__PURE__ */ jsx(
|
|
597
|
+
const node = /* @__PURE__ */ jsx(OverlayLayerProvider, { layerId, children: /* @__PURE__ */ jsx(TooltipResolvedSideContext.Provider, { value: resolvedSide, children: /* @__PURE__ */ jsx(
|
|
552
598
|
"div",
|
|
553
599
|
{
|
|
554
600
|
ref: setTipRef,
|
|
601
|
+
dir: portalDir,
|
|
555
602
|
...portalTheme,
|
|
556
603
|
role: "tooltip",
|
|
557
604
|
id: tooltipId,
|
|
@@ -559,17 +606,27 @@ function TooltipContentHost({
|
|
|
559
606
|
resolvedSide,
|
|
560
607
|
showArrow
|
|
561
608
|
}),
|
|
609
|
+
onPointerEnter: (e) => {
|
|
610
|
+
onPointerEnter?.(e);
|
|
611
|
+
if (e.defaultPrevented || e.pointerType === "touch") return;
|
|
612
|
+
holdContent();
|
|
613
|
+
},
|
|
614
|
+
onPointerLeave: (e) => {
|
|
615
|
+
onPointerLeave?.(e);
|
|
616
|
+
if (e.defaultPrevented || e.pointerType === "touch") return;
|
|
617
|
+
leaveContent();
|
|
618
|
+
},
|
|
562
619
|
...rest,
|
|
563
620
|
...dataVariantProps({ size, variant, status }),
|
|
564
621
|
"data-side": resolvedSide,
|
|
565
|
-
"data-align":
|
|
622
|
+
"data-align": resolvedAlign,
|
|
566
623
|
"data-state": dataOpenState(open),
|
|
567
624
|
children: /* @__PURE__ */ jsxs("div", { className: cn(TOOLTIP_CONTENT_INNER_CLASS, slotClassNames.panelRelative), children: [
|
|
568
625
|
showArrow ? customArrow ?? /* @__PURE__ */ jsx(TooltipArrow, {}) : null,
|
|
569
626
|
bubble
|
|
570
627
|
] })
|
|
571
628
|
}
|
|
572
|
-
) });
|
|
629
|
+
) }) });
|
|
573
630
|
return createPortal(node, portalHost);
|
|
574
631
|
}
|
|
575
632
|
export {
|