fancy-ui-vue 0.2.0 → 0.4.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.
Files changed (341) hide show
  1. package/PORTING.md +123 -2
  2. package/README.md +20 -15
  3. package/dist/components/accordion/Accordion.vue.d.ts +44 -0
  4. package/dist/components/accordion/Accordion.vue.js +88 -0
  5. package/dist/components/accordion/Accordion.vue2.js +4 -0
  6. package/dist/components/accordion/AccordionContent.vue.d.ts +25 -0
  7. package/dist/components/accordion/AccordionContent.vue.js +42 -0
  8. package/dist/components/accordion/AccordionContent.vue2.js +4 -0
  9. package/dist/components/accordion/AccordionItem.vue.d.ts +21 -0
  10. package/dist/components/accordion/AccordionItem.vue.js +66 -0
  11. package/dist/components/accordion/AccordionItem.vue2.js +4 -0
  12. package/dist/components/accordion/AccordionTrigger.vue.d.ts +24 -0
  13. package/dist/components/accordion/AccordionTrigger.vue.js +83 -0
  14. package/dist/components/accordion/AccordionTrigger.vue2.js +4 -0
  15. package/dist/components/accordion/accordion-core.d.ts +35 -0
  16. package/dist/components/accordion/accordion-core.js +44 -0
  17. package/dist/components/accordion/index.d.ts +11 -0
  18. package/dist/components/accordion/types.d.ts +45 -0
  19. package/dist/components/accordion/types.js +7 -0
  20. package/dist/components/alert-dialog/AlertDialog.vue.js +22 -3
  21. package/dist/components/animated-testimonials/AnimatedTestimonials.vue.js +3 -3
  22. package/dist/components/apple-card-carousel/AppleCard.vue.js +1 -1
  23. package/dist/components/autocomplete/Autocomplete.vue.js +1 -1
  24. package/dist/components/autocomplete/Autocomplete.vue2.js +22 -15
  25. package/dist/components/avatar/Avatar.vue.d.ts +27 -0
  26. package/dist/components/avatar/Avatar.vue.js +119 -0
  27. package/dist/components/avatar/Avatar.vue2.js +4 -0
  28. package/dist/components/avatar/avatar-core.d.ts +40 -0
  29. package/dist/components/avatar/avatar-core.js +57 -0
  30. package/dist/components/avatar/index.d.ts +2 -0
  31. package/dist/components/badge/Badge.vue.d.ts +21 -0
  32. package/dist/components/badge/Badge.vue.js +46 -0
  33. package/dist/components/badge/Badge.vue2.js +4 -0
  34. package/dist/components/badge/index.d.ts +2 -0
  35. package/dist/components/bento-grid/BentoFrame.vue.js +1 -1
  36. package/dist/components/bento-grid/BentoFrame.vue2.js +6 -5
  37. package/dist/components/bento-grid/BentoGrid.vue.js +1 -1
  38. package/dist/components/bento-grid/BentoGrid.vue2.js +12 -12
  39. package/dist/components/bento-grid/BentoGridCard.vue.js +6 -5
  40. package/dist/components/bento-grid/BentoGridItem.vue.js +6 -5
  41. package/dist/components/bg-falling-stars/FallingStarsBg.vue.d.ts +1 -1
  42. package/dist/components/bg-falling-stars/FallingStarsBg.vue.js +1 -1
  43. package/dist/components/bg-falling-stars/bg-falling-stars-core.d.ts +1 -1
  44. package/dist/components/bg-falling-stars/bg-falling-stars-core.js +47 -12
  45. package/dist/components/book/Book.vue.js +8 -9
  46. package/dist/components/book/BookDescription.vue.js +6 -5
  47. package/dist/components/book/BookHeader.vue.js +6 -5
  48. package/dist/components/book/BookTitle.vue.js +6 -5
  49. package/dist/components/box-reveal/BoxReveal.vue.js +6 -5
  50. package/dist/components/button/Button.vue.d.ts +6 -4
  51. package/dist/components/button/Button.vue.js +1 -1
  52. package/dist/components/button/Button.vue2.js +50 -22
  53. package/dist/components/card-3d/CardContainer.vue.js +1 -1
  54. package/dist/components/card-3d/CardItem.vue.js +1 -1
  55. package/dist/components/card-spotlight/CardSpotlight.vue.js +1 -1
  56. package/dist/components/chat-message/ChatMessageAction.vue.d.ts +4 -2
  57. package/dist/components/chat-message/ChatMessageAction.vue.js +4 -2
  58. package/dist/components/checkbox/Checkbox.vue.d.ts +2 -0
  59. package/dist/components/checkbox/Checkbox.vue.js +1 -1
  60. package/dist/components/checkbox/Checkbox.vue2.js +17 -7
  61. package/dist/components/collapsible/Collapsible.vue.d.ts +31 -0
  62. package/dist/components/collapsible/Collapsible.vue.js +60 -0
  63. package/dist/components/collapsible/Collapsible.vue2.js +4 -0
  64. package/dist/components/collapsible/CollapsibleContent.vue.d.ts +26 -0
  65. package/dist/components/collapsible/CollapsibleContent.vue.js +81 -0
  66. package/dist/components/collapsible/CollapsibleContent.vue2.js +4 -0
  67. package/dist/components/collapsible/CollapsibleTrigger.vue.d.ts +21 -0
  68. package/dist/components/collapsible/CollapsibleTrigger.vue.js +57 -0
  69. package/dist/components/collapsible/CollapsibleTrigger.vue2.js +4 -0
  70. package/dist/components/collapsible/collapsible-core.d.ts +47 -0
  71. package/dist/components/collapsible/collapsible-core.js +40 -0
  72. package/dist/components/collapsible/index.d.ts +8 -0
  73. package/dist/components/collapsible/types.d.ts +24 -0
  74. package/dist/components/collapsible/types.js +5 -0
  75. package/dist/components/combobox/Combobox.vue.js +1 -1
  76. package/dist/components/combobox/Combobox.vue2.js +24 -16
  77. package/dist/components/command-menu/CommandMenu.vue.d.ts +5 -0
  78. package/dist/components/command-menu/CommandMenu.vue.js +1 -1
  79. package/dist/components/command-menu/CommandMenu.vue2.js +5 -2
  80. package/dist/components/compare/Compare.vue.d.ts +15 -5
  81. package/dist/components/compare/Compare.vue.js +1 -1
  82. package/dist/components/compare/Compare.vue2.js +28 -13
  83. package/dist/components/composer/ComposerInput.vue.js +1 -1
  84. package/dist/components/composer/ComposerInput.vue2.js +11 -11
  85. package/dist/components/composer/ComposerModelPicker.vue.d.ts +4 -0
  86. package/dist/components/composer/ComposerModelPicker.vue.js +1 -1
  87. package/dist/components/composer/ComposerModelPicker.vue2.js +29 -15
  88. package/dist/components/composer/ComposerSubmit.vue.d.ts +2 -0
  89. package/dist/components/composer/ComposerSubmit.vue.js +16 -15
  90. package/dist/components/confetti/ConfettiButton.vue.d.ts +9 -2
  91. package/dist/components/confetti/ConfettiButton.vue.js +24 -6
  92. package/dist/components/container-text-flip/ContainerTextFlip.vue.js +1 -1
  93. package/dist/components/container-text-flip/ContainerTextFlip.vue2.js +12 -13
  94. package/dist/components/copy-button/CopyButton.vue.d.ts +5 -0
  95. package/dist/components/copy-button/CopyButton.vue.js +1 -1
  96. package/dist/components/copy-button/CopyButton.vue2.js +72 -11
  97. package/dist/components/datamosh-transition/DatamoshTransition.vue.d.ts +6 -2
  98. package/dist/components/datamosh-transition/DatamoshTransition.vue.js +7 -4
  99. package/dist/components/date-picker/DatePicker.vue.js +1 -1
  100. package/dist/components/date-picker/DatePicker.vue2.js +27 -21
  101. package/dist/components/dialog/Dialog.vue.js +20 -1
  102. package/dist/components/dialog/DialogSurface.vue.js +1 -1
  103. package/dist/components/dialog/DialogSurface.vue2.js +5 -2
  104. package/dist/components/dialog/types.d.ts +2 -0
  105. package/dist/components/direction-aware-hover/DirectionAwareHover.vue.js +1 -1
  106. package/dist/components/direction-aware-hover/DirectionAwareHover.vue2.js +9 -7
  107. package/dist/components/displacement-text/DisplacementText.vue.d.ts +4 -1
  108. package/dist/components/displacement-text/DisplacementText.vue.js +38 -11
  109. package/dist/components/displacement-text/displacement-text-core.d.ts +94 -4
  110. package/dist/components/displacement-text/displacement-text-core.js +287 -97
  111. package/dist/components/drawer/Drawer.vue.d.ts +5 -0
  112. package/dist/components/drawer/Drawer.vue.js +1 -1
  113. package/dist/components/drawer/Drawer.vue2.js +5 -2
  114. package/dist/components/dropdown-menu/DropdownMenuContent.vue.js +2 -1
  115. package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts +4 -0
  116. package/dist/components/dropdown-menu/DropdownMenuItem.vue.js +17 -10
  117. package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +8 -0
  118. package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.js +28 -13
  119. package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.d.ts +4 -0
  120. package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.js +1 -1
  121. package/dist/components/dropdown-menu/DropdownMenuTrigger.vue2.js +20 -10
  122. package/dist/components/editorial-engine/EditorialEngine.vue.js +1 -1
  123. package/dist/components/editorial-engine/engine.js +13 -0
  124. package/dist/components/file-upload/FileUpload.vue.d.ts +2 -0
  125. package/dist/components/file-upload/FileUpload.vue.js +1 -1
  126. package/dist/components/file-upload/FileUpload.vue2.js +20 -10
  127. package/dist/components/fireworks-hdr/FireworksHdr.vue.js +2 -2
  128. package/dist/components/flickering-grid/FlickeringGrid.vue.d.ts +1 -1
  129. package/dist/components/flickering-grid/FlickeringGrid.vue.js +1 -1
  130. package/dist/components/flickering-grid/flickering-grid-core.d.ts +1 -1
  131. package/dist/components/flickering-grid/flickering-grid-core.js +51 -9
  132. package/dist/components/flip-card/FlipCard.vue.d.ts +3 -1
  133. package/dist/components/flip-card/FlipCard.vue.js +1 -1
  134. package/dist/components/flip-card/FlipCard.vue2.js +5 -3
  135. package/dist/components/fluid-cursor/FluidCursor.vue.js +37 -9
  136. package/dist/components/fluid-cursor/fluid-cursor-core.js +3 -3
  137. package/dist/components/fluid-cursor/webgpu-engine.js +3 -3
  138. package/dist/components/focus/Focus.vue.js +1 -1
  139. package/dist/components/focus/Focus.vue2.js +2 -2
  140. package/dist/components/follow-button/FollowButton.vue.d.ts +69 -0
  141. package/dist/components/follow-button/FollowButton.vue.js +7 -0
  142. package/dist/components/follow-button/FollowButton.vue2.js +239 -0
  143. package/dist/components/follow-button/follow-core.d.ts +83 -0
  144. package/dist/components/follow-button/follow-core.js +92 -0
  145. package/dist/components/follow-button/index.d.ts +2 -0
  146. package/dist/components/frosted-glass/FrostedGlass.vue.js +1 -1
  147. package/dist/components/glare-card/GlareCard.vue.js +1 -1
  148. package/dist/components/glare-card/GlareCard.vue2.js +4 -4
  149. package/dist/components/glowing-effect/GlowingEffect.vue.js +3 -3
  150. package/dist/components/glowing-effect/glowing-effect-core.js +4 -1
  151. package/dist/components/gradient-button/GradientButton.vue.d.ts +6 -4
  152. package/dist/components/gradient-button/GradientButton.vue.js +1 -1
  153. package/dist/components/gradient-button/GradientButton.vue2.js +13 -3
  154. package/dist/components/icon-button/IconButton.vue.d.ts +6 -4
  155. package/dist/components/icon-button/IconButton.vue.js +11 -8
  156. package/dist/components/image-trail-cursor/ImageTrailCursor.vue.js +17 -7
  157. package/dist/components/image-trail-cursor/trail-variants.js +3 -6
  158. package/dist/components/inline-citation/InlineCitation.vue.js +1 -1
  159. package/dist/components/inline-citation/InlineCitation.vue2.js +20 -14
  160. package/dist/components/input/Input.vue.js +1 -1
  161. package/dist/components/input/Input.vue2.js +18 -8
  162. package/dist/components/interactive-grid-pattern/InteractiveGridPattern.vue.js +1 -1
  163. package/dist/components/interactive-grid-pattern/InteractiveGridPattern.vue2.js +1 -1
  164. package/dist/components/interactive-hover-button/InteractiveHoverButton.vue.d.ts +6 -3
  165. package/dist/components/interactive-hover-button/InteractiveHoverButton.vue.js +1 -1
  166. package/dist/components/interactive-hover-button/InteractiveHoverButton.vue2.js +12 -2
  167. package/dist/components/letter-pullup/LetterPullup.vue.js +4 -4
  168. package/dist/components/line-hover-link/LineHoverLink.vue.js +1 -1
  169. package/dist/components/line-hover-link/LineHoverLink.vue2.js +5 -6
  170. package/dist/components/link/Link.vue.d.ts +4 -2
  171. package/dist/components/link/Link.vue.js +1 -1
  172. package/dist/components/link/Link.vue2.js +11 -8
  173. package/dist/components/magnetic-field/MagnetPuck.vue.d.ts +51 -0
  174. package/dist/components/magnetic-field/MagnetPuck.vue.js +7 -0
  175. package/dist/components/magnetic-field/MagnetPuck.vue2.js +191 -0
  176. package/dist/components/magnetic-field/MagneticField.vue.d.ts +39 -0
  177. package/dist/components/magnetic-field/MagneticField.vue.js +7 -0
  178. package/dist/components/magnetic-field/MagneticField.vue2.js +157 -0
  179. package/dist/components/magnetic-field/MagneticItem.vue.d.ts +28 -0
  180. package/dist/components/magnetic-field/MagneticItem.vue.js +7 -0
  181. package/dist/components/magnetic-field/MagneticItem.vue2.js +72 -0
  182. package/dist/components/magnetic-field/index.d.ts +10 -0
  183. package/dist/components/magnetic-field/magnetic-field-core.d.ts +163 -0
  184. package/dist/components/magnetic-field/magnetic-field-core.js +534 -0
  185. package/dist/components/magnetic-field/magnetic-field-source.d.ts +58 -0
  186. package/dist/components/magnetic-field/magnetic-field-source.js +58 -0
  187. package/dist/components/magnetic-field/types.d.ts +14 -0
  188. package/dist/components/magnetic-field/types.js +5 -0
  189. package/dist/components/mosaic-glow/MosaicGlow.vue.d.ts +6 -0
  190. package/dist/components/mosaic-glow/MosaicGlow.vue.js +53 -9
  191. package/dist/components/mosaic-glow/mosaic-glow-core.d.ts +30 -0
  192. package/dist/components/mosaic-glow/mosaic-glow-core.js +27 -0
  193. package/dist/components/mosaic-glow/mosaic-glow-hdr.d.ts +24 -0
  194. package/dist/components/mosaic-glow/mosaic-glow-hdr.js +200 -0
  195. package/dist/components/navbar/NavbarLink.vue.d.ts +4 -2
  196. package/dist/components/navbar/NavbarLink.vue.js +1 -1
  197. package/dist/components/navbar/NavbarLink.vue2.js +16 -13
  198. package/dist/components/navigation-menu/NavigationMenu.vue.js +6 -3
  199. package/dist/components/navigation-menu/NavigationMenuLink.vue.js +1 -1
  200. package/dist/components/navigation-menu/NavigationMenuLink.vue2.js +8 -8
  201. package/dist/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +15 -0
  202. package/dist/components/navigation-menu/NavigationMenuTrigger.vue.js +1 -1
  203. package/dist/components/navigation-menu/NavigationMenuTrigger.vue2.js +36 -15
  204. package/dist/components/neon-border/NeonBorder.vue.js +1 -1
  205. package/dist/components/neon-border/NeonBorder.vue2.js +10 -11
  206. package/dist/components/number-input/NumberInput.vue.js +1 -1
  207. package/dist/components/number-input/NumberInput.vue2.js +22 -12
  208. package/dist/components/password-input/PasswordInput.vue.js +1 -1
  209. package/dist/components/password-input/PasswordInput.vue2.js +18 -11
  210. package/dist/components/pixel-loader/PixelLoader.vue.js +1 -1
  211. package/dist/components/pixel-loader/PixelLoader.vue2.js +6 -6
  212. package/dist/components/pixel-scene/PixelScene.vue.d.ts +60 -0
  213. package/dist/components/pixel-scene/PixelScene.vue.js +184 -0
  214. package/dist/components/pixel-scene/PixelScene.vue2.js +4 -0
  215. package/dist/components/pixel-scene/index.d.ts +4 -0
  216. package/dist/components/pixel-scene/pixel-scene-core.d.ts +256 -0
  217. package/dist/components/pixel-scene/pixel-scene-core.js +878 -0
  218. package/dist/components/pixel-scene/pixel-scene-hdr.d.ts +68 -0
  219. package/dist/components/pixel-scene/pixel-scene-hdr.js +312 -0
  220. package/dist/components/pixel-scene/pixel-scene-scenes.d.ts +31 -0
  221. package/dist/components/pixel-scene/pixel-scene-scenes.js +1074 -0
  222. package/dist/components/popover/Popover.vue.d.ts +4 -0
  223. package/dist/components/popover/Popover.vue.js +1 -1
  224. package/dist/components/popover/Popover.vue2.js +8 -6
  225. package/dist/components/popover/PopoverContent.vue.js +6 -2
  226. package/dist/components/pulse-beam/PulseBeam.vue.d.ts +6 -2
  227. package/dist/components/pulse-beam/PulseBeam.vue.js +1 -1
  228. package/dist/components/pulse-beam/PulseBeam.vue2.js +7 -4
  229. package/dist/components/radio-group/RadioGroup.vue.js +12 -11
  230. package/dist/components/radio-group/RadioGroupItem.vue.d.ts +2 -0
  231. package/dist/components/radio-group/RadioGroupItem.vue.js +1 -1
  232. package/dist/components/radio-group/RadioGroupItem.vue2.js +20 -7
  233. package/dist/components/rainbow-button/RainbowButton.vue.d.ts +11 -2
  234. package/dist/components/rainbow-button/RainbowButton.vue.js +1 -1
  235. package/dist/components/rainbow-button/RainbowButton.vue2.js +35 -18
  236. package/dist/components/ripple-button/RippleButton.vue.d.ts +6 -4
  237. package/dist/components/ripple-button/RippleButton.vue.js +1 -1
  238. package/dist/components/ripple-button/RippleButton.vue2.js +10 -5
  239. package/dist/components/search-input/SearchInput.vue.js +1 -1
  240. package/dist/components/search-input/SearchInput.vue2.js +19 -9
  241. package/dist/components/select/Select.vue.d.ts +1 -1
  242. package/dist/components/select/Select.vue.js +1 -1
  243. package/dist/components/select/Select.vue2.js +25 -17
  244. package/dist/components/sheet/Sheet.vue.d.ts +5 -0
  245. package/dist/components/sheet/Sheet.vue.js +5 -2
  246. package/dist/components/shimmer-button/ShimmerButton.vue.d.ts +2 -2
  247. package/dist/components/shimmer-button/ShimmerButton.vue.js +1 -1
  248. package/dist/components/shimmer-button/ShimmerButton.vue2.js +14 -6
  249. package/dist/components/sidebar/SidebarItem.vue.d.ts +4 -2
  250. package/dist/components/sidebar/SidebarItem.vue.js +1 -1
  251. package/dist/components/sidebar/SidebarItem.vue2.js +4 -2
  252. package/dist/components/slider/Slider.vue.d.ts +4 -0
  253. package/dist/components/slider/Slider.vue.js +1 -1
  254. package/dist/components/slider/Slider.vue2.js +20 -8
  255. package/dist/components/sources/SourcesTrigger.vue.js +1 -1
  256. package/dist/components/sources/SourcesTrigger.vue2.js +11 -11
  257. package/dist/components/sparkles/sparkles-core.d.ts +1 -1
  258. package/dist/components/sparkles/sparkles-core.js +36 -2
  259. package/dist/components/story-thread/StoryNode.vue.d.ts +11 -0
  260. package/dist/components/story-thread/StoryNode.vue.js +7 -0
  261. package/dist/components/story-thread/StoryNode.vue2.js +23 -0
  262. package/dist/components/story-thread/StoryThread.vue.d.ts +56 -0
  263. package/dist/components/story-thread/StoryThread.vue.js +7 -0
  264. package/dist/components/story-thread/StoryThread.vue2.js +103 -0
  265. package/dist/components/story-thread/index.d.ts +5 -0
  266. package/dist/components/story-thread/story-thread-core.d.ts +119 -0
  267. package/dist/components/story-thread/story-thread-core.js +491 -0
  268. package/dist/components/story-thread/types.d.ts +1 -0
  269. package/dist/components/sun-switch/SunSwitch.vue.d.ts +61 -0
  270. package/dist/components/sun-switch/SunSwitch.vue.js +7 -0
  271. package/dist/components/sun-switch/SunSwitch.vue2.js +559 -0
  272. package/dist/components/sun-switch/index.d.ts +4 -0
  273. package/dist/components/sun-switch/pixel-wave-core.d.ts +82 -0
  274. package/dist/components/sun-switch/pixel-wave-core.js +508 -0
  275. package/dist/components/sun-switch/sun-switch-core.d.ts +251 -0
  276. package/dist/components/sun-switch/sun-switch-core.js +546 -0
  277. package/dist/components/sun-switch/sun-switch-hdr.d.ts +70 -0
  278. package/dist/components/sun-switch/sun-switch-hdr.js +311 -0
  279. package/dist/components/switch/Switch.vue.d.ts +2 -0
  280. package/dist/components/switch/Switch.vue.js +1 -1
  281. package/dist/components/switch/Switch.vue2.js +16 -6
  282. package/dist/components/tabs/TabsTrigger.vue.d.ts +6 -0
  283. package/dist/components/tabs/TabsTrigger.vue.js +1 -1
  284. package/dist/components/tabs/TabsTrigger.vue2.js +28 -15
  285. package/dist/components/terminal-block/TerminalBlock.vue.js +1 -1
  286. package/dist/components/terminal-block/TerminalBlock.vue2.js +10 -9
  287. package/dist/components/text-reveal-card/TextRevealCard.vue.js +1 -2
  288. package/dist/components/textarea/Textarea.vue.js +1 -1
  289. package/dist/components/textarea/Textarea.vue2.js +19 -12
  290. package/dist/components/tick-nav/TickNav.vue.d.ts +71 -0
  291. package/dist/components/tick-nav/TickNav.vue.js +7 -0
  292. package/dist/components/tick-nav/TickNav.vue2.js +285 -0
  293. package/dist/components/tick-nav/index.d.ts +3 -0
  294. package/dist/components/tick-nav/tick-nav-core.d.ts +102 -0
  295. package/dist/components/tick-nav/tick-nav-core.js +398 -0
  296. package/dist/components/tick-nav/tick-nav-hdr.d.ts +60 -0
  297. package/dist/components/tick-nav/tick-nav-hdr.js +284 -0
  298. package/dist/components/tick-nav/types.d.ts +13 -0
  299. package/dist/components/time-picker/TimePicker.vue.js +1 -1
  300. package/dist/components/time-picker/TimePicker.vue2.js +25 -17
  301. package/dist/components/toast/Toast.vue.js +1 -1
  302. package/dist/components/toast/Toast.vue2.js +16 -4
  303. package/dist/components/toast/index.d.ts +1 -1
  304. package/dist/components/toast/store.d.ts +23 -0
  305. package/dist/components/toast/store.js +35 -7
  306. package/dist/components/toggle/Toggle.vue.d.ts +12 -0
  307. package/dist/components/toggle/Toggle.vue.js +1 -1
  308. package/dist/components/toggle/Toggle.vue2.js +27 -11
  309. package/dist/components/toggle-group/ToggleGroup.vue.d.ts +11 -0
  310. package/dist/components/toggle-group/ToggleGroup.vue.js +1 -1
  311. package/dist/components/toggle-group/ToggleGroup.vue2.js +16 -3
  312. package/dist/components/toggle-group/ToggleGroupItem.vue.d.ts +6 -0
  313. package/dist/components/toggle-group/ToggleGroupItem.vue.js +1 -1
  314. package/dist/components/toggle-group/ToggleGroupItem.vue2.js +27 -14
  315. package/dist/components/tooltip/Tooltip.vue.js +13 -0
  316. package/dist/components/tracing-beam/TracingBeam.vue.d.ts +20 -1
  317. package/dist/components/tracing-beam/TracingBeam.vue.js +5 -164
  318. package/dist/components/tracing-beam/TracingBeam.vue2.js +168 -1
  319. package/dist/components/typing-indicator/TypingIndicator.vue.js +1 -1
  320. package/dist/components/typing-indicator/TypingIndicator.vue2.js +7 -6
  321. package/dist/index.d.ts +10 -0
  322. package/dist/index.js +466 -413
  323. package/dist/internals/anchor-position.js +3 -0
  324. package/dist/internals/call-listener.d.ts +11 -0
  325. package/dist/internals/call-listener.js +31 -0
  326. package/dist/internals/dismissable.d.ts +17 -0
  327. package/dist/internals/dismissable.js +44 -1
  328. package/dist/internals/env.d.ts +1 -0
  329. package/dist/internals/env.js +11 -0
  330. package/dist/internals/focus-trap.js +29 -4
  331. package/dist/internals/merge-ids.d.ts +6 -0
  332. package/dist/internals/merge-ids.js +11 -0
  333. package/dist/internals/motion/presence-core.d.ts +1 -1
  334. package/dist/sound/engine.js +23 -9
  335. package/dist/sound/themes.d.ts +4 -3
  336. package/dist/sound/themes.js +49 -211
  337. package/dist/sound/types.d.ts +9 -1
  338. package/dist/sound/types.js +2 -2
  339. package/dist/styles.css +1473 -571
  340. package/package.json +2 -2
  341. package/tailwind.css +9 -9
