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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Children, isValidElement } from "react";
|
|
3
3
|
import { selectionIndicatorFallbackPx } from "../SelectionIndicator/selectionIndicatorStyles.js";
|
|
4
4
|
import { formatLocaleNumber } from "../utils/intlFormat.js";
|
|
5
|
+
import { isRtlElement } from "../utils/readingDirection.js";
|
|
5
6
|
const SLIDER_THUMB_PX = {
|
|
6
7
|
small: selectionIndicatorFallbackPx("small"),
|
|
7
8
|
base: selectionIndicatorFallbackPx("base"),
|
|
@@ -45,15 +46,36 @@ function sliderExplicitNames(ariaLabel, ariaLabelledBy) {
|
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
48
|
function clampSliderValue(n, lo, hi) {
|
|
48
|
-
|
|
49
|
+
const safeLo = Number.isFinite(lo) ? lo : 0;
|
|
50
|
+
const safeHi = Number.isFinite(hi) ? hi : safeLo;
|
|
51
|
+
if (safeLo >= safeHi) return safeLo;
|
|
52
|
+
if (!Number.isFinite(n)) return safeLo;
|
|
53
|
+
return Math.min(safeHi, Math.max(safeLo, n));
|
|
54
|
+
}
|
|
55
|
+
function sliderDecimalPlaces(n) {
|
|
56
|
+
if (!Number.isFinite(n)) return 0;
|
|
57
|
+
const text = String(n);
|
|
58
|
+
const expMatch = /[eE]-(\d+)$/.exec(text);
|
|
59
|
+
if (expMatch) {
|
|
60
|
+
const basePart = text.split(/[eE]/)[0] ?? "";
|
|
61
|
+
const dotIdx2 = basePart.indexOf(".");
|
|
62
|
+
const fracLen = dotIdx2 >= 0 ? basePart.length - dotIdx2 - 1 : 0;
|
|
63
|
+
return fracLen + Number(expMatch[1]);
|
|
64
|
+
}
|
|
65
|
+
const dotIdx = text.indexOf(".");
|
|
66
|
+
return dotIdx >= 0 ? text.length - dotIdx - 1 : 0;
|
|
67
|
+
}
|
|
68
|
+
function roundSliderFloat(n, decimals) {
|
|
69
|
+
if (!Number.isFinite(n) || decimals <= 0) return n;
|
|
70
|
+
return Number(n.toFixed(Math.min(decimals, 20)));
|
|
49
71
|
}
|
|
50
72
|
function sliderValueToPercent(value, min, max) {
|
|
51
|
-
if (max <= min) return 0;
|
|
52
|
-
return (value - min) / (max - min) * 100;
|
|
73
|
+
if (!Number.isFinite(min) || !Number.isFinite(max) || max <= min) return 0;
|
|
74
|
+
return (clampSliderValue(value, min, max) - min) / (max - min) * 100;
|
|
53
75
|
}
|
|
54
76
|
function sliderValueToRatio(value, min, max) {
|
|
55
|
-
if (max <= min) return 0;
|
|
56
|
-
return (value - min) / (max - min);
|
|
77
|
+
if (!Number.isFinite(min) || !Number.isFinite(max) || max <= min) return 0;
|
|
78
|
+
return (clampSliderValue(value, min, max) - min) / (max - min);
|
|
57
79
|
}
|
|
58
80
|
function sliderThumbCenterPercent(value, min, max, trackPx, thumbPx) {
|
|
59
81
|
if (trackPx <= 0) return sliderValueToPercent(value, min, max);
|
|
@@ -85,16 +107,27 @@ function sliderFillSpanForValues(trackPx, thumbPx, min, max, range, singleValue,
|
|
|
85
107
|
return { start: 0, end: Math.min(trackPx, centerPx + half) / trackPx * 100 };
|
|
86
108
|
}
|
|
87
109
|
function sliderFillStyleFromSpan(span, orientation) {
|
|
88
|
-
const size = span.end - span.start;
|
|
110
|
+
const size = Math.max(0, span.end - span.start);
|
|
89
111
|
if (orientation === "horizontal") {
|
|
90
|
-
return {
|
|
112
|
+
return { insetInlineStart: `${span.start}%`, width: `${size}%` };
|
|
91
113
|
}
|
|
92
114
|
return { bottom: `${span.start}%`, height: `${size}%` };
|
|
93
115
|
}
|
|
94
116
|
function snapSliderToStep(value, min, max, step) {
|
|
95
|
-
if (
|
|
117
|
+
if (!Number.isFinite(min) || !Number.isFinite(max) || min >= max) {
|
|
118
|
+
return Number.isFinite(min) ? min : 0;
|
|
119
|
+
}
|
|
120
|
+
if (!Number.isFinite(value)) return min;
|
|
121
|
+
if (!Number.isFinite(step) || step <= 0) return clampSliderValue(value, min, max);
|
|
122
|
+
const decimals = Math.max(
|
|
123
|
+
sliderDecimalPlaces(step),
|
|
124
|
+
sliderDecimalPlaces(min),
|
|
125
|
+
sliderDecimalPlaces(max)
|
|
126
|
+
);
|
|
96
127
|
const steps = Math.round((value - min) / step);
|
|
97
|
-
|
|
128
|
+
const raw = min + steps * step;
|
|
129
|
+
const rounded = decimals > 0 ? roundSliderFloat(raw, decimals) : raw;
|
|
130
|
+
return clampSliderValue(rounded, min, max);
|
|
98
131
|
}
|
|
99
132
|
function snapSliderToMarks(value, marks) {
|
|
100
133
|
if (marks.length === 0) return value;
|
|
@@ -115,12 +148,20 @@ function normalizeSliderMarks(marks, min, max) {
|
|
|
115
148
|
(a, b) => a - b
|
|
116
149
|
);
|
|
117
150
|
}
|
|
118
|
-
function sliderPointerToValue(clientX, clientY, rect, orientation, min, max, thumbPx) {
|
|
151
|
+
function sliderPointerToValue(clientX, clientY, rect, orientation, min, max, thumbPx, rtl = false) {
|
|
152
|
+
if (!Number.isFinite(min) || !Number.isFinite(max) || max <= min) {
|
|
153
|
+
return Number.isFinite(min) ? min : 0;
|
|
154
|
+
}
|
|
119
155
|
const span = orientation === "horizontal" ? rect.width : rect.height;
|
|
120
|
-
const
|
|
121
|
-
const
|
|
156
|
+
const safeThumb = span > thumbPx && thumbPx > 0 ? thumbPx : 0;
|
|
157
|
+
const half = safeThumb / 2;
|
|
158
|
+
const travel = span - safeThumb;
|
|
122
159
|
if (travel <= 0) return min;
|
|
123
|
-
const ratio = orientation === "horizontal" ? clampSliderValue(
|
|
160
|
+
const ratio = orientation === "horizontal" ? clampSliderValue(
|
|
161
|
+
rtl ? (rect.right - clientX - half) / travel : (clientX - rect.left - half) / travel,
|
|
162
|
+
0,
|
|
163
|
+
1
|
|
164
|
+
) : clampSliderValue(1 - (clientY - rect.top - half) / travel, 0, 1);
|
|
124
165
|
return min + ratio * (max - min);
|
|
125
166
|
}
|
|
126
167
|
function sliderAdjacentMark(value, marks, direction) {
|
|
@@ -135,9 +176,12 @@ function sliderAdjacentMark(value, marks, direction) {
|
|
|
135
176
|
}
|
|
136
177
|
return [...marks].reverse().find((mark) => mark < value) ?? marks[0];
|
|
137
178
|
}
|
|
138
|
-
function sliderStepDelta(marks, step, key, orientation) {
|
|
139
|
-
const
|
|
140
|
-
const
|
|
179
|
+
function sliderStepDelta(marks, step, key, orientation, rtl = false) {
|
|
180
|
+
const flipHoriz = orientation === "horizontal" && rtl;
|
|
181
|
+
const arrowInc = flipHoriz ? "ArrowLeft" : "ArrowRight";
|
|
182
|
+
const arrowDec = flipHoriz ? "ArrowRight" : "ArrowLeft";
|
|
183
|
+
const increaseKeys = /* @__PURE__ */ new Set([arrowInc, "ArrowUp", "PageUp"]);
|
|
184
|
+
const decreaseKeys = /* @__PURE__ */ new Set([arrowDec, "ArrowDown", "PageDown"]);
|
|
141
185
|
if (marks?.length) {
|
|
142
186
|
if (key === "Home") return "home";
|
|
143
187
|
if (key === "End") return "end";
|
|
@@ -145,13 +189,14 @@ function sliderStepDelta(marks, step, key, orientation) {
|
|
|
145
189
|
if (decreaseKeys.has(key)) return "mark-prev";
|
|
146
190
|
return 0;
|
|
147
191
|
}
|
|
148
|
-
const
|
|
192
|
+
const safeStep = Number.isFinite(step) && step > 0 ? step : 1;
|
|
193
|
+
const big = safeStep * 10;
|
|
149
194
|
if (key === "Home") return "home";
|
|
150
195
|
if (key === "End") return "end";
|
|
151
196
|
if (key === "PageUp") return big;
|
|
152
197
|
if (key === "PageDown") return -big;
|
|
153
|
-
if (key ===
|
|
154
|
-
if (key ===
|
|
198
|
+
if (key === arrowInc || key === "ArrowUp") return safeStep;
|
|
199
|
+
if (key === arrowDec || key === "ArrowDown") return -safeStep;
|
|
155
200
|
return 0;
|
|
156
201
|
}
|
|
157
202
|
function commitSliderSingle(next, current, snap, set, onChange, remember) {
|
|
@@ -180,15 +225,13 @@ function applySliderPointer(args) {
|
|
|
180
225
|
readOnly,
|
|
181
226
|
range,
|
|
182
227
|
rangeValue,
|
|
183
|
-
singleValue,
|
|
184
228
|
min,
|
|
185
229
|
max,
|
|
186
230
|
orientation,
|
|
187
231
|
fallbackThumbPx,
|
|
188
232
|
snap,
|
|
189
233
|
emitRange,
|
|
190
|
-
emitSingle
|
|
191
|
-
syncFill
|
|
234
|
+
emitSingle
|
|
192
235
|
} = args;
|
|
193
236
|
if (disabled || readOnly) return;
|
|
194
237
|
const rect = track.getBoundingClientRect();
|
|
@@ -200,55 +243,54 @@ function applySliderPointer(args) {
|
|
|
200
243
|
orientation,
|
|
201
244
|
min,
|
|
202
245
|
max,
|
|
203
|
-
thumbPx > 0 ? thumbPx : fallbackThumbPx
|
|
246
|
+
thumbPx > 0 ? thumbPx : fallbackThumbPx,
|
|
247
|
+
isRtlElement(track)
|
|
204
248
|
);
|
|
205
249
|
if (range) {
|
|
206
250
|
const [lo, hi] = rangeValue;
|
|
207
251
|
if (thumb === "start") {
|
|
208
252
|
const nextLo = snap(Math.min(raw, hi));
|
|
209
253
|
emitRange([nextLo, hi]);
|
|
210
|
-
syncFill(singleValue, [nextLo, hi]);
|
|
211
254
|
} else if (thumb === "end") {
|
|
212
255
|
const nextHi = snap(Math.max(raw, lo));
|
|
213
256
|
emitRange([lo, nextHi]);
|
|
214
|
-
syncFill(singleValue, [lo, nextHi]);
|
|
215
257
|
}
|
|
216
258
|
return;
|
|
217
259
|
}
|
|
218
|
-
const next = snap(raw);
|
|
219
260
|
emitSingle(raw);
|
|
220
|
-
syncFill(next, rangeValue);
|
|
221
261
|
}
|
|
222
262
|
function applySliderThumbKey(args) {
|
|
223
263
|
const { action, thumb, range, rangeValue, singleValue, min, max, marks, emitRange, emitSingle, commit } = args;
|
|
224
|
-
const
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
264
|
+
const [lo, hi] = rangeValue;
|
|
265
|
+
const current = thumb === "start" ? lo : thumb === "end" ? hi : singleValue;
|
|
266
|
+
const clampForThumb = (candidate) => {
|
|
267
|
+
if (!range) return clampSliderValue(candidate, min, max);
|
|
268
|
+
return thumb === "start" ? clampSliderValue(candidate, min, hi) : clampSliderValue(candidate, lo, max);
|
|
269
|
+
};
|
|
270
|
+
const emitClamped = (candidate) => {
|
|
271
|
+
const bounded = clampForThumb(candidate);
|
|
272
|
+
if (range) {
|
|
273
|
+
emitRange(thumb === "start" ? [bounded, hi] : [lo, bounded]);
|
|
274
|
+
} else {
|
|
275
|
+
emitSingle(bounded);
|
|
276
|
+
}
|
|
228
277
|
commit();
|
|
229
278
|
};
|
|
230
279
|
if (action === "home") {
|
|
231
|
-
|
|
280
|
+
emitClamped(range && thumb === "end" ? lo : min);
|
|
232
281
|
return;
|
|
233
282
|
}
|
|
234
283
|
if (action === "end") {
|
|
235
|
-
|
|
284
|
+
emitClamped(range && thumb === "start" ? hi : max);
|
|
236
285
|
return;
|
|
237
286
|
}
|
|
238
287
|
if (action === "mark-next" || action === "mark-prev") {
|
|
239
288
|
if (!marks?.length) return;
|
|
240
|
-
|
|
289
|
+
emitClamped(sliderAdjacentMark(current, marks, action === "mark-next" ? 1 : -1));
|
|
241
290
|
return;
|
|
242
291
|
}
|
|
243
292
|
if (typeof action === "number" && action !== 0) {
|
|
244
|
-
|
|
245
|
-
const [lo, hi] = rangeValue;
|
|
246
|
-
if (thumb === "start") emitRange([lo + action, hi]);
|
|
247
|
-
else emitRange([lo, hi + action]);
|
|
248
|
-
} else {
|
|
249
|
-
emitSingle(singleValue + action);
|
|
250
|
-
}
|
|
251
|
-
commit();
|
|
293
|
+
emitClamped(current + action);
|
|
252
294
|
}
|
|
253
295
|
}
|
|
254
296
|
function defaultSliderFormatValue(value) {
|
|
@@ -332,7 +374,9 @@ export {
|
|
|
332
374
|
readSliderValueBinding,
|
|
333
375
|
resolveSliderFallbackThumbPx,
|
|
334
376
|
resolveSliderThumbIcon,
|
|
377
|
+
roundSliderFloat,
|
|
335
378
|
sliderAdjacentMark,
|
|
379
|
+
sliderDecimalPlaces,
|
|
336
380
|
sliderDisplayEqual,
|
|
337
381
|
sliderDisplayFromProps,
|
|
338
382
|
sliderExplicitNames,
|
|
@@ -28,7 +28,7 @@ export declare function useSliderChromeSlot(slot: SliderChromeSlot, { motion, fo
|
|
|
28
28
|
export declare function useSliderThumbShellAnimation(disabled?: boolean): import('react').RefObject<HTMLSpanElement | null>;
|
|
29
29
|
export declare function useSliderFillCleanup(fillRef: React.RefObject<HTMLSpanElement | null>): void;
|
|
30
30
|
export declare function applySliderFillStyle(fill: HTMLSpanElement, style: {
|
|
31
|
-
|
|
31
|
+
insetInlineStart?: string;
|
|
32
32
|
width?: string;
|
|
33
33
|
bottom?: string;
|
|
34
34
|
height?: string;
|
|
@@ -80,7 +80,7 @@ function useSliderFillCleanup(fillRef) {
|
|
|
80
80
|
}
|
|
81
81
|
function applySliderFillStyle(fill, style, orientation) {
|
|
82
82
|
killMotion(fill);
|
|
83
|
-
fill.style.
|
|
83
|
+
fill.style.insetInlineStart = style.insetInlineStart ?? "";
|
|
84
84
|
fill.style.width = style.width ?? "";
|
|
85
85
|
fill.style.bottom = style.bottom ?? "";
|
|
86
86
|
fill.style.height = style.height ?? "";
|
|
@@ -88,7 +88,7 @@ function applySliderFillStyle(fill, style, orientation) {
|
|
|
88
88
|
fill.style.bottom = "";
|
|
89
89
|
fill.style.height = "";
|
|
90
90
|
} else {
|
|
91
|
-
fill.style.
|
|
91
|
+
fill.style.insetInlineStart = "";
|
|
92
92
|
fill.style.width = "";
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -231,17 +231,26 @@ function SliderTrackHost({
|
|
|
231
231
|
const state = useSliderTrackState(props, forwardedRef ?? null);
|
|
232
232
|
const scope = useOptionalSliderMotionScope();
|
|
233
233
|
useSliderTrackSlotMotion(scope, state.valueIdentity, state.disabled);
|
|
234
|
+
const {
|
|
235
|
+
onPointerOver,
|
|
236
|
+
onPointerOut,
|
|
237
|
+
onPointerUp,
|
|
238
|
+
...domTrackRest
|
|
239
|
+
} = state.trackRest;
|
|
234
240
|
const { setRef, pointerHandlers } = useMotionPart({
|
|
235
241
|
scope,
|
|
236
242
|
slot: "track",
|
|
237
243
|
forwardedRef: state.setTrackRef,
|
|
238
244
|
pointerPhases: true,
|
|
239
|
-
|
|
245
|
+
onPointerOver,
|
|
246
|
+
onPointerOut,
|
|
247
|
+
onPointerDown: state.handleTrackPointerDown,
|
|
248
|
+
onPointerUp
|
|
240
249
|
});
|
|
241
250
|
return /* @__PURE__ */ jsx(
|
|
242
251
|
"div",
|
|
243
252
|
{
|
|
244
|
-
...
|
|
253
|
+
...domTrackRest,
|
|
245
254
|
ref: setRef,
|
|
246
255
|
role: "presentation",
|
|
247
256
|
className: state.trackHitClass,
|
|
@@ -4,7 +4,7 @@ export declare function sliderThicknessToCss(thickness: number | string): string
|
|
|
4
4
|
export declare const SLIDER_SCALE_HEADER_BASE_CLASS = "flex items-baseline justify-between gap-xsmall";
|
|
5
5
|
export declare const SLIDER_SCALE_HEADER_HORIZONTAL_CLASS = "w-full";
|
|
6
6
|
export declare const SLIDER_SCALE_HEADER_VERTICAL_CLASS = "min-w-[8rem]";
|
|
7
|
-
export declare const SLIDER_SCALE_VALUE_CLASS = "tabular-nums text-muted";
|
|
7
|
+
export declare const SLIDER_SCALE_VALUE_CLASS = "tabular-nums text-muted-foreground";
|
|
8
8
|
export declare const SLIDER_RAIL_HEIGHT: Record<SliderSize, string>;
|
|
9
9
|
export declare const SLIDER_RAIL_WIDTH: Record<SliderSize, string>;
|
|
10
10
|
export declare const SLIDER_RAIL_LAYOUT_CLASS = "pointer-events-none absolute inset-0 overflow-hidden";
|
|
@@ -21,7 +21,7 @@ export declare const SLIDER_TRACK_HIT_HORIZONTAL_CLASS = "w-full";
|
|
|
21
21
|
export declare const SLIDER_TRACK_HIT_VERTICAL_CLASS = "h-48";
|
|
22
22
|
export declare const SLIDER_MARK_CLASS = "pointer-events-none absolute z-[1] size-1 rounded-[var(--selection-indicator-radius-xsmall)] bg-primary/30";
|
|
23
23
|
export declare const SLIDER_THUMB_BUTTON_BASE_CLASS = "absolute box-border flex shrink-0 origin-center items-center justify-center m-0 appearance-none border-0 bg-transparent p-0 focus-ring";
|
|
24
|
-
export declare const SLIDER_THUMB_BUTTON_HORIZONTAL_CLASS = "top-0 h-full w-auto -translate-x-1/2 aspect-square";
|
|
24
|
+
export declare const SLIDER_THUMB_BUTTON_HORIZONTAL_CLASS = "top-0 h-full w-auto -translate-x-1/2 rtl:translate-x-1/2 aspect-square";
|
|
25
25
|
export declare const SLIDER_THUMB_BUTTON_VERTICAL_CLASS = "start-0 w-full h-auto -translate-y-1/2 aspect-square";
|
|
26
26
|
export declare const SLIDER_THUMB_BUTTON_DISABLED_CLASS = "cursor-not-allowed";
|
|
27
27
|
export declare const SLIDER_THUMB_BUTTON_ENABLED_CLASS = "cursor-grab active:cursor-grabbing";
|
|
@@ -62,8 +62,8 @@ export declare function sliderThumbButtonClass({ size, orientation, disabled, ac
|
|
|
62
62
|
slotClass?: string;
|
|
63
63
|
className?: string;
|
|
64
64
|
}): string;
|
|
65
|
-
export declare function sliderThumbPositionStyle(percent: number, orientation: SliderOrientation): CSSProperties;
|
|
66
|
-
export declare function sliderMarkStyle(percent: number, orientation: SliderOrientation): CSSProperties;
|
|
65
|
+
export declare function sliderThumbPositionStyle(percent: number, orientation: SliderOrientation, isRtl?: boolean): CSSProperties;
|
|
66
|
+
export declare function sliderMarkStyle(percent: number, orientation: SliderOrientation, isRtl?: boolean): CSSProperties;
|
|
67
67
|
export declare function sliderTrackCrossStyle({ isHorizontal, thickness, }: {
|
|
68
68
|
isHorizontal: boolean;
|
|
69
69
|
thickness?: number | string;
|
|
@@ -9,7 +9,7 @@ function sliderThicknessToCss(thickness) {
|
|
|
9
9
|
const SLIDER_SCALE_HEADER_BASE_CLASS = "flex items-baseline justify-between gap-xsmall";
|
|
10
10
|
const SLIDER_SCALE_HEADER_HORIZONTAL_CLASS = "w-full";
|
|
11
11
|
const SLIDER_SCALE_HEADER_VERTICAL_CLASS = "min-w-[8rem]";
|
|
12
|
-
const SLIDER_SCALE_VALUE_CLASS = "tabular-nums text-muted";
|
|
12
|
+
const SLIDER_SCALE_VALUE_CLASS = "tabular-nums text-muted-foreground";
|
|
13
13
|
const SLIDER_RAIL_HEIGHT = {
|
|
14
14
|
small: "h-[var(--selection-indicator-small)] min-h-[var(--selection-indicator-small)]",
|
|
15
15
|
base: "h-[var(--selection-indicator-base)] min-h-[var(--selection-indicator-base)]",
|
|
@@ -35,7 +35,7 @@ const SLIDER_TRACK_HIT_HORIZONTAL_CLASS = "w-full";
|
|
|
35
35
|
const SLIDER_TRACK_HIT_VERTICAL_CLASS = "h-48";
|
|
36
36
|
const SLIDER_MARK_CLASS = "pointer-events-none absolute z-[1] size-1 rounded-[var(--selection-indicator-radius-xsmall)] bg-primary/30";
|
|
37
37
|
const SLIDER_THUMB_BUTTON_BASE_CLASS = "absolute box-border flex shrink-0 origin-center items-center justify-center m-0 appearance-none border-0 bg-transparent p-0 focus-ring";
|
|
38
|
-
const SLIDER_THUMB_BUTTON_HORIZONTAL_CLASS = "top-0 h-full w-auto -translate-x-1/2 aspect-square";
|
|
38
|
+
const SLIDER_THUMB_BUTTON_HORIZONTAL_CLASS = "top-0 h-full w-auto -translate-x-1/2 rtl:translate-x-1/2 aspect-square";
|
|
39
39
|
const SLIDER_THUMB_BUTTON_VERTICAL_CLASS = "start-0 w-full h-auto -translate-y-1/2 aspect-square";
|
|
40
40
|
const SLIDER_THUMB_BUTTON_DISABLED_CLASS = "cursor-not-allowed";
|
|
41
41
|
const SLIDER_THUMB_BUTTON_ENABLED_CLASS = "cursor-grab active:cursor-grabbing";
|
|
@@ -125,11 +125,23 @@ function sliderThumbButtonClass({
|
|
|
125
125
|
className
|
|
126
126
|
);
|
|
127
127
|
}
|
|
128
|
-
function sliderThumbPositionStyle(percent, orientation) {
|
|
129
|
-
|
|
128
|
+
function sliderThumbPositionStyle(percent, orientation, isRtl = false) {
|
|
129
|
+
if (orientation === "horizontal") {
|
|
130
|
+
return isRtl ? { insetInlineStart: `${percent}%`, translate: "50% 0" } : { insetInlineStart: `${percent}%` };
|
|
131
|
+
}
|
|
132
|
+
return { top: `${100 - percent}%` };
|
|
130
133
|
}
|
|
131
|
-
function sliderMarkStyle(percent, orientation) {
|
|
132
|
-
return orientation === "horizontal" ? {
|
|
134
|
+
function sliderMarkStyle(percent, orientation, isRtl = false) {
|
|
135
|
+
return orientation === "horizontal" ? {
|
|
136
|
+
insetInlineStart: `${percent}%`,
|
|
137
|
+
top: "50%",
|
|
138
|
+
transform: isRtl ? "translate(50%, -50%)" : "translate(-50%, -50%)"
|
|
139
|
+
} : {
|
|
140
|
+
bottom: `${percent}%`,
|
|
141
|
+
insetInlineStart: "50%",
|
|
142
|
+
top: "auto",
|
|
143
|
+
transform: isRtl ? "translate(50%, 50%)" : "translate(-50%, 50%)"
|
|
144
|
+
};
|
|
133
145
|
}
|
|
134
146
|
function sliderTrackCrossStyle({
|
|
135
147
|
isHorizontal,
|
|
@@ -7,6 +7,8 @@ export declare const SliderThumbButton: import('react').ForwardRefExoticComponen
|
|
|
7
7
|
percent: number;
|
|
8
8
|
orientation: import('./sliderTypes.js').SliderOrientation;
|
|
9
9
|
disabled?: boolean;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
isRtl?: boolean;
|
|
10
12
|
active: boolean;
|
|
11
13
|
ariaValueNow: number;
|
|
12
14
|
ariaValueMin: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { SelectionThumb } from "../SelectionThumb/index.js";
|
|
4
|
+
import { dataFlag } from "../utils/dataContract.js";
|
|
4
5
|
import { useSkinVariant } from "../../../skins/skinContext.js";
|
|
5
6
|
import { forwardRef } from "react";
|
|
6
7
|
import { useSliderThumbShellAnimation } from "./sliderAnimations.js";
|
|
@@ -18,6 +19,8 @@ const SliderThumbButton = forwardRef(
|
|
|
18
19
|
percent,
|
|
19
20
|
orientation,
|
|
20
21
|
disabled,
|
|
22
|
+
readOnly,
|
|
23
|
+
isRtl,
|
|
21
24
|
active,
|
|
22
25
|
ariaValueNow,
|
|
23
26
|
ariaValueMin,
|
|
@@ -32,6 +35,7 @@ const SliderThumbButton = forwardRef(
|
|
|
32
35
|
onPointerDown,
|
|
33
36
|
onPointerUp,
|
|
34
37
|
onKeyDown,
|
|
38
|
+
onBlur,
|
|
35
39
|
...rest
|
|
36
40
|
}, forwardedRef) {
|
|
37
41
|
const variant = useSkinVariant(variantProp);
|
|
@@ -44,12 +48,13 @@ const SliderThumbButton = forwardRef(
|
|
|
44
48
|
motion,
|
|
45
49
|
forwardedRef,
|
|
46
50
|
pointerPhases: true,
|
|
47
|
-
pressPhases: !disabled,
|
|
51
|
+
pressPhases: !disabled && !readOnly,
|
|
48
52
|
onPointerOver,
|
|
49
53
|
onPointerOut,
|
|
50
54
|
onPointerDown,
|
|
51
55
|
onPointerUp
|
|
52
56
|
});
|
|
57
|
+
const isInvalid = Boolean(fieldCtx?.isInvalid);
|
|
53
58
|
return /* @__PURE__ */ jsx(
|
|
54
59
|
"button",
|
|
55
60
|
{
|
|
@@ -63,7 +68,8 @@ const SliderThumbButton = forwardRef(
|
|
|
63
68
|
"aria-valuenow": ariaValueNow,
|
|
64
69
|
"aria-valuetext": ariaValueText,
|
|
65
70
|
"aria-orientation": orientation,
|
|
66
|
-
"aria-invalid":
|
|
71
|
+
"aria-invalid": isInvalid ? true : void 0,
|
|
72
|
+
"aria-readonly": readOnly || void 0,
|
|
67
73
|
disabled,
|
|
68
74
|
tabIndex: disabled ? -1 : 0,
|
|
69
75
|
className: sliderThumbButtonClass({
|
|
@@ -73,11 +79,17 @@ const SliderThumbButton = forwardRef(
|
|
|
73
79
|
active,
|
|
74
80
|
slotClass: cn(slotClassNames.thumb, className)
|
|
75
81
|
}),
|
|
76
|
-
style: { ...sliderThumbPositionStyle(percent, orientation), ...style },
|
|
82
|
+
style: { ...sliderThumbPositionStyle(percent, orientation, isRtl), ...style },
|
|
77
83
|
onKeyDown,
|
|
84
|
+
onBlur: (event) => {
|
|
85
|
+
onBlur?.(event);
|
|
86
|
+
fieldCtx?.onControlBlur?.();
|
|
87
|
+
},
|
|
78
88
|
...rest,
|
|
79
89
|
...pointerHandlers,
|
|
80
|
-
"data-
|
|
90
|
+
"data-disabled": dataFlag(disabled),
|
|
91
|
+
"data-readonly": dataFlag(readOnly),
|
|
92
|
+
"data-invalid": dataFlag(isInvalid),
|
|
81
93
|
children: /* @__PURE__ */ jsx(
|
|
82
94
|
SelectionThumb,
|
|
83
95
|
{
|
|
@@ -16,7 +16,7 @@ function SliderTrackMarks() {
|
|
|
16
16
|
{
|
|
17
17
|
"aria-hidden": true,
|
|
18
18
|
className: cn(SLIDER_MARK_CLASS, ctx.markSlotClass, slotClassNames.mark),
|
|
19
|
-
style: sliderMarkStyle(item.percent, ctx.orientation)
|
|
19
|
+
style: sliderMarkStyle(item.percent, ctx.orientation, ctx.isRtl)
|
|
20
20
|
},
|
|
21
21
|
item.value
|
|
22
22
|
)) });
|
|
@@ -104,7 +104,7 @@ function SliderTrackThumb({
|
|
|
104
104
|
return /* @__PURE__ */ jsx(
|
|
105
105
|
SliderThumbButton,
|
|
106
106
|
{
|
|
107
|
-
ref: forwardedRef,
|
|
107
|
+
ref: mergeRefs(ctx.getThumbRef("start"), forwardedRef),
|
|
108
108
|
size: ctx.size,
|
|
109
109
|
icon,
|
|
110
110
|
variant: ctx.variant,
|
|
@@ -113,6 +113,8 @@ function SliderTrackThumb({
|
|
|
113
113
|
percent: ctx.thumbPercent("start"),
|
|
114
114
|
orientation: ctx.orientation,
|
|
115
115
|
disabled: ctx.disabled,
|
|
116
|
+
readOnly: ctx.readOnly,
|
|
117
|
+
isRtl: ctx.isRtl,
|
|
116
118
|
active: ctx.activeThumb === "start",
|
|
117
119
|
ariaValueNow: ctx.rangeValue[0],
|
|
118
120
|
ariaValueMin: ctx.min,
|
|
@@ -130,7 +132,7 @@ function SliderTrackThumb({
|
|
|
130
132
|
return /* @__PURE__ */ jsx(
|
|
131
133
|
SliderThumbButton,
|
|
132
134
|
{
|
|
133
|
-
ref: forwardedRef,
|
|
135
|
+
ref: mergeRefs(ctx.getThumbRef("end"), forwardedRef),
|
|
134
136
|
size: ctx.size,
|
|
135
137
|
icon,
|
|
136
138
|
variant: ctx.variant,
|
|
@@ -139,6 +141,8 @@ function SliderTrackThumb({
|
|
|
139
141
|
percent: ctx.thumbPercent("end"),
|
|
140
142
|
orientation: ctx.orientation,
|
|
141
143
|
disabled: ctx.disabled,
|
|
144
|
+
readOnly: ctx.readOnly,
|
|
145
|
+
isRtl: ctx.isRtl,
|
|
142
146
|
active: ctx.activeThumb === "end",
|
|
143
147
|
ariaValueNow: ctx.rangeValue[1],
|
|
144
148
|
ariaValueMin: ctx.rangeValue[0],
|
|
@@ -155,7 +159,7 @@ function SliderTrackThumb({
|
|
|
155
159
|
return /* @__PURE__ */ jsx(
|
|
156
160
|
SliderThumbButton,
|
|
157
161
|
{
|
|
158
|
-
ref: forwardedRef,
|
|
162
|
+
ref: mergeRefs(ctx.getThumbRef("single"), forwardedRef),
|
|
159
163
|
size: ctx.size,
|
|
160
164
|
icon,
|
|
161
165
|
variant: ctx.variant,
|
|
@@ -164,6 +168,8 @@ function SliderTrackThumb({
|
|
|
164
168
|
percent: ctx.thumbPercent("single"),
|
|
165
169
|
orientation: ctx.orientation,
|
|
166
170
|
disabled: ctx.disabled,
|
|
171
|
+
readOnly: ctx.readOnly,
|
|
172
|
+
isRtl: ctx.isRtl,
|
|
167
173
|
active: ctx.activeThumb === "single",
|
|
168
174
|
ariaValueNow: ctx.singleValue,
|
|
169
175
|
ariaValueMin: ctx.min,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties, HTMLAttributes, KeyboardEvent, PointerEvent, ReactNode, RefObject } from 'react';
|
|
1
|
+
import { CSSProperties, HTMLAttributes, KeyboardEvent, PointerEvent, ReactNode, Ref, RefObject } from 'react';
|
|
2
2
|
import { Prettify } from '../../../utils/prettify.js';
|
|
3
3
|
import { LabelProps } from '../Label/index.js';
|
|
4
4
|
import { MotionController, MotionMapWithEvents, MotionValue, MotionStateHostProps } from '../utils/slotMotion/index.js';
|
|
@@ -69,6 +69,9 @@ export type SliderFieldContextValue = {
|
|
|
69
69
|
orientation: SliderOrientation;
|
|
70
70
|
display: SliderDisplayState | null;
|
|
71
71
|
setDisplay: (next: SliderDisplayState | null) => void;
|
|
72
|
+
trackProps?: SliderTrackProps;
|
|
73
|
+
registerControlRef?: (node: HTMLElement | null) => void;
|
|
74
|
+
onControlBlur?: () => void;
|
|
72
75
|
};
|
|
73
76
|
export type SliderThumbA11y = {
|
|
74
77
|
ariaLabel?: string;
|
|
@@ -88,6 +91,8 @@ export type SliderTrackContextValue = {
|
|
|
88
91
|
size: SliderSize;
|
|
89
92
|
orientation: SliderOrientation;
|
|
90
93
|
disabled?: boolean;
|
|
94
|
+
readOnly?: boolean;
|
|
95
|
+
isRtl?: boolean;
|
|
91
96
|
icon?: ReactNode;
|
|
92
97
|
range: boolean;
|
|
93
98
|
variant: SliderVariant;
|
|
@@ -98,6 +103,7 @@ export type SliderTrackContextValue = {
|
|
|
98
103
|
max: number;
|
|
99
104
|
formatValue: (value: number) => string;
|
|
100
105
|
thumbPercent: (kind: SliderThumbKind) => number;
|
|
106
|
+
getThumbRef: (kind: SliderThumbKind) => Ref<HTMLButtonElement>;
|
|
101
107
|
resolveThumbIcon: (children?: ReactNode) => ReactNode;
|
|
102
108
|
resolveThumbA11y: (kind: SliderThumbKind) => SliderThumbA11y;
|
|
103
109
|
onThumbPointerDown: (thumb: SliderThumbKind) => (e: PointerEvent<HTMLButtonElement>) => void;
|
|
@@ -214,6 +220,8 @@ export type SliderThumbButtonProps = {
|
|
|
214
220
|
percent: number;
|
|
215
221
|
orientation: SliderOrientation;
|
|
216
222
|
disabled?: boolean;
|
|
223
|
+
readOnly?: boolean;
|
|
224
|
+
isRtl?: boolean;
|
|
217
225
|
active: boolean;
|
|
218
226
|
ariaValueNow: number;
|
|
219
227
|
ariaValueMin: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SliderFieldContextValue, SliderTrackProps, UseSliderRootStateProps } from './sliderTypes.js';
|
|
2
|
-
export declare function useSliderRootState({ children, id: idProp, name, orientation, label, showValue, valueText, hint, error, invalid, range, value, defaultValue, onValueChange, onValueCommit, min, max, step, marks, size, thickness, formatValue, icon, disabled, readOnly, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, variant, }: UseSliderRootStateProps): {
|
|
2
|
+
export declare function useSliderRootState({ children, id: idProp, name, orientation, label, showValue, valueText, hint, error, invalid, range, value, defaultValue, onValueChange, onValueCommit, min, max, step, marks, size, thickness, formatValue, icon, disabled: disabledProp, readOnly: readOnlyProp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, variant, }: UseSliderRootStateProps): {
|
|
3
3
|
sliderId: string;
|
|
4
4
|
isCompound: boolean;
|
|
5
5
|
fieldCtx: SliderFieldContextValue;
|
|
@@ -8,13 +8,14 @@ export declare function useSliderRootState({ children, id: idProp, name, orienta
|
|
|
8
8
|
required: false;
|
|
9
9
|
};
|
|
10
10
|
trackProps: SliderTrackProps;
|
|
11
|
+
disabled: boolean;
|
|
11
12
|
readOnly: boolean;
|
|
12
13
|
name: string | undefined;
|
|
13
14
|
label: import('react').ReactNode;
|
|
14
15
|
showValue: boolean | undefined;
|
|
15
16
|
valueText: import('react').ReactNode;
|
|
16
17
|
hint: import('react').ReactNode;
|
|
17
|
-
error: import('react').ReactNode;
|
|
18
|
+
error: string | number | bigint | boolean | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | undefined;
|
|
18
19
|
hasHint: boolean;
|
|
19
20
|
hasError: boolean;
|
|
20
21
|
hintId: string;
|