@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,649 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { computed, ref, watch } from "vue"
|
|
4
|
+
import {
|
|
5
|
+
CalendarIcon,
|
|
6
|
+
ChevronLeftIcon,
|
|
7
|
+
ChevronRightIcon,
|
|
8
|
+
ClockIcon,
|
|
9
|
+
} from "@lucide/vue"
|
|
10
|
+
import {
|
|
11
|
+
PopoverContent,
|
|
12
|
+
PopoverPortal,
|
|
13
|
+
PopoverRoot,
|
|
14
|
+
PopoverTrigger,
|
|
15
|
+
} from "reka-ui"
|
|
16
|
+
import { cn } from "@/lib/utils"
|
|
17
|
+
|
|
18
|
+
export type DatePickerMode = "single" | "range" | "time"
|
|
19
|
+
|
|
20
|
+
export interface DatePickerSingleObjectValue {
|
|
21
|
+
date?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface DatePickerRangeObjectValue {
|
|
25
|
+
start?: string
|
|
26
|
+
end?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type DatePickerValue =
|
|
30
|
+
| string
|
|
31
|
+
| DatePickerSingleObjectValue
|
|
32
|
+
| DatePickerRangeObjectValue
|
|
33
|
+
| null
|
|
34
|
+
|
|
35
|
+
defineOptions({
|
|
36
|
+
inheritAttrs: false,
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const props = withDefaults(
|
|
40
|
+
defineProps<{
|
|
41
|
+
class?: HTMLAttributes["class"]
|
|
42
|
+
contentClass?: HTMLAttributes["class"]
|
|
43
|
+
disabled?: boolean
|
|
44
|
+
max?: string
|
|
45
|
+
min?: string
|
|
46
|
+
mode?: DatePickerMode
|
|
47
|
+
modelValue?: DatePickerValue
|
|
48
|
+
placeholder?: string
|
|
49
|
+
range?: boolean
|
|
50
|
+
timePlaceholder?: string
|
|
51
|
+
}>(),
|
|
52
|
+
{
|
|
53
|
+
mode: "single",
|
|
54
|
+
placeholder: "Pick a date",
|
|
55
|
+
range: false,
|
|
56
|
+
timePlaceholder: "Pick time",
|
|
57
|
+
},
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
const emit = defineEmits<{
|
|
61
|
+
"update:modelValue": [value: DatePickerValue]
|
|
62
|
+
change: [value: DatePickerValue]
|
|
63
|
+
}>()
|
|
64
|
+
|
|
65
|
+
const open = ref(false)
|
|
66
|
+
const dateValue = ref("")
|
|
67
|
+
const startValue = ref("")
|
|
68
|
+
const endValue = ref("")
|
|
69
|
+
const hoveredDate = ref("")
|
|
70
|
+
const timeHour = ref("")
|
|
71
|
+
const timeMinute = ref("")
|
|
72
|
+
const timeMinuteInput = ref<HTMLInputElement | null>(null)
|
|
73
|
+
const visibleMonth = ref(getMonthDate(new Date()))
|
|
74
|
+
|
|
75
|
+
const isRange = computed(() => props.range || props.mode === "range")
|
|
76
|
+
const isTimeOnly = computed(() => props.mode === "time")
|
|
77
|
+
|
|
78
|
+
const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
|
|
79
|
+
|
|
80
|
+
const calendarTitle = computed(() =>
|
|
81
|
+
new Intl.DateTimeFormat(undefined, {
|
|
82
|
+
month: "long",
|
|
83
|
+
year: "numeric",
|
|
84
|
+
}).format(visibleMonth.value),
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
const calendarDays = computed(() => {
|
|
88
|
+
const year = visibleMonth.value.getFullYear()
|
|
89
|
+
const month = visibleMonth.value.getMonth()
|
|
90
|
+
const firstDay = new Date(year, month, 1)
|
|
91
|
+
const gridStart = new Date(year, month, 1 - firstDay.getDay())
|
|
92
|
+
const rangeBounds = getActiveRangeBounds()
|
|
93
|
+
const today = formatLocalDate(new Date())
|
|
94
|
+
|
|
95
|
+
return Array.from({ length: 42 }, (_, index) => {
|
|
96
|
+
const day = new Date(
|
|
97
|
+
gridStart.getFullYear(),
|
|
98
|
+
gridStart.getMonth(),
|
|
99
|
+
gridStart.getDate() + index,
|
|
100
|
+
)
|
|
101
|
+
const value = formatLocalDate(day)
|
|
102
|
+
const selected = isDateSelected(value)
|
|
103
|
+
const rangeActive = selected || isDateInRange(value) || isDateInPreviewRange(value)
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
currentMonth: day.getMonth() === month,
|
|
107
|
+
date: value,
|
|
108
|
+
day: day.getDate(),
|
|
109
|
+
disabled: isDateDisabled(value),
|
|
110
|
+
rangeActive,
|
|
111
|
+
rangeEnd: rangeActive && rangeBounds?.end === value,
|
|
112
|
+
rangeStart: rangeActive && rangeBounds?.start === value,
|
|
113
|
+
selected,
|
|
114
|
+
today: value === today,
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
const displayValue = computed(() => {
|
|
120
|
+
if (isRange.value) {
|
|
121
|
+
const rangeLabel = [
|
|
122
|
+
formatDateLabel(startValue.value),
|
|
123
|
+
formatDateLabel(endValue.value),
|
|
124
|
+
].filter(Boolean).join(" - ")
|
|
125
|
+
|
|
126
|
+
return rangeLabel
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return formatDateLabel(dateValue.value)
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
const hasDisplayValue = computed(() => displayValue.value.length > 0)
|
|
133
|
+
|
|
134
|
+
function extractDatePart(value: string) {
|
|
135
|
+
const match = value.match(/\d{4}-\d{2}-\d{2}/)
|
|
136
|
+
|
|
137
|
+
return match?.[0] ?? ""
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function extractTimePart(value: string) {
|
|
141
|
+
const match = value.match(/(?:T|\s)?(\d{2}:\d{2})/)
|
|
142
|
+
|
|
143
|
+
return match?.[1] ?? ""
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function formatLocalDate(date: Date) {
|
|
147
|
+
const year = date.getFullYear()
|
|
148
|
+
const month = String(date.getMonth() + 1).padStart(2, "0")
|
|
149
|
+
const day = String(date.getDate()).padStart(2, "0")
|
|
150
|
+
|
|
151
|
+
return `${year}-${month}-${day}`
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function parseLocalDate(value: string) {
|
|
155
|
+
const [year, month, day] = value.split("-").map(Number)
|
|
156
|
+
|
|
157
|
+
if (!year || !month || !day) return null
|
|
158
|
+
|
|
159
|
+
return new Date(year, month - 1, day)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function getMonthDate(date: Date) {
|
|
163
|
+
return new Date(date.getFullYear(), date.getMonth(), 1)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function getTimeParts(value: string) {
|
|
167
|
+
const [hour = "", minute = ""] = value.split(":")
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
hour,
|
|
171
|
+
minute,
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function sanitizeTimeInput(value: string) {
|
|
176
|
+
return value.replace(/\D/g, "").slice(0, 2)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function normalizeTimeInput(value: string, max: number) {
|
|
180
|
+
if (!value) return ""
|
|
181
|
+
|
|
182
|
+
const number = Number(value)
|
|
183
|
+
|
|
184
|
+
if (Number.isNaN(number)) return ""
|
|
185
|
+
|
|
186
|
+
return String(Math.min(number, max)).padStart(2, "0")
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function getCompleteTimeValue() {
|
|
190
|
+
if (!timeHour.value || !timeMinute.value) return ""
|
|
191
|
+
|
|
192
|
+
const hour = normalizeTimeInput(timeHour.value, 23)
|
|
193
|
+
const minute = normalizeTimeInput(timeMinute.value, 59)
|
|
194
|
+
|
|
195
|
+
if (!hour || !minute) return ""
|
|
196
|
+
|
|
197
|
+
return `${hour}:${minute}`
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function setTimeModelValue(value: string | null) {
|
|
201
|
+
emit("update:modelValue", value)
|
|
202
|
+
emit("change", value)
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function emitCompleteTimeValue() {
|
|
206
|
+
const value = getCompleteTimeValue()
|
|
207
|
+
|
|
208
|
+
if (!value || timeHour.value.length < 2 || timeMinute.value.length < 2) return
|
|
209
|
+
|
|
210
|
+
const [hour, minute] = value.split(":")
|
|
211
|
+
|
|
212
|
+
timeHour.value = hour
|
|
213
|
+
timeMinute.value = minute
|
|
214
|
+
setTimeModelValue(value)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function handleTimeInput(part: "hour" | "minute", event: Event) {
|
|
218
|
+
if (props.disabled) return
|
|
219
|
+
|
|
220
|
+
const value = sanitizeTimeInput((event.target as HTMLInputElement).value)
|
|
221
|
+
|
|
222
|
+
if (part === "hour") {
|
|
223
|
+
timeHour.value = value
|
|
224
|
+
|
|
225
|
+
if (value.length === 2) {
|
|
226
|
+
timeMinuteInput.value?.focus()
|
|
227
|
+
}
|
|
228
|
+
} else {
|
|
229
|
+
timeMinute.value = value
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
emitCompleteTimeValue()
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function commitTimeInput(part: "hour" | "minute") {
|
|
236
|
+
if (props.disabled) return
|
|
237
|
+
|
|
238
|
+
if (part === "hour") {
|
|
239
|
+
timeHour.value = normalizeTimeInput(timeHour.value, 23)
|
|
240
|
+
} else {
|
|
241
|
+
timeMinute.value = normalizeTimeInput(timeMinute.value, 59)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const value = getCompleteTimeValue()
|
|
245
|
+
|
|
246
|
+
if (value) {
|
|
247
|
+
const [hour, minute] = value.split(":")
|
|
248
|
+
|
|
249
|
+
timeHour.value = hour
|
|
250
|
+
timeMinute.value = minute
|
|
251
|
+
setTimeModelValue(value)
|
|
252
|
+
return
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (!timeHour.value && !timeMinute.value) {
|
|
256
|
+
setTimeModelValue(null)
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function selectInputText(event: FocusEvent) {
|
|
261
|
+
const input = event.target as HTMLInputElement
|
|
262
|
+
|
|
263
|
+
input.select()
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function formatDateLabel(value: string) {
|
|
267
|
+
if (!value) return ""
|
|
268
|
+
|
|
269
|
+
const [year, month, day] = value.split("-").map(Number)
|
|
270
|
+
|
|
271
|
+
if (!year || !month || !day) return value
|
|
272
|
+
|
|
273
|
+
return new Intl.DateTimeFormat(undefined, {
|
|
274
|
+
day: "numeric",
|
|
275
|
+
month: "short",
|
|
276
|
+
year: "numeric",
|
|
277
|
+
}).format(new Date(year, month - 1, day))
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function setVisibleMonthFromValue(value: string) {
|
|
281
|
+
const date = parseLocalDate(value)
|
|
282
|
+
|
|
283
|
+
if (!date) return
|
|
284
|
+
|
|
285
|
+
visibleMonth.value = getMonthDate(date)
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
function isDateDisabled(value: string) {
|
|
289
|
+
return Boolean(
|
|
290
|
+
(props.min && value < props.min)
|
|
291
|
+
|| (props.max && value > props.max),
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function isDateSelected(value: string) {
|
|
296
|
+
if (isRange.value) {
|
|
297
|
+
return value === startValue.value || value === endValue.value
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return value === dateValue.value
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function isDateInRange(value: string) {
|
|
304
|
+
if (!isRange.value || !startValue.value || !endValue.value) return false
|
|
305
|
+
|
|
306
|
+
return value > startValue.value && value < endValue.value
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function isDateInPreviewRange(value: string) {
|
|
310
|
+
if (
|
|
311
|
+
!isRange.value
|
|
312
|
+
|| !startValue.value
|
|
313
|
+
|| endValue.value
|
|
314
|
+
|| !hoveredDate.value
|
|
315
|
+
) {
|
|
316
|
+
return false
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const start = startValue.value < hoveredDate.value
|
|
320
|
+
? startValue.value
|
|
321
|
+
: hoveredDate.value
|
|
322
|
+
const end = startValue.value < hoveredDate.value
|
|
323
|
+
? hoveredDate.value
|
|
324
|
+
: startValue.value
|
|
325
|
+
|
|
326
|
+
return value >= start && value <= end
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function getActiveRangeBounds() {
|
|
330
|
+
if (!isRange.value || !startValue.value) return null
|
|
331
|
+
|
|
332
|
+
const boundary = endValue.value || hoveredDate.value || startValue.value
|
|
333
|
+
|
|
334
|
+
return startValue.value <= boundary
|
|
335
|
+
? { start: startValue.value, end: boundary }
|
|
336
|
+
: { start: boundary, end: startValue.value }
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
function moveMonth(months: number) {
|
|
340
|
+
visibleMonth.value = new Date(
|
|
341
|
+
visibleMonth.value.getFullYear(),
|
|
342
|
+
visibleMonth.value.getMonth() + months,
|
|
343
|
+
1,
|
|
344
|
+
)
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function selectCalendarDate(value: string) {
|
|
348
|
+
if (props.disabled || isDateDisabled(value)) return
|
|
349
|
+
|
|
350
|
+
let shouldClose = false
|
|
351
|
+
hoveredDate.value = ""
|
|
352
|
+
|
|
353
|
+
if (isRange.value) {
|
|
354
|
+
if (!startValue.value || endValue.value) {
|
|
355
|
+
startValue.value = value
|
|
356
|
+
endValue.value = ""
|
|
357
|
+
} else if (value < startValue.value) {
|
|
358
|
+
endValue.value = startValue.value
|
|
359
|
+
startValue.value = value
|
|
360
|
+
shouldClose = true
|
|
361
|
+
} else {
|
|
362
|
+
endValue.value = value
|
|
363
|
+
shouldClose = true
|
|
364
|
+
}
|
|
365
|
+
} else {
|
|
366
|
+
dateValue.value = value
|
|
367
|
+
shouldClose = true
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
setVisibleMonthFromValue(value)
|
|
371
|
+
emitValue()
|
|
372
|
+
|
|
373
|
+
if (shouldClose) {
|
|
374
|
+
open.value = false
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function setRangeHoveredDate(value: string) {
|
|
379
|
+
if (
|
|
380
|
+
!isRange.value
|
|
381
|
+
|| !startValue.value
|
|
382
|
+
|| endValue.value
|
|
383
|
+
|| isDateDisabled(value)
|
|
384
|
+
) {
|
|
385
|
+
return
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
hoveredDate.value = value
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
function clearRangeHoveredDate() {
|
|
392
|
+
hoveredDate.value = ""
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
function syncFromModelValue(value: DatePickerValue | undefined) {
|
|
396
|
+
dateValue.value = ""
|
|
397
|
+
startValue.value = ""
|
|
398
|
+
endValue.value = ""
|
|
399
|
+
hoveredDate.value = ""
|
|
400
|
+
timeHour.value = ""
|
|
401
|
+
timeMinute.value = ""
|
|
402
|
+
|
|
403
|
+
if (!value) return
|
|
404
|
+
|
|
405
|
+
if (typeof value === "string") {
|
|
406
|
+
if (isTimeOnly.value) {
|
|
407
|
+
const timeParts = getTimeParts(extractTimePart(value))
|
|
408
|
+
|
|
409
|
+
timeHour.value = timeParts.hour
|
|
410
|
+
timeMinute.value = timeParts.minute
|
|
411
|
+
return
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (isRange.value) {
|
|
415
|
+
startValue.value = extractDatePart(value)
|
|
416
|
+
return
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
dateValue.value = extractDatePart(value)
|
|
420
|
+
if (dateValue.value) setVisibleMonthFromValue(dateValue.value)
|
|
421
|
+
return
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (isRange.value) {
|
|
425
|
+
const rangeValue = value as DatePickerRangeObjectValue
|
|
426
|
+
|
|
427
|
+
startValue.value = rangeValue.start ? extractDatePart(rangeValue.start) : ""
|
|
428
|
+
endValue.value = rangeValue.end ? extractDatePart(rangeValue.end) : ""
|
|
429
|
+
if (startValue.value || endValue.value) {
|
|
430
|
+
setVisibleMonthFromValue(startValue.value || endValue.value)
|
|
431
|
+
}
|
|
432
|
+
return
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
const singleValue = value as DatePickerSingleObjectValue
|
|
436
|
+
|
|
437
|
+
dateValue.value = singleValue.date ? extractDatePart(singleValue.date) : ""
|
|
438
|
+
if (dateValue.value) setVisibleMonthFromValue(dateValue.value)
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
function createModelValue(): DatePickerValue {
|
|
442
|
+
if (isTimeOnly.value) return getCompleteTimeValue() || null
|
|
443
|
+
|
|
444
|
+
if (isRange.value) {
|
|
445
|
+
const next: DatePickerRangeObjectValue = {}
|
|
446
|
+
|
|
447
|
+
if (startValue.value) next.start = startValue.value
|
|
448
|
+
if (endValue.value) next.end = endValue.value
|
|
449
|
+
|
|
450
|
+
return Object.keys(next).length ? next : null
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
return dateValue.value || null
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
function emitValue() {
|
|
457
|
+
const value = createModelValue()
|
|
458
|
+
|
|
459
|
+
emit("update:modelValue", value)
|
|
460
|
+
emit("change", value)
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
watch(
|
|
464
|
+
() => [props.modelValue, props.mode, props.range] as const,
|
|
465
|
+
([value]) => syncFromModelValue(value),
|
|
466
|
+
{ deep: true, immediate: true },
|
|
467
|
+
)
|
|
468
|
+
</script>
|
|
469
|
+
|
|
470
|
+
<template>
|
|
471
|
+
<div
|
|
472
|
+
v-if="isTimeOnly"
|
|
473
|
+
v-bind="$attrs"
|
|
474
|
+
data-slot="date-picker-time-field"
|
|
475
|
+
role="group"
|
|
476
|
+
:aria-disabled="props.disabled ? 'true' : undefined"
|
|
477
|
+
:aria-label="props.timePlaceholder"
|
|
478
|
+
:class="
|
|
479
|
+
cn(
|
|
480
|
+
'border-input bg-background text-foreground focus-within:border-ring focus-within:ring-ring/50 flex h-9 w-full items-center gap-2 rounded-md border px-3 py-1 shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]',
|
|
481
|
+
props.disabled && 'cursor-not-allowed opacity-50',
|
|
482
|
+
props.class,
|
|
483
|
+
)
|
|
484
|
+
"
|
|
485
|
+
>
|
|
486
|
+
<ClockIcon aria-hidden="true" class="size-4 shrink-0 text-muted-foreground" />
|
|
487
|
+
|
|
488
|
+
<input
|
|
489
|
+
data-slot="date-picker-hour-input"
|
|
490
|
+
:value="timeHour"
|
|
491
|
+
:disabled="props.disabled"
|
|
492
|
+
aria-label="Hour"
|
|
493
|
+
autocomplete="off"
|
|
494
|
+
class="h-7 w-8 bg-transparent text-center text-sm font-medium tabular-nums outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed"
|
|
495
|
+
inputmode="numeric"
|
|
496
|
+
maxlength="2"
|
|
497
|
+
pattern="[0-9]*"
|
|
498
|
+
placeholder="HH"
|
|
499
|
+
type="text"
|
|
500
|
+
@blur="commitTimeInput('hour')"
|
|
501
|
+
@focus="selectInputText"
|
|
502
|
+
@input="handleTimeInput('hour', $event)"
|
|
503
|
+
/>
|
|
504
|
+
|
|
505
|
+
<span aria-hidden="true" class="text-sm font-medium text-muted-foreground">
|
|
506
|
+
:
|
|
507
|
+
</span>
|
|
508
|
+
|
|
509
|
+
<input
|
|
510
|
+
ref="timeMinuteInput"
|
|
511
|
+
data-slot="date-picker-minute-input"
|
|
512
|
+
:value="timeMinute"
|
|
513
|
+
:disabled="props.disabled"
|
|
514
|
+
aria-label="Minute"
|
|
515
|
+
autocomplete="off"
|
|
516
|
+
class="h-7 w-8 bg-transparent text-center text-sm font-medium tabular-nums outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed"
|
|
517
|
+
inputmode="numeric"
|
|
518
|
+
maxlength="2"
|
|
519
|
+
pattern="[0-9]*"
|
|
520
|
+
placeholder="MM"
|
|
521
|
+
type="text"
|
|
522
|
+
@blur="commitTimeInput('minute')"
|
|
523
|
+
@focus="selectInputText"
|
|
524
|
+
@input="handleTimeInput('minute', $event)"
|
|
525
|
+
/>
|
|
526
|
+
</div>
|
|
527
|
+
|
|
528
|
+
<PopoverRoot v-else v-model:open="open">
|
|
529
|
+
<PopoverTrigger as-child>
|
|
530
|
+
<button
|
|
531
|
+
v-bind="$attrs"
|
|
532
|
+
data-slot="date-picker-trigger"
|
|
533
|
+
type="button"
|
|
534
|
+
:disabled="props.disabled"
|
|
535
|
+
:class="
|
|
536
|
+
cn(
|
|
537
|
+
'border-input bg-background text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 flex h-9 w-full items-center justify-start gap-2 rounded-md border px-3 py-2 text-left text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
|
|
538
|
+
!hasDisplayValue && 'text-muted-foreground',
|
|
539
|
+
props.class,
|
|
540
|
+
)
|
|
541
|
+
"
|
|
542
|
+
>
|
|
543
|
+
<CalendarIcon aria-hidden="true" class="size-4 shrink-0" />
|
|
544
|
+
<span class="min-w-0 flex-1 truncate">
|
|
545
|
+
{{ hasDisplayValue ? displayValue : props.placeholder }}
|
|
546
|
+
</span>
|
|
547
|
+
</button>
|
|
548
|
+
</PopoverTrigger>
|
|
549
|
+
|
|
550
|
+
<PopoverPortal>
|
|
551
|
+
<PopoverContent
|
|
552
|
+
data-slot="date-picker-content"
|
|
553
|
+
align="start"
|
|
554
|
+
:side-offset="4"
|
|
555
|
+
:class="
|
|
556
|
+
cn(
|
|
557
|
+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 max-w-[calc(100vw-2rem)] rounded-md border p-3 shadow-md outline-none',
|
|
558
|
+
props.contentClass,
|
|
559
|
+
)
|
|
560
|
+
"
|
|
561
|
+
>
|
|
562
|
+
<div data-slot="date-picker-panel" class="flex flex-col gap-3">
|
|
563
|
+
<div data-slot="date-picker-calendar" class="grid gap-3">
|
|
564
|
+
<div class="flex items-center justify-between">
|
|
565
|
+
<button
|
|
566
|
+
data-slot="date-picker-prev-month"
|
|
567
|
+
type="button"
|
|
568
|
+
aria-label="Previous month"
|
|
569
|
+
class="hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring inline-flex size-8 items-center justify-center rounded-md text-foreground transition-colors outline-none focus-visible:ring-2"
|
|
570
|
+
@click="moveMonth(-1)"
|
|
571
|
+
>
|
|
572
|
+
<ChevronLeftIcon aria-hidden="true" class="size-4" />
|
|
573
|
+
</button>
|
|
574
|
+
|
|
575
|
+
<div
|
|
576
|
+
data-slot="date-picker-calendar-heading"
|
|
577
|
+
class="text-base font-semibold"
|
|
578
|
+
>
|
|
579
|
+
{{ calendarTitle }}
|
|
580
|
+
</div>
|
|
581
|
+
|
|
582
|
+
<button
|
|
583
|
+
data-slot="date-picker-next-month"
|
|
584
|
+
type="button"
|
|
585
|
+
aria-label="Next month"
|
|
586
|
+
class="hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring inline-flex size-8 items-center justify-center rounded-md text-foreground transition-colors outline-none focus-visible:ring-2"
|
|
587
|
+
@click="moveMonth(1)"
|
|
588
|
+
>
|
|
589
|
+
<ChevronRightIcon aria-hidden="true" class="size-4" />
|
|
590
|
+
</button>
|
|
591
|
+
</div>
|
|
592
|
+
|
|
593
|
+
<div
|
|
594
|
+
data-slot="date-picker-weekdays"
|
|
595
|
+
class="grid grid-cols-7 gap-1 text-center text-xs font-medium text-muted-foreground"
|
|
596
|
+
>
|
|
597
|
+
<span v-for="day in weekDays" :key="day">
|
|
598
|
+
{{ day }}
|
|
599
|
+
</span>
|
|
600
|
+
</div>
|
|
601
|
+
|
|
602
|
+
<div
|
|
603
|
+
data-slot="date-picker-days"
|
|
604
|
+
:class="cn('grid grid-cols-7', isRange ? 'gap-0' : 'gap-1')"
|
|
605
|
+
@mouseleave="clearRangeHoveredDate"
|
|
606
|
+
>
|
|
607
|
+
<button
|
|
608
|
+
v-for="day in calendarDays"
|
|
609
|
+
:key="day.date"
|
|
610
|
+
data-slot="date-picker-day"
|
|
611
|
+
type="button"
|
|
612
|
+
:aria-label="formatDateLabel(day.date)"
|
|
613
|
+
:aria-current="day.today ? 'date' : undefined"
|
|
614
|
+
:aria-pressed="day.selected"
|
|
615
|
+
:disabled="day.disabled"
|
|
616
|
+
:class="
|
|
617
|
+
cn(
|
|
618
|
+
'hover:bg-accent hover:text-accent-foreground focus-visible:ring-ring relative flex h-8 w-full items-center justify-center rounded-md text-sm font-medium transition-colors outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-40',
|
|
619
|
+
!day.currentMonth && !day.rangeActive && 'text-muted-foreground/60',
|
|
620
|
+
day.rangeActive && 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground',
|
|
621
|
+
isRange && day.rangeActive && 'rounded-none',
|
|
622
|
+
isRange && day.rangeStart && !day.rangeEnd && 'rounded-l-md',
|
|
623
|
+
isRange && day.rangeEnd && !day.rangeStart && 'rounded-r-md',
|
|
624
|
+
isRange && day.rangeStart && day.rangeEnd && 'rounded-md',
|
|
625
|
+
)
|
|
626
|
+
"
|
|
627
|
+
@click="selectCalendarDate(day.date)"
|
|
628
|
+
@focus="setRangeHoveredDate(day.date)"
|
|
629
|
+
@mouseenter="setRangeHoveredDate(day.date)"
|
|
630
|
+
>
|
|
631
|
+
<span>{{ day.day }}</span>
|
|
632
|
+
<span
|
|
633
|
+
v-if="day.today"
|
|
634
|
+
aria-hidden="true"
|
|
635
|
+
:class="
|
|
636
|
+
cn(
|
|
637
|
+
'absolute bottom-0.5 left-1/2 size-1 -translate-x-1/2 rounded-full',
|
|
638
|
+
day.rangeActive ? 'bg-primary-foreground' : 'bg-primary',
|
|
639
|
+
)
|
|
640
|
+
"
|
|
641
|
+
/>
|
|
642
|
+
</button>
|
|
643
|
+
</div>
|
|
644
|
+
</div>
|
|
645
|
+
</div>
|
|
646
|
+
</PopoverContent>
|
|
647
|
+
</PopoverPortal>
|
|
648
|
+
</PopoverRoot>
|
|
649
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogRootEmits, DialogRootProps } from "reka-ui"
|
|
3
|
+
import { DialogRoot, useForwardPropsEmits } from "reka-ui"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogRootProps>()
|
|
6
|
+
const emits = defineEmits<DialogRootEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DialogRoot
|
|
13
|
+
v-slot="slotProps"
|
|
14
|
+
data-slot="dialog"
|
|
15
|
+
v-bind="forwarded"
|
|
16
|
+
>
|
|
17
|
+
<slot v-bind="slotProps" />
|
|
18
|
+
</DialogRoot>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogCloseProps } from "reka-ui"
|
|
3
|
+
import { DialogClose, useForwardProps } from "reka-ui"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogCloseProps>()
|
|
6
|
+
|
|
7
|
+
const forwardedProps = useForwardProps(props)
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<DialogClose
|
|
12
|
+
data-slot="dialog-close"
|
|
13
|
+
v-bind="forwardedProps"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</DialogClose>
|
|
17
|
+
</template>
|