fancy-ui-react 0.2.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/LICENSE +21 -0
- package/PORTING.md +118 -0
- package/README.md +643 -0
- package/dist/cameleon/FancyProvider.d.ts +11 -0
- package/dist/cameleon/FancyProvider.js +42 -0
- package/dist/cameleon/context.d.ts +22 -0
- package/dist/cameleon/context.js +16 -0
- package/dist/cameleon/index.d.ts +31 -0
- package/dist/cameleon/index.js +39 -0
- package/dist/cameleon/primitives/Badge.d.ts +10 -0
- package/dist/cameleon/primitives/Badge.js +12 -0
- package/dist/cameleon/primitives/Button.d.ts +11 -0
- package/dist/cameleon/primitives/Button.js +43 -0
- package/dist/cameleon/primitives/Checkbox.d.ts +10 -0
- package/dist/cameleon/primitives/Checkbox.js +39 -0
- package/dist/cameleon/primitives/Input.d.ts +10 -0
- package/dist/cameleon/primitives/Input.js +13 -0
- package/dist/cameleon/primitives/Radio.d.ts +12 -0
- package/dist/cameleon/primitives/Radio.js +29 -0
- package/dist/cameleon/primitives/Select.d.ts +10 -0
- package/dist/cameleon/primitives/Select.js +27 -0
- package/dist/cameleon/primitives/Slider.d.ts +7 -0
- package/dist/cameleon/primitives/Slider.js +22 -0
- package/dist/cameleon/primitives/Switch.d.ts +9 -0
- package/dist/cameleon/primitives/Switch.js +33 -0
- package/dist/cameleon/primitives/Textarea.d.ts +9 -0
- package/dist/cameleon/primitives/Textarea.js +13 -0
- package/dist/cameleon/primitives/Tooltip.d.ts +14 -0
- package/dist/cameleon/primitives/Tooltip.js +15 -0
- package/dist/cameleon/primitives/index.d.ts +10 -0
- package/dist/cameleon/skins/aurora/index.d.ts +2 -0
- package/dist/cameleon/skins/aurora/index.js +16 -0
- package/dist/cameleon/skins/aurora/meta.d.ts +3 -0
- package/dist/cameleon/skins/aurora/meta.js +61 -0
- package/dist/cameleon/skins/aurora/recipes.d.ts +24 -0
- package/dist/cameleon/skins/aurora/recipes.js +124 -0
- package/dist/cameleon/skins/aurora/tokens.d.ts +6 -0
- package/dist/cameleon/skins/aurora/tokens.js +18 -0
- package/dist/cameleon/skins/brutal/index.d.ts +2 -0
- package/dist/cameleon/skins/brutal/index.js +35 -0
- package/dist/cameleon/skins/brutal/meta.d.ts +3 -0
- package/dist/cameleon/skins/brutal/meta.js +73 -0
- package/dist/cameleon/skins/brutal/ornaments.d.ts +7 -0
- package/dist/cameleon/skins/brutal/ornaments.js +18 -0
- package/dist/cameleon/skins/brutal/recipes.d.ts +23 -0
- package/dist/cameleon/skins/brutal/recipes.js +113 -0
- package/dist/cameleon/skins/brutal/tokens.d.ts +8 -0
- package/dist/cameleon/skins/brutal/tokens.js +23 -0
- package/dist/cameleon/skins/default.d.ts +2 -0
- package/dist/cameleon/skins/default.js +79 -0
- package/dist/cameleon/skins/glass/index.d.ts +2 -0
- package/dist/cameleon/skins/glass/index.js +16 -0
- package/dist/cameleon/skins/glass/meta.d.ts +3 -0
- package/dist/cameleon/skins/glass/meta.js +63 -0
- package/dist/cameleon/skins/glass/recipes.d.ts +24 -0
- package/dist/cameleon/skins/glass/recipes.js +124 -0
- package/dist/cameleon/skins/glass/tokens.d.ts +5 -0
- package/dist/cameleon/skins/glass/tokens.js +18 -0
- package/dist/cameleon/skins/retro-os/index.d.ts +2 -0
- package/dist/cameleon/skins/retro-os/index.js +24 -0
- package/dist/cameleon/skins/retro-os/meta.d.ts +3 -0
- package/dist/cameleon/skins/retro-os/meta.js +61 -0
- package/dist/cameleon/skins/retro-os/ornaments.d.ts +9 -0
- package/dist/cameleon/skins/retro-os/ornaments.js +28 -0
- package/dist/cameleon/skins/retro-os/recipes.d.ts +35 -0
- package/dist/cameleon/skins/retro-os/recipes.js +126 -0
- package/dist/cameleon/skins/retro-os/tokens.d.ts +16 -0
- package/dist/cameleon/skins/retro-os/tokens.js +23 -0
- package/dist/cameleon/skins/terminal/index.d.ts +2 -0
- package/dist/cameleon/skins/terminal/index.js +24 -0
- package/dist/cameleon/skins/terminal/meta.d.ts +3 -0
- package/dist/cameleon/skins/terminal/meta.js +70 -0
- package/dist/cameleon/skins/terminal/ornaments.d.ts +7 -0
- package/dist/cameleon/skins/terminal/ornaments.js +8 -0
- package/dist/cameleon/skins/terminal/recipes.d.ts +25 -0
- package/dist/cameleon/skins/terminal/recipes.js +125 -0
- package/dist/cameleon/skins/terminal/tokens.d.ts +5 -0
- package/dist/cameleon/skins/terminal/tokens.js +18 -0
- package/dist/cameleon/types.d.ts +133 -0
- package/dist/components/agent-plan/AgentPlan.d.ts +25 -0
- package/dist/components/agent-plan/AgentPlan.js +181 -0
- package/dist/components/agent-plan/index.d.ts +2 -0
- package/dist/components/ai-data-table/AiDataTable.d.ts +54 -0
- package/dist/components/ai-data-table/AiDataTable.js +110 -0
- package/dist/components/ai-data-table/index.d.ts +2 -0
- package/dist/components/alert-dialog/AlertDialog.d.ts +35 -0
- package/dist/components/alert-dialog/AlertDialog.js +109 -0
- package/dist/components/alert-dialog/index.d.ts +2 -0
- package/dist/components/animated-beam/AnimatedBeam.d.ts +39 -0
- package/dist/components/animated-beam/AnimatedBeam.js +192 -0
- package/dist/components/animated-beam/index.d.ts +2 -0
- package/dist/components/animated-testimonials/AnimatedTestimonials.d.ts +32 -0
- package/dist/components/animated-testimonials/AnimatedTestimonials.js +172 -0
- package/dist/components/animated-testimonials/index.d.ts +2 -0
- package/dist/components/animated-tooltip/AnimatedTooltip.d.ts +13 -0
- package/dist/components/animated-tooltip/AnimatedTooltip.js +137 -0
- package/dist/components/animated-tooltip/index.d.ts +2 -0
- package/dist/components/apple-card-carousel/AppleCard.d.ts +30 -0
- package/dist/components/apple-card-carousel/AppleCard.js +219 -0
- package/dist/components/apple-card-carousel/AppleCardCarousel.d.ts +14 -0
- package/dist/components/apple-card-carousel/AppleCardCarousel.js +30 -0
- package/dist/components/apple-card-carousel/index.d.ts +4 -0
- package/dist/components/approval-card/ApprovalCard.d.ts +57 -0
- package/dist/components/approval-card/ApprovalCard.js +153 -0
- package/dist/components/approval-card/index.d.ts +2 -0
- package/dist/components/artifact-card/ArtifactCard.d.ts +44 -0
- package/dist/components/artifact-card/ArtifactCard.js +204 -0
- package/dist/components/artifact-card/index.d.ts +2 -0
- package/dist/components/autocomplete/Autocomplete.d.ts +36 -0
- package/dist/components/autocomplete/Autocomplete.js +186 -0
- package/dist/components/autocomplete/AutocompletePanel.d.ts +12 -0
- package/dist/components/autocomplete/AutocompletePanel.js +123 -0
- package/dist/components/autocomplete/index.d.ts +4 -0
- package/dist/components/autocomplete/match.d.ts +6 -0
- package/dist/components/autocomplete/match.js +10 -0
- package/dist/components/autocomplete/types.d.ts +52 -0
- package/dist/components/autocomplete/types.js +6 -0
- package/dist/components/bento-grid/BentoGrid.d.ts +6 -0
- package/dist/components/bento-grid/BentoGrid.js +19 -0
- package/dist/components/bento-grid/BentoGridCard.d.ts +11 -0
- package/dist/components/bento-grid/BentoGridCard.js +49 -0
- package/dist/components/bento-grid/BentoGridItem.d.ts +9 -0
- package/dist/components/bento-grid/BentoGridItem.js +33 -0
- package/dist/components/bento-grid/index.d.ts +6 -0
- package/dist/components/bg-falling-stars/FallingStarsBg.d.ts +24 -0
- package/dist/components/bg-falling-stars/FallingStarsBg.js +134 -0
- package/dist/components/bg-falling-stars/index.d.ts +2 -0
- package/dist/components/bg-stars/StarsBackground.d.ts +40 -0
- package/dist/components/bg-stars/StarsBackground.js +188 -0
- package/dist/components/bg-stars/index.d.ts +2 -0
- package/dist/components/blur-reveal/BlurReveal.d.ts +19 -0
- package/dist/components/blur-reveal/BlurReveal.js +50 -0
- package/dist/components/blur-reveal/index.d.ts +2 -0
- package/dist/components/book/Book.d.ts +13 -0
- package/dist/components/book/Book.js +94 -0
- package/dist/components/book/BookDescription.d.ts +6 -0
- package/dist/components/book/BookDescription.js +9 -0
- package/dist/components/book/BookHeader.d.ts +6 -0
- package/dist/components/book/BookHeader.js +9 -0
- package/dist/components/book/BookTitle.d.ts +6 -0
- package/dist/components/book/BookTitle.js +9 -0
- package/dist/components/book/index.d.ts +132 -0
- package/dist/components/book/index.js +48 -0
- package/dist/components/border-beam/BorderBeam.d.ts +25 -0
- package/dist/components/border-beam/BorderBeam.js +45 -0
- package/dist/components/border-beam/index.d.ts +2 -0
- package/dist/components/box-reveal/BoxReveal.d.ts +20 -0
- package/dist/components/box-reveal/BoxReveal.js +58 -0
- package/dist/components/box-reveal/index.d.ts +2 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +49 -0
- package/dist/components/breadcrumb/Breadcrumb.js +61 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/button/Button.d.ts +44 -0
- package/dist/components/button/Button.js +120 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/types.d.ts +4 -0
- package/dist/components/button-group/ButtonGroup.d.ts +23 -0
- package/dist/components/button-group/ButtonGroup.js +30 -0
- package/dist/components/button-group/index.d.ts +4 -0
- package/dist/components/button-group/types.d.ts +34 -0
- package/dist/components/button-group/types.js +7 -0
- package/dist/components/card-3d/CardBody.d.ts +8 -0
- package/dist/components/card-3d/CardBody.js +9 -0
- package/dist/components/card-3d/CardContainer.d.ts +19 -0
- package/dist/components/card-3d/CardContainer.js +61 -0
- package/dist/components/card-3d/CardItem.d.ts +22 -0
- package/dist/components/card-3d/CardItem.js +29 -0
- package/dist/components/card-3d/index.d.ts +6 -0
- package/dist/components/card-spotlight/CardSpotlight.d.ts +16 -0
- package/dist/components/card-spotlight/CardSpotlight.js +65 -0
- package/dist/components/card-spotlight/index.d.ts +2 -0
- package/dist/components/chat-error/ChatError.d.ts +32 -0
- package/dist/components/chat-error/ChatError.js +75 -0
- package/dist/components/chat-error/index.d.ts +2 -0
- package/dist/components/chat-message/ChatMessage.d.ts +43 -0
- package/dist/components/chat-message/ChatMessage.js +127 -0
- package/dist/components/chat-message/ChatMessageAction.d.ts +20 -0
- package/dist/components/chat-message/ChatMessageAction.js +58 -0
- package/dist/components/chat-message/ChatMessageActions.d.ts +14 -0
- package/dist/components/chat-message/ChatMessageActions.js +30 -0
- package/dist/components/chat-message/ChatMessageBranches.d.ts +15 -0
- package/dist/components/chat-message/ChatMessageBranches.js +93 -0
- package/dist/components/chat-message/index.d.ts +10 -0
- package/dist/components/chat-message/types.d.ts +38 -0
- package/dist/components/chat-message/types.js +7 -0
- package/dist/components/chat-panel/ChatEmptyState.d.ts +17 -0
- package/dist/components/chat-panel/ChatEmptyState.js +42 -0
- package/dist/components/chat-panel/ChatPanel.d.ts +31 -0
- package/dist/components/chat-panel/ChatPanel.js +163 -0
- package/dist/components/chat-panel/index.d.ts +4 -0
- package/dist/components/checkbox/Checkbox.d.ts +64 -0
- package/dist/components/checkbox/Checkbox.js +123 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/code-diff/CodeDiff.d.ts +39 -0
- package/dist/components/code-diff/CodeDiff.js +213 -0
- package/dist/components/code-diff/index.d.ts +2 -0
- package/dist/components/colourful-text/ColourfulText.d.ts +28 -0
- package/dist/components/colourful-text/ColourfulText.js +73 -0
- package/dist/components/colourful-text/index.d.ts +2 -0
- package/dist/components/combobox/Combobox.d.ts +53 -0
- package/dist/components/combobox/Combobox.js +248 -0
- package/dist/components/combobox/ComboboxPanel.d.ts +28 -0
- package/dist/components/combobox/ComboboxPanel.js +110 -0
- package/dist/components/combobox/index.d.ts +4 -0
- package/dist/components/combobox/match.d.ts +15 -0
- package/dist/components/combobox/match.js +14 -0
- package/dist/components/combobox/types.d.ts +60 -0
- package/dist/components/combobox/types.js +6 -0
- package/dist/components/command-menu/CommandMenu.d.ts +37 -0
- package/dist/components/command-menu/CommandMenu.js +386 -0
- package/dist/components/command-menu/index.d.ts +3 -0
- package/dist/components/command-menu/match.d.ts +19 -0
- package/dist/components/command-menu/match.js +45 -0
- package/dist/components/command-menu/types.d.ts +19 -0
- package/dist/components/compare/Compare.d.ts +31 -0
- package/dist/components/compare/Compare.js +300 -0
- package/dist/components/compare/StarField.d.ts +22 -0
- package/dist/components/compare/StarField.js +66 -0
- package/dist/components/compare/index.d.ts +4 -0
- package/dist/components/composer/Composer.d.ts +56 -0
- package/dist/components/composer/Composer.js +155 -0
- package/dist/components/composer/ComposerAttachment.d.ts +14 -0
- package/dist/components/composer/ComposerAttachment.js +127 -0
- package/dist/components/composer/ComposerAttachments.d.ts +18 -0
- package/dist/components/composer/ComposerAttachments.js +85 -0
- package/dist/components/composer/ComposerCommandMenu.d.ts +37 -0
- package/dist/components/composer/ComposerCommandMenu.js +208 -0
- package/dist/components/composer/ComposerInput.d.ts +22 -0
- package/dist/components/composer/ComposerInput.js +96 -0
- package/dist/components/composer/ComposerModelPicker.d.ts +32 -0
- package/dist/components/composer/ComposerModelPicker.js +223 -0
- package/dist/components/composer/ComposerSubmit.d.ts +16 -0
- package/dist/components/composer/ComposerSubmit.js +52 -0
- package/dist/components/composer/ComposerToolbar.d.ts +38 -0
- package/dist/components/composer/ComposerToolbar.js +9 -0
- package/dist/components/composer/caret.d.ts +69 -0
- package/dist/components/composer/caret.js +112 -0
- package/dist/components/composer/index.d.ts +18 -0
- package/dist/components/composer/types.d.ts +86 -0
- package/dist/components/composer/types.js +7 -0
- package/dist/components/confetti/Confetti.d.ts +37 -0
- package/dist/components/confetti/Confetti.js +45 -0
- package/dist/components/confetti/ConfettiButton.d.ts +23 -0
- package/dist/components/confetti/ConfettiButton.js +29 -0
- package/dist/components/confetti/context.d.ts +21 -0
- package/dist/components/confetti/context.js +6 -0
- package/dist/components/confetti/index.d.ts +4 -0
- package/dist/components/container-scroll/ContainerScroll.d.ts +10 -0
- package/dist/components/container-scroll/ContainerScroll.js +74 -0
- package/dist/components/container-scroll/index.d.ts +2 -0
- package/dist/components/container-text-flip/ContainerTextFlip.d.ts +9 -0
- package/dist/components/container-text-flip/ContainerTextFlip.js +58 -0
- package/dist/components/container-text-flip/index.d.ts +2 -0
- package/dist/components/context-menu/ContextMenu.d.ts +39 -0
- package/dist/components/context-menu/ContextMenu.js +105 -0
- package/dist/components/context-menu/ContextMenuContent.d.ts +27 -0
- package/dist/components/context-menu/ContextMenuContent.js +97 -0
- package/dist/components/context-menu/ContextMenuTrigger.d.ts +26 -0
- package/dist/components/context-menu/ContextMenuTrigger.js +37 -0
- package/dist/components/context-menu/index.d.ts +20 -0
- package/dist/components/context-menu/types.d.ts +52 -0
- package/dist/components/context-menu/types.js +17 -0
- package/dist/components/context-ring/ContextRing.d.ts +33 -0
- package/dist/components/context-ring/ContextRing.js +257 -0
- package/dist/components/context-ring/index.d.ts +2 -0
- package/dist/components/copy-button/CopyButton.d.ts +39 -0
- package/dist/components/copy-button/CopyButton.js +124 -0
- package/dist/components/copy-button/index.d.ts +2 -0
- package/dist/components/date-picker/DatePicker.d.ts +58 -0
- package/dist/components/date-picker/DatePicker.js +331 -0
- package/dist/components/date-picker/date-utils.d.ts +39 -0
- package/dist/components/date-picker/date-utils.js +85 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/dialog/Dialog.d.ts +29 -0
- package/dist/components/dialog/Dialog.js +105 -0
- package/dist/components/dialog/DialogSurface.d.ts +2 -0
- package/dist/components/dialog/DialogSurface.js +98 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/types.d.ts +61 -0
- package/dist/components/dim-siblings/DimSiblings.d.ts +30 -0
- package/dist/components/dim-siblings/DimSiblings.js +47 -0
- package/dist/components/dim-siblings/index.d.ts +2 -0
- package/dist/components/direction-aware-hover/DirectionAwareHover.d.ts +10 -0
- package/dist/components/direction-aware-hover/DirectionAwareHover.js +185 -0
- package/dist/components/direction-aware-hover/index.d.ts +2 -0
- package/dist/components/displacement-text/DisplacementText.d.ts +26 -0
- package/dist/components/displacement-text/DisplacementText.js +185 -0
- package/dist/components/displacement-text/index.d.ts +2 -0
- package/dist/components/dock/Dock.d.ts +28 -0
- package/dist/components/dock/Dock.js +80 -0
- package/dist/components/dock/DockIcon.d.ts +17 -0
- package/dist/components/dock/DockIcon.js +38 -0
- package/dist/components/dock/DockSeparator.d.ts +6 -0
- package/dist/components/dock/DockSeparator.js +20 -0
- package/dist/components/dock/index.d.ts +7 -0
- package/dist/components/dock/types.d.ts +47 -0
- package/dist/components/dock/types.js +15 -0
- package/dist/components/drawer/Drawer.d.ts +34 -0
- package/dist/components/drawer/Drawer.js +237 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +38 -0
- package/dist/components/dropdown-menu/DropdownMenu.js +99 -0
- package/dist/components/dropdown-menu/DropdownMenuContent.d.ts +15 -0
- package/dist/components/dropdown-menu/DropdownMenuContent.js +111 -0
- package/dist/components/dropdown-menu/DropdownMenuItem.d.ts +26 -0
- package/dist/components/dropdown-menu/DropdownMenuItem.js +74 -0
- package/dist/components/dropdown-menu/DropdownMenuLabel.d.ts +15 -0
- package/dist/components/dropdown-menu/DropdownMenuLabel.js +18 -0
- package/dist/components/dropdown-menu/DropdownMenuSeparator.d.ts +6 -0
- package/dist/components/dropdown-menu/DropdownMenuSeparator.js +15 -0
- package/dist/components/dropdown-menu/DropdownMenuSub.d.ts +10 -0
- package/dist/components/dropdown-menu/DropdownMenuSub.js +110 -0
- package/dist/components/dropdown-menu/DropdownMenuSubContent.d.ts +15 -0
- package/dist/components/dropdown-menu/DropdownMenuSubContent.js +139 -0
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.d.ts +17 -0
- package/dist/components/dropdown-menu/DropdownMenuSubTrigger.js +104 -0
- package/dist/components/dropdown-menu/DropdownMenuTrigger.d.ts +16 -0
- package/dist/components/dropdown-menu/DropdownMenuTrigger.js +67 -0
- package/dist/components/dropdown-menu/index.d.ts +20 -0
- package/dist/components/dropdown-menu/menu-shared.d.ts +39 -0
- package/dist/components/dropdown-menu/menu-shared.js +48 -0
- package/dist/components/dropdown-menu/types.d.ts +159 -0
- package/dist/components/dropdown-menu/types.js +32 -0
- package/dist/components/editorial-engine/EditorialEngine.d.ts +21 -0
- package/dist/components/editorial-engine/EditorialEngine.js +68 -0
- package/dist/components/editorial-engine/engine.d.ts +7 -0
- package/dist/components/editorial-engine/engine.js +558 -0
- package/dist/components/editorial-engine/index.d.ts +2 -0
- package/dist/components/file-upload/FileUpload.d.ts +63 -0
- package/dist/components/file-upload/FileUpload.js +438 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/fireworks-hdr/FireworksHdr.d.ts +56 -0
- package/dist/components/fireworks-hdr/FireworksHdr.js +426 -0
- package/dist/components/fireworks-hdr/dev.d.ts +1 -0
- package/dist/components/fireworks-hdr/dev.js +8 -0
- package/dist/components/fireworks-hdr/fireworks-shared.d.ts +444 -0
- package/dist/components/fireworks-hdr/fireworks-shared.js +1205 -0
- package/dist/components/fireworks-hdr/index.d.ts +4 -0
- package/dist/components/fireworks-hdr/webgl2-renderer.d.ts +20 -0
- package/dist/components/fireworks-hdr/webgl2-renderer.js +517 -0
- package/dist/components/fireworks-hdr/webgpu-renderer.d.ts +51 -0
- package/dist/components/fireworks-hdr/webgpu-renderer.js +461 -0
- package/dist/components/fireworks-hdr/webgpu-types.d.ts +159 -0
- package/dist/components/flickering-grid/FlickeringGrid.d.ts +33 -0
- package/dist/components/flickering-grid/FlickeringGrid.js +154 -0
- package/dist/components/flickering-grid/index.d.ts +2 -0
- package/dist/components/flip-card/FlipCard.d.ts +8 -0
- package/dist/components/flip-card/FlipCard.js +35 -0
- package/dist/components/flip-card/index.d.ts +2 -0
- package/dist/components/flip-words/FlipWords.d.ts +16 -0
- package/dist/components/flip-words/FlipWords.js +82 -0
- package/dist/components/flip-words/index.d.ts +2 -0
- package/dist/components/fluid-cursor/FluidCursor.d.ts +61 -0
- package/dist/components/fluid-cursor/FluidCursor.js +1479 -0
- package/dist/components/fluid-cursor/fluid-shared.d.ts +74 -0
- package/dist/components/fluid-cursor/fluid-shared.js +120 -0
- package/dist/components/fluid-cursor/index.d.ts +8 -0
- package/dist/components/fluid-cursor/webgpu-engine.d.ts +36 -0
- package/dist/components/fluid-cursor/webgpu-engine.js +922 -0
- package/dist/components/focus/Focus.d.ts +24 -0
- package/dist/components/focus/Focus.js +103 -0
- package/dist/components/focus/index.d.ts +2 -0
- package/dist/components/form-field/FormField.d.ts +46 -0
- package/dist/components/form-field/FormField.js +151 -0
- package/dist/components/form-field/index.d.ts +2 -0
- package/dist/components/frosted-glass/FrostedGlass.d.ts +48 -0
- package/dist/components/frosted-glass/FrostedGlass.js +89 -0
- package/dist/components/frosted-glass/index.d.ts +2 -0
- package/dist/components/glare-card/GlareCard.d.ts +8 -0
- package/dist/components/glare-card/GlareCard.js +103 -0
- package/dist/components/glare-card/index.d.ts +2 -0
- package/dist/components/glow-border/GlowBorder.d.ts +8 -0
- package/dist/components/glow-border/GlowBorder.js +39 -0
- package/dist/components/glow-border/index.d.ts +2 -0
- package/dist/components/glowing-effect/GlowingEffect.d.ts +23 -0
- package/dist/components/glowing-effect/GlowingEffect.js +157 -0
- package/dist/components/glowing-effect/index.d.ts +2 -0
- package/dist/components/gradient-button/GradientButton.d.ts +28 -0
- package/dist/components/gradient-button/GradientButton.js +66 -0
- package/dist/components/gradient-button/index.d.ts +2 -0
- package/dist/components/hover-card/HoverCard.d.ts +57 -0
- package/dist/components/hover-card/HoverCard.js +139 -0
- package/dist/components/hover-card/index.d.ts +2 -0
- package/dist/components/hyper-text/HyperText.d.ts +25 -0
- package/dist/components/hyper-text/HyperText.js +102 -0
- package/dist/components/hyper-text/index.d.ts +2 -0
- package/dist/components/icon-button/IconButton.d.ts +46 -0
- package/dist/components/icon-button/IconButton.js +62 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/image-generation/ImageGeneration.d.ts +33 -0
- package/dist/components/image-generation/ImageGeneration.js +131 -0
- package/dist/components/image-generation/index.d.ts +2 -0
- package/dist/components/image-trail-cursor/ImageTrailCursor.d.ts +15 -0
- package/dist/components/image-trail-cursor/ImageTrailCursor.js +75 -0
- package/dist/components/image-trail-cursor/index.d.ts +3 -0
- package/dist/components/image-trail-cursor/trail-variants.d.ts +112 -0
- package/dist/components/image-trail-cursor/trail-variants.js +787 -0
- package/dist/components/inline-citation/InlineCitation.d.ts +23 -0
- package/dist/components/inline-citation/InlineCitation.js +179 -0
- package/dist/components/inline-citation/index.d.ts +2 -0
- package/dist/components/input/Input.d.ts +41 -0
- package/dist/components/input/Input.js +74 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/interactive-grid-pattern/InteractiveGridPattern.d.ts +17 -0
- package/dist/components/interactive-grid-pattern/InteractiveGridPattern.js +89 -0
- package/dist/components/interactive-grid-pattern/index.d.ts +2 -0
- package/dist/components/interactive-hover-button/InteractiveHoverButton.d.ts +18 -0
- package/dist/components/interactive-hover-button/InteractiveHoverButton.js +66 -0
- package/dist/components/interactive-hover-button/index.d.ts +2 -0
- package/dist/components/label/Label.d.ts +18 -0
- package/dist/components/label/Label.js +28 -0
- package/dist/components/label/index.d.ts +2 -0
- package/dist/components/letter-pullup/LetterPullup.d.ts +16 -0
- package/dist/components/letter-pullup/LetterPullup.js +27 -0
- package/dist/components/letter-pullup/index.d.ts +2 -0
- package/dist/components/line-hover-link/LineHoverLink.d.ts +33 -0
- package/dist/components/line-hover-link/LineHoverLink.js +69 -0
- package/dist/components/line-hover-link/index.d.ts +2 -0
- package/dist/components/line-reveal/LineReveal.d.ts +31 -0
- package/dist/components/line-reveal/LineReveal.js +117 -0
- package/dist/components/line-reveal/index.d.ts +2 -0
- package/dist/components/line-shadow-text/LineShadowText.d.ts +18 -0
- package/dist/components/line-shadow-text/LineShadowText.js +26 -0
- package/dist/components/line-shadow-text/index.d.ts +2 -0
- package/dist/components/link/Link.d.ts +30 -0
- package/dist/components/link/Link.js +82 -0
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/liquid-glass/LiquidGlass.d.ts +49 -0
- package/dist/components/liquid-glass/LiquidGlass.js +165 -0
- package/dist/components/liquid-glass/index.d.ts +2 -0
- package/dist/components/liquid-text/LiquidText.d.ts +35 -0
- package/dist/components/liquid-text/LiquidText.js +882 -0
- package/dist/components/liquid-text/index.d.ts +2 -0
- package/dist/components/logo-cloud/AnimatedLogoCloud.d.ts +13 -0
- package/dist/components/logo-cloud/AnimatedLogoCloud.js +38 -0
- package/dist/components/logo-cloud/IconLogoCloud.d.ts +10 -0
- package/dist/components/logo-cloud/IconLogoCloud.js +20 -0
- package/dist/components/logo-cloud/StaticLogoCloud.d.ts +28 -0
- package/dist/components/logo-cloud/StaticLogoCloud.js +45 -0
- package/dist/components/logo-cloud/index.d.ts +6 -0
- package/dist/components/magnetic/Magnetic.d.ts +35 -0
- package/dist/components/magnetic/Magnetic.js +113 -0
- package/dist/components/magnetic/index.d.ts +2 -0
- package/dist/components/marquee/Marquee.d.ts +16 -0
- package/dist/components/marquee/Marquee.js +39 -0
- package/dist/components/marquee/ReviewCard.d.ts +8 -0
- package/dist/components/marquee/ReviewCard.js +17 -0
- package/dist/components/marquee/index.d.ts +4 -0
- package/dist/components/matrix-rain/MatrixRain.d.ts +35 -0
- package/dist/components/matrix-rain/MatrixRain.js +130 -0
- package/dist/components/matrix-rain/index.d.ts +2 -0
- package/dist/components/meteors/Meteors.d.ts +21 -0
- package/dist/components/meteors/Meteors.js +45 -0
- package/dist/components/meteors/index.d.ts +2 -0
- package/dist/components/mosaic-glow/MosaicGlow.d.ts +47 -0
- package/dist/components/mosaic-glow/MosaicGlow.js +438 -0
- package/dist/components/mosaic-glow/index.d.ts +2 -0
- package/dist/components/mosaic-glow/mosaic-glow-core.d.ts +94 -0
- package/dist/components/mosaic-glow/mosaic-glow-core.js +190 -0
- package/dist/components/navbar/Navbar.d.ts +25 -0
- package/dist/components/navbar/Navbar.js +27 -0
- package/dist/components/navbar/NavbarLink.d.ts +37 -0
- package/dist/components/navbar/NavbarLink.js +48 -0
- package/dist/components/navbar/index.d.ts +4 -0
- package/dist/components/navigation-menu/NavigationMenu.d.ts +28 -0
- package/dist/components/navigation-menu/NavigationMenu.js +202 -0
- package/dist/components/navigation-menu/NavigationMenuContent.d.ts +8 -0
- package/dist/components/navigation-menu/NavigationMenuContent.js +77 -0
- package/dist/components/navigation-menu/NavigationMenuItem.d.ts +20 -0
- package/dist/components/navigation-menu/NavigationMenuItem.js +18 -0
- package/dist/components/navigation-menu/NavigationMenuLink.d.ts +31 -0
- package/dist/components/navigation-menu/NavigationMenuLink.js +41 -0
- package/dist/components/navigation-menu/NavigationMenuList.d.ts +8 -0
- package/dist/components/navigation-menu/NavigationMenuList.js +33 -0
- package/dist/components/navigation-menu/NavigationMenuTrigger.d.ts +8 -0
- package/dist/components/navigation-menu/NavigationMenuTrigger.js +90 -0
- package/dist/components/navigation-menu/index.d.ts +14 -0
- package/dist/components/navigation-menu/types.d.ts +107 -0
- package/dist/components/navigation-menu/types.js +32 -0
- package/dist/components/neon-border/NeonBorder.d.ts +22 -0
- package/dist/components/neon-border/NeonBorder.js +50 -0
- package/dist/components/neon-border/index.d.ts +2 -0
- package/dist/components/noise-reveal/NoiseReveal.d.ts +29 -0
- package/dist/components/noise-reveal/NoiseReveal.js +329 -0
- package/dist/components/noise-reveal/index.d.ts +2 -0
- package/dist/components/number-input/NumberInput.d.ts +40 -0
- package/dist/components/number-input/NumberInput.js +207 -0
- package/dist/components/number-input/index.d.ts +2 -0
- package/dist/components/number-ticker/NumberTicker.d.ts +22 -0
- package/dist/components/number-ticker/NumberTicker.js +106 -0
- package/dist/components/number-ticker/index.d.ts +2 -0
- package/dist/components/pagination/Pagination.d.ts +43 -0
- package/dist/components/pagination/Pagination.js +156 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/pagination-range.d.ts +11 -0
- package/dist/components/pagination/pagination-range.js +35 -0
- package/dist/components/password-input/PasswordInput.d.ts +56 -0
- package/dist/components/password-input/PasswordInput.js +246 -0
- package/dist/components/password-input/index.d.ts +2 -0
- package/dist/components/pixel-loader/PixelLoader.d.ts +18 -0
- package/dist/components/pixel-loader/PixelLoader.js +56 -0
- package/dist/components/pixel-loader/index.d.ts +2 -0
- package/dist/components/popover/Popover.d.ts +49 -0
- package/dist/components/popover/Popover.js +81 -0
- package/dist/components/popover/PopoverContent.d.ts +21 -0
- package/dist/components/popover/PopoverContent.js +78 -0
- package/dist/components/popover/index.d.ts +6 -0
- package/dist/components/popover/types.d.ts +64 -0
- package/dist/components/popover/types.js +17 -0
- package/dist/components/presence/Presence.d.ts +40 -0
- package/dist/components/presence/Presence.js +49 -0
- package/dist/components/presence/index.d.ts +2 -0
- package/dist/components/pressable/Pressable.d.ts +27 -0
- package/dist/components/pressable/Pressable.js +86 -0
- package/dist/components/pressable/index.d.ts +2 -0
- package/dist/components/prompt-suggestions/PromptSuggestions.d.ts +25 -0
- package/dist/components/prompt-suggestions/PromptSuggestions.js +68 -0
- package/dist/components/prompt-suggestions/index.d.ts +2 -0
- package/dist/components/pulse-beam/PulseBeam.d.ts +44 -0
- package/dist/components/pulse-beam/PulseBeam.js +197 -0
- package/dist/components/pulse-beam/index.d.ts +2 -0
- package/dist/components/pulse-beam/pulse-beam-data.d.ts +81 -0
- package/dist/components/pulse-beam/pulse-beam-data.js +306 -0
- package/dist/components/pulse-beam/pulse-beam-loop.d.ts +26 -0
- package/dist/components/pulse-beam/pulse-beam-loop.js +58 -0
- package/dist/components/radio-group/RadioGroup.d.ts +56 -0
- package/dist/components/radio-group/RadioGroup.js +82 -0
- package/dist/components/radio-group/RadioGroupItem.d.ts +21 -0
- package/dist/components/radio-group/RadioGroupItem.js +47 -0
- package/dist/components/radio-group/index.d.ts +6 -0
- package/dist/components/radio-group/types.d.ts +50 -0
- package/dist/components/radio-group/types.js +7 -0
- package/dist/components/rainbow-button/RainbowButton.d.ts +21 -0
- package/dist/components/rainbow-button/RainbowButton.js +59 -0
- package/dist/components/rainbow-button/index.d.ts +2 -0
- package/dist/components/reasoning-panel/ReasoningPanel.d.ts +38 -0
- package/dist/components/reasoning-panel/ReasoningPanel.js +172 -0
- package/dist/components/reasoning-panel/index.d.ts +2 -0
- package/dist/components/recommendation-card/RecommendationCard.d.ts +53 -0
- package/dist/components/recommendation-card/RecommendationCard.js +234 -0
- package/dist/components/recommendation-card/index.d.ts +2 -0
- package/dist/components/reveal/Reveal.d.ts +36 -0
- package/dist/components/reveal/Reveal.js +138 -0
- package/dist/components/reveal/index.d.ts +2 -0
- package/dist/components/ripple/Ripple.d.ts +11 -0
- package/dist/components/ripple/Ripple.js +45 -0
- package/dist/components/ripple/index.d.ts +2 -0
- package/dist/components/ripple-button/RippleButton.d.ts +17 -0
- package/dist/components/ripple-button/RippleButton.js +77 -0
- package/dist/components/ripple-button/index.d.ts +2 -0
- package/dist/components/scroll-anchor/ScrollAnchor.d.ts +33 -0
- package/dist/components/scroll-anchor/ScrollAnchor.js +99 -0
- package/dist/components/scroll-anchor/index.d.ts +2 -0
- package/dist/components/scroll-progress/ScrollProgress.d.ts +39 -0
- package/dist/components/scroll-progress/ScrollProgress.js +118 -0
- package/dist/components/scroll-progress/index.d.ts +2 -0
- package/dist/components/search-input/SearchInput.d.ts +56 -0
- package/dist/components/search-input/SearchInput.js +192 -0
- package/dist/components/search-input/index.d.ts +2 -0
- package/dist/components/select/Select.d.ts +44 -0
- package/dist/components/select/Select.js +255 -0
- package/dist/components/select/SelectPanel.d.ts +33 -0
- package/dist/components/select/SelectPanel.js +108 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/types.d.ts +83 -0
- package/dist/components/select/types.js +8 -0
- package/dist/components/sheet/Sheet.d.ts +40 -0
- package/dist/components/sheet/Sheet.js +183 -0
- package/dist/components/sheet/index.d.ts +2 -0
- package/dist/components/shimmer-button/ShimmerButton.d.ts +26 -0
- package/dist/components/shimmer-button/ShimmerButton.js +69 -0
- package/dist/components/shimmer-button/index.d.ts +2 -0
- package/dist/components/sidebar/Sidebar.d.ts +17 -0
- package/dist/components/sidebar/Sidebar.js +27 -0
- package/dist/components/sidebar/SidebarFooter.d.ts +10 -0
- package/dist/components/sidebar/SidebarFooter.js +31 -0
- package/dist/components/sidebar/SidebarGroup.d.ts +10 -0
- package/dist/components/sidebar/SidebarGroup.js +28 -0
- package/dist/components/sidebar/SidebarItem.d.ts +33 -0
- package/dist/components/sidebar/SidebarItem.js +81 -0
- package/dist/components/sidebar/SidebarSeparator.d.ts +5 -0
- package/dist/components/sidebar/SidebarSeparator.js +13 -0
- package/dist/components/sidebar/index.d.ts +12 -0
- package/dist/components/sidebar/types.d.ts +36 -0
- package/dist/components/sidebar/types.js +7 -0
- package/dist/components/skeleton/Skeleton.d.ts +35 -0
- package/dist/components/skeleton/Skeleton.js +106 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/slider/Slider.d.ts +32 -0
- package/dist/components/slider/Slider.js +119 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/smooth-cursor/SmoothCursor.d.ts +18 -0
- package/dist/components/smooth-cursor/SmoothCursor.js +186 -0
- package/dist/components/smooth-cursor/index.d.ts +2 -0
- package/dist/components/sources/SourceCard.d.ts +21 -0
- package/dist/components/sources/SourceCard.js +48 -0
- package/dist/components/sources/Sources.d.ts +31 -0
- package/dist/components/sources/Sources.js +39 -0
- package/dist/components/sources/SourcesList.d.ts +13 -0
- package/dist/components/sources/SourcesList.js +42 -0
- package/dist/components/sources/SourcesTrigger.d.ts +11 -0
- package/dist/components/sources/SourcesTrigger.js +50 -0
- package/dist/components/sources/index.d.ts +10 -0
- package/dist/components/sources/types.d.ts +45 -0
- package/dist/components/sources/types.js +7 -0
- package/dist/components/sparkles/Sparkles.d.ts +35 -0
- package/dist/components/sparkles/Sparkles.js +112 -0
- package/dist/components/sparkles/index.d.ts +2 -0
- package/dist/components/sparkles-text/SparklesText.d.ts +28 -0
- package/dist/components/sparkles-text/SparklesText.js +84 -0
- package/dist/components/sparkles-text/index.d.ts +2 -0
- package/dist/components/status-morph/StatusMorph.d.ts +47 -0
- package/dist/components/status-morph/StatusMorph.js +110 -0
- package/dist/components/status-morph/index.d.ts +2 -0
- package/dist/components/stepper/Step.d.ts +24 -0
- package/dist/components/stepper/Step.js +152 -0
- package/dist/components/stepper/Stepper.d.ts +38 -0
- package/dist/components/stepper/Stepper.js +79 -0
- package/dist/components/stepper/index.d.ts +6 -0
- package/dist/components/stepper/types.d.ts +66 -0
- package/dist/components/stepper/types.js +7 -0
- package/dist/components/sticky-scroll/StickyScroll.d.ts +40 -0
- package/dist/components/sticky-scroll/StickyScroll.js +163 -0
- package/dist/components/sticky-scroll/index.d.ts +2 -0
- package/dist/components/streaming-text/StreamingText.d.ts +20 -0
- package/dist/components/streaming-text/StreamingText.js +32 -0
- package/dist/components/streaming-text/index.d.ts +2 -0
- package/dist/components/subagent-list/SubagentList.d.ts +28 -0
- package/dist/components/subagent-list/SubagentList.js +167 -0
- package/dist/components/subagent-list/index.d.ts +2 -0
- package/dist/components/switch/Switch.d.ts +55 -0
- package/dist/components/switch/Switch.js +77 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/tabs/Tabs.d.ts +43 -0
- package/dist/components/tabs/Tabs.js +123 -0
- package/dist/components/tabs/TabsContent.d.ts +26 -0
- package/dist/components/tabs/TabsContent.js +64 -0
- package/dist/components/tabs/TabsList.d.ts +16 -0
- package/dist/components/tabs/TabsList.js +152 -0
- package/dist/components/tabs/TabsTrigger.d.ts +19 -0
- package/dist/components/tabs/TabsTrigger.js +138 -0
- package/dist/components/tabs/index.d.ts +10 -0
- package/dist/components/tabs/types.d.ts +94 -0
- package/dist/components/tabs/types.js +7 -0
- package/dist/components/terminal-block/TerminalBlock.d.ts +27 -0
- package/dist/components/terminal-block/TerminalBlock.js +120 -0
- package/dist/components/terminal-block/ansi.d.ts +30 -0
- package/dist/components/terminal-block/ansi.js +114 -0
- package/dist/components/terminal-block/index.d.ts +2 -0
- package/dist/components/terminal-text/TerminalText.d.ts +11 -0
- package/dist/components/terminal-text/TerminalText.js +140 -0
- package/dist/components/terminal-text/index.d.ts +2 -0
- package/dist/components/text-generate-effect/TextGenerateEffect.d.ts +9 -0
- package/dist/components/text-generate-effect/TextGenerateEffect.js +58 -0
- package/dist/components/text-generate-effect/index.d.ts +2 -0
- package/dist/components/text-reveal-card/TextRevealCard.d.ts +21 -0
- package/dist/components/text-reveal-card/TextRevealCard.js +107 -0
- package/dist/components/text-reveal-card/TextRevealStars.d.ts +25 -0
- package/dist/components/text-reveal-card/TextRevealStars.js +59 -0
- package/dist/components/text-reveal-card/index.d.ts +4 -0
- package/dist/components/text-roll/TextRoll.d.ts +43 -0
- package/dist/components/text-roll/TextRoll.js +242 -0
- package/dist/components/text-roll/index.d.ts +2 -0
- package/dist/components/text-roll/roll-transitions.d.ts +74 -0
- package/dist/components/text-roll/roll-transitions.js +31 -0
- package/dist/components/textarea/Textarea.d.ts +48 -0
- package/dist/components/textarea/Textarea.js +129 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/thinking-indicator/ThinkingIndicator.d.ts +26 -0
- package/dist/components/thinking-indicator/ThinkingIndicator.js +60 -0
- package/dist/components/thinking-indicator/index.d.ts +2 -0
- package/dist/components/thread-list/ThreadList.d.ts +44 -0
- package/dist/components/thread-list/ThreadList.js +178 -0
- package/dist/components/thread-list/index.d.ts +2 -0
- package/dist/components/time-picker/TimePicker.d.ts +44 -0
- package/dist/components/time-picker/TimePicker.js +254 -0
- package/dist/components/time-picker/TimePickerPanel.d.ts +30 -0
- package/dist/components/time-picker/TimePickerPanel.js +94 -0
- package/dist/components/time-picker/index.d.ts +2 -0
- package/dist/components/time-picker/time-utils.d.ts +33 -0
- package/dist/components/time-picker/time-utils.js +65 -0
- package/dist/components/time-picker/types.d.ts +53 -0
- package/dist/components/time-picker/types.js +10 -0
- package/dist/components/timeline/Timeline.d.ts +18 -0
- package/dist/components/timeline/Timeline.js +96 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/components/toast/Toast.d.ts +16 -0
- package/dist/components/toast/Toast.js +99 -0
- package/dist/components/toast/Toaster.d.ts +19 -0
- package/dist/components/toast/Toaster.js +147 -0
- package/dist/components/toast/index.d.ts +6 -0
- package/dist/components/toast/store.d.ts +102 -0
- package/dist/components/toast/store.js +118 -0
- package/dist/components/toggle/Toggle.d.ts +28 -0
- package/dist/components/toggle/Toggle.js +69 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle-group/ToggleGroup.d.ts +42 -0
- package/dist/components/toggle-group/ToggleGroup.js +150 -0
- package/dist/components/toggle-group/ToggleGroupItem.d.ts +21 -0
- package/dist/components/toggle-group/ToggleGroupItem.js +100 -0
- package/dist/components/toggle-group/index.d.ts +6 -0
- package/dist/components/toggle-group/types.d.ts +75 -0
- package/dist/components/toggle-group/types.js +7 -0
- package/dist/components/tool-call/ToolCall.d.ts +39 -0
- package/dist/components/tool-call/ToolCall.js +195 -0
- package/dist/components/tool-call/index.d.ts +2 -0
- package/dist/components/tool-timeline/ToolTimeline.d.ts +31 -0
- package/dist/components/tool-timeline/ToolTimeline.js +99 -0
- package/dist/components/tool-timeline/index.d.ts +2 -0
- package/dist/components/tooltip/Tooltip.d.ts +36 -0
- package/dist/components/tooltip/Tooltip.js +214 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tracing-beam/TracingBeam.d.ts +11 -0
- package/dist/components/tracing-beam/TracingBeam.js +163 -0
- package/dist/components/tracing-beam/index.d.ts +2 -0
- package/dist/components/typing-indicator/TypingIndicator.d.ts +17 -0
- package/dist/components/typing-indicator/TypingIndicator.js +47 -0
- package/dist/components/typing-indicator/index.d.ts +2 -0
- package/dist/components/voice-input/VoiceInput.d.ts +60 -0
- package/dist/components/voice-input/VoiceInput.js +268 -0
- package/dist/components/voice-input/index.d.ts +2 -0
- package/dist/components/web-search/WebSearch.d.ts +37 -0
- package/dist/components/web-search/WebSearch.js +135 -0
- package/dist/components/web-search/index.d.ts +2 -0
- package/dist/index.d.ts +148 -0
- package/dist/index.js +489 -0
- package/dist/internals/Portal.d.ts +35 -0
- package/dist/internals/Portal.js +37 -0
- package/dist/internals/StreamText.d.ts +20 -0
- package/dist/internals/StreamText.js +25 -0
- package/dist/internals/ai-types.d.ts +117 -0
- package/dist/internals/anchor-position.d.ts +79 -0
- package/dist/internals/anchor-position.js +154 -0
- package/dist/internals/calendar-core.d.ts +26 -0
- package/dist/internals/calendar-core.js +57 -0
- package/dist/internals/diff.d.ts +38 -0
- package/dist/internals/diff.js +176 -0
- package/dist/internals/dismissable.d.ts +76 -0
- package/dist/internals/dismissable.js +105 -0
- package/dist/internals/dom/context.d.ts +16 -0
- package/dist/internals/dom/context.js +20 -0
- package/dist/internals/dom/ssr.d.ts +21 -0
- package/dist/internals/dom/ssr.js +21 -0
- package/dist/internals/dom/types.d.ts +9 -0
- package/dist/internals/dom/use-composed-refs.d.ts +15 -0
- package/dist/internals/dom/use-composed-refs.js +34 -0
- package/dist/internals/dom/use-element-ref.d.ts +11 -0
- package/dist/internals/dom/use-element-ref.js +12 -0
- package/dist/internals/dom/use-event-callback.d.ts +14 -0
- package/dist/internals/dom/use-event-callback.js +12 -0
- package/dist/internals/dom/use-inert-attribute.d.ts +26 -0
- package/dist/internals/dom/use-inert-attribute.js +22 -0
- package/dist/internals/dom/use-live-ref.d.ts +10 -0
- package/dist/internals/dom/use-live-ref.js +12 -0
- package/dist/internals/field.d.ts +136 -0
- package/dist/internals/field.js +33 -0
- package/dist/internals/float.d.ts +47 -0
- package/dist/internals/float.js +31 -0
- package/dist/internals/focus-trap.d.ts +82 -0
- package/dist/internals/focus-trap.js +145 -0
- package/dist/internals/host.d.ts +38 -0
- package/dist/internals/host.js +24 -0
- package/dist/internals/listbox.d.ts +101 -0
- package/dist/internals/listbox.js +171 -0
- package/dist/internals/markdown/Markdown.d.ts +22 -0
- package/dist/internals/markdown/Markdown.js +53 -0
- package/dist/internals/markdown/MarkdownInline.d.ts +5 -0
- package/dist/internals/markdown/MarkdownInline.js +40 -0
- package/dist/internals/markdown.d.ts +66 -0
- package/dist/internals/markdown.js +467 -0
- package/dist/internals/menu.d.ts +121 -0
- package/dist/internals/menu.js +217 -0
- package/dist/internals/motion/anchored.d.ts +104 -0
- package/dist/internals/motion/anchored.js +44 -0
- package/dist/internals/motion/animate.d.ts +92 -0
- package/dist/internals/motion/animate.js +84 -0
- package/dist/internals/motion/easing.d.ts +20 -0
- package/dist/internals/motion/easing.js +13 -0
- package/dist/internals/motion/haptics.d.ts +42 -0
- package/dist/internals/motion/haptics.js +29 -0
- package/dist/internals/motion/in-view.d.ts +67 -0
- package/dist/internals/motion/in-view.js +97 -0
- package/dist/internals/motion/media-query.d.ts +50 -0
- package/dist/internals/motion/media-query.js +54 -0
- package/dist/internals/motion/presence.d.ts +108 -0
- package/dist/internals/motion/presence.js +197 -0
- package/dist/internals/motion/presets.d.ts +34 -0
- package/dist/internals/motion/presets.js +19 -0
- package/dist/internals/motion/raf.d.ts +35 -0
- package/dist/internals/motion/raf.js +27 -0
- package/dist/internals/motion/stagger.d.ts +32 -0
- package/dist/internals/motion/stagger.js +15 -0
- package/dist/internals/motion/tokens.d.ts +97 -0
- package/dist/internals/motion/tokens.js +18 -0
- package/dist/internals/motion/transitions.d.ts +66 -0
- package/dist/internals/motion/transitions.js +41 -0
- package/dist/internals/motion/types.d.ts +17 -0
- package/dist/internals/relative-time.d.ts +25 -0
- package/dist/internals/relative-time.js +46 -0
- package/dist/internals/scroll-lock.d.ts +26 -0
- package/dist/internals/scroll-lock.js +65 -0
- package/dist/internals/use-anchor-position.d.ts +54 -0
- package/dist/internals/use-anchor-position.js +87 -0
- package/dist/internals/use-autoscroll.d.ts +43 -0
- package/dist/internals/use-autoscroll.js +128 -0
- package/dist/internals/use-copy.d.ts +54 -0
- package/dist/internals/use-copy.js +67 -0
- package/dist/internals/use-elapsed.d.ts +96 -0
- package/dist/internals/use-elapsed.js +195 -0
- package/dist/internals/use-float.d.ts +49 -0
- package/dist/internals/use-float.js +150 -0
- package/dist/internals/use-id.d.ts +22 -0
- package/dist/internals/use-id.js +20 -0
- package/dist/internals/use-text-stream.d.ts +94 -0
- package/dist/internals/use-text-stream.js +133 -0
- package/dist/internals/waveform-core.d.ts +33 -0
- package/dist/internals/waveform-core.js +39 -0
- package/dist/sound/SoundToggle.d.ts +23 -0
- package/dist/sound/SoundToggle.js +96 -0
- package/dist/sound/engine.d.ts +67 -0
- package/dist/sound/engine.js +370 -0
- package/dist/sound/index.d.ts +7 -0
- package/dist/sound/sound-feedback.d.ts +77 -0
- package/dist/sound/sound-feedback.js +152 -0
- package/dist/sound/sound.d.ts +98 -0
- package/dist/sound/sound.js +309 -0
- package/dist/sound/themes.d.ts +19 -0
- package/dist/sound/themes.js +355 -0
- package/dist/sound/types.d.ts +125 -0
- package/dist/sound/types.js +54 -0
- package/dist/sound/use-sound.d.ts +53 -0
- package/dist/sound/use-sound.js +82 -0
- package/dist/styles.css +7975 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +8 -0
- package/package.json +96 -0
- package/tailwind.css +132 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Menu keyboard-navigation core: which item holds **real DOM focus** as arrow
|
|
3
|
+
* keys, Home/End and typeahead move through a `role="menu"` surface.
|
|
4
|
+
*
|
|
5
|
+
* This is the counterpart to `listbox.ts`, and the difference between the two
|
|
6
|
+
* is the whole reason both exist. A listbox keeps focus on its input or
|
|
7
|
+
* trigger and points at the active row with `aria-activedescendant`; a menu
|
|
8
|
+
* moves focus onto the item itself. That is the WAI-ARIA menu pattern, and it
|
|
9
|
+
* is what assistive technology expects when it meets `role="menu"` — so a menu
|
|
10
|
+
* built on `aria-activedescendant` reads as broken even though nothing about
|
|
11
|
+
* it looks wrong. Consumers must not add `aria-activedescendant` to a surface
|
|
12
|
+
* driven by this module.
|
|
13
|
+
*
|
|
14
|
+
* Three guarantees, so `DropdownMenu`, `ContextMenu` and every submenu get
|
|
15
|
+
* them once rather than three times:
|
|
16
|
+
*
|
|
17
|
+
* - **Items navigate in DOM order, not registration order.** Mount order and
|
|
18
|
+
* document order diverge routinely — a conditional block, a list that
|
|
19
|
+
* reorders, a submenu that mounts before the item above it. Ordering is
|
|
20
|
+
* therefore resolved by `compareDocumentPosition` at navigation time, not
|
|
21
|
+
* by the order `register` happened to be called in. This is also what makes
|
|
22
|
+
* the promise survive React's child-before-parent effect ordering for free.
|
|
23
|
+
* - **Disabled items are skipped**, a consecutive run of them as a block, and
|
|
24
|
+
* movement terminates rather than spinning when every item is disabled.
|
|
25
|
+
* - **Typeahead** accumulates characters within a short window and resets
|
|
26
|
+
* after it, with a repeated character cycling through its matches — the
|
|
27
|
+
* same semantics as the listbox core, so the two feel identical to use.
|
|
28
|
+
*
|
|
29
|
+
* The focused item is tracked as an *element*, not an index: menus mutate
|
|
30
|
+
* their item list while open (a filtered list, a submenu opening), and an
|
|
31
|
+
* index captured before that mutation silently points at a different item
|
|
32
|
+
* afterwards. `focusedIndex` is derived from the element on read.
|
|
33
|
+
*/
|
|
34
|
+
import type { RefCallback } from "react";
|
|
35
|
+
export interface MenuFocusOptions {
|
|
36
|
+
/** Whether arrow navigation wraps at the ends. Defaults to true. */
|
|
37
|
+
loop?: boolean;
|
|
38
|
+
/** Called when focus moves to an item, with the item's index and element. */
|
|
39
|
+
onFocusChange?: (index: number, element: HTMLElement) => void;
|
|
40
|
+
}
|
|
41
|
+
export interface MenuFocusState {
|
|
42
|
+
/**
|
|
43
|
+
* Index of the focused item in DOM order, or -1 when focus is not on an item.
|
|
44
|
+
*
|
|
45
|
+
* Computed on read from the live ordered list, exactly like the Svelte
|
|
46
|
+
* getter — so the value is correct on a fresh read and `document.activeElement`
|
|
47
|
+
* is never wrong. It is deliberately NOT React state: nothing re-renders when
|
|
48
|
+
* focus moves, because real DOM focus does the rendering through `:focus` /
|
|
49
|
+
* `:focus-visible`. Use `onFocusChange`, or opt into `useMenuFocusedIndex`
|
|
50
|
+
* when a component genuinely must render off the number.
|
|
51
|
+
*/
|
|
52
|
+
readonly focusedIndex: number;
|
|
53
|
+
/** Registers an item element. Returns an unregister function; call it on destroy. */
|
|
54
|
+
register(element: HTMLElement): () => void;
|
|
55
|
+
/** Moves focus by delta, skipping disabled items. `delta === 0` is a no-op. */
|
|
56
|
+
move(delta: number): void;
|
|
57
|
+
/** Moves focus to the first or last enabled item. */
|
|
58
|
+
moveToEdge(edge: "first" | "last"): void;
|
|
59
|
+
/** Focuses a specific element, if it is registered and enabled. */
|
|
60
|
+
focusItem(element: HTMLElement): void;
|
|
61
|
+
/** Clears the focused item without moving DOM focus. */
|
|
62
|
+
clear(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Advances typeahead with a printable character and focuses the match.
|
|
65
|
+
*
|
|
66
|
+
* Matches against the item's `data-typeahead-label` when it has one, and
|
|
67
|
+
* otherwise against its visible text — decorative `aria-hidden` content
|
|
68
|
+
* (icon glyphs, `<kbd>` shortcuts) is excluded either way. Set the
|
|
69
|
+
* attribute whenever the item knows its own label as a string; it is
|
|
70
|
+
* cheaper and more reliable than making this reconstruct it from the DOM.
|
|
71
|
+
*/
|
|
72
|
+
typeahead(char: string): void;
|
|
73
|
+
/** Clears the typeahead buffer and any pending timer. Call from teardown. */
|
|
74
|
+
destroy(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Added for React. Notifies on every `focusedElement` change, so
|
|
77
|
+
* `useMenuFocusedIndex` can read the index through `useSyncExternalStore`.
|
|
78
|
+
* The mutation source is outside React's knowledge — a `focusItem` from a
|
|
79
|
+
* `pointerenter`, a `typeahead` from a document keydown — which is exactly
|
|
80
|
+
* the case that API exists for.
|
|
81
|
+
*/
|
|
82
|
+
subscribe(listener: () => void): () => void;
|
|
83
|
+
}
|
|
84
|
+
export declare function createMenuFocus(options?: MenuFocusOptions): MenuFocusState;
|
|
85
|
+
/**
|
|
86
|
+
* One store per mount, torn down on unmount.
|
|
87
|
+
*
|
|
88
|
+
* The options are handed to the factory as a getter object over live refs, so
|
|
89
|
+
* passing `loop` as a PLAIN VALUE behaves identically to the Svelte call sites'
|
|
90
|
+
* `get loop() { … }` — the factory reads it lazily at navigation time, and a
|
|
91
|
+
* re-render that changes it is honoured without rebuilding anything.
|
|
92
|
+
*
|
|
93
|
+
* The returned handle's identity NEVER changes, so it goes straight into a
|
|
94
|
+
* context value with no memo dance, and no item re-renders when focus moves.
|
|
95
|
+
* `destroy()` is still on the handle, but a consumer never has to call it: the
|
|
96
|
+
* unmount cleanup below closes the typeahead timer that the Svelte side's
|
|
97
|
+
* `DropdownMenuContent` forgets (divergence D-5).
|
|
98
|
+
*/
|
|
99
|
+
export declare function useMenuFocus(options?: MenuFocusOptions): MenuFocusState;
|
|
100
|
+
/**
|
|
101
|
+
* A per-item callback ref — one line in each item component, replacing the
|
|
102
|
+
* Svelte side's per-item registration effect.
|
|
103
|
+
*
|
|
104
|
+
* Registration happens in the ref callback (commit phase) rather than an
|
|
105
|
+
* effect, so it survives React's detach-then-attach protocol: the previous
|
|
106
|
+
* registration is released before the new node registers. React 18 ref
|
|
107
|
+
* callbacks cannot return a cleanup — that is 19-only — so the unregister is
|
|
108
|
+
* held locally instead.
|
|
109
|
+
*
|
|
110
|
+
* Registration order is irrelevant: `orderedItems()` sorts by
|
|
111
|
+
* `compareDocumentPosition` at navigation time.
|
|
112
|
+
*/
|
|
113
|
+
export declare function useMenuItemRef(menu: MenuFocusState): RefCallback<HTMLElement>;
|
|
114
|
+
/**
|
|
115
|
+
* Subscribes to the focused index so a component can render off it.
|
|
116
|
+
*
|
|
117
|
+
* Opt-in, and discouraged for the reason `focusedIndex`'s own doc comment
|
|
118
|
+
* gives: real DOM focus is what should drive rendering, through `:focus` /
|
|
119
|
+
* `:focus-visible`. Reach for this only when a component genuinely cannot.
|
|
120
|
+
*/
|
|
121
|
+
export declare function useMenuFocusedIndex(menu: MenuFocusState): number;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef, useCallback } from "react";
|
|
3
|
+
import { useConstant } from "./dom/ssr.js";
|
|
4
|
+
import { useEventCallback } from "./dom/use-event-callback.js";
|
|
5
|
+
import { useLiveRef } from "./dom/use-live-ref.js";
|
|
6
|
+
const TYPEAHEAD_TIMEOUT_MS = 500;
|
|
7
|
+
function compareDocumentOrder(a, b) {
|
|
8
|
+
if (a === b) return 0;
|
|
9
|
+
return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
10
|
+
}
|
|
11
|
+
function visibleTextOf(node) {
|
|
12
|
+
if (node.nodeType === Node.TEXT_NODE) return node.textContent ?? "";
|
|
13
|
+
if (node.nodeType !== Node.ELEMENT_NODE) return "";
|
|
14
|
+
const element = node;
|
|
15
|
+
if (element.getAttribute("aria-hidden") === "true") return "";
|
|
16
|
+
let text = "";
|
|
17
|
+
for (const child of Array.from(element.childNodes)) text += visibleTextOf(child);
|
|
18
|
+
return text;
|
|
19
|
+
}
|
|
20
|
+
function isDisabled(element) {
|
|
21
|
+
if (element.getAttribute("aria-disabled") === "true") return true;
|
|
22
|
+
return "disabled" in element && element.disabled === true;
|
|
23
|
+
}
|
|
24
|
+
function createMenuFocus(options = {}) {
|
|
25
|
+
const registered = [];
|
|
26
|
+
let focusedElement = null;
|
|
27
|
+
let buffer = "";
|
|
28
|
+
let timer = null;
|
|
29
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
30
|
+
function notify() {
|
|
31
|
+
for (const listener of listeners) listener();
|
|
32
|
+
}
|
|
33
|
+
function orderedItems() {
|
|
34
|
+
return registered.filter((element) => element.isConnected).sort(compareDocumentOrder);
|
|
35
|
+
}
|
|
36
|
+
function focusAt(items, index) {
|
|
37
|
+
const element = items[index];
|
|
38
|
+
if (!element) return;
|
|
39
|
+
focusedElement = element;
|
|
40
|
+
notify();
|
|
41
|
+
element.focus();
|
|
42
|
+
options.onFocusChange?.(index, element);
|
|
43
|
+
}
|
|
44
|
+
function findNext(items, from, direction, loop) {
|
|
45
|
+
const count = items.length;
|
|
46
|
+
let idx = from;
|
|
47
|
+
for (let attempts = 0; attempts < count; attempts++) {
|
|
48
|
+
idx += direction;
|
|
49
|
+
if (loop) {
|
|
50
|
+
idx = (idx % count + count) % count;
|
|
51
|
+
} else if (idx < 0 || idx >= count) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const element = items[idx];
|
|
55
|
+
if (element && !isDisabled(element)) return idx;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function indexOfFocused(items) {
|
|
60
|
+
return focusedElement ? items.indexOf(focusedElement) : -1;
|
|
61
|
+
}
|
|
62
|
+
function register(element) {
|
|
63
|
+
if (!registered.includes(element)) registered.push(element);
|
|
64
|
+
return () => {
|
|
65
|
+
const at = registered.indexOf(element);
|
|
66
|
+
if (at !== -1) registered.splice(at, 1);
|
|
67
|
+
if (focusedElement === element) {
|
|
68
|
+
focusedElement = null;
|
|
69
|
+
notify();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function move(delta) {
|
|
74
|
+
if (delta === 0) return;
|
|
75
|
+
const items = orderedItems();
|
|
76
|
+
if (items.length === 0) return;
|
|
77
|
+
const loop = options.loop ?? true;
|
|
78
|
+
const direction = delta >= 0 ? 1 : -1;
|
|
79
|
+
const steps = Math.abs(delta);
|
|
80
|
+
const current = indexOfFocused(items);
|
|
81
|
+
const from = current === -1 ? direction === 1 ? -1 : items.length : current;
|
|
82
|
+
let found = null;
|
|
83
|
+
for (let i = 0; i < steps; i++) {
|
|
84
|
+
const next = findNext(items, found ?? from, direction, loop);
|
|
85
|
+
if (next === null) break;
|
|
86
|
+
found = next;
|
|
87
|
+
}
|
|
88
|
+
if (found !== null) focusAt(items, found);
|
|
89
|
+
}
|
|
90
|
+
function moveToEdge(edge) {
|
|
91
|
+
const items = orderedItems();
|
|
92
|
+
if (items.length === 0) return;
|
|
93
|
+
if (edge === "first") {
|
|
94
|
+
for (let i = 0; i < items.length; i++) {
|
|
95
|
+
if (!isDisabled(items[i])) {
|
|
96
|
+
focusAt(items, i);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
for (let i = items.length - 1; i >= 0; i--) {
|
|
103
|
+
if (!isDisabled(items[i])) {
|
|
104
|
+
focusAt(items, i);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function focusItem(element) {
|
|
110
|
+
const items = orderedItems();
|
|
111
|
+
const index = items.indexOf(element);
|
|
112
|
+
if (index === -1 || isDisabled(element)) return;
|
|
113
|
+
focusAt(items, index);
|
|
114
|
+
}
|
|
115
|
+
function clear() {
|
|
116
|
+
focusedElement = null;
|
|
117
|
+
notify();
|
|
118
|
+
}
|
|
119
|
+
function clearBuffer() {
|
|
120
|
+
buffer = "";
|
|
121
|
+
if (timer !== null) {
|
|
122
|
+
clearTimeout(timer);
|
|
123
|
+
timer = null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function labelOf(element) {
|
|
127
|
+
const explicit = element.dataset.typeaheadLabel;
|
|
128
|
+
return (explicit ?? visibleTextOf(element)).trim().toLowerCase();
|
|
129
|
+
}
|
|
130
|
+
function typeahead(char) {
|
|
131
|
+
const items = orderedItems();
|
|
132
|
+
if (items.length === 0) return;
|
|
133
|
+
const lower = char.toLowerCase();
|
|
134
|
+
const isRepeatChar = buffer.length > 0 && [...buffer].every((c) => c === lower);
|
|
135
|
+
if (timer !== null) clearTimeout(timer);
|
|
136
|
+
timer = setTimeout(clearBuffer, TYPEAHEAD_TIMEOUT_MS);
|
|
137
|
+
if (isRepeatChar) {
|
|
138
|
+
buffer = lower;
|
|
139
|
+
const from = indexOfFocused(items);
|
|
140
|
+
for (let i = 1; i <= items.length; i++) {
|
|
141
|
+
const candidate = (from + i + items.length) % items.length;
|
|
142
|
+
const element = items[candidate];
|
|
143
|
+
if (isDisabled(element)) continue;
|
|
144
|
+
if (labelOf(element).startsWith(lower)) {
|
|
145
|
+
focusAt(items, candidate);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
buffer += lower;
|
|
152
|
+
const query = buffer;
|
|
153
|
+
for (let i = 0; i < items.length; i++) {
|
|
154
|
+
const element = items[i];
|
|
155
|
+
if (isDisabled(element)) continue;
|
|
156
|
+
if (labelOf(element).startsWith(query)) {
|
|
157
|
+
focusAt(items, i);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function destroy() {
|
|
163
|
+
clearBuffer();
|
|
164
|
+
}
|
|
165
|
+
function subscribe(listener) {
|
|
166
|
+
listeners.add(listener);
|
|
167
|
+
return () => {
|
|
168
|
+
listeners.delete(listener);
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
get focusedIndex() {
|
|
173
|
+
return indexOfFocused(orderedItems());
|
|
174
|
+
},
|
|
175
|
+
register,
|
|
176
|
+
move,
|
|
177
|
+
moveToEdge,
|
|
178
|
+
focusItem,
|
|
179
|
+
clear,
|
|
180
|
+
typeahead,
|
|
181
|
+
destroy,
|
|
182
|
+
subscribe
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function useMenuFocus(options = {}) {
|
|
186
|
+
const loop = useLiveRef(options.loop);
|
|
187
|
+
const onFocusChange = useEventCallback(options.onFocusChange);
|
|
188
|
+
const menu = useConstant(
|
|
189
|
+
() => createMenuFocus({
|
|
190
|
+
get loop() {
|
|
191
|
+
return loop.current;
|
|
192
|
+
},
|
|
193
|
+
onFocusChange
|
|
194
|
+
})
|
|
195
|
+
);
|
|
196
|
+
useEffect(() => {
|
|
197
|
+
return () => {
|
|
198
|
+
menu.destroy();
|
|
199
|
+
};
|
|
200
|
+
}, [menu]);
|
|
201
|
+
return menu;
|
|
202
|
+
}
|
|
203
|
+
function useMenuItemRef(menu) {
|
|
204
|
+
const unregister = useRef(null);
|
|
205
|
+
return useCallback(
|
|
206
|
+
(node) => {
|
|
207
|
+
unregister.current?.();
|
|
208
|
+
unregister.current = node ? menu.register(node) : null;
|
|
209
|
+
},
|
|
210
|
+
[menu]
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
export {
|
|
214
|
+
createMenuFocus,
|
|
215
|
+
useMenuFocus,
|
|
216
|
+
useMenuItemRef
|
|
217
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared scale+opacity transition for floating surfaces — menus, selects,
|
|
3
|
+
* pickers, popovers, tooltips, hover cards. One rung, one curve, one
|
|
4
|
+
* geometry, so twelve panels stop each inventing their own.
|
|
5
|
+
*
|
|
6
|
+
* The name is a slight misnomer for the modal rung: a centred dialog is
|
|
7
|
+
* anchored to nothing, and spends this same function with its own two
|
|
8
|
+
* durations (`DURATIONS.base` in, `DURATIONS.exit` out) rather than the
|
|
9
|
+
* anchored defaults. One geometry in one place was worth more than a synonym,
|
|
10
|
+
* so the modal surfaces call `anchored` too and spell their rung at the call
|
|
11
|
+
* site where the diff can see it.
|
|
12
|
+
*
|
|
13
|
+
* Two pieces that are deliberately kept separate:
|
|
14
|
+
*
|
|
15
|
+
* 1. `anchored()` — a css-only transition (scale + opacity, nothing else). It
|
|
16
|
+
* never emits `transform-origin`.
|
|
17
|
+
* 2. `originFor()` — a pure lookup the CALLER writes as a static inline
|
|
18
|
+
* `style={{ transformOrigin }}`. Keeping the origin out of `css()` means it
|
|
19
|
+
* is inspectable in DevTools, survives a future exit transition, and is
|
|
20
|
+
* available to any CSS that wants to key off it — none of which is true
|
|
21
|
+
* of a value smuggled into a per-frame transition string.
|
|
22
|
+
*
|
|
23
|
+
* Why scale + opacity and nothing else: a panel that also translated would
|
|
24
|
+
* fight `anchor-position.ts`'s `position: fixed; left/top` writes on the same
|
|
25
|
+
* element (that module owns those three properties and touches neither
|
|
26
|
+
* `transform` nor `transform-origin`, so the two never collide as written).
|
|
27
|
+
* The travel is not lost, it moves into the origin: growing from the panel
|
|
28
|
+
* edge nearest the trigger reads as "this came out of that button" far more
|
|
29
|
+
* clearly than four pixels of slide ever did.
|
|
30
|
+
*
|
|
31
|
+
* SSR: nothing here touches `window` at module scope. `prefersReducedMotion()`
|
|
32
|
+
* does, but a transition body only ever runs in the browser.
|
|
33
|
+
*/
|
|
34
|
+
import type { Side, Align } from "../anchor-position.js";
|
|
35
|
+
import type { TransitionSpec, TransitionDirection } from "./transitions.js";
|
|
36
|
+
/** Params for `anchored`. Every field is optional; the defaults ARE the
|
|
37
|
+
* anchored rung, so `anchored(node, { side: resolvedSide })` is the whole
|
|
38
|
+
* call site for eleven of the twelve panels. */
|
|
39
|
+
export interface AnchoredParams {
|
|
40
|
+
/** The RESOLVED side the surface was placed on — `useAnchorPosition`'s
|
|
41
|
+
* `onPlacement` value, never the requested one. Drives nothing but the
|
|
42
|
+
* caller's own `transform-origin`; kept here so one params object feeds
|
|
43
|
+
* both. Defaults to `"bottom"`, but callers always pass their own
|
|
44
|
+
* requested side as the seed. */
|
|
45
|
+
side?: Side;
|
|
46
|
+
/** Entrance duration (ms). Defaults to `DURATIONS.fast`. */
|
|
47
|
+
duration?: number;
|
|
48
|
+
/** Exit duration (ms). Defaults to `DURATIONS.fast`. */
|
|
49
|
+
exitDuration?: number;
|
|
50
|
+
/** Delay (ms), entrance only — an exit never waits. Defaults to 0. */
|
|
51
|
+
delay?: number;
|
|
52
|
+
/** `false` drops the scale term, leaving an opacity-only fade (Tooltip).
|
|
53
|
+
* Defaults to `true`. */
|
|
54
|
+
scale?: boolean;
|
|
55
|
+
/** Direction override, read fresh on every call, for a caller driving ONE
|
|
56
|
+
* bidirectional transition instance (which reports `direction: "both"`,
|
|
57
|
+
* and cannot distinguish enter from leave). Unset, direction comes from
|
|
58
|
+
* `options.direction`. */
|
|
59
|
+
entering?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* One-shot read of the user's motion preference.
|
|
63
|
+
*
|
|
64
|
+
* Browser-only, and safe because of where it is called from: a transition body
|
|
65
|
+
* never runs during SSR. NEVER call it at module scope, in a render path, or
|
|
66
|
+
* inside a memo — for a live, reactive answer use `useReducedMotion()` from
|
|
67
|
+
* `media-query.ts` instead. A listener would be pointless here: the value only
|
|
68
|
+
* matters at the instant a one-shot transition starts, and a preference that
|
|
69
|
+
* flips mid-flight should not retro-cancel an animation already on screen.
|
|
70
|
+
*
|
|
71
|
+
* `window.matchMedia` is resolved FRESH on every call, never memoised, for
|
|
72
|
+
* the same reason `media-query.ts` documents at length: a test that overrides
|
|
73
|
+
* `window.matchMedia` wholesale must be visible to the next call.
|
|
74
|
+
*/
|
|
75
|
+
export declare function prefersReducedMotion(): boolean;
|
|
76
|
+
export declare function originFor(side: Side, align?: Align): string;
|
|
77
|
+
/**
|
|
78
|
+
* A css-only, direction-aware transition for an anchored floating surface.
|
|
79
|
+
* Entrance: `JS_EASINGS.out` over `DURATIONS.fast`, growing from the scale
|
|
80
|
+
* floor. Exit: `JS_EASINGS.in`, half the depth, and never delayed — a
|
|
81
|
+
* dismissal that waits before starting reads as an unresponsive UI.
|
|
82
|
+
*
|
|
83
|
+
* Reduced motion collapses `duration` (and `delay`) to 0, which makes
|
|
84
|
+
* `runTransition` skip `element.animate()` entirely rather than running a
|
|
85
|
+
* zero-length animation — the same fast path `animate.test.ts` pins down.
|
|
86
|
+
*/
|
|
87
|
+
export declare function anchored(_node: Element, params?: AnchoredParams, options?: {
|
|
88
|
+
direction: TransitionDirection;
|
|
89
|
+
}): TransitionSpec;
|
|
90
|
+
/** The `data-state` values a transitioning surface reports. There is no
|
|
91
|
+
* "closed": a closed surface is not in the DOM. Deliberately two values, not
|
|
92
|
+
* three — a 150–300 ms entrance has nothing that needs to key off "opening",
|
|
93
|
+
* and two values means one static attribute plus two one-line handlers
|
|
94
|
+
* instead of four.
|
|
95
|
+
*
|
|
96
|
+
* The Svelte side pairs this type with a `markSurfaceState(event, state)`
|
|
97
|
+
* helper that writes `data-state` IMPERATIVELY from a transition event
|
|
98
|
+
* handler. That helper is NOT ported (divergence D-2): it exists solely
|
|
99
|
+
* because Svelte marks a closing `{#if}` branch inert and its scheduler skips
|
|
100
|
+
* inert effects, so a reactive attribute inside a closing block never reaches
|
|
101
|
+
* the DOM. React re-renders an exiting surface normally, so a port writes
|
|
102
|
+
* `data-state={presence.surfaceState}` as an ordinary attribute — same DOM,
|
|
103
|
+
* same CSS hooks, same two values. */
|
|
104
|
+
export type SurfaceState = "open" | "closing";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { DURATIONS, JS_EASINGS } from "./tokens.js";
|
|
3
|
+
import { PRESETS } from "./presets.js";
|
|
4
|
+
import { REDUCED_MOTION_QUERY } from "./media-query.js";
|
|
5
|
+
function prefersReducedMotion() {
|
|
6
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return false;
|
|
7
|
+
return window.matchMedia(REDUCED_MOTION_QUERY).matches;
|
|
8
|
+
}
|
|
9
|
+
const ORIGINS = {
|
|
10
|
+
bottom: { start: "left top", center: "center top", end: "right top" },
|
|
11
|
+
top: { start: "left bottom", center: "center bottom", end: "right bottom" },
|
|
12
|
+
left: { start: "right top", center: "right center", end: "right bottom" },
|
|
13
|
+
right: { start: "left top", center: "left center", end: "left bottom" }
|
|
14
|
+
};
|
|
15
|
+
function originFor(side, align = "center") {
|
|
16
|
+
return ORIGINS[side][align];
|
|
17
|
+
}
|
|
18
|
+
const ENTER_FLOOR = PRESETS.scale.scale;
|
|
19
|
+
const EXIT_FLOOR = 1 - (1 - ENTER_FLOOR) / 2;
|
|
20
|
+
function anchored(_node, params = {}, options) {
|
|
21
|
+
const entering = params.entering ?? options?.direction !== "out";
|
|
22
|
+
const reduced = prefersReducedMotion();
|
|
23
|
+
const duration = reduced ? 0 : entering ? params.duration ?? DURATIONS.fast : params.exitDuration ?? DURATIONS.fast;
|
|
24
|
+
const delay = reduced ? 0 : entering ? params.delay ?? 0 : 0;
|
|
25
|
+
const easing = entering ? JS_EASINGS.out : JS_EASINGS.in;
|
|
26
|
+
const floor = params.scale === false ? 1 : entering ? ENTER_FLOOR : EXIT_FLOOR;
|
|
27
|
+
return {
|
|
28
|
+
delay,
|
|
29
|
+
duration,
|
|
30
|
+
easing,
|
|
31
|
+
// `t` arrives ALREADY eased (the sampler evaluates `easing(i / n)`
|
|
32
|
+
// before calling `css`), so this interpolates linearly in `t` exactly
|
|
33
|
+
// like `transitions.ts` does. A floor of 1 emits no `transform` at all
|
|
34
|
+
// rather than a no-op `scale(1)`, which keeps an opacity-only panel
|
|
35
|
+
// from acquiring a compositing layer and a stacking context it never
|
|
36
|
+
// asked for.
|
|
37
|
+
css: (t) => floor === 1 ? `opacity: ${t}` : `opacity: ${t}; transform: scale(${floor + (1 - floor) * t})`
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
anchored,
|
|
42
|
+
originFor,
|
|
43
|
+
prefersReducedMotion
|
|
44
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The transition sampler — the one mechanism every `transition:`-driven
|
|
3
|
+
* component in this library runs through, reproduced from the framework's own
|
|
4
|
+
* `animate()` so the React port animates the SAME curve rather than a
|
|
5
|
+
* hand-matched approximation of it.
|
|
6
|
+
*
|
|
7
|
+
* The decisive fact behind the whole design: a css-only transition is already
|
|
8
|
+
* WAAPI. The framework samples `css(t, 1 - t)` at
|
|
9
|
+
* `n = Math.ceil(duration / (1000 / 60))` points, converts each string to a
|
|
10
|
+
* keyframe object and hands the array to `element.animate()`. Running that same
|
|
11
|
+
* algorithm against the same `css()` produces a byte-identical keyframe array
|
|
12
|
+
* and therefore a pixel-identical animation — fidelity is structural here, not
|
|
13
|
+
* aspirational. It also inherits, free: the `duration: 0` fast path reduced
|
|
14
|
+
* motion relies on, reversal from an in-flight position rather than a full
|
|
15
|
+
* restart, and testability through an `Element.prototype.animate` stub.
|
|
16
|
+
*
|
|
17
|
+
* The curve lives entirely in the SAMPLE POSITIONS (`t = t1 + delta *
|
|
18
|
+
* easing(i / n)`), never in a WAAPI `easing` option — which is exactly why
|
|
19
|
+
* every `css(t, u)` in `transitions.ts` and `anchored.ts` interpolates
|
|
20
|
+
* linearly in `t`: by the time `css` is called, `t` has already been eased.
|
|
21
|
+
*
|
|
22
|
+
* Two things the source has and this does not, both deliberate:
|
|
23
|
+
*
|
|
24
|
+
* - `tick`. `TransitionSpec` has no `tick` field (nothing in this library uses
|
|
25
|
+
* one), so the per-frame JS loop and the `reset()` handle it exists for are
|
|
26
|
+
* both gone with it.
|
|
27
|
+
* - The `overflow: hidden` inline-style workaround for a Safari < 18 bug. It
|
|
28
|
+
* triggers only when a sampled keyframe declares `overflow: hidden`, and no
|
|
29
|
+
* `css()` in this package emits `overflow` at all — porting it would ship a
|
|
30
|
+
* branch no test can reach.
|
|
31
|
+
*
|
|
32
|
+
* There is deliberately NO "the host cannot animate" `setTimeout` fallback:
|
|
33
|
+
* the source has none, and inventing one would put an untested code path into
|
|
34
|
+
* production. jsdom is handled by the `Element.prototype.animate` stub in
|
|
35
|
+
* `test-setup.ts`, which is a hard requirement of this module's suite.
|
|
36
|
+
*
|
|
37
|
+
* SSR: nothing here touches a browser global at module scope. `runTransition`
|
|
38
|
+
* itself is only ever called from a layout effect.
|
|
39
|
+
*/
|
|
40
|
+
import type { TransitionSpec } from "./transitions.js";
|
|
41
|
+
/**
|
|
42
|
+
* One `css(t, u)` declaration string → one WAAPI keyframe object.
|
|
43
|
+
*
|
|
44
|
+
* Split on `;`, split each part at the FIRST `:`, and **break** — not
|
|
45
|
+
* `continue` — on a malformed part: a declaration missing its value ends the
|
|
46
|
+
* parse rather than being skipped, which is the source's behaviour and is what
|
|
47
|
+
* keeps a trailing `;` harmless.
|
|
48
|
+
*/
|
|
49
|
+
export declare function cssToKeyframe(css: string): Keyframe;
|
|
50
|
+
/** The handle one transition leg hands back. The counterpart of a running leg
|
|
51
|
+
* is read (`t()`) and then torn down (`abort()`) by the leg that replaces it. */
|
|
52
|
+
export interface TransitionRun {
|
|
53
|
+
/** Current eased position in `css()`'s own `t` space: `1 - to` before the
|
|
54
|
+
* delay elapses, the interpolated position while the main animation runs,
|
|
55
|
+
* and `to` once it has finished. Read by a reversing counterpart so a
|
|
56
|
+
* reopen mid-close starts from where the close actually got to. */
|
|
57
|
+
t(): number;
|
|
58
|
+
/** Cancel without finishing. Also nulls the animation's `effect` (a
|
|
59
|
+
* Chromium leak) and replaces `onfinish` with a no-op, because a cancelled
|
|
60
|
+
* animation can still fire `onfinish` in rare cases. */
|
|
61
|
+
abort(): void;
|
|
62
|
+
/** Silence this run's `onFinish` without stopping it. Called on the
|
|
63
|
+
* counterpart the instant a new leg starts, so a superseded leg cannot
|
|
64
|
+
* unmount the node the new leg is animating back in. */
|
|
65
|
+
deactivate(): void;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Runs one transition leg on `element`, from its current position to `to`
|
|
69
|
+
* (`1` = visible, `0` = hidden), and calls `onFinish` when it lands.
|
|
70
|
+
*
|
|
71
|
+
* Order matters in five places, and every one of them is visible if broken:
|
|
72
|
+
*
|
|
73
|
+
* 1. `counterpart?.deactivate()` runs FIRST, before anything else.
|
|
74
|
+
* 2. A falsy `spec.duration` finishes SYNCHRONOUSLY and never calls
|
|
75
|
+
* `element.animate()` — the reduced-motion fast path, and the reason a
|
|
76
|
+
* reduced-motion close completes inside the same layout effect, before
|
|
77
|
+
* paint.
|
|
78
|
+
* 3. A leading dummy animation is ALWAYS created, even at `delay: 0`. Its
|
|
79
|
+
* keyframes pin the hidden state (`css(0, 1)`, twice) only for a fresh
|
|
80
|
+
* intro, and are empty otherwise. Pinning is what stops a DELAYED entrance
|
|
81
|
+
* painting one frame at rest first; keeping the dummy at `delay: 0` is what
|
|
82
|
+
* defers the real keyframes until the DOM has updated. The consequence for
|
|
83
|
+
* every caller: the main animation always starts ASYNCHRONOUSLY, in the
|
|
84
|
+
* dummy's `onfinish`.
|
|
85
|
+
* 4. Inside that `onfinish`: cancel the dummy, then READ `counterpart.t()`,
|
|
86
|
+
* then abort the counterpart — the read strictly before the abort, or a
|
|
87
|
+
* reversal restarts from the far end instead of from the in-flight
|
|
88
|
+
* position.
|
|
89
|
+
* 5. The sample loop runs `i = 0` to `i <= n` INCLUSIVE (n + 1 keyframes);
|
|
90
|
+
* `n` must be an integer or the `to` value is missed entirely.
|
|
91
|
+
*/
|
|
92
|
+
export declare function runTransition(element: Element, spec: TransitionSpec, to: 0 | 1, counterpart: TransitionRun | undefined, onFinish: () => void): TransitionRun;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { linear } from "./easing.js";
|
|
3
|
+
function noop() {
|
|
4
|
+
}
|
|
5
|
+
function cssPropertyToCamelcase(style) {
|
|
6
|
+
if (style === "float") return "cssFloat";
|
|
7
|
+
if (style === "offset") return "cssOffset";
|
|
8
|
+
if (style.startsWith("--")) return style;
|
|
9
|
+
const parts = style.split("-");
|
|
10
|
+
if (parts.length === 1) return parts[0] ?? style;
|
|
11
|
+
return (parts[0] ?? "") + parts.slice(1).map((word) => (word[0] ?? "").toUpperCase() + word.slice(1)).join("");
|
|
12
|
+
}
|
|
13
|
+
function cssToKeyframe(css) {
|
|
14
|
+
const keyframe = {};
|
|
15
|
+
const parts = css.split(";");
|
|
16
|
+
for (const part of parts) {
|
|
17
|
+
const [property, value] = part.split(":");
|
|
18
|
+
if (!property || value === void 0) break;
|
|
19
|
+
const formattedProperty = cssPropertyToCamelcase(property.trim());
|
|
20
|
+
keyframe[formattedProperty] = value.trim();
|
|
21
|
+
}
|
|
22
|
+
return keyframe;
|
|
23
|
+
}
|
|
24
|
+
function runTransition(element, spec, to, counterpart, onFinish) {
|
|
25
|
+
const isIntro = to === 1;
|
|
26
|
+
counterpart?.deactivate();
|
|
27
|
+
if (!spec.duration) {
|
|
28
|
+
onFinish();
|
|
29
|
+
return {
|
|
30
|
+
abort: noop,
|
|
31
|
+
deactivate: noop,
|
|
32
|
+
t: () => to
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const { delay = 0, css, easing = linear } = spec;
|
|
36
|
+
const dummyKeyframes = [];
|
|
37
|
+
if (isIntro && counterpart === void 0) {
|
|
38
|
+
const styles = cssToKeyframe(css(0, 1));
|
|
39
|
+
dummyKeyframes.push(styles, styles);
|
|
40
|
+
}
|
|
41
|
+
let getT = () => 1 - to;
|
|
42
|
+
let finish = onFinish;
|
|
43
|
+
let animation = element.animate(dummyKeyframes, { duration: delay, fill: "forwards" });
|
|
44
|
+
animation.onfinish = () => {
|
|
45
|
+
animation.cancel();
|
|
46
|
+
const t1 = counterpart?.t() ?? 1 - to;
|
|
47
|
+
counterpart?.abort();
|
|
48
|
+
const delta = to - t1;
|
|
49
|
+
const duration = spec.duration * Math.abs(delta);
|
|
50
|
+
const keyframes = [];
|
|
51
|
+
if (duration > 0) {
|
|
52
|
+
const n = Math.ceil(duration / (1e3 / 60));
|
|
53
|
+
for (let i = 0; i <= n; i += 1) {
|
|
54
|
+
const t = t1 + delta * easing(i / n);
|
|
55
|
+
keyframes.push(cssToKeyframe(css(t, 1 - t)));
|
|
56
|
+
}
|
|
57
|
+
getT = () => {
|
|
58
|
+
const time = animation.currentTime;
|
|
59
|
+
if (typeof time !== "number" || !Number.isFinite(time)) return t1;
|
|
60
|
+
return t1 + delta * easing(time / duration);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
animation = element.animate(keyframes, { duration, fill: "forwards" });
|
|
64
|
+
animation.onfinish = () => {
|
|
65
|
+
getT = () => to;
|
|
66
|
+
finish();
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
abort: () => {
|
|
71
|
+
animation.cancel();
|
|
72
|
+
animation.effect = null;
|
|
73
|
+
animation.onfinish = noop;
|
|
74
|
+
},
|
|
75
|
+
deactivate: () => {
|
|
76
|
+
finish = noop;
|
|
77
|
+
},
|
|
78
|
+
t: () => getT()
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
cssToKeyframe,
|
|
83
|
+
runTransition
|
|
84
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two curves `JS_EASINGS` names, inlined because the framework's easing
|
|
3
|
+
* module cannot become a runtime dependency of this package (divergence D-7 in
|
|
4
|
+
* the internals contract). Closed forms, copied byte-for-byte — do NOT "clean
|
|
5
|
+
* up" the endpoint guards; they are the shape of the curve at exactly the
|
|
6
|
+
* points `css()` is sampled at.
|
|
7
|
+
*
|
|
8
|
+
* Pure data-shaped functions: no side effects, no browser globals, safe to
|
|
9
|
+
* import at module scope during SSR.
|
|
10
|
+
*/
|
|
11
|
+
/** Departure curve. `t === 0` is guarded so the curve starts at exactly 0
|
|
12
|
+
* rather than at `2 ** -10`. */
|
|
13
|
+
export declare function expoIn(t: number): number;
|
|
14
|
+
/** Arrival curve. `t === 1` is guarded so the curve ends at exactly 1 rather
|
|
15
|
+
* than at `1 - 2 ** -10`. */
|
|
16
|
+
export declare function expoOut(t: number): number;
|
|
17
|
+
/** The identity curve. Not referenced by `JS_EASINGS`; exported for a caller
|
|
18
|
+
* that wants to opt a single transition out of easing entirely without
|
|
19
|
+
* hand-rolling `(t) => t` at the call site. */
|
|
20
|
+
export declare const linear: (t: number) => number;
|