@@ -1,4 +1,4 @@
1
- import { defineComponent, mergeModels, useModel, computed, ref, useTemplateRef, watch, createElementBlock, openBlock, Fragment, createElementVNode, createCommentVNode, createVNode, normalizeClass, unref, toDisplayString } from "vue";
1
+ import { defineComponent, mergeModels, useAttrs, useModel, computed, ref, useTemplateRef, watch, createElementBlock, openBlock, Fragment, createElementVNode, createCommentVNode, createVNode, mergeProps, normalizeClass, unref, toDisplayString } from "vue";
2
2
  import { cn } from "../../utils.js";
3
3
  import { useField } from "../../internals/field.js";
4
4
  import { useListbox } from "../../internals/listbox.js";
@@ -6,8 +6,8 @@ import { useFancyId } from "../../internals/use-id.js";
6
6
  import { useSoundCue } from "../../sound/use-sound.js";
7
7
  import SelectPanel from "./SelectPanel.vue.js";
8
8
  import { SELECT_CONTEXT } from "./types.js";
9
- const _hoisted_1 = ["id", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid", "aria-required", "aria-describedby", "aria-label", "disabled"];
10
- const _hoisted_2 = ["name", "^value", "disabled"];
9
+ const _hoisted_1 = ["id", "disabled"];
10
+ const _hoisted_2 = ["name", "form", "^value", "disabled"];
11
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
12
12
  ...{ name: "Select", inheritAttrs: false },
13
13
  __name: "Select",
@@ -32,6 +32,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
32
32
  }),
