@geniusdynamics/ns8-ui-lib 1.0.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 (310) hide show
  1. package/README.md +167 -0
  2. package/dist/index.d.ts +14 -0
  3. package/dist/ns8-ui-lib.es.js +4278 -0
  4. package/dist/ns8-ui-lib.es.js.map +1 -0
  5. package/dist/ns8-ui-lib.umd.js +7 -0
  6. package/dist/ns8-ui-lib.umd.js.map +1 -0
  7. package/dist/src/App.vue.d.ts +2 -0
  8. package/dist/src/components/HelloWorld.vue.d.ts +5 -0
  9. package/dist/src/components/NS/cards/NSBackupCard.vue.d.ts +51 -0
  10. package/dist/src/components/NS/cards/NSSystemInfoCard.vue.d.ts +58 -0
  11. package/dist/src/components/NS/cards/NSSystemdServiceCard.vue.d.ts +47 -0
  12. package/dist/src/components/NS/cards/index.d.ts +3 -0
  13. package/dist/src/components/NS/checkbox/NSCheckbox.vue.d.ts +37 -0
  14. package/dist/src/components/NS/checkbox/index.d.ts +1 -0
  15. package/dist/src/components/NS/data-table/NSDataTable.vue.d.ts +98 -0
  16. package/dist/src/components/NS/data-table/index.d.ts +1 -0
  17. package/dist/src/components/NS/empty-state/NSEmptyState.vue.d.ts +45 -0
  18. package/dist/src/components/NS/empty-state/index.d.ts +1 -0
  19. package/dist/src/components/NS/index.d.ts +35 -0
  20. package/dist/src/components/NS/inline-notification/NSInlineNotification.vue.d.ts +44 -0
  21. package/dist/src/components/NS/inline-notification/index.d.ts +1 -0
  22. package/dist/src/components/NS/lottie-animation/NSLottieAnimation.vue.d.ts +75 -0
  23. package/dist/src/components/NS/lottie-animation/index.d.ts +1 -0
  24. package/dist/src/components/NS/modal/NSModal.vue.d.ts +56 -0
  25. package/dist/src/components/NS/modal/NSModalTrigger.vue.d.ts +64 -0
  26. package/dist/src/components/NS/modal/index.d.ts +2 -0
  27. package/dist/src/components/NS/pagination/NSPagination.vue.d.ts +36 -0
  28. package/dist/src/components/NS/pagination/index.d.ts +1 -0
  29. package/dist/src/components/NS/progress/NSProgress.vue.d.ts +37 -0
  30. package/dist/src/components/NS/progress/NSProgressBar.vue.d.ts +39 -0
  31. package/dist/src/components/NS/progress/index.d.ts +2 -0
  32. package/dist/src/components/NS/slider/NSByteSlider.vue.d.ts +50 -0
  33. package/dist/src/components/NS/slider/NSSlider.vue.d.ts +49 -0
  34. package/dist/src/components/NS/slider/index.d.ts +2 -0
  35. package/dist/src/components/NS/tag/NSTag.vue.d.ts +41 -0
  36. package/dist/src/components/NS/tag/index.d.ts +1 -0
  37. package/dist/src/components/NS/text-input/NSTextInput.vue.d.ts +67 -0
  38. package/dist/src/components/NS/text-input/index.d.ts +1 -0
  39. package/dist/src/components/NS/toast-notification/NSToastNotification.vue.d.ts +44 -0
  40. package/dist/src/components/NS/toast-notification/index.d.ts +1 -0
  41. package/dist/src/components/NS/toggle/NSToggle.vue.d.ts +51 -0
  42. package/dist/src/components/NS/toggle/index.d.ts +1 -0
  43. package/dist/src/components/NS/wizard/NSWizard.vue.d.ts +86 -0
  44. package/dist/src/components/NS/wizard/index.d.ts +1 -0
  45. package/dist/src/components/ui/button/Button.vue.d.ts +27 -0
  46. package/dist/src/components/ui/button/index.d.ts +7 -0
  47. package/dist/src/components/ui/card/Card.vue.d.ts +21 -0
  48. package/dist/src/components/ui/card/CardAction.vue.d.ts +21 -0
  49. package/dist/src/components/ui/card/CardContent.vue.d.ts +21 -0
  50. package/dist/src/components/ui/card/CardDescription.vue.d.ts +21 -0
  51. package/dist/src/components/ui/card/CardFooter.vue.d.ts +21 -0
  52. package/dist/src/components/ui/card/CardHeader.vue.d.ts +21 -0
  53. package/dist/src/components/ui/card/CardTitle.vue.d.ts +21 -0
  54. package/dist/src/components/ui/card/index.d.ts +7 -0
  55. package/dist/src/components/ui/checkbox/NsCheckbox.vue.d.ts +49 -0
  56. package/dist/src/components/ui/checkbox/index.d.ts +11 -0
  57. package/dist/src/components/ui/dialog/Dialog.vue.d.ts +28 -0
  58. package/dist/src/components/ui/dialog/index.d.ts +1 -0
  59. package/dist/src/components/ui/empty-state/NsEmptyState.vue.d.ts +45 -0
  60. package/dist/src/components/ui/empty-state/index.d.ts +11 -0
  61. package/dist/src/components/ui/inline-notification/NsInlineNotification.vue.d.ts +45 -0
  62. package/dist/src/components/ui/inline-notification/index.d.ts +6 -0
  63. package/dist/src/components/ui/input/Input.vue.d.ts +12 -0
  64. package/dist/src/components/ui/input/index.d.ts +1 -0
  65. package/dist/src/components/ui/input-group/InputGroup.vue.d.ts +21 -0
  66. package/dist/src/components/ui/input-group/InputGroupAddon.vue.d.ts +25 -0
  67. package/dist/src/components/ui/input-group/InputGroupButton.vue.d.ts +22 -0
  68. package/dist/src/components/ui/input-group/InputGroupInput.vue.d.ts +6 -0
  69. package/dist/src/components/ui/input-group/InputGroupText.vue.d.ts +21 -0
  70. package/dist/src/components/ui/input-group/InputGroupTextarea.vue.d.ts +6 -0
  71. package/dist/src/components/ui/input-group/index.d.ts +22 -0
  72. package/dist/src/components/ui/item/Item.vue.d.ts +27 -0
  73. package/dist/src/components/ui/item/ItemActions.vue.d.ts +21 -0
  74. package/dist/src/components/ui/item/ItemContent.vue.d.ts +21 -0
  75. package/dist/src/components/ui/item/ItemDescription.vue.d.ts +21 -0
  76. package/dist/src/components/ui/item/ItemFooter.vue.d.ts +21 -0
  77. package/dist/src/components/ui/item/ItemGroup.vue.d.ts +21 -0
  78. package/dist/src/components/ui/item/ItemHeader.vue.d.ts +21 -0
  79. package/dist/src/components/ui/item/ItemMedia.vue.d.ts +23 -0
  80. package/dist/src/components/ui/item/ItemSeparator.vue.d.ts +7 -0
  81. package/dist/src/components/ui/item/ItemTitle.vue.d.ts +21 -0
  82. package/dist/src/components/ui/item/index.d.ts +20 -0
  83. package/dist/src/components/ui/label/Label.vue.d.ts +22 -0
  84. package/dist/src/components/ui/label/index.d.ts +1 -0
  85. package/dist/src/components/ui/scroll-area/ScrollArea.vue.d.ts +22 -0
  86. package/dist/src/components/ui/scroll-area/ScrollBar.vue.d.ts +9 -0
  87. package/dist/src/components/ui/scroll-area/index.d.ts +2 -0
  88. package/dist/src/components/ui/select/Select.vue.d.ts +28 -0
  89. package/dist/src/components/ui/select/SelectContent.vue.d.ts +32 -0
  90. package/dist/src/components/ui/select/SelectGroup.vue.d.ts +18 -0
  91. package/dist/src/components/ui/select/SelectItem.vue.d.ts +23 -0
  92. package/dist/src/components/ui/select/SelectItemText.vue.d.ts +18 -0
  93. package/dist/src/components/ui/select/SelectLabel.vue.d.ts +22 -0
  94. package/dist/src/components/ui/select/SelectScrollDownButton.vue.d.ts +22 -0
  95. package/dist/src/components/ui/select/SelectScrollUpButton.vue.d.ts +22 -0
  96. package/dist/src/components/ui/select/SelectSeparator.vue.d.ts +7 -0
  97. package/dist/src/components/ui/select/SelectTrigger.vue.d.ts +25 -0
  98. package/dist/src/components/ui/select/SelectValue.vue.d.ts +18 -0
  99. package/dist/src/components/ui/select/index.d.ts +11 -0
  100. package/dist/src/components/ui/separator/Separator.vue.d.ts +10 -0
  101. package/dist/src/components/ui/separator/index.d.ts +1 -0
  102. package/dist/src/components/ui/sheet/Sheet.vue.d.ts +25 -0
  103. package/dist/src/components/ui/sheet/SheetClose.vue.d.ts +18 -0
  104. package/dist/src/components/ui/sheet/SheetContent.vue.d.ts +39 -0
  105. package/dist/src/components/ui/sheet/SheetDescription.vue.d.ts +22 -0
  106. package/dist/src/components/ui/sheet/SheetFooter.vue.d.ts +21 -0
  107. package/dist/src/components/ui/sheet/SheetHeader.vue.d.ts +21 -0
  108. package/dist/src/components/ui/sheet/SheetOverlay.vue.d.ts +22 -0
  109. package/dist/src/components/ui/sheet/SheetTitle.vue.d.ts +22 -0
  110. package/dist/src/components/ui/sheet/SheetTrigger.vue.d.ts +18 -0
  111. package/dist/src/components/ui/sheet/index.d.ts +8 -0
  112. package/dist/src/components/ui/sidebar/Sidebar.vue.d.ts +24 -0
  113. package/dist/src/components/ui/sidebar/SidebarContent.vue.d.ts +21 -0
  114. package/dist/src/components/ui/sidebar/SidebarFooter.vue.d.ts +21 -0
  115. package/dist/src/components/ui/sidebar/SidebarGroup.vue.d.ts +21 -0
  116. package/dist/src/components/ui/sidebar/SidebarGroupAction.vue.d.ts +22 -0
  117. package/dist/src/components/ui/sidebar/SidebarGroupContent.vue.d.ts +21 -0
  118. package/dist/src/components/ui/sidebar/SidebarGroupLabel.vue.d.ts +22 -0
  119. package/dist/src/components/ui/sidebar/SidebarHeader.vue.d.ts +21 -0
  120. package/dist/src/components/ui/sidebar/SidebarInput.vue.d.ts +21 -0
  121. package/dist/src/components/ui/sidebar/SidebarInset.vue.d.ts +21 -0
  122. package/dist/src/components/ui/sidebar/SidebarMenu.vue.d.ts +21 -0
  123. package/dist/src/components/ui/sidebar/SidebarMenuAction.vue.d.ts +25 -0
  124. package/dist/src/components/ui/sidebar/SidebarMenuBadge.vue.d.ts +21 -0
  125. package/dist/src/components/ui/sidebar/SidebarMenuButton.vue.d.ts +27 -0
  126. package/dist/src/components/ui/sidebar/SidebarMenuButtonChild.vue.d.ts +30 -0
  127. package/dist/src/components/ui/sidebar/SidebarMenuItem.vue.d.ts +21 -0
  128. package/dist/src/components/ui/sidebar/SidebarMenuSkeleton.vue.d.ts +7 -0
  129. package/dist/src/components/ui/sidebar/SidebarMenuSub.vue.d.ts +21 -0
  130. package/dist/src/components/ui/sidebar/SidebarMenuSubButton.vue.d.ts +27 -0
  131. package/dist/src/components/ui/sidebar/SidebarMenuSubItem.vue.d.ts +21 -0
  132. package/dist/src/components/ui/sidebar/SidebarProvider.vue.d.ts +30 -0
  133. package/dist/src/components/ui/sidebar/SidebarRail.vue.d.ts +21 -0
  134. package/dist/src/components/ui/sidebar/SidebarSeparator.vue.d.ts +21 -0
  135. package/dist/src/components/ui/sidebar/SidebarTrigger.vue.d.ts +6 -0
  136. package/dist/src/components/ui/sidebar/index.d.ts +37 -0
  137. package/dist/src/components/ui/sidebar/utils.d.ts +56 -0
  138. package/dist/src/components/ui/skeleton/Skeleton.vue.d.ts +6 -0
  139. package/dist/src/components/ui/skeleton/index.d.ts +1 -0
  140. package/dist/src/components/ui/sonner/Sonner.vue.d.ts +3 -0
  141. package/dist/src/components/ui/sonner/index.d.ts +1 -0
  142. package/dist/src/components/ui/switch/Switch.vue.d.ts +28 -0
  143. package/dist/src/components/ui/switch/index.d.ts +1 -0
  144. package/dist/src/components/ui/table/Table.vue.d.ts +21 -0
  145. package/dist/src/components/ui/table/TableBody.vue.d.ts +21 -0
  146. package/dist/src/components/ui/table/TableCaption.vue.d.ts +21 -0
  147. package/dist/src/components/ui/table/TableCell.vue.d.ts +21 -0
  148. package/dist/src/components/ui/table/TableEmpty.vue.d.ts +24 -0
  149. package/dist/src/components/ui/table/TableFooter.vue.d.ts +21 -0
  150. package/dist/src/components/ui/table/TableHead.vue.d.ts +21 -0
  151. package/dist/src/components/ui/table/TableHeader.vue.d.ts +21 -0
  152. package/dist/src/components/ui/table/TableRow.vue.d.ts +21 -0
  153. package/dist/src/components/ui/table/index.d.ts +9 -0
  154. package/dist/src/components/ui/table/utils.d.ts +3 -0
  155. package/dist/src/components/ui/tabs/Tabs.vue.d.ts +28 -0
  156. package/dist/src/components/ui/tabs/TabsContent.vue.d.ts +22 -0
  157. package/dist/src/components/ui/tabs/TabsList.vue.d.ts +22 -0
  158. package/dist/src/components/ui/tabs/TabsTrigger.vue.d.ts +22 -0
  159. package/dist/src/components/ui/tabs/index.d.ts +4 -0
  160. package/dist/src/components/ui/tag/NsTag.vue.d.ts +42 -0
  161. package/dist/src/components/ui/tag/index.d.ts +8 -0
  162. package/dist/src/components/ui/text-input/NsTextInput.vue.d.ts +79 -0
  163. package/dist/src/components/ui/text-input/index.d.ts +15 -0
  164. package/dist/src/components/ui/textarea/Textarea.vue.d.ts +12 -0
  165. package/dist/src/components/ui/textarea/index.d.ts +1 -0
  166. package/dist/src/components/ui/toggle/NsToggle.vue.d.ts +54 -0
  167. package/dist/src/components/ui/toggle/index.d.ts +15 -0
  168. package/dist/src/components/ui/tooltip/Tooltip.vue.d.ts +24 -0
  169. package/dist/src/components/ui/tooltip/TooltipContent.vue.d.ts +30 -0
  170. package/dist/src/components/ui/tooltip/TooltipProvider.vue.d.ts +20 -0
  171. package/dist/src/components/ui/tooltip/TooltipTrigger.vue.d.ts +18 -0
  172. package/dist/src/components/ui/tooltip/index.d.ts +4 -0
  173. package/dist/src/composables/index.d.ts +8 -0
  174. package/dist/src/composables/useDateTimeService.d.ts +10 -0
  175. package/dist/src/composables/useFilterService.d.ts +8 -0
  176. package/dist/src/composables/useIconService.d.ts +153 -0
  177. package/dist/src/composables/usePageTitleService.d.ts +3 -0
  178. package/dist/src/composables/useQueryParamService.d.ts +13 -0
  179. package/dist/src/composables/useStorageService.d.ts +5 -0
  180. package/dist/src/composables/useTaskService.d.ts +18 -0
  181. package/dist/src/composables/useUtilService.d.ts +27 -0
  182. package/dist/src/lib/utils.d.ts +2 -0
  183. package/dist/src/main.d.ts +0 -0
  184. package/dist/vite.svg +1 -0
  185. package/package.json +80 -0
  186. package/src/App.vue +30 -0
  187. package/src/components/HelloWorld.vue +41 -0
  188. package/src/components/NS/CompleteDemo.vue +475 -0
  189. package/src/components/NS/Demo.vue +191 -0
  190. package/src/components/NS/cards/NSBackupCard.vue +272 -0
  191. package/src/components/NS/cards/NSSystemInfoCard.vue +252 -0
  192. package/src/components/NS/cards/NSSystemdServiceCard.vue +250 -0
  193. package/src/components/NS/checkbox/NSCheckbox.vue +104 -0
  194. package/src/components/NS/data-table/NSDataTable.vue +434 -0
  195. package/src/components/NS/empty-state/NSEmptyState.vue +188 -0
  196. package/src/components/NS/inline-notification/NSInlineNotification.vue +162 -0
  197. package/src/components/NS/lottie-animation/NSLottieAnimation.vue +255 -0
  198. package/src/components/NS/modal/NSModal.vue +193 -0
  199. package/src/components/NS/modal/NSModalTrigger.vue +109 -0
  200. package/src/components/NS/pagination/NSPagination.vue +247 -0
  201. package/src/components/NS/progress/NSProgress.vue +115 -0
  202. package/src/components/NS/progress/NSProgressBar.vue +137 -0
  203. package/src/components/NS/slider/NSByteSlider.vue +144 -0
  204. package/src/components/NS/slider/NSSlider.vue +142 -0
  205. package/src/components/NS/tag/NSTag.vue +139 -0
  206. package/src/components/NS/text-input/NSTextInput.vue +242 -0
  207. package/src/components/NS/toast-notification/NSToastNotification.vue +163 -0
  208. package/src/components/NS/toggle/NSToggle.vue +156 -0
  209. package/src/components/NS/wizard/NSWizard.vue +399 -0
  210. package/src/components/ui/button/Button.vue +29 -0
  211. package/src/components/ui/card/Card.vue +22 -0
  212. package/src/components/ui/card/CardAction.vue +17 -0
  213. package/src/components/ui/card/CardContent.vue +17 -0
  214. package/src/components/ui/card/CardDescription.vue +17 -0
  215. package/src/components/ui/card/CardFooter.vue +17 -0
  216. package/src/components/ui/card/CardHeader.vue +17 -0
  217. package/src/components/ui/card/CardTitle.vue +17 -0
  218. package/src/components/ui/checkbox/NsCheckbox.vue +123 -0
  219. package/src/components/ui/dialog/Dialog.vue +68 -0
  220. package/src/components/ui/empty-state/NsEmptyState.vue +149 -0
  221. package/src/components/ui/inline-notification/NsInlineNotification.vue +163 -0
  222. package/src/components/ui/input/Input.vue +33 -0
  223. package/src/components/ui/input-group/InputGroup.vue +35 -0
  224. package/src/components/ui/input-group/InputGroupAddon.vue +36 -0
  225. package/src/components/ui/input-group/InputGroupButton.vue +21 -0
  226. package/src/components/ui/input-group/InputGroupInput.vue +19 -0
  227. package/src/components/ui/input-group/InputGroupText.vue +19 -0
  228. package/src/components/ui/input-group/InputGroupTextarea.vue +19 -0
  229. package/src/components/ui/item/Item.vue +27 -0
  230. package/src/components/ui/item/ItemActions.vue +17 -0
  231. package/src/components/ui/item/ItemContent.vue +17 -0
  232. package/src/components/ui/item/ItemDescription.vue +21 -0
  233. package/src/components/ui/item/ItemFooter.vue +17 -0
  234. package/src/components/ui/item/ItemGroup.vue +18 -0
  235. package/src/components/ui/item/ItemHeader.vue +17 -0
  236. package/src/components/ui/item/ItemMedia.vue +21 -0
  237. package/src/components/ui/item/ItemSeparator.vue +18 -0
  238. package/src/components/ui/item/ItemTitle.vue +17 -0
  239. package/src/components/ui/label/Label.vue +26 -0
  240. package/src/components/ui/scroll-area/ScrollArea.vue +33 -0
  241. package/src/components/ui/scroll-area/ScrollBar.vue +32 -0
  242. package/src/components/ui/select/Select.vue +19 -0
  243. package/src/components/ui/select/SelectContent.vue +51 -0
  244. package/src/components/ui/select/SelectGroup.vue +15 -0
  245. package/src/components/ui/select/SelectItem.vue +44 -0
  246. package/src/components/ui/select/SelectItemText.vue +15 -0
  247. package/src/components/ui/select/SelectLabel.vue +17 -0
  248. package/src/components/ui/select/SelectScrollDownButton.vue +26 -0
  249. package/src/components/ui/select/SelectScrollUpButton.vue +26 -0
  250. package/src/components/ui/select/SelectSeparator.vue +19 -0
  251. package/src/components/ui/select/SelectTrigger.vue +33 -0
  252. package/src/components/ui/select/SelectValue.vue +15 -0
  253. package/src/components/ui/separator/Separator.vue +29 -0
  254. package/src/components/ui/sheet/Sheet.vue +19 -0
  255. package/src/components/ui/sheet/SheetClose.vue +15 -0
  256. package/src/components/ui/sheet/SheetContent.vue +62 -0
  257. package/src/components/ui/sheet/SheetDescription.vue +21 -0
  258. package/src/components/ui/sheet/SheetFooter.vue +16 -0
  259. package/src/components/ui/sheet/SheetHeader.vue +15 -0
  260. package/src/components/ui/sheet/SheetOverlay.vue +21 -0
  261. package/src/components/ui/sheet/SheetTitle.vue +21 -0
  262. package/src/components/ui/sheet/SheetTrigger.vue +15 -0
  263. package/src/components/ui/sidebar/Sidebar.vue +96 -0
  264. package/src/components/ui/sidebar/SidebarContent.vue +18 -0
  265. package/src/components/ui/sidebar/SidebarFooter.vue +18 -0
  266. package/src/components/ui/sidebar/SidebarGroup.vue +18 -0
  267. package/src/components/ui/sidebar/SidebarGroupAction.vue +27 -0
  268. package/src/components/ui/sidebar/SidebarGroupContent.vue +18 -0
  269. package/src/components/ui/sidebar/SidebarGroupLabel.vue +25 -0
  270. package/src/components/ui/sidebar/SidebarHeader.vue +18 -0
  271. package/src/components/ui/sidebar/SidebarInput.vue +22 -0
  272. package/src/components/ui/sidebar/SidebarInset.vue +21 -0
  273. package/src/components/ui/sidebar/SidebarMenu.vue +18 -0
  274. package/src/components/ui/sidebar/SidebarMenuAction.vue +35 -0
  275. package/src/components/ui/sidebar/SidebarMenuBadge.vue +26 -0
  276. package/src/components/ui/sidebar/SidebarMenuButton.vue +48 -0
  277. package/src/components/ui/sidebar/SidebarMenuButtonChild.vue +36 -0
  278. package/src/components/ui/sidebar/SidebarMenuItem.vue +18 -0
  279. package/src/components/ui/sidebar/SidebarMenuSkeleton.vue +35 -0
  280. package/src/components/ui/sidebar/SidebarMenuSub.vue +22 -0
  281. package/src/components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
  282. package/src/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
  283. package/src/components/ui/sidebar/SidebarProvider.vue +82 -0
  284. package/src/components/ui/sidebar/SidebarRail.vue +33 -0
  285. package/src/components/ui/sidebar/SidebarSeparator.vue +19 -0
  286. package/src/components/ui/sidebar/SidebarTrigger.vue +27 -0
  287. package/src/components/ui/skeleton/Skeleton.vue +17 -0
  288. package/src/components/ui/sonner/Sonner.vue +42 -0
  289. package/src/components/ui/switch/Switch.vue +38 -0
  290. package/src/components/ui/table/Table.vue +16 -0
  291. package/src/components/ui/table/TableBody.vue +17 -0
  292. package/src/components/ui/table/TableCaption.vue +17 -0
  293. package/src/components/ui/table/TableCell.vue +22 -0
  294. package/src/components/ui/table/TableEmpty.vue +34 -0
  295. package/src/components/ui/table/TableFooter.vue +17 -0
  296. package/src/components/ui/table/TableHead.vue +17 -0
  297. package/src/components/ui/table/TableHeader.vue +17 -0
  298. package/src/components/ui/table/TableRow.vue +17 -0
  299. package/src/components/ui/tabs/Tabs.vue +24 -0
  300. package/src/components/ui/tabs/TabsContent.vue +21 -0
  301. package/src/components/ui/tabs/TabsList.vue +24 -0
  302. package/src/components/ui/tabs/TabsTrigger.vue +26 -0
  303. package/src/components/ui/tag/NsTag.vue +114 -0
  304. package/src/components/ui/text-input/NsTextInput.vue +269 -0
  305. package/src/components/ui/textarea/Textarea.vue +28 -0
  306. package/src/components/ui/toggle/NsToggle.vue +126 -0
  307. package/src/components/ui/tooltip/Tooltip.vue +19 -0
  308. package/src/components/ui/tooltip/TooltipContent.vue +34 -0
  309. package/src/components/ui/tooltip/TooltipProvider.vue +14 -0
  310. package/src/components/ui/tooltip/TooltipTrigger.vue +15 -0
