burne-ui 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/cli/burne-ui.js +4 -3
- package/cli/init.js +83 -19
- package/cli/skin-live-slots.json +1 -1
- package/cli/skin-slots.json +2 -0
- package/cli/skin-validate.mjs +83 -2
- package/cli/tailwind.css +20 -0
- package/cli/theme-bridge.css +6 -0
- package/dist/authoring.d.ts +2 -0
- package/dist/authoring.js +8 -0
- package/dist/components/composite/Accordion/accordionStyles.js +1 -1
- package/dist/components/composite/Accordion/useAccordionRootState.js +6 -2
- package/dist/components/composite/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/components/composite/AlertDialog/AlertDialog.js +1 -0
- package/dist/components/composite/AlertDialog/alertDialogAnimations.d.ts +1 -0
- package/dist/components/composite/AlertDialog/alertDialogAnimations.js +1 -0
- package/dist/components/composite/AlertDialog/alertDialogParts.d.ts +5 -7
- package/dist/components/composite/AlertDialog/alertDialogParts.js +92 -37
- package/dist/components/composite/AlertDialog/alertDialogStyles.d.ts +3 -2
- package/dist/components/composite/AlertDialog/alertDialogStyles.js +5 -3
- package/dist/components/composite/AlertDialog/alertDialogTypes.d.ts +8 -8
- package/dist/components/composite/AlertDialog/index.d.ts +4 -6
- package/dist/components/composite/AlertDialog/useAlertDialogRootState.d.ts +1 -1
- package/dist/components/composite/AlertDialog/useAlertDialogRootState.js +13 -1
- package/dist/components/composite/ButtonGroup/ButtonGroup.d.ts +1 -0
- package/dist/components/composite/ButtonGroup/ButtonGroup.js +59 -25
- package/dist/components/composite/ButtonGroup/buttonGroupAPI.d.ts +1 -0
- package/dist/components/composite/ButtonGroup/buttonGroupAPI.js +7 -1
- package/dist/components/composite/ButtonGroup/buttonGroupContext.d.ts +3 -2
- package/dist/components/composite/ButtonGroup/buttonGroupContext.js +4 -3
- package/dist/components/composite/ButtonGroup/buttonGroupStyles.js +1 -1
- package/dist/components/composite/ButtonGroup/buttonGroupTypes.d.ts +3 -1
- package/dist/components/composite/ButtonGroup/index.d.ts +1 -0
- package/dist/components/composite/CheckboxGroup/CheckboxGroup.js +25 -7
- package/dist/components/composite/CheckboxGroup/useCheckboxGroupRootState.d.ts +5 -1
- package/dist/components/composite/CheckboxGroup/useCheckboxGroupRootState.js +74 -23
- package/dist/components/composite/Form/Form.js +6 -0
- package/dist/components/composite/Form/formAPI.d.ts +2 -0
- package/dist/components/composite/Form/formAPI.js +29 -2
- package/dist/components/composite/Form/formContext.js +4 -0
- package/dist/components/composite/Form/formParts.js +20 -6
- package/dist/components/composite/Form/formStyles.js +4 -4
- package/dist/components/composite/Form/useFormControlProps.js +25 -15
- package/dist/components/composite/Form/useFormFieldBinding.js +22 -14
- package/dist/components/composite/Form/useFormRootState.d.ts +2 -1
- package/dist/components/composite/Form/useFormRootState.js +151 -89
- package/dist/components/composite/RadioGroup/RadioGroup.js +30 -10
- package/dist/components/composite/RadioGroup/radioGroupA11y.d.ts +10 -0
- package/dist/components/composite/RadioGroup/radioGroupA11y.js +75 -0
- package/dist/components/composite/RadioGroup/radioGroupTypes.d.ts +2 -2
- package/dist/components/composite/RadioGroup/useRadioGroupRootState.d.ts +7 -1
- package/dist/components/composite/RadioGroup/useRadioGroupRootState.js +105 -34
- package/dist/components/composite/ToggleButtonGroup/ToggleButtonGroup.js +3 -1
- package/dist/components/composite/ToggleButtonGroup/toggleButtonGroupA11y.d.ts +1 -1
- package/dist/components/composite/ToggleButtonGroup/toggleButtonGroupA11y.js +13 -7
- package/dist/components/composite/ToggleButtonGroup/toggleButtonGroupAPI.d.ts +2 -0
- package/dist/components/composite/ToggleButtonGroup/toggleButtonGroupAPI.js +19 -4
- package/dist/components/composite/ToggleButtonGroup/useToggleButtonGroupRootState.js +20 -7
- package/dist/components/composite/utils/optionGroupFieldset.d.ts +1 -1
- package/dist/components/core/Alert/Alert.js +3 -1
- package/dist/components/core/Alert/alertAnimations.js +14 -3
- package/dist/components/core/Alert/alertStyles.d.ts +1 -1
- package/dist/components/core/Alert/alertStyles.js +1 -1
- package/dist/components/core/AppShell/AppShell.js +16 -4
- package/dist/components/core/AppShell/appShellAnimations.js +1 -1
- package/dist/components/core/AppShell/appShellStyles.d.ts +3 -2
- package/dist/components/core/AppShell/appShellStyles.js +8 -2
- package/dist/components/core/AspectRatio/AspectRatio.js +6 -3
- package/dist/components/core/AspectRatio/aspectRatioAnimations.js +1 -1
- package/dist/components/core/AspectRatio/aspectRatioStyles.d.ts +5 -2
- package/dist/components/core/AspectRatio/aspectRatioStyles.js +27 -3
- package/dist/components/core/Avatar/avatarParts.js +26 -6
- package/dist/components/core/Avatar/avatarTypes.d.ts +1 -0
- package/dist/components/core/Avatar/useAvatarRootState.d.ts +1 -0
- package/dist/components/core/Avatar/useAvatarRootState.js +6 -2
- package/dist/components/core/Badge/Badge.js +9 -3
- package/dist/components/core/Badge/badgeA11y.js +6 -0
- package/dist/components/core/Badge/badgeAPI.js +4 -4
- package/dist/components/core/Badge/badgeAnimations.js +18 -3
- package/dist/components/core/Badge/badgeParts.d.ts +1 -1
- package/dist/components/core/Badge/badgeParts.js +6 -3
- package/dist/components/core/Badge/badgeStyles.d.ts +1 -0
- package/dist/components/core/Badge/badgeStyles.js +2 -0
- package/dist/components/core/Badge/badgeTypes.d.ts +2 -0
- package/dist/components/core/Badge/useBadgeRootState.d.ts +1 -0
- package/dist/components/core/Badge/useBadgeRootState.js +2 -1
- package/dist/components/core/Breadcrumbs/breadcrumbsAPI.js +11 -5
- package/dist/components/core/Breadcrumbs/breadcrumbsParts.js +21 -6
- package/dist/components/core/Breadcrumbs/breadcrumbsStyles.js +4 -4
- package/dist/components/core/Button/Button.js +34 -18
- package/dist/components/core/Button/buttonAnimations.d.ts +1 -1
- package/dist/components/core/Button/buttonAnimations.js +18 -7
- package/dist/components/core/Button/buttonParts.js +2 -2
- package/dist/components/core/Button/buttonStyles.d.ts +4 -3
- package/dist/components/core/Button/buttonStyles.js +11 -10
- package/dist/components/core/Button/buttonTypes.d.ts +2 -1
- package/dist/components/core/Button/useButtonRootState.d.ts +2 -1
- package/dist/components/core/Button/useButtonRootState.js +10 -4
- package/dist/components/core/Calendar/Calendar.js +15 -4
- package/dist/components/core/Calendar/calendarAPI.d.ts +10 -6
- package/dist/components/core/Calendar/calendarAPI.js +110 -30
- package/dist/components/core/Calendar/calendarParts.js +173 -72
- package/dist/components/core/Calendar/calendarStyles.d.ts +5 -5
- package/dist/components/core/Calendar/calendarStyles.js +8 -8
- package/dist/components/core/Calendar/calendarTypes.d.ts +8 -0
- package/dist/components/core/Calendar/useCalendarRootState.js +60 -19
- package/dist/components/core/Calendar/useCalendarViewModels.js +6 -6
- package/dist/components/core/Card/Card.d.ts +1 -0
- package/dist/components/core/Card/Card.js +17 -7
- package/dist/components/core/Card/cardAPI.d.ts +1 -0
- package/dist/components/core/Card/cardAPI.js +23 -1
- package/dist/components/core/Card/cardAnimations.d.ts +1 -1
- package/dist/components/core/Card/cardAnimations.js +41 -10
- package/dist/components/core/Card/cardParts.d.ts +1 -1
- package/dist/components/core/Card/cardParts.js +26 -6
- package/dist/components/core/Card/cardStyles.d.ts +5 -4
- package/dist/components/core/Card/cardStyles.js +9 -6
- package/dist/components/core/Card/cardTypes.d.ts +4 -0
- package/dist/components/core/Card/index.d.ts +1 -0
- package/dist/components/core/Checkbox/Checkbox.js +9 -1
- package/dist/components/core/Checkbox/checkboxAPI.d.ts +2 -0
- package/dist/components/core/Checkbox/checkboxAPI.js +36 -0
- package/dist/components/core/Checkbox/checkboxParts.d.ts +5 -4
- package/dist/components/core/Checkbox/checkboxParts.js +74 -48
- package/dist/components/core/Checkbox/checkboxStyles.d.ts +4 -3
- package/dist/components/core/Checkbox/checkboxStyles.js +5 -3
- package/dist/components/core/Checkbox/checkboxTypes.d.ts +2 -0
- package/dist/components/core/Checkbox/index.d.ts +1 -1
- package/dist/components/core/Checkbox/useCheckboxRootState.d.ts +4 -1
- package/dist/components/core/Checkbox/useCheckboxRootState.js +43 -30
- package/dist/components/core/CloseButton/CloseButton.js +2 -1
- package/dist/components/core/CloseButton/closeButtonAnimations.js +38 -9
- package/dist/components/core/CloseButton/closeButtonParts.js +3 -4
- package/dist/components/core/ColorPicker/ColorPicker.js +27 -8
- package/dist/components/core/ColorPicker/ColorSlider.d.ts +2 -0
- package/dist/components/core/ColorPicker/ColorSlider.js +131 -53
- package/dist/components/core/ColorPicker/ColorSwatch.js +22 -4
- package/dist/components/core/ColorPicker/colorPickerAnimations.d.ts +1 -1
- package/dist/components/core/ColorPicker/colorPickerAnimations.js +33 -8
- package/dist/components/core/ColorPicker/colorPickerParts.js +125 -32
- package/dist/components/core/ColorPicker/colorPickerStyles.d.ts +11 -3
- package/dist/components/core/ColorPicker/colorPickerStyles.js +13 -3
- package/dist/components/core/ColorPicker/colorPickerTypes.d.ts +4 -0
- package/dist/components/core/ColorPicker/colorSliderStyles.d.ts +2 -2
- package/dist/components/core/ColorPicker/colorSliderStyles.js +4 -4
- package/dist/components/core/ColorPicker/colorSliderTypes.d.ts +2 -0
- package/dist/components/core/ColorPicker/colorSwatchStyles.d.ts +1 -0
- package/dist/components/core/ColorPicker/colorSwatchStyles.js +4 -0
- package/dist/components/core/ColorPicker/colorUtils.d.ts +2 -1
- package/dist/components/core/ColorPicker/colorUtils.js +33 -10
- package/dist/components/core/ColorPicker/index.d.ts +2 -0
- package/dist/components/core/ColorPicker/useColorPickerRootState.d.ts +3 -1
- package/dist/components/core/ColorPicker/useColorPickerRootState.js +65 -30
- package/dist/components/core/ComboBox/ComboBox.js +13 -1
- package/dist/components/core/ComboBox/comboBoxAnimations.d.ts +3 -2
- package/dist/components/core/ComboBox/comboBoxAnimations.js +5 -2
- package/dist/components/core/ComboBox/comboBoxFieldParts.js +1 -1
- package/dist/components/core/ComboBox/comboBoxParts.d.ts +3 -1
- package/dist/components/core/ComboBox/comboBoxParts.js +114 -28
- package/dist/components/core/ComboBox/comboBoxStyles.d.ts +4 -4
- package/dist/components/core/ComboBox/comboBoxStyles.js +4 -4
- package/dist/components/core/ComboBox/comboBoxTypes.d.ts +5 -0
- package/dist/components/core/ComboBox/useComboBoxInputState.d.ts +3 -2
- package/dist/components/core/ComboBox/useComboBoxInputState.js +130 -62
- package/dist/components/core/ComboBox/useComboBoxRootState.js +44 -18
- package/dist/components/core/Container/Container.js +3 -0
- package/dist/components/core/Container/containerStyles.d.ts +2 -1
- package/dist/components/core/Container/containerStyles.js +2 -1
- package/dist/components/core/ContextMenu/ContextMenu.d.ts +3 -1
- package/dist/components/core/ContextMenu/ContextMenu.js +177 -19
- package/dist/components/core/ContextMenu/contextMenuStyles.d.ts +1 -1
- package/dist/components/core/ContextMenu/contextMenuStyles.js +1 -1
- package/dist/components/core/ContextMenu/index.d.ts +3 -1
- package/dist/components/core/DatePicker/DatePicker.js +8 -3
- package/dist/components/core/DatePicker/datePickerAPI.d.ts +2 -0
- package/dist/components/core/DatePicker/datePickerAPI.js +43 -0
- package/dist/components/core/DatePicker/datePickerAnimations.d.ts +2 -1
- package/dist/components/core/DatePicker/datePickerAnimations.js +9 -5
- package/dist/components/core/DatePicker/datePickerParts.js +29 -5
- package/dist/components/core/DatePicker/datePickerStyles.d.ts +2 -2
- package/dist/components/core/DatePicker/datePickerStyles.js +2 -2
- package/dist/components/core/DatePicker/datePickerTypes.d.ts +2 -0
- package/dist/components/core/DatePicker/useDatePickerRootState.d.ts +2 -0
- package/dist/components/core/DatePicker/useDatePickerRootState.js +63 -24
- package/dist/components/core/Dialog/Dialog.d.ts +1 -1
- package/dist/components/core/Dialog/Dialog.js +2 -0
- package/dist/components/core/Dialog/dialogAnimations.d.ts +1 -0
- package/dist/components/core/Dialog/dialogAnimations.js +1 -0
- package/dist/components/core/Dialog/dialogParts.d.ts +1 -1
- package/dist/components/core/Dialog/dialogParts.js +8 -3
- package/dist/components/core/Dialog/dialogStyles.d.ts +1 -1
- package/dist/components/core/Dialog/dialogStyles.js +2 -2
- package/dist/components/core/Dialog/dialogTypes.d.ts +4 -1
- package/dist/components/core/Dialog/useDialogRootState.d.ts +1 -1
- package/dist/components/core/Dialog/useDialogRootState.js +2 -0
- package/dist/components/core/Disclosure/Disclosure.js +10 -4
- package/dist/components/core/Disclosure/disclosureAnimations.js +7 -5
- package/dist/components/core/Disclosure/disclosureContentPart.js +3 -0
- package/dist/components/core/Disclosure/disclosureParts.js +29 -20
- package/dist/components/core/Disclosure/disclosureStyles.d.ts +1 -1
- package/dist/components/core/Disclosure/disclosureStyles.js +3 -3
- package/dist/components/core/Disclosure/useDisclosureContentDrag.js +3 -1
- package/dist/components/core/Disclosure/useDisclosureGroupRootState.js +17 -7
- package/dist/components/core/Disclosure/useDisclosureRootState.js +12 -12
- package/dist/components/core/Drawer/Drawer.d.ts +1 -1
- package/dist/components/core/Drawer/Drawer.js +2 -0
- package/dist/components/core/Drawer/drawerAnimations.d.ts +1 -0
- package/dist/components/core/Drawer/drawerAnimations.js +1 -0
- package/dist/components/core/Drawer/drawerParts.js +14 -9
- package/dist/components/core/Drawer/drawerStyles.d.ts +1 -1
- package/dist/components/core/Drawer/drawerStyles.js +2 -2
- package/dist/components/core/Drawer/drawerTypes.d.ts +4 -1
- package/dist/components/core/Drawer/useDrawerHandleDrag.d.ts +2 -0
- package/dist/components/core/Drawer/useDrawerHandleDrag.js +117 -35
- package/dist/components/core/Drawer/useDrawerRootState.d.ts +1 -1
- package/dist/components/core/Drawer/useDrawerRootState.js +3 -0
- package/dist/components/core/Dropdown/dropdownA11y.js +4 -1
- package/dist/components/core/Dropdown/dropdownAnimations.d.ts +3 -2
- package/dist/components/core/Dropdown/dropdownAnimations.js +79 -29
- package/dist/components/core/Dropdown/dropdownItemParts.d.ts +3 -1
- package/dist/components/core/Dropdown/dropdownItemParts.js +25 -5
- package/dist/components/core/Dropdown/dropdownParts.js +40 -11
- package/dist/components/core/Dropdown/dropdownStyles.d.ts +3 -3
- package/dist/components/core/Dropdown/dropdownStyles.js +3 -3
- package/dist/components/core/Dropdown/dropdownSubParts.js +47 -16
- package/dist/components/core/Dropdown/dropdownTypes.d.ts +13 -2
- package/dist/components/core/Dropdown/index.d.ts +3 -1
- package/dist/components/core/Dropdown/useDropdownItemState.d.ts +5 -1
- package/dist/components/core/Dropdown/useDropdownItemState.js +3 -1
- package/dist/components/core/Dropdown/useDropdownRootState.js +16 -5
- package/dist/components/core/Expandable/expandableA11y.d.ts +1 -0
- package/dist/components/core/Expandable/expandableA11y.js +5 -0
- package/dist/components/core/Expandable/expandableAPI.d.ts +1 -0
- package/dist/components/core/Expandable/expandableAPI.js +19 -11
- package/dist/components/core/Expandable/expandableAnimations.d.ts +1 -1
- package/dist/components/core/Expandable/expandableAnimations.js +9 -9
- package/dist/components/core/Expandable/expandableParts.js +31 -23
- package/dist/components/core/Expandable/expandableStyles.d.ts +1 -1
- package/dist/components/core/Expandable/expandableStyles.js +1 -1
- package/dist/components/core/Expandable/useExpandableRootState.js +5 -3
- package/dist/components/core/Field/fieldParts.d.ts +2 -2
- package/dist/components/core/Field/fieldParts.js +2 -1
- package/dist/components/core/Field/fieldStyles.js +1 -1
- package/dist/components/core/Grid/Grid.js +3 -0
- package/dist/components/core/Grid/gridStyles.d.ts +2 -1
- package/dist/components/core/Grid/gridStyles.js +2 -1
- package/dist/components/core/Header/Header.js +3 -1
- package/dist/components/core/Header/headerStyles.d.ts +3 -2
- package/dist/components/core/Header/headerStyles.js +9 -2
- package/dist/components/core/HoverCard/hoverCardParts.js +23 -11
- package/dist/components/core/Input/inputAffixParts.js +6 -0
- package/dist/components/core/Input/inputAnimations.js +3 -1
- package/dist/components/core/Input/inputControlParts.js +48 -14
- package/dist/components/core/Input/inputFieldParts.js +1 -1
- package/dist/components/core/Input/inputStyles.d.ts +5 -5
- package/dist/components/core/Input/inputStyles.js +5 -5
- package/dist/components/core/Input/inputTypes.d.ts +1 -0
- package/dist/components/core/Input/useInputRootState.js +2 -1
- package/dist/components/core/Kbd/Kbd.js +3 -1
- package/dist/components/core/Kbd/kbdAnimations.js +16 -4
- package/dist/components/core/Kbd/kbdParts.js +6 -4
- package/dist/components/core/Kbd/kbdStyles.d.ts +1 -1
- package/dist/components/core/Kbd/kbdStyles.js +1 -1
- package/dist/components/core/Kbd/kbdTextPart.js +5 -2
- package/dist/components/core/Kbd/useKbdRootState.js +6 -2
- package/dist/components/core/Label/Label.d.ts +2 -1
- package/dist/components/core/Label/Label.js +8 -1
- package/dist/components/core/Label/labelParts.d.ts +1 -0
- package/dist/components/core/Label/labelTypes.d.ts +3 -1
- package/dist/components/core/Label/useLabelRootState.d.ts +2 -1
- package/dist/components/core/Label/useLabelRootState.js +3 -1
- package/dist/components/core/Link/Link.d.ts +1 -1
- package/dist/components/core/Link/Link.js +38 -25
- package/dist/components/core/Link/linkAPI.d.ts +3 -1
- package/dist/components/core/Link/linkAPI.js +8 -4
- package/dist/components/core/Link/linkAnchorBodyPart.d.ts +2 -2
- package/dist/components/core/Link/linkAnchorBodyPart.js +48 -8
- package/dist/components/core/Link/linkAnimations.d.ts +1 -1
- package/dist/components/core/Link/linkAnimations.js +29 -14
- package/dist/components/core/Link/linkIconSlotPart.d.ts +1 -1
- package/dist/components/core/Link/linkIconSlotPart.js +3 -3
- package/dist/components/core/Link/linkStyles.d.ts +5 -3
- package/dist/components/core/Link/linkStyles.js +6 -3
- package/dist/components/core/Link/linkTypes.d.ts +14 -1
- package/dist/components/core/Link/useLinkRootState.d.ts +2 -0
- package/dist/components/core/ListBox/ListBox.d.ts +1 -0
- package/dist/components/core/ListBox/ListBox.js +2 -0
- package/dist/components/core/ListBox/index.d.ts +1 -0
- package/dist/components/core/ListBox/listBoxAnimations.d.ts +5 -2
- package/dist/components/core/ListBox/listBoxAnimations.js +15 -3
- package/dist/components/core/ListBox/listBoxParts.js +21 -5
- package/dist/components/core/ListBox/listBoxStyles.d.ts +3 -3
- package/dist/components/core/ListBox/listBoxStyles.js +3 -3
- package/dist/components/core/ListBox/listBoxTypes.d.ts +5 -1
- package/dist/components/core/ListBox/useListBoxItemState.d.ts +1 -1
- package/dist/components/core/ListBox/useListBoxRootState.d.ts +1 -1
- package/dist/components/core/ListBox/useListBoxRootState.js +31 -6
- package/dist/components/core/ListBox/useListBoxVirtualWindow.d.ts +1 -0
- package/dist/components/core/ListBox/useListBoxVirtualWindow.js +11 -4
- package/dist/components/core/Loading/Loading.js +1 -1
- package/dist/components/core/Loading/loadingAnimations.d.ts +2 -2
- package/dist/components/core/Loading/loadingAnimations.js +12 -5
- package/dist/components/core/Loading/loadingParts.js +1 -1
- package/dist/components/core/Loading/loadingStyles.js +1 -1
- package/dist/components/core/Meter/Meter.js +21 -3
- package/dist/components/core/Meter/meterAPI.d.ts +4 -0
- package/dist/components/core/Meter/meterAPI.js +13 -2
- package/dist/components/core/Meter/meterParts.js +6 -2
- package/dist/components/core/Meter/meterStyles.d.ts +1 -1
- package/dist/components/core/Meter/meterStyles.js +1 -1
- package/dist/components/core/Meter/meterTypes.d.ts +1 -0
- package/dist/components/core/Meter/useMeterRootState.js +3 -2
- package/dist/components/core/Meter/useMeterTrackState.d.ts +1 -1
- package/dist/components/core/Meter/useMeterTrackState.js +15 -10
- package/dist/components/core/NumberInput/NumberInput.js +13 -2
- package/dist/components/core/NumberInput/numberInputParts.d.ts +4 -1
- package/dist/components/core/NumberInput/numberInputParts.js +30 -4
- package/dist/components/core/NumberInput/numberInputStyles.js +2 -2
- package/dist/components/core/NumberInput/useNumberInputRootState.js +47 -33
- package/dist/components/core/Pagination/paginationAPI.d.ts +4 -1
- package/dist/components/core/Pagination/paginationAPI.js +60 -17
- package/dist/components/core/Pagination/paginationAnimations.js +6 -0
- package/dist/components/core/Pagination/paginationParts.d.ts +1 -1
- package/dist/components/core/Pagination/paginationParts.js +82 -22
- package/dist/components/core/Pagination/paginationStyles.d.ts +7 -6
- package/dist/components/core/Pagination/paginationStyles.js +7 -6
- package/dist/components/core/Pagination/paginationTypes.d.ts +1 -0
- package/dist/components/core/Pagination/usePaginationRootState.js +12 -6
- package/dist/components/core/PinInput/pinInputAnimations.d.ts +6 -1
- package/dist/components/core/PinInput/pinInputAnimations.js +13 -4
- package/dist/components/core/PinInput/pinInputParts.js +84 -20
- package/dist/components/core/PinInput/pinInputStyles.d.ts +1 -1
- package/dist/components/core/PinInput/pinInputStyles.js +2 -2
- package/dist/components/core/PinInput/pinInputTypes.d.ts +4 -0
- package/dist/components/core/PinInput/usePinInputRootState.js +71 -33
- package/dist/components/core/Popover/popoverAnimations.d.ts +1 -0
- package/dist/components/core/Popover/popoverAnimations.js +33 -7
- package/dist/components/core/Popover/popoverParts.js +62 -14
- package/dist/components/core/Popover/popoverStyles.d.ts +1 -1
- package/dist/components/core/Popover/popoverStyles.js +1 -1
- package/dist/components/core/Popover/popoverTypes.d.ts +1 -0
- package/dist/components/core/Popover/usePopoverRootState.js +46 -14
- package/dist/components/core/ProgressBar/ProgressBar.js +21 -3
- package/dist/components/core/ProgressBar/progressBarA11y.d.ts +1 -1
- package/dist/components/core/ProgressBar/progressBarA11y.js +4 -2
- package/dist/components/core/ProgressBar/progressBarAPI.d.ts +4 -0
- package/dist/components/core/ProgressBar/progressBarAPI.js +13 -2
- package/dist/components/core/ProgressBar/progressBarParts.js +6 -2
- package/dist/components/core/ProgressBar/progressBarStyles.d.ts +1 -1
- package/dist/components/core/ProgressBar/progressBarStyles.js +1 -1
- package/dist/components/core/ProgressBar/progressBarTypes.d.ts +3 -0
- package/dist/components/core/ProgressBar/useProgressBarRootState.js +6 -3
- package/dist/components/core/ProgressBar/useProgressBarTrackState.d.ts +1 -1
- package/dist/components/core/ProgressBar/useProgressBarTrackState.js +18 -11
- package/dist/components/core/Radio/Radio.js +6 -1
- package/dist/components/core/Radio/radioParts.js +6 -3
- package/dist/components/core/Radio/radioStyles.d.ts +3 -3
- package/dist/components/core/Radio/radioStyles.js +3 -3
- package/dist/components/core/Radio/radioTypes.d.ts +1 -0
- package/dist/components/core/Radio/useRadioRootState.d.ts +5 -2
- package/dist/components/core/Radio/useRadioRootState.js +80 -36
- package/dist/components/core/Resizable/Resizable.js +185 -20
- package/dist/components/core/Resizable/index.d.ts +1 -0
- package/dist/components/core/Resizable/resizableAnimations.js +1 -1
- package/dist/components/core/Resizable/resizableParts.d.ts +1 -0
- package/dist/components/core/Resizable/resizableParts.js +96 -42
- package/dist/components/core/Resizable/resizableStyles.d.ts +3 -2
- package/dist/components/core/Resizable/resizableStyles.js +3 -2
- package/dist/components/core/Resizable/resizableTypes.d.ts +10 -2
- package/dist/components/core/Ripple/Ripple.js +3 -2
- package/dist/components/core/Ripple/rippleAPI.d.ts +1 -0
- package/dist/components/core/Ripple/rippleAPI.js +7 -0
- package/dist/components/core/Ripple/rippleStyles.d.ts +1 -1
- package/dist/components/core/Ripple/rippleStyles.js +1 -1
- package/dist/components/core/ScrollArea/ScrollArea.js +1 -1
- package/dist/components/core/ScrollArea/scrollAreaAPI.d.ts +11 -2
- package/dist/components/core/ScrollArea/scrollAreaAPI.js +65 -9
- package/dist/components/core/ScrollArea/scrollAreaParts.js +31 -10
- package/dist/components/core/ScrollArea/scrollAreaStyles.d.ts +1 -1
- package/dist/components/core/ScrollArea/scrollAreaStyles.js +1 -1
- package/dist/components/core/ScrollArea/scrollAreaTypes.d.ts +4 -0
- package/dist/components/core/ScrollArea/useScrollAreaRootState.d.ts +1 -1
- package/dist/components/core/ScrollArea/useScrollAreaRootState.js +49 -10
- package/dist/components/core/SearchInput/SearchInput.js +24 -9
- package/dist/components/core/SearchInput/searchInputAnimations.d.ts +7 -6
- package/dist/components/core/SearchInput/searchInputAnimations.js +23 -18
- package/dist/components/core/SearchInput/searchInputParts.d.ts +2 -2
- package/dist/components/core/SearchInput/searchInputParts.js +22 -10
- package/dist/components/core/SearchInput/searchInputStyles.d.ts +5 -3
- package/dist/components/core/SearchInput/searchInputStyles.js +6 -5
- package/dist/components/core/SearchInput/searchInputTypes.d.ts +1 -0
- package/dist/components/core/SearchInput/useSearchInputRootState.d.ts +3 -3
- package/dist/components/core/SearchInput/useSearchInputRootState.js +52 -34
- package/dist/components/core/Select/Select.js +13 -1
- package/dist/components/core/Select/selectAnimations.d.ts +3 -2
- package/dist/components/core/Select/selectAnimations.js +5 -2
- package/dist/components/core/Select/selectParts.d.ts +3 -1
- package/dist/components/core/Select/selectParts.js +2 -1
- package/dist/components/core/Select/selectStyles.d.ts +3 -3
- package/dist/components/core/Select/selectStyles.js +3 -3
- package/dist/components/core/Select/selectTriggerParts.js +79 -28
- package/dist/components/core/Select/selectTypes.d.ts +1 -0
- package/dist/components/core/Select/useSelectRootState.js +33 -16
- package/dist/components/core/SelectionIndicator/selectionIndicatorAnimations.js +23 -3
- package/dist/components/core/SelectionThumb/SelectionThumb.js +1 -1
- package/dist/components/core/Separator/Separator.d.ts +2 -1
- package/dist/components/core/Separator/Separator.js +3 -1
- package/dist/components/core/Separator/index.d.ts +1 -1
- package/dist/components/core/Separator/separatorStyles.d.ts +2 -2
- package/dist/components/core/Separator/separatorStyles.js +2 -2
- package/dist/components/core/Separator/separatorTypes.d.ts +4 -0
- package/dist/components/core/Sidebar/Sidebar.js +15 -2
- package/dist/components/core/Sidebar/sidebarAnimations.d.ts +2 -2
- package/dist/components/core/Sidebar/sidebarAnimations.js +4 -3
- package/dist/components/core/Sidebar/sidebarStyles.d.ts +2 -1
- package/dist/components/core/Sidebar/sidebarStyles.js +2 -1
- package/dist/components/core/Skeleton/skeletonParts.js +8 -5
- package/dist/components/core/Skeleton/skeletonStyles.d.ts +10 -0
- package/dist/components/core/Skeleton/skeletonStyles.js +20 -0
- package/dist/components/core/Slider/Slider.js +9 -3
- package/dist/components/core/Slider/sliderAPI.d.ts +5 -4
- package/dist/components/core/Slider/sliderAPI.js +86 -42
- package/dist/components/core/Slider/sliderAnimations.d.ts +1 -1
- package/dist/components/core/Slider/sliderAnimations.js +2 -2
- package/dist/components/core/Slider/sliderParts.js +11 -2
- package/dist/components/core/Slider/sliderStyles.d.ts +4 -4
- package/dist/components/core/Slider/sliderStyles.js +18 -6
- package/dist/components/core/Slider/sliderThumbParts.d.ts +2 -0
- package/dist/components/core/Slider/sliderThumbParts.js +16 -4
- package/dist/components/core/Slider/sliderTrackParts.js +10 -4
- package/dist/components/core/Slider/sliderTypes.d.ts +9 -1
- package/dist/components/core/Slider/useSliderRootState.d.ts +3 -2
- package/dist/components/core/Slider/useSliderRootState.js +104 -49
- package/dist/components/core/Slider/useSliderTrackState.js +198 -39
- package/dist/components/core/Stack/Stack.js +3 -0
- package/dist/components/core/Stack/stackStyles.d.ts +2 -1
- package/dist/components/core/Stack/stackStyles.js +2 -1
- package/dist/components/core/Stepper/index.d.ts +10 -1
- package/dist/components/core/Stepper/stepperAPI.d.ts +2 -2
- package/dist/components/core/Stepper/stepperAPI.js +4 -3
- package/dist/components/core/Stepper/stepperAnimations.d.ts +1 -0
- package/dist/components/core/Stepper/stepperAnimations.js +28 -2
- package/dist/components/core/Stepper/stepperParts.d.ts +11 -2
- package/dist/components/core/Stepper/stepperParts.js +38 -9
- package/dist/components/core/Stepper/stepperStyles.js +3 -1
- package/dist/components/core/Stepper/stepperTypes.d.ts +3 -2
- package/dist/components/core/Stepper/useStepperRootState.js +10 -3
- package/dist/components/core/Surface/Surface.js +3 -1
- package/dist/components/core/Switch/Switch.js +12 -1
- package/dist/components/core/Switch/switchAPI.d.ts +2 -0
- package/dist/components/core/Switch/switchAPI.js +18 -1
- package/dist/components/core/Switch/switchAnimations.js +29 -9
- package/dist/components/core/Switch/switchControlParts.js +93 -30
- package/dist/components/core/Switch/switchGeometry.js +2 -2
- package/dist/components/core/Switch/switchSimpleParts.d.ts +2 -1
- package/dist/components/core/Switch/switchSimpleParts.js +3 -1
- package/dist/components/core/Switch/switchStyles.d.ts +3 -3
- package/dist/components/core/Switch/switchStyles.js +3 -3
- package/dist/components/core/Switch/switchTypes.d.ts +8 -0
- package/dist/components/core/Switch/useSwitchRootState.js +54 -17
- package/dist/components/core/Table/Table.d.ts +1 -0
- package/dist/components/core/Table/Table.js +2 -0
- package/dist/components/core/Table/index.d.ts +1 -0
- package/dist/components/core/Table/tableAPI.d.ts +6 -1
- package/dist/components/core/Table/tableAPI.js +73 -5
- package/dist/components/core/Table/tableContext.js +6 -1
- package/dist/components/core/Table/tableParts.js +77 -34
- package/dist/components/core/Table/tableStyles.d.ts +13 -2
- package/dist/components/core/Table/tableStyles.js +26 -3
- package/dist/components/core/Table/tableTypes.d.ts +4 -0
- package/dist/components/core/Table/tableVirtualRows.js +140 -27
- package/dist/components/core/Table/useTableContentState.d.ts +2 -1
- package/dist/components/core/Table/useTableContentState.js +32 -6
- package/dist/components/core/Tabs/tabsA11y.d.ts +4 -3
- package/dist/components/core/Tabs/tabsA11y.js +5 -4
- package/dist/components/core/Tabs/tabsContext.d.ts +5 -0
- package/dist/components/core/Tabs/tabsContext.js +12 -0
- package/dist/components/core/Tabs/tabsPanelPart.js +11 -1
- package/dist/components/core/Tabs/tabsParts.js +70 -32
- package/dist/components/core/Tabs/tabsStyles.d.ts +5 -2
- package/dist/components/core/Tabs/tabsStyles.js +13 -4
- package/dist/components/core/Tabs/tabsTabPart.js +55 -50
- package/dist/components/core/Tabs/tabsTypes.d.ts +2 -2
- package/dist/components/core/Tabs/useSlidingTabIndicator.d.ts +1 -1
- package/dist/components/core/Tabs/useSlidingTabIndicator.js +25 -10
- package/dist/components/core/Tabs/useTabsRootState.js +13 -5
- package/dist/components/core/TagsInput/TagsInput.js +13 -2
- package/dist/components/core/TagsInput/index.d.ts +2 -0
- package/dist/components/core/TagsInput/tagsInputParts.d.ts +6 -2
- package/dist/components/core/TagsInput/tagsInputParts.js +81 -14
- package/dist/components/core/TagsInput/tagsInputStyles.js +2 -2
- package/dist/components/core/TagsInput/tagsInputTypes.d.ts +3 -0
- package/dist/components/core/TagsInput/useTagsInputRootState.js +78 -33
- package/dist/components/core/Text/Text.d.ts +2 -1
- package/dist/components/core/Text/Text.js +3 -1
- package/dist/components/core/Text/index.d.ts +1 -1
- package/dist/components/core/Text/textTypes.d.ts +4 -0
- package/dist/components/core/TextArea/textAreaAnimations.js +5 -3
- package/dist/components/core/TextArea/textAreaParts.js +94 -12
- package/dist/components/core/TextArea/textAreaStyles.d.ts +3 -3
- package/dist/components/core/TextArea/textAreaStyles.js +2 -2
- package/dist/components/core/TextArea/textAreaTypes.d.ts +1 -0
- package/dist/components/core/TextArea/useTextAreaRootState.js +2 -1
- package/dist/components/core/TimeField/TimeField.js +6 -1
- package/dist/components/core/TimeField/timeFieldAnimations.d.ts +3 -2
- package/dist/components/core/TimeField/timeFieldAnimations.js +13 -4
- package/dist/components/core/TimeField/timeFieldParts.js +50 -30
- package/dist/components/core/TimeField/timeFieldStyles.d.ts +1 -1
- package/dist/components/core/TimeField/timeFieldStyles.js +1 -1
- package/dist/components/core/TimeField/timeFieldTypes.d.ts +2 -0
- package/dist/components/core/TimeField/useTimeFieldControlState.d.ts +4 -1
- package/dist/components/core/TimeField/useTimeFieldControlState.js +141 -39
- package/dist/components/core/TimeField/useTimeFieldRootState.js +3 -1
- package/dist/components/core/Toast/toastA11y.js +17 -7
- package/dist/components/core/Toast/toastAPI.d.ts +17 -1
- package/dist/components/core/Toast/toastAPI.js +82 -0
- package/dist/components/core/Toast/toastAnimations.d.ts +1 -1
- package/dist/components/core/Toast/toastAnimations.js +106 -98
- package/dist/components/core/Toast/toastProvider.js +25 -3
- package/dist/components/core/Toast/toastStyles.d.ts +5 -3
- package/dist/components/core/Toast/toastStyles.js +5 -3
- package/dist/components/core/Toast/toastTypes.d.ts +9 -0
- package/dist/components/core/Toast/useToastProviderState.js +61 -6
- package/dist/components/core/ToggleButton/ToggleButton.js +23 -7
- package/dist/components/core/ToggleButton/toggleButtonAnimations.d.ts +4 -2
- package/dist/components/core/ToggleButton/toggleButtonAnimations.js +64 -41
- package/dist/components/core/ToggleButton/toggleButtonStyles.d.ts +2 -1
- package/dist/components/core/ToggleButton/toggleButtonStyles.js +21 -2
- package/dist/components/core/ToggleButton/toggleButtonTypes.d.ts +3 -0
- package/dist/components/core/ToggleButton/useToggleButtonRootState.d.ts +1 -1
- package/dist/components/core/ToggleButton/useToggleButtonRootState.js +4 -7
- package/dist/components/core/Tooltip/tooltipAnimations.js +17 -1
- package/dist/components/core/Tooltip/tooltipParts.js +83 -26
- package/dist/components/core/Tooltip/tooltipPosition.js +57 -32
- package/dist/components/core/Tooltip/tooltipStyles.d.ts +2 -2
- package/dist/components/core/Tooltip/tooltipStyles.js +2 -2
- package/dist/components/core/Tooltip/tooltipTypes.d.ts +5 -0
- package/dist/components/core/Tooltip/useTooltipRootState.js +59 -10
- package/dist/components/core/utils/bodyScrollLock.js +12 -3
- package/dist/components/core/utils/clampNumber.d.ts +1 -1
- package/dist/components/core/utils/clampNumber.js +4 -1
- package/dist/components/core/utils/containedEscape.js +12 -0
- package/dist/components/core/utils/fieldFormDom.d.ts +24 -0
- package/dist/components/core/utils/fieldFormDom.js +37 -2
- package/dist/components/core/utils/focusElement.js +2 -2
- package/dist/components/core/utils/hoverInteractiveLift.d.ts +12 -0
- package/dist/components/core/utils/hoverInteractiveLift.js +43 -2
- package/dist/components/core/utils/inputAffixStyles.js +1 -1
- package/dist/components/core/utils/mergeAsChildProps.d.ts +7 -0
- package/dist/components/core/utils/mergeAsChildProps.js +23 -2
- package/dist/components/core/utils/optionListItemStyles.d.ts +2 -2
- package/dist/components/core/utils/optionListItemStyles.js +2 -2
- package/dist/components/core/utils/overlayLayer.d.ts +39 -0
- package/dist/components/core/utils/overlayLayer.js +164 -2
- package/dist/components/core/utils/overlayTriggerSqueeze.js +5 -4
- package/dist/components/core/utils/portalContainer.d.ts +27 -5
- package/dist/components/core/utils/portalContainer.js +38 -4
- package/dist/components/core/utils/pressRipple.js +2 -1
- package/dist/components/core/utils/readingDirection.js +8 -0
- package/dist/components/core/utils/runOpenAfterSqueeze.d.ts +7 -0
- package/dist/components/core/utils/runOpenAfterSqueeze.js +10 -3
- package/dist/components/core/utils/semanticStatusSurface.js +4 -4
- package/dist/components/core/utils/sizeLayout/panel.js +4 -4
- package/dist/components/core/utils/slotMotion/recipes/loadKitRecipe.js +2 -0
- package/dist/components/core/utils/slotMotion/recipes/switchThumb.js +3 -0
- package/dist/components/core/utils/slotMotion/resolveMotionValue.js +1 -1
- package/dist/components/core/utils/slotMotion/slotMount.js +1 -1
- package/dist/components/core/utils/slotMotion/useBarFillMotion.js +8 -3
- package/dist/components/core/utils/useCollapsibleHeight.js +2 -1
- package/dist/components/core/utils/useConvergeRipples.js +4 -1
- package/dist/components/core/utils/useModalMotion.d.ts +2 -0
- package/dist/components/core/utils/useModalMotion.js +19 -3
- package/dist/components/core/utils/usePressableElementTextMotion.js +4 -5
- package/dist/components/core/utils/useShadowMotion.js +28 -7
- package/dist/index.d.ts +3 -3
- package/dist/skins/resolveVariantVisual.d.ts +1 -1
- package/dist/skins/resolveVariantVisual.js +2 -2
- package/dist/skins/skinContext.js +6 -5
- package/dist/skins/skinLiveSlots.generated.d.ts +1 -1
- package/dist/skins/skinLiveSlots.generated.js +1 -1
- package/dist/skins/skinShell.js +9 -4
- package/dist/skins/skinSlots.generated.d.ts +1 -1
- package/dist/skins/skinSlots.generated.js +2 -0
- package/dist/studio/colorPresets.d.ts +1 -1
- package/dist/studio/colorPresets.js +8 -1
- package/dist/studio.d.ts +1 -1
- package/dist/studio.js +13 -1
- package/dist/theme/namedPalettes.d.ts +12 -0
- package/dist/theme/namedPalettes.js +697 -1
- package/dist/theme/themeDefaults.js +6 -3
- package/dist/tokens/config.d.ts +8 -2
- package/dist/tokens/config.js +15 -2
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.js +9 -0
- package/dist/ui.css +499 -55
- package/dist/utils/cn.js +89 -2
- package/package.json +1 -1
- package/dist/components/composite/utils/useOptionGroupRequiredAnchor.js +0 -17
- package/dist/components/composite/utils/useOptionGroupSingleValue.js +0 -24
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useId, useMemo, useState, useCallback, useRef, useEffect } from "react";
|
|
3
3
|
import { useOptionalButtonGroupSegment } from "../../composite/ButtonGroup/buttonGroupContext.js";
|
|
4
|
+
import { useNativeFormReset } from "../utils/fieldFormDom.js";
|
|
4
5
|
import { fieldShellVariantFromButtonGroup } from "../utils/fieldShellVariant.js";
|
|
5
6
|
import { useControllableState } from "../utils/useControllableState.js";
|
|
6
7
|
import { useFormFieldBinding } from "../../composite/Form/useFormFieldBinding.js";
|
|
@@ -18,6 +19,7 @@ function useSelectMultipleValues({
|
|
|
18
19
|
formBound,
|
|
19
20
|
formValue,
|
|
20
21
|
setFormValue,
|
|
22
|
+
disabled,
|
|
21
23
|
readOnly
|
|
22
24
|
}) {
|
|
23
25
|
const isValuesControlled = multiple && (valuesProp !== void 0 || formBound);
|
|
@@ -36,14 +38,19 @@ function useSelectMultipleValues({
|
|
|
36
38
|
});
|
|
37
39
|
const setValues = useCallback(
|
|
38
40
|
(next) => {
|
|
39
|
-
if (!multiple || readOnly) return;
|
|
41
|
+
if (!multiple || disabled || readOnly) return;
|
|
40
42
|
if (!isValuesControlled) setInternalValues(next);
|
|
41
43
|
onValuesChange?.(next);
|
|
42
44
|
if (formBound) setFormValue(next);
|
|
43
45
|
},
|
|
44
|
-
[formBound, isValuesControlled, multiple, onValuesChange, readOnly, setFormValue]
|
|
46
|
+
[disabled, formBound, isValuesControlled, multiple, onValuesChange, readOnly, setFormValue]
|
|
45
47
|
);
|
|
46
|
-
|
|
48
|
+
const resetInternalValues = useCallback(() => {
|
|
49
|
+
if (!isValuesControlled) {
|
|
50
|
+
setInternalValues(defaultValues ?? EMPTY_SELECT_VALUES);
|
|
51
|
+
}
|
|
52
|
+
}, [defaultValues, isValuesControlled]);
|
|
53
|
+
return { values, setValues, isValuesControlled, resetInternalValues };
|
|
47
54
|
}
|
|
48
55
|
function useSelectRootState({
|
|
49
56
|
children,
|
|
@@ -85,8 +92,8 @@ function useSelectRootState({
|
|
|
85
92
|
readOnly: readOnlyProp
|
|
86
93
|
});
|
|
87
94
|
const formBound = formBinding.bound;
|
|
88
|
-
const disabled = formBinding.disabled ?? disabledProp;
|
|
89
|
-
const readOnly = Boolean(formBinding.readOnly);
|
|
95
|
+
const disabled = Boolean(formBinding.disabled ?? disabledProp);
|
|
96
|
+
const readOnly = Boolean(formBinding.readOnly ?? readOnlyProp);
|
|
90
97
|
const selectValueLabel = useBurneLabel("selectValue");
|
|
91
98
|
const placeholder = placeholderProp ?? selectValueLabel;
|
|
92
99
|
const autoId = useId();
|
|
@@ -100,9 +107,9 @@ function useSelectRootState({
|
|
|
100
107
|
const compound = hasCompoundChildren(children);
|
|
101
108
|
return {
|
|
102
109
|
isCompound: compound,
|
|
103
|
-
hasLabel: label != null || compound && hasCompoundChild(children, "Label"),
|
|
104
|
-
hasHint: hint != null || compound && hasCompoundChild(children, "SelectHint"),
|
|
105
|
-
hasError: error != null || compound && hasCompoundChild(children, "SelectError")
|
|
110
|
+
hasLabel: label != null || compound && (hasCompoundChild(children, "SelectLabel") || hasCompoundChild(children, "Label")),
|
|
111
|
+
hasHint: hint != null || compound && (hasCompoundChild(children, "SelectHint") || hasCompoundChild(children, "Select.Hint")),
|
|
112
|
+
hasError: error != null || compound && (hasCompoundChild(children, "SelectError") || hasCompoundChild(children, "Select.Error"))
|
|
106
113
|
};
|
|
107
114
|
}, [children, error, hint, label]);
|
|
108
115
|
const isControlled = valueProp !== void 0 || formBound;
|
|
@@ -117,14 +124,14 @@ function useSelectRootState({
|
|
|
117
124
|
});
|
|
118
125
|
const setValue = useCallback(
|
|
119
126
|
(next) => {
|
|
120
|
-
if (multiple || readOnly) return;
|
|
127
|
+
if (multiple || disabled || readOnly) return;
|
|
121
128
|
if (!isControlled) setInternalValue(next);
|
|
122
129
|
onValueChange?.(next === "" ? null : next);
|
|
123
130
|
if (formBound) formBinding.setValue(next);
|
|
124
131
|
},
|
|
125
|
-
[formBinding, formBound, isControlled, multiple, onValueChange, readOnly]
|
|
132
|
+
[disabled, formBinding, formBound, isControlled, multiple, onValueChange, readOnly]
|
|
126
133
|
);
|
|
127
|
-
const { values, setValues } = useSelectMultipleValues({
|
|
134
|
+
const { values, setValues, isValuesControlled, resetInternalValues } = useSelectMultipleValues({
|
|
128
135
|
multiple,
|
|
129
136
|
valuesProp,
|
|
130
137
|
defaultValues,
|
|
@@ -132,23 +139,33 @@ function useSelectRootState({
|
|
|
132
139
|
formBound,
|
|
133
140
|
formValue: formBinding.value,
|
|
134
141
|
setFormValue: formBinding.setValue,
|
|
142
|
+
disabled,
|
|
135
143
|
readOnly
|
|
136
144
|
});
|
|
137
|
-
const [
|
|
138
|
-
value: openProp,
|
|
139
|
-
defaultValue: defaultOpen,
|
|
145
|
+
const [rawOpen, setOpenState] = useControllableState({
|
|
146
|
+
value: disabled || readOnly ? false : openProp,
|
|
147
|
+
defaultValue: disabled || readOnly ? false : defaultOpen,
|
|
140
148
|
onChange: onOpenChange
|
|
141
149
|
});
|
|
150
|
+
const open = disabled || readOnly ? false : rawOpen;
|
|
142
151
|
const setOpen = useCallback(
|
|
143
152
|
(next) => {
|
|
144
|
-
if (readOnly) return;
|
|
153
|
+
if (next && (disabled || readOnly)) return;
|
|
145
154
|
setOpenState(next);
|
|
146
155
|
},
|
|
147
|
-
[readOnly, setOpenState]
|
|
156
|
+
[disabled, readOnly, setOpenState]
|
|
148
157
|
);
|
|
149
158
|
const [activeValue, setActiveValue] = useState(null);
|
|
150
159
|
const anchorRef = useRef(null);
|
|
151
160
|
const valueRef = useRef(null);
|
|
161
|
+
useNativeFormReset(
|
|
162
|
+
anchorRef,
|
|
163
|
+
() => {
|
|
164
|
+
if (!isControlled) setInternalValue(defaultValue ?? "");
|
|
165
|
+
resetInternalValues();
|
|
166
|
+
},
|
|
167
|
+
multiple ? !isValuesControlled : !isControlled
|
|
168
|
+
);
|
|
152
169
|
const optionSections = useMemo(() => selectOptionSections(optionsProp), [optionsProp]);
|
|
153
170
|
const items = useMemo(
|
|
154
171
|
() => optionSections.flatMap((section) => section.items),
|
|
@@ -27,11 +27,20 @@ function useSelectionIndicatorAnimation(active, fillRef, iconRef) {
|
|
|
27
27
|
const config = useMotionConfig();
|
|
28
28
|
const scope = useOptionalSelectionIndicatorMotionScope();
|
|
29
29
|
const firstLayoutRef = useRef(true);
|
|
30
|
+
const prevActiveRef = useRef(active);
|
|
31
|
+
const prevFillElRef = useRef(null);
|
|
32
|
+
const prevIconElRef = useRef(null);
|
|
30
33
|
const reduceMotion = usePrefersReducedMotion() || !isMotionFeatureEnabledFor(config, "enableSelectionFill");
|
|
31
34
|
useLayoutEffect(() => {
|
|
32
|
-
const fill = fillRef?.current;
|
|
33
|
-
const icon = iconRef?.current;
|
|
35
|
+
const fill = fillRef?.current ?? null;
|
|
36
|
+
const icon = iconRef?.current ?? null;
|
|
34
37
|
if (!fill && !icon) return;
|
|
38
|
+
const activeChanged = prevActiveRef.current !== active;
|
|
39
|
+
const fillMounted = fill != null && prevFillElRef.current !== fill;
|
|
40
|
+
const iconMounted = icon != null && prevIconElRef.current !== icon;
|
|
41
|
+
prevActiveRef.current = active;
|
|
42
|
+
prevFillElRef.current = fill;
|
|
43
|
+
prevIconElRef.current = icon;
|
|
35
44
|
if (firstLayoutRef.current) {
|
|
36
45
|
firstLayoutRef.current = false;
|
|
37
46
|
if (fill) {
|
|
@@ -44,6 +53,17 @@ function useSelectionIndicatorAnimation(active, fillRef, iconRef) {
|
|
|
44
53
|
}
|
|
45
54
|
return;
|
|
46
55
|
}
|
|
56
|
+
if (!activeChanged) {
|
|
57
|
+
if (fillMounted && fill) {
|
|
58
|
+
killMotion(fill);
|
|
59
|
+
snapSelectionFill(fill, active);
|
|
60
|
+
}
|
|
61
|
+
if (iconMounted && icon) {
|
|
62
|
+
killMotion(icon);
|
|
63
|
+
snapSelectionMark(icon, active);
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
47
67
|
const phase = active ? "check" : "uncheck";
|
|
48
68
|
if (scope) {
|
|
49
69
|
const root = scope.getTarget("root");
|
|
@@ -71,7 +91,7 @@ function useSelectionIndicatorAnimation(active, fillRef, iconRef) {
|
|
|
71
91
|
killMotion(icon);
|
|
72
92
|
playSelectionMark(icon, active, config);
|
|
73
93
|
}
|
|
74
|
-
}
|
|
94
|
+
});
|
|
75
95
|
}
|
|
76
96
|
function SelectionIndicatorMotionSync({
|
|
77
97
|
selected,
|
|
@@ -81,7 +81,7 @@ function SelectionThumbShell({
|
|
|
81
81
|
rest
|
|
82
82
|
}) {
|
|
83
83
|
const scope = useSelectionThumbMotionScope();
|
|
84
|
-
const pointer = hasPointerPhases(rootMotion);
|
|
84
|
+
const pointer = hasPointerPhases(rootMotion ?? scope.getRootMotion()?.root);
|
|
85
85
|
const part = useMotionPart({
|
|
86
86
|
scope,
|
|
87
87
|
slot: "root",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export type { SeparatorOrientation, SeparatorProps, SeparatorMotion, SeparatorPartMotion, } from './separatorTypes.js';
|
|
1
|
+
export type { SeparatorClassNames, SeparatorOrientation, SeparatorProps, SeparatorMotion, SeparatorPartMotion, } from './separatorTypes.js';
|
|
2
2
|
export declare const Separator: import('react').ForwardRefExoticComponent<Omit<import('react').HTMLAttributes<HTMLElement>, "role"> & {
|
|
3
3
|
orientation?: import('./separatorTypes.js').SeparatorOrientation;
|
|
4
4
|
decorative?: boolean;
|
|
5
|
+
classNames?: import('../../../index.js').Prettify<import('./separatorTypes.js').SeparatorClassNames>;
|
|
5
6
|
motion?: import('../../../index.js').Prettify<import('../utils/slotMotion/index.js').MotionMapWithEvents<import('./separatorTypes.js').SeparatorMotion>>;
|
|
6
7
|
motionController?: import('../utils/slotMotion/index.js').MotionController;
|
|
7
8
|
} & import('../utils/slotMotion/index.js').MotionStateHostProps & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useMemo } from "react";
|
|
4
|
+
import { cn } from "../../../utils/cn.js";
|
|
4
5
|
import { separatorAriaOrientation } from "./separatorA11y.js";
|
|
5
6
|
import { resolveSeparatorMotionDefaults, useSeparatorRootMotion } from "./separatorAnimations.js";
|
|
6
7
|
import { SeparatorMotionProvider } from "./separatorContext.js";
|
|
@@ -9,6 +10,7 @@ const Separator = forwardRef(function Separator2({
|
|
|
9
10
|
orientation = "horizontal",
|
|
10
11
|
decorative = false,
|
|
11
12
|
className = "",
|
|
13
|
+
classNames,
|
|
12
14
|
motion,
|
|
13
15
|
motionController,
|
|
14
16
|
motionState,
|
|
@@ -35,7 +37,7 @@ const Separator = forwardRef(function Separator2({
|
|
|
35
37
|
{
|
|
36
38
|
orientation,
|
|
37
39
|
decorative,
|
|
38
|
-
className,
|
|
40
|
+
className: cn(classNames?.root, className),
|
|
39
41
|
forwardedRef: ref,
|
|
40
42
|
rootMotion: motion?.root,
|
|
41
43
|
onPointerOver,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Separator, type SeparatorProps, type SeparatorOrientation, type SeparatorMotion, type SeparatorPartMotion, } from './Separator.js';
|
|
1
|
+
export { Separator, type SeparatorClassNames, type SeparatorProps, type SeparatorOrientation, type SeparatorMotion, type SeparatorPartMotion, } from './Separator.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SeparatorOrientation } from './separatorTypes.js';
|
|
2
2
|
export declare const SEPARATOR_BASE_CLASS = "box-border shrink-0";
|
|
3
|
-
export declare const SEPARATOR_HORIZONTAL_CLASS = "
|
|
4
|
-
export declare const SEPARATOR_VERTICAL_CLASS = "
|
|
3
|
+
export declare const SEPARATOR_HORIZONTAL_CLASS = "h-0 w-full min-w-0 max-w-full border-t-token";
|
|
4
|
+
export declare const SEPARATOR_VERTICAL_CLASS = "min-h-[1.5rem] w-0 self-stretch border-s-token";
|
|
5
5
|
export declare function separatorRootClass(orientation: SeparatorOrientation, className?: string): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../../utils/cn.js";
|
|
2
2
|
const SEPARATOR_BASE_CLASS = "box-border shrink-0";
|
|
3
|
-
const SEPARATOR_HORIZONTAL_CLASS = "
|
|
4
|
-
const SEPARATOR_VERTICAL_CLASS = "
|
|
3
|
+
const SEPARATOR_HORIZONTAL_CLASS = "h-0 w-full min-w-0 max-w-full border-t-token";
|
|
4
|
+
const SEPARATOR_VERTICAL_CLASS = "min-h-[1.5rem] w-0 self-stretch border-s-token";
|
|
5
5
|
function separatorRootClass(orientation, className) {
|
|
6
6
|
return cn(
|
|
7
7
|
SEPARATOR_BASE_CLASS,
|
|
@@ -10,6 +10,9 @@ export type SeparatorPartMotion = {
|
|
|
10
10
|
enter?: MotionValue;
|
|
11
11
|
leave?: MotionValue;
|
|
12
12
|
};
|
|
13
|
+
export type SeparatorClassNames = {
|
|
14
|
+
root?: string;
|
|
15
|
+
};
|
|
13
16
|
export type SeparatorMotion = {
|
|
14
17
|
root?: SeparatorPartMotion;
|
|
15
18
|
};
|
|
@@ -20,6 +23,7 @@ export type SeparatorProps = Omit<HTMLAttributes<HTMLElement>, "role"> & {
|
|
|
20
23
|
* Omitted or `false` keeps separator semantics.
|
|
21
24
|
*/
|
|
22
25
|
decorative?: boolean;
|
|
26
|
+
classNames?: Prettify<SeparatorClassNames>;
|
|
23
27
|
/**
|
|
24
28
|
* Per-slot motion (`root`). Defaults are empty — custom factories are opt-in.
|
|
25
29
|
* `events` — namespaced app commands for `MotionController.play` (not a DOM slot).
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useMemo, useEffect } from "react";
|
|
4
|
+
import { useSkinVariant, useSkinRegistryRevision } from "../../../skins/skinContext.js";
|
|
4
5
|
import { resolveSidebarMotionDefaults, useSidebarRootMotion } from "./sidebarAnimations.js";
|
|
5
6
|
import { SidebarMotionProvider } from "./sidebarContext.js";
|
|
6
7
|
import { sidebarRootClass } from "./sidebarStyles.js";
|
|
@@ -21,7 +22,11 @@ const Sidebar = forwardRef(function Sidebar2({
|
|
|
21
22
|
onPointerUp,
|
|
22
23
|
...rest
|
|
23
24
|
}, ref) {
|
|
24
|
-
const
|
|
25
|
+
const skinVariant = useSkinVariant(void 0);
|
|
26
|
+
const skinRevision = useSkinRegistryRevision();
|
|
27
|
+
const motionDefaults = useMemo(() => {
|
|
28
|
+
return resolveSidebarMotionDefaults(skinVariant);
|
|
29
|
+
}, [skinRevision, skinVariant]);
|
|
25
30
|
return /* @__PURE__ */ jsx(
|
|
26
31
|
SidebarMotionProvider,
|
|
27
32
|
{
|
|
@@ -36,6 +41,7 @@ const Sidebar = forwardRef(function Sidebar2({
|
|
|
36
41
|
{
|
|
37
42
|
width,
|
|
38
43
|
side,
|
|
44
|
+
variant: skinVariant,
|
|
39
45
|
className,
|
|
40
46
|
classNames,
|
|
41
47
|
forwardedRef: ref,
|
|
@@ -54,6 +60,7 @@ const Sidebar = forwardRef(function Sidebar2({
|
|
|
54
60
|
function SidebarSurface({
|
|
55
61
|
width,
|
|
56
62
|
side,
|
|
63
|
+
variant,
|
|
57
64
|
className,
|
|
58
65
|
classNames,
|
|
59
66
|
children,
|
|
@@ -84,7 +91,13 @@ function SidebarSurface({
|
|
|
84
91
|
"aside",
|
|
85
92
|
{
|
|
86
93
|
ref: part.setRef,
|
|
87
|
-
className: sidebarRootClass({
|
|
94
|
+
className: sidebarRootClass({
|
|
95
|
+
width,
|
|
96
|
+
side,
|
|
97
|
+
variant,
|
|
98
|
+
slotClass: classNames?.root,
|
|
99
|
+
className
|
|
100
|
+
}),
|
|
88
101
|
...rest,
|
|
89
102
|
...part.pointerHandlers,
|
|
90
103
|
"data-side": side,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ForwardedRef, PointerEvent as ReactPointerEvent } from 'react';
|
|
2
|
-
import { SidebarPartMotion } from './sidebarTypes.js';
|
|
3
|
-
export declare function resolveSidebarMotionDefaults():
|
|
2
|
+
import { SidebarMotion, SidebarPartMotion } from './sidebarTypes.js';
|
|
3
|
+
export declare function resolveSidebarMotionDefaults(variant?: string): SidebarMotion;
|
|
4
4
|
export declare function useSidebarRootMotion({ forwardedRef, motion, onPointerOver, onPointerOut, onPointerDown, onPointerUp, }: {
|
|
5
5
|
forwardedRef?: ForwardedRef<HTMLElement>;
|
|
6
6
|
motion?: SidebarPartMotion;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { overlaySkinMotion } from "../../../skins/resolveVariantVisual.js";
|
|
1
2
|
import { useSidebarMotionScope } from "./sidebarContext.js";
|
|
2
3
|
import { hasPointerPhases, useOptionalEnterOnMount } from "../utils/slotMotion/useSlotLifecycle.js";
|
|
3
4
|
import { useMotionPart } from "../utils/slotMotion/useMotionPart.js";
|
|
4
|
-
function resolveSidebarMotionDefaults() {
|
|
5
|
-
return {};
|
|
5
|
+
function resolveSidebarMotionDefaults(variant = "default") {
|
|
6
|
+
return overlaySkinMotion({}, variant, ["default"], "sidebar");
|
|
6
7
|
}
|
|
7
8
|
function useSidebarRootMotion({
|
|
8
9
|
forwardedRef,
|
|
@@ -13,7 +14,7 @@ function useSidebarRootMotion({
|
|
|
13
14
|
onPointerUp
|
|
14
15
|
}) {
|
|
15
16
|
const scope = useSidebarMotionScope();
|
|
16
|
-
const pointer = hasPointerPhases(motion);
|
|
17
|
+
const pointer = hasPointerPhases(motion) || hasPointerPhases(scope.getRootMotion()?.root) || hasPointerPhases(scope.getDefaults()?.root);
|
|
17
18
|
const part = useMotionPart({
|
|
18
19
|
scope,
|
|
19
20
|
slot: "root",
|
|
@@ -13,9 +13,10 @@ export declare const SIDEBAR_EDGE_CLASS: {
|
|
|
13
13
|
readonly start: "border-e-token";
|
|
14
14
|
readonly end: "border-s-token";
|
|
15
15
|
};
|
|
16
|
-
export declare function sidebarRootClass({ width, side, slotClass, className, }: {
|
|
16
|
+
export declare function sidebarRootClass({ width, side, variant, slotClass, className, }: {
|
|
17
17
|
width: SidebarWidth;
|
|
18
18
|
side: SidebarSide;
|
|
19
|
+
variant?: string;
|
|
19
20
|
slotClass?: string;
|
|
20
21
|
className?: string;
|
|
21
22
|
}): string;
|
|
@@ -17,6 +17,7 @@ const SIDEBAR_EDGE_CLASS = {
|
|
|
17
17
|
function sidebarRootClass({
|
|
18
18
|
width,
|
|
19
19
|
side,
|
|
20
|
+
variant = "default",
|
|
20
21
|
slotClass,
|
|
21
22
|
className
|
|
22
23
|
}) {
|
|
@@ -24,7 +25,7 @@ function sidebarRootClass({
|
|
|
24
25
|
SIDEBAR_BASE_CLASS,
|
|
25
26
|
SIDEBAR_WIDTH_CLASS[width],
|
|
26
27
|
SIDEBAR_EDGE_CLASS[side],
|
|
27
|
-
layoutTargetClass("sidebar.root"),
|
|
28
|
+
layoutTargetClass("sidebar.root", variant),
|
|
28
29
|
slotClass,
|
|
29
30
|
className
|
|
30
31
|
);
|
|
@@ -4,7 +4,7 @@ import { forwardRef, useMemo } from "react";
|
|
|
4
4
|
import { skeletonRegionA11yProps, skeletonPresentationProps } from "./skeletonA11y.js";
|
|
5
5
|
import { resolveSkeletonMotionDefaults, useSkeletonSlotMotion } from "./skeletonAnimations.js";
|
|
6
6
|
import { SkeletonMotionProvider, useSkeletonMotionScope } from "./skeletonContext.js";
|
|
7
|
-
import { SKELETON_CIRCLE_SIZE_DEFAULT, SKELETON_BLOCK_CLASS, skeletonVariantClass, SKELETON_BASE_CLASS, SKELETON_TEXT_LINE_LAST_SHORT_CLASS, SKELETON_TEXT_LINE_FULL_CLASS, skeletonLineAnimationDelay, SKELETON_TEXT_LINE_CLASS, SKELETON_TEXT_ROOT_CLASS, SKELETON_CIRCLE_RADIUS_CLASS, SKELETON_WAVE_OVERLAY_CLASS } from "./skeletonStyles.js";
|
|
7
|
+
import { SKELETON_CIRCLE_SIZE_DEFAULT, SKELETON_BLOCK_CLASS, skeletonVariantClass, SKELETON_BASE_CLASS, SKELETON_TEXT_LINE_LAST_SHORT_CLASS, SKELETON_TEXT_LINE_FULL_CLASS, skeletonLineAnimationDelay, SKELETON_TEXT_LINE_CLASS, SKELETON_TEXT_ROOT_CLASS, resolveSkeletonCircleSize, SKELETON_CIRCLE_RADIUS_CLASS, SKELETON_WAVE_OVERLAY_CLASS } from "./skeletonStyles.js";
|
|
8
8
|
import { dataVariantProps } from "../utils/dataContract.js";
|
|
9
9
|
import { cn } from "../../../utils/cn.js";
|
|
10
10
|
function SkeletonWave({ className, style }) {
|
|
@@ -99,6 +99,7 @@ function SkeletonCircleSurface({
|
|
|
99
99
|
onPointerDown,
|
|
100
100
|
onPointerUp
|
|
101
101
|
});
|
|
102
|
+
const { sizeClass, dataSize } = resolveSkeletonCircleSize(size);
|
|
102
103
|
return /* @__PURE__ */ jsx(
|
|
103
104
|
"div",
|
|
104
105
|
{
|
|
@@ -107,7 +108,7 @@ function SkeletonCircleSurface({
|
|
|
107
108
|
SKELETON_BASE_CLASS,
|
|
108
109
|
skeletonVariantClass(animation),
|
|
109
110
|
SKELETON_CIRCLE_RADIUS_CLASS,
|
|
110
|
-
|
|
111
|
+
sizeClass,
|
|
111
112
|
classNames?.root,
|
|
112
113
|
className
|
|
113
114
|
),
|
|
@@ -115,7 +116,7 @@ function SkeletonCircleSurface({
|
|
|
115
116
|
...skeletonPresentationProps(),
|
|
116
117
|
...domRest,
|
|
117
118
|
...part.pointerHandlers,
|
|
118
|
-
...dataVariantProps({ size }),
|
|
119
|
+
...dataVariantProps({ size: dataSize }),
|
|
119
120
|
children: animation === "wave" ? /* @__PURE__ */ jsx(SkeletonWave, { className: classNames?.wave }) : null
|
|
120
121
|
}
|
|
121
122
|
);
|
|
@@ -182,8 +183,9 @@ function SkeletonTextSurface({
|
|
|
182
183
|
onPointerDown,
|
|
183
184
|
onPointerUp
|
|
184
185
|
});
|
|
185
|
-
const
|
|
186
|
-
|
|
186
|
+
const safeLines = Number.isFinite(lines) && lines > 0 ? Math.floor(lines) : 0;
|
|
187
|
+
const lineWidths = Array.from({ length: safeLines }, (_, index) => {
|
|
188
|
+
if (lastShort && index === safeLines - 1) return SKELETON_TEXT_LINE_LAST_SHORT_CLASS;
|
|
187
189
|
return SKELETON_TEXT_LINE_FULL_CLASS;
|
|
188
190
|
});
|
|
189
191
|
return /* @__PURE__ */ jsx(
|
|
@@ -337,6 +339,7 @@ function SkeletonRegionSurface({
|
|
|
337
339
|
...skeletonRegionA11yProps(busy),
|
|
338
340
|
...domRest,
|
|
339
341
|
...part.pointerHandlers,
|
|
342
|
+
"data-state": busy ? "loading" : "idle",
|
|
340
343
|
children
|
|
341
344
|
}
|
|
342
345
|
);
|
|
@@ -4,6 +4,16 @@ export declare const SKELETON_BASE_CLASS = "relative overflow-hidden bg-primary-
|
|
|
4
4
|
export declare const SKELETON_WAVE_OVERLAY_CLASS = "pointer-events-none absolute inset-0 -translate-x-full skeleton-animate skeleton-wave";
|
|
5
5
|
export declare const SKELETON_CIRCLE_RADIUS_CLASS = "rounded-full";
|
|
6
6
|
export declare const SKELETON_CIRCLE_SIZE_DEFAULT = "min-h-control-base w-control-base";
|
|
7
|
+
export declare const SKELETON_CIRCLE_SIZE_TOKENS: {
|
|
8
|
+
readonly small: "min-h-control-small w-control-small";
|
|
9
|
+
readonly base: "min-h-control-base w-control-base";
|
|
10
|
+
readonly mid: "min-h-control-mid w-control-mid";
|
|
11
|
+
readonly large: "min-h-control-large w-control-large";
|
|
12
|
+
};
|
|
13
|
+
export declare function resolveSkeletonCircleSize(size: string): {
|
|
14
|
+
sizeClass: string;
|
|
15
|
+
dataSize?: string;
|
|
16
|
+
};
|
|
7
17
|
export declare const SKELETON_TEXT_ROOT_CLASS = "flex flex-col gap-small";
|
|
8
18
|
export declare const SKELETON_TEXT_LINE_CLASS = "h-[1em] rounded-small";
|
|
9
19
|
export declare const SKELETON_TEXT_LINE_LAST_SHORT_CLASS = "w-3/5";
|
|
@@ -2,6 +2,24 @@ const SKELETON_BASE_CLASS = "relative overflow-hidden bg-primary-tint skeleton-a
|
|
|
2
2
|
const SKELETON_WAVE_OVERLAY_CLASS = "pointer-events-none absolute inset-0 -translate-x-full skeleton-animate skeleton-wave";
|
|
3
3
|
const SKELETON_CIRCLE_RADIUS_CLASS = "rounded-full";
|
|
4
4
|
const SKELETON_CIRCLE_SIZE_DEFAULT = "min-h-control-base w-control-base";
|
|
5
|
+
const SKELETON_CIRCLE_SIZE_TOKENS = {
|
|
6
|
+
small: "min-h-control-small w-control-small",
|
|
7
|
+
base: SKELETON_CIRCLE_SIZE_DEFAULT,
|
|
8
|
+
mid: "min-h-control-mid w-control-mid",
|
|
9
|
+
large: "min-h-control-large w-control-large"
|
|
10
|
+
};
|
|
11
|
+
function resolveSkeletonCircleSize(size) {
|
|
12
|
+
if (size in SKELETON_CIRCLE_SIZE_TOKENS) {
|
|
13
|
+
return {
|
|
14
|
+
sizeClass: SKELETON_CIRCLE_SIZE_TOKENS[size],
|
|
15
|
+
dataSize: size
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
if (size === SKELETON_CIRCLE_SIZE_DEFAULT) {
|
|
19
|
+
return { sizeClass: size, dataSize: "base" };
|
|
20
|
+
}
|
|
21
|
+
return { sizeClass: size, dataSize: void 0 };
|
|
22
|
+
}
|
|
5
23
|
const SKELETON_TEXT_ROOT_CLASS = "flex flex-col gap-small";
|
|
6
24
|
const SKELETON_TEXT_LINE_CLASS = "h-[1em] rounded-small";
|
|
7
25
|
const SKELETON_TEXT_LINE_LAST_SHORT_CLASS = "w-3/5";
|
|
@@ -29,12 +47,14 @@ export {
|
|
|
29
47
|
SKELETON_BLOCK_CLASS,
|
|
30
48
|
SKELETON_CIRCLE_RADIUS_CLASS,
|
|
31
49
|
SKELETON_CIRCLE_SIZE_DEFAULT,
|
|
50
|
+
SKELETON_CIRCLE_SIZE_TOKENS,
|
|
32
51
|
SKELETON_RADIUS_CLASS,
|
|
33
52
|
SKELETON_TEXT_LINE_CLASS,
|
|
34
53
|
SKELETON_TEXT_LINE_FULL_CLASS,
|
|
35
54
|
SKELETON_TEXT_LINE_LAST_SHORT_CLASS,
|
|
36
55
|
SKELETON_TEXT_ROOT_CLASS,
|
|
37
56
|
SKELETON_WAVE_OVERLAY_CLASS,
|
|
57
|
+
resolveSkeletonCircleSize,
|
|
38
58
|
skeletonLineAnimationDelay,
|
|
39
59
|
skeletonRadiusClass,
|
|
40
60
|
skeletonVariantClass
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useRef, useMemo } from "react";
|
|
4
4
|
import { Field } from "../Field/index.js";
|
|
5
|
-
import { dataVariantProps } from "../utils/dataContract.js";
|
|
5
|
+
import { dataFlag, dataVariantProps } from "../utils/dataContract.js";
|
|
6
6
|
import { useFieldControlFocus, FieldHiddenValues, readOnlyData } from "../utils/fieldFormDom.js";
|
|
7
7
|
import { mergeRefs } from "../utils/mergeRefs.js";
|
|
8
8
|
import { useSkinVariant, useSkinRegistryRevision } from "../../../skins/skinContext.js";
|
|
@@ -101,8 +101,11 @@ const SliderRoot = forwardRef(function SliderRoot2({
|
|
|
101
101
|
const resolvedVariant = useSkinVariant(variant);
|
|
102
102
|
const skinRevision = useSkinRegistryRevision();
|
|
103
103
|
const motionDefaults = useMemo(() => {
|
|
104
|
-
return resolveSliderMotionDefaults({
|
|
105
|
-
|
|
104
|
+
return resolveSliderMotionDefaults({
|
|
105
|
+
disabled: state.disabled || state.readOnly,
|
|
106
|
+
variant
|
|
107
|
+
});
|
|
108
|
+
}, [skinRevision, state.disabled, state.readOnly, variant]);
|
|
106
109
|
return /* @__PURE__ */ jsx(SliderFieldProvider, { value: state.fieldCtx, children: /* @__PURE__ */ jsx(SliderClassNamesProvider, { classNames, children: /* @__PURE__ */ jsx(
|
|
107
110
|
SliderMotionProvider,
|
|
108
111
|
{
|
|
@@ -116,6 +119,7 @@ const SliderRoot = forwardRef(function SliderRoot2({
|
|
|
116
119
|
Field,
|
|
117
120
|
{
|
|
118
121
|
id: state.sliderId,
|
|
122
|
+
invalid: state.fieldCtx.isInvalid,
|
|
119
123
|
className: sliderRootClass({
|
|
120
124
|
orientation: state.fieldCtx.orientation,
|
|
121
125
|
slotClass: classNames?.root,
|
|
@@ -125,7 +129,9 @@ const SliderRoot = forwardRef(function SliderRoot2({
|
|
|
125
129
|
ref: mergeRefs(ref, focusRef),
|
|
126
130
|
...dataVariantProps({ size: size ?? "base", variant: resolvedVariant }),
|
|
127
131
|
"data-orientation": state.fieldCtx.orientation,
|
|
132
|
+
"data-disabled": dataFlag(state.disabled),
|
|
128
133
|
"data-readonly": readOnlyData(state.readOnly),
|
|
134
|
+
"data-invalid": dataFlag(state.fieldCtx.isInvalid),
|
|
129
135
|
children: [
|
|
130
136
|
body,
|
|
131
137
|
/* @__PURE__ */ jsx(
|
|
@@ -19,13 +19,15 @@ export declare function sliderExplicitNames(ariaLabel: unknown, ariaLabelledBy:
|
|
|
19
19
|
labelledBy: string | undefined;
|
|
20
20
|
};
|
|
21
21
|
export declare function clampSliderValue(n: number, lo: number, hi: number): number;
|
|
22
|
+
export declare function sliderDecimalPlaces(n: number): number;
|
|
23
|
+
export declare function roundSliderFloat(n: number, decimals: number): number;
|
|
22
24
|
export declare function sliderValueToPercent(value: number, min: number, max: number): number;
|
|
23
25
|
export declare function sliderValueToRatio(value: number, min: number, max: number): number;
|
|
24
26
|
export declare function sliderThumbCenterPercent(value: number, min: number, max: number, trackPx: number, thumbPx: number): number;
|
|
25
27
|
export declare function sliderThumbCenterPx(value: number, min: number, max: number, trackPx: number, thumbPx: number): number;
|
|
26
28
|
export declare function sliderFillSpanForValues(trackPx: number, thumbPx: number, min: number, max: number, range: boolean, singleValue: number, rangeValue: [number, number]): FillSpan;
|
|
27
29
|
export declare function sliderFillStyleFromSpan(span: FillSpan, orientation: SliderOrientation): {
|
|
28
|
-
|
|
30
|
+
insetInlineStart?: string;
|
|
29
31
|
width?: string;
|
|
30
32
|
bottom?: string;
|
|
31
33
|
height?: string;
|
|
@@ -33,9 +35,9 @@ export declare function sliderFillStyleFromSpan(span: FillSpan, orientation: Sli
|
|
|
33
35
|
export declare function snapSliderToStep(value: number, min: number, max: number, step: number): number;
|
|
34
36
|
export declare function snapSliderToMarks(value: number, marks: number[]): number;
|
|
35
37
|
export declare function normalizeSliderMarks(marks: number[] | undefined, min: number, max: number): number[] | undefined;
|
|
36
|
-
export declare function sliderPointerToValue(clientX: number, clientY: number, rect: DOMRect, orientation: SliderOrientation, min: number, max: number, thumbPx: number): number;
|
|
38
|
+
export declare function sliderPointerToValue(clientX: number, clientY: number, rect: DOMRect, orientation: SliderOrientation, min: number, max: number, thumbPx: number, rtl?: boolean): number;
|
|
37
39
|
export declare function sliderAdjacentMark(value: number, marks: number[], direction: 1 | -1): number;
|
|
38
|
-
export declare function sliderStepDelta(marks: number[] | undefined, step: number, key: string, orientation: SliderOrientation): number | "home" | "end" | "mark-prev" | "mark-next";
|
|
40
|
+
export declare function sliderStepDelta(marks: number[] | undefined, step: number, key: string, orientation: SliderOrientation, rtl?: boolean): number | "home" | "end" | "mark-prev" | "mark-next";
|
|
39
41
|
export declare function commitSliderSingle(next: number, current: number, snap: (raw: number) => number, set: (value: number) => void, onChange: ((value: number) => void) | undefined, remember: (value: number) => void): void;
|
|
40
42
|
export declare function commitSliderRange(next: [number, number], current: [number, number], snap: (raw: number) => number, set: (value: [number, number]) => void, onChange: ((value: [number, number]) => void) | undefined, remember: (value: [number, number]) => void): void;
|
|
41
43
|
export declare function applySliderPointer(args: {
|
|
@@ -55,7 +57,6 @@ export declare function applySliderPointer(args: {
|
|
|
55
57
|
snap: (raw: number) => number;
|
|
56
58
|
emitRange: (next: [number, number]) => void;
|
|
57
59
|
emitSingle: (next: number) => void;
|
|
58
|
-
syncFill: (nextSingle?: number, nextRange?: [number, number]) => void;
|
|
59
60
|
}): void;
|
|
60
61
|
export declare function applySliderThumbKey(args: {
|
|
61
62
|
action: number | "home" | "end" | "mark-prev" | "mark-next";
|