@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,360 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref } from "vue"
|
|
3
|
+
import type { CSSProperties, HTMLAttributes } from "vue"
|
|
4
|
+
import { CheckIcon } from "@lucide/vue"
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
import {
|
|
7
|
+
Tooltip,
|
|
8
|
+
TooltipContent,
|
|
9
|
+
TooltipProvider,
|
|
10
|
+
TooltipTrigger,
|
|
11
|
+
} from "../tooltip"
|
|
12
|
+
|
|
13
|
+
export type IncidentTimelineStatus =
|
|
14
|
+
| "degraded"
|
|
15
|
+
| "maintenance"
|
|
16
|
+
| "operational"
|
|
17
|
+
| "outage"
|
|
18
|
+
| "partial-outage"
|
|
19
|
+
|
|
20
|
+
export type IncidentTimelineSize = "sm" | "default" | "lg"
|
|
21
|
+
|
|
22
|
+
export interface IncidentTimelineItem {
|
|
23
|
+
description?: string
|
|
24
|
+
endedAt?: Date | string | null
|
|
25
|
+
id?: number | string
|
|
26
|
+
label?: string
|
|
27
|
+
startedAt?: Date | string
|
|
28
|
+
status?: IncidentTimelineStatus
|
|
29
|
+
title?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface IncidentTimelineSelectPayload {
|
|
33
|
+
index: number
|
|
34
|
+
item: IncidentTimelineItem
|
|
35
|
+
status: IncidentTimelineStatus
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface IncidentTimelineProps {
|
|
39
|
+
barCount?: number
|
|
40
|
+
class?: HTMLAttributes["class"]
|
|
41
|
+
emptyLabel?: string
|
|
42
|
+
items?: IncidentTimelineItem[]
|
|
43
|
+
label?: string
|
|
44
|
+
modelValue?: string
|
|
45
|
+
operationalLabel?: string
|
|
46
|
+
selectable?: boolean
|
|
47
|
+
showIcon?: boolean
|
|
48
|
+
showUptime?: boolean
|
|
49
|
+
size?: IncidentTimelineSize
|
|
50
|
+
status?: IncidentTimelineStatus
|
|
51
|
+
uptime?: number | string
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface NormalizedIncidentTimelineItem {
|
|
55
|
+
description?: string
|
|
56
|
+
id: string
|
|
57
|
+
index: number
|
|
58
|
+
item: IncidentTimelineItem
|
|
59
|
+
label: string
|
|
60
|
+
status: IncidentTimelineStatus
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const props = withDefaults(defineProps<IncidentTimelineProps>(), {
|
|
64
|
+
barCount: 90,
|
|
65
|
+
emptyLabel: "No timeline data.",
|
|
66
|
+
label: "Pulsetic Website",
|
|
67
|
+
operationalLabel: "Operational",
|
|
68
|
+
selectable: true,
|
|
69
|
+
showIcon: true,
|
|
70
|
+
showUptime: true,
|
|
71
|
+
size: "default",
|
|
72
|
+
status: "operational",
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const emit = defineEmits<{
|
|
76
|
+
"select": [payload: IncidentTimelineSelectPayload]
|
|
77
|
+
"update:modelValue": [value: string]
|
|
78
|
+
}>()
|
|
79
|
+
|
|
80
|
+
const openTooltipId = ref<string | null>(null)
|
|
81
|
+
|
|
82
|
+
const sizeClasses = computed(() => {
|
|
83
|
+
if (props.size === "sm") {
|
|
84
|
+
return {
|
|
85
|
+
bar: "h-5 rounded-[3px]",
|
|
86
|
+
gap: "gap-[clamp(1px,0.22vw,3px)]",
|
|
87
|
+
headerGap: "gap-2",
|
|
88
|
+
icon: "size-4",
|
|
89
|
+
iconGlyph: "size-2.5",
|
|
90
|
+
label: "text-xs",
|
|
91
|
+
labelWrap: "gap-1.5",
|
|
92
|
+
root: "gap-2",
|
|
93
|
+
uptime: "text-xs",
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (props.size === "lg") {
|
|
98
|
+
return {
|
|
99
|
+
bar: "h-9 rounded-[4px]",
|
|
100
|
+
gap: "gap-[clamp(1px,0.32vw,5px)]",
|
|
101
|
+
headerGap: "gap-4",
|
|
102
|
+
icon: "size-6",
|
|
103
|
+
iconGlyph: "size-4",
|
|
104
|
+
label: "text-base",
|
|
105
|
+
labelWrap: "gap-2.5",
|
|
106
|
+
root: "gap-3",
|
|
107
|
+
uptime: "text-sm",
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return {
|
|
112
|
+
bar: "h-7 rounded-[4px]",
|
|
113
|
+
gap: "gap-[clamp(1px,0.28vw,4px)]",
|
|
114
|
+
headerGap: "gap-3",
|
|
115
|
+
icon: "size-5",
|
|
116
|
+
iconGlyph: "size-3.5",
|
|
117
|
+
label: "text-sm",
|
|
118
|
+
labelWrap: "gap-2",
|
|
119
|
+
root: "gap-2.5",
|
|
120
|
+
uptime: "text-sm",
|
|
121
|
+
}
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
const normalizedItems = computed<NormalizedIncidentTimelineItem[]>(() => {
|
|
125
|
+
const configuredItems = props.items ?? []
|
|
126
|
+
|
|
127
|
+
if (configuredItems.length) {
|
|
128
|
+
return configuredItems.map((item, index) => normalizeItem(item, index))
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return Array.from({ length: normalizedBarCount.value }, (_, index) =>
|
|
132
|
+
normalizeItem({
|
|
133
|
+
id: index,
|
|
134
|
+
status: props.status,
|
|
135
|
+
}, index),
|
|
136
|
+
)
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
const normalizedBarCount = computed(() =>
|
|
140
|
+
Math.max(1, Math.min(180, Math.trunc(props.barCount))),
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
const visibleItems = computed(() => {
|
|
144
|
+
if (!normalizedItems.value.length) return []
|
|
145
|
+
|
|
146
|
+
if (normalizedItems.value.length === normalizedBarCount.value) return normalizedItems.value
|
|
147
|
+
|
|
148
|
+
if (normalizedItems.value.length > normalizedBarCount.value) {
|
|
149
|
+
return normalizedItems.value.slice(-normalizedBarCount.value)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const missingCount = normalizedBarCount.value - normalizedItems.value.length
|
|
153
|
+
const generated = Array.from({ length: missingCount }, (_, index) =>
|
|
154
|
+
normalizeItem({
|
|
155
|
+
id: `generated-${index}`,
|
|
156
|
+
status: props.status,
|
|
157
|
+
}, index),
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
return [...generated, ...normalizedItems.value]
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
const overallStatus = computed(() => props.status)
|
|
164
|
+
|
|
165
|
+
const uptimeLabel = computed(() => {
|
|
166
|
+
if (props.uptime !== undefined) {
|
|
167
|
+
return typeof props.uptime === "number" ? `${formatPercent(props.uptime)}%` : props.uptime
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (!visibleItems.value.length) return ""
|
|
171
|
+
|
|
172
|
+
const operationalCount = visibleItems.value.filter((item) => item.status === "operational").length
|
|
173
|
+
const value = (operationalCount / visibleItems.value.length) * 100
|
|
174
|
+
|
|
175
|
+
return `${formatPercent(value)}%`
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
const gridStyle = computed<CSSProperties>(() => ({
|
|
179
|
+
gridTemplateColumns: `repeat(${visibleItems.value.length}, minmax(2px, 1fr))`,
|
|
180
|
+
}))
|
|
181
|
+
|
|
182
|
+
function normalizeItem(item: IncidentTimelineItem, index: number): NormalizedIncidentTimelineItem {
|
|
183
|
+
const status = item.status ?? "operational"
|
|
184
|
+
const label = item.label ?? item.title ?? `${props.operationalLabel} segment ${index + 1}`
|
|
185
|
+
|
|
186
|
+
return {
|
|
187
|
+
description: item.description,
|
|
188
|
+
id: item.id === undefined ? String(index) : String(item.id),
|
|
189
|
+
index,
|
|
190
|
+
item,
|
|
191
|
+
label,
|
|
192
|
+
status,
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function formatPercent(value: number) {
|
|
197
|
+
return new Intl.NumberFormat(undefined, {
|
|
198
|
+
maximumFractionDigits: value >= 99 ? 2 : 1,
|
|
199
|
+
minimumFractionDigits: value >= 99 ? 2 : 1,
|
|
200
|
+
}).format(value)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function statusColor(status: IncidentTimelineStatus) {
|
|
204
|
+
if (status === "outage") return "oklch(0.58 0.22 27)"
|
|
205
|
+
if (status === "partial-outage") return "oklch(0.66 0.18 60)"
|
|
206
|
+
if (status === "degraded") return "oklch(0.75 0.18 90)"
|
|
207
|
+
if (status === "maintenance") return "oklch(0.62 0.13 290)"
|
|
208
|
+
|
|
209
|
+
return "oklch(0.58 0.15 150)"
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function itemStyle(item: NormalizedIncidentTimelineItem): CSSProperties {
|
|
213
|
+
return {
|
|
214
|
+
backgroundColor: statusColor(item.status),
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function isSelected(item: NormalizedIncidentTimelineItem) {
|
|
219
|
+
return props.modelValue === item.id
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function itemLabel(item: NormalizedIncidentTimelineItem) {
|
|
223
|
+
const status = item.status.replace(/-/g, " ")
|
|
224
|
+
|
|
225
|
+
return item.description ? `${item.label}: ${status}. ${item.description}` : `${item.label}: ${status}`
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function statusLabel(status: IncidentTimelineStatus) {
|
|
229
|
+
if (status === "partial-outage") return "Partial outage"
|
|
230
|
+
|
|
231
|
+
return status.charAt(0).toUpperCase() + status.slice(1)
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function isTooltipOpen(item: NormalizedIncidentTimelineItem) {
|
|
235
|
+
return openTooltipId.value === item.id
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function handleTooltipOpen(item: NormalizedIncidentTimelineItem, open: boolean) {
|
|
239
|
+
if (open) {
|
|
240
|
+
openTooltipId.value = item.id
|
|
241
|
+
return
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (openTooltipId.value === item.id) {
|
|
245
|
+
openTooltipId.value = null
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function handleSelect(item: NormalizedIncidentTimelineItem) {
|
|
250
|
+
openTooltipId.value = item.id
|
|
251
|
+
|
|
252
|
+
if (!props.selectable) return
|
|
253
|
+
|
|
254
|
+
emit("update:modelValue", item.id)
|
|
255
|
+
emit("select", {
|
|
256
|
+
index: item.index,
|
|
257
|
+
item: item.item,
|
|
258
|
+
status: item.status,
|
|
259
|
+
})
|
|
260
|
+
}
|
|
261
|
+
</script>
|
|
262
|
+
|
|
263
|
+
<template>
|
|
264
|
+
<article
|
|
265
|
+
data-slot="incident-timeline"
|
|
266
|
+
:data-size="props.size"
|
|
267
|
+
:class="cn('flex min-w-0 flex-col bg-background text-foreground', sizeClasses.root, props.class)"
|
|
268
|
+
>
|
|
269
|
+
<header
|
|
270
|
+
data-slot="incident-timeline-header"
|
|
271
|
+
:class="cn('flex min-w-0 items-center justify-between', sizeClasses.headerGap)"
|
|
272
|
+
>
|
|
273
|
+
<div
|
|
274
|
+
data-slot="incident-timeline-label-wrap"
|
|
275
|
+
:class="cn('flex min-w-0 items-center', sizeClasses.labelWrap)"
|
|
276
|
+
>
|
|
277
|
+
<span
|
|
278
|
+
v-if="props.showIcon"
|
|
279
|
+
data-slot="incident-timeline-status-icon"
|
|
280
|
+
:class="cn('inline-flex shrink-0 items-center justify-center rounded-full text-white', sizeClasses.icon)"
|
|
281
|
+
:style="{ backgroundColor: statusColor(overallStatus) }"
|
|
282
|
+
>
|
|
283
|
+
<CheckIcon aria-hidden="true" :class="sizeClasses.iconGlyph" />
|
|
284
|
+
</span>
|
|
285
|
+
|
|
286
|
+
<h3
|
|
287
|
+
data-slot="incident-timeline-label"
|
|
288
|
+
:class="cn('min-w-0 truncate font-medium leading-none tracking-normal', sizeClasses.label)"
|
|
289
|
+
>
|
|
290
|
+
{{ props.label }}
|
|
291
|
+
</h3>
|
|
292
|
+
</div>
|
|
293
|
+
|
|
294
|
+
<p
|
|
295
|
+
v-if="props.showUptime && uptimeLabel"
|
|
296
|
+
data-slot="incident-timeline-uptime"
|
|
297
|
+
:class="cn('shrink-0 font-normal leading-none tracking-normal text-muted-foreground/45', sizeClasses.uptime)"
|
|
298
|
+
>
|
|
299
|
+
{{ uptimeLabel }}
|
|
300
|
+
</p>
|
|
301
|
+
</header>
|
|
302
|
+
|
|
303
|
+
<div
|
|
304
|
+
v-if="visibleItems.length"
|
|
305
|
+
data-slot="incident-timeline-bars"
|
|
306
|
+
>
|
|
307
|
+
<TooltipProvider>
|
|
308
|
+
<div
|
|
309
|
+
data-slot="incident-timeline-bar-grid"
|
|
310
|
+
:class="cn('grid min-w-0', sizeClasses.gap)"
|
|
311
|
+
:style="gridStyle"
|
|
312
|
+
role="list"
|
|
313
|
+
:aria-label="`${props.label} timeline`"
|
|
314
|
+
>
|
|
315
|
+
<Tooltip
|
|
316
|
+
v-for="item in visibleItems"
|
|
317
|
+
:key="item.id"
|
|
318
|
+
:open="isTooltipOpen(item)"
|
|
319
|
+
@update:open="handleTooltipOpen(item, $event)"
|
|
320
|
+
>
|
|
321
|
+
<TooltipTrigger as-child>
|
|
322
|
+
<component
|
|
323
|
+
:is="props.selectable ? 'button' : 'span'"
|
|
324
|
+
data-slot="incident-timeline-bar"
|
|
325
|
+
:type="props.selectable ? 'button' : undefined"
|
|
326
|
+
role="listitem"
|
|
327
|
+
:aria-label="itemLabel(item)"
|
|
328
|
+
:aria-selected="props.selectable ? isSelected(item) : undefined"
|
|
329
|
+
:class="
|
|
330
|
+
cn(
|
|
331
|
+
'block w-full border-0 p-0 outline-none transition-[opacity,transform] hover:opacity-80 focus-visible:ring-[3px] focus-visible:ring-ring/35',
|
|
332
|
+
isSelected(item) && 'opacity-80',
|
|
333
|
+
sizeClasses.bar,
|
|
334
|
+
)
|
|
335
|
+
"
|
|
336
|
+
:style="itemStyle(item)"
|
|
337
|
+
@click="handleSelect(item)"
|
|
338
|
+
/>
|
|
339
|
+
</TooltipTrigger>
|
|
340
|
+
<TooltipContent class="max-w-56 text-left leading-snug">
|
|
341
|
+
<span class="block font-medium">{{ item.label }}</span>
|
|
342
|
+
<span class="block text-background/75">{{ statusLabel(item.status) }}</span>
|
|
343
|
+
<span v-if="item.description" class="mt-1 block text-background/75">
|
|
344
|
+
{{ item.description }}
|
|
345
|
+
</span>
|
|
346
|
+
</TooltipContent>
|
|
347
|
+
</Tooltip>
|
|
348
|
+
</div>
|
|
349
|
+
</TooltipProvider>
|
|
350
|
+
</div>
|
|
351
|
+
|
|
352
|
+
<p
|
|
353
|
+
v-else
|
|
354
|
+
data-slot="incident-timeline-empty"
|
|
355
|
+
class="text-sm text-muted-foreground"
|
|
356
|
+
>
|
|
357
|
+
{{ props.emptyLabel }}
|
|
358
|
+
</p>
|
|
359
|
+
</article>
|
|
360
|
+
</template>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, useAttrs, useId } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
import InputControl from "./InputControl.vue"
|
|
5
|
+
import type { InputModelValue, InputProps } from "./types"
|
|
6
|
+
|
|
7
|
+
defineOptions({
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<InputProps>(), {
|
|
12
|
+
iconPosition: "start",
|
|
13
|
+
type: "text",
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const emit = defineEmits<{
|
|
17
|
+
"update:modelValue": [value: InputModelValue]
|
|
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: InputModelValue) {
|
|
57
|
+
emit("update:modelValue", value)
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<InputControl
|
|
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
|
+
:input-class="props.inputClass"
|
|
73
|
+
:invalid="props.invalid || hasError"
|
|
74
|
+
:model-value="props.modelValue"
|
|
75
|
+
:placeholder="props.placeholder"
|
|
76
|
+
:readonly="props.readonly"
|
|
77
|
+
:type="props.type"
|
|
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 ? 'input-field-group' : 'input-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="input-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="input-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
|
+
<InputControl
|
|
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
|
+
:input-class="props.inputClass"
|
|
124
|
+
:invalid="props.invalid || hasError"
|
|
125
|
+
:model-value="props.modelValue"
|
|
126
|
+
:placeholder="props.placeholder"
|
|
127
|
+
:readonly="props.readonly"
|
|
128
|
+
:type="props.type"
|
|
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="input-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="input-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,135 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, useAttrs } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
import type { InputControlProps, InputModelValue } from "./types"
|
|
5
|
+
|
|
6
|
+
defineOptions({
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<InputControlProps>(), {
|
|
11
|
+
iconPosition: "start",
|
|
12
|
+
type: "text",
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const emit = defineEmits<{
|
|
16
|
+
"update:modelValue": [value: InputModelValue]
|
|
17
|
+
input: [event: Event]
|
|
18
|
+
change: [event: Event]
|
|
19
|
+
}>()
|
|
20
|
+
|
|
21
|
+
const attrs = useAttrs()
|
|
22
|
+
|
|
23
|
+
const isFileInput = computed(() => props.type === "file")
|
|
24
|
+
const hasIcon = computed(() => Boolean(props.icon))
|
|
25
|
+
const inputValue = computed(() => {
|
|
26
|
+
if (isFileInput.value) return undefined
|
|
27
|
+
|
|
28
|
+
return props.modelValue ?? props.defaultValue ?? ""
|
|
29
|
+
})
|
|
30
|
+
const valueBinding = computed(() =>
|
|
31
|
+
isFileInput.value ? {} : { value: inputValue.value },
|
|
32
|
+
)
|
|
33
|
+
const controlAttrs = computed(() => ({
|
|
34
|
+
...attrs,
|
|
35
|
+
...valueBinding.value,
|
|
36
|
+
}))
|
|
37
|
+
|
|
38
|
+
const inputClasses = computed(() =>
|
|
39
|
+
cn(
|
|
40
|
+
"border-input bg-background text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none file:mr-3 file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground 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",
|
|
41
|
+
isFileInput.value && "cursor-pointer",
|
|
42
|
+
hasIcon.value
|
|
43
|
+
&& "border-0 bg-transparent px-0 shadow-none focus-visible:border-transparent focus-visible:ring-0",
|
|
44
|
+
props.inputClass,
|
|
45
|
+
!hasIcon.value && props.class,
|
|
46
|
+
),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
const wrapperClasses = computed(() =>
|
|
50
|
+
cn(
|
|
51
|
+
"border-input bg-background text-foreground focus-within:border-ring focus-within:ring-ring/50 flex h-9 w-full min-w-0 items-center gap-2 rounded-md border px-3 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",
|
|
52
|
+
props.class,
|
|
53
|
+
),
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
function getInputModelValue(target: HTMLInputElement) {
|
|
57
|
+
if (isFileInput.value) return target.files
|
|
58
|
+
if (props.type === "number") return target.value === "" ? "" : target.valueAsNumber
|
|
59
|
+
|
|
60
|
+
return target.value
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function handleInput(event: Event) {
|
|
64
|
+
const target = event.target as HTMLInputElement
|
|
65
|
+
|
|
66
|
+
if (!isFileInput.value) {
|
|
67
|
+
emit("update:modelValue", getInputModelValue(target))
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
emit("input", event)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function handleChange(event: Event) {
|
|
74
|
+
const target = event.target as HTMLInputElement
|
|
75
|
+
|
|
76
|
+
if (isFileInput.value) {
|
|
77
|
+
emit("update:modelValue", getInputModelValue(target))
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
emit("change", event)
|
|
81
|
+
}
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<template>
|
|
85
|
+
<div
|
|
86
|
+
v-if="hasIcon"
|
|
87
|
+
data-slot="input-wrapper"
|
|
88
|
+
:class="wrapperClasses"
|
|
89
|
+
>
|
|
90
|
+
<component
|
|
91
|
+
:is="props.icon"
|
|
92
|
+
v-if="props.iconPosition === 'start'"
|
|
93
|
+
aria-hidden="true"
|
|
94
|
+
data-slot="input-icon"
|
|
95
|
+
:class="cn('size-4 shrink-0 text-muted-foreground', props.iconClass)"
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<input
|
|
99
|
+
v-bind="controlAttrs"
|
|
100
|
+
:id="props.id"
|
|
101
|
+
data-slot="input"
|
|
102
|
+
:aria-invalid="props.invalid ? true : undefined"
|
|
103
|
+
:class="inputClasses"
|
|
104
|
+
:disabled="props.disabled"
|
|
105
|
+
:placeholder="props.placeholder"
|
|
106
|
+
:readonly="props.readonly"
|
|
107
|
+
:type="props.type"
|
|
108
|
+
@change="handleChange"
|
|
109
|
+
@input="handleInput"
|
|
110
|
+
>
|
|
111
|
+
|
|
112
|
+
<component
|
|
113
|
+
:is="props.icon"
|
|
114
|
+
v-if="props.iconPosition === 'end'"
|
|
115
|
+
aria-hidden="true"
|
|
116
|
+
data-slot="input-icon"
|
|
117
|
+
:class="cn('size-4 shrink-0 text-muted-foreground', props.iconClass)"
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<input
|
|
122
|
+
v-else
|
|
123
|
+
v-bind="controlAttrs"
|
|
124
|
+
:id="props.id"
|
|
125
|
+
data-slot="input"
|
|
126
|
+
:aria-invalid="props.invalid ? true : undefined"
|
|
127
|
+
:class="inputClasses"
|
|
128
|
+
:disabled="props.disabled"
|
|
129
|
+
:placeholder="props.placeholder"
|
|
130
|
+
:readonly="props.readonly"
|
|
131
|
+
:type="props.type"
|
|
132
|
+
@change="handleChange"
|
|
133
|
+
@input="handleInput"
|
|
134
|
+
>
|
|
135
|
+
</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="input-field-group" :class="cn('grid gap-4', props.class)">
|
|
12
|
+
<slot />
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Input } from "./Input.vue"
|
|
2
|
+
export { default as InputControl } from "./InputControl.vue"
|
|
3
|
+
export { default as InputFieldGroup } from "./InputFieldGroup.vue"
|
|
4
|
+
export type {
|
|
5
|
+
InputControlProps,
|
|
6
|
+
InputIconPosition,
|
|
7
|
+
InputModelValue,
|
|
8
|
+
InputProps,
|
|
9
|
+
} from "./types"
|