@bl33dz/fa814698dcde12f86a37ac31dd3aedf9 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/perisai-ui.es.js +6402 -0
- package/dist/perisai-ui.umd.js +1 -0
- package/dist/ui.css +1 -0
- package/fix_imports.sh +38 -0
- package/generate_index.cjs +52 -0
- package/package.json +46 -0
- package/package.json.bak +42 -0
- package/src/index.css +7704 -0
- package/src/index.ts +179 -0
- package/src/lib/utils.ts +6 -0
- package/src/shadcn/accordion/Accordion.vue +19 -0
- package/src/shadcn/accordion/AccordionContent.vue +23 -0
- package/src/shadcn/accordion/AccordionItem.vue +23 -0
- package/src/shadcn/accordion/AccordionTrigger.vue +38 -0
- package/src/shadcn/accordion/index.ts +4 -0
- package/src/shadcn/avatar/Avatar.vue +18 -0
- package/src/shadcn/avatar/AvatarFallback.vue +21 -0
- package/src/shadcn/avatar/AvatarImage.vue +16 -0
- package/src/shadcn/avatar/index.ts +3 -0
- package/src/shadcn/breadcrumb/Breadcrumb.vue +8 -0
- package/src/shadcn/breadcrumb/BreadcrumbEllipsis.vue +9 -0
- package/src/shadcn/breadcrumb/BreadcrumbItem.vue +8 -0
- package/src/shadcn/breadcrumb/BreadcrumbLink.vue +8 -0
- package/src/shadcn/breadcrumb/BreadcrumbList.vue +8 -0
- package/src/shadcn/breadcrumb/BreadcrumbPage.vue +8 -0
- package/src/shadcn/breadcrumb/BreadcrumbSeparator.vue +8 -0
- package/src/shadcn/breadcrumb/index.ts +7 -0
- package/src/shadcn/button/Button.vue +29 -0
- package/src/shadcn/button/index.ts +38 -0
- package/src/shadcn/calendar/Calendar.vue +64 -0
- package/src/shadcn/calendar/CalendarCell.vue +23 -0
- package/src/shadcn/calendar/CalendarCellTrigger.vue +39 -0
- package/src/shadcn/calendar/CalendarGrid.vue +23 -0
- package/src/shadcn/calendar/CalendarGridBody.vue +15 -0
- package/src/shadcn/calendar/CalendarGridHead.vue +16 -0
- package/src/shadcn/calendar/CalendarGridRow.vue +22 -0
- package/src/shadcn/calendar/CalendarHeadCell.vue +23 -0
- package/src/shadcn/calendar/CalendarHeader.vue +23 -0
- package/src/shadcn/calendar/CalendarHeading.vue +30 -0
- package/src/shadcn/calendar/CalendarNextButton.vue +32 -0
- package/src/shadcn/calendar/CalendarPrevButton.vue +32 -0
- package/src/shadcn/calendar/index.ts +12 -0
- package/src/shadcn/card/Card.vue +8 -0
- package/src/shadcn/card/CardContent.vue +8 -0
- package/src/shadcn/card/CardDescription.vue +8 -0
- package/src/shadcn/card/CardHeader.vue +8 -0
- package/src/shadcn/card/CardTitle.vue +8 -0
- package/src/shadcn/card/index.ts +5 -0
- package/src/shadcn/checkbox/Checkbox.vue +38 -0
- package/src/shadcn/checkbox/index.ts +1 -0
- package/src/shadcn/command/Command.vue +87 -0
- package/src/shadcn/command/CommandDialog.vue +31 -0
- package/src/shadcn/command/CommandEmpty.vue +27 -0
- package/src/shadcn/command/CommandGroup.vue +45 -0
- package/src/shadcn/command/CommandInput.vue +39 -0
- package/src/shadcn/command/CommandItem.vue +76 -0
- package/src/shadcn/command/CommandList.vue +25 -0
- package/src/shadcn/command/CommandSeparator.vue +21 -0
- package/src/shadcn/command/CommandShortcut.vue +17 -0
- package/src/shadcn/command/index.ts +25 -0
- package/src/shadcn/context-menu/ContextMenu.vue +18 -0
- package/src/shadcn/context-menu/ContextMenuCheckboxItem.vue +38 -0
- package/src/shadcn/context-menu/ContextMenuContent.vue +34 -0
- package/src/shadcn/context-menu/ContextMenuGroup.vue +15 -0
- package/src/shadcn/context-menu/ContextMenuItem.vue +39 -0
- package/src/shadcn/context-menu/ContextMenuLabel.vue +22 -0
- package/src/shadcn/context-menu/ContextMenuPortal.vue +15 -0
- package/src/shadcn/context-menu/ContextMenuRadioGroup.vue +22 -0
- package/src/shadcn/context-menu/ContextMenuRadioItem.vue +38 -0
- package/src/shadcn/context-menu/ContextMenuSeparator.vue +22 -0
- package/src/shadcn/context-menu/ContextMenuShortcut.vue +17 -0
- package/src/shadcn/context-menu/ContextMenuSub.vue +22 -0
- package/src/shadcn/context-menu/ContextMenuSubContent.vue +33 -0
- package/src/shadcn/context-menu/ContextMenuSubTrigger.vue +33 -0
- package/src/shadcn/context-menu/ContextMenuTrigger.vue +17 -0
- package/src/shadcn/context-menu/index.ts +15 -0
- package/src/shadcn/dialog/Dialog.vue +18 -0
- package/src/shadcn/dialog/DialogClose.vue +15 -0
- package/src/shadcn/dialog/DialogContent.vue +46 -0
- package/src/shadcn/dialog/DialogDescription.vue +23 -0
- package/src/shadcn/dialog/DialogFooter.vue +15 -0
- package/src/shadcn/dialog/DialogHeader.vue +17 -0
- package/src/shadcn/dialog/DialogOverlay.vue +21 -0
- package/src/shadcn/dialog/DialogScrollContent.vue +56 -0
- package/src/shadcn/dialog/DialogTitle.vue +23 -0
- package/src/shadcn/dialog/DialogTrigger.vue +15 -0
- package/src/shadcn/dialog/index.ts +10 -0
- package/src/shadcn/dropdown-menu/DropdownMenu.vue +18 -0
- package/src/shadcn/dropdown-menu/DropdownMenuCheckboxItem.vue +38 -0
- package/src/shadcn/dropdown-menu/DropdownMenuContent.vue +36 -0
- package/src/shadcn/dropdown-menu/DropdownMenuGroup.vue +15 -0
- package/src/shadcn/dropdown-menu/DropdownMenuItem.vue +31 -0
- package/src/shadcn/dropdown-menu/DropdownMenuLabel.vue +23 -0
- package/src/shadcn/dropdown-menu/DropdownMenuRadioGroup.vue +22 -0
- package/src/shadcn/dropdown-menu/DropdownMenuRadioItem.vue +39 -0
- package/src/shadcn/dropdown-menu/DropdownMenuSeparator.vue +24 -0
- package/src/shadcn/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/src/shadcn/dropdown-menu/DropdownMenuSub.vue +19 -0
- package/src/shadcn/dropdown-menu/DropdownMenuSubContent.vue +28 -0
- package/src/shadcn/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
- package/src/shadcn/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/src/shadcn/dropdown-menu/index.ts +16 -0
- package/src/shadcn/menubar/Menubar.vue +33 -0
- package/src/shadcn/menubar/MenubarCheckboxItem.vue +38 -0
- package/src/shadcn/menubar/MenubarContent.vue +42 -0
- package/src/shadcn/menubar/MenubarGroup.vue +15 -0
- package/src/shadcn/menubar/MenubarItem.vue +37 -0
- package/src/shadcn/menubar/MenubarLabel.vue +20 -0
- package/src/shadcn/menubar/MenubarMenu.vue +15 -0
- package/src/shadcn/menubar/MenubarPortal.vue +5 -0
- package/src/shadcn/menubar/MenubarRadioGroup.vue +22 -0
- package/src/shadcn/menubar/MenubarRadioItem.vue +38 -0
- package/src/shadcn/menubar/MenubarSeparator.vue +21 -0
- package/src/shadcn/menubar/MenubarShortcut.vue +17 -0
- package/src/shadcn/menubar/MenubarSub.vue +23 -0
- package/src/shadcn/menubar/MenubarSubContent.vue +36 -0
- package/src/shadcn/menubar/MenubarSubTrigger.vue +28 -0
- package/src/shadcn/menubar/MenubarTrigger.vue +28 -0
- package/src/shadcn/menubar/index.ts +15 -0
- package/src/shadcn/navigation-menu/NavigationMenu.vue +35 -0
- package/src/shadcn/navigation-menu/NavigationMenuContent.vue +31 -0
- package/src/shadcn/navigation-menu/NavigationMenuIndicator.vue +23 -0
- package/src/shadcn/navigation-menu/NavigationMenuItem.vue +21 -0
- package/src/shadcn/navigation-menu/NavigationMenuLink.vue +26 -0
- package/src/shadcn/navigation-menu/NavigationMenuList.vue +28 -0
- package/src/shadcn/navigation-menu/NavigationMenuTrigger.vue +24 -0
- package/src/shadcn/navigation-menu/NavigationMenuViewport.vue +31 -0
- package/src/shadcn/navigation-menu/index.ts +14 -0
- package/src/shadcn/pagination/Pagination.vue +151 -0
- package/src/shadcn/pagination/PaginationContent.vue +22 -0
- package/src/shadcn/pagination/PaginationEllipsis.vue +25 -0
- package/src/shadcn/pagination/PaginationFirst.vue +33 -0
- package/src/shadcn/pagination/PaginationItem.vue +31 -0
- package/src/shadcn/pagination/PaginationLast.vue +33 -0
- package/src/shadcn/pagination/PaginationLink.vue +13 -0
- package/src/shadcn/pagination/PaginationNext.vue +22 -0
- package/src/shadcn/pagination/PaginationPrevious.vue +33 -0
- package/src/shadcn/pagination/index.ts +9 -0
- package/src/shadcn/popover/Popover.vue +18 -0
- package/src/shadcn/popover/PopoverAnchor.vue +15 -0
- package/src/shadcn/popover/PopoverContent.vue +46 -0
- package/src/shadcn/popover/PopoverTrigger.vue +15 -0
- package/src/shadcn/popover/index.ts +4 -0
- package/src/shadcn/radio-group/RadioGroup.vue +24 -0
- package/src/shadcn/radio-group/RadioGroupItem.vue +39 -0
- package/src/shadcn/radio-group/index.ts +2 -0
- package/src/shadcn/range-calendar/RangeCalendar.vue +71 -0
- package/src/shadcn/range-calendar/RangeCalendarCell.vue +23 -0
- package/src/shadcn/range-calendar/RangeCalendarCellTrigger.vue +41 -0
- package/src/shadcn/range-calendar/RangeCalendarGrid.vue +23 -0
- package/src/shadcn/range-calendar/RangeCalendarGridBody.vue +15 -0
- package/src/shadcn/range-calendar/RangeCalendarGridHead.vue +15 -0
- package/src/shadcn/range-calendar/RangeCalendarGridRow.vue +22 -0
- package/src/shadcn/range-calendar/RangeCalendarHeadCell.vue +23 -0
- package/src/shadcn/range-calendar/RangeCalendarHeader.vue +23 -0
- package/src/shadcn/range-calendar/RangeCalendarHeading.vue +30 -0
- package/src/shadcn/range-calendar/RangeCalendarNextButton.vue +32 -0
- package/src/shadcn/range-calendar/RangeCalendarPrevButton.vue +32 -0
- package/src/shadcn/range-calendar/index.ts +12 -0
- package/src/shadcn/select/Select.vue +18 -0
- package/src/shadcn/select/SelectContent.vue +52 -0
- package/src/shadcn/select/SelectGroup.vue +15 -0
- package/src/shadcn/select/SelectItem.vue +43 -0
- package/src/shadcn/select/SelectItemText.vue +15 -0
- package/src/shadcn/select/SelectLabel.vue +17 -0
- package/src/shadcn/select/SelectScrollDownButton.vue +26 -0
- package/src/shadcn/select/SelectScrollUpButton.vue +26 -0
- package/src/shadcn/select/SelectSeparator.vue +19 -0
- package/src/shadcn/select/SelectTrigger.vue +33 -0
- package/src/shadcn/select/SelectValue.vue +15 -0
- package/src/shadcn/select/index.ts +11 -0
- package/src/shadcn/separator/Separator.vue +31 -0
- package/src/shadcn/separator/index.ts +1 -0
- package/src/shadcn/sidebar/MenuGroup.vue +28 -0
- package/src/shadcn/sidebar/MenuItemRenderer.vue +23 -0
- package/src/shadcn/sidebar/Sidebar.vue +14 -0
- package/src/shadcn/sidebar/SidebarDemoContent.vue +26 -0
- package/src/shadcn/sidebar/SidebarMenuGroupWithLabel.vue +29 -0
- package/src/shadcn/sidebar/SidebarMenuItemWithIcon.vue +103 -0
- package/src/shadcn/sidebar/SidebarMenuSub.vue +10 -0
- package/src/shadcn/sidebar/SidebarMenuSubItemStyled.vue +38 -0
- package/src/shadcn/sidebar/SidebarTrigger.vue +8 -0
- package/src/shadcn/sidebar/index.ts +5 -0
- package/src/shadcn/slider/Slider.vue +43 -0
- package/src/shadcn/slider/index.ts +1 -0
- package/src/shadcn/sonner/Sonner.vue +19 -0
- package/src/shadcn/sonner/index.ts +1 -0
- package/src/shadcn/switch/Switch.vue +38 -0
- package/src/shadcn/switch/index.ts +1 -0
- package/src/shadcn/tabs/CardTabsContent.vue +16 -0
- package/src/shadcn/tabs/CornerCutTabsTrigger.vue +102 -0
- package/src/shadcn/tabs/GridTabsList.vue +30 -0
- package/src/shadcn/tabs/ScrollableTabsList.vue +8 -0
- package/src/shadcn/tabs/Tabs.vue +23 -0
- package/src/shadcn/tabs/TabsContent.vue +21 -0
- package/src/shadcn/tabs/TabsList.vue +24 -0
- package/src/shadcn/tabs/TabsTrigger.vue +30 -0
- package/src/shadcn/tabs/VerticalTabsList.vue +28 -0
- package/src/shadcn/tabs/VerticalTabsTrigger.vue +16 -0
- package/src/shadcn/tabs/index.ts +10 -0
- package/src/shadcn/toggle/Toggle.vue +35 -0
- package/src/shadcn/toggle/index.ts +28 -0
- package/src/shadcn/tooltip/Tooltip.vue +18 -0
- package/src/shadcn/tooltip/TooltipContent.vue +34 -0
- package/src/shadcn/tooltip/TooltipProvider.vue +14 -0
- package/src/shadcn/tooltip/TooltipTrigger.vue +15 -0
- package/src/shadcn/tooltip/index.ts +4 -0
- package/src/ui/InputOTP.vue +69 -0
- package/src/ui/InputOTPContext.ts +10 -0
- package/src/ui/InputOTPGroup.vue +7 -0
- package/src/ui/InputOTPSeparator.vue +8 -0
- package/src/ui/InputOTPSlot.vue +61 -0
- package/src/ui/PopoverContent.vue +27 -0
- package/src/ui/PopoverTrigger.vue +9 -0
- package/src/ui/SelectContent.vue +24 -0
- package/src/ui/SelectGroup.vue +22 -0
- package/src/ui/SelectItem.vue +25 -0
- package/src/ui/SelectLabel.vue +27 -0
- package/src/ui/SelectSeparator.vue +23 -0
- package/src/ui/SelectTrigger.vue +22 -0
- package/src/ui/SelectValue.vue +9 -0
- package/src/ui/SheetContent.vue +34 -0
- package/src/ui/SheetDescription.vue +9 -0
- package/src/ui/SheetHeader.vue +11 -0
- package/src/ui/SheetTitle.vue +9 -0
- package/src/ui/accordion-content.vue +21 -0
- package/src/ui/accordion-item.vue +18 -0
- package/src/ui/accordion-trigger.vue +14 -0
- package/src/ui/accordion.vue +9 -0
- package/src/ui/alert-actions.vue +13 -0
- package/src/ui/alert-description.vue +13 -0
- package/src/ui/alert-title.vue +13 -0
- package/src/ui/alert.vue +63 -0
- package/src/ui/avatar-fallback.vue +38 -0
- package/src/ui/avatar-group.vue +32 -0
- package/src/ui/avatar-image.vue +19 -0
- package/src/ui/avatar.vue +32 -0
- package/src/ui/badge.vue +90 -0
- package/src/ui/breadcrumb-item.vue +11 -0
- package/src/ui/breadcrumb-separator.vue +9 -0
- package/src/ui/breadcrumb.vue +11 -0
- package/src/ui/button.vue +76 -0
- package/src/ui/card-content.vue +16 -0
- package/src/ui/card-description.vue +16 -0
- package/src/ui/card-footer.vue +13 -0
- package/src/ui/card-header.vue +19 -0
- package/src/ui/card-title.vue +16 -0
- package/src/ui/card.vue +73 -0
- package/src/ui/category-breakdown-metric.vue +205 -0
- package/src/ui/checkbox.vue +84 -0
- package/src/ui/cn.ts +6 -0
- package/src/ui/dialog-body.vue +13 -0
- package/src/ui/dialog-close.vue +9 -0
- package/src/ui/dialog-content.vue +36 -0
- package/src/ui/dialog-description.vue +13 -0
- package/src/ui/dialog-footer.vue +13 -0
- package/src/ui/dialog-header.vue +13 -0
- package/src/ui/dialog-overlay.vue +14 -0
- package/src/ui/dialog-portal.vue +9 -0
- package/src/ui/dialog-title.vue +13 -0
- package/src/ui/dialog-trigger.vue +9 -0
- package/src/ui/dialog.vue +9 -0
- package/src/ui/dismissible-badges-demo.vue +94 -0
- package/src/ui/drawer-content.vue +53 -0
- package/src/ui/drawer-description.vue +23 -0
- package/src/ui/drawer-footer.vue +22 -0
- package/src/ui/drawer-header.vue +22 -0
- package/src/ui/drawer-title.vue +23 -0
- package/src/ui/drawer-trigger.vue +23 -0
- package/src/ui/drawer.vue +34 -0
- package/src/ui/dropdown-menu-checkbox-item.vue +27 -0
- package/src/ui/dropdown-menu-content.vue +23 -0
- package/src/ui/dropdown-menu-group.vue +7 -0
- package/src/ui/dropdown-menu-item.vue +19 -0
- package/src/ui/dropdown-menu-label.vue +17 -0
- package/src/ui/dropdown-menu-portal.vue +8 -0
- package/src/ui/dropdown-menu-radio-group.vue +14 -0
- package/src/ui/dropdown-menu-radio-item.vue +30 -0
- package/src/ui/dropdown-menu-separator.vue +13 -0
- package/src/ui/dropdown-menu-shortcut.vue +15 -0
- package/src/ui/dropdown-menu-sub-content.vue +8 -0
- package/src/ui/dropdown-menu-sub-trigger.vue +8 -0
- package/src/ui/dropdown-menu-sub.vue +8 -0
- package/src/ui/dropdown-menu-trigger.vue +8 -0
- package/src/ui/dropdown-menu.vue +9 -0
- package/src/ui/grouped-avatar.vue +19 -0
- package/src/ui/icons/Accessibility.vue +7 -0
- package/src/ui/icons/AlignLeft.vue +6 -0
- package/src/ui/icons/ArrowDown.vue +7 -0
- package/src/ui/icons/ArrowUp.vue +7 -0
- package/src/ui/icons/ArrowUpDown.vue +8 -0
- package/src/ui/icons/BookOpen.vue +6 -0
- package/src/ui/icons/Calendar.vue +9 -0
- package/src/ui/icons/Check.vue +6 -0
- package/src/ui/icons/ChevronRight.vue +6 -0
- package/src/ui/icons/Circle.vue +6 -0
- package/src/ui/icons/Copy.vue +7 -0
- package/src/ui/icons/Dot.vue +6 -0
- package/src/ui/icons/Edit.vue +6 -0
- package/src/ui/icons/FileText.vue +9 -0
- package/src/ui/icons/Folder.vue +6 -0
- package/src/ui/icons/FolderOpen.vue +7 -0
- package/src/ui/icons/Hash.vue +6 -0
- package/src/ui/icons/Home.vue +6 -0
- package/src/ui/icons/Minus.vue +6 -0
- package/src/ui/icons/MoreHorizontal.vue +8 -0
- package/src/ui/icons/Settings.vue +7 -0
- package/src/ui/icons/Slash.vue +6 -0
- package/src/ui/icons/Trash2.vue +6 -0
- package/src/ui/icons/Type.vue +6 -0
- package/src/ui/icons/User.vue +7 -0
- package/src/ui/input-otp.vue +52 -0
- package/src/ui/input.vue +98 -0
- package/src/ui/label.vue +19 -0
- package/src/ui/pagination.vue +41 -0
- package/src/ui/popover.vue +9 -0
- package/src/ui/progress.vue +67 -0
- package/src/ui/radio-group-item.vue +53 -0
- package/src/ui/radio-group.vue +27 -0
- package/src/ui/scrollable-tabs-list.vue +148 -0
- package/src/ui/select-multiple.vue +135 -0
- package/src/ui/select.vue +77 -0
- package/src/ui/separator.vue +60 -0
- package/src/ui/sheet.vue +50 -0
- package/src/ui/sidebar/BaseSidebar.vue +97 -0
- package/src/ui/sidebar/BasicSearch.vue +27 -0
- package/src/ui/sidebar/ResponsiveSearch.vue +54 -0
- package/src/ui/sidebar/Sidebar.vue +227 -0
- package/src/ui/sidebar/SidebarCollapseButton.vue +10 -0
- package/src/ui/sidebar/SidebarContent.vue +31 -0
- package/src/ui/sidebar/SidebarDescription.vue +10 -0
- package/src/ui/sidebar/SidebarExpandButton.vue +10 -0
- package/src/ui/sidebar/SidebarFooter.vue +10 -0
- package/src/ui/sidebar/SidebarGroup.vue +11 -0
- package/src/ui/sidebar/SidebarGroupContent.vue +10 -0
- package/src/ui/sidebar/SidebarGroupLabel.vue +7 -0
- package/src/ui/sidebar/SidebarHeader.vue +10 -0
- package/src/ui/sidebar/SidebarInset.vue +19 -0
- package/src/ui/sidebar/SidebarMenu.vue +7 -0
- package/src/ui/sidebar/SidebarMenuBadge.vue +7 -0
- package/src/ui/sidebar/SidebarMenuButton.vue +17 -0
- package/src/ui/sidebar/SidebarMenuItem.vue +10 -0
- package/src/ui/sidebar/SidebarMenuSub.vue +18 -0
- package/src/ui/sidebar/SidebarMenuSubContent.vue +10 -0
- package/src/ui/sidebar/SidebarMenuSubItem.vue +10 -0
- package/src/ui/sidebar/SidebarMenuSubTrigger.vue +10 -0
- package/src/ui/sidebar/SidebarProvider.vue +108 -0
- package/src/ui/sidebar/SidebarScrollArea.vue +10 -0
- package/src/ui/sidebar/SidebarSection.vue +10 -0
- package/src/ui/sidebar/SidebarSeparator.vue +8 -0
- package/src/ui/sidebar/SidebarShortcut.vue +10 -0
- package/src/ui/sidebar/SidebarTitle.vue +10 -0
- package/src/ui/sidebar/SidebarTrigger.vue +27 -0
- package/src/ui/sidebar/Wrapper.vue +12 -0
- package/src/ui/sidebar/context.ts +8 -0
- package/src/ui/sidebar/index.ts +27 -0
- package/src/ui/sidebar/sidebarStore.ts +40 -0
- package/src/ui/sidebar/types.ts +30 -0
- package/src/ui/sidebar/useAutoCollapse.ts +81 -0
- package/src/ui/sidebar.vue +24 -0
- package/src/ui/skeleton.vue +15 -0
- package/src/ui/slider.vue +32 -0
- package/src/ui/sonner.vue +67 -0
- package/src/ui/switch.vue +33 -0
- package/src/ui/tab-content.vue +28 -0
- package/src/ui/tab-list.vue +31 -0
- package/src/ui/tab-panel.vue +19 -0
- package/src/ui/tab-trigger.vue +34 -0
- package/src/ui/tab.vue +30 -0
- package/src/ui/table-body.vue +16 -0
- package/src/ui/table-caption.vue +20 -0
- package/src/ui/table-cell.vue +16 -0
- package/src/ui/table-footer.vue +16 -0
- package/src/ui/table-header.vue +132 -0
- package/src/ui/table-row.vue +16 -0
- package/src/ui/table.vue +55 -0
- package/src/ui/tabs.vue +33 -0
- package/src/ui/textarea.vue +91 -0
- package/src/ui/threat-gauge.vue +137 -0
- package/src/ui/toggle.vue +69 -0
- package/src/ui/tooltip-content.vue +52 -0
- package/src/ui/tooltip-provider.vue +13 -0
- package/src/ui/tooltip-root.vue +9 -0
- package/src/ui/tooltip-trigger.vue +13 -0
- package/src/ui/tooltip.vue +22 -0
- package/src/ui/utils.ts +6 -0
- package/vite.config.ts +39 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PaginationRootEmits, PaginationRootProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { PaginationRoot, useForwardPropsEmits } from "reka-ui"
|
|
6
|
+
import PaginationContent from './PaginationContent.vue';
|
|
7
|
+
import PaginationItem from './PaginationItem.vue';
|
|
8
|
+
import PaginationLink from './PaginationLink.vue';
|
|
9
|
+
import PaginationPrevious from './PaginationPrevious.vue';
|
|
10
|
+
import PaginationNext from './PaginationNext.vue';
|
|
11
|
+
import PaginationEllipsis from './PaginationEllipsis.vue';
|
|
12
|
+
import { cn } from "@/lib/utils"
|
|
13
|
+
import Select from '@/ui/select.vue';
|
|
14
|
+
import SelectTrigger from '@/ui/SelectTrigger.vue';
|
|
15
|
+
import SelectValue from '@/ui/SelectValue.vue';
|
|
16
|
+
import SelectContent from '@/ui/SelectContent.vue';
|
|
17
|
+
import SelectItem from '@/ui/SelectItem.vue';
|
|
18
|
+
import { ref, computed, watch } from 'vue';
|
|
19
|
+
|
|
20
|
+
const props = defineProps<PaginationRootProps & {
|
|
21
|
+
class?: HTMLAttributes["class"];
|
|
22
|
+
/**
|
|
23
|
+
* Optional variant for custom pagination UIs (e.g. 'withPageSize')
|
|
24
|
+
*/
|
|
25
|
+
variant?: string;
|
|
26
|
+
}>()
|
|
27
|
+
const emits = defineEmits<PaginationRootEmits>()
|
|
28
|
+
|
|
29
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
30
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
31
|
+
|
|
32
|
+
// --- withPageSize variant logic ---
|
|
33
|
+
const pageSizeOptions = [5, 10, 25, 50, 100];
|
|
34
|
+
const pageSize = ref(props.itemsPerPage ?? 10);
|
|
35
|
+
const pageSizeString = computed({
|
|
36
|
+
get: () => String(pageSize.value),
|
|
37
|
+
set: (val: string) => {
|
|
38
|
+
const num = parseInt(val, 10);
|
|
39
|
+
if (pageSizeOptions.includes(num)) pageSize.value = num;
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
const currentPage = ref(props.page ?? 1);
|
|
43
|
+
const totalItems = computed(() => props.total ?? 500);
|
|
44
|
+
const totalPages = computed(() => Math.ceil(totalItems.value / pageSize.value));
|
|
45
|
+
const startItem = computed(() => (currentPage.value - 1) * pageSize.value + 1);
|
|
46
|
+
const endItem = computed(() => Math.min(currentPage.value * pageSize.value, totalItems.value));
|
|
47
|
+
|
|
48
|
+
function handlePageSizeChange(val: string) {
|
|
49
|
+
pageSizeString.value = val;
|
|
50
|
+
currentPage.value = 1;
|
|
51
|
+
}
|
|
52
|
+
function handlePrevious() {
|
|
53
|
+
if (currentPage.value > 1) currentPage.value--;
|
|
54
|
+
}
|
|
55
|
+
function handleNext() {
|
|
56
|
+
if (currentPage.value < totalPages.value) currentPage.value++;
|
|
57
|
+
}
|
|
58
|
+
function setPage(page: number) {
|
|
59
|
+
if (page >= 1 && page <= totalPages.value) currentPage.value = page;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Generate pagination items (pages and ellipsis)
|
|
63
|
+
const paginationItems = computed(() => {
|
|
64
|
+
const items = [];
|
|
65
|
+
const siblingCount = 2;
|
|
66
|
+
const total = totalPages.value;
|
|
67
|
+
const page = currentPage.value;
|
|
68
|
+
if (total <= 7) {
|
|
69
|
+
for (let i = 1; i <= total; i++) {
|
|
70
|
+
items.push({ type: 'page', page: i, key: `page-${i}` });
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
items.push({ type: 'page', page: 1, key: 'page-1' });
|
|
74
|
+
if (page > 2 + siblingCount) {
|
|
75
|
+
items.push({ type: 'ellipsis', key: 'ellipsis-1' });
|
|
76
|
+
}
|
|
77
|
+
const start = Math.max(2, page - siblingCount);
|
|
78
|
+
const end = Math.min(total - 1, page + siblingCount);
|
|
79
|
+
for (let i = start; i <= end; i++) {
|
|
80
|
+
items.push({ type: 'page', page: i, key: `page-${i}` });
|
|
81
|
+
}
|
|
82
|
+
if (page < total - 1 - siblingCount) {
|
|
83
|
+
items.push({ type: 'ellipsis', key: 'ellipsis-2' });
|
|
84
|
+
}
|
|
85
|
+
items.push({ type: 'page', page: total, key: `page-${total}` });
|
|
86
|
+
}
|
|
87
|
+
return items;
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
watch(pageSize, () => {
|
|
91
|
+
if (currentPage.value > totalPages.value) {
|
|
92
|
+
currentPage.value = totalPages.value || 1;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<template>
|
|
98
|
+
<div v-if="variant === 'withPageSize'">
|
|
99
|
+
<div class="flex items-center">
|
|
100
|
+
<!-- Left side: Page size selector and results info -->
|
|
101
|
+
<div class="flex w-full items-center gap-6">
|
|
102
|
+
<Select v-model="pageSizeString" @update:modelValue="handlePageSizeChange">
|
|
103
|
+
<SelectTrigger class="w-20">
|
|
104
|
+
<SelectValue />
|
|
105
|
+
</SelectTrigger>
|
|
106
|
+
<SelectContent>
|
|
107
|
+
<SelectItem value="5">5</SelectItem>
|
|
108
|
+
<SelectItem value="10">10</SelectItem>
|
|
109
|
+
<SelectItem value="25">25</SelectItem>
|
|
110
|
+
<SelectItem value="50">50</SelectItem>
|
|
111
|
+
<SelectItem value="100">100</SelectItem>
|
|
112
|
+
</SelectContent>
|
|
113
|
+
</Select>
|
|
114
|
+
<div class="text-sm text-muted-foreground">
|
|
115
|
+
Results: {{ startItem }} - {{ endItem }} of {{ totalItems }}
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
<!-- Right side: Navigation using Pagination components -->
|
|
119
|
+
<PaginationRoot role="navigation" aria-label="pagination" data-slot="pagination" :itemsPerPage="pageSize"
|
|
120
|
+
:class="cn('mx-auto flex justify-center', props.class)">
|
|
121
|
+
<PaginationContent>
|
|
122
|
+
<PaginationItem>
|
|
123
|
+
<PaginationPrevious @click="handlePrevious" :style="{
|
|
124
|
+
pointerEvents: currentPage === 1 ? 'none' : 'auto',
|
|
125
|
+
opacity: currentPage === 1 ? 0.5 : 1,
|
|
126
|
+
}" />
|
|
127
|
+
</PaginationItem>
|
|
128
|
+
<template v-for="item in paginationItems" :key="item.key">
|
|
129
|
+
<PaginationItem v-if="item.type === 'page'" :value="item.page">
|
|
130
|
+
<PaginationLink :isActive="item.page === currentPage" @click="() => setPage(item.page)">{{
|
|
131
|
+
item.page }}</PaginationLink>
|
|
132
|
+
</PaginationItem>
|
|
133
|
+
<PaginationItem v-else-if="item.type === 'ellipsis'">
|
|
134
|
+
<PaginationEllipsis />
|
|
135
|
+
</PaginationItem>
|
|
136
|
+
</template>
|
|
137
|
+
<PaginationItem>
|
|
138
|
+
<PaginationNext @click="handleNext" :style="{
|
|
139
|
+
pointerEvents: currentPage === totalPages ? 'none' : 'auto',
|
|
140
|
+
opacity: currentPage === totalPages ? 0.5 : 1,
|
|
141
|
+
}" />
|
|
142
|
+
</PaginationItem>
|
|
143
|
+
</PaginationContent>
|
|
144
|
+
</PaginationRoot>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
<PaginationRoot v-else v-slot="slotProps" data-slot="pagination" v-bind="forwarded" :itemsPerPage="pageSize"
|
|
148
|
+
:class="cn('mx-auto flex w-full justify-center', props.class)">
|
|
149
|
+
<slot v-bind="slotProps" />
|
|
150
|
+
</PaginationRoot>
|
|
151
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PaginationListProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { PaginationList } from "reka-ui"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const props = defineProps<PaginationListProps & { class?: HTMLAttributes["class"] }>()
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<PaginationList
|
|
15
|
+
v-slot="slotProps"
|
|
16
|
+
data-slot="pagination-content"
|
|
17
|
+
v-bind="delegatedProps"
|
|
18
|
+
:class="cn('flex flex-row items-center gap-1', props.class)"
|
|
19
|
+
>
|
|
20
|
+
<slot v-bind="slotProps" />
|
|
21
|
+
</PaginationList>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PaginationEllipsisProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { MoreHorizontal } from "lucide-vue-next"
|
|
6
|
+
import { PaginationEllipsis } from "reka-ui"
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
const props = defineProps<PaginationEllipsisProps & { class?: HTMLAttributes["class"] }>()
|
|
10
|
+
|
|
11
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<PaginationEllipsis
|
|
16
|
+
data-slot="pagination-ellipsis"
|
|
17
|
+
v-bind="delegatedProps"
|
|
18
|
+
:class="cn('flex size-9 items-center justify-center', props.class)"
|
|
19
|
+
>
|
|
20
|
+
<slot>
|
|
21
|
+
<MoreHorizontal class="size-4" />
|
|
22
|
+
<span class="sr-only">More pages</span>
|
|
23
|
+
</slot>
|
|
24
|
+
</PaginationEllipsis>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PaginationFirstProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import type { ButtonVariants } from '@/shadcn/button'
|
|
5
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
6
|
+
import { ChevronLeftIcon } from "lucide-vue-next"
|
|
7
|
+
import { PaginationFirst, useForwardProps } from "reka-ui"
|
|
8
|
+
import { cn } from "@/lib/utils"
|
|
9
|
+
import { buttonVariants } from '@/shadcn/button'
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<PaginationFirstProps & {
|
|
12
|
+
size?: ButtonVariants["size"]
|
|
13
|
+
class?: HTMLAttributes["class"]
|
|
14
|
+
}>(), {
|
|
15
|
+
size: "default",
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const delegatedProps = reactiveOmit(props, "class", "size")
|
|
19
|
+
const forwarded = useForwardProps(delegatedProps)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<PaginationFirst
|
|
24
|
+
data-slot="pagination-first"
|
|
25
|
+
:class="cn(buttonVariants({ variant: 'ghost', size }), 'gap-1 px-2.5 sm:pr-2.5', props.class)"
|
|
26
|
+
v-bind="forwarded"
|
|
27
|
+
>
|
|
28
|
+
<slot>
|
|
29
|
+
<ChevronLeftIcon />
|
|
30
|
+
<span class="hidden sm:block">First</span>
|
|
31
|
+
</slot>
|
|
32
|
+
</PaginationFirst>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PaginationListItemProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import type { ButtonVariants } from '@/shadcn/button'
|
|
5
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
6
|
+
import { PaginationListItem } from "reka-ui"
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
import { buttonVariants } from '@/shadcn/button'
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<PaginationListItemProps & {
|
|
11
|
+
size?: ButtonVariants["size"]
|
|
12
|
+
class?: HTMLAttributes["class"]
|
|
13
|
+
isActive?: boolean
|
|
14
|
+
}>(), {
|
|
15
|
+
size: "icon",
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const delegatedProps = reactiveOmit(props, "class", "size", "isActive")
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<PaginationListItem data-slot="pagination-item" v-bind="delegatedProps" :class="cn(
|
|
23
|
+
buttonVariants({
|
|
24
|
+
variant: isActive ? 'outline' : 'ghost',
|
|
25
|
+
size,
|
|
26
|
+
}),
|
|
27
|
+
'block w-auto',
|
|
28
|
+
props.class)">
|
|
29
|
+
<slot />
|
|
30
|
+
</PaginationListItem>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PaginationLastProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import type { ButtonVariants } from '@/shadcn/button'
|
|
5
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
6
|
+
import { ChevronRightIcon } from "lucide-vue-next"
|
|
7
|
+
import { PaginationLast, useForwardProps } from "reka-ui"
|
|
8
|
+
import { cn } from "@/lib/utils"
|
|
9
|
+
import { buttonVariants } from '@/shadcn/button'
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<PaginationLastProps & {
|
|
12
|
+
size?: ButtonVariants["size"]
|
|
13
|
+
class?: HTMLAttributes["class"]
|
|
14
|
+
}>(), {
|
|
15
|
+
size: "default",
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const delegatedProps = reactiveOmit(props, "class", "size")
|
|
19
|
+
const forwarded = useForwardProps(delegatedProps)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<PaginationLast
|
|
24
|
+
data-slot="pagination-last"
|
|
25
|
+
:class="cn(buttonVariants({ variant: 'ghost', size }), 'gap-1 px-2.5 sm:pr-2.5', props.class)"
|
|
26
|
+
v-bind="forwarded"
|
|
27
|
+
>
|
|
28
|
+
<slot>
|
|
29
|
+
<span class="hidden sm:block">Last</span>
|
|
30
|
+
<ChevronRightIcon />
|
|
31
|
+
</slot>
|
|
32
|
+
</PaginationLast>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils';
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
class: { type: String, default: '' },
|
|
5
|
+
isActive: { type: Boolean, default: false },
|
|
6
|
+
href: { type: String, default: '' },
|
|
7
|
+
});
|
|
8
|
+
</script>
|
|
9
|
+
<template>
|
|
10
|
+
<a :href="props.href" :class="cn('inline-flex h-9 w-9 items-center justify-center rounded-md border border-transparent px-2 py-1 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground', props.class, { 'border-border bg-background text-accent-foreground': props.isActive })">
|
|
11
|
+
<slot />
|
|
12
|
+
</a>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { cn } from '@/lib/utils';
|
|
3
|
+
import { ChevronRight } from 'lucide-vue-next';
|
|
4
|
+
import { PaginationLink } from './index';
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
class: { type: String, default: '' },
|
|
7
|
+
size: { type: String, default: 'default' },
|
|
8
|
+
});
|
|
9
|
+
const emit = defineEmits(['click']);
|
|
10
|
+
</script>
|
|
11
|
+
<template>
|
|
12
|
+
<PaginationLink
|
|
13
|
+
aria-label="Go to next page"
|
|
14
|
+
size="default"
|
|
15
|
+
:class="cn('w-auto gap-1 px-2.5 sm:pr-2.5', props.class)"
|
|
16
|
+
v-bind="$attrs"
|
|
17
|
+
@click="$emit('click', $event)"
|
|
18
|
+
>
|
|
19
|
+
<span class="hidden sm:block">Next</span>
|
|
20
|
+
<ChevronRight class="h-4 w-4" />
|
|
21
|
+
</PaginationLink>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PaginationPrevProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import type { ButtonVariants } from '@/shadcn/button'
|
|
5
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
6
|
+
import { ChevronLeftIcon } from "lucide-vue-next"
|
|
7
|
+
import { PaginationPrev, useForwardProps } from "reka-ui"
|
|
8
|
+
import { cn } from "@/lib/utils"
|
|
9
|
+
import { buttonVariants } from '@/shadcn/button'
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<PaginationPrevProps & {
|
|
12
|
+
size?: ButtonVariants["size"]
|
|
13
|
+
class?: HTMLAttributes["class"]
|
|
14
|
+
}>(), {
|
|
15
|
+
size: "default",
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const delegatedProps = reactiveOmit(props, "class", "size")
|
|
19
|
+
const forwarded = useForwardProps(delegatedProps)
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<PaginationPrev
|
|
24
|
+
data-slot="pagination-previous"
|
|
25
|
+
:class="cn(buttonVariants({ variant: 'ghost', size }), 'gap-1 px-2.5 sm:pr-2.5', props.class)"
|
|
26
|
+
v-bind="forwarded"
|
|
27
|
+
>
|
|
28
|
+
<slot>
|
|
29
|
+
<ChevronLeftIcon />
|
|
30
|
+
<span class="hidden sm:block">Previous</span>
|
|
31
|
+
</slot>
|
|
32
|
+
</PaginationPrev>
|
|
33
|
+
</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 PaginationEllipsis } from "./PaginationEllipsis.vue"
|
|
4
|
+
export { default as PaginationFirst } from "./PaginationFirst.vue"
|
|
5
|
+
export { default as PaginationItem } from "./PaginationItem.vue"
|
|
6
|
+
export { default as PaginationLast } from "./PaginationLast.vue"
|
|
7
|
+
export { default as PaginationNext } from "./PaginationNext.vue"
|
|
8
|
+
export { default as PaginationPrevious } from "./PaginationPrevious.vue"
|
|
9
|
+
export { default as PaginationLink } from "./PaginationLink.vue"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PopoverRootEmits, PopoverRootProps } from "reka-ui"
|
|
3
|
+
import { PopoverRoot, useForwardPropsEmits } from "reka-ui"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<PopoverRootProps>()
|
|
6
|
+
const emits = defineEmits<PopoverRootEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<PopoverRoot
|
|
13
|
+
data-slot="popover"
|
|
14
|
+
v-bind="forwarded"
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</PopoverRoot>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PopoverAnchorProps } from "reka-ui"
|
|
3
|
+
import { PopoverAnchor } from "reka-ui"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<PopoverAnchorProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<PopoverAnchor
|
|
10
|
+
data-slot="popover-anchor"
|
|
11
|
+
v-bind="props"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</PopoverAnchor>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PopoverContentEmits, PopoverContentProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import {
|
|
6
|
+
PopoverContent,
|
|
7
|
+
|
|
8
|
+
PopoverPortal,
|
|
9
|
+
useForwardPropsEmits,
|
|
10
|
+
} from "reka-ui"
|
|
11
|
+
import { cn } from "@/lib/utils"
|
|
12
|
+
|
|
13
|
+
defineOptions({
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(
|
|
18
|
+
defineProps<PopoverContentProps & { class?: HTMLAttributes["class"] }>(),
|
|
19
|
+
{
|
|
20
|
+
align: "center",
|
|
21
|
+
sideOffset: 4,
|
|
22
|
+
},
|
|
23
|
+
)
|
|
24
|
+
const emits = defineEmits<PopoverContentEmits>()
|
|
25
|
+
|
|
26
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
27
|
+
|
|
28
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<PopoverPortal>
|
|
33
|
+
<PopoverContent
|
|
34
|
+
data-slot="popover-content"
|
|
35
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
36
|
+
:class="
|
|
37
|
+
cn(
|
|
38
|
+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md origin-(--reka-popover-content-transform-origin) outline-hidden',
|
|
39
|
+
props.class,
|
|
40
|
+
)
|
|
41
|
+
"
|
|
42
|
+
>
|
|
43
|
+
<slot />
|
|
44
|
+
</PopoverContent>
|
|
45
|
+
</PopoverPortal>
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PopoverTriggerProps } from "reka-ui"
|
|
3
|
+
import { PopoverTrigger } from "reka-ui"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<PopoverTriggerProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<PopoverTrigger
|
|
10
|
+
data-slot="popover-trigger"
|
|
11
|
+
v-bind="props"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</PopoverTrigger>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { RadioGroupRootEmits, RadioGroupRootProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { RadioGroupRoot, useForwardPropsEmits } from "reka-ui"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const props = defineProps<RadioGroupRootProps & { class?: HTMLAttributes["class"] }>()
|
|
9
|
+
const emits = defineEmits<RadioGroupRootEmits>()
|
|
10
|
+
|
|
11
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
12
|
+
|
|
13
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<RadioGroupRoot
|
|
18
|
+
data-slot="radio-group"
|
|
19
|
+
:class="cn('grid gap-3', props.class)"
|
|
20
|
+
v-bind="forwarded"
|
|
21
|
+
>
|
|
22
|
+
<slot />
|
|
23
|
+
</RadioGroupRoot>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { RadioGroupItemProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { CircleIcon } from "lucide-vue-next"
|
|
6
|
+
import {
|
|
7
|
+
RadioGroupIndicator,
|
|
8
|
+
RadioGroupItem,
|
|
9
|
+
|
|
10
|
+
useForwardProps,
|
|
11
|
+
} from "reka-ui"
|
|
12
|
+
import { cn } from "@/lib/utils"
|
|
13
|
+
|
|
14
|
+
const props = defineProps<RadioGroupItemProps & { class?: HTMLAttributes["class"] }>()
|
|
15
|
+
|
|
16
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
17
|
+
|
|
18
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<RadioGroupItem
|
|
23
|
+
data-slot="radio-group-item"
|
|
24
|
+
v-bind="forwardedProps"
|
|
25
|
+
:class="
|
|
26
|
+
cn(
|
|
27
|
+
'border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
|
|
28
|
+
props.class,
|
|
29
|
+
)
|
|
30
|
+
"
|
|
31
|
+
>
|
|
32
|
+
<RadioGroupIndicator
|
|
33
|
+
data-slot="radio-group-indicator"
|
|
34
|
+
class="relative flex items-center justify-center"
|
|
35
|
+
>
|
|
36
|
+
<CircleIcon class="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
|
|
37
|
+
</RadioGroupIndicator>
|
|
38
|
+
</RadioGroupItem>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { RangeCalendarRootEmits, RangeCalendarRootProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { RangeCalendarRoot, useForwardPropsEmits } from "reka-ui"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import { RangeCalendarCell, RangeCalendarCellTrigger, RangeCalendarGrid, RangeCalendarGridBody, RangeCalendarGridHead, RangeCalendarGridRow, RangeCalendarHeadCell, RangeCalendarHeader, RangeCalendarHeading, RangeCalendarNextButton, RangeCalendarPrevButton } from "."
|
|
8
|
+
|
|
9
|
+
const props = defineProps<RangeCalendarRootProps & { class?: HTMLAttributes["class"] }>()
|
|
10
|
+
|
|
11
|
+
const emits = defineEmits<RangeCalendarRootEmits>()
|
|
12
|
+
|
|
13
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
14
|
+
|
|
15
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
16
|
+
|
|
17
|
+
function getMonthName(month: number) {
|
|
18
|
+
const months = [
|
|
19
|
+
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
|
|
20
|
+
];
|
|
21
|
+
return months[month - 1] || month;
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<RangeCalendarRoot
|
|
27
|
+
v-slot="{ grid, weekDays }"
|
|
28
|
+
data-slot="range-calendar"
|
|
29
|
+
:class="cn('p-3', props.class)"
|
|
30
|
+
v-bind="forwarded"
|
|
31
|
+
>
|
|
32
|
+
<div class="flex flex-col gap-y-4 space-x-2 sm:flex-row sm:gap-x-4 sm:gap-y-0">
|
|
33
|
+
<div v-for="(month, index) in grid" :key="month.value.toString()">
|
|
34
|
+
<div class="flex flex-col gap-4">
|
|
35
|
+
<div class="flex justify-center pt-1 relative items-center w-full">
|
|
36
|
+
<RangeCalendarHeading>{{ getMonthName(month.value.month) }} {{ month.value.year }}</RangeCalendarHeading>
|
|
37
|
+
<div class="flex items-center gap-1">
|
|
38
|
+
<RangeCalendarPrevButton v-if="index === 0" />
|
|
39
|
+
<RangeCalendarNextButton v-if="index === grid.length - 1" />
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
<RangeCalendarGrid>
|
|
43
|
+
<RangeCalendarGridHead>
|
|
44
|
+
<RangeCalendarGridRow>
|
|
45
|
+
<RangeCalendarHeadCell
|
|
46
|
+
v-for="day in ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']" :key="day"
|
|
47
|
+
>
|
|
48
|
+
{{ day }}
|
|
49
|
+
</RangeCalendarHeadCell>
|
|
50
|
+
</RangeCalendarGridRow>
|
|
51
|
+
</RangeCalendarGridHead>
|
|
52
|
+
<RangeCalendarGridBody>
|
|
53
|
+
<RangeCalendarGridRow v-for="(weekDates, index) in month.rows" :key="`weekDate-${index}`" class="mt-2 w-full">
|
|
54
|
+
<RangeCalendarCell
|
|
55
|
+
v-for="weekDate in weekDates"
|
|
56
|
+
:key="weekDate.toString()"
|
|
57
|
+
:date="weekDate"
|
|
58
|
+
>
|
|
59
|
+
<RangeCalendarCellTrigger
|
|
60
|
+
:day="weekDate"
|
|
61
|
+
:month="month.value"
|
|
62
|
+
/>
|
|
63
|
+
</RangeCalendarCell>
|
|
64
|
+
</RangeCalendarGridRow>
|
|
65
|
+
</RangeCalendarGridBody>
|
|
66
|
+
</RangeCalendarGrid>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</RangeCalendarRoot>
|
|
71
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { RangeCalendarCellProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { RangeCalendarCell, useForwardProps } from "reka-ui"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const props = defineProps<RangeCalendarCellProps & { class?: HTMLAttributes["class"] }>()
|
|
9
|
+
|
|
10
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
11
|
+
|
|
12
|
+
const forwardedProps = useForwardProps(delegatedProps)
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<RangeCalendarCell
|
|
17
|
+
data-slot="range-calendar-cell"
|
|
18
|
+
:class="cn('relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:bg-accent first:[&:has([data-selected])]:rounded-l-md last:[&:has([data-selected])]:rounded-r-md [&:has([data-selected][data-selection-end])]:rounded-r-md [&:has([data-selected][data-selection-start])]:rounded-l-md', props.class)"
|
|
19
|
+
v-bind="forwardedProps"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</RangeCalendarCell>
|
|
23
|
+
</template>
|