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.
- package/PORTING.md +123 -2
- package/README.md +20 -15
- package/dist/components/accordion/Accordion.vue.d.ts +44 -0
- package/dist/components/accordion/Accordion.vue.js +88 -0
- package/dist/components/accordion/Accordion.vue2.js +4 -0
- package/dist/components/accordion/AccordionContent.vue.d.ts +25 -0
- package/dist/components/accordion/AccordionContent.vue.js +42 -0
- package/dist/components/accordion/AccordionContent.vue2.js +4 -0
- package/dist/components/accordion/AccordionItem.vue.d.ts +21 -0
- package/dist/components/accordion/AccordionItem.vue.js +66 -0
- package/dist/components/accordion/AccordionItem.vue2.js +4 -0
- package/dist/components/accordion/AccordionTrigger.vue.d.ts +24 -0
- package/dist/components/accordion/AccordionTrigger.vue.js +83 -0
- package/dist/components/accordion/AccordionTrigger.vue2.js +4 -0
- package/dist/components/accordion/accordion-core.d.ts +35 -0
- package/dist/components/accordion/accordion-core.js +44 -0
- package/dist/components/accordion/index.d.ts +11 -0
- package/dist/components/accordion/types.d.ts +45 -0
- package/dist/components/accordion/types.js +7 -0
- package/dist/components/alert-dialog/AlertDialog.vue.js +22 -3
- package/dist/components/animated-testimonials/AnimatedTestimonials.vue.js +3 -3
- package/dist/components/apple-card-carousel/AppleCard.vue.js +1 -1
- package/dist/components/autocomplete/Autocomplete.vue.js +1 -1
- package/dist/components/autocomplete/Autocomplete.vue2.js +22 -15
- package/dist/components/avatar/Avatar.vue.d.ts +27 -0
- package/dist/components/avatar/Avatar.vue.js +119 -0
- package/dist/components/avatar/Avatar.vue2.js +4 -0
- package/dist/components/avatar/avatar-core.d.ts +40 -0
- package/dist/components/avatar/avatar-core.js +57 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/badge/Badge.vue.d.ts +21 -0
- package/dist/components/badge/Badge.vue.js +46 -0
- package/dist/components/badge/Badge.vue2.js +4 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/bento-grid/BentoFrame.vue.js +1 -1
- package/dist/components/bento-grid/BentoFrame.vue2.js +6 -5
- package/dist/components/bento-grid/BentoGrid.vue.js +1 -1
- package/dist/components/bento-grid/BentoGrid.vue2.js +12 -12
- package/dist/components/bento-grid/BentoGridCard.vue.js +6 -5
- package/dist/components/bento-grid/BentoGridItem.vue.js +6 -5
- package/dist/components/bg-falling-stars/FallingStarsBg.vue.d.ts +1 -1
- package/dist/components/bg-falling-stars/FallingStarsBg.vue.js +1 -1
- package/dist/components/bg-falling-stars/bg-falling-stars-core.d.ts +1 -1
- package/dist/components/bg-falling-stars/bg-falling-stars-core.js +47 -12
- package/dist/components/book/Book.vue.js +8 -9
- package/dist/components/book/BookDescription.vue.js +6 -5
- package/dist/components/book/BookHeader.vue.js +6 -5
- package/dist/components/book/BookTitle.vue.js +6 -5
- package/dist/components/box-reveal/BoxReveal.vue.js +6 -5
- package/dist/components/button/Button.vue.d.ts +6 -4
- package/dist/components/button/Button.vue.js +1 -1
- package/dist/components/button/Button.vue2.js +50 -22
- package/dist/components/card-3d/CardContainer.vue.js +1 -1
- package/dist/components/card-3d/CardItem.vue.js +1 -1
- package/dist/components/card-spotlight/CardSpotlight.vue.js +1 -1
- package/dist/components/chat-message/ChatMessageAction.vue.d.ts +4 -2
- package/dist/components/chat-message/ChatMessageAction.vue.js +4 -2
- package/dist/components/checkbox/Checkbox.vue.d.ts +2 -0
- package/dist/components/checkbox/Checkbox.vue.js +1 -1
- package/dist/components/checkbox/Checkbox.vue2.js +17 -7
- package/dist/components/collapsible/Collapsible.vue.d.ts +31 -0
- package/dist/components/collapsible/Collapsible.vue.js +60 -0
- package/dist/components/collapsible/Collapsible.vue2.js +4 -0
- package/dist/components/collapsible/CollapsibleContent.vue.d.ts +26 -0
- package/dist/components/collapsible/CollapsibleContent.vue.js +81 -0
- package/dist/components/collapsible/CollapsibleContent.vue2.js +4 -0
- package/dist/components/collapsible/CollapsibleTrigger.vue.d.ts +21 -0
- package/dist/components/collapsible/CollapsibleTrigger.vue.js +57 -0
- package/dist/components/collapsible/CollapsibleTrigger.vue2.js +4 -0
- package/dist/components/collapsible/collapsible-core.d.ts +47 -0
- package/dist/components/collapsible/collapsible-core.js +40 -0
- package/dist/components/collapsible/index.d.ts +8 -0
- package/dist/components/collapsible/types.d.ts +24 -0
- package/dist/components/collapsible/types.js +5 -0
- package/dist/components/combobox/Combobox.vue.js +1 -1
- package/dist/components/combobox/Combobox.vue2.js +24 -16
- package/dist/components/command-menu/CommandMenu.vue.d.ts +5 -0
- package/dist/components/command-menu/CommandMenu.vue.js +1 -1
- package/dist/components/command-menu/CommandMenu.vue2.js +5 -2
- package/dist/components/compare/Compare.vue.d.ts +15 -5
- package/dist/components/compare/Compare.vue.js +1 -1
- package/dist/components/compare/Compare.vue2.js +28 -13
- package/dist/components/composer/ComposerInput.vue.js +1 -1
- package/dist/components/composer/ComposerInput.vue2.js +11 -11
- package/dist/components/composer/ComposerModelPicker.vue.d.ts +4 -0
- package/dist/components/composer/ComposerModelPicker.vue.js +1 -1
- package/dist/components/composer/ComposerModelPicker.vue2.js +29 -15
- package/dist/components/composer/ComposerSubmit.vue.d.ts +2 -0
- package/dist/components/composer/ComposerSubmit.vue.js +16 -15
- package/dist/components/confetti/ConfettiButton.vue.d.ts +9 -2
- package/dist/components/confetti/ConfettiButton.vue.js +24 -6
- package/dist/components/container-text-flip/ContainerTextFlip.vue.js +1 -1
- package/dist/components/container-text-flip/ContainerTextFlip.vue2.js +12 -13
- package/dist/components/copy-button/CopyButton.vue.d.ts +5 -0
- package/dist/components/copy-button/CopyButton.vue.js +1 -1
- package/dist/components/copy-button/CopyButton.vue2.js +72 -11
- package/dist/components/datamosh-transition/DatamoshTransition.vue.d.ts +6 -2
- package/dist/components/datamosh-transition/DatamoshTransition.vue.js +7 -4
- package/dist/components/date-picker/DatePicker.vue.js +1 -1
- package/dist/components/date-picker/DatePicker.vue2.js +27 -21
- package/dist/components/dialog/Dialog.vue.js +20 -1
- package/dist/components/dialog/DialogSurface.vue.js +1 -1
- package/dist/components/dialog/DialogSurface.vue2.js +5 -2
- package/dist/components/dialog/types.d.ts +2 -0
- package/dist/components/direction-aware-hover/DirectionAwareHover.vue.js +1 -1
- package/dist/components/direction-aware-hover/DirectionAwareHover.vue2.js +9 -7
- package/dist/components/displacement-text/DisplacementText.vue.d.ts +4 -1
- package/dist/components/displacement-text/DisplacementText.vue.js +38 -11
- package/dist/components/displacement-text/displacement-text-core.d.ts +94 -4
- package/dist/components/displacement-text/displacement-text-core.js +287 -97
- package/dist/components/drawer/Drawer.vue.d.ts +5 -0
- package/dist/components/drawer/Drawer.vue.js +1 -1
- package/dist/components/drawer/Drawer.vue2.js +5 -2
- package/dist/components/dropdown-menu/DropdownMenuContent.vue.js +2 -1
- package/dist/components/dropdown-menu/DropdownMenuItem.vue.d.ts +4 -0
- package/dist/components/dropdown-menu/DropdownMenuItem.vue.js +17 -10
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +8 -0
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.vue.js +28 -13
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.d.ts +4 -0
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue.js +1 -1
- package/dist/components/dropdown-menu/DropdownMenuTrigger.vue2.js +20 -10
- package/dist/components/editorial-engine/EditorialEngine.vue.js +1 -1
- package/dist/components/editorial-engine/engine.js +13 -0
- package/dist/components/file-upload/FileUpload.vue.d.ts +2 -0
- package/dist/components/file-upload/FileUpload.vue.js +1 -1
- package/dist/components/file-upload/FileUpload.vue2.js +20 -10
- package/dist/components/fireworks-hdr/FireworksHdr.vue.js +2 -2
- package/dist/components/flickering-grid/FlickeringGrid.vue.d.ts +1 -1
- package/dist/components/flickering-grid/FlickeringGrid.vue.js +1 -1
- package/dist/components/flickering-grid/flickering-grid-core.d.ts +1 -1
- package/dist/components/flickering-grid/flickering-grid-core.js +51 -9
- package/dist/components/flip-card/FlipCard.vue.d.ts +3 -1
- package/dist/components/flip-card/FlipCard.vue.js +1 -1
- package/dist/components/flip-card/FlipCard.vue2.js +5 -3
- package/dist/components/fluid-cursor/FluidCursor.vue.js +37 -9
- package/dist/components/fluid-cursor/fluid-cursor-core.js +3 -3
- package/dist/components/fluid-cursor/webgpu-engine.js +3 -3
- package/dist/components/focus/Focus.vue.js +1 -1
- package/dist/components/focus/Focus.vue2.js +2 -2
- package/dist/components/follow-button/FollowButton.vue.d.ts +69 -0
- package/dist/components/follow-button/FollowButton.vue.js +7 -0
- package/dist/components/follow-button/FollowButton.vue2.js +239 -0
- package/dist/components/follow-button/follow-core.d.ts +83 -0
- package/dist/components/follow-button/follow-core.js +92 -0
- package/dist/components/follow-button/index.d.ts +2 -0
- package/dist/components/frosted-glass/FrostedGlass.vue.js +1 -1
- package/dist/components/glare-card/GlareCard.vue.js +1 -1
- package/dist/components/glare-card/GlareCard.vue2.js +4 -4
- package/dist/components/glowing-effect/GlowingEffect.vue.js +3 -3
- package/dist/components/glowing-effect/glowing-effect-core.js +4 -1
- package/dist/components/gradient-button/GradientButton.vue.d.ts +6 -4
- package/dist/components/gradient-button/GradientButton.vue.js +1 -1
- package/dist/components/gradient-button/GradientButton.vue2.js +13 -3
- package/dist/components/icon-button/IconButton.vue.d.ts +6 -4
- package/dist/components/icon-button/IconButton.vue.js +11 -8
- package/dist/components/image-trail-cursor/ImageTrailCursor.vue.js +17 -7
- package/dist/components/image-trail-cursor/trail-variants.js +3 -6
- package/dist/components/inline-citation/InlineCitation.vue.js +1 -1
- package/dist/components/inline-citation/InlineCitation.vue2.js +20 -14
- package/dist/components/input/Input.vue.js +1 -1
- package/dist/components/input/Input.vue2.js +18 -8
- package/dist/components/interactive-grid-pattern/InteractiveGridPattern.vue.js +1 -1
- package/dist/components/interactive-grid-pattern/InteractiveGridPattern.vue2.js +1 -1
- package/dist/components/interactive-hover-button/InteractiveHoverButton.vue.d.ts +6 -3
- package/dist/components/interactive-hover-button/InteractiveHoverButton.vue.js +1 -1
- package/dist/components/interactive-hover-button/InteractiveHoverButton.vue2.js +12 -2
- package/dist/components/letter-pullup/LetterPullup.vue.js +4 -4
- package/dist/components/line-hover-link/LineHoverLink.vue.js +1 -1
- package/dist/components/line-hover-link/LineHoverLink.vue2.js +5 -6
- package/dist/components/link/Link.vue.d.ts +4 -2
- package/dist/components/link/Link.vue.js +1 -1
- package/dist/components/link/Link.vue2.js +11 -8
- package/dist/components/magnetic-field/MagnetPuck.vue.d.ts +51 -0
- package/dist/components/magnetic-field/MagnetPuck.vue.js +7 -0
- package/dist/components/magnetic-field/MagnetPuck.vue2.js +191 -0
- package/dist/components/magnetic-field/MagneticField.vue.d.ts +39 -0
- package/dist/components/magnetic-field/MagneticField.vue.js +7 -0
- package/dist/components/magnetic-field/MagneticField.vue2.js +157 -0
- package/dist/components/magnetic-field/MagneticItem.vue.d.ts +28 -0
- package/dist/components/magnetic-field/MagneticItem.vue.js +7 -0
- package/dist/components/magnetic-field/MagneticItem.vue2.js +72 -0
- package/dist/components/magnetic-field/index.d.ts +10 -0
- package/dist/components/magnetic-field/magnetic-field-core.d.ts +163 -0
- package/dist/components/magnetic-field/magnetic-field-core.js +534 -0
- package/dist/components/magnetic-field/magnetic-field-source.d.ts +58 -0
- package/dist/components/magnetic-field/magnetic-field-source.js +58 -0
- package/dist/components/magnetic-field/types.d.ts +14 -0
- package/dist/components/magnetic-field/types.js +5 -0
- package/dist/components/mosaic-glow/MosaicGlow.vue.d.ts +6 -0
- package/dist/components/mosaic-glow/MosaicGlow.vue.js +53 -9
- package/dist/components/mosaic-glow/mosaic-glow-core.d.ts +30 -0
- package/dist/components/mosaic-glow/mosaic-glow-core.js +27 -0
- package/dist/components/mosaic-glow/mosaic-glow-hdr.d.ts +24 -0
- package/dist/components/mosaic-glow/mosaic-glow-hdr.js +200 -0
- package/dist/components/navbar/NavbarLink.vue.d.ts +4 -2
- package/dist/components/navbar/NavbarLink.vue.js +1 -1
- package/dist/components/navbar/NavbarLink.vue2.js +16 -13
- package/dist/components/navigation-menu/NavigationMenu.vue.js +6 -3
- package/dist/components/navigation-menu/NavigationMenuLink.vue.js +1 -1
- package/dist/components/navigation-menu/NavigationMenuLink.vue2.js +8 -8
- package/dist/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +15 -0
- package/dist/components/navigation-menu/NavigationMenuTrigger.vue.js +1 -1
- package/dist/components/navigation-menu/NavigationMenuTrigger.vue2.js +36 -15
- package/dist/components/neon-border/NeonBorder.vue.js +1 -1
- package/dist/components/neon-border/NeonBorder.vue2.js +10 -11
- package/dist/components/number-input/NumberInput.vue.js +1 -1
- package/dist/components/number-input/NumberInput.vue2.js +22 -12
- package/dist/components/password-input/PasswordInput.vue.js +1 -1
- package/dist/components/password-input/PasswordInput.vue2.js +18 -11
- package/dist/components/pixel-loader/PixelLoader.vue.js +1 -1
- package/dist/components/pixel-loader/PixelLoader.vue2.js +6 -6
- package/dist/components/pixel-scene/PixelScene.vue.d.ts +60 -0
- package/dist/components/pixel-scene/PixelScene.vue.js +184 -0
- package/dist/components/pixel-scene/PixelScene.vue2.js +4 -0
- package/dist/components/pixel-scene/index.d.ts +4 -0
- package/dist/components/pixel-scene/pixel-scene-core.d.ts +256 -0
- package/dist/components/pixel-scene/pixel-scene-core.js +878 -0
- package/dist/components/pixel-scene/pixel-scene-hdr.d.ts +68 -0
- package/dist/components/pixel-scene/pixel-scene-hdr.js +312 -0
- package/dist/components/pixel-scene/pixel-scene-scenes.d.ts +31 -0
- package/dist/components/pixel-scene/pixel-scene-scenes.js +1074 -0
- package/dist/components/popover/Popover.vue.d.ts +4 -0
- package/dist/components/popover/Popover.vue.js +1 -1
- package/dist/components/popover/Popover.vue2.js +8 -6
- package/dist/components/popover/PopoverContent.vue.js +6 -2
- package/dist/components/pulse-beam/PulseBeam.vue.d.ts +6 -2
- package/dist/components/pulse-beam/PulseBeam.vue.js +1 -1
- package/dist/components/pulse-beam/PulseBeam.vue2.js +7 -4
- package/dist/components/radio-group/RadioGroup.vue.js +12 -11
- package/dist/components/radio-group/RadioGroupItem.vue.d.ts +2 -0
- package/dist/components/radio-group/RadioGroupItem.vue.js +1 -1
- package/dist/components/radio-group/RadioGroupItem.vue2.js +20 -7
- package/dist/components/rainbow-button/RainbowButton.vue.d.ts +11 -2
- package/dist/components/rainbow-button/RainbowButton.vue.js +1 -1
- package/dist/components/rainbow-button/RainbowButton.vue2.js +35 -18
- package/dist/components/ripple-button/RippleButton.vue.d.ts +6 -4
- package/dist/components/ripple-button/RippleButton.vue.js +1 -1
- package/dist/components/ripple-button/RippleButton.vue2.js +10 -5
- package/dist/components/search-input/SearchInput.vue.js +1 -1
- package/dist/components/search-input/SearchInput.vue2.js +19 -9
- package/dist/components/select/Select.vue.d.ts +1 -1
- package/dist/components/select/Select.vue.js +1 -1
- package/dist/components/select/Select.vue2.js +25 -17
- package/dist/components/sheet/Sheet.vue.d.ts +5 -0
- package/dist/components/sheet/Sheet.vue.js +5 -2
- package/dist/components/shimmer-button/ShimmerButton.vue.d.ts +2 -2
- package/dist/components/shimmer-button/ShimmerButton.vue.js +1 -1
- package/dist/components/shimmer-button/ShimmerButton.vue2.js +14 -6
- package/dist/components/sidebar/SidebarItem.vue.d.ts +4 -2
- package/dist/components/sidebar/SidebarItem.vue.js +1 -1
- package/dist/components/sidebar/SidebarItem.vue2.js +4 -2
- package/dist/components/slider/Slider.vue.d.ts +4 -0
- package/dist/components/slider/Slider.vue.js +1 -1
- package/dist/components/slider/Slider.vue2.js +20 -8
- package/dist/components/sources/SourcesTrigger.vue.js +1 -1
- package/dist/components/sources/SourcesTrigger.vue2.js +11 -11
- package/dist/components/sparkles/sparkles-core.d.ts +1 -1
- package/dist/components/sparkles/sparkles-core.js +36 -2
- package/dist/components/story-thread/StoryNode.vue.d.ts +11 -0
- package/dist/components/story-thread/StoryNode.vue.js +7 -0
- package/dist/components/story-thread/StoryNode.vue2.js +23 -0
- package/dist/components/story-thread/StoryThread.vue.d.ts +56 -0
- package/dist/components/story-thread/StoryThread.vue.js +7 -0
- package/dist/components/story-thread/StoryThread.vue2.js +103 -0
- package/dist/components/story-thread/index.d.ts +5 -0
- package/dist/components/story-thread/story-thread-core.d.ts +119 -0
- package/dist/components/story-thread/story-thread-core.js +491 -0
- package/dist/components/story-thread/types.d.ts +1 -0
- package/dist/components/sun-switch/SunSwitch.vue.d.ts +61 -0
- package/dist/components/sun-switch/SunSwitch.vue.js +7 -0
- package/dist/components/sun-switch/SunSwitch.vue2.js +559 -0
- package/dist/components/sun-switch/index.d.ts +4 -0
- package/dist/components/sun-switch/pixel-wave-core.d.ts +82 -0
- package/dist/components/sun-switch/pixel-wave-core.js +508 -0
- package/dist/components/sun-switch/sun-switch-core.d.ts +251 -0
- package/dist/components/sun-switch/sun-switch-core.js +546 -0
- package/dist/components/sun-switch/sun-switch-hdr.d.ts +70 -0
- package/dist/components/sun-switch/sun-switch-hdr.js +311 -0
- package/dist/components/switch/Switch.vue.d.ts +2 -0
- package/dist/components/switch/Switch.vue.js +1 -1
- package/dist/components/switch/Switch.vue2.js +16 -6
- package/dist/components/tabs/TabsTrigger.vue.d.ts +6 -0
- package/dist/components/tabs/TabsTrigger.vue.js +1 -1
- package/dist/components/tabs/TabsTrigger.vue2.js +28 -15
- package/dist/components/terminal-block/TerminalBlock.vue.js +1 -1
- package/dist/components/terminal-block/TerminalBlock.vue2.js +10 -9
- package/dist/components/text-reveal-card/TextRevealCard.vue.js +1 -2
- package/dist/components/textarea/Textarea.vue.js +1 -1
- package/dist/components/textarea/Textarea.vue2.js +19 -12
- package/dist/components/tick-nav/TickNav.vue.d.ts +71 -0
- package/dist/components/tick-nav/TickNav.vue.js +7 -0
- package/dist/components/tick-nav/TickNav.vue2.js +285 -0
- package/dist/components/tick-nav/index.d.ts +3 -0
- package/dist/components/tick-nav/tick-nav-core.d.ts +102 -0
- package/dist/components/tick-nav/tick-nav-core.js +398 -0
- package/dist/components/tick-nav/tick-nav-hdr.d.ts +60 -0
- package/dist/components/tick-nav/tick-nav-hdr.js +284 -0
- package/dist/components/tick-nav/types.d.ts +13 -0
- package/dist/components/time-picker/TimePicker.vue.js +1 -1
- package/dist/components/time-picker/TimePicker.vue2.js +25 -17
- package/dist/components/toast/Toast.vue.js +1 -1
- package/dist/components/toast/Toast.vue2.js +16 -4
- package/dist/components/toast/index.d.ts +1 -1
- package/dist/components/toast/store.d.ts +23 -0
- package/dist/components/toast/store.js +35 -7
- package/dist/components/toggle/Toggle.vue.d.ts +12 -0
- package/dist/components/toggle/Toggle.vue.js +1 -1
- package/dist/components/toggle/Toggle.vue2.js +27 -11
- package/dist/components/toggle-group/ToggleGroup.vue.d.ts +11 -0
- package/dist/components/toggle-group/ToggleGroup.vue.js +1 -1
- package/dist/components/toggle-group/ToggleGroup.vue2.js +16 -3
- package/dist/components/toggle-group/ToggleGroupItem.vue.d.ts +6 -0
- package/dist/components/toggle-group/ToggleGroupItem.vue.js +1 -1
- package/dist/components/toggle-group/ToggleGroupItem.vue2.js +27 -14
- package/dist/components/tooltip/Tooltip.vue.js +13 -0
- package/dist/components/tracing-beam/TracingBeam.vue.d.ts +20 -1
- package/dist/components/tracing-beam/TracingBeam.vue.js +5 -164
- package/dist/components/tracing-beam/TracingBeam.vue2.js +168 -1
- package/dist/components/typing-indicator/TypingIndicator.vue.js +1 -1
- package/dist/components/typing-indicator/TypingIndicator.vue2.js +7 -6
- package/dist/index.d.ts +10 -0
- package/dist/index.js +466 -413
- package/dist/internals/anchor-position.js +3 -0
- package/dist/internals/call-listener.d.ts +11 -0
- package/dist/internals/call-listener.js +31 -0
- package/dist/internals/dismissable.d.ts +17 -0
- package/dist/internals/dismissable.js +44 -1
- package/dist/internals/env.d.ts +1 -0
- package/dist/internals/env.js +11 -0
- package/dist/internals/focus-trap.js +29 -4
- package/dist/internals/merge-ids.d.ts +6 -0
- package/dist/internals/merge-ids.js +11 -0
- package/dist/internals/motion/presence-core.d.ts +1 -1
- package/dist/sound/engine.js +23 -9
- package/dist/sound/themes.d.ts +4 -3
- package/dist/sound/themes.js +49 -211
- package/dist/sound/types.d.ts +9 -1
- package/dist/sound/types.js +2 -2
- package/dist/styles.css +1473 -571
- package/package.json +2 -2
- package/tailwind.css +9 -9
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { defineComponent, useTemplateRef, shallowRef, onMounted, onBeforeUnmount, watch, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, renderSlot } from "vue";
|
|
2
|
+
import { cn } from "../../utils.js";
|
|
3
|
+
import { sound } from "../../sound/sound.js";
|
|
4
|
+
import { useReducedMotion } from "../../internals/motion/use-media-query.js";
|
|
5
|
+
import { STORY_THREAD_DEFAULTS, createStoryThread } from "./story-thread-core.js";
|
|
6
|
+
const _hoisted_1 = ["aria-label"];
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
...{ name: "StoryThread", inheritAttrs: false },
|
|
9
|
+
__name: "StoryThread",
|
|
10
|
+
props: {
|
|
11
|
+
layout: { default: STORY_THREAD_DEFAULTS.layout },
|
|
12
|
+
segments: { default: () => [] },
|
|
13
|
+
lead: { default: STORY_THREAD_DEFAULTS.lead },
|
|
14
|
+
tension: { default: STORY_THREAD_DEFAULTS.tension },
|
|
15
|
+
dash: { default: STORY_THREAD_DEFAULTS.dash },
|
|
16
|
+
head: { type: Boolean, default: STORY_THREAD_DEFAULTS.head },
|
|
17
|
+
sound: { type: Boolean, default: false },
|
|
18
|
+
onReach: {},
|
|
19
|
+
ariaLabel: { default: "Story" },
|
|
20
|
+
class: { type: [Boolean, null, String, Object, Array] }
|
|
21
|
+
},
|
|
22
|
+
setup(__props) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const root = useTemplateRef("root");
|
|
25
|
+
const viewport = useTemplateRef("viewport");
|
|
26
|
+
const track = useTemplateRef("track");
|
|
27
|
+
const svg = useTemplateRef("svg");
|
|
28
|
+
const core = shallowRef(null);
|
|
29
|
+
const reduced = useReducedMotion();
|
|
30
|
+
function options() {
|
|
31
|
+
return {
|
|
32
|
+
layout: props.layout,
|
|
33
|
+
segments: props.segments,
|
|
34
|
+
lead: props.lead,
|
|
35
|
+
tension: props.tension,
|
|
36
|
+
dash: props.dash,
|
|
37
|
+
head: props.head,
|
|
38
|
+
reducedMotion: reduced.value
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
onMounted(() => {
|
|
42
|
+
if (!root.value || !viewport.value || !track.value || !svg.value) return;
|
|
43
|
+
core.value = createStoryThread(root.value, viewport.value, track.value, svg.value, {
|
|
44
|
+
...options(),
|
|
45
|
+
onReach(id) {
|
|
46
|
+
if (props.sound) sound.play("tick", { volume: 0.5 });
|
|
47
|
+
props.onReach?.(id);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
onBeforeUnmount(() => {
|
|
52
|
+
core.value?.destroy();
|
|
53
|
+
core.value = null;
|
|
54
|
+
});
|
|
55
|
+
watch(
|
|
56
|
+
[
|
|
57
|
+
() => props.layout,
|
|
58
|
+
() => props.segments,
|
|
59
|
+
() => props.lead,
|
|
60
|
+
() => props.tension,
|
|
61
|
+
() => props.dash,
|
|
62
|
+
() => props.head,
|
|
63
|
+
reduced
|
|
64
|
+
],
|
|
65
|
+
() => core.value?.update(options()),
|
|
66
|
+
{ flush: "post" }
|
|
67
|
+
);
|
|
68
|
+
return (_ctx, _cache) => {
|
|
69
|
+
return openBlock(), createElementBlock("div", {
|
|
70
|
+
ref_key: "root",
|
|
71
|
+
ref: root,
|
|
72
|
+
class: normalizeClass(unref(cn)("st-root", props.class)),
|
|
73
|
+
role: "region",
|
|
74
|
+
"aria-label": __props.ariaLabel,
|
|
75
|
+
tabindex: "0"
|
|
76
|
+
}, [
|
|
77
|
+
createElementVNode("div", {
|
|
78
|
+
ref_key: "viewport",
|
|
79
|
+
ref: viewport,
|
|
80
|
+
class: "st-viewport"
|
|
81
|
+
}, [
|
|
82
|
+
createElementVNode("div", {
|
|
83
|
+
ref_key: "track",
|
|
84
|
+
ref: track,
|
|
85
|
+
class: "st-track"
|
|
86
|
+
}, [
|
|
87
|
+
(openBlock(), createElementBlock("svg", {
|
|
88
|
+
ref_key: "svg",
|
|
89
|
+
ref: svg,
|
|
90
|
+
class: "st-svg",
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
focusable: "false"
|
|
93
|
+
}, null, 512)),
|
|
94
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
95
|
+
], 512)
|
|
96
|
+
], 512)
|
|
97
|
+
], 10, _hoisted_1);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
export {
|
|
102
|
+
_sfc_main as default
|
|
103
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as StoryThread } from "./StoryThread.vue";
|
|
2
|
+
export { default as StoryNode } from "./StoryNode.vue";
|
|
3
|
+
export type { StoryThreadProps } from "./StoryThread.vue";
|
|
4
|
+
export type { StoryNodeProps } from "./StoryNode.vue";
|
|
5
|
+
export type { StoryThreadSegment, StoryThreadLayout, StoryThreadDash } from "./types.js";
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StoryThread engine — framework-free, byte-identical in the Svelte, React and
|
|
3
|
+
* Vue trees (see shared-cores.json).
|
|
4
|
+
*
|
|
5
|
+
* The component renders the markup; this module drives everything that moves:
|
|
6
|
+
*
|
|
7
|
+
* - the layout: horizontal (a sticky viewport whose track pans as the page
|
|
8
|
+
* scrolls vertically) or vertical (a plain stack),
|
|
9
|
+
* - the thread: one smooth curve per segment through the centres of the
|
|
10
|
+
* `[data-story-node]` anchors, drawn into the component's <svg> as a faint
|
|
11
|
+
* ghost plus a bright copy uncovered by a mask whose stroke-dashoffset
|
|
12
|
+
* follows the reading position,
|
|
13
|
+
* - the head: a glowing dot at the tip of every segment that is drawing,
|
|
14
|
+
* - the nodes: `data-reached` on each anchor the tip has passed,
|
|
15
|
+
* - the horizontal inputs: sideways wheel, mouse drag, arrow keys, and
|
|
16
|
+
* panning to whatever receives focus.
|
|
17
|
+
*
|
|
18
|
+
* Expected markup:
|
|
19
|
+
* root .st-root the scroll spacer (height set here)
|
|
20
|
+
* viewport .st-viewport sticky window onto the track
|
|
21
|
+
* track .st-track panned with translate3d
|
|
22
|
+
* svg .st-svg filled here, aria-hidden
|
|
23
|
+
* …content holding [data-story-node="<id>"] anchors
|
|
24
|
+
*
|
|
25
|
+
* Per-frame output goes straight to the DOM (attributes, `d`, transforms),
|
|
26
|
+
* never through framework state. No browser global is touched at import time.
|
|
27
|
+
*/
|
|
28
|
+
export type StoryThreadAxis = "x" | "y";
|
|
29
|
+
export type StoryThreadLayout = "auto" | "horizontal" | "vertical";
|
|
30
|
+
export type StoryThreadDash = "dotted" | "dashed" | "solid";
|
|
31
|
+
export interface StoryThreadSegment {
|
|
32
|
+
/** Node ids the segment runs through, in order. */
|
|
33
|
+
nodes: string[];
|
|
34
|
+
/** Stroke and head colour of the drawn part. Any CSS colour. */
|
|
35
|
+
color?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface StoryThreadPoint {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
}
|
|
41
|
+
/** [start, end] of a segment along the scroll axis. */
|
|
42
|
+
export type StoryThreadSpan = [number, number];
|
|
43
|
+
export interface StoryThreadOptions {
|
|
44
|
+
layout: StoryThreadLayout;
|
|
45
|
+
/** Segments to draw; empty means one segment through every node in DOM order. */
|
|
46
|
+
segments: StoryThreadSegment[];
|
|
47
|
+
/** Where the tip sits in the viewport, 0..1 along the scroll axis. */
|
|
48
|
+
lead: number;
|
|
49
|
+
/** Curve tension, 0 (straight lines) .. 1. */
|
|
50
|
+
tension: number;
|
|
51
|
+
dash: StoryThreadDash;
|
|
52
|
+
/** Draw the glowing head at each segment's tip. */
|
|
53
|
+
head: boolean;
|
|
54
|
+
/** No smooth scrolling for the arrow keys. */
|
|
55
|
+
reducedMotion: boolean;
|
|
56
|
+
/** Called once each time the tip moves past a node going forward. */
|
|
57
|
+
onReach?: (id: string) => void;
|
|
58
|
+
}
|
|
59
|
+
export interface StoryThreadCore {
|
|
60
|
+
update(options: Partial<StoryThreadOptions>): void;
|
|
61
|
+
/** Re-read the nodes and the geometry (after content changed). */
|
|
62
|
+
refresh(): void;
|
|
63
|
+
destroy(): void;
|
|
64
|
+
}
|
|
65
|
+
export declare const STORY_THREAD_DEFAULTS: {
|
|
66
|
+
readonly layout: "auto";
|
|
67
|
+
readonly lead: 0.7;
|
|
68
|
+
readonly tension: 0.55;
|
|
69
|
+
readonly dash: "dotted";
|
|
70
|
+
readonly head: true;
|
|
71
|
+
};
|
|
72
|
+
/** Viewport size at which `layout="auto"` turns horizontal. */
|
|
73
|
+
export declare const STORY_THREAD_HORIZONTAL_QUERY = "(min-width: 900px) and (min-height: 520px)";
|
|
74
|
+
/**
|
|
75
|
+
* Cubic curve through `pts` with tangents flat along `axis`: each control
|
|
76
|
+
* point sits `tension` of the way to the neighbour along the scroll axis.
|
|
77
|
+
* Empty string under two points.
|
|
78
|
+
*/
|
|
79
|
+
export declare function curvePath(pts: StoryThreadPoint[], axis: StoryThreadAxis, tension?: number): string;
|
|
80
|
+
/**
|
|
81
|
+
* The segments to draw: the given ones, or one through every node in
|
|
82
|
+
* document order. Ids that are not on the page are dropped; a segment left
|
|
83
|
+
* with fewer than two points is dropped too.
|
|
84
|
+
*/
|
|
85
|
+
export declare function resolveSegments(segments: StoryThreadSegment[], order: string[], points: Record<string, StoryThreadPoint>): {
|
|
86
|
+
ids: string[];
|
|
87
|
+
points: StoryThreadPoint[];
|
|
88
|
+
color?: string;
|
|
89
|
+
}[];
|
|
90
|
+
/** A segment's extent along the scroll axis, from its first to its last point. */
|
|
91
|
+
export declare function segmentSpan(points: StoryThreadPoint[], axis: StoryThreadAxis): StoryThreadSpan;
|
|
92
|
+
/** Drawn fraction of a segment, 0..1, for the tip at `tip` along the axis. */
|
|
93
|
+
export declare function spanProgress(tip: number, span: StoryThreadSpan): number;
|
|
94
|
+
/** Where the tip is, along the axis, in track coordinates. */
|
|
95
|
+
export declare function tipPosition(pos: number, viewport: number, lead: number): number;
|
|
96
|
+
/**
|
|
97
|
+
* Tip of the thread in the horizontal layout. It starts `lead` of the way
|
|
98
|
+
* across the viewport and reaches the end of the track exactly when the pan
|
|
99
|
+
* does, so the last node is always drawn by the end of the story. A track
|
|
100
|
+
* that does not overflow is drawn whole.
|
|
101
|
+
*/
|
|
102
|
+
export declare function panTip(pan: number, maxPan: number, viewportWidth: number, trackWidth: number, lead: number): number;
|
|
103
|
+
/** Height of the scroll spacer that lets vertical scrolling pan the whole track. */
|
|
104
|
+
export declare function spacerHeight(trackWidth: number, viewportWidth: number, viewportHeight: number): number;
|
|
105
|
+
/** Pan offset, px, for a reader who has scrolled `scrolled` px into the spacer. */
|
|
106
|
+
export declare function clampPan(scrolled: number, trackWidth: number, viewportWidth: number): number;
|
|
107
|
+
/** Scroll distance of one arrow-key press. */
|
|
108
|
+
export declare function keyStep(viewportWidth: number, dir: 1 | -1): number;
|
|
109
|
+
/** `stroke-dasharray` of the visible strokes; `null` draws a solid line. */
|
|
110
|
+
export declare function dashPattern(dash: StoryThreadDash): string | null;
|
|
111
|
+
/** Ids of the nodes the tip has passed (a node exactly at the tip counts). */
|
|
112
|
+
export declare function reachedIds(points: Record<string, StoryThreadPoint>, tip: number, axis: StoryThreadAxis): Set<string>;
|
|
113
|
+
/**
|
|
114
|
+
* Path length at which the curve reaches `at` along the axis, interpolated
|
|
115
|
+
* between samples `[length, axisCoordinate]` taken along the path. The curve
|
|
116
|
+
* is assumed to move forward along the axis, which it does when its nodes do.
|
|
117
|
+
*/
|
|
118
|
+
export declare function lengthAtAxis(samples: [number, number][], at: number): number;
|
|
119
|
+
export declare function createStoryThread(root: HTMLElement, viewport: HTMLElement, track: HTMLElement, svg: SVGSVGElement, initial?: Partial<StoryThreadOptions>): StoryThreadCore;
|