@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,14 @@
|
|
|
1
|
+
export { default as PromptInput } from "./PromptInput.vue"
|
|
2
|
+
export type {
|
|
3
|
+
PromptInputAddAction,
|
|
4
|
+
PromptInputAddActionKey,
|
|
5
|
+
PromptInputAttachment,
|
|
6
|
+
PromptInputAttachmentKind,
|
|
7
|
+
PromptInputCommand,
|
|
8
|
+
PromptInputCommandData,
|
|
9
|
+
PromptInputCommandDataValue,
|
|
10
|
+
PromptInputCommandPayload,
|
|
11
|
+
PromptInputCommandRemovePayload,
|
|
12
|
+
PromptInputModel,
|
|
13
|
+
PromptInputSubmitPayload,
|
|
14
|
+
} from "./types"
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Component } from "vue"
|
|
2
|
+
|
|
3
|
+
export type PromptInputAddActionKey = "attachment" | "mcp" | (string & {})
|
|
4
|
+
|
|
5
|
+
export interface PromptInputAddAction {
|
|
6
|
+
disabled?: boolean
|
|
7
|
+
icon?: Component
|
|
8
|
+
key: PromptInputAddActionKey
|
|
9
|
+
label: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type PromptInputAttachmentKind = "file" | "image"
|
|
13
|
+
|
|
14
|
+
export interface PromptInputAttachment {
|
|
15
|
+
file: File
|
|
16
|
+
id: string
|
|
17
|
+
kind: PromptInputAttachmentKind
|
|
18
|
+
name: string
|
|
19
|
+
previewUrl?: string
|
|
20
|
+
size: number
|
|
21
|
+
type: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type PromptInputCommandDataValue =
|
|
25
|
+
| boolean
|
|
26
|
+
| null
|
|
27
|
+
| number
|
|
28
|
+
| string
|
|
29
|
+
| PromptInputCommandDataValue[]
|
|
30
|
+
| { [key: string]: PromptInputCommandDataValue }
|
|
31
|
+
|
|
32
|
+
export type PromptInputCommandData = Record<string, PromptInputCommandDataValue>
|
|
33
|
+
|
|
34
|
+
export interface PromptInputCommand {
|
|
35
|
+
action?: (payload: PromptInputCommandPayload) => void
|
|
36
|
+
cancel?: (payload: PromptInputCommandRemovePayload) => void
|
|
37
|
+
description?: string
|
|
38
|
+
disabled?: boolean
|
|
39
|
+
icon?: Component
|
|
40
|
+
insert?: string
|
|
41
|
+
label: string
|
|
42
|
+
payload?:
|
|
43
|
+
| PromptInputCommandData
|
|
44
|
+
| ((payload: PromptInputCommandPayload) => PromptInputCommandData)
|
|
45
|
+
value: string
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface PromptInputCommandPayload {
|
|
49
|
+
command: PromptInputCommand
|
|
50
|
+
commandPayload: PromptInputCommandData
|
|
51
|
+
nextCommandPayload: PromptInputCommandData
|
|
52
|
+
nextValue: string
|
|
53
|
+
query: string
|
|
54
|
+
trigger: string
|
|
55
|
+
value: string
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface PromptInputCommandRemovePayload {
|
|
59
|
+
command: PromptInputCommand
|
|
60
|
+
commandPayload: PromptInputCommandData
|
|
61
|
+
nextCommandPayload: PromptInputCommandData
|
|
62
|
+
removedPayload: PromptInputCommandData
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface PromptInputModel {
|
|
66
|
+
disabled?: boolean
|
|
67
|
+
icon?: Component
|
|
68
|
+
label: string
|
|
69
|
+
value: string
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface PromptInputSubmitPayload {
|
|
73
|
+
attachments: PromptInputAttachment[]
|
|
74
|
+
commandPayload: PromptInputCommandData
|
|
75
|
+
model: string
|
|
76
|
+
modelOption?: PromptInputModel
|
|
77
|
+
value: string
|
|
78
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import type { RadioGroupRootEmits, RadioGroupRootProps } from "reka-ui"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { RadioGroupRoot, useForwardPropsEmits } from "reka-ui"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<RadioGroupRootProps & { class?: HTMLAttributes["class"] }>(),
|
|
10
|
+
{
|
|
11
|
+
orientation: "vertical",
|
|
12
|
+
},
|
|
13
|
+
)
|
|
14
|
+
const emits = defineEmits<RadioGroupRootEmits>()
|
|
15
|
+
|
|
16
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
17
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<RadioGroupRoot
|
|
22
|
+
v-slot="slotProps"
|
|
23
|
+
data-slot="radio-group"
|
|
24
|
+
v-bind="forwarded"
|
|
25
|
+
:class="
|
|
26
|
+
cn(
|
|
27
|
+
props.orientation === 'horizontal'
|
|
28
|
+
? 'flex flex-wrap items-center gap-4'
|
|
29
|
+
: 'grid gap-3',
|
|
30
|
+
props.class,
|
|
31
|
+
)
|
|
32
|
+
"
|
|
33
|
+
>
|
|
34
|
+
<slot v-bind="slotProps" />
|
|
35
|
+
</RadioGroupRoot>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import type { RadioGroupItemEmits, RadioGroupItemProps } from "reka-ui"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import {
|
|
6
|
+
RadioGroupIndicator,
|
|
7
|
+
RadioGroupItem,
|
|
8
|
+
useForwardPropsEmits,
|
|
9
|
+
} from "reka-ui"
|
|
10
|
+
import { cn } from "@/lib/utils"
|
|
11
|
+
|
|
12
|
+
const props = defineProps<
|
|
13
|
+
RadioGroupItemProps & {
|
|
14
|
+
class?: HTMLAttributes["class"]
|
|
15
|
+
indicatorClass?: HTMLAttributes["class"]
|
|
16
|
+
}
|
|
17
|
+
>()
|
|
18
|
+
const emits = defineEmits<RadioGroupItemEmits>()
|
|
19
|
+
|
|
20
|
+
const delegatedProps = reactiveOmit(props, "class", "indicatorClass")
|
|
21
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<RadioGroupItem
|
|
26
|
+
data-slot="radio-group-item"
|
|
27
|
+
v-bind="forwarded"
|
|
28
|
+
:class="
|
|
29
|
+
cn(
|
|
30
|
+
'border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 relative flex size-4 shrink-0 items-center justify-center rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',
|
|
31
|
+
props.class,
|
|
32
|
+
)
|
|
33
|
+
"
|
|
34
|
+
>
|
|
35
|
+
<RadioGroupIndicator
|
|
36
|
+
data-slot="radio-group-indicator"
|
|
37
|
+
:class="
|
|
38
|
+
cn(
|
|
39
|
+
'flex size-full items-center justify-center after:block after:size-2 after:rounded-full after:bg-current',
|
|
40
|
+
props.indicatorClass,
|
|
41
|
+
)
|
|
42
|
+
"
|
|
43
|
+
/>
|
|
44
|
+
</RadioGroupItem>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import type { RadioGroupItemProps } from "reka-ui"
|
|
4
|
+
import { computed, useId } from "vue"
|
|
5
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import RadioGroupItem from "./RadioGroupItem.vue"
|
|
8
|
+
|
|
9
|
+
const props = defineProps<
|
|
10
|
+
RadioGroupItemProps & {
|
|
11
|
+
class?: HTMLAttributes["class"]
|
|
12
|
+
description?: string
|
|
13
|
+
descriptionClass?: HTMLAttributes["class"]
|
|
14
|
+
indicatorClass?: HTMLAttributes["class"]
|
|
15
|
+
itemClass?: HTMLAttributes["class"]
|
|
16
|
+
label?: string
|
|
17
|
+
labelClass?: HTMLAttributes["class"]
|
|
18
|
+
}
|
|
19
|
+
>()
|
|
20
|
+
|
|
21
|
+
const generatedId = useId()
|
|
22
|
+
const optionId = computed(() => props.id ?? generatedId)
|
|
23
|
+
const delegatedProps = reactiveOmit(
|
|
24
|
+
props,
|
|
25
|
+
"class",
|
|
26
|
+
"description",
|
|
27
|
+
"descriptionClass",
|
|
28
|
+
"id",
|
|
29
|
+
"indicatorClass",
|
|
30
|
+
"itemClass",
|
|
31
|
+
"label",
|
|
32
|
+
"labelClass",
|
|
33
|
+
)
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<div
|
|
38
|
+
data-slot="radio-group-option"
|
|
39
|
+
:data-disabled="props.disabled ? '' : undefined"
|
|
40
|
+
:class="
|
|
41
|
+
cn(
|
|
42
|
+
'flex items-start gap-3',
|
|
43
|
+
props.disabled && 'opacity-50',
|
|
44
|
+
props.class,
|
|
45
|
+
)
|
|
46
|
+
"
|
|
47
|
+
>
|
|
48
|
+
<RadioGroupItem
|
|
49
|
+
v-bind="delegatedProps"
|
|
50
|
+
:id="optionId"
|
|
51
|
+
:class="props.itemClass"
|
|
52
|
+
:indicator-class="props.indicatorClass"
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
<div class="grid gap-1 leading-none">
|
|
56
|
+
<label
|
|
57
|
+
v-if="props.label || $slots.default"
|
|
58
|
+
data-slot="radio-group-label"
|
|
59
|
+
:for="optionId"
|
|
60
|
+
:class="
|
|
61
|
+
cn(
|
|
62
|
+
'text-sm font-medium leading-none text-foreground',
|
|
63
|
+
props.disabled && 'cursor-not-allowed',
|
|
64
|
+
props.labelClass,
|
|
65
|
+
)
|
|
66
|
+
"
|
|
67
|
+
>
|
|
68
|
+
<slot>{{ props.label }}</slot>
|
|
69
|
+
</label>
|
|
70
|
+
|
|
71
|
+
<p
|
|
72
|
+
v-if="props.description"
|
|
73
|
+
data-slot="radio-group-description"
|
|
74
|
+
:class="cn('text-xs leading-relaxed text-muted-foreground', props.descriptionClass)"
|
|
75
|
+
>
|
|
76
|
+
{{ props.description }}
|
|
77
|
+
</p>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, useId, watch } from "vue"
|
|
3
|
+
import type { Component } from "vue"
|
|
4
|
+
import {
|
|
5
|
+
BrainIcon,
|
|
6
|
+
ChevronDownIcon,
|
|
7
|
+
CircleAlertIcon,
|
|
8
|
+
} from "@lucide/vue"
|
|
9
|
+
import { cn } from "@/lib/utils"
|
|
10
|
+
import type {
|
|
11
|
+
ReasoningDuration,
|
|
12
|
+
ReasoningProps,
|
|
13
|
+
ReasoningStatus,
|
|
14
|
+
ReasoningStepStatus,
|
|
15
|
+
} from "./types"
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(defineProps<ReasoningProps>(), {
|
|
18
|
+
ariaLive: "polite",
|
|
19
|
+
collapsible: true,
|
|
20
|
+
defaultOpen: true,
|
|
21
|
+
status: "complete",
|
|
22
|
+
title: "Thought",
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const emit = defineEmits<{
|
|
26
|
+
"update:open": [open: boolean]
|
|
27
|
+
}>()
|
|
28
|
+
|
|
29
|
+
const slots = defineSlots<{
|
|
30
|
+
default?: () => unknown
|
|
31
|
+
footer?: () => unknown
|
|
32
|
+
summary?: (props: { duration?: ReasoningDuration; status: ReasoningStatus }) => unknown
|
|
33
|
+
}>()
|
|
34
|
+
|
|
35
|
+
const contentId = `reasoning-content-${useId()}`
|
|
36
|
+
const uncontrolledOpen = ref(props.open ?? props.defaultOpen)
|
|
37
|
+
|
|
38
|
+
watch(
|
|
39
|
+
() => props.open,
|
|
40
|
+
(open) => {
|
|
41
|
+
if (open !== undefined) {
|
|
42
|
+
uncontrolledOpen.value = open
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
const isOpen = computed({
|
|
48
|
+
get: () => props.open ?? uncontrolledOpen.value,
|
|
49
|
+
set: (open: boolean) => {
|
|
50
|
+
uncontrolledOpen.value = open
|
|
51
|
+
emit("update:open", open)
|
|
52
|
+
},
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const statusIconByStatus: Record<ReasoningStatus, Component> = {
|
|
56
|
+
complete: BrainIcon,
|
|
57
|
+
error: CircleAlertIcon,
|
|
58
|
+
thinking: BrainIcon,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const statusLabelByStatus: Record<ReasoningStatus, string> = {
|
|
62
|
+
complete: "Thought",
|
|
63
|
+
error: "Reasoning failed",
|
|
64
|
+
thinking: "Thinking",
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const headerIcon = computed(() => props.icon ?? statusIconByStatus[props.status])
|
|
68
|
+
const formattedDuration = computed(() => formatDuration(props.duration))
|
|
69
|
+
const headerText = computed(() =>
|
|
70
|
+
props.summary ?? (props.status === "complete" ? props.title : statusLabelByStatus[props.status]),
|
|
71
|
+
)
|
|
72
|
+
const visibleSteps = computed(() => props.steps ?? [])
|
|
73
|
+
const hasBody = computed(() => Boolean(props.content || slots.default))
|
|
74
|
+
const hasContent = computed(() =>
|
|
75
|
+
hasBody.value || visibleSteps.value.length > 0 || Boolean(slots.footer),
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
function toggleOpen() {
|
|
79
|
+
if (!props.collapsible) return
|
|
80
|
+
isOpen.value = !isOpen.value
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function formatDuration(duration: ReasoningProps["duration"]) {
|
|
84
|
+
if (duration === undefined || duration === "") return undefined
|
|
85
|
+
|
|
86
|
+
if (typeof duration === "number") {
|
|
87
|
+
return formatDurationParts(duration)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const parsedDuration = parseDurationString(duration)
|
|
91
|
+
return parsedDuration === undefined ? duration : formatDurationParts(parsedDuration)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function parseDurationString(duration: string) {
|
|
95
|
+
const value = duration.trim().toLowerCase()
|
|
96
|
+
|
|
97
|
+
if (/^\d+(?:\.\d+)?$/.test(value)) {
|
|
98
|
+
return Number(value)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const matches = [
|
|
102
|
+
...value.matchAll(
|
|
103
|
+
/(\d+(?:\.\d+)?)\s*(hours?|hrs?|h|minutes?|mins?|m(?!s)|seconds?|secs?|s)\b/g,
|
|
104
|
+
),
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
if (!matches.length) return undefined
|
|
108
|
+
|
|
109
|
+
return matches.reduce((totalSeconds, match) => {
|
|
110
|
+
const amount = Number(match[1])
|
|
111
|
+
const unit = match[2]
|
|
112
|
+
|
|
113
|
+
if (unit.startsWith("h")) return totalSeconds + amount * 3600
|
|
114
|
+
if (unit.startsWith("min") || unit === "m") return totalSeconds + amount * 60
|
|
115
|
+
|
|
116
|
+
return totalSeconds + amount
|
|
117
|
+
}, 0)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function formatDurationParts(duration: number) {
|
|
121
|
+
const totalSeconds = Math.max(0, Math.round(duration))
|
|
122
|
+
const hours = Math.floor(totalSeconds / 3600)
|
|
123
|
+
const minutes = Math.floor((totalSeconds % 3600) / 60)
|
|
124
|
+
const seconds = totalSeconds % 60
|
|
125
|
+
const parts: string[] = []
|
|
126
|
+
|
|
127
|
+
if (hours) parts.push(`${hours}h`)
|
|
128
|
+
if (minutes) parts.push(`${minutes}m`)
|
|
129
|
+
if (seconds || !parts.length) parts.push(`${seconds}s`)
|
|
130
|
+
|
|
131
|
+
return parts.join(" ")
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function getStepMarkerClass(status: ReasoningStepStatus = "pending") {
|
|
135
|
+
return cn(
|
|
136
|
+
"mt-2 size-1.5 rounded-full",
|
|
137
|
+
status === "complete" && "bg-foreground/60",
|
|
138
|
+
status === "current" && "bg-foreground",
|
|
139
|
+
status === "error" && "bg-destructive",
|
|
140
|
+
status === "pending" && "bg-border",
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
</script>
|
|
144
|
+
|
|
145
|
+
<template>
|
|
146
|
+
<section
|
|
147
|
+
data-slot="reasoning"
|
|
148
|
+
:data-status="props.status"
|
|
149
|
+
:data-open="isOpen ? 'true' : 'false'"
|
|
150
|
+
:aria-live="props.ariaLive"
|
|
151
|
+
:class="
|
|
152
|
+
cn(
|
|
153
|
+
'w-full text-muted-foreground',
|
|
154
|
+
props.class,
|
|
155
|
+
)
|
|
156
|
+
"
|
|
157
|
+
>
|
|
158
|
+
<component
|
|
159
|
+
:is="props.collapsible ? 'button' : 'div'"
|
|
160
|
+
data-slot="reasoning-header"
|
|
161
|
+
:type="props.collapsible ? 'button' : undefined"
|
|
162
|
+
:aria-controls="props.collapsible ? contentId : undefined"
|
|
163
|
+
:aria-expanded="props.collapsible ? isOpen : undefined"
|
|
164
|
+
:class="
|
|
165
|
+
cn(
|
|
166
|
+
'group inline-flex min-h-8 max-w-full items-center gap-2 rounded-md px-1.5 py-1 text-left text-sm text-muted-foreground',
|
|
167
|
+
props.collapsible &&
|
|
168
|
+
'cursor-pointer transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50',
|
|
169
|
+
props.headerClass,
|
|
170
|
+
)
|
|
171
|
+
"
|
|
172
|
+
@click="toggleOpen"
|
|
173
|
+
>
|
|
174
|
+
<component
|
|
175
|
+
:is="headerIcon"
|
|
176
|
+
data-slot="reasoning-icon"
|
|
177
|
+
aria-hidden="true"
|
|
178
|
+
:class="
|
|
179
|
+
cn(
|
|
180
|
+
'size-4 shrink-0',
|
|
181
|
+
props.status === 'error' && 'text-destructive',
|
|
182
|
+
props.status === 'thinking' && 'animate-pulse',
|
|
183
|
+
props.iconClass,
|
|
184
|
+
)
|
|
185
|
+
"
|
|
186
|
+
/>
|
|
187
|
+
|
|
188
|
+
<span
|
|
189
|
+
data-slot="reasoning-summary"
|
|
190
|
+
class="flex min-w-0 items-center gap-1.5"
|
|
191
|
+
>
|
|
192
|
+
<span
|
|
193
|
+
data-slot="reasoning-title"
|
|
194
|
+
class="min-w-0 truncate font-medium leading-6 text-foreground/80"
|
|
195
|
+
>
|
|
196
|
+
<slot
|
|
197
|
+
name="summary"
|
|
198
|
+
:duration="formattedDuration"
|
|
199
|
+
:status="props.status"
|
|
200
|
+
>
|
|
201
|
+
{{ headerText }}
|
|
202
|
+
</slot>
|
|
203
|
+
</span>
|
|
204
|
+
|
|
205
|
+
<span
|
|
206
|
+
v-if="formattedDuration && !$slots.summary"
|
|
207
|
+
data-slot="reasoning-duration"
|
|
208
|
+
class="shrink-0 text-xs leading-5 text-muted-foreground"
|
|
209
|
+
>
|
|
210
|
+
{{ formattedDuration }}
|
|
211
|
+
</span>
|
|
212
|
+
</span>
|
|
213
|
+
|
|
214
|
+
<ChevronDownIcon
|
|
215
|
+
v-if="props.collapsible"
|
|
216
|
+
data-slot="reasoning-chevron"
|
|
217
|
+
aria-hidden="true"
|
|
218
|
+
:class="
|
|
219
|
+
cn(
|
|
220
|
+
'size-3.5 shrink-0 transition-transform group-hover:text-foreground',
|
|
221
|
+
isOpen && 'rotate-180',
|
|
222
|
+
)
|
|
223
|
+
"
|
|
224
|
+
/>
|
|
225
|
+
</component>
|
|
226
|
+
|
|
227
|
+
<div
|
|
228
|
+
v-show="!props.collapsible || isOpen"
|
|
229
|
+
v-if="hasContent"
|
|
230
|
+
:id="contentId"
|
|
231
|
+
data-slot="reasoning-content"
|
|
232
|
+
:class="cn('mt-3 border-l pl-5', props.contentClass)"
|
|
233
|
+
>
|
|
234
|
+
<div
|
|
235
|
+
v-if="hasBody"
|
|
236
|
+
data-slot="reasoning-body"
|
|
237
|
+
class="whitespace-pre-wrap text-sm leading-7 text-muted-foreground"
|
|
238
|
+
>
|
|
239
|
+
<slot>{{ props.content }}</slot>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<ol
|
|
243
|
+
v-if="visibleSteps.length"
|
|
244
|
+
data-slot="reasoning-steps"
|
|
245
|
+
:class="cn('grid gap-4 text-sm leading-7 text-muted-foreground', hasBody && 'mt-5')"
|
|
246
|
+
>
|
|
247
|
+
<li
|
|
248
|
+
v-for="(step, index) in visibleSteps"
|
|
249
|
+
:key="`${step.title}-${index}`"
|
|
250
|
+
data-slot="reasoning-step"
|
|
251
|
+
:data-status="step.status ?? 'pending'"
|
|
252
|
+
class="grid grid-cols-[auto_1fr] gap-x-3 gap-y-1"
|
|
253
|
+
>
|
|
254
|
+
<span
|
|
255
|
+
data-slot="reasoning-step-marker"
|
|
256
|
+
aria-hidden="true"
|
|
257
|
+
:class="getStepMarkerClass(step.status)"
|
|
258
|
+
/>
|
|
259
|
+
|
|
260
|
+
<span data-slot="reasoning-step-title" class="font-medium text-foreground/75">
|
|
261
|
+
{{ step.title }}
|
|
262
|
+
</span>
|
|
263
|
+
<span
|
|
264
|
+
v-if="step.description"
|
|
265
|
+
data-slot="reasoning-step-description"
|
|
266
|
+
class="col-start-2"
|
|
267
|
+
>
|
|
268
|
+
{{ step.description }}
|
|
269
|
+
</span>
|
|
270
|
+
</li>
|
|
271
|
+
</ol>
|
|
272
|
+
|
|
273
|
+
<div v-if="$slots.footer" data-slot="reasoning-footer" class="mt-4 text-sm">
|
|
274
|
+
<slot name="footer" />
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
</section>
|
|
278
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Component, HTMLAttributes } from "vue"
|
|
2
|
+
|
|
3
|
+
export type ReasoningStatus = "complete" | "error" | "thinking"
|
|
4
|
+
export type ReasoningStepStatus = "complete" | "current" | "error" | "pending"
|
|
5
|
+
export type ReasoningDuration = number | string
|
|
6
|
+
|
|
7
|
+
export interface ReasoningStep {
|
|
8
|
+
description?: string
|
|
9
|
+
status?: ReasoningStepStatus
|
|
10
|
+
title: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ReasoningProps {
|
|
14
|
+
ariaLive?: "assertive" | "off" | "polite"
|
|
15
|
+
class?: HTMLAttributes["class"]
|
|
16
|
+
collapsible?: boolean
|
|
17
|
+
content?: string
|
|
18
|
+
contentClass?: HTMLAttributes["class"]
|
|
19
|
+
defaultOpen?: boolean
|
|
20
|
+
duration?: ReasoningDuration
|
|
21
|
+
headerClass?: HTMLAttributes["class"]
|
|
22
|
+
icon?: Component
|
|
23
|
+
iconClass?: HTMLAttributes["class"]
|
|
24
|
+
open?: boolean
|
|
25
|
+
steps?: ReasoningStep[]
|
|
26
|
+
status?: ReasoningStatus
|
|
27
|
+
summary?: string
|
|
28
|
+
title?: string
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SelectRootEmits, SelectRootProps } from "reka-ui"
|
|
3
|
+
import { SelectRoot, useForwardPropsEmits } from "reka-ui"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<SelectRootProps>()
|
|
6
|
+
const emits = defineEmits<SelectRootEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<SelectRoot
|
|
13
|
+
v-slot="slotProps"
|
|
14
|
+
data-slot="select"
|
|
15
|
+
v-bind="forwarded"
|
|
16
|
+
>
|
|
17
|
+
<slot v-bind="slotProps" />
|
|
18
|
+
</SelectRoot>
|
|
19
|
+
</template>
|