@spavn/ui 0.0.1
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/cli/commands/add.d.ts +5 -0
- package/cli/commands/add.d.ts.map +1 -0
- package/cli/commands/add.js +104 -0
- package/cli/commands/add.js.map +1 -0
- package/cli/commands/init.d.ts +5 -0
- package/cli/commands/init.d.ts.map +1 -0
- package/cli/commands/init.js +129 -0
- package/cli/commands/init.js.map +1 -0
- package/cli/index.d.ts +3 -0
- package/cli/index.d.ts.map +1 -0
- package/cli/index.js +27 -0
- package/cli/index.js.map +1 -0
- package/cli/registry.d.ts +12 -0
- package/cli/registry.d.ts.map +1 -0
- package/cli/registry.js +1112 -0
- package/cli/registry.js.map +1 -0
- package/dist/index.js +7492 -0
- package/dist/index.umd.cjs +122 -0
- package/dist/style.css +1 -0
- package/mcp-server/index.d.ts +3 -0
- package/mcp-server/index.d.ts.map +1 -0
- package/mcp-server/index.js +1266 -0
- package/mcp-server/index.js.map +1 -0
- package/package.json +91 -0
- package/src/index.ts +432 -0
- package/src/lib/accordion/Accordion.test.ts +109 -0
- package/src/lib/accordion/Accordion.vue +11 -0
- package/src/lib/accordion/AccordionContent.vue +23 -0
- package/src/lib/accordion/AccordionItem.vue +16 -0
- package/src/lib/accordion/AccordionTrigger.vue +37 -0
- package/src/lib/accordion/index.ts +4 -0
- package/src/lib/alert/Alert.test.ts +144 -0
- package/src/lib/alert/Alert.vue +17 -0
- package/src/lib/alert/AlertDescription.vue +15 -0
- package/src/lib/alert/AlertTitle.vue +15 -0
- package/src/lib/alert/variants.test.ts +47 -0
- package/src/lib/alert/variants.ts +19 -0
- package/src/lib/alert-dialog/AlertDialog.vue +11 -0
- package/src/lib/alert-dialog/AlertDialogAction.vue +23 -0
- package/src/lib/alert-dialog/AlertDialogCancel.vue +24 -0
- package/src/lib/alert-dialog/AlertDialogContent.vue +33 -0
- package/src/lib/alert-dialog/AlertDialogDescription.vue +16 -0
- package/src/lib/alert-dialog/AlertDialogFooter.vue +17 -0
- package/src/lib/alert-dialog/AlertDialogHeader.vue +17 -0
- package/src/lib/alert-dialog/AlertDialogOverlay.vue +21 -0
- package/src/lib/alert-dialog/AlertDialogPortal.vue +11 -0
- package/src/lib/alert-dialog/AlertDialogTitle.vue +16 -0
- package/src/lib/alert-dialog/AlertDialogTrigger.vue +11 -0
- package/src/lib/alert-dialog/index.ts +11 -0
- package/src/lib/aspect-ratio/AspectRatio.vue +11 -0
- package/src/lib/aspect-ratio/index.ts +1 -0
- package/src/lib/avatar/Avatar.test.ts +58 -0
- package/src/lib/avatar/Avatar.vue +20 -0
- package/src/lib/avatar/AvatarFallback.vue +20 -0
- package/src/lib/avatar/AvatarImage.vue +10 -0
- package/src/lib/avatar/index.ts +3 -0
- package/src/lib/badge/Badge.test.ts +77 -0
- package/src/lib/badge/Badge.vue +20 -0
- package/src/lib/badge/index.ts +2 -0
- package/src/lib/badge/variants.test.ts +73 -0
- package/src/lib/badge/variants.ts +26 -0
- package/src/lib/breadcrumb/Breadcrumb.vue +13 -0
- package/src/lib/breadcrumb/BreadcrumbEllipsis.vue +35 -0
- package/src/lib/breadcrumb/BreadcrumbItem.vue +15 -0
- package/src/lib/breadcrumb/BreadcrumbLink.vue +21 -0
- package/src/lib/breadcrumb/BreadcrumbList.vue +22 -0
- package/src/lib/breadcrumb/BreadcrumbPage.vue +20 -0
- package/src/lib/breadcrumb/BreadcrumbSeparator.vue +34 -0
- package/src/lib/breadcrumb/index.ts +7 -0
- package/src/lib/button/Button.test.ts +84 -0
- package/src/lib/button/Button.vue +63 -0
- package/src/lib/button/index.ts +2 -0
- package/src/lib/button/variants.test.ts +128 -0
- package/src/lib/button/variants.ts +66 -0
- package/src/lib/button-group/ButtonGroup.vue +25 -0
- package/src/lib/button-group/index.ts +1 -0
- package/src/lib/calendar/Calendar.vue +58 -0
- package/src/lib/calendar/CalendarCell.vue +22 -0
- package/src/lib/calendar/CalendarCellTrigger.vue +28 -0
- package/src/lib/calendar/CalendarGrid.vue +16 -0
- package/src/lib/calendar/CalendarGridBody.vue +11 -0
- package/src/lib/calendar/CalendarGridHead.vue +11 -0
- package/src/lib/calendar/CalendarGridRow.vue +16 -0
- package/src/lib/calendar/CalendarHeadCell.vue +16 -0
- package/src/lib/calendar/CalendarHeader.vue +16 -0
- package/src/lib/calendar/CalendarHeading.vue +16 -0
- package/src/lib/calendar/CalendarNext.vue +37 -0
- package/src/lib/calendar/CalendarPrev.vue +37 -0
- package/src/lib/calendar/index.ts +12 -0
- package/src/lib/card/Card.test.ts +202 -0
- package/src/lib/card/Card.vue +36 -0
- package/src/lib/card/CardContent.vue +15 -0
- package/src/lib/card/CardDescription.vue +15 -0
- package/src/lib/card/CardFooter.vue +16 -0
- package/src/lib/card/CardHeader.vue +15 -0
- package/src/lib/card/CardTitle.vue +15 -0
- package/src/lib/card/index.ts +6 -0
- package/src/lib/carousel/Carousel.vue +73 -0
- package/src/lib/carousel/CarouselContent.vue +55 -0
- package/src/lib/carousel/CarouselItem.vue +25 -0
- package/src/lib/carousel/CarouselNext.vue +40 -0
- package/src/lib/carousel/CarouselPrevious.vue +40 -0
- package/src/lib/carousel/index.ts +6 -0
- package/src/lib/carousel/useCarousel.ts +24 -0
- package/src/lib/checkbox/Checkbox.test.ts +45 -0
- package/src/lib/checkbox/Checkbox.vue +39 -0
- package/src/lib/code-preview/CodePreview.vue +95 -0
- package/src/lib/collapsible/Collapsible.test.ts +95 -0
- package/src/lib/collapsible/Collapsible.vue +11 -0
- package/src/lib/collapsible/CollapsibleContent.vue +21 -0
- package/src/lib/collapsible/CollapsibleTrigger.vue +11 -0
- package/src/lib/collapsible/index.ts +3 -0
- package/src/lib/command/Command.vue +21 -0
- package/src/lib/command/CommandDialog.vue +25 -0
- package/src/lib/command/CommandEmpty.vue +16 -0
- package/src/lib/command/CommandGroup.vue +21 -0
- package/src/lib/command/CommandInput.vue +35 -0
- package/src/lib/command/CommandItem.vue +23 -0
- package/src/lib/command/CommandLabel.vue +16 -0
- package/src/lib/command/CommandList.vue +16 -0
- package/src/lib/command/CommandSeparator.vue +14 -0
- package/src/lib/command/index.ts +9 -0
- package/src/lib/context-menu/ContextMenu.vue +11 -0
- package/src/lib/context-menu/ContextMenuCheckboxItem.vue +45 -0
- package/src/lib/context-menu/ContextMenuContent.vue +31 -0
- package/src/lib/context-menu/ContextMenuGroup.vue +11 -0
- package/src/lib/context-menu/ContextMenuItem.vue +24 -0
- package/src/lib/context-menu/ContextMenuLabel.vue +16 -0
- package/src/lib/context-menu/ContextMenuRadioGroup.vue +11 -0
- package/src/lib/context-menu/ContextMenuRadioItem.vue +44 -0
- package/src/lib/context-menu/ContextMenuSeparator.vue +14 -0
- package/src/lib/context-menu/ContextMenuShortcut.vue +11 -0
- package/src/lib/context-menu/ContextMenuSub.vue +11 -0
- package/src/lib/context-menu/ContextMenuSubContent.vue +28 -0
- package/src/lib/context-menu/ContextMenuSubTrigger.vue +36 -0
- package/src/lib/context-menu/ContextMenuTrigger.vue +11 -0
- package/src/lib/context-menu/index.ts +14 -0
- package/src/lib/data-table/DataTable.vue +226 -0
- package/src/lib/date-range-picker/DateRangePicker.vue +201 -0
- package/src/lib/date-time-picker/DateTimePicker.vue +159 -0
- package/src/lib/dialog/Dialog.test.ts +87 -0
- package/src/lib/dialog/Dialog.vue +14 -0
- package/src/lib/dialog/DialogClose.vue +11 -0
- package/src/lib/dialog/DialogContent.vue +56 -0
- package/src/lib/dialog/DialogDescription.vue +15 -0
- package/src/lib/dialog/DialogFooter.vue +17 -0
- package/src/lib/dialog/DialogHeader.vue +17 -0
- package/src/lib/dialog/DialogOverlay.vue +20 -0
- package/src/lib/dialog/DialogPortal.vue +11 -0
- package/src/lib/dialog/DialogTitle.vue +15 -0
- package/src/lib/dialog/DialogTrigger.vue +11 -0
- package/src/lib/dialog/index.ts +10 -0
- package/src/lib/direction/Direction.vue +13 -0
- package/src/lib/drawer/Drawer.vue +11 -0
- package/src/lib/drawer/DrawerClose.vue +11 -0
- package/src/lib/drawer/DrawerContent.vue +31 -0
- package/src/lib/drawer/DrawerDescription.vue +16 -0
- package/src/lib/drawer/DrawerFooter.vue +15 -0
- package/src/lib/drawer/DrawerHeader.vue +15 -0
- package/src/lib/drawer/DrawerOverlay.vue +21 -0
- package/src/lib/drawer/DrawerTitle.vue +16 -0
- package/src/lib/drawer/DrawerTrigger.vue +11 -0
- package/src/lib/drawer/index.ts +9 -0
- package/src/lib/dropdown-menu/DropdownMenu.test.ts +146 -0
- package/src/lib/dropdown-menu/DropdownMenu.vue +11 -0
- package/src/lib/dropdown-menu/DropdownMenuCheckboxItem.vue +45 -0
- package/src/lib/dropdown-menu/DropdownMenuContent.vue +31 -0
- package/src/lib/dropdown-menu/DropdownMenuGroup.vue +11 -0
- package/src/lib/dropdown-menu/DropdownMenuItem.vue +24 -0
- package/src/lib/dropdown-menu/DropdownMenuLabel.vue +16 -0
- package/src/lib/dropdown-menu/DropdownMenuRadioGroup.vue +11 -0
- package/src/lib/dropdown-menu/DropdownMenuRadioItem.vue +44 -0
- package/src/lib/dropdown-menu/DropdownMenuSeparator.vue +14 -0
- package/src/lib/dropdown-menu/DropdownMenuShortcut.vue +11 -0
- package/src/lib/dropdown-menu/DropdownMenuSub.vue +11 -0
- package/src/lib/dropdown-menu/DropdownMenuSubContent.vue +27 -0
- package/src/lib/dropdown-menu/DropdownMenuSubTrigger.vue +36 -0
- package/src/lib/dropdown-menu/DropdownMenuTrigger.vue +11 -0
- package/src/lib/dropdown-menu/index.ts +14 -0
- package/src/lib/empty/Empty.vue +11 -0
- package/src/lib/empty/EmptyDescription.vue +11 -0
- package/src/lib/empty/EmptyIcon.vue +8 -0
- package/src/lib/empty/EmptyTitle.vue +11 -0
- package/src/lib/empty/index.ts +4 -0
- package/src/lib/feature-card/FeatureCard.vue +177 -0
- package/src/lib/feature-card/README.md +139 -0
- package/src/lib/feature-card/index.ts +1 -0
- package/src/lib/field/Field.vue +15 -0
- package/src/lib/field/FieldDescription.vue +15 -0
- package/src/lib/field/FieldError.vue +15 -0
- package/src/lib/field/FieldLabel.vue +24 -0
- package/src/lib/field/index.ts +4 -0
- package/src/lib/hover-card/HoverCard.vue +11 -0
- package/src/lib/hover-card/HoverCardContent.vue +31 -0
- package/src/lib/hover-card/HoverCardTrigger.vue +11 -0
- package/src/lib/hover-card/index.ts +3 -0
- package/src/lib/icon/Icon.vue +33 -0
- package/src/lib/input/Input.test.ts +71 -0
- package/src/lib/input/Input.vue +85 -0
- package/src/lib/input/index.ts +1 -0
- package/src/lib/input-group/InputGroup.vue +24 -0
- package/src/lib/input-group/InputGroupAddon.vue +25 -0
- package/src/lib/input-group/InputGroupInput.vue +38 -0
- package/src/lib/input-group/index.ts +3 -0
- package/src/lib/input-otp/InputOTP.vue +16 -0
- package/src/lib/input-otp/InputOTPGroup.vue +11 -0
- package/src/lib/input-otp/InputOTPSeparator.vue +8 -0
- package/src/lib/input-otp/InputOTPSlot.vue +20 -0
- package/src/lib/input-otp/index.ts +4 -0
- package/src/lib/kbd/Kbd.vue +11 -0
- package/src/lib/kbd/index.ts +1 -0
- package/src/lib/label/Label.test.ts +38 -0
- package/src/lib/label/Label.vue +20 -0
- package/src/lib/label/index.ts +1 -0
- package/src/lib/layout/AppFooter.vue +18 -0
- package/src/lib/layout/AppHeader.vue +22 -0
- package/src/lib/layout/AppLayout.vue +13 -0
- package/src/lib/layout/AppMain.vue +22 -0
- package/src/lib/layout/AppSidebar.vue +50 -0
- package/src/lib/menubar/Menubar.vue +21 -0
- package/src/lib/menubar/MenubarCheckboxItem.vue +45 -0
- package/src/lib/menubar/MenubarContent.vue +30 -0
- package/src/lib/menubar/MenubarGroup.vue +11 -0
- package/src/lib/menubar/MenubarItem.vue +24 -0
- package/src/lib/menubar/MenubarLabel.vue +16 -0
- package/src/lib/menubar/MenubarMenu.vue +11 -0
- package/src/lib/menubar/MenubarRadioGroup.vue +11 -0
- package/src/lib/menubar/MenubarRadioItem.vue +44 -0
- package/src/lib/menubar/MenubarSeparator.vue +14 -0
- package/src/lib/menubar/MenubarShortcut.vue +11 -0
- package/src/lib/menubar/MenubarSub.vue +11 -0
- package/src/lib/menubar/MenubarSubContent.vue +26 -0
- package/src/lib/menubar/MenubarSubTrigger.vue +36 -0
- package/src/lib/menubar/MenubarTrigger.vue +21 -0
- package/src/lib/menubar/index.ts +15 -0
- package/src/lib/modal/Modal.test.ts +81 -0
- package/src/lib/modal/Modal.vue +12 -0
- package/src/lib/modal/ModalClose.vue +9 -0
- package/src/lib/modal/ModalContent.vue +32 -0
- package/src/lib/modal/ModalTrigger.vue +11 -0
- package/src/lib/multi-select/MultiSelect.vue +186 -0
- package/src/lib/multi-select/MultiSelectItem.vue +47 -0
- package/src/lib/native-select/NativeSelect.vue +41 -0
- package/src/lib/native-select/index.ts +1 -0
- package/src/lib/navigation-menu/NavigationMenu.vue +23 -0
- package/src/lib/navigation-menu/NavigationMenuContent.vue +21 -0
- package/src/lib/navigation-menu/NavigationMenuIndicator.vue +21 -0
- package/src/lib/navigation-menu/NavigationMenuItem.vue +11 -0
- package/src/lib/navigation-menu/NavigationMenuLink.vue +23 -0
- package/src/lib/navigation-menu/NavigationMenuList.vue +21 -0
- package/src/lib/navigation-menu/NavigationMenuTrigger.vue +36 -0
- package/src/lib/navigation-menu/NavigationMenuViewport.vue +24 -0
- package/src/lib/navigation-menu/index.ts +8 -0
- package/src/lib/pagination/Pagination.vue +16 -0
- package/src/lib/pagination/PaginationContent.vue +16 -0
- package/src/lib/pagination/PaginationEllipsis.vue +27 -0
- package/src/lib/pagination/PaginationFirst.vue +25 -0
- package/src/lib/pagination/PaginationItem.vue +11 -0
- package/src/lib/pagination/PaginationLast.vue +25 -0
- package/src/lib/pagination/PaginationLink.vue +31 -0
- package/src/lib/pagination/PaginationNext.vue +24 -0
- package/src/lib/pagination/PaginationPrev.vue +24 -0
- package/src/lib/pagination/index.ts +9 -0
- package/src/lib/popover/Popover.test.ts +97 -0
- package/src/lib/popover/Popover.vue +11 -0
- package/src/lib/popover/PopoverContent.vue +31 -0
- package/src/lib/popover/PopoverTrigger.vue +11 -0
- package/src/lib/popover/index.ts +3 -0
- package/src/lib/progress/Progress.test.ts +59 -0
- package/src/lib/progress/Progress.vue +41 -0
- package/src/lib/progress/index.ts +1 -0
- package/src/lib/radio-group/RadioGroup.test.ts +45 -0
- package/src/lib/radio-group/RadioGroup.vue +16 -0
- package/src/lib/radio-group/RadioGroupItem.vue +35 -0
- package/src/lib/radio-group/index.ts +2 -0
- package/src/lib/resizable/ResizableHandle.vue +38 -0
- package/src/lib/resizable/ResizablePanel.vue +11 -0
- package/src/lib/resizable/ResizablePanelGroup.vue +16 -0
- package/src/lib/resizable/index.ts +3 -0
- package/src/lib/scroll-area/ScrollArea.vue +29 -0
- package/src/lib/scroll-area/ScrollBar.vue +26 -0
- package/src/lib/scroll-area/index.ts +2 -0
- package/src/lib/select/Select.vue +11 -0
- package/src/lib/select/SelectContent.vue +48 -0
- package/src/lib/select/SelectGroup.vue +11 -0
- package/src/lib/select/SelectItem.vue +41 -0
- package/src/lib/select/SelectLabel.vue +16 -0
- package/src/lib/select/SelectScrollDownButton.vue +29 -0
- package/src/lib/select/SelectScrollUpButton.vue +29 -0
- package/src/lib/select/SelectSeparator.vue +14 -0
- package/src/lib/select/SelectTrigger.vue +37 -0
- package/src/lib/select/SelectValue.vue +11 -0
- package/src/lib/select/index.ts +10 -0
- package/src/lib/separator/Separator.test.ts +47 -0
- package/src/lib/separator/Separator.vue +23 -0
- package/src/lib/separator/index.ts +1 -0
- package/src/lib/sheet/Sheet.test.ts +118 -0
- package/src/lib/sheet/Sheet.vue +11 -0
- package/src/lib/sheet/SheetClose.vue +11 -0
- package/src/lib/sheet/SheetContent.vue +68 -0
- package/src/lib/sheet/SheetDescription.vue +16 -0
- package/src/lib/sheet/SheetFooter.vue +15 -0
- package/src/lib/sheet/SheetHeader.vue +15 -0
- package/src/lib/sheet/SheetOverlay.vue +21 -0
- package/src/lib/sheet/SheetTitle.vue +16 -0
- package/src/lib/sheet/SheetTrigger.vue +11 -0
- package/src/lib/sheet/index.ts +9 -0
- package/src/lib/sidebar/Sidebar.vue +19 -0
- package/src/lib/sidebar/SidebarContent.vue +11 -0
- package/src/lib/sidebar/SidebarFooter.vue +11 -0
- package/src/lib/sidebar/SidebarGroup.vue +11 -0
- package/src/lib/sidebar/SidebarGroupLabel.vue +11 -0
- package/src/lib/sidebar/SidebarHeader.vue +11 -0
- package/src/lib/sidebar/SidebarInset.vue +11 -0
- package/src/lib/sidebar/SidebarMenu.vue +11 -0
- package/src/lib/sidebar/SidebarMenuButton.vue +20 -0
- package/src/lib/sidebar/SidebarMenuItem.vue +9 -0
- package/src/lib/sidebar/SidebarProvider.vue +23 -0
- package/src/lib/sidebar/SidebarSeparator.vue +9 -0
- package/src/lib/sidebar/SidebarTrigger.vue +24 -0
- package/src/lib/sidebar/context.ts +8 -0
- package/src/lib/sidebar/useSidebar.ts +10 -0
- package/src/lib/skeleton/Skeleton.test.ts +36 -0
- package/src/lib/skeleton/Skeleton.vue +9 -0
- package/src/lib/skeleton/index.ts +1 -0
- package/src/lib/slider/Slider.test.ts +63 -0
- package/src/lib/slider/Slider.vue +67 -0
- package/src/lib/slider/index.ts +1 -0
- package/src/lib/sonner/Toaster.vue +29 -0
- package/src/lib/spinner/Spinner.vue +34 -0
- package/src/lib/spinner/index.ts +1 -0
- package/src/lib/stats-card/StatsCard.vue +179 -0
- package/src/lib/stats-card/index.ts +2 -0
- package/src/lib/styles.ts +133 -0
- package/src/lib/switch/Switch.test.ts +52 -0
- package/src/lib/switch/Switch.vue +43 -0
- package/src/lib/table/Table.test.ts +150 -0
- package/src/lib/table/Table.vue +13 -0
- package/src/lib/table/TableBody.vue +11 -0
- package/src/lib/table/TableCaption.vue +11 -0
- package/src/lib/table/TableCell.vue +11 -0
- package/src/lib/table/TableFooter.vue +11 -0
- package/src/lib/table/TableHead.vue +11 -0
- package/src/lib/table/TableHeader.vue +11 -0
- package/src/lib/table/TableRow.vue +11 -0
- package/src/lib/table/index.ts +8 -0
- package/src/lib/tabs/Tabs.test.ts +150 -0
- package/src/lib/tabs/Tabs.vue +11 -0
- package/src/lib/tabs/TabsContent.vue +21 -0
- package/src/lib/tabs/TabsList.vue +21 -0
- package/src/lib/tabs/TabsTrigger.vue +21 -0
- package/src/lib/tabs/index.ts +4 -0
- package/src/lib/textarea/Textarea.test.ts +41 -0
- package/src/lib/textarea/Textarea.vue +36 -0
- package/src/lib/theme-selector/README.md +154 -0
- package/src/lib/theme-selector/ThemeSelector.vue +279 -0
- package/src/lib/theme-selector/index.ts +2 -0
- package/src/lib/time-picker/TimePicker.vue +162 -0
- package/src/lib/time-picker/TimePickerSegment.vue +176 -0
- package/src/lib/toast/Toast.test.ts +80 -0
- package/src/lib/toast/Toast.vue +56 -0
- package/src/lib/toast/ToastAction.vue +23 -0
- package/src/lib/toast/ToastClose.vue +38 -0
- package/src/lib/toast/ToastDescription.vue +12 -0
- package/src/lib/toast/ToastProvider.ts +65 -0
- package/src/lib/toast/ToastTitle.vue +12 -0
- package/src/lib/toast/ToastViewport.vue +18 -0
- package/src/lib/toast/Toaster.vue +50 -0
- package/src/lib/toast/index.ts +7 -0
- package/src/lib/toggle/Toggle.vue +21 -0
- package/src/lib/toggle/index.ts +2 -0
- package/src/lib/toggle/variants.test.ts +87 -0
- package/src/lib/toggle/variants.ts +21 -0
- package/src/lib/toggle-group/ToggleGroup.vue +24 -0
- package/src/lib/toggle-group/ToggleGroupItem.vue +33 -0
- package/src/lib/toggle-group/index.ts +2 -0
- package/src/lib/tooltip/Tooltip.test.ts +87 -0
- package/src/lib/tooltip/Tooltip.vue +11 -0
- package/src/lib/tooltip/TooltipContent.vue +30 -0
- package/src/lib/tooltip/TooltipProvider.vue +11 -0
- package/src/lib/tooltip/TooltipTrigger.vue +11 -0
- package/src/lib/tooltip/index.ts +4 -0
- package/src/lib/typography/TypographyBlockquote.vue +11 -0
- package/src/lib/typography/TypographyH1.vue +11 -0
- package/src/lib/typography/TypographyH2.vue +11 -0
- package/src/lib/typography/TypographyH3.vue +11 -0
- package/src/lib/typography/TypographyH4.vue +11 -0
- package/src/lib/typography/TypographyInlineCode.vue +11 -0
- package/src/lib/typography/TypographyLarge.vue +11 -0
- package/src/lib/typography/TypographyLead.vue +11 -0
- package/src/lib/typography/TypographyMuted.vue +11 -0
- package/src/lib/typography/TypographyP.vue +11 -0
- package/src/lib/typography/TypographySmall.vue +11 -0
- package/src/lib/typography/index.ts +11 -0
- package/src/lib/utils.test.ts +45 -0
- package/src/lib/utils.ts +14 -0
- package/src/lib/variants.ts +45 -0
- package/src/theme.css +203 -0
- package/src/vite-env.d.ts +6 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{ class?: string }>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<span :class="cn('ml-auto text-xs tracking-widest text-muted-foreground', props.class)">
|
|
9
|
+
<slot />
|
|
10
|
+
</span>
|
|
11
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
import {
|
|
4
|
+
ContextMenuSubContent,
|
|
5
|
+
} from 'radix-vue'
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{ class?: string }>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<ContextMenuSubContent
|
|
13
|
+
v-bind="$attrs"
|
|
14
|
+
:class="
|
|
15
|
+
cn(
|
|
16
|
+
'z-depth-3 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-depth-3',
|
|
17
|
+
'animate-in fade-in-0 zoom-in-95',
|
|
18
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out',
|
|
19
|
+
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
20
|
+
'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
|
|
21
|
+
'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',
|
|
22
|
+
props.class
|
|
23
|
+
)
|
|
24
|
+
"
|
|
25
|
+
>
|
|
26
|
+
<slot />
|
|
27
|
+
</ContextMenuSubContent>
|
|
28
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
import { ContextMenuSubTrigger } from 'radix-vue'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{ class?: string; inset?: boolean }>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<ContextMenuSubTrigger
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
:class="
|
|
13
|
+
cn(
|
|
14
|
+
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent',
|
|
15
|
+
inset && 'pl-8',
|
|
16
|
+
props.class
|
|
17
|
+
)
|
|
18
|
+
"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
<svg
|
|
22
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
23
|
+
width="24"
|
|
24
|
+
height="24"
|
|
25
|
+
viewBox="0 0 24 24"
|
|
26
|
+
fill="none"
|
|
27
|
+
stroke="currentColor"
|
|
28
|
+
stroke-width="2"
|
|
29
|
+
stroke-linecap="round"
|
|
30
|
+
stroke-linejoin="round"
|
|
31
|
+
class="ml-auto h-4 w-4"
|
|
32
|
+
>
|
|
33
|
+
<path d="m9 18 6-6-6-6" />
|
|
34
|
+
</svg>
|
|
35
|
+
</ContextMenuSubTrigger>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { default as ContextMenu } from './ContextMenu.vue'
|
|
2
|
+
export { default as ContextMenuTrigger } from './ContextMenuTrigger.vue'
|
|
3
|
+
export { default as ContextMenuContent } from './ContextMenuContent.vue'
|
|
4
|
+
export { default as ContextMenuItem } from './ContextMenuItem.vue'
|
|
5
|
+
export { default as ContextMenuCheckboxItem } from './ContextMenuCheckboxItem.vue'
|
|
6
|
+
export { default as ContextMenuRadioItem } from './ContextMenuRadioItem.vue'
|
|
7
|
+
export { default as ContextMenuRadioGroup } from './ContextMenuRadioGroup.vue'
|
|
8
|
+
export { default as ContextMenuSub } from './ContextMenuSub.vue'
|
|
9
|
+
export { default as ContextMenuSubTrigger } from './ContextMenuSubTrigger.vue'
|
|
10
|
+
export { default as ContextMenuSubContent } from './ContextMenuSubContent.vue'
|
|
11
|
+
export { default as ContextMenuSeparator } from './ContextMenuSeparator.vue'
|
|
12
|
+
export { default as ContextMenuLabel } from './ContextMenuLabel.vue'
|
|
13
|
+
export { default as ContextMenuGroup } from './ContextMenuGroup.vue'
|
|
14
|
+
export { default as ContextMenuShortcut } from './ContextMenuShortcut.vue'
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
<script setup lang="ts" generic="T extends Record<string, any>">
|
|
2
|
+
import { ref, computed, watch } from 'vue'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
import Table from '@/lib/table/Table.vue'
|
|
5
|
+
import TableHeader from '@/lib/table/TableHeader.vue'
|
|
6
|
+
import TableBody from '@/lib/table/TableBody.vue'
|
|
7
|
+
import TableRow from '@/lib/table/TableRow.vue'
|
|
8
|
+
import TableHead from '@/lib/table/TableHead.vue'
|
|
9
|
+
import TableCell from '@/lib/table/TableCell.vue'
|
|
10
|
+
|
|
11
|
+
export interface DataTableColumn<R = any> {
|
|
12
|
+
key: string
|
|
13
|
+
label: string
|
|
14
|
+
sortable?: boolean
|
|
15
|
+
filterable?: boolean
|
|
16
|
+
class?: string
|
|
17
|
+
headerClass?: string
|
|
18
|
+
render?: (value: any, row: R) => string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const props = withDefaults(defineProps<{
|
|
22
|
+
data: T[]
|
|
23
|
+
columns: DataTableColumn<T>[]
|
|
24
|
+
pageSize?: number
|
|
25
|
+
searchable?: boolean
|
|
26
|
+
searchPlaceholder?: string
|
|
27
|
+
class?: string
|
|
28
|
+
striped?: boolean
|
|
29
|
+
hoverable?: boolean
|
|
30
|
+
}>(), {
|
|
31
|
+
pageSize: 10,
|
|
32
|
+
searchable: false,
|
|
33
|
+
searchPlaceholder: 'Search...',
|
|
34
|
+
striped: false,
|
|
35
|
+
hoverable: true,
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const emit = defineEmits<{
|
|
39
|
+
'row-click': [row: T, index: number]
|
|
40
|
+
}>()
|
|
41
|
+
|
|
42
|
+
// Sort state
|
|
43
|
+
const sortKey = ref<string | null>(null)
|
|
44
|
+
const sortDir = ref<'asc' | 'desc'>('asc')
|
|
45
|
+
|
|
46
|
+
// Filter state
|
|
47
|
+
const search = ref('')
|
|
48
|
+
const currentPage = ref(1)
|
|
49
|
+
|
|
50
|
+
// Reset page on search change
|
|
51
|
+
watch(search, () => { currentPage.value = 1 })
|
|
52
|
+
|
|
53
|
+
// Filtered data
|
|
54
|
+
const filteredData = computed(() => {
|
|
55
|
+
if (!search.value) return props.data
|
|
56
|
+
const q = search.value.toLowerCase()
|
|
57
|
+
const filterCols = props.columns.filter(c => c.filterable !== false)
|
|
58
|
+
return props.data.filter(row =>
|
|
59
|
+
filterCols.some(col => {
|
|
60
|
+
const val = row[col.key]
|
|
61
|
+
return val != null && String(val).toLowerCase().includes(q)
|
|
62
|
+
})
|
|
63
|
+
)
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
// Sorted data
|
|
67
|
+
const sortedData = computed(() => {
|
|
68
|
+
if (!sortKey.value) return filteredData.value
|
|
69
|
+
const key = sortKey.value
|
|
70
|
+
const dir = sortDir.value === 'asc' ? 1 : -1
|
|
71
|
+
return [...filteredData.value].sort((a, b) => {
|
|
72
|
+
const aVal = a[key]
|
|
73
|
+
const bVal = b[key]
|
|
74
|
+
if (aVal == null && bVal == null) return 0
|
|
75
|
+
if (aVal == null) return 1
|
|
76
|
+
if (bVal == null) return -1
|
|
77
|
+
if (typeof aVal === 'number' && typeof bVal === 'number') return (aVal - bVal) * dir
|
|
78
|
+
return String(aVal).localeCompare(String(bVal)) * dir
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
// Paginated data
|
|
83
|
+
const totalPages = computed(() => Math.max(1, Math.ceil(sortedData.value.length / props.pageSize)))
|
|
84
|
+
const paginatedData = computed(() => {
|
|
85
|
+
const start = (currentPage.value - 1) * props.pageSize
|
|
86
|
+
return sortedData.value.slice(start, start + props.pageSize)
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
// Visible page numbers
|
|
90
|
+
const visiblePages = computed(() => {
|
|
91
|
+
const pages: number[] = []
|
|
92
|
+
const total = totalPages.value
|
|
93
|
+
const current = currentPage.value
|
|
94
|
+
const delta = 2
|
|
95
|
+
for (let i = Math.max(1, current - delta); i <= Math.min(total, current + delta); i++) {
|
|
96
|
+
pages.push(i)
|
|
97
|
+
}
|
|
98
|
+
return pages
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
function toggleSort(key: string) {
|
|
102
|
+
if (sortKey.value === key) {
|
|
103
|
+
sortDir.value = sortDir.value === 'asc' ? 'desc' : 'asc'
|
|
104
|
+
} else {
|
|
105
|
+
sortKey.value = key
|
|
106
|
+
sortDir.value = 'asc'
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function goToPage(page: number) {
|
|
111
|
+
currentPage.value = Math.max(1, Math.min(page, totalPages.value))
|
|
112
|
+
}
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<template>
|
|
116
|
+
<div :class="cn('space-y-4', props.class)">
|
|
117
|
+
<!-- Toolbar -->
|
|
118
|
+
<div v-if="searchable || $slots.toolbar" class="flex items-center justify-between gap-4">
|
|
119
|
+
<div v-if="searchable" class="relative max-w-sm flex-1">
|
|
120
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground">
|
|
121
|
+
<circle cx="11" cy="11" r="8" />
|
|
122
|
+
<path d="m21 21-4.3-4.3" />
|
|
123
|
+
</svg>
|
|
124
|
+
<input
|
|
125
|
+
v-model="search"
|
|
126
|
+
type="text"
|
|
127
|
+
:placeholder="searchPlaceholder"
|
|
128
|
+
class="flex h-9 w-full rounded-md border border-input bg-background pl-9 pr-3 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
129
|
+
/>
|
|
130
|
+
</div>
|
|
131
|
+
<slot name="toolbar" />
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<!-- Table -->
|
|
135
|
+
<div class="rounded-md border overflow-hidden">
|
|
136
|
+
<Table>
|
|
137
|
+
<TableHeader>
|
|
138
|
+
<TableRow>
|
|
139
|
+
<TableHead
|
|
140
|
+
v-for="col in columns"
|
|
141
|
+
:key="col.key"
|
|
142
|
+
:class="cn(col.headerClass)"
|
|
143
|
+
>
|
|
144
|
+
<button
|
|
145
|
+
v-if="col.sortable"
|
|
146
|
+
class="flex items-center gap-1 hover:text-foreground transition-colors -m-1 p-1"
|
|
147
|
+
@click="toggleSort(col.key)"
|
|
148
|
+
>
|
|
149
|
+
{{ col.label }}
|
|
150
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="h-3.5 w-3.5" :class="sortKey === col.key ? 'text-foreground' : 'text-muted-foreground/40'">
|
|
151
|
+
<path v-if="sortKey !== col.key || sortDir === 'asc'" d="m7 15 5 5 5-5" />
|
|
152
|
+
<path v-if="sortKey !== col.key || sortDir === 'desc'" d="m7 9 5-5 5 5" />
|
|
153
|
+
</svg>
|
|
154
|
+
</button>
|
|
155
|
+
<span v-else>{{ col.label }}</span>
|
|
156
|
+
</TableHead>
|
|
157
|
+
</TableRow>
|
|
158
|
+
</TableHeader>
|
|
159
|
+
<TableBody>
|
|
160
|
+
<TableRow
|
|
161
|
+
v-for="(row, idx) in paginatedData"
|
|
162
|
+
:key="idx"
|
|
163
|
+
:class="cn(
|
|
164
|
+
hoverable && 'cursor-pointer',
|
|
165
|
+
striped && idx % 2 === 1 && 'bg-muted/30',
|
|
166
|
+
)"
|
|
167
|
+
@click="emit('row-click', row, idx)"
|
|
168
|
+
>
|
|
169
|
+
<TableCell
|
|
170
|
+
v-for="col in columns"
|
|
171
|
+
:key="col.key"
|
|
172
|
+
:class="cn(col.class)"
|
|
173
|
+
>
|
|
174
|
+
<slot :name="`cell-${col.key}`" :value="row[col.key]" :row="row">
|
|
175
|
+
{{ col.render ? col.render(row[col.key], row) : row[col.key] }}
|
|
176
|
+
</slot>
|
|
177
|
+
</TableCell>
|
|
178
|
+
</TableRow>
|
|
179
|
+
<TableRow v-if="paginatedData.length === 0">
|
|
180
|
+
<TableCell :colspan="columns.length" class="h-24 text-center text-muted-foreground">
|
|
181
|
+
No results.
|
|
182
|
+
</TableCell>
|
|
183
|
+
</TableRow>
|
|
184
|
+
</TableBody>
|
|
185
|
+
</Table>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
<!-- Pagination -->
|
|
189
|
+
<div v-if="totalPages > 1" class="flex items-center justify-between text-sm">
|
|
190
|
+
<p class="text-muted-foreground">
|
|
191
|
+
{{ sortedData.length }} result{{ sortedData.length === 1 ? '' : 's' }}
|
|
192
|
+
<span v-if="search"> for "{{ search }}"</span>
|
|
193
|
+
</p>
|
|
194
|
+
|
|
195
|
+
<div class="flex items-center gap-1">
|
|
196
|
+
<button
|
|
197
|
+
class="inline-flex h-8 w-8 items-center justify-center rounded-md border text-sm transition-colors hover:bg-accent disabled:opacity-50 disabled:pointer-events-none"
|
|
198
|
+
:disabled="currentPage <= 1"
|
|
199
|
+
@click="goToPage(currentPage - 1)"
|
|
200
|
+
>
|
|
201
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="h-4 w-4"><path d="m15 18-6-6 6-6"/></svg>
|
|
202
|
+
</button>
|
|
203
|
+
|
|
204
|
+
<button
|
|
205
|
+
v-for="page in visiblePages"
|
|
206
|
+
:key="page"
|
|
207
|
+
class="inline-flex h-8 w-8 items-center justify-center rounded-md text-sm transition-colors"
|
|
208
|
+
:class="page === currentPage
|
|
209
|
+
? 'bg-primary text-primary-foreground'
|
|
210
|
+
: 'hover:bg-accent'"
|
|
211
|
+
@click="goToPage(page)"
|
|
212
|
+
>
|
|
213
|
+
{{ page }}
|
|
214
|
+
</button>
|
|
215
|
+
|
|
216
|
+
<button
|
|
217
|
+
class="inline-flex h-8 w-8 items-center justify-center rounded-md border text-sm transition-colors hover:bg-accent disabled:opacity-50 disabled:pointer-events-none"
|
|
218
|
+
:disabled="currentPage >= totalPages"
|
|
219
|
+
@click="goToPage(currentPage + 1)"
|
|
220
|
+
>
|
|
221
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="h-4 w-4"><path d="m9 18 6-6-6-6"/></svg>
|
|
222
|
+
</button>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
</template>
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
import {
|
|
4
|
+
DateRangePickerRoot,
|
|
5
|
+
DateRangePickerCalendar,
|
|
6
|
+
DateRangePickerGrid,
|
|
7
|
+
DateRangePickerGridHead,
|
|
8
|
+
DateRangePickerGridBody,
|
|
9
|
+
DateRangePickerGridRow,
|
|
10
|
+
DateRangePickerCell,
|
|
11
|
+
DateRangePickerCellTrigger,
|
|
12
|
+
DateRangePickerHeadCell,
|
|
13
|
+
DateRangePickerHeader,
|
|
14
|
+
DateRangePickerHeading,
|
|
15
|
+
DateRangePickerNext,
|
|
16
|
+
DateRangePickerPrev,
|
|
17
|
+
DateRangePickerField,
|
|
18
|
+
DateRangePickerInput,
|
|
19
|
+
type DateRange,
|
|
20
|
+
} from 'radix-vue'
|
|
21
|
+
import type { DateValue } from '@internationalized/date'
|
|
22
|
+
import { cn } from '@/lib/utils'
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(
|
|
25
|
+
defineProps<{
|
|
26
|
+
modelValue?: { start: DateValue; end: DateValue }
|
|
27
|
+
numberOfMonths?: number
|
|
28
|
+
placeholder?: { start: DateValue; end: DateValue }
|
|
29
|
+
class?: string
|
|
30
|
+
disabled?: boolean
|
|
31
|
+
}>(),
|
|
32
|
+
{
|
|
33
|
+
numberOfMonths: 2,
|
|
34
|
+
disabled: false,
|
|
35
|
+
},
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
const emit = defineEmits<{
|
|
39
|
+
'update:modelValue': [value: DateRange]
|
|
40
|
+
}>()
|
|
41
|
+
|
|
42
|
+
function onUpdate(val: DateRange) {
|
|
43
|
+
emit('update:modelValue', val)
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<DateRangePickerRoot
|
|
49
|
+
v-bind="$attrs"
|
|
50
|
+
:model-value="modelValue as DateRange"
|
|
51
|
+
:number-of-months="numberOfMonths"
|
|
52
|
+
:disabled="disabled"
|
|
53
|
+
@update:model-value="onUpdate"
|
|
54
|
+
>
|
|
55
|
+
<DateRangePickerField
|
|
56
|
+
v-slot="{ segments }"
|
|
57
|
+
:class="
|
|
58
|
+
cn(
|
|
59
|
+
'flex h-10 w-full items-center rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground shadow-depth-1',
|
|
60
|
+
'ring-offset-background',
|
|
61
|
+
'focus-within:outline-none focus-within:ring-2 focus-within:ring-primary/20 focus-within:ring-offset-2',
|
|
62
|
+
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
63
|
+
props.class,
|
|
64
|
+
)
|
|
65
|
+
"
|
|
66
|
+
>
|
|
67
|
+
<template v-for="item in segments" :key="item.part">
|
|
68
|
+
<DateRangePickerInput
|
|
69
|
+
v-if="item.part === 'literal'"
|
|
70
|
+
:part="item.part"
|
|
71
|
+
:class="cn('text-muted-foreground')"
|
|
72
|
+
>
|
|
73
|
+
{{ item.value }}
|
|
74
|
+
</DateRangePickerInput>
|
|
75
|
+
<DateRangePickerInput
|
|
76
|
+
v-else
|
|
77
|
+
:part="item.part"
|
|
78
|
+
:class="
|
|
79
|
+
cn(
|
|
80
|
+
'inline-flex items-center justify-center rounded-md px-1 text-foreground',
|
|
81
|
+
'focus:outline-none focus:bg-accent focus:text-accent-foreground',
|
|
82
|
+
)
|
|
83
|
+
"
|
|
84
|
+
>
|
|
85
|
+
{{ item.value }}
|
|
86
|
+
</DateRangePickerInput>
|
|
87
|
+
</template>
|
|
88
|
+
</DateRangePickerField>
|
|
89
|
+
|
|
90
|
+
<DateRangePickerCalendar
|
|
91
|
+
v-slot="{ weekDays, grid }"
|
|
92
|
+
class="p-3"
|
|
93
|
+
>
|
|
94
|
+
<DateRangePickerHeader class="flex justify-between items-center pt-1 relative">
|
|
95
|
+
<DateRangePickerPrev
|
|
96
|
+
:class="
|
|
97
|
+
cn(
|
|
98
|
+
'inline-flex h-7 w-7 items-center justify-center rounded-md border-0 bg-transparent',
|
|
99
|
+
'hover:bg-accent hover:text-accent-foreground',
|
|
100
|
+
)
|
|
101
|
+
"
|
|
102
|
+
>
|
|
103
|
+
<svg
|
|
104
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
105
|
+
width="24"
|
|
106
|
+
height="24"
|
|
107
|
+
viewBox="0 0 24 24"
|
|
108
|
+
fill="none"
|
|
109
|
+
stroke="currentColor"
|
|
110
|
+
stroke-width="2"
|
|
111
|
+
stroke-linecap="round"
|
|
112
|
+
stroke-linejoin="round"
|
|
113
|
+
class="h-4 w-4"
|
|
114
|
+
>
|
|
115
|
+
<path d="m15 18-6-6 6-6" />
|
|
116
|
+
</svg>
|
|
117
|
+
</DateRangePickerPrev>
|
|
118
|
+
|
|
119
|
+
<DateRangePickerHeading class="text-sm font-medium" />
|
|
120
|
+
|
|
121
|
+
<DateRangePickerNext
|
|
122
|
+
:class="
|
|
123
|
+
cn(
|
|
124
|
+
'inline-flex h-7 w-7 items-center justify-center rounded-md border-0 bg-transparent',
|
|
125
|
+
'hover:bg-accent hover:text-accent-foreground',
|
|
126
|
+
)
|
|
127
|
+
"
|
|
128
|
+
>
|
|
129
|
+
<svg
|
|
130
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
131
|
+
width="24"
|
|
132
|
+
height="24"
|
|
133
|
+
viewBox="0 0 24 24"
|
|
134
|
+
fill="none"
|
|
135
|
+
stroke="currentColor"
|
|
136
|
+
stroke-width="2"
|
|
137
|
+
stroke-linecap="round"
|
|
138
|
+
stroke-linejoin="round"
|
|
139
|
+
class="h-4 w-4"
|
|
140
|
+
>
|
|
141
|
+
<path d="m9 18 6-6-6-6" />
|
|
142
|
+
</svg>
|
|
143
|
+
</DateRangePickerNext>
|
|
144
|
+
</DateRangePickerHeader>
|
|
145
|
+
|
|
146
|
+
<div class="mt-4 flex flex-col gap-y-4 sm:flex-row sm:gap-x-4 sm:gap-y-0">
|
|
147
|
+
<DateRangePickerGrid
|
|
148
|
+
v-for="month in grid"
|
|
149
|
+
:key="month.value.toString()"
|
|
150
|
+
class="w-full border-collapse space-y-1"
|
|
151
|
+
>
|
|
152
|
+
<DateRangePickerGridHead>
|
|
153
|
+
<DateRangePickerGridRow class="flex">
|
|
154
|
+
<DateRangePickerHeadCell
|
|
155
|
+
v-for="day in weekDays"
|
|
156
|
+
:key="day"
|
|
157
|
+
class="text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]"
|
|
158
|
+
>
|
|
159
|
+
{{ day }}
|
|
160
|
+
</DateRangePickerHeadCell>
|
|
161
|
+
</DateRangePickerGridRow>
|
|
162
|
+
</DateRangePickerGridHead>
|
|
163
|
+
<DateRangePickerGridBody>
|
|
164
|
+
<DateRangePickerGridRow
|
|
165
|
+
v-for="(weekDates, index) in month.rows"
|
|
166
|
+
:key="`weekDate-${index}`"
|
|
167
|
+
class="flex"
|
|
168
|
+
>
|
|
169
|
+
<DateRangePickerCell
|
|
170
|
+
v-for="weekDate in weekDates"
|
|
171
|
+
:key="weekDate.toString()"
|
|
172
|
+
:date="weekDate"
|
|
173
|
+
:class="
|
|
174
|
+
cn(
|
|
175
|
+
'h-8 w-8 text-center text-sm p-0 relative',
|
|
176
|
+
'focus-within:relative focus-within:z-20',
|
|
177
|
+
)
|
|
178
|
+
"
|
|
179
|
+
>
|
|
180
|
+
<DateRangePickerCellTrigger
|
|
181
|
+
:day="weekDate"
|
|
182
|
+
:month="month.value"
|
|
183
|
+
:class="
|
|
184
|
+
cn(
|
|
185
|
+
'inline-flex h-8 w-8 items-center justify-center whitespace-nowrap rounded-full text-sm font-normal',
|
|
186
|
+
'ring-offset-background transition-colors',
|
|
187
|
+
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
188
|
+
'disabled:pointer-events-none disabled:opacity-50',
|
|
189
|
+
'hover:bg-accent hover:text-accent-foreground',
|
|
190
|
+
'aria-selected:bg-primary aria-selected:text-primary-foreground aria-selected:font-medium',
|
|
191
|
+
)
|
|
192
|
+
"
|
|
193
|
+
/>
|
|
194
|
+
</DateRangePickerCell>
|
|
195
|
+
</DateRangePickerGridRow>
|
|
196
|
+
</DateRangePickerGridBody>
|
|
197
|
+
</DateRangePickerGrid>
|
|
198
|
+
</div>
|
|
199
|
+
</DateRangePickerCalendar>
|
|
200
|
+
</DateRangePickerRoot>
|
|
201
|
+
</template>
|