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,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useId, useState, useRef, useCallback, useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useFormFieldBinding } from "../../composite/Form/useFormFieldBinding.js";
|
|
4
|
+
import { useNativeFormReset } from "../utils/fieldFormDom.js";
|
|
4
5
|
import { hasCompoundChild } from "../utils/hasCompoundChild.js";
|
|
5
6
|
import { hasCompoundChildren } from "../utils/hasCompoundChildren.js";
|
|
6
|
-
import { useControllableState } from "../utils/useControllableState.js";
|
|
7
7
|
import { useResolvedFieldInvalid } from "../utils/fieldInvalid.js";
|
|
8
8
|
import { numberInputDescribedBy, numberInputFieldIds } from "./numberInputA11y.js";
|
|
9
9
|
import { numberInputLocale, parseFormNumber, parseNumberInputComplete, isNumberInputDraft, clampNumberInput, numberInputEditText, snapNumberInput, numberInputCanStep, stepNumberInput, formatNumberInput, numberInputStep } from "./numberInputAPI.js";
|
|
@@ -31,43 +31,57 @@ function useNumberInputRootState({
|
|
|
31
31
|
locale: localeProp
|
|
32
32
|
}) {
|
|
33
33
|
const locale = numberInputLocale(localeProp);
|
|
34
|
-
const
|
|
34
|
+
const formBinding = useFormFieldBinding({
|
|
35
|
+
name,
|
|
36
|
+
value: valueProp,
|
|
37
|
+
disabled,
|
|
38
|
+
readOnly
|
|
39
|
+
});
|
|
35
40
|
const reactId = useId();
|
|
36
41
|
const inputId = id ?? `number-input-${reactId}`;
|
|
37
42
|
const ids = numberInputFieldIds(inputId);
|
|
38
43
|
const isCompound = hasCompoundChildren(children);
|
|
39
44
|
const step = numberInputStep(stepProp);
|
|
40
45
|
const explicit = valueProp !== void 0;
|
|
41
|
-
const bound =
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
const bound = formBinding.bound;
|
|
47
|
+
const controlled = explicit ? valueProp : bound ? parseFormNumber(formBinding.value) : void 0;
|
|
48
|
+
const isControlled = controlled !== void 0;
|
|
49
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
50
|
+
const value = isControlled ? controlled : internalValue;
|
|
51
|
+
const onValueChangeRef = useRef(onValueChange);
|
|
52
|
+
onValueChangeRef.current = onValueChange;
|
|
53
|
+
const setValue = useCallback(
|
|
54
|
+
(next) => {
|
|
55
|
+
if (!isControlled) setInternalValue(next);
|
|
56
|
+
onValueChangeRef.current?.(next);
|
|
57
|
+
if (bound) {
|
|
58
|
+
formBinding.setValue(next ?? "");
|
|
53
59
|
}
|
|
54
|
-
}
|
|
55
|
-
|
|
60
|
+
},
|
|
61
|
+
[bound, formBinding, isControlled]
|
|
62
|
+
);
|
|
56
63
|
const [draft, setDraft] = useState(null);
|
|
57
64
|
const inputRef = useRef(null);
|
|
58
65
|
const pointerInsideRef = useRef(false);
|
|
66
|
+
useNativeFormReset(
|
|
67
|
+
inputRef,
|
|
68
|
+
() => {
|
|
69
|
+
setDraft(null);
|
|
70
|
+
setInternalValue(defaultValue);
|
|
71
|
+
},
|
|
72
|
+
!isControlled
|
|
73
|
+
);
|
|
74
|
+
const formRef = formBinding.ref;
|
|
59
75
|
const setInputRef = useCallback(
|
|
60
76
|
(node) => {
|
|
61
77
|
inputRef.current = node;
|
|
62
|
-
|
|
78
|
+
formRef(node);
|
|
63
79
|
},
|
|
64
|
-
[
|
|
80
|
+
[formRef]
|
|
65
81
|
);
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const resolvedReadOnly = readOnly || form?.readOnly === true;
|
|
70
|
-
const blocked = resolvedDisabled || form?.isSubmitting === true;
|
|
82
|
+
const resolvedError = error ?? formBinding.error;
|
|
83
|
+
const blocked = Boolean(formBinding.disabled);
|
|
84
|
+
const resolvedReadOnly = Boolean(formBinding.readOnly);
|
|
71
85
|
const parsedDraft = draft != null ? parseNumberInputComplete(draft, locale) : void 0;
|
|
72
86
|
const steppingFrom = parsedDraft === void 0 ? value : parsedDraft;
|
|
73
87
|
const canDecrement = !blocked && !resolvedReadOnly && numberInputCanStep(steppingFrom, -1, min, max);
|
|
@@ -87,6 +101,7 @@ function useNumberInputRootState({
|
|
|
87
101
|
if (blocked || resolvedReadOnly || draft != null) return;
|
|
88
102
|
setDraft(value == null ? "" : numberInputEditText(value, locale));
|
|
89
103
|
}, [blocked, draft, locale, resolvedReadOnly, value]);
|
|
104
|
+
const formOnBlur = formBinding.onBlur;
|
|
90
105
|
const commitBlur = useCallback(() => {
|
|
91
106
|
const raw = draft;
|
|
92
107
|
setDraft(null);
|
|
@@ -95,28 +110,27 @@ function useNumberInputRootState({
|
|
|
95
110
|
const next = parsed == null || parsed === void 0 ? null : snapNumberInput(parsed, step, min, max);
|
|
96
111
|
if (next !== value) setValue(next);
|
|
97
112
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (form.validateMode === "onBlur") form.validateField(name);
|
|
101
|
-
}
|
|
102
|
-
}, [blocked, bound, draft, form, locale, max, min, name, resolvedReadOnly, setValue, step, value]);
|
|
113
|
+
formOnBlur();
|
|
114
|
+
}, [blocked, draft, formOnBlur, locale, max, min, resolvedReadOnly, setValue, step, value]);
|
|
103
115
|
const nudge = useCallback(
|
|
104
116
|
(direction) => {
|
|
105
117
|
if (blocked || resolvedReadOnly) return;
|
|
106
118
|
if (!numberInputCanStep(steppingFrom, direction, min, max)) return;
|
|
107
119
|
const next = stepNumberInput(steppingFrom, direction, step, min, max);
|
|
108
|
-
|
|
120
|
+
if (draft !== null) {
|
|
121
|
+
setDraft(numberInputEditText(next, locale));
|
|
122
|
+
}
|
|
109
123
|
setValue(next);
|
|
110
124
|
},
|
|
111
|
-
[blocked, locale, max, min, resolvedReadOnly, setValue, step, steppingFrom]
|
|
125
|
+
[blocked, draft, locale, max, min, resolvedReadOnly, setValue, step, steppingFrom]
|
|
112
126
|
);
|
|
113
|
-
const labelConnected = isCompound ? hasCompoundChild(children, "NumberInputLabel") : label != null;
|
|
127
|
+
const labelConnected = isCompound ? hasCompoundChild(children, "NumberInputLabel") || hasCompoundChild(children, "Label") : label != null;
|
|
114
128
|
const hintConnected = isCompound ? hasCompoundChild(children, "NumberInputHint") : hint != null;
|
|
115
129
|
const errorConnected = isCompound ? hasCompoundChild(children, "NumberInputError") : resolvedError != null;
|
|
116
130
|
const isInvalid = useResolvedFieldInvalid({
|
|
117
131
|
invalid,
|
|
118
132
|
errorConnected: resolvedError != null || errorConnected,
|
|
119
|
-
formInvalid:
|
|
133
|
+
formInvalid: formBinding["aria-invalid"] === true
|
|
120
134
|
});
|
|
121
135
|
const text = draft ?? formatNumberInput(value, formatOptions, locale);
|
|
122
136
|
const valueText = value == null ? void 0 : formatNumberInput(value, formatOptions, locale);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
export declare function normalizePaginationTotalPages(totalPages: number | undefined): number;
|
|
2
|
+
export declare function clampPaginationPage(page: number, safeTotal: number): number;
|
|
1
3
|
export declare function getPaginationRange(page: number, totalPages: number, siblingCount: number): (number | "ellipsis")[];
|
|
2
|
-
export declare function resolvePaginationPreviousDisabled({ disabled, page, }: {
|
|
4
|
+
export declare function resolvePaginationPreviousDisabled({ disabled, page, totalPages, }: {
|
|
3
5
|
disabled?: boolean;
|
|
4
6
|
page?: number;
|
|
7
|
+
totalPages?: number;
|
|
5
8
|
}): boolean;
|
|
6
9
|
export declare function resolvePaginationNextDisabled({ disabled, page, totalPages, }: {
|
|
7
10
|
disabled?: boolean;
|
|
@@ -1,35 +1,78 @@
|
|
|
1
|
+
function normalizePaginationTotalPages(totalPages) {
|
|
2
|
+
if (totalPages == null || !Number.isFinite(totalPages)) return 0;
|
|
3
|
+
return Math.max(0, Math.floor(totalPages));
|
|
4
|
+
}
|
|
5
|
+
function clampPaginationPage(page, safeTotal) {
|
|
6
|
+
if (!Number.isFinite(page)) return safeTotal > 0 ? 1 : 0;
|
|
7
|
+
const floored = Math.floor(page);
|
|
8
|
+
if (safeTotal <= 0) return Math.max(1, floored);
|
|
9
|
+
return Math.min(Math.max(1, floored), safeTotal);
|
|
10
|
+
}
|
|
11
|
+
function buildPageSpan(start, end) {
|
|
12
|
+
const length = Math.max(0, end - start + 1);
|
|
13
|
+
return Array.from({ length }, (_, idx) => start + idx);
|
|
14
|
+
}
|
|
1
15
|
function getPaginationRange(page, totalPages, siblingCount) {
|
|
2
|
-
|
|
3
|
-
if (
|
|
4
|
-
if (
|
|
5
|
-
|
|
16
|
+
const safeTotal = normalizePaginationTotalPages(totalPages);
|
|
17
|
+
if (safeTotal <= 0) return [];
|
|
18
|
+
if (safeTotal === 1) return [1];
|
|
19
|
+
const safeSibling = Number.isFinite(siblingCount) ? Math.max(0, Math.floor(siblingCount)) : 1;
|
|
20
|
+
const totalPageNumbers = safeSibling * 2 + 5;
|
|
21
|
+
if (safeTotal <= totalPageNumbers) {
|
|
22
|
+
return buildPageSpan(1, safeTotal);
|
|
23
|
+
}
|
|
24
|
+
const safePage = clampPaginationPage(page, safeTotal);
|
|
25
|
+
const leftSiblingIndex = Math.max(safePage - safeSibling, 1);
|
|
26
|
+
const rightSiblingIndex = Math.min(safePage + safeSibling, safeTotal);
|
|
27
|
+
const shouldShowLeftDots = leftSiblingIndex > 3;
|
|
28
|
+
const shouldShowRightDots = rightSiblingIndex < safeTotal - 2;
|
|
29
|
+
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
30
|
+
const leftItemCount = 3 + 2 * safeSibling;
|
|
31
|
+
return [...buildPageSpan(1, leftItemCount), "ellipsis", safeTotal];
|
|
32
|
+
}
|
|
33
|
+
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
34
|
+
const rightItemCount = 3 + 2 * safeSibling;
|
|
35
|
+
return [1, "ellipsis", ...buildPageSpan(safeTotal - rightItemCount + 1, safeTotal)];
|
|
6
36
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return
|
|
37
|
+
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
38
|
+
return [
|
|
39
|
+
1,
|
|
40
|
+
"ellipsis",
|
|
41
|
+
...buildPageSpan(leftSiblingIndex, rightSiblingIndex),
|
|
42
|
+
"ellipsis",
|
|
43
|
+
safeTotal
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
return buildPageSpan(1, safeTotal);
|
|
17
47
|
}
|
|
18
48
|
function resolvePaginationPreviousDisabled({
|
|
19
49
|
disabled,
|
|
20
|
-
page
|
|
50
|
+
page,
|
|
51
|
+
totalPages
|
|
21
52
|
}) {
|
|
22
|
-
|
|
53
|
+
if (disabled != null) return disabled;
|
|
54
|
+
if (totalPages != null && normalizePaginationTotalPages(totalPages) <= 0) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return page != null ? !Number.isFinite(page) || page <= 1 : false;
|
|
23
58
|
}
|
|
24
59
|
function resolvePaginationNextDisabled({
|
|
25
60
|
disabled,
|
|
26
61
|
page,
|
|
27
62
|
totalPages
|
|
28
63
|
}) {
|
|
29
|
-
|
|
64
|
+
if (disabled != null) return disabled;
|
|
65
|
+
if (totalPages != null) {
|
|
66
|
+
const safeTotal = normalizePaginationTotalPages(totalPages);
|
|
67
|
+
if (safeTotal <= 0) return true;
|
|
68
|
+
return page != null ? !Number.isFinite(page) || page >= safeTotal : false;
|
|
69
|
+
}
|
|
70
|
+
return false;
|
|
30
71
|
}
|
|
31
72
|
export {
|
|
73
|
+
clampPaginationPage,
|
|
32
74
|
getPaginationRange,
|
|
75
|
+
normalizePaginationTotalPages,
|
|
33
76
|
resolvePaginationNextDisabled,
|
|
34
77
|
resolvePaginationPreviousDisabled
|
|
35
78
|
};
|
|
@@ -29,6 +29,12 @@ function usePaginationFlip(olRef, { page, totalPages, siblingCount, children })
|
|
|
29
29
|
const nextRects = /* @__PURE__ */ new Map();
|
|
30
30
|
const prevRects = prevRectsRef.current;
|
|
31
31
|
const tweens = [];
|
|
32
|
+
if (!firstRunRef.current) {
|
|
33
|
+
for (const el of items) {
|
|
34
|
+
killMotion(el);
|
|
35
|
+
gsap.set(el, { clearProps: "opacity,scale,x,transform" });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
32
38
|
for (const el of items) {
|
|
33
39
|
const key = keyFor(el);
|
|
34
40
|
const rect = el.getBoundingClientRect();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import { PaginationContentProps, PaginationIconProps, PaginationItemProps, PaginationProps } from './paginationTypes.js';
|
|
3
|
-
export declare const PaginationRootShell: ForwardRefExoticComponent<Omit<PaginationProps, "motion" | "motionState" | "motionPayload" | "playInitialState" | "
|
|
3
|
+
export declare const PaginationRootShell: ForwardRefExoticComponent<Omit<PaginationProps, "motion" | "motionState" | "motionPayload" | "playInitialState" | "classNames" | "motionController"> & RefAttributes<HTMLElement>>;
|
|
4
4
|
export declare const PaginationSummary: ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & {
|
|
5
5
|
motion?: import('../../../index.js').Prettify<import('./paginationTypes.js').PaginationSummaryPartMotion>;
|
|
6
6
|
} & RefAttributes<HTMLDivElement>>;
|
|
@@ -4,10 +4,10 @@ import { KitChevronForward, KitChevronBack } from "../utils/kitIcons.js";
|
|
|
4
4
|
import { forwardRef, useMemo, useCallback, createElement } from "react";
|
|
5
5
|
import { isInteractivePressKey } from "../utils/hoverInteractiveLift.js";
|
|
6
6
|
import { useBurneLabels } from "../../../theme/BurneLabelsProvider.js";
|
|
7
|
-
import { dataActiveState } from "../utils/dataContract.js";
|
|
7
|
+
import { dataActiveState, dataFlag } from "../utils/dataContract.js";
|
|
8
8
|
import { cn } from "../../../utils/cn.js";
|
|
9
9
|
import { PAGINATION_ELLIPSIS_ARIA_HIDDEN, resolvePaginationPageAriaLabel, PAGINATION_ICON_ARIA_HIDDEN } from "./paginationA11y.js";
|
|
10
|
-
import { getPaginationRange, resolvePaginationNextDisabled, resolvePaginationPreviousDisabled } from "./paginationAPI.js";
|
|
10
|
+
import { getPaginationRange, normalizePaginationTotalPages, resolvePaginationNextDisabled, clampPaginationPage, resolvePaginationPreviousDisabled } from "./paginationAPI.js";
|
|
11
11
|
import { usePaginationEllipsisSlot, usePaginationPageActiveSlot, usePaginationContentRef, usePaginationSummarySlot, playPaginationButtonPhase } from "./paginationAnimations.js";
|
|
12
12
|
import { usePaginationClassNames, usePagination, useOptionalPagination, useOptionalPaginationMotionScope } from "./paginationContext.js";
|
|
13
13
|
import { paginationEllipsisClass, paginationPageActiveClass, paginationPageTextClass, paginationNextIconClass, paginationPreviousIconClass, paginationNavTextClass, paginationItemClass, paginationContentClass, paginationSummaryTextClass, paginationSummaryClass, paginationRootClass, paginationInteractiveButtonClass } from "./paginationStyles.js";
|
|
@@ -48,14 +48,20 @@ const PaginationInteractive = forwardRef(
|
|
|
48
48
|
disabled,
|
|
49
49
|
motionSlot,
|
|
50
50
|
href,
|
|
51
|
+
dataState,
|
|
52
|
+
onClick,
|
|
53
|
+
onAuxClick,
|
|
51
54
|
onPointerDown,
|
|
52
55
|
onPointerUp,
|
|
53
56
|
onKeyDown,
|
|
57
|
+
tabIndex,
|
|
58
|
+
"aria-disabled": ariaDisabledProp,
|
|
54
59
|
motion,
|
|
55
60
|
...rest
|
|
56
61
|
}, ref) {
|
|
57
62
|
const scope = useOptionalPaginationMotionScope();
|
|
58
63
|
const size = useOptionalPagination()?.size ?? "base";
|
|
64
|
+
const isBlocked = Boolean(disabled) || ariaDisabledProp === true || ariaDisabledProp === "true";
|
|
59
65
|
const playPress = useCallback(
|
|
60
66
|
(phase, el) => {
|
|
61
67
|
playPaginationButtonPhase(scope, motionSlot, phase, el, motion);
|
|
@@ -67,34 +73,63 @@ const PaginationInteractive = forwardRef(
|
|
|
67
73
|
slot: motionSlot,
|
|
68
74
|
motion,
|
|
69
75
|
pressPhases: false,
|
|
70
|
-
pointerPhases: !
|
|
76
|
+
pointerPhases: !isBlocked,
|
|
71
77
|
forwardedRef: ref,
|
|
72
78
|
onPointerDown: (event) => {
|
|
73
79
|
onPointerDown?.(event);
|
|
74
|
-
if (
|
|
80
|
+
if (isBlocked || event.defaultPrevented) return;
|
|
75
81
|
playPress("pressIn", event.currentTarget);
|
|
76
82
|
},
|
|
77
83
|
onPointerUp: (event) => {
|
|
78
84
|
onPointerUp?.(event);
|
|
79
|
-
if (
|
|
85
|
+
if (isBlocked || event.defaultPrevented) return;
|
|
80
86
|
playPress("pressOut", event.currentTarget);
|
|
81
87
|
}
|
|
82
88
|
});
|
|
83
89
|
const pressKeyDown = (event) => {
|
|
90
|
+
if (isBlocked && (event.key === "Enter" || event.key === " " || event.key === "Spacebar")) {
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
84
95
|
onKeyDown?.(event);
|
|
85
|
-
if (
|
|
96
|
+
if (isBlocked || event.defaultPrevented || !isInteractivePressKey(event)) return;
|
|
86
97
|
playPress("pressIn", event.currentTarget);
|
|
87
98
|
};
|
|
88
|
-
if (href) {
|
|
99
|
+
if (href != null) {
|
|
89
100
|
return createElement(
|
|
90
101
|
"a",
|
|
91
102
|
{
|
|
92
103
|
ref: setRef,
|
|
93
|
-
href,
|
|
94
|
-
|
|
104
|
+
...isBlocked ? {} : { href },
|
|
105
|
+
"aria-disabled": isBlocked || void 0,
|
|
106
|
+
...isBlocked ? { tabIndex: -1 } : tabIndex !== void 0 ? { tabIndex } : {},
|
|
107
|
+
className: paginationInteractiveButtonClass({
|
|
108
|
+
className,
|
|
109
|
+
disabled: isBlocked,
|
|
110
|
+
size
|
|
111
|
+
}),
|
|
95
112
|
...rest,
|
|
96
113
|
...pointerHandlers,
|
|
97
|
-
|
|
114
|
+
onClick: (event) => {
|
|
115
|
+
if (isBlocked) {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
event.stopPropagation();
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
onClick?.(event);
|
|
121
|
+
},
|
|
122
|
+
onAuxClick: (event) => {
|
|
123
|
+
if (isBlocked) {
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
event.stopPropagation();
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
onAuxClick?.(event);
|
|
129
|
+
},
|
|
130
|
+
onKeyDown: pressKeyDown,
|
|
131
|
+
"data-disabled": dataFlag(isBlocked),
|
|
132
|
+
...dataState != null ? { "data-state": dataState } : {}
|
|
98
133
|
},
|
|
99
134
|
children
|
|
100
135
|
);
|
|
@@ -104,14 +139,20 @@ const PaginationInteractive = forwardRef(
|
|
|
104
139
|
{
|
|
105
140
|
ref: setRef,
|
|
106
141
|
type: "button",
|
|
107
|
-
disabled,
|
|
142
|
+
disabled: isBlocked,
|
|
143
|
+
tabIndex,
|
|
108
144
|
className: paginationInteractiveButtonClass({
|
|
109
145
|
className,
|
|
146
|
+
disabled: isBlocked,
|
|
110
147
|
size
|
|
111
148
|
}),
|
|
149
|
+
onClick,
|
|
150
|
+
onAuxClick,
|
|
112
151
|
...rest,
|
|
113
152
|
...pointerHandlers,
|
|
114
153
|
onKeyDown: pressKeyDown,
|
|
154
|
+
"data-disabled": dataFlag(isBlocked),
|
|
155
|
+
"data-state": dataState,
|
|
115
156
|
children
|
|
116
157
|
}
|
|
117
158
|
);
|
|
@@ -196,16 +237,26 @@ const PaginationPrevious = forwardRef(
|
|
|
196
237
|
const ctx = useOptionalPagination();
|
|
197
238
|
const slotClassNames = usePaginationClassNames();
|
|
198
239
|
const page = ctx?.page;
|
|
199
|
-
const
|
|
240
|
+
const totalPages = ctx?.totalPages;
|
|
241
|
+
const resolvedDisabled = resolvePaginationPreviousDisabled({
|
|
242
|
+
disabled,
|
|
243
|
+
page,
|
|
244
|
+
totalPages
|
|
245
|
+
});
|
|
200
246
|
const handleClick = useCallback(
|
|
201
247
|
(event) => {
|
|
202
248
|
onClick?.(event);
|
|
203
249
|
if (event.defaultPrevented || resolvedDisabled) return;
|
|
204
|
-
if (ctx?.onPageChange && page != null && page
|
|
205
|
-
|
|
250
|
+
if (ctx?.onPageChange && page != null && Number.isFinite(page)) {
|
|
251
|
+
const safeTotal = totalPages != null ? normalizePaginationTotalPages(totalPages) : void 0;
|
|
252
|
+
if (safeTotal != null && safeTotal <= 0) return;
|
|
253
|
+
const current = safeTotal != null ? clampPaginationPage(page, safeTotal) : Math.max(1, Math.floor(page));
|
|
254
|
+
if (current > 1) {
|
|
255
|
+
ctx.onPageChange(current - 1);
|
|
256
|
+
}
|
|
206
257
|
}
|
|
207
258
|
},
|
|
208
|
-
[ctx, onClick, page, resolvedDisabled]
|
|
259
|
+
[ctx, onClick, page, resolvedDisabled, totalPages]
|
|
209
260
|
);
|
|
210
261
|
return /* @__PURE__ */ jsx(
|
|
211
262
|
PaginationInteractive,
|
|
@@ -253,8 +304,13 @@ const PaginationNext = forwardRef(
|
|
|
253
304
|
(event) => {
|
|
254
305
|
onClick?.(event);
|
|
255
306
|
if (event.defaultPrevented || resolvedDisabled) return;
|
|
256
|
-
if (ctx?.onPageChange && page != null && totalPages != null && page
|
|
257
|
-
|
|
307
|
+
if (ctx?.onPageChange && page != null && totalPages != null && Number.isFinite(page)) {
|
|
308
|
+
const safeTotal = normalizePaginationTotalPages(totalPages);
|
|
309
|
+
if (safeTotal <= 0) return;
|
|
310
|
+
const current = clampPaginationPage(page, safeTotal);
|
|
311
|
+
if (current < safeTotal) {
|
|
312
|
+
ctx.onPageChange(current + 1);
|
|
313
|
+
}
|
|
258
314
|
}
|
|
259
315
|
},
|
|
260
316
|
[ctx, onClick, page, resolvedDisabled, totalPages]
|
|
@@ -343,6 +399,7 @@ const PaginationPage = forwardRef(
|
|
|
343
399
|
function PaginationPage2({
|
|
344
400
|
page: pageNumber,
|
|
345
401
|
active: activeProp,
|
|
402
|
+
disabled,
|
|
346
403
|
href,
|
|
347
404
|
children,
|
|
348
405
|
onClick,
|
|
@@ -354,7 +411,9 @@ const PaginationPage = forwardRef(
|
|
|
354
411
|
const labels = useBurneLabels();
|
|
355
412
|
const ctx = useOptionalPagination();
|
|
356
413
|
const slotClassNames = usePaginationClassNames();
|
|
357
|
-
const
|
|
414
|
+
const invalidPage = !Number.isFinite(pageNumber) || pageNumber < 1 || ctx?.totalPages != null && pageNumber > normalizePaginationTotalPages(ctx.totalPages);
|
|
415
|
+
const resolvedDisabled = Boolean(disabled) || invalidPage;
|
|
416
|
+
const active = activeProp ?? (!invalidPage && ctx?.page != null ? ctx.page === pageNumber : false);
|
|
358
417
|
const pageActivePart = usePaginationPageActiveSlot(
|
|
359
418
|
motion,
|
|
360
419
|
ref,
|
|
@@ -363,10 +422,10 @@ const PaginationPage = forwardRef(
|
|
|
363
422
|
const handleClick = useCallback(
|
|
364
423
|
(event) => {
|
|
365
424
|
onClick?.(event);
|
|
366
|
-
if (event.defaultPrevented || active) return;
|
|
367
|
-
ctx?.onPageChange?.(pageNumber);
|
|
425
|
+
if (event.defaultPrevented || active || resolvedDisabled) return;
|
|
426
|
+
ctx?.onPageChange?.(Math.floor(pageNumber));
|
|
368
427
|
},
|
|
369
|
-
[active, ctx, onClick, pageNumber]
|
|
428
|
+
[active, ctx, onClick, pageNumber, resolvedDisabled]
|
|
370
429
|
);
|
|
371
430
|
const label = children ?? pageNumber;
|
|
372
431
|
if (active) {
|
|
@@ -402,13 +461,14 @@ const PaginationPage = forwardRef(
|
|
|
402
461
|
{
|
|
403
462
|
ref,
|
|
404
463
|
href,
|
|
464
|
+
disabled: resolvedDisabled,
|
|
465
|
+
dataState: dataActiveState(active),
|
|
405
466
|
...pageAriaLabel != null ? { "aria-label": pageAriaLabel } : {},
|
|
406
467
|
onClick: handleClick,
|
|
407
468
|
className: cn(slotClassNames.page, className),
|
|
408
469
|
motionSlot: "page",
|
|
409
470
|
motion,
|
|
410
471
|
...rest,
|
|
411
|
-
"data-state": dataActiveState(active),
|
|
412
472
|
children: /* @__PURE__ */ jsx(
|
|
413
473
|
Text,
|
|
414
474
|
{
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ComponentSize } from '../utils/sizeLayout/index.js';
|
|
2
2
|
export declare const PAGINATION_ROOT_CLASS = "flex w-full min-w-0 flex-wrap items-center justify-between gap-xsmall gap-y-xsmall text-start";
|
|
3
3
|
export declare const PAGINATION_SUMMARY_CLASS = "flex min-w-0 flex-1 basis-component-xsmall";
|
|
4
|
-
export declare const PAGINATION_SUMMARY_TEXT_CLASS = "min-w-0 truncate text-muted";
|
|
4
|
+
export declare const PAGINATION_SUMMARY_TEXT_CLASS = "min-w-0 truncate text-muted-foreground";
|
|
5
5
|
export declare const PAGINATION_CONTENT_CLASS = "my-0 me-0 ms-auto flex max-w-full min-w-0 list-none flex-nowrap items-center justify-start gap-xsmall overflow-x-auto overscroll-x-contain p-0";
|
|
6
6
|
export declare const PAGINATION_ITEM_CLASS = "flex shrink-0 items-center";
|
|
7
7
|
export declare const PAGINATION_SIZE_CLASS: Record<ComponentSize, string>;
|
|
8
|
-
export declare const PAGINATION_INTERACTIVE_BUTTON_CLASS = "inline-flex min-w-0 origin-center cursor-pointer items-center justify-center gap-xsmall rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted no-underline outline-none hover:text-foreground focus-ring disabled:cursor-not-allowed disabled:opacity-48 disabled:hover:text-muted disabled:hover:bg-transparent motion-reduce:animate-none";
|
|
8
|
+
export declare const PAGINATION_INTERACTIVE_BUTTON_CLASS = "inline-flex min-w-0 origin-center cursor-pointer items-center justify-center gap-xsmall rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted-foreground no-underline outline-none hover:text-foreground focus-ring disabled:cursor-not-allowed disabled:opacity-48 disabled:hover:text-muted-foreground disabled:hover:bg-transparent aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-48 aria-disabled:hover:text-muted-foreground aria-disabled:hover:bg-transparent motion-reduce:animate-none";
|
|
9
9
|
/** Page digit column — `--size-scale-2xlarge` (≈1.75rem), not panel max-width. */
|
|
10
10
|
export declare const PAGINATION_PAGE_ACTIVE_CLASS = "inline-flex min-w-[length:var(--size-scale-2xlarge)] items-center justify-center px-xsmall py-xsmall font-w-mid text-foreground tabular-nums text-base";
|
|
11
11
|
export declare const PAGINATION_PAGE_TEXT_CLASS = "min-w-[length:var(--size-scale-2xlarge)] tabular-nums";
|
|
12
|
-
export declare const PAGINATION_ELLIPSIS_CLASS = "inline-flex min-w-[length:var(--size-scale-2xlarge)] items-center justify-center px-xsmall py-xsmall text-muted tabular-nums";
|
|
12
|
+
export declare const PAGINATION_ELLIPSIS_CLASS = "inline-flex min-w-[length:var(--size-scale-2xlarge)] items-center justify-center px-xsmall py-xsmall text-muted-foreground tabular-nums";
|
|
13
13
|
export declare const PAGINATION_NAV_TEXT_CLASS = "";
|
|
14
|
-
export declare const PAGINATION_PREVIOUS_ICON_CLASS = "shrink-0 icon-small opacity-75";
|
|
15
|
-
export declare const PAGINATION_NEXT_ICON_CLASS = "shrink-0 icon-small opacity-75";
|
|
14
|
+
export declare const PAGINATION_PREVIOUS_ICON_CLASS = "shrink-0 icon-small opacity-75 rtl:rotate-180";
|
|
15
|
+
export declare const PAGINATION_NEXT_ICON_CLASS = "shrink-0 icon-small opacity-75 rtl:rotate-180";
|
|
16
16
|
export declare function paginationRootClass({ slotClass, className, }: {
|
|
17
17
|
slotClass?: string;
|
|
18
18
|
className?: string;
|
|
@@ -33,8 +33,9 @@ export declare function paginationItemClass({ slotClass, className, }: {
|
|
|
33
33
|
slotClass?: string;
|
|
34
34
|
className?: string;
|
|
35
35
|
}): string;
|
|
36
|
-
export declare function paginationInteractiveButtonClass({ size, slotClass, className, }: {
|
|
36
|
+
export declare function paginationInteractiveButtonClass({ size, disabled, slotClass, className, }: {
|
|
37
37
|
size?: ComponentSize;
|
|
38
|
+
disabled?: boolean;
|
|
38
39
|
slotClass?: string;
|
|
39
40
|
className?: string;
|
|
40
41
|
}): string;
|
|
@@ -2,7 +2,7 @@ import { hoverVariant } from "../utils/hoverVariant.js";
|
|
|
2
2
|
import { cn } from "../../../utils/cn.js";
|
|
3
3
|
const PAGINATION_ROOT_CLASS = "flex w-full min-w-0 flex-wrap items-center justify-between gap-xsmall gap-y-xsmall text-start";
|
|
4
4
|
const PAGINATION_SUMMARY_CLASS = "flex min-w-0 flex-1 basis-component-xsmall";
|
|
5
|
-
const PAGINATION_SUMMARY_TEXT_CLASS = "min-w-0 truncate text-muted";
|
|
5
|
+
const PAGINATION_SUMMARY_TEXT_CLASS = "min-w-0 truncate text-muted-foreground";
|
|
6
6
|
const PAGINATION_CONTENT_CLASS = "my-0 me-0 ms-auto flex max-w-full min-w-0 list-none flex-nowrap items-center justify-start gap-xsmall overflow-x-auto overscroll-x-contain p-0";
|
|
7
7
|
const PAGINATION_ITEM_CLASS = "flex shrink-0 items-center";
|
|
8
8
|
const PAGINATION_SIZE_CLASS = {
|
|
@@ -11,13 +11,13 @@ const PAGINATION_SIZE_CLASS = {
|
|
|
11
11
|
mid: "min-h-control-mid text-mid",
|
|
12
12
|
large: "min-h-control-large text-large"
|
|
13
13
|
};
|
|
14
|
-
const PAGINATION_INTERACTIVE_BUTTON_CLASS = "inline-flex min-w-0 origin-center cursor-pointer items-center justify-center gap-xsmall rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted no-underline outline-none hover:text-foreground focus-ring disabled:cursor-not-allowed disabled:opacity-48 disabled:hover:text-muted disabled:hover:bg-transparent motion-reduce:animate-none";
|
|
14
|
+
const PAGINATION_INTERACTIVE_BUTTON_CLASS = "inline-flex min-w-0 origin-center cursor-pointer items-center justify-center gap-xsmall rounded-mid border-0 bg-transparent px-xsmall py-xsmall font-[inherit] text-muted-foreground no-underline outline-none hover:text-foreground focus-ring disabled:cursor-not-allowed disabled:opacity-48 disabled:hover:text-muted-foreground disabled:hover:bg-transparent aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-48 aria-disabled:hover:text-muted-foreground aria-disabled:hover:bg-transparent motion-reduce:animate-none";
|
|
15
15
|
const PAGINATION_PAGE_ACTIVE_CLASS = "inline-flex min-w-[length:var(--size-scale-2xlarge)] items-center justify-center px-xsmall py-xsmall font-w-mid text-foreground tabular-nums text-base";
|
|
16
16
|
const PAGINATION_PAGE_TEXT_CLASS = "min-w-[length:var(--size-scale-2xlarge)] tabular-nums";
|
|
17
|
-
const PAGINATION_ELLIPSIS_CLASS = "inline-flex min-w-[length:var(--size-scale-2xlarge)] items-center justify-center px-xsmall py-xsmall text-muted tabular-nums";
|
|
17
|
+
const PAGINATION_ELLIPSIS_CLASS = "inline-flex min-w-[length:var(--size-scale-2xlarge)] items-center justify-center px-xsmall py-xsmall text-muted-foreground tabular-nums";
|
|
18
18
|
const PAGINATION_NAV_TEXT_CLASS = "";
|
|
19
|
-
const PAGINATION_PREVIOUS_ICON_CLASS = "shrink-0 icon-small opacity-75";
|
|
20
|
-
const PAGINATION_NEXT_ICON_CLASS = "shrink-0 icon-small opacity-75";
|
|
19
|
+
const PAGINATION_PREVIOUS_ICON_CLASS = "shrink-0 icon-small opacity-75 rtl:rotate-180";
|
|
20
|
+
const PAGINATION_NEXT_ICON_CLASS = "shrink-0 icon-small opacity-75 rtl:rotate-180";
|
|
21
21
|
function paginationRootClass({
|
|
22
22
|
slotClass,
|
|
23
23
|
className
|
|
@@ -54,13 +54,14 @@ function paginationItemClass({
|
|
|
54
54
|
}
|
|
55
55
|
function paginationInteractiveButtonClass({
|
|
56
56
|
size = "base",
|
|
57
|
+
disabled,
|
|
57
58
|
slotClass,
|
|
58
59
|
className
|
|
59
60
|
}) {
|
|
60
61
|
return cn(
|
|
61
62
|
PAGINATION_INTERACTIVE_BUTTON_CLASS,
|
|
62
63
|
PAGINATION_SIZE_CLASS[size],
|
|
63
|
-
hoverVariant(),
|
|
64
|
+
!disabled && hoverVariant(),
|
|
64
65
|
slotClass,
|
|
65
66
|
className
|
|
66
67
|
);
|
|
@@ -124,6 +124,7 @@ export type PaginationInteractiveProps = ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
124
124
|
motionSlot: PaginationButtonSlot;
|
|
125
125
|
motion?: Prettify<PaginationPartMotion>;
|
|
126
126
|
href?: string;
|
|
127
|
+
dataState?: "active" | "inactive";
|
|
127
128
|
};
|
|
128
129
|
export type PaginationIconProps = KitIconProps & {
|
|
129
130
|
motion?: Prettify<PaginationPartMotion>;
|
|
@@ -3,9 +3,10 @@ import { useCallback, useMemo } from "react";
|
|
|
3
3
|
import { useControllableState } from "../utils/useControllableState.js";
|
|
4
4
|
import { useBurneLabel } from "../../../theme/BurneLabelsProvider.js";
|
|
5
5
|
import { resolvePaginationAriaLabel } from "./paginationA11y.js";
|
|
6
|
+
import { normalizePaginationTotalPages, clampPaginationPage } from "./paginationAPI.js";
|
|
6
7
|
function usePaginationRootState({
|
|
7
8
|
page: pageProp,
|
|
8
|
-
defaultPage,
|
|
9
|
+
defaultPage = 1,
|
|
9
10
|
totalPages,
|
|
10
11
|
onPageChange,
|
|
11
12
|
siblingCount = 1,
|
|
@@ -13,28 +14,33 @@ function usePaginationRootState({
|
|
|
13
14
|
"aria-label": ariaLabel
|
|
14
15
|
}) {
|
|
15
16
|
const paginationLabel = useBurneLabel("pagination");
|
|
16
|
-
const
|
|
17
|
+
const safeTotal = totalPages != null ? normalizePaginationTotalPages(totalPages) : void 0;
|
|
18
|
+
const [rawPage, setPageRaw] = useControllableState({
|
|
17
19
|
value: pageProp,
|
|
18
20
|
defaultValue: defaultPage,
|
|
19
21
|
onChange: onPageChange ? (next) => {
|
|
20
22
|
if (next !== void 0) onPageChange(next);
|
|
21
23
|
} : void 0
|
|
22
24
|
});
|
|
25
|
+
const page = rawPage == null ? void 0 : safeTotal != null && safeTotal > 0 ? clampPaginationPage(rawPage, safeTotal) : Number.isFinite(rawPage) ? Math.max(1, Math.floor(rawPage)) : 1;
|
|
23
26
|
const setPage = useCallback(
|
|
24
27
|
(next) => {
|
|
25
|
-
|
|
28
|
+
if (!Number.isFinite(next)) return;
|
|
29
|
+
if (safeTotal != null && safeTotal <= 0) return;
|
|
30
|
+
const clamped = safeTotal != null ? clampPaginationPage(next, safeTotal) : Math.max(1, Math.floor(next));
|
|
31
|
+
setPageRaw(clamped);
|
|
26
32
|
},
|
|
27
|
-
[setPageRaw]
|
|
33
|
+
[safeTotal, setPageRaw]
|
|
28
34
|
);
|
|
29
35
|
const contextValue = useMemo(
|
|
30
36
|
() => ({
|
|
31
37
|
page,
|
|
32
|
-
totalPages,
|
|
38
|
+
totalPages: safeTotal,
|
|
33
39
|
onPageChange: setPage,
|
|
34
40
|
siblingCount,
|
|
35
41
|
size
|
|
36
42
|
}),
|
|
37
|
-
[page, setPage, siblingCount, size
|
|
43
|
+
[page, safeTotal, setPage, siblingCount, size]
|
|
38
44
|
);
|
|
39
45
|
return {
|
|
40
46
|
contextValue,
|
|
@@ -30,7 +30,12 @@ export declare function usePinInputShellMotion({ motion, forwardedRef, onPointer
|
|
|
30
30
|
onPointerUp: (e: import('react').PointerEvent<HTMLDivElement>) => void;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
|
-
export declare function usePinInputControlMotion(
|
|
33
|
+
export declare function usePinInputControlMotion({ onPointerOver, onPointerOut, onPointerDown, onPointerUp, }?: {
|
|
34
|
+
onPointerOver?: PointerEventHandler<HTMLInputElement>;
|
|
35
|
+
onPointerOut?: PointerEventHandler<HTMLInputElement>;
|
|
36
|
+
onPointerDown?: PointerEventHandler<HTMLInputElement>;
|
|
37
|
+
onPointerUp?: PointerEventHandler<HTMLInputElement>;
|
|
38
|
+
}): {
|
|
34
39
|
setRef: (node: HTMLInputElement | null) => void;
|
|
35
40
|
pointerHandlers: {
|
|
36
41
|
onPointerOver: (e: import('react').PointerEvent<HTMLInputElement>) => void;
|