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,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional tactile feedback via `navigator.vibrate` — a touch-only, opt-in
|
|
3
|
+
* add-on (Pressable's `haptic` prop, StatusMorph's `haptic` prop). Nothing
|
|
4
|
+
* here ever throws: the Vibration API is unsupported on most desktop
|
|
5
|
+
* browsers and can be silently refused by a browser policy even where it
|
|
6
|
+
* exists (Safari on iOS has never implemented it, for instance), and a
|
|
7
|
+
* missing rumble is a non-event a user never notices — a thrown error
|
|
8
|
+
* breaking the surrounding click handler very much would be.
|
|
9
|
+
*
|
|
10
|
+
* No hook: both functions are called from a click handler, never from a
|
|
11
|
+
* render path. `canVibrate()` reads `navigator` and is therefore
|
|
12
|
+
* server-safe only because it guards on `typeof navigator`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const HAPTIC_PATTERNS: {
|
|
15
|
+
readonly light: 10;
|
|
16
|
+
readonly medium: 25;
|
|
17
|
+
readonly heavy: 50;
|
|
18
|
+
readonly success: readonly [15, 60, 15];
|
|
19
|
+
readonly error: readonly [60, 60, 60, 60, 60];
|
|
20
|
+
};
|
|
21
|
+
export type HapticPattern = keyof typeof HAPTIC_PATTERNS;
|
|
22
|
+
/** Whether this environment can even attempt a vibration. Checked before
|
|
23
|
+
* `vibrate()` calls into the API, and exported separately so a component
|
|
24
|
+
* can skip attaching pointer-tracking work entirely when it never could
|
|
25
|
+
* fire (e.g. gating a touch-only listener without needing to wait for a
|
|
26
|
+
* failed call to find that out). */
|
|
27
|
+
export declare function canVibrate(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Fire a vibration pattern. Returns whether the browser accepted the
|
|
30
|
+
* request (`navigator.vibrate`'s own return value) — `false` for
|
|
31
|
+
* "unsupported", "not called from a user gesture", "the tab is
|
|
32
|
+
* backgrounded", or any other reason the platform declines. Never throws:
|
|
33
|
+
* some browsers throw rather than return `false` for a policy refusal, so
|
|
34
|
+
* the whole thing is wrapped rather than trusting the spec's "just returns
|
|
35
|
+
* a boolean" description. The `!== false` coerces `navigator.vibrate`'s
|
|
36
|
+
* result rather than returning it verbatim: lib.dom types the method as
|
|
37
|
+
* always returning `boolean`, but that is a type-level promise the DOM spec
|
|
38
|
+
* does not actually keep — a user agent is free to return `undefined`, and
|
|
39
|
+
* without the coercion this function's own `boolean` return type would be a
|
|
40
|
+
* runtime lie for a caller that checks `=== false`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function vibrate(pattern: HapticPattern | number | number[]): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const HAPTIC_PATTERNS = {
|
|
3
|
+
light: 10,
|
|
4
|
+
medium: 25,
|
|
5
|
+
heavy: 50,
|
|
6
|
+
success: [15, 60, 15],
|
|
7
|
+
error: [60, 60, 60, 60, 60]
|
|
8
|
+
};
|
|
9
|
+
function canVibrate() {
|
|
10
|
+
return typeof navigator !== "undefined" && typeof navigator.vibrate === "function";
|
|
11
|
+
}
|
|
12
|
+
function resolvePattern(pattern) {
|
|
13
|
+
if (typeof pattern !== "string") return pattern;
|
|
14
|
+
const value = HAPTIC_PATTERNS[pattern];
|
|
15
|
+
return typeof value === "number" ? value : [...value];
|
|
16
|
+
}
|
|
17
|
+
function vibrate(pattern) {
|
|
18
|
+
try {
|
|
19
|
+
if (!canVibrate()) return false;
|
|
20
|
+
return navigator.vibrate(resolvePattern(pattern)) !== false;
|
|
21
|
+
} catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
HAPTIC_PATTERNS,
|
|
27
|
+
canVibrate,
|
|
28
|
+
vibrate
|
|
29
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The primitive every "reveal on scroll" / "notice when visible" component in
|
|
3
|
+
* this family uses instead of hand-rolling its own IntersectionObserver.
|
|
4
|
+
* Four components elsewhere in this library (blur-reveal, box-reveal,
|
|
5
|
+
* line-reveal, number-ticker) each carry a near-identical
|
|
6
|
+
* `new IntersectionObserver(...)` block, differing only in whether they
|
|
7
|
+
* honour `once: false` and whether `root`/`rootMargin` are exposed at all —
|
|
8
|
+
* this is the single, parameterized version those four independently
|
|
9
|
+
* reinvented, written once for the ten components that need it here.
|
|
10
|
+
*
|
|
11
|
+
* Two layers, as everywhere in `internals/`: `observeInView(node, options)` is
|
|
12
|
+
* the framework-free core (its own suite drives it directly against a
|
|
13
|
+
* hand-built node, no React), and `useInView(node, options)` is the hook the
|
|
14
|
+
* components use.
|
|
15
|
+
*/
|
|
16
|
+
export interface InViewOptions {
|
|
17
|
+
/** Disconnect after the first time the node becomes visible. Default true. */
|
|
18
|
+
once?: boolean;
|
|
19
|
+
/** IntersectionObserver threshold(s). Default 0.1. */
|
|
20
|
+
threshold?: number | number[];
|
|
21
|
+
/** IntersectionObserver rootMargin. Default "0px". */
|
|
22
|
+
rootMargin?: string;
|
|
23
|
+
/** IntersectionObserver root. Default null (the viewport). */
|
|
24
|
+
root?: Element | Document | null;
|
|
25
|
+
/** Called with the current intersecting state on every observer callback. */
|
|
26
|
+
onChange: (inView: boolean, entry?: IntersectionObserverEntry) => void;
|
|
27
|
+
}
|
|
28
|
+
/** What `observeInView` hands back. `update()` swaps the live options in
|
|
29
|
+
* place; `destroy()` disconnects for good. */
|
|
30
|
+
export interface InViewHandle {
|
|
31
|
+
update(options: InViewOptions): void;
|
|
32
|
+
destroy(): void;
|
|
33
|
+
}
|
|
34
|
+
export declare function observeInView(node: Element, opts: InViewOptions): InViewHandle;
|
|
35
|
+
export interface UseInViewOptions extends Omit<InViewOptions, "onChange"> {
|
|
36
|
+
/** Optional here (it is required on the core): the hook already returns the
|
|
37
|
+
* state, so a consumer only supplies this when it needs the entry itself. */
|
|
38
|
+
onChange?: InViewOptions["onChange"];
|
|
39
|
+
/** `false` observes nothing at all. Default true. */
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Returns whether `node` is currently intersecting, and forwards every
|
|
44
|
+
* observer fire to `onChange`.
|
|
45
|
+
*
|
|
46
|
+
* Takes the NODE, not a ref (convention C-1): a node created by a conditional
|
|
47
|
+
* or by a presence-gated subtree is still `null` when a `[]`-deps effect
|
|
48
|
+
* fires, and that effect never re-runs.
|
|
49
|
+
*
|
|
50
|
+
* A LAYOUT effect, not a passive one: the no-IntersectionObserver branch calls
|
|
51
|
+
* `onChange(true)` synchronously, and a passive effect would paint one frame
|
|
52
|
+
* of hidden content before the fail-visible answer landed. Constructing the
|
|
53
|
+
* observer costs nothing measurable.
|
|
54
|
+
*
|
|
55
|
+
* The dependency array is exactly the core's own rebuild rule: `threshold`,
|
|
56
|
+
* `rootMargin` and `root` are the observer's constructor arguments and force a
|
|
57
|
+
* new one; `once` and `onChange` are read live on every fire and must NOT —
|
|
58
|
+
* an inline `onChange` closure changes identity every render, and re-observing
|
|
59
|
+
* for that alone would throw away more than intended. `firedOnce` lives in a
|
|
60
|
+
* ref so it survives a rebuild but not an unmount, matching the core handle's
|
|
61
|
+
* per-instance lifetime.
|
|
62
|
+
*
|
|
63
|
+
* SSR: `false`, matching an un-run observer. A consumer that needs the
|
|
64
|
+
* revealed state in the server HTML uses the `initial="visible"` pattern
|
|
65
|
+
* `Reveal` already has.
|
|
66
|
+
*/
|
|
67
|
+
export declare function useInView(node: Element | null, options?: UseInViewOptions): boolean;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState, useRef } from "react";
|
|
3
|
+
import { useIsomorphicLayoutEffect } from "../dom/ssr.js";
|
|
4
|
+
import { useEventCallback } from "../dom/use-event-callback.js";
|
|
5
|
+
import { useLiveRef } from "../dom/use-live-ref.js";
|
|
6
|
+
const DEFAULT_THRESHOLD = 0.1;
|
|
7
|
+
const DEFAULT_ROOT_MARGIN = "0px";
|
|
8
|
+
function observerInit(options) {
|
|
9
|
+
return {
|
|
10
|
+
threshold: options.threshold ?? DEFAULT_THRESHOLD,
|
|
11
|
+
rootMargin: options.rootMargin ?? DEFAULT_ROOT_MARGIN,
|
|
12
|
+
root: options.root ?? null
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function sameObserverInit(a, b) {
|
|
16
|
+
const ia = observerInit(a);
|
|
17
|
+
const ib = observerInit(b);
|
|
18
|
+
return JSON.stringify(ia.threshold) === JSON.stringify(ib.threshold) && ia.rootMargin === ib.rootMargin && ia.root === ib.root;
|
|
19
|
+
}
|
|
20
|
+
function noop() {
|
|
21
|
+
}
|
|
22
|
+
function observeInView(node, opts) {
|
|
23
|
+
if (typeof window === "undefined" || typeof IntersectionObserver === "undefined") {
|
|
24
|
+
opts.onChange(true);
|
|
25
|
+
return { update: noop, destroy: noop };
|
|
26
|
+
}
|
|
27
|
+
let current = opts;
|
|
28
|
+
let observer;
|
|
29
|
+
let firedOnce = false;
|
|
30
|
+
function build(o) {
|
|
31
|
+
observer?.disconnect();
|
|
32
|
+
observer = void 0;
|
|
33
|
+
if (firedOnce) return;
|
|
34
|
+
observer = new IntersectionObserver((entries) => {
|
|
35
|
+
for (const entry of entries) {
|
|
36
|
+
current.onChange(entry.isIntersecting, entry);
|
|
37
|
+
if (entry.isIntersecting && (current.once ?? true)) {
|
|
38
|
+
firedOnce = true;
|
|
39
|
+
observer?.disconnect();
|
|
40
|
+
observer = void 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, observerInit(o));
|
|
44
|
+
observer.observe(node);
|
|
45
|
+
}
|
|
46
|
+
build(current);
|
|
47
|
+
return {
|
|
48
|
+
update(newOpts) {
|
|
49
|
+
const needsRebuild = !sameObserverInit(current, newOpts);
|
|
50
|
+
current = newOpts;
|
|
51
|
+
if (needsRebuild) build(newOpts);
|
|
52
|
+
},
|
|
53
|
+
destroy() {
|
|
54
|
+
observer?.disconnect();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function useInView(node, options = {}) {
|
|
59
|
+
const { once, threshold, rootMargin, root, enabled = true, onChange } = options;
|
|
60
|
+
const [inView, setInView] = useState(false);
|
|
61
|
+
const onceRef = useLiveRef(once);
|
|
62
|
+
const handleChange = useEventCallback(onChange);
|
|
63
|
+
const firedOnce = useRef(false);
|
|
64
|
+
const thresholdKey = JSON.stringify(threshold ?? DEFAULT_THRESHOLD);
|
|
65
|
+
useIsomorphicLayoutEffect(() => {
|
|
66
|
+
if (!node || !enabled) return;
|
|
67
|
+
if (firedOnce.current) return;
|
|
68
|
+
const handle = observeInView(node, {
|
|
69
|
+
// A getter, not a captured value: `once` is read off this object on
|
|
70
|
+
// every fire, so flipping it takes effect without a rebuild.
|
|
71
|
+
get once() {
|
|
72
|
+
return onceRef.current;
|
|
73
|
+
},
|
|
74
|
+
threshold,
|
|
75
|
+
rootMargin,
|
|
76
|
+
root,
|
|
77
|
+
// Rest args, forwarded as received: the fail-visible branch calls
|
|
78
|
+
// `onChange(true)` with ONE argument, and re-expanding it to
|
|
79
|
+
// `(visible, entry)` would hand the consumer an explicit
|
|
80
|
+
// `undefined` second argument the core never sent.
|
|
81
|
+
onChange: (...args) => {
|
|
82
|
+
const [visible] = args;
|
|
83
|
+
setInView(visible);
|
|
84
|
+
if (visible && (onceRef.current ?? true)) firedOnce.current = true;
|
|
85
|
+
handleChange(...args);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return () => {
|
|
89
|
+
handle.destroy();
|
|
90
|
+
};
|
|
91
|
+
}, [node, enabled, thresholdKey, rootMargin, root]);
|
|
92
|
+
return inView;
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
observeInView,
|
|
96
|
+
useInView
|
|
97
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live `matchMedia` state as a hook.
|
|
3
|
+
*
|
|
4
|
+
* `useSyncExternalStore`, and this file is the archetype for choosing it: a
|
|
5
|
+
* store React does not own, mutated outside React's knowledge, that must not
|
|
6
|
+
* tear across a concurrent render — and whose `getServerSnapshot` returns
|
|
7
|
+
* `fallback` for the server render AND the hydration render, which eliminates
|
|
8
|
+
* the whole mismatch class rather than papering over it. A
|
|
9
|
+
* `useState` + `useEffect` version reaches the same end state with one extra
|
|
10
|
+
* committed frame and a real hydration mismatch the moment someone
|
|
11
|
+
* "optimises" the initializer into a lazy `window.matchMedia` read.
|
|
12
|
+
*
|
|
13
|
+
* The Svelte source's `start()`/`stop()` pair has no counterpart here (D-4): it
|
|
14
|
+
* exists only because that framework has no lifecycle-bound reactive
|
|
15
|
+
* primitive, so the factory had to be constructible during SSR before any
|
|
16
|
+
* effect ran. `useSyncExternalStore` IS that lifecycle, with the hydration
|
|
17
|
+
* guarantee on top. The consuming pattern collapses from three lines to
|
|
18
|
+
* `const reduced = useReducedMotion();`.
|
|
19
|
+
*
|
|
20
|
+
* `getSnapshot` is called by React on every render and again after every store
|
|
21
|
+
* change, so it must not allocate: `window.matchMedia(query)` mints a NEW
|
|
22
|
+
* `MediaQueryList` on each call, and one `useReducedMotion()` in a
|
|
23
|
+
* scroll-driven tree turns that into garbage on every frame. The list is
|
|
24
|
+
* therefore memoised per query, and dropped again on the two events that can
|
|
25
|
+
* make a memoised one wrong:
|
|
26
|
+
*
|
|
27
|
+
* - `window.matchMedia` itself being replaced. The cache is keyed on the
|
|
28
|
+
* current function as well as the query, which is what keeps the source's
|
|
29
|
+
* own rationale intact: a test that overrides `matchMedia` wholesale
|
|
30
|
+
* installs a different function, the key stops matching, and the very next
|
|
31
|
+
* call resolves against the new implementation.
|
|
32
|
+
* - A `change` event actually firing. A real `MediaQueryList.matches` is live
|
|
33
|
+
* — the browser updates the object you already hold — but a stub that
|
|
34
|
+
* captures `matches` at construction is not, and re-resolving once per real
|
|
35
|
+
* preference change (a rare, user-driven event) costs nothing and makes the
|
|
36
|
+
* hook correct against both. The subscription itself stays on the list it
|
|
37
|
+
* was added to, so no listener is stranded.
|
|
38
|
+
*
|
|
39
|
+
* Between those, every render reuses one list. `matches` is a boolean, so
|
|
40
|
+
* snapshot identity is a non-issue either way.
|
|
41
|
+
*/
|
|
42
|
+
export declare const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
43
|
+
/**
|
|
44
|
+
* `true` while `query` matches. `fallback` is the answer on the server, during
|
|
45
|
+
* hydration, and on a host without `matchMedia` at all.
|
|
46
|
+
*/
|
|
47
|
+
export declare function useMediaQuery(query: string, fallback?: boolean): boolean;
|
|
48
|
+
/** `useMediaQuery(REDUCED_MOTION_QUERY, false)` — reduced motion is never
|
|
49
|
+
* assumed before the browser has actually been asked. */
|
|
50
|
+
export declare function useReducedMotion(): boolean;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useSyncExternalStore } from "react";
|
|
3
|
+
const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
4
|
+
function canMatchMedia() {
|
|
5
|
+
return typeof window !== "undefined" && typeof window.matchMedia === "function";
|
|
6
|
+
}
|
|
7
|
+
let cachedImpl;
|
|
8
|
+
let cache = /* @__PURE__ */ new Map();
|
|
9
|
+
function mediaQueryList(query) {
|
|
10
|
+
if (cachedImpl !== window.matchMedia) {
|
|
11
|
+
cachedImpl = window.matchMedia;
|
|
12
|
+
cache = /* @__PURE__ */ new Map();
|
|
13
|
+
}
|
|
14
|
+
const existing = cache.get(query);
|
|
15
|
+
if (existing) return existing;
|
|
16
|
+
const mql = window.matchMedia(query);
|
|
17
|
+
cache.set(query, mql);
|
|
18
|
+
return mql;
|
|
19
|
+
}
|
|
20
|
+
function invalidate(query) {
|
|
21
|
+
cache.delete(query);
|
|
22
|
+
}
|
|
23
|
+
function useMediaQuery(query, fallback = false) {
|
|
24
|
+
const subscribe = useCallback(
|
|
25
|
+
(onStoreChange) => {
|
|
26
|
+
if (!canMatchMedia()) return () => {
|
|
27
|
+
};
|
|
28
|
+
const mql = mediaQueryList(query);
|
|
29
|
+
const handleChange = () => {
|
|
30
|
+
invalidate(query);
|
|
31
|
+
onStoreChange();
|
|
32
|
+
};
|
|
33
|
+
mql.addEventListener("change", handleChange);
|
|
34
|
+
return () => {
|
|
35
|
+
mql.removeEventListener("change", handleChange);
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
[query]
|
|
39
|
+
);
|
|
40
|
+
const getSnapshot = useCallback(() => {
|
|
41
|
+
if (!canMatchMedia()) return fallback;
|
|
42
|
+
return mediaQueryList(query).matches;
|
|
43
|
+
}, [query, fallback]);
|
|
44
|
+
const getServerSnapshot = useCallback(() => fallback, [fallback]);
|
|
45
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
46
|
+
}
|
|
47
|
+
function useReducedMotion() {
|
|
48
|
+
return useMediaQuery(REDUCED_MOTION_QUERY, false);
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
REDUCED_MOTION_QUERY,
|
|
52
|
+
useMediaQuery,
|
|
53
|
+
useReducedMotion
|
|
54
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `usePresence` — the mount/unmount clock every transition-driven surface in
|
|
3
|
+
* this package runs on.
|
|
4
|
+
*
|
|
5
|
+
* The framework this library ports from hands a conditional block's exit
|
|
6
|
+
* animation to its own scheduler: the block stays alive until its LAST
|
|
7
|
+
* transition finishes, and only then is it destroyed. React has no such thing
|
|
8
|
+
* — a component that stops rendering a subtree removes it in the same commit —
|
|
9
|
+
* so the clock has to be owned explicitly. This hook is that owner, and owning
|
|
10
|
+
* it in one place rather than per component buys three things:
|
|
11
|
+
*
|
|
12
|
+
* - **Cleanup timing, for free.** Every effect cleanup inside the subtree — a
|
|
13
|
+
* scroll lock's release, a dismissable layer's splice, a focus trap's destroy
|
|
14
|
+
* path — lands at the instant the exit settles, exactly where the source's
|
|
15
|
+
* outro-delayed `destroy()` put it. No other module needs a "delay my
|
|
16
|
+
* teardown" mechanism.
|
|
17
|
+
* - **Reversal.** ONE bidirectional leg per node, never a split in/out pair, so
|
|
18
|
+
* a reopen mid-close resumes from the position the close actually reached
|
|
19
|
+
* instead of snapping back to the far end. Reversal smoothing only exists for
|
|
20
|
+
* a unified leg; having one hook own both directions makes that structural
|
|
21
|
+
* rather than a convention a port could break. The node is never unmounted
|
|
22
|
+
* during such a reversal — which is why `onEnterStart` is the hook a focus
|
|
23
|
+
* trap re-arms from.
|
|
24
|
+
* - **Grouping.** Several nodes can share one clock (a dialog's scrim and its
|
|
25
|
+
* panel), so they leave together and the unmount is a tie rather than a
|
|
26
|
+
* straggler.
|
|
27
|
+
*
|
|
28
|
+
* `register()` is called during render and returns a CACHED, identity-stable
|
|
29
|
+
* ref callback, so React never detaches and reattaches an animated node. The
|
|
30
|
+
* transition and its params are rewritten on every render into a per-key slot
|
|
31
|
+
* and read at the instant a leg starts, never at render time. That is what lets
|
|
32
|
+
* `params` take a `(entering: boolean) => P` factory, and the factory form is
|
|
33
|
+
* the documented default: a single bidirectional transition cannot tell
|
|
34
|
+
* entering from leaving on its own (its `direction` reports `"both"` on both
|
|
35
|
+
* invocations, computed once for the life of the node), but `open` can — so the
|
|
36
|
+
* factory is called with the answer, and `usePresence` passes a real
|
|
37
|
+
* `"in"`/`"out"` down so a preset's own direction-dependent easing default
|
|
38
|
+
* resolves correctly.
|
|
39
|
+
*
|
|
40
|
+
* Phase: layout effect throughout (contract §4). The source starts an intro
|
|
41
|
+
* before paint; a passive effect would paint one frame at rest first, and a
|
|
42
|
+
* reduced-motion close would cost an extra frame instead of settling inside the
|
|
43
|
+
* same effect that started it.
|
|
44
|
+
*
|
|
45
|
+
* SSR: `mounted` starts at `open`, no leg ever runs, and nothing here reads a
|
|
46
|
+
* browser global in a render path. A surface that is open on the server paints
|
|
47
|
+
* at rest — which is also the client's behaviour on a first render, because
|
|
48
|
+
* `appear` defaults to false.
|
|
49
|
+
*/
|
|
50
|
+
import type { RefCallback } from "react";
|
|
51
|
+
import type { SurfaceState } from "./anchored.js";
|
|
52
|
+
import type { TransitionFn } from "./transitions.js";
|
|
53
|
+
/** The three values `Presence` renders into `data-state`, because its source
|
|
54
|
+
* renders three. An anchored surface renders `surfaceState`'s two instead —
|
|
55
|
+
* the two vocabularies are not interchangeable (convention C-5). */
|
|
56
|
+
export type PresenceState = "opening" | "open" | "closing";
|
|
57
|
+
export interface UsePresenceOptions {
|
|
58
|
+
/**
|
|
59
|
+
* Animate an entrance when `open` is ALREADY true on the very first render.
|
|
60
|
+
* Default FALSE, reproducing two source rules that happen to agree: a LOCAL
|
|
61
|
+
* transition never plays on the initial render of the block that owns it,
|
|
62
|
+
* and hydration defaults intros off. A surface mounting for the first time
|
|
63
|
+
* already open therefore paints visible with no intro.
|
|
64
|
+
*/
|
|
65
|
+
appear?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Set `inert` on every attached node while closing, clear it on enter.
|
|
68
|
+
* Default true — the source sets it itself, synchronously, immediately
|
|
69
|
+
* before the exit starts, which is what keeps a closing panel from
|
|
70
|
+
* answering a click. `false` is the explicit opt-out, and it means this
|
|
71
|
+
* hook never touches `inert` at all.
|
|
72
|
+
*
|
|
73
|
+
* Written as the ATTRIBUTE, through `toggleAttribute`, never as the
|
|
74
|
+
* `inert` IDL property — the one mechanism this package uses everywhere
|
|
75
|
+
* (`useInertAttribute` is the same write behind a ref). The attribute is
|
|
76
|
+
* what `:not([inert])` selectors and assistive technology key on, a real
|
|
77
|
+
* browser reflects it to the IDL property for anything reading that
|
|
78
|
+
* instead, and it is the only one of the two that exists under jsdom, so
|
|
79
|
+
* the behaviour a test pins is the behaviour that ships.
|
|
80
|
+
*/
|
|
81
|
+
inert?: boolean;
|
|
82
|
+
onEnterStart?: () => void;
|
|
83
|
+
onEnterEnd?: () => void;
|
|
84
|
+
/** Fires at the dismiss instant, before the exit paints. */
|
|
85
|
+
onExitStart?: () => void;
|
|
86
|
+
onExitEnd?: () => void;
|
|
87
|
+
}
|
|
88
|
+
export interface PresenceHandle {
|
|
89
|
+
/** Render the subtree while true. Stays true through the WHOLE exit. */
|
|
90
|
+
readonly mounted: boolean;
|
|
91
|
+
/** Three values. For anything whose source renders three. */
|
|
92
|
+
readonly state: PresenceState;
|
|
93
|
+
/** Two values — `state === "closing" ? "closing" : "open"`. THE value every
|
|
94
|
+
* anchored surface renders into `data-state` (convention C-5). */
|
|
95
|
+
readonly surfaceState: SurfaceState;
|
|
96
|
+
/** `=== open`. Pass to `active:` options and to params factories. */
|
|
97
|
+
readonly entering: boolean;
|
|
98
|
+
/** Attach the single animated element. */
|
|
99
|
+
register<P>(transition: TransitionFn<P>, params?: P | ((entering: boolean) => P)): RefCallback<HTMLElement>;
|
|
100
|
+
/** Attach one of several elements sharing this clock (a dialog's scrim +
|
|
101
|
+
* panel). The subtree unmounts only when EVERY keyed exit has finished. */
|
|
102
|
+
register<P>(key: string, transition: TransitionFn<P>, params?: P | ((entering: boolean) => P)): RefCallback<HTMLElement>;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Owns one surface's mount/unmount clock. `mounted` stays true through the
|
|
106
|
+
* whole exit and goes false only once every registered node's leg has settled.
|
|
107
|
+
*/
|
|
108
|
+
export declare function usePresence(open: boolean, options?: UsePresenceOptions): PresenceHandle;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useConstant, useIsomorphicLayoutEffect } from "../dom/ssr.js";
|
|
4
|
+
import { useEventCallback } from "../dom/use-event-callback.js";
|
|
5
|
+
import { useLiveRef } from "../dom/use-live-ref.js";
|
|
6
|
+
import { runTransition } from "./animate.js";
|
|
7
|
+
const DEFAULT_KEY = "default";
|
|
8
|
+
function createPresenceCore(deps) {
|
|
9
|
+
const slots = /* @__PURE__ */ new Map();
|
|
10
|
+
let leg = null;
|
|
11
|
+
let starting = false;
|
|
12
|
+
let inertApplied = false;
|
|
13
|
+
let firstRun = true;
|
|
14
|
+
function ensureSlot(key) {
|
|
15
|
+
const existing = slots.get(key);
|
|
16
|
+
if (existing) return existing;
|
|
17
|
+
const slot = {
|
|
18
|
+
node: null,
|
|
19
|
+
buildSpec: null,
|
|
20
|
+
run: void 0,
|
|
21
|
+
legTo: null,
|
|
22
|
+
finished: false,
|
|
23
|
+
pendingLeg: null,
|
|
24
|
+
// Block body, never a concise arrow: React 19 reads a returned value
|
|
25
|
+
// as a cleanup function (convention C-3).
|
|
26
|
+
ref: (node) => {
|
|
27
|
+
if (node) {
|
|
28
|
+
slot.node = node;
|
|
29
|
+
const pending = slot.pendingLeg;
|
|
30
|
+
slot.pendingLeg = null;
|
|
31
|
+
if (pending !== null && leg === pending) startSlot(slot, pending);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
slot.pendingLeg = leg !== null && !slot.finished ? leg : null;
|
|
35
|
+
slot.run?.abort();
|
|
36
|
+
slot.run = void 0;
|
|
37
|
+
slot.node = null;
|
|
38
|
+
slot.legTo = null;
|
|
39
|
+
slot.finished = false;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
slots.set(key, slot);
|
|
43
|
+
return slot;
|
|
44
|
+
}
|
|
45
|
+
function register(a, b, c) {
|
|
46
|
+
const keyed = typeof a === "string";
|
|
47
|
+
const slot = ensureSlot(keyed ? a : DEFAULT_KEY);
|
|
48
|
+
const transition = keyed ? b : a;
|
|
49
|
+
const params = keyed ? c : b;
|
|
50
|
+
slot.buildSpec = (node, entering) => {
|
|
51
|
+
const resolved = typeof params === "function" ? params(entering) : params;
|
|
52
|
+
return transition(node, resolved, { direction: entering ? "in" : "out" });
|
|
53
|
+
};
|
|
54
|
+
return slot.ref;
|
|
55
|
+
}
|
|
56
|
+
function startSlot(slot, to) {
|
|
57
|
+
const node = slot.node;
|
|
58
|
+
const buildSpec = slot.buildSpec;
|
|
59
|
+
if (!node || !buildSpec) return;
|
|
60
|
+
const counterpart = slot.run;
|
|
61
|
+
slot.legTo = to;
|
|
62
|
+
slot.finished = false;
|
|
63
|
+
slot.run = void 0;
|
|
64
|
+
const handle = { current: void 0 };
|
|
65
|
+
const run = runTransition(node, buildSpec(node, to === 1), to, counterpart, () => {
|
|
66
|
+
slot.finished = true;
|
|
67
|
+
if (to === 1) {
|
|
68
|
+
handle.current?.abort();
|
|
69
|
+
slot.run = void 0;
|
|
70
|
+
}
|
|
71
|
+
settle(to);
|
|
72
|
+
});
|
|
73
|
+
handle.current = run;
|
|
74
|
+
if (!slot.finished) slot.run = run;
|
|
75
|
+
}
|
|
76
|
+
function startLegs(to) {
|
|
77
|
+
starting = true;
|
|
78
|
+
try {
|
|
79
|
+
for (const slot of slots.values()) {
|
|
80
|
+
if (!slot.node) continue;
|
|
81
|
+
if (slot.legTo === to) continue;
|
|
82
|
+
startSlot(slot, to);
|
|
83
|
+
}
|
|
84
|
+
} finally {
|
|
85
|
+
starting = false;
|
|
86
|
+
}
|
|
87
|
+
settle(to);
|
|
88
|
+
}
|
|
89
|
+
function settle(to) {
|
|
90
|
+
if (starting) return;
|
|
91
|
+
if (leg !== to) return;
|
|
92
|
+
for (const slot of slots.values()) {
|
|
93
|
+
if (!slot.node) continue;
|
|
94
|
+
if (slot.legTo !== to || !slot.finished) return;
|
|
95
|
+
}
|
|
96
|
+
leg = null;
|
|
97
|
+
if (to === 1) {
|
|
98
|
+
deps.setState("open");
|
|
99
|
+
deps.onEnterEnd();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
deps.setMounted(false);
|
|
103
|
+
deps.setState("open");
|
|
104
|
+
deps.onExitEnd();
|
|
105
|
+
}
|
|
106
|
+
function beginEnter() {
|
|
107
|
+
leg = 1;
|
|
108
|
+
if (inertApplied) {
|
|
109
|
+
inertApplied = false;
|
|
110
|
+
for (const slot of slots.values()) {
|
|
111
|
+
slot.node?.toggleAttribute("inert", false);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
deps.setState("opening");
|
|
115
|
+
deps.onEnterStart();
|
|
116
|
+
}
|
|
117
|
+
function beginExit() {
|
|
118
|
+
leg = 0;
|
|
119
|
+
deps.onExitStart();
|
|
120
|
+
deps.setState("closing");
|
|
121
|
+
if (deps.inertRef.current) {
|
|
122
|
+
inertApplied = true;
|
|
123
|
+
for (const slot of slots.values()) {
|
|
124
|
+
slot.node?.toggleAttribute("inert", true);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function sync(open, mounted, appear) {
|
|
129
|
+
const first = firstRun;
|
|
130
|
+
firstRun = false;
|
|
131
|
+
if (open) {
|
|
132
|
+
if (!mounted) {
|
|
133
|
+
beginEnter();
|
|
134
|
+
deps.setMounted(true);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (first && !appear) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (leg !== 1) beginEnter();
|
|
141
|
+
startLegs(1);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (!mounted) return;
|
|
145
|
+
if (leg !== 0) beginExit();
|
|
146
|
+
startLegs(0);
|
|
147
|
+
}
|
|
148
|
+
function teardown() {
|
|
149
|
+
for (const slot of slots.values()) {
|
|
150
|
+
slot.run?.abort();
|
|
151
|
+
slot.run = void 0;
|
|
152
|
+
slot.legTo = null;
|
|
153
|
+
slot.finished = false;
|
|
154
|
+
slot.pendingLeg = null;
|
|
155
|
+
}
|
|
156
|
+
leg = null;
|
|
157
|
+
inertApplied = false;
|
|
158
|
+
firstRun = true;
|
|
159
|
+
}
|
|
160
|
+
return { register, sync, teardown };
|
|
161
|
+
}
|
|
162
|
+
function usePresence(open, options = {}) {
|
|
163
|
+
const { appear = false, inert = true } = options;
|
|
164
|
+
const [mounted, setMounted] = useState(open);
|
|
165
|
+
const [state, setState] = useState("open");
|
|
166
|
+
const onEnterStart = useEventCallback(options.onEnterStart);
|
|
167
|
+
const onEnterEnd = useEventCallback(options.onEnterEnd);
|
|
168
|
+
const onExitStart = useEventCallback(options.onExitStart);
|
|
169
|
+
const onExitEnd = useEventCallback(options.onExitEnd);
|
|
170
|
+
const inertRef = useLiveRef(inert);
|
|
171
|
+
const appearRef = useLiveRef(appear);
|
|
172
|
+
const core = useConstant(
|
|
173
|
+
() => createPresenceCore({
|
|
174
|
+
setMounted,
|
|
175
|
+
setState,
|
|
176
|
+
onEnterStart,
|
|
177
|
+
onEnterEnd,
|
|
178
|
+
onExitStart,
|
|
179
|
+
onExitEnd,
|
|
180
|
+
inertRef
|
|
181
|
+
})
|
|
182
|
+
);
|
|
183
|
+
useIsomorphicLayoutEffect(() => {
|
|
184
|
+
core.sync(open, mounted, appearRef.current);
|
|
185
|
+
}, [core, appearRef, open, mounted]);
|
|
186
|
+
useIsomorphicLayoutEffect(() => core.teardown, [core]);
|
|
187
|
+
return {
|
|
188
|
+
mounted,
|
|
189
|
+
state,
|
|
190
|
+
surfaceState: state === "closing" ? "closing" : "open",
|
|
191
|
+
entering: open,
|
|
192
|
+
register: core.register
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
export {
|
|
196
|
+
usePresence
|
|
197
|
+
};
|