33
33
  emits: ["update:value"],
34
34
  setup(__props, { expose: __expose }) {
35
+ const attrs = useAttrs();
35
36
  const props = __props;
36
37
  const value = useModel(__props, "value");
37
38
  const field = useField();
@@ -234,27 +235,33 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
234
235
  props.class
235
236
  )
236
237
  );
238
+ function triggerAttrs() {
239
+ const describedBy = [field?.describedBy, attrs["aria-describedby"]].filter(Boolean).join(" ") || void 0;
240
+ return {
241
+ ...attrs,
242
+ type: "button",
243
+ role: "combobox",
244
+ "aria-haspopup": "listbox",
245
+ "aria-expanded": open.value,
246
+ "aria-controls": open.value ? panelId : void 0,
247
+ "aria-activedescendant": open.value && listbox.activeIndex !== -1 ? optionId(listbox.activeIndex) : void 0,
248
+ "aria-invalid": effectiveInvalid.value ? "true" : attrs["aria-invalid"],
249
+ "aria-required": effectiveRequired.value ? "true" : attrs["aria-required"],
250
+ "aria-describedby": describedBy,
251
+ "aria-label": props.label ?? attrs["aria-label"]
252
+ };
253
+ }
237
254
  return (_ctx, _cache) => {
238
255
  return openBlock(), createElementBlock(Fragment, null, [
239
- createElementVNode("button", {
256
+ createElementVNode("button", mergeProps({
240
257
  ref_key: "trigger",
241
258
  ref: trigger,
242
259
  id: effectiveId.value,
243
- type: "button",
244
- role: "combobox",
245
- "aria-haspopup": "listbox",
246
- "aria-expanded": open.value,
247
- "aria-controls": open.value ? panelId : void 0,
248
- "aria-activedescendant": open.value && unref(listbox).activeIndex !== -1 ? optionId(unref(listbox).activeIndex) : void 0,
249
- "aria-invalid": effectiveInvalid.value ? "true" : void 0,
250
- "aria-required": effectiveRequired.value ? "true" : void 0,
251
- "aria-describedby": unref(field)?.describedBy,
252
- "aria-label": props.label,
253
260
  disabled: effectiveDisabled.value,
254
- class: normalizeClass(classes.value),
261
+ class: classes.value,
255
262
  onClick: handleTriggerClick,
256
263
  onKeydown: handleTriggerKeydown
257
- }, [
264
+ }, triggerAttrs()), [
258
265
  createElementVNode("span", {
259
266
  class: normalizeClass(unref(cn)("truncate", !selectedOption.value && "text-muted-foreground"))
260
267
  }, toDisplayString(selectedOption.value?.label ?? props.placeholder ?? ""), 3),
@@ -262,11 +269,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
262
269
  "aria-hidden": "true",
263
270
  class: "ft-select-caret text-muted-foreground text-[9px]"
264
271
  }, "▼", -1))
265
- ], 42, _hoisted_1),
272
+ ], 16, _hoisted_1),
266
273
  props.name ? (openBlock(), createElementBlock("input", {
267
274
  key: 0,
268
275
  type: "hidden",
269
276
  name: props.name,
277
+ form: unref(attrs).form,
270
278
  "^value": value.value,
271
279
  disabled: effectiveDisabled.value
272
280
  }, null, 8, _hoisted_2)) : createCommentVNode("", true),
