fancy-ui-vue 0.3.0 → 0.4.1

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.
Files changed (102) hide show
  1. package/README.md +9 -6
  2. package/dist/components/animated-testimonials/AnimatedTestimonials.vue.js +23 -12
  3. package/dist/components/bg-falling-stars/FallingStarsBg.vue.js +10 -1
  4. package/dist/components/bg-falling-stars/bg-falling-stars-core.d.ts +6 -0
  5. package/dist/components/bg-falling-stars/bg-falling-stars-core.js +24 -2
  6. package/dist/components/bg-stars/StarsBackground.vue.js +1 -1
  7. package/dist/components/bg-stars/StarsBackground.vue2.js +13 -1
  8. package/dist/components/bg-stars/bg-stars-core.d.ts +6 -0
  9. package/dist/components/bg-stars/bg-stars-core.js +21 -1
  10. package/dist/components/book/Book.vue.js +5 -83
  11. package/dist/components/book/Book.vue2.js +82 -1
  12. package/dist/components/box-reveal/BoxReveal.vue.js +5 -47
  13. package/dist/components/box-reveal/BoxReveal.vue2.js +48 -1
  14. package/dist/components/compare/StarField.vue.js +1 -1
  15. package/dist/components/container-text-flip/ContainerTextFlip.vue.js +1 -1
  16. package/dist/components/container-text-flip/ContainerTextFlip.vue2.js +14 -5
  17. package/dist/components/flickering-grid/FlickeringGrid.vue.js +19 -1
  18. package/dist/components/flickering-grid/flickering-grid-core.d.ts +6 -0
  19. package/dist/components/flickering-grid/flickering-grid-core.js +30 -1
  20. package/dist/components/flip-words/FlipWords.vue.js +1 -1
  21. package/dist/components/flip-words/FlipWords.vue2.js +14 -7
  22. package/dist/components/hyper-text/HyperText.vue.js +6 -97
  23. package/dist/components/hyper-text/HyperText.vue2.js +101 -0
  24. package/dist/components/letter-pullup/LetterPullup.vue.js +6 -38
  25. package/dist/components/letter-pullup/LetterPullup.vue2.js +40 -0
  26. package/dist/components/logo-cloud/AnimatedLogoCloud.vue.js +1 -1
  27. package/dist/components/magnetic-field/MagnetPuck.vue.d.ts +51 -0
  28. package/dist/components/magnetic-field/MagnetPuck.vue.js +7 -0
  29. package/dist/components/magnetic-field/MagnetPuck.vue2.js +191 -0
  30. package/dist/components/magnetic-field/MagneticField.vue.d.ts +39 -0
  31. package/dist/components/magnetic-field/MagneticField.vue.js +7 -0
  32. package/dist/components/magnetic-field/MagneticField.vue2.js +157 -0
  33. package/dist/components/magnetic-field/MagneticItem.vue.d.ts +28 -0
  34. package/dist/components/magnetic-field/MagneticItem.vue.js +7 -0
  35. package/dist/components/magnetic-field/MagneticItem.vue2.js +72 -0
  36. package/dist/components/magnetic-field/index.d.ts +10 -0
  37. package/dist/components/magnetic-field/magnetic-field-core.d.ts +163 -0
  38. package/dist/components/magnetic-field/magnetic-field-core.js +534 -0
  39. package/dist/components/magnetic-field/magnetic-field-source.d.ts +58 -0
  40. package/dist/components/magnetic-field/magnetic-field-source.js +58 -0
  41. package/dist/components/magnetic-field/types.d.ts +14 -0
  42. package/dist/components/magnetic-field/types.js +5 -0
  43. package/dist/components/matrix-rain/MatrixRain.vue.js +20 -1
  44. package/dist/components/matrix-rain/matrix-rain-core.d.ts +6 -0
  45. package/dist/components/matrix-rain/matrix-rain-core.js +28 -6
  46. package/dist/components/noise-reveal/NoiseReveal.vue.js +7 -0
  47. package/dist/components/noise-reveal/noise-reveal-core.js +23 -7
  48. package/dist/components/pixel-scene/PixelScene.vue.d.ts +60 -0
  49. package/dist/components/pixel-scene/PixelScene.vue.js +184 -0
  50. package/dist/components/pixel-scene/PixelScene.vue2.js +4 -0
  51. package/dist/components/pixel-scene/index.d.ts +4 -0
  52. package/dist/components/pixel-scene/pixel-scene-core.d.ts +256 -0
  53. package/dist/components/pixel-scene/pixel-scene-core.js +878 -0
  54. package/dist/components/pixel-scene/pixel-scene-hdr.d.ts +68 -0
  55. package/dist/components/pixel-scene/pixel-scene-hdr.js +312 -0
  56. package/dist/components/pixel-scene/pixel-scene-scenes.d.ts +31 -0
  57. package/dist/components/pixel-scene/pixel-scene-scenes.js +1074 -0
  58. package/dist/components/ripple/Ripple.vue.js +1 -1
  59. package/dist/components/ripple/Ripple.vue2.js +6 -1
  60. package/dist/components/sparkles/Sparkles.vue.js +10 -1
  61. package/dist/components/sparkles/sparkles-core.d.ts +6 -0
  62. package/dist/components/sparkles/sparkles-core.js +26 -2
  63. package/dist/components/sparkles-text/SparklesText.vue.js +6 -88
  64. package/dist/components/sparkles-text/SparklesText.vue2.js +100 -0
  65. package/dist/components/story-thread/StoryNode.vue.d.ts +11 -0
  66. package/dist/components/story-thread/StoryNode.vue.js +7 -0
  67. package/dist/components/story-thread/StoryNode.vue2.js +23 -0
  68. package/dist/components/story-thread/StoryThread.vue.d.ts +56 -0
  69. package/dist/components/story-thread/StoryThread.vue.js +7 -0
  70. package/dist/components/story-thread/StoryThread.vue2.js +103 -0
  71. package/dist/components/story-thread/index.d.ts +5 -0
  72. package/dist/components/story-thread/story-thread-core.d.ts +119 -0
  73. package/dist/components/story-thread/story-thread-core.js +491 -0
  74. package/dist/components/story-thread/types.d.ts +1 -0
  75. package/dist/components/sun-switch/SunSwitch.vue.d.ts +61 -0
  76. package/dist/components/sun-switch/SunSwitch.vue.js +7 -0
  77. package/dist/components/sun-switch/SunSwitch.vue2.js +559 -0
  78. package/dist/components/sun-switch/index.d.ts +4 -0
  79. package/dist/components/sun-switch/pixel-wave-core.d.ts +82 -0
  80. package/dist/components/sun-switch/pixel-wave-core.js +508 -0
  81. package/dist/components/sun-switch/sun-switch-core.d.ts +251 -0
  82. package/dist/components/sun-switch/sun-switch-core.js +546 -0
  83. package/dist/components/sun-switch/sun-switch-hdr.d.ts +70 -0
  84. package/dist/components/sun-switch/sun-switch-hdr.js +311 -0
  85. package/dist/components/terminal-text/TerminalText.vue.js +1 -1
  86. package/dist/components/terminal-text/TerminalText.vue2.js +36 -4
  87. package/dist/components/text-generate-effect/TextGenerateEffect.vue.js +5 -72
  88. package/dist/components/text-generate-effect/TextGenerateEffect.vue2.js +74 -1
  89. package/dist/components/text-reveal-card/TextRevealCard.vue.js +5 -101
  90. package/dist/components/text-reveal-card/TextRevealCard.vue2.js +98 -1
  91. package/dist/components/text-reveal-card/TextRevealStars.vue.js +1 -1
  92. package/dist/components/text-reveal-card/TextRevealStars.vue2.js +29 -12
  93. package/dist/components/tracing-beam/TracingBeam.vue.d.ts +20 -1
  94. package/dist/components/tracing-beam/TracingBeam.vue.js +5 -164
  95. package/dist/components/tracing-beam/TracingBeam.vue2.js +168 -1
  96. package/dist/index.d.ts +4 -0
  97. package/dist/index.js +361 -338
  98. package/dist/styles.css +731 -89
  99. package/package.json +1 -1
  100. package/dist/components/hyper-text/HyperText.vue3.js +0 -5
  101. package/dist/components/letter-pullup/LetterPullup.vue3.js +0 -5
  102. package/dist/components/sparkles-text/SparklesText.vue3.js +0 -5
