@yewdiel21/motion-kit 0.9.0 → 0.10.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/NOTICE +3 -35
- package/README.md +93 -81
- package/dist/auto/index.d.ts +22 -3
- package/dist/auto/index.js +43 -5
- package/dist/auto/index.js.map +1 -1
- package/dist/{chunk-KLY5BRRI.js → chunk-34EZ7DF4.js} +1 -1
- package/dist/chunk-34EZ7DF4.js.map +1 -0
- package/dist/{chunk-RFDIZYFX.js → chunk-DOOMULVV.js} +20 -20
- package/dist/chunk-DOOMULVV.js.map +1 -0
- package/dist/{chunk-ABNRDDO7.js → chunk-I3DXF2KQ.js} +2 -2
- package/dist/{chunk-Q4LVFNLN.js → chunk-IKQ5FODN.js} +4 -4
- package/dist/chunk-IKQ5FODN.js.map +1 -0
- package/dist/{chunk-2BQGFOA7.js → chunk-J6OCFNGU.js} +2 -2
- package/dist/chunk-J6OCFNGU.js.map +1 -0
- package/dist/{chunk-6OJAP6ZL.js → chunk-QFBOHPWZ.js} +3 -3
- package/dist/chunk-QFBOHPWZ.js.map +1 -0
- package/dist/{chunk-J27KH2A2.js → chunk-RVSKEBIC.js} +1 -1
- package/dist/chunk-RVSKEBIC.js.map +1 -0
- package/dist/{chunk-34XYOXHG.js → chunk-TFNRIZHU.js} +1615 -12
- package/dist/chunk-TFNRIZHU.js.map +1 -0
- package/dist/{chunk-FS2HJVVY.js → chunk-XAKC2QY7.js} +1204 -5
- package/dist/chunk-XAKC2QY7.js.map +1 -0
- package/dist/css/components/calendar.css +159 -0
- package/dist/css/components/chat-background.css +2 -2
- package/dist/css/components/chat.css +1 -1
- package/dist/css/components/cursor.css +3 -3
- package/dist/css/components/dialog.css +3 -3
- package/dist/css/components/hover-card.css +14 -0
- package/dist/css/components/input-otp.css +10 -0
- package/dist/css/components/island.css +1 -1
- package/dist/css/components/menu.css +1 -1
- package/dist/css/components/nav.css +1 -5
- package/dist/css/components/pagination.css +11 -0
- package/dist/css/components/quantity.css +16 -0
- package/dist/css/components/slot-picker.css +126 -0
- package/dist/css/components/steps.css +2 -2
- package/dist/css/components/studio-dock.css +35 -0
- package/dist/css/components/theme-picker.css +1 -1
- package/dist/css/components/toast.css +1 -1
- package/dist/css/components/trailer.css +37 -0
- package/dist/css/controls.css +78 -13
- package/dist/css/effects.css +8 -8
- package/dist/css/fonts.css +1 -1
- package/dist/css/themes/black-green.css +1 -1
- package/dist/css/themes/black.css +1 -1
- package/dist/css/themes/blue.css +1 -1
- package/dist/css/themes/brown.css +1 -1
- package/dist/css/themes/cold-blue.css +1 -1
- package/dist/css/themes/funny.css +1 -1
- package/dist/css/themes/gray.css +1 -1
- package/dist/css/themes/green.css +1 -1
- package/dist/css/themes/modern-1.css +1 -1
- package/dist/css/themes/neogreen.css +1 -1
- package/dist/css/themes/new.css +1 -1
- package/dist/css/themes/new2.css +1 -1
- package/dist/css/themes/oled.css +1 -1
- package/dist/css/themes/orange.css +1 -1
- package/dist/css/themes/pastel-pink.css +1 -1
- package/dist/css/themes/pink.css +1 -1
- package/dist/css/themes/purple.css +1 -1
- package/dist/css/themes/red.css +1 -1
- package/dist/css/themes/super-blue.css +1 -1
- package/dist/css/themes.css +19 -19
- package/dist/css/tokens.css +9 -9
- package/dist/elements/index.d.ts +75 -7
- package/dist/elements/index.js +172 -6
- package/dist/elements/index.js.map +1 -1
- package/dist/{engine-CUr9QijM.d.ts → engine-GDGwQnJE.d.ts} +2 -2
- package/dist/gl/index.js +3 -3
- package/dist/index.css +1076 -63
- package/dist/index.d.ts +17 -17
- package/dist/index.js +49 -7
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +139 -40
- package/dist/react/index.js +355 -8
- package/dist/react/index.js.map +1 -1
- package/dist/{reduced-BM4Ls0g5.d.ts → reduced-BmBzKH94.d.ts} +215 -18
- package/dist/{reveal-WFUWDrei.d.ts → reveal-jsX-uwUz.d.ts} +233 -24
- package/dist/{store-Bqy_obnD.d.ts → store-DYb3tTsZ.d.ts} +5 -5
- package/dist/theme/generate.d.ts +1 -1
- package/dist/theme/generate.js +2 -2
- package/dist/theme/generate.js.map +1 -1
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/index.js +2 -2
- package/dist/{theme-BFMoCzi6.d.ts → theme-Bjf9qIIy.d.ts} +1 -1
- package/package.json +2 -2
- package/registry.json +230 -156
- package/skills/motion-kit/SKILL.md +209 -189
- package/skills/motion-kit/reference/components.md +5 -5
- package/skills/motion-kit/reference/design.md +14 -14
- package/skills/motion-kit/reference/recipes.md +48 -49
- package/src/auto/auto-init.ts +38 -0
- package/src/components/calendar/README.md +82 -0
- package/src/components/calendar/calendar.css +158 -0
- package/src/components/calendar/element.ts +27 -0
- package/src/components/calendar/engine.ts +412 -0
- package/src/components/calendar/react.tsx +69 -0
- package/src/components/chat/README.md +1 -3
- package/src/components/chat/chat.css +1 -1
- package/src/components/chat/engine.ts +1 -1
- package/src/components/chat/react.tsx +1 -1
- package/src/components/chat-background/README.md +1 -3
- package/src/components/chat-background/audio.ts +1 -1
- package/src/components/chat-background/chat-background.css +2 -2
- package/src/components/chat-background/engine.ts +1 -1
- package/src/components/chat-background/react.tsx +1 -1
- package/src/components/cursor/README.md +3 -5
- package/src/components/cursor/cursor.css +3 -3
- package/src/components/cursor/element.ts +2 -2
- package/src/components/cursor/engine.ts +5 -5
- package/src/components/cursor/react.tsx +1 -1
- package/src/components/dialog/README.md +4 -8
- package/src/components/dialog/dialog.css +3 -3
- package/src/components/dialog/engine.ts +2 -2
- package/src/components/dialog/react.tsx +1 -1
- package/src/components/hover-card/README.md +16 -0
- package/src/components/hover-card/element.ts +8 -0
- package/src/components/hover-card/engine.ts +69 -0
- package/src/components/hover-card/hover-card.css +13 -0
- package/src/components/hover-card/react.tsx +19 -0
- package/src/components/input-otp/README.md +18 -0
- package/src/components/input-otp/element.ts +14 -0
- package/src/components/input-otp/engine.ts +106 -0
- package/src/components/input-otp/input-otp.css +9 -0
- package/src/components/input-otp/react.tsx +21 -0
- package/src/components/island/README.md +7 -7
- package/src/components/island/engine.ts +3 -3
- package/src/components/island/island.css +1 -1
- package/src/components/island/react.tsx +3 -3
- package/src/components/menu/README.md +2 -4
- package/src/components/menu/engine.ts +1 -1
- package/src/components/menu/menu.css +1 -1
- package/src/components/menu/react.tsx +1 -1
- package/src/components/nav/README.md +12 -14
- package/src/components/nav/engine.ts +5 -5
- package/src/components/nav/nav.css +1 -5
- package/src/components/nav/react.tsx +3 -3
- package/src/components/pagination/README.md +17 -0
- package/src/components/pagination/element.ts +14 -0
- package/src/components/pagination/engine.ts +102 -0
- package/src/components/pagination/pagination.css +10 -0
- package/src/components/pagination/react.tsx +22 -0
- package/src/components/quantity/README.md +20 -0
- package/src/components/quantity/element.ts +14 -0
- package/src/components/quantity/engine.ts +85 -0
- package/src/components/quantity/quantity.css +15 -0
- package/src/components/quantity/react.tsx +21 -0
- package/src/components/slot-picker/README.md +68 -0
- package/src/components/slot-picker/element.ts +27 -0
- package/src/components/slot-picker/engine.ts +412 -0
- package/src/components/slot-picker/react.tsx +76 -0
- package/src/components/slot-picker/slot-picker.css +125 -0
- package/src/components/steps/README.md +1 -3
- package/src/components/steps/engine.ts +3 -3
- package/src/components/steps/react.tsx +2 -2
- package/src/components/steps/steps.css +2 -2
- package/src/components/studio-dock/README.md +44 -0
- package/src/components/studio-dock/element.ts +11 -0
- package/src/components/studio-dock/engine.ts +212 -0
- package/src/components/studio-dock/react.tsx +23 -0
- package/src/components/studio-dock/studio-dock.css +34 -0
- package/src/components/theme-picker/README.md +3 -5
- package/src/components/theme-picker/engine.ts +2 -2
- package/src/components/theme-picker/react.tsx +1 -1
- package/src/components/theme-picker/theme-picker.css +1 -1
- package/src/components/toast/README.md +1 -3
- package/src/components/toast/engine.ts +2 -2
- package/src/components/toast/react.tsx +1 -1
- package/src/components/toast/store.ts +1 -2
- package/src/components/toast/toast.css +1 -1
- package/src/components/trailer/README.md +28 -0
- package/src/components/trailer/element.ts +13 -0
- package/src/components/trailer/engine.ts +189 -0
- package/src/components/trailer/react.tsx +16 -0
- package/src/components/trailer/trailer.css +36 -0
- package/src/core/channels.ts +3 -3
- package/src/core/curves.ts +3 -3
- package/src/core/dates.ts +98 -0
- package/src/core/gsap.ts +2 -2
- package/src/core/loop.ts +1 -1
- package/src/core/math.ts +1 -1
- package/src/core/physics-spring.ts +2 -2
- package/src/core/scroll-track.ts +2 -4
- package/src/core/spring.ts +1 -1
- package/src/core/timing.ts +21 -22
- package/src/css/controls/README.md +24 -20
- package/src/css/controls/burger.css +1 -1
- package/src/css/controls/button.css +4 -4
- package/src/css/controls/checkbox.css +1 -1
- package/src/css/controls/chip.css +1 -1
- package/src/css/controls/field.css +2 -2
- package/src/css/controls/glass.css +4 -4
- package/src/css/controls/status.css +63 -0
- package/src/css/default-theme.css +1 -1
- package/src/css/effects/README.md +19 -21
- package/src/css/effects/anim.css +1 -1
- package/src/css/effects/fade.css +1 -1
- package/src/css/effects/float.css +1 -1
- package/src/css/effects/frost.css +1 -1
- package/src/css/effects/grain.css +1 -1
- package/src/css/effects/loading.css +1 -1
- package/src/css/effects/success.css +1 -1
- package/src/css/effects/text.css +1 -1
- package/src/css/fonts.css +1 -1
- package/src/css/states.css +1 -1
- package/src/css/themes/black-green.css +1 -1
- package/src/css/themes/black.css +1 -1
- package/src/css/themes/blue.css +1 -1
- package/src/css/themes/brown.css +1 -1
- package/src/css/themes/cold-blue.css +1 -1
- package/src/css/themes/funny.css +1 -1
- package/src/css/themes/gray.css +1 -1
- package/src/css/themes/green.css +1 -1
- package/src/css/themes/modern-1.css +1 -1
- package/src/css/themes/neogreen.css +1 -1
- package/src/css/themes/new.css +1 -1
- package/src/css/themes/new2.css +1 -1
- package/src/css/themes/oled.css +1 -1
- package/src/css/themes/orange.css +1 -1
- package/src/css/themes/pastel-pink.css +1 -1
- package/src/css/themes/pink.css +1 -1
- package/src/css/themes/purple.css +1 -1
- package/src/css/themes/red.css +1 -1
- package/src/css/themes/super-blue.css +1 -1
- package/src/css/tokens.css +8 -8
- package/src/elements/index.ts +24 -0
- package/src/gl/liquid-blend/README.md +3 -3
- package/src/gl/matcap/README.md +3 -3
- package/src/gl/particle-hero/README.md +1 -1
- package/src/gl/particle-hero/create-particle-hero.ts +3 -5
- package/src/gl/particle-hero/shaders.ts +1 -1
- package/src/gl/shader-blur/README.md +3 -3
- package/src/gl/shader-grain/README.md +3 -3
- package/src/index.ts +25 -0
- package/src/motion/chat.ts +2 -2
- package/src/motion/confetti.ts +1 -1
- package/src/motion/count.ts +1 -1
- package/src/motion/details.ts +1 -1
- package/src/motion/drag-dismiss.ts +1 -1
- package/src/motion/effects.ts +1 -1
- package/src/motion/entrances.ts +1 -1
- package/src/motion/floating.ts +1 -1
- package/src/motion/flow.ts +2 -2
- package/src/motion/indicator.ts +1 -1
- package/src/motion/layout.ts +1 -1
- package/src/motion/liquid.ts +1 -1
- package/src/motion/morph.ts +2 -2
- package/src/motion/reveal.ts +1 -1
- package/src/motion/sheet.ts +1 -1
- package/src/motion/surface.ts +1 -1
- package/src/react/animated-number.tsx +2 -2
- package/src/react/flip-group.tsx +1 -1
- package/src/react/frost.tsx +1 -1
- package/src/react/index.ts +21 -0
- package/src/react/slot-text.tsx +1 -1
- package/src/react/use-action-button.ts +6 -0
- package/src/react/use-card-dock.ts +1 -1
- package/src/react/use-cascade.ts +1 -1
- package/src/react/use-contrast.ts +1 -1
- package/src/react/use-depth-grid.ts +1 -1
- package/src/react/use-editorial-reveal.ts +7 -0
- package/src/react/use-fill-text.ts +1 -1
- package/src/react/use-film-hero.ts +6 -0
- package/src/react/use-font-cycle.ts +7 -0
- package/src/react/use-frame-zoom.ts +1 -1
- package/src/react/use-image-zoom.ts +5 -0
- package/src/react/use-joined-cta.ts +5 -0
- package/src/react/use-letters.ts +1 -1
- package/src/react/use-local-clock.ts +5 -0
- package/src/react/use-marquee.ts +1 -1
- package/src/react/use-mask-text.ts +1 -1
- package/src/react/use-parallax.ts +1 -1
- package/src/react/use-particle-hero.ts +1 -1
- package/src/react/use-scroll-dock.ts +5 -0
- package/src/react/use-snap-strip.ts +1 -1
- package/src/react/use-sticker.ts +5 -0
- package/src/react/use-studio-dock.ts +8 -0
- package/src/react/use-text-roll.ts +1 -1
- package/src/react/use-thumbnail-nav.ts +7 -0
- package/src/react/use-trailer.ts +6 -0
- package/src/react/use-weight-hover.ts +5 -0
- package/src/recipes/action-button/README.md +31 -0
- package/src/recipes/action-button/action-button.css +113 -0
- package/src/recipes/action-button/create-action-button.ts +56 -0
- package/src/recipes/card-dock/README.md +1 -1
- package/src/recipes/card-dock/card-dock.css +1 -1
- package/src/recipes/card-dock/create-card-dock.ts +2 -2
- package/src/recipes/cascade/README.md +1 -3
- package/src/recipes/cascade/create-cascade.ts +3 -3
- package/src/recipes/contrast/README.md +0 -2
- package/src/recipes/contrast/create-contrast.ts +1 -1
- package/src/recipes/counter/README.md +0 -2
- package/src/recipes/counter/create-counter.ts +1 -1
- package/src/recipes/curved-carousel/README.md +0 -2
- package/src/recipes/curved-carousel/create-curved-carousel.ts +2 -2
- package/src/recipes/curved-carousel/curved-carousel.css +1 -1
- package/src/recipes/depth-grid/README.md +0 -2
- package/src/recipes/depth-grid/create-depth-grid.ts +3 -4
- package/src/recipes/details/README.md +0 -2
- package/src/recipes/details/create-details.ts +1 -1
- package/src/recipes/dock-pill/README.md +3 -3
- package/src/recipes/drag-ruler/README.md +3 -3
- package/src/recipes/editorial-reveal/README.md +35 -0
- package/src/recipes/editorial-reveal/create-editorial-reveal.ts +91 -0
- package/src/recipes/editorial-reveal/editorial-reveal.css +17 -0
- package/src/recipes/fill-text/README.md +1 -1
- package/src/recipes/fill-text/create-fill-text.ts +1 -1
- package/src/recipes/film-hero/README.md +23 -0
- package/src/recipes/film-hero/create-film-hero.ts +65 -0
- package/src/recipes/film-hero/film-hero.css +29 -0
- package/src/recipes/fit-text/README.md +0 -2
- package/src/recipes/flow/README.md +0 -2
- package/src/recipes/flow/create-flow.ts +1 -1
- package/src/recipes/font-cycle/README.md +11 -0
- package/src/recipes/font-cycle/create-font-cycle.ts +126 -0
- package/src/recipes/font-cycle/font-cycle.css +36 -0
- package/src/recipes/frame-zoom/README.md +1 -3
- package/src/recipes/frame-zoom/create-frame-zoom.ts +2 -2
- package/src/recipes/image-zoom/README.md +16 -0
- package/src/recipes/image-zoom/create-image-zoom.ts +27 -0
- package/src/recipes/image-zoom/image-zoom.css +7 -0
- package/src/recipes/infinite-reel/README.md +3 -3
- package/src/recipes/joined-cta/README.md +13 -0
- package/src/recipes/joined-cta/create-joined-cta.ts +22 -0
- package/src/recipes/joined-cta/joined-cta.css +17 -0
- package/src/recipes/letters/README.md +2 -4
- package/src/recipes/letters/create-letters.ts +3 -3
- package/src/recipes/local-clock/README.md +31 -0
- package/src/recipes/local-clock/create-local-clock.ts +61 -0
- package/src/recipes/marquee/README.md +0 -2
- package/src/recipes/marquee/create-marquee.ts +3 -3
- package/src/recipes/marquee/marquee.css +1 -1
- package/src/recipes/mask-text/README.md +3 -5
- package/src/recipes/mask-text/create-mask-text.ts +4 -4
- package/src/recipes/parallax/README.md +1 -3
- package/src/recipes/parallax/create-parallax.ts +1 -1
- package/src/recipes/pile/README.md +0 -2
- package/src/recipes/pile/create-pile.ts +1 -1
- package/src/recipes/pile/pile-math.ts +1 -1
- package/src/recipes/pile/pile.css +1 -1
- package/src/recipes/pill/README.md +0 -2
- package/src/recipes/pill/pill.css +2 -2
- package/src/recipes/pop/README.md +0 -2
- package/src/recipes/pop/create-pop.ts +1 -1
- package/src/recipes/radial-menu/README.md +0 -2
- package/src/recipes/radial-menu/create-radial-menu.ts +1 -1
- package/src/recipes/radial-menu/radial-menu.css +1 -1
- package/src/recipes/reflow/README.md +3 -5
- package/src/recipes/reflow/create-reflow.ts +1 -1
- package/src/recipes/repel-bento/README.md +3 -3
- package/src/recipes/reveal/README.md +0 -2
- package/src/recipes/reveal/create-reveal.ts +1 -1
- package/src/recipes/rotator/README.md +3 -3
- package/src/recipes/scroll-dock/README.md +46 -0
- package/src/recipes/scroll-dock/create-scroll-dock.ts +72 -0
- package/src/recipes/scroll-dock/scroll-dock.css +70 -0
- package/src/recipes/slot-text/README.md +0 -2
- package/src/recipes/slot-text/create-slot-text.ts +1 -1
- package/src/recipes/snap-strip/README.md +1 -1
- package/src/recipes/snap-strip/create-snap-strip.ts +5 -6
- package/src/recipes/snap-strip/snap-strip.css +1 -1
- package/src/recipes/sortable/README.md +3 -5
- package/src/recipes/sortable/create-sortable.ts +4 -4
- package/src/recipes/sortable/sortable.css +1 -1
- package/src/recipes/spring-cards/README.md +0 -2
- package/src/recipes/spring-cards/create-spring-cards.ts +1 -1
- package/src/recipes/spring-cards/spring-cards.css +1 -1
- package/src/recipes/sticker/README.md +59 -0
- package/src/recipes/sticker/create-sticker.ts +490 -0
- package/src/recipes/sticker/sticker.css +112 -0
- package/src/recipes/stretch-footer/README.md +0 -2
- package/src/recipes/stretch-footer/create-stretch-footer.ts +1 -1
- package/src/recipes/stretch-footer/stretch-footer.css +1 -1
- package/src/recipes/tabs/README.md +0 -2
- package/src/recipes/tabs/create-tabs.ts +1 -1
- package/src/recipes/text-roll/README.md +1 -3
- package/src/recipes/text-roll/create-text-roll.ts +3 -3
- package/src/recipes/text-roll/text-roll.css +1 -1
- package/src/recipes/thumbnail-nav/README.md +16 -0
- package/src/recipes/thumbnail-nav/create-thumbnail-nav.ts +165 -0
- package/src/recipes/thumbnail-nav/thumbnail-nav.css +108 -0
- package/src/recipes/ticket-menu/README.md +3 -3
- package/src/recipes/weight-hover/README.md +37 -0
- package/src/recipes/weight-hover/create-weight-hover.ts +136 -0
- package/src/recipes/weight-hover/weight-hover.css +7 -0
- package/src/recipes/words/README.md +0 -2
- package/src/recipes/words/create-words.ts +1 -1
- package/src/theme/generate.ts +1 -1
- package/src/theme/presets.ts +2 -2
- package/src/theme/theme.ts +1 -2
- package/dist/chunk-2BQGFOA7.js.map +0 -1
- package/dist/chunk-34XYOXHG.js.map +0 -1
- package/dist/chunk-6OJAP6ZL.js.map +0 -1
- package/dist/chunk-FS2HJVVY.js.map +0 -1
- package/dist/chunk-J27KH2A2.js.map +0 -1
- package/dist/chunk-KLY5BRRI.js.map +0 -1
- package/dist/chunk-Q4LVFNLN.js.map +0 -1
- package/dist/chunk-RFDIZYFX.js.map +0 -1
- /package/dist/{chunk-ABNRDDO7.js.map → chunk-I3DXF2KQ.js.map} +0 -0
|
@@ -8,7 +8,7 @@ interface DialogLabels {
|
|
|
8
8
|
dock?: string;
|
|
9
9
|
}
|
|
10
10
|
interface DialogOptions {
|
|
11
|
-
/** morph (
|
|
11
|
+
/** morph (default), liquid, or sheet: rises from the bottom and pushes [data-mk-underlay] back. */
|
|
12
12
|
variant?: DialogVariant;
|
|
13
13
|
placement?: DialogPlacement;
|
|
14
14
|
/** Tinted backdrop; false leaves it transparent (menus). */
|
|
@@ -54,11 +54,220 @@ interface MenuInstance extends DialogInstance {
|
|
|
54
54
|
}
|
|
55
55
|
declare function createMenu(dialog: HTMLElement | null, options?: MenuOptions): MenuInstance;
|
|
56
56
|
|
|
57
|
+
interface QuantityOptions {
|
|
58
|
+
min?: number;
|
|
59
|
+
max?: number;
|
|
60
|
+
step?: number;
|
|
61
|
+
value?: number;
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
onChange?: (value: number) => void;
|
|
64
|
+
}
|
|
65
|
+
interface QuantityInstance extends Instance {
|
|
66
|
+
setValue(value: number, notify?: boolean): void;
|
|
67
|
+
readonly value: number;
|
|
68
|
+
}
|
|
69
|
+
/** Bounded numeric control. Bite/rotation is CSS; buttons remain native. */
|
|
70
|
+
declare function createQuantity(root: HTMLElement | null, options?: QuantityOptions): QuantityInstance;
|
|
71
|
+
|
|
72
|
+
interface PaginationOptions {
|
|
73
|
+
totalPages?: number;
|
|
74
|
+
page?: number;
|
|
75
|
+
siblings?: number;
|
|
76
|
+
pageLabel?: (page: number) => string;
|
|
77
|
+
onChange?: (page: number) => void;
|
|
78
|
+
}
|
|
79
|
+
interface PaginationInstance extends Instance {
|
|
80
|
+
setPage(page: number, notify?: boolean): void;
|
|
81
|
+
setTotalPages(total: number): void;
|
|
82
|
+
readonly page: number;
|
|
83
|
+
readonly totalPages: number;
|
|
84
|
+
}
|
|
85
|
+
/** Renders a bounded window of pages, even when totalPages is very large. */
|
|
86
|
+
declare function createPagination(root: HTMLElement | null, options?: PaginationOptions): PaginationInstance;
|
|
87
|
+
|
|
88
|
+
interface HoverCardOptions {
|
|
89
|
+
openDelay?: number;
|
|
90
|
+
closeDelay?: number;
|
|
91
|
+
placement?: 'top' | 'bottom';
|
|
92
|
+
onOpenChange?: (open: boolean) => void;
|
|
93
|
+
}
|
|
94
|
+
interface HoverCardInstance extends Instance {
|
|
95
|
+
open(): void;
|
|
96
|
+
close(): void;
|
|
97
|
+
readonly isOpen: boolean;
|
|
98
|
+
}
|
|
99
|
+
/** Nonmodal preview: pointer, keyboard focus and tap all reveal the same panel. */
|
|
100
|
+
declare function createHoverCard(root: HTMLElement | null, options?: HoverCardOptions): HoverCardInstance;
|
|
101
|
+
|
|
102
|
+
interface InputOtpOptions {
|
|
103
|
+
length?: number;
|
|
104
|
+
value?: string;
|
|
105
|
+
mask?: boolean;
|
|
106
|
+
onChange?: (value: string) => void;
|
|
107
|
+
onComplete?: (value: string) => void;
|
|
108
|
+
}
|
|
109
|
+
interface InputOtpInstance extends Instance {
|
|
110
|
+
setValue(value: string, notify?: boolean): void;
|
|
111
|
+
focus(): void;
|
|
112
|
+
readonly value: string;
|
|
113
|
+
}
|
|
114
|
+
/** One real input preserves native editing, mobile autofill and password managers. */
|
|
115
|
+
declare function createInputOtp(root: HTMLElement | null, options?: InputOtpOptions): InputOtpInstance;
|
|
116
|
+
|
|
117
|
+
type StudioDockView = 'menu' | 'contact' | 'reel';
|
|
118
|
+
interface StudioDockState {
|
|
119
|
+
open: boolean;
|
|
120
|
+
view: StudioDockView;
|
|
121
|
+
page: number;
|
|
122
|
+
}
|
|
123
|
+
interface StudioDockOptions {
|
|
124
|
+
/** Seconds. Reference sheet: 1.3 s, outBack(.52). */
|
|
125
|
+
duration?: number;
|
|
126
|
+
ease?: string;
|
|
127
|
+
/** Move focus into a newly opened view. Defaults to true. */
|
|
128
|
+
focusOnOpen?: boolean;
|
|
129
|
+
/** Contain Tab within the open panel and its toggle. Defaults to true. */
|
|
130
|
+
trapFocus?: boolean;
|
|
131
|
+
onChange?: (state: StudioDockState) => void;
|
|
132
|
+
}
|
|
133
|
+
interface StudioDockInstance extends Instance {
|
|
134
|
+
open(view?: StudioDockView): void;
|
|
135
|
+
close(): void;
|
|
136
|
+
toggle(): void;
|
|
137
|
+
selectPage(index: number): void;
|
|
138
|
+
readonly state: StudioDockState;
|
|
139
|
+
}
|
|
140
|
+
/** A contained studio sheet. Markup remains useful without JavaScript; fixed positioning is CSS opt-in. */
|
|
141
|
+
declare function createStudioDock(root: HTMLElement | null, options?: StudioDockOptions): StudioDockInstance;
|
|
142
|
+
|
|
143
|
+
type DateInput = Date | string | number;
|
|
144
|
+
/** Local midnight of a date; "2026-10-23" is read as a local day, not UTC. */
|
|
145
|
+
declare function toDate(input: DateInput | null | undefined, fallback?: Date): Date;
|
|
146
|
+
/** YYYY-MM-DD of the local day. */
|
|
147
|
+
declare const dayKey: (date: Date) => string;
|
|
148
|
+
|
|
149
|
+
type CalendarView = 'month' | 'week';
|
|
150
|
+
type CalendarEventStatus = 'pending' | 'done' | 'cancelled';
|
|
151
|
+
interface CalendarEvent {
|
|
152
|
+
id: string | number;
|
|
153
|
+
title: string;
|
|
154
|
+
start: DateInput;
|
|
155
|
+
end?: DateInput;
|
|
156
|
+
allDay?: boolean;
|
|
157
|
+
status?: CalendarEventStatus;
|
|
158
|
+
/** Any CSS colour for the chip. */
|
|
159
|
+
color?: string;
|
|
160
|
+
}
|
|
161
|
+
interface CalendarRange {
|
|
162
|
+
start: Date;
|
|
163
|
+
end: Date;
|
|
164
|
+
view: CalendarView;
|
|
165
|
+
}
|
|
166
|
+
interface CalendarLabels {
|
|
167
|
+
more?: (count: number) => string;
|
|
168
|
+
events?: (count: number) => string;
|
|
169
|
+
status?: Partial<Record<CalendarEventStatus, string>>;
|
|
170
|
+
}
|
|
171
|
+
interface CalendarOptions {
|
|
172
|
+
/** Date the calendar opens on. */
|
|
173
|
+
date?: DateInput;
|
|
174
|
+
view?: CalendarView;
|
|
175
|
+
/** 0 = Sunday … 6 = Saturday. */
|
|
176
|
+
firstDay?: number;
|
|
177
|
+
locale?: string;
|
|
178
|
+
events?: CalendarEvent[];
|
|
179
|
+
/** Chips per day in the month view before "+N". */
|
|
180
|
+
maxEvents?: number;
|
|
181
|
+
selected?: DateInput | null;
|
|
182
|
+
/** Override "today" (tests, demos in another zone). */
|
|
183
|
+
today?: DateInput;
|
|
184
|
+
labels?: CalendarLabels;
|
|
185
|
+
onSelect?: (date: Date) => void;
|
|
186
|
+
onEventClick?: (event: CalendarEvent) => void;
|
|
187
|
+
onNavigate?: (range: CalendarRange) => void;
|
|
188
|
+
}
|
|
189
|
+
interface CalendarInstance extends Instance {
|
|
190
|
+
next(): void;
|
|
191
|
+
prev(): void;
|
|
192
|
+
goToday(): void;
|
|
193
|
+
setDate(date: DateInput): void;
|
|
194
|
+
setView(view: CalendarView): void;
|
|
195
|
+
setEvents(events: CalendarEvent[]): void;
|
|
196
|
+
select(date: DateInput | null, notify?: boolean): void;
|
|
197
|
+
readonly date: Date;
|
|
198
|
+
readonly view: CalendarView;
|
|
199
|
+
readonly selected: Date | null;
|
|
200
|
+
readonly range: CalendarRange;
|
|
201
|
+
}
|
|
202
|
+
declare function createCalendar(root: HTMLElement | null, options?: CalendarOptions): CalendarInstance;
|
|
203
|
+
|
|
204
|
+
type SlotSource = string[] | Record<string, string[]> | ((date: Date) => string[] | Promise<string[]>);
|
|
205
|
+
interface SlotValue {
|
|
206
|
+
date: Date;
|
|
207
|
+
time: string;
|
|
208
|
+
key: string;
|
|
209
|
+
value: string;
|
|
210
|
+
}
|
|
211
|
+
interface SlotPickerLabels {
|
|
212
|
+
placeholder?: string;
|
|
213
|
+
empty?: string;
|
|
214
|
+
loading?: string;
|
|
215
|
+
heading?: (date: Date) => string;
|
|
216
|
+
}
|
|
217
|
+
interface SlotPickerOptions {
|
|
218
|
+
/** Month shown first (and the selected day when `value` is not given). */
|
|
219
|
+
date?: DateInput;
|
|
220
|
+
/** Initial value: "2026-10-23T10:30" or { date, time }. */
|
|
221
|
+
value?: string | {
|
|
222
|
+
date: DateInput;
|
|
223
|
+
time: string;
|
|
224
|
+
} | null;
|
|
225
|
+
slots?: SlotSource;
|
|
226
|
+
min?: DateInput;
|
|
227
|
+
max?: DateInput;
|
|
228
|
+
/** Weekdays never available (0 = Sunday). */
|
|
229
|
+
closedDays?: number[];
|
|
230
|
+
isDisabled?: (date: Date) => boolean;
|
|
231
|
+
firstDay?: number;
|
|
232
|
+
locale?: string;
|
|
233
|
+
labels?: SlotPickerLabels;
|
|
234
|
+
onChange?: (value: SlotValue) => void;
|
|
235
|
+
onDateChange?: (date: Date) => void;
|
|
236
|
+
}
|
|
237
|
+
interface SlotPickerInstance extends Instance {
|
|
238
|
+
selectDate(date: DateInput): void;
|
|
239
|
+
selectTime(time: string | null): void;
|
|
240
|
+
setSlots(slots: SlotSource): void;
|
|
241
|
+
readonly date: Date | null;
|
|
242
|
+
readonly time: string | null;
|
|
243
|
+
readonly value: string | null;
|
|
244
|
+
}
|
|
245
|
+
declare function createSlotPicker(root: HTMLElement | null, options?: SlotPickerOptions): SlotPickerInstance;
|
|
246
|
+
|
|
247
|
+
interface TrailerOptions {
|
|
248
|
+
triggers?: boolean | string;
|
|
249
|
+
autoplay?: boolean;
|
|
250
|
+
closeOnBackdrop?: boolean;
|
|
251
|
+
onOpen?: () => void;
|
|
252
|
+
onClose?: () => void;
|
|
253
|
+
}
|
|
254
|
+
interface TrailerInstance extends Instance {
|
|
255
|
+
open(origin?: HTMLElement | null): void;
|
|
256
|
+
close(): void;
|
|
257
|
+
toggle(origin?: HTMLElement | null): void;
|
|
258
|
+
play(): Promise<boolean>;
|
|
259
|
+
pause(): void;
|
|
260
|
+
seek(seconds: number): void;
|
|
261
|
+
setVolume(volume: number): void;
|
|
262
|
+
readonly isOpen: boolean;
|
|
263
|
+
}
|
|
264
|
+
/** Native modal + consumer-owned video, with optional accessible custom transport controls. */
|
|
265
|
+
declare function createTrailer(root: HTMLElement | null, options?: TrailerOptions): TrailerInstance;
|
|
266
|
+
|
|
57
267
|
/**
|
|
58
|
-
* Every
|
|
268
|
+
* Every duration in one place (seconds, like GSAP, unless the name says
|
|
59
269
|
* ms). Recipes and components take their defaults from here, so a timing is
|
|
60
|
-
* changed once.
|
|
61
|
-
* and money/replication-catalog.json.
|
|
270
|
+
* changed once.
|
|
62
271
|
*/
|
|
63
272
|
declare const TIMING: Readonly<{
|
|
64
273
|
flow: 0.5;
|
|
@@ -204,12 +413,12 @@ declare const TIMING: Readonly<{
|
|
|
204
413
|
charsDelay: 0.225;
|
|
205
414
|
charsStagger: 0.02;
|
|
206
415
|
}>;
|
|
207
|
-
/**
|
|
416
|
+
/** glass (CSS): surface/shadow transitions, ring and shine. */
|
|
208
417
|
glass: Readonly<{
|
|
209
418
|
hover: 0.4;
|
|
210
419
|
ring: 0.5;
|
|
211
420
|
}>;
|
|
212
|
-
/**
|
|
421
|
+
/** utility animations (css/effects/anim.css), by name. */
|
|
213
422
|
effects: Readonly<{
|
|
214
423
|
out: 0.5;
|
|
215
424
|
'out-left': 0.5;
|
|
@@ -222,7 +431,7 @@ declare const TIMING: Readonly<{
|
|
|
222
431
|
wipe: 0.7;
|
|
223
432
|
'progress-in': 1;
|
|
224
433
|
}>;
|
|
225
|
-
/**
|
|
434
|
+
/** success confetti, per 60 fps frame. */
|
|
226
435
|
confetti: Readonly<{
|
|
227
436
|
count: 45;
|
|
228
437
|
speed: readonly [2, 8];
|
|
@@ -233,14 +442,14 @@ declare const TIMING: Readonly<{
|
|
|
233
442
|
drag: 0.98;
|
|
234
443
|
spin: 2.5;
|
|
235
444
|
}>;
|
|
236
|
-
/**
|
|
445
|
+
/** project sheet. */
|
|
237
446
|
sheet: Readonly<{
|
|
238
447
|
open: 0.72;
|
|
239
448
|
close: 0.72;
|
|
240
449
|
underlayScale: 0.98;
|
|
241
450
|
underlayOpacity: 0.4;
|
|
242
451
|
}>;
|
|
243
|
-
/**
|
|
452
|
+
/** Physical spring pairs: [stiffness, damping]. */
|
|
244
453
|
springs: Readonly<{
|
|
245
454
|
press: readonly [400, 10];
|
|
246
455
|
success: readonly [260, 18];
|
|
@@ -252,7 +461,7 @@ declare const TIMING: Readonly<{
|
|
|
252
461
|
bentoRepel: readonly [300, 25];
|
|
253
462
|
dockPill: readonly [380, 30];
|
|
254
463
|
}>;
|
|
255
|
-
/**
|
|
464
|
+
/** masked type. */
|
|
256
465
|
maskText: Readonly<{
|
|
257
466
|
duration: 1.2;
|
|
258
467
|
delay: 0.1;
|
|
@@ -261,14 +470,14 @@ declare const TIMING: Readonly<{
|
|
|
261
470
|
y: 100;
|
|
262
471
|
threshold: 0.8;
|
|
263
472
|
}>;
|
|
264
|
-
/**
|
|
473
|
+
/** reveal group (rules, fades, rises). */
|
|
265
474
|
cascade: Readonly<{
|
|
266
475
|
duration: 1.2;
|
|
267
476
|
step: 0.03;
|
|
268
477
|
rise: 200;
|
|
269
478
|
threshold: 0.3;
|
|
270
479
|
}>;
|
|
271
|
-
/**
|
|
480
|
+
/** slot title: each letter turns 8–14 times inside a 2 s expo.out envelope. */
|
|
272
481
|
textRoll: Readonly<{
|
|
273
482
|
duration: 2;
|
|
274
483
|
stagger: 0.04;
|
|
@@ -276,7 +485,7 @@ declare const TIMING: Readonly<{
|
|
|
276
485
|
interval: 6000;
|
|
277
486
|
quietMs: 1000;
|
|
278
487
|
}>;
|
|
279
|
-
/**
|
|
488
|
+
/** hero letters: scale on hover, pastel blink. */
|
|
280
489
|
letters: Readonly<{
|
|
281
490
|
scale: 1.3;
|
|
282
491
|
y: -5;
|
|
@@ -286,14 +495,14 @@ declare const TIMING: Readonly<{
|
|
|
286
495
|
blinkRepeatDelay: 0.1;
|
|
287
496
|
blinkDelays: readonly [0.1, 0.6, 0.2, 1, 0.4, 1.2, 0.15, 0.8, 0.3];
|
|
288
497
|
}>;
|
|
289
|
-
/**
|
|
498
|
+
/** image parallax. */
|
|
290
499
|
parallax: Readonly<{
|
|
291
500
|
travel: 10;
|
|
292
501
|
scale: 1.2;
|
|
293
502
|
strongScale: 1.3;
|
|
294
503
|
lerp: 1;
|
|
295
504
|
}>;
|
|
296
|
-
/**
|
|
505
|
+
/** About grid gathering from depth. */
|
|
297
506
|
depthGrid: Readonly<{
|
|
298
507
|
perspective: 600;
|
|
299
508
|
distance: 900;
|
|
@@ -304,7 +513,7 @@ declare const TIMING: Readonly<{
|
|
|
304
513
|
stagger: 0.15;
|
|
305
514
|
lerp: 1;
|
|
306
515
|
}>;
|
|
307
|
-
/**
|
|
516
|
+
/** video mask: the frame and the picture inside scale in opposite directions. */
|
|
308
517
|
frameZoom: Readonly<{
|
|
309
518
|
outer: readonly [80, 20];
|
|
310
519
|
inner: readonly [130, 20];
|
|
@@ -313,19 +522,19 @@ declare const TIMING: Readonly<{
|
|
|
313
522
|
open: 1;
|
|
314
523
|
lerp: 1;
|
|
315
524
|
}>;
|
|
316
|
-
/**
|
|
525
|
+
/** marquee: seconds per item, at most 14 counted. */
|
|
317
526
|
marquee: Readonly<{
|
|
318
527
|
perItem: 2;
|
|
319
528
|
maxItems: 14;
|
|
320
529
|
}>;
|
|
321
|
-
/**
|
|
530
|
+
/** glass chip and dot cursor. */
|
|
322
531
|
cursor: Readonly<{
|
|
323
532
|
gutter: 10;
|
|
324
533
|
circle: 96;
|
|
325
534
|
dotLerp: 0.2;
|
|
326
535
|
light: 180;
|
|
327
536
|
}>;
|
|
328
|
-
/**
|
|
537
|
+
/** floating navbar: enters from −300 % over 1.8 s; rows follow 0.15 s + 0.025 s each. */
|
|
329
538
|
island: Readonly<{
|
|
330
539
|
entrance: 1.8;
|
|
331
540
|
offset: -300;
|
|
@@ -333,18 +542,18 @@ declare const TIMING: Readonly<{
|
|
|
333
542
|
step: 0.025;
|
|
334
543
|
focus: 150;
|
|
335
544
|
}>;
|
|
336
|
-
/**
|
|
545
|
+
/** product dock: spread for 1.6 s on load; tablet range re-checked 250 ms after a resize. */
|
|
337
546
|
cardDock: Readonly<{
|
|
338
547
|
intro: 1600;
|
|
339
548
|
resizeDebounce: 250;
|
|
340
549
|
}>;
|
|
341
|
-
/**
|
|
550
|
+
/** phone cards: 5 s a card, 2 s wait after a touch, 0.5 s after it shows. */
|
|
342
551
|
snapStrip: Readonly<{
|
|
343
552
|
interval: 5000;
|
|
344
553
|
resume: 2000;
|
|
345
554
|
delay: 500;
|
|
346
555
|
}>;
|
|
347
|
-
/**
|
|
556
|
+
/** fill-text: letters from .2, 0.5 s each, 0.1 s apart, top 90 % → centre 40 %. */
|
|
348
557
|
fillText: Readonly<{
|
|
349
558
|
from: 0.2;
|
|
350
559
|
duration: 0.5;
|
|
@@ -352,7 +561,7 @@ declare const TIMING: Readonly<{
|
|
|
352
561
|
start: "top 90%";
|
|
353
562
|
end: "center 40%";
|
|
354
563
|
}>;
|
|
355
|
-
/**
|
|
564
|
+
/** particle hero: fade in 1 s after 0.3 s, morph cycles, pointer push. */
|
|
356
565
|
particleHero: Readonly<{
|
|
357
566
|
fadeIn: 1;
|
|
358
567
|
fadeDelay: 0.3;
|
|
@@ -413,4 +622,4 @@ interface RevealHandle {
|
|
|
413
622
|
}
|
|
414
623
|
declare function revealFrom(target: HTMLElement, options?: RevealOptions): RevealHandle | null;
|
|
415
624
|
|
|
416
|
-
export { type DialogInstance as D, type MenuInstance as M, type RevealHandle as R,
|
|
625
|
+
export { type RevealOptions as A, type RevealSpeed as B, type CalendarInstance as C, type DialogInstance as D, type SlotPickerLabels as E, type SlotPickerOptions as F, type SlotSource as G, type HoverCardInstance as H, type InputOtpInstance as I, type SlotValue as J, type StudioDockOptions as K, type StudioDockState as L, type MenuInstance as M, TIMING as N, type TrailerOptions as O, type PaginationInstance as P, type QuantityInstance as Q, type RevealHandle as R, type StudioDockInstance as S, type TrailerInstance as T, createDialog as U, createMenu as V, dayKey as W, revealFrom as X, toDate as Y, createTrailer as a, createQuantity as b, createStudioDock as c, createPagination as d, createHoverCard as e, createInputOtp as f, createCalendar as g, createSlotPicker as h, type StudioDockView as i, type SlotPickerInstance as j, type CalendarEvent as k, type CalendarEventStatus as l, type CalendarLabels as m, type CalendarOptions as n, type CalendarRange as o, type CalendarView as p, type DateInput as q, type DialogLabels as r, type DialogOptions as s, type DialogPlacement as t, type DialogVariant as u, type HoverCardOptions as v, type InputOtpOptions as w, type MenuOptions as x, type PaginationOptions as y, type QuantityOptions as z };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { I as Instance } from './types-BkS_raL8.js';
|
|
2
2
|
import { Flip } from 'gsap/Flip';
|
|
3
|
-
import { R as RevealHandle } from './reveal-
|
|
3
|
+
import { R as RevealHandle } from './reveal-jsX-uwUz.js';
|
|
4
4
|
|
|
5
5
|
interface ThemePickerOptions {
|
|
6
|
-
/** Theme ids to show, in order. Default:
|
|
6
|
+
/** Theme ids to show, in order. Default: visible presets, or all with showHidden. */
|
|
7
7
|
themes?: string[];
|
|
8
8
|
showHidden?: boolean;
|
|
9
9
|
labels?: {
|
|
@@ -68,7 +68,7 @@ type NavStyle = (typeof NAV_STYLES)[number];
|
|
|
68
68
|
interface NavOptions {
|
|
69
69
|
/** Default: the saved one (storageKey), else the mk-nav--<style> class in the markup, else 'bonita' (Money's default). */
|
|
70
70
|
style?: NavStyle;
|
|
71
|
-
/** The accent variant
|
|
71
|
+
/** The accent variant: the current page in primary-container. */
|
|
72
72
|
accent?: boolean;
|
|
73
73
|
/** Reveal the shell from the first button when the nav starts (off by default). */
|
|
74
74
|
reveal?: boolean;
|
|
@@ -95,7 +95,7 @@ interface NavigateDetail {
|
|
|
95
95
|
/** The click: call its preventDefault() to stop a link (single-page apps). */
|
|
96
96
|
originalEvent: MouseEvent;
|
|
97
97
|
}
|
|
98
|
-
/**
|
|
98
|
+
/** nav entrance: the app shell is uncovered from the nav's first button. */
|
|
99
99
|
declare function revealShell(nav: HTMLElement): RevealHandle | null;
|
|
100
100
|
declare function createNav(root: HTMLElement | null, options?: NavOptions): NavInstance;
|
|
101
101
|
|
|
@@ -125,7 +125,7 @@ declare function createCursor(host: HTMLElement | null, options?: CursorOptions)
|
|
|
125
125
|
interface IslandOptions {
|
|
126
126
|
/** Drop in from above on load (true), wait for ready() ('manual') or not at all. */
|
|
127
127
|
entrance?: boolean | 'manual';
|
|
128
|
-
/** Close when the page scrolls after a wheel or touch
|
|
128
|
+
/** Close when the page scrolls after a wheel or touch. */
|
|
129
129
|
closeOnScroll?: boolean;
|
|
130
130
|
/** Close when a link inside a panel is followed. */
|
|
131
131
|
closeOnNavigate?: boolean;
|
package/dist/theme/generate.d.ts
CHANGED
package/dist/theme/generate.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
themeCss
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-I3DXF2KQ.js";
|
|
4
4
|
import {
|
|
5
5
|
ROLES,
|
|
6
6
|
registerTheme,
|
|
7
7
|
setTheme
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-RVSKEBIC.js";
|
|
9
9
|
import "../chunk-TGV27ZWM.js";
|
|
10
10
|
|
|
11
11
|
// src/theme/generate.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/theme/generate.ts"],"sourcesContent":["import {\n Hct,\n MaterialDynamicColors,\n SchemeContent,\n SchemeExpressive,\n SchemeFidelity,\n SchemeMonochrome,\n SchemeNeutral,\n SchemeTonalSpot,\n SchemeVibrant,\n argbFromHex,\n hexFromArgb,\n} from '@material/material-color-utilities';\nimport { ROLES, type Role } from './presets';\nimport { themeCss, type Palette, type ThemePalettes } from './css-format';\nimport { registerTheme, setTheme } from './theme';\n\n/*\n * Material 3 palettes from any colour,
|
|
1
|
+
{"version":3,"sources":["../../src/theme/generate.ts"],"sourcesContent":["import {\n Hct,\n MaterialDynamicColors,\n SchemeContent,\n SchemeExpressive,\n SchemeFidelity,\n SchemeMonochrome,\n SchemeNeutral,\n SchemeTonalSpot,\n SchemeVibrant,\n argbFromHex,\n hexFromArgb,\n} from '@material/material-color-utilities';\nimport { ROLES, type Role } from './presets';\nimport { themeCss, type Palette, type ThemePalettes } from './css-format';\nimport { registerTheme, setTheme } from './theme';\n\n/*\n * Material 3 palettes from any colour, with the 37 theme color roles.\n * Needs the optional peer @material/material-color-utilities ^0.3.0\n * (0.4.0 publishes ESM imports without extensions that Node cannot load).\n */\n\nexport type ThemeVariant = 'tonal-spot' | 'vibrant' | 'expressive' | 'neutral' | 'content' | 'fidelity' | 'monochrome';\n\nexport interface GenerateOptions {\n variant?: ThemeVariant;\n /** -1 (reduced) … 0 (standard) … 1 (high). */\n contrast?: number;\n}\n\nconst SCHEMES = {\n 'tonal-spot': SchemeTonalSpot,\n vibrant: SchemeVibrant,\n expressive: SchemeExpressive,\n neutral: SchemeNeutral,\n content: SchemeContent,\n fidelity: SchemeFidelity,\n monochrome: SchemeMonochrome,\n} as const;\n\nconst camel = (role: string) => role.replace(/-([a-z])/g, (_, c: string) => c.toUpperCase());\ntype Dynamic = { getArgb(scheme: unknown): number };\n\nexport function generateTheme(seed: string, { variant = 'tonal-spot', contrast = 0 }: GenerateOptions = {}): ThemePalettes {\n if (!/^#?[0-9a-f]{6}$/i.test(seed)) throw new Error(`generateTheme: seed must be a #rrggbb colour (got \"${seed}\")`);\n const Scheme = SCHEMES[variant];\n if (!Scheme) throw new Error(`generateTheme: unknown variant \"${variant}\"`);\n const source = Hct.fromInt(argbFromHex(seed.startsWith('#') ? seed : `#${seed}`));\n const palette = (dark: boolean): Palette => {\n const scheme = new Scheme(source, dark, contrast);\n const colors = MaterialDynamicColors as unknown as Record<string, Dynamic>;\n return Object.fromEntries(ROLES.map((role) => [role, hexFromArgb(colors[camel(role)].getArgb(scheme))])) as Record<Role, string>;\n };\n return { light: palette(false), dark: palette(true) };\n}\n\nexport { themeCss };\n\n/** Generate a theme from `seed`, inject it as a <style>, register and select it. */\nexport function applyTheme(seed: string, { id = 'custom', ...options }: GenerateOptions & { id?: string } = {}) {\n const css = themeCss(id, generateTheme(seed, options));\n let style = document.querySelector<HTMLStyleElement>(`style[data-mk-theme-style=\"${id}\"]`);\n if (!style) {\n style = document.createElement('style');\n style.dataset.mkThemeStyle = id;\n document.head.append(style);\n }\n style.textContent = css;\n registerTheme(id);\n return setTheme(id);\n}\n"],"mappings":";;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAmBP,IAAM,UAAU;AAAA,EACd,cAAc;AAAA,EACd,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA,EACV,YAAY;AACd;AAEA,IAAM,QAAQ,CAAC,SAAiB,KAAK,QAAQ,aAAa,CAAC,GAAG,MAAc,EAAE,YAAY,CAAC;AAGpF,SAAS,cAAc,MAAc,EAAE,UAAU,cAAc,WAAW,EAAE,IAAqB,CAAC,GAAkB;AACzH,MAAI,CAAC,mBAAmB,KAAK,IAAI,EAAG,OAAM,IAAI,MAAM,sDAAsD,IAAI,IAAI;AAClH,QAAM,SAAS,QAAQ,OAAO;AAC9B,MAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,mCAAmC,OAAO,GAAG;AAC1E,QAAM,SAAS,IAAI,QAAQ,YAAY,KAAK,WAAW,GAAG,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;AAChF,QAAM,UAAU,CAAC,SAA2B;AAC1C,UAAM,SAAS,IAAI,OAAO,QAAQ,MAAM,QAAQ;AAChD,UAAM,SAAS;AACf,WAAO,OAAO,YAAY,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,YAAY,OAAO,MAAM,IAAI,CAAC,EAAE,QAAQ,MAAM,CAAC,CAAC,CAAC,CAAC;AAAA,EACzG;AACA,SAAO,EAAE,OAAO,QAAQ,KAAK,GAAG,MAAM,QAAQ,IAAI,EAAE;AACtD;AAKO,SAAS,WAAW,MAAc,EAAE,KAAK,UAAU,GAAG,QAAQ,IAAuC,CAAC,GAAG;AAC9G,QAAM,MAAM,SAAS,IAAI,cAAc,MAAM,OAAO,CAAC;AACrD,MAAI,QAAQ,SAAS,cAAgC,8BAA8B,EAAE,IAAI;AACzF,MAAI,CAAC,OAAO;AACV,YAAQ,SAAS,cAAc,OAAO;AACtC,UAAM,QAAQ,eAAe;AAC7B,aAAS,KAAK,OAAO,KAAK;AAAA,EAC5B;AACA,QAAM,cAAc;AACpB,gBAAc,EAAE;AAChB,SAAO,SAAS,EAAE;AACpB;","names":[]}
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as Role } from '../theme-
|
|
2
|
-
export { D as DEFAULT_THEME, I as InitThemeOptions, M as MK_THEME_HEAD_SCRIPT, c as ROLES, d as THEMES, e as THEME_EVENT, f as ThemeId, b as ThemeMode, g as ThemePreset, T as ThemeState, h as getTheme, i as initTheme, r as registerTheme, a as setMode, s as setTheme, t as themeHeadScript } from '../theme-
|
|
1
|
+
import { R as Role } from '../theme-Bjf9qIIy.js';
|
|
2
|
+
export { D as DEFAULT_THEME, I as InitThemeOptions, M as MK_THEME_HEAD_SCRIPT, c as ROLES, d as THEMES, e as THEME_EVENT, f as ThemeId, b as ThemeMode, g as ThemePreset, T as ThemeState, h as getTheme, i as initTheme, r as registerTheme, a as setMode, s as setTheme, t as themeHeadScript } from '../theme-Bjf9qIIy.js';
|
|
3
3
|
|
|
4
4
|
type Palette = Record<Role, string>;
|
|
5
5
|
interface ThemePalettes {
|
package/dist/theme/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
themeCss
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-I3DXF2KQ.js";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_THEME,
|
|
6
6
|
MK_THEME_HEAD_SCRIPT,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
setMode,
|
|
14
14
|
setTheme,
|
|
15
15
|
themeHeadScript
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-RVSKEBIC.js";
|
|
17
17
|
import "../chunk-TGV27ZWM.js";
|
|
18
18
|
export {
|
|
19
19
|
DEFAULT_THEME,
|
|
@@ -4,7 +4,7 @@ type Role = (typeof ROLES)[number];
|
|
|
4
4
|
interface ThemePreset {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly name: string;
|
|
7
|
-
/** Hidden from
|
|
7
|
+
/** Hidden from the picker unless showHidden is enabled. */
|
|
8
8
|
readonly hidden: boolean;
|
|
9
9
|
/** Modes with their own palette. OLED is dark-only and uses Black in light mode. */
|
|
10
10
|
readonly modes: readonly ('light' | 'dark')[];
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yewdiel21/motion-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Motion toolkit for vanilla, Astro and React: GSAP recipes, accessible components, 19 themes, CSS controls and optional WebGL effects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://motion-kit-playground.vercel.app",
|
|
8
8
|
"bugs": {
|
|
9
9
|
"url": "https://github.com/YewdielMartinez/motion-kit/issues"
|
|
10
10
|
},
|