@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.
Files changed (408) hide show
  1. package/app/assets/styles/animate.css +71 -0
  2. package/app/assets/styles/colors.css +116 -0
  3. package/app/assets/styles/globals.css +43 -0
  4. package/app/assets/styles/index.stories.ts +211 -0
  5. package/app/assets/styles/transition.css +34 -0
  6. package/app/assets/styles/utilities.css +26 -0
  7. package/app/components/shadcn/accordion/Accordion.vue +18 -0
  8. package/app/components/shadcn/accordion/AccordionContent.vue +23 -0
  9. package/app/components/shadcn/accordion/AccordionItem.vue +24 -0
  10. package/app/components/shadcn/accordion/AccordionTrigger.vue +37 -0
  11. package/app/components/shadcn/accordion/index.ts +4 -0
  12. package/app/components/shadcn/alert/Alert.vue +21 -0
  13. package/app/components/shadcn/alert/AlertDescription.vue +17 -0
  14. package/app/components/shadcn/alert/AlertTitle.vue +17 -0
  15. package/app/components/shadcn/alert/index.ts +24 -0
  16. package/app/components/shadcn/avatar/Avatar.vue +18 -0
  17. package/app/components/shadcn/avatar/AvatarFallback.vue +21 -0
  18. package/app/components/shadcn/avatar/AvatarImage.vue +16 -0
  19. package/app/components/shadcn/avatar/index.ts +3 -0
  20. package/app/components/shadcn/badge/Badge.vue +26 -0
  21. package/app/components/shadcn/badge/index.ts +26 -0
  22. package/app/components/shadcn/breadcrumb/Breadcrumb.vue +17 -0
  23. package/app/components/shadcn/breadcrumb/BreadcrumbEllipsis.vue +23 -0
  24. package/app/components/shadcn/breadcrumb/BreadcrumbItem.vue +17 -0
  25. package/app/components/shadcn/breadcrumb/BreadcrumbLink.vue +21 -0
  26. package/app/components/shadcn/breadcrumb/BreadcrumbList.vue +17 -0
  27. package/app/components/shadcn/breadcrumb/BreadcrumbPage.vue +20 -0
  28. package/app/components/shadcn/breadcrumb/BreadcrumbSeparator.vue +22 -0
  29. package/app/components/shadcn/breadcrumb/index.ts +7 -0
  30. package/app/components/shadcn/button/Button.vue +31 -0
  31. package/app/components/shadcn/button/index.ts +38 -0
  32. package/app/components/shadcn/card/Card.vue +22 -0
  33. package/app/components/shadcn/card/CardAction.vue +17 -0
  34. package/app/components/shadcn/card/CardContent.vue +17 -0
  35. package/app/components/shadcn/card/CardDescription.vue +17 -0
  36. package/app/components/shadcn/card/CardFooter.vue +17 -0
  37. package/app/components/shadcn/card/CardHeader.vue +17 -0
  38. package/app/components/shadcn/card/CardTitle.vue +17 -0
  39. package/app/components/shadcn/card/index.ts +7 -0
  40. package/app/components/shadcn/checkbox/Checkbox.vue +35 -0
  41. package/app/components/shadcn/checkbox/index.ts +1 -0
  42. package/app/components/shadcn/collapsible/Collapsible.vue +19 -0
  43. package/app/components/shadcn/collapsible/CollapsibleContent.vue +15 -0
  44. package/app/components/shadcn/collapsible/CollapsibleTrigger.vue +15 -0
  45. package/app/components/shadcn/collapsible/index.ts +3 -0
  46. package/app/components/shadcn/command/Command.vue +87 -0
  47. package/app/components/shadcn/command/CommandDialog.vue +31 -0
  48. package/app/components/shadcn/command/CommandEmpty.vue +27 -0
  49. package/app/components/shadcn/command/CommandGroup.vue +45 -0
  50. package/app/components/shadcn/command/CommandInput.vue +39 -0
  51. package/app/components/shadcn/command/CommandItem.vue +76 -0
  52. package/app/components/shadcn/command/CommandList.vue +25 -0
  53. package/app/components/shadcn/command/CommandSeparator.vue +21 -0
  54. package/app/components/shadcn/command/CommandShortcut.vue +17 -0
  55. package/app/components/shadcn/command/index.ts +25 -0
  56. package/app/components/shadcn/dialog/Dialog.vue +19 -0
  57. package/app/components/shadcn/dialog/DialogClose.vue +15 -0
  58. package/app/components/shadcn/dialog/DialogContent.vue +53 -0
  59. package/app/components/shadcn/dialog/DialogDescription.vue +23 -0
  60. package/app/components/shadcn/dialog/DialogFooter.vue +27 -0
  61. package/app/components/shadcn/dialog/DialogHeader.vue +17 -0
  62. package/app/components/shadcn/dialog/DialogOverlay.vue +21 -0
  63. package/app/components/shadcn/dialog/DialogScrollContent.vue +59 -0
  64. package/app/components/shadcn/dialog/DialogTitle.vue +23 -0
  65. package/app/components/shadcn/dialog/DialogTrigger.vue +15 -0
  66. package/app/components/shadcn/dialog/index.ts +10 -0
  67. package/app/components/shadcn/dropdown-menu/DropdownMenu.vue +19 -0
  68. package/app/components/shadcn/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -0
  69. package/app/components/shadcn/dropdown-menu/DropdownMenuContent.vue +39 -0
  70. package/app/components/shadcn/dropdown-menu/DropdownMenuGroup.vue +15 -0
  71. package/app/components/shadcn/dropdown-menu/DropdownMenuItem.vue +31 -0
  72. package/app/components/shadcn/dropdown-menu/DropdownMenuLabel.vue +23 -0
  73. package/app/components/shadcn/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
  74. package/app/components/shadcn/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
  75. package/app/components/shadcn/dropdown-menu/DropdownMenuSeparator.vue +23 -0
  76. package/app/components/shadcn/dropdown-menu/DropdownMenuShortcut.vue +17 -0
  77. package/app/components/shadcn/dropdown-menu/DropdownMenuSub.vue +18 -0
  78. package/app/components/shadcn/dropdown-menu/DropdownMenuSubContent.vue +27 -0
  79. package/app/components/shadcn/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
  80. package/app/components/shadcn/dropdown-menu/DropdownMenuTrigger.vue +17 -0
  81. package/app/components/shadcn/dropdown-menu/index.ts +16 -0
  82. package/app/components/shadcn/field/Field.vue +25 -0
  83. package/app/components/shadcn/field/FieldContent.vue +20 -0
  84. package/app/components/shadcn/field/FieldDescription.vue +22 -0
  85. package/app/components/shadcn/field/FieldError.vue +53 -0
  86. package/app/components/shadcn/field/FieldGroup.vue +20 -0
  87. package/app/components/shadcn/field/FieldLabel.vue +23 -0
  88. package/app/components/shadcn/field/FieldLegend.vue +24 -0
  89. package/app/components/shadcn/field/FieldSeparator.vue +29 -0
  90. package/app/components/shadcn/field/FieldSet.vue +21 -0
  91. package/app/components/shadcn/field/FieldTitle.vue +20 -0
  92. package/app/components/shadcn/field/index.ts +39 -0
  93. package/app/components/shadcn/input/Input.vue +33 -0
  94. package/app/components/shadcn/input/index.ts +1 -0
  95. package/app/components/shadcn/input-group/InputGroup.vue +35 -0
  96. package/app/components/shadcn/input-group/InputGroupAddon.vue +36 -0
  97. package/app/components/shadcn/input-group/InputGroupButton.vue +29 -0
  98. package/app/components/shadcn/input-group/InputGroupInput.vue +19 -0
  99. package/app/components/shadcn/input-group/InputGroupText.vue +19 -0
  100. package/app/components/shadcn/input-group/InputGroupTextarea.vue +19 -0
  101. package/app/components/shadcn/input-group/index.ts +51 -0
  102. package/app/components/shadcn/label/Label.vue +26 -0
  103. package/app/components/shadcn/label/index.ts +1 -0
  104. package/app/components/shadcn/number-field/NumberField.vue +20 -0
  105. package/app/components/shadcn/number-field/NumberFieldContent.vue +14 -0
  106. package/app/components/shadcn/number-field/NumberFieldDecrement.vue +22 -0
  107. package/app/components/shadcn/number-field/NumberFieldIncrement.vue +22 -0
  108. package/app/components/shadcn/number-field/NumberFieldInput.vue +16 -0
  109. package/app/components/shadcn/number-field/index.ts +5 -0
  110. package/app/components/shadcn/pagination/Pagination.vue +26 -0
  111. package/app/components/shadcn/pagination/PaginationContent.vue +22 -0
  112. package/app/components/shadcn/pagination/PaginationEllipsis.vue +25 -0
  113. package/app/components/shadcn/pagination/PaginationFirst.vue +33 -0
  114. package/app/components/shadcn/pagination/PaginationItem.vue +34 -0
  115. package/app/components/shadcn/pagination/PaginationLast.vue +33 -0
  116. package/app/components/shadcn/pagination/PaginationNext.vue +33 -0
  117. package/app/components/shadcn/pagination/PaginationPrevious.vue +33 -0
  118. package/app/components/shadcn/pagination/index.ts +8 -0
  119. package/app/components/shadcn/pin-input/PinInput.vue +26 -0
  120. package/app/components/shadcn/pin-input/PinInputGroup.vue +21 -0
  121. package/app/components/shadcn/pin-input/PinInputSeparator.vue +19 -0
  122. package/app/components/shadcn/pin-input/PinInputSlot.vue +21 -0
  123. package/app/components/shadcn/pin-input/index.ts +4 -0
  124. package/app/components/shadcn/popover/Popover.vue +19 -0
  125. package/app/components/shadcn/popover/PopoverAnchor.vue +15 -0
  126. package/app/components/shadcn/popover/PopoverContent.vue +45 -0
  127. package/app/components/shadcn/popover/PopoverTrigger.vue +15 -0
  128. package/app/components/shadcn/popover/index.ts +4 -0
  129. package/app/components/shadcn/progress/Progress.vue +38 -0
  130. package/app/components/shadcn/progress/index.ts +1 -0
  131. package/app/components/shadcn/radio-group/RadioGroup.vue +25 -0
  132. package/app/components/shadcn/radio-group/RadioGroupItem.vue +40 -0
  133. package/app/components/shadcn/radio-group/index.ts +2 -0
  134. package/app/components/shadcn/scroll-area/ScrollArea.vue +33 -0
  135. package/app/components/shadcn/scroll-area/ScrollBar.vue +32 -0
  136. package/app/components/shadcn/scroll-area/index.ts +2 -0
  137. package/app/components/shadcn/select/Select.vue +19 -0
  138. package/app/components/shadcn/select/SelectContent.vue +51 -0
  139. package/app/components/shadcn/select/SelectGroup.vue +15 -0
  140. package/app/components/shadcn/select/SelectItem.vue +44 -0
  141. package/app/components/shadcn/select/SelectItemText.vue +15 -0
  142. package/app/components/shadcn/select/SelectLabel.vue +17 -0
  143. package/app/components/shadcn/select/SelectScrollDownButton.vue +26 -0
  144. package/app/components/shadcn/select/SelectScrollUpButton.vue +26 -0
  145. package/app/components/shadcn/select/SelectSeparator.vue +19 -0
  146. package/app/components/shadcn/select/SelectTrigger.vue +33 -0
  147. package/app/components/shadcn/select/SelectValue.vue +15 -0
  148. package/app/components/shadcn/select/index.ts +11 -0
  149. package/app/components/shadcn/separator/Separator.vue +29 -0
  150. package/app/components/shadcn/separator/index.ts +1 -0
  151. package/app/components/shadcn/sheet/Sheet.vue +19 -0
  152. package/app/components/shadcn/sheet/SheetClose.vue +15 -0
  153. package/app/components/shadcn/sheet/SheetContent.vue +62 -0
  154. package/app/components/shadcn/sheet/SheetDescription.vue +21 -0
  155. package/app/components/shadcn/sheet/SheetFooter.vue +16 -0
  156. package/app/components/shadcn/sheet/SheetHeader.vue +15 -0
  157. package/app/components/shadcn/sheet/SheetOverlay.vue +21 -0
  158. package/app/components/shadcn/sheet/SheetTitle.vue +21 -0
  159. package/app/components/shadcn/sheet/SheetTrigger.vue +15 -0
  160. package/app/components/shadcn/sheet/index.ts +8 -0
  161. package/app/components/shadcn/sidebar/Sidebar.vue +96 -0
  162. package/app/components/shadcn/sidebar/SidebarContent.vue +18 -0
  163. package/app/components/shadcn/sidebar/SidebarFooter.vue +18 -0
  164. package/app/components/shadcn/sidebar/SidebarGroup.vue +18 -0
  165. package/app/components/shadcn/sidebar/SidebarGroupAction.vue +27 -0
  166. package/app/components/shadcn/sidebar/SidebarGroupContent.vue +18 -0
  167. package/app/components/shadcn/sidebar/SidebarGroupLabel.vue +25 -0
  168. package/app/components/shadcn/sidebar/SidebarHeader.vue +18 -0
  169. package/app/components/shadcn/sidebar/SidebarInput.vue +22 -0
  170. package/app/components/shadcn/sidebar/SidebarInset.vue +21 -0
  171. package/app/components/shadcn/sidebar/SidebarMenu.vue +18 -0
  172. package/app/components/shadcn/sidebar/SidebarMenuAction.vue +35 -0
  173. package/app/components/shadcn/sidebar/SidebarMenuBadge.vue +26 -0
  174. package/app/components/shadcn/sidebar/SidebarMenuButton.vue +48 -0
  175. package/app/components/shadcn/sidebar/SidebarMenuButtonChild.vue +36 -0
  176. package/app/components/shadcn/sidebar/SidebarMenuItem.vue +18 -0
  177. package/app/components/shadcn/sidebar/SidebarMenuSkeleton.vue +35 -0
  178. package/app/components/shadcn/sidebar/SidebarMenuSub.vue +22 -0
  179. package/app/components/shadcn/sidebar/SidebarMenuSubButton.vue +36 -0
  180. package/app/components/shadcn/sidebar/SidebarMenuSubItem.vue +18 -0
  181. package/app/components/shadcn/sidebar/SidebarProvider.vue +82 -0
  182. package/app/components/shadcn/sidebar/SidebarRail.vue +33 -0
  183. package/app/components/shadcn/sidebar/SidebarSeparator.vue +19 -0
  184. package/app/components/shadcn/sidebar/SidebarTrigger.vue +27 -0
  185. package/app/components/shadcn/sidebar/index.ts +60 -0
  186. package/app/components/shadcn/sidebar/utils.ts +19 -0
  187. package/app/components/shadcn/skeleton/Skeleton.vue +17 -0
  188. package/app/components/shadcn/skeleton/index.ts +1 -0
  189. package/app/components/shadcn/slider/Slider.vue +43 -0
  190. package/app/components/shadcn/slider/index.ts +1 -0
  191. package/app/components/shadcn/sonner/Sonner.vue +42 -0
  192. package/app/components/shadcn/sonner/index.ts +1 -0
  193. package/app/components/shadcn/switch/Switch.vue +38 -0
  194. package/app/components/shadcn/switch/index.ts +1 -0
  195. package/app/components/shadcn/table/Table.vue +16 -0
  196. package/app/components/shadcn/table/TableBody.vue +17 -0
  197. package/app/components/shadcn/table/TableCaption.vue +17 -0
  198. package/app/components/shadcn/table/TableCell.vue +22 -0
  199. package/app/components/shadcn/table/TableEmpty.vue +34 -0
  200. package/app/components/shadcn/table/TableFooter.vue +17 -0
  201. package/app/components/shadcn/table/TableHead.vue +17 -0
  202. package/app/components/shadcn/table/TableHeader.vue +17 -0
  203. package/app/components/shadcn/table/TableRow.vue +17 -0
  204. package/app/components/shadcn/table/index.ts +9 -0
  205. package/app/components/shadcn/table/utils.ts +10 -0
  206. package/app/components/shadcn/tabs/Tabs.vue +24 -0
  207. package/app/components/shadcn/tabs/TabsContent.vue +21 -0
  208. package/app/components/shadcn/tabs/TabsList.vue +24 -0
  209. package/app/components/shadcn/tabs/TabsTrigger.vue +26 -0
  210. package/app/components/shadcn/tabs/index.ts +4 -0
  211. package/app/components/shadcn/textarea/Textarea.vue +28 -0
  212. package/app/components/shadcn/textarea/index.ts +1 -0
  213. package/app/components/shadcn/toggle/Toggle.vue +35 -0
  214. package/app/components/shadcn/toggle/index.ts +28 -0
  215. package/app/components/shadcn/toggle-group/ToggleGroup.vue +49 -0
  216. package/app/components/shadcn/toggle-group/ToggleGroupItem.vue +46 -0
  217. package/app/components/shadcn/toggle-group/index.ts +2 -0
  218. package/app/components/shadcn/tooltip/Tooltip.vue +19 -0
  219. package/app/components/shadcn/tooltip/TooltipContent.vue +34 -0
  220. package/app/components/shadcn/tooltip/TooltipProvider.vue +14 -0
  221. package/app/components/shadcn/tooltip/TooltipTrigger.vue +15 -0
  222. package/app/components/shadcn/tooltip/index.ts +4 -0
  223. package/app/components/ui/Accordion/index.stories.ts +108 -0
  224. package/app/components/ui/Accordion/index.vue +80 -0
  225. package/app/components/ui/Accordion/types.ts +27 -0
  226. package/app/components/ui/Alert/index.stories.ts +53 -0
  227. package/app/components/ui/Alert/index.vue +61 -0
  228. package/app/components/ui/Alert/types.ts +9 -0
  229. package/app/components/ui/AlertDialog/index.stories.ts +108 -0
  230. package/app/components/ui/AlertDialog/index.vue +25 -0
  231. package/app/components/ui/AsyncDataTable/en.json +3 -0
  232. package/app/components/ui/AsyncDataTable/index.stories.ts +141 -0
  233. package/app/components/ui/AsyncDataTable/index.vue +312 -0
  234. package/app/components/ui/AsyncDataTable/types.ts +53 -0
  235. package/app/components/ui/Avatar/index.stories.ts +84 -0
  236. package/app/components/ui/Avatar/index.vue +52 -0
  237. package/app/components/ui/Avatar/types.ts +8 -0
  238. package/app/components/ui/Badge/index.stories.ts +67 -0
  239. package/app/components/ui/Badge/index.vue +12 -0
  240. package/app/components/ui/Badge/types.ts +3 -0
  241. package/app/components/ui/Breadcrumb/index.stories.ts +52 -0
  242. package/app/components/ui/Breadcrumb/index.vue +61 -0
  243. package/app/components/ui/Breadcrumb/types.ts +11 -0
  244. package/app/components/ui/Button/index.stories.ts +145 -0
  245. package/app/components/ui/Button/index.vue +63 -0
  246. package/app/components/ui/Button/types.ts +14 -0
  247. package/app/components/ui/ButtonGroup/index.stories.ts +75 -0
  248. package/app/components/ui/ButtonGroup/index.vue +22 -0
  249. package/app/components/ui/ButtonGroup/types.ts +3 -0
  250. package/app/components/ui/Card/index.stories.ts +65 -0
  251. package/app/components/ui/Card/index.vue +28 -0
  252. package/app/components/ui/Card/types.ts +3 -0
  253. package/app/components/ui/Checkbox/index.stories.ts +68 -0
  254. package/app/components/ui/Checkbox/index.vue +23 -0
  255. package/app/components/ui/Checkbox/types.ts +3 -0
  256. package/app/components/ui/CopyButton/en.json +4 -0
  257. package/app/components/ui/CopyButton/index.stories.ts +55 -0
  258. package/app/components/ui/CopyButton/index.vue +98 -0
  259. package/app/components/ui/CopyButton/types.ts +10 -0
  260. package/app/components/ui/DataTable/en.json +3 -0
  261. package/app/components/ui/DataTable/index.stories.ts +231 -0
  262. package/app/components/ui/DataTable/index.vue +505 -0
  263. package/app/components/ui/DataTable/types.ts +42 -0
  264. package/app/components/ui/DatePicker/en.json +9 -0
  265. package/app/components/ui/DatePicker/index.stories.ts +70 -0
  266. package/app/components/ui/DatePicker/index.vue +127 -0
  267. package/app/components/ui/DatePicker/style.css +88 -0
  268. package/app/components/ui/DatePicker/types.ts +41 -0
  269. package/app/components/ui/DateRangePicker/en.json +5 -0
  270. package/app/components/ui/DateRangePicker/index.stories.ts +67 -0
  271. package/app/components/ui/DateRangePicker/index.vue +138 -0
  272. package/app/components/ui/DateRangePicker/types.ts +31 -0
  273. package/app/components/ui/Divider/index.stories.ts +42 -0
  274. package/app/components/ui/Divider/index.vue +16 -0
  275. package/app/components/ui/Divider/types.ts +3 -0
  276. package/app/components/ui/Drawer/index.stories.ts +124 -0
  277. package/app/components/ui/Drawer/index.vue +197 -0
  278. package/app/components/ui/Drawer/types.ts +22 -0
  279. package/app/components/ui/Dropdown/index.stories.ts +145 -0
  280. package/app/components/ui/Dropdown/index.vue +258 -0
  281. package/app/components/ui/Dropdown/types.ts +87 -0
  282. package/app/components/ui/FormItem/index.stories.ts +70 -0
  283. package/app/components/ui/FormItem/index.vue +56 -0
  284. package/app/components/ui/FormItem/types.ts +14 -0
  285. package/app/components/ui/Help/index.stories.ts +54 -0
  286. package/app/components/ui/Help/index.vue +35 -0
  287. package/app/components/ui/Help/types.ts +8 -0
  288. package/app/components/ui/Icon/index.stories.ts +68 -0
  289. package/app/components/ui/Icon/index.vue +30 -0
  290. package/app/components/ui/Icon/types.ts +5 -0
  291. package/app/components/ui/Input/index.stories.ts +73 -0
  292. package/app/components/ui/Input/index.vue +92 -0
  293. package/app/components/ui/Input/types.ts +9 -0
  294. package/app/components/ui/InputCurrency/index.stories.ts +75 -0
  295. package/app/components/ui/InputCurrency/index.vue +31 -0
  296. package/app/components/ui/InputCurrency/types.ts +4 -0
  297. package/app/components/ui/InputNumber/index.stories.ts +56 -0
  298. package/app/components/ui/InputNumber/index.vue +76 -0
  299. package/app/components/ui/InputNumber/types.ts +10 -0
  300. package/app/components/ui/InputOtp/index.stories.ts +39 -0
  301. package/app/components/ui/InputOtp/index.vue +45 -0
  302. package/app/components/ui/InputOtp/types.ts +5 -0
  303. package/app/components/ui/InputPercent/index.stories.ts +32 -0
  304. package/app/components/ui/InputPercent/index.vue +8 -0
  305. package/app/components/ui/InputRange/index.stories.ts +37 -0
  306. package/app/components/ui/InputRange/index.vue +49 -0
  307. package/app/components/ui/InputRange/types.ts +8 -0
  308. package/app/components/ui/Loading/index.stories.ts +36 -0
  309. package/app/components/ui/Loading/index.vue +15 -0
  310. package/app/components/ui/Loading/types.ts +3 -0
  311. package/app/components/ui/Markdown/index.stories.ts +52 -0
  312. package/app/components/ui/Markdown/index.vue +22 -0
  313. package/app/components/ui/Markdown/themes/github.css +1248 -0
  314. package/app/components/ui/Markdown/types.ts +3 -0
  315. package/app/components/ui/Modal/index.stories.ts +124 -0
  316. package/app/components/ui/Modal/index.vue +202 -0
  317. package/app/components/ui/Modal/types.ts +23 -0
  318. package/app/components/ui/ModalContent/index.stories.ts +47 -0
  319. package/app/components/ui/ModalContent/index.vue +79 -0
  320. package/app/components/ui/ModalContent/types.ts +9 -0
  321. package/app/components/ui/PageCard/index.stories.ts +106 -0
  322. package/app/components/ui/PageCard/index.vue +135 -0
  323. package/app/components/ui/PageCard/types.ts +16 -0
  324. package/app/components/ui/Pagination/en.json +3 -0
  325. package/app/components/ui/Pagination/index.stories.ts +82 -0
  326. package/app/components/ui/Pagination/index.vue +173 -0
  327. package/app/components/ui/Pagination/types.ts +18 -0
  328. package/app/components/ui/Popover/index.stories.ts +67 -0
  329. package/app/components/ui/Popover/index.vue +21 -0
  330. package/app/components/ui/Popover/types.ts +5 -0
  331. package/app/components/ui/Qrcode/index.stories.ts +57 -0
  332. package/app/components/ui/Qrcode/index.vue +40 -0
  333. package/app/components/ui/Qrcode/types.ts +3 -0
  334. package/app/components/ui/Radio/index.stories.ts +71 -0
  335. package/app/components/ui/Radio/index.vue +10 -0
  336. package/app/components/ui/Radio/types.ts +3 -0
  337. package/app/components/ui/RadioCardGroup/index.stories.ts +90 -0
  338. package/app/components/ui/RadioCardGroup/index.vue +64 -0
  339. package/app/components/ui/RadioCardGroup/types.ts +13 -0
  340. package/app/components/ui/ScrollArea/index.stories.ts +66 -0
  341. package/app/components/ui/ScrollArea/index.vue +64 -0
  342. package/app/components/ui/ScrollArea/types.ts +5 -0
  343. package/app/components/ui/SearchSelect/en.json +5 -0
  344. package/app/components/ui/SearchSelect/index.stories.ts +126 -0
  345. package/app/components/ui/SearchSelect/index.vue +259 -0
  346. package/app/components/ui/SearchSelect/types.ts +39 -0
  347. package/app/components/ui/Select/en.json +6 -0
  348. package/app/components/ui/Select/index.stories.ts +128 -0
  349. package/app/components/ui/Select/index.vue +267 -0
  350. package/app/components/ui/Select/types.ts +34 -0
  351. package/app/components/ui/Skeleton/index.stories.ts +56 -0
  352. package/app/components/ui/Skeleton/index.vue +12 -0
  353. package/app/components/ui/Skeleton/types.ts +4 -0
  354. package/app/components/ui/Slider/index.stories.ts +60 -0
  355. package/app/components/ui/Slider/index.vue +27 -0
  356. package/app/components/ui/Slider/types.ts +5 -0
  357. package/app/components/ui/Surface/index.stories.ts +50 -0
  358. package/app/components/ui/Surface/index.vue +108 -0
  359. package/app/components/ui/Surface/types.ts +8 -0
  360. package/app/components/ui/Switch/index.stories.ts +32 -0
  361. package/app/components/ui/Switch/index.vue +10 -0
  362. package/app/components/ui/Switch/types.ts +3 -0
  363. package/app/components/ui/Tabs/index.stories.ts +116 -0
  364. package/app/components/ui/Tabs/index.vue +94 -0
  365. package/app/components/ui/Tabs/types.ts +19 -0
  366. package/app/components/ui/Tag/index.stories.ts +51 -0
  367. package/app/components/ui/Tag/index.vue +108 -0
  368. package/app/components/ui/Tag/types.ts +8 -0
  369. package/app/components/ui/Textarea/index.stories.ts +35 -0
  370. package/app/components/ui/Textarea/index.vue +50 -0
  371. package/app/components/ui/Textarea/types.ts +8 -0
  372. package/app/components/ui/Toast/index.stories.ts +48 -0
  373. package/app/components/ui/Toast/index.vue +21 -0
  374. package/app/components/ui/Toast/types.ts +5 -0
  375. package/app/components/ui/Tooltip/index.stories.ts +62 -0
  376. package/app/components/ui/Tooltip/index.vue +72 -0
  377. package/app/components/ui/Tooltip/types.ts +7 -0
  378. package/app/components/ui/WebLink/index.stories.ts +59 -0
  379. package/app/components/ui/WebLink/index.vue +61 -0
  380. package/app/components/ui/WebLink/types.ts +11 -0
  381. package/app/composables/index.ts +9 -0
  382. package/app/composables/useDialog.ts +76 -0
  383. package/app/composables/useToast.ts +49 -0
  384. package/app/en.json +23 -0
  385. package/app/types/index.ts +7 -0
  386. package/app/utils/index.ts +6 -0
  387. package/i18n/messages/ar.json +65 -0
  388. package/i18n/messages/de.json +65 -0
  389. package/i18n/messages/en.json +65 -0
  390. package/i18n/messages/es.json +65 -0
  391. package/i18n/messages/fr.json +65 -0
  392. package/i18n/messages/hi.json +65 -0
  393. package/i18n/messages/id.json +65 -0
  394. package/i18n/messages/it.json +65 -0
  395. package/i18n/messages/ja.json +65 -0
  396. package/i18n/messages/ko.json +65 -0
  397. package/i18n/messages/nl.json +65 -0
  398. package/i18n/messages/pl.json +65 -0
  399. package/i18n/messages/pt.json +65 -0
  400. package/i18n/messages/ru.json +65 -0
  401. package/i18n/messages/th.json +65 -0
  402. package/i18n/messages/tr.json +65 -0
  403. package/i18n/messages/vi.json +65 -0
  404. package/i18n/messages/zh-CN.json +65 -0
  405. package/i18n/messages/zh-TW.json +65 -0
  406. package/i18n.config.ts +19 -0
  407. package/nuxt.config.ts +62 -0
  408. package/package.json +46 -0
