@yewdiel21/motion-kit 0.0.0-stage → 0.9.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 +38 -0
- package/README.md +80 -2
- package/bin/motion-kit.mjs +242 -0
- package/css.d.ts +2 -0
- package/dist/auto/index.d.ts +63 -0
- package/dist/auto/index.js +207 -0
- package/dist/auto/index.js.map +1 -0
- package/dist/chunk-2BQGFOA7.js +177 -0
- package/dist/chunk-2BQGFOA7.js.map +1 -0
- package/dist/chunk-34XYOXHG.js +2374 -0
- package/dist/chunk-34XYOXHG.js.map +1 -0
- package/dist/chunk-6OJAP6ZL.js +832 -0
- package/dist/chunk-6OJAP6ZL.js.map +1 -0
- package/dist/chunk-ABNRDDO7.js +28 -0
- package/dist/chunk-ABNRDDO7.js.map +1 -0
- package/dist/chunk-FS2HJVVY.js +3320 -0
- package/dist/chunk-FS2HJVVY.js.map +1 -0
- package/dist/chunk-J27KH2A2.js +157 -0
- package/dist/chunk-J27KH2A2.js.map +1 -0
- package/dist/chunk-KLY5BRRI.js +18 -0
- package/dist/chunk-KLY5BRRI.js.map +1 -0
- package/dist/chunk-Q4LVFNLN.js +1617 -0
- package/dist/chunk-Q4LVFNLN.js.map +1 -0
- package/dist/chunk-RFDIZYFX.js +304 -0
- package/dist/chunk-RFDIZYFX.js.map +1 -0
- package/dist/chunk-TGV27ZWM.js +17 -0
- package/dist/chunk-TGV27ZWM.js.map +1 -0
- package/dist/confetti-BSX1CLLV.d.ts +41 -0
- package/dist/css/components/chat-background.css +87 -0
- package/dist/css/components/chat.css +237 -0
- package/dist/css/components/cursor.css +178 -0
- package/dist/css/components/dialog.css +259 -0
- package/dist/css/components/island.css +301 -0
- package/dist/css/components/menu.css +105 -0
- package/dist/css/components/nav.css +1054 -0
- package/dist/css/components/steps.css +50 -0
- package/dist/css/components/theme-picker.css +115 -0
- package/dist/css/components/toast.css +115 -0
- package/dist/css/controls.css +950 -0
- package/dist/css/effects.css +587 -0
- package/dist/css/fonts.css +3 -0
- package/dist/css/themes/black-green.css +126 -0
- package/dist/css/themes/black.css +126 -0
- package/dist/css/themes/blue.css +126 -0
- package/dist/css/themes/brown.css +126 -0
- package/dist/css/themes/cold-blue.css +126 -0
- package/dist/css/themes/funny.css +126 -0
- package/dist/css/themes/gray.css +126 -0
- package/dist/css/themes/green.css +126 -0
- package/dist/css/themes/modern-1.css +126 -0
- package/dist/css/themes/neogreen.css +126 -0
- package/dist/css/themes/new.css +126 -0
- package/dist/css/themes/new2.css +126 -0
- package/dist/css/themes/oled.css +126 -0
- package/dist/css/themes/orange.css +126 -0
- package/dist/css/themes/pastel-pink.css +126 -0
- package/dist/css/themes/pink.css +126 -0
- package/dist/css/themes/purple.css +126 -0
- package/dist/css/themes/red.css +126 -0
- package/dist/css/themes/super-blue.css +126 -0
- package/dist/css/themes.css +2431 -0
- package/dist/css/tokens.css +452 -0
- package/dist/elements/index.d.ts +183 -0
- package/dist/elements/index.js +472 -0
- package/dist/elements/index.js.map +1 -0
- package/dist/engine-CUr9QijM.d.ts +46 -0
- package/dist/gl/index.d.ts +61 -0
- package/dist/gl/index.js +18 -0
- package/dist/gl/index.js.map +1 -0
- package/dist/index.css +5296 -0
- package/dist/index.d.ts +440 -0
- package/dist/index.js +390 -0
- package/dist/index.js.map +1 -0
- package/dist/react/index.d.ts +476 -0
- package/dist/react/index.js +969 -0
- package/dist/react/index.js.map +1 -0
- package/dist/reduced-BM4Ls0g5.d.ts +566 -0
- package/dist/reveal-WFUWDrei.d.ts +416 -0
- package/dist/store-Bqy_obnD.d.ts +195 -0
- package/dist/theme/generate.d.ts +18 -0
- package/dist/theme/generate.js +64 -0
- package/dist/theme/generate.js.map +1 -0
- package/dist/theme/index.d.ts +17 -0
- package/dist/theme/index.js +32 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme-BFMoCzi6.d.ts +158 -0
- package/dist/types-BkS_raL8.d.ts +7 -0
- package/package.json +114 -3
- package/registry.json +469 -0
- package/skills/motion-kit/SKILL.md +189 -0
- package/skills/motion-kit/reference/components.md +86 -0
- package/skills/motion-kit/reference/design.md +92 -0
- package/skills/motion-kit/reference/recipes.md +172 -0
- package/src/auto/auto-init.ts +151 -0
- package/src/auto/index.ts +3 -0
- package/src/auto/parse-options.ts +68 -0
- package/src/components/chat/README.md +90 -0
- package/src/components/chat/chat.css +236 -0
- package/src/components/chat/element.ts +98 -0
- package/src/components/chat/engine.ts +295 -0
- package/src/components/chat/react.tsx +196 -0
- package/src/components/chat-background/README.md +50 -0
- package/src/components/chat-background/audio.ts +56 -0
- package/src/components/chat-background/chat-background.css +86 -0
- package/src/components/chat-background/element.ts +31 -0
- package/src/components/chat-background/engine.ts +108 -0
- package/src/components/chat-background/react.tsx +36 -0
- package/src/components/cursor/README.md +53 -0
- package/src/components/cursor/cursor.css +177 -0
- package/src/components/cursor/element.ts +23 -0
- package/src/components/cursor/engine.ts +254 -0
- package/src/components/cursor/react.tsx +26 -0
- package/src/components/dialog/README.md +106 -0
- package/src/components/dialog/dialog.css +258 -0
- package/src/components/dialog/element.ts +118 -0
- package/src/components/dialog/engine.ts +432 -0
- package/src/components/dialog/react.tsx +200 -0
- package/src/components/icon.tsx +10 -0
- package/src/components/icons.ts +24 -0
- package/src/components/island/README.md +91 -0
- package/src/components/island/element.ts +45 -0
- package/src/components/island/engine.ts +200 -0
- package/src/components/island/island.css +300 -0
- package/src/components/island/react.tsx +115 -0
- package/src/components/menu/README.md +67 -0
- package/src/components/menu/element.ts +55 -0
- package/src/components/menu/engine.ts +142 -0
- package/src/components/menu/menu.css +104 -0
- package/src/components/menu/react.tsx +82 -0
- package/src/components/nav/README.md +85 -0
- package/src/components/nav/element.ts +39 -0
- package/src/components/nav/engine.ts +164 -0
- package/src/components/nav/nav.css +1053 -0
- package/src/components/nav/react.tsx +90 -0
- package/src/components/steps/README.md +70 -0
- package/src/components/steps/element.ts +43 -0
- package/src/components/steps/engine.ts +185 -0
- package/src/components/steps/react.tsx +91 -0
- package/src/components/steps/steps.css +49 -0
- package/src/components/theme-picker/README.md +57 -0
- package/src/components/theme-picker/element.ts +20 -0
- package/src/components/theme-picker/engine.ts +91 -0
- package/src/components/theme-picker/react.tsx +31 -0
- package/src/components/theme-picker/theme-picker.css +114 -0
- package/src/components/toast/README.md +60 -0
- package/src/components/toast/element.ts +25 -0
- package/src/components/toast/engine.ts +483 -0
- package/src/components/toast/react.tsx +22 -0
- package/src/components/toast/store.ts +122 -0
- package/src/components/toast/toast.css +114 -0
- package/src/core/channels.ts +165 -0
- package/src/core/curves.ts +35 -0
- package/src/core/frame.ts +12 -0
- package/src/core/gsap.ts +65 -0
- package/src/core/loop.ts +44 -0
- package/src/core/math.ts +9 -0
- package/src/core/physics-spring.ts +59 -0
- package/src/core/pointer.ts +63 -0
- package/src/core/reduced.ts +21 -0
- package/src/core/scope.ts +70 -0
- package/src/core/scroll-track.ts +106 -0
- package/src/core/split.ts +68 -0
- package/src/core/spring.ts +22 -0
- package/src/core/styles.ts +31 -0
- package/src/core/timing.ts +204 -0
- package/src/core/types.ts +20 -0
- package/src/core/visible.ts +19 -0
- package/src/css/base.css +142 -0
- package/src/css/controls/README.md +122 -0
- package/src/css/controls/burger.css +67 -0
- package/src/css/controls/button.css +226 -0
- package/src/css/controls/checkbox.css +53 -0
- package/src/css/controls/chip.css +85 -0
- package/src/css/controls/field.css +124 -0
- package/src/css/controls/glass.css +220 -0
- package/src/css/controls/icon.css +26 -0
- package/src/css/controls/segmented.css +60 -0
- package/src/css/controls/switch.css +72 -0
- package/src/css/default-theme.css +123 -0
- package/src/css/effects/README.md +134 -0
- package/src/css/effects/anim.css +224 -0
- package/src/css/effects/fade.css +15 -0
- package/src/css/effects/float.css +64 -0
- package/src/css/effects/frost.css +62 -0
- package/src/css/effects/grain.css +58 -0
- package/src/css/effects/loading.css +60 -0
- package/src/css/effects/success.css +22 -0
- package/src/css/effects/text.css +67 -0
- package/src/css/fonts.css +3 -0
- package/src/css/states.css +51 -0
- package/src/css/themes/black-green.css +126 -0
- package/src/css/themes/black.css +126 -0
- package/src/css/themes/blue.css +126 -0
- package/src/css/themes/brown.css +126 -0
- package/src/css/themes/cold-blue.css +126 -0
- package/src/css/themes/funny.css +126 -0
- package/src/css/themes/gray.css +126 -0
- package/src/css/themes/green.css +126 -0
- package/src/css/themes/modern-1.css +126 -0
- package/src/css/themes/neogreen.css +126 -0
- package/src/css/themes/new.css +126 -0
- package/src/css/themes/new2.css +126 -0
- package/src/css/themes/oled.css +126 -0
- package/src/css/themes/orange.css +126 -0
- package/src/css/themes/pastel-pink.css +126 -0
- package/src/css/themes/pink.css +126 -0
- package/src/css/themes/purple.css +126 -0
- package/src/css/themes/red.css +126 -0
- package/src/css/themes/super-blue.css +126 -0
- package/src/css/tokens.css +182 -0
- package/src/elements/base.ts +76 -0
- package/src/elements/index.ts +48 -0
- package/src/gl/index.ts +15 -0
- package/src/gl/liquid-blend/README.md +23 -0
- package/src/gl/liquid-blend/create-liquid-blend.ts +7 -0
- package/src/gl/liquid-blend/shader.ts +9 -0
- package/src/gl/matcap/README.md +23 -0
- package/src/gl/matcap/create-matcap.ts +7 -0
- package/src/gl/matcap/shader.ts +16 -0
- package/src/gl/particle-hero/README.md +41 -0
- package/src/gl/particle-hero/create-particle-hero.ts +544 -0
- package/src/gl/particle-hero/particle-hero.css +19 -0
- package/src/gl/particle-hero/shaders.ts +84 -0
- package/src/gl/shader-blur/README.md +23 -0
- package/src/gl/shader-blur/create-shader-blur.ts +7 -0
- package/src/gl/shader-blur/shader.ts +11 -0
- package/src/gl/shader-grain/README.md +23 -0
- package/src/gl/shader-grain/create-shader-grain.ts +7 -0
- package/src/gl/shader-grain/shader.ts +6 -0
- package/src/gl/shared/create-shader-effect.ts +186 -0
- package/src/gl/shared/shader.css +3 -0
- package/src/gl/shared/shaders.ts +30 -0
- package/src/index.ts +177 -0
- package/src/motion/anchor.ts +45 -0
- package/src/motion/chat.ts +97 -0
- package/src/motion/confetti.ts +130 -0
- package/src/motion/count.ts +95 -0
- package/src/motion/details.ts +70 -0
- package/src/motion/drag-dismiss.ts +231 -0
- package/src/motion/effects.ts +81 -0
- package/src/motion/entrances.ts +27 -0
- package/src/motion/floating.ts +389 -0
- package/src/motion/flow.ts +115 -0
- package/src/motion/indicator.ts +44 -0
- package/src/motion/layout.ts +39 -0
- package/src/motion/liquid.ts +227 -0
- package/src/motion/morph.ts +540 -0
- package/src/motion/reveal.ts +112 -0
- package/src/motion/sheet.ts +65 -0
- package/src/motion/surface.ts +108 -0
- package/src/react/animated-number.tsx +30 -0
- package/src/react/flip-group.tsx +44 -0
- package/src/react/frost.tsx +33 -0
- package/src/react/index.ts +80 -0
- package/src/react/slot-text.tsx +44 -0
- package/src/react/theme-provider.tsx +42 -0
- package/src/react/use-card-dock.ts +9 -0
- package/src/react/use-cascade.ts +9 -0
- package/src/react/use-contrast.ts +9 -0
- package/src/react/use-counter.ts +8 -0
- package/src/react/use-curved-carousel.ts +10 -0
- package/src/react/use-depth-grid.ts +9 -0
- package/src/react/use-details.ts +7 -0
- package/src/react/use-dock-pill.ts +10 -0
- package/src/react/use-drag-ruler.ts +10 -0
- package/src/react/use-fill-text.ts +9 -0
- package/src/react/use-fit-text.ts +8 -0
- package/src/react/use-flow.ts +8 -0
- package/src/react/use-frame-zoom.ts +9 -0
- package/src/react/use-infinite-reel.ts +8 -0
- package/src/react/use-letters.ts +9 -0
- package/src/react/use-liquid-blend.ts +8 -0
- package/src/react/use-marquee.ts +9 -0
- package/src/react/use-mask-text.ts +9 -0
- package/src/react/use-matcap.ts +8 -0
- package/src/react/use-parallax.ts +9 -0
- package/src/react/use-particle-hero.ts +9 -0
- package/src/react/use-pile.ts +8 -0
- package/src/react/use-pop.ts +8 -0
- package/src/react/use-radial-menu.ts +10 -0
- package/src/react/use-recipe.ts +38 -0
- package/src/react/use-reflow.ts +9 -0
- package/src/react/use-repel-bento.ts +8 -0
- package/src/react/use-reveal.ts +8 -0
- package/src/react/use-rotator.ts +10 -0
- package/src/react/use-shader-blur.ts +8 -0
- package/src/react/use-shader-grain.ts +8 -0
- package/src/react/use-slot-text.ts +17 -0
- package/src/react/use-snap-strip.ts +9 -0
- package/src/react/use-sortable.ts +14 -0
- package/src/react/use-spring-cards.ts +8 -0
- package/src/react/use-stretch-footer.ts +20 -0
- package/src/react/use-tabs.ts +10 -0
- package/src/react/use-text-roll.ts +9 -0
- package/src/react/use-ticket-menu.ts +15 -0
- package/src/react/use-words.ts +8 -0
- package/src/recipes/card-dock/README.md +36 -0
- package/src/recipes/card-dock/card-dock.css +178 -0
- package/src/recipes/card-dock/create-card-dock.ts +97 -0
- package/src/recipes/cascade/README.md +33 -0
- package/src/recipes/cascade/create-cascade.ts +111 -0
- package/src/recipes/contrast/README.md +29 -0
- package/src/recipes/contrast/create-contrast.ts +68 -0
- package/src/recipes/counter/README.md +42 -0
- package/src/recipes/counter/create-counter.ts +84 -0
- package/src/recipes/curved-carousel/README.md +50 -0
- package/src/recipes/curved-carousel/carousel-math.ts +20 -0
- package/src/recipes/curved-carousel/create-curved-carousel.ts +257 -0
- package/src/recipes/curved-carousel/curved-carousel.css +50 -0
- package/src/recipes/depth-grid/README.md +30 -0
- package/src/recipes/depth-grid/create-depth-grid.ts +120 -0
- package/src/recipes/details/README.md +31 -0
- package/src/recipes/details/create-details.ts +27 -0
- package/src/recipes/dock-pill/README.md +23 -0
- package/src/recipes/dock-pill/create-dock-pill.ts +68 -0
- package/src/recipes/dock-pill/dock-pill.css +5 -0
- package/src/recipes/drag-ruler/README.md +21 -0
- package/src/recipes/drag-ruler/create-drag-ruler.ts +95 -0
- package/src/recipes/drag-ruler/drag-ruler.css +16 -0
- package/src/recipes/fill-text/README.md +27 -0
- package/src/recipes/fill-text/create-fill-text.ts +93 -0
- package/src/recipes/fit-text/README.md +37 -0
- package/src/recipes/fit-text/create-fit-text.ts +55 -0
- package/src/recipes/fit-text/fit-text.css +6 -0
- package/src/recipes/flow/README.md +46 -0
- package/src/recipes/flow/create-flow.ts +55 -0
- package/src/recipes/frame-zoom/README.md +29 -0
- package/src/recipes/frame-zoom/create-frame-zoom.ts +91 -0
- package/src/recipes/infinite-reel/README.md +23 -0
- package/src/recipes/infinite-reel/create-infinite-reel.ts +140 -0
- package/src/recipes/infinite-reel/infinite-reel.css +8 -0
- package/src/recipes/letters/README.md +30 -0
- package/src/recipes/letters/create-letters.ts +113 -0
- package/src/recipes/marquee/README.md +32 -0
- package/src/recipes/marquee/create-marquee.ts +74 -0
- package/src/recipes/marquee/marquee.css +41 -0
- package/src/recipes/mask-text/README.md +39 -0
- package/src/recipes/mask-text/create-mask-text.ts +134 -0
- package/src/recipes/parallax/README.md +31 -0
- package/src/recipes/parallax/create-parallax.ts +74 -0
- package/src/recipes/pile/README.md +48 -0
- package/src/recipes/pile/create-pile.ts +50 -0
- package/src/recipes/pile/pile-math.ts +27 -0
- package/src/recipes/pile/pile.css +63 -0
- package/src/recipes/pill/README.md +30 -0
- package/src/recipes/pill/pill.css +48 -0
- package/src/recipes/pop/README.md +36 -0
- package/src/recipes/pop/create-pop.ts +52 -0
- package/src/recipes/radial-menu/README.md +44 -0
- package/src/recipes/radial-menu/create-radial-menu.ts +96 -0
- package/src/recipes/radial-menu/radial-menu.css +45 -0
- package/src/recipes/reflow/README.md +47 -0
- package/src/recipes/reflow/create-reflow.ts +49 -0
- package/src/recipes/repel-bento/README.md +21 -0
- package/src/recipes/repel-bento/create-repel-bento.ts +65 -0
- package/src/recipes/repel-bento/repel-bento.css +3 -0
- package/src/recipes/reveal/README.md +36 -0
- package/src/recipes/reveal/create-reveal.ts +48 -0
- package/src/recipes/rotator/README.md +21 -0
- package/src/recipes/rotator/create-rotator.ts +66 -0
- package/src/recipes/rotator/rotator.css +3 -0
- package/src/recipes/slot-text/README.md +44 -0
- package/src/recipes/slot-text/create-slot-text.ts +244 -0
- package/src/recipes/slot-text/slot-text.css +42 -0
- package/src/recipes/snap-strip/README.md +31 -0
- package/src/recipes/snap-strip/create-snap-strip.ts +133 -0
- package/src/recipes/snap-strip/snap-strip.css +23 -0
- package/src/recipes/sortable/README.md +88 -0
- package/src/recipes/sortable/create-sortable.ts +863 -0
- package/src/recipes/sortable/sortable.css +40 -0
- package/src/recipes/spring-cards/README.md +48 -0
- package/src/recipes/spring-cards/create-spring-cards.ts +140 -0
- package/src/recipes/spring-cards/spring-cards.css +23 -0
- package/src/recipes/stretch-footer/README.md +44 -0
- package/src/recipes/stretch-footer/create-stretch-footer.ts +69 -0
- package/src/recipes/stretch-footer/stretch-footer.css +28 -0
- package/src/recipes/tabs/README.md +39 -0
- package/src/recipes/tabs/create-tabs.ts +91 -0
- package/src/recipes/tabs/tabs.css +19 -0
- package/src/recipes/text-roll/README.md +35 -0
- package/src/recipes/text-roll/create-text-roll.ts +137 -0
- package/src/recipes/text-roll/text-roll.css +21 -0
- package/src/recipes/ticket-menu/README.md +24 -0
- package/src/recipes/ticket-menu/create-ticket-menu.ts +6 -0
- package/src/recipes/words/README.md +43 -0
- package/src/recipes/words/create-words.ts +114 -0
- package/src/theme/css-format.ts +32 -0
- package/src/theme/generate.ts +72 -0
- package/src/theme/index.ts +15 -0
- package/src/theme/presets.ts +79 -0
- package/src/theme/theme.ts +119 -0
|
@@ -0,0 +1,969 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ANIMATIONS,
|
|
4
|
+
animate,
|
|
5
|
+
confetti,
|
|
6
|
+
leave
|
|
7
|
+
} from "../chunk-2BQGFOA7.js";
|
|
8
|
+
import {
|
|
9
|
+
captureLayout,
|
|
10
|
+
createCardDock,
|
|
11
|
+
createCascade,
|
|
12
|
+
createContrast,
|
|
13
|
+
createCounter,
|
|
14
|
+
createCurvedCarousel,
|
|
15
|
+
createDepthGrid,
|
|
16
|
+
createDetails,
|
|
17
|
+
createDockPill,
|
|
18
|
+
createDragRuler,
|
|
19
|
+
createFillText,
|
|
20
|
+
createFitText,
|
|
21
|
+
createFlow,
|
|
22
|
+
createFrameZoom,
|
|
23
|
+
createInfiniteReel,
|
|
24
|
+
createLetters,
|
|
25
|
+
createMarquee,
|
|
26
|
+
createMaskText,
|
|
27
|
+
createParallax,
|
|
28
|
+
createPile,
|
|
29
|
+
createPop,
|
|
30
|
+
createRadialMenu,
|
|
31
|
+
createReflow,
|
|
32
|
+
createRepelBento,
|
|
33
|
+
createReveal,
|
|
34
|
+
createRotator,
|
|
35
|
+
createSlotText,
|
|
36
|
+
createSnapStrip,
|
|
37
|
+
createSortable,
|
|
38
|
+
createSpringCards,
|
|
39
|
+
createStretchFooter,
|
|
40
|
+
createTabs,
|
|
41
|
+
createTextRoll,
|
|
42
|
+
createTicketMenu,
|
|
43
|
+
createWords,
|
|
44
|
+
moveItem,
|
|
45
|
+
pileLayers,
|
|
46
|
+
pileStyle,
|
|
47
|
+
reflowLayout
|
|
48
|
+
} from "../chunk-FS2HJVVY.js";
|
|
49
|
+
import {
|
|
50
|
+
ICON_PATHS,
|
|
51
|
+
NAV_STYLES,
|
|
52
|
+
PENDING_ID,
|
|
53
|
+
capturePending,
|
|
54
|
+
clearToasts,
|
|
55
|
+
createChat,
|
|
56
|
+
createChatBackground,
|
|
57
|
+
createCursor,
|
|
58
|
+
createIsland,
|
|
59
|
+
createSteps,
|
|
60
|
+
createThemePicker,
|
|
61
|
+
createToaster,
|
|
62
|
+
dismissToast,
|
|
63
|
+
morphPendingToReply,
|
|
64
|
+
revealShell,
|
|
65
|
+
toast
|
|
66
|
+
} from "../chunk-Q4LVFNLN.js";
|
|
67
|
+
import {
|
|
68
|
+
createDialog,
|
|
69
|
+
createMenu,
|
|
70
|
+
tweenNumber
|
|
71
|
+
} from "../chunk-34XYOXHG.js";
|
|
72
|
+
import {
|
|
73
|
+
DEFAULT_THEME,
|
|
74
|
+
MK_THEME_HEAD_SCRIPT,
|
|
75
|
+
THEME_EVENT,
|
|
76
|
+
initTheme,
|
|
77
|
+
setMode,
|
|
78
|
+
setTheme,
|
|
79
|
+
themeHeadScript
|
|
80
|
+
} from "../chunk-J27KH2A2.js";
|
|
81
|
+
import {
|
|
82
|
+
createLiquidBlend,
|
|
83
|
+
createMatcap,
|
|
84
|
+
createParticleHero,
|
|
85
|
+
createShaderBlur,
|
|
86
|
+
createShaderGrain
|
|
87
|
+
} from "../chunk-6OJAP6ZL.js";
|
|
88
|
+
import "../chunk-KLY5BRRI.js";
|
|
89
|
+
import {
|
|
90
|
+
MK_HEAD_SCRIPT,
|
|
91
|
+
TIMING
|
|
92
|
+
} from "../chunk-RFDIZYFX.js";
|
|
93
|
+
import "../chunk-TGV27ZWM.js";
|
|
94
|
+
|
|
95
|
+
// src/react/use-recipe.ts
|
|
96
|
+
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
97
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
98
|
+
function useRecipe(ref, factory, options, deps = []) {
|
|
99
|
+
const instance = useRef(null);
|
|
100
|
+
useIsomorphicLayoutEffect(() => {
|
|
101
|
+
const created = factory(ref.current, options);
|
|
102
|
+
instance.current = created;
|
|
103
|
+
return () => {
|
|
104
|
+
created.destroy();
|
|
105
|
+
instance.current = null;
|
|
106
|
+
};
|
|
107
|
+
}, deps);
|
|
108
|
+
return instance;
|
|
109
|
+
}
|
|
110
|
+
function useLatest(value) {
|
|
111
|
+
const ref = useRef(value);
|
|
112
|
+
ref.current = value;
|
|
113
|
+
return ref;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// src/react/use-spring-cards.ts
|
|
117
|
+
var useSpringCards = (ref, options, deps) => useRecipe(ref, createSpringCards, options, deps);
|
|
118
|
+
|
|
119
|
+
// src/react/use-curved-carousel.ts
|
|
120
|
+
function useCurvedCarousel(ref, options = {}, deps) {
|
|
121
|
+
const onSelect = useLatest(options.onSelect);
|
|
122
|
+
return useRecipe(ref, createCurvedCarousel, { ...options, onSelect: (index, slide) => onSelect.current?.(index, slide) }, deps);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// src/react/use-pile.ts
|
|
126
|
+
var usePile = (ref, options, deps) => useRecipe(ref, createPile, options, deps);
|
|
127
|
+
|
|
128
|
+
// src/react/use-words.ts
|
|
129
|
+
var useWords = (ref, options, deps) => useRecipe(ref, createWords, options, deps);
|
|
130
|
+
|
|
131
|
+
// src/react/use-flow.ts
|
|
132
|
+
var useFlow = (ref, options, deps) => useRecipe(ref, createFlow, options, deps);
|
|
133
|
+
|
|
134
|
+
// src/react/use-pop.ts
|
|
135
|
+
var usePop = (ref, options, deps) => useRecipe(ref, createPop, options, deps);
|
|
136
|
+
|
|
137
|
+
// src/react/use-fit-text.ts
|
|
138
|
+
var useFitText = (ref, options, deps) => useRecipe(ref, createFitText, options, deps);
|
|
139
|
+
|
|
140
|
+
// src/react/use-stretch-footer.ts
|
|
141
|
+
function useStretchFooter(ref, options = {}, deps) {
|
|
142
|
+
const { phantomRef, titleRef, ...rest } = options;
|
|
143
|
+
return useRecipe(
|
|
144
|
+
ref,
|
|
145
|
+
(el) => createStretchFooter(el, { ...rest, phantom: phantomRef?.current ?? void 0, title: titleRef?.current ?? void 0 }),
|
|
146
|
+
void 0,
|
|
147
|
+
deps
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// src/react/use-radial-menu.ts
|
|
152
|
+
function useRadialMenu(ref, options = {}, deps) {
|
|
153
|
+
const onToggle = useLatest(options.onToggle);
|
|
154
|
+
return useRecipe(ref, createRadialMenu, { ...options, onToggle: (open) => onToggle.current?.(open) }, deps);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// src/react/use-tabs.ts
|
|
158
|
+
function useTabs(ref, options = {}, deps) {
|
|
159
|
+
const onSelect = useLatest(options.onSelect);
|
|
160
|
+
return useRecipe(ref, createTabs, { ...options, onSelect: (index, tab) => onSelect.current?.(index, tab) }, deps);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// src/react/use-counter.ts
|
|
164
|
+
var useCounter = (ref, options, deps) => useRecipe(ref, createCounter, options, deps);
|
|
165
|
+
|
|
166
|
+
// src/react/use-details.ts
|
|
167
|
+
var useDetails = (ref, deps) => useRecipe(ref, createDetails, void 0, deps);
|
|
168
|
+
|
|
169
|
+
// src/react/use-reveal.ts
|
|
170
|
+
var useReveal = (ref, options, deps) => useRecipe(ref, createReveal, options, deps);
|
|
171
|
+
|
|
172
|
+
// src/react/use-reflow.ts
|
|
173
|
+
var useReflow = (ref, options, deps) => useRecipe(ref, createReflow, options, deps);
|
|
174
|
+
|
|
175
|
+
// src/react/use-slot-text.ts
|
|
176
|
+
function useSlotText(ref, text, options = {}) {
|
|
177
|
+
const instance = useRecipe(ref, createSlotText, { ...options, text });
|
|
178
|
+
useIsomorphicLayoutEffect(() => {
|
|
179
|
+
instance.current?.set(text);
|
|
180
|
+
}, [text]);
|
|
181
|
+
return instance;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// src/react/use-sortable.ts
|
|
185
|
+
function useSortable(ref, options = {}, deps) {
|
|
186
|
+
const onReorder = useLatest(options.onReorder);
|
|
187
|
+
return useRecipe(ref, createSortable, { mutate: false, ...options, onReorder: (detail) => onReorder.current?.(detail) }, deps);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// src/react/use-mask-text.ts
|
|
191
|
+
var useMaskText = (ref, options, deps) => useRecipe(ref, createMaskText, options, deps);
|
|
192
|
+
|
|
193
|
+
// src/react/use-cascade.ts
|
|
194
|
+
var useCascade = (ref, options, deps) => useRecipe(ref, createCascade, options, deps);
|
|
195
|
+
|
|
196
|
+
// src/react/use-text-roll.ts
|
|
197
|
+
var useTextRoll = (ref, options, deps) => useRecipe(ref, createTextRoll, options, deps);
|
|
198
|
+
|
|
199
|
+
// src/react/use-letters.ts
|
|
200
|
+
var useLetters = (ref, options, deps) => useRecipe(ref, createLetters, options, deps);
|
|
201
|
+
|
|
202
|
+
// src/react/use-parallax.ts
|
|
203
|
+
var useParallax = (ref, options, deps) => useRecipe(ref, createParallax, options, deps);
|
|
204
|
+
|
|
205
|
+
// src/react/use-depth-grid.ts
|
|
206
|
+
var useDepthGrid = (ref, options, deps) => useRecipe(ref, createDepthGrid, options, deps);
|
|
207
|
+
|
|
208
|
+
// src/react/use-frame-zoom.ts
|
|
209
|
+
var useFrameZoom = (ref, options, deps) => useRecipe(ref, createFrameZoom, options, deps);
|
|
210
|
+
|
|
211
|
+
// src/react/use-contrast.ts
|
|
212
|
+
var useContrast = (ref, options, deps) => useRecipe(ref, createContrast, options, deps);
|
|
213
|
+
|
|
214
|
+
// src/react/use-marquee.ts
|
|
215
|
+
var useMarquee = (ref, options, deps) => useRecipe(ref, createMarquee, options, deps);
|
|
216
|
+
|
|
217
|
+
// src/react/use-card-dock.ts
|
|
218
|
+
var useCardDock = (ref, options, deps) => useRecipe(ref, createCardDock, options, deps);
|
|
219
|
+
|
|
220
|
+
// src/react/use-snap-strip.ts
|
|
221
|
+
var useSnapStrip = (ref, options, deps) => useRecipe(ref, createSnapStrip, options, deps);
|
|
222
|
+
|
|
223
|
+
// src/react/use-fill-text.ts
|
|
224
|
+
var useFillText = (ref, options, deps) => useRecipe(ref, createFillText, options, deps);
|
|
225
|
+
|
|
226
|
+
// src/react/use-ticket-menu.ts
|
|
227
|
+
function useTicketMenu(ref, options = {}, deps) {
|
|
228
|
+
const latest = useLatest(options);
|
|
229
|
+
return useRecipe(ref, createTicketMenu, {
|
|
230
|
+
...options,
|
|
231
|
+
onSelect: (value, item) => latest.current.onSelect?.(value, item),
|
|
232
|
+
onOpen: () => latest.current.onOpen?.(),
|
|
233
|
+
onClose: () => latest.current.onClose?.()
|
|
234
|
+
}, deps);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// src/react/use-infinite-reel.ts
|
|
238
|
+
var useInfiniteReel = (ref, options, deps) => useRecipe(ref, createInfiniteReel, options, deps);
|
|
239
|
+
|
|
240
|
+
// src/react/use-repel-bento.ts
|
|
241
|
+
var useRepelBento = (ref, options, deps) => useRecipe(ref, createRepelBento, options, deps);
|
|
242
|
+
|
|
243
|
+
// src/react/use-rotator.ts
|
|
244
|
+
function useRotator(ref, options = {}, deps) {
|
|
245
|
+
const callback = useLatest(options.onChange);
|
|
246
|
+
return useRecipe(ref, createRotator, { ...options, onChange: (index) => callback.current?.(index) }, deps);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// src/react/use-drag-ruler.ts
|
|
250
|
+
function useDragRuler(ref, options = {}, deps) {
|
|
251
|
+
const callback = useLatest(options.onChange);
|
|
252
|
+
return useRecipe(ref, createDragRuler, { ...options, onChange: (value) => callback.current?.(value) }, deps);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// src/react/use-dock-pill.ts
|
|
256
|
+
function useDockPill(ref, options = {}, deps) {
|
|
257
|
+
const callback = useLatest(options.onSelect);
|
|
258
|
+
return useRecipe(ref, createDockPill, { ...options, onSelect: (index, item) => callback.current?.(index, item) }, deps);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// src/react/use-liquid-blend.ts
|
|
262
|
+
var useLiquidBlend = (ref, options, deps) => useRecipe(ref, createLiquidBlend, options, deps);
|
|
263
|
+
|
|
264
|
+
// src/react/use-matcap.ts
|
|
265
|
+
var useMatcap = (ref, options, deps) => useRecipe(ref, createMatcap, options, deps);
|
|
266
|
+
|
|
267
|
+
// src/react/use-shader-grain.ts
|
|
268
|
+
var useShaderGrain = (ref, options, deps) => useRecipe(ref, createShaderGrain, options, deps);
|
|
269
|
+
|
|
270
|
+
// src/react/use-shader-blur.ts
|
|
271
|
+
var useShaderBlur = (ref, options, deps) => useRecipe(ref, createShaderBlur, options, deps);
|
|
272
|
+
|
|
273
|
+
// src/react/use-particle-hero.ts
|
|
274
|
+
var useParticleHero = (ref, options, deps) => useRecipe(ref, createParticleHero, options, deps);
|
|
275
|
+
|
|
276
|
+
// src/react/theme-provider.tsx
|
|
277
|
+
import { createContext, useContext, useMemo, useState } from "react";
|
|
278
|
+
import { jsx } from "react/jsx-runtime";
|
|
279
|
+
var ThemeContext = createContext(null);
|
|
280
|
+
function ThemeProvider({ children, defaultTheme, mode, storageKey }) {
|
|
281
|
+
const [state, setState] = useState(() => ({ id: defaultTheme ?? DEFAULT_THEME, mode: mode ?? "system", resolved: "light" }));
|
|
282
|
+
useIsomorphicLayoutEffect(() => {
|
|
283
|
+
const onChange = (event) => setState(event.detail);
|
|
284
|
+
document.addEventListener(THEME_EVENT, onChange);
|
|
285
|
+
setState(initTheme({ default: defaultTheme, mode, storageKey }));
|
|
286
|
+
return () => document.removeEventListener(THEME_EVENT, onChange);
|
|
287
|
+
}, [defaultTheme, mode, storageKey]);
|
|
288
|
+
const value = useMemo(() => ({ ...state, setTheme, setMode }), [state]);
|
|
289
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children });
|
|
290
|
+
}
|
|
291
|
+
function useTheme() {
|
|
292
|
+
const value = useContext(ThemeContext);
|
|
293
|
+
if (!value) throw new Error("useTheme() needs a <ThemeProvider> above it");
|
|
294
|
+
return value;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// src/components/theme-picker/react.tsx
|
|
298
|
+
import { useRef as useRef2 } from "react";
|
|
299
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
300
|
+
function ThemePicker({ className, style, unstyled, themes, showHidden, labels, onChange }) {
|
|
301
|
+
const ref = useRef2(null);
|
|
302
|
+
const change = useLatest(onChange);
|
|
303
|
+
const themeKey = themes?.join(",");
|
|
304
|
+
useIsomorphicLayoutEffect(() => {
|
|
305
|
+
const picker = createThemePicker(ref.current, {
|
|
306
|
+
themes: themeKey ? themeKey.split(",") : void 0,
|
|
307
|
+
showHidden,
|
|
308
|
+
labels,
|
|
309
|
+
onChange: (id) => change.current?.(id)
|
|
310
|
+
});
|
|
311
|
+
return () => picker.destroy();
|
|
312
|
+
}, [themeKey, showHidden, labels?.group]);
|
|
313
|
+
const classes = [unstyled ? null : "mk-theme-picker", className].filter(Boolean).join(" ");
|
|
314
|
+
return /* @__PURE__ */ jsx2("div", { ref, className: classes || void 0, style });
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// src/react/slot-text.tsx
|
|
318
|
+
import { useRef as useRef3, useState as useState2 } from "react";
|
|
319
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
320
|
+
var escapeHtml = (text) => text.replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`);
|
|
321
|
+
function SlotText({ text, className, direction, duration, stagger, exitOffset, colorFade, maxTilt }) {
|
|
322
|
+
const ref = useRef3(null);
|
|
323
|
+
const instance = useRef3(null);
|
|
324
|
+
const [initial] = useState2(text);
|
|
325
|
+
const [html] = useState2(() => ({ __html: escapeHtml(text) }));
|
|
326
|
+
useIsomorphicLayoutEffect(() => {
|
|
327
|
+
const created = createSlotText(ref.current, { direction, duration, stagger, exitOffset, colorFade, maxTilt, text: initial, accessibleCopy: false });
|
|
328
|
+
instance.current = created;
|
|
329
|
+
return () => {
|
|
330
|
+
created.destroy();
|
|
331
|
+
instance.current = null;
|
|
332
|
+
};
|
|
333
|
+
}, []);
|
|
334
|
+
useIsomorphicLayoutEffect(() => {
|
|
335
|
+
instance.current?.set(text);
|
|
336
|
+
}, [text]);
|
|
337
|
+
return /* @__PURE__ */ jsxs("span", { className, children: [
|
|
338
|
+
/* @__PURE__ */ jsx3("span", { className: "mk-sr-only", children: text }),
|
|
339
|
+
/* @__PURE__ */ jsx3("span", { ref, "aria-hidden": "true", dangerouslySetInnerHTML: html })
|
|
340
|
+
] });
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// src/react/animated-number.tsx
|
|
344
|
+
import { useEffect as useEffect2, useRef as useRef4, useState as useState3 } from "react";
|
|
345
|
+
import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
|
|
346
|
+
var whole = (shown) => String(Math.round(shown));
|
|
347
|
+
function AnimatedNumber({ value, format = whole, duration }) {
|
|
348
|
+
const [shown, setShown] = useState3(value);
|
|
349
|
+
const current = useRef4(value);
|
|
350
|
+
useEffect2(() => {
|
|
351
|
+
const tween = tweenNumber(current.current, value, (next) => {
|
|
352
|
+
current.current = next;
|
|
353
|
+
setShown(next);
|
|
354
|
+
}, { duration });
|
|
355
|
+
return () => {
|
|
356
|
+
tween?.kill();
|
|
357
|
+
};
|
|
358
|
+
}, [value, duration]);
|
|
359
|
+
return /* @__PURE__ */ jsx4(Fragment, { children: format(shown) });
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// src/react/flip-group.tsx
|
|
363
|
+
import { Component } from "react";
|
|
364
|
+
var FlipGroup = class extends Component {
|
|
365
|
+
flip = null;
|
|
366
|
+
getSnapshotBeforeUpdate(previous) {
|
|
367
|
+
const node = this.props.root.current;
|
|
368
|
+
if (previous.signature === this.props.signature || !node) return null;
|
|
369
|
+
return captureLayout(node, this.props.selector ?? "[data-flip-id]");
|
|
370
|
+
}
|
|
371
|
+
componentDidUpdate(_previous, _state, before) {
|
|
372
|
+
const node = this.props.root.current;
|
|
373
|
+
if (!before || !node) return;
|
|
374
|
+
this.flip?.kill();
|
|
375
|
+
this.flip = reflowLayout(node, this.props.selector ?? "[data-flip-id]", before);
|
|
376
|
+
}
|
|
377
|
+
componentWillUnmount() {
|
|
378
|
+
this.flip?.kill();
|
|
379
|
+
}
|
|
380
|
+
render() {
|
|
381
|
+
return this.props.children;
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
// src/components/dialog/react.tsx
|
|
386
|
+
import {
|
|
387
|
+
createContext as createContext2,
|
|
388
|
+
useCallback,
|
|
389
|
+
useContext as useContext2,
|
|
390
|
+
useMemo as useMemo2,
|
|
391
|
+
useRef as useRef5,
|
|
392
|
+
useState as useState4
|
|
393
|
+
} from "react";
|
|
394
|
+
|
|
395
|
+
// src/components/icon.tsx
|
|
396
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
397
|
+
function MkIcon({ name, size = 20 }) {
|
|
398
|
+
return /* @__PURE__ */ jsx5("svg", { "aria-hidden": "true", width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx5("path", { d: ICON_PATHS[name] }) });
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// src/components/dialog/react.tsx
|
|
402
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
403
|
+
function useSurfaceRoot({ open: controlled, defaultOpen = false, onOpenChange, children: _children, ...options }) {
|
|
404
|
+
const [uncontrolled, setUncontrolled] = useState4(defaultOpen);
|
|
405
|
+
const open = controlled ?? uncontrolled;
|
|
406
|
+
const current = useLatest(open);
|
|
407
|
+
const change = useLatest(onOpenChange);
|
|
408
|
+
const isControlled = controlled !== void 0;
|
|
409
|
+
const setOpen = useCallback(
|
|
410
|
+
(next) => {
|
|
411
|
+
if (next === current.current) return;
|
|
412
|
+
current.current = next;
|
|
413
|
+
if (!isControlled) setUncontrolled(next);
|
|
414
|
+
change.current?.(next);
|
|
415
|
+
},
|
|
416
|
+
[isControlled, current, change]
|
|
417
|
+
);
|
|
418
|
+
const origin = useRef5(null);
|
|
419
|
+
const instance = useRef5(null);
|
|
420
|
+
const optionKey = JSON.stringify(options);
|
|
421
|
+
const stable = useMemo2(() => options, [optionKey]);
|
|
422
|
+
return useMemo2(() => ({ open, setOpen, origin, instance, options: stable }), [open, setOpen, stable]);
|
|
423
|
+
}
|
|
424
|
+
var DialogContext = createContext2(null);
|
|
425
|
+
function useDialogContext(part) {
|
|
426
|
+
const value = useContext2(DialogContext);
|
|
427
|
+
if (!value) throw new Error(`<Dialog.${part}> must be inside <Dialog.Root>`);
|
|
428
|
+
return value;
|
|
429
|
+
}
|
|
430
|
+
function Root(props) {
|
|
431
|
+
const value = useSurfaceRoot(props);
|
|
432
|
+
return /* @__PURE__ */ jsx6(DialogContext.Provider, { value, children: props.children });
|
|
433
|
+
}
|
|
434
|
+
function Trigger({ onClick, children, ...props }) {
|
|
435
|
+
const context = useDialogContext("Trigger");
|
|
436
|
+
return /* @__PURE__ */ jsx6(
|
|
437
|
+
"button",
|
|
438
|
+
{
|
|
439
|
+
type: "button",
|
|
440
|
+
"aria-haspopup": "dialog",
|
|
441
|
+
"aria-expanded": context.open,
|
|
442
|
+
...props,
|
|
443
|
+
onClick: (event) => {
|
|
444
|
+
onClick?.(event);
|
|
445
|
+
if (event.defaultPrevented) return;
|
|
446
|
+
context.origin.current = event.currentTarget;
|
|
447
|
+
context.setOpen(!context.open);
|
|
448
|
+
},
|
|
449
|
+
children
|
|
450
|
+
}
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
function useSurfaceEngine(context, create) {
|
|
454
|
+
const ref = useRef5(null);
|
|
455
|
+
const setOpen = useLatest(context.setOpen);
|
|
456
|
+
useIsomorphicLayoutEffect(() => {
|
|
457
|
+
const dialog = ref.current;
|
|
458
|
+
if (!dialog) return;
|
|
459
|
+
const created = create(dialog, { ...context.options, triggers: false, onClose: () => setOpen.current(false) });
|
|
460
|
+
context.instance.current = created;
|
|
461
|
+
if (context.open) created.open(context.origin.current ?? void 0);
|
|
462
|
+
return () => {
|
|
463
|
+
created.destroy();
|
|
464
|
+
context.instance.current = null;
|
|
465
|
+
};
|
|
466
|
+
}, [context.options]);
|
|
467
|
+
useIsomorphicLayoutEffect(() => {
|
|
468
|
+
const instance = context.instance.current;
|
|
469
|
+
if (!instance) return;
|
|
470
|
+
if (context.open && !instance.isOpen) {
|
|
471
|
+
instance.open(context.origin.current ?? void 0);
|
|
472
|
+
context.origin.current = null;
|
|
473
|
+
} else if (!context.open && instance.isOpen) instance.close();
|
|
474
|
+
}, [context.open]);
|
|
475
|
+
return ref;
|
|
476
|
+
}
|
|
477
|
+
function Content({ size = "md", unstyled, className, children, ...props }) {
|
|
478
|
+
const context = useDialogContext("Content");
|
|
479
|
+
const ref = useSurfaceEngine(context, createDialog);
|
|
480
|
+
const classes = [unstyled ? null : "mk-dialog", !unstyled && size !== "md" ? `mk-dialog--${size}` : null, className].filter(Boolean).join(" ");
|
|
481
|
+
return /* @__PURE__ */ jsx6("dialog", { ref, className: classes || void 0, ...props, children });
|
|
482
|
+
}
|
|
483
|
+
var partOf = (name) => function Part({ children, ...props }) {
|
|
484
|
+
const Tag = name === "header" ? "header" : name === "footer" ? "footer" : name === "title" ? "h2" : name === "description" ? "p" : "div";
|
|
485
|
+
return /* @__PURE__ */ jsx6(Tag, { "data-mk-part": name, ...props, children });
|
|
486
|
+
};
|
|
487
|
+
function Close({ children, label = "Cerrar", ...props }) {
|
|
488
|
+
return /* @__PURE__ */ jsx6("button", { type: "button", "data-mk-part": "close", "aria-label": children ? void 0 : label, ...props, children: children ?? /* @__PURE__ */ jsx6(MkIcon, { name: "close" }) });
|
|
489
|
+
}
|
|
490
|
+
function Handle({ children, ...props }) {
|
|
491
|
+
return /* @__PURE__ */ jsx6("button", { type: "button", "data-mk-part": "handle", ...props, children: children ?? /* @__PURE__ */ jsx6(MkIcon, { name: "expand", size: 18 }) });
|
|
492
|
+
}
|
|
493
|
+
var Dialog = {
|
|
494
|
+
Root,
|
|
495
|
+
Trigger,
|
|
496
|
+
Content,
|
|
497
|
+
Header: partOf("header"),
|
|
498
|
+
Title: partOf("title"),
|
|
499
|
+
Description: partOf("description"),
|
|
500
|
+
Actions: partOf("actions"),
|
|
501
|
+
Body: partOf("body"),
|
|
502
|
+
Footer: partOf("footer"),
|
|
503
|
+
Close,
|
|
504
|
+
Handle
|
|
505
|
+
};
|
|
506
|
+
function useDialog() {
|
|
507
|
+
const context = useDialogContext("useDialog");
|
|
508
|
+
return { open: context.open, setOpen: context.setOpen, instance: context.instance };
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// src/components/menu/react.tsx
|
|
512
|
+
import { createContext as createContext3, useContext as useContext3, useRef as useRef6 } from "react";
|
|
513
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
514
|
+
var MenuContext = createContext3(null);
|
|
515
|
+
function useMenuContext(part) {
|
|
516
|
+
const value = useContext3(MenuContext);
|
|
517
|
+
if (!value) throw new Error(`<Menu.${part}> must be inside <Menu.Root>`);
|
|
518
|
+
return value;
|
|
519
|
+
}
|
|
520
|
+
function Root2({ onSelect, closeOnSelect = true, ticket = false, children, ...props }) {
|
|
521
|
+
const surface = useSurfaceRoot(props);
|
|
522
|
+
const select = useLatest(onSelect);
|
|
523
|
+
return /* @__PURE__ */ jsx7(MenuContext.Provider, { value: { ...surface, onSelect: select, closeOnSelect, ticket }, children });
|
|
524
|
+
}
|
|
525
|
+
function Trigger2({ onClick, children, ...props }) {
|
|
526
|
+
const context = useMenuContext("Trigger");
|
|
527
|
+
return /* @__PURE__ */ jsx7(
|
|
528
|
+
"button",
|
|
529
|
+
{
|
|
530
|
+
type: "button",
|
|
531
|
+
"aria-haspopup": "menu",
|
|
532
|
+
"aria-expanded": context.open,
|
|
533
|
+
...props,
|
|
534
|
+
onClick: (event) => {
|
|
535
|
+
onClick?.(event);
|
|
536
|
+
if (event.defaultPrevented) return;
|
|
537
|
+
context.origin.current = event.currentTarget;
|
|
538
|
+
context.setOpen(!context.open);
|
|
539
|
+
},
|
|
540
|
+
children
|
|
541
|
+
}
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
function Content2({ className, children, ...props }) {
|
|
545
|
+
const context = useMenuContext("Content");
|
|
546
|
+
const closeOnSelect = useRef6(context.closeOnSelect);
|
|
547
|
+
closeOnSelect.current = context.closeOnSelect;
|
|
548
|
+
const ref = useSurfaceEngine(
|
|
549
|
+
context,
|
|
550
|
+
(dialog, options) => createMenu(dialog, { ...options, ticket: context.ticket, closeOnSelect: closeOnSelect.current, onSelect: (value, item) => context.onSelect.current?.(value, item) })
|
|
551
|
+
);
|
|
552
|
+
return /* @__PURE__ */ jsx7("dialog", { ref, className: ["mk-dialog mk-menu", className].filter(Boolean).join(" "), ...props, children });
|
|
553
|
+
}
|
|
554
|
+
function Item({ value, children, ...props }) {
|
|
555
|
+
return /* @__PURE__ */ jsx7("button", { type: "button", "data-mk-item": "", "data-mk-value": value, ...props, children });
|
|
556
|
+
}
|
|
557
|
+
function Separator() {
|
|
558
|
+
return /* @__PURE__ */ jsx7("hr", { "data-mk-separator": "" });
|
|
559
|
+
}
|
|
560
|
+
var Menu = { Root: Root2, Trigger: Trigger2, Content: Content2, Item, Separator };
|
|
561
|
+
|
|
562
|
+
// src/components/toast/react.tsx
|
|
563
|
+
import { useRef as useRef7 } from "react";
|
|
564
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
565
|
+
function Toaster({ labels }) {
|
|
566
|
+
const ref = useRef7(null);
|
|
567
|
+
const dismiss = labels?.dismiss;
|
|
568
|
+
useIsomorphicLayoutEffect(() => {
|
|
569
|
+
const toaster = createToaster(ref.current, { labels: { dismiss } });
|
|
570
|
+
return () => toaster.destroy();
|
|
571
|
+
}, [dismiss]);
|
|
572
|
+
return /* @__PURE__ */ jsx8("div", { ref, className: "mk-toaster" });
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// src/components/chat-background/react.tsx
|
|
576
|
+
import { useRef as useRef8 } from "react";
|
|
577
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
578
|
+
function ChatBackground({ energy = 0, scale = 1, className, style }) {
|
|
579
|
+
const ref = useRef8(null);
|
|
580
|
+
const instance = useRef8(null);
|
|
581
|
+
useIsomorphicLayoutEffect(() => {
|
|
582
|
+
const created = createChatBackground(ref.current, { energy, scale });
|
|
583
|
+
instance.current = created;
|
|
584
|
+
return () => {
|
|
585
|
+
created.destroy();
|
|
586
|
+
instance.current = null;
|
|
587
|
+
};
|
|
588
|
+
}, []);
|
|
589
|
+
useIsomorphicLayoutEffect(() => {
|
|
590
|
+
instance.current?.setEnergy(energy);
|
|
591
|
+
}, [energy]);
|
|
592
|
+
useIsomorphicLayoutEffect(() => {
|
|
593
|
+
instance.current?.setScale(scale);
|
|
594
|
+
}, [scale]);
|
|
595
|
+
return /* @__PURE__ */ jsx9("div", { ref, className: ["mk-chat-background", className].filter(Boolean).join(" "), style });
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
// src/components/chat/react.tsx
|
|
599
|
+
import {
|
|
600
|
+
Component as Component2,
|
|
601
|
+
createContext as createContext4,
|
|
602
|
+
useContext as useContext4,
|
|
603
|
+
useRef as useRef9
|
|
604
|
+
} from "react";
|
|
605
|
+
import { jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
606
|
+
var ChatContext = createContext4(null);
|
|
607
|
+
function Root3({ onSend, animateExisting, labels = {}, className, children, ...props }) {
|
|
608
|
+
const ref = useRef9(null);
|
|
609
|
+
const instance = useRef9(null);
|
|
610
|
+
const send = useLatest(onSend);
|
|
611
|
+
useIsomorphicLayoutEffect(() => {
|
|
612
|
+
const created = createChat(ref.current, { animateExisting, labels, onSend: (text) => send.current?.(text) });
|
|
613
|
+
instance.current = created;
|
|
614
|
+
return () => {
|
|
615
|
+
created.destroy();
|
|
616
|
+
instance.current = null;
|
|
617
|
+
};
|
|
618
|
+
}, []);
|
|
619
|
+
return /* @__PURE__ */ jsx10(ChatContext.Provider, { value: { instance, labels }, children: /* @__PURE__ */ jsx10("div", { ref, className: ["mk-chat", className].filter(Boolean).join(" "), ...props, children }) });
|
|
620
|
+
}
|
|
621
|
+
var Messages = class extends Component2 {
|
|
622
|
+
static contextType = ChatContext;
|
|
623
|
+
state = { showPending: false };
|
|
624
|
+
list = null;
|
|
625
|
+
timer;
|
|
626
|
+
componentDidMount() {
|
|
627
|
+
if (this.props.pending) this.wait();
|
|
628
|
+
}
|
|
629
|
+
componentDidUpdate(previous, _state, snapshot) {
|
|
630
|
+
if (this.props.pending && !previous.pending) this.wait();
|
|
631
|
+
if (!this.props.pending && previous.pending) {
|
|
632
|
+
clearTimeout(this.timer);
|
|
633
|
+
if (this.state.showPending) this.setState({ showPending: false });
|
|
634
|
+
}
|
|
635
|
+
if (!snapshot || !this.list) return;
|
|
636
|
+
const answers = [...this.list.querySelectorAll('[data-mk-message][data-mk-role="assistant"]:not([data-mk-pending])')];
|
|
637
|
+
const reply = answers[answers.length - 1];
|
|
638
|
+
if (!reply) return;
|
|
639
|
+
this.context?.instance.current?.adopt(reply);
|
|
640
|
+
morphPendingToReply(snapshot, reply, this.list);
|
|
641
|
+
}
|
|
642
|
+
getSnapshotBeforeUpdate(previous) {
|
|
643
|
+
if (!previous.pending || this.props.pending || !this.state.showPending || !this.list) return null;
|
|
644
|
+
return capturePending(this.list.querySelector("[data-mk-pending]"));
|
|
645
|
+
}
|
|
646
|
+
componentWillUnmount() {
|
|
647
|
+
clearTimeout(this.timer);
|
|
648
|
+
}
|
|
649
|
+
wait() {
|
|
650
|
+
clearTimeout(this.timer);
|
|
651
|
+
this.timer = setTimeout(() => {
|
|
652
|
+
if (this.props.pending) this.setState({ showPending: true });
|
|
653
|
+
}, TIMING.chat.pendingDelayMs);
|
|
654
|
+
}
|
|
655
|
+
render() {
|
|
656
|
+
const thinking = this.context?.labels.thinking ?? "Pensando...";
|
|
657
|
+
return /* @__PURE__ */ jsxs2(
|
|
658
|
+
"div",
|
|
659
|
+
{
|
|
660
|
+
ref: (node) => {
|
|
661
|
+
this.list = node;
|
|
662
|
+
},
|
|
663
|
+
"data-mk-part": "messages",
|
|
664
|
+
children: [
|
|
665
|
+
this.props.children,
|
|
666
|
+
this.props.pending && this.state.showPending ? /* @__PURE__ */ jsx10("div", { "data-mk-message": "", "data-mk-role": "assistant", "data-mk-pending": "", "data-flip-id": PENDING_ID, children: /* @__PURE__ */ jsxs2("span", { className: "mk-chat__thinking", children: [
|
|
667
|
+
/* @__PURE__ */ jsx10(MkIcon, { name: "sparkle", size: 18 }),
|
|
668
|
+
/* @__PURE__ */ jsx10("span", { children: thinking })
|
|
669
|
+
] }) }) : null
|
|
670
|
+
]
|
|
671
|
+
}
|
|
672
|
+
);
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
function Message({ role = "assistant", children, ...props }) {
|
|
676
|
+
return /* @__PURE__ */ jsx10("div", { "data-mk-message": "", "data-mk-role": role, ...props, children: /* @__PURE__ */ jsx10("div", { "data-mk-text": "", children }) });
|
|
677
|
+
}
|
|
678
|
+
function Composer({ actions, sendLabel = "Enviar", placeholder = "Escribe un mensaje...", ...props }) {
|
|
679
|
+
return /* @__PURE__ */ jsxs2("form", { "data-mk-part": "composer", children: [
|
|
680
|
+
/* @__PURE__ */ jsx10("textarea", { "data-mk-part": "input", rows: 1, placeholder, "aria-label": placeholder, ...props }),
|
|
681
|
+
/* @__PURE__ */ jsxs2("div", { "data-mk-part": "buttons", children: [
|
|
682
|
+
actions,
|
|
683
|
+
/* @__PURE__ */ jsx10("button", { type: "submit", "data-mk-part": "send", "aria-label": sendLabel, children: /* @__PURE__ */ jsx10(MkIcon, { name: "send", size: 22 }) })
|
|
684
|
+
] })
|
|
685
|
+
] });
|
|
686
|
+
}
|
|
687
|
+
function Confirm({ children, ...props }) {
|
|
688
|
+
const ref = useRef9(null);
|
|
689
|
+
const context = useContext4(ChatContext);
|
|
690
|
+
useIsomorphicLayoutEffect(() => {
|
|
691
|
+
if (ref.current) context?.instance.current?.confirm(ref.current);
|
|
692
|
+
}, []);
|
|
693
|
+
return /* @__PURE__ */ jsx10("div", { ref, "data-mk-part": "confirm", ...props, children });
|
|
694
|
+
}
|
|
695
|
+
var Chat = { Root: Root3, Messages, Message, Composer, Confirm };
|
|
696
|
+
function useChat() {
|
|
697
|
+
const context = useContext4(ChatContext);
|
|
698
|
+
if (!context) throw new Error("useChat() needs a <Chat.Root> above it");
|
|
699
|
+
return context.instance;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
// src/components/nav/react.tsx
|
|
703
|
+
import { useRef as useRef10 } from "react";
|
|
704
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
705
|
+
function Nav({
|
|
706
|
+
items,
|
|
707
|
+
active,
|
|
708
|
+
onSelect,
|
|
709
|
+
navStyle = "bonita",
|
|
710
|
+
accent = false,
|
|
711
|
+
reveal = false,
|
|
712
|
+
first,
|
|
713
|
+
actions,
|
|
714
|
+
className,
|
|
715
|
+
...props
|
|
716
|
+
}) {
|
|
717
|
+
const ref = useRef10(null);
|
|
718
|
+
useIsomorphicLayoutEffect(() => {
|
|
719
|
+
if (!reveal || !ref.current) return;
|
|
720
|
+
const handle = revealShell(ref.current);
|
|
721
|
+
return () => handle?.cancel();
|
|
722
|
+
}, []);
|
|
723
|
+
const classes = ["mk-nav", `mk-nav--${navStyle}`, accent && "mk-nav--accent", className].filter(Boolean).join(" ");
|
|
724
|
+
return /* @__PURE__ */ jsxs3("nav", { ref, "aria-label": "Principal", ...props, className: classes, children: [
|
|
725
|
+
first,
|
|
726
|
+
/* @__PURE__ */ jsx11("div", { className: "mk-nav__buttons", children: items.map((item) => {
|
|
727
|
+
const shared = {
|
|
728
|
+
className: "mk-nav__button",
|
|
729
|
+
"aria-current": item.value === active ? "page" : void 0,
|
|
730
|
+
"data-mk-value": item.value,
|
|
731
|
+
"data-mk-hide-mobile": item.hideOnMobile ? "" : void 0,
|
|
732
|
+
onClick: (event) => onSelect?.(item.value, event)
|
|
733
|
+
};
|
|
734
|
+
const content = /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
735
|
+
item.icon ? /* @__PURE__ */ jsx11("span", { className: "mk-nav__icon", "aria-hidden": "true", children: item.icon }) : null,
|
|
736
|
+
/* @__PURE__ */ jsx11("span", { className: "mk-nav__name", children: item.label })
|
|
737
|
+
] });
|
|
738
|
+
return item.href ? /* @__PURE__ */ jsx11("a", { href: item.href, ...shared, children: content }, item.value) : /* @__PURE__ */ jsx11("button", { type: "button", ...shared, children: content }, item.value);
|
|
739
|
+
}) }),
|
|
740
|
+
actions ? /* @__PURE__ */ jsx11("div", { className: "mk-nav__actions", children: actions }) : null
|
|
741
|
+
] });
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
// src/components/steps/react.tsx
|
|
745
|
+
import {
|
|
746
|
+
Children,
|
|
747
|
+
createContext as createContext5,
|
|
748
|
+
isValidElement,
|
|
749
|
+
useContext as useContext5,
|
|
750
|
+
useRef as useRef11
|
|
751
|
+
} from "react";
|
|
752
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
753
|
+
var StepsContext = createContext5({ initial: 0 });
|
|
754
|
+
var StepIndex = createContext5(-1);
|
|
755
|
+
function Root4({ index = 0, onChange, busy = false, duration, className, children, ...props }) {
|
|
756
|
+
const ref = useRef11(null);
|
|
757
|
+
const instance = useRef11(null);
|
|
758
|
+
const initial = useRef11(index);
|
|
759
|
+
const change = useLatest(onChange);
|
|
760
|
+
useIsomorphicLayoutEffect(() => {
|
|
761
|
+
const created = createSteps(ref.current, { index: initial.current, duration, onChange: (i, previous) => change.current?.(i, previous) });
|
|
762
|
+
instance.current = created;
|
|
763
|
+
return () => {
|
|
764
|
+
created.destroy();
|
|
765
|
+
instance.current = null;
|
|
766
|
+
};
|
|
767
|
+
}, []);
|
|
768
|
+
useIsomorphicLayoutEffect(() => {
|
|
769
|
+
void instance.current?.goTo(index);
|
|
770
|
+
}, [index]);
|
|
771
|
+
useIsomorphicLayoutEffect(() => {
|
|
772
|
+
instance.current?.busy(busy);
|
|
773
|
+
}, [busy]);
|
|
774
|
+
let count = 0;
|
|
775
|
+
const numbered = Children.map(
|
|
776
|
+
children,
|
|
777
|
+
(child) => isValidElement(child) && child.type === Step ? /* @__PURE__ */ jsx12(StepIndex.Provider, { value: count++, children: child }) : child
|
|
778
|
+
);
|
|
779
|
+
return /* @__PURE__ */ jsx12(StepsContext.Provider, { value: { initial: initial.current }, children: /* @__PURE__ */ jsx12("div", { ref, className: ["mk-steps", className].filter(Boolean).join(" "), ...props, children: numbered }) });
|
|
780
|
+
}
|
|
781
|
+
function Step({ children, ...props }) {
|
|
782
|
+
const { initial } = useContext5(StepsContext);
|
|
783
|
+
const index = useContext5(StepIndex);
|
|
784
|
+
return /* @__PURE__ */ jsx12("section", { "data-mk-step": "", hidden: index !== initial, ...props, children });
|
|
785
|
+
}
|
|
786
|
+
function Counter(props) {
|
|
787
|
+
const { initial } = useContext5(StepsContext);
|
|
788
|
+
return /* @__PURE__ */ jsx12("span", { "data-mk-counter": "", suppressHydrationWarning: true, ...props, children: initial + 1 });
|
|
789
|
+
}
|
|
790
|
+
var Steps = Object.assign(Root4, { Step, Counter });
|
|
791
|
+
|
|
792
|
+
// src/components/cursor/react.tsx
|
|
793
|
+
import { useRef as useRef12 } from "react";
|
|
794
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
795
|
+
function Cursor({ variant = "chip", text, arrows, zone, className }) {
|
|
796
|
+
const ref = useRef12(null);
|
|
797
|
+
useIsomorphicLayoutEffect(() => {
|
|
798
|
+
const cursor = createCursor(ref.current, { variant, text, arrows, zone: zone ? document.querySelector(zone) : void 0 });
|
|
799
|
+
return () => cursor.destroy();
|
|
800
|
+
}, [variant, text, arrows, zone]);
|
|
801
|
+
return /* @__PURE__ */ jsx13("div", { ref, className });
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
// src/react/frost.tsx
|
|
805
|
+
import { jsx as jsx14, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
806
|
+
function Frost({ position = "bottom", fixed = false, height, strength, className, style }) {
|
|
807
|
+
const vars = {};
|
|
808
|
+
if (height !== void 0) vars["--mk-frost-height"] = typeof height === "number" ? `${height}px` : height;
|
|
809
|
+
if (strength !== void 0) vars["--mk-frost-strength"] = String(strength);
|
|
810
|
+
return /* @__PURE__ */ jsxs4(
|
|
811
|
+
"div",
|
|
812
|
+
{
|
|
813
|
+
"aria-hidden": "true",
|
|
814
|
+
className: ["mk-frost", position === "top" && "mk-frost--top", fixed && "mk-frost--fixed", className].filter(Boolean).join(" "),
|
|
815
|
+
style: { ...style, ...vars },
|
|
816
|
+
children: [
|
|
817
|
+
/* @__PURE__ */ jsx14("i", {}),
|
|
818
|
+
/* @__PURE__ */ jsx14("i", {}),
|
|
819
|
+
/* @__PURE__ */ jsx14("i", {}),
|
|
820
|
+
/* @__PURE__ */ jsx14("i", {}),
|
|
821
|
+
/* @__PURE__ */ jsx14("i", {})
|
|
822
|
+
]
|
|
823
|
+
}
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// src/components/island/react.tsx
|
|
828
|
+
import { useRef as useRef13 } from "react";
|
|
829
|
+
import { jsx as jsx15, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
830
|
+
function IslandDots() {
|
|
831
|
+
return /* @__PURE__ */ jsx15("span", { className: "mk-island__dots", "aria-hidden": "true", children: Array.from({ length: 9 }, (_, i) => /* @__PURE__ */ jsx15("i", {}, i)) });
|
|
832
|
+
}
|
|
833
|
+
function Island({
|
|
834
|
+
brand,
|
|
835
|
+
cta,
|
|
836
|
+
panels,
|
|
837
|
+
contained = false,
|
|
838
|
+
entrance,
|
|
839
|
+
closeOnScroll,
|
|
840
|
+
closeOnNavigate,
|
|
841
|
+
focusOnOpen,
|
|
842
|
+
onChange,
|
|
843
|
+
instanceRef,
|
|
844
|
+
className,
|
|
845
|
+
...props
|
|
846
|
+
}) {
|
|
847
|
+
const ref = useRef13(null);
|
|
848
|
+
const change = useLatest(onChange);
|
|
849
|
+
useIsomorphicLayoutEffect(() => {
|
|
850
|
+
const instance = createIsland(ref.current, {
|
|
851
|
+
entrance,
|
|
852
|
+
closeOnScroll,
|
|
853
|
+
closeOnNavigate,
|
|
854
|
+
focusOnOpen,
|
|
855
|
+
onChange: (active) => change.current?.(active)
|
|
856
|
+
});
|
|
857
|
+
if (instanceRef) instanceRef.current = instance;
|
|
858
|
+
return () => {
|
|
859
|
+
instance.destroy();
|
|
860
|
+
if (instanceRef) instanceRef.current = null;
|
|
861
|
+
};
|
|
862
|
+
}, [panels.map((panel) => panel.name).join(), entrance, closeOnScroll, closeOnNavigate, focusOnOpen]);
|
|
863
|
+
const classes = ["mk-island", contained && "mk-island--contained", className].filter(Boolean).join(" ");
|
|
864
|
+
return /* @__PURE__ */ jsxs5("nav", { ref, "aria-label": "Principal", ...props, className: classes, children: [
|
|
865
|
+
/* @__PURE__ */ jsx15("button", { type: "button", className: "mk-island__backdrop", "data-mk-island-close": true, tabIndex: -1, "aria-label": "Cerrar" }),
|
|
866
|
+
/* @__PURE__ */ jsxs5("div", { className: "mk-island__shell", children: [
|
|
867
|
+
/* @__PURE__ */ jsx15("div", { className: "mk-island__glass", "aria-hidden": "true" }),
|
|
868
|
+
/* @__PURE__ */ jsxs5("div", { className: "mk-island__header", children: [
|
|
869
|
+
brand ? /* @__PURE__ */ jsx15("span", { className: "mk-island__brand", children: brand }) : /* @__PURE__ */ jsx15("span", {}),
|
|
870
|
+
/* @__PURE__ */ jsxs5("div", { className: "mk-island__actions", children: [
|
|
871
|
+
cta ? /* @__PURE__ */ jsx15("a", { className: "mk-island__cta", href: cta.href, children: cta.label }) : null,
|
|
872
|
+
panels.map((panel, i) => /* @__PURE__ */ jsxs5("span", { style: { display: "contents" }, children: [
|
|
873
|
+
i > 0 ? /* @__PURE__ */ jsx15("span", { className: "mk-island__separator", "aria-hidden": "true" }) : null,
|
|
874
|
+
/* @__PURE__ */ jsx15(
|
|
875
|
+
"button",
|
|
876
|
+
{
|
|
877
|
+
type: "button",
|
|
878
|
+
className: panel.light ? "mk-island__button mk-island__button--light" : "mk-island__button",
|
|
879
|
+
"data-mk-island-toggle": panel.name,
|
|
880
|
+
"aria-label": panel.label,
|
|
881
|
+
children: panel.icon ?? /* @__PURE__ */ jsx15(IslandDots, {})
|
|
882
|
+
}
|
|
883
|
+
)
|
|
884
|
+
] }, panel.name))
|
|
885
|
+
] })
|
|
886
|
+
] }),
|
|
887
|
+
/* @__PURE__ */ jsx15("div", { className: "mk-island__content", children: /* @__PURE__ */ jsx15("div", { children: panels.map((panel) => /* @__PURE__ */ jsx15("section", { className: "mk-island__panel", "data-mk-island-panel": panel.name, "aria-label": panel.label, children: panel.content }, panel.name)) }) })
|
|
888
|
+
] })
|
|
889
|
+
] });
|
|
890
|
+
}
|
|
891
|
+
export {
|
|
892
|
+
ANIMATIONS,
|
|
893
|
+
AnimatedNumber,
|
|
894
|
+
Chat,
|
|
895
|
+
ChatBackground,
|
|
896
|
+
Cursor,
|
|
897
|
+
Dialog,
|
|
898
|
+
FlipGroup,
|
|
899
|
+
Frost,
|
|
900
|
+
Island,
|
|
901
|
+
IslandDots,
|
|
902
|
+
MK_HEAD_SCRIPT,
|
|
903
|
+
MK_THEME_HEAD_SCRIPT,
|
|
904
|
+
Menu,
|
|
905
|
+
MkIcon,
|
|
906
|
+
NAV_STYLES,
|
|
907
|
+
Nav,
|
|
908
|
+
SlotText,
|
|
909
|
+
Steps,
|
|
910
|
+
ThemePicker,
|
|
911
|
+
ThemeProvider,
|
|
912
|
+
Toaster,
|
|
913
|
+
animate,
|
|
914
|
+
clearToasts,
|
|
915
|
+
confetti,
|
|
916
|
+
dismissToast,
|
|
917
|
+
leave,
|
|
918
|
+
moveItem,
|
|
919
|
+
pileLayers,
|
|
920
|
+
pileStyle,
|
|
921
|
+
themeHeadScript,
|
|
922
|
+
toast,
|
|
923
|
+
useCardDock,
|
|
924
|
+
useCascade,
|
|
925
|
+
useChat,
|
|
926
|
+
useContrast,
|
|
927
|
+
useCounter,
|
|
928
|
+
useCurvedCarousel,
|
|
929
|
+
useDepthGrid,
|
|
930
|
+
useDetails,
|
|
931
|
+
useDialog,
|
|
932
|
+
useDockPill,
|
|
933
|
+
useDragRuler,
|
|
934
|
+
useFillText,
|
|
935
|
+
useFitText,
|
|
936
|
+
useFlow,
|
|
937
|
+
useFrameZoom,
|
|
938
|
+
useInfiniteReel,
|
|
939
|
+
useIsomorphicLayoutEffect,
|
|
940
|
+
useLatest,
|
|
941
|
+
useLetters,
|
|
942
|
+
useLiquidBlend,
|
|
943
|
+
useMarquee,
|
|
944
|
+
useMaskText,
|
|
945
|
+
useMatcap,
|
|
946
|
+
useParallax,
|
|
947
|
+
useParticleHero,
|
|
948
|
+
usePile,
|
|
949
|
+
usePop,
|
|
950
|
+
useRadialMenu,
|
|
951
|
+
useRecipe,
|
|
952
|
+
useReflow,
|
|
953
|
+
useRepelBento,
|
|
954
|
+
useReveal,
|
|
955
|
+
useRotator,
|
|
956
|
+
useShaderBlur,
|
|
957
|
+
useShaderGrain,
|
|
958
|
+
useSlotText,
|
|
959
|
+
useSnapStrip,
|
|
960
|
+
useSortable,
|
|
961
|
+
useSpringCards,
|
|
962
|
+
useStretchFooter,
|
|
963
|
+
useTabs,
|
|
964
|
+
useTextRoll,
|
|
965
|
+
useTheme,
|
|
966
|
+
useTicketMenu,
|
|
967
|
+
useWords
|
|
968
|
+
};
|
|
969
|
+
//# sourceMappingURL=index.js.map
|