@snowui-design-system/components 0.3.0-alpha.0 → 0.3.0-alpha.11
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/AGENTS.md +39 -0
- package/LICENSE +152 -91
- package/README.md +52 -11
- package/THIRD_PARTY_NOTICES.md +41 -0
- package/component-catalog.json +532 -106
- package/dist/client/blocks/Sidebar.js +185 -143
- package/dist/client/blocks/SidebarItem.js +29 -15
- package/dist/client/blocks/SidebarSection.js +13 -5
- package/dist/client/blocks/index.js +2 -0
- package/dist/client/compat.d.ts +1 -1
- package/dist/client/compat.js +3 -1
- package/dist/client/components/Accordion.d.ts +2 -0
- package/dist/client/components/Accordion.js +37 -16
- package/dist/client/components/AccordionItem.js +1 -1
- package/dist/client/components/BarChart.js +10 -3
- package/dist/client/components/BlurText.js +2 -2
- package/dist/client/components/Breadcrumb.d.ts +1 -0
- package/dist/client/components/Breadcrumb.js +44 -18
- package/dist/client/components/Button.d.ts +2 -0
- package/dist/client/components/Button.js +6 -1
- package/dist/client/components/ChartGroup.js +23 -10
- package/dist/client/components/Checkbox.d.ts +2 -0
- package/dist/client/components/Checkbox.js +19 -4
- package/dist/client/components/Chip.js +2 -2
- package/dist/client/components/CircularChart.js +10 -3
- package/dist/client/components/CodeBlock.js +283 -226
- package/dist/client/components/CopyButton.js +5 -2
- package/dist/client/components/CopyLink.js +1 -1
- package/dist/client/components/DataTable.d.ts +8 -2
- package/dist/client/components/DataTable.js +11 -5
- package/dist/client/components/Dialog.js +1 -1
- package/dist/client/components/ExpandButton.js +10 -3
- package/dist/client/components/Field.js +3 -2
- package/dist/client/components/FlowText.js +2 -2
- package/dist/client/components/Frame.d.ts +9 -0
- package/dist/client/components/Frame.js +106 -40
- package/dist/client/components/GaugeChart.js +10 -3
- package/dist/client/components/GradientMotion.d.ts +1 -1
- package/dist/client/components/GradientMotion.js +2 -2
- package/dist/client/components/Icon.js +6 -3
- package/dist/client/components/Image.d.ts +2 -0
- package/dist/client/components/Image.js +14 -2
- package/dist/client/components/ImageViewer.js +51 -27
- package/dist/client/components/Indicator.js +5 -3
- package/dist/client/components/Input.d.ts +1 -0
- package/dist/client/components/Input.js +51 -24
- package/dist/client/components/LineChart.js +10 -3
- package/dist/client/components/Link.d.ts +1 -1
- package/dist/client/components/Link.js +58 -30
- package/dist/client/components/Listbox.d.ts +2 -0
- package/dist/client/components/Listbox.js +98 -43
- package/dist/client/components/MenuItem.d.ts +2 -0
- package/dist/client/components/MenuItem.js +15 -2
- package/dist/client/components/NumberFlow.js +4 -4
- package/dist/client/components/NumericText.js +2 -2
- package/dist/client/components/OTPInput.d.ts +32 -0
- package/dist/client/components/OTPInput.js +556 -0
- package/dist/client/components/OverflowAction.d.ts +2 -0
- package/dist/client/components/OverflowAction.js +146 -65
- package/dist/client/components/OverflowActions.d.ts +7 -1
- package/dist/client/components/OverflowActions.js +102 -26
- package/dist/client/components/Pagination.js +117 -68
- package/dist/client/components/Radio.d.ts +2 -0
- package/dist/client/components/Radio.js +20 -5
- package/dist/client/components/ScrambleText.js +6 -3
- package/dist/client/components/ScrollArea.js +11 -5
- package/dist/client/components/SearchBox.d.ts +1 -0
- package/dist/client/components/SearchBox.js +32 -7
- package/dist/client/components/SearchInput.js +43 -3
- package/dist/client/components/Select.d.ts +1 -0
- package/dist/client/components/Select.js +65 -27
- package/dist/client/components/SidePanel.js +84 -57
- package/dist/client/components/Slider.d.ts +1 -1
- package/dist/client/components/Slider.js +36 -13
- package/dist/client/components/SlotText.js +2 -2
- package/dist/client/components/SnowUILogo.js +1 -1
- package/dist/client/components/Spinner.js +9 -2
- package/dist/client/components/Switch.d.ts +2 -0
- package/dist/client/components/Switch.js +18 -3
- package/dist/client/components/Tab.js +90 -81
- package/dist/client/components/Table.js +30 -16
- package/dist/client/components/TableBody.js +10 -4
- package/dist/client/components/TableCell.d.ts +1 -0
- package/dist/client/components/TableCell.js +100 -50
- package/dist/client/components/TableHead.js +72 -39
- package/dist/client/components/TableToolbar.js +217 -141
- package/dist/client/components/Tag.js +21 -3
- package/dist/client/components/Text.js +163 -83
- package/dist/client/components/Textarea.js +8 -2
- package/dist/client/components/Toast.js +9 -2
- package/dist/client/components/Toaster.d.ts +2 -0
- package/dist/client/components/Toaster.js +52 -38
- package/dist/client/components/Tooltip.js +229 -201
- package/dist/client/context.js +2 -0
- package/dist/client/dev.js +2 -0
- package/dist/client/i18n/messages.d.ts +2 -2
- package/dist/client/i18n/messages.js +177 -1
- package/dist/client/index.d.ts +4 -2
- package/dist/client/index.js +8 -6
- package/dist/client/internal/code-block/prettier-svelte.d.ts +2 -0
- package/dist/client/internal/component-icon/index.js +2 -0
- package/dist/client/internal/snow-ui-logo/Wordmark.js +22 -10
- package/dist/client/internal/snow-ui-logo/emoji-metrics.js +2 -0
- package/dist/client/keys.d.ts +1 -0
- package/dist/client/keys.js +3 -0
- package/dist/client/lib/adaptive-contrast-renderer.js +2 -0
- package/dist/client/lib/chart/ChartHoverPanel.js +1 -1
- package/dist/client/lib/chart/appearance-timeline.js +2 -0
- package/dist/client/lib/chart/arc-path.js +2 -0
- package/dist/client/lib/chart/colors.js +2 -0
- package/dist/client/lib/chart/size.js +2 -0
- package/dist/client/lib/clipboard.js +2 -0
- package/dist/client/lib/color.js +2 -0
- package/dist/client/lib/date-format.js +2 -0
- package/dist/client/lib/edge-fade.js +3 -1
- package/dist/client/lib/media-loading.d.ts +7 -0
- package/dist/client/lib/media-loading.js +12 -0
- package/dist/client/lib/number-format.js +8 -0
- package/dist/client/lib/overflow-actions-motion.js +2 -0
- package/dist/client/lib/overlay-scrollbar.d.ts +1 -0
- package/dist/client/lib/overlay-scrollbar.js +9 -0
- package/dist/client/lib/overlay-trigger-timing.js +2 -0
- package/dist/client/lib/progressive-blur.d.ts +13 -0
- package/dist/client/lib/progressive-blur.js +54 -0
- package/dist/client/lib/resizable.d.ts +1 -1
- package/dist/client/lib/responsive-exit.js +2 -0
- package/dist/client/lib/search-filter.js +2 -0
- package/dist/client/lib/side-panel.js +2 -0
- package/dist/client/lib/split-pane.js +2 -0
- package/dist/client/lib/table-column-motion.js +2 -0
- package/dist/client/lib/table-context.d.ts +5 -0
- package/dist/client/lib/table-context.js +4 -1
- package/dist/client/lib/table-responsive.d.ts +1 -1
- package/dist/client/lib/table-responsive.js +41 -7
- package/dist/client/lib/table-selection-fade.js +2 -0
- package/dist/client/lib/table-truncation.js +2 -0
- package/dist/client/lib/text-motion/animation.js +2 -0
- package/dist/client/lib/text-motion/character.js +2 -0
- package/dist/client/lib/text-motion/color.js +2 -0
- package/dist/client/lib/text-motion/layout.js +2 -0
- package/dist/client/lib/text-motion/preference.js +2 -0
- package/dist/client/lib/text-motion/sequence.js +2 -0
- package/dist/client/lib/text-motion/typography.js +2 -0
- package/dist/client/lib/tooltip-delay.js +2 -0
- package/dist/client/lib/tooltip-motion-dismiss.js +2 -0
- package/dist/client/lib/tooltip-pointer-speed.js +2 -0
- package/dist/client/lib/truncate.js +2 -0
- package/dist/client/logic/ComponentPartsBoundary.d.ts +7 -0
- package/dist/client/logic/ComponentPartsBoundary.js +15 -0
- package/dist/client/logic/content-line.d.ts +5 -0
- package/dist/client/logic/content-line.js +13 -0
- package/dist/client/logic/frame-dom-runtime.d.ts +3 -1
- package/dist/client/logic/frame-dom-runtime.js +5 -3
- package/dist/client/logic/frame-field-control.js +2 -0
- package/dist/client/logic/frame-inline-style.js +2 -3
- package/dist/client/logic/frame-layout.js +3 -0
- package/dist/client/logic/frame-motion-defaults.js +2 -0
- package/dist/client/logic/frame-motion.d.ts +15 -23
- package/dist/client/logic/frame-motion.js +196 -30
- package/dist/client/logic/frame-prop-filter.d.ts +1 -1
- package/dist/client/logic/frame-prop-filter.js +3 -0
- package/dist/client/logic/frame-responsive.js +22 -6
- package/dist/client/logic/frame-state.d.ts +2 -14
- package/dist/client/logic/frame-state.js +60 -9
- package/dist/client/logic/frame-types.d.ts +2 -0
- package/dist/client/logic/geometry-cache.js +2 -0
- package/dist/client/logic/layout-flip.js +2 -0
- package/dist/client/logic/morph.js +2 -0
- package/dist/client/logic/motion-engine.js +2 -0
- package/dist/client/logic/motion-orchestration.js +2 -0
- package/dist/client/logic/motion-types.js +2 -0
- package/dist/client/logic/overflow-actions.d.ts +11 -2
- package/dist/client/logic/overflow-actions.js +5 -0
- package/dist/client/logic/toast.js +7 -4
- package/dist/client/logic/wc-adapter.js +2 -0
- package/dist/client/motion/bridge.js +2 -0
- package/dist/client/motion/content-crossfade.js +2 -0
- package/dist/client/motion/expand.js +2 -0
- package/dist/client/motion/fade-in.js +2 -0
- package/dist/client/motion/fade-out.js +2 -0
- package/dist/client/motion/morph.js +2 -0
- package/dist/client/motion/move.js +2 -0
- package/dist/client/motion/number.d.ts +3 -3
- package/dist/client/motion/number.js +5 -3
- package/dist/client/motion/replace.js +2 -0
- package/dist/client/motion/rotate.css +2 -0
- package/dist/client/motion/rotate.js +2 -0
- package/dist/client/motion/scale-in.js +2 -0
- package/dist/client/motion/tokens.js +2 -0
- package/dist/client/motion/while-2xl.js +2 -0
- package/dist/client/motion/while-active.js +2 -0
- package/dist/client/motion/while-appear.js +2 -0
- package/dist/client/motion/while-click.js +2 -0
- package/dist/client/motion/while-collapsed.js +2 -0
- package/dist/client/motion/while-disabled.js +2 -0
- package/dist/client/motion/while-disappear.js +2 -0
- package/dist/client/motion/while-drag.js +2 -0
- package/dist/client/motion/while-editing.js +2 -0
- package/dist/client/motion/while-expanded.js +2 -0
- package/dist/client/motion/while-focus.js +2 -0
- package/dist/client/motion/while-hover.js +2 -0
- package/dist/client/motion/while-idle.js +2 -0
- package/dist/client/motion/while-key.js +2 -0
- package/dist/client/motion/while-lg.js +2 -0
- package/dist/client/motion/while-load.js +2 -0
- package/dist/client/motion/while-md.js +2 -0
- package/dist/client/motion/while-reload.js +2 -0
- package/dist/client/motion/while-scroll.js +2 -0
- package/dist/client/motion/while-sm.js +2 -0
- package/dist/client/motion/while-uploading.js +2 -0
- package/dist/client/motion/while-validating.js +2 -0
- package/dist/client/motion/while-xl.js +2 -0
- package/dist/client/motion/while-xs.js +2 -0
- package/dist/client/styles/auto-layout.css +23 -1
- package/dist/client/styles/backdrop.css +2 -0
- package/dist/client/styles/components.css +28 -20
- package/dist/client/styles/index.css +2 -0
- package/dist/client/styles/layout.css +33 -7
- package/dist/client/styles/scale.css +2 -0
- package/dist/client/styles/scrollbar.css +16 -1
- package/dist/client/styles/themes.css +7 -4
- package/dist/client/styles/tokens.css +2 -0
- package/dist/client/vite-env.d.ts +2 -0
- package/dist/server/blocks/Sidebar.js +47 -27
- package/dist/server/blocks/SidebarItem.js +7 -5
- package/dist/server/blocks/SidebarSection.js +13 -5
- package/dist/server/blocks/index.js +2 -0
- package/dist/server/compat.d.ts +1 -1
- package/dist/server/compat.js +3 -1
- package/dist/server/components/Accordion.d.ts +2 -0
- package/dist/server/components/Accordion.js +12 -1
- package/dist/server/components/AccordionItem.js +1 -1
- package/dist/server/components/BarChart.js +6 -3
- package/dist/server/components/BlurText.js +2 -2
- package/dist/server/components/Breadcrumb.d.ts +1 -0
- package/dist/server/components/Breadcrumb.js +26 -5
- package/dist/server/components/Button.d.ts +2 -0
- package/dist/server/components/Button.js +6 -1
- package/dist/server/components/ChartGroup.js +6 -3
- package/dist/server/components/Checkbox.d.ts +2 -0
- package/dist/server/components/Checkbox.js +16 -3
- package/dist/server/components/Chip.js +2 -2
- package/dist/server/components/CircularChart.js +6 -3
- package/dist/server/components/CodeBlock.js +27 -14
- package/dist/server/components/CopyButton.js +6 -2
- package/dist/server/components/CopyLink.js +1 -1
- package/dist/server/components/DataTable.d.ts +8 -2
- package/dist/server/components/DataTable.js +11 -5
- package/dist/server/components/Dialog.js +1 -1
- package/dist/server/components/ExpandButton.js +7 -3
- package/dist/server/components/Field.js +3 -2
- package/dist/server/components/FlowText.js +2 -2
- package/dist/server/components/Frame.d.ts +9 -0
- package/dist/server/components/Frame.js +71 -34
- package/dist/server/components/GaugeChart.js +6 -3
- package/dist/server/components/GradientMotion.d.ts +1 -1
- package/dist/server/components/GradientMotion.js +2 -2
- package/dist/server/components/Icon.js +5 -4
- package/dist/server/components/Image.d.ts +2 -0
- package/dist/server/components/Image.js +11 -4
- package/dist/server/components/ImageViewer.js +6 -3
- package/dist/server/components/Indicator.js +5 -3
- package/dist/server/components/Input.d.ts +1 -0
- package/dist/server/components/Input.js +32 -22
- package/dist/server/components/LineChart.js +6 -3
- package/dist/server/components/Link.d.ts +1 -1
- package/dist/server/components/Link.js +22 -3
- package/dist/server/components/Listbox.d.ts +2 -0
- package/dist/server/components/Listbox.js +81 -22
- package/dist/server/components/MenuItem.d.ts +2 -0
- package/dist/server/components/MenuItem.js +9 -2
- package/dist/server/components/NumberFlow.js +4 -4
- package/dist/server/components/NumericText.js +2 -2
- package/dist/server/components/OTPInput.d.ts +32 -0
- package/dist/server/components/OTPInput.js +401 -0
- package/dist/server/components/OverflowAction.d.ts +2 -0
- package/dist/server/components/OverflowAction.js +70 -26
- package/dist/server/components/OverflowActions.d.ts +7 -1
- package/dist/server/components/OverflowActions.js +88 -30
- package/dist/server/components/Pagination.js +42 -22
- package/dist/server/components/Radio.d.ts +2 -0
- package/dist/server/components/Radio.js +15 -5
- package/dist/server/components/ScrambleText.js +6 -3
- package/dist/server/components/ScrollArea.js +5 -2
- package/dist/server/components/SearchBox.d.ts +1 -0
- package/dist/server/components/SearchBox.js +25 -5
- package/dist/server/components/SearchInput.js +12 -3
- package/dist/server/components/Select.d.ts +1 -0
- package/dist/server/components/Select.js +55 -20
- package/dist/server/components/SidePanel.js +36 -15
- package/dist/server/components/Slider.d.ts +1 -1
- package/dist/server/components/Slider.js +34 -11
- package/dist/server/components/SlotText.js +2 -2
- package/dist/server/components/SnowUILogo.js +1 -1
- package/dist/server/components/Spinner.js +4 -2
- package/dist/server/components/Switch.d.ts +2 -0
- package/dist/server/components/Switch.js +14 -3
- package/dist/server/components/Tab.js +62 -52
- package/dist/server/components/Table.js +16 -6
- package/dist/server/components/TableBody.js +9 -2
- package/dist/server/components/TableCell.d.ts +1 -0
- package/dist/server/components/TableCell.js +68 -25
- package/dist/server/components/TableHead.js +35 -8
- package/dist/server/components/TableToolbar.js +104 -55
- package/dist/server/components/Tag.js +17 -3
- package/dist/server/components/Text.js +64 -15
- package/dist/server/components/Textarea.js +5 -2
- package/dist/server/components/Toast.js +5 -2
- package/dist/server/components/Toaster.d.ts +2 -0
- package/dist/server/components/Toaster.js +18 -3
- package/dist/server/components/Tooltip.js +39 -16
- package/dist/server/context.js +2 -0
- package/dist/server/dev.js +2 -0
- package/dist/server/i18n/messages.d.ts +2 -2
- package/dist/server/i18n/messages.js +177 -1
- package/dist/server/index.d.ts +4 -2
- package/dist/server/index.js +8 -6
- package/dist/server/internal/code-block/prettier-svelte.d.ts +2 -0
- package/dist/server/internal/component-icon/index.js +2 -0
- package/dist/server/internal/snow-ui-logo/Wordmark.js +16 -8
- package/dist/server/internal/snow-ui-logo/emoji-metrics.js +2 -0
- package/dist/server/keys.d.ts +1 -0
- package/dist/server/keys.js +3 -0
- package/dist/server/lib/adaptive-contrast-renderer.js +2 -0
- package/dist/server/lib/chart/ChartHoverPanel.js +1 -1
- package/dist/server/lib/chart/appearance-timeline.js +2 -0
- package/dist/server/lib/chart/arc-path.js +2 -0
- package/dist/server/lib/chart/colors.js +2 -0
- package/dist/server/lib/chart/size.js +2 -0
- package/dist/server/lib/clipboard.js +2 -0
- package/dist/server/lib/color.js +2 -0
- package/dist/server/lib/date-format.js +2 -0
- package/dist/server/lib/edge-fade.js +3 -1
- package/dist/server/lib/media-loading.d.ts +7 -0
- package/dist/server/lib/media-loading.js +12 -0
- package/dist/server/lib/number-format.js +8 -0
- package/dist/server/lib/overflow-actions-motion.js +2 -0
- package/dist/server/lib/overlay-scrollbar.d.ts +1 -0
- package/dist/server/lib/overlay-scrollbar.js +9 -0
- package/dist/server/lib/overlay-trigger-timing.js +2 -0
- package/dist/server/lib/progressive-blur.d.ts +13 -0
- package/dist/server/lib/progressive-blur.js +54 -0
- package/dist/server/lib/resizable.d.ts +1 -1
- package/dist/server/lib/responsive-exit.js +2 -0
- package/dist/server/lib/search-filter.js +2 -0
- package/dist/server/lib/side-panel.js +2 -0
- package/dist/server/lib/split-pane.js +2 -0
- package/dist/server/lib/table-column-motion.js +2 -0
- package/dist/server/lib/table-context.d.ts +5 -0
- package/dist/server/lib/table-context.js +4 -1
- package/dist/server/lib/table-responsive.d.ts +1 -1
- package/dist/server/lib/table-responsive.js +41 -7
- package/dist/server/lib/table-selection-fade.js +2 -0
- package/dist/server/lib/table-truncation.js +2 -0
- package/dist/server/lib/text-motion/animation.js +2 -0
- package/dist/server/lib/text-motion/character.js +2 -0
- package/dist/server/lib/text-motion/color.js +2 -0
- package/dist/server/lib/text-motion/layout.js +2 -0
- package/dist/server/lib/text-motion/preference.js +2 -0
- package/dist/server/lib/text-motion/sequence.js +2 -0
- package/dist/server/lib/text-motion/typography.js +2 -0
- package/dist/server/lib/tooltip-delay.js +2 -0
- package/dist/server/lib/tooltip-motion-dismiss.js +2 -0
- package/dist/server/lib/tooltip-pointer-speed.js +2 -0
- package/dist/server/lib/truncate.js +2 -0
- package/dist/server/logic/ComponentPartsBoundary.d.ts +7 -0
- package/dist/server/logic/ComponentPartsBoundary.js +12 -0
- package/dist/server/logic/content-line.d.ts +5 -0
- package/dist/server/logic/content-line.js +13 -0
- package/dist/server/logic/frame-dom-runtime.d.ts +3 -1
- package/dist/server/logic/frame-dom-runtime.js +5 -3
- package/dist/server/logic/frame-field-control.js +2 -0
- package/dist/server/logic/frame-inline-style.js +2 -3
- package/dist/server/logic/frame-layout.js +3 -0
- package/dist/server/logic/frame-motion-defaults.js +2 -0
- package/dist/server/logic/frame-motion.d.ts +15 -23
- package/dist/server/logic/frame-motion.js +75 -29
- package/dist/server/logic/frame-prop-filter.d.ts +1 -1
- package/dist/server/logic/frame-prop-filter.js +3 -0
- package/dist/server/logic/frame-responsive.js +22 -6
- package/dist/server/logic/frame-state.d.ts +2 -14
- package/dist/server/logic/frame-state.js +60 -9
- package/dist/server/logic/frame-types.d.ts +2 -0
- package/dist/server/logic/geometry-cache.js +2 -0
- package/dist/server/logic/layout-flip.js +2 -0
- package/dist/server/logic/morph.js +2 -0
- package/dist/server/logic/motion-engine.js +2 -0
- package/dist/server/logic/motion-orchestration.js +2 -0
- package/dist/server/logic/motion-types.js +2 -0
- package/dist/server/logic/overflow-actions.d.ts +11 -2
- package/dist/server/logic/overflow-actions.js +5 -0
- package/dist/server/logic/toast.js +7 -4
- package/dist/server/logic/wc-adapter.js +2 -0
- package/dist/server/motion/bridge.js +2 -0
- package/dist/server/motion/content-crossfade.js +2 -0
- package/dist/server/motion/expand.js +2 -0
- package/dist/server/motion/fade-in.js +2 -0
- package/dist/server/motion/fade-out.js +2 -0
- package/dist/server/motion/morph.js +2 -0
- package/dist/server/motion/move.js +2 -0
- package/dist/server/motion/number.d.ts +3 -3
- package/dist/server/motion/number.js +5 -3
- package/dist/server/motion/replace.js +2 -0
- package/dist/server/motion/rotate.css +2 -0
- package/dist/server/motion/rotate.js +2 -0
- package/dist/server/motion/scale-in.js +2 -0
- package/dist/server/motion/tokens.js +2 -0
- package/dist/server/motion/while-2xl.js +2 -0
- package/dist/server/motion/while-active.js +2 -0
- package/dist/server/motion/while-appear.js +2 -0
- package/dist/server/motion/while-click.js +2 -0
- package/dist/server/motion/while-collapsed.js +2 -0
- package/dist/server/motion/while-disabled.js +2 -0
- package/dist/server/motion/while-disappear.js +2 -0
- package/dist/server/motion/while-drag.js +2 -0
- package/dist/server/motion/while-editing.js +2 -0
- package/dist/server/motion/while-expanded.js +2 -0
- package/dist/server/motion/while-focus.js +2 -0
- package/dist/server/motion/while-hover.js +2 -0
- package/dist/server/motion/while-idle.js +2 -0
- package/dist/server/motion/while-key.js +2 -0
- package/dist/server/motion/while-lg.js +2 -0
- package/dist/server/motion/while-load.js +2 -0
- package/dist/server/motion/while-md.js +2 -0
- package/dist/server/motion/while-reload.js +2 -0
- package/dist/server/motion/while-scroll.js +2 -0
- package/dist/server/motion/while-sm.js +2 -0
- package/dist/server/motion/while-uploading.js +2 -0
- package/dist/server/motion/while-validating.js +2 -0
- package/dist/server/motion/while-xl.js +2 -0
- package/dist/server/motion/while-xs.js +2 -0
- package/dist/server/styles/auto-layout.css +23 -1
- package/dist/server/styles/backdrop.css +2 -0
- package/dist/server/styles/components.css +28 -20
- package/dist/server/styles/index.css +2 -0
- package/dist/server/styles/layout.css +33 -7
- package/dist/server/styles/scale.css +2 -0
- package/dist/server/styles/scrollbar.css +16 -1
- package/dist/server/styles/themes.css +7 -4
- package/dist/server/styles/tokens.css +2 -0
- package/dist/server/vite-env.d.ts +2 -0
- package/llms.txt +8 -0
- package/package.json +16 -7
- package/dist/client/components/FramePro.d.ts +0 -23
- package/dist/client/components/FramePro.js +0 -412
- package/dist/client/logic/frame-pro-motion.d.ts +0 -26
- package/dist/client/logic/frame-pro-motion.js +0 -310
- package/dist/client/logic/frame-pro-state.d.ts +0 -39
- package/dist/client/logic/frame-pro-state.js +0 -538
- package/dist/server/components/FramePro.d.ts +0 -23
- package/dist/server/components/FramePro.js +0 -301
- package/dist/server/logic/frame-pro-motion.d.ts +0 -26
- package/dist/server/logic/frame-pro-motion.js +0 -176
- package/dist/server/logic/frame-pro-state.d.ts +0 -39
- package/dist/server/logic/frame-pro-state.js +0 -445
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
/* frame-pro-motion.svelte.js generated by Svelte v5.56.4 */
|
|
2
|
-
import * as $ from 'svelte/internal/client';
|
|
3
|
-
import { hasMotionConfig } from "./frame-utils.js";
|
|
4
|
-
import { captureFlipRect, beginFlipEnter, applyFlipExit } from "./layout-flip.js";
|
|
5
|
-
|
|
6
|
-
export class FrameMotion {
|
|
7
|
-
#props;
|
|
8
|
-
#motion;
|
|
9
|
-
#state;
|
|
10
|
-
#responsive;
|
|
11
|
-
#getId;
|
|
12
|
-
#getElement;
|
|
13
|
-
|
|
14
|
-
constructor(props, motion, state, responsive, getId, getElement) {
|
|
15
|
-
this.#props = props;
|
|
16
|
-
this.#motion = motion;
|
|
17
|
-
this.#state = state;
|
|
18
|
-
this.#responsive = responsive;
|
|
19
|
-
this.#getId = getId;
|
|
20
|
-
this.#getElement = getElement;
|
|
21
|
-
|
|
22
|
-
// 注册到编排器,并触发独立 FLIP 进场(无需 Motion 上下文)
|
|
23
|
-
$.user_effect(() => {
|
|
24
|
-
const id = this.#getId();
|
|
25
|
-
const element = this.#getElement();
|
|
26
|
-
|
|
27
|
-
// 独立 FLIP 进场:layoutId/itemId 存在时尝试从模块注册表读取起点
|
|
28
|
-
const flipId = this.#props.itemId ?? this.#props.layoutId;
|
|
29
|
-
|
|
30
|
-
if (flipId && element) {
|
|
31
|
-
beginFlipEnter(flipId, element);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (!this.#motion || !this.shouldRegister || !element || !id) return;
|
|
35
|
-
|
|
36
|
-
return this.#motion.register({
|
|
37
|
-
id,
|
|
38
|
-
element,
|
|
39
|
-
timeline: this.#props.timeline,
|
|
40
|
-
scroll: this.#props.scroll,
|
|
41
|
-
layoutId: this.#props.itemId ?? this.#props.layoutId,
|
|
42
|
-
scope: this.#props.scope
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// === 状态变化 -> 动效通知 (合并优化) ===
|
|
47
|
-
// 使用单一 effect 替代多个独立 effect,减少响应式订阅开销
|
|
48
|
-
// 缓存上一次的触发器状态,用于差量更新
|
|
49
|
-
let prevTriggerStates = {};
|
|
50
|
-
|
|
51
|
-
$.user_effect(() => {
|
|
52
|
-
// 收集所有触发器状态
|
|
53
|
-
const currentStates = {
|
|
54
|
-
whileHover: this.#state.hovered,
|
|
55
|
-
whileClick: this.#state.pressed,
|
|
56
|
-
whileFocus: this.#state.focused,
|
|
57
|
-
whileDrag: this.#state.isDragging,
|
|
58
|
-
whileScroll: this.#state.isScrolling,
|
|
59
|
-
whileKey: this.#state.isKeyActive,
|
|
60
|
-
whileLoad: this.#state.currentState === "StartLoad" || this.#state.currentState === "Load" || !!this.#props.loading,
|
|
61
|
-
whileReload: this.#state.currentState === "Reload" || !!this.#props.whileReload,
|
|
62
|
-
whileActive: this.#state.currentState === "Active" || !!this.#props.whileActive,
|
|
63
|
-
whileDisabled: this.#state.currentState === "Disabled" || !!this.#props.whileDisabled,
|
|
64
|
-
whileValidating: this.#state.currentState === "Validating" || !!this.#props.whileValidating,
|
|
65
|
-
whileUploading: this.#state.currentState === "Uploading" || !!this.#props.whileUploading,
|
|
66
|
-
whileEditing: this.#state.currentState === "Editing" || !!this.#props.whileEditing,
|
|
67
|
-
whileCollapsed: !!this.#props.collapsed,
|
|
68
|
-
whileExpanded: !!this.#props.expanded,
|
|
69
|
-
whileIdle: !this.#state.isAnyTriggerActive
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
// 仅通知发生变化的触发器
|
|
73
|
-
for (const [event, active] of Object.entries(currentStates)) {
|
|
74
|
-
if (prevTriggerStates[event] !== active) {
|
|
75
|
-
this.#notify(event, { active });
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
prevTriggerStates = currentStates;
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// 生命周期通知 (单独保留,因为需要 cleanup)
|
|
83
|
-
$.user_effect(() => {
|
|
84
|
-
this.#notify("whileAppear", { active: true });
|
|
85
|
-
|
|
86
|
-
// === 编排触发逻辑 ===
|
|
87
|
-
// 根据 orchestrateTrigger 决定何时触发编排
|
|
88
|
-
const trigger = this.#props.orchestrateTrigger ?? "appear";
|
|
89
|
-
|
|
90
|
-
if (this.#props.orchestrate && trigger === "appear") {
|
|
91
|
-
const id = this.#getId();
|
|
92
|
-
|
|
93
|
-
if (id && this.#motion) {
|
|
94
|
-
// 使用微任务或下一帧确保子组件已挂载并注册
|
|
95
|
-
requestAnimationFrame(() => {
|
|
96
|
-
this.#motion?.Play(id);
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return () => this.#notify("whileDisappear", { active: true });
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// === orchestrateTrigger: hover ===
|
|
105
|
-
$.user_effect(() => {
|
|
106
|
-
const trigger = this.#props.orchestrateTrigger;
|
|
107
|
-
|
|
108
|
-
if (this.#props.orchestrate && trigger === "hover" && this.#state.hovered) {
|
|
109
|
-
const id = this.#getId();
|
|
110
|
-
|
|
111
|
-
if (id && this.#motion) {
|
|
112
|
-
this.#motion.Play(id);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
// === orchestrateTrigger: click ===
|
|
118
|
-
$.user_effect(() => {
|
|
119
|
-
const trigger = this.#props.orchestrateTrigger;
|
|
120
|
-
|
|
121
|
-
if (this.#props.orchestrate && trigger === "click" && this.#state.pressed) {
|
|
122
|
-
const id = this.#getId();
|
|
123
|
-
|
|
124
|
-
if (id && this.#motion) {
|
|
125
|
-
this.#motion.Play(id);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
// === orchestrateTrigger: scroll ===
|
|
131
|
-
$.user_effect(() => {
|
|
132
|
-
const trigger = this.#props.orchestrateTrigger;
|
|
133
|
-
|
|
134
|
-
if (this.#props.orchestrate && trigger === "scroll" && this.#state.isScrolling) {
|
|
135
|
-
const id = this.#getId();
|
|
136
|
-
|
|
137
|
-
if (id && this.#motion) {
|
|
138
|
-
this.#motion.Play(id);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
// 响应式断点通知
|
|
144
|
-
let prevBreakpoint;
|
|
145
|
-
|
|
146
|
-
$.user_effect(() => {
|
|
147
|
-
if (!this.#responsive) return;
|
|
148
|
-
|
|
149
|
-
const breakpoint = this.#responsive.breakpoint;
|
|
150
|
-
|
|
151
|
-
if (!breakpoint || breakpoint === prevBreakpoint) return;
|
|
152
|
-
|
|
153
|
-
const eventMap = {
|
|
154
|
-
xs: "whileXs",
|
|
155
|
-
sm: "whileSm",
|
|
156
|
-
md: "whileMd",
|
|
157
|
-
lg: "whileLg",
|
|
158
|
-
xl: "whileXl",
|
|
159
|
-
"2xl": "while2xl"
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
const eventName = eventMap[breakpoint];
|
|
163
|
-
|
|
164
|
-
if (eventName) this.#notify(eventName, { active: true });
|
|
165
|
-
|
|
166
|
-
prevBreakpoint = breakpoint;
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
// Setup whileScroll trigger
|
|
170
|
-
$.user_effect(() => {
|
|
171
|
-
if (this.#props.whileScroll) {
|
|
172
|
-
this.#setupWhileScroll();
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
get shouldRegister() {
|
|
178
|
-
const id = this.#getId();
|
|
179
|
-
|
|
180
|
-
return !!id || hasMotionConfig(this.#props);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
get controller() {
|
|
184
|
-
return {
|
|
185
|
-
play: (options) => {
|
|
186
|
-
const id = this.#getId();
|
|
187
|
-
|
|
188
|
-
if (id && this.#motion) this.#motion.Play(id, options);
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
captureLayout: (layoutId) => {
|
|
192
|
-
const id = layoutId ?? this.#props.itemId ?? this.#props.layoutId ?? this.#getId();
|
|
193
|
-
const element = this.#getElement();
|
|
194
|
-
|
|
195
|
-
if (id && element && this.#motion) {
|
|
196
|
-
this.#motion.captureLayout(id, element);
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
|
|
200
|
-
playLayoutTo: (target, options) => {
|
|
201
|
-
const id = options?.layoutId ?? this.#props.itemId ?? this.#props.layoutId ?? this.#getId();
|
|
202
|
-
const element = this.#getElement();
|
|
203
|
-
|
|
204
|
-
if (id && element && this.#motion) {
|
|
205
|
-
this.#motion.playLayoutTo(id, element, target, options);
|
|
206
|
-
} else {
|
|
207
|
-
options?.onComplete?.();
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
/** 捕获当前 Frame 位置写入模块级 FLIP 注册表,无需 initMotion 上下文。 */
|
|
212
|
-
captureFlip: (layoutId) => {
|
|
213
|
-
const id = layoutId ?? this.#props.itemId ?? this.#props.layoutId ?? this.#getId();
|
|
214
|
-
const element = this.#getElement();
|
|
215
|
-
|
|
216
|
-
if (id && element) captureFlipRect(id, element);
|
|
217
|
-
},
|
|
218
|
-
|
|
219
|
-
/** 将当前 Frame 以 FLIP 方式过渡到目标位置,无需 initMotion 上下文。 */
|
|
220
|
-
playFlipTo: (target, options) => {
|
|
221
|
-
const element = this.#getElement();
|
|
222
|
-
|
|
223
|
-
if (element && target) {
|
|
224
|
-
applyFlipExit(element, target, options);
|
|
225
|
-
} else {
|
|
226
|
-
options?.onComplete?.();
|
|
227
|
-
}
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
reset: () => {
|
|
231
|
-
const id = this.#getId();
|
|
232
|
-
|
|
233
|
-
if (id && this.#motion) this.#motion.Reset(id);
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
pause: () => {
|
|
237
|
-
// TODO
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
#notify(event, detail) {
|
|
243
|
-
const id = this.#getId();
|
|
244
|
-
|
|
245
|
-
if (!this.#motion || !this.shouldRegister || !id) return;
|
|
246
|
-
|
|
247
|
-
this.#motion.notify(id, event, detail);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
#setupWhileScroll() {
|
|
251
|
-
const element = this.#getElement();
|
|
252
|
-
|
|
253
|
-
if (!element) return;
|
|
254
|
-
|
|
255
|
-
// 解析 offset 配置 (如 ["start center", "end center"])
|
|
256
|
-
const scrollConfig = this.#props.scroll;
|
|
257
|
-
|
|
258
|
-
const offset = scrollConfig?.offset ?? ["start center", "end center"];
|
|
259
|
-
|
|
260
|
-
// 解析偏移量
|
|
261
|
-
const parseOffset = (str) => {
|
|
262
|
-
const parts = str.split(" ");
|
|
263
|
-
|
|
264
|
-
return {
|
|
265
|
-
element: parts[0] || "start", // start, center, end
|
|
266
|
-
viewport: parts[1] || "center" // start, center, end
|
|
267
|
-
};
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
const startOffset = parseOffset(offset[0]);
|
|
271
|
-
|
|
272
|
-
const handleScroll = () => {
|
|
273
|
-
const rect = element.getBoundingClientRect();
|
|
274
|
-
const viewportHeight = window.innerHeight;
|
|
275
|
-
|
|
276
|
-
// 计算元素位置
|
|
277
|
-
const getElementPosition = (pos) => {
|
|
278
|
-
if (pos === "start") return rect.top;
|
|
279
|
-
if (pos === "end") return rect.bottom;
|
|
280
|
-
|
|
281
|
-
return rect.top + rect.height / 2; // center
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
// 计算视口位置
|
|
285
|
-
const getViewportPosition = (pos) => {
|
|
286
|
-
if (pos === "start") return 0;
|
|
287
|
-
if (pos === "end") return viewportHeight;
|
|
288
|
-
|
|
289
|
-
return viewportHeight / 2; // center
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
const elementPos = getElementPosition(startOffset.element);
|
|
293
|
-
const viewportTrigger = getViewportPosition(startOffset.viewport);
|
|
294
|
-
|
|
295
|
-
// 当元素位置到达视口触发点时激活
|
|
296
|
-
const isActive = elementPos <= viewportTrigger;
|
|
297
|
-
|
|
298
|
-
if (this.#state.isScrolling !== isActive) {
|
|
299
|
-
this.#state.isScrolling = isActive;
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
window.addEventListener("scroll", handleScroll);
|
|
304
|
-
handleScroll(); // Initial check
|
|
305
|
-
|
|
306
|
-
return () => {
|
|
307
|
-
window.removeEventListener("scroll", handleScroll);
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { FrameProps, CoreState } from "./frame-types";
|
|
2
|
-
import type { Motion } from "./motion.js";
|
|
3
|
-
export declare class FrameState {
|
|
4
|
-
#private;
|
|
5
|
-
hovered: boolean;
|
|
6
|
-
pressed: boolean;
|
|
7
|
-
focused: boolean;
|
|
8
|
-
isDragging: boolean;
|
|
9
|
-
isScrolling: boolean;
|
|
10
|
-
isKeyActive: boolean;
|
|
11
|
-
currentState: CoreState;
|
|
12
|
-
constructor(props: FrameProps, motion: Motion | undefined);
|
|
13
|
-
get interactionState(): (string & {}) | "StartLoad" | "Load" | "Reload" | "Appear" | "Disappear" | "Idle" | "Active" | "Disabled" | "Validating" | "Uploading" | "Editing" | "Click" | "Hover" | "Focus" | "Drag" | "Scroll";
|
|
14
|
-
get isAnyTriggerActive(): boolean | undefined;
|
|
15
|
-
handleClick: (e: MouseEvent) => void;
|
|
16
|
-
handleDblClick: (_e: MouseEvent) => void;
|
|
17
|
-
handleContextMenu: (_e: MouseEvent) => void;
|
|
18
|
-
handleMouseEnter: (e: MouseEvent) => void;
|
|
19
|
-
handleMouseLeave: () => void;
|
|
20
|
-
handleMouseDown: () => void;
|
|
21
|
-
handleMouseUp: (_e: MouseEvent) => void;
|
|
22
|
-
handleMouseMove: (_e: MouseEvent) => void;
|
|
23
|
-
handleTouchStart: (_e: TouchEvent) => void;
|
|
24
|
-
handleTouchEnd: (_e: TouchEvent) => void;
|
|
25
|
-
handleTouchMove: (_e: TouchEvent) => void;
|
|
26
|
-
handleTouchCancel: (_e: TouchEvent) => void;
|
|
27
|
-
handleFocus: (e: FocusEvent) => void;
|
|
28
|
-
handleBlur: () => void;
|
|
29
|
-
handleKeyDown: (e: KeyboardEvent) => void;
|
|
30
|
-
handleKeyUp: () => void;
|
|
31
|
-
handleKeyPress: (_e: KeyboardEvent) => void;
|
|
32
|
-
handleInput: (_e: Event) => void;
|
|
33
|
-
handleChange: (_e: Event) => void;
|
|
34
|
-
handleSubmit: (_e: Event) => void;
|
|
35
|
-
handleDragStart: (e: DragEvent) => void;
|
|
36
|
-
handleDrag: (_e: DragEvent) => void;
|
|
37
|
-
handleDragEnd: (_e: DragEvent) => void;
|
|
38
|
-
handleScroll: (_e: Event) => void;
|
|
39
|
-
}
|