@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
|
+
export { default as AlertDialog } from './AlertDialog.vue'
|
|
2
|
+
export { default as AlertDialogTrigger } from './AlertDialogTrigger.vue'
|
|
3
|
+
export { default as AlertDialogPortal } from './AlertDialogPortal.vue'
|
|
4
|
+
export { default as AlertDialogOverlay } from './AlertDialogOverlay.vue'
|
|
5
|
+
export { default as AlertDialogContent } from './AlertDialogContent.vue'
|
|
6
|
+
export { default as AlertDialogHeader } from './AlertDialogHeader.vue'
|
|
7
|
+
export { default as AlertDialogFooter } from './AlertDialogFooter.vue'
|
|
8
|
+
export { default as AlertDialogTitle } from './AlertDialogTitle.vue'
|
|
9
|
+
export { default as AlertDialogDescription } from './AlertDialogDescription.vue'
|
|
10
|
+
export { default as AlertDialogAction } from './AlertDialogAction.vue'
|
|
11
|
+
export { default as AlertDialogCancel } from './AlertDialogCancel.vue'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AspectRatio } from './AspectRatio.vue'
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import Avatar from './Avatar.vue'
|
|
4
|
+
import AvatarFallback from './AvatarFallback.vue'
|
|
5
|
+
|
|
6
|
+
describe('Avatar', () => {
|
|
7
|
+
it('renders correctly', () => {
|
|
8
|
+
const wrapper = mount(Avatar)
|
|
9
|
+
expect(wrapper.exists()).toBe(true)
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('renders slot content', () => {
|
|
13
|
+
const wrapper = mount(Avatar, {
|
|
14
|
+
slots: { default: '<span>AB</span>' },
|
|
15
|
+
})
|
|
16
|
+
expect(wrapper.text()).toContain('AB')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('applies custom class', () => {
|
|
20
|
+
const wrapper = mount(Avatar, {
|
|
21
|
+
props: { class: 'avatar-custom' },
|
|
22
|
+
})
|
|
23
|
+
expect(wrapper.classes()).toContain('avatar-custom')
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('has default size classes', () => {
|
|
27
|
+
const wrapper = mount(Avatar)
|
|
28
|
+
const classes = wrapper.classes().join(' ')
|
|
29
|
+
expect(classes).toContain('h-10')
|
|
30
|
+
expect(classes).toContain('w-10')
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
describe('AvatarFallback', () => {
|
|
35
|
+
it('renders correctly inside Avatar', () => {
|
|
36
|
+
const wrapper = mount(Avatar, {
|
|
37
|
+
slots: {
|
|
38
|
+
default: {
|
|
39
|
+
template: '<AvatarFallback>JD</AvatarFallback>',
|
|
40
|
+
components: { AvatarFallback },
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
expect(wrapper.text()).toContain('JD')
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it('applies custom class', () => {
|
|
48
|
+
const wrapper = mount(Avatar, {
|
|
49
|
+
slots: {
|
|
50
|
+
default: {
|
|
51
|
+
template: '<AvatarFallback class="fb-custom">X</AvatarFallback>',
|
|
52
|
+
components: { AvatarFallback },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
expect(wrapper.html()).toContain('fb-custom')
|
|
57
|
+
})
|
|
58
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { AvatarRoot, type AvatarRootProps } from 'radix-vue'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<AvatarRootProps & { class?: string }>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<AvatarRoot
|
|
10
|
+
v-bind="props"
|
|
11
|
+
:class="
|
|
12
|
+
cn(
|
|
13
|
+
'relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full shadow-depth-1',
|
|
14
|
+
props.class
|
|
15
|
+
)
|
|
16
|
+
"
|
|
17
|
+
>
|
|
18
|
+
<slot />
|
|
19
|
+
</AvatarRoot>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { AvatarFallback, type AvatarFallbackProps } from 'radix-vue'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<AvatarFallbackProps & { class?: string }>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<AvatarFallback
|
|
10
|
+
v-bind="props"
|
|
11
|
+
:class="
|
|
12
|
+
cn(
|
|
13
|
+
'flex h-full w-full items-center justify-center rounded-full bg-muted text-muted-foreground',
|
|
14
|
+
props.class
|
|
15
|
+
)
|
|
16
|
+
"
|
|
17
|
+
>
|
|
18
|
+
<slot />
|
|
19
|
+
</AvatarFallback>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { AvatarImage, type AvatarImageProps } from 'radix-vue'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<AvatarImageProps & { class?: string }>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<AvatarImage v-bind="props" :class="cn('aspect-square h-full w-full', props.class)" />
|
|
10
|
+
</template>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import Badge from './Badge.vue'
|
|
4
|
+
|
|
5
|
+
describe('Badge', () => {
|
|
6
|
+
it('renders correctly', () => {
|
|
7
|
+
const wrapper = mount(Badge)
|
|
8
|
+
expect(wrapper.exists()).toBe(true)
|
|
9
|
+
expect(wrapper.element.tagName).toBe('DIV')
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('renders slot content', () => {
|
|
13
|
+
const wrapper = mount(Badge, {
|
|
14
|
+
slots: { default: 'New' },
|
|
15
|
+
})
|
|
16
|
+
expect(wrapper.text()).toContain('New')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('applies default variant classes', () => {
|
|
20
|
+
const wrapper = mount(Badge)
|
|
21
|
+
const classes = wrapper.classes().join(' ')
|
|
22
|
+
expect(classes).toContain('bg-primary')
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('applies destructive variant classes', () => {
|
|
26
|
+
const wrapper = mount(Badge, {
|
|
27
|
+
props: { variant: 'destructive' },
|
|
28
|
+
})
|
|
29
|
+
const classes = wrapper.classes().join(' ')
|
|
30
|
+
expect(classes).toContain('bg-destructive')
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('applies secondary variant classes', () => {
|
|
34
|
+
const wrapper = mount(Badge, {
|
|
35
|
+
props: { variant: 'secondary' },
|
|
36
|
+
})
|
|
37
|
+
const classes = wrapper.classes().join(' ')
|
|
38
|
+
expect(classes).toContain('bg-secondary')
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('applies outline variant classes', () => {
|
|
42
|
+
const wrapper = mount(Badge, {
|
|
43
|
+
props: { variant: 'outline' },
|
|
44
|
+
})
|
|
45
|
+
const classes = wrapper.classes().join(' ')
|
|
46
|
+
expect(classes).toContain('text-foreground')
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it('applies default size classes', () => {
|
|
50
|
+
const wrapper = mount(Badge)
|
|
51
|
+
const classes = wrapper.classes().join(' ')
|
|
52
|
+
expect(classes).toContain('text-xs')
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('applies sm size classes', () => {
|
|
56
|
+
const wrapper = mount(Badge, {
|
|
57
|
+
props: { size: 'sm' },
|
|
58
|
+
})
|
|
59
|
+
const classes = wrapper.classes().join(' ')
|
|
60
|
+
expect(classes).toContain('text-[10px]')
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it('applies lg size classes', () => {
|
|
64
|
+
const wrapper = mount(Badge, {
|
|
65
|
+
props: { size: 'lg' },
|
|
66
|
+
})
|
|
67
|
+
const classes = wrapper.classes().join(' ')
|
|
68
|
+
expect(classes).toContain('text-sm')
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it('applies custom class', () => {
|
|
72
|
+
const wrapper = mount(Badge, {
|
|
73
|
+
props: { class: 'my-badge' },
|
|
74
|
+
})
|
|
75
|
+
expect(wrapper.classes()).toContain('my-badge')
|
|
76
|
+
})
|
|
77
|
+
})
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
import { badgeVariants, type BadgeVariants } from './variants'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
variant?: BadgeVariants['variant']
|
|
7
|
+
size?: BadgeVariants['size']
|
|
8
|
+
class?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = defineProps<Props>()
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div :class="cn(badgeVariants({ variant, size }), props.class)">
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
export { badgeVariants }
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { badgeVariants } from './variants'
|
|
3
|
+
|
|
4
|
+
describe('badgeVariants', () => {
|
|
5
|
+
describe('defaults', () => {
|
|
6
|
+
it('returns expected classes with no arguments (default variant and size)', () => {
|
|
7
|
+
const result = badgeVariants()
|
|
8
|
+
expect(result).toContain('inline-flex')
|
|
9
|
+
expect(result).toContain('items-center')
|
|
10
|
+
expect(result).toContain('rounded-full')
|
|
11
|
+
expect(result).toContain('bg-primary')
|
|
12
|
+
expect(result).toContain('text-primary-foreground')
|
|
13
|
+
expect(result).toContain('px-2.5')
|
|
14
|
+
expect(result).toContain('py-0.5')
|
|
15
|
+
expect(result).toContain('text-xs')
|
|
16
|
+
})
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
describe('variant', () => {
|
|
20
|
+
it('default variant includes primary background and shadow', () => {
|
|
21
|
+
const result = badgeVariants({ variant: 'default' })
|
|
22
|
+
expect(result).toContain('bg-primary')
|
|
23
|
+
expect(result).toContain('text-primary-foreground')
|
|
24
|
+
expect(result).toContain('shadow-depth-1')
|
|
25
|
+
expect(result).toContain('border-transparent')
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('secondary variant includes secondary background', () => {
|
|
29
|
+
const result = badgeVariants({ variant: 'secondary' })
|
|
30
|
+
expect(result).toContain('bg-secondary')
|
|
31
|
+
expect(result).toContain('text-secondary-foreground')
|
|
32
|
+
expect(result).toContain('border-transparent')
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('destructive variant includes destructive background and shadow', () => {
|
|
36
|
+
const result = badgeVariants({ variant: 'destructive' })
|
|
37
|
+
expect(result).toContain('bg-destructive')
|
|
38
|
+
expect(result).toContain('text-destructive-foreground')
|
|
39
|
+
expect(result).toContain('shadow-depth-1')
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it('outline variant includes foreground text only', () => {
|
|
43
|
+
const result = badgeVariants({ variant: 'outline' })
|
|
44
|
+
expect(result).toContain('text-foreground')
|
|
45
|
+
expect(result).not.toContain('bg-primary')
|
|
46
|
+
expect(result).not.toContain('bg-secondary')
|
|
47
|
+
expect(result).not.toContain('bg-destructive')
|
|
48
|
+
})
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
describe('size', () => {
|
|
52
|
+
it('sm size applies smaller padding and text', () => {
|
|
53
|
+
const result = badgeVariants({ size: 'sm' })
|
|
54
|
+
expect(result).toContain('px-2')
|
|
55
|
+
expect(result).toContain('py-0')
|
|
56
|
+
expect(result).toContain('text-[10px]')
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it('default size applies standard padding and text', () => {
|
|
60
|
+
const result = badgeVariants({ size: 'default' })
|
|
61
|
+
expect(result).toContain('px-2.5')
|
|
62
|
+
expect(result).toContain('py-0.5')
|
|
63
|
+
expect(result).toContain('text-xs')
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it('lg size applies larger padding and text', () => {
|
|
67
|
+
const result = badgeVariants({ size: 'lg' })
|
|
68
|
+
expect(result).toContain('px-3')
|
|
69
|
+
expect(result).toContain('py-1')
|
|
70
|
+
expect(result).toContain('text-sm')
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
})
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
export const badgeVariants = cva(
|
|
4
|
+
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
|
5
|
+
{
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: 'border-transparent bg-primary text-primary-foreground shadow-depth-1',
|
|
9
|
+
secondary: 'border-transparent bg-secondary text-secondary-foreground',
|
|
10
|
+
destructive: 'border-transparent bg-destructive text-destructive-foreground shadow-depth-1',
|
|
11
|
+
outline: 'text-foreground',
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
sm: 'px-2 py-0 text-[10px]',
|
|
15
|
+
default: 'px-2.5 py-0.5 text-xs',
|
|
16
|
+
lg: 'px-3 py-1 text-sm',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: 'default',
|
|
21
|
+
size: 'default',
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
export type BadgeVariants = VariantProps<typeof badgeVariants>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const props = defineProps<Props>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<span
|
|
13
|
+
role="presentation"
|
|
14
|
+
aria-hidden="true"
|
|
15
|
+
:class="cn('flex h-9 w-9 items-center justify-center', props.class)"
|
|
16
|
+
>
|
|
17
|
+
<svg
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
width="24"
|
|
20
|
+
height="24"
|
|
21
|
+
viewBox="0 0 24 24"
|
|
22
|
+
fill="none"
|
|
23
|
+
stroke="currentColor"
|
|
24
|
+
stroke-width="2"
|
|
25
|
+
stroke-linecap="round"
|
|
26
|
+
stroke-linejoin="round"
|
|
27
|
+
class="h-4 w-4"
|
|
28
|
+
>
|
|
29
|
+
<circle cx="12" cy="12" r="1" />
|
|
30
|
+
<circle cx="19" cy="12" r="1" />
|
|
31
|
+
<circle cx="5" cy="12" r="1" />
|
|
32
|
+
</svg>
|
|
33
|
+
<span class="sr-only">More</span>
|
|
34
|
+
</span>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const props = defineProps<Props>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<li :class="cn('inline-flex items-center gap-1.5', props.class)">
|
|
13
|
+
<slot />
|
|
14
|
+
</li>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string
|
|
6
|
+
href?: string
|
|
7
|
+
asChild?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const props = defineProps<Props>()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<component
|
|
15
|
+
:is="asChild ? 'slot' : 'a'"
|
|
16
|
+
:href="asChild ? undefined : href"
|
|
17
|
+
:class="cn('transition-colors hover:text-foreground', props.class)"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</component>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const props = defineProps<Props>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<ol
|
|
13
|
+
:class="
|
|
14
|
+
cn(
|
|
15
|
+
'flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5',
|
|
16
|
+
props.class
|
|
17
|
+
)
|
|
18
|
+
"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
</ol>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const props = defineProps<Props>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<span
|
|
13
|
+
role="link"
|
|
14
|
+
aria-disabled="true"
|
|
15
|
+
aria-current="page"
|
|
16
|
+
:class="cn('font-normal text-foreground', props.class)"
|
|
17
|
+
>
|
|
18
|
+
<slot />
|
|
19
|
+
</span>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
class?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const props = defineProps<Props>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<li
|
|
13
|
+
role="presentation"
|
|
14
|
+
aria-hidden="true"
|
|
15
|
+
:class="cn('[&>svg]:size-3.5', props.class)"
|
|
16
|
+
>
|
|
17
|
+
<slot>
|
|
18
|
+
<svg
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
width="24"
|
|
21
|
+
height="24"
|
|
22
|
+
viewBox="0 0 24 24"
|
|
23
|
+
fill="none"
|
|
24
|
+
stroke="currentColor"
|
|
25
|
+
stroke-width="2"
|
|
26
|
+
stroke-linecap="round"
|
|
27
|
+
stroke-linejoin="round"
|
|
28
|
+
class="h-4 w-4"
|
|
29
|
+
>
|
|
30
|
+
<path d="m9 18 6-6-6-6" />
|
|
31
|
+
</svg>
|
|
32
|
+
</slot>
|
|
33
|
+
</li>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Breadcrumb } from './Breadcrumb.vue'
|
|
2
|
+
export { default as BreadcrumbList } from './BreadcrumbList.vue'
|
|
3
|
+
export { default as BreadcrumbItem } from './BreadcrumbItem.vue'
|
|
4
|
+
export { default as BreadcrumbLink } from './BreadcrumbLink.vue'
|
|
5
|
+
export { default as BreadcrumbPage } from './BreadcrumbPage.vue'
|
|
6
|
+
export { default as BreadcrumbSeparator } from './BreadcrumbSeparator.vue'
|
|
7
|
+
export { default as BreadcrumbEllipsis } from './BreadcrumbEllipsis.vue'
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import Button from './Button.vue'
|
|
4
|
+
|
|
5
|
+
describe('Button', () => {
|
|
6
|
+
it('renders correctly', () => {
|
|
7
|
+
const wrapper = mount(Button)
|
|
8
|
+
expect(wrapper.exists()).toBe(true)
|
|
9
|
+
expect(wrapper.element.tagName).toBe('BUTTON')
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('renders slot content', () => {
|
|
13
|
+
const wrapper = mount(Button, {
|
|
14
|
+
slots: { default: 'Click me' },
|
|
15
|
+
})
|
|
16
|
+
expect(wrapper.text()).toContain('Click me')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('applies variant prop classes', () => {
|
|
20
|
+
const wrapper = mount(Button, {
|
|
21
|
+
props: { variant: 'destructive' },
|
|
22
|
+
})
|
|
23
|
+
expect(wrapper.classes().join(' ')).toContain('bg-destructive')
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('applies default variant when no variant specified', () => {
|
|
27
|
+
const wrapper = mount(Button)
|
|
28
|
+
expect(wrapper.classes().join(' ')).toContain('bg-primary')
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('applies size prop classes', () => {
|
|
32
|
+
const wrapper = mount(Button, {
|
|
33
|
+
props: { size: 'sm' },
|
|
34
|
+
})
|
|
35
|
+
expect(wrapper.classes().join(' ')).toContain('h-9')
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('applies lg size prop classes', () => {
|
|
39
|
+
const wrapper = mount(Button, {
|
|
40
|
+
props: { size: 'lg' },
|
|
41
|
+
})
|
|
42
|
+
expect(wrapper.classes().join(' ')).toContain('h-11')
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
it('is disabled when disabled prop is true', () => {
|
|
46
|
+
const wrapper = mount(Button, {
|
|
47
|
+
props: { disabled: true },
|
|
48
|
+
})
|
|
49
|
+
expect(wrapper.attributes('disabled')).toBeDefined()
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('is disabled when loading prop is true', () => {
|
|
53
|
+
const wrapper = mount(Button, {
|
|
54
|
+
props: { loading: true },
|
|
55
|
+
})
|
|
56
|
+
expect(wrapper.attributes('disabled')).toBeDefined()
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
it('emits click event when clicked', async () => {
|
|
60
|
+
const wrapper = mount(Button)
|
|
61
|
+
await wrapper.trigger('click')
|
|
62
|
+
expect(wrapper.emitted('click')).toHaveLength(1)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it('sets type attribute correctly', () => {
|
|
66
|
+
const wrapper = mount(Button, {
|
|
67
|
+
props: { type: 'submit' },
|
|
68
|
+
})
|
|
69
|
+
expect(wrapper.attributes('type')).toBe('submit')
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it('defaults type to button', () => {
|
|
73
|
+
const wrapper = mount(Button)
|
|
74
|
+
expect(wrapper.attributes('type')).toBe('button')
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('shows loading spinner when loading', () => {
|
|
78
|
+
const wrapper = mount(Button, {
|
|
79
|
+
props: { loading: true },
|
|
80
|
+
slots: { default: 'Submit' },
|
|
81
|
+
})
|
|
82
|
+
expect(wrapper.find('svg.animate-spin').exists()).toBe(true)
|
|
83
|
+
})
|
|
84
|
+
})
|