@polymarbot/nuxt-layer-shadcn-ui 0.1.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/app/assets/styles/animate.css +71 -0
- package/app/assets/styles/colors.css +116 -0
- package/app/assets/styles/globals.css +43 -0
- package/app/assets/styles/index.stories.ts +211 -0
- package/app/assets/styles/transition.css +34 -0
- package/app/assets/styles/utilities.css +26 -0
- package/app/components/shadcn/accordion/Accordion.vue +18 -0
- package/app/components/shadcn/accordion/AccordionContent.vue +23 -0
- package/app/components/shadcn/accordion/AccordionItem.vue +24 -0
- package/app/components/shadcn/accordion/AccordionTrigger.vue +37 -0
- package/app/components/shadcn/accordion/index.ts +4 -0
- package/app/components/shadcn/alert/Alert.vue +21 -0
- package/app/components/shadcn/alert/AlertDescription.vue +17 -0
- package/app/components/shadcn/alert/AlertTitle.vue +17 -0
- package/app/components/shadcn/alert/index.ts +24 -0
- package/app/components/shadcn/avatar/Avatar.vue +18 -0
- package/app/components/shadcn/avatar/AvatarFallback.vue +21 -0
- package/app/components/shadcn/avatar/AvatarImage.vue +16 -0
- package/app/components/shadcn/avatar/index.ts +3 -0
- package/app/components/shadcn/badge/Badge.vue +26 -0
- package/app/components/shadcn/badge/index.ts +26 -0
- package/app/components/shadcn/breadcrumb/Breadcrumb.vue +17 -0
- package/app/components/shadcn/breadcrumb/BreadcrumbEllipsis.vue +23 -0
- package/app/components/shadcn/breadcrumb/BreadcrumbItem.vue +17 -0
- package/app/components/shadcn/breadcrumb/BreadcrumbLink.vue +21 -0
- package/app/components/shadcn/breadcrumb/BreadcrumbList.vue +17 -0
- package/app/components/shadcn/breadcrumb/BreadcrumbPage.vue +20 -0
- package/app/components/shadcn/breadcrumb/BreadcrumbSeparator.vue +22 -0
- package/app/components/shadcn/breadcrumb/index.ts +7 -0
- package/app/components/shadcn/button/Button.vue +31 -0
- package/app/components/shadcn/button/index.ts +38 -0
- package/app/components/shadcn/card/Card.vue +22 -0
- package/app/components/shadcn/card/CardAction.vue +17 -0
- package/app/components/shadcn/card/CardContent.vue +17 -0
- package/app/components/shadcn/card/CardDescription.vue +17 -0
- package/app/components/shadcn/card/CardFooter.vue +17 -0
- package/app/components/shadcn/card/CardHeader.vue +17 -0
- package/app/components/shadcn/card/CardTitle.vue +17 -0
- package/app/components/shadcn/card/index.ts +7 -0
- package/app/components/shadcn/checkbox/Checkbox.vue +35 -0
- package/app/components/shadcn/checkbox/index.ts +1 -0
- package/app/components/shadcn/collapsible/Collapsible.vue +19 -0
- package/app/components/shadcn/collapsible/CollapsibleContent.vue +15 -0
- package/app/components/shadcn/collapsible/CollapsibleTrigger.vue +15 -0
- package/app/components/shadcn/collapsible/index.ts +3 -0
- package/app/components/shadcn/command/Command.vue +87 -0
- package/app/components/shadcn/command/CommandDialog.vue +31 -0
- package/app/components/shadcn/command/CommandEmpty.vue +27 -0
- package/app/components/shadcn/command/CommandGroup.vue +45 -0
- package/app/components/shadcn/command/CommandInput.vue +39 -0
- package/app/components/shadcn/command/CommandItem.vue +76 -0
- package/app/components/shadcn/command/CommandList.vue +25 -0
- package/app/components/shadcn/command/CommandSeparator.vue +21 -0
- package/app/components/shadcn/command/CommandShortcut.vue +17 -0
- package/app/components/shadcn/command/index.ts +25 -0
- package/app/components/shadcn/dialog/Dialog.vue +19 -0
- package/app/components/shadcn/dialog/DialogClose.vue +15 -0
- package/app/components/shadcn/dialog/DialogContent.vue +53 -0
- package/app/components/shadcn/dialog/DialogDescription.vue +23 -0
- package/app/components/shadcn/dialog/DialogFooter.vue +27 -0
- package/app/components/shadcn/dialog/DialogHeader.vue +17 -0
- package/app/components/shadcn/dialog/DialogOverlay.vue +21 -0
- package/app/components/shadcn/dialog/DialogScrollContent.vue +59 -0
- package/app/components/shadcn/dialog/DialogTitle.vue +23 -0
- package/app/components/shadcn/dialog/DialogTrigger.vue +15 -0
- package/app/components/shadcn/dialog/index.ts +10 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenu.vue +19 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuContent.vue +39 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuGroup.vue +15 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuItem.vue +31 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuLabel.vue +23 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuSub.vue +18 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuSubContent.vue +27 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
- package/app/components/shadcn/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/app/components/shadcn/dropdown-menu/index.ts +16 -0
- package/app/components/shadcn/field/Field.vue +25 -0
- package/app/components/shadcn/field/FieldContent.vue +20 -0
- package/app/components/shadcn/field/FieldDescription.vue +22 -0
- package/app/components/shadcn/field/FieldError.vue +53 -0
- package/app/components/shadcn/field/FieldGroup.vue +20 -0
- package/app/components/shadcn/field/FieldLabel.vue +23 -0
- package/app/components/shadcn/field/FieldLegend.vue +24 -0
- package/app/components/shadcn/field/FieldSeparator.vue +29 -0
- package/app/components/shadcn/field/FieldSet.vue +21 -0
- package/app/components/shadcn/field/FieldTitle.vue +20 -0
- package/app/components/shadcn/field/index.ts +39 -0
- package/app/components/shadcn/input/Input.vue +33 -0
- package/app/components/shadcn/input/index.ts +1 -0
- package/app/components/shadcn/input-group/InputGroup.vue +35 -0
- package/app/components/shadcn/input-group/InputGroupAddon.vue +36 -0
- package/app/components/shadcn/input-group/InputGroupButton.vue +29 -0
- package/app/components/shadcn/input-group/InputGroupInput.vue +19 -0
- package/app/components/shadcn/input-group/InputGroupText.vue +19 -0
- package/app/components/shadcn/input-group/InputGroupTextarea.vue +19 -0
- package/app/components/shadcn/input-group/index.ts +51 -0
- package/app/components/shadcn/label/Label.vue +26 -0
- package/app/components/shadcn/label/index.ts +1 -0
- package/app/components/shadcn/number-field/NumberField.vue +20 -0
- package/app/components/shadcn/number-field/NumberFieldContent.vue +14 -0
- package/app/components/shadcn/number-field/NumberFieldDecrement.vue +22 -0
- package/app/components/shadcn/number-field/NumberFieldIncrement.vue +22 -0
- package/app/components/shadcn/number-field/NumberFieldInput.vue +16 -0
- package/app/components/shadcn/number-field/index.ts +5 -0
- package/app/components/shadcn/pagination/Pagination.vue +26 -0
- package/app/components/shadcn/pagination/PaginationContent.vue +22 -0
- package/app/components/shadcn/pagination/PaginationEllipsis.vue +25 -0
- package/app/components/shadcn/pagination/PaginationFirst.vue +33 -0
- package/app/components/shadcn/pagination/PaginationItem.vue +34 -0
- package/app/components/shadcn/pagination/PaginationLast.vue +33 -0
- package/app/components/shadcn/pagination/PaginationNext.vue +33 -0
- package/app/components/shadcn/pagination/PaginationPrevious.vue +33 -0
- package/app/components/shadcn/pagination/index.ts +8 -0
- package/app/components/shadcn/pin-input/PinInput.vue +26 -0
- package/app/components/shadcn/pin-input/PinInputGroup.vue +21 -0
- package/app/components/shadcn/pin-input/PinInputSeparator.vue +19 -0
- package/app/components/shadcn/pin-input/PinInputSlot.vue +21 -0
- package/app/components/shadcn/pin-input/index.ts +4 -0
- package/app/components/shadcn/popover/Popover.vue +19 -0
- package/app/components/shadcn/popover/PopoverAnchor.vue +15 -0
- package/app/components/shadcn/popover/PopoverContent.vue +45 -0
- package/app/components/shadcn/popover/PopoverTrigger.vue +15 -0
- package/app/components/shadcn/popover/index.ts +4 -0
- package/app/components/shadcn/progress/Progress.vue +38 -0
- package/app/components/shadcn/progress/index.ts +1 -0
- package/app/components/shadcn/radio-group/RadioGroup.vue +25 -0
- package/app/components/shadcn/radio-group/RadioGroupItem.vue +40 -0
- package/app/components/shadcn/radio-group/index.ts +2 -0
- package/app/components/shadcn/scroll-area/ScrollArea.vue +33 -0
- package/app/components/shadcn/scroll-area/ScrollBar.vue +32 -0
- package/app/components/shadcn/scroll-area/index.ts +2 -0
- package/app/components/shadcn/select/Select.vue +19 -0
- package/app/components/shadcn/select/SelectContent.vue +51 -0
- package/app/components/shadcn/select/SelectGroup.vue +15 -0
- package/app/components/shadcn/select/SelectItem.vue +44 -0
- package/app/components/shadcn/select/SelectItemText.vue +15 -0
- package/app/components/shadcn/select/SelectLabel.vue +17 -0
- package/app/components/shadcn/select/SelectScrollDownButton.vue +26 -0
- package/app/components/shadcn/select/SelectScrollUpButton.vue +26 -0
- package/app/components/shadcn/select/SelectSeparator.vue +19 -0
- package/app/components/shadcn/select/SelectTrigger.vue +33 -0
- package/app/components/shadcn/select/SelectValue.vue +15 -0
- package/app/components/shadcn/select/index.ts +11 -0
- package/app/components/shadcn/separator/Separator.vue +29 -0
- package/app/components/shadcn/separator/index.ts +1 -0
- package/app/components/shadcn/sheet/Sheet.vue +19 -0
- package/app/components/shadcn/sheet/SheetClose.vue +15 -0
- package/app/components/shadcn/sheet/SheetContent.vue +62 -0
- package/app/components/shadcn/sheet/SheetDescription.vue +21 -0
- package/app/components/shadcn/sheet/SheetFooter.vue +16 -0
- package/app/components/shadcn/sheet/SheetHeader.vue +15 -0
- package/app/components/shadcn/sheet/SheetOverlay.vue +21 -0
- package/app/components/shadcn/sheet/SheetTitle.vue +21 -0
- package/app/components/shadcn/sheet/SheetTrigger.vue +15 -0
- package/app/components/shadcn/sheet/index.ts +8 -0
- package/app/components/shadcn/sidebar/Sidebar.vue +96 -0
- package/app/components/shadcn/sidebar/SidebarContent.vue +18 -0
- package/app/components/shadcn/sidebar/SidebarFooter.vue +18 -0
- package/app/components/shadcn/sidebar/SidebarGroup.vue +18 -0
- package/app/components/shadcn/sidebar/SidebarGroupAction.vue +27 -0
- package/app/components/shadcn/sidebar/SidebarGroupContent.vue +18 -0
- package/app/components/shadcn/sidebar/SidebarGroupLabel.vue +25 -0
- package/app/components/shadcn/sidebar/SidebarHeader.vue +18 -0
- package/app/components/shadcn/sidebar/SidebarInput.vue +22 -0
- package/app/components/shadcn/sidebar/SidebarInset.vue +21 -0
- package/app/components/shadcn/sidebar/SidebarMenu.vue +18 -0
- package/app/components/shadcn/sidebar/SidebarMenuAction.vue +35 -0
- package/app/components/shadcn/sidebar/SidebarMenuBadge.vue +26 -0
- package/app/components/shadcn/sidebar/SidebarMenuButton.vue +48 -0
- package/app/components/shadcn/sidebar/SidebarMenuButtonChild.vue +36 -0
- package/app/components/shadcn/sidebar/SidebarMenuItem.vue +18 -0
- package/app/components/shadcn/sidebar/SidebarMenuSkeleton.vue +35 -0
- package/app/components/shadcn/sidebar/SidebarMenuSub.vue +22 -0
- package/app/components/shadcn/sidebar/SidebarMenuSubButton.vue +36 -0
- package/app/components/shadcn/sidebar/SidebarMenuSubItem.vue +18 -0
- package/app/components/shadcn/sidebar/SidebarProvider.vue +82 -0
- package/app/components/shadcn/sidebar/SidebarRail.vue +33 -0
- package/app/components/shadcn/sidebar/SidebarSeparator.vue +19 -0
- package/app/components/shadcn/sidebar/SidebarTrigger.vue +27 -0
- package/app/components/shadcn/sidebar/index.ts +60 -0
- package/app/components/shadcn/sidebar/utils.ts +19 -0
- package/app/components/shadcn/skeleton/Skeleton.vue +17 -0
- package/app/components/shadcn/skeleton/index.ts +1 -0
- package/app/components/shadcn/slider/Slider.vue +43 -0
- package/app/components/shadcn/slider/index.ts +1 -0
- package/app/components/shadcn/sonner/Sonner.vue +42 -0
- package/app/components/shadcn/sonner/index.ts +1 -0
- package/app/components/shadcn/switch/Switch.vue +38 -0
- package/app/components/shadcn/switch/index.ts +1 -0
- package/app/components/shadcn/table/Table.vue +16 -0
- package/app/components/shadcn/table/TableBody.vue +17 -0
- package/app/components/shadcn/table/TableCaption.vue +17 -0
- package/app/components/shadcn/table/TableCell.vue +22 -0
- package/app/components/shadcn/table/TableEmpty.vue +34 -0
- package/app/components/shadcn/table/TableFooter.vue +17 -0
- package/app/components/shadcn/table/TableHead.vue +17 -0
- package/app/components/shadcn/table/TableHeader.vue +17 -0
- package/app/components/shadcn/table/TableRow.vue +17 -0
- package/app/components/shadcn/table/index.ts +9 -0
- package/app/components/shadcn/table/utils.ts +10 -0
- package/app/components/shadcn/tabs/Tabs.vue +24 -0
- package/app/components/shadcn/tabs/TabsContent.vue +21 -0
- package/app/components/shadcn/tabs/TabsList.vue +24 -0
- package/app/components/shadcn/tabs/TabsTrigger.vue +26 -0
- package/app/components/shadcn/tabs/index.ts +4 -0
- package/app/components/shadcn/textarea/Textarea.vue +28 -0
- package/app/components/shadcn/textarea/index.ts +1 -0
- package/app/components/shadcn/toggle/Toggle.vue +35 -0
- package/app/components/shadcn/toggle/index.ts +28 -0
- package/app/components/shadcn/toggle-group/ToggleGroup.vue +49 -0
- package/app/components/shadcn/toggle-group/ToggleGroupItem.vue +46 -0
- package/app/components/shadcn/toggle-group/index.ts +2 -0
- package/app/components/shadcn/tooltip/Tooltip.vue +19 -0
- package/app/components/shadcn/tooltip/TooltipContent.vue +34 -0
- package/app/components/shadcn/tooltip/TooltipProvider.vue +14 -0
- package/app/components/shadcn/tooltip/TooltipTrigger.vue +15 -0
- package/app/components/shadcn/tooltip/index.ts +4 -0
- package/app/components/ui/Accordion/index.stories.ts +108 -0
- package/app/components/ui/Accordion/index.vue +80 -0
- package/app/components/ui/Accordion/types.ts +27 -0
- package/app/components/ui/Alert/index.stories.ts +53 -0
- package/app/components/ui/Alert/index.vue +61 -0
- package/app/components/ui/Alert/types.ts +9 -0
- package/app/components/ui/AlertDialog/index.stories.ts +108 -0
- package/app/components/ui/AlertDialog/index.vue +25 -0
- package/app/components/ui/AsyncDataTable/en.json +3 -0
- package/app/components/ui/AsyncDataTable/index.stories.ts +141 -0
- package/app/components/ui/AsyncDataTable/index.vue +312 -0
- package/app/components/ui/AsyncDataTable/types.ts +53 -0
- package/app/components/ui/Avatar/index.stories.ts +84 -0
- package/app/components/ui/Avatar/index.vue +52 -0
- package/app/components/ui/Avatar/types.ts +8 -0
- package/app/components/ui/Badge/index.stories.ts +67 -0
- package/app/components/ui/Badge/index.vue +12 -0
- package/app/components/ui/Badge/types.ts +3 -0
- package/app/components/ui/Breadcrumb/index.stories.ts +52 -0
- package/app/components/ui/Breadcrumb/index.vue +61 -0
- package/app/components/ui/Breadcrumb/types.ts +11 -0
- package/app/components/ui/Button/index.stories.ts +145 -0
- package/app/components/ui/Button/index.vue +63 -0
- package/app/components/ui/Button/types.ts +14 -0
- package/app/components/ui/ButtonGroup/index.stories.ts +75 -0
- package/app/components/ui/ButtonGroup/index.vue +22 -0
- package/app/components/ui/ButtonGroup/types.ts +3 -0
- package/app/components/ui/Card/index.stories.ts +65 -0
- package/app/components/ui/Card/index.vue +28 -0
- package/app/components/ui/Card/types.ts +3 -0
- package/app/components/ui/Checkbox/index.stories.ts +68 -0
- package/app/components/ui/Checkbox/index.vue +23 -0
- package/app/components/ui/Checkbox/types.ts +3 -0
- package/app/components/ui/CopyButton/en.json +4 -0
- package/app/components/ui/CopyButton/index.stories.ts +55 -0
- package/app/components/ui/CopyButton/index.vue +98 -0
- package/app/components/ui/CopyButton/types.ts +10 -0
- package/app/components/ui/DataTable/en.json +3 -0
- package/app/components/ui/DataTable/index.stories.ts +231 -0
- package/app/components/ui/DataTable/index.vue +505 -0
- package/app/components/ui/DataTable/types.ts +42 -0
- package/app/components/ui/DatePicker/en.json +9 -0
- package/app/components/ui/DatePicker/index.stories.ts +70 -0
- package/app/components/ui/DatePicker/index.vue +127 -0
- package/app/components/ui/DatePicker/style.css +88 -0
- package/app/components/ui/DatePicker/types.ts +41 -0
- package/app/components/ui/DateRangePicker/en.json +5 -0
- package/app/components/ui/DateRangePicker/index.stories.ts +67 -0
- package/app/components/ui/DateRangePicker/index.vue +138 -0
- package/app/components/ui/DateRangePicker/types.ts +31 -0
- package/app/components/ui/Divider/index.stories.ts +42 -0
- package/app/components/ui/Divider/index.vue +16 -0
- package/app/components/ui/Divider/types.ts +3 -0
- package/app/components/ui/Drawer/index.stories.ts +124 -0
- package/app/components/ui/Drawer/index.vue +197 -0
- package/app/components/ui/Drawer/types.ts +22 -0
- package/app/components/ui/Dropdown/index.stories.ts +145 -0
- package/app/components/ui/Dropdown/index.vue +258 -0
- package/app/components/ui/Dropdown/types.ts +87 -0
- package/app/components/ui/FormItem/index.stories.ts +70 -0
- package/app/components/ui/FormItem/index.vue +56 -0
- package/app/components/ui/FormItem/types.ts +14 -0
- package/app/components/ui/Help/index.stories.ts +54 -0
- package/app/components/ui/Help/index.vue +35 -0
- package/app/components/ui/Help/types.ts +8 -0
- package/app/components/ui/Icon/index.stories.ts +68 -0
- package/app/components/ui/Icon/index.vue +30 -0
- package/app/components/ui/Icon/types.ts +5 -0
- package/app/components/ui/Input/index.stories.ts +73 -0
- package/app/components/ui/Input/index.vue +92 -0
- package/app/components/ui/Input/types.ts +9 -0
- package/app/components/ui/InputCurrency/index.stories.ts +75 -0
- package/app/components/ui/InputCurrency/index.vue +31 -0
- package/app/components/ui/InputCurrency/types.ts +4 -0
- package/app/components/ui/InputNumber/index.stories.ts +56 -0
- package/app/components/ui/InputNumber/index.vue +76 -0
- package/app/components/ui/InputNumber/types.ts +10 -0
- package/app/components/ui/InputOtp/index.stories.ts +39 -0
- package/app/components/ui/InputOtp/index.vue +45 -0
- package/app/components/ui/InputOtp/types.ts +5 -0
- package/app/components/ui/InputPercent/index.stories.ts +32 -0
- package/app/components/ui/InputPercent/index.vue +8 -0
- package/app/components/ui/InputRange/index.stories.ts +37 -0
- package/app/components/ui/InputRange/index.vue +49 -0
- package/app/components/ui/InputRange/types.ts +8 -0
- package/app/components/ui/Loading/index.stories.ts +36 -0
- package/app/components/ui/Loading/index.vue +15 -0
- package/app/components/ui/Loading/types.ts +3 -0
- package/app/components/ui/Markdown/index.stories.ts +52 -0
- package/app/components/ui/Markdown/index.vue +22 -0
- package/app/components/ui/Markdown/themes/github.css +1248 -0
- package/app/components/ui/Markdown/types.ts +3 -0
- package/app/components/ui/Modal/index.stories.ts +124 -0
- package/app/components/ui/Modal/index.vue +202 -0
- package/app/components/ui/Modal/types.ts +23 -0
- package/app/components/ui/ModalContent/index.stories.ts +47 -0
- package/app/components/ui/ModalContent/index.vue +79 -0
- package/app/components/ui/ModalContent/types.ts +9 -0
- package/app/components/ui/PageCard/index.stories.ts +106 -0
- package/app/components/ui/PageCard/index.vue +135 -0
- package/app/components/ui/PageCard/types.ts +16 -0
- package/app/components/ui/Pagination/en.json +3 -0
- package/app/components/ui/Pagination/index.stories.ts +82 -0
- package/app/components/ui/Pagination/index.vue +173 -0
- package/app/components/ui/Pagination/types.ts +18 -0
- package/app/components/ui/Popover/index.stories.ts +67 -0
- package/app/components/ui/Popover/index.vue +21 -0
- package/app/components/ui/Popover/types.ts +5 -0
- package/app/components/ui/Qrcode/index.stories.ts +57 -0
- package/app/components/ui/Qrcode/index.vue +40 -0
- package/app/components/ui/Qrcode/types.ts +3 -0
- package/app/components/ui/Radio/index.stories.ts +71 -0
- package/app/components/ui/Radio/index.vue +10 -0
- package/app/components/ui/Radio/types.ts +3 -0
- package/app/components/ui/RadioCardGroup/index.stories.ts +90 -0
- package/app/components/ui/RadioCardGroup/index.vue +64 -0
- package/app/components/ui/RadioCardGroup/types.ts +13 -0
- package/app/components/ui/ScrollArea/index.stories.ts +66 -0
- package/app/components/ui/ScrollArea/index.vue +64 -0
- package/app/components/ui/ScrollArea/types.ts +5 -0
- package/app/components/ui/SearchSelect/en.json +5 -0
- package/app/components/ui/SearchSelect/index.stories.ts +126 -0
- package/app/components/ui/SearchSelect/index.vue +259 -0
- package/app/components/ui/SearchSelect/types.ts +39 -0
- package/app/components/ui/Select/en.json +6 -0
- package/app/components/ui/Select/index.stories.ts +128 -0
- package/app/components/ui/Select/index.vue +267 -0
- package/app/components/ui/Select/types.ts +34 -0
- package/app/components/ui/Skeleton/index.stories.ts +56 -0
- package/app/components/ui/Skeleton/index.vue +12 -0
- package/app/components/ui/Skeleton/types.ts +4 -0
- package/app/components/ui/Slider/index.stories.ts +60 -0
- package/app/components/ui/Slider/index.vue +27 -0
- package/app/components/ui/Slider/types.ts +5 -0
- package/app/components/ui/Surface/index.stories.ts +50 -0
- package/app/components/ui/Surface/index.vue +108 -0
- package/app/components/ui/Surface/types.ts +8 -0
- package/app/components/ui/Switch/index.stories.ts +32 -0
- package/app/components/ui/Switch/index.vue +10 -0
- package/app/components/ui/Switch/types.ts +3 -0
- package/app/components/ui/Tabs/index.stories.ts +116 -0
- package/app/components/ui/Tabs/index.vue +94 -0
- package/app/components/ui/Tabs/types.ts +19 -0
- package/app/components/ui/Tag/index.stories.ts +51 -0
- package/app/components/ui/Tag/index.vue +108 -0
- package/app/components/ui/Tag/types.ts +8 -0
- package/app/components/ui/Textarea/index.stories.ts +35 -0
- package/app/components/ui/Textarea/index.vue +50 -0
- package/app/components/ui/Textarea/types.ts +8 -0
- package/app/components/ui/Toast/index.stories.ts +48 -0
- package/app/components/ui/Toast/index.vue +21 -0
- package/app/components/ui/Toast/types.ts +5 -0
- package/app/components/ui/Tooltip/index.stories.ts +62 -0
- package/app/components/ui/Tooltip/index.vue +72 -0
- package/app/components/ui/Tooltip/types.ts +7 -0
- package/app/components/ui/WebLink/index.stories.ts +59 -0
- package/app/components/ui/WebLink/index.vue +61 -0
- package/app/components/ui/WebLink/types.ts +11 -0
- package/app/composables/index.ts +9 -0
- package/app/composables/useDialog.ts +76 -0
- package/app/composables/useToast.ts +49 -0
- package/app/en.json +23 -0
- package/app/types/index.ts +7 -0
- package/app/utils/index.ts +6 -0
- package/i18n/messages/ar.json +65 -0
- package/i18n/messages/de.json +65 -0
- package/i18n/messages/en.json +65 -0
- package/i18n/messages/es.json +65 -0
- package/i18n/messages/fr.json +65 -0
- package/i18n/messages/hi.json +65 -0
- package/i18n/messages/id.json +65 -0
- package/i18n/messages/it.json +65 -0
- package/i18n/messages/ja.json +65 -0
- package/i18n/messages/ko.json +65 -0
- package/i18n/messages/nl.json +65 -0
- package/i18n/messages/pl.json +65 -0
- package/i18n/messages/pt.json +65 -0
- package/i18n/messages/ru.json +65 -0
- package/i18n/messages/th.json +65 -0
- package/i18n/messages/tr.json +65 -0
- package/i18n/messages/vi.json +65 -0
- package/i18n/messages/zh-CN.json +65 -0
- package/i18n/messages/zh-TW.json +65 -0
- package/i18n.config.ts +19 -0
- package/nuxt.config.ts +62 -0
- package/package.json +46 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<main
|
|
12
|
+
data-slot="sidebar-inset"
|
|
13
|
+
:class="cn(
|
|
14
|
+
'bg-background relative flex w-full flex-1 flex-col',
|
|
15
|
+
'md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2',
|
|
16
|
+
props.class,
|
|
17
|
+
)"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</main>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<ul
|
|
12
|
+
data-slot="sidebar-menu"
|
|
13
|
+
data-sidebar="menu"
|
|
14
|
+
:class="cn('flex w-full min-w-0 flex-col gap-1', props.class)"
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</ul>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PrimitiveProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { Primitive } from "reka-ui"
|
|
5
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<PrimitiveProps & {
|
|
8
|
+
showOnHover?: boolean
|
|
9
|
+
class?: HTMLAttributes["class"]
|
|
10
|
+
}>(), {
|
|
11
|
+
as: "button",
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<Primitive
|
|
17
|
+
data-slot="sidebar-menu-action"
|
|
18
|
+
data-sidebar="menu-action"
|
|
19
|
+
:class="cn(
|
|
20
|
+
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
21
|
+
'after:absolute after:-inset-2 md:after:hidden',
|
|
22
|
+
'peer-data-[size=sm]/menu-button:top-1',
|
|
23
|
+
'peer-data-[size=default]/menu-button:top-1.5',
|
|
24
|
+
'peer-data-[size=lg]/menu-button:top-2.5',
|
|
25
|
+
'group-data-[collapsible=icon]:hidden',
|
|
26
|
+
showOnHover
|
|
27
|
+
&& 'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0',
|
|
28
|
+
props.class,
|
|
29
|
+
)"
|
|
30
|
+
:as="as"
|
|
31
|
+
:as-child="asChild"
|
|
32
|
+
>
|
|
33
|
+
<slot />
|
|
34
|
+
</Primitive>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="sidebar-menu-badge"
|
|
13
|
+
data-sidebar="menu-badge"
|
|
14
|
+
:class="cn(
|
|
15
|
+
'text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none',
|
|
16
|
+
'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground',
|
|
17
|
+
'peer-data-[size=sm]/menu-button:top-1',
|
|
18
|
+
'peer-data-[size=default]/menu-button:top-1.5',
|
|
19
|
+
'peer-data-[size=lg]/menu-button:top-2.5',
|
|
20
|
+
'group-data-[collapsible=icon]:hidden',
|
|
21
|
+
props.class,
|
|
22
|
+
)"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Component } from "vue"
|
|
3
|
+
import type { SidebarMenuButtonProps } from "./SidebarMenuButtonChild.vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/tooltip'
|
|
6
|
+
import SidebarMenuButtonChild from "./SidebarMenuButtonChild.vue"
|
|
7
|
+
import { useSidebar } from "./utils"
|
|
8
|
+
|
|
9
|
+
defineOptions({
|
|
10
|
+
inheritAttrs: false,
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(defineProps<SidebarMenuButtonProps & {
|
|
14
|
+
tooltip?: string | Component
|
|
15
|
+
}>(), {
|
|
16
|
+
as: "button",
|
|
17
|
+
variant: "default",
|
|
18
|
+
size: "default",
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const { isMobile, state } = useSidebar()
|
|
22
|
+
|
|
23
|
+
const delegatedProps = reactiveOmit(props, "tooltip")
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<SidebarMenuButtonChild v-if="!tooltip" v-bind="{ ...delegatedProps, ...$attrs }">
|
|
28
|
+
<slot />
|
|
29
|
+
</SidebarMenuButtonChild>
|
|
30
|
+
|
|
31
|
+
<Tooltip v-else>
|
|
32
|
+
<TooltipTrigger as-child>
|
|
33
|
+
<SidebarMenuButtonChild v-bind="{ ...delegatedProps, ...$attrs }">
|
|
34
|
+
<slot />
|
|
35
|
+
</SidebarMenuButtonChild>
|
|
36
|
+
</TooltipTrigger>
|
|
37
|
+
<TooltipContent
|
|
38
|
+
side="right"
|
|
39
|
+
align="center"
|
|
40
|
+
:hidden="state !== 'collapsed' || isMobile"
|
|
41
|
+
>
|
|
42
|
+
<template v-if="typeof tooltip === 'string'">
|
|
43
|
+
{{ tooltip }}
|
|
44
|
+
</template>
|
|
45
|
+
<component :is="tooltip" v-else />
|
|
46
|
+
</TooltipContent>
|
|
47
|
+
</Tooltip>
|
|
48
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PrimitiveProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import type { SidebarMenuButtonVariants } from "."
|
|
5
|
+
import { Primitive } from "reka-ui"
|
|
6
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
7
|
+
import { sidebarMenuButtonVariants } from "."
|
|
8
|
+
|
|
9
|
+
export interface SidebarMenuButtonProps extends PrimitiveProps {
|
|
10
|
+
variant?: SidebarMenuButtonVariants["variant"]
|
|
11
|
+
size?: SidebarMenuButtonVariants["size"]
|
|
12
|
+
isActive?: boolean
|
|
13
|
+
class?: HTMLAttributes["class"]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const props = withDefaults(defineProps<SidebarMenuButtonProps>(), {
|
|
17
|
+
as: "button",
|
|
18
|
+
variant: "default",
|
|
19
|
+
size: "default",
|
|
20
|
+
})
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<Primitive
|
|
25
|
+
data-slot="sidebar-menu-button"
|
|
26
|
+
data-sidebar="menu-button"
|
|
27
|
+
:data-size="size"
|
|
28
|
+
:data-active="isActive"
|
|
29
|
+
:class="cn(sidebarMenuButtonVariants({ variant, size }), props.class)"
|
|
30
|
+
:as="as"
|
|
31
|
+
:as-child="asChild"
|
|
32
|
+
v-bind="$attrs"
|
|
33
|
+
>
|
|
34
|
+
<slot />
|
|
35
|
+
</Primitive>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<li
|
|
12
|
+
data-slot="sidebar-menu-item"
|
|
13
|
+
data-sidebar="menu-item"
|
|
14
|
+
:class="cn('group/menu-item relative', props.class)"
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</li>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { computed } from "vue"
|
|
4
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
5
|
+
import { Skeleton } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/skeleton'
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
showIcon?: boolean
|
|
9
|
+
class?: HTMLAttributes["class"]
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const width = computed(() => {
|
|
13
|
+
return `${Math.floor(Math.random() * 40) + 50}%`
|
|
14
|
+
})
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div
|
|
19
|
+
data-slot="sidebar-menu-skeleton"
|
|
20
|
+
data-sidebar="menu-skeleton"
|
|
21
|
+
:class="cn('flex h-8 items-center gap-2 rounded-md px-2', props.class)"
|
|
22
|
+
>
|
|
23
|
+
<Skeleton
|
|
24
|
+
v-if="showIcon"
|
|
25
|
+
class="size-4 rounded-md"
|
|
26
|
+
data-sidebar="menu-skeleton-icon"
|
|
27
|
+
/>
|
|
28
|
+
|
|
29
|
+
<Skeleton
|
|
30
|
+
class="h-4 max-w-(--skeleton-width) flex-1"
|
|
31
|
+
data-sidebar="menu-skeleton-text"
|
|
32
|
+
:style="{ '--skeleton-width': width }"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<ul
|
|
12
|
+
data-slot="sidebar-menu-sub"
|
|
13
|
+
data-sidebar="menu-badge"
|
|
14
|
+
:class="cn(
|
|
15
|
+
'border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5',
|
|
16
|
+
'group-data-[collapsible=icon]:hidden',
|
|
17
|
+
props.class,
|
|
18
|
+
)"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
</ul>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PrimitiveProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { Primitive } from "reka-ui"
|
|
5
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<PrimitiveProps & {
|
|
8
|
+
size?: "sm" | "md"
|
|
9
|
+
isActive?: boolean
|
|
10
|
+
class?: HTMLAttributes["class"]
|
|
11
|
+
}>(), {
|
|
12
|
+
as: "a",
|
|
13
|
+
size: "md",
|
|
14
|
+
})
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<Primitive
|
|
19
|
+
data-slot="sidebar-menu-sub-button"
|
|
20
|
+
data-sidebar="menu-sub-button"
|
|
21
|
+
:as="as"
|
|
22
|
+
:as-child="asChild"
|
|
23
|
+
:data-size="size"
|
|
24
|
+
:data-active="isActive ? '' : undefined"
|
|
25
|
+
:class="cn(
|
|
26
|
+
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
|
|
27
|
+
'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',
|
|
28
|
+
size === 'sm' && 'text-xs',
|
|
29
|
+
size === 'md' && 'text-sm',
|
|
30
|
+
'group-data-[collapsible=icon]:hidden',
|
|
31
|
+
props.class,
|
|
32
|
+
)"
|
|
33
|
+
>
|
|
34
|
+
<slot />
|
|
35
|
+
</Primitive>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<li
|
|
12
|
+
data-slot="sidebar-menu-sub-item"
|
|
13
|
+
data-sidebar="menu-sub-item"
|
|
14
|
+
:class="cn('group/menu-sub-item relative', props.class)"
|
|
15
|
+
>
|
|
16
|
+
<slot />
|
|
17
|
+
</li>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes, Ref } from "vue"
|
|
3
|
+
import { defaultDocument, useEventListener, useMediaQuery, useVModel } from "@vueuse/core"
|
|
4
|
+
import { TooltipProvider } from "reka-ui"
|
|
5
|
+
import { computed, ref } from "vue"
|
|
6
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
7
|
+
import { provideSidebarContext, SIDEBAR_COOKIE_MAX_AGE, SIDEBAR_COOKIE_NAME, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON } from "./utils"
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
defaultOpen?: boolean
|
|
11
|
+
open?: boolean
|
|
12
|
+
class?: HTMLAttributes["class"]
|
|
13
|
+
}>(), {
|
|
14
|
+
defaultOpen: !defaultDocument?.cookie.includes(`${SIDEBAR_COOKIE_NAME}=false`),
|
|
15
|
+
open: undefined,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const emits = defineEmits<{
|
|
19
|
+
"update:open": [open: boolean]
|
|
20
|
+
}>()
|
|
21
|
+
|
|
22
|
+
const isMobile = useMediaQuery("(max-width: 768px)")
|
|
23
|
+
const openMobile = ref(false)
|
|
24
|
+
|
|
25
|
+
const open = useVModel(props, "open", emits, {
|
|
26
|
+
defaultValue: props.defaultOpen ?? false,
|
|
27
|
+
passive: (props.open === undefined) as false,
|
|
28
|
+
}) as Ref<boolean>
|
|
29
|
+
|
|
30
|
+
function setOpen(value: boolean) {
|
|
31
|
+
open.value = value // emits('update:open', value)
|
|
32
|
+
|
|
33
|
+
// This sets the cookie to keep the sidebar state.
|
|
34
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${open.value}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function setOpenMobile(value: boolean) {
|
|
38
|
+
openMobile.value = value
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Helper to toggle the sidebar.
|
|
42
|
+
function toggleSidebar() {
|
|
43
|
+
return isMobile.value ? setOpenMobile(!openMobile.value) : setOpen(!open.value)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
useEventListener("keydown", (event: KeyboardEvent) => {
|
|
47
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
48
|
+
event.preventDefault()
|
|
49
|
+
toggleSidebar()
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
54
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
55
|
+
const state = computed(() => open.value ? "expanded" : "collapsed")
|
|
56
|
+
|
|
57
|
+
provideSidebarContext({
|
|
58
|
+
state,
|
|
59
|
+
open,
|
|
60
|
+
setOpen,
|
|
61
|
+
isMobile,
|
|
62
|
+
openMobile,
|
|
63
|
+
setOpenMobile,
|
|
64
|
+
toggleSidebar,
|
|
65
|
+
})
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<template>
|
|
69
|
+
<TooltipProvider :delay-duration="0">
|
|
70
|
+
<div
|
|
71
|
+
data-slot="sidebar-wrapper"
|
|
72
|
+
:style="{
|
|
73
|
+
'--sidebar-width': SIDEBAR_WIDTH,
|
|
74
|
+
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
|
|
75
|
+
}"
|
|
76
|
+
:class="cn('group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full', props.class)"
|
|
77
|
+
v-bind="$attrs"
|
|
78
|
+
>
|
|
79
|
+
<slot />
|
|
80
|
+
</div>
|
|
81
|
+
</TooltipProvider>
|
|
82
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
4
|
+
import { useSidebar } from "./utils"
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
class?: HTMLAttributes["class"]
|
|
8
|
+
}>()
|
|
9
|
+
|
|
10
|
+
const { toggleSidebar } = useSidebar()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<button
|
|
15
|
+
data-sidebar="rail"
|
|
16
|
+
data-slot="sidebar-rail"
|
|
17
|
+
aria-label="Toggle Sidebar"
|
|
18
|
+
:tabindex="-1"
|
|
19
|
+
title="Toggle Sidebar"
|
|
20
|
+
:class="cn(
|
|
21
|
+
'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex',
|
|
22
|
+
'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',
|
|
23
|
+
'[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
|
|
24
|
+
'hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',
|
|
25
|
+
'[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
|
|
26
|
+
'[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',
|
|
27
|
+
props.class,
|
|
28
|
+
)"
|
|
29
|
+
@click="toggleSidebar"
|
|
30
|
+
>
|
|
31
|
+
<slot />
|
|
32
|
+
</button>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
4
|
+
import { Separator } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/separator'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<{
|
|
7
|
+
class?: HTMLAttributes["class"]
|
|
8
|
+
}>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<Separator
|
|
13
|
+
data-slot="sidebar-separator"
|
|
14
|
+
data-sidebar="separator"
|
|
15
|
+
:class="cn('bg-sidebar-border mx-2 w-auto', props.class)"
|
|
16
|
+
>
|
|
17
|
+
<slot />
|
|
18
|
+
</Separator>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { PanelLeft } from "lucide-vue-next"
|
|
4
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
5
|
+
import { Button } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/button'
|
|
6
|
+
import { useSidebar } from "./utils"
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
class?: HTMLAttributes["class"]
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const { toggleSidebar } = useSidebar()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<Button
|
|
17
|
+
data-sidebar="trigger"
|
|
18
|
+
data-slot="sidebar-trigger"
|
|
19
|
+
variant="ghost"
|
|
20
|
+
size="icon"
|
|
21
|
+
:class="cn('h-7 w-7', props.class)"
|
|
22
|
+
@click="toggleSidebar"
|
|
23
|
+
>
|
|
24
|
+
<PanelLeft />
|
|
25
|
+
<span class="sr-only">Toggle Sidebar</span>
|
|
26
|
+
</Button>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { VariantProps } from "class-variance-authority"
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cva } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
export interface SidebarProps {
|
|
6
|
+
side?: "left" | "right"
|
|
7
|
+
variant?: "sidebar" | "floating" | "inset"
|
|
8
|
+
collapsible?: "offcanvas" | "icon" | "none"
|
|
9
|
+
class?: HTMLAttributes["class"]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { default as Sidebar } from "./Sidebar.vue"
|
|
13
|
+
export { default as SidebarContent } from "./SidebarContent.vue"
|
|
14
|
+
export { default as SidebarFooter } from "./SidebarFooter.vue"
|
|
15
|
+
export { default as SidebarGroup } from "./SidebarGroup.vue"
|
|
16
|
+
export { default as SidebarGroupAction } from "./SidebarGroupAction.vue"
|
|
17
|
+
export { default as SidebarGroupContent } from "./SidebarGroupContent.vue"
|
|
18
|
+
export { default as SidebarGroupLabel } from "./SidebarGroupLabel.vue"
|
|
19
|
+
export { default as SidebarHeader } from "./SidebarHeader.vue"
|
|
20
|
+
export { default as SidebarInput } from "./SidebarInput.vue"
|
|
21
|
+
export { default as SidebarInset } from "./SidebarInset.vue"
|
|
22
|
+
export { default as SidebarMenu } from "./SidebarMenu.vue"
|
|
23
|
+
export { default as SidebarMenuAction } from "./SidebarMenuAction.vue"
|
|
24
|
+
export { default as SidebarMenuBadge } from "./SidebarMenuBadge.vue"
|
|
25
|
+
export { default as SidebarMenuButton } from "./SidebarMenuButton.vue"
|
|
26
|
+
export { default as SidebarMenuItem } from "./SidebarMenuItem.vue"
|
|
27
|
+
export { default as SidebarMenuSkeleton } from "./SidebarMenuSkeleton.vue"
|
|
28
|
+
export { default as SidebarMenuSub } from "./SidebarMenuSub.vue"
|
|
29
|
+
export { default as SidebarMenuSubButton } from "./SidebarMenuSubButton.vue"
|
|
30
|
+
export { default as SidebarMenuSubItem } from "./SidebarMenuSubItem.vue"
|
|
31
|
+
export { default as SidebarProvider } from "./SidebarProvider.vue"
|
|
32
|
+
export { default as SidebarRail } from "./SidebarRail.vue"
|
|
33
|
+
export { default as SidebarSeparator } from "./SidebarSeparator.vue"
|
|
34
|
+
export { default as SidebarTrigger } from "./SidebarTrigger.vue"
|
|
35
|
+
|
|
36
|
+
export { useSidebar } from "./utils"
|
|
37
|
+
|
|
38
|
+
export const sidebarMenuButtonVariants = cva(
|
|
39
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
40
|
+
{
|
|
41
|
+
variants: {
|
|
42
|
+
variant: {
|
|
43
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
44
|
+
outline:
|
|
45
|
+
"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
|
|
46
|
+
},
|
|
47
|
+
size: {
|
|
48
|
+
default: "h-8 text-sm",
|
|
49
|
+
sm: "h-7 text-xs",
|
|
50
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
variant: "default",
|
|
55
|
+
size: "default",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
export type SidebarMenuButtonVariants = VariantProps<typeof sidebarMenuButtonVariants>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from "vue"
|
|
2
|
+
import { createContext } from "reka-ui"
|
|
3
|
+
|
|
4
|
+
export const SIDEBAR_COOKIE_NAME = "sidebar_state"
|
|
5
|
+
export const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
|
|
6
|
+
export const SIDEBAR_WIDTH = "16rem"
|
|
7
|
+
export const SIDEBAR_WIDTH_MOBILE = "18rem"
|
|
8
|
+
export const SIDEBAR_WIDTH_ICON = "3rem"
|
|
9
|
+
export const SIDEBAR_KEYBOARD_SHORTCUT = "b"
|
|
10
|
+
|
|
11
|
+
export const [useSidebar, provideSidebarContext] = createContext<{
|
|
12
|
+
state: ComputedRef<"expanded" | "collapsed">
|
|
13
|
+
open: Ref<boolean>
|
|
14
|
+
setOpen: (value: boolean) => void
|
|
15
|
+
isMobile: Ref<boolean>
|
|
16
|
+
openMobile: Ref<boolean>
|
|
17
|
+
setOpenMobile: (value: boolean) => void
|
|
18
|
+
toggleSidebar: () => void
|
|
19
|
+
}>("Sidebar")
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
4
|
+
|
|
5
|
+
interface SkeletonProps {
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const props = defineProps<SkeletonProps>()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div
|
|
14
|
+
data-slot="skeleton"
|
|
15
|
+
:class="cn('animate-pulse rounded-md bg-primary/10', props.class)"
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Skeleton } from "./Skeleton.vue"
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SliderRootEmits, SliderRootProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import { reactiveOmit } from "@vueuse/core"
|
|
5
|
+
import { SliderRange, SliderRoot, SliderThumb, SliderTrack, useForwardPropsEmits } from "reka-ui"
|
|
6
|
+
import { cn } from '@polymarbot/nuxt-layer-shadcn-ui/app/utils'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<SliderRootProps & { class?: HTMLAttributes["class"] }>()
|
|
9
|
+
const emits = defineEmits<SliderRootEmits>()
|
|
10
|
+
|
|
11
|
+
const delegatedProps = reactiveOmit(props, "class")
|
|
12
|
+
|
|
13
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<SliderRoot
|
|
18
|
+
v-slot="{ modelValue }"
|
|
19
|
+
data-slot="slider"
|
|
20
|
+
:class="cn(
|
|
21
|
+
'relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col',
|
|
22
|
+
props.class,
|
|
23
|
+
)"
|
|
24
|
+
v-bind="forwarded"
|
|
25
|
+
>
|
|
26
|
+
<SliderTrack
|
|
27
|
+
data-slot="slider-track"
|
|
28
|
+
class="bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
29
|
+
>
|
|
30
|
+
<SliderRange
|
|
31
|
+
data-slot="slider-range"
|
|
32
|
+
class="bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
33
|
+
/>
|
|
34
|
+
</SliderTrack>
|
|
35
|
+
|
|
36
|
+
<SliderThumb
|
|
37
|
+
v-for="(_, key) in modelValue"
|
|
38
|
+
:key="key"
|
|
39
|
+
data-slot="slider-thumb"
|
|
40
|
+
class="bg-white border-primary ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
41
|
+
/>
|
|
42
|
+
</SliderRoot>
|
|
43
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Slider } from "./Slider.vue"
|