@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,71 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import { RadioGroup } from '../../shadcn/radio-group'
|
|
3
|
+
import Radio from './index.vue'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'UI/Radio',
|
|
7
|
+
component: Radio,
|
|
8
|
+
argTypes: {
|
|
9
|
+
disabled: { control: 'boolean' },
|
|
10
|
+
},
|
|
11
|
+
args: {
|
|
12
|
+
disabled: false,
|
|
13
|
+
},
|
|
14
|
+
} satisfies Meta<typeof Radio>
|
|
15
|
+
|
|
16
|
+
export default meta
|
|
17
|
+
type Story = StoryObj<typeof meta>
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
render: args => ({
|
|
21
|
+
components: { RadioGroup, Radio },
|
|
22
|
+
setup () {
|
|
23
|
+
const selected = ref('option1')
|
|
24
|
+
const plan = ref('free')
|
|
25
|
+
return { args, selected, plan }
|
|
26
|
+
},
|
|
27
|
+
template: `
|
|
28
|
+
<div class="space-y-10">
|
|
29
|
+
<!-- Controlled -->
|
|
30
|
+
<section>
|
|
31
|
+
<h3 class="mb-4 text-lg font-medium">Controlled</h3>
|
|
32
|
+
<RadioGroup v-model="selected" :disabled="args.disabled" class="flex flex-col gap-3">
|
|
33
|
+
<label class="flex items-center gap-2 cursor-pointer">
|
|
34
|
+
<Radio value="option1" />
|
|
35
|
+
<span class="text-sm">Option 1</span>
|
|
36
|
+
</label>
|
|
37
|
+
<label class="flex items-center gap-2 cursor-pointer">
|
|
38
|
+
<Radio value="option2" />
|
|
39
|
+
<span class="text-sm">Option 2</span>
|
|
40
|
+
</label>
|
|
41
|
+
<label class="flex items-center gap-2 cursor-pointer">
|
|
42
|
+
<Radio value="option3" />
|
|
43
|
+
<span class="text-sm">Option 3</span>
|
|
44
|
+
</label>
|
|
45
|
+
</RadioGroup>
|
|
46
|
+
<div class="mt-2 text-sm text-muted-foreground">Selected: {{ selected }}</div>
|
|
47
|
+
</section>
|
|
48
|
+
|
|
49
|
+
<!-- Plan Selection -->
|
|
50
|
+
<section>
|
|
51
|
+
<h3 class="mb-4 text-lg font-medium">Plan Selection</h3>
|
|
52
|
+
<RadioGroup v-model="plan" class="flex flex-col gap-3">
|
|
53
|
+
<label class="flex items-center gap-2 cursor-pointer">
|
|
54
|
+
<Radio value="free" />
|
|
55
|
+
<span class="text-sm">Free - $0/month</span>
|
|
56
|
+
</label>
|
|
57
|
+
<label class="flex items-center gap-2 cursor-pointer">
|
|
58
|
+
<Radio value="pro" />
|
|
59
|
+
<span class="text-sm">Pro - $9/month</span>
|
|
60
|
+
</label>
|
|
61
|
+
<label class="flex items-center gap-2 cursor-pointer">
|
|
62
|
+
<Radio value="enterprise" />
|
|
63
|
+
<span class="text-sm">Enterprise - $29/month</span>
|
|
64
|
+
</label>
|
|
65
|
+
</RadioGroup>
|
|
66
|
+
<div class="mt-2 text-sm text-muted-foreground">Plan: {{ plan }}</div>
|
|
67
|
+
</section>
|
|
68
|
+
</div>
|
|
69
|
+
`,
|
|
70
|
+
}),
|
|
71
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { RadioGroupItem } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/radio-group'
|
|
3
|
+
import type { RadioProps } from './types'
|
|
4
|
+
|
|
5
|
+
defineProps<RadioProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<RadioGroupItem />
|
|
10
|
+
</template>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import type { RadioCardGroupOption } from './types'
|
|
3
|
+
import RadioCardGroup from './index.vue'
|
|
4
|
+
|
|
5
|
+
const options: RadioCardGroupOption[] = [
|
|
6
|
+
{
|
|
7
|
+
value: 'current',
|
|
8
|
+
title: 'Current view',
|
|
9
|
+
description: 'Export with the currently applied filters and date range',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
value: 'custom',
|
|
13
|
+
title: 'Custom range',
|
|
14
|
+
description: 'Specify a date range to export data for the entire period',
|
|
15
|
+
},
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
const manyOptions: RadioCardGroupOption[] = [
|
|
19
|
+
{
|
|
20
|
+
value: 'free',
|
|
21
|
+
title: 'Free',
|
|
22
|
+
description: '$0/month — For personal projects',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: 'pro',
|
|
26
|
+
title: 'Pro',
|
|
27
|
+
description: '$9/month — For small teams',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: 'enterprise',
|
|
31
|
+
title: 'Enterprise',
|
|
32
|
+
description: '$29/month — For large organizations',
|
|
33
|
+
disabled: true,
|
|
34
|
+
},
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
const meta = {
|
|
38
|
+
title: 'UI/RadioCardGroup',
|
|
39
|
+
component: RadioCardGroup,
|
|
40
|
+
argTypes: {
|
|
41
|
+
disabled: { control: 'boolean' },
|
|
42
|
+
},
|
|
43
|
+
args: {
|
|
44
|
+
options,
|
|
45
|
+
disabled: false,
|
|
46
|
+
},
|
|
47
|
+
} satisfies Meta<typeof RadioCardGroup>
|
|
48
|
+
|
|
49
|
+
export default meta
|
|
50
|
+
type Story = StoryObj<typeof meta>
|
|
51
|
+
|
|
52
|
+
export const Default: Story = {
|
|
53
|
+
render: args => ({
|
|
54
|
+
components: { RadioCardGroup },
|
|
55
|
+
setup () {
|
|
56
|
+
const selected = ref('current')
|
|
57
|
+
return { args, selected, options }
|
|
58
|
+
},
|
|
59
|
+
template: `
|
|
60
|
+
<div class="max-w-md space-y-4">
|
|
61
|
+
<RadioCardGroup
|
|
62
|
+
v-model="selected"
|
|
63
|
+
:options="options"
|
|
64
|
+
:disabled="args.disabled"
|
|
65
|
+
/>
|
|
66
|
+
<div class="text-sm text-muted-foreground">Selected: {{ selected }}</div>
|
|
67
|
+
</div>
|
|
68
|
+
`,
|
|
69
|
+
}),
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const WithDisabledOption: Story = {
|
|
73
|
+
render: args => ({
|
|
74
|
+
components: { RadioCardGroup },
|
|
75
|
+
setup () {
|
|
76
|
+
const selected = ref('pro')
|
|
77
|
+
return { args, selected, manyOptions }
|
|
78
|
+
},
|
|
79
|
+
template: `
|
|
80
|
+
<div class="max-w-md space-y-4">
|
|
81
|
+
<RadioCardGroup
|
|
82
|
+
v-model="selected"
|
|
83
|
+
:options="manyOptions"
|
|
84
|
+
:disabled="args.disabled"
|
|
85
|
+
/>
|
|
86
|
+
<div class="text-sm text-muted-foreground">Selected: {{ selected }}</div>
|
|
87
|
+
</div>
|
|
88
|
+
`,
|
|
89
|
+
}),
|
|
90
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
RadioGroup,
|
|
4
|
+
RadioGroupItem,
|
|
5
|
+
} from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/radio-group'
|
|
6
|
+
import type { RadioCardGroupProps } from './types'
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(defineProps<RadioCardGroupProps>(), {
|
|
9
|
+
modelValue: undefined,
|
|
10
|
+
disabled: false,
|
|
11
|
+
class: undefined,
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits<{
|
|
15
|
+
'update:modelValue': [value: string]
|
|
16
|
+
}>()
|
|
17
|
+
|
|
18
|
+
const model = computed({
|
|
19
|
+
get: () => props.modelValue,
|
|
20
|
+
set: value => {
|
|
21
|
+
if (value !== undefined) emit('update:modelValue', value)
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const mergedClass = computed(() => cn('gap-3', props.class))
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<RadioGroup
|
|
30
|
+
v-model="model"
|
|
31
|
+
:disabled="disabled"
|
|
32
|
+
:class="mergedClass"
|
|
33
|
+
>
|
|
34
|
+
<label
|
|
35
|
+
v-for="option in options"
|
|
36
|
+
:key="option.value"
|
|
37
|
+
class="
|
|
38
|
+
flex cursor-pointer items-center gap-3 rounded-lg border border-border
|
|
39
|
+
px-4 py-3 transition-colors
|
|
40
|
+
has-data-disabled:cursor-not-allowed has-data-disabled:opacity-50
|
|
41
|
+
has-data-[state=checked]:border-primary
|
|
42
|
+
"
|
|
43
|
+
:class="[
|
|
44
|
+
option.disabled ? 'cursor-not-allowed opacity-50' : 'hover:bg-accent/50',
|
|
45
|
+
]"
|
|
46
|
+
>
|
|
47
|
+
<RadioGroupItem
|
|
48
|
+
:value="option.value"
|
|
49
|
+
:disabled="option.disabled"
|
|
50
|
+
/>
|
|
51
|
+
<div class="grid flex-1 gap-0.5">
|
|
52
|
+
<span class="text-sm font-medium">
|
|
53
|
+
{{ option.title }}
|
|
54
|
+
</span>
|
|
55
|
+
<span
|
|
56
|
+
v-if="option.description"
|
|
57
|
+
class="text-xs text-muted-foreground"
|
|
58
|
+
>
|
|
59
|
+
{{ option.description }}
|
|
60
|
+
</span>
|
|
61
|
+
</div>
|
|
62
|
+
</label>
|
|
63
|
+
</RadioGroup>
|
|
64
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface RadioCardGroupOption {
|
|
2
|
+
value: string
|
|
3
|
+
title: string
|
|
4
|
+
description?: string
|
|
5
|
+
disabled?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface RadioCardGroupProps {
|
|
9
|
+
modelValue?: string
|
|
10
|
+
options: RadioCardGroupOption[]
|
|
11
|
+
disabled?: boolean
|
|
12
|
+
class?: ClassValue
|
|
13
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import ScrollArea from './index.vue'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'UI/ScrollArea',
|
|
6
|
+
component: ScrollArea,
|
|
7
|
+
argTypes: {
|
|
8
|
+
fadeMask: { control: 'boolean' },
|
|
9
|
+
},
|
|
10
|
+
args: {
|
|
11
|
+
fadeMask: false,
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta<typeof ScrollArea>
|
|
14
|
+
|
|
15
|
+
export default meta
|
|
16
|
+
type Story = StoryObj<typeof meta>
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
render: args => ({
|
|
20
|
+
components: { ScrollArea },
|
|
21
|
+
setup () {
|
|
22
|
+
const items = Array.from({ length: 30 }, (_, i) => `Item ${i + 1}`)
|
|
23
|
+
const fewItems = Array.from({ length: 3 }, (_, i) => `Item ${i + 1}`)
|
|
24
|
+
return { args, items, fewItems }
|
|
25
|
+
},
|
|
26
|
+
template: `
|
|
27
|
+
<div class="space-y-10">
|
|
28
|
+
<!-- Controlled -->
|
|
29
|
+
<section>
|
|
30
|
+
<h3 class="mb-4 text-lg font-medium">Controlled</h3>
|
|
31
|
+
<div class="h-[250px] w-[250px] rounded-md border bg-card">
|
|
32
|
+
<ScrollArea class="h-full" v-bind="args">
|
|
33
|
+
<div class="p-4 space-y-2">
|
|
34
|
+
<div
|
|
35
|
+
v-for="item in items"
|
|
36
|
+
:key="item"
|
|
37
|
+
class="rounded-md border bg-muted px-3 py-2 text-sm"
|
|
38
|
+
>
|
|
39
|
+
{{ item }}
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</ScrollArea>
|
|
43
|
+
</div>
|
|
44
|
+
</section>
|
|
45
|
+
|
|
46
|
+
<!-- No Overflow -->
|
|
47
|
+
<section>
|
|
48
|
+
<h3 class="mb-4 text-lg font-medium">No Overflow</h3>
|
|
49
|
+
<div class="h-[250px] w-[250px] rounded-md border bg-card">
|
|
50
|
+
<ScrollArea class="h-full" fadeMask>
|
|
51
|
+
<div class="p-4 space-y-2">
|
|
52
|
+
<div
|
|
53
|
+
v-for="item in fewItems"
|
|
54
|
+
:key="item"
|
|
55
|
+
class="rounded-md border bg-muted px-3 py-2 text-sm"
|
|
56
|
+
>
|
|
57
|
+
{{ item }}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</ScrollArea>
|
|
61
|
+
</div>
|
|
62
|
+
</section>
|
|
63
|
+
</div>
|
|
64
|
+
`,
|
|
65
|
+
}),
|
|
66
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {
|
|
3
|
+
ScrollArea as ShadcnScrollArea,
|
|
4
|
+
} from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/scroll-area'
|
|
5
|
+
import { useResizeObserver } from '@vueuse/core'
|
|
6
|
+
import type { ScrollAreaProps } from './types'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<ScrollAreaProps>()
|
|
9
|
+
|
|
10
|
+
const rootRef = ref<InstanceType<typeof ShadcnScrollArea>>()
|
|
11
|
+
const viewportEl = ref<HTMLElement>()
|
|
12
|
+
|
|
13
|
+
const { isOverflowing, atStart, atEnd } = useScrollState(viewportEl)
|
|
14
|
+
|
|
15
|
+
onMounted(() => {
|
|
16
|
+
const root = rootRef.value?.$el as HTMLElement | undefined
|
|
17
|
+
viewportEl.value = root?.querySelector<HTMLElement>('[data-slot="scroll-area-viewport"]') ?? undefined
|
|
18
|
+
|
|
19
|
+
// Observe content wrapper to detect content size changes
|
|
20
|
+
const contentEl = viewportEl.value?.firstElementChild as HTMLElement | undefined
|
|
21
|
+
if (contentEl) {
|
|
22
|
+
useResizeObserver(contentEl, () => {
|
|
23
|
+
// Trigger re-evaluation by briefly toggling the ref
|
|
24
|
+
const el = viewportEl.value
|
|
25
|
+
viewportEl.value = undefined
|
|
26
|
+
nextTick(() => {
|
|
27
|
+
viewportEl.value = el
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
// Only keep viewport in the tab order when content actually overflows;
|
|
34
|
+
// otherwise reka-ui's FocusScope auto-focus lands on an unscrollable container.
|
|
35
|
+
watchEffect(() => {
|
|
36
|
+
const el = viewportEl.value
|
|
37
|
+
if (!el) return
|
|
38
|
+
el.setAttribute('tabindex', isOverflowing.value ? '0' : '-1')
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const FADE_SIZE = '1.25rem'
|
|
42
|
+
|
|
43
|
+
const maskStyle = computed(() => {
|
|
44
|
+
if (!props.fadeMask || !isOverflowing.value) return undefined
|
|
45
|
+
if (atStart.value && atEnd.value) return undefined
|
|
46
|
+
|
|
47
|
+
if (atStart.value) {
|
|
48
|
+
return { maskImage: `linear-gradient(to bottom, #000 calc(100% - ${FADE_SIZE}), transparent 100%)` }
|
|
49
|
+
}
|
|
50
|
+
if (atEnd.value) {
|
|
51
|
+
return { maskImage: `linear-gradient(to bottom, transparent 0, #000 ${FADE_SIZE})` }
|
|
52
|
+
}
|
|
53
|
+
return { maskImage: `linear-gradient(to bottom, transparent 0, #000 ${FADE_SIZE}, #000 calc(100% - ${FADE_SIZE}), transparent 100%)` }
|
|
54
|
+
})
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<template>
|
|
58
|
+
<ShadcnScrollArea
|
|
59
|
+
ref="rootRef"
|
|
60
|
+
:style="maskStyle"
|
|
61
|
+
>
|
|
62
|
+
<slot />
|
|
63
|
+
</ShadcnScrollArea>
|
|
64
|
+
</template>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import type { SearchSelectLoadMethodParams, SearchSelectLoadMethodResult } from './types'
|
|
3
|
+
import SearchSelect from './index.vue'
|
|
4
|
+
|
|
5
|
+
// Mock data: 100 items for simulating server-side search
|
|
6
|
+
const allItems = Array.from({ length: 100 }, (_, i) => ({
|
|
7
|
+
label: `Item ${i + 1}`,
|
|
8
|
+
value: `item-${i + 1}`,
|
|
9
|
+
}))
|
|
10
|
+
|
|
11
|
+
// Simulate async API call with keyword filter and pagination
|
|
12
|
+
function mockLoadMethod (params: SearchSelectLoadMethodParams): Promise<SearchSelectLoadMethodResult<string>> {
|
|
13
|
+
return new Promise(resolve => {
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
const filtered = allItems.filter(item =>
|
|
16
|
+
item.label.toLowerCase().includes(params.keyword.toLowerCase()),
|
|
17
|
+
)
|
|
18
|
+
const items = filtered.slice(params.offset, params.offset + params.limit)
|
|
19
|
+
resolve({ items, total: filtered.length })
|
|
20
|
+
}, 500)
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Simulate fetching a single item by value
|
|
25
|
+
function mockLoadValueOptionMethod (value: string) {
|
|
26
|
+
return new Promise<{ label: string, value: string } | null>(resolve => {
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
const item = allItems.find(i => i.value === value)
|
|
29
|
+
resolve(item ?? null)
|
|
30
|
+
}, 200)
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const meta = {
|
|
35
|
+
title: 'UI/SearchSelect',
|
|
36
|
+
component: SearchSelect as any,
|
|
37
|
+
argTypes: {
|
|
38
|
+
autoLoad: { control: 'boolean' },
|
|
39
|
+
disabled: { control: 'boolean' },
|
|
40
|
+
},
|
|
41
|
+
args: {
|
|
42
|
+
autoLoad: false,
|
|
43
|
+
disabled: false,
|
|
44
|
+
},
|
|
45
|
+
} satisfies Meta
|
|
46
|
+
|
|
47
|
+
export default meta
|
|
48
|
+
type Story = StoryObj<typeof meta>
|
|
49
|
+
|
|
50
|
+
export const Default: Story = {
|
|
51
|
+
render: args => ({
|
|
52
|
+
components: { SearchSelect },
|
|
53
|
+
setup () {
|
|
54
|
+
const selected = ref<string>()
|
|
55
|
+
const withPreselect = ref<string>('item-42')
|
|
56
|
+
const withDefaults = ref<string>()
|
|
57
|
+
const withCreateNew = ref<string>()
|
|
58
|
+
|
|
59
|
+
const defaultOptions = [
|
|
60
|
+
{ label: 'All Items', value: 'all' },
|
|
61
|
+
{ label: 'Featured', value: 'featured' },
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
args,
|
|
66
|
+
selected,
|
|
67
|
+
withPreselect,
|
|
68
|
+
withDefaults,
|
|
69
|
+
withCreateNew,
|
|
70
|
+
defaultOptions,
|
|
71
|
+
mockLoadMethod,
|
|
72
|
+
mockLoadValueOptionMethod,
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
template: `
|
|
76
|
+
<div class="space-y-10 max-w-sm">
|
|
77
|
+
<!-- Controlled -->
|
|
78
|
+
<section>
|
|
79
|
+
<h3 class="mb-4 text-lg font-medium">Controlled</h3>
|
|
80
|
+
<SearchSelect
|
|
81
|
+
v-model="selected"
|
|
82
|
+
:loadMethod="mockLoadMethod"
|
|
83
|
+
v-bind="args"
|
|
84
|
+
/>
|
|
85
|
+
<div class="mt-2 text-sm text-muted-foreground">Selected: {{ selected ?? 'none' }}</div>
|
|
86
|
+
</section>
|
|
87
|
+
|
|
88
|
+
<!-- Pre-selected Value -->
|
|
89
|
+
<section>
|
|
90
|
+
<h3 class="mb-4 text-lg font-medium">Pre-selected Value (item-42)</h3>
|
|
91
|
+
<SearchSelect
|
|
92
|
+
v-model="withPreselect"
|
|
93
|
+
:loadMethod="mockLoadMethod"
|
|
94
|
+
:loadValueOptionMethod="mockLoadValueOptionMethod"
|
|
95
|
+
autoLoad
|
|
96
|
+
/>
|
|
97
|
+
<div class="mt-2 text-sm text-muted-foreground">Selected: {{ withPreselect ?? 'none' }}</div>
|
|
98
|
+
</section>
|
|
99
|
+
|
|
100
|
+
<!-- With Default Options -->
|
|
101
|
+
<section>
|
|
102
|
+
<h3 class="mb-4 text-lg font-medium">With Default Options</h3>
|
|
103
|
+
<SearchSelect
|
|
104
|
+
v-model="withDefaults"
|
|
105
|
+
:loadMethod="mockLoadMethod"
|
|
106
|
+
:defaultOptions="defaultOptions"
|
|
107
|
+
autoLoad
|
|
108
|
+
/>
|
|
109
|
+
<div class="mt-2 text-sm text-muted-foreground">Selected: {{ withDefaults ?? 'none' }}</div>
|
|
110
|
+
</section>
|
|
111
|
+
|
|
112
|
+
<!-- With Create New -->
|
|
113
|
+
<section>
|
|
114
|
+
<h3 class="mb-4 text-lg font-medium">With Create New</h3>
|
|
115
|
+
<SearchSelect
|
|
116
|
+
v-model="withCreateNew"
|
|
117
|
+
:loadMethod="mockLoadMethod"
|
|
118
|
+
createNewTo="/create"
|
|
119
|
+
autoLoad
|
|
120
|
+
/>
|
|
121
|
+
<div class="mt-2 text-sm text-muted-foreground">Selected: {{ withCreateNew ?? 'none' }}</div>
|
|
122
|
+
</section>
|
|
123
|
+
</div>
|
|
124
|
+
`,
|
|
125
|
+
}),
|
|
126
|
+
}
|