@@ -0,0 +1,434 @@
1
+ <script setup lang="ts">
2
+ import { ref, computed, watch } from 'vue'
3
+ import { ChevronUp, ChevronDown, MoreHorizontal, Search, Filter } from 'lucide-vue-next'
4
+ import {
5
+ Table,
6
+ TableBody,
7
+ TableCell,
8
+ TableHead,
9
+ TableHeader,
10
+ TableRow
11
+ } from '@/components/ui/table'
12
+ import { Button } from '@/components/ui/button'
13
+ import { Input } from '@/components/ui/input'
14
+ import { cn } from '@/lib/utils'
15
+
16
+ interface Column {
17
+ key: string
18
+ label: string
19
+ sortable?: boolean
20
+ width?: string
21
+ align?: 'left' | 'center' | 'right'
22
+ filterable?: boolean
23
+ render?: (value: any, row: any, index: number) => any
24
+ }
25
+
26
+ interface Action {
27
+ key: string
28
+ label: string
29
+ icon?: any
30
+ onClick: (row: any, index: number) => void
31
+ disabled?: (row: any) => boolean
32
+ variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'
33
+ }
34
+
35
+ interface Props {
36
+ data?: any[]
37
+ columns?: Column[]
38
+ actions?: Action[]
39
+ loading?: boolean
40
+ selectable?: boolean
41
+ searchable?: boolean
42
+ filterable?: boolean
43
+ pagination?: boolean
44
+ currentPage?: number
45
+ itemsPerPage?: number
46
+ totalItems?: number
47
+ showTotal?: boolean
48
+ emptyMessage?: string
49
+ loadingMessage?: string
50
+ maxHeight?: string
51
+ striped?: boolean
52
+ hover?: boolean
53
+ class?: string
54
+ tableClass?: string
55
+ headerClass?: string
56
+ bodyClass?: string
57
+ }
58
+
59
+ const props = withDefaults(defineProps<Props>(), {
60
+ data: () => [],
61
+ columns: () => [],
62
+ actions: () => [],
63
+ loading: false,
64
+ selectable: false,
65
+ searchable: false,
66
+ filterable: false,
67
+ pagination: false,
68
+ currentPage: 1,
69
+ itemsPerPage: 10,
70
+ totalItems: 0,
71
+ showTotal: true,
72
+ emptyMessage: 'No data available',
73
+ loadingMessage: 'Loading...',
74
+ striped: true,
75
+ hover: true,
76
+ })
77
+
78
+ const emit = defineEmits<{
79
+ 'update:currentPage': [page: number]
80
+ 'update:itemsPerPage': [size: number]
81
+ 'selection-change': [selectedRows: any[]]
82
+ 'row-click': [row: any, index: number]
83
+ 'sort-change': [column: string, direction: 'asc' | 'desc' | null]
84
+ 'filter-change': [filters: Record<string, any>]
85
+ 'search': [query: string]
86
+ }>()
87
+
88
+ const selectedRows = ref<any[]>([])
89
+ const searchQuery = ref('')
90
+ const sortColumn = ref<string>('')
91
+ const sortDirection = ref<'asc' | 'desc' | null>(null)
92
+ const filters = ref<Record<string, any>>({})
93
+
94
+ const processedData = computed(() => {
95
+ let result = [...(props.data || [])]
96
+
97
+ // Apply search
98
+ if (searchQuery.value && props.searchable) {
99
+ const query = searchQuery.value.toLowerCase()
100
+ result = result.filter(row => {
101
+ return props.columns.some(column => {
102
+ const value = row[column.key]
103
+ return value && value.toString().toLowerCase().includes(query)
104
+ })
105
+ })
106
+ }
107
+
108
+ // Apply filters
109
+ if (props.filterable) {
110
+ Object.entries(filters.value).forEach(([key, value]) => {
111
+ if (value) {
112
+ result = result.filter(row => {
113
+ const rowValue = row[key]
114
+ return rowValue && rowValue.toString().toLowerCase().includes(value.toString().toLowerCase())
115
+ })
116
+ }
117
+ })
118
+ }
119
+
120
+ // Apply sorting
121
+ if (sortColumn.value && sortDirection.value) {
122
+ result.sort((a, b) => {
123
+ const aValue = a[sortColumn.value]
124
+ const bValue = b[sortColumn.value]
125
+
126
+ if (aValue === bValue) return 0
127
+
128
+ let comparison = 0
129
+ if (aValue < bValue) comparison = -1
130
+ if (aValue > bValue) comparison = 1
131
+
132
+ return sortDirection.value === 'asc' ? comparison : -comparison
133
+ })
134
+ }
135
+
136
+ return result
137
+ })
138
+
139
+ const currentPageData = computed(() => {
140
+ if (!props.pagination) return processedData.value
141
+
142
+ const start = (props.currentPage - 1) * props.itemsPerPage
143
+ const end = start + props.itemsPerPage
144
+ return processedData.value.slice(start, end)
145
+ })
146
+
147
+ const toggleSelection = (row: any) => {
148
+ const index = selectedRows.value.findIndex(r => r === row)
149
+ if (index > -1) {
150
+ selectedRows.value.splice(index, 1)
151
+ } else {
152
+ selectedRows.value.push(row)
153
+ }
154
+ emit('selection-change', selectedRows.value)
155
+ }
156
+
157
+ const toggleAllSelection = () => {
158
+ if (selectedRows.value.length === currentPageData.value.length) {
159
+ selectedRows.value = []
160
+ } else {
161
+ selectedRows.value = [...currentPageData.value]
162
+ }
163
+ emit('selection-change', selectedRows.value)
164
+ }
165
+
166
+ const handleSort = (column: Column) => {
167
+ if (!column.sortable) return
168
+
169
+ if (sortColumn.value === column.key) {
170
+ if (sortDirection.value === 'asc') {
171
+ sortDirection.value = 'desc'
172
+ } else {
173
+ sortDirection.value = null
174
+ sortColumn.value = ''
175
+ }
176
+ } else {
177
+ sortColumn.value = column.key
178
+ sortDirection.value = 'asc'
179
+ }
180
+
181
+ emit('sort-change', sortColumn.value, sortDirection.value)
182
+ }
183
+
184
+ const handleRowClick = (row: any, index: number) => {
185
+ emit('row-click', row, index)
186
+ }
187
+
188
+ const handleSearch = (query: string) => {
189
+ searchQuery.value = query
190
+ emit('search', query)
191
+ }
192
+
193
+ const handleFilterChange = (key: string, value: any) => {
194
+ filters.value[key] = value
195
+ emit('filter-change', filters.value)
196
+ }
197
+
198
+ const isAllSelected = computed(() =>
199
+ currentPageData.value.length > 0 && selectedRows.value.length === currentPageData.value.length
200
+ )
201
+
202
+ const isIndeterminate = computed(() =>
203
+ selectedRows.value.length > 0 && selectedRows.value.length < currentPageData.value.length
204
+ )
205
+
206
+ const containerClasses = computed(() => {
207
+ return cn('w-full space-y-4', props.class)
208
+ })
209
+
210
+ const tableClasses = computed(() => {
211
+ return cn('w-full', props.tableClass)
212
+ })
213
+
214
+ const headerClasses = computed(() => {
215
+ return cn('[&_tr]:border-b', props.headerClass)
216
+ })
217
+
218
+ const bodyClasses = computed(() => {
219
+ const baseClasses = '[&_tr:last-child]:border-0'
220
+
221
+ const styleClasses = {
222
+ '[&_tr]:border-b': props.striped,
223
+ '[&_tr:nth-child(even)]:bg-muted/50': props.striped,
224
+ '[&_tr:hover:bg-muted/50]:not(.selected)': props.hover,
225
+ }
226
+
227
+ return cn(baseClasses, styleClasses, props.bodyClass)
228
+ })
229
+
230
+ // Watch for selection changes
231
+ watch(() => props.currentPage, () => {
232
+ selectedRows.value = []
233
+ emit('selection-change', selectedRows.value)
234
+ })
235
+ </script>
236
+
237
+ <template>
238
+ <div :class="containerClasses">
239
+ <!-- Header with search and filters -->
240
+ <div class="flex items-center justify-between gap-4 mb-4">
241
+ <div class="flex items-center gap-2">
242
+ <!-- Search -->
243
+ <div v-if="searchable" class="relative">
244
+ <Search class="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground" />
245
+ <Input
246
+ :model-value="searchQuery"
247
+ @update:model-value="handleSearch"
248
+ placeholder="Search..."
249
+ class="pl-9 w-64"
250
+ />
251
+ </div>
252
+
253
+ <!-- Filters -->
254
+ <div v-if="filterable" class="flex items-center gap-2">
255
+ <Filter class="h-4 w-4 text-muted-foreground" />
256
+ <div v-for="column in columns.filter(c => c.filterable)" :key="column.key">
257
+ <Input
258
+ :model-value="filters[column.key]"
259
+ @update:model-value="(value) => handleFilterChange(column.key, value)"
260
+ :placeholder="`Filter ${column.label}...`"
261
+ class="w-32"
262
+ />
263
+ </div>
264
+ </div>
265
+ </div>
266
+
267
+ <!-- Total count -->
268
+ <div v-if="showTotal" class="text-sm text-muted-foreground">
269
+ {{ processedData.length }} items total
270
+ </div>
271
+ </div>
272
+
273
+ <!-- Table -->
274
+ <div class="rounded-md border">
275
+ <Table :class="tableClasses">
276
+ <TableHeader :class="headerClasses">
277
+ <TableRow>
278
+ <!-- Select all checkbox -->
279
+ <TableHead v-if="selectable" class="w-12">
280
+ <input
281
+ type="checkbox"
282
+ :checked="isAllSelected"
283
+ :indeterminate="isIndeterminate"
284
+ @change="toggleAllSelection"
285
+ class="rounded border-gray-300"
286
+ />
287
+ </TableHead>
288
+
289
+ <!-- Column headers -->
290
+ <TableHead
291
+ v-for="column in columns"
292
+ :key="column.key"
293
+ :class="cn(
294
+ 'relative',
295
+ {
296
+ 'text-left': column.align === 'left' || !column.align,
297
+ 'text-center': column.align === 'center',
298
+ 'text-right': column.align === 'right',
299
+ 'cursor-pointer hover:bg-muted/50': column.sortable
300
+ }
301
+ )"
302
+ :style="{ width: column.width }"
303
+ @click="handleSort(column)"
304
+ >
305
+ <div class="flex items-center gap-1">
306
+ {{ column.label }}
307
+ <div v-if="column.sortable" class="flex flex-col">
308
+ <ChevronUp
309
+ :class="cn(
310
+ 'h-3 w-3',
311
+ sortColumn === column.key && sortDirection === 'asc' ? 'text-primary' : 'text-muted-foreground'
312
+ )"
313
+ />
314
+ <ChevronDown
315
+ :class="cn(
316
+ 'h-3 w-3 -mt-1',
317
+ sortColumn === column.key && sortDirection === 'desc' ? 'text-primary' : 'text-muted-foreground'
318
+ )"
319
+ />
320
+ </div>
321
+ </div>
322
+ </TableHead>
323
+
324
+ <!-- Actions column -->
325
+ <TableHead v-if="actions.length > 0" class="w-16">
326
+ <span class="sr-only">Actions</span>
327
+ </TableHead>
328
+ </TableRow>
329
+ </TableHeader>
330
+
331
+ <TableBody :class="bodyClasses">
332
+ <!-- Loading state -->
333
+ <TableRow v-if="loading">
334
+ <TableCell :colspan="columns.length + (selectable ? 1 : 0) + (actions.length > 0 ? 1 : 0)" class="text-center py-8">
335
+ <div class="flex items-center justify-center space-x-2">
336
+ <div class="animate-spin rounded-full h-4 w-4 border-b-2 border-primary"></div>
337
+ <span>{{ loadingMessage }}</span>
338
+ </div>
339
+ </TableCell>
340
+ </TableRow>
341
+
342
+ <!-- Empty state -->
343
+ <TableRow v-else-if="currentPageData.length === 0">
344
+ <TableCell :colspan="columns.length + (selectable ? 1 : 0) + (actions.length > 0 ? 1 : 0)" class="text-center py-8">
345
+ {{ emptyMessage }}
346
+ </TableCell>
347
+ </TableRow>
348
+
349
+ <!-- Data rows -->
350
+ <TableRow
351
+ v-else
352
+ v-for="(row, index) in currentPageData"
353
+ :key="`row-${index}`"
354
+ :class="{
355
+ 'selected': selectedRows.includes(row)
356
+ }"
357
+ @click="handleRowClick(row, index)"
358
+ class="cursor-pointer"
359
+ >
360
+ <!-- Selection checkbox -->
361
+ <TableCell v-if="selectable" class="w-12">
362
+ <input
363
+ type="checkbox"
364
+ :checked="selectedRows.includes(row)"
365
+ @change="toggleSelection(row)"
366
+ class="rounded border-gray-300"
367
+ />
368
+ </TableCell>
369
+
370
+ <!-- Data cells -->
371
+ <TableCell
372
+ v-for="column in columns"
373
+ :key="column.key"
374
+ :class="cn(
375
+ {
376
+ 'text-left': column.align === 'left' || !column.align,
377
+ 'text-center': column.align === 'center',
378
+ 'text-right': column.align === 'right'
379
+ }
380
+ )"
381
+ >
382
+ <slot
383
+ :name="`cell-${column.key}`"
384
+ :row="row"
385
+ :value="row[column.key]"
386
+ :column="column"
387
+ :index="index"
388
+ >
389
+ <span v-if="column.render">
390
+ {{ column.render(row[column.key], row, index) }}
391
+ </span>
392
+ <span v-else>
393
+ {{ row[column.key] }}
394
+ </span>
395
+ </slot>
396
+ </TableCell>
397
+
398
+ <!-- Actions -->
399
+ <TableCell v-if="actions.length > 0">
400
+ <div class="flex items-center justify-end space-x-1">
401
+ <Button
402
+ v-for="action in actions"
403
+ :key="action.key"
404
+ :variant="action.variant || 'ghost'"
405
+ :size="sm"
406
+ :disabled="action.disabled ? action.disabled(row) : false"
407
+ @click.stop="action.onClick(row, index)"
408
+ >
409
+ <component v-if="action.icon" :is="action.icon" class="h-4 w-4" />
410
+ {{ action.label }}
411
+ </Button>
412
+ </div>
413
+ </TableCell>
414
+ </TableRow>
415
+ </TableBody>
416
+ </Table>
417
+ </div>
418
+
419
+ <!-- Pagination -->
420
+ <div v-if="pagination" class="mt-4">
421
+ <slot name="pagination" :current-page="currentPage" :total-items="processedData.length">
422
+ <!-- Built-in pagination placeholder -->
423
+ <div class="flex items-center justify-between">
424
+ <div class="text-sm text-muted-foreground">
425
+ Showing {{ (currentPage - 1) * itemsPerPage + 1 }} to {{ Math.min(currentPage * itemsPerPage, processedData.length) }} of {{ processedData.length }} items
426
+ </div>
427
+ <div class="text-sm text-muted-foreground">
428
+ Page {{ currentPage }} of {{ Math.ceil(processedData.length / itemsPerPage) }}
429
+ </div>
430
+ </div>
431
+ </slot>
432
+ </div>
433
+ </div>
434
+ </template>
@@ -0,0 +1,188 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+ import { FileX, Search, InBox, AlertCircle, Info } from 'lucide-vue-next'
4
+ import { NSLottieAnimation } from '@/components/NS/lottie-animation'
5
+ import { cn } from '@/lib/utils'
6
+
7
+ interface Props {
8
+ title?: string
9
+ description?: string
10
+ icon?: string | object
11
+ lottiePath?: string // Path to Lottie JSON file
12
+ lottieData?: any // Direct Lottie animation data
13
+ animationTitle?: string
14
+ size?: 'default' | 'sm' | 'lg'
15
+ variant?: 'default' | 'muted'
16
+ loop?: boolean | number
17
+ animateOnHover?: boolean
18
+ autoPlay?: boolean
19
+ class?: string
20
+ iconClass?: string
21
+ titleClass?: string
22
+ descriptionClass?: string
23
+ }
24
+
25
+ const props = withDefaults(defineProps<Props>(), {
26
+ title: 'No data available',
27
+ size: 'default',
28
+ variant: 'default',
29
+ loop: true,
30
+ animateOnHover: false,
31
+ autoPlay: true,
32
+ })
33
+
34
+ const DefaultIcon = computed(() => {
35
+ if (props.icon) {
36
+ return null // Use custom icon
37
+ }
38
+
39
+ // Choose appropriate default icon based on title content
40
+ const title = props.title?.toLowerCase() || ''
41
+
42
+ if (title.includes('search') || title.includes('find') || title.includes('result')) {
43
+ return Search
44
+ } else if (title.includes('empty') || title.includes('no') || title.includes('data')) {
45
+ return FileX
46
+ } else if (title.includes('message') || title.includes('notification') || title.includes('alert')) {
47
+ return InBox
48
+ } else if (title.includes('error') || title.includes('warning')) {
49
+ return AlertCircle
50
+ } else {
51
+ return Info
52
+ }
53
+ })
54
+
55
+ const iconComponent = computed(() => {
56
+ if (typeof props.icon === 'object') {
57
+ return props.icon // Vue component
58
+ }
59
+
60
+ if (typeof props.icon === 'string') {
61
+ // Map string to Lucide icons
62
+ const iconMap: Record<string, any> = {
63
+ 'file-x': FileX,
64
+ 'search': Search,
65
+ 'inbox': InBox,
66
+ 'alert-circle': AlertCircle,
67
+ 'info': Info,
68
+ }
69
+
70
+ return iconMap[props.icon] || DefaultIcon.value
71
+ }
72
+
73
+ return DefaultIcon.value
74
+ })
75
+
76
+ const containerClasses = computed(() => {
77
+ const sizeClasses = {
78
+ default: 'p-8',
79
+ sm: 'p-4',
80
+ lg: 'p-12'
81
+ }
82
+
83
+ const variantClasses = {
84
+ default: 'text-foreground',
85
+ muted: 'text-muted-foreground'
86
+ }
87
+
88
+ return cn(
89
+ 'flex flex-col items-center justify-center text-center',
90
+ sizeClasses[props.size],
91
+ variantClasses[props.variant],
92
+ props.class
93
+ )
94
+ })
95
+
96
+ const iconClasses = computed(() => {
97
+ const sizeClasses = {
98
+ default: 'h-16 w-16',
99
+ sm: 'h-12 w-12',
100
+ lg: 'h-20 w-20'
101
+ }
102
+
103
+ return cn('text-muted-foreground', sizeClasses[props.size], props.iconClass)
104
+ })
105
+
106
+ const titleClasses = computed(() => {
107
+ return cn(
108
+ 'text-lg font-semibold mb-2',
109
+ {
110
+ 'text-foreground': props.variant === 'default',
111
+ 'text-muted-foreground': props.variant === 'muted'
112
+ },
113
+ props.titleClass
114
+ )
115
+ })
116
+
117
+ const descriptionClasses = computed(() => {
118
+ return cn(
119
+ 'text-sm max-w-md mb-6',
120
+ {
121
+ 'text-muted-foreground': props.variant === 'default',
122
+ 'text-muted-foreground/70': props.variant === 'muted'
123
+ },
124
+ props.descriptionClass
125
+ )
126
+ })
127
+
128
+ const hasIconSlot = computed(() => !!$slots.icon)
129
+ const hasDescriptionSlot = computed(() => !!$slots.description)
130
+ const hasActionsSlot = computed(() => !!$slots.actions)
131
+ </script>
132
+
133
+ <template>
134
+ <div :class="containerClasses">
135
+ <!-- Icon section -->
136
+ <div class="mb-4">
137
+ <slot name="icon">
138
+ <!-- Lottie animation if provided -->
139
+ <NSLottieAnimation
140
+ v-if="lottiePath || lottieData"
141
+ :path="lottiePath"
142
+ :animation-data="lottieData"
143
+ :width="48"
144
+ :height="48"
145
+ :class="iconClasses"
146
+ :title="animationTitle || title"
147
+ :play-on-hover="true"
148
+ :stop-on-hover-out="true"
149
+ />
150
+
151
+ <!-- Custom icon or default Lucide icon -->
152
+ <component
153
+ v-else-if="iconComponent && !hasIconSlot"
154
+ :is="iconComponent"
155
+ :class="iconClasses"
156
+ />
157
+ </slot>
158
+ </div>
159
+
160
+ <!-- Title section -->
161
+ <h3
162
+ v-if="title || $slots.title"
163
+ :class="titleClasses"
164
+ >
165
+ <slot name="title">{{ title }}</slot>
166
+ </h3>
167
+
168
+ <!-- Description section -->
169
+ <div
170
+ v-if="hasDescriptionSlot || description"
171
+ :class="descriptionClasses"
172
+ >
173
+ <slot name="description">
174
+ <p>{{ description }}</p>
175
+ </slot>
176
+ </div>
177
+
178
+ <!-- Actions section -->
179
+ <div v-if="hasActionsSlot" class="mt-4">
180
+ <slot name="actions" />
181
+ </div>
182
+
183
+ <!-- Extra content section -->
184
+ <div v-if="$slots.extra" class="mt-6">
185
+ <slot name="extra" />
186
+ </div>
187
+ </div>
188
+ </template>