burne-ui 1.8.6 → 1.8.8
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/dist/components/composite/Accordion/Accordion.d.ts +1 -1
- package/dist/components/composite/Accordion/accordionAnimations.d.ts +4 -4
- package/dist/components/composite/Accordion/accordionParts.d.ts +3 -5
- package/dist/components/composite/Accordion/accordionStyles.d.ts +4 -1
- package/dist/components/composite/Accordion/accordionTypes.d.ts +14 -5
- package/dist/components/composite/Accordion/index.d.ts +5 -4
- package/dist/components/composite/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/components/composite/AlertDialog/alertDialogContext.d.ts +6 -2
- package/dist/components/composite/AlertDialog/alertDialogParts.d.ts +9 -8
- package/dist/components/composite/AlertDialog/alertDialogTypes.d.ts +33 -7
- package/dist/components/composite/AlertDialog/index.d.ts +7 -3
- package/dist/components/composite/ButtonGroup/ButtonGroup.d.ts +2 -1
- package/dist/components/composite/ButtonGroup/buttonGroupContext.d.ts +6 -2
- package/dist/components/composite/ButtonGroup/buttonGroupTypes.d.ts +8 -2
- package/dist/components/composite/ButtonGroup/index.d.ts +2 -1
- package/dist/components/composite/CheckboxGroup/CheckboxGroup.d.ts +5 -4
- package/dist/components/composite/CheckboxGroup/checkboxGroupAnimations.d.ts +13 -12
- package/dist/components/composite/CheckboxGroup/checkboxGroupContext.d.ts +6 -2
- package/dist/components/composite/CheckboxGroup/checkboxGroupParts.d.ts +16 -13
- package/dist/components/composite/CheckboxGroup/checkboxGroupTypes.d.ts +29 -8
- package/dist/components/composite/CheckboxGroup/index.d.ts +18 -18
- package/dist/components/composite/Form/Form.d.ts +2 -1
- package/dist/components/composite/Form/formContext.d.ts +6 -2
- package/dist/components/composite/Form/formParts.d.ts +2 -0
- package/dist/components/composite/Form/formTypes.d.ts +19 -2
- package/dist/components/composite/Form/index.d.ts +4 -1
- package/dist/components/composite/RadioGroup/RadioGroup.d.ts +4 -3
- package/dist/components/composite/RadioGroup/index.d.ts +19 -17
- package/dist/components/composite/RadioGroup/radioGroupAnimations.d.ts +39 -0
- package/dist/components/composite/RadioGroup/radioGroupContext.d.ts +11 -0
- package/dist/components/composite/RadioGroup/radioGroupParts.d.ts +18 -13
- package/dist/components/composite/RadioGroup/radioGroupTypes.d.ts +40 -5
- package/dist/components/composite/ToggleButtonGroup/ToggleButtonGroup.d.ts +2 -1
- package/dist/components/composite/ToggleButtonGroup/index.d.ts +2 -1
- package/dist/components/composite/ToggleButtonGroup/toggleButtonGroupContext.d.ts +6 -2
- package/dist/components/composite/ToggleButtonGroup/toggleButtonGroupTypes.d.ts +8 -2
- package/dist/components/core/Alert/Alert.d.ts +5 -1
- package/dist/components/core/Alert/alertContext.d.ts +6 -2
- package/dist/components/core/Alert/alertTypes.d.ts +24 -2
- package/dist/components/core/Alert/index.d.ts +5 -1
- package/dist/components/core/Avatar/Avatar.d.ts +2 -1
- package/dist/components/core/Avatar/avatarContext.d.ts +6 -2
- package/dist/components/core/Avatar/avatarTypes.d.ts +8 -2
- package/dist/components/core/Avatar/index.d.ts +2 -1
- package/dist/components/core/Badge/Badge.d.ts +5 -1
- package/dist/components/core/Badge/badgeContext.d.ts +6 -2
- package/dist/components/core/Badge/badgeParts.d.ts +5 -1
- package/dist/components/core/Badge/badgeTypes.d.ts +43 -3
- package/dist/components/core/Badge/index.d.ts +10 -2
- package/dist/components/core/Breadcrumbs/Breadcrumbs.d.ts +2 -1
- package/dist/components/core/Breadcrumbs/breadcrumbsAnimations.d.ts +19 -1
- package/dist/components/core/Breadcrumbs/breadcrumbsContext.d.ts +6 -2
- package/dist/components/core/Breadcrumbs/breadcrumbsParts.d.ts +3 -1
- package/dist/components/core/Breadcrumbs/breadcrumbsTypes.d.ts +31 -2
- package/dist/components/core/Breadcrumbs/index.d.ts +3 -1
- package/dist/components/core/Button/Button.d.ts +5 -1
- package/dist/components/core/Button/buttonContext.d.ts +6 -2
- package/dist/components/core/Button/buttonParts.d.ts +15 -7
- package/dist/components/core/Button/buttonTypes.d.ts +46 -7
- package/dist/components/core/Button/index.d.ts +17 -5
- package/dist/components/core/Calendar/calendarAnimations.d.ts +19 -1
- package/dist/components/core/Calendar/calendarContext.d.ts +6 -2
- package/dist/components/core/Calendar/calendarParts.d.ts +13 -5
- package/dist/components/core/Calendar/calendarStyles.d.ts +1 -0
- package/dist/components/core/Calendar/calendarTypes.d.ts +43 -6
- package/dist/components/core/Calendar/index.d.ts +12 -4
- package/dist/components/core/Card/Card.d.ts +5 -1
- package/dist/components/core/Card/cardContext.d.ts +6 -2
- package/dist/components/core/Card/cardTypes.d.ts +23 -2
- package/dist/components/core/Card/index.d.ts +5 -1
- package/dist/components/core/Checkbox/Checkbox.d.ts +2 -1
- package/dist/components/core/Checkbox/checkboxAnimations.d.ts +26 -4
- package/dist/components/core/Checkbox/checkboxContext.d.ts +12 -2
- package/dist/components/core/Checkbox/checkboxParts.d.ts +11 -7
- package/dist/components/core/Checkbox/checkboxTypes.d.ts +45 -10
- package/dist/components/core/Checkbox/index.d.ts +5 -2
- package/dist/components/core/CloseButton/CloseButton.d.ts +2 -1
- package/dist/components/core/CloseButton/closeButtonContext.d.ts +6 -2
- package/dist/components/core/CloseButton/closeButtonStyles.d.ts +1 -1
- package/dist/components/core/CloseButton/closeButtonTypes.d.ts +12 -3
- package/dist/components/core/ColorPicker/ColorPicker.d.ts +4 -4
- package/dist/components/core/ColorPicker/ColorSlider.d.ts +3 -1
- package/dist/components/core/ColorPicker/ColorSwatch.d.ts +2 -1
- package/dist/components/core/ColorPicker/colorPickerContext.d.ts +6 -2
- package/dist/components/core/ColorPicker/colorPickerParts.d.ts +10 -2
- package/dist/components/core/ColorPicker/colorPickerTypes.d.ts +29 -9
- package/dist/components/core/ColorPicker/colorSliderContext.d.ts +6 -2
- package/dist/components/core/ColorPicker/colorSliderTypes.d.ts +16 -2
- package/dist/components/core/ColorPicker/colorSwatchContext.d.ts +6 -2
- package/dist/components/core/ColorPicker/colorSwatchTypes.d.ts +11 -2
- package/dist/components/core/ColorPicker/index.d.ts +14 -3
- package/dist/components/core/ComboBox/ComboBox.d.ts +2 -2
- package/dist/components/core/ComboBox/comboBoxAnimations.d.ts +19 -1
- package/dist/components/core/ComboBox/comboBoxContext.d.ts +6 -2
- package/dist/components/core/ComboBox/comboBoxFieldParts.d.ts +12 -14
- package/dist/components/core/ComboBox/comboBoxParts.d.ts +4 -1
- package/dist/components/core/ComboBox/comboBoxTypes.d.ts +27 -3
- package/dist/components/core/ComboBox/index.d.ts +15 -5
- package/dist/components/core/Dialog/Dialog.d.ts +1 -1
- package/dist/components/core/Dialog/dialogContext.d.ts +6 -2
- package/dist/components/core/Dialog/dialogParts.d.ts +10 -5
- package/dist/components/core/Dialog/dialogTypes.d.ts +33 -7
- package/dist/components/core/Dialog/index.d.ts +8 -3
- package/dist/components/core/Disclosure/Disclosure.d.ts +2 -1
- package/dist/components/core/Disclosure/disclosureContext.d.ts +6 -2
- package/dist/components/core/Disclosure/disclosureParts.d.ts +1 -1
- package/dist/components/core/Disclosure/disclosureTypes.d.ts +25 -7
- package/dist/components/core/Disclosure/index.d.ts +2 -1
- package/dist/components/core/Drawer/Drawer.d.ts +1 -1
- package/dist/components/core/Drawer/drawerContext.d.ts +6 -2
- package/dist/components/core/Drawer/drawerParts.d.ts +10 -5
- package/dist/components/core/Drawer/drawerTypes.d.ts +33 -7
- package/dist/components/core/Drawer/index.d.ts +8 -3
- package/dist/components/core/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/core/Dropdown/dropdownAnimations.d.ts +30 -8
- package/dist/components/core/Dropdown/dropdownContext.d.ts +6 -2
- package/dist/components/core/Dropdown/dropdownItemParts.d.ts +4 -3
- package/dist/components/core/Dropdown/dropdownParts.d.ts +8 -4
- package/dist/components/core/Dropdown/dropdownSubParts.d.ts +2 -0
- package/dist/components/core/Dropdown/dropdownTypes.d.ts +56 -12
- package/dist/components/core/Dropdown/index.d.ts +9 -2
- package/dist/components/core/Expandable/Expandable.d.ts +2 -1
- package/dist/components/core/Expandable/expandableContext.d.ts +6 -2
- package/dist/components/core/Expandable/expandableParts.d.ts +3 -3
- package/dist/components/core/Expandable/expandableTypes.d.ts +24 -6
- package/dist/components/core/Expandable/index.d.ts +2 -1
- package/dist/components/core/Field/Field.d.ts +2 -1
- package/dist/components/core/Field/fieldAnimations.d.ts +17 -17
- package/dist/components/core/Field/fieldContext.d.ts +12 -4
- package/dist/components/core/Field/fieldParts.d.ts +8 -9
- package/dist/components/core/Field/fieldTypes.d.ts +22 -6
- package/dist/components/core/Field/index.d.ts +7 -4
- package/dist/components/core/Input/Input.d.ts +2 -2
- package/dist/components/core/Input/index.d.ts +15 -5
- package/dist/components/core/Input/inputAnimations.d.ts +20 -2
- package/dist/components/core/Input/inputContext.d.ts +6 -2
- package/dist/components/core/Input/inputControlParts.d.ts +1 -0
- package/dist/components/core/Input/inputFieldParts.d.ts +12 -14
- package/dist/components/core/Input/inputTypes.d.ts +28 -3
- package/dist/components/core/Kbd/Kbd.d.ts +2 -1
- package/dist/components/core/Kbd/index.d.ts +10 -3
- package/dist/components/core/Kbd/kbdAnimations.d.ts +19 -3
- package/dist/components/core/Kbd/kbdContext.d.ts +6 -2
- package/dist/components/core/Kbd/kbdParts.d.ts +8 -5
- package/dist/components/core/Kbd/kbdTypes.d.ts +21 -3
- package/dist/components/core/Label/Label.d.ts +12 -2
- package/dist/components/core/Label/index.d.ts +1 -2
- package/dist/components/core/Label/labelContext.d.ts +6 -2
- package/dist/components/core/Label/labelTypes.d.ts +8 -2
- package/dist/components/core/Link/Link.d.ts +1 -1
- package/dist/components/core/Link/linkContext.d.ts +6 -2
- package/dist/components/core/Link/linkTypes.d.ts +26 -3
- package/dist/components/core/ListBox/ListBox.d.ts +1 -1
- package/dist/components/core/ListBox/index.d.ts +1 -0
- package/dist/components/core/ListBox/listBoxAnimations.d.ts +20 -2
- package/dist/components/core/ListBox/listBoxContext.d.ts +6 -2
- package/dist/components/core/ListBox/listBoxParts.d.ts +8 -7
- package/dist/components/core/ListBox/listBoxTypes.d.ts +38 -6
- package/dist/components/core/Loading/Loading.d.ts +2 -1
- package/dist/components/core/Loading/loadingContext.d.ts +6 -2
- package/dist/components/core/Loading/loadingTypes.d.ts +8 -2
- package/dist/components/core/Meter/Meter.d.ts +2 -2
- package/dist/components/core/Meter/index.d.ts +14 -5
- package/dist/components/core/Meter/meterAnimations.d.ts +30 -4
- package/dist/components/core/Meter/meterContext.d.ts +7 -3
- package/dist/components/core/Meter/meterParts.d.ts +13 -14
- package/dist/components/core/Meter/meterStyles.d.ts +1 -6
- package/dist/components/core/Meter/meterTypes.d.ts +36 -12
- package/dist/components/core/Meter/useMeterTrackState.d.ts +0 -2
- package/dist/components/core/Pagination/Pagination.d.ts +3 -2
- package/dist/components/core/Pagination/index.d.ts +18 -6
- package/dist/components/core/Pagination/paginationAnimations.d.ts +29 -2
- package/dist/components/core/Pagination/paginationContext.d.ts +6 -2
- package/dist/components/core/Pagination/paginationParts.d.ts +17 -6
- package/dist/components/core/Pagination/paginationTypes.d.ts +43 -5
- package/dist/components/core/Popover/Popover.d.ts +1 -1
- package/dist/components/core/Popover/index.d.ts +9 -3
- package/dist/components/core/Popover/popoverContext.d.ts +6 -2
- package/dist/components/core/Popover/popoverParts.d.ts +9 -4
- package/dist/components/core/Popover/popoverTypes.d.ts +41 -9
- package/dist/components/core/ProgressBar/ProgressBar.d.ts +2 -2
- package/dist/components/core/ProgressBar/index.d.ts +14 -5
- package/dist/components/core/ProgressBar/progressBarAnimations.d.ts +32 -4
- package/dist/components/core/ProgressBar/progressBarContext.d.ts +7 -3
- package/dist/components/core/ProgressBar/progressBarParts.d.ts +13 -14
- package/dist/components/core/ProgressBar/progressBarTypes.d.ts +35 -12
- package/dist/components/core/Radio/Radio.d.ts +2 -1
- package/dist/components/core/Radio/index.d.ts +5 -2
- package/dist/components/core/Radio/radioAnimations.d.ts +26 -4
- package/dist/components/core/Radio/radioContext.d.ts +12 -2
- package/dist/components/core/Radio/radioParts.d.ts +11 -7
- package/dist/components/core/Radio/radioTypes.d.ts +45 -10
- package/dist/components/core/SearchInput/searchInputContext.d.ts +6 -2
- package/dist/components/core/Select/Select.d.ts +2 -2
- package/dist/components/core/Select/index.d.ts +15 -5
- package/dist/components/core/Select/selectAnimations.d.ts +19 -1
- package/dist/components/core/Select/selectContext.d.ts +6 -2
- package/dist/components/core/Select/selectFieldParts.d.ts +12 -14
- package/dist/components/core/Select/selectParts.d.ts +3 -1
- package/dist/components/core/Select/selectTriggerParts.d.ts +1 -0
- package/dist/components/core/Select/selectTypes.d.ts +27 -3
- package/dist/components/core/SelectionIndicator/SelectionIndicator.d.ts +1 -1
- package/dist/components/core/SelectionIndicator/selectionIndicatorContext.d.ts +6 -2
- package/dist/components/core/SelectionIndicator/selectionIndicatorTypes.d.ts +12 -2
- package/dist/components/core/SelectionThumb/SelectionThumb.d.ts +1 -1
- package/dist/components/core/SelectionThumb/selectionThumbContext.d.ts +6 -2
- package/dist/components/core/SelectionThumb/selectionThumbTypes.d.ts +9 -2
- package/dist/components/core/Separator/Separator.d.ts +2 -1
- package/dist/components/core/Separator/separatorContext.d.ts +6 -2
- package/dist/components/core/Separator/separatorTypes.d.ts +8 -2
- package/dist/components/core/Skeleton/Skeleton.d.ts +2 -1
- package/dist/components/core/Skeleton/index.d.ts +10 -5
- package/dist/components/core/Skeleton/skeletonContext.d.ts +6 -2
- package/dist/components/core/Skeleton/skeletonParts.d.ts +9 -4
- package/dist/components/core/Skeleton/skeletonTypes.d.ts +33 -6
- package/dist/components/core/Slider/Slider.d.ts +2 -2
- package/dist/components/core/Slider/index.d.ts +13 -5
- package/dist/components/core/Slider/sliderAnimations.d.ts +20 -1
- package/dist/components/core/Slider/sliderContext.d.ts +6 -2
- package/dist/components/core/Slider/sliderParts.d.ts +13 -15
- package/dist/components/core/Slider/sliderScaleField.d.ts +4 -6
- package/dist/components/core/Slider/sliderThumbParts.d.ts +1 -1
- package/dist/components/core/Slider/sliderTypes.d.ts +27 -5
- package/dist/components/core/Slider/useSliderTrackState.d.ts +28 -28
- package/dist/components/core/Surface/Surface.d.ts +2 -1
- package/dist/components/core/Surface/surfaceContext.d.ts +6 -2
- package/dist/components/core/Surface/surfaceTypes.d.ts +8 -2
- package/dist/components/core/Switch/Switch.d.ts +2 -1
- package/dist/components/core/Switch/index.d.ts +3 -1
- package/dist/components/core/Switch/switchAnimations.d.ts +12 -1
- package/dist/components/core/Switch/switchContext.d.ts +6 -2
- package/dist/components/core/Switch/switchControlParts.d.ts +1 -0
- package/dist/components/core/Switch/switchFieldParts.d.ts +3 -3
- package/dist/components/core/Switch/switchTrackParts.d.ts +1 -1
- package/dist/components/core/Switch/switchTypes.d.ts +50 -7
- package/dist/components/core/Switch/useSwitchRootState.d.ts +17 -17
- package/dist/components/core/Table/Table.d.ts +5 -4
- package/dist/components/core/Table/index.d.ts +14 -4
- package/dist/components/core/Table/tableAPI.d.ts +3 -1
- package/dist/components/core/Table/tableAnimations.d.ts +3 -3
- package/dist/components/core/Table/tableContext.d.ts +6 -2
- package/dist/components/core/Table/tableParts.d.ts +12 -3
- package/dist/components/core/Table/tableTypes.d.ts +30 -8
- package/dist/components/core/Tabs/Tabs.d.ts +2 -1
- package/dist/components/core/Tabs/index.d.ts +4 -1
- package/dist/components/core/Tabs/tabsAnimations.d.ts +3 -2
- package/dist/components/core/Tabs/tabsContext.d.ts +6 -2
- package/dist/components/core/Tabs/tabsPanelPart.d.ts +1 -0
- package/dist/components/core/Tabs/tabsTabPart.d.ts +1 -0
- package/dist/components/core/Tabs/tabsTypes.d.ts +19 -2
- package/dist/components/core/Text/Text.d.ts +2 -1
- package/dist/components/core/Text/textContext.d.ts +6 -2
- package/dist/components/core/Text/textTypes.d.ts +8 -2
- package/dist/components/core/TextArea/TextArea.d.ts +2 -2
- package/dist/components/core/TextArea/index.d.ts +15 -5
- package/dist/components/core/TextArea/textAreaAnimations.d.ts +19 -1
- package/dist/components/core/TextArea/textAreaContext.d.ts +6 -2
- package/dist/components/core/TextArea/textAreaParts.d.ts +14 -14
- package/dist/components/core/TextArea/textAreaTypes.d.ts +29 -3
- package/dist/components/core/TimeField/TimeField.d.ts +2 -2
- package/dist/components/core/TimeField/index.d.ts +14 -5
- package/dist/components/core/TimeField/timeFieldAnimations.d.ts +20 -2
- package/dist/components/core/TimeField/timeFieldContext.d.ts +6 -2
- package/dist/components/core/TimeField/timeFieldParts.d.ts +13 -14
- package/dist/components/core/TimeField/timeFieldTypes.d.ts +28 -4
- package/dist/components/core/Toast/Toast.d.ts +2 -1
- package/dist/components/core/Toast/index.d.ts +2 -1
- package/dist/components/core/Toast/toastAnimations.d.ts +2 -1
- package/dist/components/core/Toast/toastContext.d.ts +6 -2
- package/dist/components/core/Toast/toastTypes.d.ts +26 -9
- package/dist/components/core/ToggleButton/ToggleButton.d.ts +2 -1
- package/dist/components/core/ToggleButton/index.d.ts +2 -1
- package/dist/components/core/ToggleButton/toggleButtonContext.d.ts +6 -2
- package/dist/components/core/ToggleButton/toggleButtonTypes.d.ts +8 -2
- package/dist/components/core/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/core/Tooltip/index.d.ts +3 -2
- package/dist/components/core/Tooltip/tooltipAnimations.d.ts +1 -0
- package/dist/components/core/Tooltip/tooltipContext.d.ts +6 -2
- package/dist/components/core/Tooltip/tooltipParts.d.ts +7 -6
- package/dist/components/core/Tooltip/tooltipTypes.d.ts +34 -7
- package/dist/components/core/Tooltip/useTooltipRootState.d.ts +2 -2
- package/dist/components/core/utils/motionConfig.d.ts +4 -4
- package/dist/components/core/utils/optionListItemParts.d.ts +4 -2
- package/dist/components/core/utils/overlayTriggerSqueeze.d.ts +39 -0
- package/dist/components/core/utils/slotMotion/createMotionScope.d.ts +18 -4
- package/dist/components/core/utils/slotMotion/enterHidesFirstPaint.d.ts +3 -7
- package/dist/components/core/utils/slotMotion/index.d.ts +7 -2
- package/dist/components/core/utils/slotMotion/kitMotionRecipeMeta.d.ts +8 -0
- package/dist/components/core/utils/slotMotion/motionController.d.ts +20 -0
- package/dist/components/core/utils/slotMotion/motionController.test.d.ts +1 -0
- package/dist/components/core/utils/slotMotion/motionControllerApi.test.d.ts +1 -0
- package/dist/components/core/utils/slotMotion/motionControllerTypes.d.ts +49 -0
- package/dist/components/core/utils/slotMotion/motionEvents.d.ts +67 -0
- package/dist/components/core/utils/slotMotion/motionEvents.test.d.ts +1 -0
- package/dist/components/core/utils/slotMotion/motionRecipeRegistry.d.ts +6 -2
- package/dist/components/core/utils/slotMotion/motionTween.d.ts +49 -0
- package/dist/components/core/utils/slotMotion/motionTween.test.d.ts +1 -0
- package/dist/components/core/utils/slotMotion/playMotionState.d.ts +29 -0
- package/dist/components/core/utils/slotMotion/playMotionState.test.d.ts +1 -0
- package/dist/components/core/utils/slotMotion/recipes/collapsibleHeight.d.ts +1 -1
- package/dist/components/core/utils/slotMotion/recipes/progressFill.d.ts +9 -0
- package/dist/components/core/utils/slotMotion/recipes/progressFill.test.d.ts +1 -0
- package/dist/components/core/utils/slotMotion/runMotionPhase.d.ts +5 -2
- package/dist/components/core/utils/slotMotion/slotMotionTypes.d.ts +115 -9
- package/dist/components/core/utils/slotMotion/useBarFillMotion.d.ts +21 -0
- package/dist/components/core/utils/slotMotion/useMotionPart.d.ts +5 -5
- package/dist/components/core/utils/useCollapsibleHeight.d.ts +9 -1
- package/dist/components/core/utils/useContainerPointerHoverHandlers.d.ts +5 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +31 -31
- package/dist/index.js +20305 -16413
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +1 -1
- package/dist/themeRuntimeContext-BveSYUe9.cjs +14 -0
- package/dist/{themeRuntimeContext-DELPwtpL.js → themeRuntimeContext-DCicI7AC.js} +640 -614
- package/dist/ui.css +43 -0
- package/package.json +4 -3
- package/dist/themeRuntimeContext-DknZO7q3.cjs +0 -14
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { MOTION_PHASE_NAMES, MotionPartPhases, MotionSlotMap, MotionValue } from './slotMotionTypes';
|
|
2
|
+
/** App commands on `motion.events`. Do not use `MotionPhaseName` keys. */
|
|
3
|
+
export type MotionEvents<TEvent extends string = string> = {
|
|
4
|
+
[K in TEvent]?: MotionValue;
|
|
5
|
+
};
|
|
6
|
+
/** Per-slot values for one app mode (`idle` / `loading`). Not phases. */
|
|
7
|
+
export type MotionStateSlots = {
|
|
8
|
+
[slot: string]: MotionValue | undefined;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* App modes on `motion.states`. Sibling of slots and `events`.
|
|
12
|
+
* Do not use `MotionPhaseName` keys (`idle` is fine; `hoverIn` is not).
|
|
13
|
+
*/
|
|
14
|
+
export type MotionStates<TState extends string = string> = {
|
|
15
|
+
[K in TState]?: MotionStateSlots;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Host props for declarative modes. Destructure before `...rest` (not on the DOM).
|
|
19
|
+
* Pair with `motion.states`. Same `motionState` again does not replay.
|
|
20
|
+
*/
|
|
21
|
+
export type MotionStateHostProps = {
|
|
22
|
+
/**
|
|
23
|
+
* App mode (`idle` / `loading` / `success`). Not a `MotionPhaseName`.
|
|
24
|
+
* The same value again is a no-op; change it to play `motion.states[name]`.
|
|
25
|
+
*/
|
|
26
|
+
motionState?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Opaque snapshot for the transition factory (`ctx.payload`).
|
|
29
|
+
* Updating this without changing `motionState` does not replay.
|
|
30
|
+
*/
|
|
31
|
+
motionPayload?: unknown;
|
|
32
|
+
/**
|
|
33
|
+
* Play `motion.states[motionState]` on mount. Default skip so first paint stays CSS rest.
|
|
34
|
+
*/
|
|
35
|
+
playInitialState?: boolean;
|
|
36
|
+
};
|
|
37
|
+
/** Slot map plus sibling `events` / `states` (not DOM slots). */
|
|
38
|
+
export type MotionMapWithEvents<TSlots extends object> = TSlots & {
|
|
39
|
+
events?: MotionEvents;
|
|
40
|
+
states?: MotionStates;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Root `motion` including optional `events` / `states`. Open index cannot be `MotionSlotMap`
|
|
44
|
+
* (`events` values are `MotionValue`; `states` values are per-slot maps).
|
|
45
|
+
*/
|
|
46
|
+
export type MotionRootInput = {
|
|
47
|
+
[slot: string]: MotionPartPhases | MotionEvents | MotionStates | undefined;
|
|
48
|
+
events?: MotionEvents;
|
|
49
|
+
states?: MotionStates;
|
|
50
|
+
};
|
|
51
|
+
type NoPhaseKeys<T> = Extract<keyof T, (typeof MOTION_PHASE_NAMES)[number]> extends never ? T : never;
|
|
52
|
+
/**
|
|
53
|
+
* Identity helper for a namespaced event map (`checkout:saving`).
|
|
54
|
+
* Built-in phase names as keys are a type error and a dev `console.error`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function createMotionEvents<const T extends Record<string, MotionValue>>(events: NoPhaseKeys<T>): T;
|
|
57
|
+
/**
|
|
58
|
+
* Identity helper for `motion.states` (`idle` / `loading` / `success`).
|
|
59
|
+
* Built-in phase names as keys are a type error and a dev `console.error`.
|
|
60
|
+
*/
|
|
61
|
+
export declare function createMotionStates<const T extends Record<string, MotionStateSlots>>(states: NoPhaseKeys<T>): T;
|
|
62
|
+
export declare function splitMotionRootMap(motion: MotionRootInput | undefined): {
|
|
63
|
+
slots: MotionSlotMap | undefined;
|
|
64
|
+
events: MotionEvents | undefined;
|
|
65
|
+
states: MotionStates | undefined;
|
|
66
|
+
};
|
|
67
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import { KitRecipeName, MotionRecipe } from './slotMotionTypes';
|
|
1
|
+
import { KitRecipeName, MotionRecipe, MotionRecipeMetadata } from './slotMotionTypes';
|
|
2
2
|
export type RegisterMotionRecipeOptions = {
|
|
3
3
|
/**
|
|
4
4
|
* Replace a kit recipe (`hoverLiftSecondLevel`, …).
|
|
5
5
|
* Custom names never need this — re-registering them just replaces the previous app entry.
|
|
6
6
|
*/
|
|
7
7
|
override?: boolean;
|
|
8
|
-
}
|
|
8
|
+
} & Partial<MotionRecipeMetadata>;
|
|
9
9
|
export declare function isKitMotionRecipe(name: string): name is KitRecipeName;
|
|
10
10
|
/**
|
|
11
11
|
* Write the kit layer only. Does not touch app overrides, so a later
|
|
12
12
|
* `registerKitMotionRecipes()` (HMR / re-import) cannot wipe `{ override: true }`.
|
|
13
|
+
* Metadata comes from `KIT_MOTION_RECIPE_META`.
|
|
13
14
|
*/
|
|
14
15
|
export declare function registerKitMotionRecipe(name: KitRecipeName, recipe: MotionRecipe): void;
|
|
15
16
|
/**
|
|
16
17
|
* Register an app recipe. Custom names always write.
|
|
17
18
|
* Kit names no-op in dev with a warning unless `{ override: true }`.
|
|
19
|
+
* Metadata overlays kit (on override) or `MOTION_RECIPE_METADATA_DEFAULTS` (new name).
|
|
18
20
|
*/
|
|
19
21
|
export declare function registerMotionRecipe(name: string, recipe: MotionRecipe, options?: RegisterMotionRecipeOptions): void;
|
|
20
22
|
/** Remove an app entry. Kit names fall back to the kit default. */
|
|
21
23
|
export declare function unregisterMotionRecipe(name: string): boolean;
|
|
22
24
|
export declare function getMotionRecipe(name: string): MotionRecipe | undefined;
|
|
25
|
+
/** Live passport (app overlay wins, then kit, then nothing). */
|
|
26
|
+
export declare function getMotionRecipeMetadata(name: string): MotionRecipeMetadata | undefined;
|
|
23
27
|
export declare function hasMotionRecipe(name: string): boolean;
|
|
24
28
|
/** Kit names plus any app custom / override names, sorted. */
|
|
25
29
|
export declare function listMotionRecipes(): string[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MotionConfig } from '../motionConfig';
|
|
2
|
+
import { MotionAnimation, MotionDelay, MotionPhaseName, MotionReplay, MotionTimeline, MotionTweenVars, MotionVars } from './slotMotionTypes';
|
|
3
|
+
export declare const MOTION_REST_POSE: {
|
|
4
|
+
readonly x: 0;
|
|
5
|
+
readonly y: 0;
|
|
6
|
+
readonly scale: 1;
|
|
7
|
+
readonly scaleX: 1;
|
|
8
|
+
readonly scaleY: 1;
|
|
9
|
+
readonly rotation: 0;
|
|
10
|
+
readonly rotate: 0;
|
|
11
|
+
readonly autoAlpha: 1;
|
|
12
|
+
readonly opacity: 1;
|
|
13
|
+
};
|
|
14
|
+
export type MotionTweenHost = {
|
|
15
|
+
el: HTMLElement;
|
|
16
|
+
phase: MotionPhaseName | (string & {});
|
|
17
|
+
reduced: boolean;
|
|
18
|
+
config: Readonly<MotionConfig>;
|
|
19
|
+
onCleanup: (fn: () => void) => void;
|
|
20
|
+
setAnimation: (animation: MotionAnimation | undefined) => void;
|
|
21
|
+
};
|
|
22
|
+
export type MotionTweenApi = {
|
|
23
|
+
to: {
|
|
24
|
+
(vars: MotionTweenVars): MotionAnimation | undefined;
|
|
25
|
+
(el: HTMLElement | null | undefined, vars: MotionTweenVars): MotionAnimation | undefined;
|
|
26
|
+
};
|
|
27
|
+
fromRest: {
|
|
28
|
+
(vars: MotionTweenVars): MotionAnimation | undefined;
|
|
29
|
+
(el: HTMLElement | null | undefined, vars: MotionTweenVars): MotionAnimation | undefined;
|
|
30
|
+
};
|
|
31
|
+
fromTo: {
|
|
32
|
+
(from: MotionTweenVars, vars: MotionTweenVars): MotionAnimation | undefined;
|
|
33
|
+
(el: HTMLElement | null | undefined, from: MotionTweenVars, vars: MotionTweenVars): MotionAnimation | undefined;
|
|
34
|
+
};
|
|
35
|
+
timeline: () => MotionTimeline;
|
|
36
|
+
};
|
|
37
|
+
export declare function resolveMotionReplay(phase: string, vars: {
|
|
38
|
+
replay?: MotionReplay;
|
|
39
|
+
yoyo?: boolean;
|
|
40
|
+
}): MotionReplay;
|
|
41
|
+
export declare function motionRestVars(vars: MotionTweenVars): MotionTweenVars;
|
|
42
|
+
/** Seconds for GSAP `delay`. `"expand"` → `expandDuration`. Invalid / non-finite → omit. */
|
|
43
|
+
export declare function resolveMotionDelay(delay: MotionDelay | undefined, cfg: Readonly<MotionConfig>): number | undefined;
|
|
44
|
+
export declare function playDeclarativeMotion(el: HTMLElement, vars: MotionVars, options: {
|
|
45
|
+
phase: MotionPhaseName | (string & {});
|
|
46
|
+
reduced: boolean;
|
|
47
|
+
config: Readonly<MotionConfig>;
|
|
48
|
+
}): MotionAnimation | undefined;
|
|
49
|
+
export declare function createMotionTweenApi(host: MotionTweenHost): MotionTweenApi;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MotionStates } from './motionEvents';
|
|
2
|
+
import { MotionValue } from './slotMotionTypes';
|
|
3
|
+
export type MotionStatePlayScope = {
|
|
4
|
+
getStates: () => MotionStates | undefined;
|
|
5
|
+
getTargets: (slot: string) => readonly HTMLElement[];
|
|
6
|
+
play: (slot: string, name: string, options?: {
|
|
7
|
+
partValue?: MotionValue;
|
|
8
|
+
el?: HTMLElement | null;
|
|
9
|
+
fromState?: string;
|
|
10
|
+
toState?: string;
|
|
11
|
+
payload?: unknown;
|
|
12
|
+
}) => unknown;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* First commit: skip unless `playInitial`.
|
|
16
|
+
* Same name: skip (payload-only updates do not replay).
|
|
17
|
+
* Empty `next`: skip (no automatic rest pose).
|
|
18
|
+
*/
|
|
19
|
+
export declare function nextMotionStateTransition(prev: string | undefined, next: string | undefined, options: {
|
|
20
|
+
isFirst: boolean;
|
|
21
|
+
playInitial: boolean;
|
|
22
|
+
}): {
|
|
23
|
+
from: string | undefined;
|
|
24
|
+
to: string;
|
|
25
|
+
} | null;
|
|
26
|
+
/** Play every listed slot for `to`. Missing state → skip + dev `console.error`. */
|
|
27
|
+
export declare function playMotionStateTransition(scope: MotionStatePlayScope, from: string | undefined, to: string, payload?: unknown): void;
|
|
28
|
+
/** Provider hook: play `motion.states[motionState]` when the mode changes. */
|
|
29
|
+
export declare function useMotionStatePlayback(scope: MotionStatePlayScope, motionState: string | undefined, payload: unknown, playInitial?: boolean): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MotionAnimation, MotionContext } from '../slotMotionTypes';
|
|
2
|
-
/** Enter/leave panel height. Snapshot
|
|
2
|
+
/** Enter/leave panel height. Snapshot layout height inside `animateCollapsibleHeight` — not a GSAP function value. */
|
|
3
3
|
export declare function collapsibleHeightRecipe(ctx: MotionContext): MotionAnimation | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MotionAnimation, MotionContext, MotionTransformVars } from '../slotMotionTypes';
|
|
2
|
+
export declare function clampProgressScale(value: number): number;
|
|
3
|
+
export declare function progressScaleFromPercent(percent: number): number;
|
|
4
|
+
export declare function progressFillScaleVars(scale: number, isHorizontal: boolean): MotionTransformVars;
|
|
5
|
+
export declare function applyProgressFillInstant(el: HTMLElement, scale: number, isHorizontal: boolean): void;
|
|
6
|
+
/** Determinate Meter / ProgressBar fill: compositor `scaleX` / `scaleY`. */
|
|
7
|
+
export declare function progressFillRecipe(ctx: MotionContext): MotionAnimation | undefined;
|
|
8
|
+
/** ProgressBar indeterminate translate loop. Host replays on ResizeObserver. */
|
|
9
|
+
export declare function progressIndeterminateRecipe(ctx: MotionContext): MotionAnimation | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,7 +3,7 @@ import { MotionCancelReason, MotionPhaseName, MotionRecipeParams, MotionRun, Mot
|
|
|
3
3
|
export declare function killStoredMotion(el: HTMLElement, reason?: MotionCancelReason): void;
|
|
4
4
|
export type RunMotionPhaseOptions = {
|
|
5
5
|
el: HTMLElement | null | undefined;
|
|
6
|
-
phase: MotionPhaseName;
|
|
6
|
+
phase: MotionPhaseName | (string & {});
|
|
7
7
|
value: MotionValue | undefined;
|
|
8
8
|
targets: Record<string, HTMLElement | null>;
|
|
9
9
|
getTarget?: (slot: string) => HTMLElement | null;
|
|
@@ -13,10 +13,13 @@ export type RunMotionPhaseOptions = {
|
|
|
13
13
|
waitForComplete?: boolean;
|
|
14
14
|
slot?: string;
|
|
15
15
|
config?: Readonly<MotionConfig>;
|
|
16
|
+
fromState?: string;
|
|
17
|
+
toState?: string;
|
|
18
|
+
payload?: unknown;
|
|
16
19
|
};
|
|
17
20
|
/**
|
|
18
21
|
* Play one phase on one element. A new play cancels the previous run on that
|
|
19
22
|
* element and always settles its `finished` (it does not hang).
|
|
20
23
|
* `false` skips the phase without killing, so a host slot can drive this target.
|
|
21
24
|
*/
|
|
22
|
-
export declare function runMotionPhase({ el, phase, value, targets, getTarget, getTargets, params, complete, waitForComplete, slot, config, }: RunMotionPhaseOptions): MotionRun;
|
|
25
|
+
export declare function runMotionPhase({ el, phase, value, targets, getTarget, getTargets, params, complete, waitForComplete, slot, config, fromState, toState, payload, }: RunMotionPhaseOptions): MotionRun;
|
|
@@ -2,18 +2,51 @@ import { RefObject } from 'react';
|
|
|
2
2
|
import { MotionConfig } from '../motionConfig';
|
|
3
3
|
import { ShadowSize } from '../../../../tokens/shadows';
|
|
4
4
|
/** Built-in recipe names. Custom names via `registerMotionRecipe` are also valid (kit names need `{ override: true }`). */
|
|
5
|
-
export declare const KIT_MOTION_RECIPES: readonly ["hoverLiftSecondLevel", "hoverLiftGloss", "hoverLiftFirstLevel", "pressSqueeze", "pressSqueezeGloss", "collapsibleHeight", "chevronRotate", "portalSurfaceEnter", "portalSurfaceLeave", "selectionFill", "selectionMark", "modalOverlayEnter", "modalOverlayLeave", "modalPanelEnter", "modalPanelLeave", "drawerSlideEnter", "drawerSlideLeave", "switchThumb", "switchFill", "switchIconOn", "switchIconOff", "toastSurfaceEnter", "toastSurfaceLeave", "contentFade", "searchExpand", "searchIconShift", "fileRowExit"];
|
|
5
|
+
export declare const KIT_MOTION_RECIPES: readonly ["hoverLiftSecondLevel", "hoverLiftGloss", "hoverLiftFirstLevel", "pressSqueeze", "pressSqueezeGloss", "collapsibleHeight", "chevronRotate", "portalSurfaceEnter", "portalSurfaceLeave", "selectionFill", "selectionMark", "modalOverlayEnter", "modalOverlayLeave", "modalPanelEnter", "modalPanelLeave", "drawerSlideEnter", "drawerSlideLeave", "switchThumb", "switchFill", "switchIconOn", "switchIconOff", "toastSurfaceEnter", "toastSurfaceLeave", "contentFade", "searchExpand", "searchIconShift", "fileRowExit", "progressFill", "progressIndeterminate"];
|
|
6
6
|
export type KitRecipeName = (typeof KIT_MOTION_RECIPES)[number];
|
|
7
7
|
/** Autocomplete kit names; custom registered strings still type-check. */
|
|
8
8
|
export type MotionRecipeName = KitRecipeName | (string & {});
|
|
9
|
+
/**
|
|
10
|
+
* `MotionConfig` duration key a recipe reads by default (`ctx.config[token]`).
|
|
11
|
+
* Host params (`ctx.params.duration`) may still override.
|
|
12
|
+
*/
|
|
13
|
+
export type MotionDurationToken = "interactiveDuration" | "tooltipDuration" | "modalDuration" | "switchThumbDuration" | "selectionFillDuration" | "expandDuration" | "toastDismissDuration" | "progressFillDuration" | "progressIndeterminateDuration";
|
|
14
|
+
/**
|
|
15
|
+
* Tween delay: seconds, or a `MotionConfig` duration key (milliseconds → seconds).
|
|
16
|
+
* `"expand"` is `expandDuration` — start after `collapsibleHeight` on Expandable / Disclosure / Accordion.
|
|
17
|
+
*/
|
|
18
|
+
export type MotionDelay = number | MotionDurationToken | "expand";
|
|
19
|
+
/** Reduced-motion / `enable*` off: snap to the end state, or skip the effect. */
|
|
20
|
+
export type MotionReducedStrategy = "instant" | "skip";
|
|
21
|
+
/**
|
|
22
|
+
* Passport for a named recipe. Kit recipes fill every field (`KIT_MOTION_RECIPE_META`).
|
|
23
|
+
* App `registerMotionRecipe(name, fn, { hidesFirstPaint: true })` overlays these.
|
|
24
|
+
*/
|
|
25
|
+
export type MotionRecipeMetadata = {
|
|
26
|
+
/** Nested enter: `gsap.set(autoAlpha: 0)` before play. Portal host recipes stay `false`. */
|
|
27
|
+
hidesFirstPaint: boolean;
|
|
28
|
+
/** Recipe has a reduced / flag-off branch (`ctx.reduced` or `enable*`). */
|
|
29
|
+
supportsReducedMotion: boolean;
|
|
30
|
+
/** How that branch behaves. Pointer recipes typically `skip`; lifecycle `instant`. */
|
|
31
|
+
reducedStrategy: MotionReducedStrategy;
|
|
32
|
+
/** Measures or writes layout (`height` / `width` / `left`). Not for hover. */
|
|
33
|
+
usesLayout: boolean;
|
|
34
|
+
/** Leave returns a tween / calls `complete` so the host can unmount after. */
|
|
35
|
+
supportsLeaveCompletion: boolean;
|
|
36
|
+
/** Pointer phases (hover / press), not open / close / check. */
|
|
37
|
+
interactive: boolean;
|
|
38
|
+
defaultDurationToken: MotionDurationToken;
|
|
39
|
+
};
|
|
40
|
+
export declare const MOTION_RECIPE_METADATA_DEFAULTS: MotionRecipeMetadata;
|
|
9
41
|
/** Canonical lifecycle phases. App events are a separate W3 API — do not add them here. */
|
|
10
42
|
export declare const MOTION_PHASE_NAMES: readonly ["hoverIn", "hoverOut", "pressIn", "pressOut", "enter", "leave", "check", "uncheck", "change"];
|
|
11
43
|
export type MotionPhaseName = (typeof MOTION_PHASE_NAMES)[number];
|
|
44
|
+
export declare function isMotionPhaseName(value: string): value is MotionPhaseName;
|
|
12
45
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `rotation` / `scaleX` / `opacity` in
|
|
16
|
-
*
|
|
46
|
+
* Compositor vars for `MotionController.set` and kit recipes.
|
|
47
|
+
* Layout (`width` / `height` / `top` / `left` / `margin`) is forbidden — no index signature.
|
|
48
|
+
* Declarative `motion` maps stay on `MotionVars`; `rotation` / `scaleX` / `opacity` in a
|
|
49
|
+
* factory belong in `ctx.fromRest` / `ctx.to` or `gsap.to`, not in `MotionVars`.
|
|
17
50
|
*/
|
|
18
51
|
export type MotionTransformVars = {
|
|
19
52
|
x?: number;
|
|
@@ -28,11 +61,17 @@ export type MotionTransformVars = {
|
|
|
28
61
|
duration?: number;
|
|
29
62
|
ease?: string;
|
|
30
63
|
};
|
|
64
|
+
/**
|
|
65
|
+
* Where a declarative tween starts. `"current"` continues from the live pose
|
|
66
|
+
* (hover / press). `"rest"` restarts from identity (`x`/`y` `0`, `scale` `1`, …)
|
|
67
|
+
* so a retriggered ping does not freeze at the peak.
|
|
68
|
+
*/
|
|
69
|
+
export type MotionReplay = "rest" | "current";
|
|
31
70
|
/**
|
|
32
71
|
* Transform / opacity vars for the public motion API (safe subset of compositor props).
|
|
33
72
|
* Duration is seconds (GSAP). Do not pass layout props (`width`, `height`, `top`, `left`).
|
|
34
|
-
* `rotation` / `scaleX` / `scaleY` / `opacity` are not
|
|
35
|
-
* `
|
|
73
|
+
* `rotation` / `scaleX` / `scaleY` / `opacity` are not in `MotionVars` — use a factory
|
|
74
|
+
* (`ctx.fromRest` / `ctx.to`) or `MotionController.set` with `MotionTransformVars`.
|
|
36
75
|
*/
|
|
37
76
|
export type MotionVars = {
|
|
38
77
|
x?: number;
|
|
@@ -41,13 +80,46 @@ export type MotionVars = {
|
|
|
41
80
|
autoAlpha?: number;
|
|
42
81
|
duration?: number;
|
|
43
82
|
ease?: string;
|
|
83
|
+
yoyo?: boolean;
|
|
84
|
+
repeat?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Seconds, a `MotionDurationToken` (`"expandDuration"`), or `"expand"`
|
|
87
|
+
* (`expandDuration`). Use `"expand"` so Expandable / Disclosure / Accordion
|
|
88
|
+
* body enter starts after `collapsibleHeight`.
|
|
89
|
+
*/
|
|
90
|
+
delay?: MotionDelay;
|
|
91
|
+
/**
|
|
92
|
+
* Start pose. Default: `"current"` for lifecycle phases; app events with
|
|
93
|
+
* `yoyo: true` replay from `"rest"`. Set explicitly to override.
|
|
94
|
+
*/
|
|
95
|
+
replay?: MotionReplay;
|
|
44
96
|
/**
|
|
45
97
|
* Nested enter first-paint: `"hidden"` → `gsap.set(autoAlpha: 0)` before play
|
|
46
98
|
* (`hideNestedEnterSlots`). `"visible"` skips even if `autoAlpha` is set.
|
|
47
|
-
*
|
|
99
|
+
* Named recipes also hide when `getMotionRecipeMetadata(name).hidesFirstPaint`.
|
|
100
|
+
* Raw factories cannot be inspected — wrap as `{ recipe: "name", firstPaint: "hidden" }`
|
|
101
|
+
* or pass `{ hidesFirstPaint: true }` to `registerMotionRecipe`.
|
|
48
102
|
*/
|
|
49
103
|
firstPaint?: "hidden" | "visible";
|
|
50
104
|
};
|
|
105
|
+
/** Compositor tween vars for `ctx.to` / `ctx.fromRest` (includes `rotation` / `scaleX`). */
|
|
106
|
+
export type MotionTweenVars = MotionTransformVars & {
|
|
107
|
+
yoyo?: boolean;
|
|
108
|
+
repeat?: number;
|
|
109
|
+
delay?: MotionDelay;
|
|
110
|
+
};
|
|
111
|
+
/** GSAP timeline position (`0`, `"+=0.05"`, `"<"`). */
|
|
112
|
+
export type MotionTimelinePosition = number | string;
|
|
113
|
+
/**
|
|
114
|
+
* Kit timeline: `overwrite` / `force3D` are already in defaults.
|
|
115
|
+
* `fromRest` restarts listed transform keys from identity.
|
|
116
|
+
*/
|
|
117
|
+
export type MotionTimeline = MotionAnimation & {
|
|
118
|
+
to: (el: HTMLElement | null | undefined, vars: MotionTweenVars, position?: MotionTimelinePosition) => MotionTimeline;
|
|
119
|
+
fromTo: (el: HTMLElement | null | undefined, from: MotionTweenVars, vars: MotionTweenVars, position?: MotionTimelinePosition) => MotionTimeline;
|
|
120
|
+
fromRest: (el: HTMLElement | null | undefined, vars: MotionTweenVars, position?: MotionTimelinePosition) => MotionTimeline;
|
|
121
|
+
add: (child: Pick<MotionAnimation, "kill"> | undefined, position?: MotionTimelinePosition) => MotionTimeline;
|
|
122
|
+
};
|
|
51
123
|
/**
|
|
52
124
|
* Closed kit host params (`MotionContext.params`). Custom app data stays in a
|
|
53
125
|
* factory closure — do not add an index signature.
|
|
@@ -71,6 +143,12 @@ export type MotionRecipeParams = {
|
|
|
71
143
|
isTop?: boolean;
|
|
72
144
|
getTravelPx?: () => number;
|
|
73
145
|
travelPx?: number;
|
|
146
|
+
/** Live 0…1 fill amount for Meter / ProgressBar (`progressFill`). */
|
|
147
|
+
getProgressScale?: () => number;
|
|
148
|
+
/** Meter / ProgressBar orientation. `false` → vertical (origin bottom). */
|
|
149
|
+
isHorizontal?: boolean;
|
|
150
|
+
/** ProgressBar indeterminate translate loop (`progressIndeterminate`). */
|
|
151
|
+
indeterminate?: boolean;
|
|
74
152
|
placement?: "left" | "right" | "top" | "bottom";
|
|
75
153
|
targetW?: number;
|
|
76
154
|
collapsedDim?: number;
|
|
@@ -103,7 +181,13 @@ export type MotionRun = {
|
|
|
103
181
|
};
|
|
104
182
|
export type MotionContext = {
|
|
105
183
|
el: HTMLElement;
|
|
106
|
-
phase: MotionPhaseName;
|
|
184
|
+
phase: MotionPhaseName | (string & {});
|
|
185
|
+
/** Previous `motionState` for a state transition. Undefined for phases / events. */
|
|
186
|
+
fromState?: string;
|
|
187
|
+
/** Next `motionState` for a state transition (`ctx.phase` is the same name). */
|
|
188
|
+
toState?: string;
|
|
189
|
+
/** Opaque snapshot from `motionPayload` at the moment of the transition. */
|
|
190
|
+
payload?: unknown;
|
|
107
191
|
/**
|
|
108
192
|
* Unique / first live node per slot at play time.
|
|
109
193
|
* Repeated slots: use `ctx.el` (this instance) or `getTargets(slot)`.
|
|
@@ -126,6 +210,28 @@ export type MotionContext = {
|
|
|
126
210
|
signal: AbortSignal;
|
|
127
211
|
/** Register timer/RAF teardown; runs on cancel and when the run settles. */
|
|
128
212
|
onCleanup: (fn: () => void) => void;
|
|
213
|
+
/**
|
|
214
|
+
* Tween from the current pose. Kit sets `overwrite` (`"auto"` on phases, `true`
|
|
215
|
+
* on app events) and `force3D: false` — do not copy those flags in app code.
|
|
216
|
+
*/
|
|
217
|
+
to: {
|
|
218
|
+
(vars: MotionTweenVars): MotionAnimation | undefined;
|
|
219
|
+
(el: HTMLElement | null | undefined, vars: MotionTweenVars): MotionAnimation | undefined;
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* Retriggerable one-shot from rest. Prefer this (or a declarative map with
|
|
223
|
+
* `yoyo` / `replay: "rest"`) over raw `gsap.fromTo` + `overwrite`.
|
|
224
|
+
*/
|
|
225
|
+
fromRest: {
|
|
226
|
+
(vars: MotionTweenVars): MotionAnimation | undefined;
|
|
227
|
+
(el: HTMLElement | null | undefined, vars: MotionTweenVars): MotionAnimation | undefined;
|
|
228
|
+
};
|
|
229
|
+
fromTo: {
|
|
230
|
+
(from: MotionTweenVars, vars: MotionTweenVars): MotionAnimation | undefined;
|
|
231
|
+
(el: HTMLElement | null | undefined, from: MotionTweenVars, vars: MotionTweenVars): MotionAnimation | undefined;
|
|
232
|
+
};
|
|
233
|
+
/** Multi-slot sequence; children inherit kit tween defaults. */
|
|
234
|
+
timeline: () => MotionTimeline;
|
|
129
235
|
};
|
|
130
236
|
/**
|
|
131
237
|
* Prefer returning a GSAP tween/timeline (`kill`) so the kit can interrupt and wait for `leave`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { MotionScopeValue } from './createMotionScope';
|
|
3
|
+
/**
|
|
4
|
+
* Determinate first-paint + `fill.enter`, `change: false` / reduced snap,
|
|
5
|
+
* and indeterminate `fill.change` loop (ResizeObserver replay).
|
|
6
|
+
* Track still broadcasts determinate `fill.change` via `useSlotPhaseOnChange`.
|
|
7
|
+
*
|
|
8
|
+
* `fill.enter` is played here (not `useOptionalEnterOnMount`). A mount-only
|
|
9
|
+
* `useEffect` `killMotion` runs *after* enter in React Strict Mode and leaves
|
|
10
|
+
* the fill at scale 0; cleanup on this layout effect kills and lets the second
|
|
11
|
+
* setup replay enter.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useBarFillMotion({ scope, percent, isHorizontal, indeterminate, fillRef, }: {
|
|
14
|
+
scope: MotionScopeValue | null;
|
|
15
|
+
percent: number;
|
|
16
|
+
isHorizontal: boolean;
|
|
17
|
+
indeterminate?: boolean;
|
|
18
|
+
fillRef: RefObject<HTMLSpanElement | null>;
|
|
19
|
+
}): {
|
|
20
|
+
reduceMotion: boolean;
|
|
21
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ForwardedRef, RefObject, PointerEvent as ReactPointerEvent } from 'react';
|
|
1
|
+
import { ForwardedRef, PointerEventHandler, RefObject, PointerEvent as ReactPointerEvent } from 'react';
|
|
2
2
|
import { MotionScopeValue } from './createMotionScope';
|
|
3
3
|
import { MotionPartPhases } from './slotMotionTypes';
|
|
4
4
|
export declare function mergeMotionPointerHandlers<E extends HTMLElement>(userOver: ((e: ReactPointerEvent<E>) => void) | undefined, userOut: ((e: ReactPointerEvent<E>) => void) | undefined, motionOver: (e: ReactPointerEvent<E>) => void, motionOut: (e: ReactPointerEvent<E>) => void): {
|
|
@@ -23,10 +23,10 @@ export declare function useMotionPart<T extends HTMLElement>({ scope, slot, moti
|
|
|
23
23
|
/** When true, pressIn/pressOut on pointer down/up (trigger = this part). */
|
|
24
24
|
pressPhases?: boolean;
|
|
25
25
|
skipHover?: () => boolean;
|
|
26
|
-
onPointerOver?:
|
|
27
|
-
onPointerOut?:
|
|
28
|
-
onPointerDown?:
|
|
29
|
-
onPointerUp?:
|
|
26
|
+
onPointerOver?: PointerEventHandler<T>;
|
|
27
|
+
onPointerOut?: PointerEventHandler<T>;
|
|
28
|
+
onPointerDown?: PointerEventHandler<T>;
|
|
29
|
+
onPointerUp?: PointerEventHandler<T>;
|
|
30
30
|
}): {
|
|
31
31
|
setRef: (node: T | null) => void;
|
|
32
32
|
targetRef: RefObject<T | null>;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { MotionConfig } from './motionConfig';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* In-flow layout height of the content wrapper (padding + child borders).
|
|
5
|
+
* Snapshot before the tween — do not pass as a GSAP function value.
|
|
6
|
+
*
|
|
7
|
+
* Prefer `offsetHeight` over `scrollHeight`: transformed descendants
|
|
8
|
+
* (`motion.body` `y`) inflate scrollable overflow, so the shell overshoots and
|
|
9
|
+
* snaps when the transform settles. `scrollHeight` is only a fallback when the
|
|
10
|
+
* shell has already clipped the inner to 0.
|
|
11
|
+
*/
|
|
4
12
|
export declare function measureCollapsibleContentHeight(inner: HTMLElement): number;
|
|
5
13
|
export declare function releaseExpandedShellHeight(shell: HTMLElement, inner: HTMLElement): void;
|
|
6
14
|
export declare function applyCollapsibleInstantState(shell: HTMLElement, open: boolean): void;
|
|
@@ -9,7 +9,11 @@ export type UseContainerPointerHoverHandlersOptions<Element extends HTMLElement
|
|
|
9
9
|
* Pass `shouldSkipInteractiveHoverLift` from hover-lift utils.
|
|
10
10
|
*/
|
|
11
11
|
skipHover?: () => boolean;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Kill GSAP on the target when the hook unmounts (default true).
|
|
14
|
+
* Slot motion must pass `false`: this node also plays `enter`, and Strict Mode
|
|
15
|
+
* re-runs effect cleanup immediately — `killMotion` leaves `opacity: 0`.
|
|
16
|
+
*/
|
|
13
17
|
killMotionOnUnmount?: boolean;
|
|
14
18
|
onEnter: (el: HTMLElement, e: ReactPointerEvent<Element>) => void;
|
|
15
19
|
onLeave: (el: HTMLElement, e: ReactPointerEvent<Element>) => void;
|