@wzh-/ai-chat-example 1.0.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/.vscode/extensions.json +3 -0
- package/.vscode/settings.json +6 -0
- package/README.md +5 -0
- package/auto-imports.d.ts +73 -0
- package/components.d.ts +312 -0
- package/components.json +21 -0
- package/index.html +13 -0
- package/package.json +60 -0
- package/public/vite.svg +1 -0
- package/src/App.vue +68 -0
- package/src/components/ChatConversation/ChatConversation.vue +97 -0
- package/src/components/ChatConversation/index.ts +1 -0
- package/src/components/ChatPromptInputProvider/ChatPromptInputProvider.vue +47 -0
- package/src/components/ChatPromptInputProvider/index.ts +1 -0
- package/src/components/ai-elements/artifact/Artifact.vue +23 -0
- package/src/components/ai-elements/artifact/ArtifactAction.vue +72 -0
- package/src/components/ai-elements/artifact/ArtifactActions.vue +19 -0
- package/src/components/ai-elements/artifact/ArtifactClose.vue +39 -0
- package/src/components/ai-elements/artifact/ArtifactContent.vue +20 -0
- package/src/components/ai-elements/artifact/ArtifactDescription.vue +20 -0
- package/src/components/ai-elements/artifact/ArtifactHeader.vue +23 -0
- package/src/components/ai-elements/artifact/ArtifactTitle.vue +20 -0
- package/src/components/ai-elements/artifact/index.ts +8 -0
- package/src/components/ai-elements/canvas/Canvas.vue +37 -0
- package/src/components/ai-elements/canvas/index.ts +1 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThought.vue +41 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtContent.vue +32 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtHeader.vue +43 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtImage.vue +25 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtSearchResult.vue +24 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtSearchResults.vue +17 -0
- package/src/components/ai-elements/chain-of-thought/ChainOfThoughtStep.vue +54 -0
- package/src/components/ai-elements/chain-of-thought/context.ts +22 -0
- package/src/components/ai-elements/chain-of-thought/index.ts +7 -0
- package/src/components/ai-elements/checkpoint/Checkpoint.vue +19 -0
- package/src/components/ai-elements/checkpoint/CheckpointIcon.vue +19 -0
- package/src/components/ai-elements/checkpoint/CheckpointTrigger.vue +46 -0
- package/src/components/ai-elements/checkpoint/index.ts +3 -0
- package/src/components/ai-elements/code-block/CodeBlock.vue +84 -0
- package/src/components/ai-elements/code-block/CodeBlockCopyButton.vue +84 -0
- package/src/components/ai-elements/code-block/context.ts +7 -0
- package/src/components/ai-elements/code-block/index.ts +2 -0
- package/src/components/ai-elements/code-block/utils.ts +46 -0
- package/src/components/ai-elements/confirmation/Confirmation.vue +30 -0
- package/src/components/ai-elements/confirmation/ConfirmationAccepted.vue +18 -0
- package/src/components/ai-elements/confirmation/ConfirmationAction.vue +9 -0
- package/src/components/ai-elements/confirmation/ConfirmationActions.vue +23 -0
- package/src/components/ai-elements/confirmation/ConfirmationRejected.vue +18 -0
- package/src/components/ai-elements/confirmation/ConfirmationRequest.vue +11 -0
- package/src/components/ai-elements/confirmation/ConfirmationTitle.vue +18 -0
- package/src/components/ai-elements/confirmation/context.ts +46 -0
- package/src/components/ai-elements/confirmation/index.ts +7 -0
- package/src/components/ai-elements/connection/Connection.vue +36 -0
- package/src/components/ai-elements/connection/index.ts +1 -0
- package/src/components/ai-elements/context/Context.vue +29 -0
- package/src/components/ai-elements/context/ContextCacheUsage.vue +45 -0
- package/src/components/ai-elements/context/ContextContent.vue +20 -0
- package/src/components/ai-elements/context/ContextContentBody.vue +14 -0
- package/src/components/ai-elements/context/ContextContentFooter.vue +49 -0
- package/src/components/ai-elements/context/ContextContentHeader.vue +49 -0
- package/src/components/ai-elements/context/ContextIcon.vue +62 -0
- package/src/components/ai-elements/context/ContextInputUsage.vue +46 -0
- package/src/components/ai-elements/context/ContextOutputUsage.vue +45 -0
- package/src/components/ai-elements/context/ContextReasoningUsage.vue +48 -0
- package/src/components/ai-elements/context/ContextTrigger.vue +32 -0
- package/src/components/ai-elements/context/TokensWithCost.vue +25 -0
- package/src/components/ai-elements/context/context.ts +23 -0
- package/src/components/ai-elements/context/index.ts +12 -0
- package/src/components/ai-elements/controls/Controls.vue +25 -0
- package/src/components/ai-elements/controls/index.ts +1 -0
- package/src/components/ai-elements/conversation/Conversation.vue +37 -0
- package/src/components/ai-elements/conversation/ConversationContent.vue +21 -0
- package/src/components/ai-elements/conversation/ConversationEmptyState.vue +40 -0
- package/src/components/ai-elements/conversation/ConversationScrollButton.vue +34 -0
- package/src/components/ai-elements/conversation/index.ts +4 -0
- package/src/components/ai-elements/edge/Animated.vue +91 -0
- package/src/components/ai-elements/edge/Temporary.vue +28 -0
- package/src/components/ai-elements/edge/index.ts +2 -0
- package/src/components/ai-elements/image/Image.vue +29 -0
- package/src/components/ai-elements/image/index.ts +1 -0
- package/src/components/ai-elements/inline-citation/InlineCitation.vue +14 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCard.vue +17 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCardBody.vue +15 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCardTrigger.vue +35 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarousel.vue +15 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselContent.vue +9 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselHeader.vue +16 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselIndex.vue +46 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselItem.vue +15 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselNext.vue +23 -0
- package/src/components/ai-elements/inline-citation/InlineCitationCarouselPrev.vue +23 -0
- package/src/components/ai-elements/inline-citation/InlineCitationQuote.vue +16 -0
- package/src/components/ai-elements/inline-citation/InlineCitationSource.vue +26 -0
- package/src/components/ai-elements/inline-citation/InlineCitationText.vue +14 -0
- package/src/components/ai-elements/inline-citation/index.ts +14 -0
- package/src/components/ai-elements/loader/Loader.vue +23 -0
- package/src/components/ai-elements/loader/LoaderIcon.vue +38 -0
- package/src/components/ai-elements/loader/index.ts +2 -0
- package/src/components/ai-elements/message/Message.vue +27 -0
- package/src/components/ai-elements/message/MessageAction.vue +45 -0
- package/src/components/ai-elements/message/MessageActions.vue +19 -0
- package/src/components/ai-elements/message/MessageAttachment.vue +87 -0
- package/src/components/ai-elements/message/MessageAttachments.vue +25 -0
- package/src/components/ai-elements/message/MessageAvatar.vue +22 -0
- package/src/components/ai-elements/message/MessageBranch.vue +66 -0
- package/src/components/ai-elements/message/MessageBranchContent.vue +51 -0
- package/src/components/ai-elements/message/MessageBranchNext.vue +23 -0
- package/src/components/ai-elements/message/MessageBranchPage.vue +28 -0
- package/src/components/ai-elements/message/MessageBranchPrevious.vue +23 -0
- package/src/components/ai-elements/message/MessageBranchSelector.vue +23 -0
- package/src/components/ai-elements/message/MessageContent.vue +26 -0
- package/src/components/ai-elements/message/MessageResponse.vue +42 -0
- package/src/components/ai-elements/message/MessageToolbar.vue +24 -0
- package/src/components/ai-elements/message/context.ts +22 -0
- package/src/components/ai-elements/message/index.ts +15 -0
- package/src/components/ai-elements/model-selector/ModelSelector.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorContent.vue +29 -0
- package/src/components/ai-elements/model-selector/ModelSelectorDialog.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorEmpty.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorGroup.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorInput.vue +18 -0
- package/src/components/ai-elements/model-selector/ModelSelectorItem.vue +10 -0
- package/src/components/ai-elements/model-selector/ModelSelectorList.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorLogo.vue +22 -0
- package/src/components/ai-elements/model-selector/ModelSelectorLogoGroup.vue +24 -0
- package/src/components/ai-elements/model-selector/ModelSelectorName.vue +19 -0
- package/src/components/ai-elements/model-selector/ModelSelectorSeparator.vue +7 -0
- package/src/components/ai-elements/model-selector/ModelSelectorShortcut.vue +9 -0
- package/src/components/ai-elements/model-selector/ModelSelectorTrigger.vue +9 -0
- package/src/components/ai-elements/model-selector/index.ts +14 -0
- package/src/components/ai-elements/node/Node.vue +31 -0
- package/src/components/ai-elements/node/NodeAction.vue +9 -0
- package/src/components/ai-elements/node/NodeContent.vue +15 -0
- package/src/components/ai-elements/node/NodeDescription.vue +9 -0
- package/src/components/ai-elements/node/NodeFooter.vue +15 -0
- package/src/components/ai-elements/node/NodeHeader.vue +15 -0
- package/src/components/ai-elements/node/NodeTitle.vue +9 -0
- package/src/components/ai-elements/node/index.ts +7 -0
- package/src/components/ai-elements/open-in-chat/OpenIn.vue +20 -0
- package/src/components/ai-elements/open-in-chat/OpenInContent.vue +25 -0
- package/src/components/ai-elements/open-in-chat/OpenInItemLink.vue +30 -0
- package/src/components/ai-elements/open-in-chat/OpenInTrigger.vue +16 -0
- package/src/components/ai-elements/open-in-chat/context.ts +20 -0
- package/src/components/ai-elements/open-in-chat/index.ts +9 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/ChatGPT.vue +13 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/Claude.vue +15 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/Cursor.vue +13 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/Github.vue +8 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/Scira.vue +58 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/V0.vue +15 -0
- package/src/components/ai-elements/open-in-chat/providers/icons/index.ts +6 -0
- package/src/components/ai-elements/open-in-chat/providers/index.ts +69 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInChatGPT.vue +18 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInClaude.vue +18 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInCursor.vue +18 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInScira.vue +18 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInT3.vue +18 -0
- package/src/components/ai-elements/open-in-chat/providers/items/OpenInv0.vue +18 -0
- package/src/components/ai-elements/panel/Panel.vue +28 -0
- package/src/components/ai-elements/panel/index.ts +1 -0
- package/src/components/ai-elements/plan/Plan.vue +32 -0
- package/src/components/ai-elements/plan/PlanAction.vue +9 -0
- package/src/components/ai-elements/plan/PlanContent.vue +12 -0
- package/src/components/ai-elements/plan/PlanDescription.vue +25 -0
- package/src/components/ai-elements/plan/PlanFooter.vue +9 -0
- package/src/components/ai-elements/plan/PlanHeader.vue +18 -0
- package/src/components/ai-elements/plan/PlanTitle.vue +16 -0
- package/src/components/ai-elements/plan/PlanTrigger.vue +25 -0
- package/src/components/ai-elements/plan/context.ts +20 -0
- package/src/components/ai-elements/plan/index.ts +8 -0
- package/src/components/ai-elements/prompt-input/PromptInput.vue +116 -0
- package/src/components/ai-elements/prompt-input/PromptInputActionAddAttachments.vue +22 -0
- package/src/components/ai-elements/prompt-input/PromptInputActionMenu.vue +15 -0
- package/src/components/ai-elements/prompt-input/PromptInputActionMenuContent.vue +21 -0
- package/src/components/ai-elements/prompt-input/PromptInputActionMenuItem.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputActionMenuTrigger.vue +22 -0
- package/src/components/ai-elements/prompt-input/PromptInputAttachment.vue +94 -0
- package/src/components/ai-elements/prompt-input/PromptInputAttachments.vue +22 -0
- package/src/components/ai-elements/prompt-input/PromptInputBody.vue +12 -0
- package/src/components/ai-elements/prompt-input/PromptInputButton.vue +56 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommand.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandEmpty.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandGroup.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandInput.vue +17 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandItem.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandList.vue +17 -0
- package/src/components/ai-elements/prompt-input/PromptInputCommandSeparator.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputFooter.vue +23 -0
- package/src/components/ai-elements/prompt-input/PromptInputHeader.vue +23 -0
- package/src/components/ai-elements/prompt-input/PromptInputHoverCard.vue +23 -0
- package/src/components/ai-elements/prompt-input/PromptInputHoverCardContent.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputHoverCardTrigger.vue +15 -0
- package/src/components/ai-elements/prompt-input/PromptInputProvider.vue +32 -0
- package/src/components/ai-elements/prompt-input/PromptInputSelect.vue +15 -0
- package/src/components/ai-elements/prompt-input/PromptInputSelectContent.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputSelectItem.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputSelectTrigger.vue +26 -0
- package/src/components/ai-elements/prompt-input/PromptInputSelectValue.vue +19 -0
- package/src/components/ai-elements/prompt-input/PromptInputSpeechButton.vue +137 -0
- package/src/components/ai-elements/prompt-input/PromptInputSubmit.vue +60 -0
- package/src/components/ai-elements/prompt-input/PromptInputTab.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputTabBody.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputTabItem.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputTabLabel.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputTabsList.vue +16 -0
- package/src/components/ai-elements/prompt-input/PromptInputTextarea.vue +78 -0
- package/src/components/ai-elements/prompt-input/PromptInputTools.vue +12 -0
- package/src/components/ai-elements/prompt-input/context.ts +223 -0
- package/src/components/ai-elements/prompt-input/index.ts +39 -0
- package/src/components/ai-elements/prompt-input/types.ts +28 -0
- package/src/components/ai-elements/queue/Queue.vue +21 -0
- package/src/components/ai-elements/queue/QueueItem.vue +21 -0
- package/src/components/ai-elements/queue/QueueItemAction.vue +25 -0
- package/src/components/ai-elements/queue/QueueItemActions.vue +14 -0
- package/src/components/ai-elements/queue/QueueItemAttachment.vue +14 -0
- package/src/components/ai-elements/queue/QueueItemContent.vue +32 -0
- package/src/components/ai-elements/queue/QueueItemDescription.vue +32 -0
- package/src/components/ai-elements/queue/QueueItemFile.vue +25 -0
- package/src/components/ai-elements/queue/QueueItemImage.vue +18 -0
- package/src/components/ai-elements/queue/QueueItemIndicator.vue +30 -0
- package/src/components/ai-elements/queue/QueueList.vue +22 -0
- package/src/components/ai-elements/queue/QueueSection.vue +26 -0
- package/src/components/ai-elements/queue/QueueSectionContent.vue +15 -0
- package/src/components/ai-elements/queue/QueueSectionLabel.vue +26 -0
- package/src/components/ai-elements/queue/QueueSectionTrigger.vue +25 -0
- package/src/components/ai-elements/queue/index.ts +15 -0
- package/src/components/ai-elements/reasoning/Reasoning.vue +94 -0
- package/src/components/ai-elements/reasoning/ReasoningContent.vue +41 -0
- package/src/components/ai-elements/reasoning/ReasoningTrigger.vue +61 -0
- package/src/components/ai-elements/reasoning/context.ts +19 -0
- package/src/components/ai-elements/reasoning/index.ts +3 -0
- package/src/components/ai-elements/shimmer/Shimmer.vue +69 -0
- package/src/components/ai-elements/shimmer/index.ts +1 -0
- package/src/components/ai-elements/sources/Source.vue +26 -0
- package/src/components/ai-elements/sources/Sources.vue +17 -0
- package/src/components/ai-elements/sources/SourcesContent.vue +23 -0
- package/src/components/ai-elements/sources/SourcesTrigger.vue +24 -0
- package/src/components/ai-elements/sources/index.ts +4 -0
- package/src/components/ai-elements/suggestion/Suggestion.vue +38 -0
- package/src/components/ai-elements/suggestion/Suggestions.vue +20 -0
- package/src/components/ai-elements/suggestion/index.ts +2 -0
- package/src/components/ai-elements/task/Task.vue +32 -0
- package/src/components/ai-elements/task/TaskContent.vue +27 -0
- package/src/components/ai-elements/task/TaskItem.vue +16 -0
- package/src/components/ai-elements/task/TaskItemFile.vue +18 -0
- package/src/components/ai-elements/task/TaskTrigger.vue +33 -0
- package/src/components/ai-elements/task/index.ts +5 -0
- package/src/components/ai-elements/tool/Tool.vue +18 -0
- package/src/components/ai-elements/tool/ToolContent.vue +23 -0
- package/src/components/ai-elements/tool/ToolHeader.vue +38 -0
- package/src/components/ai-elements/tool/ToolInput.vue +32 -0
- package/src/components/ai-elements/tool/ToolOutput.vue +69 -0
- package/src/components/ai-elements/tool/ToolStatusBadge.vue +63 -0
- package/src/components/ai-elements/tool/index.ts +5 -0
- package/src/components/ai-elements/toolbar/Toolbar.vue +32 -0
- package/src/components/ai-elements/toolbar/index.ts +1 -0
- package/src/components/ai-elements/web-preview/WebPreview.vue +60 -0
- package/src/components/ai-elements/web-preview/WebPreviewBody.vue +34 -0
- package/src/components/ai-elements/web-preview/WebPreviewConsole.vue +92 -0
- package/src/components/ai-elements/web-preview/WebPreviewNavigation.vue +21 -0
- package/src/components/ai-elements/web-preview/WebPreviewNavigationButton.vue +45 -0
- package/src/components/ai-elements/web-preview/WebPreviewUrl.vue +43 -0
- package/src/components/ai-elements/web-preview/context.ts +25 -0
- package/src/components/ai-elements/web-preview/index.ts +7 -0
- package/src/components/ui/alert/Alert.vue +21 -0
- package/src/components/ui/alert/AlertDescription.vue +17 -0
- package/src/components/ui/alert/AlertTitle.vue +17 -0
- package/src/components/ui/alert/index.ts +24 -0
- package/src/components/ui/avatar/Avatar.vue +18 -0
- package/src/components/ui/avatar/AvatarFallback.vue +21 -0
- package/src/components/ui/avatar/AvatarImage.vue +16 -0
- package/src/components/ui/avatar/index.ts +3 -0
- package/src/components/ui/badge/Badge.vue +26 -0
- package/src/components/ui/badge/index.ts +26 -0
- package/src/components/ui/button/Button.vue +29 -0
- package/src/components/ui/button/index.ts +38 -0
- package/src/components/ui/button-group/ButtonGroup.vue +22 -0
- package/src/components/ui/button-group/ButtonGroupSeparator.vue +24 -0
- package/src/components/ui/button-group/ButtonGroupText.vue +29 -0
- package/src/components/ui/button-group/index.ts +25 -0
- package/src/components/ui/card/Card.vue +22 -0
- package/src/components/ui/card/CardAction.vue +17 -0
- package/src/components/ui/card/CardContent.vue +17 -0
- package/src/components/ui/card/CardDescription.vue +17 -0
- package/src/components/ui/card/CardFooter.vue +17 -0
- package/src/components/ui/card/CardHeader.vue +17 -0
- package/src/components/ui/card/CardTitle.vue +17 -0
- package/src/components/ui/card/index.ts +7 -0
- package/src/components/ui/carousel/Carousel.vue +53 -0
- package/src/components/ui/carousel/CarouselContent.vue +33 -0
- package/src/components/ui/carousel/CarouselItem.vue +24 -0
- package/src/components/ui/carousel/CarouselNext.vue +41 -0
- package/src/components/ui/carousel/CarouselPrevious.vue +41 -0
- package/src/components/ui/carousel/index.ts +10 -0
- package/src/components/ui/carousel/interface.ts +26 -0
- package/src/components/ui/carousel/useCarousel.ts +56 -0
- package/src/components/ui/collapsible/Collapsible.vue +19 -0
- package/src/components/ui/collapsible/CollapsibleContent.vue +15 -0
- package/src/components/ui/collapsible/CollapsibleTrigger.vue +15 -0
- package/src/components/ui/collapsible/index.ts +3 -0
- package/src/components/ui/command/Command.vue +87 -0
- package/src/components/ui/command/CommandDialog.vue +31 -0
- package/src/components/ui/command/CommandEmpty.vue +27 -0
- package/src/components/ui/command/CommandGroup.vue +45 -0
- package/src/components/ui/command/CommandInput.vue +39 -0
- package/src/components/ui/command/CommandItem.vue +76 -0
- package/src/components/ui/command/CommandList.vue +25 -0
- package/src/components/ui/command/CommandSeparator.vue +21 -0
- package/src/components/ui/command/CommandShortcut.vue +17 -0
- package/src/components/ui/command/index.ts +25 -0
- package/src/components/ui/dialog/Dialog.vue +19 -0
- package/src/components/ui/dialog/DialogClose.vue +15 -0
- package/src/components/ui/dialog/DialogContent.vue +53 -0
- package/src/components/ui/dialog/DialogDescription.vue +23 -0
- package/src/components/ui/dialog/DialogFooter.vue +15 -0
- package/src/components/ui/dialog/DialogHeader.vue +17 -0
- package/src/components/ui/dialog/DialogOverlay.vue +21 -0
- package/src/components/ui/dialog/DialogScrollContent.vue +59 -0
- package/src/components/ui/dialog/DialogTitle.vue +23 -0
- package/src/components/ui/dialog/DialogTrigger.vue +15 -0
- package/src/components/ui/dialog/index.ts +10 -0
- package/src/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -0
- package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -0
- package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -0
- package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -0
- package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
- package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +30 -0
- package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/src/components/ui/dropdown-menu/index.ts +16 -0
- package/src/components/ui/hover-card/HoverCard.vue +19 -0
- package/src/components/ui/hover-card/HoverCardContent.vue +43 -0
- package/src/components/ui/hover-card/HoverCardTrigger.vue +15 -0
- package/src/components/ui/hover-card/index.ts +3 -0
- package/src/components/ui/input/Input.vue +33 -0
- package/src/components/ui/input/index.ts +1 -0
- package/src/components/ui/input-group/InputGroup.vue +37 -0
- package/src/components/ui/input-group/InputGroupAddon.vue +36 -0
- package/src/components/ui/input-group/InputGroupButton.vue +21 -0
- package/src/components/ui/input-group/InputGroupInput.vue +19 -0
- package/src/components/ui/input-group/InputGroupText.vue +19 -0
- package/src/components/ui/input-group/InputGroupTextarea.vue +19 -0
- package/src/components/ui/input-group/index.ts +59 -0
- package/src/components/ui/progress/Progress.vue +38 -0
- package/src/components/ui/progress/index.ts +1 -0
- package/src/components/ui/scroll-area/ScrollArea.vue +33 -0
- package/src/components/ui/scroll-area/ScrollBar.vue +32 -0
- package/src/components/ui/scroll-area/index.ts +2 -0
- package/src/components/ui/select/Select.vue +19 -0
- package/src/components/ui/select/SelectContent.vue +51 -0
- package/src/components/ui/select/SelectGroup.vue +15 -0
- package/src/components/ui/select/SelectItem.vue +44 -0
- package/src/components/ui/select/SelectItemText.vue +15 -0
- package/src/components/ui/select/SelectLabel.vue +17 -0
- package/src/components/ui/select/SelectScrollDownButton.vue +26 -0
- package/src/components/ui/select/SelectScrollUpButton.vue +26 -0
- package/src/components/ui/select/SelectSeparator.vue +19 -0
- package/src/components/ui/select/SelectTrigger.vue +33 -0
- package/src/components/ui/select/SelectValue.vue +15 -0
- package/src/components/ui/select/index.ts +11 -0
- package/src/components/ui/separator/Separator.vue +29 -0
- package/src/components/ui/separator/index.ts +1 -0
- package/src/components/ui/textarea/Textarea.vue +28 -0
- package/src/components/ui/textarea/index.ts +1 -0
- package/src/components/ui/tooltip/Tooltip.vue +19 -0
- package/src/components/ui/tooltip/TooltipContent.vue +34 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +14 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +15 -0
- package/src/components/ui/tooltip/index.ts +4 -0
- package/src/composables/useChat.ts +46 -0
- package/src/index.ts +3 -0
- package/src/lib/utils.ts +7 -0
- package/src/main.ts +5 -0
- package/src/request/index.ts +41 -0
- package/src/style.css +120 -0
- package/tsconfig.app.json +25 -0
- package/tsconfig.json +13 -0
- package/tsconfig.node.json +26 -0
- package/vite.config.ts +26 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="alert-title"
|
|
13
|
+
:class="cn('col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority"
|
|
2
|
+
import { cva } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
export { default as Alert } from "./Alert.vue"
|
|
5
|
+
export { default as AlertDescription } from "./AlertDescription.vue"
|
|
6
|
+
export { default as AlertTitle } from "./AlertTitle.vue"
|
|
7
|
+
|
|
8
|
+
export const alertVariants = cva(
|
|
9
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: "bg-card text-card-foreground",
|
|
14
|
+
destructive:
|
|
15
|
+
"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: "default",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
export type AlertVariants = VariantProps<typeof alertVariants>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { AvatarRoot } from "reka-ui"
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
class?: HTMLAttributes["class"]
|
|
8
|
+
}>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<AvatarRoot
|
|
13
|
+
data-slot="avatar"
|
|
14
|
+
:class="cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', props.class)"
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</AvatarRoot>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { AvatarFallbackProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { AvatarFallback } from "reka-ui"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const props = defineProps<AvatarFallbackProps & { class?: HTMLAttributes["class"] }>()
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<AvatarFallback
|
|
15
|
+
data-slot="avatar-fallback"
|
|
16
|
+
v-bind="delegatedProps"
|
|
17
|
+
:class="cn('bg-muted flex size-full items-center justify-center rounded-full', props.class)"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</AvatarFallback>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { AvatarImageProps } from "reka-ui"
|
|
3
|
+
import { AvatarImage } from "reka-ui"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<AvatarImageProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<AvatarImage
|
|
10
|
+
data-slot="avatar-image"
|
|
11
|
+
v-bind="props"
|
|
12
|
+
class="aspect-square size-full"
|
|
13
|
+
>
|
|
14
|
+
<slot />
|
|
15
|
+
</AvatarImage>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PrimitiveProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import type { BadgeVariants } from "."
|
|
5
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
6
|
+
import { Primitive } from "reka-ui"
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
import { badgeVariants } from "."
|
|
9
|
+
|
|
10
|
+
const props = defineProps<PrimitiveProps & {
|
|
11
|
+
variant?: BadgeVariants["variant"]
|
|
12
|
+
class?: HTMLAttributes["class"]
|
|
13
|
+
}>()
|
|
14
|
+
|
|
15
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<Primitive
|
|
20
|
+
data-slot="badge"
|
|
21
|
+
:class="cn(badgeVariants({ variant }), props.class)"
|
|
22
|
+
v-bind="delegatedProps"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</Primitive>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority"
|
|
2
|
+
import { cva } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
export { default as Badge } from "./Badge.vue"
|
|
5
|
+
|
|
6
|
+
export const badgeVariants = cva(
|
|
7
|
+
"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
13
|
+
secondary:
|
|
14
|
+
"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
15
|
+
destructive:
|
|
16
|
+
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
17
|
+
outline:
|
|
18
|
+
"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "default",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
)
|
|
26
|
+
export type BadgeVariants = VariantProps<typeof badgeVariants>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PrimitiveProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import type { ButtonVariants } from "."
|
|
5
|
+
import { Primitive } from "reka-ui"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import { buttonVariants } from "."
|
|
8
|
+
|
|
9
|
+
interface Props extends PrimitiveProps {
|
|
10
|
+
variant?: ButtonVariants["variant"]
|
|
11
|
+
size?: ButtonVariants["size"]
|
|
12
|
+
class?: HTMLAttributes["class"]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
+
as: "button",
|
|
17
|
+
})
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<Primitive
|
|
22
|
+
data-slot="button"
|
|
23
|
+
:as="as"
|
|
24
|
+
:as-child="asChild"
|
|
25
|
+
:class="cn(buttonVariants({ variant, size }), props.class)"
|
|
26
|
+
>
|
|
27
|
+
<slot />
|
|
28
|
+
</Primitive>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority"
|
|
2
|
+
import { cva } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
export { default as Button } from "./Button.vue"
|
|
5
|
+
|
|
6
|
+
export const buttonVariants = cva(
|
|
7
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
"bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
+
destructive:
|
|
14
|
+
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
15
|
+
outline:
|
|
16
|
+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
17
|
+
secondary:
|
|
18
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
19
|
+
ghost:
|
|
20
|
+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
21
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
"default": "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
25
|
+
"sm": "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
26
|
+
"lg": "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
27
|
+
"icon": "size-9",
|
|
28
|
+
"icon-sm": "size-8",
|
|
29
|
+
"icon-lg": "size-10",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
variant: "default",
|
|
34
|
+
size: "default",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
)
|
|
38
|
+
export type ButtonVariants = VariantProps<typeof buttonVariants>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import type { ButtonGroupVariants } from "."
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { buttonGroupVariants } from "."
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
class?: HTMLAttributes["class"]
|
|
9
|
+
orientation?: ButtonGroupVariants["orientation"]
|
|
10
|
+
}>()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div
|
|
15
|
+
role="group"
|
|
16
|
+
data-slot="button-group"
|
|
17
|
+
:data-orientation="props.orientation"
|
|
18
|
+
:class="cn(buttonGroupVariants({ orientation: props.orientation }), props.class)"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SeparatorProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
import { Separator } from '@/components/ui/separator'
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(defineProps<SeparatorProps & { class?: HTMLAttributes["class"] }>(), {
|
|
9
|
+
orientation: "vertical",
|
|
10
|
+
})
|
|
11
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<Separator
|
|
16
|
+
data-slot="button-group-separator"
|
|
17
|
+
v-bind="delegatedProps"
|
|
18
|
+
:orientation="props.orientation"
|
|
19
|
+
:class="cn(
|
|
20
|
+
'bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto',
|
|
21
|
+
props.class,
|
|
22
|
+
)"
|
|
23
|
+
/>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PrimitiveProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import type { ButtonGroupVariants } from "."
|
|
5
|
+
import { Primitive } from "reka-ui"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
interface Props extends PrimitiveProps {
|
|
9
|
+
class?: HTMLAttributes["class"]
|
|
10
|
+
orientation?: ButtonGroupVariants["orientation"]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
14
|
+
as: "div",
|
|
15
|
+
})
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<Primitive
|
|
20
|
+
role="group"
|
|
21
|
+
data-slot="button-group"
|
|
22
|
+
:data-orientation="props.orientation"
|
|
23
|
+
:as="as"
|
|
24
|
+
:as-child="asChild"
|
|
25
|
+
:class="cn('bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4', props.class)"
|
|
26
|
+
>
|
|
27
|
+
<slot />
|
|
28
|
+
</Primitive>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority"
|
|
2
|
+
import { cva } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
export { default as ButtonGroup } from "./ButtonGroup.vue"
|
|
5
|
+
export { default as ButtonGroupSeparator } from "./ButtonGroupSeparator.vue"
|
|
6
|
+
export { default as ButtonGroupText } from "./ButtonGroupText.vue"
|
|
7
|
+
|
|
8
|
+
export const buttonGroupVariants = cva(
|
|
9
|
+
"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
orientation: {
|
|
13
|
+
horizontal:
|
|
14
|
+
"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
15
|
+
vertical:
|
|
16
|
+
"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
orientation: "horizontal",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
export type ButtonGroupVariants = VariantProps<typeof buttonGroupVariants>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="card"
|
|
13
|
+
:class="
|
|
14
|
+
cn(
|
|
15
|
+
'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
|
|
16
|
+
props.class,
|
|
17
|
+
)
|
|
18
|
+
"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="card-action"
|
|
13
|
+
:class="cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="card-content"
|
|
13
|
+
:class="cn('px-6', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<p
|
|
12
|
+
data-slot="card-description"
|
|
13
|
+
:class="cn('text-muted-foreground text-sm', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</p>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="card-footer"
|
|
13
|
+
:class="cn('flex items-center px-6 [.border-t]:pt-6', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="card-header"
|
|
13
|
+
:class="cn('@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<h3
|
|
12
|
+
data-slot="card-title"
|
|
13
|
+
:class="cn('leading-none font-semibold', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</h3>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Card } from "./Card.vue"
|
|
2
|
+
export { default as CardAction } from "./CardAction.vue"
|
|
3
|
+
export { default as CardContent } from "./CardContent.vue"
|
|
4
|
+
export { default as CardDescription } from "./CardDescription.vue"
|
|
5
|
+
export { default as CardFooter } from "./CardFooter.vue"
|
|
6
|
+
export { default as CardHeader } from "./CardHeader.vue"
|
|
7
|
+
export { default as CardTitle } from "./CardTitle.vue"
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CarouselEmits, CarouselProps, WithClassAsProps } from "./interface"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
import { useProvideCarousel } from "./useCarousel"
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<CarouselProps & WithClassAsProps>(), {
|
|
7
|
+
orientation: "horizontal",
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const emits = defineEmits<CarouselEmits>()
|
|
11
|
+
|
|
12
|
+
const { canScrollNext, canScrollPrev, carouselApi, carouselRef, orientation, scrollNext, scrollPrev } = useProvideCarousel(props, emits)
|
|
13
|
+
|
|
14
|
+
defineExpose({
|
|
15
|
+
canScrollNext,
|
|
16
|
+
canScrollPrev,
|
|
17
|
+
carouselApi,
|
|
18
|
+
carouselRef,
|
|
19
|
+
orientation,
|
|
20
|
+
scrollNext,
|
|
21
|
+
scrollPrev,
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
25
|
+
const prevKey = props.orientation === "vertical" ? "ArrowUp" : "ArrowLeft"
|
|
26
|
+
const nextKey = props.orientation === "vertical" ? "ArrowDown" : "ArrowRight"
|
|
27
|
+
|
|
28
|
+
if (event.key === prevKey) {
|
|
29
|
+
event.preventDefault()
|
|
30
|
+
scrollPrev()
|
|
31
|
+
|
|
32
|
+
return
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (event.key === nextKey) {
|
|
36
|
+
event.preventDefault()
|
|
37
|
+
scrollNext()
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<div
|
|
44
|
+
data-slot="carousel"
|
|
45
|
+
:class="cn('relative', props.class)"
|
|
46
|
+
role="region"
|
|
47
|
+
aria-roledescription="carousel"
|
|
48
|
+
tabindex="0"
|
|
49
|
+
@keydown="onKeyDown"
|
|
50
|
+
>
|
|
51
|
+
<slot :can-scroll-next :can-scroll-prev :carousel-api :carousel-ref :orientation :scroll-next :scroll-prev />
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { WithClassAsProps } from "./interface"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
import { useCarousel } from "./useCarousel"
|
|
5
|
+
|
|
6
|
+
defineOptions({
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const props = defineProps<WithClassAsProps>()
|
|
11
|
+
|
|
12
|
+
const { carouselRef, orientation } = useCarousel()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div
|
|
17
|
+
ref="carouselRef"
|
|
18
|
+
data-slot="carousel-content"
|
|
19
|
+
class="overflow-hidden"
|
|
20
|
+
>
|
|
21
|
+
<div
|
|
22
|
+
:class="
|
|
23
|
+
cn(
|
|
24
|
+
'flex',
|
|
25
|
+
orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',
|
|
26
|
+
props.class,
|
|
27
|
+
)"
|
|
28
|
+
v-bind="$attrs"
|
|
29
|
+
>
|
|
30
|
+
<slot />
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { WithClassAsProps } from "./interface"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
import { useCarousel } from "./useCarousel"
|
|
5
|
+
|
|
6
|
+
const props = defineProps<WithClassAsProps>()
|
|
7
|
+
|
|
8
|
+
const { orientation } = useCarousel()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div
|
|
13
|
+
data-slot="carousel-item"
|
|
14
|
+
role="group"
|
|
15
|
+
aria-roledescription="slide"
|
|
16
|
+
:class="cn(
|
|
17
|
+
'min-w-0 shrink-0 grow-0 basis-full',
|
|
18
|
+
orientation === 'horizontal' ? 'pl-4' : 'pt-4',
|
|
19
|
+
props.class,
|
|
20
|
+
)"
|
|
21
|
+
>
|
|
22
|
+
<slot />
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { WithClassAsProps } from "./interface"
|
|
3
|
+
import type { ButtonVariants } from '@/components/ui/button'
|
|
4
|
+
import { ArrowRight } from "lucide-vue-next"
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
import { Button } from '@/components/ui/button'
|
|
7
|
+
import { useCarousel } from "./useCarousel"
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
variant?: ButtonVariants["variant"]
|
|
11
|
+
size?: ButtonVariants["size"]
|
|
12
|
+
}
|
|
13
|
+
& WithClassAsProps>(), {
|
|
14
|
+
variant: "outline",
|
|
15
|
+
size: "icon",
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const { orientation, canScrollNext, scrollNext } = useCarousel()
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<Button
|
|
23
|
+
data-slot="carousel-next"
|
|
24
|
+
:disabled="!canScrollNext"
|
|
25
|
+
:class="cn(
|
|
26
|
+
'absolute size-8 rounded-full',
|
|
27
|
+
orientation === 'horizontal'
|
|
28
|
+
? 'top-1/2 -right-12 -translate-y-1/2'
|
|
29
|
+
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
30
|
+
props.class,
|
|
31
|
+
)"
|
|
32
|
+
:variant="variant"
|
|
33
|
+
:size="size"
|
|
34
|
+
@click="scrollNext"
|
|
35
|
+
>
|
|
36
|
+
<slot>
|
|
37
|
+
<ArrowRight />
|
|
38
|
+
<span class="sr-only">Next Slide</span>
|
|
39
|
+
</slot>
|
|
40
|
+
</Button>
|
|
41
|
+
</template>
|