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,62 +1,121 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useId,
|
|
2
|
+
import { useId, useMemo, useState, useRef, useCallback } from "react";
|
|
3
3
|
import { useFormFieldBinding } from "../Form/useFormFieldBinding.js";
|
|
4
4
|
import "../../core/Field/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useNativeFormReset } from "../../core/utils/fieldFormDom.js";
|
|
6
|
+
import { hasCompoundChild } from "../../core/utils/hasCompoundChild.js";
|
|
7
|
+
import { itemsPartTaken } from "../../core/utils/itemsBesideChildren.js";
|
|
8
|
+
import { radioGroupName, findFirstEnabledRadioValue, createRadioGroupKeyDownHandler } from "./radioGroupA11y.js";
|
|
8
9
|
import { useFieldSetHintId, useFieldSetErrorId } from "../../core/Field/Field.js";
|
|
9
10
|
function useRadioGroupRootState({
|
|
10
11
|
required = false,
|
|
11
12
|
value: valueProp,
|
|
12
13
|
defaultValue,
|
|
13
14
|
onValueChange,
|
|
14
|
-
disabled
|
|
15
|
-
readOnly
|
|
15
|
+
disabled: disabledProp,
|
|
16
|
+
readOnly: readOnlyProp,
|
|
16
17
|
name: nameProp,
|
|
18
|
+
error,
|
|
19
|
+
items,
|
|
20
|
+
children,
|
|
21
|
+
onKeyDown,
|
|
22
|
+
onBlur: onBlurProp,
|
|
17
23
|
hintId: hintIdProp,
|
|
18
24
|
errorId: errorIdProp
|
|
19
25
|
}) {
|
|
20
26
|
const autoId = useId();
|
|
21
27
|
const legendId = useId();
|
|
22
|
-
const groupName = radioGroupName(nameProp, autoId);
|
|
23
28
|
const formBinding = useFormFieldBinding({
|
|
24
29
|
name: nameProp,
|
|
25
30
|
value: valueProp,
|
|
26
|
-
disabled,
|
|
27
|
-
readOnly
|
|
31
|
+
disabled: disabledProp,
|
|
32
|
+
readOnly: readOnlyProp
|
|
28
33
|
});
|
|
29
|
-
const
|
|
34
|
+
const groupName = radioGroupName(formBinding.name ?? nameProp, autoId);
|
|
35
|
+
const resolvedDisabled = Boolean(disabledProp ?? formBinding.disabled);
|
|
36
|
+
const resolvedReadOnly = Boolean(readOnlyProp ?? formBinding.readOnly);
|
|
30
37
|
const formBound = formBinding.bound;
|
|
38
|
+
const formInvalid = Boolean(formBound && formBinding.error);
|
|
39
|
+
const hasCompoundError = useMemo(
|
|
40
|
+
() => hasCompoundChild(children, "RadioGroup.Error", "RadioGroupError"),
|
|
41
|
+
[children]
|
|
42
|
+
);
|
|
43
|
+
const resolvedError = error ?? (!hasCompoundError && formBound ? formBinding.error : void 0);
|
|
31
44
|
const formValue = formBound && formBinding.value != null && formBinding.value !== "" ? String(formBinding.value) : null;
|
|
32
45
|
const hintId = useFieldSetHintId(hintIdProp);
|
|
33
46
|
const errorId = useFieldSetErrorId(errorIdProp);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
const controlled = valueProp !== void 0;
|
|
48
|
+
const [internalValue, setInternalValue] = useState(() => defaultValue ?? null);
|
|
49
|
+
const selectedValue = formBound ? formValue : controlled ? valueProp ?? null : internalValue;
|
|
50
|
+
const fieldsetRef = useRef(null);
|
|
51
|
+
const bindFieldsetRef = useCallback(
|
|
52
|
+
(node) => {
|
|
53
|
+
fieldsetRef.current = node;
|
|
54
|
+
if (formBound) {
|
|
55
|
+
const firstInput = node?.querySelector('input[type="radio"]:not(:disabled)');
|
|
56
|
+
formBinding.ref(firstInput ?? node);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
[formBinding, formBound]
|
|
60
|
+
);
|
|
61
|
+
useNativeFormReset(
|
|
62
|
+
fieldsetRef,
|
|
63
|
+
() => {
|
|
64
|
+
setInternalValue(defaultValue ?? null);
|
|
65
|
+
},
|
|
66
|
+
!controlled && !formBound
|
|
67
|
+
);
|
|
68
|
+
const handleBlur = useCallback(
|
|
69
|
+
(event) => {
|
|
70
|
+
onBlurProp?.(event);
|
|
71
|
+
if (formBound && !event.currentTarget.contains(event.relatedTarget)) {
|
|
72
|
+
formBinding.onBlur();
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
[formBinding, formBound, onBlurProp]
|
|
76
|
+
);
|
|
40
77
|
const selectValue = useCallback(
|
|
41
78
|
(next) => {
|
|
42
|
-
if (resolvedReadOnly) return;
|
|
43
|
-
|
|
44
|
-
|
|
79
|
+
if (resolvedReadOnly || resolvedDisabled) return;
|
|
80
|
+
if (required && next == null) return;
|
|
81
|
+
const resolvedNext = next ?? null;
|
|
82
|
+
if (!controlled && !formBound) setInternalValue(resolvedNext);
|
|
83
|
+
onValueChange?.(resolvedNext);
|
|
84
|
+
if (formBound) formBinding.setValue(resolvedNext ?? "");
|
|
45
85
|
},
|
|
46
|
-
[formBinding, formBound,
|
|
86
|
+
[controlled, formBinding, formBound, onValueChange, required, resolvedDisabled, resolvedReadOnly]
|
|
87
|
+
);
|
|
88
|
+
const optionList = useMemo(
|
|
89
|
+
() => items && !itemsPartTaken("RadioGroup", children, "RadioRoot", "RadioGroup.List") ? items : void 0,
|
|
90
|
+
[children, items]
|
|
91
|
+
);
|
|
92
|
+
const requiredAnchorValue = useMemo(
|
|
93
|
+
() => findFirstEnabledRadioValue(optionList, children),
|
|
94
|
+
[children, optionList]
|
|
95
|
+
);
|
|
96
|
+
const isOptionRequired = useCallback(
|
|
97
|
+
(optionValue, optionDisabled) => {
|
|
98
|
+
if (!required || resolvedDisabled || optionDisabled) return false;
|
|
99
|
+
if (requiredAnchorValue === "") return false;
|
|
100
|
+
if (requiredAnchorValue !== null) return optionValue === requiredAnchorValue;
|
|
101
|
+
return true;
|
|
102
|
+
},
|
|
103
|
+
[required, requiredAnchorValue, resolvedDisabled]
|
|
104
|
+
);
|
|
105
|
+
const handleKeyDown = useMemo(
|
|
106
|
+
() => createRadioGroupKeyDownHandler({
|
|
107
|
+
disabled: resolvedDisabled,
|
|
108
|
+
readOnly: resolvedReadOnly,
|
|
109
|
+
groupName,
|
|
110
|
+
selectValue,
|
|
111
|
+
onKeyDown
|
|
112
|
+
}),
|
|
113
|
+
[groupName, onKeyDown, resolvedDisabled, resolvedReadOnly, selectValue]
|
|
47
114
|
);
|
|
48
|
-
const { claimRequiredAnchor: claimAnchor } = useOptionGroupRequiredAnchor([
|
|
49
|
-
required,
|
|
50
|
-
groupName
|
|
51
|
-
]);
|
|
52
|
-
const claimRequiredAnchor = useCallback(() => {
|
|
53
|
-
if (!required) return false;
|
|
54
|
-
return claimAnchor();
|
|
55
|
-
}, [claimAnchor, required]);
|
|
56
115
|
const contextValue = useMemo(
|
|
57
116
|
() => ({
|
|
58
117
|
name: groupName,
|
|
59
|
-
disabled:
|
|
118
|
+
disabled: resolvedDisabled,
|
|
60
119
|
readOnly: resolvedReadOnly,
|
|
61
120
|
required,
|
|
62
121
|
legendId,
|
|
@@ -64,23 +123,35 @@ function useRadioGroupRootState({
|
|
|
64
123
|
errorId,
|
|
65
124
|
selectedValue,
|
|
66
125
|
selectValue,
|
|
67
|
-
|
|
126
|
+
isOptionRequired
|
|
68
127
|
}),
|
|
69
128
|
[
|
|
70
|
-
claimRequiredAnchor,
|
|
71
129
|
errorId,
|
|
72
|
-
formBinding,
|
|
73
|
-
resolvedReadOnly,
|
|
74
130
|
groupName,
|
|
75
131
|
hintId,
|
|
132
|
+
isOptionRequired,
|
|
76
133
|
legendId,
|
|
77
134
|
required,
|
|
135
|
+
resolvedDisabled,
|
|
136
|
+
resolvedReadOnly,
|
|
78
137
|
selectValue,
|
|
79
138
|
selectedValue
|
|
80
139
|
]
|
|
81
140
|
);
|
|
82
141
|
const fieldLabelCtx = useMemo(() => ({ required }), [required]);
|
|
83
|
-
return {
|
|
142
|
+
return {
|
|
143
|
+
contextValue,
|
|
144
|
+
fieldLabelCtx,
|
|
145
|
+
hintId,
|
|
146
|
+
errorId,
|
|
147
|
+
disabled: resolvedDisabled,
|
|
148
|
+
optionList,
|
|
149
|
+
formInvalid,
|
|
150
|
+
resolvedError,
|
|
151
|
+
bindFieldsetRef,
|
|
152
|
+
handleKeyDown,
|
|
153
|
+
handleBlur
|
|
154
|
+
};
|
|
84
155
|
}
|
|
85
156
|
export {
|
|
86
157
|
useRadioGroupRootState
|
|
@@ -7,7 +7,7 @@ import { toggleButtonGroupRootClass } from "./toggleButtonGroupStyles.js";
|
|
|
7
7
|
import { ToggleButtonGroupProvider } from "../../core/ToggleButton/toggleButtonContext.js";
|
|
8
8
|
import { KIT_TOGGLE_BUTTON_VARIANTS } from "../../core/ToggleButton/toggleButtonTypes.js";
|
|
9
9
|
import { isKitVariant } from "../../../skins/resolveVariantVisual.js";
|
|
10
|
-
import { dataVariantProps } from "../../core/utils/dataContract.js";
|
|
10
|
+
import { dataFlag, dataVariantProps } from "../../core/utils/dataContract.js";
|
|
11
11
|
import { cn } from "../../../utils/cn.js";
|
|
12
12
|
import { itemsPartTaken } from "../../core/utils/itemsBesideChildren.js";
|
|
13
13
|
import { ToggleButton } from "../../core/ToggleButton/index.js";
|
|
@@ -147,6 +147,8 @@ function ToggleButtonGroupRootSurface({
|
|
|
147
147
|
...rest,
|
|
148
148
|
...part.pointerHandlers,
|
|
149
149
|
...dataVariantProps({ size, variant }),
|
|
150
|
+
"data-orientation": orientation,
|
|
151
|
+
"data-disabled": dataFlag(disabled),
|
|
150
152
|
children
|
|
151
153
|
}
|
|
152
154
|
);
|
|
@@ -6,7 +6,7 @@ export declare function collectToggleButtons(root: HTMLElement): HTMLButtonEleme
|
|
|
6
6
|
* Falls back to `firstItemValue` before any focus interaction.
|
|
7
7
|
*/
|
|
8
8
|
export declare function resolveToggleButtonTabIndex(itemValue: string, rovingValue: string | undefined, firstItemValue: string | undefined): 0 | -1;
|
|
9
|
-
export declare function resolveToggleButtonArrowTargetIndex(key: string, orientation: ToggleButtonGroupOrientation, currentIndex: number, itemCount: number): number | null;
|
|
9
|
+
export declare function resolveToggleButtonArrowTargetIndex(key: string, orientation: ToggleButtonGroupOrientation, currentIndex: number, itemCount: number, rtl?: boolean): number | null;
|
|
10
10
|
/**
|
|
11
11
|
* Arrows / Home / End move focus only (roving). Enter / Space stay on the
|
|
12
12
|
* focused `<button>` and toggle/select via native activation + click handler.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { focusKeyboard } from "../../core/utils/focusElement.js";
|
|
2
|
+
import { isRtlElement } from "../../core/utils/readingDirection.js";
|
|
2
3
|
function collectToggleButtons(root) {
|
|
3
4
|
return Array.from(root.querySelectorAll("[data-value]:not([disabled])")).filter(
|
|
4
5
|
(el) => el instanceof HTMLButtonElement
|
|
@@ -6,16 +7,20 @@ function collectToggleButtons(root) {
|
|
|
6
7
|
}
|
|
7
8
|
function resolveToggleButtonTabIndex(itemValue, rovingValue, firstItemValue) {
|
|
8
9
|
const active = rovingValue ?? firstItemValue;
|
|
9
|
-
return itemValue === active ? 0 : -1;
|
|
10
|
+
return active !== void 0 && itemValue === active ? 0 : -1;
|
|
10
11
|
}
|
|
11
|
-
function resolveToggleButtonArrowTargetIndex(key, orientation, currentIndex, itemCount) {
|
|
12
|
+
function resolveToggleButtonArrowTargetIndex(key, orientation, currentIndex, itemCount, rtl = false) {
|
|
12
13
|
if (itemCount === 0) return null;
|
|
13
14
|
const horizontal = orientation === "horizontal";
|
|
15
|
+
const nextKey = rtl ? "ArrowLeft" : "ArrowRight";
|
|
16
|
+
const prevKey = rtl ? "ArrowRight" : "ArrowLeft";
|
|
17
|
+
if (horizontal && key === nextKey) {
|
|
18
|
+
return currentIndex < 0 ? 0 : (currentIndex + 1) % itemCount;
|
|
19
|
+
}
|
|
20
|
+
if (horizontal && key === prevKey) {
|
|
21
|
+
return currentIndex < 0 ? itemCount - 1 : (currentIndex - 1 + itemCount) % itemCount;
|
|
22
|
+
}
|
|
14
23
|
switch (key) {
|
|
15
|
-
case "ArrowRight":
|
|
16
|
-
return horizontal ? currentIndex < 0 ? 0 : (currentIndex + 1) % itemCount : null;
|
|
17
|
-
case "ArrowLeft":
|
|
18
|
-
return horizontal ? currentIndex < 0 ? itemCount - 1 : (currentIndex - 1 + itemCount) % itemCount : null;
|
|
19
24
|
case "ArrowDown":
|
|
20
25
|
return !horizontal ? currentIndex < 0 ? 0 : (currentIndex + 1) % itemCount : null;
|
|
21
26
|
case "ArrowUp":
|
|
@@ -44,7 +49,8 @@ function createToggleButtonGroupKeyDownHandler({
|
|
|
44
49
|
event.key,
|
|
45
50
|
orientation,
|
|
46
51
|
currentIndex,
|
|
47
|
-
items.length
|
|
52
|
+
items.length,
|
|
53
|
+
isRtlElement(event.currentTarget)
|
|
48
54
|
);
|
|
49
55
|
if (nextIndex == null) return;
|
|
50
56
|
event.preventDefault();
|
|
@@ -5,6 +5,8 @@ export { flattenFragmentChildren };
|
|
|
5
5
|
export declare function isToggleButtonChild(child: ReactElement): boolean;
|
|
6
6
|
export declare function countToggleButtonChildren(children: ReactElement[]): number;
|
|
7
7
|
export declare function extractToggleItemValues(children: ReactElement[]): string[];
|
|
8
|
+
export declare function extractEnabledToggleItemValues(children: ReactElement[], groupDisabled?: boolean): string[];
|
|
9
|
+
export declare function extractDisabledToggleItemValues(children: ReactElement[]): Set<string>;
|
|
8
10
|
export declare function normalizeMultipleDefault(value: string | string[] | null | undefined): string[];
|
|
9
11
|
export declare function normalizeSingleDefault(value: string | string[] | null | undefined): string | undefined;
|
|
10
12
|
export declare function isToggleButtonGroupItemSelected(type: ToggleButtonGroupType, itemValue: string, singleValue: string | undefined, multipleValues: string[]): boolean;
|
|
@@ -5,14 +5,28 @@ function isToggleButtonChild(child) {
|
|
|
5
5
|
function countToggleButtonChildren(children) {
|
|
6
6
|
return children.reduce((n, el) => n + (isToggleButtonChild(el) ? 1 : 0), 0);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function extractEnabledToggleItemValues(children, groupDisabled = false) {
|
|
9
|
+
if (groupDisabled) return [];
|
|
9
10
|
return children.reduce((acc, el) => {
|
|
10
11
|
if (!isToggleButtonChild(el)) return acc;
|
|
11
|
-
const
|
|
12
|
-
if (typeof value === "string")
|
|
12
|
+
const props = el.props;
|
|
13
|
+
if (!props.disabled && typeof props.value === "string") {
|
|
14
|
+
acc.push(props.value);
|
|
15
|
+
}
|
|
13
16
|
return acc;
|
|
14
17
|
}, []);
|
|
15
18
|
}
|
|
19
|
+
function extractDisabledToggleItemValues(children) {
|
|
20
|
+
const set = /* @__PURE__ */ new Set();
|
|
21
|
+
for (const el of children) {
|
|
22
|
+
if (!isToggleButtonChild(el)) continue;
|
|
23
|
+
const props = el.props;
|
|
24
|
+
if (props.disabled && typeof props.value === "string") {
|
|
25
|
+
set.add(props.value);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return set;
|
|
29
|
+
}
|
|
16
30
|
function normalizeMultipleDefault(value) {
|
|
17
31
|
if (value == null) return [];
|
|
18
32
|
return Array.isArray(value) ? value : [value];
|
|
@@ -35,7 +49,8 @@ function resolveToggleButtonGroupSelectionChange(type, itemValue, singleValue, m
|
|
|
35
49
|
}
|
|
36
50
|
export {
|
|
37
51
|
countToggleButtonChildren,
|
|
38
|
-
|
|
52
|
+
extractDisabledToggleItemValues,
|
|
53
|
+
extractEnabledToggleItemValues,
|
|
39
54
|
isToggleButtonChild,
|
|
40
55
|
isToggleButtonGroupItemSelected,
|
|
41
56
|
normalizeMultipleDefault,
|
|
@@ -3,7 +3,7 @@ import { useState, useMemo, useRef, useCallback } from "react";
|
|
|
3
3
|
import { useSkinVariant } from "../../../skins/skinContext.js";
|
|
4
4
|
import { toggleOptionListSelection } from "../../core/utils/optionListSelection.js";
|
|
5
5
|
import { resolveToggleButtonTabIndex, createToggleButtonGroupKeyDownHandler } from "./toggleButtonGroupA11y.js";
|
|
6
|
-
import { normalizeSingleDefault, normalizeMultipleDefault, countToggleButtonChildren,
|
|
6
|
+
import { normalizeSingleDefault, normalizeMultipleDefault, countToggleButtonChildren, extractEnabledToggleItemValues, extractDisabledToggleItemValues, isToggleButtonGroupItemSelected, resolveToggleButtonGroupSelectionChange } from "./toggleButtonGroupAPI.js";
|
|
7
7
|
import { flattenFragmentChildren } from "../ButtonGroup/buttonGroupAPI.js";
|
|
8
8
|
function useToggleButtonGroupRootState({
|
|
9
9
|
children,
|
|
@@ -41,16 +41,26 @@ function useToggleButtonGroupRootState({
|
|
|
41
41
|
latestMultipleRef.current = multipleValues;
|
|
42
42
|
const flat = useMemo(() => flattenFragmentChildren(children), [children]);
|
|
43
43
|
const segmentCount = useMemo(() => countToggleButtonChildren(flat), [flat]);
|
|
44
|
-
const
|
|
44
|
+
const enabledToggleValues = useMemo(
|
|
45
|
+
() => extractEnabledToggleItemValues(flat, disabled),
|
|
46
|
+
[disabled, flat]
|
|
47
|
+
);
|
|
48
|
+
const disabledToggleValues = useMemo(
|
|
49
|
+
() => extractDisabledToggleItemValues(flat),
|
|
50
|
+
[flat]
|
|
51
|
+
);
|
|
52
|
+
const enabledSet = useMemo(() => new Set(enabledToggleValues), [enabledToggleValues]);
|
|
53
|
+
const firstEnabledToggleValue = enabledToggleValues[0];
|
|
45
54
|
const [rovingValue, setRovingValue] = useState(void 0);
|
|
46
|
-
const
|
|
55
|
+
const candidateRoving = rovingValue ?? (isSingle ? singleValue : multipleValues.find((v) => enabledSet.has(v)));
|
|
56
|
+
const resolvedRovingValue = candidateRoving != null && enabledSet.has(candidateRoving) ? candidateRoving : firstEnabledToggleValue;
|
|
47
57
|
const isSelected = useCallback(
|
|
48
58
|
(itemValue) => isToggleButtonGroupItemSelected(type, itemValue, singleValue, multipleValues),
|
|
49
59
|
[multipleValues, singleValue, type]
|
|
50
60
|
);
|
|
51
61
|
const select = useCallback(
|
|
52
62
|
(itemValue) => {
|
|
53
|
-
if (disabled) return;
|
|
63
|
+
if (disabled || disabledToggleValues.has(itemValue)) return;
|
|
54
64
|
if (isSingle) {
|
|
55
65
|
const change = resolveToggleButtonGroupSelectionChange(
|
|
56
66
|
type,
|
|
@@ -68,11 +78,14 @@ function useToggleButtonGroupRootState({
|
|
|
68
78
|
if (!isControlled) setInternalMultiple(next);
|
|
69
79
|
onValuesChange?.(next);
|
|
70
80
|
},
|
|
71
|
-
[disabled, isControlled, isSingle, multipleValues, onValueChange, onValuesChange, singleValue, type]
|
|
81
|
+
[disabled, disabledToggleValues, isControlled, isSingle, multipleValues, onValueChange, onValuesChange, singleValue, type]
|
|
72
82
|
);
|
|
73
83
|
const tabIndexFor = useCallback(
|
|
74
|
-
(itemValue) =>
|
|
75
|
-
|
|
84
|
+
(itemValue) => {
|
|
85
|
+
if (disabled || disabledToggleValues.has(itemValue)) return -1;
|
|
86
|
+
return resolveToggleButtonTabIndex(itemValue, resolvedRovingValue, firstEnabledToggleValue);
|
|
87
|
+
},
|
|
88
|
+
[disabled, disabledToggleValues, firstEnabledToggleValue, resolvedRovingValue]
|
|
76
89
|
);
|
|
77
90
|
const contextValue = useMemo(
|
|
78
91
|
() => ({
|
|
@@ -5,7 +5,7 @@ export type { OptionGroupOrientation };
|
|
|
5
5
|
export type OptionGroupFieldsetProps = Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children"> & Pick<FieldSetProps, "hintId" | "errorId" | "size" | "classNames" | "invalid"> & {
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
};
|
|
8
|
-
export declare const OptionGroupFieldset: import('react').ForwardRefExoticComponent<Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children"> & Pick<FieldSetProps, "size" | "
|
|
8
|
+
export declare const OptionGroupFieldset: import('react').ForwardRefExoticComponent<Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children"> & Pick<FieldSetProps, "size" | "classNames" | "invalid" | "hintId" | "errorId"> & {
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
} & import('react').RefAttributes<HTMLFieldSetElement>>;
|
|
11
11
|
export type OptionGroupLegendProps = HTMLAttributes<HTMLLegendElement>;
|
|
@@ -97,6 +97,8 @@ const AlertRoot = forwardRef(function Alert({
|
|
|
97
97
|
children,
|
|
98
98
|
onPointerOver,
|
|
99
99
|
onPointerOut,
|
|
100
|
+
onPointerDown,
|
|
101
|
+
onPointerUp,
|
|
100
102
|
"aria-labelledby": ariaLabelledByProp,
|
|
101
103
|
"aria-describedby": ariaDescribedByProp,
|
|
102
104
|
...rest
|
|
@@ -167,7 +169,7 @@ const AlertRoot = forwardRef(function Alert({
|
|
|
167
169
|
action,
|
|
168
170
|
onPointerOver,
|
|
169
171
|
onPointerOut,
|
|
170
|
-
rest,
|
|
172
|
+
rest: { ...rest, onPointerDown, onPointerUp },
|
|
171
173
|
children
|
|
172
174
|
}
|
|
173
175
|
)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRef, useCallback, useMemo } from "react";
|
|
2
|
+
import { useRef, useCallback, useLayoutEffect, useMemo } from "react";
|
|
3
3
|
import { mergeForwardedRef } from "../utils/mergeRefs.js";
|
|
4
|
-
import {
|
|
4
|
+
import { useMotionConfig } from "../utils/motionConfigContext.js";
|
|
5
|
+
import { isKitHoverLiftRecipe, primeInteractiveScaleRest, shouldSkipInteractiveHoverLift } from "../utils/hoverInteractiveLift.js";
|
|
5
6
|
import { useSecondLevelShadow } from "../utils/useShadowMotion.js";
|
|
6
7
|
import { overlaySkinMotion, usesKitElevation } from "../../../skins/resolveVariantVisual.js";
|
|
7
8
|
import { cn } from "../../../utils/cn.js";
|
|
@@ -48,10 +49,20 @@ function useAlertAnimations({
|
|
|
48
49
|
[ref, scope]
|
|
49
50
|
);
|
|
50
51
|
useOptionalEnterOnMount(scope, "root", rootRef);
|
|
52
|
+
const config = useMotionConfig();
|
|
51
53
|
const secondLevelLift = useSecondLevelShadow(rootRef, kitSurface, {
|
|
52
54
|
shadowSize: shadow,
|
|
53
|
-
interactive: false
|
|
55
|
+
interactive: false,
|
|
56
|
+
killMotionOnUnmount: false
|
|
54
57
|
});
|
|
58
|
+
useLayoutEffect(() => {
|
|
59
|
+
if (!kitSurface) return;
|
|
60
|
+
const enterValue = scope.resolve("root", "enter", rootMotionRef.current);
|
|
61
|
+
const hoverValue = scope.resolve("root", "hoverIn", rootMotionRef.current);
|
|
62
|
+
if ((enterValue == null || enterValue === false) && isKitHoverLiftRecipe(hoverValue)) {
|
|
63
|
+
primeInteractiveScaleRest(rootRef.current, config);
|
|
64
|
+
}
|
|
65
|
+
}, [config, kitSurface, scope, variant]);
|
|
55
66
|
const motionPointer = useMotionPointerPhases({
|
|
56
67
|
enabled: true,
|
|
57
68
|
targetRef: rootRef,
|
|
@@ -9,4 +9,4 @@ export declare function alertIndicatorClass(status: AlertStatus, iconSvgClass: s
|
|
|
9
9
|
export declare const ALERT_COMPOUND_CONTENTS_CLASS = "contents";
|
|
10
10
|
export declare const ALERT_TITLE_CLASS = "font-w-mid";
|
|
11
11
|
export declare function alertTitleClass(status: AlertStatus): string;
|
|
12
|
-
export declare const ALERT_DESCRIPTION_CLASS = "text-muted";
|
|
12
|
+
export declare const ALERT_DESCRIPTION_CLASS = "text-muted-foreground";
|
|
@@ -27,7 +27,7 @@ function alertTitleClass(status) {
|
|
|
27
27
|
status !== "default" ? SEMANTIC_STATUS_TEXT[status] : ""
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
|
-
const ALERT_DESCRIPTION_CLASS = "text-muted";
|
|
30
|
+
const ALERT_DESCRIPTION_CLASS = "text-muted-foreground";
|
|
31
31
|
export {
|
|
32
32
|
ALERT_COMPOUND_CONTENTS_CLASS,
|
|
33
33
|
ALERT_DESCRIPTION_CLASS,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, useMemo, Children, isValidElement } from "react";
|
|
3
|
+
import { forwardRef, useMemo, Children, isValidElement, Fragment } from "react";
|
|
4
|
+
import { useSkinVariant } from "../../../skins/skinContext.js";
|
|
4
5
|
import { resolveAppShellMotionDefaults, useAppShellRootMotion, useAppShellBodyMotion, useAppShellMainMotion } from "./appShellAnimations.js";
|
|
5
6
|
import { AppShellMotionProvider } from "./appShellContext.js";
|
|
6
7
|
import { appShellRootClass, appShellBodyClass, appShellMainClass } from "./appShellStyles.js";
|
|
@@ -14,19 +15,29 @@ function sidebarEdge(child) {
|
|
|
14
15
|
const side = child.props.side;
|
|
15
16
|
return side === "end" ? "end" : "start";
|
|
16
17
|
}
|
|
18
|
+
function flattenShellChildren(children, out = []) {
|
|
19
|
+
Children.forEach(children, (child) => {
|
|
20
|
+
if (isValidElement(child) && child.type === Fragment) {
|
|
21
|
+
flattenShellChildren(child.props.children, out);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
out.push(child);
|
|
25
|
+
});
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
17
28
|
function splitShell(children) {
|
|
18
29
|
const header = [];
|
|
19
30
|
const leading = [];
|
|
20
31
|
const trailing = [];
|
|
21
32
|
const main = [];
|
|
22
|
-
|
|
33
|
+
for (const child of flattenShellChildren(children)) {
|
|
23
34
|
const name = partName(child);
|
|
24
35
|
if (name === "Header") header.push(child);
|
|
25
36
|
else if (name === "Sidebar") {
|
|
26
37
|
if (sidebarEdge(child) === "end") trailing.push(child);
|
|
27
38
|
else leading.push(child);
|
|
28
39
|
} else main.push(child);
|
|
29
|
-
}
|
|
40
|
+
}
|
|
30
41
|
return { header, leading, trailing, main };
|
|
31
42
|
}
|
|
32
43
|
const AppShell = forwardRef(function AppShell2({
|
|
@@ -95,6 +106,7 @@ function AppShellSurface({
|
|
|
95
106
|
onPointerUp,
|
|
96
107
|
rest
|
|
97
108
|
}) {
|
|
109
|
+
const skinVariant = useSkinVariant(void 0);
|
|
98
110
|
const part = useAppShellRootMotion({
|
|
99
111
|
forwardedRef,
|
|
100
112
|
motion: rootMotion,
|
|
@@ -107,7 +119,7 @@ function AppShellSurface({
|
|
|
107
119
|
"div",
|
|
108
120
|
{
|
|
109
121
|
ref: part.setRef,
|
|
110
|
-
className: appShellRootClass({ slotClass: classNames?.root, className }),
|
|
122
|
+
className: appShellRootClass({ skinVariant, slotClass: classNames?.root, className }),
|
|
111
123
|
...rest,
|
|
112
124
|
...part.pointerHandlers,
|
|
113
125
|
children: [
|
|
@@ -18,7 +18,7 @@ function useAppShellSlot(slot, {
|
|
|
18
18
|
onPointerUp
|
|
19
19
|
}) {
|
|
20
20
|
const scope = useAppShellMotionScope();
|
|
21
|
-
const pointer = hasPointerPhases(motion);
|
|
21
|
+
const pointer = hasPointerPhases(motion ?? scope?.getRootMotion()?.[slot]);
|
|
22
22
|
const part = useMotionPart({
|
|
23
23
|
scope,
|
|
24
24
|
slot: APP_SHELL_MOTION_SLOTS[slot].slot,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export declare const APP_SHELL_ROOT_CLASS = "flex min-h-dvh w-full min-w-0 flex-col bg-background";
|
|
1
|
+
export declare const APP_SHELL_ROOT_CLASS = "flex min-h-dvh w-full min-w-0 flex-col bg-background text-foreground";
|
|
2
2
|
export declare const APP_SHELL_BODY_CLASS = "flex min-h-0 w-full min-w-0 flex-1";
|
|
3
3
|
export declare const APP_SHELL_MAIN_CLASS = "min-h-0 min-w-0 flex-1";
|
|
4
|
-
export declare function appShellRootClass({ slotClass, className, }: {
|
|
4
|
+
export declare function appShellRootClass({ skinVariant, slotClass, className, }: {
|
|
5
|
+
skinVariant?: string;
|
|
5
6
|
slotClass?: string;
|
|
6
7
|
className?: string;
|
|
7
8
|
}): string;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { layoutTargetClass } from "../../../skins/resolveVariantVisual.js";
|
|
2
2
|
import { cn } from "../../../utils/cn.js";
|
|
3
|
-
const APP_SHELL_ROOT_CLASS = "flex min-h-dvh w-full min-w-0 flex-col bg-background";
|
|
3
|
+
const APP_SHELL_ROOT_CLASS = "flex min-h-dvh w-full min-w-0 flex-col bg-background text-foreground";
|
|
4
4
|
const APP_SHELL_BODY_CLASS = "flex min-h-0 w-full min-w-0 flex-1";
|
|
5
5
|
const APP_SHELL_MAIN_CLASS = "min-h-0 min-w-0 flex-1";
|
|
6
6
|
function appShellRootClass({
|
|
7
|
+
skinVariant,
|
|
7
8
|
slotClass,
|
|
8
9
|
className
|
|
9
10
|
}) {
|
|
10
|
-
return cn(
|
|
11
|
+
return cn(
|
|
12
|
+
APP_SHELL_ROOT_CLASS,
|
|
13
|
+
layoutTargetClass("appShell.root", skinVariant),
|
|
14
|
+
slotClass,
|
|
15
|
+
className
|
|
16
|
+
);
|
|
11
17
|
}
|
|
12
18
|
function appShellBodyClass({ slotClass }) {
|
|
13
19
|
return cn(APP_SHELL_BODY_CLASS, slotClass);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useMemo } from "react";
|
|
4
|
+
import { useSkinVariant } from "../../../skins/skinContext.js";
|
|
4
5
|
import { resolveAspectRatioMotionDefaults, useAspectRatioRootMotion, useAspectRatioContentMotion } from "./aspectRatioAnimations.js";
|
|
5
6
|
import { AspectRatioMotionProvider } from "./aspectRatioContext.js";
|
|
6
|
-
import { aspectRatioRootClass, aspectRatioContentClass } from "./aspectRatioStyles.js";
|
|
7
|
+
import { resolveSafeAspectRatio, aspectRatioRootClass, aspectRatioContentClass } from "./aspectRatioStyles.js";
|
|
7
8
|
const AspectRatio = forwardRef(function AspectRatio2({
|
|
8
9
|
ratio = 1,
|
|
9
10
|
className = "",
|
|
@@ -64,6 +65,8 @@ function AspectRatioSurface({
|
|
|
64
65
|
onPointerUp,
|
|
65
66
|
rest
|
|
66
67
|
}) {
|
|
68
|
+
const skinVariant = useSkinVariant(void 0);
|
|
69
|
+
const safeRatio = resolveSafeAspectRatio(ratio);
|
|
67
70
|
const part = useAspectRatioRootMotion({
|
|
68
71
|
forwardedRef,
|
|
69
72
|
motion: rootMotion,
|
|
@@ -76,10 +79,10 @@ function AspectRatioSurface({
|
|
|
76
79
|
"div",
|
|
77
80
|
{
|
|
78
81
|
ref: part.setRef,
|
|
79
|
-
className: aspectRatioRootClass({ slotClass: classNames?.root, className }),
|
|
82
|
+
className: aspectRatioRootClass({ skinVariant, slotClass: classNames?.root, className }),
|
|
80
83
|
...rest,
|
|
81
84
|
...part.pointerHandlers,
|
|
82
|
-
style: { ...rest.style, aspectRatio:
|
|
85
|
+
style: { ...rest.style, aspectRatio: safeRatio },
|
|
83
86
|
children: /* @__PURE__ */ jsx(AspectRatioContent, { slotClass: classNames?.content, motion: contentMotion, children })
|
|
84
87
|
}
|
|
85
88
|
);
|
|
@@ -17,7 +17,7 @@ function useAspectSlot(slot, {
|
|
|
17
17
|
onPointerUp
|
|
18
18
|
}) {
|
|
19
19
|
const scope = useAspectRatioMotionScope();
|
|
20
|
-
const pointer = hasPointerPhases(motion);
|
|
20
|
+
const pointer = hasPointerPhases(motion ?? scope?.getRootMotion()?.[slot]);
|
|
21
21
|
const part = useMotionPart({
|
|
22
22
|
scope,
|
|
23
23
|
slot: ASPECT_RATIO_MOTION_SLOTS[slot].slot,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { AspectRatioValue } from './aspectRatioTypes.js';
|
|
2
|
+
export declare const ASPECT_RATIO_ROOT_CLASS = "relative w-full min-w-0 shrink-0";
|
|
2
3
|
export declare const ASPECT_RATIO_CONTENT_CLASS = "absolute inset-0 size-full min-h-0 min-w-0 overflow-hidden";
|
|
3
|
-
export declare function
|
|
4
|
+
export declare function resolveSafeAspectRatio(ratio: AspectRatioValue | undefined): AspectRatioValue;
|
|
5
|
+
export declare function aspectRatioRootClass({ skinVariant, slotClass, className, }: {
|
|
6
|
+
skinVariant?: string;
|
|
4
7
|
slotClass?: string;
|
|
5
8
|
className?: string;
|
|
6
9
|
}): string;
|
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import { layoutTargetClass } from "../../../skins/resolveVariantVisual.js";
|
|
2
2
|
import { cn } from "../../../utils/cn.js";
|
|
3
|
-
const ASPECT_RATIO_ROOT_CLASS = "relative w-full min-w-0";
|
|
3
|
+
const ASPECT_RATIO_ROOT_CLASS = "relative w-full min-w-0 shrink-0";
|
|
4
4
|
const ASPECT_RATIO_CONTENT_CLASS = "absolute inset-0 size-full min-h-0 min-w-0 overflow-hidden";
|
|
5
|
+
function resolveSafeAspectRatio(ratio) {
|
|
6
|
+
if (typeof ratio === "number") {
|
|
7
|
+
return Number.isFinite(ratio) && ratio > 0 ? ratio : 1;
|
|
8
|
+
}
|
|
9
|
+
if (typeof ratio === "string") {
|
|
10
|
+
const parts = ratio.split("/");
|
|
11
|
+
if (parts.length === 2) {
|
|
12
|
+
const w = Number(parts[0]);
|
|
13
|
+
const h = Number(parts[1]);
|
|
14
|
+
if (Number.isFinite(w) && Number.isFinite(h) && w > 0 && h > 0) {
|
|
15
|
+
return ratio;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return 1;
|
|
19
|
+
}
|
|
20
|
+
return 1;
|
|
21
|
+
}
|
|
5
22
|
function aspectRatioRootClass({
|
|
23
|
+
skinVariant,
|
|
6
24
|
slotClass,
|
|
7
25
|
className
|
|
8
26
|
}) {
|
|
9
|
-
return cn(
|
|
27
|
+
return cn(
|
|
28
|
+
ASPECT_RATIO_ROOT_CLASS,
|
|
29
|
+
layoutTargetClass("aspectRatio.root", skinVariant),
|
|
30
|
+
slotClass,
|
|
31
|
+
className
|
|
32
|
+
);
|
|
10
33
|
}
|
|
11
34
|
function aspectRatioContentClass({
|
|
12
35
|
slotClass,
|
|
@@ -18,5 +41,6 @@ export {
|
|
|
18
41
|
ASPECT_RATIO_CONTENT_CLASS,
|
|
19
42
|
ASPECT_RATIO_ROOT_CLASS,
|
|
20
43
|
aspectRatioContentClass,
|
|
21
|
-
aspectRatioRootClass
|
|
44
|
+
aspectRatioRootClass,
|
|
45
|
+
resolveSafeAspectRatio
|
|
22
46
|
};
|