@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,159 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, useAttrs, useId } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
import TextareaControl from "./TextareaControl.vue"
|
|
5
|
+
import type { TextareaModelValue, TextareaProps } from "./types"
|
|
6
|
+
|
|
7
|
+
defineOptions({
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<TextareaProps>(), {
|
|
12
|
+
iconPosition: "start",
|
|
13
|
+
resize: "vertical",
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const emit = defineEmits<{
|
|
17
|
+
"update:modelValue": [value: TextareaModelValue]
|
|
18
|
+
input: [event: Event]
|
|
19
|
+
change: [event: Event]
|
|
20
|
+
}>()
|
|
21
|
+
|
|
22
|
+
const attrs = useAttrs()
|
|
23
|
+
const generatedId = useId()
|
|
24
|
+
|
|
25
|
+
const controlId = computed(() => props.id ?? generatedId)
|
|
26
|
+
const hasMessage = computed(() => Boolean(props.message || props.error))
|
|
27
|
+
const hasError = computed(() => Boolean(props.error))
|
|
28
|
+
const shouldRenderField = computed(() =>
|
|
29
|
+
Boolean(
|
|
30
|
+
props.field
|
|
31
|
+
|| props.fieldGroup
|
|
32
|
+
|| props.label
|
|
33
|
+
|| props.description
|
|
34
|
+
|| hasMessage.value,
|
|
35
|
+
),
|
|
36
|
+
)
|
|
37
|
+
const descriptionId = computed(() =>
|
|
38
|
+
props.description ? `${controlId.value}-description` : undefined,
|
|
39
|
+
)
|
|
40
|
+
const messageId = computed(() =>
|
|
41
|
+
hasMessage.value ? `${controlId.value}-message` : undefined,
|
|
42
|
+
)
|
|
43
|
+
const describedBy = computed(() => {
|
|
44
|
+
const value = [
|
|
45
|
+
attrs["aria-describedby"],
|
|
46
|
+
descriptionId.value,
|
|
47
|
+
messageId.value,
|
|
48
|
+
].filter(Boolean).join(" ")
|
|
49
|
+
|
|
50
|
+
return value || undefined
|
|
51
|
+
})
|
|
52
|
+
const resolvedMessage = computed(() =>
|
|
53
|
+
typeof props.error === "string" ? props.error : props.message,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
function handleUpdate(value: TextareaModelValue) {
|
|
57
|
+
emit("update:modelValue", value)
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<TextareaControl
|
|
63
|
+
v-if="!shouldRenderField"
|
|
64
|
+
v-bind="attrs"
|
|
65
|
+
:id="controlId"
|
|
66
|
+
:class="props.class"
|
|
67
|
+
:default-value="props.defaultValue"
|
|
68
|
+
:disabled="props.disabled"
|
|
69
|
+
:icon="props.icon"
|
|
70
|
+
:icon-class="props.iconClass"
|
|
71
|
+
:icon-position="props.iconPosition"
|
|
72
|
+
:invalid="props.invalid || hasError"
|
|
73
|
+
:model-value="props.modelValue"
|
|
74
|
+
:placeholder="props.placeholder"
|
|
75
|
+
:readonly="props.readonly"
|
|
76
|
+
:resize="props.resize"
|
|
77
|
+
:textarea-class="props.textareaClass"
|
|
78
|
+
@change="emit('change', $event)"
|
|
79
|
+
@input="emit('input', $event)"
|
|
80
|
+
@update:model-value="handleUpdate"
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<div
|
|
84
|
+
v-else
|
|
85
|
+
:data-slot="props.fieldGroup ? 'textarea-field-group' : 'textarea-field'"
|
|
86
|
+
:class="
|
|
87
|
+
cn(
|
|
88
|
+
props.fieldGroup ? 'grid gap-4' : 'grid gap-2',
|
|
89
|
+
props.groupClass,
|
|
90
|
+
)
|
|
91
|
+
"
|
|
92
|
+
>
|
|
93
|
+
<div
|
|
94
|
+
data-slot="textarea-field"
|
|
95
|
+
:data-disabled="props.disabled ? '' : undefined"
|
|
96
|
+
:data-invalid="hasError ? '' : undefined"
|
|
97
|
+
:class="cn('grid gap-2', props.fieldClass)"
|
|
98
|
+
>
|
|
99
|
+
<label
|
|
100
|
+
v-if="props.label"
|
|
101
|
+
data-slot="textarea-label"
|
|
102
|
+
:for="controlId"
|
|
103
|
+
:class="
|
|
104
|
+
cn(
|
|
105
|
+
'text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70 data-[disabled=true]:opacity-50',
|
|
106
|
+
props.labelClass,
|
|
107
|
+
)
|
|
108
|
+
"
|
|
109
|
+
>
|
|
110
|
+
{{ props.label }}
|
|
111
|
+
</label>
|
|
112
|
+
|
|
113
|
+
<TextareaControl
|
|
114
|
+
v-bind="attrs"
|
|
115
|
+
:id="controlId"
|
|
116
|
+
:aria-describedby="describedBy"
|
|
117
|
+
:class="props.class"
|
|
118
|
+
:default-value="props.defaultValue"
|
|
119
|
+
:disabled="props.disabled"
|
|
120
|
+
:icon="props.icon"
|
|
121
|
+
:icon-class="props.iconClass"
|
|
122
|
+
:icon-position="props.iconPosition"
|
|
123
|
+
:invalid="props.invalid || hasError"
|
|
124
|
+
:model-value="props.modelValue"
|
|
125
|
+
:placeholder="props.placeholder"
|
|
126
|
+
:readonly="props.readonly"
|
|
127
|
+
:resize="props.resize"
|
|
128
|
+
:textarea-class="props.textareaClass"
|
|
129
|
+
@change="emit('change', $event)"
|
|
130
|
+
@input="emit('input', $event)"
|
|
131
|
+
@update:model-value="handleUpdate"
|
|
132
|
+
/>
|
|
133
|
+
|
|
134
|
+
<p
|
|
135
|
+
v-if="props.description"
|
|
136
|
+
:id="descriptionId"
|
|
137
|
+
data-slot="textarea-description"
|
|
138
|
+
:class="cn('text-xs leading-relaxed text-muted-foreground', props.descriptionClass)"
|
|
139
|
+
>
|
|
140
|
+
{{ props.description }}
|
|
141
|
+
</p>
|
|
142
|
+
|
|
143
|
+
<p
|
|
144
|
+
v-if="resolvedMessage"
|
|
145
|
+
:id="messageId"
|
|
146
|
+
data-slot="textarea-message"
|
|
147
|
+
:class="
|
|
148
|
+
cn(
|
|
149
|
+
'text-xs font-medium leading-relaxed',
|
|
150
|
+
hasError ? 'text-destructive' : 'text-muted-foreground',
|
|
151
|
+
props.messageClass,
|
|
152
|
+
)
|
|
153
|
+
"
|
|
154
|
+
>
|
|
155
|
+
{{ resolvedMessage }}
|
|
156
|
+
</p>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</template>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, useAttrs } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
import type { TextareaControlProps, TextareaModelValue } from "./types"
|
|
5
|
+
|
|
6
|
+
defineOptions({
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<TextareaControlProps>(), {
|
|
11
|
+
iconPosition: "start",
|
|
12
|
+
resize: "vertical",
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const emit = defineEmits<{
|
|
16
|
+
"update:modelValue": [value: TextareaModelValue]
|
|
17
|
+
input: [event: Event]
|
|
18
|
+
change: [event: Event]
|
|
19
|
+
}>()
|
|
20
|
+
|
|
21
|
+
const attrs = useAttrs()
|
|
22
|
+
|
|
23
|
+
const hasIcon = computed(() => Boolean(props.icon))
|
|
24
|
+
const textareaValue = computed(() => props.modelValue ?? props.defaultValue ?? "")
|
|
25
|
+
const controlAttrs = computed(() => ({
|
|
26
|
+
...attrs,
|
|
27
|
+
value: textareaValue.value,
|
|
28
|
+
}))
|
|
29
|
+
const resizeClass = computed(() => {
|
|
30
|
+
if (props.resize === "none") return "resize-none"
|
|
31
|
+
if (props.resize === "horizontal") return "resize-x"
|
|
32
|
+
if (props.resize === "both") return "resize"
|
|
33
|
+
|
|
34
|
+
return "resize-y"
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const textareaClasses = computed(() =>
|
|
38
|
+
cn(
|
|
39
|
+
"border-input bg-background text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex min-h-20 w-full min-w-0 rounded-md border px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
40
|
+
resizeClass.value,
|
|
41
|
+
hasIcon.value
|
|
42
|
+
&& "min-h-16 border-0 bg-transparent px-0 py-0 shadow-none focus-visible:border-transparent focus-visible:ring-0",
|
|
43
|
+
props.textareaClass,
|
|
44
|
+
!hasIcon.value && props.class,
|
|
45
|
+
),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
const wrapperClasses = computed(() =>
|
|
49
|
+
cn(
|
|
50
|
+
"border-input bg-background text-foreground focus-within:border-ring focus-within:ring-ring/50 flex min-h-20 w-full min-w-0 items-start gap-2 rounded-md border px-3 py-2 shadow-xs transition-[color,box-shadow] focus-within:ring-[3px] has-disabled:cursor-not-allowed has-disabled:opacity-50 has-aria-invalid:border-destructive has-aria-invalid:ring-destructive/20",
|
|
51
|
+
props.class,
|
|
52
|
+
),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
function getTextareaModelValue(target: HTMLTextAreaElement) {
|
|
56
|
+
return target.value
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function handleInput(event: Event) {
|
|
60
|
+
const target = event.target as HTMLTextAreaElement
|
|
61
|
+
|
|
62
|
+
emit("update:modelValue", getTextareaModelValue(target))
|
|
63
|
+
emit("input", event)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function handleChange(event: Event) {
|
|
67
|
+
emit("change", event)
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<template>
|
|
72
|
+
<div
|
|
73
|
+
v-if="hasIcon"
|
|
74
|
+
data-slot="textarea-wrapper"
|
|
75
|
+
:class="wrapperClasses"
|
|
76
|
+
>
|
|
77
|
+
<component
|
|
78
|
+
:is="props.icon"
|
|
79
|
+
v-if="props.iconPosition === 'start'"
|
|
80
|
+
aria-hidden="true"
|
|
81
|
+
data-slot="textarea-icon"
|
|
82
|
+
:class="cn('mt-0.5 size-4 shrink-0 text-muted-foreground', props.iconClass)"
|
|
83
|
+
/>
|
|
84
|
+
|
|
85
|
+
<textarea
|
|
86
|
+
v-bind="controlAttrs"
|
|
87
|
+
:id="props.id"
|
|
88
|
+
data-slot="textarea"
|
|
89
|
+
:aria-invalid="props.invalid ? true : undefined"
|
|
90
|
+
:class="textareaClasses"
|
|
91
|
+
:disabled="props.disabled"
|
|
92
|
+
:placeholder="props.placeholder"
|
|
93
|
+
:readonly="props.readonly"
|
|
94
|
+
@change="handleChange"
|
|
95
|
+
@input="handleInput"
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<component
|
|
99
|
+
:is="props.icon"
|
|
100
|
+
v-if="props.iconPosition === 'end'"
|
|
101
|
+
aria-hidden="true"
|
|
102
|
+
data-slot="textarea-icon"
|
|
103
|
+
:class="cn('mt-0.5 size-4 shrink-0 text-muted-foreground', props.iconClass)"
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<textarea
|
|
108
|
+
v-else
|
|
109
|
+
v-bind="controlAttrs"
|
|
110
|
+
:id="props.id"
|
|
111
|
+
data-slot="textarea"
|
|
112
|
+
:aria-invalid="props.invalid ? true : undefined"
|
|
113
|
+
:class="textareaClasses"
|
|
114
|
+
:disabled="props.disabled"
|
|
115
|
+
:placeholder="props.placeholder"
|
|
116
|
+
:readonly="props.readonly"
|
|
117
|
+
@change="handleChange"
|
|
118
|
+
@input="handleInput"
|
|
119
|
+
/>
|
|
120
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
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 data-slot="textarea-field-group" :class="cn('grid gap-4', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as Textarea } from "./Textarea.vue"
|
|
2
|
+
export { default as TextareaControl } from "./TextareaControl.vue"
|
|
3
|
+
export { default as TextareaFieldGroup } from "./TextareaFieldGroup.vue"
|
|
4
|
+
export type {
|
|
5
|
+
TextareaControlProps,
|
|
6
|
+
TextareaIconPosition,
|
|
7
|
+
TextareaModelValue,
|
|
8
|
+
TextareaProps,
|
|
9
|
+
TextareaResize,
|
|
10
|
+
} from "./types"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Component, HTMLAttributes } from "vue"
|
|
2
|
+
|
|
3
|
+
export type TextareaModelValue = string | number
|
|
4
|
+
export type TextareaIconPosition = "start" | "end"
|
|
5
|
+
export type TextareaResize = "none" | "vertical" | "horizontal" | "both"
|
|
6
|
+
|
|
7
|
+
export interface TextareaControlProps {
|
|
8
|
+
class?: HTMLAttributes["class"]
|
|
9
|
+
defaultValue?: TextareaModelValue
|
|
10
|
+
disabled?: boolean
|
|
11
|
+
icon?: Component
|
|
12
|
+
iconClass?: HTMLAttributes["class"]
|
|
13
|
+
iconPosition?: TextareaIconPosition
|
|
14
|
+
id?: string
|
|
15
|
+
invalid?: boolean
|
|
16
|
+
modelValue?: TextareaModelValue
|
|
17
|
+
placeholder?: string
|
|
18
|
+
readonly?: boolean
|
|
19
|
+
resize?: TextareaResize
|
|
20
|
+
textareaClass?: HTMLAttributes["class"]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface TextareaProps extends TextareaControlProps {
|
|
24
|
+
description?: string
|
|
25
|
+
descriptionClass?: HTMLAttributes["class"]
|
|
26
|
+
error?: string | boolean
|
|
27
|
+
field?: boolean
|
|
28
|
+
fieldClass?: HTMLAttributes["class"]
|
|
29
|
+
fieldGroup?: boolean
|
|
30
|
+
groupClass?: HTMLAttributes["class"]
|
|
31
|
+
label?: string
|
|
32
|
+
labelClass?: HTMLAttributes["class"]
|
|
33
|
+
message?: string
|
|
34
|
+
messageClass?: HTMLAttributes["class"]
|
|
35
|
+
}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref } from "vue"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import {
|
|
5
|
+
ChevronDownIcon,
|
|
6
|
+
CircleCheckIcon,
|
|
7
|
+
CircleXIcon,
|
|
8
|
+
ClockIcon,
|
|
9
|
+
LoaderCircleIcon,
|
|
10
|
+
WrenchIcon,
|
|
11
|
+
} from "@lucide/vue"
|
|
12
|
+
import { createCodeLines } from "@/lib/code-highlight"
|
|
13
|
+
import { cn } from "@/lib/utils"
|
|
14
|
+
|
|
15
|
+
export type ToolSize = "sm" | "default" | "lg"
|
|
16
|
+
export type ToolStatus =
|
|
17
|
+
| "pending"
|
|
18
|
+
| "awaiting-approval"
|
|
19
|
+
| "responded"
|
|
20
|
+
| "running"
|
|
21
|
+
| "completed"
|
|
22
|
+
| "error"
|
|
23
|
+
| "denied"
|
|
24
|
+
|
|
25
|
+
export type ToolParameters =
|
|
26
|
+
| string
|
|
27
|
+
| number
|
|
28
|
+
| boolean
|
|
29
|
+
| Record<string, unknown>
|
|
30
|
+
| unknown[]
|
|
31
|
+
| null
|
|
32
|
+
|
|
33
|
+
export interface ToolTogglePayload {
|
|
34
|
+
open: boolean
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface ToolProps {
|
|
38
|
+
class?: HTMLAttributes["class"]
|
|
39
|
+
collapsible?: boolean
|
|
40
|
+
defaultOpen?: boolean
|
|
41
|
+
highlight?: boolean
|
|
42
|
+
name?: string
|
|
43
|
+
open?: boolean
|
|
44
|
+
parameters?: ToolParameters
|
|
45
|
+
parametersLabel?: string
|
|
46
|
+
parametersLanguage?: string
|
|
47
|
+
showParameters?: boolean
|
|
48
|
+
showToggle?: boolean
|
|
49
|
+
size?: ToolSize
|
|
50
|
+
status?: ToolStatus
|
|
51
|
+
statusLabel?: string
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const props = withDefaults(defineProps<ToolProps>(), {
|
|
55
|
+
collapsible: true,
|
|
56
|
+
defaultOpen: true,
|
|
57
|
+
highlight: true,
|
|
58
|
+
name: "tool",
|
|
59
|
+
parametersLabel: "Parameters",
|
|
60
|
+
parametersLanguage: "json",
|
|
61
|
+
showParameters: true,
|
|
62
|
+
showToggle: true,
|
|
63
|
+
size: "default",
|
|
64
|
+
status: "pending",
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
const emit = defineEmits<{
|
|
68
|
+
"toggle": [payload: ToolTogglePayload]
|
|
69
|
+
"update:open": [value: boolean]
|
|
70
|
+
}>()
|
|
71
|
+
|
|
72
|
+
const localOpen = ref(props.defaultOpen)
|
|
73
|
+
const isOpen = computed(() => {
|
|
74
|
+
if (!props.collapsible) return true
|
|
75
|
+
|
|
76
|
+
return props.open ?? localOpen.value
|
|
77
|
+
})
|
|
78
|
+
const statusLabel = computed(() => props.statusLabel ?? defaultStatusLabel(props.status))
|
|
79
|
+
const statusIcon = computed(() => {
|
|
80
|
+
if (props.status === "pending") return LoaderCircleIcon
|
|
81
|
+
if (props.status === "awaiting-approval") return ClockIcon
|
|
82
|
+
if (props.status === "responded") return CircleCheckIcon
|
|
83
|
+
if (props.status === "running") return ClockIcon
|
|
84
|
+
if (props.status === "completed") return CircleCheckIcon
|
|
85
|
+
|
|
86
|
+
return CircleXIcon
|
|
87
|
+
})
|
|
88
|
+
const parameterText = computed(() => formatParameters(props.parameters))
|
|
89
|
+
const parameterLines = computed(() => createCodeLines(
|
|
90
|
+
parameterText.value,
|
|
91
|
+
props.parametersLanguage,
|
|
92
|
+
props.highlight,
|
|
93
|
+
))
|
|
94
|
+
const sizeClasses = computed(() => {
|
|
95
|
+
if (props.size === "sm") {
|
|
96
|
+
return {
|
|
97
|
+
badge: "h-5 gap-1.5 px-2 text-xs",
|
|
98
|
+
badgeIcon: "size-3",
|
|
99
|
+
content: "px-3 pb-3 pt-2.5",
|
|
100
|
+
header: "gap-2.5 px-3 py-2.5",
|
|
101
|
+
icon: "size-3.5",
|
|
102
|
+
innerGap: "gap-2.5",
|
|
103
|
+
label: "text-xs",
|
|
104
|
+
name: "text-xs",
|
|
105
|
+
panel: "mt-2 min-h-12 rounded-lg px-3 py-2 text-xs leading-5",
|
|
106
|
+
toggleButton: "size-7",
|
|
107
|
+
toggleIcon: "size-3.5",
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (props.size === "lg") {
|
|
112
|
+
return {
|
|
113
|
+
badge: "h-7 gap-2 px-3 text-sm",
|
|
114
|
+
badgeIcon: "size-4",
|
|
115
|
+
content: "px-5 pb-5 pt-4",
|
|
116
|
+
header: "gap-3 px-5 py-4",
|
|
117
|
+
icon: "size-5",
|
|
118
|
+
innerGap: "gap-3",
|
|
119
|
+
label: "text-xs",
|
|
120
|
+
name: "text-sm",
|
|
121
|
+
panel: "mt-3 min-h-20 rounded-xl px-4 py-3 text-xs leading-6",
|
|
122
|
+
toggleButton: "size-9",
|
|
123
|
+
toggleIcon: "size-4",
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
badge: "h-6 gap-1.5 px-2.5 text-xs",
|
|
129
|
+
badgeIcon: "size-3.5",
|
|
130
|
+
content: "px-4 pb-4 pt-3",
|
|
131
|
+
header: "gap-2.5 px-4 py-3",
|
|
132
|
+
icon: "size-4",
|
|
133
|
+
innerGap: "gap-2.5",
|
|
134
|
+
label: "text-xs",
|
|
135
|
+
name: "text-[13px]",
|
|
136
|
+
panel: "mt-3 min-h-16 rounded-xl px-4 py-3 text-xs leading-6",
|
|
137
|
+
toggleButton: "size-8",
|
|
138
|
+
toggleIcon: "size-4",
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
function defaultStatusLabel(status: ToolStatus) {
|
|
143
|
+
if (status === "awaiting-approval") return "Awaiting Approval"
|
|
144
|
+
if (status === "responded") return "Responded"
|
|
145
|
+
if (status === "running") return "Running"
|
|
146
|
+
if (status === "completed") return "Completed"
|
|
147
|
+
if (status === "error") return "Error"
|
|
148
|
+
if (status === "denied") return "Denied"
|
|
149
|
+
|
|
150
|
+
return "Pending"
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function statusClass(status: ToolStatus) {
|
|
154
|
+
if (status === "pending") return "text-foreground"
|
|
155
|
+
if (status === "awaiting-approval") return "text-amber-600"
|
|
156
|
+
if (status === "responded") return "text-blue-600"
|
|
157
|
+
if (status === "completed") return "text-emerald-600"
|
|
158
|
+
if (status === "error") return "text-destructive"
|
|
159
|
+
if (status === "denied") return "text-orange-600"
|
|
160
|
+
|
|
161
|
+
return "text-muted-foreground"
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function formatParameters(value?: ToolParameters) {
|
|
165
|
+
if (value === undefined || value === null) return "{}"
|
|
166
|
+
if (typeof value === "string") return value
|
|
167
|
+
|
|
168
|
+
try {
|
|
169
|
+
return JSON.stringify(value, null, 2)
|
|
170
|
+
} catch {
|
|
171
|
+
return String(value)
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function setOpen(nextOpen: boolean) {
|
|
176
|
+
if (!props.collapsible) return
|
|
177
|
+
|
|
178
|
+
const previousOpen = isOpen.value
|
|
179
|
+
|
|
180
|
+
if (props.open === undefined) {
|
|
181
|
+
localOpen.value = nextOpen
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
emit("update:open", nextOpen)
|
|
185
|
+
|
|
186
|
+
if (previousOpen !== nextOpen) {
|
|
187
|
+
emit("toggle", { open: nextOpen })
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function toggleOpen() {
|
|
192
|
+
setOpen(!isOpen.value)
|
|
193
|
+
}
|
|
194
|
+
</script>
|
|
195
|
+
|
|
196
|
+
<template>
|
|
197
|
+
<article
|
|
198
|
+
data-slot="tool"
|
|
199
|
+
:data-open="isOpen"
|
|
200
|
+
:data-size="props.size"
|
|
201
|
+
:data-status="props.status"
|
|
202
|
+
:class="cn('overflow-hidden rounded-xl border bg-card text-card-foreground shadow-xs', props.class)"
|
|
203
|
+
>
|
|
204
|
+
<header
|
|
205
|
+
data-slot="tool-header"
|
|
206
|
+
:class="cn('flex items-center transition-colors', sizeClasses.header)"
|
|
207
|
+
>
|
|
208
|
+
<component
|
|
209
|
+
:is="props.collapsible ? 'button' : 'div'"
|
|
210
|
+
data-slot="tool-toggle"
|
|
211
|
+
:type="props.collapsible ? 'button' : undefined"
|
|
212
|
+
:aria-expanded="props.collapsible ? isOpen : undefined"
|
|
213
|
+
:class="cn('flex min-w-0 flex-1 items-center text-left outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50', sizeClasses.innerGap)"
|
|
214
|
+
@click="toggleOpen"
|
|
215
|
+
>
|
|
216
|
+
<WrenchIcon
|
|
217
|
+
data-slot="tool-icon"
|
|
218
|
+
aria-hidden="true"
|
|
219
|
+
:class="cn('shrink-0 text-muted-foreground', sizeClasses.icon)"
|
|
220
|
+
/>
|
|
221
|
+
|
|
222
|
+
<span
|
|
223
|
+
data-slot="tool-name"
|
|
224
|
+
:class="cn('min-w-0 truncate font-semibold leading-tight tracking-normal', sizeClasses.name)"
|
|
225
|
+
>
|
|
226
|
+
{{ props.name }}
|
|
227
|
+
</span>
|
|
228
|
+
|
|
229
|
+
<span
|
|
230
|
+
data-slot="tool-status"
|
|
231
|
+
:class="cn('inline-flex shrink-0 items-center rounded-full bg-muted font-medium leading-none text-foreground', sizeClasses.badge)"
|
|
232
|
+
>
|
|
233
|
+
<component
|
|
234
|
+
:is="statusIcon"
|
|
235
|
+
data-slot="tool-status-icon"
|
|
236
|
+
aria-hidden="true"
|
|
237
|
+
:class="cn(sizeClasses.badgeIcon, statusClass(props.status), props.status === 'pending' && 'animate-spin')"
|
|
238
|
+
/>
|
|
239
|
+
<span>{{ statusLabel }}</span>
|
|
240
|
+
</span>
|
|
241
|
+
</component>
|
|
242
|
+
|
|
243
|
+
<button
|
|
244
|
+
v-if="props.collapsible && props.showToggle"
|
|
245
|
+
data-slot="tool-toggle-icon"
|
|
246
|
+
type="button"
|
|
247
|
+
:aria-label="isOpen ? 'Collapse tool' : 'Expand tool'"
|
|
248
|
+
:aria-expanded="isOpen"
|
|
249
|
+
:class="
|
|
250
|
+
cn(
|
|
251
|
+
'inline-flex shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50',
|
|
252
|
+
sizeClasses.toggleButton,
|
|
253
|
+
)
|
|
254
|
+
"
|
|
255
|
+
@click="toggleOpen"
|
|
256
|
+
>
|
|
257
|
+
<ChevronDownIcon
|
|
258
|
+
aria-hidden="true"
|
|
259
|
+
:class="cn('transition-transform', sizeClasses.toggleIcon, isOpen && 'rotate-180')"
|
|
260
|
+
/>
|
|
261
|
+
</button>
|
|
262
|
+
</header>
|
|
263
|
+
|
|
264
|
+
<section
|
|
265
|
+
v-if="isOpen && props.showParameters"
|
|
266
|
+
data-slot="tool-content"
|
|
267
|
+
:class="sizeClasses.content"
|
|
268
|
+
>
|
|
269
|
+
<div
|
|
270
|
+
data-slot="tool-parameters-label"
|
|
271
|
+
:class="cn('font-semibold uppercase leading-none text-muted-foreground', sizeClasses.label)"
|
|
272
|
+
>
|
|
273
|
+
{{ props.parametersLabel }}
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
<pre
|
|
277
|
+
data-slot="tool-parameters"
|
|
278
|
+
:class="cn('overflow-auto border bg-background font-mono text-foreground whitespace-pre-wrap break-words', sizeClasses.panel)"
|
|
279
|
+
><slot
|
|
280
|
+
name="parameters"
|
|
281
|
+
:parameters="props.parameters"
|
|
282
|
+
:text="parameterText"
|
|
283
|
+
:lines="parameterLines"
|
|
284
|
+
><code
|
|
285
|
+
data-slot="tool-parameters-code"
|
|
286
|
+
:data-language="props.parametersLanguage"
|
|
287
|
+
class="block min-w-0 whitespace-pre-wrap break-words"
|
|
288
|
+
><span
|
|
289
|
+
v-for="line in parameterLines"
|
|
290
|
+
:key="line.number"
|
|
291
|
+
data-slot="tool-parameters-line"
|
|
292
|
+
:data-line="line.number"
|
|
293
|
+
class="block min-h-[1lh]"
|
|
294
|
+
><span
|
|
295
|
+
v-if="line.isEmpty"
|
|
296
|
+
aria-hidden="true"
|
|
297
|
+
> </span><span
|
|
298
|
+
v-else
|
|
299
|
+
data-slot="tool-parameters-token"
|
|
300
|
+
v-html="line.html"
|
|
301
|
+
/></span></code></slot></pre>
|
|
302
|
+
</section>
|
|
303
|
+
</article>
|
|
304
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TooltipRootEmits, TooltipRootProps } from "reka-ui"
|
|
3
|
+
import { TooltipRoot, useForwardPropsEmits } from "reka-ui"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<TooltipRootProps>()
|
|
6
|
+
const emits = defineEmits<TooltipRootEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<TooltipRoot
|
|
13
|
+
v-slot="slotProps"
|
|
14
|
+
data-slot="tooltip"
|
|
15
|
+
v-bind="forwarded"
|
|
16
|
+
>
|
|
17
|
+
<slot v-bind="slotProps" />
|
|
18
|
+
</TooltipRoot>
|
|
19
|
+
</template>
|