@@ -22,6 +22,11 @@ export interface SheetProps {
22
22
  dismissible?: boolean;
23
23
  /** Panel width (left/right sides) or height (top/bottom sides). */
24
24
  size?: SheetSize;
25
+ /**
26
+ * The panel's `id`. A trigger the caller renders outside the component
27
+ * points its `aria-controls` at it while the panel is open.
28
+ */
29
+ id?: string;
25
30
  /** Additional CSS classes merged onto the panel. */
26
31
  class?: HTMLAttributes["class"];
27
32
  /**
@@ -10,7 +10,7 @@ import { anchored, prefersReducedMotion } from "../../internals/motion/anchored.
10
10
  import { usePresence } from "../../internals/motion/presence.js";
11
11
  import { DURATIONS, JS_EASINGS } from "../../internals/motion/tokens.js";
12
12
  import { useSoundCue } from "../../sound/use-sound.js";
13
- const _hoisted_1 = ["aria-labelledby", "aria-label", "aria-describedby", "data-state", "data-side"];
13
+ const _hoisted_1 = ["id", "aria-labelledby", "aria-label", "aria-describedby", "data-state", "data-side"];
14
14
  const _hoisted_2 = {
15
15
  key: 0,
16
16
  class: "ft-sheet-header flex items-start justify-between gap-4"
@@ -34,6 +34,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
34
34
  ariaLabel: {},
35
35
  dismissible: { type: Boolean, default: true },
36
36
  size: { default: "md" },
37
+ id: {},
37
38
  class: { type: [Boolean, null, String, Object, Array] },
38
39
  sound: { type: Boolean, default: false }
39
40
  }, {
@@ -79,7 +80,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
79
80
  onDismiss: close,
80
81
  escape: __props.dismissible,
81
82
  outsideClick: __props.dismissible,
82
- active: () => open.value
83
+ active: () => open.value,
84
+ keepFocus: true
83
85
  }));
84
86
  function edgeSlide(_node, params) {
85
87
  const reduced = prefersReducedMotion();
@@ -153,6 +155,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
153
155
  ref: unref(panelRef),
154
156
  class: normalizeClass(panelClasses.value),
155
157
  role: "dialog",
158
+ id: __props.id,
156
159
  "aria-modal": "true",
157
160
  "aria-labelledby": titleId.value,
158
161
  "aria-label": titleId.value ? void 0 : __props.ariaLabel,
@@ -13,8 +13,8 @@ export interface ShimmerButtonProps {
13
13
  /** Custom CSS class */
14
14
  class?: HTMLAttributes["class"];
15
15
  /**
16
- * Plays the matching interface cue through the sound controller. Off by
17
- * default; only audible once the user has enabled sound.
16
+ * Plays the `hover` cue on mouse/pen pointer enter and the `press` cue on
17
+ * click. Off by default; only audible once the user has enabled sound.
18
18
  */
19
19
  sound?: boolean;
20
20
  /** Native `disabled`, read to guard the sound cue. */
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./ShimmerButton.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const ShimmerButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3423513b"]]);
4
+ const ShimmerButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3892394c"]]);
5
5
  export {
6
6
  ShimmerButton as default
7
7
  };
@@ -1,6 +1,7 @@
1
- import { defineComponent, useAttrs, computed, createElementBlock, openBlock, mergeProps, unref, createElementVNode, renderSlot } from "vue";
1
+ import { defineComponent, useTemplateRef, useAttrs, computed, createElementBlock, openBlock, mergeProps, unref, createElementVNode, renderSlot } from "vue";
2
2
  import { cn } from "../../utils.js";
3
3
  import { useSoundCue } from "../../sound/use-sound.js";
4
+ import { useSoundFeedback } from "../../sound/use-sound-feedback.js";
4
5
  const _hoisted_1 = ["disabled"];
5
6
  const _hoisted_2 = { class: "relative z-10" };
6
7
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -17,6 +18,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17
18
  disabled: { type: Boolean, default: false }
18
19
  },
