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,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { clearMotionTransform, killMotion } from "../utils/gsapMotion.js";
|
|
3
3
|
import { useRef, useCallback, useMemo, useLayoutEffect, useEffect } from "react";
|
|
4
|
-
import { initElementShadow, isInteractivePressKey, shouldSkipInteractiveHoverLift, shadowNone } from "../utils/hoverInteractiveLift.js";
|
|
4
|
+
import { initElementShadow, isKitHoverLiftRecipe, primeInteractiveScaleRest, isInteractivePressKey, shouldSkipInteractiveHoverLift, shadowNone } from "../utils/hoverInteractiveLift.js";
|
|
5
5
|
import { mergeForwardedRef } from "../utils/mergeRefs.js";
|
|
6
|
+
import { useMotionConfig } from "../utils/motionConfigContext.js";
|
|
6
7
|
import { isOverlayTriggerOpening } from "../utils/overlayTriggerSqueeze.js";
|
|
7
8
|
import { shadowMotionFor } from "../utils/useShadowMotion.js";
|
|
8
9
|
import { overlaySkinMotion, usesKitElevationMember } from "../../../skins/resolveVariantVisual.js";
|
|
@@ -35,6 +36,7 @@ function resolveButtonMotionDefaults({
|
|
|
35
36
|
}
|
|
36
37
|
function useButtonAnimations({
|
|
37
38
|
variant,
|
|
39
|
+
disabled,
|
|
38
40
|
blocked,
|
|
39
41
|
groupSegment,
|
|
40
42
|
motion,
|
|
@@ -73,18 +75,27 @@ function useButtonAnimations({
|
|
|
73
75
|
"root",
|
|
74
76
|
btnRef
|
|
75
77
|
);
|
|
78
|
+
const config = useMotionConfig();
|
|
76
79
|
const btnShadow = useMemo(
|
|
77
80
|
() => hasHoverShadow ? shadowMotionFor("none") : void 0,
|
|
78
81
|
[hasHoverShadow]
|
|
79
82
|
);
|
|
80
83
|
useLayoutEffect(() => {
|
|
81
|
-
if (!enabled ||
|
|
84
|
+
if (!enabled || useContentRef) return;
|
|
82
85
|
if (hoverPointerInsideRef.current) return;
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
const el = btnRef.current;
|
|
87
|
+
if (btnShadow) initElementShadow(el, shadowNone());
|
|
88
|
+
const enterValue = scope.resolve("root", "enter", rootMotionRef.current);
|
|
89
|
+
const hoverValue = scope.resolve("root", "hoverIn", rootMotionRef.current);
|
|
90
|
+
if ((enterValue == null || enterValue === false) && isKitHoverLiftRecipe(hoverValue)) {
|
|
91
|
+
primeInteractiveScaleRest(el, config);
|
|
92
|
+
}
|
|
93
|
+
}, [btnShadow, config, enabled, hoverPointerInsideRef, scope, useContentRef, variant]);
|
|
85
94
|
useEffect(() => {
|
|
86
|
-
if (enabled)
|
|
87
|
-
|
|
95
|
+
if (!enabled) {
|
|
96
|
+
hoverPointerInsideRef.current = false;
|
|
97
|
+
}
|
|
98
|
+
if (!disabled) return;
|
|
88
99
|
const el = btnRef.current;
|
|
89
100
|
const content = contentMotionRef.current;
|
|
90
101
|
if (el) {
|
|
@@ -97,7 +108,7 @@ function useButtonAnimations({
|
|
|
97
108
|
killMotion(content);
|
|
98
109
|
content.style.transform = "";
|
|
99
110
|
}
|
|
100
|
-
}, [enabled, hoverPointerInsideRef]);
|
|
111
|
+
}, [disabled, enabled, hoverPointerInsideRef]);
|
|
101
112
|
useEffect(() => {
|
|
102
113
|
const contentRef = contentMotionRef;
|
|
103
114
|
return () => {
|
|
@@ -55,8 +55,8 @@ const ButtonContent = forwardRef(
|
|
|
55
55
|
const slotClassNames = useButtonClassNames();
|
|
56
56
|
const scope = useOptionalButtonMotionScope();
|
|
57
57
|
const setRef = (node) => {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
mergeForwardedRef(ref, node);
|
|
59
|
+
if (ctx?.contentMotionRef) ctx.contentMotionRef.current = node;
|
|
60
60
|
if (ctx?.groupSegment) scope?.registerTarget("root", node);
|
|
61
61
|
};
|
|
62
62
|
return /* @__PURE__ */ jsx(
|
|
@@ -15,9 +15,10 @@ export declare const BUTTON_STATUS_RIPPLE: Record<ButtonStatus, string>;
|
|
|
15
15
|
export declare const BUTTON_PRIMARY_STATUS_RIPPLE: Record<SemanticSurfaceStatus, string>;
|
|
16
16
|
export declare const BUTTON_ICON_SLOT_SIZE: Record<ButtonSize, string>;
|
|
17
17
|
export declare const BUTTON_SIZE_TEXT_VARIANT: Record<ButtonSize, TextVariant>;
|
|
18
|
-
export declare const BUTTON_BASE_INTERACTIVE_CLASS = "relative inline-flex items-center justify-center outline-none focus-ring disabled:pointer-events-none";
|
|
18
|
+
export declare const BUTTON_BASE_INTERACTIVE_CLASS = "relative inline-flex items-center justify-center outline-none focus-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50";
|
|
19
19
|
export declare const BUTTON_CONTENT_MOTION_CLASS = "relative z-[1] grid w-full min-w-0 place-items-center";
|
|
20
|
-
|
|
20
|
+
/** Marker so overlay press scales this node, not the segment shell that paints the fill. */
|
|
21
|
+
export declare const BUTTON_CONTENT_MOTION_GROUP_CLASS = "button-group-motion origin-center";
|
|
21
22
|
export declare const BUTTON_LABEL_LAYER_CLASS = "col-start-1 row-start-1 inline-flex w-full min-w-0 items-center justify-center gap-xsmall";
|
|
22
23
|
export declare const BUTTON_LEFT_ICON_SLOT_CLASS = "inline-flex shrink-0 items-center justify-center icon-slot";
|
|
23
24
|
export declare const BUTTON_LABEL_TEXT_CLASS = "min-w-0 shrink";
|
|
@@ -41,7 +42,7 @@ export declare function buttonLoaderTextClass(variant: ButtonVariant, status: Bu
|
|
|
41
42
|
export declare function buttonConvergeRippleColor(variant: ButtonVariant, status: ButtonStatus): string;
|
|
42
43
|
export declare const BUTTON_CONTROL_HEIGHT_CLASS: Record<ComponentSize, string>;
|
|
43
44
|
export declare function controlShellClass(size: ComponentSize, minW?: string): string;
|
|
44
|
-
export declare function buttonRootClass(size: ComponentSize,
|
|
45
|
+
export declare function buttonRootClass(size: ComponentSize, _iconOnly?: boolean): string;
|
|
45
46
|
export declare function buttonSpinnerClass(size: ComponentSize): string;
|
|
46
47
|
export declare function buttonSpinnerInnerClass(): string;
|
|
47
48
|
export declare function buttonContentClass({ groupSegment, slotClass, className, }: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SEMANTIC_STATUS_FILL_TEXT, SEMANTIC_STATUS_TEXT, SEMANTIC_STATUS_OUTLINE_BORDER, SEMANTIC_STATUS_FILL
|
|
1
|
+
import { SEMANTIC_STATUS_FILL_TEXT, SEMANTIC_STATUS_TEXT, SEMANTIC_STATUS_SURFACE_TINT, SEMANTIC_STATUS_OUTLINE_BORDER, SEMANTIC_STATUS_FILL } from "../utils/semanticStatusSurface.js";
|
|
2
2
|
import { hoverVariant } from "../utils/hoverVariant.js";
|
|
3
3
|
import { SHADOW_LIFT_MOTION_CLASS } from "../utils/useShadowMotion.js";
|
|
4
4
|
import { colorToken } from "../../../tokens/index.js";
|
|
@@ -75,9 +75,9 @@ const BUTTON_SIZE_TEXT_VARIANT = {
|
|
|
75
75
|
mid: "mid",
|
|
76
76
|
large: "large"
|
|
77
77
|
};
|
|
78
|
-
const BUTTON_BASE_INTERACTIVE_CLASS = "relative inline-flex items-center justify-center outline-none focus-ring disabled:pointer-events-none";
|
|
78
|
+
const BUTTON_BASE_INTERACTIVE_CLASS = "relative inline-flex items-center justify-center outline-none focus-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50";
|
|
79
79
|
const BUTTON_CONTENT_MOTION_CLASS = "relative z-[1] grid w-full min-w-0 place-items-center";
|
|
80
|
-
const BUTTON_CONTENT_MOTION_GROUP_CLASS = "origin-center";
|
|
80
|
+
const BUTTON_CONTENT_MOTION_GROUP_CLASS = "button-group-motion origin-center";
|
|
81
81
|
const BUTTON_LABEL_LAYER_CLASS = "col-start-1 row-start-1 inline-flex w-full min-w-0 items-center justify-center gap-xsmall";
|
|
82
82
|
const BUTTON_LEFT_ICON_SLOT_CLASS = `inline-flex shrink-0 items-center justify-center ${ICON_SLOT_CLASS}`;
|
|
83
83
|
const BUTTON_LABEL_TEXT_CLASS = "min-w-0 shrink";
|
|
@@ -119,12 +119,13 @@ function buttonHoverVariant(variant, status) {
|
|
|
119
119
|
}
|
|
120
120
|
switch (key) {
|
|
121
121
|
case "default":
|
|
122
|
-
return
|
|
122
|
+
return "default";
|
|
123
123
|
case "primary":
|
|
124
124
|
return `${status}-fill`;
|
|
125
125
|
case "outline":
|
|
126
|
-
case "ghost":
|
|
127
126
|
return status;
|
|
127
|
+
case "ghost":
|
|
128
|
+
return `${status}-tint-hover`;
|
|
128
129
|
case "secondary":
|
|
129
130
|
return "secondary";
|
|
130
131
|
}
|
|
@@ -137,7 +138,7 @@ function buttonStatusClass(variant, status) {
|
|
|
137
138
|
}
|
|
138
139
|
switch (key) {
|
|
139
140
|
case "default":
|
|
140
|
-
return
|
|
141
|
+
return SEMANTIC_STATUS_TEXT[status];
|
|
141
142
|
case "primary":
|
|
142
143
|
return SEMANTIC_STATUS_FILL[status];
|
|
143
144
|
case "outline":
|
|
@@ -145,7 +146,7 @@ function buttonStatusClass(variant, status) {
|
|
|
145
146
|
case "secondary":
|
|
146
147
|
return SEMANTIC_STATUS_TEXT[status];
|
|
147
148
|
case "ghost":
|
|
148
|
-
return SEMANTIC_STATUS_TEXT[status];
|
|
149
|
+
return cn(SEMANTIC_STATUS_SURFACE_TINT[status], SEMANTIC_STATUS_TEXT[status]);
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
function buttonIdleSurfaceMotion(variant, status, blocked) {
|
|
@@ -169,15 +170,15 @@ const BUTTON_CONTROL_HEIGHT_CLASS = {
|
|
|
169
170
|
mid: "min-h-control-mid",
|
|
170
171
|
large: "min-h-control-large"
|
|
171
172
|
};
|
|
172
|
-
function controlShellClass(size, minW =
|
|
173
|
+
function controlShellClass(size, minW = "min-w-fit") {
|
|
173
174
|
const layout = CONTROL_SIZE_LAYOUT[size];
|
|
174
175
|
return cn(minW, layout.padX, layout.padY);
|
|
175
176
|
}
|
|
176
|
-
function buttonRootClass(size,
|
|
177
|
+
function buttonRootClass(size, _iconOnly = false) {
|
|
177
178
|
const layout = CONTROL_SIZE_LAYOUT[size];
|
|
178
179
|
return cn(
|
|
179
180
|
BUTTON_CONTROL_HEIGHT_CLASS[size],
|
|
180
|
-
|
|
181
|
+
"min-w-fit",
|
|
181
182
|
layout.padX,
|
|
182
183
|
layout.padY
|
|
183
184
|
);
|
|
@@ -100,9 +100,10 @@ export type ButtonSimpleContentProps = {
|
|
|
100
100
|
iconPosition?: IconPosition;
|
|
101
101
|
children?: ReactNode;
|
|
102
102
|
};
|
|
103
|
-
export type UseButtonRootStateProps = Pick<ButtonProps, "variant" | "status" | "size" | "iconOnly" | "groupSegment" | "disabled" | "className" | "classNames" | "ripple" | "icon" | "iconPosition" | "children" | "onClick" | "type">;
|
|
103
|
+
export type UseButtonRootStateProps = Pick<ButtonProps, "variant" | "status" | "size" | "iconOnly" | "groupSegment" | "disabled" | "motionState" | "className" | "classNames" | "ripple" | "icon" | "iconPosition" | "children" | "onClick" | "type">;
|
|
104
104
|
export type UseButtonAnimationsProps = {
|
|
105
105
|
variant: ButtonVariant;
|
|
106
|
+
disabled: boolean;
|
|
106
107
|
blocked: boolean;
|
|
107
108
|
groupSegment: ButtonGroupSegment | undefined;
|
|
108
109
|
motion?: ButtonMotion;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseButtonRootStateProps } from './buttonTypes.js';
|
|
2
|
-
export declare function useButtonRootState({ variant: variantProp, status, size: sizeProp, type, disabled: disabledProp, icon, iconPosition, ripple, iconOnly, groupSegment: groupSegmentProp, className, classNames, children, onClick, }: UseButtonRootStateProps): {
|
|
2
|
+
export declare function useButtonRootState({ variant: variantProp, status, size: sizeProp, type, disabled: disabledProp, motionState, icon, iconPosition, ripple, iconOnly, groupSegment: groupSegmentProp, className, classNames, children, onClick, }: UseButtonRootStateProps): {
|
|
3
3
|
type: "button" | "submit" | "reset";
|
|
4
4
|
size: import('../utils/sizeLayout/index.js').ComponentSize;
|
|
5
5
|
variant: string;
|
|
@@ -7,6 +7,7 @@ export declare function useButtonRootState({ variant: variantProp, status, size:
|
|
|
7
7
|
status: import('../utils/semanticStatusIcons.js').SemanticStatus;
|
|
8
8
|
ripple: boolean;
|
|
9
9
|
blocked: boolean;
|
|
10
|
+
isLoading: boolean;
|
|
10
11
|
userDisabled: boolean;
|
|
11
12
|
groupSegment: Readonly<{
|
|
12
13
|
orientation: import('../../../index.js').ButtonGroupOrientation;
|
|
@@ -3,7 +3,7 @@ import { useMemo } from "react";
|
|
|
3
3
|
import { useSkinVariant, useSkinSurfaceStyle } from "../../../skins/skinContext.js";
|
|
4
4
|
import { useOptionalButtonGroupLayout, useOptionalButtonGroupSegment } from "../../composite/ButtonGroup/buttonGroupContext.js";
|
|
5
5
|
import { buttonGroupRoundingClasses, buttonGroupOverlapBorderClasses, buttonGroupSegmentSurfaceClasses } from "../../composite/ButtonGroup/buttonGroupStyles.js";
|
|
6
|
-
import { useOptionalFormBindingContext } from "../../composite/Form/formContext.js";
|
|
6
|
+
import { useOptionalFormBindingContext, useFormShell } from "../../composite/Form/formContext.js";
|
|
7
7
|
import { cn } from "../../../utils/cn.js";
|
|
8
8
|
import { hasButtonCompoundChildren } from "./buttonAPI.js";
|
|
9
9
|
import { BUTTON_CURSOR_CLASS, BUTTON_DISABLED_OPACITY_CLASS, buttonSurfaceMotionClass, buttonRootClass, BUTTON_STATUS_FOCUS_OUTLINE, BUTTON_BASE_INTERACTIVE_CLASS, buttonLoaderTextClass, buttonConvergeRippleColor } from "./buttonStyles.js";
|
|
@@ -14,6 +14,7 @@ function useButtonRootState({
|
|
|
14
14
|
size: sizeProp,
|
|
15
15
|
type = "button",
|
|
16
16
|
disabled: disabledProp,
|
|
17
|
+
motionState,
|
|
17
18
|
icon,
|
|
18
19
|
iconPosition = "start",
|
|
19
20
|
ripple = false,
|
|
@@ -27,12 +28,16 @@ function useButtonRootState({
|
|
|
27
28
|
const layoutCtx = useOptionalButtonGroupLayout();
|
|
28
29
|
const groupCtx = useOptionalButtonGroupSegment();
|
|
29
30
|
const formCtx = useOptionalFormBindingContext();
|
|
31
|
+
const formShell = useFormShell();
|
|
30
32
|
const groupSegment = layoutCtx?.segmented ? void 0 : groupSegmentProp ?? groupCtx?.segment;
|
|
31
|
-
const size = sizeProp ?? groupCtx?.size ?? "base";
|
|
33
|
+
const size = sizeProp ?? groupCtx?.size ?? formShell?.size ?? "base";
|
|
32
34
|
const variant = useSkinVariant(variantProp ?? groupCtx?.variant);
|
|
33
35
|
const surfaceStyle = useSkinSurfaceStyle(variant);
|
|
34
|
-
const userDisabled = Boolean(
|
|
35
|
-
|
|
36
|
+
const userDisabled = Boolean(
|
|
37
|
+
disabledProp ?? groupCtx?.disabled ?? formCtx?.disabled ?? formCtx?.isSubmitting
|
|
38
|
+
);
|
|
39
|
+
const isLoading = motionState === "loading";
|
|
40
|
+
const blocked = userDisabled || isLoading;
|
|
36
41
|
const sizeRounded = CONTROL_SIZE_LAYOUT[size].rounded;
|
|
37
42
|
const roundingClass = groupSegment ? buttonGroupRoundingClasses(groupSegment) : sizeRounded;
|
|
38
43
|
const groupGlue = groupSegment ? cn(
|
|
@@ -63,6 +68,7 @@ function useButtonRootState({
|
|
|
63
68
|
status,
|
|
64
69
|
ripple,
|
|
65
70
|
blocked,
|
|
71
|
+
isLoading,
|
|
66
72
|
userDisabled,
|
|
67
73
|
groupSegment,
|
|
68
74
|
clipClass,
|
|
@@ -12,7 +12,7 @@ import { CalendarDay, CalendarFooter, CalendarGrid, CalendarHeader, CalendarNavN
|
|
|
12
12
|
import { calendarRootClass } from "./calendarStyles.js";
|
|
13
13
|
import { KIT_CALENDAR_VARIANTS } from "./calendarTypes.js";
|
|
14
14
|
import { useCalendarRootState } from "./useCalendarRootState.js";
|
|
15
|
-
import { dataVariantProps } from "../utils/dataContract.js";
|
|
15
|
+
import { dataFlag, dataVariantProps } from "../utils/dataContract.js";
|
|
16
16
|
import { cn } from "../../../utils/cn.js";
|
|
17
17
|
import { useMotionPart } from "../utils/slotMotion/useMotionPart.js";
|
|
18
18
|
import { useOptionalEnterOnMount } from "../utils/slotMotion/useSlotLifecycle.js";
|
|
@@ -22,6 +22,8 @@ const CalendarRoot = forwardRef(
|
|
|
22
22
|
selectionMode: _selectionMode,
|
|
23
23
|
variant: _variant,
|
|
24
24
|
size: _size,
|
|
25
|
+
disabled: _disabled,
|
|
26
|
+
readOnly: _readOnly,
|
|
25
27
|
defaultMonth: _defaultMonth,
|
|
26
28
|
month: _month,
|
|
27
29
|
onMonthChange: _onMonthChange,
|
|
@@ -81,6 +83,8 @@ const CalendarRoot = forwardRef(
|
|
|
81
83
|
rest,
|
|
82
84
|
size: contextValue.size,
|
|
83
85
|
variant: contextValue.variant,
|
|
86
|
+
disabled: contextValue.disabled,
|
|
87
|
+
readOnly: contextValue.readOnly,
|
|
84
88
|
children: content
|
|
85
89
|
}
|
|
86
90
|
)
|
|
@@ -95,17 +99,21 @@ function CalendarRootSurface({
|
|
|
95
99
|
rest,
|
|
96
100
|
size,
|
|
97
101
|
variant,
|
|
102
|
+
disabled,
|
|
103
|
+
readOnly,
|
|
98
104
|
children
|
|
99
105
|
}) {
|
|
100
|
-
const { onPointerOver, onPointerOut, ...domRest } = rest;
|
|
106
|
+
const { onPointerOver, onPointerOut, onPointerDown, onPointerUp, ...domRest } = rest;
|
|
101
107
|
const scope = useCalendarMotionScope();
|
|
102
108
|
const part = useMotionPart({
|
|
103
109
|
scope,
|
|
104
110
|
slot: "root",
|
|
105
111
|
forwardedRef,
|
|
106
|
-
pointerPhases:
|
|
112
|
+
pointerPhases: !disabled,
|
|
107
113
|
onPointerOver,
|
|
108
|
-
onPointerOut
|
|
114
|
+
onPointerOut,
|
|
115
|
+
onPointerDown,
|
|
116
|
+
onPointerUp
|
|
109
117
|
});
|
|
110
118
|
useOptionalEnterOnMount(scope, "root", part.targetRef);
|
|
111
119
|
const shadow = useSecondLevelShadow(part.targetRef, usesKitElevation(variant, KIT_CALENDAR_VARIANTS), {
|
|
@@ -119,9 +127,12 @@ function CalendarRootSurface({
|
|
|
119
127
|
{
|
|
120
128
|
ref: part.setRef,
|
|
121
129
|
className: cn(className, shadow.motionClass),
|
|
130
|
+
"aria-disabled": disabled || void 0,
|
|
122
131
|
...domRest,
|
|
123
132
|
...part.pointerHandlers,
|
|
124
133
|
...dataVariantProps({ size, variant }),
|
|
134
|
+
"data-disabled": dataFlag(disabled),
|
|
135
|
+
"data-readonly": dataFlag(readOnly),
|
|
125
136
|
children
|
|
126
137
|
}
|
|
127
138
|
);
|
|
@@ -22,8 +22,11 @@ export declare function buildDayCellModels({ viewDate, selectedDates, rangeStart
|
|
|
22
22
|
isDateUnavailable?: (date: Date) => boolean;
|
|
23
23
|
today: Date;
|
|
24
24
|
}): CalendarDayCellModel[];
|
|
25
|
-
export declare function
|
|
26
|
-
export declare function
|
|
25
|
+
export declare function isCalendarMonthDisabled(year: number, month: number, minDate?: Date, maxDate?: Date): boolean;
|
|
26
|
+
export declare function isCalendarYearDisabled(year: number, minDate?: Date, maxDate?: Date): boolean;
|
|
27
|
+
export declare function canCalendarNavigate(view: CalendarView, viewDate: Date, direction: -1 | 1, minDate?: Date, maxDate?: Date): boolean;
|
|
28
|
+
export declare function buildMonthCellModels(viewDate: Date, selectedDates: Date[], locale: CalendarLocale, today: Date, minDate?: Date, maxDate?: Date): CalendarMonthCellModel[];
|
|
29
|
+
export declare function buildYearCellModels(viewDate: Date, selectedDates: Date[], today: Date, minDate?: Date, maxDate?: Date): CalendarYearCellModel[];
|
|
27
30
|
export declare function createDefaultCalendarValue(mode: CalendarMode, defaultValue: unknown): unknown;
|
|
28
31
|
export declare function addCalendarDays(date: Date, delta: number): Date;
|
|
29
32
|
export declare function addCalendarMonths(date: Date, delta: number): Date;
|
|
@@ -32,9 +35,10 @@ export declare function addCalendarYears(date: Date, delta: number): Date;
|
|
|
32
35
|
export declare function calendarRangeHitsUnavailable(start: Date, end: Date, isDateUnavailable?: (date: Date) => boolean): boolean;
|
|
33
36
|
export declare function isCalendarDateDisabled(date: Date, minDate?: Date, maxDate?: Date, isDateUnavailable?: (date: Date) => boolean): boolean;
|
|
34
37
|
export declare function clampCalendarDate(date: Date, minDate?: Date, maxDate?: Date): Date;
|
|
35
|
-
export declare function resolveInitialFocusDate({ mode, resolvedValue, today, minDate, maxDate, }: {
|
|
38
|
+
export declare function resolveInitialFocusDate({ mode, resolvedValue, initialMonth, today, minDate, maxDate, }: {
|
|
36
39
|
mode: CalendarMode;
|
|
37
40
|
resolvedValue: unknown;
|
|
41
|
+
initialMonth?: Date;
|
|
38
42
|
today: Date;
|
|
39
43
|
minDate?: Date;
|
|
40
44
|
maxDate?: Date;
|
|
@@ -43,9 +47,9 @@ export declare function resolveInitialFocusDate({ mode, resolvedValue, today, mi
|
|
|
43
47
|
* APG Date Picker day-grid keyboard move.
|
|
44
48
|
* Arrow ±day / ±week, Home/End week bounds, PageUp/Down ±month (Shift = ±year).
|
|
45
49
|
*/
|
|
46
|
-
export declare function moveCalendarFocusDate(current: Date, key: string, shiftKey: boolean, minDate?: Date, maxDate?: Date, isDateUnavailable?: (date: Date) => boolean): Date | null;
|
|
50
|
+
export declare function moveCalendarFocusDate(current: Date, key: string, shiftKey: boolean, minDate?: Date, maxDate?: Date, isDateUnavailable?: (date: Date) => boolean, rtl?: boolean): Date | null;
|
|
47
51
|
/** Month picker (3×4): arrows move selection index. */
|
|
48
|
-
export declare function moveCalendarMonthFocusIndex(current: number, key: string): number | null;
|
|
52
|
+
export declare function moveCalendarMonthFocusIndex(current: number, key: string, rtl?: boolean): number | null;
|
|
49
53
|
/** Year picker (3×4 of 12 cells): arrows move selection index. */
|
|
50
|
-
export declare function moveCalendarYearFocusIndex(current: number, key: string): number | null;
|
|
54
|
+
export declare function moveCalendarYearFocusIndex(current: number, key: string, rtl?: boolean): number | null;
|
|
51
55
|
export declare function chunkCalendarCells<T>(cells: T[], size: number): T[][];
|
|
@@ -41,13 +41,15 @@ function resolveSelectedDates(mode, resolvedValue) {
|
|
|
41
41
|
}
|
|
42
42
|
function resolveRangeStart(mode, rangePending, resolvedValue) {
|
|
43
43
|
if (mode !== "range") return null;
|
|
44
|
-
if (rangePending) return rangePending;
|
|
45
|
-
|
|
44
|
+
if (rangePending) return startOfDay(rangePending);
|
|
45
|
+
const start = resolvedValue?.start ?? null;
|
|
46
|
+
return start ? startOfDay(start) : null;
|
|
46
47
|
}
|
|
47
48
|
function resolveRangeEnd(mode, rangePending, resolvedValue) {
|
|
48
49
|
if (mode !== "range") return null;
|
|
49
50
|
if (rangePending) return null;
|
|
50
|
-
|
|
51
|
+
const end = resolvedValue?.end ?? null;
|
|
52
|
+
return end ? startOfDay(end) : null;
|
|
51
53
|
}
|
|
52
54
|
function navigateViewDate(prev, view, delta) {
|
|
53
55
|
if (view === "days") return new Date(prev.getFullYear(), prev.getMonth() + delta, 1);
|
|
@@ -71,9 +73,12 @@ function buildDayCellModels({
|
|
|
71
73
|
const month = viewDate.getMonth();
|
|
72
74
|
const daysInMonth = getDaysInMonth(year, month);
|
|
73
75
|
const offset = getMonthStartOffset(year, month);
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
const
|
|
76
|
+
const normalizedStart = rangeStart ? startOfDay(rangeStart) : null;
|
|
77
|
+
const normalizedEnd = rangeEnd ? startOfDay(rangeEnd) : null;
|
|
78
|
+
const normalizedHover = hoverDate ? startOfDay(hoverDate) : null;
|
|
79
|
+
const effectiveRangeEnd = normalizedEnd ?? (normalizedStart && normalizedHover ? normalizedHover : null);
|
|
80
|
+
const rLow = normalizedStart && effectiveRangeEnd ? normalizedStart <= effectiveRangeEnd ? normalizedStart : effectiveRangeEnd : null;
|
|
81
|
+
const rHigh = normalizedStart && effectiveRangeEnd ? normalizedStart <= effectiveRangeEnd ? effectiveRangeEnd : normalizedStart : null;
|
|
77
82
|
const rawCells = [
|
|
78
83
|
...Array(offset).fill(null),
|
|
79
84
|
...Array.from({ length: daysInMonth }, (_, i) => i + 1)
|
|
@@ -112,7 +117,53 @@ function buildDayCellModels({
|
|
|
112
117
|
};
|
|
113
118
|
});
|
|
114
119
|
}
|
|
115
|
-
function
|
|
120
|
+
function isCalendarMonthDisabled(year, month, minDate, maxDate) {
|
|
121
|
+
const monthStart = new Date(year, month, 1);
|
|
122
|
+
const monthEnd = new Date(year, month, getDaysInMonth(year, month));
|
|
123
|
+
const min = minDate ? startOfDay(minDate) : void 0;
|
|
124
|
+
const max = maxDate ? startOfDay(maxDate) : void 0;
|
|
125
|
+
return !!min && monthEnd < min || !!max && monthStart > max;
|
|
126
|
+
}
|
|
127
|
+
function isCalendarYearDisabled(year, minDate, maxDate) {
|
|
128
|
+
const yearStart = new Date(year, 0, 1);
|
|
129
|
+
const yearEnd = new Date(year, 11, 31);
|
|
130
|
+
const min = minDate ? startOfDay(minDate) : void 0;
|
|
131
|
+
const max = maxDate ? startOfDay(maxDate) : void 0;
|
|
132
|
+
return !!min && yearEnd < min || !!max && yearStart > max;
|
|
133
|
+
}
|
|
134
|
+
function canCalendarNavigate(view, viewDate, direction, minDate, maxDate) {
|
|
135
|
+
const year = viewDate.getFullYear();
|
|
136
|
+
const month = viewDate.getMonth();
|
|
137
|
+
if (direction < 0) {
|
|
138
|
+
if (!minDate) return true;
|
|
139
|
+
const min = startOfDay(minDate);
|
|
140
|
+
if (view === "days") {
|
|
141
|
+
const prevMonthEnd = new Date(year, month, 0);
|
|
142
|
+
return prevMonthEnd >= min;
|
|
143
|
+
}
|
|
144
|
+
if (view === "months") {
|
|
145
|
+
const prevYearEnd = new Date(year - 1, 11, 31);
|
|
146
|
+
return prevYearEnd >= min;
|
|
147
|
+
}
|
|
148
|
+
const decadeStart2 = Math.floor(year / 10) * 10;
|
|
149
|
+
const prevDecadeEnd = new Date(decadeStart2 - 1, 11, 31);
|
|
150
|
+
return prevDecadeEnd >= min;
|
|
151
|
+
}
|
|
152
|
+
if (!maxDate) return true;
|
|
153
|
+
const max = startOfDay(maxDate);
|
|
154
|
+
if (view === "days") {
|
|
155
|
+
const nextMonthStart = new Date(year, month + 1, 1);
|
|
156
|
+
return nextMonthStart <= max;
|
|
157
|
+
}
|
|
158
|
+
if (view === "months") {
|
|
159
|
+
const nextYearStart = new Date(year + 1, 0, 1);
|
|
160
|
+
return nextYearStart <= max;
|
|
161
|
+
}
|
|
162
|
+
const decadeStart = Math.floor(year / 10) * 10;
|
|
163
|
+
const nextDecadeStart = new Date(decadeStart + 10, 0, 1);
|
|
164
|
+
return nextDecadeStart <= max;
|
|
165
|
+
}
|
|
166
|
+
function buildMonthCellModels(viewDate, selectedDates, locale, today, minDate, maxDate) {
|
|
116
167
|
const year = viewDate.getFullYear();
|
|
117
168
|
return locale.monthsShort.map((name, month) => ({
|
|
118
169
|
month,
|
|
@@ -120,17 +171,19 @@ function buildMonthCellModels(viewDate, selectedDates, locale, today) {
|
|
|
120
171
|
isCurrentMonth: today.getFullYear() === year && today.getMonth() === month,
|
|
121
172
|
isSelected: selectedDates.some(
|
|
122
173
|
(d) => d.getFullYear() === year && d.getMonth() === month
|
|
123
|
-
)
|
|
174
|
+
),
|
|
175
|
+
disabled: isCalendarMonthDisabled(year, month, minDate, maxDate)
|
|
124
176
|
}));
|
|
125
177
|
}
|
|
126
|
-
function buildYearCellModels(viewDate, selectedDates, today) {
|
|
178
|
+
function buildYearCellModels(viewDate, selectedDates, today, minDate, maxDate) {
|
|
127
179
|
const decadeStart = Math.floor(viewDate.getFullYear() / 10) * 10;
|
|
128
180
|
const years = Array.from({ length: 12 }, (_, i) => decadeStart - 1 + i);
|
|
129
181
|
return years.map((year) => ({
|
|
130
182
|
year,
|
|
131
183
|
isCurrentYear: today.getFullYear() === year,
|
|
132
184
|
isSelected: selectedDates.some((d) => d.getFullYear() === year),
|
|
133
|
-
outOfDecade: year < decadeStart || year > decadeStart + 9
|
|
185
|
+
outOfDecade: year < decadeStart || year > decadeStart + 9,
|
|
186
|
+
disabled: isCalendarYearDisabled(year, minDate, maxDate)
|
|
134
187
|
}));
|
|
135
188
|
}
|
|
136
189
|
function createDefaultCalendarValue(mode, defaultValue) {
|
|
@@ -171,32 +224,52 @@ function calendarRangeHitsUnavailable(start, end, isDateUnavailable) {
|
|
|
171
224
|
return false;
|
|
172
225
|
}
|
|
173
226
|
function isCalendarDateDisabled(date, minDate, maxDate, isDateUnavailable) {
|
|
174
|
-
|
|
227
|
+
const day = startOfDay(date);
|
|
228
|
+
const min = minDate ? startOfDay(minDate) : void 0;
|
|
229
|
+
const max = maxDate ? startOfDay(maxDate) : void 0;
|
|
230
|
+
return !!min && day < min || !!max && day > max || !!isDateUnavailable?.(day);
|
|
175
231
|
}
|
|
176
232
|
function clampCalendarDate(date, minDate, maxDate) {
|
|
177
233
|
let next = startOfDay(date);
|
|
178
|
-
|
|
179
|
-
|
|
234
|
+
const min = minDate ? startOfDay(minDate) : void 0;
|
|
235
|
+
const max = maxDate ? startOfDay(maxDate) : void 0;
|
|
236
|
+
if (min && next < min) next = min;
|
|
237
|
+
if (max && next > max) next = max;
|
|
180
238
|
return next;
|
|
181
239
|
}
|
|
182
240
|
function resolveInitialFocusDate({
|
|
183
241
|
mode,
|
|
184
242
|
resolvedValue,
|
|
243
|
+
initialMonth,
|
|
185
244
|
today,
|
|
186
245
|
minDate,
|
|
187
246
|
maxDate
|
|
188
247
|
}) {
|
|
189
|
-
const
|
|
190
|
-
if (
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
248
|
+
const candidateFromValue = resolveSelectedDates(mode, resolvedValue)[0] ?? (mode === "range" ? resolveRangeStart(mode, null, resolvedValue) : null);
|
|
249
|
+
if (initialMonth) {
|
|
250
|
+
const mYear = initialMonth.getFullYear();
|
|
251
|
+
const mMonth = initialMonth.getMonth();
|
|
252
|
+
if (candidateFromValue && candidateFromValue.getFullYear() === mYear && candidateFromValue.getMonth() === mMonth) {
|
|
253
|
+
return clampCalendarDate(candidateFromValue, minDate, maxDate);
|
|
254
|
+
}
|
|
255
|
+
if (today.getFullYear() === mYear && today.getMonth() === mMonth) {
|
|
256
|
+
return clampCalendarDate(today, minDate, maxDate);
|
|
257
|
+
}
|
|
258
|
+
return clampCalendarDate(new Date(mYear, mMonth, 1), minDate, maxDate);
|
|
194
259
|
}
|
|
260
|
+
if (candidateFromValue) return clampCalendarDate(candidateFromValue, minDate, maxDate);
|
|
195
261
|
return clampCalendarDate(today, minDate, maxDate);
|
|
196
262
|
}
|
|
197
|
-
function
|
|
263
|
+
function resolveRtlHorizontalKey(key, rtl) {
|
|
264
|
+
if (!rtl) return key;
|
|
265
|
+
if (key === "ArrowLeft") return "ArrowRight";
|
|
266
|
+
if (key === "ArrowRight") return "ArrowLeft";
|
|
267
|
+
return key;
|
|
268
|
+
}
|
|
269
|
+
function moveCalendarFocusDate(current, key, shiftKey, minDate, maxDate, isDateUnavailable, rtl = false) {
|
|
270
|
+
const effectiveKey = resolveRtlHorizontalKey(key, rtl);
|
|
198
271
|
let next = null;
|
|
199
|
-
switch (
|
|
272
|
+
switch (effectiveKey) {
|
|
200
273
|
case "ArrowLeft":
|
|
201
274
|
next = addCalendarDays(current, -1);
|
|
202
275
|
break;
|
|
@@ -228,15 +301,17 @@ function moveCalendarFocusDate(current, key, shiftKey, minDate, maxDate, isDateU
|
|
|
228
301
|
default:
|
|
229
302
|
return null;
|
|
230
303
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
304
|
+
const min = minDate ? startOfDay(minDate) : void 0;
|
|
305
|
+
const max = maxDate ? startOfDay(maxDate) : void 0;
|
|
306
|
+
next = clampCalendarDate(next, min, max);
|
|
307
|
+
if (isCalendarDateDisabled(next, min, max, isDateUnavailable)) {
|
|
308
|
+
const direction = effectiveKey === "ArrowLeft" || effectiveKey === "ArrowUp" || effectiveKey === "Home" || effectiveKey === "PageUp" ? -1 : 1;
|
|
234
309
|
let cursor = next;
|
|
235
310
|
for (let i = 0; i < 366; i++) {
|
|
236
311
|
cursor = addCalendarDays(cursor, direction);
|
|
237
|
-
cursor = clampCalendarDate(cursor,
|
|
238
|
-
if (!isCalendarDateDisabled(cursor,
|
|
239
|
-
if (direction < 0 &&
|
|
312
|
+
cursor = clampCalendarDate(cursor, min, max);
|
|
313
|
+
if (!isCalendarDateDisabled(cursor, min, max, isDateUnavailable)) return cursor;
|
|
314
|
+
if (direction < 0 && min && isSameDay(cursor, min) || direction > 0 && max && isSameDay(cursor, max)) {
|
|
240
315
|
break;
|
|
241
316
|
}
|
|
242
317
|
}
|
|
@@ -244,8 +319,9 @@ function moveCalendarFocusDate(current, key, shiftKey, minDate, maxDate, isDateU
|
|
|
244
319
|
}
|
|
245
320
|
return next;
|
|
246
321
|
}
|
|
247
|
-
function moveCalendarMonthFocusIndex(current, key) {
|
|
248
|
-
|
|
322
|
+
function moveCalendarMonthFocusIndex(current, key, rtl = false) {
|
|
323
|
+
const effectiveKey = resolveRtlHorizontalKey(key, rtl);
|
|
324
|
+
switch (effectiveKey) {
|
|
249
325
|
case "ArrowLeft":
|
|
250
326
|
return current > 0 ? current - 1 : 11;
|
|
251
327
|
case "ArrowRight":
|
|
@@ -262,8 +338,9 @@ function moveCalendarMonthFocusIndex(current, key) {
|
|
|
262
338
|
return null;
|
|
263
339
|
}
|
|
264
340
|
}
|
|
265
|
-
function moveCalendarYearFocusIndex(current, key) {
|
|
266
|
-
|
|
341
|
+
function moveCalendarYearFocusIndex(current, key, rtl = false) {
|
|
342
|
+
const effectiveKey = resolveRtlHorizontalKey(key, rtl);
|
|
343
|
+
switch (effectiveKey) {
|
|
267
344
|
case "ArrowLeft":
|
|
268
345
|
return current > 0 ? current - 1 : 11;
|
|
269
346
|
case "ArrowRight":
|
|
@@ -295,6 +372,7 @@ export {
|
|
|
295
372
|
buildMonthCellModels,
|
|
296
373
|
buildYearCellModels,
|
|
297
374
|
calendarRangeHitsUnavailable,
|
|
375
|
+
canCalendarNavigate,
|
|
298
376
|
chunkCalendarCells,
|
|
299
377
|
clampCalendarDate,
|
|
300
378
|
createDefaultCalendarValue,
|
|
@@ -303,6 +381,8 @@ export {
|
|
|
303
381
|
getDaysInMonth,
|
|
304
382
|
getMonthStartOffset,
|
|
305
383
|
isCalendarDateDisabled,
|
|
384
|
+
isCalendarMonthDisabled,
|
|
385
|
+
isCalendarYearDisabled,
|
|
306
386
|
isSameDay,
|
|
307
387
|
moveCalendarFocusDate,
|
|
308
388
|
moveCalendarMonthFocusIndex,
|