@@ -0,0 +1,34 @@
1
+ export interface SelectOption<V extends string | number = string, M = unknown> {
2
+ label: string
3
+ value: V
4
+ disabled?: boolean
5
+ group?: string
6
+ meta?: M
7
+ }
8
+
9
+ /** Filter function signature matching Command's filterFunction */
10
+ export type SelectFilterFunction = (items: string[], keyword: string) => string[]
11
+
12
+ export type SelectBaseProps<V extends string | number = string, M = unknown> = {
13
+ options?: SelectOption<V, M>[]
14
+ placeholder?: string
15
+ disabled?: boolean
16
+ /** true: enable client-side label filter; function: custom filter (disables internal filter) */
17
+ filter?: boolean | SelectFilterFunction
18
+ /** Search input placeholder */
19
+ searchPlaceholder?: string
20
+ /** Empty state text */
21
+ emptyText?: string
22
+ }
23
+
24
+ export type SelectSingleProps<V extends string | number = string, M = unknown> = SelectBaseProps<V, M> & {
25
+ multiple?: false
26
+ modelValue?: V
27
+ }
28
+
29
+ export type SelectMultipleProps<V extends string | number = string, M = unknown> = SelectBaseProps<V, M> & {
30
+ multiple?: true
31
+ modelValue?: V[]
32
+ }
33
+
34
+ export type SelectProps<V extends string | number = string, M = unknown> = SelectSingleProps<V, M> | SelectMultipleProps<V, M>
@@ -0,0 +1,56 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import Skeleton from './index.vue'
3
+
4
+ const meta = {
5
+ title: 'UI/Skeleton',
6
+ component: Skeleton,
7
+ argTypes: {
8
+ width: { control: 'text' },
9
+ height: { control: 'text' },
10
+ },
11
+ args: {
12
+ width: '200px',
13
+ height: '20px',
14
+ },
15
+ } satisfies Meta<typeof Skeleton>
16
+
17
+ export default meta
18
+ type Story = StoryObj<typeof meta>
19
+
20
+ export const Default: Story = {
21
+ render: args => ({
22
+ components: { Skeleton },
23
+ setup: () => ({ args }),
24
+ template: `
25
+ <div class="space-y-10">
26
+ <!-- Controlled -->
27
+ <section>
28
+ <h3 class="mb-4 text-lg font-medium">Controlled</h3>
29
+ <Skeleton v-bind="args" />
30
+ </section>
31
+
32
+ <!-- Various Sizes -->
33
+ <section>
34
+ <h3 class="mb-4 text-lg font-medium">Various Sizes</h3>
35
+ <div class="space-y-3">
36
+ <Skeleton width="100%" height="12px" />
37
+ <Skeleton width="80%" height="12px" />
38
+ <Skeleton width="60%" height="12px" />
39
+ </div>
40
+ </section>
41
+
42
+ <!-- Card Skeleton -->
43
+ <section>
44
+ <h3 class="mb-4 text-lg font-medium">Card Skeleton</h3>
45
+ <div class="flex items-center gap-4">
46
+ <Skeleton width="48px" height="48px" class="rounded-full" />
47
+ <div class="space-y-2">
48
+ <Skeleton width="160px" height="16px" />
49
+ <Skeleton width="120px" height="12px" />
50
+ </div>
51
+ </div>
52
+ </section>
53
+ </div>
54
+ `,
55
+ }),
56
+ }
@@ -0,0 +1,12 @@
1
+ <script setup lang="ts">
2
+ import { Skeleton as ShadcnSkeleton } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/skeleton'
3
+ import type { SkeletonProps } from './types'
4
+
5
+ defineProps<SkeletonProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <ShadcnSkeleton
10
+ :style="{ width, height }"
11
+ />
12
+ </template>
@@ -0,0 +1,4 @@
1
+ export interface SkeletonProps {
2
+ width?: string
3
+ height?: string
4
+ }
@@ -0,0 +1,60 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import Slider from './index.vue'
3
+
4
+ const meta = {
5
+ title: 'UI/Slider',
6
+ component: Slider,
7
+ argTypes: {
8
+ disabled: { control: 'boolean' },
9
+ },
10
+ args: {
11
+ disabled: false,
12
+ },
13
+ } satisfies Meta<typeof Slider>
14
+
15
+ export default meta
16
+ type Story = StoryObj<typeof meta>
17
+
18
+ export const Default: Story = {
19
+ render: args => ({
20
+ components: { Slider },
21
+ setup () {
22
+ const single = ref(50)
23
+ const range = ref([ 20, 80 ])
24
+ const stepped = ref(50)
25
+ const custom = ref(500)
26
+ return { args, single, range, stepped, custom }
27
+ },
28
+ template: `
29
+ <div class="space-y-10 max-w-sm">
30
+ <!-- Controlled -->
31
+ <section>
32
+ <h3 class="mb-4 text-lg font-medium">Controlled</h3>
33
+ <Slider v-model="single" v-bind="args" />
34
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ single }}</div>
35
+ </section>
36
+
37
+ <!-- Range (Two Thumbs) -->
38
+ <section>
39
+ <h3 class="mb-4 text-lg font-medium">Range (Two Thumbs)</h3>
40
+ <Slider v-model="range" />
41
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ range }}</div>
42
+ </section>
43
+
44
+ <!-- With Step -->
45
+ <section>
46
+ <h3 class="mb-4 text-lg font-medium">With Step (25)</h3>
47
+ <Slider v-model="stepped" :step="25" />
48
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ stepped }}</div>
49
+ </section>
50
+
51
+ <!-- Custom Min / Max -->
52
+ <section>
53
+ <h3 class="mb-4 text-lg font-medium">Custom Min / Max (0 - 1000)</h3>
54
+ <Slider v-model="custom" :min="0" :max="1000" />
55
+ <div class="mt-2 text-sm text-muted-foreground">Value: {{ custom }}</div>
56
+ </section>
57
+ </div>
58
+ `,
59
+ }),
60
+ }
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ import { Slider as ShadcnSlider } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/slider'
3
+ import type { SliderProps } from './types'
4
+
5
+ const props = withDefaults(defineProps<SliderProps>(), {
6
+ modelValue: () => [ 0 ],
7
+ })
8
+
9
+ const emit = defineEmits<{ 'update:modelValue': [value: number | number[]]}>()
10
+
11
+ // Normalize between single number and array for shadcn Slider
12
+ const isSingleValue = computed(() => typeof props.modelValue === 'number')
13
+
14
+ const internalModel = computed({
15
+ get: () => {
16
+ if (typeof props.modelValue === 'number') return [ props.modelValue ]
17
+ return props.modelValue ?? [ 0 ]
18
+ },
19
+ set: (value: number[]) => {
20
+ emit('update:modelValue', isSingleValue.value ? (value[0] ?? 0) : value)
21
+ },
22
+ })
23
+ </script>
24
+
25
+ <template>
26
+ <ShadcnSlider v-model="internalModel" />
27
+ </template>
@@ -0,0 +1,5 @@
1
+ import type { SliderRootProps } from 'reka-ui'
2
+
3
+ export interface SliderProps extends /* @vue-ignore */ Omit<SliderRootProps, 'modelValue' | 'defaultValue'> {
4
+ modelValue?: number | number[]
5
+ }
@@ -0,0 +1,50 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import Surface from './index.vue'
3
+
4
+ type SurfaceType = 'default' | 'success' | 'info' | 'help' | 'warn' | 'danger'
5
+ type SurfaceVariant = 'solid' | 'soft' | 'bordered' | 'flat'
6
+
7
+ const types: SurfaceType[] = [ 'default', 'success', 'info', 'help', 'warn', 'danger' ]
8
+ const variants: SurfaceVariant[] = [ 'solid', 'soft', 'bordered', 'flat' ]
9
+
10
+ const meta = {
11
+ title: 'UI/Surface',
12
+ component: Surface,
13
+ argTypes: {
14
+ type: { control: 'select', options: types },
15
+ variant: { control: 'select', options: variants },
16
+ },
17
+ args: {
18
+ type: 'default',
19
+ variant: 'soft',
20
+ },
21
+ } satisfies Meta<typeof Surface>
22
+
23
+ export default meta
24
+ type Story = StoryObj<typeof meta>
25
+
26
+ export const Default: Story = {
27
+ render: args => ({
28
+ components: { Surface },
29
+ setup: () => ({ args, types, variants }),
30
+ template: `
31
+ <div class="space-y-10">
32
+ <!-- Controlled -->
33
+ <section>
34
+ <h3 class="mb-4 text-lg font-medium">Controlled</h3>
35
+ <Surface v-bind="args" class="p-4">This is a controlled surface.</Surface>
36
+ </section>
37
+
38
+ <!-- All Variants × All Types -->
39
+ <section v-for="v in variants" :key="v">
40
+ <h3 class="mb-4 text-lg font-medium">Variant: {{ v }}</h3>
41
+ <div class="grid grid-cols-2 gap-3 md:grid-cols-3">
42
+ <Surface v-for="t in types" :key="t" :variant="v" :type="t" class="p-4">
43
+ <strong>{{ t }}</strong> surface
44
+ </Surface>
45
+ </div>
46
+ </section>
47
+ </div>
48
+ `,
49
+ }),
50
+ }
@@ -0,0 +1,108 @@
1
+ <script setup lang="ts">
2
+ import { cva } from 'class-variance-authority'
3
+ import type { SurfaceProps } from './types'
4
+
5
+ const surfaceVariants = cva(
6
+ 'rounded-lg',
7
+ {
8
+ variants: {
9
+ variant: {
10
+ solid: 'border',
11
+ soft: 'border',
12
+ bordered: 'border bg-transparent',
13
+ flat: '',
14
+ },
15
+ type: {
16
+ default: '',
17
+ success: '',
18
+ info: '',
19
+ help: '',
20
+ warn: '',
21
+ danger: '',
22
+ },
23
+ },
24
+ compoundVariants: [
25
+ // solid — full color background
26
+ { variant: 'solid', type: 'default', class: `
27
+ border-transparent bg-accent text-accent-foreground
28
+ ` },
29
+ { variant: 'solid', type: 'success', class: `
30
+ border-success bg-success text-success-foreground
31
+ ` },
32
+ { variant: 'solid', type: 'info', class: `
33
+ border-info bg-info text-info-foreground
34
+ ` },
35
+ { variant: 'solid', type: 'help', class: `
36
+ border-help bg-help text-help-foreground
37
+ ` },
38
+ { variant: 'solid', type: 'warn', class: `
39
+ border-warn bg-warn text-warn-foreground
40
+ ` },
41
+ { variant: 'solid', type: 'danger', class: `
42
+ border-danger bg-danger text-danger-foreground
43
+ ` },
44
+ // soft — tinted background + soft border
45
+ { variant: 'soft', type: 'default', class: `
46
+ border-border bg-secondary text-secondary-foreground
47
+ ` },
48
+ { variant: 'soft', type: 'success', class: `
49
+ border-success/50 bg-success/10 text-success
50
+ ` },
51
+ { variant: 'soft', type: 'info', class: `
52
+ border-info/50 bg-info/10 text-info
53
+ ` },
54
+ { variant: 'soft', type: 'help', class: `
55
+ border-help/50 bg-help/10 text-help
56
+ ` },
57
+ { variant: 'soft', type: 'warn', class: `
58
+ border-warn/50 bg-warn/10 text-warn
59
+ ` },
60
+ { variant: 'soft', type: 'danger', class: `
61
+ border-danger/50 bg-danger/10 text-danger
62
+ ` },
63
+ // bordered — border only
64
+ { variant: 'bordered', type: 'default', class: `
65
+ border-border text-foreground
66
+ ` },
67
+ { variant: 'bordered', type: 'success', class: `
68
+ border-success/50 text-success
69
+ ` },
70
+ { variant: 'bordered', type: 'info', class: 'border-info/50 text-info' },
71
+ { variant: 'bordered', type: 'help', class: 'border-help/50 text-help' },
72
+ { variant: 'bordered', type: 'warn', class: 'border-warn/50 text-warn' },
73
+ { variant: 'bordered', type: 'danger', class: `
74
+ border-danger/50 text-danger
75
+ ` },
76
+ // flat — tinted background only
77
+ { variant: 'flat', type: 'default', class: `
78
+ bg-secondary text-secondary-foreground
79
+ ` },
80
+ { variant: 'flat', type: 'success', class: 'bg-success/10 text-success' },
81
+ { variant: 'flat', type: 'info', class: 'bg-info/10 text-info' },
82
+ { variant: 'flat', type: 'help', class: 'bg-help/10 text-help' },
83
+ { variant: 'flat', type: 'warn', class: 'bg-warn/10 text-warn' },
84
+ { variant: 'flat', type: 'danger', class: 'bg-danger/10 text-danger' },
85
+ ],
86
+ defaultVariants: {
87
+ variant: 'soft',
88
+ type: 'default',
89
+ },
90
+ },
91
+ )
92
+
93
+ const props = withDefaults(defineProps<SurfaceProps>(), {
94
+ type: 'default',
95
+ variant: 'soft',
96
+ class: undefined,
97
+ })
98
+
99
+ const mergedClass = computed(() =>
100
+ cn(surfaceVariants({ type: props.type, variant: props.variant }), props.class),
101
+ )
102
+ </script>
103
+
104
+ <template>
105
+ <div :class="mergedClass">
106
+ <slot />
107
+ </div>
108
+ </template>
@@ -0,0 +1,8 @@
1
+ export type SurfaceType = 'default' | 'success' | 'info' | 'help' | 'warn' | 'danger'
2
+ export type SurfaceVariant = 'solid' | 'soft' | 'bordered' | 'flat'
3
+
4
+ export interface SurfaceProps {
5
+ type?: SurfaceType
6
+ variant?: SurfaceVariant
7
+ class?: ClassValue
8
+ }
@@ -0,0 +1,32 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import Switch from './index.vue'
3
+
4
+ const meta = {
5
+ title: 'UI/Switch',
6
+ component: Switch,
7
+ argTypes: {
8
+ disabled: { control: 'boolean' },
9
+ },
10
+ args: {
11
+ disabled: false,
12
+ },
13
+ } satisfies Meta<typeof Switch>
14
+
15
+ export default meta
16
+ type Story = StoryObj<typeof meta>
17
+
18
+ export const Default: Story = {
19
+ render: args => ({
20
+ components: { Switch },
21
+ setup () {
22
+ const on = ref(true)
23
+ return { args, on }
24
+ },
25
+ template: `
26
+ <div class="flex items-center gap-4">
27
+ <Switch v-model="on" v-bind="args" />
28
+ <div class="text-sm text-muted-foreground">Value: {{ on }}</div>
29
+ </div>
30
+ `,
31
+ }),
32
+ }
@@ -0,0 +1,10 @@
1
+ <script setup lang="ts">
2
+ import { Switch as ShadcnSwitch } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/switch'
3
+ import type { SwitchProps } from './types'
4
+
5
+ defineProps<SwitchProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <ShadcnSwitch />
10
+ </template>
@@ -0,0 +1,3 @@
1
+ import type { SwitchRootProps } from 'reka-ui'
2
+
3
+ export interface SwitchProps extends /* @vue-ignore */ SwitchRootProps {}
@@ -0,0 +1,116 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import Card from '../Card/index.vue'
3
+ import type { TabsItem } from './types'
4
+ import Tabs from './index.vue'
5
+
6
+ const items: TabsItem[] = [
7
+ {
8
+ value: 'account',
9
+ title: 'Account',
10
+ icon: 'user',
11
+ content: 'Manage your account details, profile information, and preferences here.',
12
+ },
13
+ {
14
+ value: 'password',
15
+ title: 'Password',
16
+ icon: 'lock',
17
+ content: 'Update your password and manage two-factor authentication settings.',
18
+ },
19
+ {
20
+ value: 'notifications',
21
+ title: 'Notifications',
22
+ icon: 'bell',
23
+ content: 'Control which notifications you receive and how they are delivered.',
24
+ disabled: true,
25
+ },
26
+ ]
27
+
28
+ const navItems: TabsItem[] = items.map(({ content, ...rest }) => rest)
29
+
30
+ const meta = {
31
+ title: 'UI/Tabs',
32
+ component: Tabs,
33
+ argTypes: {
34
+ rounded: { control: 'boolean' },
35
+ iconOnly: { control: 'boolean' },
36
+ },
37
+ args: {
38
+ rounded: false,
39
+ iconOnly: false,
40
+ },
41
+ } satisfies Meta<typeof Tabs>
42
+
43
+ export default meta
44
+ type Story = StoryObj<typeof meta>
45
+
46
+ export const Default: Story = {
47
+ render: args => ({
48
+ components: { Tabs, Card },
49
+ setup () {
50
+ const value = ref<string>('account')
51
+ return { args, items, navItems, value }
52
+ },
53
+ template: `
54
+ <div class="max-w-md space-y-10">
55
+ <!-- Controlled -->
56
+ <section>
57
+ <h3 class="mb-4 text-lg font-medium">Controlled</h3>
58
+ <Tabs
59
+ v-model="value"
60
+ v-bind="args"
61
+ :items="items"
62
+ />
63
+ <div class="mt-3 text-sm text-muted-foreground">Active: {{ value }}</div>
64
+ </section>
65
+
66
+ <!-- Icon Only (title used as aria-label) -->
67
+ <section>
68
+ <h3 class="mb-4 text-lg font-medium">Icon Only</h3>
69
+ <Tabs
70
+ icon-only
71
+ :items="items"
72
+ default-value="account"
73
+ />
74
+ </section>
75
+
76
+ <!-- Rounded -->
77
+ <section>
78
+ <h3 class="mb-4 text-lg font-medium">Rounded</h3>
79
+ <Tabs
80
+ rounded
81
+ :items="items"
82
+ default-value="account"
83
+ />
84
+ </section>
85
+
86
+ <!-- No Content (triggers only, no gap below) -->
87
+ <section>
88
+ <h3 class="mb-4 text-lg font-medium">No Content</h3>
89
+ <Tabs
90
+ :items="navItems"
91
+ default-value="account"
92
+ />
93
+ </section>
94
+
95
+ <!-- Custom Slots -->
96
+ <section>
97
+ <h3 class="mb-4 text-lg font-medium">Custom Slots</h3>
98
+ <Tabs
99
+ :items="items"
100
+ default-value="account"
101
+ list-class="w-full"
102
+ >
103
+ <template #title="{ item, active }">
104
+ <span :class="active ? 'font-semibold' : ''">{{ item.title }}</span>
105
+ </template>
106
+ <template #content="{ item }">
107
+ <Card>
108
+ <p class="text-sm text-muted-foreground">{{ item.content }}</p>
109
+ </Card>
110
+ </template>
111
+ </Tabs>
112
+ </section>
113
+ </div>
114
+ `,
115
+ }),
116
+ }
@@ -0,0 +1,94 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ Tabs as ShadcnTabs,
4
+ TabsContent,
5
+ TabsList,
6
+ TabsTrigger,
7
+ } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/tabs'
8
+ import type { TabsItem, TabsProps } from './types'
9
+
10
+ const props = withDefaults(defineProps<TabsProps>(), {
11
+ items: () => [],
12
+ modelValue: undefined,
13
+ defaultValue: undefined,
14
+ rounded: false,
15
+ iconOnly: false,
16
+ listClass: undefined,
17
+ triggerClass: undefined,
18
+ })
19
+
20
+ const emit = defineEmits<{
21
+ 'update:modelValue': [value: string]
22
+ }>()
23
+
24
+ defineSlots<{
25
+ title?: (props: { item: TabsItem, active: boolean }) => unknown
26
+ content?: (props: { item: TabsItem, active: boolean }) => unknown
27
+ }>()
28
+
29
+ const hasItemContent = computed(() => props.items.some(item => !!item.content))
30
+
31
+ const mergedListClass = computed(() => cn(props.rounded && 'rounded-full', props.listClass))
32
+
33
+ function getTriggerClass (item: TabsItem) {
34
+ const showsOnlyIcon = !!item.icon && (props.iconOnly || !item.title)
35
+ return cn(
36
+ props.rounded && 'rounded-full',
37
+ showsOnlyIcon && 'aspect-square flex-none px-0',
38
+ props.triggerClass,
39
+ )
40
+ }
41
+ </script>
42
+
43
+ <template>
44
+ <ShadcnTabs
45
+ v-slot="{ modelValue: activeValue }"
46
+ :modelValue="modelValue"
47
+ :defaultValue="defaultValue"
48
+ @update:modelValue="value => emit('update:modelValue', String(value))"
49
+ >
50
+ <TabsList :class="mergedListClass">
51
+ <TabsTrigger
52
+ v-for="item in items"
53
+ :key="item.value"
54
+ :value="item.value"
55
+ :disabled="item.disabled"
56
+ :class="getTriggerClass(item)"
57
+ :aria-label="item.title"
58
+ >
59
+ <slot
60
+ name="title"
61
+ :item="item"
62
+ :active="activeValue === item.value"
63
+ >
64
+ <Icon
65
+ v-if="item.icon && typeof item.icon === 'string'"
66
+ :name="item.icon"
67
+ />
68
+ <component
69
+ :is="item.icon"
70
+ v-else-if="item.icon"
71
+ />
72
+ <span v-if="item.title && !iconOnly">
73
+ {{ item.title }}
74
+ </span>
75
+ </slot>
76
+ </TabsTrigger>
77
+ </TabsList>
78
+ <template v-if="hasItemContent || $slots.content">
79
+ <TabsContent
80
+ v-for="item in items"
81
+ :key="item.value"
82
+ :value="item.value"
83
+ >
84
+ <slot
85
+ name="content"
86
+ :item="item"
87
+ :active="activeValue === item.value"
88
+ >
89
+ {{ item.content }}
90
+ </slot>
91
+ </TabsContent>
92
+ </template>
93
+ </ShadcnTabs>
94
+ </template>
@@ -0,0 +1,19 @@
1
+ import type { Component } from 'vue'
2
+
3
+ export interface TabsItem {
4
+ value: string
5
+ title?: string
6
+ icon?: string | Component
7
+ content?: string
8
+ disabled?: boolean
9
+ }
10
+
11
+ export interface TabsProps {
12
+ items?: TabsItem[]
13
+ modelValue?: string
14
+ defaultValue?: string
15
+ rounded?: boolean
16
+ iconOnly?: boolean
17
+ listClass?: ClassValue
18
+ triggerClass?: ClassValue
19
+ }