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,71 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "vue";
|
|
2
|
+
import type { TickNavItem } from "./types.js";
|
|
3
|
+
export interface TickNavProps {
|
|
4
|
+
/** The rows, top to bottom. */
|
|
5
|
+
items: TickNavItem[];
|
|
6
|
+
/**
|
|
7
|
+
* Called with the id of an item that is activated and not already current.
|
|
8
|
+
* The current id is the `value` model (`v-model:value`).
|
|
9
|
+
*/
|
|
10
|
+
onValueChange?: (id: string) => void;
|
|
11
|
+
/** Rows over which the neighbours of the hovered row still react. */
|
|
12
|
+
reach?: number;
|
|
13
|
+
/** Ruler ticks drawn between two rows. */
|
|
14
|
+
minorTicks?: number;
|
|
15
|
+
/**
|
|
16
|
+
* `"neon"` turns the lines into glowing tubes: proximity raises the glow,
|
|
17
|
+
* a hot beam of light rides every pluck, labels glow on hover, and the
|
|
18
|
+
* current line breathes. Made for dark surfaces.
|
|
19
|
+
*/
|
|
20
|
+
variant?: "default" | "neon";
|
|
21
|
+
/**
|
|
22
|
+
* Neon only: on a display that reports HDR, draw the light in a WebGPU
|
|
23
|
+
* canvas with extended tone mapping, so the tubes run brighter than SDR
|
|
24
|
+
* white and the beam peaks around 1000 nits. Elsewhere the CSS glow
|
|
25
|
+
* stays on its own.
|
|
26
|
+
*/
|
|
27
|
+
hdr?: boolean;
|
|
28
|
+
/** Accessible name of the `<nav>` landmark. */
|
|
29
|
+
ariaLabel?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Plays a cue each time a mouse or pen plucks a line: `hover` for an
|
|
32
|
+
* item's line, a softer `tick` for a ruler tick. Off by default; only
|
|
33
|
+
* audible once the user has enabled sound.
|
|
34
|
+
*/
|
|
35
|
+
sound?: boolean;
|
|
36
|
+
/** Additional CSS classes on the `<nav>`. */
|
|
37
|
+
class?: HTMLAttributes["class"];
|
|
38
|
+
}
|
|
39
|
+
declare const _default: typeof __VLS_export;
|
|
40
|
+
export default _default;
|
|
41
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<TickNavProps & {
|
|
42
|
+
/** Id of the current item. */
|
|
43
|
+
value?: string;
|
|
44
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
45
|
+
"update:value": (value: string | undefined) => any;
|
|
46
|
+
}, string, import("vue").PublicProps, Readonly<TickNavProps & {
|
|
47
|
+
/** Id of the current item. */
|
|
48
|
+
value?: string;
|
|
49
|
+
}> & Readonly<{
|
|
50
|
+
"onUpdate:value"?: ((value: string | undefined) => any) | undefined;
|
|
51
|
+
}>, {
|
|
52
|
+
variant: "default" | "neon";
|
|
53
|
+
sound: boolean;
|
|
54
|
+
ariaLabel: string;
|
|
55
|
+
hdr: boolean;
|
|
56
|
+
reach: number;
|
|
57
|
+
minorTicks: number;
|
|
58
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
59
|
+
/**
|
|
60
|
+
* Content of the card that follows the pointer while a row is hovered (or
|
|
61
|
+
* sits beside a keyboard-focused row). Leave it out and no card is rendered.
|
|
62
|
+
*/
|
|
63
|
+
preview?(p: {
|
|
64
|
+
item: TickNavItem;
|
|
65
|
+
}): unknown;
|
|
66
|
+
}>;
|
|
67
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
68
|
+
new (): {
|
|
69
|
+
$slots: S;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { defineComponent, mergeModels, useModel, useTemplateRef, ref, shallowRef, computed, onMounted, onBeforeUnmount, watch, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createElementVNode, Fragment, renderList, createTextVNode, toDisplayString, 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 { createTickNavCore, TICK_NAV_FLAT_PATH, TICK_NAV_DEFAULTS } from "./tick-nav-core.js";
|
|
6
|
+
import { startTickNavHdr, watchTickNavAccent, tickNavLights, TICK_NAV_HDR_PAD, resolveCssColor } from "./tick-nav-hdr.js";
|
|
7
|
+
const _hoisted_1 = ["aria-label", "data-variant", "data-hdr"];
|
|
8
|
+
const _hoisted_2 = ["data-current", "data-active", "data-disabled"];
|
|
9
|
+
const _hoisted_3 = ["href", "aria-current", "onClick"];
|
|
10
|
+
const _hoisted_4 = {
|
|
11
|
+
class: "tn-bar",
|
|
12
|
+
viewBox: "0 0 54 8",
|
|
13
|
+
preserveAspectRatio: "none",
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
};
|
|
16
|
+
const _hoisted_5 = ["d"];
|
|
17
|
+
const _hoisted_6 = ["d"];
|
|
18
|
+
const _hoisted_7 = { class: "tn-label" };
|
|
19
|
+
const _hoisted_8 = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "tn-badge"
|
|
22
|
+
};
|
|
23
|
+
const _hoisted_9 = ["disabled", "aria-current", "onClick"];
|
|
24
|
+
const _hoisted_10 = {
|
|
25
|
+
class: "tn-bar",
|
|
26
|
+
viewBox: "0 0 54 8",
|
|
27
|
+
preserveAspectRatio: "none",
|
|
28
|
+
"aria-hidden": "true"
|
|
29
|
+
};
|
|
30
|
+
const _hoisted_11 = ["d"];
|
|
31
|
+
const _hoisted_12 = ["d"];
|
|
32
|
+
const _hoisted_13 = { class: "tn-label" };
|
|
33
|
+
const _hoisted_14 = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "tn-badge"
|
|
36
|
+
};
|
|
37
|
+
const _hoisted_15 = {
|
|
38
|
+
key: 2,
|
|
39
|
+
class: "tn-ticks",
|
|
40
|
+
"aria-hidden": "true"
|
|
41
|
+
};
|
|
42
|
+
const _hoisted_16 = {
|
|
43
|
+
viewBox: "0 0 54 8",
|
|
44
|
+
preserveAspectRatio: "none"
|
|
45
|
+
};
|
|
46
|
+
const _hoisted_17 = ["d"];
|
|
47
|
+
const _hoisted_18 = ["d"];
|
|
48
|
+
const _hoisted_19 = {
|
|
49
|
+
key: 1,
|
|
50
|
+
class: "tn-preview",
|
|
51
|
+
"aria-hidden": "true"
|
|
52
|
+
};
|
|
53
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
54
|
+
...{ name: "TickNav", inheritAttrs: false },
|
|
55
|
+
__name: "TickNav",
|
|
56
|
+
props: /* @__PURE__ */ mergeModels({
|
|
57
|
+
items: {},
|
|
58
|
+
onValueChange: {},
|
|
59
|
+
reach: { default: TICK_NAV_DEFAULTS.reach },
|
|
60
|
+
minorTicks: { default: 2 },
|
|
61
|
+
variant: { default: "default" },
|
|
62
|
+
hdr: { type: Boolean, default: true },
|
|
63
|
+
ariaLabel: { default: "Navigation" },
|
|
64
|
+
sound: { type: Boolean, default: false },
|
|
65
|
+
class: { type: [Boolean, null, String, Object, Array] }
|
|
66
|
+
}, {
|
|
67
|
+
"value": {},
|
|
68
|
+
"valueModifiers": {}
|
|
69
|
+
}),
|
|
70
|
+
emits: ["update:value"],
|
|
71
|
+
setup(__props) {
|
|
72
|
+
const props = __props;
|
|
73
|
+
const value = useModel(__props, "value");
|
|
74
|
+
const root = useTemplateRef("root");
|
|
75
|
+
const list = useTemplateRef("list");
|
|
76
|
+
const active = ref(-1);
|
|
77
|
+
const core = shallowRef(null);
|
|
78
|
+
const hdrCanvas = useTemplateRef("hdrCanvas");
|
|
79
|
+
const hdrOn = ref(false);
|
|
80
|
+
const reduced = useReducedMotion();
|
|
81
|
+
const ticks = computed(() => Math.max(0, Math.round(props.minorTicks)));
|
|
82
|
+
const currentIndex = computed(() => props.items.findIndex((item) => item.id === value.value));
|
|
83
|
+
const activeItem = computed(() => active.value >= 0 ? props.items[active.value] : void 0);
|
|
84
|
+
onMounted(() => {
|
|
85
|
+
if (!root.value || !list.value) return;
|
|
86
|
+
core.value = createTickNavCore(root.value, list.value, {
|
|
87
|
+
reach: props.reach,
|
|
88
|
+
current: currentIndex.value,
|
|
89
|
+
reducedMotion: reduced.value,
|
|
90
|
+
onActiveChange(index) {
|
|
91
|
+
active.value = index;
|
|
92
|
+
},
|
|
93
|
+
onPluck(kind) {
|
|
94
|
+
if (!props.sound) return;
|
|
95
|
+
if (kind === "row") sound.play("hover");
|
|
96
|
+
else sound.play("tick", { volume: 0.6 });
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
onBeforeUnmount(() => {
|
|
101
|
+
core.value?.destroy();
|
|
102
|
+
core.value = null;
|
|
103
|
+
active.value = -1;
|
|
104
|
+
});
|
|
105
|
+
watch(
|
|
106
|
+
[() => props.reach, currentIndex, reduced],
|
|
107
|
+
() => {
|
|
108
|
+
core.value?.update({
|
|
109
|
+
reach: props.reach,
|
|
110
|
+
current: currentIndex.value,
|
|
111
|
+
reducedMotion: reduced.value
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
{ flush: "post" }
|
|
115
|
+
);
|
|
116
|
+
watch(
|
|
117
|
+
[() => props.items.map((item) => item.id).join("\0"), ticks, () => props.variant],
|
|
118
|
+
() => core.value?.refresh(),
|
|
119
|
+
{ flush: "post" }
|
|
120
|
+
);
|
|
121
|
+
watch(
|
|
122
|
+
[hdrCanvas, core, root],
|
|
123
|
+
([canvas, instance, host], _old, onCleanup) => {
|
|
124
|
+
if (!canvas || !instance || !host) return;
|
|
125
|
+
let cancelled = false;
|
|
126
|
+
let stop = null;
|
|
127
|
+
void startTickNavHdr(canvas).then((light) => {
|
|
128
|
+
if (!light) return;
|
|
129
|
+
if (cancelled) {
|
|
130
|
+
light.destroy();
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const unwatch = watchTickNavAccent(canvas, (css) => {
|
|
134
|
+
const accent = resolveCssColor(css);
|
|
135
|
+
if (!accent) return;
|
|
136
|
+
light.setAccent(accent);
|
|
137
|
+
instance.measure();
|
|
138
|
+
});
|
|
139
|
+
const size = () => light.resize(
|
|
140
|
+
host.offsetWidth + TICK_NAV_HDR_PAD * 2,
|
|
141
|
+
host.offsetHeight + TICK_NAV_HDR_PAD * 2
|
|
142
|
+
);
|
|
143
|
+
size();
|
|
144
|
+
const ro = new ResizeObserver(() => {
|
|
145
|
+
size();
|
|
146
|
+
instance.measure();
|
|
147
|
+
});
|
|
148
|
+
ro.observe(host);
|
|
149
|
+
instance.update({ onFrame: (lines) => light.render(tickNavLights(lines)) });
|
|
150
|
+
hdrOn.value = true;
|
|
151
|
+
stop = () => {
|
|
152
|
+
unwatch();
|
|
153
|
+
ro.disconnect();
|
|
154
|
+
instance.update({ onFrame: void 0 });
|
|
155
|
+
light.destroy();
|
|
156
|
+
hdrOn.value = false;
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
onCleanup(() => {
|
|
160
|
+
cancelled = true;
|
|
161
|
+
stop?.();
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
{ flush: "post" }
|
|
165
|
+
);
|
|
166
|
+
function activate(item, event) {
|
|
167
|
+
if (item.disabled) {
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (item.id === value.value) return;
|
|
172
|
+
value.value = item.id;
|
|
173
|
+
props.onValueChange?.(item.id);
|
|
174
|
+
}
|
|
175
|
+
return (_ctx, _cache) => {
|
|
176
|
+
return openBlock(), createElementBlock("nav", {
|
|
177
|
+
ref_key: "root",
|
|
178
|
+
ref: root,
|
|
179
|
+
"aria-label": __props.ariaLabel,
|
|
180
|
+
class: normalizeClass(unref(cn)("tn-root", props.class)),
|
|
181
|
+
"data-variant": __props.variant === "neon" ? "neon" : void 0,
|
|
182
|
+
"data-hdr": hdrOn.value ? "" : void 0
|
|
183
|
+
}, [
|
|
184
|
+
__props.variant === "neon" && __props.hdr ? (openBlock(), createElementBlock("canvas", {
|
|
185
|
+
key: 0,
|
|
186
|
+
ref_key: "hdrCanvas",
|
|
187
|
+
ref: hdrCanvas,
|
|
188
|
+
class: "tn-hdr",
|
|
189
|
+
"aria-hidden": "true"
|
|
190
|
+
}, null, 512)) : createCommentVNode("", true),
|
|
191
|
+
createElementVNode("ul", {
|
|
192
|
+
ref_key: "list",
|
|
193
|
+
ref: list,
|
|
194
|
+
class: "tn-list"
|
|
195
|
+
}, [
|
|
196
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, i) => {
|
|
197
|
+
return openBlock(), createElementBlock("li", {
|
|
198
|
+
key: item.id,
|
|
199
|
+
class: "tn-item",
|
|
200
|
+
"data-current": item.id === value.value ? "" : void 0,
|
|
201
|
+
"data-active": i === active.value ? "" : void 0,
|
|
202
|
+
"data-disabled": item.disabled ? "" : void 0
|
|
203
|
+
}, [
|
|
204
|
+
item.href && !item.disabled ? (openBlock(), createElementBlock("a", {
|
|
205
|
+
key: 0,
|
|
206
|
+
class: "tn-link",
|
|
207
|
+
href: item.href,
|
|
208
|
+
"aria-current": item.id === value.value ? "page" : void 0,
|
|
209
|
+
onClick: ($event) => activate(item, $event)
|
|
210
|
+
}, [
|
|
211
|
+
(openBlock(), createElementBlock("svg", _hoisted_4, [
|
|
212
|
+
createElementVNode("path", {
|
|
213
|
+
class: "tn-path",
|
|
214
|
+
d: unref(TICK_NAV_FLAT_PATH)
|
|
215
|
+
}, null, 8, _hoisted_5),
|
|
216
|
+
__props.variant === "neon" ? (openBlock(), createElementBlock("path", {
|
|
217
|
+
key: 0,
|
|
218
|
+
class: "tn-beam",
|
|
219
|
+
d: unref(TICK_NAV_FLAT_PATH),
|
|
220
|
+
pathLength: "100"
|
|
221
|
+
}, null, 8, _hoisted_6)) : createCommentVNode("", true)
|
|
222
|
+
])),
|
|
223
|
+
createElementVNode("span", _hoisted_7, [
|
|
224
|
+
createTextVNode(toDisplayString(item.label) + " ", 1),
|
|
225
|
+
item.badge ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(item.badge), 1)) : createCommentVNode("", true)
|
|
226
|
+
])
|
|
227
|
+
], 8, _hoisted_3)) : (openBlock(), createElementBlock("button", {
|
|
228
|
+
key: 1,
|
|
229
|
+
type: "button",
|
|
230
|
+
class: "tn-link",
|
|
231
|
+
disabled: item.disabled,
|
|
232
|
+
"aria-current": item.id === value.value ? "page" : void 0,
|
|
233
|
+
onClick: ($event) => activate(item, $event)
|
|
234
|
+
}, [
|
|
235
|
+
(openBlock(), createElementBlock("svg", _hoisted_10, [
|
|
236
|
+
createElementVNode("path", {
|
|
237
|
+
class: "tn-path",
|
|
238
|
+
d: unref(TICK_NAV_FLAT_PATH)
|
|
239
|
+
}, null, 8, _hoisted_11),
|
|
240
|
+
__props.variant === "neon" ? (openBlock(), createElementBlock("path", {
|
|
241
|
+
key: 0,
|
|
242
|
+
class: "tn-beam",
|
|
243
|
+
d: unref(TICK_NAV_FLAT_PATH),
|
|
244
|
+
pathLength: "100"
|
|
245
|
+
}, null, 8, _hoisted_12)) : createCommentVNode("", true)
|
|
246
|
+
])),
|
|
247
|
+
createElementVNode("span", _hoisted_13, [
|
|
248
|
+
createTextVNode(toDisplayString(item.label) + " ", 1),
|
|
249
|
+
item.badge ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(item.badge), 1)) : createCommentVNode("", true)
|
|
250
|
+
])
|
|
251
|
+
], 8, _hoisted_9)),
|
|
252
|
+
ticks.value > 0 && i < __props.items.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_15, [
|
|
253
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(ticks.value, (_, k) => {
|
|
254
|
+
return openBlock(), createElementBlock("span", {
|
|
255
|
+
key: k,
|
|
256
|
+
class: "tn-tick"
|
|
257
|
+
}, [
|
|
258
|
+
(openBlock(), createElementBlock("svg", _hoisted_16, [
|
|
259
|
+
createElementVNode("path", {
|
|
260
|
+
class: "tn-tick-path",
|
|
261
|
+
d: unref(TICK_NAV_FLAT_PATH)
|
|
262
|
+
}, null, 8, _hoisted_17),
|
|
263
|
+
__props.variant === "neon" ? (openBlock(), createElementBlock("path", {
|
|
264
|
+
key: 0,
|
|
265
|
+
class: "tn-beam",
|
|
266
|
+
d: unref(TICK_NAV_FLAT_PATH),
|
|
267
|
+
pathLength: "100"
|
|
268
|
+
}, null, 8, _hoisted_18)) : createCommentVNode("", true)
|
|
269
|
+
]))
|
|
270
|
+
]);
|
|
271
|
+
}), 128))
|
|
272
|
+
])) : createCommentVNode("", true)
|
|
273
|
+
], 8, _hoisted_2);
|
|
274
|
+
}), 128))
|
|
275
|
+
], 512),
|
|
276
|
+
_ctx.$slots.preview && activeItem.value ? (openBlock(), createElementBlock("div", _hoisted_19, [
|
|
277
|
+
renderSlot(_ctx.$slots, "preview", { item: activeItem.value }, void 0, true)
|
|
278
|
+
])) : createCommentVNode("", true)
|
|
279
|
+
], 10, _hoisted_1);
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
export {
|
|
284
|
+
_sfc_main as default
|
|
285
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TickNav engine — framework-free, byte-identical in the Svelte, React and Vue
|
|
3
|
+
* trees (see shared-cores.json).
|
|
4
|
+
*
|
|
5
|
+
* The component renders the markup; this module drives everything that moves:
|
|
6
|
+
*
|
|
7
|
+
* - a width spring per row (resting length → hover length),
|
|
8
|
+
* - a proximity spring per row and per tick group, fed by a smoothstep of the
|
|
9
|
+
* distance, in rows, to the hovered row,
|
|
10
|
+
* - a one-shot "pluck": a wave packet that runs along a line and leaves it
|
|
11
|
+
* flat again. Every line plucks — rows and ticks alike — the moment the
|
|
12
|
+
* pointer crosses it, so a sweep strums the ruler like strings,
|
|
13
|
+
* - the preview card's position (it follows the pointer) and its fade-in.
|
|
14
|
+
*
|
|
15
|
+
* All output goes to CSS custom properties and to the pluck path's `d`, never
|
|
16
|
+
* through framework state, so nothing re-renders per frame. The loop sleeps as
|
|
17
|
+
* soon as every spring has settled.
|
|
18
|
+
*
|
|
19
|
+
* Expected markup, inside `list`:
|
|
20
|
+
* li.tn-item one per item, in order
|
|
21
|
+
* .tn-path the row's <path> (pluck target)
|
|
22
|
+
* .tn-ticks optional tick group after the row
|
|
23
|
+
* .tn-tick-path one <path> per tick (pluck target)
|
|
24
|
+
* A line's <svg> may also hold a `.tn-beam` path: it gets the same `d` as the
|
|
25
|
+
* line during a pluck, and the <svg> gets `data-plucking` plus `--tn-p`, the
|
|
26
|
+
* eased progress 0..1 of the wave's head, so CSS can ride a highlight on it.
|
|
27
|
+
* and, inside `root`, an optional `.tn-preview` that reads `--tn-px`,
|
|
28
|
+
* `--tn-py` and `--tn-po`.
|
|
29
|
+
*
|
|
30
|
+
* No browser global is touched at import time.
|
|
31
|
+
*/
|
|
32
|
+
export interface TickNavCoreOptions {
|
|
33
|
+
/** Rows over which proximity falls to zero. */
|
|
34
|
+
reach: number;
|
|
35
|
+
/** Resting line length, px. */
|
|
36
|
+
restLength: number;
|
|
37
|
+
/** Line length of the hovered and the current row, px. */
|
|
38
|
+
activeLength: number;
|
|
39
|
+
/** Extra length, px, that proximity adds to lines and ticks. */
|
|
40
|
+
proximityLength: number;
|
|
41
|
+
/** Index of the current item, or -1. */
|
|
42
|
+
current: number;
|
|
43
|
+
/** Snap instead of animating; no pluck. */
|
|
44
|
+
reducedMotion: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Called when the hovered (or keyboard-focused) row changes. `index` is -1
|
|
47
|
+
* when nothing is hovered. `pointer` is true for a mouse or pen.
|
|
48
|
+
*/
|
|
49
|
+
onActiveChange?: (index: number, pointer: boolean) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Called each time a mouse or pen plucks a line: `kind` says whether it is
|
|
52
|
+
* an item's line or a tick, `row` is the item it belongs to (a tick belongs
|
|
53
|
+
* to the item above it). The place to play a sound.
|
|
54
|
+
*/
|
|
55
|
+
onPluck?: (kind: "row" | "tick", row: number) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Called after every painted frame with each line's state, for a renderer
|
|
58
|
+
* that draws extra light on top (the HDR layer). Positions are CSS px
|
|
59
|
+
* relative to `root`.
|
|
60
|
+
*/
|
|
61
|
+
onFrame?: (lines: TickNavLineState[]) => void;
|
|
62
|
+
}
|
|
63
|
+
export interface TickNavLineState {
|
|
64
|
+
kind: "row" | "tick";
|
|
65
|
+
row: number;
|
|
66
|
+
/** Left end and vertical centre of the line, relative to `root`. */
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
/** Current drawn length, px. */
|
|
70
|
+
length: number;
|
|
71
|
+
/** Proximity 0..1. */
|
|
72
|
+
near: number;
|
|
73
|
+
/** Eased progress of a running pluck's wave head, or null. */
|
|
74
|
+
progress: number | null;
|
|
75
|
+
current: boolean;
|
|
76
|
+
}
|
|
77
|
+
export interface TickNavCore {
|
|
78
|
+
update(options: Partial<TickNavCoreOptions>): void;
|
|
79
|
+
/** Re-reads the rows after the item list changed. */
|
|
80
|
+
refresh(): void;
|
|
81
|
+
/** Re-measures line positions after a layout change (resize). */
|
|
82
|
+
measure(): void;
|
|
83
|
+
destroy(): void;
|
|
84
|
+
}
|
|
85
|
+
/** Tick lengths; the component's CSS uses the same numbers. */
|
|
86
|
+
export declare const TICK_NAV_TICK_REST = 24;
|
|
87
|
+
export declare const TICK_NAV_TICK_GROW = 16;
|
|
88
|
+
export declare const TICK_NAV_DEFAULTS: Readonly<{
|
|
89
|
+
reach: 4;
|
|
90
|
+
restLength: 32;
|
|
91
|
+
activeLength: 55;
|
|
92
|
+
proximityLength: 16;
|
|
93
|
+
}>;
|
|
94
|
+
/** The flat line the pluck starts from and returns to, in the 54×8 viewBox. */
|
|
95
|
+
export declare const TICK_NAV_FLAT_PATH = "M0 4L54 4";
|
|
96
|
+
/**
|
|
97
|
+
* The pluck at progress `p` (0..1, already eased): a packet centred on
|
|
98
|
+
* `54 * p`, 20 units wide, whose amplitude fades by 30% over the run.
|
|
99
|
+
* `amplitude` scales the swing (ticks swing less than rows).
|
|
100
|
+
*/
|
|
101
|
+
export declare function pluckPath(p: number, amplitude?: number): string;
|
|
102
|
+
export declare function createTickNavCore(root: HTMLElement, list: HTMLElement, initial?: Partial<TickNavCoreOptions>): TickNavCore;
|