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
|
@@ -8,24 +8,34 @@ import { useResizableHandleMotion, useResizablePanelMotion } from "./resizableAn
|
|
|
8
8
|
import { useResizableLayout } from "./resizableContext.js";
|
|
9
9
|
import { resizableHandleClass, resizablePanelClass } from "./resizableStyles.js";
|
|
10
10
|
const DEFAULT_MIN = 8;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const DEFAULT_MAX = 100;
|
|
12
|
+
function computePairBounds(pairSum, minBefore, maxBefore, minAfter, maxAfter) {
|
|
13
|
+
const loBefore = Math.max(minBefore, pairSum - maxAfter);
|
|
14
|
+
const hiBefore = Math.min(maxBefore, pairSum - minAfter);
|
|
15
|
+
if (loBefore > hiBefore) {
|
|
16
|
+
const mid = Math.min(maxBefore, Math.max(minBefore, pairSum / 2));
|
|
17
|
+
return { loBefore: mid, hiBefore: mid };
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
return { loBefore, hiBefore };
|
|
20
|
+
}
|
|
21
|
+
function clampPair(startBefore, startAfter, delta, minBefore, maxBefore, minAfter, maxAfter) {
|
|
22
|
+
const pairSum = startBefore + startAfter;
|
|
23
|
+
const { loBefore, hiBefore } = computePairBounds(
|
|
24
|
+
pairSum,
|
|
25
|
+
minBefore,
|
|
26
|
+
maxBefore,
|
|
27
|
+
minAfter,
|
|
28
|
+
maxAfter
|
|
29
|
+
);
|
|
30
|
+
const before = Math.min(hiBefore, Math.max(loBefore, startBefore + delta));
|
|
31
|
+
const after = Math.max(0, pairSum - before);
|
|
23
32
|
return { before, after };
|
|
24
33
|
}
|
|
25
34
|
const ResizablePanel = forwardRef(function ResizablePanel2({
|
|
26
35
|
id: idProp,
|
|
27
36
|
defaultSize,
|
|
28
37
|
minSize = DEFAULT_MIN,
|
|
38
|
+
maxSize = DEFAULT_MAX,
|
|
29
39
|
className = "",
|
|
30
40
|
motion,
|
|
31
41
|
onPointerOver,
|
|
@@ -50,15 +60,12 @@ const ResizablePanel = forwardRef(function ResizablePanel2({
|
|
|
50
60
|
});
|
|
51
61
|
const size = layout.sizes[id];
|
|
52
62
|
useLayoutEffect(() => {
|
|
53
|
-
layoutRef.current.
|
|
54
|
-
}, [id, minSize]);
|
|
55
|
-
useLayoutEffect(() => {
|
|
56
|
-
if (defaultSize == null) return;
|
|
57
|
-
layoutRef.current.commit((prev) => id in prev ? prev : { ...prev, [id]: defaultSize });
|
|
58
|
-
}, [defaultSize, id]);
|
|
63
|
+
layoutRef.current.registerPanel(id, { defaultSize, minSize, maxSize });
|
|
64
|
+
}, [defaultSize, id, maxSize, minSize]);
|
|
59
65
|
useLayoutEffect(() => {
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
return () => {
|
|
67
|
+
layoutRef.current.unregisterPanel(id);
|
|
68
|
+
};
|
|
62
69
|
}, [id]);
|
|
63
70
|
return /* @__PURE__ */ jsx(
|
|
64
71
|
"div",
|
|
@@ -102,25 +109,40 @@ const ResizableHandle = forwardRef(function ResizableHandle2({
|
|
|
102
109
|
layoutRef.current = layout;
|
|
103
110
|
const drag = useRef(null);
|
|
104
111
|
const [announced, setAnnounced] = useState();
|
|
105
|
-
const [bounds, setBounds] = useState({ min: DEFAULT_MIN, max: 100, controls: "" });
|
|
112
|
+
const [bounds, setBounds] = useState({ min: DEFAULT_MIN, max: 100 - DEFAULT_MIN, controls: "" });
|
|
106
113
|
const resizeLabel = useBurneLabel("resizePanels");
|
|
107
114
|
const measure = useCallback((root) => {
|
|
108
|
-
const
|
|
115
|
+
const api = layoutRef.current;
|
|
116
|
+
const horizontal = api.orientation === "horizontal";
|
|
109
117
|
const panels = [...root.children].filter(
|
|
110
118
|
(node) => node instanceof HTMLElement && Boolean(node.dataset.value) && node.getAttribute("role") !== "separator"
|
|
111
119
|
);
|
|
112
|
-
const
|
|
120
|
+
const measuredTotal = panels.reduce((sum, node) => {
|
|
113
121
|
const box = node.getBoundingClientRect();
|
|
114
122
|
return sum + (horizontal ? box.width : box.height);
|
|
115
|
-
}, 0)
|
|
123
|
+
}, 0);
|
|
124
|
+
const allInSizes = panels.length > 0 && panels.every((node) => node.dataset.value && node.dataset.value in api.sizes);
|
|
116
125
|
const next = {};
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
if (allInSizes) {
|
|
127
|
+
for (const node of panels) {
|
|
128
|
+
const id = node.dataset.value;
|
|
129
|
+
next[id] = api.sizes[id] ?? 0;
|
|
130
|
+
}
|
|
131
|
+
} else if (measuredTotal > 0) {
|
|
132
|
+
for (const node of panels) {
|
|
133
|
+
const id = node.dataset.value;
|
|
134
|
+
if (!id) continue;
|
|
135
|
+
const box = node.getBoundingClientRect();
|
|
136
|
+
next[id] = (horizontal ? box.width : box.height) / measuredTotal * 100;
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
const equal = panels.length > 0 ? 100 / panels.length : 100;
|
|
140
|
+
for (const node of panels) {
|
|
141
|
+
const id = node.dataset.value;
|
|
142
|
+
if (id) next[id] = equal;
|
|
143
|
+
}
|
|
122
144
|
}
|
|
123
|
-
return { next, total };
|
|
145
|
+
return { next, total: measuredTotal > 0 ? measuredTotal : 100 };
|
|
124
146
|
}, []);
|
|
125
147
|
const applyDelta = useCallback((deltaPercent) => {
|
|
126
148
|
const current = drag.current;
|
|
@@ -131,9 +153,10 @@ const ResizableHandle = forwardRef(function ResizableHandle2({
|
|
|
131
153
|
current.startAfter,
|
|
132
154
|
deltaPercent,
|
|
133
155
|
api.minOf(current.beforeId),
|
|
134
|
-
api.
|
|
156
|
+
api.maxOf(current.beforeId),
|
|
157
|
+
api.minOf(current.afterId),
|
|
158
|
+
api.maxOf(current.afterId)
|
|
135
159
|
);
|
|
136
|
-
if (!pair) return;
|
|
137
160
|
api.commit((prev) => ({
|
|
138
161
|
...prev,
|
|
139
162
|
[current.beforeId]: pair.before,
|
|
@@ -144,17 +167,35 @@ const ResizableHandle = forwardRef(function ResizableHandle2({
|
|
|
144
167
|
const readBounds = useCallback((handle) => {
|
|
145
168
|
const before = handle.previousElementSibling;
|
|
146
169
|
const after = handle.nextElementSibling;
|
|
147
|
-
|
|
170
|
+
const root = handle.parentElement;
|
|
171
|
+
if (!(before instanceof HTMLElement) || !(after instanceof HTMLElement) || !root) return;
|
|
148
172
|
const beforeId = before.dataset.value;
|
|
149
173
|
const afterId = after.dataset.value;
|
|
150
174
|
if (!beforeId || !afterId) return;
|
|
151
175
|
const api = layoutRef.current;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
176
|
+
let beforeVal = api.sizes[beforeId];
|
|
177
|
+
let afterVal = api.sizes[afterId];
|
|
178
|
+
if (beforeVal == null || afterVal == null) {
|
|
179
|
+
const { next } = measure(root);
|
|
180
|
+
beforeVal = next[beforeId] ?? 50;
|
|
181
|
+
afterVal = next[afterId] ?? 50;
|
|
182
|
+
}
|
|
183
|
+
const pairSum = beforeVal + afterVal;
|
|
184
|
+
const { loBefore, hiBefore } = computePairBounds(
|
|
185
|
+
pairSum,
|
|
186
|
+
api.minOf(beforeId),
|
|
187
|
+
api.maxOf(beforeId),
|
|
188
|
+
api.minOf(afterId),
|
|
189
|
+
api.maxOf(afterId)
|
|
190
|
+
);
|
|
191
|
+
const min = Math.round(loBefore);
|
|
192
|
+
const max = Math.round(Math.max(loBefore, hiBefore));
|
|
193
|
+
const controls = `${before.id} ${after.id}`;
|
|
194
|
+
setBounds(
|
|
195
|
+
(prev) => prev.min === min && prev.max === max && prev.controls === controls ? prev : { min, max, controls }
|
|
196
|
+
);
|
|
197
|
+
setAnnounced(Math.round(beforeVal));
|
|
198
|
+
}, [measure]);
|
|
158
199
|
const part = useResizableHandleMotion({
|
|
159
200
|
forwardedRef: ref,
|
|
160
201
|
motion,
|
|
@@ -181,7 +222,12 @@ const ResizableHandle = forwardRef(function ResizableHandle2({
|
|
|
181
222
|
startPos: layoutRef.current.orientation === "horizontal" ? event.clientX : event.clientY,
|
|
182
223
|
total
|
|
183
224
|
};
|
|
184
|
-
handle.setPointerCapture
|
|
225
|
+
if (typeof handle.setPointerCapture === "function") {
|
|
226
|
+
try {
|
|
227
|
+
handle.setPointerCapture(event.pointerId);
|
|
228
|
+
} catch {
|
|
229
|
+
}
|
|
230
|
+
}
|
|
185
231
|
},
|
|
186
232
|
onPointerUp: (event) => {
|
|
187
233
|
onPointerUp?.(event);
|
|
@@ -254,16 +300,24 @@ const ResizableHandle = forwardRef(function ResizableHandle2({
|
|
|
254
300
|
const api = layoutRef.current;
|
|
255
301
|
api.commit(() => next);
|
|
256
302
|
const startBefore = next[beforeId] ?? 0;
|
|
303
|
+
const startAfter = next[afterId] ?? 0;
|
|
304
|
+
const { loBefore, hiBefore } = computePairBounds(
|
|
305
|
+
startBefore + startAfter,
|
|
306
|
+
api.minOf(beforeId),
|
|
307
|
+
api.maxOf(beforeId),
|
|
308
|
+
api.minOf(afterId),
|
|
309
|
+
api.maxOf(afterId)
|
|
310
|
+
);
|
|
257
311
|
drag.current = {
|
|
258
312
|
beforeId,
|
|
259
313
|
afterId,
|
|
260
314
|
startBefore,
|
|
261
|
-
startAfter
|
|
315
|
+
startAfter,
|
|
262
316
|
startPos: 0,
|
|
263
317
|
total
|
|
264
318
|
};
|
|
265
|
-
if (home) applyDelta(
|
|
266
|
-
else if (end) applyDelta(
|
|
319
|
+
if (home) applyDelta(loBefore - startBefore);
|
|
320
|
+
else if (end) applyDelta(hiBefore - startBefore);
|
|
267
321
|
else applyDelta(grow ? 2 : -2);
|
|
268
322
|
drag.current = null;
|
|
269
323
|
}
|
|
@@ -2,7 +2,7 @@ import { ResizableOrientation } from './resizableTypes.js';
|
|
|
2
2
|
export declare const RESIZABLE_ROOT_CLASS = "flex min-h-0 w-full min-w-0";
|
|
3
3
|
export declare const RESIZABLE_ORIENTATION_CLASS: {
|
|
4
4
|
readonly horizontal: "flex-row";
|
|
5
|
-
readonly vertical: "flex-col";
|
|
5
|
+
readonly vertical: "h-full flex-col";
|
|
6
6
|
};
|
|
7
7
|
export declare const RESIZABLE_PANEL_CLASS = "min-h-0 min-w-0 overflow-auto";
|
|
8
8
|
export declare const RESIZABLE_PANEL_FLEX_CLASS = "flex-1";
|
|
@@ -12,8 +12,9 @@ export declare const RESIZABLE_HANDLE_AXIS_CLASS: {
|
|
|
12
12
|
readonly horizontal: "w-small cursor-col-resize self-stretch border-s-token";
|
|
13
13
|
readonly vertical: "h-small cursor-row-resize self-stretch border-t-token";
|
|
14
14
|
};
|
|
15
|
-
export declare function resizableRootClass({ orientation, slotClass, className, }: {
|
|
15
|
+
export declare function resizableRootClass({ orientation, skinVariant, slotClass, className, }: {
|
|
16
16
|
orientation: ResizableOrientation;
|
|
17
|
+
skinVariant?: string;
|
|
17
18
|
slotClass?: string;
|
|
18
19
|
className?: string;
|
|
19
20
|
}): string;
|
|
@@ -3,7 +3,7 @@ import { cn } from "../../../utils/cn.js";
|
|
|
3
3
|
const RESIZABLE_ROOT_CLASS = "flex min-h-0 w-full min-w-0";
|
|
4
4
|
const RESIZABLE_ORIENTATION_CLASS = {
|
|
5
5
|
horizontal: "flex-row",
|
|
6
|
-
vertical: "flex-col"
|
|
6
|
+
vertical: "h-full flex-col"
|
|
7
7
|
};
|
|
8
8
|
const RESIZABLE_PANEL_CLASS = "min-h-0 min-w-0 overflow-auto";
|
|
9
9
|
const RESIZABLE_PANEL_FLEX_CLASS = "flex-1";
|
|
@@ -15,13 +15,14 @@ const RESIZABLE_HANDLE_AXIS_CLASS = {
|
|
|
15
15
|
};
|
|
16
16
|
function resizableRootClass({
|
|
17
17
|
orientation,
|
|
18
|
+
skinVariant,
|
|
18
19
|
slotClass,
|
|
19
20
|
className
|
|
20
21
|
}) {
|
|
21
22
|
return cn(
|
|
22
23
|
RESIZABLE_ROOT_CLASS,
|
|
23
24
|
RESIZABLE_ORIENTATION_CLASS[orientation],
|
|
24
|
-
layoutTargetClass("resizable.root"),
|
|
25
|
+
layoutTargetClass("resizable.root", skinVariant),
|
|
25
26
|
slotClass,
|
|
26
27
|
className
|
|
27
28
|
);
|
|
@@ -33,18 +33,26 @@ export type ResizablePanelProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
33
33
|
defaultSize?: number;
|
|
34
34
|
/** Smallest share in percent. Default `8`. */
|
|
35
35
|
minSize?: number;
|
|
36
|
+
/** Largest share in percent. Default `100`. */
|
|
37
|
+
maxSize?: number;
|
|
36
38
|
motion?: Prettify<ResizablePartMotion>;
|
|
37
39
|
};
|
|
38
40
|
export type ResizableHandleProps = HTMLAttributes<HTMLDivElement> & {
|
|
39
41
|
motion?: Prettify<ResizablePartMotion>;
|
|
40
42
|
};
|
|
43
|
+
export type ResizablePanelConstraints = {
|
|
44
|
+
defaultSize?: number;
|
|
45
|
+
minSize: number;
|
|
46
|
+
maxSize: number;
|
|
47
|
+
};
|
|
41
48
|
export type ResizableLayoutValue = {
|
|
42
49
|
orientation: ResizableOrientation;
|
|
43
50
|
sizes: Readonly<Record<string, number>>;
|
|
44
51
|
panelClass?: string;
|
|
45
52
|
handleClass?: string;
|
|
46
53
|
commit: (updater: (prev: Record<string, number>) => Record<string, number>) => void;
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
registerPanel: (id: string, spec: ResizablePanelConstraints) => void;
|
|
55
|
+
unregisterPanel: (id: string) => void;
|
|
49
56
|
minOf: (id: string) => number;
|
|
57
|
+
maxOf: (id: string) => number;
|
|
50
58
|
};
|
|
@@ -9,7 +9,7 @@ import { ConvergeRippleLayer } from "../utils/pressRipple.js";
|
|
|
9
9
|
import { useConvergeRipples } from "../utils/useConvergeRipples.js";
|
|
10
10
|
import { cn } from "../../../utils/cn.js";
|
|
11
11
|
import { rippleLayerA11yProps } from "./rippleA11y.js";
|
|
12
|
-
import { resolveRippleEventTarget, resolveRipplePaint } from "./rippleAPI.js";
|
|
12
|
+
import { resolveRippleEventTarget, isRippleTargetDisabled, resolveRipplePaint } from "./rippleAPI.js";
|
|
13
13
|
import { RIPPLE_LAYER_CLASS } from "./rippleStyles.js";
|
|
14
14
|
const ConvergeRipplePaint = memo(
|
|
15
15
|
forwardRef(
|
|
@@ -56,7 +56,8 @@ const Ripple = forwardRef(function Ripple2({
|
|
|
56
56
|
const handler = (ev) => {
|
|
57
57
|
if (disabled || prefersReducedMotion() || !isMotionFeatureEnabledFor(motion, "enableRipple")) return;
|
|
58
58
|
if (ev.defaultPrevented) return;
|
|
59
|
-
if (ev.
|
|
59
|
+
if (ev.button !== 0) return;
|
|
60
|
+
if (isRippleTargetDisabled(ev.currentTarget ?? target)) return;
|
|
60
61
|
paintRef.current?.pushAtClientCoords(target, ev.clientX, ev.clientY);
|
|
61
62
|
};
|
|
62
63
|
target.addEventListener("pointerdown", handler);
|
|
@@ -4,13 +4,20 @@ function resolveRipplePaint(input) {
|
|
|
4
4
|
if (input in RIPPLE_COLOR) return RIPPLE_COLOR[input];
|
|
5
5
|
return input;
|
|
6
6
|
}
|
|
7
|
+
const RIPPLE_DISABLED_SELECTOR = ":disabled, [aria-disabled='true'], [data-disabled]";
|
|
7
8
|
function resolveRippleEventTarget(layer) {
|
|
8
9
|
const interactive = layer.closest(
|
|
9
10
|
"button,a[href],[role='button']"
|
|
10
11
|
);
|
|
11
12
|
return interactive ?? layer.parentElement;
|
|
12
13
|
}
|
|
14
|
+
function isRippleTargetDisabled(target) {
|
|
15
|
+
if (!(target instanceof Element)) return true;
|
|
16
|
+
if (target.matches(RIPPLE_DISABLED_SELECTOR)) return true;
|
|
17
|
+
return target.closest(RIPPLE_DISABLED_SELECTOR) !== null;
|
|
18
|
+
}
|
|
13
19
|
export {
|
|
20
|
+
isRippleTargetDisabled,
|
|
14
21
|
resolveRippleEventTarget,
|
|
15
22
|
resolveRipplePaint
|
|
16
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const RIPPLE_LAYER_CLASS = "pointer-events-none absolute inset-0 z-0 overflow-hidden rounded-[inherit]";
|
|
1
|
+
export declare const RIPPLE_LAYER_CLASS = "pointer-events-none absolute inset-0 z-0 isolate overflow-hidden rounded-[inherit]";
|
|
@@ -10,6 +10,10 @@ export declare const SCROLL_AREA_MIN_THUMB = 24;
|
|
|
10
10
|
export declare const EMPTY_SCROLL_METRICS: ScrollMetrics;
|
|
11
11
|
export declare function scrollAreaHasPart(children: ReactNode, displayName: string): boolean;
|
|
12
12
|
export declare function scrollAreaIsCompound(children: ReactNode): boolean;
|
|
13
|
+
export declare function detectCompoundScrollAxes(children: ReactNode): {
|
|
14
|
+
vertical: boolean;
|
|
15
|
+
horizontal: boolean;
|
|
16
|
+
};
|
|
13
17
|
export declare function scrollAxisMetrics(viewport: number, content: number, scroll: number, track?: number): ScrollMetrics;
|
|
14
18
|
export declare function scrollFromThumbOffset(offset: number, metrics: ScrollMetrics): number;
|
|
15
19
|
export declare function scrollAreaNextOffset(current: number, metrics: ScrollMetrics, delta: number | "start" | "end"): number;
|
|
@@ -43,7 +47,12 @@ export declare function bindScrollAreaThumbDrag(thumb: HTMLElement, event: {
|
|
|
43
47
|
viewport: HTMLElement;
|
|
44
48
|
metrics: ScrollMetrics;
|
|
45
49
|
onDragging: (dragging: boolean) => void;
|
|
46
|
-
}): void;
|
|
50
|
+
}): (() => void) | undefined;
|
|
51
|
+
export declare function applyScrollAreaWheel(viewport: HTMLElement, axis: ScrollAxis, metrics: ScrollMetrics, event: {
|
|
52
|
+
deltaX: number;
|
|
53
|
+
deltaY: number;
|
|
54
|
+
deltaMode: number;
|
|
55
|
+
}): boolean;
|
|
47
56
|
export declare function jumpScrollAreaToPointer(bar: HTMLElement, event: {
|
|
48
57
|
clientX: number;
|
|
49
58
|
clientY: number;
|
|
@@ -55,4 +64,4 @@ export declare function jumpScrollAreaToPointer(bar: HTMLElement, event: {
|
|
|
55
64
|
metrics: ScrollMetrics;
|
|
56
65
|
}): void;
|
|
57
66
|
export declare function applyScrollAreaKey(viewport: HTMLElement, axis: ScrollAxis, metrics: ScrollMetrics, key: string): boolean;
|
|
58
|
-
export declare function paintScrollThumb(bar: HTMLElement, metrics: ScrollMetrics): void;
|
|
67
|
+
export declare function paintScrollThumb(bar: HTMLElement, metrics: ScrollMetrics, rtl?: boolean): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Children, isValidElement } from "react";
|
|
3
|
+
import { isRtlElement } from "../utils/readingDirection.js";
|
|
3
4
|
const SCROLL_AREA_VIEWPORT_DISPLAY_NAME = "ScrollAreaViewport";
|
|
4
5
|
const SCROLL_AREA_SCROLLBAR_DISPLAY_NAME = "ScrollAreaScrollbar";
|
|
5
6
|
const SCROLL_AREA_THUMB_DISPLAY_NAME = "ScrollAreaThumb";
|
|
@@ -27,6 +28,24 @@ function scrollAreaHasPart(children, displayName) {
|
|
|
27
28
|
function scrollAreaIsCompound(children) {
|
|
28
29
|
return scrollAreaHasPart(children, SCROLL_AREA_VIEWPORT_DISPLAY_NAME);
|
|
29
30
|
}
|
|
31
|
+
function detectCompoundScrollAxes(children) {
|
|
32
|
+
let vertical = false;
|
|
33
|
+
let horizontal = false;
|
|
34
|
+
const walk = (nodes) => {
|
|
35
|
+
Children.forEach(nodes, (node) => {
|
|
36
|
+
if (!isValidElement(node)) return;
|
|
37
|
+
if (childDisplayName(node) === SCROLL_AREA_SCROLLBAR_DISPLAY_NAME) {
|
|
38
|
+
const axis = node.props.orientation ?? "vertical";
|
|
39
|
+
if (axis === "horizontal") horizontal = true;
|
|
40
|
+
else vertical = true;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (node.props.children) walk(node.props.children);
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
walk(children);
|
|
47
|
+
return { vertical, horizontal };
|
|
48
|
+
}
|
|
30
49
|
function scrollAxisMetrics(viewport, content, scroll, track = viewport) {
|
|
31
50
|
const maxScroll = Math.max(0, content - viewport);
|
|
32
51
|
const overflowing = maxScroll > 1 && track > 0 && viewport > 0;
|
|
@@ -132,27 +151,34 @@ function rtlScrollType() {
|
|
|
132
151
|
}
|
|
133
152
|
function readInlineScroll(element) {
|
|
134
153
|
const max = Math.max(0, element.scrollWidth - element.clientWidth);
|
|
135
|
-
const direction =
|
|
154
|
+
const direction = isRtlElement(element) ? "rtl" : "ltr";
|
|
136
155
|
return inlineScrollOffset(element.scrollLeft, max, direction, rtlScrollType());
|
|
137
156
|
}
|
|
138
157
|
function writeInlineScroll(element, offset) {
|
|
139
158
|
const max = Math.max(0, element.scrollWidth - element.clientWidth);
|
|
140
|
-
const direction =
|
|
159
|
+
const direction = isRtlElement(element) ? "rtl" : "ltr";
|
|
141
160
|
element.scrollLeft = inlineScrollLeft(offset, max, direction, rtlScrollType());
|
|
142
161
|
}
|
|
143
162
|
function bindScrollAreaThumbDrag(thumb, event, options) {
|
|
144
|
-
if (event.button !== 0 || !options.metrics.overflowing) return;
|
|
163
|
+
if (event.button !== 0 || !options.metrics.overflowing) return void 0;
|
|
145
164
|
event.preventDefault();
|
|
146
165
|
event.stopPropagation();
|
|
147
|
-
thumb.setPointerCapture
|
|
166
|
+
if (typeof thumb.setPointerCapture === "function") {
|
|
167
|
+
try {
|
|
168
|
+
thumb.setPointerCapture(event.pointerId);
|
|
169
|
+
} catch {
|
|
170
|
+
}
|
|
171
|
+
}
|
|
148
172
|
const { axis, viewport, metrics, onDragging } = options;
|
|
149
|
-
const rtl = axis === "horizontal" &&
|
|
173
|
+
const rtl = axis === "horizontal" && isRtlElement(viewport);
|
|
150
174
|
const sign = rtl ? -1 : 1;
|
|
151
175
|
const startClient = axis === "vertical" ? event.clientY : event.clientX;
|
|
152
176
|
const startScroll = axis === "vertical" ? viewport.scrollTop : readInlineScroll(viewport);
|
|
153
177
|
const maxOffset = Math.max(1, metrics.track - metrics.thumbSize);
|
|
178
|
+
let ended = false;
|
|
154
179
|
onDragging(true);
|
|
155
180
|
const move = (ev) => {
|
|
181
|
+
if (ended) return;
|
|
156
182
|
const client = axis === "vertical" ? ev.clientY : ev.clientX;
|
|
157
183
|
const delta = (client - startClient) * sign;
|
|
158
184
|
const next = startScroll + delta / maxOffset * metrics.maxScroll;
|
|
@@ -160,21 +186,48 @@ function bindScrollAreaThumbDrag(thumb, event, options) {
|
|
|
160
186
|
else writeInlineScroll(viewport, next);
|
|
161
187
|
};
|
|
162
188
|
const end = () => {
|
|
189
|
+
if (ended) return;
|
|
190
|
+
ended = true;
|
|
163
191
|
thumb.removeEventListener("pointermove", move);
|
|
164
192
|
thumb.removeEventListener("pointerup", end);
|
|
165
193
|
thumb.removeEventListener("pointercancel", end);
|
|
194
|
+
thumb.removeEventListener("lostpointercapture", end);
|
|
166
195
|
onDragging(false);
|
|
167
196
|
};
|
|
168
197
|
thumb.addEventListener("pointermove", move);
|
|
169
198
|
thumb.addEventListener("pointerup", end);
|
|
170
199
|
thumb.addEventListener("pointercancel", end);
|
|
200
|
+
thumb.addEventListener("lostpointercapture", end);
|
|
201
|
+
return end;
|
|
202
|
+
}
|
|
203
|
+
function applyScrollAreaWheel(viewport, axis, metrics, event) {
|
|
204
|
+
if (!metrics.overflowing || metrics.maxScroll <= 0) return false;
|
|
205
|
+
const pageSize = (axis === "vertical" ? viewport.clientHeight : viewport.clientWidth) || 16;
|
|
206
|
+
const scale = event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? pageSize : 1;
|
|
207
|
+
const raw = axis === "vertical" ? event.deltaY : event.deltaX !== 0 ? event.deltaX : event.deltaY;
|
|
208
|
+
const delta = raw * scale;
|
|
209
|
+
if (delta === 0) return false;
|
|
210
|
+
if (axis === "vertical") {
|
|
211
|
+
const before2 = viewport.scrollTop;
|
|
212
|
+
const next2 = Math.min(metrics.maxScroll, Math.max(0, before2 + delta));
|
|
213
|
+
if (Math.abs(next2 - before2) < 0.5) return false;
|
|
214
|
+
viewport.scrollTop = next2;
|
|
215
|
+
return true;
|
|
216
|
+
}
|
|
217
|
+
const rtl = isRtlElement(viewport);
|
|
218
|
+
const inlineDelta = event.deltaX !== 0 && rtl ? -delta : delta;
|
|
219
|
+
const before = readInlineScroll(viewport);
|
|
220
|
+
const next = Math.min(metrics.maxScroll, Math.max(0, before + inlineDelta));
|
|
221
|
+
if (Math.abs(next - before) < 0.5) return false;
|
|
222
|
+
writeInlineScroll(viewport, next);
|
|
223
|
+
return true;
|
|
171
224
|
}
|
|
172
225
|
function jumpScrollAreaToPointer(bar, event, options) {
|
|
173
226
|
if (event.target !== event.currentTarget) return;
|
|
174
227
|
const { axis, viewport, metrics } = options;
|
|
175
228
|
if (!metrics.overflowing) return;
|
|
176
229
|
const rect = bar.getBoundingClientRect();
|
|
177
|
-
const rtl = axis === "horizontal" &&
|
|
230
|
+
const rtl = axis === "horizontal" && isRtlElement(viewport);
|
|
178
231
|
const local = axis === "vertical" ? event.clientY - rect.top : event.clientX - rect.left;
|
|
179
232
|
const along = rtl ? rect.width - local : local;
|
|
180
233
|
const next = scrollFromThumbOffset(along - metrics.thumbSize / 2, metrics);
|
|
@@ -182,7 +235,7 @@ function jumpScrollAreaToPointer(bar, event, options) {
|
|
|
182
235
|
else writeInlineScroll(viewport, next);
|
|
183
236
|
}
|
|
184
237
|
function applyScrollAreaKey(viewport, axis, metrics, key) {
|
|
185
|
-
const rtl = axis === "horizontal" &&
|
|
238
|
+
const rtl = axis === "horizontal" && isRtlElement(viewport);
|
|
186
239
|
const delta = scrollAreaKeyDelta(key, axis, metrics.viewport, rtl);
|
|
187
240
|
if (delta == null || !metrics.overflowing) return false;
|
|
188
241
|
const current = axis === "vertical" ? viewport.scrollTop : readInlineScroll(viewport);
|
|
@@ -191,9 +244,10 @@ function applyScrollAreaKey(viewport, axis, metrics, key) {
|
|
|
191
244
|
else writeInlineScroll(viewport, next);
|
|
192
245
|
return true;
|
|
193
246
|
}
|
|
194
|
-
function paintScrollThumb(bar, metrics) {
|
|
247
|
+
function paintScrollThumb(bar, metrics, rtl = false) {
|
|
248
|
+
const signedOffset = rtl && metrics.thumbOffset !== 0 ? -metrics.thumbOffset : metrics.thumbOffset;
|
|
195
249
|
bar.style.setProperty("--scroll-thumb-size", `${metrics.thumbSize}px`);
|
|
196
|
-
bar.style.setProperty("--scroll-thumb-offset", `${
|
|
250
|
+
bar.style.setProperty("--scroll-thumb-offset", `${signedOffset}px`);
|
|
197
251
|
}
|
|
198
252
|
export {
|
|
199
253
|
EMPTY_SCROLL_METRICS,
|
|
@@ -205,7 +259,9 @@ export {
|
|
|
205
259
|
SCROLL_AREA_THUMB_DISPLAY_NAME,
|
|
206
260
|
SCROLL_AREA_VIEWPORT_DISPLAY_NAME,
|
|
207
261
|
applyScrollAreaKey,
|
|
262
|
+
applyScrollAreaWheel,
|
|
208
263
|
bindScrollAreaThumbDrag,
|
|
264
|
+
detectCompoundScrollAxes,
|
|
209
265
|
inlineScrollLeft,
|
|
210
266
|
inlineScrollOffset,
|
|
211
267
|
jumpScrollAreaToPointer,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, useLayoutEffect, useContext, createContext } from "react";
|
|
3
|
+
import { forwardRef, useRef, useEffect, useLayoutEffect, useContext, createContext } from "react";
|
|
4
4
|
import { dataActiveState } from "../utils/dataContract.js";
|
|
5
|
-
import { scrollAreaHasPart, applyScrollAreaKey, bindScrollAreaThumbDrag, jumpScrollAreaToPointer, SCROLL_AREA_THUMB_DISPLAY_NAME, SCROLL_AREA_VIEWPORT_DISPLAY_NAME, SCROLL_AREA_SCROLLBAR_DISPLAY_NAME, SCROLL_AREA_CORNER_DISPLAY_NAME } from "./scrollAreaAPI.js";
|
|
5
|
+
import { scrollAreaHasPart, applyScrollAreaKey, applyScrollAreaWheel, bindScrollAreaThumbDrag, jumpScrollAreaToPointer, SCROLL_AREA_THUMB_DISPLAY_NAME, SCROLL_AREA_VIEWPORT_DISPLAY_NAME, SCROLL_AREA_SCROLLBAR_DISPLAY_NAME, SCROLL_AREA_CORNER_DISPLAY_NAME } from "./scrollAreaAPI.js";
|
|
6
6
|
import { scrollAreaScrollbarA11y } from "./scrollAreaA11y.js";
|
|
7
7
|
import { useScrollAreaSlotMotion } from "./scrollAreaAnimations.js";
|
|
8
8
|
import { useScrollAreaContext, useScrollAreaClassNames } from "./scrollAreaContext.js";
|
|
@@ -131,9 +131,13 @@ const ScrollAreaScrollbar = forwardRef(
|
|
|
131
131
|
onWheel?.(event);
|
|
132
132
|
const viewport = viewportRef.current;
|
|
133
133
|
if (!viewport || event.defaultPrevented) return;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
const handled = applyScrollAreaWheel(
|
|
135
|
+
viewport,
|
|
136
|
+
orientation,
|
|
137
|
+
axesRef.current[orientation],
|
|
138
|
+
event
|
|
139
|
+
);
|
|
140
|
+
if (handled) event.preventDefault();
|
|
137
141
|
},
|
|
138
142
|
onKeyDown: (event) => {
|
|
139
143
|
onKeyDown?.(event);
|
|
@@ -157,11 +161,20 @@ const ScrollAreaThumb = forwardRef(
|
|
|
157
161
|
onPointerOut,
|
|
158
162
|
onPointerDown,
|
|
159
163
|
onPointerUp,
|
|
164
|
+
onLostPointerCapture,
|
|
160
165
|
...rest
|
|
161
166
|
}, ref) {
|
|
162
167
|
const axis = useScrollAreaAxis();
|
|
163
168
|
const { viewportRef, axesRef, setDragging } = useScrollAreaContext();
|
|
164
169
|
const classNames = useScrollAreaClassNames();
|
|
170
|
+
const dragCleanupRef = useRef(void 0);
|
|
171
|
+
useEffect(
|
|
172
|
+
() => () => {
|
|
173
|
+
dragCleanupRef.current?.();
|
|
174
|
+
dragCleanupRef.current = void 0;
|
|
175
|
+
},
|
|
176
|
+
[]
|
|
177
|
+
);
|
|
165
178
|
const part = useScrollAreaSlotMotion({
|
|
166
179
|
slot: "thumb",
|
|
167
180
|
motion,
|
|
@@ -171,9 +184,11 @@ const ScrollAreaThumb = forwardRef(
|
|
|
171
184
|
onPointerUp,
|
|
172
185
|
onPointerDown: (event) => {
|
|
173
186
|
onPointerDown?.(event);
|
|
187
|
+
if (event.defaultPrevented) return;
|
|
174
188
|
const viewport = viewportRef.current;
|
|
175
189
|
if (!viewport) return;
|
|
176
|
-
|
|
190
|
+
dragCleanupRef.current?.();
|
|
191
|
+
dragCleanupRef.current = bindScrollAreaThumbDrag(event.currentTarget, event, {
|
|
177
192
|
axis,
|
|
178
193
|
viewport,
|
|
179
194
|
metrics: axesRef.current[axis],
|
|
@@ -188,6 +203,11 @@ const ScrollAreaThumb = forwardRef(
|
|
|
188
203
|
...rest,
|
|
189
204
|
...part.pointerHandlers,
|
|
190
205
|
ref: part.setRef,
|
|
206
|
+
onLostPointerCapture: (event) => {
|
|
207
|
+
onLostPointerCapture?.(event);
|
|
208
|
+
dragCleanupRef.current?.();
|
|
209
|
+
dragCleanupRef.current = void 0;
|
|
210
|
+
},
|
|
191
211
|
className: scrollAreaThumbClass({ axis, slotClass: classNames.thumb, className }),
|
|
192
212
|
style: { ...style, ...geometry }
|
|
193
213
|
}
|
|
@@ -205,7 +225,7 @@ const ScrollAreaCorner = forwardRef(
|
|
|
205
225
|
onPointerUp,
|
|
206
226
|
...rest
|
|
207
227
|
}, ref) {
|
|
208
|
-
const {
|
|
228
|
+
const { hasBars, barActive } = useScrollAreaContext();
|
|
209
229
|
const classNames = useScrollAreaClassNames();
|
|
210
230
|
const part = useScrollAreaSlotMotion({
|
|
211
231
|
slot: "corner",
|
|
@@ -216,7 +236,7 @@ const ScrollAreaCorner = forwardRef(
|
|
|
216
236
|
onPointerDown,
|
|
217
237
|
onPointerUp
|
|
218
238
|
});
|
|
219
|
-
const
|
|
239
|
+
const bothVisible = hasBars.vertical && hasBars.horizontal && barActive.vertical && barActive.horizontal;
|
|
220
240
|
return /* @__PURE__ */ jsx(
|
|
221
241
|
"div",
|
|
222
242
|
{
|
|
@@ -224,8 +244,9 @@ const ScrollAreaCorner = forwardRef(
|
|
|
224
244
|
...part.pointerHandlers,
|
|
225
245
|
ref: part.setRef,
|
|
226
246
|
"aria-hidden": "true",
|
|
227
|
-
hidden:
|
|
228
|
-
className: scrollAreaCornerClass({ slotClass: classNames.corner, className })
|
|
247
|
+
hidden: bothVisible ? void 0 : true,
|
|
248
|
+
className: scrollAreaCornerClass({ slotClass: classNames.corner, className }),
|
|
249
|
+
"data-state": dataActiveState(bothVisible)
|
|
229
250
|
}
|
|
230
251
|
);
|
|
231
252
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ScrollAreaOrientation, ScrollAxis } from './scrollAreaTypes.js';
|
|
2
2
|
export declare const SCROLL_AREA_ROOT_CLASS = "relative min-h-0 min-w-0 overflow-hidden";
|
|
3
|
-
export declare const SCROLL_AREA_VIEWPORT_CLASS = "size-full min-h-0 min-w-0 overscroll-contain outline-none [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden";
|
|
3
|
+
export declare const SCROLL_AREA_VIEWPORT_CLASS = "size-full min-h-0 min-w-0 overscroll-contain outline-none focus-ring-inset [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden";
|
|
4
4
|
export declare function scrollAreaViewportOverflow(orientation: ScrollAreaOrientation): string;
|
|
5
5
|
/** Layout wrapper. Not a public slot: `w-max` lets a horizontal row grow past the viewport. */
|
|
6
6
|
export declare function scrollAreaContentClass(orientation: ScrollAreaOrientation): string;
|