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,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useState, useCallback } from "react";
|
|
4
|
-
import { dataVariantProps } from "../utils/dataContract.js";
|
|
4
|
+
import { dataFlag, dataVariantProps } from "../utils/dataContract.js";
|
|
5
5
|
import { Field } from "../Field/index.js";
|
|
6
6
|
import { Popover } from "../Popover/index.js";
|
|
7
7
|
import { POPOVER_DEFAULT_OFFSET } from "../Popover/popoverStyles.js";
|
|
8
8
|
import { FIELD_CONTROL_MOBILE_NO_ZOOM_CLASS } from "../utils/fieldControlMobileNoZoom.js";
|
|
9
|
-
import { mergeForwardedRef } from "../utils/mergeRefs.js";
|
|
9
|
+
import { mergeForwardedRef, mergeRefs } from "../utils/mergeRefs.js";
|
|
10
10
|
import { useBurneLabels } from "../../../theme/BurneLabelsProvider.js";
|
|
11
11
|
import { colorPickerAlphaInputAriaLabel, colorPickerHexInputAriaLabel, colorPickerAreaValueText, colorPickerAreaAriaLabel, colorPickerContentAriaLabel, colorPickerTriggerAriaLabel } from "./colorPickerA11y.js";
|
|
12
12
|
import { useColorPickerSlotMotion, useColorPickerAreaDrag, useColorPickerAreaChange } from "./colorPickerAnimations.js";
|
|
13
13
|
import { COLOR_PICKER_SWATCH_SIZE_MAP, COLOR_PICKER_SLIDER_SIZE_MAP } from "./colorPickerAPI.js";
|
|
14
14
|
import { useColorPicker, useColorPickerClassNames, useOptionalColorPickerMotionScope } from "./colorPickerContext.js";
|
|
15
|
-
import { COLOR_PICKER_PRESETS_CLASS, COLOR_PICKER_ALPHA_FIELD_CLASS, COLOR_PICKER_ALPHA_SUFFIX_CLASS, COLOR_PICKER_ALPHA_INPUT_CLASS, COLOR_PICKER_HEX_PREFIX_CLASS, COLOR_PICKER_HEX_FIELD_CLASS, COLOR_PICKER_HEX_INPUT_CLASS, COLOR_PICKER_PREVIEW_SWATCH_CLASS, COLOR_PICKER_PREVIEW_WRAP_CLASS, COLOR_PICKER_AREA_THUMB_CLASS, colorPickerAreaClass, colorPickerContentPanelClass, COLOR_PICKER_SLIDERS_STACK_CLASS, COLOR_PICKER_SLIDERS_ROW_CLASS, COLOR_PICKER_INPUTS_ROW_CLASS } from "./colorPickerStyles.js";
|
|
15
|
+
import { COLOR_PICKER_PRESETS_CLASS, COLOR_PICKER_ALPHA_FIELD_CLASS, COLOR_PICKER_ALPHA_SUFFIX_CLASS, COLOR_PICKER_INPUT_DISABLED_CLASS, COLOR_PICKER_ALPHA_INPUT_CLASS, COLOR_PICKER_HEX_PREFIX_CLASS, COLOR_PICKER_HEX_FIELD_CLASS, COLOR_PICKER_HEX_INPUT_CLASS, COLOR_PICKER_PREVIEW_SWATCH_CLASS, COLOR_PICKER_PREVIEW_WRAP_CLASS, COLOR_PICKER_AREA_THUMB_CLASS, colorPickerAreaClass, colorPickerContentPanelClass, COLOR_PICKER_SLIDERS_STACK_CLASS, COLOR_PICKER_SLIDERS_ROW_CLASS, COLOR_PICKER_INPUTS_ROW_CLASS } from "./colorPickerStyles.js";
|
|
16
16
|
import { ColorSliderTrack } from "./ColorSlider.js";
|
|
17
17
|
import { ColorSwatch } from "./ColorSwatch.js";
|
|
18
18
|
import { hexToHsva, clampN, hueToRgbString, hsvaToColorString } from "./colorUtils.js";
|
|
@@ -29,9 +29,9 @@ const ColorPickerArea = forwardRef(
|
|
|
29
29
|
...rest
|
|
30
30
|
}, ref) {
|
|
31
31
|
const labels = useBurneLabels();
|
|
32
|
-
const { hsva, setHsva, hex, size } = useColorPicker();
|
|
32
|
+
const { hsva, setHsva, hex, size, disabled, readOnly } = useColorPicker();
|
|
33
33
|
const slotClassNames = useColorPickerClassNames();
|
|
34
|
-
const { areaRef, thumbRef, handlePointerDown, handleThumbKeyDown } = useColorPickerAreaDrag({ hsva, setHsva });
|
|
34
|
+
const { areaRef, thumbRef, handlePointerDown, handleThumbKeyDown } = useColorPickerAreaDrag({ hsva, setHsva, disabled, readOnly });
|
|
35
35
|
const areaPart = useColorPickerSlotMotion("area", {
|
|
36
36
|
motion,
|
|
37
37
|
playEnter: false,
|
|
@@ -47,20 +47,22 @@ const ColorPickerArea = forwardRef(
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
useColorPickerAreaChange(hex);
|
|
50
|
+
const { setRef: setAreaPartRef } = areaPart;
|
|
51
|
+
const { setRef: setThumbPartRef } = thumbPart;
|
|
50
52
|
const setRefs = useCallback(
|
|
51
53
|
(node) => {
|
|
52
54
|
areaRef.current = node;
|
|
53
|
-
|
|
55
|
+
setAreaPartRef(node);
|
|
54
56
|
mergeForwardedRef(ref, node);
|
|
55
57
|
},
|
|
56
|
-
[
|
|
58
|
+
[areaRef, ref, setAreaPartRef]
|
|
57
59
|
);
|
|
58
60
|
const setThumbRef = useCallback(
|
|
59
61
|
(node) => {
|
|
60
62
|
thumbRef.current = node;
|
|
61
|
-
|
|
63
|
+
setThumbPartRef(node);
|
|
62
64
|
},
|
|
63
|
-
[
|
|
65
|
+
[setThumbPartRef, thumbRef]
|
|
64
66
|
);
|
|
65
67
|
const hueColor = hueToRgbString(hsva.h);
|
|
66
68
|
const thumbColor = hsvaToColorString(hsva);
|
|
@@ -69,9 +71,11 @@ const ColorPickerArea = forwardRef(
|
|
|
69
71
|
{
|
|
70
72
|
ref: setRefs,
|
|
71
73
|
role: "group",
|
|
74
|
+
"aria-disabled": disabled || void 0,
|
|
72
75
|
className: colorPickerAreaClass(
|
|
73
76
|
size,
|
|
74
|
-
cn(slotClassNames.area, className)
|
|
77
|
+
cn(slotClassNames.area, className),
|
|
78
|
+
{ disabled, readOnly }
|
|
75
79
|
),
|
|
76
80
|
style: {
|
|
77
81
|
/* HSV area physics: fixed #000/#fff endpoints (not theme tokens). */
|
|
@@ -84,13 +88,17 @@ const ColorPickerArea = forwardRef(
|
|
|
84
88
|
areaPart.pointerHandlers.onPointerDown?.(e);
|
|
85
89
|
if (!e.defaultPrevented) handlePointerDown(e);
|
|
86
90
|
},
|
|
91
|
+
"data-disabled": dataFlag(disabled),
|
|
92
|
+
"data-readonly": dataFlag(readOnly),
|
|
87
93
|
children: /* @__PURE__ */ jsx(
|
|
88
94
|
"button",
|
|
89
95
|
{
|
|
90
96
|
ref: setThumbRef,
|
|
91
97
|
type: "button",
|
|
92
98
|
role: "slider",
|
|
93
|
-
|
|
99
|
+
disabled,
|
|
100
|
+
tabIndex: disabled ? -1 : 0,
|
|
101
|
+
"aria-readonly": readOnly || void 0,
|
|
94
102
|
"aria-label": colorPickerAreaAriaLabel(labels.colorPickerArea),
|
|
95
103
|
"aria-valuemin": 0,
|
|
96
104
|
"aria-valuemax": 100,
|
|
@@ -114,7 +122,9 @@ const ColorPickerArea = forwardRef(
|
|
|
114
122
|
onPointerDown: (e) => {
|
|
115
123
|
thumbPart.pointerHandlers.onPointerDown?.(e);
|
|
116
124
|
if (!e.defaultPrevented) handlePointerDown(e);
|
|
117
|
-
}
|
|
125
|
+
},
|
|
126
|
+
"data-disabled": dataFlag(disabled),
|
|
127
|
+
"data-readonly": dataFlag(readOnly)
|
|
118
128
|
}
|
|
119
129
|
)
|
|
120
130
|
}
|
|
@@ -133,7 +143,8 @@ const ColorPickerHexInput = forwardRef(
|
|
|
133
143
|
...rest
|
|
134
144
|
}, ref) {
|
|
135
145
|
const labels = useBurneLabels();
|
|
136
|
-
const { hex, setHsva } = useColorPicker();
|
|
146
|
+
const { hex, setHsva, disabled, readOnly } = useColorPicker();
|
|
147
|
+
const blocked = disabled || readOnly;
|
|
137
148
|
const slotClassNames = useColorPickerClassNames();
|
|
138
149
|
const part = useColorPickerSlotMotion("hexInput", {
|
|
139
150
|
motion,
|
|
@@ -147,24 +158,28 @@ const ColorPickerHexInput = forwardRef(
|
|
|
147
158
|
const [editDraft, setEditDraft] = useState("");
|
|
148
159
|
const commit = useCallback(
|
|
149
160
|
(draft) => {
|
|
161
|
+
if (blocked) return;
|
|
150
162
|
const candidate = `#${draft}`;
|
|
151
163
|
const parsed = hexToHsva(candidate);
|
|
152
164
|
if (parsed) setHsva(parsed);
|
|
153
165
|
},
|
|
154
|
-
[setHsva]
|
|
166
|
+
[blocked, setHsva]
|
|
155
167
|
);
|
|
156
|
-
const displayValue = isEditing ? editDraft : hex.slice(1);
|
|
168
|
+
const displayValue = isEditing && !blocked ? editDraft : hex.slice(1);
|
|
157
169
|
return /* @__PURE__ */ jsxs(
|
|
158
170
|
"div",
|
|
159
171
|
{
|
|
160
172
|
ref: part.setRef,
|
|
161
173
|
className: cn(
|
|
162
174
|
COLOR_PICKER_HEX_INPUT_CLASS,
|
|
175
|
+
disabled && COLOR_PICKER_INPUT_DISABLED_CLASS,
|
|
163
176
|
slotClassNames.hexInput,
|
|
164
177
|
className
|
|
165
178
|
),
|
|
166
179
|
...rest,
|
|
167
180
|
...part.pointerHandlers,
|
|
181
|
+
"data-disabled": dataFlag(disabled),
|
|
182
|
+
"data-readonly": dataFlag(readOnly),
|
|
168
183
|
children: [
|
|
169
184
|
/* @__PURE__ */ jsx(
|
|
170
185
|
"span",
|
|
@@ -182,6 +197,8 @@ const ColorPickerHexInput = forwardRef(
|
|
|
182
197
|
type: "text",
|
|
183
198
|
value: displayValue,
|
|
184
199
|
maxLength: 8,
|
|
200
|
+
disabled,
|
|
201
|
+
readOnly,
|
|
185
202
|
spellCheck: false,
|
|
186
203
|
"aria-label": colorPickerHexInputAriaLabel(labels.colorPickerHex),
|
|
187
204
|
className: cn(
|
|
@@ -190,20 +207,26 @@ const ColorPickerHexInput = forwardRef(
|
|
|
190
207
|
FIELD_CONTROL_MOBILE_NO_ZOOM_CLASS
|
|
191
208
|
),
|
|
192
209
|
onFocus: () => {
|
|
210
|
+
if (blocked) return;
|
|
193
211
|
setIsEditing(true);
|
|
194
212
|
setEditDraft(hex.slice(1));
|
|
195
213
|
},
|
|
196
|
-
onChange: (e) =>
|
|
214
|
+
onChange: (e) => {
|
|
215
|
+
if (blocked) return;
|
|
216
|
+
setEditDraft(e.target.value.replace(/[^0-9a-fA-F]/g, "").toUpperCase());
|
|
217
|
+
},
|
|
197
218
|
onBlur: () => {
|
|
198
|
-
commit(editDraft);
|
|
219
|
+
if (!blocked) commit(editDraft);
|
|
199
220
|
setIsEditing(false);
|
|
200
221
|
},
|
|
201
222
|
onKeyDown: (e) => {
|
|
202
223
|
if (e.key === "Enter") {
|
|
203
|
-
commit(editDraft);
|
|
224
|
+
if (!blocked) commit(editDraft);
|
|
204
225
|
setIsEditing(false);
|
|
205
226
|
}
|
|
206
|
-
}
|
|
227
|
+
},
|
|
228
|
+
"data-disabled": dataFlag(disabled),
|
|
229
|
+
"data-readonly": dataFlag(readOnly)
|
|
207
230
|
}
|
|
208
231
|
)
|
|
209
232
|
]
|
|
@@ -223,7 +246,8 @@ const ColorPickerAlphaInput = forwardRef(
|
|
|
223
246
|
...rest
|
|
224
247
|
}, ref) {
|
|
225
248
|
const labels = useBurneLabels();
|
|
226
|
-
const { hsva, setHsva } = useColorPicker();
|
|
249
|
+
const { hsva, setHsva, disabled, readOnly } = useColorPicker();
|
|
250
|
+
const blocked = disabled || readOnly;
|
|
227
251
|
const slotClassNames = useColorPickerClassNames();
|
|
228
252
|
const part = useColorPickerSlotMotion("alphaInput", {
|
|
229
253
|
motion,
|
|
@@ -233,33 +257,77 @@ const ColorPickerAlphaInput = forwardRef(
|
|
|
233
257
|
onPointerDown,
|
|
234
258
|
onPointerUp
|
|
235
259
|
});
|
|
260
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
261
|
+
const [editDraft, setEditDraft] = useState("");
|
|
262
|
+
const commitAlpha = useCallback(
|
|
263
|
+
(draft) => {
|
|
264
|
+
if (blocked || draft === "") return;
|
|
265
|
+
const n = parseInt(draft, 10);
|
|
266
|
+
if (!Number.isNaN(n)) {
|
|
267
|
+
setHsva({ ...hsva, a: clampN(n, 0, 100) });
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
[blocked, hsva, setHsva]
|
|
271
|
+
);
|
|
272
|
+
const displayValue = isEditing && !blocked ? editDraft : String(Math.round(hsva.a));
|
|
236
273
|
return /* @__PURE__ */ jsxs(
|
|
237
274
|
"div",
|
|
238
275
|
{
|
|
239
276
|
ref: part.setRef,
|
|
240
277
|
className: cn(
|
|
241
278
|
COLOR_PICKER_ALPHA_INPUT_CLASS,
|
|
279
|
+
disabled && COLOR_PICKER_INPUT_DISABLED_CLASS,
|
|
242
280
|
slotClassNames.alphaInput,
|
|
243
281
|
className
|
|
244
282
|
),
|
|
245
283
|
...rest,
|
|
246
284
|
...part.pointerHandlers,
|
|
285
|
+
"data-disabled": dataFlag(disabled),
|
|
286
|
+
"data-readonly": dataFlag(readOnly),
|
|
247
287
|
children: [
|
|
248
288
|
/* @__PURE__ */ jsx(
|
|
249
289
|
"input",
|
|
250
290
|
{
|
|
251
291
|
type: "text",
|
|
252
|
-
|
|
292
|
+
inputMode: "numeric",
|
|
293
|
+
maxLength: 3,
|
|
294
|
+
disabled,
|
|
295
|
+
readOnly,
|
|
296
|
+
value: displayValue,
|
|
253
297
|
"aria-label": colorPickerAlphaInputAriaLabel(labels.colorPickerAlpha),
|
|
254
298
|
className: cn(
|
|
255
299
|
COLOR_PICKER_ALPHA_FIELD_CLASS,
|
|
256
300
|
slotClassNames.alphaInputField,
|
|
257
301
|
FIELD_CONTROL_MOBILE_NO_ZOOM_CLASS
|
|
258
302
|
),
|
|
303
|
+
onFocus: () => {
|
|
304
|
+
if (blocked) return;
|
|
305
|
+
setIsEditing(true);
|
|
306
|
+
setEditDraft(String(Math.round(hsva.a)));
|
|
307
|
+
},
|
|
259
308
|
onChange: (e) => {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
309
|
+
if (blocked) return;
|
|
310
|
+
const digits = e.target.value.replace(/[^0-9]/g, "");
|
|
311
|
+
setEditDraft(digits);
|
|
312
|
+
if (digits !== "") {
|
|
313
|
+
const n = parseInt(digits, 10);
|
|
314
|
+
if (!Number.isNaN(n)) {
|
|
315
|
+
setHsva({ ...hsva, a: clampN(n, 0, 100) });
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
onBlur: () => {
|
|
320
|
+
commitAlpha(editDraft);
|
|
321
|
+
setIsEditing(false);
|
|
322
|
+
},
|
|
323
|
+
onKeyDown: (e) => {
|
|
324
|
+
if (e.key === "Enter") {
|
|
325
|
+
commitAlpha(editDraft);
|
|
326
|
+
setIsEditing(false);
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
"data-disabled": dataFlag(disabled),
|
|
330
|
+
"data-readonly": dataFlag(readOnly)
|
|
263
331
|
}
|
|
264
332
|
),
|
|
265
333
|
/* @__PURE__ */ jsx(
|
|
@@ -289,7 +357,8 @@ const ColorPickerPresets = forwardRef(
|
|
|
289
357
|
onPointerUp,
|
|
290
358
|
...rest
|
|
291
359
|
}, ref) {
|
|
292
|
-
const { hex, setHsva, size } = useColorPicker();
|
|
360
|
+
const { hex, setHsva, size, disabled, readOnly } = useColorPicker();
|
|
361
|
+
const blocked = disabled || readOnly;
|
|
293
362
|
const slotClassNames = useColorPickerClassNames();
|
|
294
363
|
const part = useColorPickerSlotMotion("presets", {
|
|
295
364
|
motion,
|
|
@@ -310,15 +379,20 @@ const ColorPickerPresets = forwardRef(
|
|
|
310
379
|
),
|
|
311
380
|
...rest,
|
|
312
381
|
...part.pointerHandlers,
|
|
382
|
+
"data-disabled": dataFlag(disabled),
|
|
383
|
+
"data-readonly": dataFlag(readOnly),
|
|
313
384
|
children: presets.map((preset) => /* @__PURE__ */ jsx(
|
|
314
385
|
ColorSwatch,
|
|
315
386
|
{
|
|
316
387
|
color: preset,
|
|
317
388
|
size: COLOR_PICKER_SWATCH_SIZE_MAP[size],
|
|
318
389
|
shape: "rounded",
|
|
390
|
+
disabled,
|
|
391
|
+
"aria-disabled": readOnly || void 0,
|
|
319
392
|
selected: hex.toLowerCase() === preset.toLowerCase(),
|
|
320
393
|
className: slotClassNames.presetSwatch,
|
|
321
394
|
onClick: () => {
|
|
395
|
+
if (blocked) return;
|
|
322
396
|
const parsed = hexToHsva(preset);
|
|
323
397
|
if (parsed) setHsva(parsed);
|
|
324
398
|
}
|
|
@@ -378,7 +452,7 @@ function ColorPickerDefaultLayout({
|
|
|
378
452
|
showAlpha,
|
|
379
453
|
presets
|
|
380
454
|
}) {
|
|
381
|
-
const { hsva, setHsva, size } = useColorPicker();
|
|
455
|
+
const { hsva, setHsva, size, disabled, readOnly } = useColorPicker();
|
|
382
456
|
const slotClassNames = useColorPickerClassNames();
|
|
383
457
|
const sliderSize = COLOR_PICKER_SLIDER_SIZE_MAP[size];
|
|
384
458
|
const pickerMotion = useOptionalColorPickerMotionScope()?.getRootMotion();
|
|
@@ -408,6 +482,8 @@ function ColorPickerDefaultLayout({
|
|
|
408
482
|
color: hsva,
|
|
409
483
|
value: hsva.h,
|
|
410
484
|
size: sliderSize,
|
|
485
|
+
disabled,
|
|
486
|
+
readOnly,
|
|
411
487
|
className: slotClassNames.hueSlider,
|
|
412
488
|
motion: pickerMotion?.hueSlider,
|
|
413
489
|
onValueChange: (h) => setHsva({ ...hsva, h })
|
|
@@ -420,6 +496,8 @@ function ColorPickerDefaultLayout({
|
|
|
420
496
|
color: hsva,
|
|
421
497
|
value: hsva.a,
|
|
422
498
|
size: sliderSize,
|
|
499
|
+
disabled,
|
|
500
|
+
readOnly,
|
|
423
501
|
className: slotClassNames.alphaSlider,
|
|
424
502
|
motion: pickerMotion?.alphaSlider,
|
|
425
503
|
onValueChange: (a) => setHsva({ ...hsva, a })
|
|
@@ -448,7 +526,7 @@ function ColorPickerDefaultLayout({
|
|
|
448
526
|
] });
|
|
449
527
|
}
|
|
450
528
|
const ColorPickerTrigger = forwardRef(
|
|
451
|
-
function ColorPickerTrigger2({ swatchSize, className, children, asChild = true, motion, autoFocus, tabIndex, ...rest }, ref) {
|
|
529
|
+
function ColorPickerTrigger2({ swatchSize, className, children, asChild = true, motion, autoFocus, tabIndex, onBlur, onClick, ...rest }, ref) {
|
|
452
530
|
const labels = useBurneLabels();
|
|
453
531
|
const field = useColorPicker();
|
|
454
532
|
const { hex, disabled, size, invalid } = field;
|
|
@@ -456,19 +534,34 @@ const ColorPickerTrigger = forwardRef(
|
|
|
456
534
|
return /* @__PURE__ */ jsx(
|
|
457
535
|
Popover.Trigger,
|
|
458
536
|
{
|
|
459
|
-
ref,
|
|
537
|
+
ref: mergeRefs(ref, field.registerTriggerRef),
|
|
460
538
|
id: field.triggerId,
|
|
461
539
|
asChild,
|
|
540
|
+
disabled,
|
|
462
541
|
motion,
|
|
463
542
|
className: cn(slotClassNames.trigger, className),
|
|
543
|
+
onBlur: (e) => {
|
|
544
|
+
onBlur?.(e);
|
|
545
|
+
field.onTriggerBlur?.();
|
|
546
|
+
},
|
|
547
|
+
onClick: (e) => {
|
|
548
|
+
if (disabled) {
|
|
549
|
+
e.preventDefault();
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
onClick?.(e);
|
|
553
|
+
},
|
|
464
554
|
...rest,
|
|
465
|
-
...dataVariantProps({ size }),
|
|
466
555
|
...autoFocus ?? field.autoFocus ? { autoFocus: true } : {},
|
|
467
|
-
|
|
556
|
+
...dataVariantProps({ size }),
|
|
557
|
+
tabIndex: disabled ? -1 : tabIndex ?? field.tabIndex,
|
|
468
558
|
"aria-invalid": invalid ? true : void 0,
|
|
469
559
|
"aria-readonly": field.readOnly || void 0,
|
|
470
|
-
"
|
|
471
|
-
"data-
|
|
560
|
+
"aria-required": field.required || void 0,
|
|
561
|
+
"data-disabled": dataFlag(disabled),
|
|
562
|
+
"data-readonly": dataFlag(field.readOnly),
|
|
563
|
+
"data-invalid": dataFlag(invalid),
|
|
564
|
+
"data-required": dataFlag(field.required),
|
|
472
565
|
children: children ?? /* @__PURE__ */ jsx(
|
|
473
566
|
ColorSwatch,
|
|
474
567
|
{
|
|
@@ -3,20 +3,28 @@ export declare const COLOR_PICKER_WIDTH: Record<ColorPickerSize, string>;
|
|
|
3
3
|
export declare const COLOR_PICKER_AREA_HEIGHT: Record<ColorPickerSize, string>;
|
|
4
4
|
export declare const COLOR_PICKER_PAD: Record<ColorPickerSize, string>;
|
|
5
5
|
export declare const COLOR_PICKER_AREA_CLASS = "relative w-full touch-none select-none rounded-small cursor-crosshair overflow-hidden";
|
|
6
|
+
export declare const COLOR_PICKER_AREA_DISABLED_CLASS = "cursor-not-allowed opacity-48";
|
|
7
|
+
export declare const COLOR_PICKER_AREA_READONLY_CLASS = "cursor-default";
|
|
8
|
+
export declare const COLOR_PICKER_INPUT_DISABLED_CLASS = "cursor-not-allowed opacity-48";
|
|
9
|
+
/** Alternating 50% transparency checkerboard using kit tokens (`--color-border` / `--color-surface`). */
|
|
10
|
+
export declare const COLOR_PICKER_CHECKERBOARD_CLASS = "[background-image:repeating-conic-gradient(var(--color-border)_0%_25%,var(--color-surface)_0%_50%)] [background-size:8px_8px]";
|
|
6
11
|
/** Dual ring: theme background inner + foreground hairline — readable on any swatch hue. */
|
|
7
12
|
export declare const COLOR_PICKER_AREA_THUMB_CLASS = "absolute z-10 size-[length:var(--size-scale-small)] -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-background [box-shadow:0_0_0_1px_var(--color-foreground)] hover:[box-shadow:0_0_0_1px_var(--color-foreground),var(--shadow-lift)] focus-ring";
|
|
8
13
|
export declare const COLOR_PICKER_SLIDERS_ROW_CLASS = "flex items-center gap-small";
|
|
9
14
|
export declare const COLOR_PICKER_SLIDERS_STACK_CLASS = "flex min-w-0 flex-1 flex-col gap-xsmall";
|
|
10
15
|
export declare const COLOR_PICKER_INPUTS_ROW_CLASS = "flex min-w-0 items-center gap-small";
|
|
11
16
|
export declare const COLOR_PICKER_HEX_INPUT_CLASS = "flex min-w-0 shrink items-center gap-xsmall rounded-small border-token bg-secondary px-small py-xsmall focus-within-ring";
|
|
12
|
-
export declare const COLOR_PICKER_HEX_PREFIX_CLASS = "text-small text-muted select-none";
|
|
17
|
+
export declare const COLOR_PICKER_HEX_PREFIX_CLASS = "text-small text-muted-foreground select-none";
|
|
13
18
|
export declare const COLOR_PICKER_HEX_FIELD_CLASS = "w-[8ch] bg-transparent text-small font-mono uppercase text-foreground outline-none field-control-mobile-no-zoom";
|
|
14
19
|
export declare const COLOR_PICKER_ALPHA_INPUT_CLASS = "flex shrink-0 items-center gap-xsmall rounded-small border-token bg-secondary px-small py-xsmall focus-within-ring";
|
|
15
20
|
export declare const COLOR_PICKER_ALPHA_FIELD_CLASS = "w-8 bg-transparent text-end text-small font-mono text-foreground outline-none field-control-mobile-no-zoom";
|
|
16
|
-
export declare const COLOR_PICKER_ALPHA_SUFFIX_CLASS = "text-small text-muted select-none";
|
|
21
|
+
export declare const COLOR_PICKER_ALPHA_SUFFIX_CLASS = "text-small text-muted-foreground select-none";
|
|
17
22
|
export declare const COLOR_PICKER_PRESETS_CLASS = "flex flex-wrap gap-xsmall border-t-token pt-small";
|
|
18
23
|
export declare const COLOR_PICKER_PREVIEW_WRAP_CLASS = "inline-flex shrink-0";
|
|
19
24
|
export declare const COLOR_PICKER_PREVIEW_SWATCH_CLASS = "shrink-0";
|
|
20
25
|
export declare const COLOR_PICKER_CONTENT_PANEL_CLASS = "flex flex-col text-foreground";
|
|
21
26
|
export declare function colorPickerContentPanelClass(size: ColorPickerSize, slotPanel?: string): string;
|
|
22
|
-
export declare function colorPickerAreaClass(size: ColorPickerSize, slotArea?: string
|
|
27
|
+
export declare function colorPickerAreaClass(size: ColorPickerSize, slotArea?: string, options?: {
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
readOnly?: boolean;
|
|
30
|
+
}): string;
|
|
@@ -20,16 +20,20 @@ const COLOR_PICKER_PAD = {
|
|
|
20
20
|
large: "p-xlarge gap-xlarge"
|
|
21
21
|
};
|
|
22
22
|
const COLOR_PICKER_AREA_CLASS = "relative w-full touch-none select-none rounded-small cursor-crosshair overflow-hidden";
|
|
23
|
+
const COLOR_PICKER_AREA_DISABLED_CLASS = "cursor-not-allowed opacity-48";
|
|
24
|
+
const COLOR_PICKER_AREA_READONLY_CLASS = "cursor-default";
|
|
25
|
+
const COLOR_PICKER_INPUT_DISABLED_CLASS = "cursor-not-allowed opacity-48";
|
|
26
|
+
const COLOR_PICKER_CHECKERBOARD_CLASS = "[background-image:repeating-conic-gradient(var(--color-border)_0%_25%,var(--color-surface)_0%_50%)] [background-size:8px_8px]";
|
|
23
27
|
const COLOR_PICKER_AREA_THUMB_CLASS = "absolute z-10 size-[length:var(--size-scale-small)] -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-background [box-shadow:0_0_0_1px_var(--color-foreground)] hover:[box-shadow:0_0_0_1px_var(--color-foreground),var(--shadow-lift)] focus-ring";
|
|
24
28
|
const COLOR_PICKER_SLIDERS_ROW_CLASS = "flex items-center gap-small";
|
|
25
29
|
const COLOR_PICKER_SLIDERS_STACK_CLASS = "flex min-w-0 flex-1 flex-col gap-xsmall";
|
|
26
30
|
const COLOR_PICKER_INPUTS_ROW_CLASS = "flex min-w-0 items-center gap-small";
|
|
27
31
|
const COLOR_PICKER_HEX_INPUT_CLASS = "flex min-w-0 shrink items-center gap-xsmall rounded-small border-token bg-secondary px-small py-xsmall focus-within-ring";
|
|
28
|
-
const COLOR_PICKER_HEX_PREFIX_CLASS = "text-small text-muted select-none";
|
|
32
|
+
const COLOR_PICKER_HEX_PREFIX_CLASS = "text-small text-muted-foreground select-none";
|
|
29
33
|
const COLOR_PICKER_HEX_FIELD_CLASS = `w-[8ch] bg-transparent text-small font-mono uppercase text-foreground outline-none ${FIELD_CONTROL_MOBILE_NO_ZOOM_CLASS}`;
|
|
30
34
|
const COLOR_PICKER_ALPHA_INPUT_CLASS = "flex shrink-0 items-center gap-xsmall rounded-small border-token bg-secondary px-small py-xsmall focus-within-ring";
|
|
31
35
|
const COLOR_PICKER_ALPHA_FIELD_CLASS = `w-8 bg-transparent text-end text-small font-mono text-foreground outline-none ${FIELD_CONTROL_MOBILE_NO_ZOOM_CLASS}`;
|
|
32
|
-
const COLOR_PICKER_ALPHA_SUFFIX_CLASS = "text-small text-muted select-none";
|
|
36
|
+
const COLOR_PICKER_ALPHA_SUFFIX_CLASS = "text-small text-muted-foreground select-none";
|
|
33
37
|
const COLOR_PICKER_PRESETS_CLASS = "flex flex-wrap gap-xsmall border-t-token pt-small";
|
|
34
38
|
const COLOR_PICKER_PREVIEW_WRAP_CLASS = "inline-flex shrink-0";
|
|
35
39
|
const COLOR_PICKER_PREVIEW_SWATCH_CLASS = "shrink-0";
|
|
@@ -43,10 +47,12 @@ function colorPickerContentPanelClass(size, slotPanel) {
|
|
|
43
47
|
slotPanel
|
|
44
48
|
);
|
|
45
49
|
}
|
|
46
|
-
function colorPickerAreaClass(size, slotArea) {
|
|
50
|
+
function colorPickerAreaClass(size, slotArea, options) {
|
|
47
51
|
return cn(
|
|
48
52
|
COLOR_PICKER_AREA_CLASS,
|
|
49
53
|
COLOR_PICKER_AREA_HEIGHT[size],
|
|
54
|
+
options?.disabled && COLOR_PICKER_AREA_DISABLED_CLASS,
|
|
55
|
+
!options?.disabled && options?.readOnly && COLOR_PICKER_AREA_READONLY_CLASS,
|
|
50
56
|
slotArea
|
|
51
57
|
);
|
|
52
58
|
}
|
|
@@ -55,13 +61,17 @@ export {
|
|
|
55
61
|
COLOR_PICKER_ALPHA_INPUT_CLASS,
|
|
56
62
|
COLOR_PICKER_ALPHA_SUFFIX_CLASS,
|
|
57
63
|
COLOR_PICKER_AREA_CLASS,
|
|
64
|
+
COLOR_PICKER_AREA_DISABLED_CLASS,
|
|
58
65
|
COLOR_PICKER_AREA_HEIGHT,
|
|
66
|
+
COLOR_PICKER_AREA_READONLY_CLASS,
|
|
59
67
|
COLOR_PICKER_AREA_THUMB_CLASS,
|
|
68
|
+
COLOR_PICKER_CHECKERBOARD_CLASS,
|
|
60
69
|
COLOR_PICKER_CONTENT_PANEL_CLASS,
|
|
61
70
|
COLOR_PICKER_HEX_FIELD_CLASS,
|
|
62
71
|
COLOR_PICKER_HEX_INPUT_CLASS,
|
|
63
72
|
COLOR_PICKER_HEX_PREFIX_CLASS,
|
|
64
73
|
COLOR_PICKER_INPUTS_ROW_CLASS,
|
|
74
|
+
COLOR_PICKER_INPUT_DISABLED_CLASS,
|
|
65
75
|
COLOR_PICKER_PAD,
|
|
66
76
|
COLOR_PICKER_PRESETS_CLASS,
|
|
67
77
|
COLOR_PICKER_PREVIEW_SWATCH_CLASS,
|
|
@@ -156,6 +156,8 @@ export type ColorPickerContextValue = {
|
|
|
156
156
|
name?: string;
|
|
157
157
|
autoFocus?: boolean;
|
|
158
158
|
tabIndex?: number;
|
|
159
|
+
registerTriggerRef?: (node: HTMLElement | null) => void;
|
|
160
|
+
onTriggerBlur?: () => void;
|
|
159
161
|
};
|
|
160
162
|
export type ColorPickerClassNamesProviderProps = {
|
|
161
163
|
classNames?: Prettify<ColorPickerClassNames>;
|
|
@@ -165,4 +167,6 @@ export type UseColorPickerRootStateProps = ColorPickerProps;
|
|
|
165
167
|
export type UseColorPickerAreaDragProps = {
|
|
166
168
|
hsva: HSVA;
|
|
167
169
|
setHsva: (next: HSVA) => void;
|
|
170
|
+
disabled?: boolean;
|
|
171
|
+
readOnly?: boolean;
|
|
168
172
|
};
|
|
@@ -6,7 +6,7 @@ export declare const COLOR_SLIDER_TRACK_OVERFLOW_CLASS = "overflow-hidden";
|
|
|
6
6
|
export declare const COLOR_SLIDER_DISABLED_CLASS = "opacity-48";
|
|
7
7
|
export declare const COLOR_SLIDER_ROOT_CLASS = "flex flex-col gap-xsmall";
|
|
8
8
|
export declare const COLOR_SLIDER_LABEL_ROW_CLASS = "flex items-center justify-between";
|
|
9
|
-
export declare const COLOR_SLIDER_LABEL_TEXT_CLASS = "text-muted";
|
|
9
|
+
export declare const COLOR_SLIDER_LABEL_TEXT_CLASS = "text-muted-foreground";
|
|
10
10
|
export declare const COLOR_SLIDER_VALUE_TEXT_CLASS = "font-w-mid text-foreground";
|
|
11
11
|
export declare const CHANNEL_A11Y_LABEL: Record<ColorChannel, string>;
|
|
12
12
|
export declare function colorSliderTrackClass({ size, orientation, disabled, slotClass, className, }: {
|
|
@@ -16,4 +16,4 @@ export declare function colorSliderTrackClass({ size, orientation, disabled, slo
|
|
|
16
16
|
slotClass?: string;
|
|
17
17
|
className?: string;
|
|
18
18
|
}): string;
|
|
19
|
-
export declare function colorSliderBackgroundStyle(channel: ColorChannel, color: HSVA, orientation: ColorSliderOrientation): CSSProperties;
|
|
19
|
+
export declare function colorSliderBackgroundStyle(channel: ColorChannel, color: HSVA, orientation: ColorSliderOrientation, rtl?: boolean): CSSProperties;
|
|
@@ -6,7 +6,7 @@ const COLOR_SLIDER_TRACK_OVERFLOW_CLASS = "overflow-hidden";
|
|
|
6
6
|
const COLOR_SLIDER_DISABLED_CLASS = "opacity-48";
|
|
7
7
|
const COLOR_SLIDER_ROOT_CLASS = "flex flex-col gap-xsmall";
|
|
8
8
|
const COLOR_SLIDER_LABEL_ROW_CLASS = "flex items-center justify-between";
|
|
9
|
-
const COLOR_SLIDER_LABEL_TEXT_CLASS = "text-muted";
|
|
9
|
+
const COLOR_SLIDER_LABEL_TEXT_CLASS = "text-muted-foreground";
|
|
10
10
|
const COLOR_SLIDER_VALUE_TEXT_CLASS = "font-w-mid text-foreground";
|
|
11
11
|
const CHANNEL_A11Y_LABEL = {
|
|
12
12
|
hue: "Hue",
|
|
@@ -37,12 +37,12 @@ function colorSliderTrackClass({
|
|
|
37
37
|
className
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
|
-
function colorSliderBackgroundStyle(channel, color, orientation) {
|
|
40
|
+
function colorSliderBackgroundStyle(channel, color, orientation, rtl = false) {
|
|
41
41
|
const horizontal = orientation === "horizontal";
|
|
42
42
|
if (channel === "alpha") {
|
|
43
|
-
return alphaSliderGradientStyle(color, horizontal);
|
|
43
|
+
return alphaSliderGradientStyle(color, horizontal, rtl);
|
|
44
44
|
}
|
|
45
|
-
const dir = horizontal ? "to right" : "to top";
|
|
45
|
+
const dir = horizontal ? rtl ? "to left" : "to right" : "to top";
|
|
46
46
|
const { r, g, b } = hsvaToRgba(color);
|
|
47
47
|
switch (channel) {
|
|
48
48
|
case "hue":
|
|
@@ -35,6 +35,7 @@ export type ColorSliderTrackProps = Omit<HTMLAttributes<HTMLDivElement>, "color"
|
|
|
35
35
|
size?: ColorSliderSize;
|
|
36
36
|
orientation?: ColorSliderOrientation;
|
|
37
37
|
disabled?: boolean;
|
|
38
|
+
readOnly?: boolean;
|
|
38
39
|
/**
|
|
39
40
|
* Per-slot motion for the track (`enter` / `change`). Thumb geometry stays kit-internal.
|
|
40
41
|
* Defaults are empty.
|
|
@@ -56,6 +57,7 @@ export type ColorSliderProps = Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
|
56
57
|
size?: ColorSliderSize;
|
|
57
58
|
orientation?: ColorSliderOrientation;
|
|
58
59
|
disabled?: boolean;
|
|
60
|
+
readOnly?: boolean;
|
|
59
61
|
classNames?: Prettify<ColorSliderClassNames>;
|
|
60
62
|
/**
|
|
61
63
|
* Per-slot motion (`root`, `track`). Nested ColorSlider.Track does not inherit defaults.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ColorSwatchClassNames, ColorSwatchShape, ColorSwatchSize } from './colorSwatchTypes.js';
|
|
2
2
|
export declare const COLOR_SWATCH_DECORATIVE_CLASS = "relative shrink-0 overflow-hidden";
|
|
3
3
|
export declare const COLOR_SWATCH_BUTTON_CLASS = "relative shrink-0 origin-center overflow-hidden focus-ring";
|
|
4
|
+
export declare const COLOR_SWATCH_FILL_LAYER_CLASS = "pointer-events-none absolute inset-0 rounded-[inherit]";
|
|
4
5
|
/** Selection ring. Keyboard focus stays on `focus-ring`. */
|
|
5
6
|
export declare const COLOR_SWATCH_SELECTED_CLASS = "ring-2 ring-primary ring-offset-2 ring-offset-background";
|
|
6
7
|
export declare const COLOR_SWATCH_SIZE_CLASS: Record<ColorSwatchSize, string>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { SHADOW_LIFT_MOTION_CLASS } from "../utils/useShadowMotion.js";
|
|
2
2
|
import { cn } from "../../../utils/cn.js";
|
|
3
|
+
import { COLOR_PICKER_CHECKERBOARD_CLASS } from "./colorPickerStyles.js";
|
|
3
4
|
const COLOR_SWATCH_DECORATIVE_CLASS = "relative shrink-0 overflow-hidden";
|
|
4
5
|
const COLOR_SWATCH_BUTTON_CLASS = "relative shrink-0 origin-center overflow-hidden focus-ring";
|
|
6
|
+
const COLOR_SWATCH_FILL_LAYER_CLASS = "pointer-events-none absolute inset-0 rounded-[inherit]";
|
|
5
7
|
const COLOR_SWATCH_SELECTED_CLASS = "ring-2 ring-primary ring-offset-2 ring-offset-background";
|
|
6
8
|
const COLOR_SWATCH_SIZE_CLASS = {
|
|
7
9
|
small: "h-5 w-5",
|
|
@@ -30,6 +32,7 @@ function colorSwatchClass({
|
|
|
30
32
|
}) {
|
|
31
33
|
return cn(
|
|
32
34
|
interactive ? COLOR_SWATCH_BUTTON_CLASS : COLOR_SWATCH_DECORATIVE_CLASS,
|
|
35
|
+
COLOR_PICKER_CHECKERBOARD_CLASS,
|
|
33
36
|
interactive && SHADOW_LIFT_MOTION_CLASS,
|
|
34
37
|
COLOR_SWATCH_SIZE_CLASS[size],
|
|
35
38
|
COLOR_SWATCH_SHAPE_CLASS[shape],
|
|
@@ -43,6 +46,7 @@ function colorSwatchClass({
|
|
|
43
46
|
export {
|
|
44
47
|
COLOR_SWATCH_BUTTON_CLASS,
|
|
45
48
|
COLOR_SWATCH_DECORATIVE_CLASS,
|
|
49
|
+
COLOR_SWATCH_FILL_LAYER_CLASS,
|
|
46
50
|
COLOR_SWATCH_SELECTED_CLASS,
|
|
47
51
|
COLOR_SWATCH_SHAPE_CLASS,
|
|
48
52
|
COLOR_SWATCH_SIZE_CLASS,
|
|
@@ -25,4 +25,5 @@ export declare function hexToHsva(hex: string): HSVA | null;
|
|
|
25
25
|
export declare function hsvaToColorString(hsva: HSVA): string;
|
|
26
26
|
/** Pure hue color at s=100, v=100 for gradient display */
|
|
27
27
|
export declare function hueToRgbString(hue: number): string;
|
|
28
|
-
export declare
|
|
28
|
+
export declare const COLOR_CHECKERBOARD_IMAGE = "repeating-conic-gradient(var(--color-border) 0% 25%, var(--color-surface) 0% 50%)";
|
|
29
|
+
export declare function alphaSliderGradientStyle(color: HSVA, horizontal: boolean, rtl?: boolean): React.CSSProperties;
|