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,48 +1,72 @@
|
|
|
1
1
|
const VIEWPORT_PAD = 8;
|
|
2
|
-
function
|
|
3
|
-
|
|
2
|
+
function getViewportBounds() {
|
|
3
|
+
if (typeof window === "undefined") {
|
|
4
|
+
return { left: 0, top: 0, right: 1024, bottom: 768 };
|
|
5
|
+
}
|
|
6
|
+
const vv = window.visualViewport;
|
|
7
|
+
if (vv) {
|
|
8
|
+
const left = vv.offsetLeft ?? 0;
|
|
9
|
+
const top = vv.offsetTop ?? 0;
|
|
10
|
+
return {
|
|
11
|
+
left,
|
|
12
|
+
top,
|
|
13
|
+
right: left + vv.width,
|
|
14
|
+
bottom: top + vv.height
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
left: 0,
|
|
19
|
+
top: 0,
|
|
20
|
+
right: window.innerWidth,
|
|
21
|
+
bottom: window.innerHeight
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function clampToViewport(value, size, vpStart, vpEnd, pad) {
|
|
25
|
+
const min = vpStart + pad;
|
|
26
|
+
const max = Math.max(min, vpEnd - size - pad);
|
|
27
|
+
return Math.max(min, Math.min(value, max));
|
|
4
28
|
}
|
|
5
|
-
function alignAlongAxis(anchorStart, anchorSize, floatingSize, align,
|
|
6
|
-
const
|
|
7
|
-
return
|
|
29
|
+
function alignAlongAxis(anchorStart, anchorSize, floatingSize, align, vpStart, vpEnd, pad) {
|
|
30
|
+
const pos = align === "start" ? anchorStart : align === "end" ? anchorStart + anchorSize - floatingSize : anchorStart + anchorSize / 2 - floatingSize / 2;
|
|
31
|
+
return clampToViewport(pos, floatingSize, vpStart, vpEnd, pad);
|
|
8
32
|
}
|
|
9
|
-
function fitsTop(tr, height, gap, pad) {
|
|
10
|
-
return tr.top - gap - height >= pad;
|
|
33
|
+
function fitsTop(tr, height, gap, pad, vp) {
|
|
34
|
+
return tr.top - gap - height >= vp.top + pad;
|
|
11
35
|
}
|
|
12
|
-
function fitsBottom(tr, height, gap, pad) {
|
|
13
|
-
return tr.bottom + gap + height <=
|
|
36
|
+
function fitsBottom(tr, height, gap, pad, vp) {
|
|
37
|
+
return tr.bottom + gap + height <= vp.bottom - pad;
|
|
14
38
|
}
|
|
15
|
-
function fitsLeft(tr, width, gap, pad) {
|
|
16
|
-
return tr.left - gap - width >= pad;
|
|
39
|
+
function fitsLeft(tr, width, gap, pad, vp) {
|
|
40
|
+
return tr.left - gap - width >= vp.left + pad;
|
|
17
41
|
}
|
|
18
|
-
function fitsRight(tr, width, gap, pad) {
|
|
19
|
-
return tr.right + gap + width <=
|
|
42
|
+
function fitsRight(tr, width, gap, pad, vp) {
|
|
43
|
+
return tr.right + gap + width <= vp.right - pad;
|
|
20
44
|
}
|
|
21
|
-
function placeTop(tr, fr, gap, pad, align) {
|
|
45
|
+
function placeTop(tr, fr, gap, pad, align, vp) {
|
|
22
46
|
return {
|
|
23
|
-
left: alignAlongAxis(tr.left, tr.width, fr.width, align,
|
|
24
|
-
top: tr.top - gap - fr.height,
|
|
47
|
+
left: alignAlongAxis(tr.left, tr.width, fr.width, align, vp.left, vp.right, pad),
|
|
48
|
+
top: clampToViewport(tr.top - gap - fr.height, fr.height, vp.top, vp.bottom, pad),
|
|
25
49
|
resolvedSide: "top"
|
|
26
50
|
};
|
|
27
51
|
}
|
|
28
|
-
function placeBottom(tr, fr, gap, pad, align) {
|
|
52
|
+
function placeBottom(tr, fr, gap, pad, align, vp) {
|
|
29
53
|
return {
|
|
30
|
-
left: alignAlongAxis(tr.left, tr.width, fr.width, align,
|
|
31
|
-
top: tr.bottom + gap,
|
|
54
|
+
left: alignAlongAxis(tr.left, tr.width, fr.width, align, vp.left, vp.right, pad),
|
|
55
|
+
top: clampToViewport(tr.bottom + gap, fr.height, vp.top, vp.bottom, pad),
|
|
32
56
|
resolvedSide: "bottom"
|
|
33
57
|
};
|
|
34
58
|
}
|
|
35
|
-
function placeLeft(tr, fr, gap, pad, align) {
|
|
59
|
+
function placeLeft(tr, fr, gap, pad, align, vp) {
|
|
36
60
|
return {
|
|
37
|
-
left: tr.left - gap - fr.width,
|
|
38
|
-
top: alignAlongAxis(tr.top, tr.height, fr.height, align,
|
|
61
|
+
left: clampToViewport(tr.left - gap - fr.width, fr.width, vp.left, vp.right, pad),
|
|
62
|
+
top: alignAlongAxis(tr.top, tr.height, fr.height, align, vp.top, vp.bottom, pad),
|
|
39
63
|
resolvedSide: "left"
|
|
40
64
|
};
|
|
41
65
|
}
|
|
42
|
-
function placeRight(tr, fr, gap, pad, align) {
|
|
66
|
+
function placeRight(tr, fr, gap, pad, align, vp) {
|
|
43
67
|
return {
|
|
44
|
-
left: tr.right + gap,
|
|
45
|
-
top: alignAlongAxis(tr.top, tr.height, fr.height, align,
|
|
68
|
+
left: clampToViewport(tr.right + gap, fr.width, vp.left, vp.right, pad),
|
|
69
|
+
top: alignAlongAxis(tr.top, tr.height, fr.height, align, vp.top, vp.bottom, pad),
|
|
46
70
|
resolvedSide: "right"
|
|
47
71
|
};
|
|
48
72
|
}
|
|
@@ -53,10 +77,10 @@ const PLACERS = {
|
|
|
53
77
|
right: placeRight
|
|
54
78
|
};
|
|
55
79
|
const FIT_CHECKS = {
|
|
56
|
-
top: (tr, _w, h, gap, pad) => fitsTop(tr, h, gap, pad),
|
|
57
|
-
bottom: (tr, _w, h, gap, pad) => fitsBottom(tr, h, gap, pad),
|
|
58
|
-
left: (tr, w, _h, gap, pad) => fitsLeft(tr, w, gap, pad),
|
|
59
|
-
right: (tr, w, _h, gap, pad) => fitsRight(tr, w, gap, pad)
|
|
80
|
+
top: (tr, _w, h, gap, pad, vp) => fitsTop(tr, h, gap, pad, vp),
|
|
81
|
+
bottom: (tr, _w, h, gap, pad, vp) => fitsBottom(tr, h, gap, pad, vp),
|
|
82
|
+
left: (tr, w, _h, gap, pad, vp) => fitsLeft(tr, w, gap, pad, vp),
|
|
83
|
+
right: (tr, w, _h, gap, pad, vp) => fitsRight(tr, w, gap, pad, vp)
|
|
60
84
|
};
|
|
61
85
|
const FLIP_ORDER = {
|
|
62
86
|
top: ["top", "bottom", "right", "left"],
|
|
@@ -69,14 +93,15 @@ function computeTooltipPlacement(triggerRect, floatingRect, preferredSide, offse
|
|
|
69
93
|
const pad = options?.collisionPadding ?? VIEWPORT_PAD;
|
|
70
94
|
const align = options?.align ?? "center";
|
|
71
95
|
const avoid = options?.avoidCollisions !== false;
|
|
96
|
+
const vp = getViewportBounds();
|
|
72
97
|
const order = avoid ? FLIP_ORDER[preferredSide] : [preferredSide];
|
|
73
98
|
for (const side of order) {
|
|
74
|
-
if (!FIT_CHECKS[side](triggerRect, floatingRect.width, floatingRect.height, gap, pad)) {
|
|
99
|
+
if (!FIT_CHECKS[side](triggerRect, floatingRect.width, floatingRect.height, gap, pad, vp)) {
|
|
75
100
|
continue;
|
|
76
101
|
}
|
|
77
|
-
return PLACERS[side](triggerRect, floatingRect, gap, pad, align);
|
|
102
|
+
return PLACERS[side](triggerRect, floatingRect, gap, pad, align, vp);
|
|
78
103
|
}
|
|
79
|
-
return PLACERS[preferredSide](triggerRect, floatingRect, gap, pad, align);
|
|
104
|
+
return PLACERS[preferredSide](triggerRect, floatingRect, gap, pad, align, vp);
|
|
80
105
|
}
|
|
81
106
|
const TOOLTIP_ARROW_CLASS = {
|
|
82
107
|
top: "bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2",
|
|
@@ -18,11 +18,11 @@ export declare const TOOLTIP_GRID_GAP: Record<TooltipSize, string>;
|
|
|
18
18
|
export declare const TOOLTIP_TRIGGER_BASE_CLASS = "inline-flex shrink-0 outline-none focus-ring";
|
|
19
19
|
export declare const TOOLTIP_INDICATOR_BASE_CLASS = "inline-flex shrink-0";
|
|
20
20
|
export declare const TOOLTIP_TITLE_CLASS = "font-w-mid";
|
|
21
|
-
export declare const TOOLTIP_DESCRIPTION_MUTED_CLASS = "text-muted";
|
|
21
|
+
export declare const TOOLTIP_DESCRIPTION_MUTED_CLASS = "text-muted-foreground";
|
|
22
22
|
export declare const TOOLTIP_ARROW_BASE_CLASS = "pointer-events-none absolute z-0 size-2 rotate-45";
|
|
23
23
|
/** Arrow fill mirrors panel surface (no status tint). */
|
|
24
24
|
export declare const TOOLTIP_ARROW_FILL_CLASS: Record<KitTooltipVariant, string>;
|
|
25
|
-
export declare const TOOLTIP_CONTENT_BASE_CLASS = "pointer-events-
|
|
25
|
+
export declare const TOOLTIP_CONTENT_BASE_CLASS = "pointer-events-auto fixed top-0 start-0 z-tooltip w-max min-w-0 overflow-visible text-start outline-none";
|
|
26
26
|
export declare const TOOLTIP_CONTENT_INNER_CLASS = "relative overflow-visible";
|
|
27
27
|
/** Compound slots (`Tooltip.Message`) — pass-through grid children. */
|
|
28
28
|
export declare const TOOLTIP_COMPOUND_CONTENTS_CLASS = "contents";
|
|
@@ -52,14 +52,14 @@ const TOOLTIP_GRID_GAP = {
|
|
|
52
52
|
const TOOLTIP_TRIGGER_BASE_CLASS = "inline-flex shrink-0 outline-none focus-ring";
|
|
53
53
|
const TOOLTIP_INDICATOR_BASE_CLASS = "inline-flex shrink-0";
|
|
54
54
|
const TOOLTIP_TITLE_CLASS = "font-w-mid";
|
|
55
|
-
const TOOLTIP_DESCRIPTION_MUTED_CLASS = "text-muted";
|
|
55
|
+
const TOOLTIP_DESCRIPTION_MUTED_CLASS = "text-muted-foreground";
|
|
56
56
|
const TOOLTIP_ARROW_BASE_CLASS = "pointer-events-none absolute z-0 size-2 rotate-45";
|
|
57
57
|
const TOOLTIP_ARROW_FILL_CLASS = {
|
|
58
58
|
default: "bg-surface",
|
|
59
59
|
outline: "border-token-outline bg-background",
|
|
60
60
|
secondary: "bg-secondary"
|
|
61
61
|
};
|
|
62
|
-
const TOOLTIP_CONTENT_BASE_CLASS = "pointer-events-
|
|
62
|
+
const TOOLTIP_CONTENT_BASE_CLASS = "pointer-events-auto fixed top-0 start-0 z-tooltip w-max min-w-0 overflow-visible text-start outline-none";
|
|
63
63
|
const TOOLTIP_CONTENT_INNER_CLASS = "relative overflow-visible";
|
|
64
64
|
const TOOLTIP_COMPOUND_CONTENTS_CLASS = "contents";
|
|
65
65
|
const TOOLTIP_PANEL_BASE_CLASS = "relative z-[1] w-max min-w-0 rounded-mid text-start";
|
|
@@ -129,7 +129,12 @@ export type TooltipContextValue = {
|
|
|
129
129
|
/** Status glyph. `null` hides it. A node replaces the status icon. */
|
|
130
130
|
icon?: ReactNode | null;
|
|
131
131
|
triggerRef: React.RefObject<HTMLElement | null>;
|
|
132
|
+
contentRef: React.RefObject<HTMLDivElement | null>;
|
|
133
|
+
layerId: symbol;
|
|
132
134
|
scheduleShow: () => void;
|
|
135
|
+
leaveTrigger: () => void;
|
|
136
|
+
holdContent: () => void;
|
|
137
|
+
leaveContent: () => void;
|
|
133
138
|
hide: () => void;
|
|
134
139
|
/** Portal mount node from Root; Content may override via its own prop. */
|
|
135
140
|
portalContainer?: HTMLElement | null;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRef, useId, useCallback, useEffect, useMemo } from "react";
|
|
3
|
-
import { useOverlayDelay, overlayShouldClose } from "../utils/overlayLayer.js";
|
|
3
|
+
import { useOverlayDelay, useRegisterOverlayLayer, overlayShouldClose } from "../utils/overlayLayer.js";
|
|
4
4
|
import { useControllableState } from "../utils/useControllableState.js";
|
|
5
5
|
import { useSkinVariant } from "../../../skins/skinContext.js";
|
|
6
|
+
const TOOLTIP_HOVER_BRIDGE_MS = 100;
|
|
6
7
|
function useTooltipRootState({
|
|
7
8
|
size = "base",
|
|
8
9
|
variant: variantProp,
|
|
@@ -31,7 +32,12 @@ function useTooltipRootState({
|
|
|
31
32
|
defaultValue: defaultOpen,
|
|
32
33
|
onChange: onOpenChange
|
|
33
34
|
});
|
|
35
|
+
const openRef = useRef(open);
|
|
36
|
+
openRef.current = open;
|
|
34
37
|
const triggerRef = useRef(null);
|
|
38
|
+
const contentRef = useRef(null);
|
|
39
|
+
const pointerOnTriggerRef = useRef(false);
|
|
40
|
+
const pointerOnContentRef = useRef(false);
|
|
35
41
|
const showTimerRef = useRef(null);
|
|
36
42
|
const tooltipId = useId();
|
|
37
43
|
const clearTimer = useCallback(() => {
|
|
@@ -40,36 +46,70 @@ function useTooltipRootState({
|
|
|
40
46
|
showTimerRef.current = null;
|
|
41
47
|
}
|
|
42
48
|
}, []);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!open) {
|
|
51
|
+
pointerOnTriggerRef.current = false;
|
|
52
|
+
pointerOnContentRef.current = false;
|
|
53
|
+
}
|
|
54
|
+
}, [open]);
|
|
43
55
|
const scheduleShow = useCallback(() => {
|
|
56
|
+
pointerOnTriggerRef.current = true;
|
|
44
57
|
clearTimer();
|
|
58
|
+
if (openRef.current) return;
|
|
45
59
|
showTimerRef.current = globalThis.setTimeout(() => {
|
|
46
60
|
showTimerRef.current = null;
|
|
47
61
|
setOpen(true);
|
|
48
62
|
}, openDelay);
|
|
49
63
|
}, [clearTimer, openDelay, setOpen]);
|
|
64
|
+
const scheduleBridgeClose = useCallback(() => {
|
|
65
|
+
clearTimer();
|
|
66
|
+
if (!openRef.current) return;
|
|
67
|
+
const bridgeDelay = Math.max(closeDelay, TOOLTIP_HOVER_BRIDGE_MS);
|
|
68
|
+
showTimerRef.current = globalThis.setTimeout(() => {
|
|
69
|
+
showTimerRef.current = null;
|
|
70
|
+
if (pointerOnTriggerRef.current || pointerOnContentRef.current) return;
|
|
71
|
+
setOpen(false);
|
|
72
|
+
}, bridgeDelay);
|
|
73
|
+
}, [clearTimer, closeDelay, setOpen]);
|
|
74
|
+
const leaveTrigger = useCallback(() => {
|
|
75
|
+
pointerOnTriggerRef.current = false;
|
|
76
|
+
scheduleBridgeClose();
|
|
77
|
+
}, [scheduleBridgeClose]);
|
|
78
|
+
const holdContent = useCallback(() => {
|
|
79
|
+
pointerOnContentRef.current = true;
|
|
80
|
+
clearTimer();
|
|
81
|
+
}, [clearTimer]);
|
|
82
|
+
const leaveContent = useCallback(() => {
|
|
83
|
+
pointerOnContentRef.current = false;
|
|
84
|
+
scheduleBridgeClose();
|
|
85
|
+
}, [scheduleBridgeClose]);
|
|
50
86
|
const hide = useCallback(() => {
|
|
51
87
|
clearTimer();
|
|
88
|
+
if (pointerOnContentRef.current || pointerOnTriggerRef.current) return;
|
|
52
89
|
if (closeDelay <= 0) {
|
|
53
90
|
setOpen(false);
|
|
54
91
|
return;
|
|
55
92
|
}
|
|
56
93
|
showTimerRef.current = globalThis.setTimeout(() => {
|
|
57
94
|
showTimerRef.current = null;
|
|
95
|
+
if (pointerOnContentRef.current || pointerOnTriggerRef.current) return;
|
|
58
96
|
setOpen(false);
|
|
59
97
|
}, closeDelay);
|
|
60
98
|
}, [clearTimer, closeDelay, setOpen]);
|
|
61
99
|
useEffect(() => () => clearTimer(), [clearTimer]);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (!overlayShouldClose(
|
|
100
|
+
const layerId = useRegisterOverlayLayer({
|
|
101
|
+
enabled: open,
|
|
102
|
+
kind: "floating",
|
|
103
|
+
onEscape: (dismissEvent) => {
|
|
104
|
+
if (!overlayShouldClose(dismissEvent, onEscapeKeyDown, closeOnEscape)) return true;
|
|
105
|
+
pointerOnTriggerRef.current = false;
|
|
106
|
+
pointerOnContentRef.current = false;
|
|
67
107
|
clearTimer();
|
|
68
108
|
setOpen(false);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
109
|
+
return true;
|
|
110
|
+
},
|
|
111
|
+
containsNode: (node) => Boolean(triggerRef.current?.contains(node) || contentRef.current?.contains(node))
|
|
112
|
+
});
|
|
73
113
|
const contextValue = useMemo(
|
|
74
114
|
() => ({
|
|
75
115
|
open,
|
|
@@ -84,13 +124,22 @@ function useTooltipRootState({
|
|
|
84
124
|
avoidCollisions,
|
|
85
125
|
icon,
|
|
86
126
|
triggerRef,
|
|
127
|
+
contentRef,
|
|
128
|
+
layerId,
|
|
87
129
|
scheduleShow,
|
|
130
|
+
leaveTrigger,
|
|
131
|
+
holdContent,
|
|
132
|
+
leaveContent,
|
|
88
133
|
hide,
|
|
89
134
|
portalContainer
|
|
90
135
|
}),
|
|
91
136
|
[
|
|
92
137
|
hide,
|
|
138
|
+
holdContent,
|
|
93
139
|
icon,
|
|
140
|
+
layerId,
|
|
141
|
+
leaveContent,
|
|
142
|
+
leaveTrigger,
|
|
94
143
|
open,
|
|
95
144
|
portalContainer,
|
|
96
145
|
scheduleShow,
|
|
@@ -27,20 +27,23 @@ function readInline(style) {
|
|
|
27
27
|
function applyLock(doc, win) {
|
|
28
28
|
const body = doc.body;
|
|
29
29
|
const html = doc.documentElement;
|
|
30
|
+
const scrollX = win.scrollX || win.pageXOffset || 0;
|
|
30
31
|
const scrollY = win.scrollY || win.pageYOffset || 0;
|
|
31
32
|
const next = {
|
|
33
|
+
scrollX,
|
|
32
34
|
scrollY,
|
|
33
35
|
body: readInline(body.style),
|
|
34
36
|
html: {
|
|
35
37
|
overflow: html.style.overflow,
|
|
36
|
-
overscrollBehavior: html.style.overscrollBehavior
|
|
38
|
+
overscrollBehavior: html.style.overscrollBehavior,
|
|
39
|
+
scrollBehavior: html.style.scrollBehavior
|
|
37
40
|
}
|
|
38
41
|
};
|
|
39
42
|
const scrollbarGap = Math.max(0, win.innerWidth - html.clientWidth);
|
|
40
43
|
const paddingRight = parsePx(win.getComputedStyle(body).paddingRight) + scrollbarGap;
|
|
41
44
|
body.style.position = "fixed";
|
|
42
45
|
body.style.top = `-${scrollY}px`;
|
|
43
|
-
body.style.left = "0";
|
|
46
|
+
body.style.left = scrollX !== 0 ? `-${scrollX}px` : "0";
|
|
44
47
|
body.style.right = "0";
|
|
45
48
|
body.style.width = "100%";
|
|
46
49
|
body.style.overflow = "hidden";
|
|
@@ -65,7 +68,13 @@ function restoreLock(doc, win, prev) {
|
|
|
65
68
|
body.style.overscrollBehavior = prev.body.overscrollBehavior;
|
|
66
69
|
html.style.overflow = prev.html.overflow;
|
|
67
70
|
html.style.overscrollBehavior = prev.html.overscrollBehavior;
|
|
68
|
-
|
|
71
|
+
if ("scrollBehavior" in html.style) {
|
|
72
|
+
html.style.scrollBehavior = "auto";
|
|
73
|
+
}
|
|
74
|
+
win.scrollTo(prev.scrollX, prev.scrollY);
|
|
75
|
+
if ("scrollBehavior" in html.style) {
|
|
76
|
+
html.style.scrollBehavior = prev.html.scrollBehavior ?? "";
|
|
77
|
+
}
|
|
69
78
|
}
|
|
70
79
|
function lockBodyScroll() {
|
|
71
80
|
const doc = getDocument();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Clamp `n` into the inclusive range `[lo, hi]
|
|
1
|
+
/** Clamp `n` into the inclusive range `[lo, hi]` (safe against `NaN`, `±Infinity`, and `lo > hi`). */
|
|
2
2
|
export declare function clampNumber(n: number, lo: number, hi: number): number;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
function clampNumber(n, lo, hi) {
|
|
2
|
-
|
|
2
|
+
const min = Number.isFinite(lo) ? lo : 0;
|
|
3
|
+
const max = Number.isFinite(hi) ? Math.max(min, hi) : min;
|
|
4
|
+
if (!Number.isFinite(n)) return min;
|
|
5
|
+
return Math.min(max, Math.max(min, n));
|
|
3
6
|
}
|
|
4
7
|
export {
|
|
5
8
|
clampNumber
|
|
@@ -5,6 +5,18 @@ function shouldHandleContainedEscape(event, dialog) {
|
|
|
5
5
|
if (target == null || !dialog.contains(target)) return false;
|
|
6
6
|
const topModal = dialog.ownerDocument.querySelector("dialog:modal");
|
|
7
7
|
if (topModal && topModal !== dialog) return false;
|
|
8
|
+
if (typeof dialog.ownerDocument.querySelectorAll === "function") {
|
|
9
|
+
const openModals = dialog.ownerDocument.querySelectorAll(
|
|
10
|
+
"dialog[open]:not(.portal-contained)"
|
|
11
|
+
);
|
|
12
|
+
const lastModal = openModals.length > 0 ? openModals[openModals.length - 1] : null;
|
|
13
|
+
if (lastModal && lastModal !== dialog) return false;
|
|
14
|
+
const containedDialogs = dialog.ownerDocument.querySelectorAll(
|
|
15
|
+
"dialog[open].portal-contained"
|
|
16
|
+
);
|
|
17
|
+
const topContained = containedDialogs.length > 0 ? containedDialogs[containedDialogs.length - 1] : null;
|
|
18
|
+
if (topContained && topContained !== dialog) return false;
|
|
19
|
+
}
|
|
8
20
|
return true;
|
|
9
21
|
}
|
|
10
22
|
export {
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import { HTMLAttributes, RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* True while an IME composition session is active (CJK / mobile composition).
|
|
4
|
+
* Checks both `isComposing` and WebKit/Chromium fallback `keyCode === 229`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isImeComposingEvent(event: {
|
|
7
|
+
isComposing?: boolean;
|
|
8
|
+
keyCode?: number;
|
|
9
|
+
nativeEvent?: {
|
|
10
|
+
isComposing?: boolean;
|
|
11
|
+
keyCode?: number;
|
|
12
|
+
};
|
|
13
|
+
}): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* True when `target` is inside an interactive descendant (`button`, `a[href]`,
|
|
16
|
+
* `[role="button"]`, `input`, `textarea`, `select`, `[contenteditable="true"]`),
|
|
17
|
+
* optionally ignoring the field's own primary `control`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isInteractiveDescendantTarget(target: EventTarget | null, ownControl?: Element | null): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Listen for native `<form>` `"reset"` events and invoke `onReset` on the next
|
|
22
|
+
* microtask (unless `event.defaultPrevented`) so uncontrolled custom controls
|
|
23
|
+
* revert to their `defaultValue` / `defaultChecked` alongside native inputs.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useNativeFormReset(elementRef: RefObject<HTMLElement | null>, onReset: () => void, enabled?: boolean): void;
|
|
2
26
|
/** One hidden input per value so a native form and `FormData` see the field. */
|
|
3
27
|
export declare function FieldHiddenValues({ name, value, }: {
|
|
4
28
|
name?: string;
|
|
@@ -1,7 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useRef, useLayoutEffect } from "react";
|
|
3
|
+
import { useRef, useEffect, useLayoutEffect } from "react";
|
|
4
4
|
import { dataFlag } from "./dataContract.js";
|
|
5
|
+
function isImeComposingEvent(event) {
|
|
6
|
+
const native = event.nativeEvent ?? event;
|
|
7
|
+
return Boolean(native.isComposing) || native.keyCode === 229;
|
|
8
|
+
}
|
|
9
|
+
function isInteractiveDescendantTarget(target, ownControl) {
|
|
10
|
+
if (!(target instanceof Element)) return false;
|
|
11
|
+
const hit = target.closest(
|
|
12
|
+
'button, a[href], [role="button"], input, textarea, select, [contenteditable="true"]'
|
|
13
|
+
);
|
|
14
|
+
if (!hit) return false;
|
|
15
|
+
if (ownControl && (hit === ownControl || ownControl.contains(hit))) return false;
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
function useNativeFormReset(elementRef, onReset, enabled = true) {
|
|
19
|
+
const onResetRef = useRef(onReset);
|
|
20
|
+
onResetRef.current = onReset;
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!enabled) return void 0;
|
|
23
|
+
const form = elementRef.current?.closest("form");
|
|
24
|
+
if (!form) return void 0;
|
|
25
|
+
const handleReset = (event) => {
|
|
26
|
+
if (event.defaultPrevented) return;
|
|
27
|
+
queueMicrotask(() => {
|
|
28
|
+
if (!event.defaultPrevented) {
|
|
29
|
+
onResetRef.current();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
form.addEventListener("reset", handleReset);
|
|
34
|
+
return () => form.removeEventListener("reset", handleReset);
|
|
35
|
+
}, [elementRef, enabled]);
|
|
36
|
+
}
|
|
5
37
|
const FIELD_FOCUS_SELECTOR = 'input:not([type="hidden"]):not([aria-hidden="true"]), button[role="combobox"], button[role="slider"], [role="spinbutton"], [role="combobox"]';
|
|
6
38
|
function FieldHiddenValues({
|
|
7
39
|
name,
|
|
@@ -54,7 +86,10 @@ function useFieldControlFocus(rootRef, autoFocus, tabIndex) {
|
|
|
54
86
|
}
|
|
55
87
|
export {
|
|
56
88
|
FieldHiddenValues,
|
|
89
|
+
isImeComposingEvent,
|
|
90
|
+
isInteractiveDescendantTarget,
|
|
57
91
|
readOnlyData,
|
|
58
92
|
splitFieldHostRest,
|
|
59
|
-
useFieldControlFocus
|
|
93
|
+
useFieldControlFocus,
|
|
94
|
+
useNativeFormReset
|
|
60
95
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const FOCUSABLE_SELECTOR = [
|
|
2
2
|
"button:not([disabled])",
|
|
3
3
|
"[href]",
|
|
4
|
-
|
|
4
|
+
'input:not([type="hidden"]):not([disabled])',
|
|
5
5
|
"select:not([disabled])",
|
|
6
6
|
"textarea:not([disabled])",
|
|
7
7
|
'[tabindex]:not([tabindex="-1"])'
|
|
@@ -24,7 +24,7 @@ function isFocusVisibleElement(el) {
|
|
|
24
24
|
function getFirstFocusable(root) {
|
|
25
25
|
const nodes = root.querySelectorAll(FOCUSABLE_SELECTOR);
|
|
26
26
|
for (const el of nodes) {
|
|
27
|
-
if (el.closest("[aria-hidden='true']")) continue;
|
|
27
|
+
if (el.closest("[aria-hidden='true'], [inert], [hidden]")) continue;
|
|
28
28
|
return el;
|
|
29
29
|
}
|
|
30
30
|
return null;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { RefObject, PointerEvent as ReactPointerEvent } from 'react';
|
|
2
2
|
import { MotionConfig } from './motionConfig.js';
|
|
3
3
|
import { ShadowInteraction, ShadowSize } from '../../../tokens/shadows.js';
|
|
4
|
+
/**
|
|
5
|
+
* Non-identity 2D rest scale for controls that scale on hover/press.
|
|
6
|
+
* Blink/Chromium switches from layout pixel-snapping (`IsIdentityOr2DTranslation()`)
|
|
7
|
+
* to local rasterization as soon as `scale !== 1`, shifting fractional heights
|
|
8
|
+
* (e.g. 34.8px after theme shuffle) by 1px on frame 1 of `hoverIn` / `hoverOut`
|
|
9
|
+
* and at the end of `pressSqueeze`. Keeping rest at `1.0001` (~0.003px) holds one
|
|
10
|
+
* consistent rasterization path without `will-change` layer promotion.
|
|
11
|
+
*/
|
|
12
|
+
export declare const INTERACTIVE_REST_SCALE = 1.0001;
|
|
13
|
+
export declare function isKitHoverLiftRecipe(value: unknown): boolean;
|
|
4
14
|
/**
|
|
5
15
|
* Shadow tiers for lift / press. Values are live `var(--shadow-*)` refs.
|
|
6
16
|
*
|
|
@@ -46,6 +56,8 @@ export declare function readShadowSize(size: ShadowSize, from?: Element | null):
|
|
|
46
56
|
export declare function initElementShadow(element: HTMLElement | null, shadow: string): void;
|
|
47
57
|
/** Scale cache reset when hover lift turns off. A style write leaves GSAP's scale. */
|
|
48
58
|
export declare function resetInteractiveLiftScale(element: HTMLElement | null): void;
|
|
59
|
+
/** Primes `INTERACTIVE_REST_SCALE` on active desktop scale-lifting controls before first hover. */
|
|
60
|
+
export declare function primeInteractiveScaleRest(element: HTMLElement | null, config?: Readonly<MotionConfig>, reduced?: boolean): void;
|
|
49
61
|
/** Hover lift and shadow change: off for reduced-motion, touch and viewport ≤ tablet. */
|
|
50
62
|
export declare function shouldSkipInteractiveHoverLift(config?: Readonly<MotionConfig>, reduced?: boolean): boolean;
|
|
51
63
|
export declare function resolveAdaptiveHoverLiftScale(element: HTMLElement, config?: Readonly<MotionConfig>): number;
|
|
@@ -10,6 +10,17 @@ import { useContainerPointerHoverHandlers } from "./useContainerPointerHoverHand
|
|
|
10
10
|
import { SHADOW_LIFT_CSS_VAR, SHADOW_CSS_VAR } from "../../../tokens/shadows.js";
|
|
11
11
|
import { TOUCH_OR_NARROW_VIEWPORT_MQL } from "../../../tokens/breakpoints.js";
|
|
12
12
|
const INTERACTIVE_TRANSFORM_VARS = { force3D: false };
|
|
13
|
+
const INTERACTIVE_REST_SCALE = 1.0001;
|
|
14
|
+
function isKitHoverLiftRecipe(value) {
|
|
15
|
+
if (typeof value === "string") {
|
|
16
|
+
return value === "hoverLiftFirstLevel" || value === "hoverLiftSecondLevel";
|
|
17
|
+
}
|
|
18
|
+
if (value != null && typeof value === "object" && "recipe" in value) {
|
|
19
|
+
const recipe = value.recipe;
|
|
20
|
+
return recipe === "hoverLiftFirstLevel" || recipe === "hoverLiftSecondLevel";
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
13
24
|
function resolveShadowReadRoot(from) {
|
|
14
25
|
if (from) return from;
|
|
15
26
|
return document.documentElement;
|
|
@@ -62,6 +73,18 @@ function resetInteractiveLiftScale(element) {
|
|
|
62
73
|
if (!element) return;
|
|
63
74
|
gsap.set(element, { scale: 1, force3D: false, overwrite: "auto" });
|
|
64
75
|
}
|
|
76
|
+
function primeInteractiveScaleRest(element, config, reduced) {
|
|
77
|
+
if (!element || shouldSkipInteractiveHoverLift(config, reduced)) return;
|
|
78
|
+
const currentScaleX = Number(gsap.getProperty(element, "scaleX"));
|
|
79
|
+
if (Number.isFinite(currentScaleX) && Math.abs(currentScaleX - 1) > 1e-6) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
gsap.set(element, {
|
|
83
|
+
scale: INTERACTIVE_REST_SCALE,
|
|
84
|
+
overwrite: "auto",
|
|
85
|
+
...INTERACTIVE_TRANSFORM_VARS
|
|
86
|
+
});
|
|
87
|
+
}
|
|
65
88
|
function isTouchOrNarrowViewport() {
|
|
66
89
|
if (typeof window === "undefined" || !window.matchMedia) return false;
|
|
67
90
|
return window.matchMedia(TOUCH_OR_NARROW_VIEWPORT_MQL).matches;
|
|
@@ -110,7 +133,6 @@ function animateInteractiveHoverLift(element, lifted, liftScale, shadow, config,
|
|
|
110
133
|
}
|
|
111
134
|
return void 0;
|
|
112
135
|
}
|
|
113
|
-
const resolvedScale = lifted ? liftScale !== void 0 ? liftScale : adaptiveHoverLiftScale(element, config) : 1;
|
|
114
136
|
const cfg = resolveMotionConfig(config);
|
|
115
137
|
const duration = cfg.interactiveDuration / 1e3;
|
|
116
138
|
if (shadow) {
|
|
@@ -126,6 +148,21 @@ function animateInteractiveHoverLift(element, lifted, liftScale, shadow, config,
|
|
|
126
148
|
ease: cfg.hoverLiftEase
|
|
127
149
|
});
|
|
128
150
|
}
|
|
151
|
+
if (liftScale === 1) {
|
|
152
|
+
const currentScaleX = Number(gsap.getProperty(element, "scaleX"));
|
|
153
|
+
const currentScaleY = Number(gsap.getProperty(element, "scaleY"));
|
|
154
|
+
if ((!Number.isFinite(currentScaleX) || currentScaleX === 1) && (!Number.isFinite(currentScaleY) || currentScaleY === 1)) {
|
|
155
|
+
return void 0;
|
|
156
|
+
}
|
|
157
|
+
return gsap.to(element, {
|
|
158
|
+
scale: 1,
|
|
159
|
+
duration,
|
|
160
|
+
ease: cfg.hoverLiftEase,
|
|
161
|
+
...INTERACTIVE_TRANSFORM_VARS,
|
|
162
|
+
overwrite: "auto"
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
const resolvedScale = lifted ? liftScale !== void 0 ? liftScale : adaptiveHoverLiftScale(element, config) : INTERACTIVE_REST_SCALE;
|
|
129
166
|
return gsap.to(element, {
|
|
130
167
|
scale: resolvedScale,
|
|
131
168
|
duration,
|
|
@@ -203,7 +240,8 @@ function animateInteractivePressSqueeze(element, options) {
|
|
|
203
240
|
tl.add(() => {
|
|
204
241
|
if (signal?.aborted) return;
|
|
205
242
|
const releaseToHover = options?.restoreHover !== false && resolvePointerInside(options?.pointerInside) && canHoverLift;
|
|
206
|
-
const
|
|
243
|
+
const keepsRestScale = options?.restoreHover !== false && options?.liftScale !== 1 && canHoverLift;
|
|
244
|
+
const releaseScale = releaseToHover ? options?.liftScale !== void 0 ? options.liftScale : adaptiveHoverLiftScale(element, cfg) : keepsRestScale ? INTERACTIVE_REST_SCALE : 1;
|
|
207
245
|
const releaseOut = releaseToHover ? total : total * 0.5;
|
|
208
246
|
const releaseEase = releaseToHover ? cfg.hoverLiftEase : "sine.inOut";
|
|
209
247
|
options?.onReleaseStart?.();
|
|
@@ -246,10 +284,13 @@ function useInteractiveHoverLiftContainerHandlers(liftedRef, enabled, pointerIns
|
|
|
246
284
|
});
|
|
247
285
|
}
|
|
248
286
|
export {
|
|
287
|
+
INTERACTIVE_REST_SCALE,
|
|
249
288
|
animateInteractiveHoverLift,
|
|
250
289
|
animateInteractivePressSqueeze,
|
|
251
290
|
initElementShadow,
|
|
252
291
|
isInteractivePressKey,
|
|
292
|
+
isKitHoverLiftRecipe,
|
|
293
|
+
primeInteractiveScaleRest,
|
|
253
294
|
readShadowSize,
|
|
254
295
|
readShadowVar,
|
|
255
296
|
resetInteractiveLiftScale,
|
|
@@ -3,7 +3,7 @@ import { CONTROL_SIZE_LAYOUT } from "./sizeLayout/control.js";
|
|
|
3
3
|
function affixSlotClass(size) {
|
|
4
4
|
const layout = CONTROL_SIZE_LAYOUT[size];
|
|
5
5
|
return cn(
|
|
6
|
-
"flex self-stretch shrink-0 items-center text-muted",
|
|
6
|
+
"flex self-stretch shrink-0 items-center text-muted-foreground",
|
|
7
7
|
layout.affixPadX,
|
|
8
8
|
layout.affixText
|
|
9
9
|
);
|
|
@@ -8,7 +8,14 @@ export type MergeAsChildPropsOptions = {
|
|
|
8
8
|
* child Button sees the event (e.g. squeeze-open triggers).
|
|
9
9
|
*/
|
|
10
10
|
runBeforeChild?: readonly string[];
|
|
11
|
+
/**
|
|
12
|
+
* When true, blocks pointer/keyboard activation (`onClick`, `onAuxClick`, and
|
|
13
|
+
* `Enter`/`Space` on `onKeyDown`) with `preventDefault()` + `stopPropagation()`
|
|
14
|
+
* before any child handler runs — critical for `<Button asChild disabled><a>`.
|
|
15
|
+
*/
|
|
16
|
+
disabled?: boolean;
|
|
11
17
|
};
|
|
18
|
+
export declare function getChildRef<T>(child: ReactElement): Ref<T> | undefined;
|
|
12
19
|
/**
|
|
13
20
|
* Build props for `cloneElement` when an asChild host delegates to a single child.
|
|
14
21
|
*
|