@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,124 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import Button from '../Button/index.vue'
|
|
3
|
+
import Input from '../Input/index.vue'
|
|
4
|
+
import Modal from './index.vue'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'UI/Modal',
|
|
8
|
+
component: Modal,
|
|
9
|
+
argTypes: {
|
|
10
|
+
loading: { control: 'boolean' },
|
|
11
|
+
disabled: { control: 'boolean' },
|
|
12
|
+
confirmDisabled: { control: 'boolean' },
|
|
13
|
+
showCancel: { control: 'boolean' },
|
|
14
|
+
showClose: { control: 'boolean' },
|
|
15
|
+
hideHeader: { control: 'boolean' },
|
|
16
|
+
hideFooter: { control: 'boolean' },
|
|
17
|
+
alignCenter: { control: 'boolean' },
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
loading: false,
|
|
21
|
+
disabled: false,
|
|
22
|
+
confirmDisabled: false,
|
|
23
|
+
showCancel: false,
|
|
24
|
+
showClose: true,
|
|
25
|
+
hideHeader: false,
|
|
26
|
+
hideFooter: false,
|
|
27
|
+
alignCenter: false,
|
|
28
|
+
},
|
|
29
|
+
} satisfies Meta
|
|
30
|
+
|
|
31
|
+
export default meta
|
|
32
|
+
type Story = StoryObj<typeof meta>
|
|
33
|
+
|
|
34
|
+
export const Default: Story = {
|
|
35
|
+
render: args => ({
|
|
36
|
+
components: { Modal, Button, Input },
|
|
37
|
+
setup () {
|
|
38
|
+
const controlled = ref(false)
|
|
39
|
+
const withDescription = ref(false)
|
|
40
|
+
const typeInfo = ref(false)
|
|
41
|
+
const typeSuccess = ref(false)
|
|
42
|
+
const typeHelp = ref(false)
|
|
43
|
+
const typeWarn = ref(false)
|
|
44
|
+
const typeDanger = ref(false)
|
|
45
|
+
const scrollable = ref(false)
|
|
46
|
+
return { args, controlled, withDescription, typeInfo, typeSuccess, typeHelp, typeWarn, typeDanger, scrollable }
|
|
47
|
+
},
|
|
48
|
+
template: `
|
|
49
|
+
<div class="space-y-10">
|
|
50
|
+
<!-- Controlled -->
|
|
51
|
+
<section>
|
|
52
|
+
<h3 class="mb-4 text-lg font-medium">Controlled</h3>
|
|
53
|
+
<Button @click="controlled = true">Open Modal</Button>
|
|
54
|
+
<Modal
|
|
55
|
+
v-model:visible="controlled"
|
|
56
|
+
v-bind="args"
|
|
57
|
+
title="Modal Title"
|
|
58
|
+
confirmText="OK"
|
|
59
|
+
cancelText="Cancel"
|
|
60
|
+
>
|
|
61
|
+
<p>This is the modal content.</p>
|
|
62
|
+
<Input class="mt-4" placeholder="Try interacting with this input" />
|
|
63
|
+
</Modal>
|
|
64
|
+
</section>
|
|
65
|
+
|
|
66
|
+
<!-- With Description -->
|
|
67
|
+
<section>
|
|
68
|
+
<h3 class="mb-4 text-lg font-medium">With Description</h3>
|
|
69
|
+
<Button @click="withDescription = true">Open Modal</Button>
|
|
70
|
+
<Modal
|
|
71
|
+
v-model:visible="withDescription"
|
|
72
|
+
title="Delete Project"
|
|
73
|
+
description="This will permanently remove the project and all its data. This action cannot be undone."
|
|
74
|
+
showCancel
|
|
75
|
+
confirmVariant="destructive"
|
|
76
|
+
confirmText="Delete"
|
|
77
|
+
>
|
|
78
|
+
<p>Are you sure you want to continue?</p>
|
|
79
|
+
</Modal>
|
|
80
|
+
</section>
|
|
81
|
+
|
|
82
|
+
<!-- Scrollable Content -->
|
|
83
|
+
<section>
|
|
84
|
+
<h3 class="mb-4 text-lg font-medium">Scrollable Content</h3>
|
|
85
|
+
<Button @click="scrollable = true">Open Modal</Button>
|
|
86
|
+
<Modal v-model:visible="scrollable" title="Terms of Service" showCancel confirmText="Accept">
|
|
87
|
+
<div class="space-y-4">
|
|
88
|
+
<p v-for="i in 20" :key="i">
|
|
89
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.
|
|
90
|
+
</p>
|
|
91
|
+
</div>
|
|
92
|
+
</Modal>
|
|
93
|
+
</section>
|
|
94
|
+
|
|
95
|
+
<!-- With Type -->
|
|
96
|
+
<section>
|
|
97
|
+
<h3 class="mb-4 text-lg font-medium">With Type</h3>
|
|
98
|
+
<div class="flex gap-2">
|
|
99
|
+
<Button variant="outline" @click="typeInfo = true">Info</Button>
|
|
100
|
+
<Button variant="outline" @click="typeSuccess = true">Success</Button>
|
|
101
|
+
<Button variant="outline" @click="typeHelp = true">Help</Button>
|
|
102
|
+
<Button variant="outline" @click="typeWarn = true">Warn</Button>
|
|
103
|
+
<Button variant="outline" @click="typeDanger = true">Danger</Button>
|
|
104
|
+
</div>
|
|
105
|
+
<Modal v-model:visible="typeInfo" title="Information" type="info" showCancel>
|
|
106
|
+
<p>Your session will expire in 5 minutes.</p>
|
|
107
|
+
</Modal>
|
|
108
|
+
<Modal v-model:visible="typeSuccess" title="Success" type="success">
|
|
109
|
+
<p>Your payment has been processed successfully.</p>
|
|
110
|
+
</Modal>
|
|
111
|
+
<Modal v-model:visible="typeHelp" title="Help" type="help" showCancel>
|
|
112
|
+
<p>Need assistance? Check our documentation or contact support.</p>
|
|
113
|
+
</Modal>
|
|
114
|
+
<Modal v-model:visible="typeWarn" title="Warning" type="warn" showCancel confirmVariant="destructive">
|
|
115
|
+
<p>This operation may affect your existing data.</p>
|
|
116
|
+
</Modal>
|
|
117
|
+
<Modal v-model:visible="typeDanger" title="Delete Account" type="danger" showCancel confirmVariant="destructive" confirmText="Delete">
|
|
118
|
+
<p>All data will be permanently removed. This action cannot be undone.</p>
|
|
119
|
+
</Modal>
|
|
120
|
+
</section>
|
|
121
|
+
</div>
|
|
122
|
+
`,
|
|
123
|
+
}),
|
|
124
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogClose,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogDescription,
|
|
7
|
+
DialogFooter,
|
|
8
|
+
DialogHeader,
|
|
9
|
+
DialogTitle,
|
|
10
|
+
} from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/dialog'
|
|
11
|
+
import type { ModalProps } from './types'
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(defineProps<ModalProps>(), {
|
|
14
|
+
showClose: true,
|
|
15
|
+
title: undefined,
|
|
16
|
+
description: undefined,
|
|
17
|
+
confirmText: undefined,
|
|
18
|
+
cancelText: undefined,
|
|
19
|
+
content: undefined,
|
|
20
|
+
confirmVariant: 'default',
|
|
21
|
+
cancelVariant: 'outline',
|
|
22
|
+
type: undefined,
|
|
23
|
+
class: undefined,
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const emit = defineEmits<{
|
|
27
|
+
'update:visible': [value: boolean]
|
|
28
|
+
'open': []
|
|
29
|
+
'close': []
|
|
30
|
+
'closed': []
|
|
31
|
+
'confirm': []
|
|
32
|
+
'cancel': []
|
|
33
|
+
}>()
|
|
34
|
+
|
|
35
|
+
const { t } = useI18n()
|
|
36
|
+
|
|
37
|
+
const resolvedConfirmText = computed(
|
|
38
|
+
() => props.confirmText ?? t('common.actions.confirm'),
|
|
39
|
+
)
|
|
40
|
+
const resolvedCancelText = computed(
|
|
41
|
+
() => props.cancelText ?? t('common.actions.cancel'),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
const dialogOpen = computed({
|
|
45
|
+
get: () => props.visible ?? false,
|
|
46
|
+
set: (value: boolean) => {
|
|
47
|
+
if (!value && props.visible && !props.loading) {
|
|
48
|
+
onCancel()
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
watch(() => props.visible, visible => {
|
|
54
|
+
if (visible) emit('open')
|
|
55
|
+
else emit('close')
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
function onConfirm () {
|
|
59
|
+
emit('confirm')
|
|
60
|
+
emit('update:visible', false)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function onCancel () {
|
|
64
|
+
emit('cancel')
|
|
65
|
+
emit('update:visible', false)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const contentClass = computed(() =>
|
|
69
|
+
cn(
|
|
70
|
+
'gap-0 py-0',
|
|
71
|
+
props.alignCenter && 'text-center',
|
|
72
|
+
props.class,
|
|
73
|
+
),
|
|
74
|
+
)
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<template>
|
|
78
|
+
<Dialog v-model:open="dialogOpen">
|
|
79
|
+
<DialogContent
|
|
80
|
+
:class="contentClass"
|
|
81
|
+
:showCloseButton="false"
|
|
82
|
+
@pointerDownOutside.prevent
|
|
83
|
+
@closeAutoFocus="emit('closed')"
|
|
84
|
+
>
|
|
85
|
+
<!-- Header -->
|
|
86
|
+
<DialogHeader
|
|
87
|
+
v-if="!hideHeader && (!!title || !!description || !!$slots.header)"
|
|
88
|
+
:class="cn('pt-5', alignCenter && 'items-center')"
|
|
89
|
+
>
|
|
90
|
+
<DialogTitle>
|
|
91
|
+
<slot name="header">
|
|
92
|
+
{{ title }}
|
|
93
|
+
</slot>
|
|
94
|
+
</DialogTitle>
|
|
95
|
+
<DialogDescription v-if="description">
|
|
96
|
+
{{ description }}
|
|
97
|
+
</DialogDescription>
|
|
98
|
+
<DialogDescription
|
|
99
|
+
v-else
|
|
100
|
+
class="sr-only"
|
|
101
|
+
/>
|
|
102
|
+
</DialogHeader>
|
|
103
|
+
|
|
104
|
+
<!-- A11y fallback: DialogTitle/DialogDescription required by reka-ui -->
|
|
105
|
+
<template v-else>
|
|
106
|
+
<DialogTitle class="sr-only">
|
|
107
|
+
{{ title }}
|
|
108
|
+
</DialogTitle>
|
|
109
|
+
<DialogDescription class="sr-only" />
|
|
110
|
+
</template>
|
|
111
|
+
|
|
112
|
+
<!-- Content -->
|
|
113
|
+
<ScrollArea
|
|
114
|
+
fadeMask
|
|
115
|
+
class="my-5 max-h-[60vh]"
|
|
116
|
+
>
|
|
117
|
+
<ModalContent
|
|
118
|
+
:type="type"
|
|
119
|
+
:content="content"
|
|
120
|
+
:inert="loading || disabled || undefined"
|
|
121
|
+
:class="[ loading || disabled ? 'opacity-50' : undefined ]"
|
|
122
|
+
class="p-1"
|
|
123
|
+
>
|
|
124
|
+
<slot />
|
|
125
|
+
</ModalContent>
|
|
126
|
+
</ScrollArea>
|
|
127
|
+
|
|
128
|
+
<!-- Footer -->
|
|
129
|
+
<DialogFooter
|
|
130
|
+
v-if="!hideFooter"
|
|
131
|
+
class="pb-5"
|
|
132
|
+
>
|
|
133
|
+
<slot name="footer">
|
|
134
|
+
<!-- Left side slot -->
|
|
135
|
+
<div class="min-w-0 flex-1">
|
|
136
|
+
<slot name="footerLeft" />
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<!-- Right side buttons -->
|
|
140
|
+
<div
|
|
141
|
+
class="flex shrink-0 gap-4"
|
|
142
|
+
:class="[ alignCenter ? 'justify-center' : 'justify-end' ]"
|
|
143
|
+
>
|
|
144
|
+
<Button
|
|
145
|
+
v-if="showCancel"
|
|
146
|
+
class="min-w-32"
|
|
147
|
+
:variant="cancelVariant"
|
|
148
|
+
:disabled="loading"
|
|
149
|
+
@click="onCancel"
|
|
150
|
+
>
|
|
151
|
+
{{ resolvedCancelText }}
|
|
152
|
+
</Button>
|
|
153
|
+
<Button
|
|
154
|
+
:class="showCancel ? 'min-w-32' : 'min-w-48'"
|
|
155
|
+
:variant="confirmVariant"
|
|
156
|
+
:loading="loading"
|
|
157
|
+
:disabled="disabled || confirmDisabled"
|
|
158
|
+
@click="onConfirm"
|
|
159
|
+
>
|
|
160
|
+
{{ resolvedConfirmText }}
|
|
161
|
+
</Button>
|
|
162
|
+
</div>
|
|
163
|
+
</slot>
|
|
164
|
+
</DialogFooter>
|
|
165
|
+
|
|
166
|
+
<DialogClose
|
|
167
|
+
v-if="showClose"
|
|
168
|
+
:disabled="loading"
|
|
169
|
+
class="
|
|
170
|
+
absolute top-3 right-3 flex size-8 items-center justify-center
|
|
171
|
+
rounded-full text-muted-foreground ring-offset-background transition
|
|
172
|
+
hover:bg-accent/50 hover:text-foreground
|
|
173
|
+
focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden
|
|
174
|
+
disabled:pointer-events-none disabled:opacity-50
|
|
175
|
+
"
|
|
176
|
+
>
|
|
177
|
+
<Icon name="x" />
|
|
178
|
+
<span class="sr-only">
|
|
179
|
+
{{ t('common.actions.close') }}
|
|
180
|
+
</span>
|
|
181
|
+
</DialogClose>
|
|
182
|
+
</DialogContent>
|
|
183
|
+
</Dialog>
|
|
184
|
+
</template>
|
|
185
|
+
|
|
186
|
+
<style>
|
|
187
|
+
/* Translucent blur backdrop. DialogOverlay is rendered inside DialogPortal
|
|
188
|
+
(outside component scope), so use a non-scoped style. */
|
|
189
|
+
[data-slot='dialog-overlay'] {
|
|
190
|
+
z-index: 200;
|
|
191
|
+
background-color: rgba(252, 252, 252, 0.3);
|
|
192
|
+
backdrop-filter: blur(2px);
|
|
193
|
+
-webkit-backdrop-filter: blur(2px);
|
|
194
|
+
}
|
|
195
|
+
.dark [data-slot='dialog-overlay'] {
|
|
196
|
+
background-color: rgba(25, 25, 25, 0.3);
|
|
197
|
+
}
|
|
198
|
+
/* Raise above layout header (z-100) so the dialog covers it. */
|
|
199
|
+
[data-slot='dialog-content'] {
|
|
200
|
+
z-index: 200;
|
|
201
|
+
}
|
|
202
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ButtonVariants } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/button'
|
|
2
|
+
import type { ModalContentProps } from '../ModalContent/types'
|
|
3
|
+
|
|
4
|
+
export interface ModalProps {
|
|
5
|
+
visible?: boolean
|
|
6
|
+
loading?: boolean
|
|
7
|
+
disabled?: boolean
|
|
8
|
+
confirmDisabled?: boolean
|
|
9
|
+
showCancel?: boolean
|
|
10
|
+
showClose?: boolean
|
|
11
|
+
hideHeader?: boolean
|
|
12
|
+
hideFooter?: boolean
|
|
13
|
+
alignCenter?: boolean
|
|
14
|
+
title?: string
|
|
15
|
+
description?: string
|
|
16
|
+
content?: ModalContentProps['content']
|
|
17
|
+
confirmText?: string
|
|
18
|
+
cancelText?: string
|
|
19
|
+
confirmVariant?: ButtonVariants['variant']
|
|
20
|
+
cancelVariant?: ButtonVariants['variant']
|
|
21
|
+
type?: ModalContentProps['type']
|
|
22
|
+
class?: ClassValue
|
|
23
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import ModalContent from './index.vue'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'UI/ModalContent',
|
|
6
|
+
component: ModalContent,
|
|
7
|
+
} satisfies Meta<typeof ModalContent>
|
|
8
|
+
|
|
9
|
+
export default meta
|
|
10
|
+
type Story = StoryObj<typeof meta>
|
|
11
|
+
|
|
12
|
+
export const Default: Story = {
|
|
13
|
+
render: () => ({
|
|
14
|
+
components: { ModalContent },
|
|
15
|
+
template: `
|
|
16
|
+
<div class="space-y-4 max-w-md">
|
|
17
|
+
<!-- Types -->
|
|
18
|
+
<section>
|
|
19
|
+
<h3 class="mb-4 text-lg font-medium">Types</h3>
|
|
20
|
+
<div class="space-y-4">
|
|
21
|
+
<ModalContent type="default" content="This is a default message." />
|
|
22
|
+
<ModalContent type="success" content="Operation completed successfully." />
|
|
23
|
+
<ModalContent type="info" content="Your changes have been saved." />
|
|
24
|
+
<ModalContent type="help" content="Need help? Check the documentation." />
|
|
25
|
+
<ModalContent type="warn" content="This operation will affect all users." />
|
|
26
|
+
<ModalContent type="danger" content="Are you sure you want to delete this item? This action cannot be undone." />
|
|
27
|
+
</div>
|
|
28
|
+
</section>
|
|
29
|
+
|
|
30
|
+
<!-- Custom Icon -->
|
|
31
|
+
<section>
|
|
32
|
+
<h3 class="mb-4 text-lg font-medium">Custom Icon</h3>
|
|
33
|
+
<div class="space-y-4">
|
|
34
|
+
<ModalContent icon="shield-alert" content="Your session is about to expire." />
|
|
35
|
+
<ModalContent type="warn" icon="shield-alert" content="Security warning: unusual login detected." />
|
|
36
|
+
</div>
|
|
37
|
+
</section>
|
|
38
|
+
|
|
39
|
+
<!-- Multiline Text -->
|
|
40
|
+
<section>
|
|
41
|
+
<h3 class="mb-4 text-lg font-medium">Multiline Text</h3>
|
|
42
|
+
<ModalContent type="warn" content="Warning: This operation will affect all users.\nPlease review the changes before proceeding." />
|
|
43
|
+
</section>
|
|
44
|
+
</div>
|
|
45
|
+
`,
|
|
46
|
+
}),
|
|
47
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { isVNode } from 'vue'
|
|
3
|
+
import type { ModalContentProps, ModalContentType } from './types'
|
|
4
|
+
|
|
5
|
+
const typeIconNameMap: Partial<Record<ModalContentType, string>> = {
|
|
6
|
+
success: 'circle-check',
|
|
7
|
+
info: 'info',
|
|
8
|
+
help: 'circle-question-mark',
|
|
9
|
+
warn: 'triangle-alert',
|
|
10
|
+
danger: 'circle-alert',
|
|
11
|
+
error: 'circle-x',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const typeIconClasses: Record<ModalContentType, string> = {
|
|
15
|
+
default: 'text-primary',
|
|
16
|
+
success: 'text-success',
|
|
17
|
+
info: 'text-info',
|
|
18
|
+
help: 'text-help',
|
|
19
|
+
warn: 'text-warn',
|
|
20
|
+
danger: 'text-destructive',
|
|
21
|
+
error: 'text-destructive',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(defineProps<ModalContentProps>(), {
|
|
25
|
+
type: undefined,
|
|
26
|
+
icon: undefined,
|
|
27
|
+
content: undefined,
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const iconName = computed(() => {
|
|
31
|
+
if (props.icon) return props.icon
|
|
32
|
+
if (props.type) return typeIconNameMap[props.type]
|
|
33
|
+
return undefined
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const iconClass = computed(() =>
|
|
37
|
+
cn('size-8 shrink-0', props.type && typeIconClasses[props.type]),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
// Check if content is HTMLElement
|
|
41
|
+
function isHTMLElement (value: unknown): value is HTMLElement {
|
|
42
|
+
return value instanceof HTMLElement
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<div class="flex w-full items-center gap-4">
|
|
48
|
+
<!-- Icon -->
|
|
49
|
+
<Icon
|
|
50
|
+
v-if="iconName"
|
|
51
|
+
:name="iconName"
|
|
52
|
+
:class="iconClass"
|
|
53
|
+
/>
|
|
54
|
+
<!-- Content -->
|
|
55
|
+
<div class="flex-1">
|
|
56
|
+
<!-- VNode: render directly -->
|
|
57
|
+
<component
|
|
58
|
+
:is="content"
|
|
59
|
+
v-if="isVNode(content)"
|
|
60
|
+
/>
|
|
61
|
+
<!-- HTMLElement: mount via ref -->
|
|
62
|
+
<div
|
|
63
|
+
v-else-if="isHTMLElement(content)"
|
|
64
|
+
ref="elementContainer"
|
|
65
|
+
>
|
|
66
|
+
<component :is="() => content" />
|
|
67
|
+
</div>
|
|
68
|
+
<!-- String: render as text with whitespace preserved -->
|
|
69
|
+
<span
|
|
70
|
+
v-else-if="content"
|
|
71
|
+
class="whitespace-pre-wrap"
|
|
72
|
+
>
|
|
73
|
+
{{ content }}
|
|
74
|
+
</span>
|
|
75
|
+
<!-- Fallback to slot -->
|
|
76
|
+
<slot v-else />
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VNode } from 'vue'
|
|
2
|
+
|
|
3
|
+
export type ModalContentType = 'default' | 'success' | 'info' | 'help' | 'warn' | 'danger' | 'error'
|
|
4
|
+
|
|
5
|
+
export interface ModalContentProps {
|
|
6
|
+
type?: ModalContentType
|
|
7
|
+
icon?: string
|
|
8
|
+
content?: string | VNode | HTMLElement
|
|
9
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import Button from '../Button/index.vue'
|
|
3
|
+
import WebLink from '../WebLink/index.vue'
|
|
4
|
+
import PageCard from './index.vue'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'UI/PageCard',
|
|
8
|
+
component: PageCard,
|
|
9
|
+
argTypes: {
|
|
10
|
+
title: { control: 'text' },
|
|
11
|
+
subtitle: { control: 'text' },
|
|
12
|
+
loading: { control: 'boolean' },
|
|
13
|
+
ready: { control: 'boolean' },
|
|
14
|
+
disabled: { control: 'boolean' },
|
|
15
|
+
variant: { control: 'inline-radio', options: [ 'paper', 'card' ]},
|
|
16
|
+
},
|
|
17
|
+
args: {
|
|
18
|
+
title: 'Settings',
|
|
19
|
+
subtitle: '',
|
|
20
|
+
loading: false,
|
|
21
|
+
ready: true,
|
|
22
|
+
disabled: false,
|
|
23
|
+
variant: 'paper',
|
|
24
|
+
},
|
|
25
|
+
} satisfies Meta<typeof PageCard>
|
|
26
|
+
|
|
27
|
+
export default meta
|
|
28
|
+
type Story = StoryObj<typeof meta>
|
|
29
|
+
|
|
30
|
+
export const Default: Story = {
|
|
31
|
+
render: args => ({
|
|
32
|
+
components: { PageCard, Button, WebLink },
|
|
33
|
+
setup: () => ({ args }),
|
|
34
|
+
template: `
|
|
35
|
+
<div class="space-y-10 max-w-2xl">
|
|
36
|
+
<!-- Controlled -->
|
|
37
|
+
<section>
|
|
38
|
+
<h3 class="mb-4 text-lg font-medium">Controlled</h3>
|
|
39
|
+
<PageCard v-bind="args">
|
|
40
|
+
<p>Page card content goes here.</p>
|
|
41
|
+
</PageCard>
|
|
42
|
+
</section>
|
|
43
|
+
|
|
44
|
+
<!-- With Back Button -->
|
|
45
|
+
<section>
|
|
46
|
+
<h3 class="mb-4 text-lg font-medium">With Back Button</h3>
|
|
47
|
+
<PageCard title="Edit Profile" :back="{ action: () => {} }">
|
|
48
|
+
<p>A page card with a back button in the header.</p>
|
|
49
|
+
</PageCard>
|
|
50
|
+
</section>
|
|
51
|
+
|
|
52
|
+
<!-- Back + Subtitle -->
|
|
53
|
+
<section>
|
|
54
|
+
<h3 class="mb-4 text-lg font-medium">Back + Subtitle</h3>
|
|
55
|
+
<PageCard title="Bot Details" subtitle="View and edit your bot configuration." :back="{ action: () => {} }">
|
|
56
|
+
<p>Back button combined with title and subtitle.</p>
|
|
57
|
+
</PageCard>
|
|
58
|
+
</section>
|
|
59
|
+
|
|
60
|
+
<!-- With Actions -->
|
|
61
|
+
<section>
|
|
62
|
+
<h3 class="mb-4 text-lg font-medium">With Actions</h3>
|
|
63
|
+
<PageCard title="API Keys">
|
|
64
|
+
<template #actions>
|
|
65
|
+
<Button variant="outline" size="sm">Export</Button>
|
|
66
|
+
<Button size="sm">Create</Button>
|
|
67
|
+
</template>
|
|
68
|
+
<p>Action buttons rendered on the right side of the title.</p>
|
|
69
|
+
</PageCard>
|
|
70
|
+
</section>
|
|
71
|
+
|
|
72
|
+
<!-- Actions + Subtitle + Back -->
|
|
73
|
+
<section>
|
|
74
|
+
<h3 class="mb-4 text-lg font-medium">Actions + Subtitle + Back</h3>
|
|
75
|
+
<PageCard
|
|
76
|
+
title="Developer Settings"
|
|
77
|
+
subtitle="Manage API keys and webhooks for your organization."
|
|
78
|
+
:back="{ action: () => {} }"
|
|
79
|
+
>
|
|
80
|
+
<template #actions>
|
|
81
|
+
<WebLink href="#" target="_blank" class="text-sm">Docs</WebLink>
|
|
82
|
+
<WebLink href="#" target="_blank" class="text-sm">API Reference</WebLink>
|
|
83
|
+
</template>
|
|
84
|
+
<p>Back button, title, subtitle, and trailing action slot working together.</p>
|
|
85
|
+
</PageCard>
|
|
86
|
+
</section>
|
|
87
|
+
|
|
88
|
+
<!-- Card Variant -->
|
|
89
|
+
<section>
|
|
90
|
+
<h3 class="mb-4 text-lg font-medium">Card Variant</h3>
|
|
91
|
+
<PageCard title="Profile" subtitle="Rounded corners and a visible border." variant="card">
|
|
92
|
+
<p>Use variant="card" for widget-style panels; default "paper" is edge-to-edge.</p>
|
|
93
|
+
</PageCard>
|
|
94
|
+
</section>
|
|
95
|
+
|
|
96
|
+
<!-- No Title -->
|
|
97
|
+
<section>
|
|
98
|
+
<h3 class="mb-4 text-lg font-medium">No Title</h3>
|
|
99
|
+
<PageCard>
|
|
100
|
+
<p>A page card without a title — just content.</p>
|
|
101
|
+
</PageCard>
|
|
102
|
+
</section>
|
|
103
|
+
</div>
|
|
104
|
+
`,
|
|
105
|
+
}),
|
|
106
|
+
}
|