@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,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
import { NavigationMenuViewport } from 'radix-vue'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{ class?: string }>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="absolute left-0 top-full flex justify-center">
|
|
11
|
+
<NavigationMenuViewport
|
|
12
|
+
v-bind="$attrs"
|
|
13
|
+
:class="
|
|
14
|
+
cn(
|
|
15
|
+
'origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-depth-3',
|
|
16
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out',
|
|
17
|
+
'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90',
|
|
18
|
+
'md:w-[var(--radix-navigation-menu-viewport-width)]',
|
|
19
|
+
props.class
|
|
20
|
+
)
|
|
21
|
+
"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as NavigationMenu } from './NavigationMenu.vue'
|
|
2
|
+
export { default as NavigationMenuContent } from './NavigationMenuContent.vue'
|
|
3
|
+
export { default as NavigationMenuIndicator } from './NavigationMenuIndicator.vue'
|
|
4
|
+
export { default as NavigationMenuItem } from './NavigationMenuItem.vue'
|
|
5
|
+
export { default as NavigationMenuLink } from './NavigationMenuLink.vue'
|
|
6
|
+
export { default as NavigationMenuList } from './NavigationMenuList.vue'
|
|
7
|
+
export { default as NavigationMenuTrigger } from './NavigationMenuTrigger.vue'
|
|
8
|
+
export { default as NavigationMenuViewport } from './NavigationMenuViewport.vue'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
import { PaginationRoot } from 'radix-vue'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{ class?: string }>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<PaginationRoot
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
:class="cn('mx-auto flex w-full justify-center', props.class)"
|
|
13
|
+
>
|
|
14
|
+
<slot />
|
|
15
|
+
</PaginationRoot>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
import { PaginationList } from 'radix-vue'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{ class?: string }>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<PaginationList
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
:class="cn('flex flex-row items-center gap-1', props.class)"
|
|
13
|
+
>
|
|
14
|
+
<slot />
|
|
15
|
+
</PaginationList>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
defineProps<{ class?: string }>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<span :class="cn('flex h-9 w-9 items-center justify-center', $props.class)">
|
|
9
|
+
<svg
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
width="24"
|
|
12
|
+
height="24"
|
|
13
|
+
viewBox="0 0 24 24"
|
|
14
|
+
fill="none"
|
|
15
|
+
stroke="currentColor"
|
|
16
|
+
stroke-width="2"
|
|
17
|
+
stroke-linecap="round"
|
|
18
|
+
stroke-linejoin="round"
|
|
19
|
+
class="h-4 w-4"
|
|
20
|
+
>
|
|
21
|
+
<circle cx="12" cy="12" r="1" />
|
|
22
|
+
<circle cx="19" cy="12" r="1" />
|
|
23
|
+
<circle cx="5" cy="12" r="1" />
|
|
24
|
+
</svg>
|
|
25
|
+
<span class="sr-only">More pages</span>
|
|
26
|
+
</span>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import PaginationLink from './PaginationLink.vue'
|
|
3
|
+
|
|
4
|
+
defineProps<{ class?: string }>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<PaginationLink :class="$props.class">
|
|
9
|
+
<svg
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
width="24"
|
|
12
|
+
height="24"
|
|
13
|
+
viewBox="0 0 24 24"
|
|
14
|
+
fill="none"
|
|
15
|
+
stroke="currentColor"
|
|
16
|
+
stroke-width="2"
|
|
17
|
+
stroke-linecap="round"
|
|
18
|
+
stroke-linejoin="round"
|
|
19
|
+
class="h-4 w-4"
|
|
20
|
+
>
|
|
21
|
+
<path d="m11 17-5-5 5-5" />
|
|
22
|
+
<path d="m18 17-5-5 5-5" />
|
|
23
|
+
</svg>
|
|
24
|
+
</PaginationLink>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import PaginationLink from './PaginationLink.vue'
|
|
3
|
+
|
|
4
|
+
defineProps<{ class?: string }>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<PaginationLink :class="$props.class">
|
|
9
|
+
<svg
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
width="24"
|
|
12
|
+
height="24"
|
|
13
|
+
viewBox="0 0 24 24"
|
|
14
|
+
fill="none"
|
|
15
|
+
stroke="currentColor"
|
|
16
|
+
stroke-width="2"
|
|
17
|
+
stroke-linecap="round"
|
|
18
|
+
stroke-linejoin="round"
|
|
19
|
+
class="h-4 w-4"
|
|
20
|
+
>
|
|
21
|
+
<path d="m13 17 5-5-5-5" />
|
|
22
|
+
<path d="m6 17 5-5-5-5" />
|
|
23
|
+
</svg>
|
|
24
|
+
</PaginationLink>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
withDefaults(
|
|
5
|
+
defineProps<{
|
|
6
|
+
class?: string
|
|
7
|
+
isActive?: boolean
|
|
8
|
+
size?: string
|
|
9
|
+
}>(),
|
|
10
|
+
{
|
|
11
|
+
size: 'icon',
|
|
12
|
+
}
|
|
13
|
+
)
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<button
|
|
18
|
+
:class="
|
|
19
|
+
cn(
|
|
20
|
+
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
21
|
+
'h-10 w-10',
|
|
22
|
+
isActive
|
|
23
|
+
? 'border border-input bg-background hover:bg-accent hover:text-accent-foreground shadow-depth-1'
|
|
24
|
+
: 'hover:bg-accent hover:text-accent-foreground',
|
|
25
|
+
$props.class
|
|
26
|
+
)
|
|
27
|
+
"
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
</button>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import PaginationLink from './PaginationLink.vue'
|
|
3
|
+
|
|
4
|
+
defineProps<{ class?: string }>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<PaginationLink :class="$props.class">
|
|
9
|
+
<svg
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
width="24"
|
|
12
|
+
height="24"
|
|
13
|
+
viewBox="0 0 24 24"
|
|
14
|
+
fill="none"
|
|
15
|
+
stroke="currentColor"
|
|
16
|
+
stroke-width="2"
|
|
17
|
+
stroke-linecap="round"
|
|
18
|
+
stroke-linejoin="round"
|
|
19
|
+
class="h-4 w-4"
|
|
20
|
+
>
|
|
21
|
+
<path d="m9 18 6-6-6-6" />
|
|
22
|
+
</svg>
|
|
23
|
+
</PaginationLink>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import PaginationLink from './PaginationLink.vue'
|
|
3
|
+
|
|
4
|
+
defineProps<{ class?: string }>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<PaginationLink :class="$props.class">
|
|
9
|
+
<svg
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
width="24"
|
|
12
|
+
height="24"
|
|
13
|
+
viewBox="0 0 24 24"
|
|
14
|
+
fill="none"
|
|
15
|
+
stroke="currentColor"
|
|
16
|
+
stroke-width="2"
|
|
17
|
+
stroke-linecap="round"
|
|
18
|
+
stroke-linejoin="round"
|
|
19
|
+
class="h-4 w-4"
|
|
20
|
+
>
|
|
21
|
+
<path d="m15 18-6-6 6-6" />
|
|
22
|
+
</svg>
|
|
23
|
+
</PaginationLink>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Pagination } from './Pagination.vue'
|
|
2
|
+
export { default as PaginationContent } from './PaginationContent.vue'
|
|
3
|
+
export { default as PaginationItem } from './PaginationItem.vue'
|
|
4
|
+
export { default as PaginationLink } from './PaginationLink.vue'
|
|
5
|
+
export { default as PaginationFirst } from './PaginationFirst.vue'
|
|
6
|
+
export { default as PaginationPrev } from './PaginationPrev.vue'
|
|
7
|
+
export { default as PaginationNext } from './PaginationNext.vue'
|
|
8
|
+
export { default as PaginationLast } from './PaginationLast.vue'
|
|
9
|
+
export { default as PaginationEllipsis } from './PaginationEllipsis.vue'
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import { h } from 'vue'
|
|
4
|
+
import Popover from './Popover.vue'
|
|
5
|
+
import PopoverTrigger from './PopoverTrigger.vue'
|
|
6
|
+
import PopoverContent from './PopoverContent.vue'
|
|
7
|
+
|
|
8
|
+
describe('Popover', () => {
|
|
9
|
+
it('renders without errors', () => {
|
|
10
|
+
const wrapper = mount(Popover, {
|
|
11
|
+
slots: { default: 'Popover content' },
|
|
12
|
+
})
|
|
13
|
+
expect(wrapper.exists()).toBe(true)
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
describe('PopoverTrigger', () => {
|
|
18
|
+
it('renders slot content', () => {
|
|
19
|
+
const wrapper = mount(Popover, {
|
|
20
|
+
slots: {
|
|
21
|
+
default: () => h(PopoverTrigger, null, { default: () => 'Open Popover' }),
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
expect(wrapper.text()).toContain('Open Popover')
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it('renders as a button', () => {
|
|
28
|
+
const wrapper = mount(Popover, {
|
|
29
|
+
slots: {
|
|
30
|
+
default: () => h(PopoverTrigger, null, { default: () => 'Click' }),
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
expect(wrapper.find('button').exists()).toBe(true)
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
describe('PopoverContent', () => {
|
|
38
|
+
it('mounts without errors inside Popover', () => {
|
|
39
|
+
const wrapper = mount(Popover, {
|
|
40
|
+
attrs: { open: true },
|
|
41
|
+
slots: {
|
|
42
|
+
default: () => [
|
|
43
|
+
h(PopoverTrigger, null, { default: () => 'Trigger' }),
|
|
44
|
+
h(PopoverContent, null, { default: () => 'Popover body' }),
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
attachTo: document.body,
|
|
48
|
+
})
|
|
49
|
+
expect(wrapper.exists()).toBe(true)
|
|
50
|
+
wrapper.unmount()
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
it('accepts sideOffset prop', () => {
|
|
54
|
+
const wrapper = mount(Popover, {
|
|
55
|
+
attrs: { open: true },
|
|
56
|
+
slots: {
|
|
57
|
+
default: () => [
|
|
58
|
+
h(PopoverTrigger, null, { default: () => 'Trigger' }),
|
|
59
|
+
h(PopoverContent, { sideOffset: 8 }, { default: () => 'Content' }),
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
attachTo: document.body,
|
|
63
|
+
})
|
|
64
|
+
expect(wrapper.exists()).toBe(true)
|
|
65
|
+
wrapper.unmount()
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('accepts align prop', () => {
|
|
69
|
+
const wrapper = mount(Popover, {
|
|
70
|
+
attrs: { open: true },
|
|
71
|
+
slots: {
|
|
72
|
+
default: () => [
|
|
73
|
+
h(PopoverTrigger, null, { default: () => 'Trigger' }),
|
|
74
|
+
h(PopoverContent, { align: 'start' }, { default: () => 'Aligned content' }),
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
attachTo: document.body,
|
|
78
|
+
})
|
|
79
|
+
expect(wrapper.exists()).toBe(true)
|
|
80
|
+
wrapper.unmount()
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
it('accepts custom class prop', () => {
|
|
84
|
+
const wrapper = mount(Popover, {
|
|
85
|
+
attrs: { open: true },
|
|
86
|
+
slots: {
|
|
87
|
+
default: () => [
|
|
88
|
+
h(PopoverTrigger, null, { default: () => 'Trigger' }),
|
|
89
|
+
h(PopoverContent, { class: 'custom-popover' }, { default: () => 'Styled' }),
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
attachTo: document.body,
|
|
93
|
+
})
|
|
94
|
+
expect(wrapper.exists()).toBe(true)
|
|
95
|
+
wrapper.unmount()
|
|
96
|
+
})
|
|
97
|
+
})
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
import {
|
|
4
|
+
PopoverContent,
|
|
5
|
+
PopoverPortal,
|
|
6
|
+
} from 'radix-vue'
|
|
7
|
+
import { cn } from '@/lib/utils'
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<{ class?: string; sideOffset?: number; align?: 'start' | 'center' | 'end' }>(), { sideOffset: 4, align: 'center' })
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<PopoverPortal>
|
|
14
|
+
<PopoverContent
|
|
15
|
+
v-bind="$attrs"
|
|
16
|
+
:side-offset="props.sideOffset" :align="props.align"
|
|
17
|
+
:class="
|
|
18
|
+
cn(
|
|
19
|
+
'z-depth-3 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-depth-3 outline-none',
|
|
20
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out',
|
|
21
|
+
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
22
|
+
'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
|
|
23
|
+
'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',
|
|
24
|
+
props.class
|
|
25
|
+
)
|
|
26
|
+
"
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
</PopoverContent>
|
|
30
|
+
</PopoverPortal>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import Progress from './Progress.vue'
|
|
4
|
+
|
|
5
|
+
describe('Progress', () => {
|
|
6
|
+
it('renders correctly', () => {
|
|
7
|
+
const wrapper = mount(Progress)
|
|
8
|
+
expect(wrapper.exists()).toBe(true)
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
it('accepts modelValue prop', () => {
|
|
12
|
+
const wrapper = mount(Progress, {
|
|
13
|
+
props: { modelValue: 50 },
|
|
14
|
+
})
|
|
15
|
+
expect(wrapper.exists()).toBe(true)
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it('applies default size class', () => {
|
|
19
|
+
const wrapper = mount(Progress)
|
|
20
|
+
expect(wrapper.html()).toContain('h-1.5')
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it('applies sm size class', () => {
|
|
24
|
+
const wrapper = mount(Progress, {
|
|
25
|
+
props: { size: 'sm' },
|
|
26
|
+
})
|
|
27
|
+
expect(wrapper.html()).toContain('h-1')
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it('applies lg size class', () => {
|
|
31
|
+
const wrapper = mount(Progress, {
|
|
32
|
+
props: { size: 'lg' },
|
|
33
|
+
})
|
|
34
|
+
expect(wrapper.html()).toContain('h-2')
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('sets aria-label when provided', () => {
|
|
38
|
+
const wrapper = mount(Progress, {
|
|
39
|
+
props: { ariaLabel: 'Upload progress', modelValue: 75 },
|
|
40
|
+
})
|
|
41
|
+
expect(wrapper.html()).toContain('Upload progress')
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it('transforms indicator based on modelValue', () => {
|
|
45
|
+
const wrapper = mount(Progress, {
|
|
46
|
+
props: { modelValue: 60 },
|
|
47
|
+
})
|
|
48
|
+
const indicator = wrapper.find('[style]')
|
|
49
|
+
expect(indicator.exists()).toBe(true)
|
|
50
|
+
expect(indicator.attributes('style')).toContain('translateX(-40%)')
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
it('applies custom class', () => {
|
|
54
|
+
const wrapper = mount(Progress, {
|
|
55
|
+
props: { class: 'my-progress' },
|
|
56
|
+
})
|
|
57
|
+
expect(wrapper.html()).toContain('my-progress')
|
|
58
|
+
})
|
|
59
|
+
})
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
import {
|
|
4
|
+
ProgressIndicator,
|
|
5
|
+
ProgressRoot,
|
|
6
|
+
} from 'radix-vue'
|
|
7
|
+
import { cn } from '@/lib/utils'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
class?: string
|
|
11
|
+
modelValue?: number
|
|
12
|
+
size?: 'default' | 'sm' | 'lg'
|
|
13
|
+
ariaLabel?: string
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
const sizeClasses = {
|
|
17
|
+
sm: 'h-1',
|
|
18
|
+
default: 'h-1.5',
|
|
19
|
+
lg: 'h-2',
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<ProgressRoot
|
|
25
|
+
v-bind="$attrs"
|
|
26
|
+
:model-value="props.modelValue"
|
|
27
|
+
:aria-label="props.ariaLabel"
|
|
28
|
+
:class="
|
|
29
|
+
cn(
|
|
30
|
+
'relative w-full overflow-hidden rounded-full bg-muted',
|
|
31
|
+
sizeClasses[props.size || 'default'],
|
|
32
|
+
props.class
|
|
33
|
+
)
|
|
34
|
+
"
|
|
35
|
+
>
|
|
36
|
+
<ProgressIndicator
|
|
37
|
+
:class="cn('h-full w-full flex-1 bg-primary rounded-full transition-all duration-300 ease-out')"
|
|
38
|
+
:style="{ transform: `translateX(-${100 - (props.modelValue || 0)}%)` }"
|
|
39
|
+
/>
|
|
40
|
+
</ProgressRoot>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Progress } from './Progress.vue'
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import RadioGroup from './RadioGroup.vue'
|
|
4
|
+
import RadioGroupItem from './RadioGroupItem.vue'
|
|
5
|
+
|
|
6
|
+
describe('RadioGroup', () => {
|
|
7
|
+
it('renders correctly', () => {
|
|
8
|
+
const wrapper = mount(RadioGroup)
|
|
9
|
+
expect(wrapper.exists()).toBe(true)
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('renders slot content', () => {
|
|
13
|
+
const wrapper = mount(RadioGroup, {
|
|
14
|
+
slots: { default: '<div class="test-child">Option</div>' },
|
|
15
|
+
})
|
|
16
|
+
expect(wrapper.find('.test-child').exists()).toBe(true)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('passes modelValue to radix RadioGroupRoot', () => {
|
|
20
|
+
const wrapper = mount(RadioGroup, {
|
|
21
|
+
attrs: { modelValue: 'option-1' },
|
|
22
|
+
slots: {
|
|
23
|
+
default: {
|
|
24
|
+
components: { RadioGroupItem },
|
|
25
|
+
template: '<RadioGroupItem value="option-1" /><RadioGroupItem value="option-2" />',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
expect(wrapper.exists()).toBe(true)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it('passes disabled attribute', () => {
|
|
33
|
+
const wrapper = mount(RadioGroup, {
|
|
34
|
+
attrs: { disabled: true },
|
|
35
|
+
})
|
|
36
|
+
expect(wrapper.exists()).toBe(true)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('applies custom class', () => {
|
|
40
|
+
const wrapper = mount(RadioGroup, {
|
|
41
|
+
props: { class: 'custom-radio' },
|
|
42
|
+
})
|
|
43
|
+
expect(wrapper.html()).toContain('custom-radio')
|
|
44
|
+
})
|
|
45
|
+
})
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
import { RadioGroupRoot } from 'radix-vue'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{ class?: string }>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<RadioGroupRoot
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
:class="cn('grid gap-2', props.class)"
|
|
13
|
+
>
|
|
14
|
+
<slot />
|
|
15
|
+
</RadioGroupRoot>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
import {
|
|
4
|
+
RadioGroupIndicator,
|
|
5
|
+
RadioGroupItem,
|
|
6
|
+
} from 'radix-vue'
|
|
7
|
+
import { cn } from '@/lib/utils'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{ class?: string }>()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<RadioGroupItem
|
|
14
|
+
v-bind="$attrs"
|
|
15
|
+
:class="
|
|
16
|
+
cn(
|
|
17
|
+
'aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 shadow-depth-1',
|
|
18
|
+
props.class
|
|
19
|
+
)
|
|
20
|
+
"
|
|
21
|
+
>
|
|
22
|
+
<RadioGroupIndicator class="flex items-center justify-center">
|
|
23
|
+
<svg
|
|
24
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
25
|
+
width="24"
|
|
26
|
+
height="24"
|
|
27
|
+
viewBox="0 0 24 24"
|
|
28
|
+
fill="currentColor"
|
|
29
|
+
class="h-2.5 w-2.5"
|
|
30
|
+
>
|
|
31
|
+
<circle cx="12" cy="12" r="6" />
|
|
32
|
+
</svg>
|
|
33
|
+
</RadioGroupIndicator>
|
|
34
|
+
</RadioGroupItem>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
import { SplitterResizeHandle } from 'radix-vue'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{ class?: string; withHandle?: boolean }>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<SplitterResizeHandle
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
:class="
|
|
13
|
+
cn(
|
|
14
|
+
'relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90',
|
|
15
|
+
props.class
|
|
16
|
+
)
|
|
17
|
+
"
|
|
18
|
+
>
|
|
19
|
+
<div
|
|
20
|
+
v-if="withHandle"
|
|
21
|
+
class="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border"
|
|
22
|
+
>
|
|
23
|
+
<svg
|
|
24
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
25
|
+
width="24"
|
|
26
|
+
height="24"
|
|
27
|
+
viewBox="0 0 24 24"
|
|
28
|
+
fill="none"
|
|
29
|
+
stroke="currentColor"
|
|
30
|
+
stroke-width="2"
|
|
31
|
+
class="h-2.5 w-2.5"
|
|
32
|
+
>
|
|
33
|
+
<circle cx="12" cy="9" r="1" />
|
|
34
|
+
<circle cx="12" cy="15" r="1" />
|
|
35
|
+
</svg>
|
|
36
|
+
</div>
|
|
37
|
+
</SplitterResizeHandle>
|
|
38
|
+
</template>
|