@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,127 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Locale } from 'date-fns'
|
|
3
|
+
import type { DatePickerProps } from './types'
|
|
4
|
+
import { VueDatePicker } from '@vuepic/vue-datepicker'
|
|
5
|
+
import { enUS } from 'date-fns/locale/en-US'
|
|
6
|
+
import { ja } from 'date-fns/locale/ja'
|
|
7
|
+
import '@vuepic/vue-datepicker/dist/main.css'
|
|
8
|
+
import './style.css'
|
|
9
|
+
|
|
10
|
+
const dateFnsLocaleMap: Record<string, Locale> = {
|
|
11
|
+
ja,
|
|
12
|
+
en: enUS,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
defineOptions({ inheritAttrs: false })
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(defineProps<DatePickerProps>(), {
|
|
18
|
+
modelValue: undefined,
|
|
19
|
+
type: 'date',
|
|
20
|
+
showTime: false,
|
|
21
|
+
disabled: false,
|
|
22
|
+
readonly: false,
|
|
23
|
+
placeholder: undefined,
|
|
24
|
+
minDate: undefined,
|
|
25
|
+
maxDate: undefined,
|
|
26
|
+
valueFormat: undefined,
|
|
27
|
+
autoApply: true,
|
|
28
|
+
class: undefined,
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const emit = defineEmits<{
|
|
32
|
+
'update:modelValue': [value: Date | string | null]
|
|
33
|
+
}>()
|
|
34
|
+
|
|
35
|
+
const model = computed({
|
|
36
|
+
get: () => props.modelValue,
|
|
37
|
+
set: value => emit('update:modelValue', value ?? null),
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const T = useTranslations('components.ui.DatePicker')
|
|
41
|
+
|
|
42
|
+
const { locale: i18nLocale } = useI18n()
|
|
43
|
+
const dateFnsLocale = computed(() => dateFnsLocaleMap[i18nLocale.value] ?? ja)
|
|
44
|
+
|
|
45
|
+
const hasTime = computed(() => !!props.showTime)
|
|
46
|
+
|
|
47
|
+
const formatKey = computed(() => {
|
|
48
|
+
if (props.type === 'year') return 'year'
|
|
49
|
+
if (props.type === 'month') return 'month'
|
|
50
|
+
if (hasTime.value) return 'dateTime'
|
|
51
|
+
return 'date'
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const defaultFormat = computed(() => T(`format.${formatKey.value}`))
|
|
55
|
+
|
|
56
|
+
const timeConfig = computed(() => {
|
|
57
|
+
if (typeof props.showTime === 'object') {
|
|
58
|
+
return { enableTimePicker: true, ...props.showTime }
|
|
59
|
+
}
|
|
60
|
+
return { enableTimePicker: props.showTime }
|
|
61
|
+
})
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<VueDatePicker
|
|
66
|
+
v-model="model"
|
|
67
|
+
v-bind="$attrs"
|
|
68
|
+
:class="props.class"
|
|
69
|
+
:locale="dateFnsLocale"
|
|
70
|
+
:timeConfig="timeConfig"
|
|
71
|
+
:disabled="disabled"
|
|
72
|
+
:readonly="readonly"
|
|
73
|
+
:placeholder="placeholder"
|
|
74
|
+
:minDate="minDate"
|
|
75
|
+
:maxDate="maxDate"
|
|
76
|
+
:formats="{ input: defaultFormat }"
|
|
77
|
+
:modelType="valueFormat"
|
|
78
|
+
:monthPicker="type === 'month'"
|
|
79
|
+
:yearPicker="type === 'year'"
|
|
80
|
+
:autoApply="autoApply"
|
|
81
|
+
:inputAttrs="{ clearable: false }"
|
|
82
|
+
textInput
|
|
83
|
+
>
|
|
84
|
+
<template #dp-input="{ value, onInput, onEnter, onTab, onClear, onBlur, onFocus, openMenu }">
|
|
85
|
+
<div @click.stop>
|
|
86
|
+
<Input
|
|
87
|
+
:modelValue="value"
|
|
88
|
+
:placeholder="placeholder ?? T('placeholder')"
|
|
89
|
+
:disabled="disabled"
|
|
90
|
+
:readonly="readonly"
|
|
91
|
+
@update:modelValue="(v: string | undefined) => onInput(v ?? '')"
|
|
92
|
+
@keydown.enter="onEnter"
|
|
93
|
+
@keydown.tab="onTab"
|
|
94
|
+
@change="(v: string | undefined) => { if (!v) onClear() }"
|
|
95
|
+
@blur="onBlur"
|
|
96
|
+
@focus="() => { onFocus(); openMenu() }"
|
|
97
|
+
>
|
|
98
|
+
<template #prefix>
|
|
99
|
+
<Icon
|
|
100
|
+
name="calendar-days"
|
|
101
|
+
class="cursor-pointer text-muted-foreground"
|
|
102
|
+
@click="openMenu"
|
|
103
|
+
/>
|
|
104
|
+
</template>
|
|
105
|
+
</Input>
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
108
|
+
<template #arrow-left>
|
|
109
|
+
<Icon name="chevron-left" />
|
|
110
|
+
</template>
|
|
111
|
+
<template #arrow-right>
|
|
112
|
+
<Icon name="chevron-right" />
|
|
113
|
+
</template>
|
|
114
|
+
<template #arrow-up>
|
|
115
|
+
<Icon name="chevron-up" />
|
|
116
|
+
</template>
|
|
117
|
+
<template #arrow-down>
|
|
118
|
+
<Icon name="chevron-down" />
|
|
119
|
+
</template>
|
|
120
|
+
<template #calendar-icon>
|
|
121
|
+
<Icon name="calendar-days" />
|
|
122
|
+
</template>
|
|
123
|
+
<template #clock-icon>
|
|
124
|
+
<Icon name="clock" />
|
|
125
|
+
</template>
|
|
126
|
+
</VueDatePicker>
|
|
127
|
+
</template>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @vuepic/vue-datepicker theme override
|
|
3
|
+
* Maps dp__* CSS variables to shadcn color tokens (oklch)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* ==========================================
|
|
7
|
+
* CSS Variable Overrides
|
|
8
|
+
* ========================================== */
|
|
9
|
+
|
|
10
|
+
/* Color variables (shared light & dark) */
|
|
11
|
+
.dp__theme_light,
|
|
12
|
+
.dp__theme_dark {
|
|
13
|
+
--dp-background-color: var(--color-popover);
|
|
14
|
+
--dp-text-color: var(--color-popover-foreground);
|
|
15
|
+
--dp-icon-color: var(--color-muted-foreground);
|
|
16
|
+
--dp-tooltip-color: var(--color-popover);
|
|
17
|
+
--dp-primary-color: var(--color-primary);
|
|
18
|
+
--dp-primary-text-color: var(--color-primary-foreground);
|
|
19
|
+
--dp-primary-disabled-color: var(--color-muted-foreground);
|
|
20
|
+
--dp-hover-color: var(--color-accent);
|
|
21
|
+
--dp-hover-text-color: var(--color-accent-foreground);
|
|
22
|
+
--dp-hover-icon-color: var(--color-foreground);
|
|
23
|
+
--dp-border-color: var(--color-border);
|
|
24
|
+
--dp-menu-border-color: var(--color-border);
|
|
25
|
+
--dp-border-color-hover: var(--color-ring);
|
|
26
|
+
--dp-border-color-focus: var(--color-ring);
|
|
27
|
+
--dp-secondary-color: var(--color-muted-foreground);
|
|
28
|
+
--dp-disabled-color: var(--color-muted);
|
|
29
|
+
--dp-disabled-color-text: var(--color-muted-foreground);
|
|
30
|
+
--dp-scroll-bar-background: var(--color-muted);
|
|
31
|
+
--dp-scroll-bar-color: var(--color-muted-foreground);
|
|
32
|
+
--dp-success-color: var(--color-success);
|
|
33
|
+
--dp-success-color-disabled: var(--color-muted-foreground);
|
|
34
|
+
--dp-danger-color: var(--color-danger);
|
|
35
|
+
--dp-marker-color: var(--color-danger);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Theme-specific color overrides */
|
|
39
|
+
.dp__theme_light {
|
|
40
|
+
--dp-highlight-color: oklch(from var(--color-primary) l c h / 10%);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.dp__theme_dark {
|
|
44
|
+
--dp-highlight-color: oklch(from var(--color-primary) l c h / 20%);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Shape, sizing, spacing, font */
|
|
48
|
+
.dp__main {
|
|
49
|
+
--dp-border-radius: var(--radius-md);
|
|
50
|
+
--dp-cell-border-radius: var(--radius-md);
|
|
51
|
+
--dp-cell-size: 28px;
|
|
52
|
+
--dp-button-height: 28px;
|
|
53
|
+
--dp-month-year-row-height: 28px;
|
|
54
|
+
--dp-common-padding: 4px;
|
|
55
|
+
--dp-overlay-col-padding: 4px;
|
|
56
|
+
--dp-font-family: inherit;
|
|
57
|
+
--dp-font-size: 0.875rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* ==========================================
|
|
61
|
+
* Style Overrides (align with shadcn)
|
|
62
|
+
* ========================================== */
|
|
63
|
+
|
|
64
|
+
/* Overlay bottom button (back to calendar / toggle time) */
|
|
65
|
+
.dp__button,
|
|
66
|
+
.dp__action_row,
|
|
67
|
+
.dp__arrow_bottom {
|
|
68
|
+
background-color: var(--color-background);
|
|
69
|
+
color: var(--color-foreground);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Calendar cell: center within grid item */
|
|
73
|
+
.dp__cell_inner {
|
|
74
|
+
margin: 0 auto;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Calendar grid: uniform gap between cells */
|
|
78
|
+
.dp__calendar_row {
|
|
79
|
+
gap: 4px;
|
|
80
|
+
margin: 4px 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Menu: shadow-md */
|
|
84
|
+
.dp__menu {
|
|
85
|
+
box-shadow:
|
|
86
|
+
0 4px 6px -1px rgb(0 0 0 / 0.1),
|
|
87
|
+
0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
88
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface DatePickerTimeConfig {
|
|
2
|
+
enableSeconds?: boolean
|
|
3
|
+
enableMinutes?: boolean
|
|
4
|
+
is24?: boolean
|
|
5
|
+
noHoursOverlay?: boolean
|
|
6
|
+
noMinutesOverlay?: boolean
|
|
7
|
+
noSecondsOverlay?: boolean
|
|
8
|
+
hoursIncrement?: number | string
|
|
9
|
+
minutesIncrement?: number | string
|
|
10
|
+
secondsIncrement?: number | string
|
|
11
|
+
hoursGridIncrement?: number | string
|
|
12
|
+
minutesGridIncrement?: number | string
|
|
13
|
+
secondsGridIncrement?: number | string
|
|
14
|
+
timePickerInline?: boolean
|
|
15
|
+
startTime?: { hours: number, minutes: number, seconds?: number }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type DatePickerType = 'date' | 'month' | 'year'
|
|
19
|
+
|
|
20
|
+
export interface DatePickerProps {
|
|
21
|
+
modelValue?: Date | string | null
|
|
22
|
+
/** Picker type: date (default), month, or year */
|
|
23
|
+
type?: DatePickerType
|
|
24
|
+
/** Enable time selection, or pass DatePickerTimeConfig for fine-grained control */
|
|
25
|
+
showTime?: boolean | DatePickerTimeConfig
|
|
26
|
+
/** Disable the date picker */
|
|
27
|
+
disabled?: boolean
|
|
28
|
+
/** Readonly mode */
|
|
29
|
+
readonly?: boolean
|
|
30
|
+
/** Placeholder text */
|
|
31
|
+
placeholder?: string
|
|
32
|
+
/** Minimum selectable date */
|
|
33
|
+
minDate?: Date | string
|
|
34
|
+
/** Maximum selectable date */
|
|
35
|
+
maxDate?: Date | string
|
|
36
|
+
/** v-model output format (e.g. 'yyyy-MM-dd', 'timestamp', 'iso') */
|
|
37
|
+
valueFormat?: string
|
|
38
|
+
/** Auto apply selection without confirm button */
|
|
39
|
+
autoApply?: boolean
|
|
40
|
+
class?: ClassValue
|
|
41
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import DateRangePicker from './index.vue'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'UI/DateRangePicker',
|
|
6
|
+
component: DateRangePicker,
|
|
7
|
+
argTypes: {
|
|
8
|
+
showTime: { control: 'boolean' },
|
|
9
|
+
disabled: { control: 'boolean' },
|
|
10
|
+
maxSpanDays: { control: 'number' },
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
showTime: false,
|
|
14
|
+
disabled: false,
|
|
15
|
+
maxSpanDays: undefined,
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof DateRangePicker>
|
|
18
|
+
|
|
19
|
+
export default meta
|
|
20
|
+
type Story = StoryObj<typeof meta>
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {
|
|
23
|
+
render: args => ({
|
|
24
|
+
components: { DateRangePicker },
|
|
25
|
+
setup () {
|
|
26
|
+
const range = ref({ start: null, end: null })
|
|
27
|
+
const withTime = ref({ start: null, end: null })
|
|
28
|
+
const maxSpan = ref({ start: null, end: null })
|
|
29
|
+
const preselected = ref({
|
|
30
|
+
start: new Date(2025, 5, 1),
|
|
31
|
+
end: new Date(2025, 5, 15),
|
|
32
|
+
})
|
|
33
|
+
return { args, range, withTime, maxSpan, preselected }
|
|
34
|
+
},
|
|
35
|
+
template: `
|
|
36
|
+
<div class="max-w-lg space-y-10">
|
|
37
|
+
<!-- Controlled -->
|
|
38
|
+
<section>
|
|
39
|
+
<h3 class="mb-4 text-lg font-medium">Controlled</h3>
|
|
40
|
+
<DateRangePicker v-model="range" v-bind="args" />
|
|
41
|
+
<div class="mt-2 text-sm text-muted-foreground">Value: {{ range }}</div>
|
|
42
|
+
</section>
|
|
43
|
+
|
|
44
|
+
<!-- With Time -->
|
|
45
|
+
<section>
|
|
46
|
+
<h3 class="mb-4 text-lg font-medium">With Time</h3>
|
|
47
|
+
<DateRangePicker v-model="withTime" showTime />
|
|
48
|
+
<div class="mt-2 text-sm text-muted-foreground">Value: {{ withTime }}</div>
|
|
49
|
+
</section>
|
|
50
|
+
|
|
51
|
+
<!-- Max Span (7 days) -->
|
|
52
|
+
<section>
|
|
53
|
+
<h3 class="mb-4 text-lg font-medium">Max Span (7 days)</h3>
|
|
54
|
+
<DateRangePicker v-model="maxSpan" :maxSpanDays="7" />
|
|
55
|
+
<div class="mt-2 text-sm text-muted-foreground">Value: {{ maxSpan }}</div>
|
|
56
|
+
</section>
|
|
57
|
+
|
|
58
|
+
<!-- Preselected -->
|
|
59
|
+
<section>
|
|
60
|
+
<h3 class="mb-4 text-lg font-medium">Preselected</h3>
|
|
61
|
+
<DateRangePicker v-model="preselected" />
|
|
62
|
+
<div class="mt-2 text-sm text-muted-foreground">Value: {{ preselected }}</div>
|
|
63
|
+
</section>
|
|
64
|
+
</div>
|
|
65
|
+
`,
|
|
66
|
+
}),
|
|
67
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DateRangePickerProps, DateRangePickerValue } from './types'
|
|
3
|
+
|
|
4
|
+
defineOptions({ inheritAttrs: false })
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<DateRangePickerProps>(), {
|
|
7
|
+
modelValue: () => ({ start: null, end: null }),
|
|
8
|
+
showTime: false,
|
|
9
|
+
disabled: false,
|
|
10
|
+
readonly: false,
|
|
11
|
+
startPlaceholder: undefined,
|
|
12
|
+
endPlaceholder: undefined,
|
|
13
|
+
minDate: undefined,
|
|
14
|
+
maxDate: undefined,
|
|
15
|
+
maxSpanDays: undefined,
|
|
16
|
+
valueFormat: undefined,
|
|
17
|
+
autoApply: true,
|
|
18
|
+
class: undefined,
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const emit = defineEmits<{
|
|
22
|
+
'update:modelValue': [value: DateRangePickerValue]
|
|
23
|
+
}>()
|
|
24
|
+
|
|
25
|
+
const T = useTranslations('components.ui.DateRangePicker')
|
|
26
|
+
|
|
27
|
+
const startDate = ref<Date | string | null>(props.modelValue?.start ?? null)
|
|
28
|
+
const endDate = ref<Date | string | null>(props.modelValue?.end ?? null)
|
|
29
|
+
|
|
30
|
+
watch(() => props.modelValue, val => {
|
|
31
|
+
startDate.value = val?.start ?? null
|
|
32
|
+
endDate.value = val?.end ?? null
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
function emitRange () {
|
|
36
|
+
emit('update:modelValue', {
|
|
37
|
+
start: startDate.value,
|
|
38
|
+
end: endDate.value,
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function handleStartUpdate (value: Date | string | null) {
|
|
43
|
+
startDate.value = value
|
|
44
|
+
emitRange()
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function handleEndUpdate (value: Date | string | null) {
|
|
48
|
+
// If time is disabled, set end time to end of day
|
|
49
|
+
if (value instanceof Date && !props.showTime) {
|
|
50
|
+
const adjusted = new Date(value)
|
|
51
|
+
adjusted.setHours(23, 59, 59, 999)
|
|
52
|
+
endDate.value = adjusted
|
|
53
|
+
} else {
|
|
54
|
+
endDate.value = value
|
|
55
|
+
}
|
|
56
|
+
emitRange()
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Helper functions for date constraints
|
|
60
|
+
function addDays (date: Date, days: number): Date {
|
|
61
|
+
const result = new Date(date)
|
|
62
|
+
result.setDate(result.getDate() + days)
|
|
63
|
+
return result
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function toDate (value: Date | string | null): Date | undefined {
|
|
67
|
+
if (!value) return undefined
|
|
68
|
+
return value instanceof Date ? value : new Date(value)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Start picker constraints
|
|
72
|
+
const startMinDate = computed(() => {
|
|
73
|
+
const min = props.minDate
|
|
74
|
+
const spanLimit = props.maxSpanDays && endDate.value
|
|
75
|
+
? addDays(toDate(endDate.value)!, -(props.maxSpanDays - 1))
|
|
76
|
+
: undefined
|
|
77
|
+
if (min && spanLimit) return new Date(Math.max(+new Date(min), +spanLimit))
|
|
78
|
+
return min ?? spanLimit
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const startMaxDate = computed(() => {
|
|
82
|
+
const end = toDate(endDate.value)
|
|
83
|
+
const max = props.maxDate
|
|
84
|
+
if (end && max) return new Date(Math.min(+end, +new Date(max)))
|
|
85
|
+
return end ?? max
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
// End picker constraints
|
|
89
|
+
const endMinDate = computed(() => {
|
|
90
|
+
const start = toDate(startDate.value)
|
|
91
|
+
const min = props.minDate
|
|
92
|
+
if (start && min) return new Date(Math.max(+start, +new Date(min)))
|
|
93
|
+
return start ?? min
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
const endMaxDate = computed(() => {
|
|
97
|
+
const max = props.maxDate
|
|
98
|
+
const spanLimit = props.maxSpanDays && startDate.value
|
|
99
|
+
? addDays(toDate(startDate.value)!, props.maxSpanDays - 1)
|
|
100
|
+
: undefined
|
|
101
|
+
if (max && spanLimit) return new Date(Math.min(+new Date(max), +spanLimit))
|
|
102
|
+
return max ?? spanLimit
|
|
103
|
+
})
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<template>
|
|
107
|
+
<div :class="cn('flex items-center gap-2', props.class)">
|
|
108
|
+
<DatePicker
|
|
109
|
+
:modelValue="startDate"
|
|
110
|
+
:showTime="showTime"
|
|
111
|
+
:disabled="disabled"
|
|
112
|
+
:readonly="readonly"
|
|
113
|
+
:placeholder="startPlaceholder ?? T('startPlaceholder')"
|
|
114
|
+
:minDate="startMinDate"
|
|
115
|
+
:maxDate="startMaxDate"
|
|
116
|
+
:valueFormat="valueFormat"
|
|
117
|
+
:autoApply="autoApply"
|
|
118
|
+
v-bind="$attrs"
|
|
119
|
+
@update:modelValue="handleStartUpdate"
|
|
120
|
+
/>
|
|
121
|
+
<span class="shrink-0 text-muted-foreground">
|
|
122
|
+
{{ T('to') }}
|
|
123
|
+
</span>
|
|
124
|
+
<DatePicker
|
|
125
|
+
:modelValue="endDate"
|
|
126
|
+
:showTime="showTime"
|
|
127
|
+
:disabled="disabled"
|
|
128
|
+
:readonly="readonly"
|
|
129
|
+
:placeholder="endPlaceholder ?? T('endPlaceholder')"
|
|
130
|
+
:minDate="endMinDate"
|
|
131
|
+
:maxDate="endMaxDate"
|
|
132
|
+
:valueFormat="valueFormat"
|
|
133
|
+
:autoApply="autoApply"
|
|
134
|
+
v-bind="$attrs"
|
|
135
|
+
@update:modelValue="handleEndUpdate"
|
|
136
|
+
/>
|
|
137
|
+
</div>
|
|
138
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { DatePickerTimeConfig } from '../DatePicker/types'
|
|
2
|
+
|
|
3
|
+
export interface DateRangePickerValue {
|
|
4
|
+
start: Date | string | null
|
|
5
|
+
end: Date | string | null
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface DateRangePickerProps {
|
|
9
|
+
modelValue?: DateRangePickerValue
|
|
10
|
+
/** Enable time selection, or pass DatePickerTimeConfig for fine-grained control */
|
|
11
|
+
showTime?: boolean | DatePickerTimeConfig
|
|
12
|
+
/** Disable the date range picker */
|
|
13
|
+
disabled?: boolean
|
|
14
|
+
/** Readonly mode */
|
|
15
|
+
readonly?: boolean
|
|
16
|
+
/** Placeholder for start date input */
|
|
17
|
+
startPlaceholder?: string
|
|
18
|
+
/** Placeholder for end date input */
|
|
19
|
+
endPlaceholder?: string
|
|
20
|
+
/** Minimum selectable date */
|
|
21
|
+
minDate?: Date | string
|
|
22
|
+
/** Maximum selectable date */
|
|
23
|
+
maxDate?: Date | string
|
|
24
|
+
/** Maximum span in days between start and end date */
|
|
25
|
+
maxSpanDays?: number
|
|
26
|
+
/** v-model output format (e.g. 'yyyy-MM-dd', 'timestamp', 'iso') */
|
|
27
|
+
valueFormat?: string
|
|
28
|
+
/** Auto apply selection without confirm button */
|
|
29
|
+
autoApply?: boolean
|
|
30
|
+
class?: ClassValue
|
|
31
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import Divider from './index.vue'
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'UI/Divider',
|
|
6
|
+
component: Divider,
|
|
7
|
+
} satisfies Meta<typeof Divider>
|
|
8
|
+
|
|
9
|
+
export default meta
|
|
10
|
+
type Story = StoryObj<typeof meta>
|
|
11
|
+
|
|
12
|
+
export const Default: Story = {
|
|
13
|
+
render: args => ({
|
|
14
|
+
components: { Divider },
|
|
15
|
+
setup: () => ({ args }),
|
|
16
|
+
template: `
|
|
17
|
+
<div class="space-y-10">
|
|
18
|
+
<!-- Horizontal -->
|
|
19
|
+
<section>
|
|
20
|
+
<h3 class="mb-4 text-lg font-medium">Horizontal</h3>
|
|
21
|
+
<div class="space-y-4">
|
|
22
|
+
<p>Content above</p>
|
|
23
|
+
<Divider />
|
|
24
|
+
<p>Content below</p>
|
|
25
|
+
</div>
|
|
26
|
+
</section>
|
|
27
|
+
|
|
28
|
+
<!-- Vertical -->
|
|
29
|
+
<section>
|
|
30
|
+
<h3 class="mb-4 text-lg font-medium">Vertical</h3>
|
|
31
|
+
<div class="flex h-8 items-center gap-4">
|
|
32
|
+
<span>Left</span>
|
|
33
|
+
<Divider type="vertical" />
|
|
34
|
+
<span>Center</span>
|
|
35
|
+
<Divider type="vertical" />
|
|
36
|
+
<span>Right</span>
|
|
37
|
+
</div>
|
|
38
|
+
</section>
|
|
39
|
+
</div>
|
|
40
|
+
`,
|
|
41
|
+
}),
|
|
42
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Separator } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/separator'
|
|
3
|
+
import type { DividerProps } from './types'
|
|
4
|
+
|
|
5
|
+
withDefaults(defineProps<DividerProps>(), {
|
|
6
|
+
type: 'horizontal',
|
|
7
|
+
})
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<Separator
|
|
12
|
+
:orientation="type"
|
|
13
|
+
>
|
|
14
|
+
<slot />
|
|
15
|
+
</Separator>
|
|
16
|
+
</template>
|
|
@@ -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 Drawer from './index.vue'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'UI/Drawer',
|
|
8
|
+
component: Drawer,
|
|
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
|
+
side: {
|
|
18
|
+
control: 'select',
|
|
19
|
+
options: [ 'top', 'right', 'bottom', 'left' ],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
args: {
|
|
23
|
+
loading: false,
|
|
24
|
+
disabled: false,
|
|
25
|
+
confirmDisabled: false,
|
|
26
|
+
showCancel: false,
|
|
27
|
+
showClose: true,
|
|
28
|
+
hideHeader: false,
|
|
29
|
+
hideFooter: false,
|
|
30
|
+
side: 'right',
|
|
31
|
+
},
|
|
32
|
+
} satisfies Meta
|
|
33
|
+
|
|
34
|
+
export default meta
|
|
35
|
+
type Story = StoryObj<typeof meta>
|
|
36
|
+
|
|
37
|
+
export const Default: Story = {
|
|
38
|
+
render: args => ({
|
|
39
|
+
components: { Drawer, Button, Input },
|
|
40
|
+
setup () {
|
|
41
|
+
const controlled = ref(false)
|
|
42
|
+
const withDescription = ref(false)
|
|
43
|
+
const sideTop = ref(false)
|
|
44
|
+
const sideRight = ref(false)
|
|
45
|
+
const sideBottom = ref(false)
|
|
46
|
+
const sideLeft = ref(false)
|
|
47
|
+
const scrollable = ref(false)
|
|
48
|
+
return { args, controlled, withDescription, sideTop, sideRight, sideBottom, sideLeft, scrollable }
|
|
49
|
+
},
|
|
50
|
+
template: `
|
|
51
|
+
<div class="space-y-10">
|
|
52
|
+
<!-- Controlled -->
|
|
53
|
+
<section>
|
|
54
|
+
<h3 class="mb-4 text-lg font-medium">Controlled</h3>
|
|
55
|
+
<Button @click="controlled = true">Open Drawer</Button>
|
|
56
|
+
<Drawer
|
|
57
|
+
v-model:visible="controlled"
|
|
58
|
+
v-bind="args"
|
|
59
|
+
title="Drawer Title"
|
|
60
|
+
confirmText="OK"
|
|
61
|
+
cancelText="Cancel"
|
|
62
|
+
>
|
|
63
|
+
<p>This is the drawer content.</p>
|
|
64
|
+
<Input class="mt-4" placeholder="Try interacting with this input" />
|
|
65
|
+
</Drawer>
|
|
66
|
+
</section>
|
|
67
|
+
|
|
68
|
+
<!-- With Description -->
|
|
69
|
+
<section>
|
|
70
|
+
<h3 class="mb-4 text-lg font-medium">With Description</h3>
|
|
71
|
+
<Button @click="withDescription = true">Open Drawer</Button>
|
|
72
|
+
<Drawer
|
|
73
|
+
v-model:visible="withDescription"
|
|
74
|
+
title="Edit Profile"
|
|
75
|
+
description="Update your personal information. Changes will be visible to other users immediately."
|
|
76
|
+
showCancel
|
|
77
|
+
confirmText="Save"
|
|
78
|
+
>
|
|
79
|
+
<div class="space-y-3">
|
|
80
|
+
<Input placeholder="Name" />
|
|
81
|
+
<Input placeholder="Email" />
|
|
82
|
+
</div>
|
|
83
|
+
</Drawer>
|
|
84
|
+
</section>
|
|
85
|
+
|
|
86
|
+
<!-- Scrollable Content -->
|
|
87
|
+
<section>
|
|
88
|
+
<h3 class="mb-4 text-lg font-medium">Scrollable Content</h3>
|
|
89
|
+
<Button @click="scrollable = true">Open Drawer</Button>
|
|
90
|
+
<Drawer v-model:visible="scrollable" title="Terms of Service" showCancel confirmText="Accept">
|
|
91
|
+
<div class="space-y-4">
|
|
92
|
+
<p v-for="i in 20" :key="i">
|
|
93
|
+
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.
|
|
94
|
+
</p>
|
|
95
|
+
</div>
|
|
96
|
+
</Drawer>
|
|
97
|
+
</section>
|
|
98
|
+
|
|
99
|
+
<!-- Side Variants -->
|
|
100
|
+
<section>
|
|
101
|
+
<h3 class="mb-4 text-lg font-medium">Side</h3>
|
|
102
|
+
<div class="flex gap-2">
|
|
103
|
+
<Button variant="outline" @click="sideTop = true">Top</Button>
|
|
104
|
+
<Button variant="outline" @click="sideRight = true">Right</Button>
|
|
105
|
+
<Button variant="outline" @click="sideBottom = true">Bottom</Button>
|
|
106
|
+
<Button variant="outline" @click="sideLeft = true">Left</Button>
|
|
107
|
+
</div>
|
|
108
|
+
<Drawer v-model:visible="sideTop" side="top" title="Top Drawer">
|
|
109
|
+
<p>Slides in from the top.</p>
|
|
110
|
+
</Drawer>
|
|
111
|
+
<Drawer v-model:visible="sideRight" side="right" title="Right Drawer">
|
|
112
|
+
<p>Slides in from the right.</p>
|
|
113
|
+
</Drawer>
|
|
114
|
+
<Drawer v-model:visible="sideBottom" side="bottom" title="Bottom Drawer">
|
|
115
|
+
<p>Slides in from the bottom.</p>
|
|
116
|
+
</Drawer>
|
|
117
|
+
<Drawer v-model:visible="sideLeft" side="left" title="Left Drawer">
|
|
118
|
+
<p>Slides in from the left.</p>
|
|
119
|
+
</Drawer>
|
|
120
|
+
</section>
|
|
121
|
+
</div>
|
|
122
|
+
`,
|
|
123
|
+
}),
|
|
124
|
+
}
|