motionary 14.0.0 → 14.1.0
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/CHANGELOG.md +55 -1
- package/README.md +6 -4
- package/README_ja.md +1 -1
- package/README_zh.md +1 -1
- package/bin/motionary.mjs +63 -0
- package/bin/public-paths.mjs +2 -0
- package/dist/chunks/{anim-image-ClUQGh0E.js → anim-image-CkRXgwIe.js} +2 -2
- package/dist/chunks/{anim-image-DodXfc61.cjs → anim-image-Djph3LVk.cjs} +2 -2
- package/dist/chunks/audio-CfvQzwt5.js +1 -1
- package/dist/chunks/audio-D0LwPShE.cjs +1 -1
- package/dist/chunks/badge-wall-Bp5kUwTU.js +1 -1
- package/dist/chunks/badge-wall-CITexuW7.cjs +1 -1
- package/dist/chunks/base-BvH4nAcv.cjs +1 -1
- package/dist/chunks/base-D0sRwVz1.js +1 -1
- package/dist/chunks/bg-generator-CML8tPN8.cjs +1 -1
- package/dist/chunks/bg-generator-CbdOCgcF.js +1 -1
- package/dist/chunks/bind-B_CTL6Qn.js +1 -1
- package/dist/chunks/bind-Ui43-n2d.cjs +1 -1
- package/dist/chunks/builtins-CY1l_hAW.js +1 -1
- package/dist/chunks/builtins-DweCp29Z.cjs +1 -1
- package/dist/chunks/carousel-DU3rHTq0.cjs +1 -1
- package/dist/chunks/carousel-Drr0G4y7.js +1 -1
- package/dist/chunks/cart-drawer-BrBfdhOd.js +1 -1
- package/dist/chunks/cart-drawer-CkFMKMhx.cjs +1 -1
- package/dist/chunks/code-export-PdGSl9WE.cjs +1 -1
- package/dist/chunks/code-export-qPPmVqgS.js +1 -1
- package/dist/chunks/color-picker-B_xWVH8H.cjs +1 -1
- package/dist/chunks/color-picker-D4-raPTo.js +1 -1
- package/dist/chunks/command-palette-ISetAeX1.cjs +1 -1
- package/dist/chunks/command-palette-YgbhCzi2.js +1 -1
- package/dist/chunks/core-BSqTp8Bt.js +1 -1
- package/dist/chunks/core-BjcOCpJt.cjs +1 -1
- package/dist/chunks/core-DbAYRKnS.cjs +1 -1
- package/dist/chunks/core-Dj6iomdc.js +1 -1
- package/dist/chunks/core-DjjKLmZ6.cjs +1 -1
- package/dist/chunks/core-LmWkFGlE.js +1 -1
- package/dist/chunks/countdown-CE26Bi78.js +1 -1
- package/dist/chunks/countdown-RQViryt7.cjs +1 -1
- package/dist/chunks/date-picker-BgApzPNn.cjs +1 -1
- package/dist/chunks/date-picker-a677RmYE.js +1 -1
- package/dist/chunks/ease-HwYZnZat.cjs +1 -1
- package/dist/chunks/ease-XN8_0sXu.js +1 -1
- package/dist/chunks/equalizer-2GzcV-8j.js +1 -1
- package/dist/chunks/equalizer-_eD_ZdCl.cjs +1 -1
- package/dist/chunks/festival-banner-Bs18K0MJ.cjs +1 -1
- package/dist/chunks/festival-banner-Cfbi5oks.js +1 -1
- package/dist/chunks/field-B3_pZbPt.js +1 -1
- package/dist/chunks/field-Dwq8-CLN.cjs +1 -1
- package/dist/chunks/format-B2XGhlqH.js +1 -1
- package/dist/chunks/format-DrRrPbjl.cjs +1 -1
- package/dist/chunks/fx-DaVuB89C.cjs +1 -1
- package/dist/chunks/fx-szWxgCx0.js +1 -1
- package/dist/chunks/generative-BKoxWOSP.cjs +1 -1
- package/dist/chunks/generative-D1QtbFNP.js +1 -1
- package/dist/chunks/{gl-scene-C2-f72GW.js → gl-scene-BzhaujZ6.js} +2 -2
- package/dist/chunks/{gl-scene-CVQgoCo9.cjs → gl-scene-DN4qAmSW.cjs} +2 -2
- package/dist/chunks/globe-C2UzKQJI.js +1 -1
- package/dist/chunks/globe-DA0jyb6s.cjs +1 -1
- package/dist/chunks/gpu-C2C6iBQC.cjs +1 -1
- package/dist/chunks/gpu-D7wkP6SZ.js +1 -1
- package/dist/chunks/gpu-particles-Dw2HV4Me.js +1 -1
- package/dist/chunks/gpu-particles-wEO_rds1.cjs +1 -1
- package/dist/chunks/{index-DSF6GbSF.js → index-B1LSv5Uo.js} +4 -3
- package/dist/chunks/{index-B65QsFQk.cjs → index-C9_FEsfz.cjs} +3 -2
- package/dist/chunks/index-tags-B-JBecYg.js +1 -1
- package/dist/chunks/index-tags-hLIF2Clq.cjs +1 -1
- package/dist/chunks/key-click-BLm3BI8_.js +1 -1
- package/dist/chunks/key-click-v7I4K5Sr.cjs +1 -1
- package/dist/chunks/{keyframes-DJtDafnp.cjs → keyframes-BKy1Mz7O.cjs} +2 -2
- package/dist/chunks/{keyframes-BBxaMajc.js → keyframes-DN-QDf45.js} +2 -2
- package/dist/chunks/leaderboard-DvSSQ8o3.cjs +1 -1
- package/dist/chunks/leaderboard-odMGN-i2.js +1 -1
- package/dist/chunks/location-card-B7LwfBVv.js +1 -1
- package/dist/chunks/location-card-DSPTApUe.cjs +1 -1
- package/dist/chunks/lottie-icon-BoxkukMd.cjs +1 -1
- package/dist/chunks/lottie-icon-BsW6EvKG.js +1 -1
- package/dist/chunks/{lottie-player-BCoUFOkM.cjs → lottie-player-BU-bItCy.cjs} +2 -2
- package/dist/chunks/{lottie-player-Bl1gLrZT.js → lottie-player-DmNP6QsW.js} +2 -2
- package/dist/chunks/lyrics-CRB7dA1j.cjs +1 -1
- package/dist/chunks/lyrics-CfAOpxkR.js +1 -1
- package/dist/chunks/manifest-mzYIR0fB.js +1 -1
- package/dist/chunks/manifest-xr3WET80.cjs +1 -1
- package/dist/chunks/menu-Bwy7HGGu.js +1 -1
- package/dist/chunks/menu-CZ1zHTT9.cjs +1 -1
- package/dist/chunks/menu-toggle-9o38aUlM.js +1 -1
- package/dist/chunks/menu-toggle-DGXN4VsN.cjs +1 -1
- package/dist/chunks/nav-morph-C4rD3wrU.cjs +1 -1
- package/dist/chunks/nav-morph-CmqTSjWr.js +1 -1
- package/dist/chunks/otp-DUyEWYMi.cjs +1 -1
- package/dist/chunks/otp-DlwGTaHQ.js +1 -1
- package/dist/chunks/pagination-9Kv3ngXX.js +1 -1
- package/dist/chunks/pagination-DHmYZZU9.cjs +1 -1
- package/dist/chunks/{physics-playground-DsnhVbVr.js → physics-playground-B6xWX0aK.js} +2 -2
- package/dist/chunks/{physics-playground-BOwru4ar.cjs → physics-playground-cODUFbJL.cjs} +2 -2
- package/dist/chunks/play-BdevnnRU.js +1 -1
- package/dist/chunks/play-DCeKlDqE.cjs +1 -1
- package/dist/chunks/player-BJPVdtzo.cjs +1 -1
- package/dist/chunks/player-D18aHq0n.js +1 -1
- package/dist/chunks/player-core-BTFa6_IO.cjs +1 -1
- package/dist/chunks/player-core-DR1WR-41.js +1 -1
- package/dist/chunks/presence-DAthlALi.cjs +1 -1
- package/dist/chunks/presence-DQsKeMSf.js +1 -1
- package/dist/chunks/presets-BYBVJVeP.js +1 -1
- package/dist/chunks/presets-CUHys3sK.cjs +1 -1
- package/dist/chunks/prize-wheel-D2MlXZz3.js +1 -1
- package/dist/chunks/prize-wheel-emDopI5c.cjs +1 -1
- package/dist/chunks/product-gallery-BznJaf2u.js +1 -1
- package/dist/chunks/product-gallery-CKtSVhZk.cjs +1 -1
- package/dist/chunks/progress-ring-C75O4MUi.cjs +1 -1
- package/dist/chunks/progress-ring-DTbpqpsJ.js +1 -1
- package/dist/chunks/prop-panel-DFqga6H5.cjs +1 -1
- package/dist/chunks/prop-panel-DTDO4kVW.js +1 -1
- package/dist/chunks/radar-D-bZRrgs.cjs +1 -1
- package/dist/chunks/radar-lUFsshFe.js +1 -1
- package/dist/chunks/reactions-BL2iO8iy.cjs +1 -1
- package/dist/chunks/reactions-zFqABIRz.js +1 -1
- package/dist/chunks/{registry-DwxAf29L.js → registry-BsVrFoLd.js} +2 -2
- package/dist/chunks/registry-CE5_Mo_p.js +1 -1
- package/dist/chunks/registry-CibnX7Ui.cjs +1 -1
- package/dist/chunks/{registry-ChLWwIC4.cjs → registry-DKOhN0IC.cjs} +2 -2
- package/dist/chunks/retro-button-CS_yN0sA.js +1 -1
- package/dist/chunks/retro-button-DrrBZ6w8.cjs +1 -1
- package/dist/chunks/rive-BTqu1owb.js +1 -1
- package/dist/chunks/rive-D6X4J0Mi.cjs +1 -1
- package/dist/chunks/{runtime-link-ykoWOFHQ.cjs → runtime-link-Cf4bL3SI.cjs} +2 -2
- package/dist/chunks/{runtime-link-Bg6c5x7w.js → runtime-link-CnRLQlW3.js} +2 -2
- package/dist/chunks/scene-C4h75wjo.cjs +1 -1
- package/dist/chunks/scene-DWNb4Lb1.js +1 -1
- package/dist/chunks/scroll-driven-CQbwzCdn.cjs +1 -1
- package/dist/chunks/scroll-driven-LghshrWq.js +1 -1
- package/dist/chunks/{scroll-scene-DQBNf7Q4.js → scroll-scene-B7ILdTi5.js} +3 -3
- package/dist/chunks/{scroll-scene-C_d8SE9e.cjs → scroll-scene-D3FOlUYX.cjs} +3 -3
- package/dist/chunks/segmented-CpB4mKIn.cjs +1 -1
- package/dist/chunks/segmented-Dn8MH47H.js +1 -1
- package/dist/chunks/shader-backdrop-BodjXMhw.cjs +1 -1
- package/dist/chunks/shader-backdrop-Cnq8-zUi.js +1 -1
- package/dist/chunks/shared-Bf72wLyt.cjs +1 -1
- package/dist/chunks/shared-CkKHWrtJ.js +1 -1
- package/dist/chunks/shared-jkgRH-Hx.cjs +1 -1
- package/dist/chunks/shared-o9CtwHmi.js +1 -1
- package/dist/chunks/sheet-B38ylIEW.cjs +1 -1
- package/dist/chunks/sheet-CeSuvE2R.js +1 -1
- package/dist/chunks/sign-DvZ1jHxE.js +1 -1
- package/dist/chunks/sign-RAkQIWrM.cjs +1 -1
- package/dist/chunks/skeleton-reveal-Dsd3Wp0n.cjs +1 -1
- package/dist/chunks/skeleton-reveal-WR9NVMyM.js +1 -1
- package/dist/chunks/sparkline-4vqobz_N.js +1 -1
- package/dist/chunks/sparkline-DeKhZpVo.cjs +1 -1
- package/dist/chunks/spring-CpnuPym2.js +1 -1
- package/dist/chunks/spring-XEl_diDJ.cjs +1 -1
- package/dist/chunks/stagger-B9sKPwQB.js +1 -1
- package/dist/chunks/stagger-DFKwqOQG.cjs +1 -1
- package/dist/chunks/suggestion-chips-CAcbFTr4.cjs +1 -1
- package/dist/chunks/suggestion-chips-CuuKEDNG.js +1 -1
- package/dist/chunks/switch-DiTlApGd.cjs +1 -1
- package/dist/chunks/switch-WErIYZJD.js +1 -1
- package/dist/chunks/tab-bar-BBlVAqbq.cjs +1 -1
- package/dist/chunks/tab-bar-D01Yx5Qz.js +1 -1
- package/dist/chunks/{ticker-DxG5WlGA.js → ticker-B-UUbU4I.js} +2 -2
- package/dist/chunks/{ticker-CdX1xnUl.cjs → ticker-Cv_Ex_sv.cjs} +2 -2
- package/dist/chunks/tip-BsX2--FP.js +1 -1
- package/dist/chunks/tip-VGS3qAUm.cjs +1 -1
- package/dist/chunks/toast-stack-Cdu0GOkt.js +1 -1
- package/dist/chunks/toast-stack-DprisNp_.cjs +1 -1
- package/dist/chunks/{tween-CB3CoBmZ.js → tween-BehYElBX.js} +2 -2
- package/dist/chunks/{tween-BEox7vZY.cjs → tween-DDFjS4XP.cjs} +2 -2
- package/dist/chunks/upload-progress-CEAWkP-p.cjs +1 -1
- package/dist/chunks/upload-progress-DguzIPm0.js +1 -1
- package/dist/chunks/variants-BtqEJuki.cjs +1 -1
- package/dist/chunks/variants-Dvcgx0pd.js +1 -1
- package/dist/chunks/viewport-BAXHhZLV.js +1 -1
- package/dist/chunks/viewport-EFYGqMNa.cjs +1 -1
- package/dist/chunks/voice-button-9UauxvT9.cjs +1 -1
- package/dist/chunks/voice-button-DBAXRVMZ.js +1 -1
- package/dist/chunks/weather-card-4Eg6e43D.cjs +1 -1
- package/dist/chunks/weather-card-DQ9HUFd4.js +1 -1
- package/dist/chunks/worker-canvas-BMBXAFWp.cjs +1 -1
- package/dist/chunks/worker-canvas-BZKnSNtg.js +1 -1
- package/dist/chunks/xp-bar-CxjWJQFS.js +1 -1
- package/dist/chunks/xp-bar-DkWfCTfB.cjs +1 -1
- package/dist/components/a11y.cjs +1 -1
- package/dist/components/a11y.js +1 -1
- package/dist/components/ai.cjs +1 -1
- package/dist/components/ai.js +1 -1
- package/dist/components/angular.cjs +1 -1
- package/dist/components/angular.js +1 -1
- package/dist/components/background.cjs +1 -1
- package/dist/components/background.js +1 -1
- package/dist/components/bridge.cjs +1 -1
- package/dist/components/bridge.js +1 -1
- package/dist/components/cards.cjs +1 -1
- package/dist/components/cards.js +1 -1
- package/dist/components/click.cjs +1 -1
- package/dist/components/click.js +1 -1
- package/dist/components/compat-v13.cjs +1 -1
- package/dist/components/compat-v13.js +1 -1
- package/dist/components/core.cjs +1 -1
- package/dist/components/core.js +1 -1
- package/dist/components/depth.cjs +1 -1
- package/dist/components/depth.js +1 -1
- package/dist/components/design.cjs +1 -1
- package/dist/components/design.js +1 -1
- package/dist/components/dotlottie.cjs +3 -3
- package/dist/components/dotlottie.js +3 -3
- package/dist/components/dsl.cjs +1 -1
- package/dist/components/dsl.js +1 -1
- package/dist/components/effects.cjs +1 -1
- package/dist/components/effects.js +1 -1
- package/dist/components/engine.cjs +1 -1
- package/dist/components/engine.js +1 -1
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.js +1 -1
- package/dist/components/fx-3d.cjs +1 -1
- package/dist/components/fx-3d.js +1 -1
- package/dist/components/fx-ai.cjs +1 -1
- package/dist/components/fx-ai.js +1 -1
- package/dist/components/fx-chart.cjs +1 -1
- package/dist/components/fx-chart.js +1 -1
- package/dist/components/fx-cinema.cjs +1 -1
- package/dist/components/fx-cinema.js +1 -1
- package/dist/components/fx-cyber.cjs +1 -1
- package/dist/components/fx-cyber.js +1 -1
- package/dist/components/fx-festival.cjs +1 -1
- package/dist/components/fx-festival.js +1 -1
- package/dist/components/fx-focus.cjs +1 -1
- package/dist/components/fx-focus.js +1 -1
- package/dist/components/fx-form.cjs +1 -1
- package/dist/components/fx-form.js +1 -1
- package/dist/components/fx-game.cjs +1 -1
- package/dist/components/fx-game.js +1 -1
- package/dist/components/fx-genart.cjs +1 -1
- package/dist/components/fx-genart.js +1 -1
- package/dist/components/fx-geo.cjs +1 -1
- package/dist/components/fx-geo.js +1 -1
- package/dist/components/fx-gesture.cjs +1 -1
- package/dist/components/fx-gesture.js +1 -1
- package/dist/components/fx-gpu.cjs +1 -1
- package/dist/components/fx-gpu.js +1 -1
- package/dist/components/fx-light.cjs +1 -1
- package/dist/components/fx-light.js +1 -1
- package/dist/components/fx-lottie.cjs +1 -1
- package/dist/components/fx-lottie.js +1 -1
- package/dist/components/fx-morph.cjs +1 -1
- package/dist/components/fx-morph.js +1 -1
- package/dist/components/fx-music.cjs +1 -1
- package/dist/components/fx-music.js +1 -1
- package/dist/components/fx-organic.cjs +1 -1
- package/dist/components/fx-organic.js +1 -1
- package/dist/components/fx-paper.cjs +1 -1
- package/dist/components/fx-paper.js +1 -1
- package/dist/components/fx-perf.cjs +1 -1
- package/dist/components/fx-perf.js +1 -1
- package/dist/components/fx-physics.cjs +1 -1
- package/dist/components/fx-physics.js +1 -1
- package/dist/components/fx-retro.cjs +1 -1
- package/dist/components/fx-retro.js +1 -1
- package/dist/components/fx-safe.cjs +1 -1
- package/dist/components/fx-safe.js +1 -1
- package/dist/components/fx-shop.cjs +1 -1
- package/dist/components/fx-shop.js +1 -1
- package/dist/components/fx-social.cjs +1 -1
- package/dist/components/fx-social.js +1 -1
- package/dist/components/fx-spatial.cjs +1 -1
- package/dist/components/fx-spatial.js +1 -1
- package/dist/components/fx-surface.cjs +1 -1
- package/dist/components/fx-surface.js +1 -1
- package/dist/components/fx-text.cjs +1 -1
- package/dist/components/fx-text.js +1 -1
- package/dist/components/fx-transitions.cjs +1 -1
- package/dist/components/fx-transitions.js +1 -1
- package/dist/components/fx-video.cjs +1 -1
- package/dist/components/fx-video.js +1 -1
- package/dist/components/fx-weather.cjs +1 -1
- package/dist/components/fx-weather.js +1 -1
- package/dist/components/fx.cjs +1 -1
- package/dist/components/fx.js +1 -1
- package/dist/components/fx2.cjs +1 -1
- package/dist/components/fx2.js +1 -1
- package/dist/components/gesture.cjs +1 -1
- package/dist/components/gesture.js +1 -1
- package/dist/components/gl-model.cjs +3 -3
- package/dist/components/gl-model.js +3 -3
- package/dist/components/gl-pool.cjs +1 -1
- package/dist/components/gl-pool.js +1 -1
- package/dist/components/interaction.cjs +1 -1
- package/dist/components/interaction.js +1 -1
- package/dist/components/jsx.cjs +1 -1
- package/dist/components/jsx.js +1 -1
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/lazy.cjs +1 -1
- package/dist/components/lazy.js +1 -1
- package/dist/components/lite.cjs +1 -1
- package/dist/components/lite.js +1 -1
- package/dist/components/marketplace.cjs +1 -1
- package/dist/components/marketplace.js +1 -1
- package/dist/components/motion-scene.cjs +2 -2
- package/dist/components/motion-scene.js +2 -2
- package/dist/components/motion-tokens.cjs +837 -0
- package/dist/components/motion-tokens.d.cts +242 -0
- package/dist/components/motion-tokens.d.ts +242 -0
- package/dist/components/motion-tokens.js +811 -0
- package/dist/components/motion.cjs +2 -2
- package/dist/components/motion.js +2 -2
- package/dist/components/native.cjs +1 -1
- package/dist/components/native.js +1 -1
- package/dist/components/offscreen.cjs +1 -1
- package/dist/components/offscreen.js +1 -1
- package/dist/components/packs.cjs +1 -1
- package/dist/components/packs.js +1 -1
- package/dist/components/page.cjs +1 -1
- package/dist/components/page.js +1 -1
- package/dist/components/perf-tasks.cjs +1 -1
- package/dist/components/perf-tasks.js +1 -1
- package/dist/components/perf.cjs +1 -1
- package/dist/components/perf.js +1 -1
- package/dist/components/physics.cjs +1 -1
- package/dist/components/physics.js +1 -1
- package/dist/components/plugins.cjs +1 -1
- package/dist/components/plugins.js +1 -1
- package/dist/components/react.cjs +1 -1
- package/dist/components/react.js +1 -1
- package/dist/components/reveal.cjs +1 -1
- package/dist/components/reveal.js +1 -1
- package/dist/components/scene-v2.cjs +1 -1
- package/dist/components/scene-v2.js +1 -1
- package/dist/components/snap-carousel.cjs +2 -2
- package/dist/components/snap-carousel.js +2 -2
- package/dist/components/solid.cjs +1 -1
- package/dist/components/solid.js +1 -1
- package/dist/components/svelte.cjs +1 -1
- package/dist/components/svelte.js +1 -1
- package/dist/components/svg.cjs +1 -1
- package/dist/components/svg.js +1 -1
- package/dist/components/text.cjs +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/timeline-editor.cjs +1 -1
- package/dist/components/timeline-editor.js +1 -1
- package/dist/components/timeline.cjs +1 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/tokens.cjs +1 -1
- package/dist/components/tokens.js +1 -1
- package/dist/components/transitions.cjs +1 -1
- package/dist/components/transitions.js +1 -1
- package/dist/components/ui.cjs +1 -1
- package/dist/components/ui.js +1 -1
- package/dist/components/vue.cjs +1 -1
- package/dist/components/vue.js +1 -1
- package/dist/components/webgl.cjs +1 -1
- package/dist/components/webgl.js +1 -1
- package/dist/components/widgets.cjs +5 -5
- package/dist/components/widgets.js +7 -7
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/components.umd.js +1 -1
- package/dist/effects/achievement-unlock.cjs +1 -1
- package/dist/effects/achievement-unlock.js +1 -1
- package/dist/effects/aurora-veil.cjs +1 -1
- package/dist/effects/aurora-veil.js +1 -1
- package/dist/effects/badge-pop.cjs +1 -1
- package/dist/effects/badge-pop.js +1 -1
- package/dist/effects/bars-grow.cjs +1 -1
- package/dist/effects/bars-grow.js +1 -1
- package/dist/effects/beat-bounce.cjs +1 -1
- package/dist/effects/beat-bounce.js +1 -1
- package/dist/effects/blob-button.cjs +1 -1
- package/dist/effects/blob-button.js +1 -1
- package/dist/effects/bloom.cjs +1 -1
- package/dist/effects/bloom.js +1 -1
- package/dist/effects/breathe.cjs +1 -1
- package/dist/effects/breathe.js +1 -1
- package/dist/effects/brushed-metal.cjs +1 -1
- package/dist/effects/brushed-metal.js +1 -1
- package/dist/effects/camera-dolly.cjs +1 -1
- package/dist/effects/camera-dolly.js +1 -1
- package/dist/effects/card-flip-3d.cjs +1 -1
- package/dist/effects/card-flip-3d.js +1 -1
- package/dist/effects/chest-open.cjs +1 -1
- package/dist/effects/chest-open.js +1 -1
- package/dist/effects/cloth.cjs +1 -1
- package/dist/effects/cloth.js +1 -1
- package/dist/effects/coin-burst.cjs +1 -1
- package/dist/effects/coin-burst.js +1 -1
- package/dist/effects/color-pulse.cjs +1 -1
- package/dist/effects/color-pulse.js +1 -1
- package/dist/effects/crt-power.cjs +1 -1
- package/dist/effects/crt-power.js +1 -1
- package/dist/effects/crumple.cjs +1 -1
- package/dist/effects/crumple.js +1 -1
- package/dist/effects/data-decode.cjs +1 -1
- package/dist/effects/data-decode.js +1 -1
- package/dist/effects/day-cycle.cjs +1 -1
- package/dist/effects/day-cycle.js +1 -1
- package/dist/effects/depth-in.cjs +1 -1
- package/dist/effects/depth-in.js +1 -1
- package/dist/effects/depth-pop.cjs +1 -1
- package/dist/effects/depth-pop.js +1 -1
- package/dist/effects/depth-stack.cjs +1 -1
- package/dist/effects/depth-stack.js +1 -1
- package/dist/effects/dolly-in.cjs +1 -1
- package/dist/effects/dolly-in.js +1 -1
- package/dist/effects/dots-pop.cjs +1 -1
- package/dist/effects/dots-pop.js +1 -1
- package/dist/effects/field-shake.cjs +1 -1
- package/dist/effects/field-shake.js +1 -1
- package/dist/effects/field-success.cjs +1 -1
- package/dist/effects/field-success.js +1 -1
- package/dist/effects/film-burn.cjs +1 -1
- package/dist/effects/film-burn.js +1 -1
- package/dist/effects/fire.cjs +1 -1
- package/dist/effects/fire.js +1 -1
- package/dist/effects/fireflies.cjs +1 -1
- package/dist/effects/fireflies.js +1 -1
- package/dist/effects/firework-burst.cjs +1 -1
- package/dist/effects/firework-burst.js +1 -1
- package/dist/effects/flip-chars.cjs +1 -1
- package/dist/effects/flip-chars.js +1 -1
- package/dist/effects/fluid.cjs +1 -1
- package/dist/effects/fluid.js +1 -1
- package/dist/effects/fly-to-cart.cjs +1 -1
- package/dist/effects/fly-to-cart.js +1 -1
- package/dist/effects/focus-draw.cjs +1 -1
- package/dist/effects/focus-draw.js +1 -1
- package/dist/effects/focus-glow.cjs +1 -1
- package/dist/effects/focus-glow.js +1 -1
- package/dist/effects/fog.cjs +1 -1
- package/dist/effects/fog.js +1 -1
- package/dist/effects/font-breathe.cjs +1 -1
- package/dist/effects/font-breathe.js +1 -1
- package/dist/effects/form-cascade.cjs +1 -1
- package/dist/effects/form-cascade.js +1 -1
- package/dist/effects/gen-skeleton.cjs +1 -1
- package/dist/effects/gen-skeleton.js +1 -1
- package/dist/effects/glass-frost.cjs +1 -1
- package/dist/effects/glass-frost.js +1 -1
- package/dist/effects/glitch-text.cjs +1 -1
- package/dist/effects/glitch-text.js +1 -1
- package/dist/effects/globe-spin.cjs +1 -1
- package/dist/effects/globe-spin.js +1 -1
- package/dist/effects/god-rays.cjs +1 -1
- package/dist/effects/god-rays.js +1 -1
- package/dist/effects/gpu-lift.cjs +1 -1
- package/dist/effects/gpu-lift.js +1 -1
- package/dist/effects/grain-flicker.cjs +1 -1
- package/dist/effects/grain-flicker.js +1 -1
- package/dist/effects/halftone-in.cjs +1 -1
- package/dist/effects/halftone-in.js +1 -1
- package/dist/effects/highlight-sweep.cjs +1 -1
- package/dist/effects/highlight-sweep.js +1 -1
- package/dist/effects/hologram.cjs +1 -1
- package/dist/effects/hologram.js +1 -1
- package/dist/effects/hud-frame.cjs +1 -1
- package/dist/effects/hud-frame.js +1 -1
- package/dist/effects/icon-pop.cjs +1 -1
- package/dist/effects/icon-pop.js +1 -1
- package/dist/effects/icon-swap.cjs +1 -1
- package/dist/effects/icon-swap.js +1 -1
- package/dist/effects/idle-reveal.cjs +1 -1
- package/dist/effects/idle-reveal.js +1 -1
- package/dist/effects/ink.cjs +1 -1
- package/dist/effects/ink.js +1 -1
- package/dist/effects/jump-cut.cjs +1 -1
- package/dist/effects/jump-cut.js +1 -1
- package/dist/effects/kaleido.cjs +1 -1
- package/dist/effects/kaleido.js +1 -1
- package/dist/effects/label-float.cjs +1 -1
- package/dist/effects/label-float.js +1 -1
- package/dist/effects/lantern-rise.cjs +1 -1
- package/dist/effects/lantern-rise.js +1 -1
- package/dist/effects/leaves.cjs +1 -1
- package/dist/effects/leaves.js +1 -1
- package/dist/effects/letterbox.cjs +1 -1
- package/dist/effects/letterbox.js +1 -1
- package/dist/effects/level-up.cjs +1 -1
- package/dist/effects/level-up.js +1 -1
- package/dist/effects/light-follow.cjs +1 -1
- package/dist/effects/light-follow.js +1 -1
- package/dist/effects/lightning.cjs +1 -1
- package/dist/effects/lightning.js +1 -1
- package/dist/effects/line-draw.cjs +1 -1
- package/dist/effects/line-draw.js +1 -1
- package/dist/effects/liquid-text.cjs +1 -1
- package/dist/effects/liquid-text.js +1 -1
- package/dist/effects/liquid-wipe.cjs +1 -1
- package/dist/effects/liquid-wipe.js +1 -1
- package/dist/effects/lottie-play.cjs +1 -1
- package/dist/effects/lottie-play.js +1 -1
- package/dist/effects/magnet.cjs +1 -1
- package/dist/effects/magnet.js +1 -1
- package/dist/effects/marching-ants.cjs +1 -1
- package/dist/effects/marching-ants.js +1 -1
- package/dist/effects/marker-pulse.cjs +1 -1
- package/dist/effects/marker-pulse.js +1 -1
- package/dist/effects/mention-glow.cjs +1 -1
- package/dist/effects/mention-glow.js +1 -1
- package/dist/effects/mesh-drift.cjs +1 -1
- package/dist/effects/mesh-drift.js +1 -1
- package/dist/effects/message-in.cjs +1 -1
- package/dist/effects/message-in.js +1 -1
- package/dist/effects/mosaic-flip.cjs +1 -1
- package/dist/effects/mosaic-flip.js +1 -1
- package/dist/effects/neon-ignite.cjs +1 -1
- package/dist/effects/neon-ignite.js +1 -1
- package/dist/effects/neon-pulse.cjs +1 -1
- package/dist/effects/neon-pulse.js +1 -1
- package/dist/effects/neon-write.cjs +1 -1
- package/dist/effects/neon-write.js +1 -1
- package/dist/effects/neu-press.cjs +1 -1
- package/dist/effects/neu-press.js +1 -1
- package/dist/effects/noise-reveal.cjs +1 -1
- package/dist/effects/noise-reveal.js +1 -1
- package/dist/effects/number-roll.cjs +1 -1
- package/dist/effects/number-roll.js +1 -1
- package/dist/effects/orbit-camera.cjs +1 -1
- package/dist/effects/orbit-camera.js +1 -1
- package/dist/effects/orbit-in.cjs +1 -1
- package/dist/effects/orbit-in.js +1 -1
- package/dist/effects/origami.cjs +1 -1
- package/dist/effects/origami.js +1 -1
- package/dist/effects/page-curl.cjs +1 -1
- package/dist/effects/page-curl.js +1 -1
- package/dist/effects/pan-reveal.cjs +1 -1
- package/dist/effects/pan-reveal.js +1 -1
- package/dist/effects/paper-unfold.cjs +1 -1
- package/dist/effects/paper-unfold.js +1 -1
- package/dist/effects/particle-text.cjs +1 -1
- package/dist/effects/particle-text.js +1 -1
- package/dist/effects/path-morph.cjs +1 -1
- package/dist/effects/path-morph.js +1 -1
- package/dist/effects/pearlescent.cjs +1 -1
- package/dist/effects/pearlescent.js +1 -1
- package/dist/effects/pencil-sketch.cjs +1 -1
- package/dist/effects/pencil-sketch.js +1 -1
- package/dist/effects/pin-drop.cjs +1 -1
- package/dist/effects/pin-drop.js +1 -1
- package/dist/effects/pinball.cjs +1 -1
- package/dist/effects/pinball.js +1 -1
- package/dist/effects/pinch-hint.cjs +1 -1
- package/dist/effects/pinch-hint.js +1 -1
- package/dist/effects/pixelate-in.cjs +1 -1
- package/dist/effects/pixelate-in.js +1 -1
- package/dist/effects/pointer-shadow.cjs +1 -1
- package/dist/effects/pointer-shadow.js +1 -1
- package/dist/effects/portal-open.cjs +1 -1
- package/dist/effects/portal-open.js +1 -1
- package/dist/effects/price-flip.cjs +1 -1
- package/dist/effects/price-flip.js +1 -1
- package/dist/effects/product-spin.cjs +1 -1
- package/dist/effects/product-spin.js +1 -1
- package/dist/effects/rack-focus.cjs +1 -1
- package/dist/effects/rack-focus.js +1 -1
- package/dist/effects/radial-spectrum.cjs +1 -1
- package/dist/effects/radial-spectrum.js +1 -1
- package/dist/effects/rain-glass.cjs +1 -1
- package/dist/effects/rain-glass.js +1 -1
- package/dist/effects/reaction-burst.cjs +1 -1
- package/dist/effects/reaction-burst.js +1 -1
- package/dist/effects/read-receipt.cjs +1 -1
- package/dist/effects/read-receipt.js +1 -1
- package/dist/effects/refraction.cjs +1 -1
- package/dist/effects/refraction.js +1 -1
- package/dist/effects/ring-sweep.cjs +1 -1
- package/dist/effects/ring-sweep.js +1 -1
- package/dist/effects/ripple-dissolve.cjs +1 -1
- package/dist/effects/ripple-dissolve.js +1 -1
- package/dist/effects/rope.cjs +1 -1
- package/dist/effects/rope.js +1 -1
- package/dist/effects/route-draw.cjs +1 -1
- package/dist/effects/route-draw.js +1 -1
- package/dist/effects/safe-fade.cjs +1 -1
- package/dist/effects/safe-fade.js +1 -1
- package/dist/effects/sakura.cjs +1 -1
- package/dist/effects/sakura.js +1 -1
- package/dist/effects/sale-shine.cjs +1 -1
- package/dist/effects/sale-shine.js +1 -1
- package/dist/effects/sankey-flow.cjs +1 -1
- package/dist/effects/sankey-flow.js +1 -1
- package/dist/effects/scanline-sweep.cjs +1 -1
- package/dist/effects/scanline-sweep.js +1 -1
- package/dist/effects/shatter.cjs +1 -1
- package/dist/effects/shatter.js +1 -1
- package/dist/effects/smoke.cjs +1 -1
- package/dist/effects/smoke.js +1 -1
- package/dist/effects/snowfall.cjs +1 -1
- package/dist/effects/snowfall.js +1 -1
- package/dist/effects/soft-body.cjs +1 -1
- package/dist/effects/soft-body.js +1 -1
- package/dist/effects/sound-particles.cjs +1 -1
- package/dist/effects/sound-particles.js +1 -1
- package/dist/effects/spatial-float.cjs +1 -1
- package/dist/effects/spatial-float.js +1 -1
- package/dist/effects/spectrum-mirror.cjs +1 -1
- package/dist/effects/spectrum-mirror.js +1 -1
- package/dist/effects/splash.cjs +1 -1
- package/dist/effects/splash.js +1 -1
- package/dist/effects/spooky-float.cjs +1 -1
- package/dist/effects/spooky-float.js +1 -1
- package/dist/effects/stock-pulse.cjs +1 -1
- package/dist/effects/stock-pulse.js +1 -1
- package/dist/effects/stream-text.cjs +1 -1
- package/dist/effects/stream-text.js +1 -1
- package/dist/effects/stroke-draw.cjs +1 -1
- package/dist/effects/stroke-draw.js +1 -1
- package/dist/effects/success-check.cjs +1 -1
- package/dist/effects/success-check.js +1 -1
- package/dist/effects/swipe-hint.cjs +1 -1
- package/dist/effects/swipe-hint.js +1 -1
- package/dist/effects/text-trail.cjs +1 -1
- package/dist/effects/text-trail.js +1 -1
- package/dist/effects/thinking-glow.cjs +1 -1
- package/dist/effects/thinking-glow.js +1 -1
- package/dist/effects/tilt-wobble.cjs +1 -1
- package/dist/effects/tilt-wobble.js +1 -1
- package/dist/effects/typing-dots.cjs +1 -1
- package/dist/effects/typing-dots.js +1 -1
- package/dist/effects/underline-sweep.cjs +1 -1
- package/dist/effects/underline-sweep.js +1 -1
- package/dist/effects/vhs-glitch.cjs +1 -1
- package/dist/effects/vhs-glitch.js +1 -1
- package/dist/effects/vine-grow.cjs +1 -1
- package/dist/effects/vine-grow.js +1 -1
- package/dist/effects/vinyl-spin.cjs +1 -1
- package/dist/effects/vinyl-spin.js +1 -1
- package/dist/effects/voice-wave.cjs +1 -1
- package/dist/effects/voice-wave.js +1 -1
- package/dist/effects/water-drop.cjs +1 -1
- package/dist/effects/water-drop.js +1 -1
- package/dist/effects/watercolor.cjs +1 -1
- package/dist/effects/watercolor.js +1 -1
- package/dist/effects/waveform-scope.cjs +1 -1
- package/dist/effects/waveform-scope.js +1 -1
- package/dist/effects/xmas-snow.cjs +1 -1
- package/dist/effects/xmas-snow.js +1 -1
- package/dist/effects/xp-gain.cjs +1 -1
- package/dist/effects/xp-gain.js +1 -1
- package/dist/effects/y2k-shine.cjs +1 -1
- package/dist/effects/y2k-shine.js +1 -1
- package/dist/element.cjs +1 -1
- package/dist/element.js +1 -1
- package/dist/element.umd.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/llms-full.txt +1 -1
- package/dist/llms.txt +1 -1
- package/dist/manifest.json +1 -1
- package/dist/presets/extended.cjs +1 -1
- package/dist/presets/extended.js +1 -1
- package/dist/presets-extended.umd.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/runtime/drag-snap.cjs +2 -2
- package/dist/runtime/drag-snap.iife.js +1 -1
- package/dist/runtime/drag-snap.js +2 -2
- package/dist/runtime/format-apng.cjs +3 -3
- package/dist/runtime/format-apng.iife.js +1 -1
- package/dist/runtime/format-apng.js +3 -3
- package/dist/runtime/format-css.cjs +3 -3
- package/dist/runtime/format-css.iife.js +1 -1
- package/dist/runtime/format-css.js +3 -3
- package/dist/runtime/format-gif.cjs +3 -3
- package/dist/runtime/format-gif.iife.js +1 -1
- package/dist/runtime/format-gif.js +3 -3
- package/dist/runtime/format-gltf.cjs +2 -2
- package/dist/runtime/format-gltf.iife.js +1 -1
- package/dist/runtime/format-gltf.js +2 -2
- package/dist/runtime/format-motion.cjs +4 -4
- package/dist/runtime/format-motion.iife.js +1 -1
- package/dist/runtime/format-motion.js +4 -4
- package/dist/runtime/format-obj.cjs +2 -2
- package/dist/runtime/format-obj.iife.js +1 -1
- package/dist/runtime/format-obj.js +2 -2
- package/dist/runtime/format-scene.cjs +2 -2
- package/dist/runtime/format-scene.iife.js +1 -1
- package/dist/runtime/format-scene.js +2 -2
- package/dist/runtime/format-sprite.cjs +3 -3
- package/dist/runtime/format-sprite.iife.js +1 -1
- package/dist/runtime/format-sprite.js +3 -3
- package/dist/runtime/format-svg.cjs +3 -3
- package/dist/runtime/format-svg.iife.js +1 -1
- package/dist/runtime/format-svg.js +3 -3
- package/dist/runtime/format-webp.cjs +3 -3
- package/dist/runtime/format-webp.iife.js +1 -1
- package/dist/runtime/format-webp.js +3 -3
- package/dist/runtime/gl.cjs +2 -2
- package/dist/runtime/gl.iife.js +1 -1
- package/dist/runtime/gl.js +2 -2
- package/dist/runtime/gltf-anim.cjs +2 -2
- package/dist/runtime/gltf-anim.iife.js +1 -1
- package/dist/runtime/gltf-anim.js +2 -2
- package/dist/runtime/gltf-decoders.cjs +2 -2
- package/dist/runtime/gltf-decoders.iife.js +1 -1
- package/dist/runtime/gltf-decoders.js +2 -2
- package/dist/runtime/lottie-state.cjs +2 -2
- package/dist/runtime/lottie-state.iife.js +1 -1
- package/dist/runtime/lottie-state.js +2 -2
- package/dist/runtime/physics.cjs +2 -2
- package/dist/runtime/physics.iife.js +1 -1
- package/dist/runtime/physics.js +2 -2
- package/dist/runtime/scroll.cjs +3 -3
- package/dist/runtime/scroll.iife.js +1 -1
- package/dist/runtime/scroll.js +3 -3
- package/dist/runtime/smooth.cjs +2 -2
- package/dist/runtime/smooth.iife.js +1 -1
- package/dist/runtime/smooth.js +2 -2
- package/dist/runtime/text.cjs +2 -2
- package/dist/runtime/text.iife.js +1 -1
- package/dist/runtime/text.js +2 -2
- package/dist/runtime/vector.cjs +3 -3
- package/dist/runtime/vector.iife.js +1 -1
- package/dist/runtime/vector.js +3 -3
- package/dist/runtime.cjs +4 -4
- package/dist/runtime.d.cts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.iife.js +2 -2
- package/dist/runtime.js +6 -6
- package/dist/solid.cjs +1 -1
- package/dist/solid.js +1 -1
- package/dist/svelte.cjs +1 -1
- package/dist/svelte.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +1 -1
- package/dist/widgets/add-to-cart.cjs +1 -1
- package/dist/widgets/add-to-cart.js +1 -1
- package/dist/widgets/badge-wall.cjs +1 -1
- package/dist/widgets/badge-wall.js +1 -1
- package/dist/widgets/bar-chart.cjs +1 -1
- package/dist/widgets/bar-chart.js +1 -1
- package/dist/widgets/bg-generator.cjs +1 -1
- package/dist/widgets/bg-generator.js +1 -1
- package/dist/widgets/carousel.cjs +1 -1
- package/dist/widgets/carousel.js +1 -1
- package/dist/widgets/cart-drawer.cjs +1 -1
- package/dist/widgets/cart-drawer.js +1 -1
- package/dist/widgets/chapter-nav.cjs +1 -1
- package/dist/widgets/chapter-nav.js +1 -1
- package/dist/widgets/chat-composer.cjs +1 -1
- package/dist/widgets/chat-composer.js +1 -1
- package/dist/widgets/clock-control.cjs +1 -1
- package/dist/widgets/clock-control.js +1 -1
- package/dist/widgets/code-export.cjs +1 -1
- package/dist/widgets/code-export.js +1 -1
- package/dist/widgets/color-picker.cjs +1 -1
- package/dist/widgets/color-picker.js +1 -1
- package/dist/widgets/command-palette.cjs +1 -1
- package/dist/widgets/command-palette.js +1 -1
- package/dist/widgets/compare.cjs +1 -1
- package/dist/widgets/compare.js +1 -1
- package/dist/widgets/countdown.cjs +1 -1
- package/dist/widgets/countdown.js +1 -1
- package/dist/widgets/cube-gallery.cjs +1 -1
- package/dist/widgets/cube-gallery.js +1 -1
- package/dist/widgets/date-picker.cjs +1 -1
- package/dist/widgets/date-picker.js +1 -1
- package/dist/widgets/disclosure.cjs +1 -1
- package/dist/widgets/disclosure.js +1 -1
- package/dist/widgets/dock.cjs +1 -1
- package/dist/widgets/dock.js +1 -1
- package/dist/widgets/dotlottie.cjs +1 -1
- package/dist/widgets/dotlottie.js +1 -1
- package/dist/widgets/equalizer.cjs +1 -1
- package/dist/widgets/equalizer.js +1 -1
- package/dist/widgets/festival-banner.cjs +1 -1
- package/dist/widgets/festival-banner.js +1 -1
- package/dist/widgets/field.cjs +1 -1
- package/dist/widgets/field.js +1 -1
- package/dist/widgets/file-drop.cjs +1 -1
- package/dist/widgets/file-drop.js +1 -1
- package/dist/widgets/gauge.cjs +1 -1
- package/dist/widgets/gauge.js +1 -1
- package/dist/widgets/gen-art.cjs +1 -1
- package/dist/widgets/gen-art.js +1 -1
- package/dist/widgets/gesture-sticker.cjs +1 -1
- package/dist/widgets/gesture-sticker.js +1 -1
- package/dist/widgets/gl-model.cjs +1 -1
- package/dist/widgets/gl-model.js +1 -1
- package/dist/widgets/gl-scene.cjs +2 -2
- package/dist/widgets/gl-scene.js +2 -2
- package/dist/widgets/globe.cjs +1 -1
- package/dist/widgets/globe.js +1 -1
- package/dist/widgets/gpu-particles.cjs +1 -1
- package/dist/widgets/gpu-particles.js +1 -1
- package/dist/widgets/gyro-card.cjs +1 -1
- package/dist/widgets/gyro-card.js +1 -1
- package/dist/widgets/hero-video.cjs +1 -1
- package/dist/widgets/hero-video.js +1 -1
- package/dist/widgets/hud-panel.cjs +1 -1
- package/dist/widgets/hud-panel.js +1 -1
- package/dist/widgets/hydrate.cjs +1 -1
- package/dist/widgets/hydrate.js +1 -1
- package/dist/widgets/install-button.cjs +1 -1
- package/dist/widgets/install-button.js +1 -1
- package/dist/widgets/kanban.cjs +1 -1
- package/dist/widgets/kanban.js +1 -1
- package/dist/widgets/keyframe-editor.cjs +1 -1
- package/dist/widgets/keyframe-editor.js +1 -1
- package/dist/widgets/kpi.cjs +1 -1
- package/dist/widgets/kpi.js +1 -1
- package/dist/widgets/leaderboard.cjs +1 -1
- package/dist/widgets/leaderboard.js +1 -1
- package/dist/widgets/liquid-nav.cjs +1 -1
- package/dist/widgets/liquid-nav.js +1 -1
- package/dist/widgets/location-card.cjs +1 -1
- package/dist/widgets/location-card.js +1 -1
- package/dist/widgets/lottie-icon.cjs +1 -1
- package/dist/widgets/lottie-icon.js +1 -1
- package/dist/widgets/lottie-player.cjs +2 -2
- package/dist/widgets/lottie-player.js +2 -2
- package/dist/widgets/lottie.cjs +1 -1
- package/dist/widgets/lottie.js +1 -1
- package/dist/widgets/lyrics.cjs +1 -1
- package/dist/widgets/lyrics.js +1 -1
- package/dist/widgets/masonry-flow.cjs +1 -1
- package/dist/widgets/masonry-flow.js +1 -1
- package/dist/widgets/menu-toggle.cjs +1 -1
- package/dist/widgets/menu-toggle.js +1 -1
- package/dist/widgets/menu.cjs +1 -1
- package/dist/widgets/menu.js +1 -1
- package/dist/widgets/message-list.cjs +1 -1
- package/dist/widgets/message-list.js +1 -1
- package/dist/widgets/milestones.cjs +1 -1
- package/dist/widgets/milestones.js +1 -1
- package/dist/widgets/modal.cjs +1 -1
- package/dist/widgets/modal.js +1 -1
- package/dist/widgets/motion-inspector.cjs +2 -2
- package/dist/widgets/motion-inspector.js +2 -2
- package/dist/widgets/motion-prefs.cjs +1 -1
- package/dist/widgets/motion-prefs.js +1 -1
- package/dist/widgets/motion-prompt.cjs +1 -1
- package/dist/widgets/motion-prompt.js +1 -1
- package/dist/widgets/motion-spec.cjs +1 -1
- package/dist/widgets/motion-spec.js +1 -1
- package/dist/widgets/motion.cjs +1 -1
- package/dist/widgets/motion.js +1 -1
- package/dist/widgets/music-player.cjs +1 -1
- package/dist/widgets/music-player.js +1 -1
- package/dist/widgets/native-preview.cjs +1 -1
- package/dist/widgets/native-preview.js +1 -1
- package/dist/widgets/nav-morph.cjs +1 -1
- package/dist/widgets/nav-morph.js +1 -1
- package/dist/widgets/notification-bell.cjs +1 -1
- package/dist/widgets/notification-bell.js +1 -1
- package/dist/widgets/odometer.cjs +1 -1
- package/dist/widgets/odometer.js +1 -1
- package/dist/widgets/organic-card.cjs +1 -1
- package/dist/widgets/organic-card.js +1 -1
- package/dist/widgets/otp.cjs +1 -1
- package/dist/widgets/otp.js +1 -1
- package/dist/widgets/pagination.cjs +1 -1
- package/dist/widgets/pagination.js +1 -1
- package/dist/widgets/panorama.cjs +1 -1
- package/dist/widgets/panorama.js +1 -1
- package/dist/widgets/parallax-layers.cjs +1 -1
- package/dist/widgets/parallax-layers.js +1 -1
- package/dist/widgets/pause-all.cjs +1 -1
- package/dist/widgets/pause-all.js +1 -1
- package/dist/widgets/perf-monitor.cjs +1 -1
- package/dist/widgets/perf-monitor.js +1 -1
- package/dist/widgets/physics-playground.cjs +2 -2
- package/dist/widgets/physics-playground.js +2 -2
- package/dist/widgets/plugin-card.cjs +3 -3
- package/dist/widgets/plugin-card.js +3 -3
- package/dist/widgets/plugin-store.cjs +1 -1
- package/dist/widgets/plugin-store.js +1 -1
- package/dist/widgets/presence.cjs +1 -1
- package/dist/widgets/presence.js +1 -1
- package/dist/widgets/prize-wheel.cjs +1 -1
- package/dist/widgets/prize-wheel.js +1 -1
- package/dist/widgets/product-gallery.cjs +1 -1
- package/dist/widgets/product-gallery.js +1 -1
- package/dist/widgets/progress-ring.cjs +1 -1
- package/dist/widgets/progress-ring.js +1 -1
- package/dist/widgets/prop-panel.cjs +1 -1
- package/dist/widgets/prop-panel.js +1 -1
- package/dist/widgets/pull-cord.cjs +1 -1
- package/dist/widgets/pull-cord.js +1 -1
- package/dist/widgets/radar.cjs +1 -1
- package/dist/widgets/radar.js +1 -1
- package/dist/widgets/reactions.cjs +1 -1
- package/dist/widgets/reactions.js +1 -1
- package/dist/widgets/red-envelope.cjs +1 -1
- package/dist/widgets/red-envelope.js +1 -1
- package/dist/widgets/retro-button.cjs +1 -1
- package/dist/widgets/retro-button.js +1 -1
- package/dist/widgets/rive.cjs +1 -1
- package/dist/widgets/rive.js +1 -1
- package/dist/widgets/route-transition.cjs +1 -1
- package/dist/widgets/route-transition.js +1 -1
- package/dist/widgets/scene.cjs +1 -1
- package/dist/widgets/scene.js +1 -1
- package/dist/widgets/scroll-ring.cjs +1 -1
- package/dist/widgets/scroll-ring.js +1 -1
- package/dist/widgets/scroll-scene.cjs +2 -2
- package/dist/widgets/scroll-scene.js +2 -2
- package/dist/widgets/segmented.cjs +1 -1
- package/dist/widgets/segmented.js +1 -1
- package/dist/widgets/shader-backdrop.cjs +1 -1
- package/dist/widgets/shader-backdrop.js +1 -1
- package/dist/widgets/sheet.cjs +1 -1
- package/dist/widgets/sheet.js +1 -1
- package/dist/widgets/shortcut.cjs +1 -1
- package/dist/widgets/shortcut.js +1 -1
- package/dist/widgets/skeleton-reveal.cjs +1 -1
- package/dist/widgets/skeleton-reveal.js +1 -1
- package/dist/widgets/sketch-chart.cjs +1 -1
- package/dist/widgets/sketch-chart.js +1 -1
- package/dist/widgets/smooth-scroll.cjs +2 -2
- package/dist/widgets/smooth-scroll.js +2 -2
- package/dist/widgets/snap-carousel.cjs +1 -1
- package/dist/widgets/snap-carousel.js +1 -1
- package/dist/widgets/sparkline.cjs +1 -1
- package/dist/widgets/sparkline.js +1 -1
- package/dist/widgets/spatial-card.cjs +1 -1
- package/dist/widgets/spatial-card.js +1 -1
- package/dist/widgets/star-rating.cjs +1 -1
- package/dist/widgets/star-rating.js +1 -1
- package/dist/widgets/stepper.cjs +1 -1
- package/dist/widgets/stepper.js +1 -1
- package/dist/widgets/sticky-wall.cjs +1 -1
- package/dist/widgets/sticky-wall.js +1 -1
- package/dist/widgets/stories.cjs +1 -1
- package/dist/widgets/stories.js +1 -1
- package/dist/widgets/suggestion-chips.cjs +1 -1
- package/dist/widgets/suggestion-chips.js +1 -1
- package/dist/widgets/swipe-deck.cjs +1 -1
- package/dist/widgets/swipe-deck.js +1 -1
- package/dist/widgets/switch.cjs +1 -1
- package/dist/widgets/switch.js +1 -1
- package/dist/widgets/tab-bar.cjs +1 -1
- package/dist/widgets/tab-bar.js +1 -1
- package/dist/widgets/terminal.cjs +1 -1
- package/dist/widgets/terminal.js +1 -1
- package/dist/widgets/text-splitter.cjs +3 -3
- package/dist/widgets/text-splitter.js +3 -3
- package/dist/widgets/theme-surface.cjs +1 -1
- package/dist/widgets/theme-surface.js +1 -1
- package/dist/widgets/theme-switcher.cjs +1 -1
- package/dist/widgets/theme-switcher.js +1 -1
- package/dist/widgets/tip.cjs +1 -1
- package/dist/widgets/tip.js +1 -1
- package/dist/widgets/toast-stack.cjs +1 -1
- package/dist/widgets/toast-stack.js +1 -1
- package/dist/widgets/token-editor.cjs +1 -1
- package/dist/widgets/token-editor.js +1 -1
- package/dist/widgets/upload-progress.cjs +1 -1
- package/dist/widgets/upload-progress.js +1 -1
- package/dist/widgets/video-card.cjs +1 -1
- package/dist/widgets/video-card.js +1 -1
- package/dist/widgets/voice-button.cjs +1 -1
- package/dist/widgets/voice-button.js +1 -1
- package/dist/widgets/volume-knob.cjs +1 -1
- package/dist/widgets/volume-knob.js +1 -1
- package/dist/widgets/weather-card.cjs +1 -1
- package/dist/widgets/weather-card.js +1 -1
- package/dist/widgets/worker-canvas.cjs +1 -1
- package/dist/widgets/worker-canvas.js +1 -1
- package/dist/widgets/xp-bar.cjs +1 -1
- package/dist/widgets/xp-bar.js +1 -1
- package/dist/widgets.umd.js +2 -2
- package/docs/motion-tokens.md +144 -5
- package/docs/versions.md +6 -4
- package/package.json +21 -1
|
@@ -0,0 +1,811 @@
|
|
|
1
|
+
import { MOTION_TOKENS, resolveTokenAliases, parseDuration, parseEasing, applyMotionTokens } from './tokens.js';
|
|
2
|
+
export { validateDesignTokens } from './tokens.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Motion Tokens 2.0 (14.1) — the token set: durations, easing curves, springs, spatial distances and motion
|
|
6
|
+
* semantics (enter / exit / emphasis / transition), with modes (built-in `reduced`, default `compact`, custom).
|
|
7
|
+
* Semantic tokens reference primitives with the DTCG alias syntax (`"{duration.normal}"`), the same syntax
|
|
8
|
+
* Motion Engine v2 and Scene Format v2 accept since 13.9 / 14.0.
|
|
9
|
+
*/
|
|
10
|
+
/** Token-set generation (14.1 = 2). */
|
|
11
|
+
const MOTION_TOKENS_VERSION = 2;
|
|
12
|
+
const SEMANTIC_KINDS = ['enter', 'exit', 'emphasis', 'transition'];
|
|
13
|
+
/** The built-in reduced-motion mode (derived from any set; explicit overrides apply on top). */
|
|
14
|
+
const REDUCED_MOTION_MODE = 'reduced';
|
|
15
|
+
const PRIM = ['duration', 'easing', 'spring', 'distance'];
|
|
16
|
+
const NAME = /^[A-Za-z0-9_-]+$/;
|
|
17
|
+
const REF = /^\{([^{}]+)\}$/;
|
|
18
|
+
const isObj$1 = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
19
|
+
const own = (o, k) => isObj$1(o) && Object.prototype.hasOwnProperty.call(o, k);
|
|
20
|
+
const keys = Object.keys;
|
|
21
|
+
/** `"{a.b}"` → `"a.b"` (or undefined). */
|
|
22
|
+
const tokenRefPath = (v) => (typeof v === 'string' ? REF.exec(v.trim())?.[1] : undefined);
|
|
23
|
+
const kebab = (s) => s.replace(/([a-z0-9])([A-Z])/g, '$1-$2').replace(/[\s_.]+/g, '-').toLowerCase();
|
|
24
|
+
/** The default token set: the 4.2 scale + distances + semantics + a `compact` mode. */
|
|
25
|
+
const MOTION_TOKENS_2 = {
|
|
26
|
+
duration: { ...MOTION_TOKENS.duration },
|
|
27
|
+
easing: { ...MOTION_TOKENS.easing },
|
|
28
|
+
spring: /*#__PURE__*/ Object.fromEntries(Object.entries(MOTION_TOKENS.spring).map(([k, v]) => [k, { ...v }])),
|
|
29
|
+
distance: { none: 0, xs: 4, sm: 8, md: 16, lg: 32, xl: 64 },
|
|
30
|
+
semantic: {
|
|
31
|
+
enter: { default: { duration: '{duration.normal}', easing: '{easing.decelerate}', distance: '{distance.md}' } },
|
|
32
|
+
exit: { default: { duration: '{duration.fast}', easing: '{easing.accelerate}', distance: '{distance.sm}' } },
|
|
33
|
+
emphasis: { default: { duration: '{duration.normal}', easing: '{easing.emphasized}', distance: '{distance.xs}', spring: '{spring.bouncy}' } },
|
|
34
|
+
transition: { default: { duration: '{duration.normal}', easing: '{easing.standard}' } },
|
|
35
|
+
},
|
|
36
|
+
modes: {
|
|
37
|
+
compact: { duration: { fast: 120, normal: 240, slow: 480, slower: 720, slowest: 1120 }, distance: { xs: 2, sm: 4, md: 8, lg: 16, xl: 32 } },
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
const cloneSem = (s) => Object.fromEntries(keys(s || {}).map((k) => [k, Object.fromEntries(keys(s[k] || {}).map((n) => [n, { ...s[k][n] }]))]));
|
|
41
|
+
function cloneOv(o) {
|
|
42
|
+
const out = {};
|
|
43
|
+
for (const g of ['duration', 'easing', 'distance'])
|
|
44
|
+
if (o[g])
|
|
45
|
+
out[g] = { ...o[g] };
|
|
46
|
+
if (o.spring)
|
|
47
|
+
out.spring = Object.fromEntries(keys(o.spring).map((k) => [k, { ...o.spring[k] }]));
|
|
48
|
+
if (o.semantic)
|
|
49
|
+
out.semantic = cloneSem(o.semantic);
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
function cloneSet(s) {
|
|
53
|
+
var _a;
|
|
54
|
+
const out = cloneOv(s);
|
|
55
|
+
out.duration || (out.duration = {});
|
|
56
|
+
out.easing || (out.easing = {});
|
|
57
|
+
out.spring || (out.spring = {});
|
|
58
|
+
out.distance || (out.distance = {});
|
|
59
|
+
out.semantic = cloneSem(s.semantic);
|
|
60
|
+
for (const k of SEMANTIC_KINDS)
|
|
61
|
+
(_a = out.semantic)[k] || (_a[k] = {});
|
|
62
|
+
if (s.modes)
|
|
63
|
+
out.modes = Object.fromEntries(keys(s.modes).map((m) => [m, cloneOv(s.modes[m])]));
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
function mergeOv(t, p) {
|
|
67
|
+
var _a;
|
|
68
|
+
if (!isObj$1(p))
|
|
69
|
+
return;
|
|
70
|
+
for (const g of ['duration', 'easing', 'distance'])
|
|
71
|
+
if (isObj$1(p[g]))
|
|
72
|
+
Object.assign((t[g] || (t[g] = {})), p[g]);
|
|
73
|
+
if (isObj$1(p.spring))
|
|
74
|
+
for (const k of keys(p.spring))
|
|
75
|
+
(t.spring || (t.spring = {}))[k] = { ...(t.spring[k] || { stiffness: 170, damping: 26, mass: 1 }), ...p.spring[k] };
|
|
76
|
+
if (isObj$1(p.semantic))
|
|
77
|
+
for (const k of keys(p.semantic))
|
|
78
|
+
for (const n of keys(p.semantic[k] || {}))
|
|
79
|
+
((_a = (t.semantic || (t.semantic = {})))[k] || (_a[k] = {}))[n] = { ...(t.semantic[k][n] || {}), ...p.semantic[k][n] };
|
|
80
|
+
}
|
|
81
|
+
/** Merge a partial set (and modes) over `base` (default: the built-in set). Never mutates either. */
|
|
82
|
+
function defineMotionTokens(partial = {}, base = MOTION_TOKENS_2) {
|
|
83
|
+
var _a;
|
|
84
|
+
const out = cloneSet(base);
|
|
85
|
+
mergeOv(out, partial);
|
|
86
|
+
if (isObj$1(partial.modes))
|
|
87
|
+
for (const m of keys(partial.modes))
|
|
88
|
+
mergeOv(((_a = (out.modes || (out.modes = {})))[m] || (_a[m] = {})), partial.modes[m]);
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
const bez = (e) => {
|
|
92
|
+
const m = /^cubic-bezier\(([^)]*)\)$/.exec(e.trim());
|
|
93
|
+
const n = m ? m[1].split(',').map(Number) : [];
|
|
94
|
+
return n.length === 4 && n.every(isFinite) ? n : undefined;
|
|
95
|
+
};
|
|
96
|
+
const up = (x) => Math.ceil(x * 100) / 100;
|
|
97
|
+
/** The reduced-motion overrides derived from a set: no travel, durations ≤ 150 ms, no overshooting curves, critically damped springs. */
|
|
98
|
+
function reducedMotionOverrides(set) {
|
|
99
|
+
var _a;
|
|
100
|
+
const cap = (v) => (v > 150 ? 150 : v);
|
|
101
|
+
const o = { duration: {}, easing: {}, spring: {}, distance: {}, semantic: {} };
|
|
102
|
+
for (const k of keys(set.duration))
|
|
103
|
+
o.duration[k] = cap(set.duration[k]);
|
|
104
|
+
for (const k of keys(set.distance))
|
|
105
|
+
o.distance[k] = 0;
|
|
106
|
+
for (const k of keys(set.easing)) {
|
|
107
|
+
const b = bez(set.easing[k]);
|
|
108
|
+
if (b && (b[1] < 0 || b[1] > 1 || b[3] < 0 || b[3] > 1))
|
|
109
|
+
o.easing[k] = 'cubic-bezier(0.2, 0, 0, 1)';
|
|
110
|
+
}
|
|
111
|
+
for (const k of keys(set.spring)) {
|
|
112
|
+
const s = set.spring[k];
|
|
113
|
+
o.spring[k] = { damping: Math.max(s.damping, up(2 * Math.sqrt(s.stiffness * s.mass))) };
|
|
114
|
+
}
|
|
115
|
+
for (const kind of keys(set.semantic))
|
|
116
|
+
for (const n of keys(set.semantic[kind] || {})) {
|
|
117
|
+
const e = set.semantic[kind][n], p = {};
|
|
118
|
+
if (typeof e.distance === 'number' && e.distance)
|
|
119
|
+
p.distance = 0;
|
|
120
|
+
if (typeof e.duration === 'number' && e.duration > 150)
|
|
121
|
+
p.duration = 150;
|
|
122
|
+
if (keys(p).length)
|
|
123
|
+
((_a = o.semantic)[kind] || (_a[kind] = {}))[n] = p;
|
|
124
|
+
}
|
|
125
|
+
return o;
|
|
126
|
+
}
|
|
127
|
+
/** The set as seen in `mode` (or several, applied in order); `reduced` is always available. The result has no `modes`. */
|
|
128
|
+
function withMode(set, mode) {
|
|
129
|
+
const out = cloneSet(set);
|
|
130
|
+
delete out.modes;
|
|
131
|
+
for (const m of mode == null ? [] : Array.isArray(mode) ? mode : [mode]) {
|
|
132
|
+
const explicit = set.modes && own(set.modes, m) ? set.modes[m] : undefined;
|
|
133
|
+
if (m === REDUCED_MOTION_MODE)
|
|
134
|
+
mergeOv(out, reducedMotionOverrides(out));
|
|
135
|
+
else if (!explicit)
|
|
136
|
+
throw new Error(`[motionary] tokens: unknown mode "${m}" (have: ${[REDUCED_MOTION_MODE, ...keys(set.modes || {})].join(', ')})`);
|
|
137
|
+
mergeOv(out, explicit);
|
|
138
|
+
}
|
|
139
|
+
return out;
|
|
140
|
+
}
|
|
141
|
+
function prim(set, g, n) {
|
|
142
|
+
const v = own(set[g], n) ? set[g][n] : undefined;
|
|
143
|
+
return g === 'spring' && v ? { ...v } : v;
|
|
144
|
+
}
|
|
145
|
+
const lit = (set, v, g) => {
|
|
146
|
+
const p = tokenRefPath(v);
|
|
147
|
+
if (p) {
|
|
148
|
+
const [grp, n] = p.split('.');
|
|
149
|
+
return grp === g ? prim(set, g, n) : undefined;
|
|
150
|
+
}
|
|
151
|
+
if (g === 'easing')
|
|
152
|
+
return typeof v === 'string' ? v : undefined;
|
|
153
|
+
if (g === 'spring')
|
|
154
|
+
return isObj$1(v) ? { stiffness: +v.stiffness, damping: +v.damping, mass: +(v.mass ?? 1) } : undefined;
|
|
155
|
+
if (g === 'distance')
|
|
156
|
+
return typeof v === 'number' ? v : typeof v === 'string' ? parseFloat(v) : undefined;
|
|
157
|
+
return parseDuration(v);
|
|
158
|
+
};
|
|
159
|
+
/** One semantic motion, resolved to literals (falls back to the kind's `default`). */
|
|
160
|
+
function resolveSemantic(set, kind, name = 'default', mode) {
|
|
161
|
+
const s = mode ? withMode(set, mode) : set;
|
|
162
|
+
const grp = s.semantic[kind] || {};
|
|
163
|
+
const e = grp[name] || grp.default;
|
|
164
|
+
if (!e)
|
|
165
|
+
throw new Error(`[motionary] tokens: no semantic token ${kind}.${name}`);
|
|
166
|
+
const r = {
|
|
167
|
+
duration: lit(s, e.duration, 'duration') ?? 0,
|
|
168
|
+
delay: e.delay == null ? 0 : lit(s, e.delay, 'duration') ?? 0,
|
|
169
|
+
easing: (e.easing == null ? s.easing.standard : lit(s, e.easing, 'easing')) ?? 'ease',
|
|
170
|
+
distance: e.distance == null ? 0 : lit(s, e.distance, 'distance') ?? 0,
|
|
171
|
+
};
|
|
172
|
+
if (e.spring != null) {
|
|
173
|
+
const sp = lit(s, e.spring, 'spring');
|
|
174
|
+
if (sp)
|
|
175
|
+
r.spring = sp;
|
|
176
|
+
}
|
|
177
|
+
return r;
|
|
178
|
+
}
|
|
179
|
+
/** `"{duration.fast}"`, `"distance.md"`, `"{enter.default}"`, `"{semantic.exit.default}"` → its value (undefined when unknown). */
|
|
180
|
+
function resolveMotionToken(set, ref, mode) {
|
|
181
|
+
const s = mode ? withMode(set, mode) : set;
|
|
182
|
+
const parts = (tokenRefPath(ref) ?? ref).split('.');
|
|
183
|
+
if (parts[0] === 'semantic')
|
|
184
|
+
parts.shift();
|
|
185
|
+
const [g, n] = parts;
|
|
186
|
+
if (PRIM.includes(g))
|
|
187
|
+
return prim(s, g, n);
|
|
188
|
+
if (SEMANTIC_KINDS.includes(g) && own(s.semantic[g], n))
|
|
189
|
+
return resolveSemantic(s, g, n);
|
|
190
|
+
return undefined;
|
|
191
|
+
}
|
|
192
|
+
/** `{ duration, delay, easing }` for `animate()` in motionary/motion. */
|
|
193
|
+
function motionOptions(set, kind, name = 'default', mode) {
|
|
194
|
+
const r = resolveSemantic(set, kind, name, mode);
|
|
195
|
+
return { duration: r.duration, delay: r.delay, easing: r.easing };
|
|
196
|
+
}
|
|
197
|
+
/** Keyframes for a semantic motion: enter / exit fade + travel by its distance, emphasis nudges and returns, transition moves. */
|
|
198
|
+
function motionKeyframes(set, kind, name = 'default', o = {}) {
|
|
199
|
+
const d = resolveSemantic(set, kind, name, o.mode).distance * (o.direction || 1);
|
|
200
|
+
const t = (k) => (d * k ? `translate${(o.axis || 'y').toUpperCase()}(${d * k}px)` : 'none');
|
|
201
|
+
if (kind === 'enter')
|
|
202
|
+
return [{ opacity: 0, transform: t(1) }, { opacity: 1, transform: 'none' }];
|
|
203
|
+
if (kind === 'exit')
|
|
204
|
+
return [{ opacity: 1, transform: 'none' }, { opacity: 0, transform: t(1) }];
|
|
205
|
+
if (kind === 'emphasis')
|
|
206
|
+
return [{ transform: 'none' }, { transform: t(-1), offset: 0.4 }, { transform: 'none' }];
|
|
207
|
+
return [{ transform: 'none' }, { transform: t(1) }];
|
|
208
|
+
}
|
|
209
|
+
const EASE_KW = /^(linear|ease|ease-in|ease-out|ease-in-out|step-start|step-end)$/;
|
|
210
|
+
/** Whether `v` is a CSS easing this library understands (keywords, cubic-bezier with x in 0–1, steps(), linear()). */
|
|
211
|
+
function isCssEasing(v) {
|
|
212
|
+
if (typeof v !== 'string')
|
|
213
|
+
return false;
|
|
214
|
+
const s = v.trim();
|
|
215
|
+
if (EASE_KW.test(s))
|
|
216
|
+
return true;
|
|
217
|
+
if (/^cubic-bezier\(/.test(s)) {
|
|
218
|
+
const b = bez(s);
|
|
219
|
+
return !!b && b[0] >= 0 && b[0] <= 1 && b[2] >= 0 && b[2] <= 1;
|
|
220
|
+
}
|
|
221
|
+
return /^steps\(\s*\d+\s*(,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/.test(s) || /^linear\([^()]+\)$/.test(s);
|
|
222
|
+
}
|
|
223
|
+
function checkGroups(o, at, P) {
|
|
224
|
+
const num = (v) => typeof v === 'number' && isFinite(v);
|
|
225
|
+
for (const g of PRIM) {
|
|
226
|
+
if (o[g] === undefined)
|
|
227
|
+
continue;
|
|
228
|
+
if (!isObj$1(o[g])) {
|
|
229
|
+
P(`${at}${g}`, 'expected an object');
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
for (const [n, v] of Object.entries(o[g])) {
|
|
233
|
+
const p = `${at}${g}.${n}`;
|
|
234
|
+
if (!NAME.test(n))
|
|
235
|
+
P(p, 'invalid name (letters, digits, - and _)');
|
|
236
|
+
else if (g === 'duration' && !(num(v) && v >= 0 && v <= 1e7))
|
|
237
|
+
P(p, 'expected a finite number of ms ≥ 0');
|
|
238
|
+
else if (g === 'distance' && !num(v))
|
|
239
|
+
P(p, 'expected a finite number of px');
|
|
240
|
+
else if (g === 'easing' && !isCssEasing(v))
|
|
241
|
+
P(p, `not a CSS easing: ${JSON.stringify(v)}`);
|
|
242
|
+
else if (g === 'spring' && !(isObj$1(v) && (v.stiffness === undefined || (num(v.stiffness) && v.stiffness > 0)) && (v.damping === undefined || (num(v.damping) && v.damping >= 0)) && (v.mass === undefined || (num(v.mass) && v.mass > 0))))
|
|
243
|
+
P(p, 'expected { stiffness > 0, damping ≥ 0, mass > 0 }');
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
/** Problems in a token set (empty = valid). Never throws. */
|
|
248
|
+
function validateMotionTokens(set) {
|
|
249
|
+
const out = [];
|
|
250
|
+
const P = (p, m) => void out.push(`${p}: ${m}`);
|
|
251
|
+
if (!isObj$1(set))
|
|
252
|
+
return ['set: expected an object'];
|
|
253
|
+
checkGroups(set, '', P);
|
|
254
|
+
const sem = (s, at, all, partial) => {
|
|
255
|
+
if (!isObj$1(s))
|
|
256
|
+
return void P(at, 'expected an object');
|
|
257
|
+
for (const k of keys(s)) {
|
|
258
|
+
if (!SEMANTIC_KINDS.includes(k)) {
|
|
259
|
+
P(`${at}.${k}`, 'unknown kind (enter | exit | emphasis | transition)');
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
for (const [n, e] of Object.entries(s[k] || {})) {
|
|
263
|
+
const p = `${at}.${k}.${n}`;
|
|
264
|
+
if (!NAME.test(n)) {
|
|
265
|
+
P(p, 'invalid name (letters, digits, - and _)');
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
if (!isObj$1(e)) {
|
|
269
|
+
P(p, 'expected an object');
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
if (!partial && e.duration === undefined)
|
|
273
|
+
P(`${p}.duration`, 'required');
|
|
274
|
+
for (const f of keys(e)) {
|
|
275
|
+
const g = { duration: 'duration', delay: 'duration', easing: 'easing', distance: 'distance', spring: 'spring' }[f];
|
|
276
|
+
if (!g) {
|
|
277
|
+
P(`${p}.${f}`, 'unknown field (duration | easing | delay | distance | spring)');
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
const v = e[f], r = tokenRefPath(v);
|
|
281
|
+
if (r) {
|
|
282
|
+
const [rg, rn] = r.split('.');
|
|
283
|
+
if (rg !== g)
|
|
284
|
+
P(`${p}.${f}`, `${v} is not a ${g} token`);
|
|
285
|
+
else if (!own(all[g], rn))
|
|
286
|
+
P(`${p}.${f}`, `unknown token ${v}`);
|
|
287
|
+
}
|
|
288
|
+
else if (typeof v === 'string' && v.trim().startsWith('{'))
|
|
289
|
+
P(`${p}.${f}`, `malformed token reference ${JSON.stringify(v)}`);
|
|
290
|
+
else if (lit(all, v, g) === undefined || (g === 'easing' && !isCssEasing(v)) || (g !== 'easing' && g !== 'spring' && !isFinite(lit(all, v, g))))
|
|
291
|
+
P(`${p}.${f}`, `invalid ${g} value ${JSON.stringify(v)}`);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
sem(set.semantic, 'semantic', set, false);
|
|
297
|
+
if (set.modes !== undefined) {
|
|
298
|
+
if (!isObj$1(set.modes))
|
|
299
|
+
P('modes', 'expected an object');
|
|
300
|
+
else
|
|
301
|
+
for (const [m, o] of Object.entries(set.modes)) {
|
|
302
|
+
if (!NAME.test(m)) {
|
|
303
|
+
P(`modes.${m}`, 'invalid mode name');
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
if (!isObj$1(o)) {
|
|
307
|
+
P(`modes.${m}`, 'expected an object');
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
for (const k of keys(o))
|
|
311
|
+
if (!PRIM.includes(k) && k !== 'semantic')
|
|
312
|
+
P(`modes.${m}.${k}`, 'unknown group');
|
|
313
|
+
checkGroups(o, `modes.${m}.`, P);
|
|
314
|
+
let view;
|
|
315
|
+
try {
|
|
316
|
+
view = withMode(set, m);
|
|
317
|
+
}
|
|
318
|
+
catch { /* reported above */ }
|
|
319
|
+
if (o.semantic && view)
|
|
320
|
+
sem(o.semantic, `modes.${m}.semantic`, view, true);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
try {
|
|
324
|
+
const r = withMode(set, REDUCED_MOTION_MODE);
|
|
325
|
+
for (const [k, v] of Object.entries(r.distance))
|
|
326
|
+
if (v)
|
|
327
|
+
P('modes.reduced', `distance.${k} is ${v} — reduced motion should not move content`);
|
|
328
|
+
}
|
|
329
|
+
catch { /* invalid set, reported above */ }
|
|
330
|
+
return out;
|
|
331
|
+
}
|
|
332
|
+
const X = 'org.motionary';
|
|
333
|
+
/** Export a token set as a DTCG document (springs, semantic distance / spring and modes travel in `$extensions["org.motionary"]`). */
|
|
334
|
+
function motionTokenSetToDTCG(set, o = {}) {
|
|
335
|
+
const stable = (o.format || '2025.10') === '2025.10', G = o.group || 'motion';
|
|
336
|
+
const ms = (v) => (stable ? { value: v, unit: 'ms' } : `${v}ms`);
|
|
337
|
+
const px = (v) => (stable ? { value: v, unit: 'px' } : `${v}px`);
|
|
338
|
+
const ref = (v) => `{${G}.${tokenRefPath(v)}}`;
|
|
339
|
+
const g = { $description: 'Motion tokens (Motionary Motion Tokens 2.0)', duration: { $type: 'duration' }, easing: { $type: 'cubicBezier' }, distance: { $type: 'dimension' }, spring: { $description: 'Spring parameters (not a DTCG type; in $extensions)' } };
|
|
340
|
+
for (const [k, v] of Object.entries(set.duration))
|
|
341
|
+
g.duration[k] = { $value: ms(v) };
|
|
342
|
+
for (const [k, v] of Object.entries(set.distance))
|
|
343
|
+
g.distance[k] = { $value: px(v) };
|
|
344
|
+
const easeTok = (css) => {
|
|
345
|
+
const b = bez(css) || { linear: [0, 0, 1, 1], ease: [0.25, 0.1, 0.25, 1], 'ease-in': [0.42, 0, 1, 1], 'ease-out': [0, 0, 0.58, 1], 'ease-in-out': [0.42, 0, 0.58, 1] }[css.trim()];
|
|
346
|
+
return b ? { $value: b, ...(parseEasing(b) !== css ? { $extensions: { [X]: { css } } } : {}) } : undefined;
|
|
347
|
+
};
|
|
348
|
+
for (const [k, v] of Object.entries(set.easing))
|
|
349
|
+
g.easing[k] = easeTok(v) || { $type: 'string', $value: v };
|
|
350
|
+
for (const [k, v] of Object.entries(set.spring))
|
|
351
|
+
g.spring[k] = { $extensions: { [X]: { spring: { ...v } } } };
|
|
352
|
+
for (const kind of SEMANTIC_KINDS) {
|
|
353
|
+
const grp = set.semantic[kind] || {};
|
|
354
|
+
if (!keys(grp).length)
|
|
355
|
+
continue;
|
|
356
|
+
g[kind] = { $type: 'transition' };
|
|
357
|
+
for (const [n, e] of Object.entries(grp)) {
|
|
358
|
+
const val = (v, f, p) => (tokenRefPath(v) ? ref(v) : f(lit(set, v, p) ?? 0));
|
|
359
|
+
const x = {};
|
|
360
|
+
let tf;
|
|
361
|
+
if (e.easing == null)
|
|
362
|
+
(tf = `{${G}.easing.standard}`), (x.noEasing = true);
|
|
363
|
+
else if (tokenRefPath(e.easing))
|
|
364
|
+
tf = ref(e.easing);
|
|
365
|
+
else {
|
|
366
|
+
const t = easeTok(e.easing);
|
|
367
|
+
tf = t ? t.$value : [0, 0, 1, 1];
|
|
368
|
+
if (!t || t.$extensions)
|
|
369
|
+
x.easing = e.easing;
|
|
370
|
+
}
|
|
371
|
+
if (e.distance != null)
|
|
372
|
+
x.distance = val(e.distance, px, 'distance');
|
|
373
|
+
if (e.spring != null)
|
|
374
|
+
x.spring = tokenRefPath(e.spring) ? ref(e.spring) : { ...e.spring };
|
|
375
|
+
if (e.delay != null)
|
|
376
|
+
x.delay = true;
|
|
377
|
+
const tok = { $value: { duration: val(e.duration, ms, 'duration'), delay: e.delay == null ? ms(0) : val(e.delay, ms, 'duration'), timingFunction: tf } };
|
|
378
|
+
if (keys(x).length)
|
|
379
|
+
tok.$extensions = { [X]: x };
|
|
380
|
+
g[kind][n] = tok;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
const doc = { $schema: 'https://www.designtokens.org/schemas/2025.10/format.json', [G]: g, $extensions: { [X]: { version: MOTION_TOKENS_VERSION } } };
|
|
384
|
+
if (o.modes !== false && set.modes && keys(set.modes).length)
|
|
385
|
+
doc.$extensions[X].modes = JSON.parse(JSON.stringify(set.modes));
|
|
386
|
+
return doc;
|
|
387
|
+
}
|
|
388
|
+
const PRIM_GROUPS = { duration: 'duration', durations: 'duration', easing: 'easing', easings: 'easing', distance: 'distance', distances: 'distance', spring: 'spring', springs: 'spring' };
|
|
389
|
+
const isTok = (n) => isObj$1(n) && '$value' in n;
|
|
390
|
+
function dim(v) {
|
|
391
|
+
if (typeof v === 'number')
|
|
392
|
+
return v;
|
|
393
|
+
const m = isObj$1(v) ? [0, v.value, v.unit] : /^\s*(-?\d*\.?\d+)\s*(px|rem|em)?\s*$/.exec(String(v ?? ''));
|
|
394
|
+
if (!m || typeof +m[1] !== 'number' || !isFinite(+m[1]))
|
|
395
|
+
return undefined;
|
|
396
|
+
return m[2] === 'rem' || m[2] === 'em' ? +m[1] * 16 : +m[1];
|
|
397
|
+
}
|
|
398
|
+
const round = (v) => (v === undefined ? v : Math.round(v * 1000) / 1000);
|
|
399
|
+
/** Find the motion group: the first object (breadth-first) holding a duration / easing / distance / spring / semantic group. */
|
|
400
|
+
function findRoot(doc) {
|
|
401
|
+
const q = [[doc, []]];
|
|
402
|
+
while (q.length) {
|
|
403
|
+
const [n, p] = q.shift();
|
|
404
|
+
if (!isObj$1(n) || isTok(n))
|
|
405
|
+
continue;
|
|
406
|
+
if (keys(n).some((k) => (PRIM_GROUPS[k] || SEMANTIC_KINDS.includes(k)) && isObj$1(n[k]) && !isTok(n[k])))
|
|
407
|
+
return p;
|
|
408
|
+
for (const k of keys(n))
|
|
409
|
+
if (!k.startsWith('$'))
|
|
410
|
+
q.push([n[k], [...p, k]]);
|
|
411
|
+
}
|
|
412
|
+
return undefined;
|
|
413
|
+
}
|
|
414
|
+
/** Import a DTCG document (Motionary 2.0 exports, or any DTCG motion group); merged over `base` (default: the built-in set). Throws on broken aliases. */
|
|
415
|
+
function motionTokenSetFromDTCG(doc, base = MOTION_TOKENS_2) {
|
|
416
|
+
var _a, _b;
|
|
417
|
+
const resolved = resolveTokenAliases(doc);
|
|
418
|
+
const rootPath = findRoot(doc) || [];
|
|
419
|
+
const at = (o, p) => p.reduce((n, k) => n?.[k], o);
|
|
420
|
+
const raw = at(doc, rootPath) || {}, res = at(resolved, rootPath) || {};
|
|
421
|
+
const prefix = rootPath.length ? rootPath.join('.') + '.' : '';
|
|
422
|
+
const p = { duration: {}, easing: {}, spring: {}, distance: {}, semantic: {} };
|
|
423
|
+
for (const k of keys(res)) {
|
|
424
|
+
const g = PRIM_GROUPS[k];
|
|
425
|
+
if (!g || !isObj$1(res[k]))
|
|
426
|
+
continue;
|
|
427
|
+
for (const [n, t] of Object.entries(res[k])) {
|
|
428
|
+
if (n.startsWith('$') || !isObj$1(t))
|
|
429
|
+
continue;
|
|
430
|
+
const ext = t.$extensions?.[X] || {};
|
|
431
|
+
if (g === 'spring') {
|
|
432
|
+
const s = ext.spring || (isTok(t) && isObj$1(t.$value) ? t.$value : undefined);
|
|
433
|
+
if (s)
|
|
434
|
+
p.spring[n] = { stiffness: +s.stiffness || 170, damping: +s.damping || 26, mass: +s.mass || 1 };
|
|
435
|
+
}
|
|
436
|
+
else if (isTok(t)) {
|
|
437
|
+
const v = g === 'duration' ? round(parseDuration(t.$value)) : g === 'distance' ? round(dim(t.$value)) : ext.css || parseEasing(t.$value);
|
|
438
|
+
if (v !== undefined)
|
|
439
|
+
p[g][n] = v;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
const mapRef = (v, g, resolvedVal, conv) => {
|
|
444
|
+
const r = tokenRefPath(v);
|
|
445
|
+
if (r && r.startsWith(prefix)) {
|
|
446
|
+
const rest = r.slice(prefix.length), [rg, rn] = rest.split('.');
|
|
447
|
+
if (PRIM_GROUPS[rg] === g && own(p[g], rn))
|
|
448
|
+
return `{${g}.${rn}}`;
|
|
449
|
+
}
|
|
450
|
+
return conv(resolvedVal);
|
|
451
|
+
};
|
|
452
|
+
for (const kind of SEMANTIC_KINDS) {
|
|
453
|
+
const rg = raw[kind], sg = res[kind];
|
|
454
|
+
if (!isObj$1(rg))
|
|
455
|
+
continue;
|
|
456
|
+
for (const n of keys(rg)) {
|
|
457
|
+
const rt = rg[n], st = sg?.[n];
|
|
458
|
+
if (n.startsWith('$') || !isTok(rt) || !isObj$1(st?.$value))
|
|
459
|
+
continue;
|
|
460
|
+
const rv = isObj$1(rt.$value) ? rt.$value : {}, sv = st.$value, x = rt.$extensions?.[X] || {}, sx = st.$extensions?.[X] || {};
|
|
461
|
+
const e = { duration: mapRef(rv.duration, 'duration', sv.duration, (v) => round(parseDuration(v))) };
|
|
462
|
+
if (!x.noEasing)
|
|
463
|
+
e.easing = x.easing ?? mapRef(rv.timingFunction, 'easing', sv.timingFunction, parseEasing);
|
|
464
|
+
if (x.delay || round(parseDuration(sv.delay)) || tokenRefPath(rv.delay))
|
|
465
|
+
e.delay = mapRef(rv.delay, 'duration', sv.delay, (v) => round(parseDuration(v)) ?? 0);
|
|
466
|
+
if (x.distance != null)
|
|
467
|
+
e.distance = mapRef(x.distance, 'distance', sx.distance ?? x.distance, (v) => round(dim(v)) ?? 0);
|
|
468
|
+
if (x.spring != null)
|
|
469
|
+
e.spring = mapRef(x.spring, 'spring', x.spring, (v) => (isObj$1(v) ? { ...v } : undefined));
|
|
470
|
+
((_a = p.semantic)[kind] || (_a[kind] = {}))[n] = e;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
const modes = doc?.$extensions?.[X]?.modes;
|
|
474
|
+
if (isObj$1(modes))
|
|
475
|
+
p.modes = JSON.parse(JSON.stringify(modes));
|
|
476
|
+
const out = cloneSet(base);
|
|
477
|
+
mergeOv(out, p);
|
|
478
|
+
// semantic entries from the document replace the base entry (no field leaks from the default)
|
|
479
|
+
for (const k of keys(p.semantic || {}))
|
|
480
|
+
for (const n of keys(p.semantic[k]))
|
|
481
|
+
out.semantic[k][n] = { ...p.semantic[k][n] };
|
|
482
|
+
if (p.modes)
|
|
483
|
+
for (const m of keys(p.modes))
|
|
484
|
+
mergeOv(((_b = (out.modes || (out.modes = {})))[m] || (_b[m] = {})), p.modes[m]);
|
|
485
|
+
return out;
|
|
486
|
+
}
|
|
487
|
+
/** The custom-property map: primitives (`--usa-duration-fast: 150ms`, `--usa-distance-md: 16px`…) and semantic vars referencing them. */
|
|
488
|
+
function motionTokenSetVars(set, o = {}) {
|
|
489
|
+
const s = o.mode ? withMode(set, o.mode) : set, P = o.prefix || '--usa', v = {};
|
|
490
|
+
for (const [k, x] of Object.entries(s.duration))
|
|
491
|
+
v[`${P}-duration-${kebab(k)}`] = `${x}ms`;
|
|
492
|
+
for (const [k, x] of Object.entries(s.easing))
|
|
493
|
+
v[`${P}-easing-${kebab(k)}`] = x;
|
|
494
|
+
for (const [k, x] of Object.entries(s.spring))
|
|
495
|
+
for (const f of ['stiffness', 'damping', 'mass'])
|
|
496
|
+
v[`${P}-spring-${kebab(k)}-${f}`] = String(x[f]);
|
|
497
|
+
for (const [k, x] of Object.entries(s.distance))
|
|
498
|
+
v[`${P}-distance-${kebab(k)}`] = `${x}px`;
|
|
499
|
+
const ref = (x, g, unit, dflt) => {
|
|
500
|
+
const r = tokenRefPath(x);
|
|
501
|
+
if (r) {
|
|
502
|
+
const [, n] = r.split('.');
|
|
503
|
+
return `var(${P}-${g}-${kebab(n)})`;
|
|
504
|
+
}
|
|
505
|
+
if (x == null)
|
|
506
|
+
return dflt;
|
|
507
|
+
const l = lit(s, x, g);
|
|
508
|
+
return l === undefined ? dflt : `${l}${unit}`;
|
|
509
|
+
};
|
|
510
|
+
for (const kind of SEMANTIC_KINDS)
|
|
511
|
+
for (const [n, e] of Object.entries(s.semantic[kind] || {})) {
|
|
512
|
+
const b = `${P}-motion-${kind}-${kebab(n)}`;
|
|
513
|
+
v[`${b}-duration`] = ref(e.duration, 'duration', 'ms', '0ms');
|
|
514
|
+
v[`${b}-delay`] = ref(e.delay, 'duration', 'ms', '0ms');
|
|
515
|
+
v[`${b}-easing`] = e.easing == null ? `var(${P}-easing-standard)` : ref(e.easing, 'easing', '', 'ease');
|
|
516
|
+
v[`${b}-distance`] = ref(e.distance, 'distance', 'px', '0px');
|
|
517
|
+
}
|
|
518
|
+
return v;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* A stylesheet: the set on `selector`, then each mode as the variables that change — `reduced` under
|
|
522
|
+
* `@media (prefers-reduced-motion: reduce)` and every mode under `selector[data-usa-motion-mode~="<mode>"]`
|
|
523
|
+
* (an explicit data attribute wins over the OS preference).
|
|
524
|
+
*/
|
|
525
|
+
function motionTokenSetToCss(set, o = {}) {
|
|
526
|
+
const sel = o.selector || ':root';
|
|
527
|
+
const base = motionTokenSetVars(set, o);
|
|
528
|
+
const block = (s, v, ind = '') => `${ind}${s} {\n${Object.entries(v).map(([k, x]) => `${ind} ${k}: ${x};`).join('\n')}\n${ind}}\n`;
|
|
529
|
+
let css = block(sel, base);
|
|
530
|
+
if (o.modes === false)
|
|
531
|
+
return css;
|
|
532
|
+
const diff = (m) => Object.fromEntries(Object.entries(motionTokenSetVars(set, { ...o, mode: m })).filter(([k, x]) => base[k] !== x));
|
|
533
|
+
const names = [...new Set([REDUCED_MOTION_MODE, ...keys(set.modes || {})])];
|
|
534
|
+
for (const m of names) {
|
|
535
|
+
const d = diff(m);
|
|
536
|
+
if (!keys(d).length)
|
|
537
|
+
continue;
|
|
538
|
+
if (m === REDUCED_MOTION_MODE)
|
|
539
|
+
css += `@media (prefers-reduced-motion: reduce) {\n${block(sel, d, ' ')}}\n`;
|
|
540
|
+
css += block(`${sel}[data-usa-motion-mode~="${m}"]`, d);
|
|
541
|
+
}
|
|
542
|
+
return css;
|
|
543
|
+
}
|
|
544
|
+
// --- runtime: Motion Engine v2 / Scene Format v2 ----------------------------------------
|
|
545
|
+
/** Whether the user asked for reduced motion (`prefers-reduced-motion: reduce`). */
|
|
546
|
+
function prefersReducedMotion() {
|
|
547
|
+
return typeof matchMedia === 'function' && !!matchMedia('(prefers-reduced-motion: reduce)')?.matches;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Make `set` the active motion scale: writes every custom property on `root` (default `<html>`) and makes
|
|
551
|
+
* `{duration.*}` / `{easing.*}` / `{spring.*}` references in motionary/motion, motionary/motion/scene and the
|
|
552
|
+
* token-aware components resolve to it. `mode: 'auto'` follows `prefers-reduced-motion` (and its changes).
|
|
553
|
+
* Returns an undo function.
|
|
554
|
+
*/
|
|
555
|
+
function applyMotionTokenSet(set, o = {}) {
|
|
556
|
+
const el = o.root || (typeof document !== 'undefined' ? document.documentElement : undefined);
|
|
557
|
+
const auto = o.mode === 'auto';
|
|
558
|
+
let undoPrim = () => { }, old = {};
|
|
559
|
+
const restore = () => {
|
|
560
|
+
undoPrim();
|
|
561
|
+
if (el)
|
|
562
|
+
for (const [k, v] of Object.entries(old))
|
|
563
|
+
v ? el.style.setProperty(k, v) : el.style.removeProperty(k);
|
|
564
|
+
old = {};
|
|
565
|
+
};
|
|
566
|
+
const apply = () => {
|
|
567
|
+
restore();
|
|
568
|
+
const mode = auto ? (prefersReducedMotion() ? REDUCED_MOTION_MODE : undefined) : o.mode;
|
|
569
|
+
const s = withMode(set, mode);
|
|
570
|
+
undoPrim = applyMotionTokens({ duration: s.duration, easing: s.easing, spring: s.spring }, el, o.prefix);
|
|
571
|
+
if (el)
|
|
572
|
+
for (const [k, v] of Object.entries(motionTokenSetVars(s, { prefix: o.prefix })))
|
|
573
|
+
if (!/-(duration|easing|spring)-/.test(k.slice((o.prefix || '--usa').length)) || k.includes('-motion-'))
|
|
574
|
+
(old[k] = el.style.getPropertyValue(k)), el.style.setProperty(k, v);
|
|
575
|
+
};
|
|
576
|
+
apply();
|
|
577
|
+
const mq = auto && typeof matchMedia === 'function' ? matchMedia('(prefers-reduced-motion: reduce)') : undefined;
|
|
578
|
+
mq?.addEventListener?.('change', apply);
|
|
579
|
+
return () => {
|
|
580
|
+
mq?.removeEventListener?.('change', apply);
|
|
581
|
+
restore();
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
/** Scene-local tokens (`doc.tokens`) for Scene Format v2 from a set (in `mode`). */
|
|
585
|
+
function toSceneTokens(set, mode) {
|
|
586
|
+
const s = withMode(set, mode);
|
|
587
|
+
return { duration: s.duration, easing: s.easing, spring: s.spring };
|
|
588
|
+
}
|
|
589
|
+
/** A copy of a scene v2 document whose `tokens` carry the set (the document's own tokens win). */
|
|
590
|
+
function withSceneTokens(doc, set, mode) {
|
|
591
|
+
const t = toSceneTokens(set, mode), d = isObj$1(doc.tokens) ? doc.tokens : {};
|
|
592
|
+
return { ...doc, tokens: { duration: { ...t.duration, ...d.duration }, easing: { ...t.easing, ...d.easing }, spring: { ...t.spring, ...d.spring } } };
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Motion Tokens 2.0 (14.1) — Figma Variables adapter. Pure data in the shapes of the Figma Variables REST API:
|
|
597
|
+
* `motionTokensToFigma()` builds a `POST /v1/files/:file_key/variables` body; `motionTokensFromFigma()` reads a
|
|
598
|
+
* `GET /v1/files/:file_key/variables/local` response (or such a POST body). No network calls: send the body with
|
|
599
|
+
* your own token, or use `npx motionary tokens export-figma / import-figma`.
|
|
600
|
+
*
|
|
601
|
+
* Variables are named `motion/<group>/<name>` (the 12.3 Figma plugin's names): durations and distances FLOAT,
|
|
602
|
+
* easings STRING, springs three FLOATs (`motion/spring/<name>/stiffness|damping|mass`), semantic tokens
|
|
603
|
+
* `motion/<enter|exit|emphasis|transition>/<name>/<duration|delay|easing|distance>` as aliases of the primitives.
|
|
604
|
+
* Token-set modes become collection modes (`reduced` ↔ "Reduced motion").
|
|
605
|
+
*/
|
|
606
|
+
const isObj = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
607
|
+
const FIELDS = ['duration', 'delay', 'easing', 'distance'];
|
|
608
|
+
const SPRING = ['stiffness', 'damping', 'mass'];
|
|
609
|
+
const modeLabel = (m) => (m === REDUCED_MOTION_MODE ? 'Reduced motion' : m.replace(/(^|-)(\w)/g, (_, s, c) => (s ? ' ' : '') + c.toUpperCase()));
|
|
610
|
+
const modeKey = (name) => (/reduc/i.test(name) ? REDUCED_MOTION_MODE : kebab(name.trim()).replace(/[^a-z0-9_-]/g, ''));
|
|
611
|
+
/** A token set as a Figma Variables `POST` body (one collection, Default + one mode per token-set mode). */
|
|
612
|
+
function motionTokensToFigma(set = MOTION_TOKENS_2, o = {}) {
|
|
613
|
+
const P = o.prefix || 'motion', C = o.cssPrefix || '--usa', col = `${P}-collection`;
|
|
614
|
+
const modes = o.modes || [...new Set([REDUCED_MOTION_MODE, ...Object.keys(set.modes || {})])];
|
|
615
|
+
const mid = (m) => `${P}-mode-${m || 'default'}`;
|
|
616
|
+
const body = {
|
|
617
|
+
variableCollections: [{ action: 'CREATE', id: col, name: o.collection || 'Motion', initialModeId: mid() }],
|
|
618
|
+
variableModes: [{ action: 'UPDATE', id: mid(), name: 'Default', variableCollectionId: col }, ...modes.map((m) => ({ action: 'CREATE', id: mid(m), name: modeLabel(m), variableCollectionId: col }))],
|
|
619
|
+
variables: [],
|
|
620
|
+
variableModeValues: [],
|
|
621
|
+
};
|
|
622
|
+
const views = [[mid(), withMode(set)], ...modes.map((m) => [mid(m), withMode(set, m)])];
|
|
623
|
+
const vid = (name) => `var:${name}`;
|
|
624
|
+
const declared = new Set();
|
|
625
|
+
const declare = (name, type, css, description) => {
|
|
626
|
+
if (declared.has(name))
|
|
627
|
+
return;
|
|
628
|
+
declared.add(name);
|
|
629
|
+
body.variables.push({ action: 'CREATE', id: vid(name), name, variableCollectionId: col, resolvedType: type, ...(description ? { description } : {}), scopes: ['ALL_SCOPES'], codeSyntax: { WEB: `var(${C}-${css})` } });
|
|
630
|
+
};
|
|
631
|
+
const put = (name, modeId, value) => body.variableModeValues.push({ variableId: vid(name), modeId, value });
|
|
632
|
+
const prims = [['duration', 'FLOAT', 'ms'], ['easing', 'STRING', 'CSS easing'], ['distance', 'FLOAT', 'px']];
|
|
633
|
+
// primitives: names from every view (a mode can add tokens)
|
|
634
|
+
for (const [modeId, s] of views) {
|
|
635
|
+
for (const [g, type, d] of prims)
|
|
636
|
+
for (const [k, v] of Object.entries(s[g])) {
|
|
637
|
+
const name = `${P}/${g}/${k}`;
|
|
638
|
+
declare(name, type, `${g}-${kebab(k)}`, d);
|
|
639
|
+
put(name, modeId, v);
|
|
640
|
+
}
|
|
641
|
+
for (const [k, v] of Object.entries(s.spring))
|
|
642
|
+
for (const f of SPRING) {
|
|
643
|
+
const name = `${P}/spring/${k}/${f}`;
|
|
644
|
+
declare(name, 'FLOAT', `spring-${kebab(k)}-${f}`, `spring ${f}`);
|
|
645
|
+
put(name, modeId, v[f]);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
// semantic tokens: aliases where they reference a primitive, literals otherwise
|
|
649
|
+
for (const [modeId, s] of views)
|
|
650
|
+
for (const kind of SEMANTIC_KINDS)
|
|
651
|
+
for (const [n, e] of Object.entries(s.semantic[kind] || {})) {
|
|
652
|
+
const base = `${P}/${kind}/${n}`, css = `motion-${kind}-${kebab(n)}`;
|
|
653
|
+
for (const f of FIELDS) {
|
|
654
|
+
const v = e[f];
|
|
655
|
+
if (v == null)
|
|
656
|
+
continue;
|
|
657
|
+
const r = tokenRefPath(v), name = `${base}/${f}`;
|
|
658
|
+
declare(name, f === 'easing' ? 'STRING' : 'FLOAT', `${css}-${f}`, f === 'easing' ? 'CSS easing' : f === 'distance' ? 'px' : 'ms');
|
|
659
|
+
if (r)
|
|
660
|
+
put(name, modeId, { type: 'VARIABLE_ALIAS', id: vid(`${P}/${r.replace('.', '/')}`) });
|
|
661
|
+
else
|
|
662
|
+
put(name, modeId, f === 'easing' ? String(v) : typeof v === 'number' ? v : parseFloat(String(v)) || 0);
|
|
663
|
+
}
|
|
664
|
+
if (e.spring != null) {
|
|
665
|
+
const r = tokenRefPath(e.spring);
|
|
666
|
+
for (const f of SPRING) {
|
|
667
|
+
const name = `${base}/spring/${f}`;
|
|
668
|
+
declare(name, 'FLOAT', `${css}-spring-${f}`, `spring ${f}`);
|
|
669
|
+
put(name, modeId, r ? { type: 'VARIABLE_ALIAS', id: vid(`${P}/spring/${r.split('.')[1]}/${f}`) } : e.spring[f]);
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
return body;
|
|
674
|
+
}
|
|
675
|
+
/** Normalize a GET /variables/local response or a POST body into collections + variables. */
|
|
676
|
+
function normalize(json) {
|
|
677
|
+
const cols = {};
|
|
678
|
+
const vars = [];
|
|
679
|
+
if (isObj(json?.meta?.variables)) {
|
|
680
|
+
for (const c of Object.values(json.meta.variableCollections || {}))
|
|
681
|
+
cols[c.id] = { name: c.name, def: c.defaultModeId, modes: (c.modes || []).map((m) => ({ id: m.modeId, name: m.name })) };
|
|
682
|
+
for (const v of Object.values(json.meta.variables))
|
|
683
|
+
vars.push({ id: v.id, name: v.name, type: v.resolvedType, col: v.variableCollectionId, values: { ...(v.valuesByMode || {}) } });
|
|
684
|
+
}
|
|
685
|
+
else if (Array.isArray(json?.variables)) {
|
|
686
|
+
for (const c of json.variableCollections || [])
|
|
687
|
+
if (c.action !== 'DELETE')
|
|
688
|
+
cols[c.id] = { name: c.name, def: c.initialModeId, modes: [] };
|
|
689
|
+
for (const m of json.variableModes || [])
|
|
690
|
+
if (m.action !== 'DELETE' && cols[m.variableCollectionId])
|
|
691
|
+
cols[m.variableCollectionId].modes.push({ id: m.id, name: m.name });
|
|
692
|
+
for (const c of Object.values(cols))
|
|
693
|
+
if (!c.modes.some((m) => m.id === c.def))
|
|
694
|
+
c.modes.unshift({ id: c.def, name: 'Default' });
|
|
695
|
+
const byId = {};
|
|
696
|
+
for (const v of json.variables)
|
|
697
|
+
if (v.action !== 'DELETE')
|
|
698
|
+
vars.push((byId[v.id] = { id: v.id, name: v.name, type: v.resolvedType, col: v.variableCollectionId, values: {} }));
|
|
699
|
+
for (const x of json.variableModeValues || [])
|
|
700
|
+
if (byId[x.variableId])
|
|
701
|
+
byId[x.variableId].values[x.modeId] = x.value;
|
|
702
|
+
}
|
|
703
|
+
else
|
|
704
|
+
throw new Error('[motionary] tokens: not a Figma Variables response (meta.variables) or POST body (variables[])');
|
|
705
|
+
return { cols, vars };
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Read a Figma Variables `GET /v1/files/:key/variables/local` response (or a `POST` body) into a token set,
|
|
709
|
+
* merged over `base`. The collection's default mode is the set; other modes become token-set modes holding only
|
|
710
|
+
* what differs ("Reduced motion" / "Reduce motion" → `reduced`, "Dense UI" → `dense-ui`).
|
|
711
|
+
*/
|
|
712
|
+
function motionTokensFromFigma(json, o = {}) {
|
|
713
|
+
var _a, _b, _c, _d;
|
|
714
|
+
const P = (o.prefix || 'motion') + '/';
|
|
715
|
+
const { cols, vars } = normalize(json);
|
|
716
|
+
const mine = vars.filter((v) => typeof v.name === 'string' && v.name.startsWith(P) && (v.type === 'FLOAT' || v.type === 'STRING'));
|
|
717
|
+
const colId = Object.keys(cols).find((id) => (o.collection ? cols[id].name === o.collection : mine.some((v) => v.col === id))) || mine[0]?.col;
|
|
718
|
+
const col = colId ? cols[colId] : undefined;
|
|
719
|
+
const list = mine.filter((v) => v.col === colId);
|
|
720
|
+
const byId = {};
|
|
721
|
+
for (const v of vars)
|
|
722
|
+
byId[v.id] = v;
|
|
723
|
+
const val = (v, mode) => (mode in v.values ? v.values[mode] : v.values[col?.def ?? '']);
|
|
724
|
+
// a value in a mode, aliases followed to a literal
|
|
725
|
+
const literal = (v, mode, depth = 0) => {
|
|
726
|
+
const x = val(v, mode);
|
|
727
|
+
if (isObj(x) && x.type === 'VARIABLE_ALIAS')
|
|
728
|
+
return depth < 16 && byId[x.id] ? literal(byId[x.id], mode, depth + 1) : undefined;
|
|
729
|
+
return x;
|
|
730
|
+
};
|
|
731
|
+
const split = (v) => v.name.slice(P.length).split('/');
|
|
732
|
+
const read = (mode) => {
|
|
733
|
+
var _a, _b, _c;
|
|
734
|
+
const t = { duration: {}, easing: {}, distance: {}, spring: {}, semantic: {} };
|
|
735
|
+
const sem = {};
|
|
736
|
+
for (const v of list) {
|
|
737
|
+
const parts = split(v), [g, n, f, sf] = parts;
|
|
738
|
+
if ((g === 'duration' || g === 'distance') && parts.length === 2) {
|
|
739
|
+
const x = literal(v, mode);
|
|
740
|
+
if (typeof x === 'number')
|
|
741
|
+
t[g][n] = x;
|
|
742
|
+
}
|
|
743
|
+
else if (g === 'easing' && parts.length === 2) {
|
|
744
|
+
const x = literal(v, mode);
|
|
745
|
+
if (typeof x === 'string')
|
|
746
|
+
t.easing[n] = x;
|
|
747
|
+
}
|
|
748
|
+
else if (g === 'spring' && parts.length === 3 && SPRING.includes(f)) {
|
|
749
|
+
const x = literal(v, mode);
|
|
750
|
+
if (typeof x === 'number')
|
|
751
|
+
((_a = t.spring)[n] || (_a[n] = {}))[f] = x;
|
|
752
|
+
}
|
|
753
|
+
else if (SEMANTIC_KINDS.includes(g) && n) {
|
|
754
|
+
const e = ((_b = (sem[g] || (sem[g] = {})))[n] || (_b[n] = {}));
|
|
755
|
+
const raw = val(v, mode), target = isObj(raw) && raw.type === 'VARIABLE_ALIAS' ? byId[raw.id] : undefined;
|
|
756
|
+
const tp = target && target.name.startsWith(P) ? split(target) : undefined;
|
|
757
|
+
if (FIELDS.includes(f) && parts.length === 3) {
|
|
758
|
+
const want = f === 'delay' ? 'duration' : f;
|
|
759
|
+
e[f] = tp && tp.length === 2 && tp[0] === want ? `{${want}.${tp[1]}}` : literal(v, mode);
|
|
760
|
+
}
|
|
761
|
+
else if (f === 'spring' && SPRING.includes(sf)) {
|
|
762
|
+
(e.$spring || (e.$spring = {}))[sf] = tp && tp.length === 3 && tp[0] === 'spring' && tp[2] === sf ? `ref:${tp[1]}` : literal(v, mode);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
for (const [k, grp] of Object.entries(sem))
|
|
767
|
+
for (const [n, e] of Object.entries(grp)) {
|
|
768
|
+
if (e.$spring) {
|
|
769
|
+
const refs = SPRING.map((f) => e.$spring[f]);
|
|
770
|
+
e.spring = refs.every((r) => typeof r === 'string' && r === refs[0] && r.startsWith('ref:')) ? `{spring.${refs[0].slice(4)}}` : { stiffness: +refs[0], damping: +refs[1], mass: +refs[2] };
|
|
771
|
+
delete e.$spring;
|
|
772
|
+
}
|
|
773
|
+
for (const f of Object.keys(e))
|
|
774
|
+
if (e[f] === undefined)
|
|
775
|
+
delete e[f];
|
|
776
|
+
((_c = t.semantic)[k] || (_c[k] = {}))[n] = e;
|
|
777
|
+
}
|
|
778
|
+
return t;
|
|
779
|
+
};
|
|
780
|
+
const def = col?.def ?? '';
|
|
781
|
+
const base = read(def);
|
|
782
|
+
const modes = {};
|
|
783
|
+
for (const m of col?.modes || []) {
|
|
784
|
+
if (m.id === def)
|
|
785
|
+
continue;
|
|
786
|
+
const t = read(m.id), d = {};
|
|
787
|
+
for (const g of ['duration', 'easing', 'distance'])
|
|
788
|
+
for (const [k, v] of Object.entries(t[g]))
|
|
789
|
+
if (base[g][k] !== v)
|
|
790
|
+
((d[g] || (d[g] = {}))[k] = v);
|
|
791
|
+
for (const [k, v] of Object.entries(t.spring))
|
|
792
|
+
for (const f of SPRING)
|
|
793
|
+
if (base.spring[k]?.[f] !== v[f])
|
|
794
|
+
(((_a = (d.spring || (d.spring = {})))[k] || (_a[k] = {}))[f] = v[f]);
|
|
795
|
+
for (const [kind, grp] of Object.entries(t.semantic))
|
|
796
|
+
for (const [n, e] of Object.entries(grp))
|
|
797
|
+
for (const [f, v] of Object.entries(e))
|
|
798
|
+
if (JSON.stringify(base.semantic[kind]?.[n]?.[f]) !== JSON.stringify(v))
|
|
799
|
+
(((_c = ((_b = (d.semantic || (d.semantic = {})))[kind] || (_b[kind] = {})))[n] || (_c[n] = {}))[f] = v);
|
|
800
|
+
if (Object.keys(d).length)
|
|
801
|
+
modes[modeKey(m.name)] = d;
|
|
802
|
+
}
|
|
803
|
+
const out = defineMotionTokens({ ...base, semantic: {}, modes }, o.base || MOTION_TOKENS_2);
|
|
804
|
+
for (const k of Object.keys(base.semantic))
|
|
805
|
+
for (const n of Object.keys(base.semantic[k]))
|
|
806
|
+
((_d = out.semantic)[k] || (_d[k] = {}))[n] = base.semantic[k][n];
|
|
807
|
+
return out;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
export { MOTION_TOKENS_2, MOTION_TOKENS_VERSION, REDUCED_MOTION_MODE, SEMANTIC_KINDS, applyMotionTokenSet, defineMotionTokens, isCssEasing, kebab, motionKeyframes, motionOptions, motionTokenSetFromDTCG, motionTokenSetToCss, motionTokenSetToDTCG, motionTokenSetVars, motionTokensFromFigma, motionTokensToFigma, prefersReducedMotion, reducedMotionOverrides, resolveMotionToken, resolveSemantic, toSceneTokens, tokenRefPath, validateMotionTokens, withMode, withSceneTokens };
|
|
811
|
+
//# sourceMappingURL=https://raw.githubusercontent.com/HarrisonCN/Motionary/v14.1.0/dist/components/motion-tokens.js.map
|