@slexn/codecenter-ui 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/LICENSE +34 -0
- package/README.md +148 -0
- package/components.json +20 -0
- package/dist/codecenter-ui.cjs +10 -0
- package/dist/codecenter-ui.js +17995 -0
- package/dist/components/ui/accordion/Accordion.vue.d.ts +28 -0
- package/dist/components/ui/accordion/AccordionContent.vue.d.ts +22 -0
- package/dist/components/ui/accordion/AccordionItem.vue.d.ts +24 -0
- package/dist/components/ui/accordion/AccordionTrigger.vue.d.ts +22 -0
- package/dist/components/ui/accordion/index.d.ts +4 -0
- package/dist/components/ui/alert/Alert.vue.d.ts +32 -0
- package/dist/components/ui/alert/AlertDescription.vue.d.ts +24 -0
- package/dist/components/ui/alert/AlertTitle.vue.d.ts +24 -0
- package/dist/components/ui/alert/index.d.ts +4 -0
- package/dist/components/ui/alert/variants.d.ts +5 -0
- package/dist/components/ui/button/Button.vue.d.ts +27 -0
- package/dist/components/ui/button/index.d.ts +2 -0
- package/dist/components/ui/button/variants.d.ts +6 -0
- package/dist/components/ui/button-group/ButtonGroup.vue.d.ts +25 -0
- package/dist/components/ui/button-group/index.d.ts +2 -0
- package/dist/components/ui/card/Card.vue.d.ts +21 -0
- package/dist/components/ui/card/CardContent.vue.d.ts +21 -0
- package/dist/components/ui/card/CardDescription.vue.d.ts +21 -0
- package/dist/components/ui/card/CardFooter.vue.d.ts +21 -0
- package/dist/components/ui/card/CardHeader.vue.d.ts +21 -0
- package/dist/components/ui/card/CardTitle.vue.d.ts +21 -0
- package/dist/components/ui/card/index.d.ts +6 -0
- package/dist/components/ui/chart/Chart.vue.d.ts +92 -0
- package/dist/components/ui/chart/index.d.ts +2 -0
- package/dist/components/ui/chat/Chat.vue.d.ts +190 -0
- package/dist/components/ui/chat/ChatAttachments.vue.d.ts +11 -0
- package/dist/components/ui/chat/ChatCodeBlock.vue.d.ts +16 -0
- package/dist/components/ui/chat/code-block.d.ts +27 -0
- package/dist/components/ui/chat/index.d.ts +6 -0
- package/dist/components/ui/chat/types.d.ts +15 -0
- package/dist/components/ui/checkbox/Checkbox.vue.d.ts +29 -0
- package/dist/components/ui/checkbox/index.d.ts +1 -0
- package/dist/components/ui/commit/Commit.vue.d.ts +62 -0
- package/dist/components/ui/commit/index.d.ts +2 -0
- package/dist/components/ui/contribution-graph/ContributionGraph.vue.d.ts +87 -0
- package/dist/components/ui/contribution-graph/index.d.ts +2 -0
- package/dist/components/ui/data-table/DataTable.vue.d.ts +109 -0
- package/dist/components/ui/data-table/index.d.ts +2 -0
- package/dist/components/ui/date-picker/DatePicker.vue.d.ts +37 -0
- package/dist/components/ui/date-picker/index.d.ts +2 -0
- package/dist/components/ui/dialog/Dialog.vue.d.ts +25 -0
- package/dist/components/ui/dialog/DialogClose.vue.d.ts +18 -0
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +39 -0
- package/dist/components/ui/dialog/DialogDescription.vue.d.ts +22 -0
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts +21 -0
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts +21 -0
- package/dist/components/ui/dialog/DialogOverlay.vue.d.ts +22 -0
- package/dist/components/ui/dialog/DialogScrollContent.vue.d.ts +36 -0
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts +22 -0
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +18 -0
- package/dist/components/ui/dialog/index.d.ts +10 -0
- package/dist/components/ui/diff/DiffTool.vue.d.ts +21 -0
- package/dist/components/ui/diff/diff-parser.d.ts +30 -0
- package/dist/components/ui/diff/diff-tool.d.ts +36 -0
- package/dist/components/ui/diff/index.d.ts +2 -0
- package/dist/components/ui/dropdown-menu/DropdownMenu.vue.d.ts +24 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue.d.ts +29 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuContent.vue.d.ts +36 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuGroup.vue.d.ts +18 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuItem.vue.d.ts +26 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuLabel.vue.d.ts +23 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue.d.ts +22 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuRadioItem.vue.d.ts +27 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSeparator.vue.d.ts +7 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuShortcut.vue.d.ts +21 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSub.vue.d.ts +22 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +38 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +23 -0
- package/dist/components/ui/dropdown-menu/DropdownMenuTrigger.vue.d.ts +18 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +15 -0
- package/dist/components/ui/gauge/Gauge.vue.d.ts +62 -0
- package/dist/components/ui/gauge/index.d.ts +2 -0
- package/dist/components/ui/git-graph/GitGraph.vue.d.ts +59 -0
- package/dist/components/ui/git-graph/index.d.ts +2 -0
- package/dist/components/ui/incident-timeline/IncidentTimeline.vue.d.ts +50 -0
- package/dist/components/ui/incident-timeline/index.d.ts +2 -0
- package/dist/components/ui/input/Input.vue.d.ts +14 -0
- package/dist/components/ui/input/InputControl.vue.d.ts +14 -0
- package/dist/components/ui/input/InputFieldGroup.vue.d.ts +21 -0
- package/dist/components/ui/input/index.d.ts +4 -0
- package/dist/components/ui/input/types.d.ts +31 -0
- package/dist/components/ui/kpi-card/KpiCard.vue.d.ts +46 -0
- package/dist/components/ui/kpi-card/index.d.ts +2 -0
- package/dist/components/ui/kpi-line-card/KpiLineCard.vue.d.ts +66 -0
- package/dist/components/ui/kpi-line-card/index.d.ts +2 -0
- package/dist/components/ui/model-selector/ModelSelector.vue.d.ts +41 -0
- package/dist/components/ui/model-selector/index.d.ts +2 -0
- package/dist/components/ui/model-selector/types.d.ts +12 -0
- package/dist/components/ui/network-graph/NetworkGraph.vue.d.ts +75 -0
- package/dist/components/ui/network-graph/index.d.ts +2 -0
- package/dist/components/ui/pagination/Pagination.vue.d.ts +29 -0
- package/dist/components/ui/pagination/PaginationContent.vue.d.ts +29 -0
- package/dist/components/ui/pagination/PaginationEllipsis.vue.d.ts +22 -0
- package/dist/components/ui/pagination/PaginationFirst.vue.d.ts +26 -0
- package/dist/components/ui/pagination/PaginationItem.vue.d.ts +28 -0
- package/dist/components/ui/pagination/PaginationLast.vue.d.ts +26 -0
- package/dist/components/ui/pagination/PaginationNext.vue.d.ts +26 -0
- package/dist/components/ui/pagination/PaginationPrevious.vue.d.ts +26 -0
- package/dist/components/ui/pagination/index.d.ts +8 -0
- package/dist/components/ui/profile/Profile.vue.d.ts +30 -0
- package/dist/components/ui/profile/ProfileGroup.vue.d.ts +37 -0
- package/dist/components/ui/profile/index.d.ts +4 -0
- package/dist/components/ui/progress/Progress.vue.d.ts +36 -0
- package/dist/components/ui/progress/index.d.ts +2 -0
- package/dist/components/ui/prompt-input/PromptInput.vue.d.ts +150 -0
- package/dist/components/ui/prompt-input/index.d.ts +2 -0
- package/dist/components/ui/prompt-input/types.d.ts +61 -0
- package/dist/components/ui/radio-group/RadioGroup.vue.d.ts +30 -0
- package/dist/components/ui/radio-group/RadioGroupItem.vue.d.ts +12 -0
- package/dist/components/ui/radio-group/RadioGroupOption.vue.d.ts +28 -0
- package/dist/components/ui/radio-group/index.d.ts +3 -0
- package/dist/components/ui/reasoning/Reasoning.vue.d.ts +40 -0
- package/dist/components/ui/reasoning/index.d.ts +2 -0
- package/dist/components/ui/reasoning/types.d.ts +26 -0
- package/dist/components/ui/select/Select.vue.d.ts +28 -0
- package/dist/components/ui/select/SelectContent.vue.d.ts +46 -0
- package/dist/components/ui/select/SelectGroup.vue.d.ts +18 -0
- package/dist/components/ui/select/SelectItem.vue.d.ts +26 -0
- package/dist/components/ui/select/SelectItemText.vue.d.ts +18 -0
- package/dist/components/ui/select/SelectLabel.vue.d.ts +22 -0
- package/dist/components/ui/select/SelectScrollDownButton.vue.d.ts +22 -0
- package/dist/components/ui/select/SelectScrollUpButton.vue.d.ts +22 -0
- package/dist/components/ui/select/SelectSeparator.vue.d.ts +7 -0
- package/dist/components/ui/select/SelectTrigger.vue.d.ts +25 -0
- package/dist/components/ui/select/SelectValue.vue.d.ts +18 -0
- package/dist/components/ui/select/index.d.ts +11 -0
- package/dist/components/ui/select/search.d.ts +18 -0
- package/dist/components/ui/separator/Separator.vue.d.ts +6 -0
- package/dist/components/ui/separator/index.d.ts +2 -0
- package/dist/components/ui/separator/types.d.ts +7 -0
- package/dist/components/ui/shimmer/Shimmer.vue.d.ts +37 -0
- package/dist/components/ui/shimmer/index.d.ts +2 -0
- package/dist/components/ui/sidebar/Sidebar.vue.d.ts +24 -0
- package/dist/components/ui/sidebar/SidebarContent.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarFooter.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarGroup.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarGroupAction.vue.d.ts +24 -0
- package/dist/components/ui/sidebar/SidebarGroupContent.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarGroupLabel.vue.d.ts +24 -0
- package/dist/components/ui/sidebar/SidebarHeader.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarInput.vue.d.ts +6 -0
- package/dist/components/ui/sidebar/SidebarInset.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenu.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuAction.vue.d.ts +25 -0
- package/dist/components/ui/sidebar/SidebarMenuBadge.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuButton.vue.d.ts +25 -0
- package/dist/components/ui/sidebar/SidebarMenuButtonChild.vue.d.ts +30 -0
- package/dist/components/ui/sidebar/SidebarMenuItem.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuSub.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarMenuSubButton.vue.d.ts +27 -0
- package/dist/components/ui/sidebar/SidebarMenuSubItem.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarProvider.vue.d.ts +36 -0
- package/dist/components/ui/sidebar/SidebarRail.vue.d.ts +21 -0
- package/dist/components/ui/sidebar/SidebarSeparator.vue.d.ts +6 -0
- package/dist/components/ui/sidebar/SidebarTrigger.vue.d.ts +6 -0
- package/dist/components/ui/sidebar/context.d.ts +19 -0
- package/dist/components/ui/sidebar/index.d.ts +26 -0
- package/dist/components/ui/sidebar/types.d.ts +11 -0
- package/dist/components/ui/sidebar/variants.d.ts +6 -0
- package/dist/components/ui/skeleton/Skeleton.vue.d.ts +18 -0
- package/dist/components/ui/skeleton/index.d.ts +2 -0
- package/dist/components/ui/sonner/Sonner.vue.d.ts +5 -0
- package/dist/components/ui/sonner/index.d.ts +2 -0
- package/dist/components/ui/spinner/Spinner.vue.d.ts +11 -0
- package/dist/components/ui/spinner/index.d.ts +1 -0
- package/dist/components/ui/stepper/Stepper.vue.d.ts +38 -0
- package/dist/components/ui/stepper/StepperDescription.vue.d.ts +22 -0
- package/dist/components/ui/stepper/StepperIndicator.vue.d.ts +30 -0
- package/dist/components/ui/stepper/StepperItem.vue.d.ts +24 -0
- package/dist/components/ui/stepper/StepperSeparator.vue.d.ts +7 -0
- package/dist/components/ui/stepper/StepperTitle.vue.d.ts +22 -0
- package/dist/components/ui/stepper/StepperTrigger.vue.d.ts +22 -0
- package/dist/components/ui/stepper/index.d.ts +7 -0
- package/dist/components/ui/switch/Switch.vue.d.ts +12 -0
- package/dist/components/ui/switch/index.d.ts +1 -0
- package/dist/components/ui/table/Table.vue.d.ts +22 -0
- package/dist/components/ui/table/TableBody.vue.d.ts +21 -0
- package/dist/components/ui/table/TableCaption.vue.d.ts +21 -0
- package/dist/components/ui/table/TableCell.vue.d.ts +22 -0
- package/dist/components/ui/table/TableEmpty.vue.d.ts +24 -0
- package/dist/components/ui/table/TableFooter.vue.d.ts +21 -0
- package/dist/components/ui/table/TableHead.vue.d.ts +21 -0
- package/dist/components/ui/table/TableHeader.vue.d.ts +21 -0
- package/dist/components/ui/table/TableRow.vue.d.ts +21 -0
- package/dist/components/ui/table/index.d.ts +9 -0
- package/dist/components/ui/tabs/Tabs.vue.d.ts +28 -0
- package/dist/components/ui/tabs/TabsContent.vue.d.ts +22 -0
- package/dist/components/ui/tabs/TabsList.vue.d.ts +22 -0
- package/dist/components/ui/tabs/TabsTrigger.vue.d.ts +22 -0
- package/dist/components/ui/tabs/index.d.ts +4 -0
- package/dist/components/ui/tag/Tag.vue.d.ts +35 -0
- package/dist/components/ui/tag/index.d.ts +2 -0
- package/dist/components/ui/tag/variants.d.ts +6 -0
- package/dist/components/ui/textarea/Textarea.vue.d.ts +14 -0
- package/dist/components/ui/textarea/TextareaControl.vue.d.ts +14 -0
- package/dist/components/ui/textarea/TextareaFieldGroup.vue.d.ts +21 -0
- package/dist/components/ui/textarea/index.d.ts +4 -0
- package/dist/components/ui/textarea/types.d.ts +32 -0
- package/dist/components/ui/tool/Tool.vue.d.ts +61 -0
- package/dist/components/ui/tool/index.d.ts +2 -0
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts +24 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +32 -0
- package/dist/components/ui/tooltip/TooltipProvider.vue.d.ts +20 -0
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +18 -0
- package/dist/components/ui/tooltip/index.d.ts +4 -0
- package/dist/docs/component-docs.d.ts +18 -0
- package/dist/docs/markdown.d.ts +27 -0
- package/dist/index.d.ts +45 -0
- package/dist/lib/code-highlight.d.ts +11 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/styles.css +3 -0
- package/package.json +76 -0
- package/public/r/accordion.json +52 -0
- package/public/r/alert.json +51 -0
- package/public/r/button-group.json +31 -0
- package/public/r/button.json +39 -0
- package/public/r/card.json +61 -0
- package/public/r/chart.json +31 -0
- package/public/r/chat.json +186 -0
- package/public/r/checkbox.json +34 -0
- package/public/r/commit.json +32 -0
- package/public/r/contribution-graph.json +63 -0
- package/public/r/data-table.json +197 -0
- package/public/r/date-picker.json +33 -0
- package/public/r/dialog.json +88 -0
- package/public/r/diff.json +71 -0
- package/public/r/dropdown-menu.json +112 -0
- package/public/r/gauge.json +31 -0
- package/public/r/git-graph.json +32 -0
- package/public/r/incident-timeline.json +64 -0
- package/public/r/input.json +49 -0
- package/public/r/kpi-card.json +32 -0
- package/public/r/kpi-line-card.json +32 -0
- package/public/r/model-selector.json +148 -0
- package/public/r/network-graph.json +33 -0
- package/public/r/pagination.json +95 -0
- package/public/r/profile.json +37 -0
- package/public/r/progress.json +31 -0
- package/public/r/prompt-input.json +293 -0
- package/public/r/radio-group.json +45 -0
- package/public/r/reasoning.json +38 -0
- package/public/r/registry.json +2512 -0
- package/public/r/select.json +100 -0
- package/public/r/separator.json +37 -0
- package/public/r/shimmer.json +31 -0
- package/public/r/sidebar.json +221 -0
- package/public/r/skeleton.json +31 -0
- package/public/r/sonner.json +33 -0
- package/public/r/spinner.json +31 -0
- package/public/r/stepper.json +70 -0
- package/public/r/switch.json +33 -0
- package/public/r/table.json +79 -0
- package/public/r/tabs.json +51 -0
- package/public/r/tag.json +39 -0
- package/public/r/textarea.json +49 -0
- package/public/r/tool.json +32 -0
- package/public/r/tooltip.json +51 -0
- package/registry.json +2512 -0
- package/src/components/docs/MarkdownContent.vue +106 -0
- package/src/components/ui/accordion/Accordion.vue +24 -0
- package/src/components/ui/accordion/AccordionContent.vue +62 -0
- package/src/components/ui/accordion/AccordionItem.vue +23 -0
- package/src/components/ui/accordion/AccordionTrigger.vue +38 -0
- package/src/components/ui/accordion/index.ts +4 -0
- package/src/components/ui/alert/Alert.vue +40 -0
- package/src/components/ui/alert/AlertDescription.vue +24 -0
- package/src/components/ui/alert/AlertTitle.vue +24 -0
- package/src/components/ui/alert/index.ts +4 -0
- package/src/components/ui/alert/variants.ts +19 -0
- package/src/components/ui/button/Button.vue +27 -0
- package/src/components/ui/button/index.ts +2 -0
- package/src/components/ui/button/variants.ts +32 -0
- package/src/components/ui/button-group/ButtonGroup.vue +31 -0
- package/src/components/ui/button-group/index.ts +2 -0
- package/src/components/ui/card/Card.vue +17 -0
- package/src/components/ui/card/CardContent.vue +14 -0
- package/src/components/ui/card/CardDescription.vue +14 -0
- package/src/components/ui/card/CardFooter.vue +14 -0
- package/src/components/ui/card/CardHeader.vue +17 -0
- package/src/components/ui/card/CardTitle.vue +14 -0
- package/src/components/ui/card/index.ts +6 -0
- package/src/components/ui/chart/Chart.vue +1042 -0
- package/src/components/ui/chart/index.ts +13 -0
- package/src/components/ui/chat/Chat.vue +1297 -0
- package/src/components/ui/chat/ChatAttachments.vue +278 -0
- package/src/components/ui/chat/ChatCodeBlock.vue +283 -0
- package/src/components/ui/chat/code-block.ts +30 -0
- package/src/components/ui/chat/index.ts +24 -0
- package/src/components/ui/chat/types.ts +23 -0
- package/src/components/ui/checkbox/Checkbox.vue +38 -0
- package/src/components/ui/checkbox/index.ts +1 -0
- package/src/components/ui/commit/Commit.vue +423 -0
- package/src/components/ui/commit/index.ts +9 -0
- package/src/components/ui/contribution-graph/ContributionGraph.vue +719 -0
- package/src/components/ui/contribution-graph/index.ts +9 -0
- package/src/components/ui/data-table/DataTable.vue +534 -0
- package/src/components/ui/data-table/index.ts +9 -0
- package/src/components/ui/date-picker/DatePicker.vue +649 -0
- package/src/components/ui/date-picker/index.ts +7 -0
- package/src/components/ui/dialog/Dialog.vue +19 -0
- package/src/components/ui/dialog/DialogClose.vue +17 -0
- package/src/components/ui/dialog/DialogContent.vue +60 -0
- package/src/components/ui/dialog/DialogDescription.vue +23 -0
- package/src/components/ui/dialog/DialogFooter.vue +17 -0
- package/src/components/ui/dialog/DialogHeader.vue +17 -0
- package/src/components/ui/dialog/DialogOverlay.vue +23 -0
- package/src/components/ui/dialog/DialogScrollContent.vue +69 -0
- package/src/components/ui/dialog/DialogTitle.vue +23 -0
- package/src/components/ui/dialog/DialogTrigger.vue +17 -0
- package/src/components/ui/dialog/index.ts +10 -0
- package/src/components/ui/diff/DiffTool.vue +513 -0
- package/src/components/ui/diff/diff-parser.ts +423 -0
- package/src/components/ui/diff/diff-tool.ts +39 -0
- package/src/components/ui/diff/index.ts +5 -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 +31 -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/gauge/Gauge.vue +725 -0
- package/src/components/ui/gauge/index.ts +9 -0
- package/src/components/ui/git-graph/GitGraph.vue +715 -0
- package/src/components/ui/git-graph/index.ts +9 -0
- package/src/components/ui/incident-timeline/IncidentTimeline.vue +360 -0
- package/src/components/ui/incident-timeline/index.ts +7 -0
- package/src/components/ui/input/Input.vue +159 -0
- package/src/components/ui/input/InputControl.vue +135 -0
- package/src/components/ui/input/InputFieldGroup.vue +14 -0
- package/src/components/ui/input/index.ts +9 -0
- package/src/components/ui/input/types.ts +34 -0
- package/src/components/ui/kpi-card/KpiCard.vue +268 -0
- package/src/components/ui/kpi-card/index.ts +9 -0
- package/src/components/ui/kpi-line-card/KpiLineCard.vue +622 -0
- package/src/components/ui/kpi-line-card/index.ts +11 -0
- package/src/components/ui/model-selector/ModelSelector.vue +328 -0
- package/src/components/ui/model-selector/index.ts +6 -0
- package/src/components/ui/model-selector/types.ts +15 -0
- package/src/components/ui/network-graph/NetworkGraph.vue +902 -0
- package/src/components/ui/network-graph/index.ts +7 -0
- package/src/components/ui/pagination/Pagination.vue +26 -0
- package/src/components/ui/pagination/PaginationContent.vue +24 -0
- package/src/components/ui/pagination/PaginationEllipsis.vue +27 -0
- package/src/components/ui/pagination/PaginationFirst.vue +33 -0
- package/src/components/ui/pagination/PaginationItem.vue +39 -0
- package/src/components/ui/pagination/PaginationLast.vue +33 -0
- package/src/components/ui/pagination/PaginationNext.vue +33 -0
- package/src/components/ui/pagination/PaginationPrevious.vue +33 -0
- package/src/components/ui/pagination/index.ts +8 -0
- package/src/components/ui/profile/Profile.vue +226 -0
- package/src/components/ui/profile/ProfileGroup.vue +96 -0
- package/src/components/ui/profile/index.ts +8 -0
- package/src/components/ui/progress/Progress.vue +271 -0
- package/src/components/ui/progress/index.ts +9 -0
- package/src/components/ui/prompt-input/PromptInput.vue +1094 -0
- package/src/components/ui/prompt-input/index.ts +14 -0
- package/src/components/ui/prompt-input/types.ts +78 -0
- package/src/components/ui/radio-group/RadioGroup.vue +36 -0
- package/src/components/ui/radio-group/RadioGroupItem.vue +45 -0
- package/src/components/ui/radio-group/RadioGroupOption.vue +80 -0
- package/src/components/ui/radio-group/index.ts +3 -0
- package/src/components/ui/reasoning/Reasoning.vue +278 -0
- package/src/components/ui/reasoning/index.ts +8 -0
- package/src/components/ui/reasoning/types.ts +29 -0
- package/src/components/ui/select/Select.vue +19 -0
- package/src/components/ui/select/SelectContent.vue +166 -0
- package/src/components/ui/select/SelectGroup.vue +23 -0
- package/src/components/ui/select/SelectItem.vue +97 -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/select/search.ts +26 -0
- package/src/components/ui/separator/Separator.vue +30 -0
- package/src/components/ui/separator/index.ts +5 -0
- package/src/components/ui/separator/types.ts +9 -0
- package/src/components/ui/shimmer/Shimmer.vue +110 -0
- package/src/components/ui/shimmer/index.ts +5 -0
- package/src/components/ui/sidebar/Sidebar.vue +142 -0
- package/src/components/ui/sidebar/SidebarContent.vue +18 -0
- package/src/components/ui/sidebar/SidebarFooter.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroup.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroupAction.vue +31 -0
- package/src/components/ui/sidebar/SidebarGroupContent.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroupLabel.vue +30 -0
- package/src/components/ui/sidebar/SidebarHeader.vue +18 -0
- package/src/components/ui/sidebar/SidebarInput.vue +26 -0
- package/src/components/ui/sidebar/SidebarInset.vue +23 -0
- package/src/components/ui/sidebar/SidebarMenu.vue +18 -0
- package/src/components/ui/sidebar/SidebarMenuAction.vue +34 -0
- package/src/components/ui/sidebar/SidebarMenuBadge.vue +25 -0
- package/src/components/ui/sidebar/SidebarMenuButton.vue +37 -0
- package/src/components/ui/sidebar/SidebarMenuButtonChild.vue +38 -0
- package/src/components/ui/sidebar/SidebarMenuItem.vue +18 -0
- package/src/components/ui/sidebar/SidebarMenuSub.vue +18 -0
- package/src/components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
- package/src/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
- package/src/components/ui/sidebar/SidebarProvider.vue +119 -0
- package/src/components/ui/sidebar/SidebarRail.vue +35 -0
- package/src/components/ui/sidebar/SidebarSeparator.vue +18 -0
- package/src/components/ui/sidebar/SidebarTrigger.vue +28 -0
- package/src/components/ui/sidebar/context.ts +39 -0
- package/src/components/ui/sidebar/index.ts +43 -0
- package/src/components/ui/sidebar/types.ts +13 -0
- package/src/components/ui/sidebar/variants.ts +25 -0
- package/src/components/ui/skeleton/Skeleton.vue +53 -0
- package/src/components/ui/skeleton/index.ts +5 -0
- package/src/components/ui/sonner/Sonner.vue +69 -0
- package/src/components/ui/sonner/index.ts +12 -0
- package/src/components/ui/spinner/Spinner.vue +33 -0
- package/src/components/ui/spinner/index.ts +1 -0
- package/src/components/ui/stepper/Stepper.vue +29 -0
- package/src/components/ui/stepper/StepperDescription.vue +30 -0
- package/src/components/ui/stepper/StepperIndicator.vue +50 -0
- package/src/components/ui/stepper/StepperItem.vue +28 -0
- package/src/components/ui/stepper/StepperSeparator.vue +25 -0
- package/src/components/ui/stepper/StepperTitle.vue +27 -0
- package/src/components/ui/stepper/StepperTrigger.vue +27 -0
- package/src/components/ui/stepper/index.ts +7 -0
- package/src/components/ui/switch/Switch.vue +41 -0
- package/src/components/ui/switch/index.ts +1 -0
- package/src/components/ui/table/Table.vue +23 -0
- package/src/components/ui/table/TableBody.vue +17 -0
- package/src/components/ui/table/TableCaption.vue +17 -0
- package/src/components/ui/table/TableCell.vue +24 -0
- package/src/components/ui/table/TableEmpty.vue +31 -0
- package/src/components/ui/table/TableFooter.vue +17 -0
- package/src/components/ui/table/TableHead.vue +22 -0
- package/src/components/ui/table/TableHeader.vue +17 -0
- package/src/components/ui/table/TableRow.vue +22 -0
- package/src/components/ui/table/index.ts +9 -0
- package/src/components/ui/tabs/Tabs.vue +24 -0
- package/src/components/ui/tabs/TabsContent.vue +22 -0
- package/src/components/ui/tabs/TabsList.vue +27 -0
- package/src/components/ui/tabs/TabsTrigger.vue +27 -0
- package/src/components/ui/tabs/index.ts +4 -0
- package/src/components/ui/tag/Tag.vue +55 -0
- package/src/components/ui/tag/index.ts +2 -0
- package/src/components/ui/tag/variants.ts +29 -0
- package/src/components/ui/textarea/Textarea.vue +159 -0
- package/src/components/ui/textarea/TextareaControl.vue +120 -0
- package/src/components/ui/textarea/TextareaFieldGroup.vue +14 -0
- package/src/components/ui/textarea/index.ts +10 -0
- package/src/components/ui/textarea/types.ts +35 -0
- package/src/components/ui/tool/Tool.vue +304 -0
- package/src/components/ui/tool/index.ts +7 -0
- package/src/components/ui/tooltip/Tooltip.vue +19 -0
- package/src/components/ui/tooltip/TooltipContent.vue +44 -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/lib/code-highlight.ts +220 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles.css +684 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Component, HTMLAttributes } from "vue"
|
|
3
|
+
import {
|
|
4
|
+
AudioLinesIcon,
|
|
5
|
+
FileArchiveIcon,
|
|
6
|
+
FileCodeIcon,
|
|
7
|
+
FileIcon,
|
|
8
|
+
FileImageIcon,
|
|
9
|
+
FileSpreadsheetIcon,
|
|
10
|
+
FileTextIcon,
|
|
11
|
+
FileVideoCameraIcon,
|
|
12
|
+
} from "@lucide/vue"
|
|
13
|
+
import { cn } from "@/lib/utils"
|
|
14
|
+
import type { ChatAttachment, ChatSide } from "./types"
|
|
15
|
+
|
|
16
|
+
type ChatFileKind =
|
|
17
|
+
| "archive"
|
|
18
|
+
| "audio"
|
|
19
|
+
| "code"
|
|
20
|
+
| "document"
|
|
21
|
+
| "image"
|
|
22
|
+
| "spreadsheet"
|
|
23
|
+
| "unknown"
|
|
24
|
+
| "video"
|
|
25
|
+
|
|
26
|
+
interface ChatAttachmentsProps {
|
|
27
|
+
attachments: ChatAttachment[]
|
|
28
|
+
class?: HTMLAttributes["class"]
|
|
29
|
+
side?: ChatSide
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const props = withDefaults(defineProps<ChatAttachmentsProps>(), {
|
|
33
|
+
side: "left",
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const codeExtensions = new Set([
|
|
37
|
+
"astro",
|
|
38
|
+
"c",
|
|
39
|
+
"cpp",
|
|
40
|
+
"css",
|
|
41
|
+
"go",
|
|
42
|
+
"html",
|
|
43
|
+
"java",
|
|
44
|
+
"js",
|
|
45
|
+
"jsx",
|
|
46
|
+
"json",
|
|
47
|
+
"kt",
|
|
48
|
+
"mdx",
|
|
49
|
+
"php",
|
|
50
|
+
"py",
|
|
51
|
+
"rb",
|
|
52
|
+
"rs",
|
|
53
|
+
"scss",
|
|
54
|
+
"sh",
|
|
55
|
+
"swift",
|
|
56
|
+
"ts",
|
|
57
|
+
"tsx",
|
|
58
|
+
"vue",
|
|
59
|
+
"xml",
|
|
60
|
+
"yaml",
|
|
61
|
+
"yml",
|
|
62
|
+
])
|
|
63
|
+
const documentExtensions = new Set([
|
|
64
|
+
"doc",
|
|
65
|
+
"docx",
|
|
66
|
+
"md",
|
|
67
|
+
"pdf",
|
|
68
|
+
"rtf",
|
|
69
|
+
"txt",
|
|
70
|
+
])
|
|
71
|
+
const imageExtensions = new Set([
|
|
72
|
+
"avif",
|
|
73
|
+
"gif",
|
|
74
|
+
"heic",
|
|
75
|
+
"jpeg",
|
|
76
|
+
"jpg",
|
|
77
|
+
"png",
|
|
78
|
+
"svg",
|
|
79
|
+
"webp",
|
|
80
|
+
])
|
|
81
|
+
const spreadsheetExtensions = new Set([
|
|
82
|
+
"csv",
|
|
83
|
+
"numbers",
|
|
84
|
+
"ods",
|
|
85
|
+
"tsv",
|
|
86
|
+
"xls",
|
|
87
|
+
"xlsx",
|
|
88
|
+
])
|
|
89
|
+
const archiveExtensions = new Set([
|
|
90
|
+
"7z",
|
|
91
|
+
"gz",
|
|
92
|
+
"rar",
|
|
93
|
+
"tar",
|
|
94
|
+
"tgz",
|
|
95
|
+
"zip",
|
|
96
|
+
])
|
|
97
|
+
const audioExtensions = new Set([
|
|
98
|
+
"aac",
|
|
99
|
+
"flac",
|
|
100
|
+
"m4a",
|
|
101
|
+
"mp3",
|
|
102
|
+
"ogg",
|
|
103
|
+
"wav",
|
|
104
|
+
])
|
|
105
|
+
const videoExtensions = new Set([
|
|
106
|
+
"avi",
|
|
107
|
+
"m4v",
|
|
108
|
+
"mkv",
|
|
109
|
+
"mov",
|
|
110
|
+
"mp4",
|
|
111
|
+
"webm",
|
|
112
|
+
])
|
|
113
|
+
|
|
114
|
+
function attachmentKey(attachment: ChatAttachment, index: number) {
|
|
115
|
+
return attachment.id ?? `${attachment.name}-${index}`
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function normalizeExtension(extension?: string) {
|
|
119
|
+
return extension?.replace(/^\./, "").trim().toLowerCase() || undefined
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function extensionFromName(name: string) {
|
|
123
|
+
const cleanName = name.split(/[?#]/)[0] ?? name
|
|
124
|
+
const lastDotIndex = cleanName.lastIndexOf(".")
|
|
125
|
+
|
|
126
|
+
if (lastDotIndex <= 0 || lastDotIndex === cleanName.length - 1) {
|
|
127
|
+
return undefined
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return normalizeExtension(cleanName.slice(lastDotIndex + 1))
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function fileExtension(attachment: ChatAttachment) {
|
|
134
|
+
return normalizeExtension(attachment.extension) ??
|
|
135
|
+
extensionFromName(attachment.name) ??
|
|
136
|
+
extensionFromName(attachment.url ?? "")
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function fileKind(attachment: ChatAttachment): ChatFileKind {
|
|
140
|
+
const extension = fileExtension(attachment)
|
|
141
|
+
|
|
142
|
+
if (extension) {
|
|
143
|
+
if (codeExtensions.has(extension)) return "code"
|
|
144
|
+
if (documentExtensions.has(extension)) return "document"
|
|
145
|
+
if (imageExtensions.has(extension)) return "image"
|
|
146
|
+
if (spreadsheetExtensions.has(extension)) return "spreadsheet"
|
|
147
|
+
if (archiveExtensions.has(extension)) return "archive"
|
|
148
|
+
if (audioExtensions.has(extension)) return "audio"
|
|
149
|
+
if (videoExtensions.has(extension)) return "video"
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const type = attachment.type?.toLowerCase()
|
|
153
|
+
|
|
154
|
+
if (!type) return "unknown"
|
|
155
|
+
if (type.includes("image")) return "image"
|
|
156
|
+
if (type.includes("video")) return "video"
|
|
157
|
+
if (type.includes("audio")) return "audio"
|
|
158
|
+
if (type.includes("zip") || type.includes("archive")) return "archive"
|
|
159
|
+
if (type.includes("csv") || type.includes("sheet") || type.includes("excel")) {
|
|
160
|
+
return "spreadsheet"
|
|
161
|
+
}
|
|
162
|
+
if (
|
|
163
|
+
type.includes("code") ||
|
|
164
|
+
type.includes("javascript") ||
|
|
165
|
+
type.includes("json") ||
|
|
166
|
+
type.includes("typescript")
|
|
167
|
+
) {
|
|
168
|
+
return "code"
|
|
169
|
+
}
|
|
170
|
+
if (type.includes("pdf") || type.includes("text") || type.includes("document")) {
|
|
171
|
+
return "document"
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return "unknown"
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function attachmentIcon(attachment: ChatAttachment): Component {
|
|
178
|
+
const iconByKind: Record<ChatFileKind, Component> = {
|
|
179
|
+
archive: FileArchiveIcon,
|
|
180
|
+
audio: AudioLinesIcon,
|
|
181
|
+
code: FileCodeIcon,
|
|
182
|
+
document: FileTextIcon,
|
|
183
|
+
image: FileImageIcon,
|
|
184
|
+
spreadsheet: FileSpreadsheetIcon,
|
|
185
|
+
unknown: FileIcon,
|
|
186
|
+
video: FileVideoCameraIcon,
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return iconByKind[fileKind(attachment)]
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function attachmentTypeLabel(attachment: ChatAttachment) {
|
|
193
|
+
return attachment.type ?? fileExtension(attachment)?.toUpperCase()
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function attachmentMeta(attachment: ChatAttachment) {
|
|
197
|
+
return [attachmentTypeLabel(attachment), attachment.size]
|
|
198
|
+
.filter(Boolean)
|
|
199
|
+
.join(" / ")
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function attachmentLinkAttrs(attachment: ChatAttachment) {
|
|
203
|
+
if (!attachment.url) return {}
|
|
204
|
+
|
|
205
|
+
return {
|
|
206
|
+
href: attachment.url,
|
|
207
|
+
rel: "noreferrer",
|
|
208
|
+
target: "_blank",
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
</script>
|
|
212
|
+
|
|
213
|
+
<template>
|
|
214
|
+
<div
|
|
215
|
+
v-if="props.attachments.length > 0"
|
|
216
|
+
data-slot="chat-attachments"
|
|
217
|
+
:data-side="props.side"
|
|
218
|
+
:class="
|
|
219
|
+
cn(
|
|
220
|
+
'flex max-w-full flex-col gap-2',
|
|
221
|
+
props.side === 'right' ? 'items-end' : 'items-start',
|
|
222
|
+
props.class,
|
|
223
|
+
)
|
|
224
|
+
"
|
|
225
|
+
>
|
|
226
|
+
<component
|
|
227
|
+
:is="attachment.url ? 'a' : 'div'"
|
|
228
|
+
v-for="(attachment, index) in props.attachments"
|
|
229
|
+
:key="attachmentKey(attachment, index)"
|
|
230
|
+
v-bind="attachmentLinkAttrs(attachment)"
|
|
231
|
+
data-slot="chat-attachment"
|
|
232
|
+
:data-file-kind="fileKind(attachment)"
|
|
233
|
+
:data-file-extension="fileExtension(attachment)"
|
|
234
|
+
:title="attachment.name"
|
|
235
|
+
class="flex w-64 max-w-full min-w-0 items-center gap-3 rounded-lg bg-muted px-3 py-2 text-left text-xs text-foreground no-underline transition-colors hover:bg-muted/80 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
236
|
+
>
|
|
237
|
+
<span
|
|
238
|
+
v-if="attachment.thumbnailUrl"
|
|
239
|
+
data-slot="chat-attachment-preview"
|
|
240
|
+
class="flex size-9 shrink-0 items-center justify-center rounded-md bg-background text-muted-foreground"
|
|
241
|
+
>
|
|
242
|
+
<img
|
|
243
|
+
:alt="attachment.alt ?? attachment.name"
|
|
244
|
+
class="size-full rounded-md object-cover"
|
|
245
|
+
:src="attachment.thumbnailUrl"
|
|
246
|
+
/>
|
|
247
|
+
</span>
|
|
248
|
+
<span
|
|
249
|
+
v-else
|
|
250
|
+
data-slot="chat-attachment-icon"
|
|
251
|
+
class="flex size-9 shrink-0 items-center justify-center rounded-md bg-background text-muted-foreground"
|
|
252
|
+
>
|
|
253
|
+
<component
|
|
254
|
+
:is="attachmentIcon(attachment)"
|
|
255
|
+
aria-hidden="true"
|
|
256
|
+
/>
|
|
257
|
+
</span>
|
|
258
|
+
<span
|
|
259
|
+
data-slot="chat-attachment-body"
|
|
260
|
+
class="flex min-w-0 flex-col"
|
|
261
|
+
>
|
|
262
|
+
<span
|
|
263
|
+
data-slot="chat-attachment-name"
|
|
264
|
+
class="truncate font-medium"
|
|
265
|
+
>
|
|
266
|
+
{{ attachment.name }}
|
|
267
|
+
</span>
|
|
268
|
+
<span
|
|
269
|
+
v-if="attachmentMeta(attachment)"
|
|
270
|
+
data-slot="chat-attachment-meta"
|
|
271
|
+
class="truncate text-current/65"
|
|
272
|
+
>
|
|
273
|
+
{{ attachmentMeta(attachment) }}
|
|
274
|
+
</span>
|
|
275
|
+
</span>
|
|
276
|
+
</component>
|
|
277
|
+
</div>
|
|
278
|
+
</template>
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, onBeforeUnmount, ref, watch } from "vue"
|
|
3
|
+
import { CheckIcon, CopyIcon, Maximize2Icon, Minimize2Icon } from "@lucide/vue"
|
|
4
|
+
import { Button } from "@/components/ui/button"
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
import {
|
|
7
|
+
chatCodeBlockDefaults,
|
|
8
|
+
type ChatCodeBlockEmits,
|
|
9
|
+
type ChatCodeBlockProps,
|
|
10
|
+
} from "./code-block"
|
|
11
|
+
import { codeLineNumberWidth, createCodeLines } from "@/lib/code-highlight"
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(
|
|
14
|
+
defineProps<ChatCodeBlockProps>(),
|
|
15
|
+
chatCodeBlockDefaults,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
const emit = defineEmits<ChatCodeBlockEmits>()
|
|
19
|
+
|
|
20
|
+
const copied = ref(false)
|
|
21
|
+
const expanded = ref(false)
|
|
22
|
+
let copiedTimer: ReturnType<typeof setTimeout> | undefined
|
|
23
|
+
let previousBodyOverflow: string | undefined
|
|
24
|
+
|
|
25
|
+
const codeLines = computed(() => createCodeLines(
|
|
26
|
+
props.code,
|
|
27
|
+
props.language,
|
|
28
|
+
props.highlight,
|
|
29
|
+
))
|
|
30
|
+
const visibleLineCount = computed(() =>
|
|
31
|
+
Math.max(1, Math.trunc(props.maxVisibleLines)),
|
|
32
|
+
)
|
|
33
|
+
const shouldScroll = computed(() => codeLines.value.length > visibleLineCount.value)
|
|
34
|
+
const languageLabel = computed(() => props.language || props.label)
|
|
35
|
+
const codeLineStyle = computed(() => ({
|
|
36
|
+
gridTemplateColumns: props.lineNumbers
|
|
37
|
+
? `${codeLineNumberWidth(codeLines.value.length)} minmax(0, 1fr)`
|
|
38
|
+
: "minmax(0, 1fr)",
|
|
39
|
+
}))
|
|
40
|
+
const collapsedScrollStyle = computed(() => shouldScroll.value
|
|
41
|
+
? {
|
|
42
|
+
maxHeight: `${visibleLineCount.value * 1.5 + 2}rem`,
|
|
43
|
+
}
|
|
44
|
+
: undefined)
|
|
45
|
+
|
|
46
|
+
async function copyCode() {
|
|
47
|
+
try {
|
|
48
|
+
if (typeof navigator !== "undefined") {
|
|
49
|
+
await navigator.clipboard?.writeText(props.code)
|
|
50
|
+
}
|
|
51
|
+
} catch {
|
|
52
|
+
// Clipboard permissions vary by browser; the component still reports intent.
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
emit("copy", props.code)
|
|
56
|
+
copied.value = true
|
|
57
|
+
|
|
58
|
+
if (copiedTimer) clearTimeout(copiedTimer)
|
|
59
|
+
copiedTimer = setTimeout(() => {
|
|
60
|
+
copied.value = false
|
|
61
|
+
}, 1200)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function openExpanded() {
|
|
65
|
+
expanded.value = true
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function closeExpanded() {
|
|
69
|
+
expanded.value = false
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
73
|
+
if (event.key === "Escape") closeExpanded()
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
watch(expanded, (isExpanded) => {
|
|
77
|
+
if (typeof document === "undefined" || typeof window === "undefined") return
|
|
78
|
+
|
|
79
|
+
if (isExpanded) {
|
|
80
|
+
previousBodyOverflow = document.body.style.overflow
|
|
81
|
+
document.body.style.overflow = "hidden"
|
|
82
|
+
window.addEventListener("keydown", handleKeydown)
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
document.body.style.overflow = previousBodyOverflow ?? ""
|
|
87
|
+
previousBodyOverflow = undefined
|
|
88
|
+
window.removeEventListener("keydown", handleKeydown)
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
onBeforeUnmount(() => {
|
|
92
|
+
if (copiedTimer) clearTimeout(copiedTimer)
|
|
93
|
+
|
|
94
|
+
if (typeof document !== "undefined") {
|
|
95
|
+
document.body.style.overflow = previousBodyOverflow ?? ""
|
|
96
|
+
}
|
|
97
|
+
if (typeof window !== "undefined") {
|
|
98
|
+
window.removeEventListener("keydown", handleKeydown)
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
<template>
|
|
104
|
+
<div
|
|
105
|
+
data-slot="chat-code-block"
|
|
106
|
+
:data-language="props.language"
|
|
107
|
+
:data-scrollable="shouldScroll ? '' : undefined"
|
|
108
|
+
:class="
|
|
109
|
+
cn(
|
|
110
|
+
'relative w-full min-w-0 max-w-full overflow-hidden rounded-xl border font-mono text-[13px] leading-6 shadow-sm',
|
|
111
|
+
props.class,
|
|
112
|
+
)
|
|
113
|
+
"
|
|
114
|
+
>
|
|
115
|
+
<div
|
|
116
|
+
data-slot="chat-code-toolbar"
|
|
117
|
+
class="absolute top-2 right-2 z-10 flex max-w-[calc(100%-1rem)] items-center gap-1 rounded-md border px-1 py-0.5"
|
|
118
|
+
>
|
|
119
|
+
<span
|
|
120
|
+
data-slot="chat-code-language"
|
|
121
|
+
class="max-w-20 truncate px-1 text-xs"
|
|
122
|
+
>
|
|
123
|
+
{{ languageLabel }}
|
|
124
|
+
</span>
|
|
125
|
+
<Button
|
|
126
|
+
data-slot="chat-code-copy"
|
|
127
|
+
type="button"
|
|
128
|
+
variant="ghost"
|
|
129
|
+
size="icon-sm"
|
|
130
|
+
class="size-7 rounded-md"
|
|
131
|
+
:aria-label="copied ? props.copiedLabel : props.copyLabel"
|
|
132
|
+
:title="copied ? props.copiedLabel : props.copyLabel"
|
|
133
|
+
@click="copyCode"
|
|
134
|
+
>
|
|
135
|
+
<CheckIcon v-if="copied" />
|
|
136
|
+
<CopyIcon v-else />
|
|
137
|
+
</Button>
|
|
138
|
+
<Button
|
|
139
|
+
data-slot="chat-code-expand-trigger"
|
|
140
|
+
type="button"
|
|
141
|
+
variant="ghost"
|
|
142
|
+
size="icon-sm"
|
|
143
|
+
class="size-7 rounded-md"
|
|
144
|
+
:aria-label="props.expandLabel"
|
|
145
|
+
:title="props.expandLabel"
|
|
146
|
+
@click="openExpanded"
|
|
147
|
+
>
|
|
148
|
+
<Maximize2Icon />
|
|
149
|
+
</Button>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<pre
|
|
153
|
+
data-slot="chat-code-scroll"
|
|
154
|
+
:data-scrollable="shouldScroll ? '' : undefined"
|
|
155
|
+
:class="
|
|
156
|
+
cn(
|
|
157
|
+
'm-0 overflow-x-auto text-[13px] leading-6 [tab-size:2]',
|
|
158
|
+
shouldScroll ? 'overflow-y-auto' : 'overflow-y-hidden',
|
|
159
|
+
)
|
|
160
|
+
"
|
|
161
|
+
:style="collapsedScrollStyle"
|
|
162
|
+
><code
|
|
163
|
+
data-slot="chat-code"
|
|
164
|
+
:data-language="props.language"
|
|
165
|
+
class="block min-w-max font-mono whitespace-pre"
|
|
166
|
+
><span
|
|
167
|
+
v-for="line in codeLines"
|
|
168
|
+
:key="line.number"
|
|
169
|
+
data-slot="chat-code-line"
|
|
170
|
+
:data-diff="line.diffType"
|
|
171
|
+
:data-line="line.number"
|
|
172
|
+
class="grid min-w-full w-max"
|
|
173
|
+
:style="codeLineStyle"
|
|
174
|
+
><span
|
|
175
|
+
v-if="props.lineNumbers"
|
|
176
|
+
data-slot="chat-code-line-number"
|
|
177
|
+
aria-hidden="true"
|
|
178
|
+
class="sticky left-0 w-full select-none border-r pl-2 pr-3 text-right tabular-nums"
|
|
179
|
+
>{{ line.number }}</span><span
|
|
180
|
+
data-slot="chat-code-line-content"
|
|
181
|
+
class="block min-h-[1lh] pl-3 pr-4"
|
|
182
|
+
><span
|
|
183
|
+
v-if="line.isEmpty"
|
|
184
|
+
aria-hidden="true"
|
|
185
|
+
> </span><span
|
|
186
|
+
v-else
|
|
187
|
+
data-slot="chat-code-token"
|
|
188
|
+
v-html="line.html"
|
|
189
|
+
/></span></span></code></pre>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
<Teleport to="body">
|
|
193
|
+
<div
|
|
194
|
+
v-if="expanded"
|
|
195
|
+
data-slot="chat-code-dialog-overlay"
|
|
196
|
+
class="fixed inset-0 z-50 flex items-center justify-center p-4"
|
|
197
|
+
@click.self="closeExpanded"
|
|
198
|
+
>
|
|
199
|
+
<section
|
|
200
|
+
data-slot="chat-code-dialog"
|
|
201
|
+
role="dialog"
|
|
202
|
+
aria-modal="true"
|
|
203
|
+
:aria-label="props.expandLabel"
|
|
204
|
+
class="grid w-full max-w-6xl grid-rows-[auto_minmax(0,1fr)] overflow-hidden rounded-2xl border shadow-2xl"
|
|
205
|
+
>
|
|
206
|
+
<h2 class="sr-only">
|
|
207
|
+
{{ props.expandLabel }}
|
|
208
|
+
</h2>
|
|
209
|
+
<div
|
|
210
|
+
data-slot="chat-code-dialog-header"
|
|
211
|
+
class="flex h-11 items-center justify-between gap-3 border-b px-4"
|
|
212
|
+
>
|
|
213
|
+
<span
|
|
214
|
+
data-slot="chat-code-language"
|
|
215
|
+
class="min-w-0 truncate text-xs"
|
|
216
|
+
>
|
|
217
|
+
{{ languageLabel }}
|
|
218
|
+
</span>
|
|
219
|
+
<div class="flex shrink-0 items-center gap-1">
|
|
220
|
+
<Button
|
|
221
|
+
data-slot="chat-code-copy"
|
|
222
|
+
type="button"
|
|
223
|
+
variant="ghost"
|
|
224
|
+
size="icon-sm"
|
|
225
|
+
class="size-8 rounded-md"
|
|
226
|
+
:aria-label="copied ? props.copiedLabel : props.copyLabel"
|
|
227
|
+
:title="copied ? props.copiedLabel : props.copyLabel"
|
|
228
|
+
@click="copyCode"
|
|
229
|
+
>
|
|
230
|
+
<CheckIcon v-if="copied" />
|
|
231
|
+
<CopyIcon v-else />
|
|
232
|
+
</Button>
|
|
233
|
+
<Button
|
|
234
|
+
data-slot="chat-code-collapse-trigger"
|
|
235
|
+
type="button"
|
|
236
|
+
variant="ghost"
|
|
237
|
+
size="icon-sm"
|
|
238
|
+
class="size-8 rounded-md"
|
|
239
|
+
:aria-label="props.closeLabel"
|
|
240
|
+
:title="props.closeLabel"
|
|
241
|
+
@click="closeExpanded"
|
|
242
|
+
>
|
|
243
|
+
<Minimize2Icon />
|
|
244
|
+
</Button>
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
<pre
|
|
249
|
+
data-slot="chat-code-scroll"
|
|
250
|
+
data-expanded
|
|
251
|
+
class="m-0 max-h-[calc(90vh-4rem)] overflow-auto text-[13px] leading-6 [tab-size:2]"
|
|
252
|
+
><code
|
|
253
|
+
data-slot="chat-code"
|
|
254
|
+
:data-language="props.language"
|
|
255
|
+
class="block min-w-max font-mono whitespace-pre"
|
|
256
|
+
><span
|
|
257
|
+
v-for="line in codeLines"
|
|
258
|
+
:key="line.number"
|
|
259
|
+
data-slot="chat-code-line"
|
|
260
|
+
:data-diff="line.diffType"
|
|
261
|
+
:data-line="line.number"
|
|
262
|
+
class="grid min-w-full w-max"
|
|
263
|
+
:style="codeLineStyle"
|
|
264
|
+
><span
|
|
265
|
+
v-if="props.lineNumbers"
|
|
266
|
+
data-slot="chat-code-line-number"
|
|
267
|
+
aria-hidden="true"
|
|
268
|
+
class="sticky left-0 w-full select-none border-r pl-2 pr-3 text-right tabular-nums"
|
|
269
|
+
>{{ line.number }}</span><span
|
|
270
|
+
data-slot="chat-code-line-content"
|
|
271
|
+
class="block min-h-[1lh] pl-3 pr-4"
|
|
272
|
+
><span
|
|
273
|
+
v-if="line.isEmpty"
|
|
274
|
+
aria-hidden="true"
|
|
275
|
+
> </span><span
|
|
276
|
+
v-else
|
|
277
|
+
data-slot="chat-code-token"
|
|
278
|
+
v-html="line.html"
|
|
279
|
+
/></span></span></code></pre>
|
|
280
|
+
</section>
|
|
281
|
+
</div>
|
|
282
|
+
</Teleport>
|
|
283
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "vue"
|
|
2
|
+
|
|
3
|
+
export interface ChatCodeBlockProps {
|
|
4
|
+
class?: HTMLAttributes["class"]
|
|
5
|
+
closeLabel?: string
|
|
6
|
+
code: string
|
|
7
|
+
copiedLabel?: string
|
|
8
|
+
copyLabel?: string
|
|
9
|
+
expandLabel?: string
|
|
10
|
+
highlight?: boolean
|
|
11
|
+
label?: string
|
|
12
|
+
language?: string
|
|
13
|
+
lineNumbers?: boolean
|
|
14
|
+
maxVisibleLines?: number
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type ChatCodeBlockEmits = {
|
|
18
|
+
copy: [code: string]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const chatCodeBlockDefaults = {
|
|
22
|
+
closeLabel: "닫기",
|
|
23
|
+
copiedLabel: "복사됨",
|
|
24
|
+
copyLabel: "코드 복사",
|
|
25
|
+
expandLabel: "크게 보기",
|
|
26
|
+
highlight: true,
|
|
27
|
+
label: "Code",
|
|
28
|
+
lineNumbers: true,
|
|
29
|
+
maxVisibleLines: 20,
|
|
30
|
+
} satisfies Partial<ChatCodeBlockProps>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { default as Chat } from "./Chat.vue"
|
|
2
|
+
export { default as ChatAttachments } from "./ChatAttachments.vue"
|
|
3
|
+
export { default as ChatCodeBlock } from "./ChatCodeBlock.vue"
|
|
4
|
+
export type {
|
|
5
|
+
ChatCodeBlockEmits,
|
|
6
|
+
ChatCodeBlockProps,
|
|
7
|
+
} from "./code-block"
|
|
8
|
+
export type {
|
|
9
|
+
ChatActionSlotProps,
|
|
10
|
+
ChatAttachmentSlotProps,
|
|
11
|
+
ChatContentSlotProps,
|
|
12
|
+
ChatMessage,
|
|
13
|
+
ChatMessageSlotProps,
|
|
14
|
+
ChatProfile,
|
|
15
|
+
ChatResolvedMessage,
|
|
16
|
+
} from "./Chat.vue"
|
|
17
|
+
export type {
|
|
18
|
+
ChatActionKey,
|
|
19
|
+
ChatActionVisibility,
|
|
20
|
+
ChatAttachment,
|
|
21
|
+
ChatSide,
|
|
22
|
+
ChatStatus,
|
|
23
|
+
ChatVariant,
|
|
24
|
+
} from "./types"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type ChatAttachment = {
|
|
2
|
+
alt?: string
|
|
3
|
+
extension?: string
|
|
4
|
+
id?: number | string
|
|
5
|
+
name: string
|
|
6
|
+
size?: string
|
|
7
|
+
thumbnailUrl?: string
|
|
8
|
+
type?: string
|
|
9
|
+
url?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type ChatActionVisibility = "always" | "hover"
|
|
13
|
+
export type ChatActionKey =
|
|
14
|
+
| "bookmark"
|
|
15
|
+
| "branch"
|
|
16
|
+
| "copy"
|
|
17
|
+
| "download"
|
|
18
|
+
| "edit"
|
|
19
|
+
| "pagination"
|
|
20
|
+
| "regenerate"
|
|
21
|
+
export type ChatSide = "left" | "right"
|
|
22
|
+
export type ChatStatus = "complete" | "error" | "streaming"
|
|
23
|
+
export type ChatVariant = "bubble" | "plain"
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CheckboxRootEmits, CheckboxRootProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { Check } from "@lucide/vue"
|
|
5
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
6
|
+
import { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits } from "reka-ui"
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
const props = defineProps<CheckboxRootProps & { class?: HTMLAttributes["class"] }>()
|
|
10
|
+
const emits = defineEmits<CheckboxRootEmits>()
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
13
|
+
|
|
14
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<CheckboxRoot
|
|
19
|
+
v-slot="slotProps"
|
|
20
|
+
data-slot="checkbox"
|
|
21
|
+
v-bind="forwarded"
|
|
22
|
+
:class="
|
|
23
|
+
cn(
|
|
24
|
+
'peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
|
|
25
|
+
props.class,
|
|
26
|
+
)
|
|
27
|
+
"
|
|
28
|
+
>
|
|
29
|
+
<CheckboxIndicator
|
|
30
|
+
data-slot="checkbox-indicator"
|
|
31
|
+
class="grid place-content-center text-current transition-none"
|
|
32
|
+
>
|
|
33
|
+
<slot v-bind="slotProps">
|
|
34
|
+
<Check class="size-3.5" />
|
|
35
|
+
</slot>
|
|
36
|
+
</CheckboxIndicator>
|
|
37
|
+
</CheckboxRoot>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Checkbox } from "./Checkbox.vue"
|