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,76 @@
|
|
|
1
|
+
import type { ElementRef } from "./dom/types.js";
|
|
2
|
+
export interface DismissableCoreOptions {
|
|
3
|
+
/** Called when the node should be dismissed. */
|
|
4
|
+
onDismiss: () => void;
|
|
5
|
+
/** Whether pressing Escape dismisses. Defaults to true. */
|
|
6
|
+
escape?: boolean;
|
|
7
|
+
/** Whether a pointerdown outside the node dismisses. Defaults to true. */
|
|
8
|
+
outsideClick?: boolean;
|
|
9
|
+
/** Elements to ignore when detecting outside clicks (e.g. a trigger button). */
|
|
10
|
+
exclude?: () => (HTMLElement | null)[];
|
|
11
|
+
/**
|
|
12
|
+
* Whether this layer is still the live one. A GETTER, not a boolean, and
|
|
13
|
+
* read fresh on every Escape and every outside pointerdown, so a layer
|
|
14
|
+
* that goes inactive stops answering without anything having to hand the
|
|
15
|
+
* core a new value first.
|
|
16
|
+
*
|
|
17
|
+
* Every overlay that animates its exit passes its `open`. The moment
|
|
18
|
+
* `open` flips false the layer stops answering Escape AND stops counting
|
|
19
|
+
* as the top layer, so a second Escape during the fade is a no-op and the
|
|
20
|
+
* dialog underneath gets it instead of having it swallowed by a panel that
|
|
21
|
+
* is already leaving. Defaults to always-active.
|
|
22
|
+
*/
|
|
23
|
+
active?: () => boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface DismissableHandle {
|
|
26
|
+
/** Swaps the options in place — the action's `update` under a new name. */
|
|
27
|
+
update(options: DismissableCoreOptions): void;
|
|
28
|
+
/** Pops this layer off the stack and detaches the document listeners. */
|
|
29
|
+
destroy(): void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Registers `node` as a dismissable layer and wires the document listeners.
|
|
33
|
+
*
|
|
34
|
+
* SSR-safe: does nothing when `document` is unavailable.
|
|
35
|
+
*/
|
|
36
|
+
export declare function attachDismissable(node: HTMLElement, opts: DismissableCoreOptions): DismissableHandle;
|
|
37
|
+
/** Test-only. Not exported from index.ts. */
|
|
38
|
+
export declare function __dismissableLayerCount(): number;
|
|
39
|
+
export interface DismissableOptions {
|
|
40
|
+
/** Called when the node should be dismissed. */
|
|
41
|
+
onDismiss: () => void;
|
|
42
|
+
/** Escape dismisses. Default true. */
|
|
43
|
+
escape?: boolean;
|
|
44
|
+
/** A pointerdown outside dismisses. Default true. */
|
|
45
|
+
outsideClick?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Elements that do not count as "outside" — typically the trigger. An
|
|
48
|
+
* array of nodes or refs, resolved at event time, or the getter form for
|
|
49
|
+
* a genuinely dynamic set.
|
|
50
|
+
*/
|
|
51
|
+
exclude?: Array<ElementRef<HTMLElement> | HTMLElement | null | undefined> | (() => (HTMLElement | null)[]);
|
|
52
|
+
/**
|
|
53
|
+
* Whether this layer is still LIVE. Pass the surface's `open`. Default true.
|
|
54
|
+
*
|
|
55
|
+
* A plain boolean where the core takes a getter: React re-renders the
|
|
56
|
+
* still-mounted exiting surface normally, so the hook can hold the current
|
|
57
|
+
* value in a live ref and hand the core a getter over it. Semantics are
|
|
58
|
+
* unchanged — a layer stays ON the stack for its whole exit and stops
|
|
59
|
+
* being TOP of it the instant `active` flips.
|
|
60
|
+
*/
|
|
61
|
+
active?: boolean;
|
|
62
|
+
/** Whether the layer is registered at all. Default true. */
|
|
63
|
+
enabled?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Dismissable behaviour for `node`.
|
|
67
|
+
*
|
|
68
|
+
* Returns nothing: this hook owns behaviour, not state — nothing it does is
|
|
69
|
+
* rendered, so neither `useState` nor `useSyncExternalStore` has any part in
|
|
70
|
+
* it.
|
|
71
|
+
*
|
|
72
|
+
* A passive effect, not a layout one: the layer push and the two document
|
|
73
|
+
* listeners are invisible in the first painted frame, and no key can be
|
|
74
|
+
* pressed before they land.
|
|
75
|
+
*/
|
|
76
|
+
export declare function useDismissable(node: HTMLElement | null, options: DismissableOptions): void;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useRef, useEffect } from "react";
|
|
3
|
+
import { useEventCallback } from "./dom/use-event-callback.js";
|
|
4
|
+
import { useLiveRef } from "./dom/use-live-ref.js";
|
|
5
|
+
const layers = [];
|
|
6
|
+
function attachDismissable(node, opts) {
|
|
7
|
+
if (typeof document === "undefined") {
|
|
8
|
+
return { update() {
|
|
9
|
+
}, destroy() {
|
|
10
|
+
} };
|
|
11
|
+
}
|
|
12
|
+
let onDismiss = opts.onDismiss;
|
|
13
|
+
let escape = opts.escape ?? true;
|
|
14
|
+
let outsideClick = opts.outsideClick ?? true;
|
|
15
|
+
let exclude = opts.exclude;
|
|
16
|
+
let isActive = opts.active ?? (() => true);
|
|
17
|
+
function isTopLayer() {
|
|
18
|
+
for (let i = layers.length - 1; i >= 0; i -= 1) {
|
|
19
|
+
const candidate = layers[i];
|
|
20
|
+
if (candidate.isActive()) return candidate.node === node;
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
function handleKeydown(event) {
|
|
25
|
+
if (!isActive()) return;
|
|
26
|
+
if (!escape) return;
|
|
27
|
+
if (event.key !== "Escape") return;
|
|
28
|
+
if (!isTopLayer()) return;
|
|
29
|
+
event.stopImmediatePropagation();
|
|
30
|
+
onDismiss();
|
|
31
|
+
}
|
|
32
|
+
function handlePointerdown(event) {
|
|
33
|
+
if (!isActive()) return;
|
|
34
|
+
if (!outsideClick) return;
|
|
35
|
+
if (!isTopLayer()) return;
|
|
36
|
+
const target = event.target;
|
|
37
|
+
if (!target || node.contains(target)) return;
|
|
38
|
+
const excluded = exclude?.() ?? [];
|
|
39
|
+
if (excluded.some((el) => el?.contains(target))) return;
|
|
40
|
+
onDismiss();
|
|
41
|
+
}
|
|
42
|
+
const layer = { node, isActive: () => isActive() };
|
|
43
|
+
layers.push(layer);
|
|
44
|
+
document.addEventListener("keydown", handleKeydown);
|
|
45
|
+
document.addEventListener("pointerdown", handlePointerdown);
|
|
46
|
+
return {
|
|
47
|
+
update(newOpts) {
|
|
48
|
+
onDismiss = newOpts.onDismiss;
|
|
49
|
+
escape = newOpts.escape ?? true;
|
|
50
|
+
outsideClick = newOpts.outsideClick ?? true;
|
|
51
|
+
exclude = newOpts.exclude;
|
|
52
|
+
isActive = newOpts.active ?? (() => true);
|
|
53
|
+
},
|
|
54
|
+
destroy() {
|
|
55
|
+
const i = layers.indexOf(layer);
|
|
56
|
+
if (i !== -1) layers.splice(i, 1);
|
|
57
|
+
document.removeEventListener("keydown", handleKeydown);
|
|
58
|
+
document.removeEventListener("pointerdown", handlePointerdown);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function useDismissable(node, options) {
|
|
63
|
+
const { escape = true, outsideClick = true, active = true, enabled = true } = options;
|
|
64
|
+
const onDismiss = useEventCallback(options.onDismiss);
|
|
65
|
+
const activeRef = useLiveRef(active);
|
|
66
|
+
const excludeRef = useLiveRef(options.exclude);
|
|
67
|
+
const escapeRef = useLiveRef(escape);
|
|
68
|
+
const outsideClickRef = useLiveRef(outsideClick);
|
|
69
|
+
const getActive = useCallback(() => activeRef.current, [activeRef]);
|
|
70
|
+
const getExclude = useCallback(() => {
|
|
71
|
+
const exclude = excludeRef.current;
|
|
72
|
+
if (!exclude) return [];
|
|
73
|
+
if (typeof exclude === "function") return exclude();
|
|
74
|
+
return exclude.map((entry) => entry && "current" in entry ? entry.current : entry ?? null);
|
|
75
|
+
}, [excludeRef]);
|
|
76
|
+
const handleRef = useRef(null);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (!node || !enabled) return;
|
|
79
|
+
const handle = attachDismissable(node, {
|
|
80
|
+
onDismiss,
|
|
81
|
+
escape: escapeRef.current,
|
|
82
|
+
outsideClick: outsideClickRef.current,
|
|
83
|
+
exclude: getExclude,
|
|
84
|
+
active: getActive
|
|
85
|
+
});
|
|
86
|
+
handleRef.current = handle;
|
|
87
|
+
return () => {
|
|
88
|
+
handleRef.current = null;
|
|
89
|
+
handle.destroy();
|
|
90
|
+
};
|
|
91
|
+
}, [node, enabled, onDismiss, getActive, getExclude, escapeRef, outsideClickRef]);
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
handleRef.current?.update({
|
|
94
|
+
onDismiss,
|
|
95
|
+
escape,
|
|
96
|
+
outsideClick,
|
|
97
|
+
exclude: getExclude,
|
|
98
|
+
active: getActive
|
|
99
|
+
});
|
|
100
|
+
}, [escape, outsideClick, onDismiss, getActive, getExclude]);
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
attachDismissable,
|
|
104
|
+
useDismissable
|
|
105
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Provider } from "react";
|
|
2
|
+
export interface InternalContext<T> {
|
|
3
|
+
Provider: Provider<T | undefined>;
|
|
4
|
+
useRequired: () => T;
|
|
5
|
+
useOptional: () => T | undefined;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A typed context plus its two readers. `useRequired` throws a named error outside its
|
|
9
|
+
* provider (the compound-component contract); `useOptional` returns `undefined` (the
|
|
10
|
+
* degrade-gracefully contract — a field reader with no field, a group item outside its
|
|
11
|
+
* group).
|
|
12
|
+
*
|
|
13
|
+
* A context VALUE is a plain object rebuilt when its scalar inputs change, and the
|
|
14
|
+
* rebuild is what makes consumers re-render. Never wrap one in `useMemo(..., [])`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createInternalContext<T>(displayName: string): InternalContext<T>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
function createInternalContext(displayName) {
|
|
4
|
+
const Context = createContext(void 0);
|
|
5
|
+
Context.displayName = displayName;
|
|
6
|
+
function useRequired() {
|
|
7
|
+
const value = useContext(Context);
|
|
8
|
+
if (value === void 0) {
|
|
9
|
+
throw new Error(`${displayName} is missing: this component must be rendered inside its provider.`);
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
function useOptional() {
|
|
14
|
+
return useContext(Context);
|
|
15
|
+
}
|
|
16
|
+
return { Provider: Context.Provider, useRequired, useOptional };
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
createInternalContext
|
|
20
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* `useLayoutEffect` in the browser, `useEffect` on the server. Everything whose
|
|
4
|
+
* absence is visible in the first painted frame — position, focus, scroll lock, a
|
|
5
|
+
* transition leg — runs through this.
|
|
6
|
+
*
|
|
7
|
+
* The branch is taken once at module scope, never in a render path, so it costs
|
|
8
|
+
* nothing per render and cannot desynchronise a hydration.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
11
|
+
/**
|
|
12
|
+
* `false` on the server AND during the hydration render, `true` from the first
|
|
13
|
+
* post-hydration render on. useSyncExternalStore, not useState+useEffect: no extra
|
|
14
|
+
* commit, and tear-free under concurrent rendering.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useIsHydrated(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Lazily create a per-instance value exactly once. StrictMode-safe only because every
|
|
19
|
+
* `create*` factory in this contract is allocation-only — no listeners, no timers.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useConstant<T>(create: () => T): T;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLayoutEffect, useEffect, useRef, useSyncExternalStore } from "react";
|
|
3
|
+
const useIsomorphicLayoutEffect = typeof document !== "undefined" ? useLayoutEffect : useEffect;
|
|
4
|
+
const emptySubscribe = () => () => {
|
|
5
|
+
};
|
|
6
|
+
const getSnapshot = () => true;
|
|
7
|
+
const getServerSnapshot = () => false;
|
|
8
|
+
function useIsHydrated() {
|
|
9
|
+
return useSyncExternalStore(emptySubscribe, getSnapshot, getServerSnapshot);
|
|
10
|
+
}
|
|
11
|
+
const UNSET = /* @__PURE__ */ Symbol("useConstant.unset");
|
|
12
|
+
function useConstant(create) {
|
|
13
|
+
const ref = useRef(UNSET);
|
|
14
|
+
if (ref.current === UNSET) ref.current = create();
|
|
15
|
+
return ref.current;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
useConstant,
|
|
19
|
+
useIsHydrated,
|
|
20
|
+
useIsomorphicLayoutEffect
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural ref type. NOT React.RefObject / React.MutableRefObject: those changed
|
|
3
|
+
* shape between @types/react 18 and 19 (19 dropped the mutable/readonly split), and
|
|
4
|
+
* this package's peer range is `^18 || ^19`. A structural type is assignable from
|
|
5
|
+
* every variant either version emits.
|
|
6
|
+
*/
|
|
7
|
+
export type ElementRef<T extends Element = HTMLElement> = {
|
|
8
|
+
readonly current: T | null;
|
|
9
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Ref, RefCallback } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Non-hook form, for use inside an existing callback ref.
|
|
4
|
+
*
|
|
5
|
+
* Returns the cleanup a React 19 callback ref may hand back, or `undefined`.
|
|
6
|
+
* React 19 runs that cleanup on detach INSTEAD of calling the ref with
|
|
7
|
+
* `null`, so a composer that swallowed the return value would silently drop
|
|
8
|
+
* the consumer's teardown. React 18 has no such channel and ignores whatever
|
|
9
|
+
* a callback ref returns — which is why the value is passed on rather than
|
|
10
|
+
* acted upon here, and why every caller must still be able to cope with a
|
|
11
|
+
* plain `assignRef(ref, null)` detach.
|
|
12
|
+
*/
|
|
13
|
+
export declare function assignRef<T>(ref: Ref<T> | undefined | null, node: T | null): (() => void) | undefined;
|
|
14
|
+
/** Merges any number of refs into one callback ref. Skips nullish entries. */
|
|
15
|
+
export declare function useComposedRefs<T>(...refs: Array<Ref<T> | undefined | null>): RefCallback<T>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef, useCallback } from "react";
|
|
3
|
+
function assignRef(ref, node) {
|
|
4
|
+
if (typeof ref === "function") {
|
|
5
|
+
const cleanup = ref(node);
|
|
6
|
+
return typeof cleanup === "function" ? cleanup : void 0;
|
|
7
|
+
}
|
|
8
|
+
if (ref) ref.current = node;
|
|
9
|
+
return void 0;
|
|
10
|
+
}
|
|
11
|
+
function useComposedRefs(...refs) {
|
|
12
|
+
const pending = useRef(null);
|
|
13
|
+
const detach = useCallback(() => {
|
|
14
|
+
const cleanups = pending.current;
|
|
15
|
+
pending.current = null;
|
|
16
|
+
if (!cleanups) return;
|
|
17
|
+
for (const cleanup of cleanups) cleanup();
|
|
18
|
+
}, []);
|
|
19
|
+
return useCallback(
|
|
20
|
+
(node) => {
|
|
21
|
+
detach();
|
|
22
|
+
if (node === null) return;
|
|
23
|
+
pending.current = refs.map((ref) => {
|
|
24
|
+
const cleanup = assignRef(ref, node);
|
|
25
|
+
return cleanup ?? (() => assignRef(ref, null));
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
[...refs, detach]
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
assignRef,
|
|
33
|
+
useComposedRefs
|
|
34
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RefCallback } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The node, and the callback ref that publishes it. THE way a component hands an
|
|
4
|
+
* element to an internals hook (convention C-1).
|
|
5
|
+
*
|
|
6
|
+
* Returns state, not a ref, so a hook keyed on `[node]` re-runs the moment the node
|
|
7
|
+
* appears — which is the only correct behaviour for a node whose existence is
|
|
8
|
+
* conditional (a presence-mounted panel, an `{#if}`-equivalent branch). The setter
|
|
9
|
+
* identity is stable for the life of the component.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useElementRef<T extends Element = HTMLElement>(): [T | null, RefCallback<T>];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState, useCallback } from "react";
|
|
3
|
+
function useElementRef() {
|
|
4
|
+
const [node, setNode] = useState(null);
|
|
5
|
+
const ref = useCallback((next) => {
|
|
6
|
+
setNode(next);
|
|
7
|
+
}, []);
|
|
8
|
+
return [node, ref];
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
useElementRef
|
|
12
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A permanently identity-stable wrapper that always calls the most recent `fn`.
|
|
3
|
+
* `undefined` yields a stable no-op returning `undefined`.
|
|
4
|
+
*
|
|
5
|
+
* The ref is written inside `useInsertionEffect`, NOT during render. Insertion effects
|
|
6
|
+
* run before every layout effect, so a listener always sees the current callback, and
|
|
7
|
+
* a concurrent render that React throws away can never publish a stale one. This is
|
|
8
|
+
* the React counterpart of the getter-object call sites the Svelte sources use.
|
|
9
|
+
*
|
|
10
|
+
* Every `on*` option on every internals hook goes through this. It is also why
|
|
11
|
+
* anchor-position's `newOpts.onPlacement !== options.onPlacement` reset branch is
|
|
12
|
+
* unreachable from the hook path: the identity never changes.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useEventCallback<A extends unknown[], R>(fn: ((...args: A) => R) | undefined): (...args: A) => R | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef, useInsertionEffect, useCallback } from "react";
|
|
3
|
+
function useEventCallback(fn) {
|
|
4
|
+
const ref = useRef(fn);
|
|
5
|
+
useInsertionEffect(() => {
|
|
6
|
+
ref.current = fn;
|
|
7
|
+
}, [fn]);
|
|
8
|
+
return useCallback((...args) => ref.current?.(...args), []);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
useEventCallback
|
|
12
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RefCallback } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Keeps the `inert` ATTRIBUTE on an element in sync with a boolean, imperatively.
|
|
4
|
+
*
|
|
5
|
+
* Not a JSX prop, because there is no spelling of one that works across this
|
|
6
|
+
* package's peer range: `inert={true}` is dropped with a warning by React 18
|
|
7
|
+
* (which knows no such attribute and refuses to guess), and `inert=""` is
|
|
8
|
+
* rejected by React 19 (which knows it as a boolean). The attribute itself is
|
|
9
|
+
* what `:not([inert])` selectors and assistive technology key on, so it is
|
|
10
|
+
* written straight to the node instead — one mechanism, identical output on 18
|
|
11
|
+
* and 19.
|
|
12
|
+
*
|
|
13
|
+
* The returned callback ref is identity-stable, so React never detaches and
|
|
14
|
+
* reattaches it; it applies the current value the instant a node arrives (which
|
|
15
|
+
* is what covers a node that REMOUNTS while the flag is unchanged), and the
|
|
16
|
+
* layout effect applies every later change to the node already held. Layout, not
|
|
17
|
+
* passive: inertness that lands a frame late is a frame in which a collapsed
|
|
18
|
+
* region is still clickable and still reachable by Tab.
|
|
19
|
+
*
|
|
20
|
+
* Compose it with `useComposedRefs` when the element already has a ref.
|
|
21
|
+
*
|
|
22
|
+
* SSR: an element is never inert in the server HTML — an attribute this hook
|
|
23
|
+
* writes at commit cannot exist before hydration. Divergence from the Svelte
|
|
24
|
+
* source, which SSRs `inert` inline; observable only in the pre-hydration frame.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useInertAttribute<T extends Element = HTMLElement>(inert: boolean): RefCallback<T>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef, useCallback } from "react";
|
|
3
|
+
import { useIsomorphicLayoutEffect } from "./ssr.js";
|
|
4
|
+
import { useLiveRef } from "./use-live-ref.js";
|
|
5
|
+
function useInertAttribute(inert) {
|
|
6
|
+
const nodeRef = useRef(null);
|
|
7
|
+
const inertRef = useLiveRef(inert);
|
|
8
|
+
const ref = useCallback(
|
|
9
|
+
(node) => {
|
|
10
|
+
nodeRef.current = node;
|
|
11
|
+
if (node) node.toggleAttribute("inert", inertRef.current);
|
|
12
|
+
},
|
|
13
|
+
[inertRef]
|
|
14
|
+
);
|
|
15
|
+
useIsomorphicLayoutEffect(() => {
|
|
16
|
+
nodeRef.current?.toggleAttribute("inert", inert);
|
|
17
|
+
}, [inert]);
|
|
18
|
+
return ref;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
useInertAttribute
|
|
22
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A read-only ref mirroring `value`, written in `useInsertionEffect` for the same
|
|
3
|
+
* reason as `useEventCallback`. The React counterpart of a Svelte getter for a
|
|
4
|
+
* NON-callback value: a long-lived closure (a document listener, an observer
|
|
5
|
+
* callback, a stack entry) reads `ref.current` and sees the latest render's value
|
|
6
|
+
* without being rebuilt.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useLiveRef<T>(value: T): {
|
|
9
|
+
readonly current: T;
|
|
10
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contract between a FormField and whatever control it wraps.
|
|
3
|
+
*
|
|
4
|
+
* `FormField` owns the id, the label/help/error wiring and the required/
|
|
5
|
+
* disabled flags; every control in this wave (Input, Textarea, Checkbox, ...)
|
|
6
|
+
* reads all of that through `useField()` instead of a caller threading ids
|
|
7
|
+
* and aria attributes by hand. A control mounted outside a `FormField`
|
|
8
|
+
* degrades to `undefined` — it must still work standalone, falling back to
|
|
9
|
+
* its own props, exactly like `ToggleGroupItem` degrades outside a
|
|
10
|
+
* `ToggleGroup`.
|
|
11
|
+
*
|
|
12
|
+
* `FieldContext` below is the frozen surface every other component in this
|
|
13
|
+
* wave was built against — its shape must not change. `createFieldState` is
|
|
14
|
+
* this file's own implementation detail: what `FormField` actually
|
|
15
|
+
* constructs and publishes, and the only thing that changes if the wiring
|
|
16
|
+
* inside `describedBy` ever needs to change.
|
|
17
|
+
*/
|
|
18
|
+
import type { ReactNode } from "react";
|
|
19
|
+
/** What a `FormField` publishes to the control (and `Label`) it wraps. */
|
|
20
|
+
export interface FieldContext {
|
|
21
|
+
/**
|
|
22
|
+
* The id the labelled control must carry. Pair it with a native
|
|
23
|
+
* `for`/`id` association — only meaningful for a control whose *root* is
|
|
24
|
+
* one of the elements `<label for>` can target (button, input, meter,
|
|
25
|
+
* output, progress, select, textarea). A control whose root is anything
|
|
26
|
+
* else (a `<div role="radiogroup">`, say) must use `labelId` below
|
|
27
|
+
* instead — `for` cannot reach it, ARIA role or not.
|
|
28
|
+
*/
|
|
29
|
+
readonly controlId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Id of the rendered `<label>` element, for a control whose root is not
|
|
32
|
+
* one `for` can target — point that control's own `aria-labelledby` at
|
|
33
|
+
* this instead. `undefined` when `FormField` renders no label of its
|
|
34
|
+
* own (no `label` prop given). Optional for the same reason `valid` is —
|
|
35
|
+
* see its doc comment.
|
|
36
|
+
*/
|
|
37
|
+
readonly labelId?: string;
|
|
38
|
+
/** Space-joined ids of whichever help and error text are actually rendered, or undefined. */
|
|
39
|
+
readonly describedBy: string | undefined;
|
|
40
|
+
readonly invalid: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the field is explicitly marked as passing validation. Never
|
|
43
|
+
* `true` while `invalid` is `true` — a control that reads both should
|
|
44
|
+
* still treat them as mutually exclusive, but this is the authority on
|
|
45
|
+
* that, not an assumption a control has to make itself.
|
|
46
|
+
*
|
|
47
|
+
* Optional, not required: this was added after four other builders had
|
|
48
|
+
* already coded their own controls, harnesses and hand-built
|
|
49
|
+
* `FieldContext` object literals against the original five-field shape.
|
|
50
|
+
* Making it required would have been a breaking change to a contract
|
|
51
|
+
* that was frozen out from under them — every one of those literals
|
|
52
|
+
* would fail to type-check the moment this file changed, with none of
|
|
53
|
+
* their own files touched to explain why. Optional keeps every existing
|
|
54
|
+
* literal valid as-is; `createFieldState`'s own output always populates
|
|
55
|
+
* it, so `FormField` itself never has to treat it as absent — only a
|
|
56
|
+
* hand-built context that predates this field does, and `undefined`
|
|
57
|
+
* there reads the same as `false` to a `field?.valid ?? false` consumer.
|
|
58
|
+
*/
|
|
59
|
+
readonly valid?: boolean;
|
|
60
|
+
readonly required: boolean;
|
|
61
|
+
readonly disabled: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Inputs `createFieldState` builds a `FieldContext` from. Every entry is a
|
|
65
|
+
* plain value, where the Svelte source takes a getter: React re-renders
|
|
66
|
+
* `FormField` when any of these nine change, and the rebuilt context object
|
|
67
|
+
* is what makes the controls below it re-render. A getter would buy nothing
|
|
68
|
+
* here and would defeat the `useMemo` dependency array documented on
|
|
69
|
+
* `createFieldState`.
|
|
70
|
+
*/
|
|
71
|
+
export interface FieldStateOptions {
|
|
72
|
+
/** The id to publish as `controlId`. */
|
|
73
|
+
controlId: string;
|
|
74
|
+
/** The id to publish as `labelId`, or undefined while no label is rendered. */
|
|
75
|
+
labelId: string | undefined;
|
|
76
|
+
/** The id the help paragraph carries while it is rendered. */
|
|
77
|
+
descriptionId: string;
|
|
78
|
+
/** The id the error paragraph carries while it is rendered. */
|
|
79
|
+
errorId: string;
|
|
80
|
+
/** Whether the help paragraph is currently rendered. */
|
|
81
|
+
hasDescription: boolean;
|
|
82
|
+
/** Whether the error paragraph is currently rendered. */
|
|
83
|
+
hasError: boolean;
|
|
84
|
+
/** Whether the field is explicitly marked valid. The caller decides how this interacts with `hasError` — see `valid`'s own doc comment on `FieldContext`. */
|
|
85
|
+
valid: boolean;
|
|
86
|
+
required: boolean;
|
|
87
|
+
disabled: boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Builds the object `FormField` publishes through `<FieldProvider value={...}>`.
|
|
91
|
+
*
|
|
92
|
+
* `describedBy` is derived, not registered: it is computed from
|
|
93
|
+
* `hasDescription`/`hasError`, the same two flags `FormField`'s own
|
|
94
|
+
* conditionals gate the help/error paragraphs on. That is what keeps the id
|
|
95
|
+
* list honest — a described-by id only ever appears while the element it
|
|
96
|
+
* points at is actually in the DOM, because both are driven by the exact
|
|
97
|
+
* same read, in the exact same render pass. A separate mount/unmount
|
|
98
|
+
* registration written into state would add a step between "the paragraph is
|
|
99
|
+
* in the DOM" and "the id is in the list" — and that step runs inside
|
|
100
|
+
* `useEffect`, which never fires during SSR, so the very first paint would
|
|
101
|
+
* carry the paragraph without the attribute pointing at it. Deriving
|
|
102
|
+
* directly avoids that entirely: `describedBy` is exactly as correct on the
|
|
103
|
+
* server-rendered HTML as it is after hydration.
|
|
104
|
+
*
|
|
105
|
+
* Pure and framework-free, so `FormField` calls it from a `useMemo` keyed on
|
|
106
|
+
* the nine scalars — a field-by-field dependency array, never the options
|
|
107
|
+
* object, so the identity is stable across unrelated parent re-renders and
|
|
108
|
+
* changes exactly when a consumer must re-render:
|
|
109
|
+
*
|
|
110
|
+
* ```ts
|
|
111
|
+
* const field = useMemo(
|
|
112
|
+
* () => createFieldState({ controlId, labelId, descriptionId, errorId,
|
|
113
|
+
* hasDescription, hasError, valid, required, disabled }),
|
|
114
|
+
* [controlId, labelId, descriptionId, errorId, hasDescription, hasError, valid, required, disabled]
|
|
115
|
+
* );
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
export declare function createFieldState(options: FieldStateOptions): FieldContext;
|
|
119
|
+
/**
|
|
120
|
+
* The context `FormField` publishes under. Consumers read it only via
|
|
121
|
+
* `useField()`.
|
|
122
|
+
*
|
|
123
|
+
* Its default is `undefined`, which is the whole "no FormField above me"
|
|
124
|
+
* case: a control outside a provider reads back exactly what a provider that
|
|
125
|
+
* published `undefined` would have given it.
|
|
126
|
+
*/
|
|
127
|
+
export declare const FieldReactContext: import("react").Context<FieldContext | undefined>;
|
|
128
|
+
export interface FieldProviderProps {
|
|
129
|
+
/** The context object, built by `createFieldState`. */
|
|
130
|
+
value: FieldContext;
|
|
131
|
+
children?: ReactNode;
|
|
132
|
+
}
|
|
133
|
+
/** Publishes a `FieldContext` to every control rendered beneath it. */
|
|
134
|
+
export declare function FieldProvider({ value, children }: FieldProviderProps): ReactNode;
|
|
135
|
+
/** Returns the surrounding FormField's context, or undefined when there is none. */
|
|
136
|
+
export declare function useField(): FieldContext | undefined;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useContext, createContext, createElement } from "react";
|
|
3
|
+
function createFieldState(options) {
|
|
4
|
+
const ids = [];
|
|
5
|
+
if (options.hasDescription) ids.push(options.descriptionId);
|
|
6
|
+
if (options.hasError) ids.push(options.errorId);
|
|
7
|
+
return {
|
|
8
|
+
controlId: options.controlId,
|
|
9
|
+
labelId: options.labelId,
|
|
10
|
+
describedBy: ids.length > 0 ? ids.join(" ") : void 0,
|
|
11
|
+
invalid: options.hasError,
|
|
12
|
+
// Enforced here, not trusted from the caller: `hasError` always wins,
|
|
13
|
+
// so a control reading `field.valid` never has to also check
|
|
14
|
+
// `field.invalid` itself to get the "error still wins" rule right.
|
|
15
|
+
valid: options.valid && !options.hasError,
|
|
16
|
+
required: options.required,
|
|
17
|
+
disabled: options.disabled
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const FieldReactContext = createContext(void 0);
|
|
21
|
+
FieldReactContext.displayName = "FieldContext";
|
|
22
|
+
function FieldProvider({ value, children }) {
|
|
23
|
+
return createElement(FieldReactContext.Provider, { value }, children);
|
|
24
|
+
}
|
|
25
|
+
function useField() {
|
|
26
|
+
return useContext(FieldReactContext);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
FieldProvider,
|
|
30
|
+
FieldReactContext,
|
|
31
|
+
createFieldState,
|
|
32
|
+
useField
|
|
33
|
+
};
|