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,12 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, useMemo, useCallback, Children, isValidElement, cloneElement,
|
|
3
|
+
import { forwardRef, useMemo, useCallback, useRef, useEffect, Children, isValidElement, cloneElement, useState, useLayoutEffect } from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import { Field } from "../Field/index.js";
|
|
6
6
|
import { burneLightThemePortalProps } from "../utils/burneLightTheme.js";
|
|
7
7
|
import { dataOpenState, dataVariantProps } from "../utils/dataContract.js";
|
|
8
8
|
import { mergeAsChildProps } from "../utils/mergeAsChildProps.js";
|
|
9
|
-
import {
|
|
9
|
+
import { OverlayLayerProvider } from "../utils/overlayLayer.js";
|
|
10
|
+
import { resolveFloatingPortalContainer } from "../utils/portalContainer.js";
|
|
11
|
+
import { isRtlElement } from "../utils/readingDirection.js";
|
|
10
12
|
import { useSkinRegistryRevision, useApplySkinPortal } from "../../../skins/skinContext.js";
|
|
11
13
|
import { useOverlayTriggerSlot } from "../utils/overlayTriggerSqueeze.js";
|
|
12
14
|
import { TOOLTIP_ARROW_CLASS } from "../Tooltip/tooltipPosition.js";
|
|
@@ -46,17 +48,23 @@ const PopoverTrigger = forwardRef(
|
|
|
46
48
|
onPointerDown,
|
|
47
49
|
onPointerUp
|
|
48
50
|
});
|
|
51
|
+
const setPartRef = part.setRef;
|
|
49
52
|
const mergedRef = useCallback(
|
|
50
53
|
(node) => {
|
|
51
|
-
|
|
54
|
+
setPartRef(node);
|
|
52
55
|
triggerRef.current = node;
|
|
53
56
|
},
|
|
54
|
-
[
|
|
57
|
+
[setPartRef, triggerRef]
|
|
55
58
|
);
|
|
59
|
+
const openedFromPointerDownRef = useRef(false);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!open) openedFromPointerDownRef.current = false;
|
|
62
|
+
}, [open]);
|
|
56
63
|
const handlePointerDown = useCallback(
|
|
57
64
|
(e) => {
|
|
58
65
|
if (open || openingRef.current || e.button !== 0) return;
|
|
59
66
|
e.preventDefault();
|
|
67
|
+
openedFromPointerDownRef.current = true;
|
|
60
68
|
openAfterSqueeze(() => setOpen(true));
|
|
61
69
|
},
|
|
62
70
|
[open, openingRef, openAfterSqueeze, setOpen]
|
|
@@ -65,9 +73,14 @@ const PopoverTrigger = forwardRef(
|
|
|
65
73
|
(event) => {
|
|
66
74
|
onClick?.(event);
|
|
67
75
|
if (event.defaultPrevented) return;
|
|
76
|
+
if (openedFromPointerDownRef.current) {
|
|
77
|
+
openedFromPointerDownRef.current = false;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
68
80
|
if (open) setOpen(false);
|
|
81
|
+
else if (!openingRef.current) setOpen(true);
|
|
69
82
|
},
|
|
70
|
-
[onClick, open, setOpen]
|
|
83
|
+
[onClick, open, openingRef, setOpen]
|
|
71
84
|
);
|
|
72
85
|
const handleKeyDown = useCallback(
|
|
73
86
|
(event) => {
|
|
@@ -105,7 +118,8 @@ const PopoverTrigger = forwardRef(
|
|
|
105
118
|
onKeyDown: (event) => {
|
|
106
119
|
handleKeyDown(event);
|
|
107
120
|
},
|
|
108
|
-
...triggerA11y2
|
|
121
|
+
...triggerA11y2,
|
|
122
|
+
"data-state": dataOpenState(open)
|
|
109
123
|
},
|
|
110
124
|
mergedRef,
|
|
111
125
|
{ runBeforeChild: ["onPointerDown", "onKeyDown"] }
|
|
@@ -131,6 +145,7 @@ const PopoverTrigger = forwardRef(
|
|
|
131
145
|
part.pointerHandlers.onPointerDown(e);
|
|
132
146
|
handlePointerDown(e);
|
|
133
147
|
},
|
|
148
|
+
"data-state": dataOpenState(open),
|
|
134
149
|
children
|
|
135
150
|
}
|
|
136
151
|
);
|
|
@@ -354,6 +369,7 @@ function PopoverContentHost({
|
|
|
354
369
|
triggerRef,
|
|
355
370
|
anchorRef,
|
|
356
371
|
contentRef,
|
|
372
|
+
layerId,
|
|
357
373
|
portalContainer: portalContainerFromRoot
|
|
358
374
|
} = usePopoverContext("Popover.Content");
|
|
359
375
|
const slotClassNames = usePopoverClassNames();
|
|
@@ -377,6 +393,7 @@ function PopoverContentHost({
|
|
|
377
393
|
const {
|
|
378
394
|
setPanelRef,
|
|
379
395
|
portalMounted,
|
|
396
|
+
portalHost: lifecyclePortalHost,
|
|
380
397
|
resolvedSide
|
|
381
398
|
} = usePopoverContentLifecycle({
|
|
382
399
|
open,
|
|
@@ -402,15 +419,44 @@ function PopoverContentHost({
|
|
|
402
419
|
},
|
|
403
420
|
[setPanelRef]
|
|
404
421
|
);
|
|
422
|
+
const [portalMeta, setPortalMeta] = useState({});
|
|
423
|
+
const syncPortalMeta = useCallback(() => {
|
|
424
|
+
const triggerThemeAncestor2 = triggerRef.current?.closest?.("[data-theme]");
|
|
425
|
+
const themeEl = triggerThemeAncestor2 && triggerThemeAncestor2 !== document.documentElement ? triggerRef.current : anchorRef?.current ?? triggerRef.current;
|
|
426
|
+
const nextTheme = burneLightThemePortalProps(themeEl)["data-theme"];
|
|
427
|
+
const dirEl = triggerRef.current ?? anchorRef?.current;
|
|
428
|
+
const dirAncestor2 = dirEl?.closest?.("[dir]");
|
|
429
|
+
const rawDir = dirAncestor2 && dirAncestor2 !== document.documentElement ? dirAncestor2.getAttribute("dir") : null;
|
|
430
|
+
const nextDir = rawDir === "rtl" || rawDir === "ltr" ? rawDir : dirEl instanceof HTMLElement && isRtlElement(dirEl) ? "rtl" : void 0;
|
|
431
|
+
setPortalMeta(
|
|
432
|
+
(prev) => prev.theme === nextTheme && prev.dir === nextDir ? prev : { theme: nextTheme, dir: nextDir }
|
|
433
|
+
);
|
|
434
|
+
}, [anchorRef, triggerRef]);
|
|
435
|
+
useLayoutEffect(() => {
|
|
436
|
+
if (!open && !portalMounted) return;
|
|
437
|
+
syncPortalMeta();
|
|
438
|
+
}, [open, portalMounted, syncPortalMeta]);
|
|
439
|
+
useEffect(() => {
|
|
440
|
+
if (!open && !portalMounted) return;
|
|
441
|
+
syncPortalMeta();
|
|
442
|
+
const onSync = () => syncPortalMeta();
|
|
443
|
+
window.addEventListener("scroll", onSync, { capture: true, passive: true });
|
|
444
|
+
return () => window.removeEventListener("scroll", onSync, true);
|
|
445
|
+
}, [open, portalMounted, syncPortalMeta]);
|
|
405
446
|
if (!portalMounted) return null;
|
|
406
447
|
if (typeof document === "undefined") return null;
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
);
|
|
448
|
+
const effectiveContainer = portalContainerProp ?? portalContainerFromRoot;
|
|
449
|
+
const dialogAnchor = anchorRef?.current?.closest?.("dialog[open]:not(.portal-contained)") ? anchorRef.current : triggerRef.current ?? anchorRef?.current ?? null;
|
|
450
|
+
const portalHost = resolveFloatingPortalContainer(effectiveContainer, dialogAnchor) ?? lifecyclePortalHost;
|
|
410
451
|
if (!portalHost) return null;
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
);
|
|
452
|
+
const triggerThemeAncestor = triggerRef.current?.closest?.("[data-theme]");
|
|
453
|
+
const themeAnchor = triggerThemeAncestor && triggerThemeAncestor !== document.documentElement ? triggerRef.current : anchorRef?.current ?? triggerRef.current;
|
|
454
|
+
const liveTheme = burneLightThemePortalProps(themeAnchor)["data-theme"] ?? portalMeta.theme;
|
|
455
|
+
const portalTheme = liveTheme ? { "data-theme": liveTheme } : {};
|
|
456
|
+
const dirSource = triggerRef.current ?? anchorRef?.current;
|
|
457
|
+
const dirAncestor = dirSource?.closest?.("[dir]");
|
|
458
|
+
const liveDirAttr = dirAncestor && dirAncestor !== document.documentElement ? dirAncestor.getAttribute("dir") : null;
|
|
459
|
+
const portalDir = liveDirAttr === "rtl" || liveDirAttr === "ltr" ? liveDirAttr : portalMeta.dir ?? (dirSource instanceof HTMLElement && isRtlElement(dirSource) ? "rtl" : void 0);
|
|
414
460
|
const describedBy = resolvePopoverDescribedBy({
|
|
415
461
|
contentRole,
|
|
416
462
|
labelConnected,
|
|
@@ -423,10 +469,12 @@ function PopoverContentHost({
|
|
|
423
469
|
labelConnected,
|
|
424
470
|
labelId
|
|
425
471
|
});
|
|
426
|
-
const node = /* @__PURE__ */ jsx(PopoverResolvedSideProvider, { value: resolvedSide, children: /* @__PURE__ */ jsx(PopoverContentChromeProvider, { unstyled, children: /* @__PURE__ */ jsx(
|
|
472
|
+
const node = /* @__PURE__ */ jsx(OverlayLayerProvider, { layerId, children: /* @__PURE__ */ jsx(PopoverResolvedSideProvider, { value: resolvedSide, children: /* @__PURE__ */ jsx(PopoverContentChromeProvider, { unstyled, children: /* @__PURE__ */ jsx(
|
|
427
473
|
"div",
|
|
428
474
|
{
|
|
429
475
|
ref: setSurfaceRef,
|
|
476
|
+
tabIndex: -1,
|
|
477
|
+
dir: portalDir,
|
|
430
478
|
...portalTheme,
|
|
431
479
|
id: popoverId,
|
|
432
480
|
role: contentRole,
|
|
@@ -472,7 +520,7 @@ function PopoverContentHost({
|
|
|
472
520
|
}
|
|
473
521
|
)
|
|
474
522
|
}
|
|
475
|
-
) }) });
|
|
523
|
+
) }) }) });
|
|
476
524
|
return createPortal(node, portalHost);
|
|
477
525
|
}
|
|
478
526
|
export {
|
|
@@ -7,7 +7,7 @@ export declare const POPOVER_TITLE_VARIANT: Record<PopoverSize, TextVariant>;
|
|
|
7
7
|
export declare const POPOVER_DESCRIPTION_VARIANT: Record<PopoverSize, TextVariant>;
|
|
8
8
|
export declare const POPOVER_GAP_CLASS: Record<PopoverContentGap, string>;
|
|
9
9
|
export declare const POPOVER_TRIGGER_CLASS = "inline-flex shrink-0 border-0 bg-transparent p-0 outline-none focus-ring";
|
|
10
|
-
export declare const POPOVER_CONTENT_CLASS = "pointer-events-auto z-popover w-max min-w-0 overflow-visible text-start outline-none";
|
|
10
|
+
export declare const POPOVER_CONTENT_CLASS = "pointer-events-auto fixed top-0 start-0 z-popover w-max min-w-0 overflow-visible text-start outline-none";
|
|
11
11
|
export declare const POPOVER_PANEL_RELATIVE_CLASS = "relative overflow-visible";
|
|
12
12
|
export declare const POPOVER_PANEL_BASE_CLASS = "relative z-[1] flex min-w-0 flex-col overflow-hidden text-foreground";
|
|
13
13
|
export declare const POPOVER_PANEL_SURFACE: Record<KitPopoverVariant, string>;
|
|
@@ -23,7 +23,7 @@ const POPOVER_GAP_CLASS = {
|
|
|
23
23
|
large: "gap-large"
|
|
24
24
|
};
|
|
25
25
|
const POPOVER_TRIGGER_CLASS = "inline-flex shrink-0 border-0 bg-transparent p-0 outline-none focus-ring";
|
|
26
|
-
const POPOVER_CONTENT_CLASS = "pointer-events-auto z-popover w-max min-w-0 overflow-visible text-start outline-none";
|
|
26
|
+
const POPOVER_CONTENT_CLASS = "pointer-events-auto fixed top-0 start-0 z-popover w-max min-w-0 overflow-visible text-start outline-none";
|
|
27
27
|
const POPOVER_PANEL_RELATIVE_CLASS = "relative overflow-visible";
|
|
28
28
|
const POPOVER_PANEL_BASE_CLASS = "relative z-[1] flex min-w-0 flex-col overflow-hidden text-foreground";
|
|
29
29
|
const POPOVER_PANEL_SURFACE = {
|
|
@@ -72,6 +72,7 @@ export type PopoverContextValue = {
|
|
|
72
72
|
triggerRef: RefObject<HTMLElement | null>;
|
|
73
73
|
anchorRef?: RefObject<HTMLElement | null>;
|
|
74
74
|
contentRef: RefObject<HTMLDivElement | null>;
|
|
75
|
+
layerId: symbol;
|
|
75
76
|
/** Portal mount node from Root; Content may override via its own prop. */
|
|
76
77
|
portalContainer?: HTMLElement | null;
|
|
77
78
|
};
|
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useRef, useId, useMemo, useEffect } from "react";
|
|
3
3
|
import { focusElement } from "../utils/focusElement.js";
|
|
4
|
-
import { overlayShouldClose } from "../utils/overlayLayer.js";
|
|
4
|
+
import { useRegisterOverlayLayer, isNodeInChildOverlayLayer, overlayShouldClose } from "../utils/overlayLayer.js";
|
|
5
5
|
import { useSkinVariant } from "../../../skins/skinContext.js";
|
|
6
6
|
import { hasCompoundChild } from "../utils/hasCompoundChild.js";
|
|
7
7
|
import { popoverHintId, popoverLabelId } from "./popoverA11y.js";
|
|
8
8
|
import { useControllableOpen } from "./popoverAPI.js";
|
|
9
|
+
const OUTSIDE_FOCUSABLE_SELECTOR = [
|
|
10
|
+
"button:not([disabled])",
|
|
11
|
+
"a[href]",
|
|
12
|
+
'input:not([type="hidden"]):not([disabled])',
|
|
13
|
+
"select:not([disabled])",
|
|
14
|
+
"textarea:not([disabled])",
|
|
15
|
+
'[contenteditable]:not([contenteditable="false"])',
|
|
16
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
17
|
+
"label"
|
|
18
|
+
].join(",");
|
|
19
|
+
function isFocusableOutsideTarget(target) {
|
|
20
|
+
if (!(target instanceof Element)) return false;
|
|
21
|
+
const match = target.closest(OUTSIDE_FOCUSABLE_SELECTOR);
|
|
22
|
+
if (!match) return false;
|
|
23
|
+
if (match.closest("[aria-hidden='true'], [inert], [hidden]")) return false;
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
9
26
|
function usePopoverRootState({
|
|
10
27
|
children,
|
|
11
28
|
size = "base",
|
|
@@ -31,6 +48,7 @@ function usePopoverRootState({
|
|
|
31
48
|
const triggerRef = useRef(null);
|
|
32
49
|
const contentRef = useRef(null);
|
|
33
50
|
const wasOpenRef = useRef(open);
|
|
51
|
+
const closedByPointerOutsideRef = useRef(false);
|
|
34
52
|
const autoId = useId();
|
|
35
53
|
const popoverId = `popover-${autoId}`;
|
|
36
54
|
const labelId = popoverLabelId(popoverId);
|
|
@@ -42,23 +60,28 @@ function usePopoverRootState({
|
|
|
42
60
|
}),
|
|
43
61
|
[children]
|
|
44
62
|
);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (!overlayShouldClose(
|
|
63
|
+
const layerId = useRegisterOverlayLayer({
|
|
64
|
+
enabled: open,
|
|
65
|
+
kind: "floating",
|
|
66
|
+
onEscape: (dismissEvent) => {
|
|
67
|
+
if (!overlayShouldClose(dismissEvent, onEscapeKeyDown, closeOnEscape)) return true;
|
|
50
68
|
setOpen(false);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
69
|
+
return true;
|
|
70
|
+
},
|
|
71
|
+
containsNode: (node) => Boolean(
|
|
72
|
+
anchorRef?.current?.contains(node) || triggerRef.current?.contains(node) || contentRef.current?.contains(node)
|
|
73
|
+
)
|
|
74
|
+
});
|
|
55
75
|
useEffect(() => {
|
|
56
76
|
if (!open) return;
|
|
57
77
|
const onPointerDown = (event) => {
|
|
58
78
|
const target = event.target;
|
|
79
|
+
if (!target) return;
|
|
59
80
|
const anchor = anchorRef?.current ?? triggerRef.current;
|
|
60
81
|
if (anchor?.contains(target)) return;
|
|
82
|
+
if (triggerRef.current?.contains(target)) return;
|
|
61
83
|
if (contentRef.current?.contains(target)) return;
|
|
84
|
+
if (isNodeInChildOverlayLayer(layerId, target)) return;
|
|
62
85
|
const dismissEvent = {
|
|
63
86
|
target: event.target,
|
|
64
87
|
preventDefault: () => event.preventDefault(),
|
|
@@ -67,15 +90,22 @@ function usePopoverRootState({
|
|
|
67
90
|
}
|
|
68
91
|
};
|
|
69
92
|
if (!overlayShouldClose(dismissEvent, onInteractOutside, closeOnInteractOutside)) return;
|
|
93
|
+
closedByPointerOutsideRef.current = isFocusableOutsideTarget(event.target);
|
|
70
94
|
setOpen(false);
|
|
71
95
|
};
|
|
72
96
|
document.addEventListener("pointerdown", onPointerDown);
|
|
73
97
|
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
74
|
-
}, [anchorRef, closeOnInteractOutside, onInteractOutside, open, setOpen]);
|
|
98
|
+
}, [anchorRef, closeOnInteractOutside, layerId, onInteractOutside, open, setOpen]);
|
|
75
99
|
useEffect(() => {
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
100
|
+
if (open) {
|
|
101
|
+
closedByPointerOutsideRef.current = false;
|
|
102
|
+
} else if (wasOpenRef.current) {
|
|
103
|
+
const skipRestore = closedByPointerOutsideRef.current;
|
|
104
|
+
closedByPointerOutsideRef.current = false;
|
|
105
|
+
if (restoreFocus && !skipRestore) {
|
|
106
|
+
const el = anchorRef?.current ?? triggerRef.current;
|
|
107
|
+
focusElement(el);
|
|
108
|
+
}
|
|
79
109
|
}
|
|
80
110
|
wasOpenRef.current = open;
|
|
81
111
|
}, [anchorRef, open, restoreFocus, triggerRef]);
|
|
@@ -98,6 +128,7 @@ function usePopoverRootState({
|
|
|
98
128
|
triggerRef,
|
|
99
129
|
anchorRef,
|
|
100
130
|
contentRef,
|
|
131
|
+
layerId,
|
|
101
132
|
portalContainer
|
|
102
133
|
}),
|
|
103
134
|
[
|
|
@@ -106,6 +137,7 @@ function usePopoverRootState({
|
|
|
106
137
|
hintId,
|
|
107
138
|
labelConnected,
|
|
108
139
|
labelId,
|
|
140
|
+
layerId,
|
|
109
141
|
open,
|
|
110
142
|
popoverId,
|
|
111
143
|
portalContainer,
|
|
@@ -56,6 +56,17 @@ const ProgressBarRoot = forwardRef(function ProgressBarRoot2({
|
|
|
56
56
|
status,
|
|
57
57
|
formatValue
|
|
58
58
|
});
|
|
59
|
+
const {
|
|
60
|
+
"aria-label": ariaLabel,
|
|
61
|
+
"aria-labelledby": ariaLabelledBy,
|
|
62
|
+
"aria-describedby": ariaDescribedBy,
|
|
63
|
+
...rootDivRest
|
|
64
|
+
} = divRest;
|
|
65
|
+
const simpleAriaProps = {
|
|
66
|
+
...ariaLabel !== void 0 ? { "aria-label": ariaLabel } : void 0,
|
|
67
|
+
...ariaLabelledBy !== void 0 ? { "aria-labelledby": ariaLabelledBy } : void 0,
|
|
68
|
+
...ariaDescribedBy !== void 0 ? { "aria-describedby": ariaDescribedBy } : void 0
|
|
69
|
+
};
|
|
59
70
|
const body = state.isCompound ? children : /* @__PURE__ */ jsx(
|
|
60
71
|
ProgressBarSimpleBody,
|
|
61
72
|
{
|
|
@@ -64,7 +75,14 @@ const ProgressBarRoot = forwardRef(function ProgressBarRoot2({
|
|
|
64
75
|
valueText: state.valueText,
|
|
65
76
|
hint: state.hint,
|
|
66
77
|
error: state.error,
|
|
67
|
-
trackProps: {
|
|
78
|
+
trackProps: {
|
|
79
|
+
...state.trackProps,
|
|
80
|
+
...simpleAriaProps,
|
|
81
|
+
motionController,
|
|
82
|
+
motionState,
|
|
83
|
+
motionPayload,
|
|
84
|
+
playInitialState
|
|
85
|
+
}
|
|
68
86
|
}
|
|
69
87
|
);
|
|
70
88
|
return /* @__PURE__ */ jsx(ProgressBarFieldProvider, { value: state.fieldCtx, children: /* @__PURE__ */ jsx(ProgressBarClassNamesProvider, { classNames, children: /* @__PURE__ */ jsx(
|
|
@@ -84,9 +102,9 @@ const ProgressBarRoot = forwardRef(function ProgressBarRoot2({
|
|
|
84
102
|
slotClass: classNames?.root,
|
|
85
103
|
className
|
|
86
104
|
}),
|
|
87
|
-
...divRest,
|
|
105
|
+
...state.isCompound ? divRest : rootDivRest,
|
|
88
106
|
ref,
|
|
89
|
-
...dataVariantProps({ size: size ?? "base" }),
|
|
107
|
+
...dataVariantProps({ size: size ?? "base", status }),
|
|
90
108
|
children: body
|
|
91
109
|
}
|
|
92
110
|
) })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fieldErrorId, fieldHintId } from '../Field/fieldA11y.js';
|
|
2
2
|
import { ProgressBarTrackAriaProps } from './progressBarTypes.js';
|
|
3
3
|
export declare function progressBarLabelId(progressId: string): string;
|
|
4
|
-
export declare function resolveProgressBarTrackAria({ clampedValue, min, max, statusText, indeterminate, labelId, ariaDescribedBy, }: ProgressBarTrackAriaProps): {
|
|
4
|
+
export declare function resolveProgressBarTrackAria({ clampedValue, min, max, statusText, indeterminate, labelConnected, labelId, ariaDescribedBy, }: ProgressBarTrackAriaProps): {
|
|
5
5
|
"aria-valuenow"?: number;
|
|
6
6
|
"aria-valuemin"?: number;
|
|
7
7
|
"aria-valuemax"?: number;
|
|
@@ -9,18 +9,20 @@ function resolveProgressBarTrackAria({
|
|
|
9
9
|
max,
|
|
10
10
|
statusText,
|
|
11
11
|
indeterminate,
|
|
12
|
+
labelConnected,
|
|
12
13
|
labelId,
|
|
13
14
|
ariaDescribedBy
|
|
14
15
|
}) {
|
|
16
|
+
const connectedLabelId = labelConnected ? labelId : void 0;
|
|
15
17
|
return {
|
|
16
18
|
"aria-valuenow": indeterminate ? void 0 : clampedValue,
|
|
17
19
|
"aria-valuemin": indeterminate ? void 0 : min,
|
|
18
20
|
"aria-valuemax": indeterminate ? void 0 : max,
|
|
19
21
|
"aria-valuetext": statusText,
|
|
20
22
|
"aria-busy": indeterminate || void 0,
|
|
21
|
-
"aria-labelledby":
|
|
23
|
+
"aria-labelledby": connectedLabelId,
|
|
22
24
|
"aria-describedby": ariaDescribedBy,
|
|
23
|
-
"aria-label":
|
|
25
|
+
"aria-label": connectedLabelId == null ? statusText : void 0
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
function resolveProgressBarDescribedBy({
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ProgressBarDisplayState } from './progressBarTypes.js';
|
|
2
|
+
export declare function resolveProgressBarBounds(min: number, max: number): {
|
|
3
|
+
safeMin: number;
|
|
4
|
+
safeMax: number;
|
|
5
|
+
};
|
|
2
6
|
export declare function progressBarValueToPercent(value: number, min: number, max: number): number;
|
|
3
7
|
export declare function defaultProgressBarFormatValue(value: number): string;
|
|
4
8
|
export declare function progressBarDisplayEqual(a: ProgressBarDisplayState | null, b: ProgressBarDisplayState | null): boolean;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { formatLocaleNumber } from "../utils/intlFormat.js";
|
|
2
|
+
function resolveProgressBarBounds(min, max) {
|
|
3
|
+
const safeMin = Number.isFinite(min) ? min : 0;
|
|
4
|
+
const safeMax = Number.isFinite(max) ? max >= safeMin ? max : safeMin : Math.max(safeMin, 100);
|
|
5
|
+
return { safeMin, safeMax };
|
|
6
|
+
}
|
|
2
7
|
function progressBarValueToPercent(value, min, max) {
|
|
8
|
+
if (!Number.isFinite(value) || !Number.isFinite(min) || !Number.isFinite(max)) {
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
3
11
|
if (max <= min) return 0;
|
|
4
|
-
|
|
12
|
+
const raw = (value - min) / (max - min) * 100;
|
|
13
|
+
if (!Number.isFinite(raw)) return 0;
|
|
14
|
+
return Math.min(100, Math.max(0, raw));
|
|
5
15
|
}
|
|
6
16
|
function defaultProgressBarFormatValue(value) {
|
|
7
17
|
return formatLocaleNumber(value);
|
|
@@ -14,5 +24,6 @@ function progressBarDisplayEqual(a, b) {
|
|
|
14
24
|
export {
|
|
15
25
|
defaultProgressBarFormatValue,
|
|
16
26
|
progressBarDisplayEqual,
|
|
17
|
-
progressBarValueToPercent
|
|
27
|
+
progressBarValueToPercent,
|
|
28
|
+
resolveProgressBarBounds
|
|
18
29
|
};
|
|
@@ -3,6 +3,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
3
3
|
import { forwardRef, useMemo } from "react";
|
|
4
4
|
import { Field } from "../Field/index.js";
|
|
5
5
|
import { Label as LabelCompound } from "../Label/index.js";
|
|
6
|
+
import { dataVariantProps } from "../utils/dataContract.js";
|
|
6
7
|
import { resolveProgressBarMotionDefaults, useProgressBarChromeSlot, useProgressBarFillMotion, useProgressBarTrackSlotMotion } from "./progressBarAnimations.js";
|
|
7
8
|
import { useOptionalProgressBarMotionScope, ProgressBarMotionProvider, useProgressBarFieldContext, useProgressBarClassNames } from "./progressBarContext.js";
|
|
8
9
|
import { progressBarValueClass, progressBarHeaderClass, progressBarIndeterminateFillClass, progressBarDeterminateFillStyle, progressBarFillClass, progressBarTrackClass } from "./progressBarStyles.js";
|
|
@@ -206,6 +207,7 @@ const ProgressBarTrack = forwardRef(
|
|
|
206
207
|
size,
|
|
207
208
|
thickness,
|
|
208
209
|
color,
|
|
210
|
+
status,
|
|
209
211
|
formatValue,
|
|
210
212
|
orientation,
|
|
211
213
|
className,
|
|
@@ -235,6 +237,7 @@ const ProgressBarTrack = forwardRef(
|
|
|
235
237
|
size,
|
|
236
238
|
thickness,
|
|
237
239
|
color,
|
|
240
|
+
status,
|
|
238
241
|
formatValue,
|
|
239
242
|
orientation,
|
|
240
243
|
"aria-describedby": ariaDescribedByProp
|
|
@@ -278,7 +281,7 @@ const ProgressBarTrack = forwardRef(
|
|
|
278
281
|
}
|
|
279
282
|
);
|
|
280
283
|
ProgressBarTrack.displayName = "ProgressBar.Track";
|
|
281
|
-
const ProgressBarTrackHost = forwardRef(function ProgressBarTrackHost2({ className, state, ...rest }, ref) {
|
|
284
|
+
const ProgressBarTrackHost = forwardRef(function ProgressBarTrackHost2({ className, style, state, ...rest }, ref) {
|
|
282
285
|
const slotClassNames = useProgressBarClassNames();
|
|
283
286
|
const {
|
|
284
287
|
size: resolvedSize,
|
|
@@ -335,8 +338,9 @@ const ProgressBarTrackHost = forwardRef(function ProgressBarTrackHost2({ classNa
|
|
|
335
338
|
slotClass: slotClassNames.track,
|
|
336
339
|
className
|
|
337
340
|
}),
|
|
338
|
-
style: trackCrossStyle,
|
|
341
|
+
style: trackCrossStyle || style ? { ...trackCrossStyle, ...style } : void 0,
|
|
339
342
|
...rest,
|
|
343
|
+
...dataVariantProps({ status }),
|
|
340
344
|
children: isIndeterminate ? /* @__PURE__ */ jsx(
|
|
341
345
|
"span",
|
|
342
346
|
{
|
|
@@ -18,7 +18,7 @@ export declare const PROGRESS_BAR_INDETERMINATE_FILL_REDUCED_VERTICAL_CLASS = "b
|
|
|
18
18
|
export declare const PROGRESS_BAR_HEADER_BASE_CLASS = "flex items-baseline justify-between gap-xsmall";
|
|
19
19
|
export declare const PROGRESS_BAR_HEADER_HORIZONTAL_CLASS = "w-full";
|
|
20
20
|
export declare const PROGRESS_BAR_HEADER_VERTICAL_CLASS = "min-w-[8rem]";
|
|
21
|
-
export declare const PROGRESS_BAR_VALUE_CLASS = "tabular-nums text-muted";
|
|
21
|
+
export declare const PROGRESS_BAR_VALUE_CLASS = "tabular-nums text-muted-foreground";
|
|
22
22
|
export declare function progressBarRootClass({ orientation, slotClass, className, }: {
|
|
23
23
|
orientation: ProgressBarOrientation;
|
|
24
24
|
slotClass?: string;
|
|
@@ -29,7 +29,7 @@ const PROGRESS_BAR_INDETERMINATE_FILL_REDUCED_VERTICAL_CLASS = "bottom-1/4 h-1/2
|
|
|
29
29
|
const PROGRESS_BAR_HEADER_BASE_CLASS = "flex items-baseline justify-between gap-xsmall";
|
|
30
30
|
const PROGRESS_BAR_HEADER_HORIZONTAL_CLASS = "w-full";
|
|
31
31
|
const PROGRESS_BAR_HEADER_VERTICAL_CLASS = "min-w-[8rem]";
|
|
32
|
-
const PROGRESS_BAR_VALUE_CLASS = "tabular-nums text-muted";
|
|
32
|
+
const PROGRESS_BAR_VALUE_CLASS = "tabular-nums text-muted-foreground";
|
|
33
33
|
function progressBarRootClass({
|
|
34
34
|
orientation,
|
|
35
35
|
slotClass,
|
|
@@ -53,7 +53,9 @@ export type ProgressBarFieldContextValue = {
|
|
|
53
53
|
errorId: string;
|
|
54
54
|
hintConnected: boolean;
|
|
55
55
|
errorConnected: boolean;
|
|
56
|
+
labelConnected: boolean;
|
|
56
57
|
orientation: ProgressBarOrientation;
|
|
58
|
+
status?: SemanticStatus;
|
|
57
59
|
display: ProgressBarDisplayState | null;
|
|
58
60
|
setDisplay: (next: ProgressBarDisplayState | null) => void;
|
|
59
61
|
};
|
|
@@ -138,6 +140,7 @@ export type ProgressBarTrackAriaProps = {
|
|
|
138
140
|
max: number;
|
|
139
141
|
statusText: string;
|
|
140
142
|
indeterminate: boolean;
|
|
143
|
+
labelConnected: boolean;
|
|
141
144
|
labelId?: string;
|
|
142
145
|
ariaDescribedBy?: string;
|
|
143
146
|
};
|
|
@@ -33,14 +33,15 @@ function useProgressBarRootState({
|
|
|
33
33
|
const setDisplay = useCallback((next) => {
|
|
34
34
|
setDisplayState((prev) => progressBarDisplayEqual(prev, next) ? prev : next);
|
|
35
35
|
}, []);
|
|
36
|
-
const { isCompound, hasHint, hasError } = useMemo(() => {
|
|
36
|
+
const { isCompound, hasLabel, hasHint, hasError } = useMemo(() => {
|
|
37
37
|
const compound = hasCompoundChildren(children);
|
|
38
38
|
return {
|
|
39
39
|
isCompound: compound,
|
|
40
|
+
hasLabel: label != null || compound && hasCompoundChild(children, "ProgressBarLabel", "Label"),
|
|
40
41
|
hasHint: hint != null || compound && hasCompoundChild(children, "ProgressBar.Hint"),
|
|
41
42
|
hasError: error != null || compound && hasCompoundChild(children, "ProgressBar.Error")
|
|
42
43
|
};
|
|
43
|
-
}, [children, error, hint]);
|
|
44
|
+
}, [children, error, hint, label]);
|
|
44
45
|
const fieldCtx = useMemo(
|
|
45
46
|
() => ({
|
|
46
47
|
progressId,
|
|
@@ -48,11 +49,13 @@ function useProgressBarRootState({
|
|
|
48
49
|
errorId,
|
|
49
50
|
hintConnected: hasHint,
|
|
50
51
|
errorConnected: hasError,
|
|
52
|
+
labelConnected: hasLabel,
|
|
51
53
|
orientation,
|
|
54
|
+
status,
|
|
52
55
|
display,
|
|
53
56
|
setDisplay
|
|
54
57
|
}),
|
|
55
|
-
[display, errorId, hasError, hasHint, hintId, orientation, progressId, setDisplay]
|
|
58
|
+
[display, errorId, hasError, hasHint, hasLabel, hintId, orientation, progressId, setDisplay, status]
|
|
56
59
|
);
|
|
57
60
|
const fieldLabelCtx = useMemo(() => ({ labelId }), [labelId]);
|
|
58
61
|
const trackProps = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseProgressBarTrackStateProps } from './progressBarTypes.js';
|
|
2
|
-
export declare function useProgressBarTrackState({ value, indeterminate, min, max, size, thickness, color, status, formatValue, orientation: orientationProp, "aria-describedby": ariaDescribedByProp, }: UseProgressBarTrackStateProps): {
|
|
2
|
+
export declare function useProgressBarTrackState({ value, indeterminate, min, max, size, thickness, color, status: statusProp, formatValue, orientation: orientationProp, "aria-describedby": ariaDescribedByProp, }: UseProgressBarTrackStateProps): {
|
|
3
3
|
size: import('../utils/sizeLayout/index.js').ComponentSize;
|
|
4
4
|
thickness: string | number | undefined;
|
|
5
5
|
color: string | undefined;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useMemo, useLayoutEffect } from "react";
|
|
3
3
|
import { clampNumber } from "../utils/clampNumber.js";
|
|
4
4
|
import { useBurneLabel } from "../../../theme/BurneLabelsProvider.js";
|
|
5
|
-
import { progressBarValueToPercent, defaultProgressBarFormatValue } from "./progressBarAPI.js";
|
|
5
|
+
import { resolveProgressBarBounds, progressBarValueToPercent, defaultProgressBarFormatValue } from "./progressBarAPI.js";
|
|
6
6
|
import { resolveProgressBarDescribedBy, resolveProgressBarTrackAria, progressBarLabelId } from "./progressBarA11y.js";
|
|
7
7
|
import { useOptionalProgressBarFieldContext } from "./progressBarContext.js";
|
|
8
8
|
import { progressBarTrackCrossStyle, progressBarFillColorStyle } from "./progressBarStyles.js";
|
|
@@ -14,7 +14,7 @@ function useProgressBarTrackState({
|
|
|
14
14
|
size = "base",
|
|
15
15
|
thickness,
|
|
16
16
|
color,
|
|
17
|
-
status,
|
|
17
|
+
status: statusProp,
|
|
18
18
|
formatValue = defaultProgressBarFormatValue,
|
|
19
19
|
orientation: orientationProp,
|
|
20
20
|
"aria-describedby": ariaDescribedByProp
|
|
@@ -22,17 +22,23 @@ function useProgressBarTrackState({
|
|
|
22
22
|
const fieldCtx = useOptionalProgressBarFieldContext();
|
|
23
23
|
const loadingStatus = useBurneLabel("loadingStatus");
|
|
24
24
|
const orientation = orientationProp ?? fieldCtx?.orientation ?? "horizontal";
|
|
25
|
+
const status = statusProp ?? fieldCtx?.status;
|
|
25
26
|
const progressId = fieldCtx?.progressId;
|
|
26
27
|
const labelId = progressId != null ? progressBarLabelId(progressId) : void 0;
|
|
28
|
+
const labelConnected = fieldCtx?.labelConnected ?? false;
|
|
27
29
|
const hintConnected = fieldCtx?.hintConnected ?? false;
|
|
28
30
|
const errorConnected = fieldCtx?.errorConnected ?? false;
|
|
31
|
+
const { safeMin, safeMax } = useMemo(
|
|
32
|
+
() => resolveProgressBarBounds(min, max),
|
|
33
|
+
[max, min]
|
|
34
|
+
);
|
|
29
35
|
const clampedValue = useMemo(
|
|
30
|
-
() => clampNumber(value,
|
|
31
|
-
[
|
|
36
|
+
() => value === Number.POSITIVE_INFINITY ? safeMax : clampNumber(value, safeMin, safeMax),
|
|
37
|
+
[safeMax, safeMin, value]
|
|
32
38
|
);
|
|
33
39
|
const percent = useMemo(
|
|
34
|
-
() => progressBarValueToPercent(clampedValue,
|
|
35
|
-
[clampedValue,
|
|
40
|
+
() => progressBarValueToPercent(clampedValue, safeMin, safeMax),
|
|
41
|
+
[clampedValue, safeMax, safeMin]
|
|
36
42
|
);
|
|
37
43
|
const isHorizontal = orientation === "horizontal";
|
|
38
44
|
const statusText = useMemo(() => {
|
|
@@ -48,10 +54,11 @@ function useProgressBarTrackState({
|
|
|
48
54
|
});
|
|
49
55
|
const aria = resolveProgressBarTrackAria({
|
|
50
56
|
clampedValue,
|
|
51
|
-
min,
|
|
52
|
-
max,
|
|
57
|
+
min: safeMin,
|
|
58
|
+
max: safeMax,
|
|
53
59
|
statusText,
|
|
54
60
|
indeterminate,
|
|
61
|
+
labelConnected,
|
|
55
62
|
labelId,
|
|
56
63
|
ariaDescribedBy
|
|
57
64
|
});
|
|
@@ -65,11 +72,11 @@ function useProgressBarTrackState({
|
|
|
65
72
|
setDisplay?.({
|
|
66
73
|
clampedValue,
|
|
67
74
|
statusText,
|
|
68
|
-
min,
|
|
69
|
-
max,
|
|
75
|
+
min: safeMin,
|
|
76
|
+
max: safeMax,
|
|
70
77
|
indeterminate
|
|
71
78
|
});
|
|
72
|
-
}, [clampedValue, indeterminate,
|
|
79
|
+
}, [clampedValue, indeterminate, safeMax, safeMin, setDisplay, statusText]);
|
|
73
80
|
return {
|
|
74
81
|
size,
|
|
75
82
|
thickness,
|
|
@@ -7,7 +7,7 @@ import { RadioSimpleBody } from "./radioParts.js";
|
|
|
7
7
|
import { RadioContent, RadioControl, RadioError, RadioHint, RadioIndicator, RadioLabel } from "./radioParts.js";
|
|
8
8
|
import { RADIO_ROOT_DISABLED_CLASS, radioGridClass } from "./radioStyles.js";
|
|
9
9
|
import { useRadioRootState } from "./useRadioRootState.js";
|
|
10
|
-
import { dataCheckedState, dataVariantProps } from "../utils/dataContract.js";
|
|
10
|
+
import { dataFlag, dataCheckedState, dataVariantProps } from "../utils/dataContract.js";
|
|
11
11
|
import { cn } from "../../../utils/cn.js";
|
|
12
12
|
const RadioRoot = forwardRef(function RadioRoot2({
|
|
13
13
|
children,
|
|
@@ -99,6 +99,7 @@ const RadioRoot = forwardRef(function RadioRoot2({
|
|
|
99
99
|
"label",
|
|
100
100
|
{
|
|
101
101
|
ref,
|
|
102
|
+
htmlFor: state.contextValue.inputId,
|
|
102
103
|
className: gridClass,
|
|
103
104
|
...rest,
|
|
104
105
|
onPointerDown: handlePointerDown,
|
|
@@ -109,6 +110,10 @@ const RadioRoot = forwardRef(function RadioRoot2({
|
|
|
109
110
|
}),
|
|
110
111
|
"data-selected": state.mergedChecked ? "true" : void 0,
|
|
111
112
|
"data-state": dataCheckedState(state.mergedChecked),
|
|
113
|
+
"data-disabled": dataFlag(state.isDisabled),
|
|
114
|
+
"data-readonly": dataFlag(state.isReadOnly),
|
|
115
|
+
"data-invalid": dataFlag(state.isInvalid),
|
|
116
|
+
"data-required": dataFlag(state.isRequired),
|
|
112
117
|
children: state.isCompound ? children : /* @__PURE__ */ jsx(
|
|
113
118
|
RadioSimpleBody,
|
|
114
119
|
{
|