package/README.md CHANGED
@@ -10,7 +10,7 @@ Animated UI components for **Vue 3.5+**, styled with Tailwind CSS v4 — the
10
10
  ![Vue](https://img.shields.io/badge/Vue-3.5+-42B883?logo=vuedotjs&logoColor=white)
11
11
  ![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-4-06B6D4?logo=tailwindcss&logoColor=white)
12
12
  ![TypeScript](https://img.shields.io/badge/TypeScript-5-3178C6?logo=typescript&logoColor=white)
13
- ![Components](https://img.shields.io/badge/Components-151-8B5CF6)
13
+ ![Components](https://img.shields.io/badge/Components-155-8B5CF6)
14
14
  ![MIT License](https://img.shields.io/badge/License-MIT-green)
15
15
 
16
16
  <p align="center">
@@ -40,10 +40,10 @@ Animated UI components for **Vue 3.5+**, styled with Tailwind CSS v4 &mdash; the
40
40
 
41
41
  ## Features
42
42
 
43
- - **151 components** &mdash; core primitives (forms, navigation, overlays) alongside buttons, text animations, backgrounds, cursors, AI/chat building blocks and a micro-interactions collection
43
+ - **155 components** &mdash; core primitives (forms, navigation, overlays) alongside buttons, text animations, backgrounds, cursors, AI/chat building blocks and a micro-interactions collection
44
44
  - **Motion that feels physical** &mdash; beams of light, liquid-metal and neon borders, a physical flip card, a before/after slider with a motion trail, a datamosh page transition; springs and WebGL where they earn their keep
45
45
  - **Idiomatic Vue 3.5** &mdash; `<script setup>` single-file components, reactive props destructuring, `defineModel` for every bindable (`v-model:<name>`), snippets as named and scoped slots, `defineExpose` wherever the Svelte source exposes a `ref`; every other prop keeps its Svelte name
46
- - **Same components, three frameworks** &mdash; All 151 components of `fancy-ui-svelte` are ported, under the same names and with the same visual contract; the [Svelte package](https://github.com/RamaHerbin/fancy-ui#readme) is the reference, [`fancy-ui-react`](https://github.com/RamaHerbin/fancy-ui/tree/main/react#readme) the React edition, and parity is checked in CI
46
+ - **Same components, three frameworks** &mdash; All 155 components of `fancy-ui-svelte` are ported, under the same names and with the same visual contract; the [Svelte package](https://github.com/RamaHerbin/fancy-ui#readme) is the reference, [`fancy-ui-react`](https://github.com/RamaHerbin/fancy-ui/tree/main/react#readme) the React edition, and parity is checked in CI
47
47
  - **Tailwind CSS v4** &mdash; one CSS import, semantic colour tokens, light and dark themes that follow the OS or a `.dark` class
48
48
  - **Accessible and SSR-safe** &mdash; keyboard support where it applies, `prefers-reduced-motion` respected, a `seed` prop wherever the source randomises in render so server and client agree, clean hydration under Nuxt, canvas and WebGL work deferred to mount
49
49
  - **Opt-in sound** &mdash; eleven synthesised interface cues, a `SoundToggle` switch and the `useSound` / `useSoundFeedback` composables; silent until the user turns it on
@@ -153,6 +153,10 @@ Out of the box the package follows the operating-system preference: `dark:` util
153
153
 
154
154
  `tailwind.css` is what makes that work, in three parts: it declares the `.dark` token block, it declares a `dark` variant that matches a `.dark` ancestor OR the media query (unless a `.light` ancestor opts out), and it sets `color-scheme: light dark` on `:root` with `.dark` / `.light` overrides so the components' `light-dark()` colours &mdash; and the browser's own form controls, scrollbars and caret &mdash; resolve the same way. An app that declares its own `@custom-variant dark` after the import keeps its own definition.
155
155
 
156
+ ### Nuxt
157
+
158
+ The setup above works as-is in Nuxt (add `@tailwindcss/vite` to `vite.plugins`). A Nuxt module, [`fancy-ui-nuxt`](https://github.com/RamaHerbin/fancy-ui/tree/main/nuxt#readme), auto-imports every component as `<Fancy…>`, adds `styles.css` and auto-imports the sound composables; it lives in this repo and is not yet published to npm.
159
+
156
160
  ### Server rendering
157
161
 
158
162
  The package is written for SSR: the `examples/nuxt-app` consumer in this repo is generated in CI with `failOnError` on, so a component that breaks server rendering or hydration fails the build. Three rules follow from that and are worth knowing:
@@ -282,7 +286,7 @@ Components are named by their exported Vue name.
282
286
  ### Package-level rules
283
287
 
284
288
  - **props**: `<Name>Props` hold the component's own props only, never a `ButtonHTMLAttributes`-style intersection or Svelte's `Omit<HTMLAttributes<…>, …>` fold-in, so native attributes are untyped. Every component sets `inheritAttrs: false` and writes `v-bind="attrs"` only where the Svelte source spreads `{...restProps}`, at the same position, so attributes the component sets after it (`data-state`, `data-position`, `data-panel-side`) still win.
285
- - These components forward native attributes and listeners (rules in [PORTING.md](https://github.com/RamaHerbin/fancy-ui/blob/main/vue/PORTING.md#native-attributes)): Autocomplete, BentoGrid, BentoGridCard, BentoGridItem, Book, BookDescription, BookHeader, BookTitle, BoxReveal, Button, Checkbox, Combobox, ComposerInput, ComposerModelPicker, ComposerSubmit, ConfettiButton, ContainerTextFlip, CopyButton, DatamoshTransition, DatePicker, DimSiblings, DropdownMenuItem, DropdownMenuSubTrigger, DropdownMenuTrigger, FileUpload, GradientButton, IconButton, InlineCitation, Input, InteractiveHoverButton, LetterPullup, LineHoverLink, Link, Magnetic (outer wrapper), MosaicGlow, NavbarLink, NavigationMenuLink, NavigationMenuTrigger, NeonBorder, NumberInput, PasswordInput, PixelLoader, Popover, Presence, Pressable, PulseBeam, RadioGroup, RadioGroupItem, RainbowButton, Reveal, RippleButton, ScrollProgress, SearchInput, Select, ShimmerButton, Skeleton, Slider, SourcesTrigger, StatusMorph, StickyScroll, Switch, TabsTrigger, TerminalBlock, Textarea, TextRoll, TimePicker, Toggle, ToggleGroupItem, TypingIndicator. Button, CopyButton and IconButton land them on the `<button>` (Button and IconButton on the `<a>` once `href` is set). Capture-phase listeners (`@click.capture`) are stripped while Button or IconButton is disabled or loading; the Svelte and React ports do not guard capture-phase listeners. Targets: Input, Textarea, PasswordInput, SearchInput and NumberInput → inner `<input>` / `<textarea>`; Link, LineHoverLink, NavbarLink, NavigationMenuLink and InlineCitation → their anchor (InlineCitation's marker is a `<button>` when unlinked), where the managed `aria-current`, `aria-disabled`, `tabindex`, `target`, `rel` and label win while they apply; Book, BookHeader, BookTitle and BookDescription → their own element; the other display components (BoxReveal, BentoGrid, BentoGridItem, BentoGridCard, ContainerTextFlip, LetterPullup, NeonBorder, PixelLoader, TerminalBlock, TypingIndicator) → their root, where managed `role`, `aria-live` and `data-state` win and a consumer `style` merges; Checkbox, Switch, Slider, RadioGroup, RadioGroupItem and FileUpload → their native input or group, where `@change` / `@input` are declared camelCase `onChange` (Slider also `onInput`); Select, Combobox, Autocomplete, DatePicker and TimePicker → trigger or input, with the component's invariants merged after the attributes. Triggers and items: DropdownMenuTrigger, DropdownMenuItem, DropdownMenuSubTrigger, TabsTrigger, NavigationMenuTrigger, SourcesTrigger, Toggle, ToggleGroupItem, Popover (trigger button; `class` and `ref` still target the panel) and ComposerSubmit and ComposerModelPicker → their button, ComposerInput → textarea; they declare camelCase `onClick`, `onKeydown`, `onFocus`, `onMouseenter` and `onMouseleave` (skipped while disabled), and managed `role`, `type`, `aria-expanded`, `aria-controls`, `aria-selected`, `aria-pressed` and roving `tabindex` win. A consumer `style` merges with the component's own custom properties (`mergeProps`) instead of overwriting them the way a later `{...restProps}` would.
289
+ - These components forward native attributes and listeners (rules in [PORTING.md](https://github.com/RamaHerbin/fancy-ui/blob/main/vue/PORTING.md#native-attributes)): Autocomplete, BentoGrid, BentoGridCard, BentoGridItem, Book, BookDescription, BookHeader, BookTitle, BoxReveal, Button, Checkbox, Combobox, ComposerInput, ComposerModelPicker, ComposerSubmit, ConfettiButton, ContainerTextFlip, CopyButton, DatamoshTransition, DatePicker, DimSiblings, DropdownMenuItem, DropdownMenuSubTrigger, DropdownMenuTrigger, FileUpload, GradientButton, IconButton, InlineCitation, Input, InteractiveHoverButton, LetterPullup, LineHoverLink, Link, MagnetPuck, Magnetic (outer wrapper), MagneticField, MagneticItem (outer wrapper), MosaicGlow, NavbarLink, NavigationMenuLink, NavigationMenuTrigger, NeonBorder, NumberInput, PasswordInput, PixelLoader, Popover, Presence, Pressable, PulseBeam, RadioGroup, RadioGroupItem, RainbowButton, Reveal, RippleButton, ScrollProgress, SearchInput, Select, ShimmerButton, Skeleton, Slider, SourcesTrigger, StatusMorph, StickyScroll, Switch, TabsTrigger, TerminalBlock, Textarea, TextRoll, TimePicker, Toggle, ToggleGroupItem, TypingIndicator. Button, CopyButton and IconButton land them on the `<button>` (Button and IconButton on the `<a>` once `href` is set). Capture-phase listeners (`@click.capture`) are stripped while Button or IconButton is disabled or loading; the Svelte and React ports do not guard capture-phase listeners. Targets: Input, Textarea, PasswordInput, SearchInput and NumberInput → inner `<input>` / `<textarea>`; Link, LineHoverLink, NavbarLink, NavigationMenuLink and InlineCitation → their anchor (InlineCitation's marker is a `<button>` when unlinked), where the managed `aria-current`, `aria-disabled`, `tabindex`, `target`, `rel` and label win while they apply; Book, BookHeader, BookTitle and BookDescription → their own element; the other display components (BoxReveal, BentoGrid, BentoGridItem, BentoGridCard, ContainerTextFlip, LetterPullup, NeonBorder, PixelLoader, TerminalBlock, TypingIndicator) → their root, where managed `role`, `aria-live` and `data-state` win and a consumer `style` merges; Checkbox, Switch, Slider, RadioGroup, RadioGroupItem and FileUpload → their native input or group, where `@change` / `@input` are declared camelCase `onChange` (Slider also `onInput`); Select, Combobox, Autocomplete, DatePicker and TimePicker → trigger or input, with the component's invariants merged after the attributes. Triggers and items: DropdownMenuTrigger, DropdownMenuItem, DropdownMenuSubTrigger, TabsTrigger, NavigationMenuTrigger, SourcesTrigger, Toggle, ToggleGroupItem, Popover (trigger button; `class` and `ref` still target the panel) and ComposerSubmit and ComposerModelPicker → their button, ComposerInput → textarea; they declare camelCase `onClick`, `onKeydown`, `onFocus`, `onMouseenter` and `onMouseleave` (skipped while disabled), and managed `role`, `type`, `aria-expanded`, `aria-controls`, `aria-selected`, `aria-pressed` and roving `tabindex` win. A consumer `style` merges with the component's own custom properties (`mergeProps`) instead of overwriting them the way a later `{...restProps}` would.
286
290
  - Every component not listed above is closed, exactly as in Svelte: an `id`, `data-*`, `aria-*` or `@click` put on it is dropped silently (`<Dialog id="x" data-foo="bar">` renders neither), which differs from Vue's default fallthrough.
287
291
  - **boolean props**: a DOM attribute the component reads is a declared Boolean prop rather than a value read off `$attrs`, so a bare `<RippleButton disabled>` is `true`, not the falsy string `""` that would let the sound cue play: `disabled` on GradientButton, InteractiveHoverButton, RippleButton, ShimmerButton. Vue's Boolean casting applies to every Boolean prop: `<ChatMessageAction active="">` is `true` where Svelte renders `aria-pressed=""` (`active` keeps three states through an explicit `undefined` default), and ReasoningPanel's bare `open` is `true`.
288
292
  - **class**: `class` is a declared prop typed `HTMLAttributes["class"]` (string, array or object) rather than `string`, merged once by `cn()` at the Svelte call site and argument position and never doubled through `$attrs`. Exceptions: ReviewCard (Marquee) declares no `class`, as in Svelte, so a `class` on it is dropped, and the renderless roots ContextMenu, DropdownMenu and DropdownMenuSub have none; LiquidGlass keeps `containerClass` a `string`; FrostedGlass's `class` still targets the content layer and `containerClass` the outer container.
@@ -336,7 +340,7 @@ Components are named by their exported Vue name.
336
340
  - **composables**: composables expose no `destroy()`; cleanup runs through `onScopeDispose`. Focus-trap composables return a handle (`returnFocusNow` / `rearm`) instead of imperative action methods. Media-query and similar composables keep an explicit `start` / `stop` pair and accept getter-shaped options, as the Svelte actions do.
337
341
  - **hydration**: sound preferences hydrate explicitly in `onMounted` (`hydrateSound()`) rather than reading `localStorage` during setup, because Vue's production hydration does not patch an attribute mismatch introduced by an eagerly read client-only preference.
338
342
  - **vue floor**: Vue 3.5 is the floor, not just the minimum peer range: the port relies on reactive props destructuring, `useTemplateRef`, `onWatcherCleanup` and `<Teleport defer>`.
339
- - **upstream fixes**: a handful of proven bugs surfaced while porting `fancy-ui-react` were fixed on the Svelte source itself, and the Vue port inherits those fixes. The review of the Vue port surfaced more, fixed here first with Svelte parity pending (each listed under its component below): animated-testimonials, animated-tooltip, autocomplete, compare, confetti, copy-button, focus, inline-citation, number-input, rainbow-button, select, text-generate-effect, tooltip, tracing-beam.
343
+ - **upstream fixes**: a handful of proven bugs surfaced while porting `fancy-ui-react` were fixed on the Svelte source itself, and the Vue port inherits those fixes. The review of the Vue port surfaced more, fixed here first with Svelte parity pending (each listed under its component below): animated-testimonials, animated-tooltip, autocomplete, compare, confetti, copy-button, focus, inline-citation, number-input, rainbow-button, select, text-generate-effect, tooltip.
340
344
  - **not listed**: implementation-only differences with no consumer surface (template duplication, style-object plumbing, internal helper types, test-fixture transpositions) are not recorded here. A component without a bullet below differs from Svelte only through the rules above.
341
345
 
342
346
  ### Per component
@@ -398,7 +402,6 @@ Components are named by their exported Vue name.
398
402
  - **toast**: The entrance and exit move from `<Toast>` to `<Toaster>`: a `<Toast>` rendered directly by a consumer paints at rest and no longer animates itself in or out. Through `<Toaster>` the motion is unchanged — same preset, 300ms/8px arrival, 200ms/4px departure, same reduced-motion collapse (parity with the React port).
399
403
  - **tool-call**: The auto-open for a failure is keyed on the `call.status` VALUE, not on the `call` object identity: handing the card a fresh `call` object whose status is still `"error"` does not re-fire the auto-open. Observable only when a consumer drives `open` from outside AND re-creates the `call` object (same as the React port).
400
404
  - **tooltip**: the tooltip appends its id to the trigger's existing `aria-describedby` list and removes only that id on close, instead of overwriting the attribute and then deleting it; it also rewires its listeners and `aria-describedby` onto a replacement trigger when the slot swaps its first element (upstream fixes, Svelte parity pending).
401
- - **tracing-beam**: each instance uses its own generated gradient id (`useFancyId()`) for the gradient and its stroke reference, so two beams on one page no longer share one spring-animated gradient (upstream fix, Svelte parity pending).
402
405
 
403
406
  ## Tech Stack
404
407
 
@@ -1,6 +1,7 @@
1
- import { defineComponent, ref, watch, onMounted, onBeforeUnmount, computed, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, Fragment, renderList, normalizeStyle, toDisplayString } from "vue";
1
+ import { defineComponent, ref, watch, onMounted, onBeforeUnmount, computed, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, Fragment, renderList, toDisplayString } from "vue";
2
2
  import { cn } from "../../utils.js";
3
3
  import { useSoundCue } from "../../sound/use-sound.js";
4
+ import { useReducedMotion } from "../../internals/motion/use-media-query.js";
4
5
  const _hoisted_1 = {
5
6
  key: 0,
6
7
  class: "text-muted-foreground text-center"
@@ -37,11 +38,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
37
38
  const direction = ref("next");
38
39
  const isAnimating = ref(false);
39
40
  const isHovered = ref(false);
41
+ const isFocused = ref(false);
42
+ const reducedMotion = useReducedMotion();
40
43
  let navigateTimer = null;
41
44
  function navigate(dir, fromUser = false) {
42
45
  if (isAnimating.value || __props.testimonials.length === 0) return;
43
46
  if (__props.sound && fromUser && __props.testimonials.length > 1) playCue("select");
44
47
  direction.value = dir;
48
+ if (reducedMotion.value) {
49
+ const n = __props.testimonials.length;
50
+ activeIndex.value = dir === "next" ? (activeIndex.value + 1) % n : (activeIndex.value - 1 + n) % n;
51
+ return;
52
+ }
45
53
  isAnimating.value = true;
46
54
  navigateTimer = setTimeout(() => {
47
55
  const count = __props.testimonials.length;
@@ -61,12 +69,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
61
69
  [
62
70
  () => __props.autoplay,
63
71
  () => isHovered.value,
72
+ () => isFocused.value,
73
+ () => reducedMotion.value,
64
74
  () => __props.interval,
65
75
  () => __props.testimonials,
66
76
  () => __props.testimonials.length
67
77
  ],
68
78
  (_v, _o, onCleanup) => {
69
- if (!__props.autoplay || isHovered.value || __props.testimonials.length === 0) return;
79
+ if (!__props.autoplay || isHovered.value || isFocused.value || reducedMotion.value || __props.testimonials.length === 0)
80
+ return;
70
81
  const timer = setInterval(() => navigate("next"), __props.interval);
71
82
  onCleanup(() => clearInterval(timer));
72
83
  },
@@ -89,6 +100,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
89
100
  ),
90
101
  onMouseenter: _cache[2] || (_cache[2] = ($event) => isHovered.value = true),
91
102
  onMouseleave: _cache[3] || (_cache[3] = ($event) => isHovered.value = false),
103
+ onFocusin: _cache[4] || (_cache[4] = ($event) => isFocused.value = true),
104
+ onFocusout: _cache[5] || (_cache[5] = ($event) => isFocused.value = false),
92
105
  role: "region",
93
106
  "aria-label": "Testimonials"
94
107
  }, [
@@ -99,12 +112,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
99
112
  key: index,
100
113
  class: normalizeClass(
101
114
  unref(cn)(
102
- "absolute inset-0 h-full w-full origin-bottom rounded-3xl ease-in-out motion-safe:transition-all",
115
+ "absolute inset-0 h-full w-full origin-bottom rounded-3xl ease-in-out motion-safe:transition-all motion-safe:duration-300",
103
116
  index === activeIndex.value ? "z-20 translate-y-0 scale-100 rotate-0 opacity-100" : "z-10 translate-y-4 scale-95 opacity-0",
104
117
  index !== activeIndex.value && direction.value === "next" ? "-translate-y-4" : index !== activeIndex.value ? "translate-y-4" : ""
105
118
  )
106
- ),
107
- style: normalizeStyle(`transition-duration: ${TRANSITION_DURATION}ms`)
119
+ )
108
120
  }, [
109
121
  createElementVNode("img", {
110
122
  src: testimonial.src,
@@ -112,32 +124,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
112
124
  class: "h-full w-full rounded-3xl object-cover object-center",
113
125
  draggable: "false"
114
126
  }, null, 8, _hoisted_4)
115
- ], 6);
127
+ ], 2);
116
128
  }), 128))
117
129
  ]),
118
130
  createElementVNode("div", _hoisted_5, [
119
131
  createElementVNode("div", {
120
132
  class: normalizeClass(
121
133
  unref(cn)(
122
- "ease-in-out",
134
+ "ease-in-out motion-safe:transition-[opacity,transform] motion-safe:duration-300",
123
135
  isAnimating.value ? direction.value === "next" ? "translate-y-4 opacity-0" : "-translate-y-4 opacity-0" : "translate-y-0 opacity-100"
124
136
  )
125
- ),
126
- style: normalizeStyle(`transition: opacity ${TRANSITION_DURATION}ms, transform ${TRANSITION_DURATION}ms`)
137
+ )
127
138
  }, [
128
139
  createElementVNode("p", _hoisted_6, toDisplayString(activeTestimonial.value?.quote), 1),
129
140
  createElementVNode("div", _hoisted_7, [
130
141
  createElementVNode("p", _hoisted_8, toDisplayString(activeTestimonial.value?.name), 1),
131
142
  createElementVNode("p", _hoisted_9, toDisplayString(activeTestimonial.value?.designation), 1)
132
143
  ])
133
- ], 6),
144
+ ], 2),
134
145
  createElementVNode("div", _hoisted_10, [
135
146
  createElementVNode("button", {
136
147
  type: "button",
137
148
  onClick: _cache[0] || (_cache[0] = ($event) => navigate("prev", true)),
138
149
  class: "group/button flex h-10 w-10 items-center justify-center rounded-full bg-gray-100 transition-colors hover:bg-gray-200 dark:bg-neutral-800 dark:hover:bg-neutral-700",
139
150
  "aria-label": "Previous testimonial"
140
- }, [..._cache[4] || (_cache[4] = [
151
+ }, [..._cache[6] || (_cache[6] = [
141
152
  createElementVNode("svg", {
142
153
  xmlns: "http://www.w3.org/2000/svg",
143
154
  width: "20",
@@ -158,7 +169,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
158
169
  onClick: _cache[1] || (_cache[1] = ($event) => navigate("next", true)),
159
170
  class: "group/button flex h-10 w-10 items-center justify-center rounded-full bg-gray-100 transition-colors hover:bg-gray-200 dark:bg-neutral-800 dark:hover:bg-neutral-700",
160
171
  "aria-label": "Next testimonial"
161
- }, [..._cache[5] || (_cache[5] = [
172
+ }, [..._cache[7] || (_cache[7] = [
162
173
  createElementVNode("svg", {
163
174
  xmlns: "http://www.w3.org/2000/svg",
164
175
  width: "20",
@@ -1,5 +1,6 @@
1
1
  import { defineComponent, useTemplateRef, watch, onMounted, onBeforeUnmount, createElementBlock, openBlock, normalizeClass, unref } from "vue";
2
2
  import { cn } from "../../utils.js";
3
+ import { useReducedMotion } from "../../internals/motion/use-media-query.js";
3
4
  import { createFallingStars } from "./bg-falling-stars-core.js";
4
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
6
  ...{ name: "FallingStarsBg", inheritAttrs: false },
@@ -13,6 +14,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
14
  const canvasRef = useTemplateRef("canvas");
14
15
  let engine = null;
15
16
  let resizeObserver = null;
17
+ const reducedMotion = useReducedMotion();
16
18
  watch(
17
19
  () => __props.color,
18
20
  (nextColor) => {
@@ -23,7 +25,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
25
  onMounted(() => {
24
26
  const canvas = canvasRef.value;
25
27
  if (!canvas) return;
26
- engine = createFallingStars({ canvas }, { count: __props.count, color: __props.color });
28
+ engine = createFallingStars({ canvas }, { count: __props.count, color: __props.color, reducedMotion: reducedMotion.value });
27
29
  resizeObserver = new ResizeObserver(() => engine?.resize());
28
30
  resizeObserver.observe(canvas);
29
31
  });
@@ -31,6 +33,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
33
  engine?.destroy();
32
34
  resizeObserver?.disconnect();
33
35
  });
36
+ watch(
37
+ reducedMotion,
38
+ (next) => {
39
+ engine?.setOptions({ reducedMotion: next });
40
+ },
41
+ { flush: "post" }
42
+ );
34
43
  return (_ctx, _cache) => {
35
44
  return openBlock(), createElementBlock("canvas", {
36
45
  ref: "canvas",
@@ -11,6 +11,12 @@ export interface FallingStarsInitOptions {
11
11
  export interface FallingStarsLiveOptions {
12
12
  /** Star color: a hex string, or `currentColor` (default) to follow the text colour. */
13
13
  color?: string;
14
+ /**
15
+ * Reduced-motion preference, owned by the wrapper (the core never reads
16
+ * `matchMedia`). When true the engine paints one still frame and idles; a
17
+ * flip back to false resumes the loop.
18
+ */
19
+ reducedMotion?: boolean;
14
20
  }
15
21
  export interface FallingStarsEngine {
16
22
  setOptions(next: Partial<FallingStarsLiveOptions>): void;
@@ -57,6 +57,7 @@ function createFallingStars(el, options, random = Math.random) {
57
57
  let perspective = 0;
58
58
  let stars = [];
59
59
  let rafId = 0;
60
+ let reducedMotion = options.reducedMotion ?? false;
60
61
  let destroyed = false;
61
62
  function resize() {
62
63
  if (destroyed) return;
@@ -72,6 +73,7 @@ function createFallingStars(el, options, random = Math.random) {
72
73
  ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
73
74
  }
74
75
  perspective = width / 2;
76
+ if (reducedMotion && rafId === 0 && stars.length > 0) loop();
75
77
  }
76
78
  function drawStar(star, width, height, rgb) {
77
79
  if (!ctx) return;
@@ -121,6 +123,10 @@ function createFallingStars(el, options, random = Math.random) {
121
123
  star.y = (random() - 0.5) * 2 * height;
122
124
  }
123
125
  }
126
+ if (reducedMotion) {
127
+ rafId = 0;
128
+ return;
129
+ }
124
130
  rafId = requestAnimationFrame(loop);
125
131
  }
126
132
  resize();
@@ -135,17 +141,33 @@ function createFallingStars(el, options, random = Math.random) {
135
141
  speed: random() * 5 + 2
136
142
  });
137
143
  }
138
- rafId = requestAnimationFrame(loop);
144
+ if (reducedMotion) loop();
145
+ else rafId = requestAnimationFrame(loop);
146
+ const themeObserver = typeof MutationObserver !== "undefined" ? new MutationObserver(() => {
147
+ if (reducedMotion && rafId === 0 && CURRENT_COLOR.test(color)) loop();
148
+ }) : null;
149
+ themeObserver?.observe(document.documentElement, {
150
+ attributes: true,
151
+ attributeFilter: ["class"]
152
+ });
139
153
  return {
140
154
  setOptions(next) {
141
- if (next.color !== void 0) {
155
+ if (destroyed) return;
156
+ const wasReduced = reducedMotion;
157
+ if (next.reducedMotion !== void 0) reducedMotion = next.reducedMotion;
158
+ if (next.color !== void 0 && next.color !== color) {
142
159
  color = next.color;
160
+ if (reducedMotion && rafId === 0) loop();
161
+ }
162
+ if (wasReduced && !reducedMotion && rafId === 0) {
163
+ rafId = requestAnimationFrame(loop);
143
164
  }
144
165
  },
145
166
  resize,
146
167
  destroy() {
147
168
  if (destroyed) return;
148
169
  destroyed = true;
170
+ themeObserver?.disconnect();
149
171
  if (rafId) cancelAnimationFrame(rafId);
150
172
  }
151
173
  };
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./StarsBackground.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const StarsBackground = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-065f7ce0"]]);
4
+ const StarsBackground = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-51fcced5"]]);
5
5
  export {
6
6
  StarsBackground as default
7
7
  };
@@ -1,5 +1,6 @@
1
1
  import { defineComponent, computed, useTemplateRef, onMounted, onBeforeUnmount, watch, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, renderSlot, normalizeStyle } from "vue";
2
2
  import { cn } from "../../utils.js";
3
+ import { useReducedMotion } from "../../internals/motion/use-media-query.js";
3
4
  import { generateStars, createBgStars } from "./bg-stars-core.js";
4
5
  const _hoisted_1 = {
5
6
  ref: "parallax",
@@ -41,11 +42,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
41
42
  const hostRef = useTemplateRef("host");
42
43
  const parallaxRef = useTemplateRef("parallax");
43
44
  let engine = null;
45
+ const reducedMotion = useReducedMotion();
44
46
  onMounted(() => {
45
47
  const host = hostRef.value;
46
48
  const parallax = parallaxRef.value;
47
49
  if (!host || !parallax) return;
48
- engine = createBgStars({ host, parallax }, { factor: __props.factor, stiffness: __props.stiffness, damping: __props.damping });
50
+ engine = createBgStars(
51
+ { host, parallax },
52
+ { factor: __props.factor, stiffness: __props.stiffness, damping: __props.damping, reducedMotion: reducedMotion.value }
53
+ );
49
54
  });
50
55
  onBeforeUnmount(() => {
51
56
  engine?.destroy();
@@ -61,6 +66,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
61
66
  const layer1Duration = computed(() => `${__props.speed}s`);
62
67
  const layer2Duration = computed(() => `${__props.speed * 2}s`);
63
68
  const layer3Duration = computed(() => `${__props.speed * 3}s`);
69
+ watch(
70
+ reducedMotion,
71
+ (next) => {
72
+ engine?.setOptions({ reducedMotion: next });
73
+ },
74
+ { flush: "post" }
75
+ );
64
76
  return (_ctx, _cache) => {
65
77
  return openBlock(), createElementBlock("div", {
66
78
  ref: "host",
@@ -16,6 +16,12 @@ export interface BgStarsLiveOptions {
16
16
  stiffness?: number;
17
17
  /** Spring damping for parallax (default: 20). */
18
18
  damping?: number;
19
+ /**
20
+ * Reduced-motion preference, owned by the wrapper (the core never reads
21
+ * `matchMedia`). When true the parallax is parked at rest and the loop idles;
22
+ * a flip back to false resumes it.
23
+ */
24
+ reducedMotion?: boolean;
19
25
  }
20
26
  export interface BgStarsEngine {
21
27
  setOptions(next: Partial<BgStarsLiveOptions>): void;
@@ -20,12 +20,19 @@ function createBgStars(el, options, random = Math.random) {
20
20
  let targetY = 0;
21
21
  let velocityX = 0;
22
22
  let velocityY = 0;
23
+ let reducedMotion = options.reducedMotion ?? false;
23
24
  let rafId = null;
24
25
  let destroyed = false;
25
26
  function applyTransform() {
26
27
  el.parallax.style.transform = `translate(${springX}px, ${springY}px)`;
27
28
  }
28
29
  function tick() {
30
+ if (reducedMotion) {
31
+ springX = springY = targetX = targetY = velocityX = velocityY = 0;
32
+ applyTransform();
33
+ rafId = null;
34
+ return;
35
+ }
29
36
  const forceX = (targetX - springX) * (stiffness / 1e3);
30
37
  const forceY = (targetY - springY) * (stiffness / 1e3);
31
38
  velocityX = velocityX * (1 - damping / 100) + forceX;
@@ -36,6 +43,7 @@ function createBgStars(el, options, random = Math.random) {
36
43
  rafId = requestAnimationFrame(tick);
37
44
  }
38
45
  function handleMouseMove(e) {
46
+ if (reducedMotion) return;
39
47
  const centerX = window.innerWidth / 2;
40
48
  const centerY = window.innerHeight / 2;
41
49
  targetX = -(e.clientX - centerX) * factor;
@@ -43,13 +51,25 @@ function createBgStars(el, options, random = Math.random) {
43
51
  }
44
52
  el.host.addEventListener("mousemove", handleMouseMove);
45
53
  applyTransform();
46
- rafId = requestAnimationFrame(tick);
54
+ if (!reducedMotion) rafId = requestAnimationFrame(tick);
47
55
  return {
48
56
  setOptions(next) {
49
57
  if (destroyed) return;
50
58
  if (next.factor !== void 0) factor = next.factor;
51
59
  if (next.stiffness !== void 0) stiffness = next.stiffness;
52
60
  if (next.damping !== void 0) damping = next.damping;
61
+ if (next.reducedMotion !== void 0 && next.reducedMotion !== reducedMotion) {
62
+ reducedMotion = next.reducedMotion;
63
+ if (reducedMotion) {
64
+ if (rafId !== null) {
65
+ cancelAnimationFrame(rafId);
66
+ rafId = null;
67
+ }
68
+ tick();
69
+ } else if (rafId === null) {
70
+ rafId = requestAnimationFrame(tick);
71
+ }
72
+ }
53
73
  },
54
74
  resize() {
55
75
  },
@@ -1,85 +1,7 @@
1
- import { defineComponent, useAttrs, computed, createElementBlock, openBlock, mergeProps, unref, createElementVNode, normalizeClass, normalizeStyle, renderSlot } from "vue";
2
- import { cn } from "../../utils.js";
3
- import { BOOK_COLOR_MAP, BOOK_RADIUS_MAP, BOOK_SIZE_MAP, BOOK_SHADOW_SIZE_MAP } from "./index.js";
4
- const _hoisted_1 = { class: "pl-1" };
5
- const _sfc_main = /* @__PURE__ */ defineComponent({
6
- ...{ name: "Book", inheritAttrs: false },
7
- __name: "Book",
8
- props: {
9
- class: { type: [Boolean, null, String, Object, Array], default: "" },
10
- duration: { default: 1e3 },
11
- color: { default: "zinc" },
12
- isStatic: { type: Boolean, default: false },
13
- size: { default: "md" },
14
- radius: { default: "md" },
15
- shadowSize: { default: "lg" }
16
- },
17
- setup(__props) {
18
- const props = __props;
19
- const attrs = useAttrs();
20
- const computedGradient = computed(() => BOOK_COLOR_MAP[props.color] || BOOK_COLOR_MAP.zinc);
21
- return (_ctx, _cache) => {
22
- return openBlock(), createElementBlock("div", mergeProps(unref(attrs), {
23
- class: unref(cn)(
24
- "group z-10 w-min [--shadowColor:#bbb] [perspective:800px] dark:[--shadowColor:#111]",
25
- props.class
26
- )
27
- }), [
28
- createElementVNode("div", {
29
- style: normalizeStyle({ width: unref(BOOK_SIZE_MAP)[__props.size].width, transition: `transform ${__props.duration}ms ease` }),
30
- class: normalizeClass(
31
- unref(cn)(
32
- "relative aspect-[3/4] [transform-style:preserve-3d]",
33
- __props.isStatic ? "[transform:rotateY(-30deg)]" : "[transform:rotateY(0deg)] group-hover:[transform:rotateY(-30deg)]",
34
- unref(BOOK_RADIUS_MAP)[__props.radius]
35
- )
36
- )
37
- }, [
38
- createElementVNode("div", {
39
- class: normalizeClass(
40
- unref(cn)(
41
- "absolute inset-y-0 left-0 flex size-full flex-col justify-end overflow-hidden bg-gradient-to-tr p-6 text-white",
42
- computedGradient.value.from,
43
- computedGradient.value.to,
44
- unref(BOOK_RADIUS_MAP)[__props.radius]
45
- )
46
- ),
47
- style: { "transform": "translateZ(25px)", "box-shadow": "5px 5px 20px var(--shadowColor)" }
48
- }, [
49
- _cache[0] || (_cache[0] = createElementVNode("div", {
50
- class: "absolute top-0 left-0 h-full",
51
- style: { "min-width": "8.2%", "background": "linear-gradient(\n 90deg,\n hsla(0, 0%, 100%, 0),\n hsla(0, 0%, 100%, 0) 12%,\n hsla(0, 0%, 100%, 0.25) 29.25%,\n hsla(0, 0%, 100%, 0) 50.5%,\n hsla(0, 0%, 100%, 0) 75.25%,\n hsla(0, 0%, 100%, 0.25) 91%,\n hsla(0, 0%, 100%, 0)\n ),\n linear-gradient(\n 90deg,\n rgba(0, 0, 0, 0.03),\n rgba(0, 0, 0, 0.1) 12%,\n transparent 30%,\n rgba(0, 0, 0, 0.02) 50%,\n rgba(0, 0, 0, 0.2) 73.5%,\n rgba(0, 0, 0, 0.5) 75.25%,\n rgba(0, 0, 0, 0.15) 85.25%,\n transparent\n )", "opacity": "0.2" }
52
- }, null, -1)),
53
- createElementVNode("div", _hoisted_1, [
54
- renderSlot(_ctx.$slots, "default")
55
- ])
56
- ], 2),
57
- createElementVNode("div", {
58
- class: "absolute left-0 bg-white",
59
- style: normalizeStyle({
60
- top: "3px",
61
- bottom: "3px",
62
- width: "48px",
63
- transform: `translateX(${unref(BOOK_SIZE_MAP)[__props.size].spineTranslation}) rotateY(90deg)`,
64
- background: "linear-gradient(90deg, rgba(255,255,255,1) 50%, rgba(249,249,249,1) 50%)"
65
- })
66
- }, null, 4),
67
- createElementVNode("div", {
68
- class: normalizeClass(
69
- unref(cn)(
70
- "absolute inset-y-0 left-0 flex size-full flex-col justify-end overflow-hidden bg-gradient-to-tr p-6 text-white",
71
- computedGradient.value.from,
72
- computedGradient.value.to,
73
- unref(BOOK_RADIUS_MAP)[__props.radius]
74
- )
75
- ),
76
- style: normalizeStyle({ transform: "translateZ(-25px)", boxShadow: unref(BOOK_SHADOW_SIZE_MAP)[__props.shadowSize] })
77
- }, null, 6)
78
- ], 6)
79
- ], 16);
80
- };
81
- }
82
- });
1
+ import _sfc_main from "./Book.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const Book = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-05eed92f"]]);
83
5
  export {
84
- _sfc_main as default
6
+ Book as default
85
7
  };
@@ -1,4 +1,85 @@
1
- import _sfc_main from "./Book.vue.js";
1
+ import { defineComponent, useAttrs, computed, createElementBlock, openBlock, mergeProps, unref, createElementVNode, normalizeClass, normalizeStyle, renderSlot } from "vue";
2
+ import { cn } from "../../utils.js";
3
+ import { BOOK_COLOR_MAP, BOOK_RADIUS_MAP, BOOK_SIZE_MAP, BOOK_SHADOW_SIZE_MAP } from "./index.js";
4
+ const _hoisted_1 = { class: "pl-1" };
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ ...{ name: "Book", inheritAttrs: false },
7
+ __name: "Book",
8
+ props: {
9
+ class: { type: [Boolean, null, String, Object, Array], default: "" },
10
+ duration: { default: 1e3 },
11
+ color: { default: "zinc" },
12
+ isStatic: { type: Boolean, default: false },
13
+ size: { default: "md" },
14
+ radius: { default: "md" },
15
+ shadowSize: { default: "lg" }
16
+ },
17
+ setup(__props) {
18
+ const props = __props;
19
+ const attrs = useAttrs();
20
+ const computedGradient = computed(() => BOOK_COLOR_MAP[props.color] || BOOK_COLOR_MAP.zinc);
21
+ return (_ctx, _cache) => {
22
+ return openBlock(), createElementBlock("div", mergeProps(unref(attrs), {
23
+ class: unref(cn)(
24
+ "group z-10 w-min [--shadowColor:#bbb] [perspective:800px] dark:[--shadowColor:#111]",
25
+ props.class
26
+ )
27
+ }), [
28
+ createElementVNode("div", {
29
+ style: normalizeStyle({ width: unref(BOOK_SIZE_MAP)[__props.size].width, "--book-duration": `${__props.duration}ms` }),
30
+ class: normalizeClass(
31
+ unref(cn)(
32
+ "book-cover relative aspect-[3/4] [transform-style:preserve-3d]",
33
+ __props.isStatic ? "[transform:rotateY(-30deg)]" : "[transform:rotateY(0deg)] group-hover:[transform:rotateY(-30deg)]",
34
+ unref(BOOK_RADIUS_MAP)[__props.radius]
35
+ )
36
+ )
37
+ }, [
38
+ createElementVNode("div", {
39
+ class: normalizeClass(
40
+ unref(cn)(
41
+ "absolute inset-y-0 left-0 flex size-full flex-col justify-end overflow-hidden bg-gradient-to-tr p-6 text-white",
42
+ computedGradient.value.from,
43
+ computedGradient.value.to,
44
+ unref(BOOK_RADIUS_MAP)[__props.radius]
45
+ )
46
+ ),
47
+ style: { "transform": "translateZ(25px)", "box-shadow": "5px 5px 20px var(--shadowColor)" }
48
+ }, [
49
+ _cache[0] || (_cache[0] = createElementVNode("div", {
50
+ class: "absolute top-0 left-0 h-full",
51
+ style: { "min-width": "8.2%", "background": "linear-gradient(\n 90deg,\n hsla(0, 0%, 100%, 0),\n hsla(0, 0%, 100%, 0) 12%,\n hsla(0, 0%, 100%, 0.25) 29.25%,\n hsla(0, 0%, 100%, 0) 50.5%,\n hsla(0, 0%, 100%, 0) 75.25%,\n hsla(0, 0%, 100%, 0.25) 91%,\n hsla(0, 0%, 100%, 0)\n ),\n linear-gradient(\n 90deg,\n rgba(0, 0, 0, 0.03),\n rgba(0, 0, 0, 0.1) 12%,\n transparent 30%,\n rgba(0, 0, 0, 0.02) 50%,\n rgba(0, 0, 0, 0.2) 73.5%,\n rgba(0, 0, 0, 0.5) 75.25%,\n rgba(0, 0, 0, 0.15) 85.25%,\n transparent\n )", "opacity": "0.2" }
52
+ }, null, -1)),
53
+ createElementVNode("div", _hoisted_1, [
54
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
55
+ ])
56
+ ], 2),
57
+ createElementVNode("div", {
58
+ class: "absolute left-0 bg-white",
59
+ style: normalizeStyle({
60
+ top: "3px",
61
+ bottom: "3px",
62
+ width: "48px",
63
+ transform: `translateX(${unref(BOOK_SIZE_MAP)[__props.size].spineTranslation}) rotateY(90deg)`,
64
+ background: "linear-gradient(90deg, rgba(255,255,255,1) 50%, rgba(249,249,249,1) 50%)"
65
+ })
66
+ }, null, 4),
67
+ createElementVNode("div", {
68
+ class: normalizeClass(
69
+ unref(cn)(
70
+ "absolute inset-y-0 left-0 flex size-full flex-col justify-end overflow-hidden bg-gradient-to-tr p-6 text-white",
71
+ computedGradient.value.from,
72
+ computedGradient.value.to,
73
+ unref(BOOK_RADIUS_MAP)[__props.radius]
74
+ )
75
+ ),
76
+ style: normalizeStyle({ transform: "translateZ(-25px)", boxShadow: unref(BOOK_SHADOW_SIZE_MAP)[__props.shadowSize] })
77
+ }, null, 6)
78
+ ], 6)
79
+ ], 16);
80
+ };
81
+ }
82
+ });
2
83
  export {
3
84
  _sfc_main as default
4
85
  };