19
20
  setup(__props) {
21
+ const el = useTemplateRef("el");
22
+ useSoundFeedback(el, () => ({
23
+ on: __props.sound ? { pointerenter: "hover" } : {},
24
+ disabled: __props.disabled
25
+ }));
20
26
  const attrs = useAttrs();
21
27
  const playCue = useSoundCue(() => __props.sound);
22
28
  const styleVars = computed(() => ({
@@ -30,16 +36,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
30
36
  if (!__props.disabled) playCue("press");
31
37
  }
32
38
  function handlePointerMove(event) {
33
- const el = event.currentTarget;
34
- const rect = el.getBoundingClientRect();
35
- el.style.setProperty("--mx", `${event.clientX - rect.left}px`);
36
- el.style.setProperty("--my", `${event.clientY - rect.top}px`);
39
+ const el2 = event.currentTarget;
40
+ const rect = el2.getBoundingClientRect();
41
+ el2.style.setProperty("--mx", `${event.clientX - rect.left}px`);
42
+ el2.style.setProperty("--my", `${event.clientY - rect.top}px`);
37
43
  }
38
44
  return (_ctx, _cache) => {
39
45
  return openBlock(), createElementBlock("button", mergeProps({
46
+ ref_key: "el",
47
+ ref: el,
40
48
  class: unref(cn)(
41
49
  "shimmer-button group relative isolate flex cursor-pointer items-center justify-center overflow-hidden [border-radius:var(--radius)] px-6 py-3 whitespace-nowrap text-white/90",
42
- "transform-gpu transition-[transform,color] duration-300 ease-out hover:text-white active:scale-[0.98]",
50
+ "transform-gpu duration-300 ease-out hover:text-white active:scale-[0.98] transition-[color] motion-safe:transition-[transform,color]",
43
51
  __props.class
44
52
  ),
45
53
  style: styleVars.value,
@@ -16,8 +16,10 @@ export interface SidebarItemProps {
16
16
  badgeLabel?: string;
17
17
  /** Disables both the click and keyboard-activation paths. */
18
18
  disabled?: boolean;
19
- /** Native click handler, for the `<button>` branch. Never called while `disabled`. */
20
- onclick?: (event: MouseEvent) => void;
19
+ /** Click handler. Never called while `disabled`. `@click` reaches it. */
20
+ onClick?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
21
+ /** @deprecated Use `@click` / `onClick`. Only called when `onClick` is absent. */
22
+ onclick?: ((event: MouseEvent) => void) | ((event: MouseEvent) => void)[];
21
23
  /** Additional CSS classes */
22
24
  class?: HTMLAttributes["class"];
23
25
  /**
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./SidebarItem.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const SidebarItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-87dc6589"]]);
4
+ const SidebarItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-941b2caf"]]);
5
5
  export {
6
6
  SidebarItem as default
7
7
  };
@@ -1,4 +1,5 @@
1
1
  import { defineComponent, useTemplateRef, inject, computed, createElementBlock, openBlock, normalizeClass, createCommentVNode, createElementVNode, renderSlot, unref, createTextVNode, toDisplayString } from "vue";
2
+ import { callListener } from "../../internals/call-listener.js";
2
3
  import { cn } from "../../utils.js";
3
4
  import { SIDEBAR_KEY } from "./types.js";
4
5
  import { sound } from "../../sound/sound.js";
@@ -32,7 +33,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
32
33
  badge: {},
33
34
  badgeLabel: {},
34
35
  disabled: { type: Boolean, default: false },
35
- onclick: { type: Function },
36
+ onClick: { type: [Function, Array] },
37
+ onclick: { type: [Function, Array] },
36
38
  class: { type: [Boolean, null, String, Object, Array] },
37
39
  sound: { type: Boolean, default: false }
38
40
  },
@@ -58,7 +60,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
58
60
  return;
59
61
  }
60
62
  if (__props.sound && !__props.current) sound.play("select");
61
- __props.onclick?.(event);
63
+ callListener(__props.onClick ?? __props.onclick, event);
62
64
  }
63
65
  return (_ctx, _cache) => {
64
66
  return openBlock(), createElementBlock("li", _hoisted_1, [
@@ -4,6 +4,10 @@ export interface SliderProps {
4
4
  value?: number;
5
5
  /** Called with the new value on every input event. */
6
6
  onValueChange?: (value: number) => void;
7
+ /** A consumer `@input`, run once after the internal value update. */
8
+ onInput?: (event: Event) => void;
9
+ /** A consumer `@change`, run once after the internal handling. */
10
+ onChange?: (event: Event) => void;
7
11
  /** Lower bound. */
8
12
  min?: number;
9
13
  /** Upper bound. */
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./Slider.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const Slider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-915625c4"]]);
4
+ const Slider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c74d57e5"]]);
5
5
  export {
6
6
  Slider as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent, mergeModels, useModel, useTemplateRef, computed, onMounted, watch, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, createCommentVNode, normalizeStyle, toDisplayString } from "vue";
1
+ import { defineComponent, mergeModels, useAttrs, useModel, useTemplateRef, computed, onMounted, watch, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, createCommentVNode, normalizeStyle, toDisplayString, mergeProps } from "vue";
2
2
  import { cn } from "../../utils.js";
3
3
  import { useField } from "../../internals/field.js";
4
4
  import { useSoundCue } from "../../sound/use-sound.js";
@@ -14,6 +14,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  props: /* @__PURE__ */ mergeModels({
15
15
  value: {},
16
16
  onValueChange: { type: Function },
17
+ onInput: { type: Function },
18
+ onChange: { type: Function },
17
19
  min: { default: 0 },
18
20
  max: { default: 100 },
19
21
  step: { default: 1 },
@@ -31,6 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
33
  }),
32
34
  emits: ["update:value"],
33
35
  setup(__props, { expose: __expose }) {
36
+ const attrs = useAttrs();
34
37
  const value = useModel(__props, "value");
35
38
  const el = useTemplateRef("el");
36
39
  __expose({ ref: el });
@@ -52,16 +55,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
52
55
  const fraction = computed(
53
56
  () => __props.max > __props.min ? Math.min(1, Math.max(0, (clampedValue.value - __props.min) / (__props.max - __props.min))) : 0
54
57
  );
58
+ function callListener(listener, ...args) {
59
+ if (Array.isArray(listener)) {
60
+ for (const fn of listener) if (typeof fn === "function") fn(...args);
61
+ } else if (typeof listener === "function") {
62
+ listener(...args);
63
+ }
64
+ }
55
65
  function handleInput(event) {
56
66
  if (effectiveDisabled.value) return;
57
67
  const next = Number(event.currentTarget.value);
58
68
  value.value = next;
59
69
  __props.onValueChange?.(next);
70
+ callListener(__props.onInput, event);
60
71
  }
61
72
  const playCue = useSoundCue(() => __props.sound);
62
- function handleChange() {
73
+ function handleChange(event) {
63
74
  if (effectiveDisabled.value) return;
64
75
  playCue("tick");
76
+ callListener(__props.onChange, event);
65
77
  }
66
78
  return (_ctx, _cache) => {
67
79
  return openBlock(), createElementBlock("div", {
@@ -77,7 +89,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
77
89
  style: normalizeStyle({ left: `${fraction.value * 100}%`, color: "var(--ft-slider-accent-end)" }),
78
90
  "aria-hidden": "true"
79
91
  }, toDisplayString(clampedValue.value), 5)) : createCommentVNode("", true),
80
- createElementVNode("input", {
92
+ createElementVNode("input", mergeProps(unref(attrs), {
81
93
  ref_key: "el",
82
94
  ref: el,
83
95
  type: "range",
@@ -89,16 +101,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
89
101
  step: __props.step,
90
102
  value: clampedValue.value,
91
103
  disabled: effectiveDisabled.value,
92
- "aria-describedby": unref(field)?.describedBy,
93
- "aria-invalid": effectiveInvalid.value ? "true" : void 0,
104
+ "aria-describedby": [unref(field)?.describedBy, unref(attrs)["aria-describedby"]].filter(Boolean).join(" ") || void 0,
105
+ "aria-invalid": effectiveInvalid.value ? "true" : unref(attrs)["aria-invalid"],
94
106
  "aria-valuemin": __props.min,
95
107
  "aria-valuemax": __props.max,
96
108
  "aria-valuenow": clampedValue.value,
97
- "aria-label": __props.label,
98
- style: normalizeStyle({ "--ft-slider-fill": `${fraction.value * 100}%` }),
109
+ "aria-label": __props.label ?? unref(attrs)["aria-label"],
110
+ style: { "--ft-slider-fill": `${fraction.value * 100}%` },
99
111
  onInput: handleInput,
100
112
  onChange: handleChange
101
- }, null, 44, _hoisted_1)
113
+ }), null, 16, _hoisted_1)
102
114
  ], 4),
103
115
  __props.showBounds ? (openBlock(), createElementBlock("div", _hoisted_2, [
104
116
  createElementVNode("span", null, toDisplayString(__props.min), 1),
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./SourcesTrigger.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const SourcesTrigger = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d1575fd3"]]);
4
+ const SourcesTrigger = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-28d2d62f"]]);
5
5
  export {
6
6
  SourcesTrigger as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent, inject, computed, createElementBlock, openBlock, unref, normalizeClass, createCommentVNode, createElementVNode, Fragment, renderList, toDisplayString } from "vue";
1
+ import { defineComponent, useAttrs, inject, computed, createElementBlock, openBlock, mergeProps, unref, createCommentVNode, createElementVNode, Fragment, renderList, toDisplayString, normalizeClass } from "vue";
2
2
  import { cn } from "../../utils.js";
3
3
  import { monogram, hostOf } from "../../internals/host.js";
4
4
  import { SOURCES_CONTEXT_KEY } from "./types.js";
@@ -17,6 +17,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17
17
  class: { type: [Boolean, null, String, Object, Array] }
18
18
  },
19
19
  setup(__props) {
20
+ const attrs = useAttrs();
20
21
  const STACK_LIMIT = 3;
21
22
  const sources = inject(SOURCES_CONTEXT_KEY, void 0);
22
23
  const count = computed(() => sources?.count ?? 0);
@@ -24,18 +25,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
24
25
  const stack = computed(() => (sources?.sources ?? []).slice(0, STACK_LIMIT));
25
26
  const text = computed(() => __props.label ?? `${count.value} ${count.value === 1 ? "source" : "sources"}`);
26
27
  return (_ctx, _cache) => {
27
- return openBlock(), createElementBlock("button", {
28
+ return openBlock(), createElementBlock("button", mergeProps({
29
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(sources)?.toggle())
30
+ }, unref(attrs), {
28
31
  type: "button",
29
- class: normalizeClass(
30
- unref(cn)(
31
- "ft-sources-trigger text-muted-foreground hover:text-foreground inline-flex items-center gap-2 rounded-full px-2 py-1 text-xs",
32
- __props.class
33
- )
32
+ class: unref(cn)(
33
+ "ft-sources-trigger text-muted-foreground hover:text-foreground inline-flex items-center gap-2 rounded-full px-2 py-1 text-xs",
34
+ __props.class
34
35
  ),
35
36
  "aria-expanded": isOpen.value,
36
- "aria-controls": unref(sources)?.listId,
37
- onClick: _cache[0] || (_cache[0] = ($event) => unref(sources)?.toggle())
38
- }, [
37
+ "aria-controls": unref(sources)?.listId
38
+ }), [
39
39
  stack.value.length > 0 ? (openBlock(), createElementBlock("span", _hoisted_2, [
40
40
  (openBlock(true), createElementBlock(Fragment, null, renderList(stack.value, (source) => {
41
41
  return openBlock(), createElementBlock("span", {
@@ -57,7 +57,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
57
57
  }, [..._cache[1] || (_cache[1] = [
58
58
  createElementVNode("path", { d: "m9 6 6 6-6 6" }, null, -1)
59
59
  ])], 2))
60
- ], 10, _hoisted_1);
60
+ ], 16, _hoisted_1);
61
61
  };
62
62
  }
63
63
  });
@@ -15,7 +15,7 @@ export interface SparklesInitOptions {
15
15
  particleDensity?: number;
16
16
  }
17
17
  export interface SparklesLiveOptions {
18
- /** Hex color (e.g. "#ffffff") particles are filled with; re-read every frame. */
18
+ /** Hex color (e.g. "#ffffff") or `currentColor` particles are filled with; re-read every frame. */
19
19
  particleColor?: string;
20
20
  }
21
21
  export interface SparklesEngine {
@@ -3,6 +3,33 @@ const DEFAULT_MAX_SIZE = 3;
3
3
  const DEFAULT_SPEED = 4;
4
4
  const DEFAULT_PARTICLE_DENSITY = 120;
5
5
  const DEFAULT_PARTICLE_COLOR = "#ffffff";
6
+ const CURRENT_COLOR = /^\s*currentcolor\s*$/i;
7
+ function resolveCurrentColor(color, el) {
8
+ if (!CURRENT_COLOR.test(color)) return color;
9
+ const computed = getComputedStyle(el).color;
10
+ let r = 0;
11
+ let g = 0;
12
+ let b = 0;
13
+ const m = /^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)/i.exec(computed);
14
+ if (m) {
15
+ r = Math.round(+m[1]);
16
+ g = Math.round(+m[2]);
17
+ b = Math.round(+m[3]);
18
+ } else if (computed) {
19
+ try {
20
+ const probe = document.createElement("canvas");
21
+ probe.width = probe.height = 1;
22
+ const pctx = probe.getContext("2d", { willReadFrequently: true });
23
+ if (pctx) {
24
+ pctx.fillStyle = computed;
25
+ pctx.fillRect(0, 0, 1, 1);
26
+ [r = 0, g = 0, b = 0] = pctx.getImageData(0, 0, 1, 1).data;
27
+ }
28
+ } catch {
29
+ }
30
+ }
31
+ return `#${[r, g, b].map((c) => c.toString(16).padStart(2, "0")).join("")}`;
32
+ }
6
33
  function createSparkles(elements, options, random = Math.random) {
7
34
  const { canvas, container } = elements;
8
35
  let ctx = canvas.getContext("2d");
@@ -45,6 +72,7 @@ function createSparkles(elements, options, random = Math.random) {
45
72
  function updateAndDraw() {
46
73
  if (!ctx) return;
47
74
  ctx.clearRect(0, 0, canvas.width, canvas.height);
75
+ const fill = resolveCurrentColor(particleColor, canvas);
48
76
  for (const p of particles) {
49
77
  p.x += p.vx;
50
78
  p.y += p.vy;
@@ -55,8 +83,14 @@ function createSparkles(elements, options, random = Math.random) {
55
83
  p.phase = (p.phase + p.phaseSpeed) % (Math.PI * 2);
56
84
  const opacity = 0.3 + (Math.sin(p.phase) * 0.3 + 0.3);
57
85
  ctx.beginPath();
58
- ctx.arc(p.x * canvas.width / (100 * dpr), p.y * canvas.height / (100 * dpr), p.size, 0, Math.PI * 2);
59
- ctx.fillStyle = `${particleColor}${Math.floor(opacity * 255).toString(16).padStart(2, "0")}`;
86
+ ctx.arc(
87
+ p.x * canvas.width / (100 * dpr),
88
+ p.y * canvas.height / (100 * dpr),
89
+ p.size,
90
+ 0,
91
+ Math.PI * 2
92
+ );
93
+ ctx.fillStyle = `${fill}${Math.floor(opacity * 255).toString(16).padStart(2, "0")}`;
60
94
  ctx.fill();
61
95
  }
62
96
  rafId = requestAnimationFrame(updateAndDraw);
@@ -0,0 +1,11 @@
1
+ export interface StoryNodeProps {
2
+ /** Id the thread runs through; referenced by StoryThread's `segments`. */
3
+ id: string;
4
+ /** `"dot"` is a filled dot; `"ring"` a hollow ring, for a fork or a destination. */
5
+ variant?: "dot" | "ring";
6
+ }
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ declare const __VLS_export: import("vue").DefineComponent<StoryNodeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<StoryNodeProps> & Readonly<{}>, {
10
+ variant: "dot" | "ring";
11
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./StoryNode.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const StoryNode = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c134385b"]]);
5
+ export {
6
+ StoryNode as default
7
+ };
@@ -0,0 +1,23 @@
1
+ import { defineComponent, createElementBlock, openBlock, mergeProps } from "vue";
2
+ const _hoisted_1 = ["data-story-node", "data-variant"];
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ ...{ name: "StoryNode", inheritAttrs: false },
5
+ __name: "StoryNode",
6
+ props: {
7
+ id: {},
8
+ variant: { default: "dot" }
9
+ },
10
+ setup(__props) {
11
+ return (_ctx, _cache) => {
12
+ return openBlock(), createElementBlock("span", mergeProps(_ctx.$attrs, {
13
+ class: "st-node",
14
+ "data-story-node": __props.id,
15
+ "data-variant": __props.variant,
16
+ "aria-hidden": "true"
17
+ }), null, 16, _hoisted_1);
18
+ };
19
+ }
20
+ });
21
+ export {
22
+ _sfc_main as default
23
+ };
@@ -0,0 +1,56 @@
1
+ import type { HTMLAttributes } from "vue";
2
+ import type { StoryThreadDash, StoryThreadLayout, StoryThreadSegment } from "./types.js";
3
+ export interface StoryThreadProps {
4
+ /**
5
+ * `"horizontal"` pins a full-height viewport and pans the content sideways
6
+ * as the page scrolls; `"vertical"` keeps a plain stack. `"auto"` is
7
+ * horizontal from 900 × 520 px up, vertical below.
8
+ */
9
+ layout?: StoryThreadLayout;
10
+ /**
11
+ * The thread's segments, each through a list of StoryNode ids. Leave it
12
+ * out for one segment through every node in document order. Several
13
+ * segments that leave the same node and meet again draw a fork whose
14
+ * branches advance together.
15
+ */
16
+ segments?: StoryThreadSegment[];
17
+ /** Where the tip of the thread sits in the viewport, 0..1 along the reading axis. */
18
+ lead?: number;
19
+ /** Curve tension between nodes: 0 draws straight lines, 1 long flat tangents. */
20
+ tension?: number;
21
+ /** Stroke pattern of the thread. */
22
+ dash?: StoryThreadDash;
23
+ /** Draw a glowing dot at the tip of every segment while it is drawing. */
24
+ head?: boolean;
25
+ /**
26
+ * Plays a soft `tick` each time the thread reaches a node going forward.
27
+ * Off by default; only audible once the user has enabled sound.
28
+ */
29
+ sound?: boolean;
30
+ /** Called with a node's id each time the thread reaches it going forward. */
31
+ onReach?: (id: string) => void;
32
+ /** Accessible name of the region. */
33
+ ariaLabel?: string;
34
+ /** Additional CSS classes on the root. */
35
+ class?: HTMLAttributes["class"];
36
+ }
37
+ declare const _default: typeof __VLS_export;
38
+ export default _default;
39
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<StoryThreadProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<StoryThreadProps> & Readonly<{}>, {
40
+ head: boolean;
41
+ sound: boolean;
42
+ ariaLabel: string;
43
+ layout: StoryThreadLayout;
44
+ segments: StoryThreadSegment[];
45
+ lead: number;
46
+ tension: number;
47
+ dash: StoryThreadDash;
48
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
49
+ /** The story: sections holding StoryNode anchors. */
50
+ default?(): unknown;
51
+ }>;
52
+ type __VLS_WithSlots<T, S> = T & {
53
+ new (): {
54
+ $slots: S;
55
+ };
56
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./StoryThread.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const StoryThread = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dc205dfd"]]);
5
+ export {
6
+ StoryThread as default
7
+ };