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
|
@@ -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", "
|
|
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:
|
|
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
|
-
],
|
|
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
|
|
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-
|
|
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
|
|
34
|
-
const rect =
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
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
|
-
/**
|
|
20
|
-
|
|
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-
|
|
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
|
-
|
|
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
|
|
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-
|
|
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" :
|
|
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:
|
|
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,
|
|
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-
|
|
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,
|
|
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:
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
],
|
|
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(
|
|
59
|
-
|
|
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
|
+
};
|