vlite3 0.0.8 → 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 (461) hide show
  1. package/.vscode/extensions.json +3 -0
  2. package/LICENSE +21 -0
  3. package/README.md +258 -17
  4. package/index.html +16 -0
  5. package/package.json +6 -3
  6. package/scripts/bundle-css.js +45 -0
  7. package/src/App.vue +7 -0
  8. package/src/components/Accordion/Accordion.vue +139 -0
  9. package/src/components/Accordion/AccordionContent.vue +63 -0
  10. package/src/components/Accordion/AccordionItem.vue +163 -0
  11. package/src/components/Accordion/AccordionTrigger.vue +125 -0
  12. package/src/components/Accordion/index.ts +5 -0
  13. package/src/components/Accordion/types.ts +41 -0
  14. package/src/components/Alert.vue +112 -0
  15. package/src/components/Avatar.vue +110 -0
  16. package/src/components/AvatarUploader/AvatarUploader.vue +129 -0
  17. package/{components/AvatarUploader/index.d.ts → src/components/AvatarUploader/index.ts} +2 -2
  18. package/src/components/Badge.vue +45 -0
  19. package/src/components/Button.vue +122 -0
  20. package/src/components/ButtonGroup.vue +173 -0
  21. package/src/components/Carousel/Carousel.vue +84 -0
  22. package/src/components/Carousel/index.ts +2 -0
  23. package/src/components/Carousel/types.ts +25 -0
  24. package/src/components/CheckBox.vue +132 -0
  25. package/src/components/Chip/Chip.vue +158 -0
  26. package/src/components/Chip/index.ts +2 -0
  27. package/src/components/Chip/types.ts +23 -0
  28. package/src/components/ChoiceBox/ChoiceBox.vue +181 -0
  29. package/src/components/ChoiceBox/index.ts +2 -0
  30. package/src/components/ColorPicker/ColorIro.vue +207 -0
  31. package/src/components/ColorPicker/ColorPicker.vue +61 -0
  32. package/src/components/ConfirmationModal.vue +46 -0
  33. package/src/components/DataTable/DataTable.vue +478 -0
  34. package/src/components/DataTable/DataTableHeader.vue +78 -0
  35. package/src/components/DataTable/DataTableRow.vue +171 -0
  36. package/src/components/DataTable/DataTableToolbar.vue +45 -0
  37. package/src/components/DataTable/index.ts +5 -0
  38. package/src/components/DataTable/types.ts +85 -0
  39. package/src/components/DatePicker.vue +102 -0
  40. package/src/components/Dropdown/Dropdown.vue +348 -0
  41. package/src/components/Dropdown/DropdownBooleanItem.vue +40 -0
  42. package/src/components/Dropdown/DropdownGroupedLayout.vue +115 -0
  43. package/src/components/Dropdown/DropdownItem.vue +56 -0
  44. package/src/components/Dropdown/DropdownMenu.vue +374 -0
  45. package/src/components/Dropdown/DropdownTrigger.vue +27 -0
  46. package/src/components/Dropdown/composables/useDropdownIds.ts +27 -0
  47. package/src/components/Dropdown/composables/useDropdownNavigation.ts +109 -0
  48. package/src/components/Dropdown/composables/useDropdownSelection.ts +106 -0
  49. package/src/components/Dropdown/index.ts +6 -0
  50. package/src/components/FilePicker/FilePicker.vue +459 -0
  51. package/src/components/FilePicker/index.ts +2 -0
  52. package/src/components/FileTree/FileTree.vue +334 -0
  53. package/src/components/FileTree/FileTreeNode.vue +225 -0
  54. package/src/components/FileTree/index.ts +2 -0
  55. package/src/components/FileTree/types.ts +31 -0
  56. package/src/components/FileTree/useTreeSelection.ts +66 -0
  57. package/src/components/Form/CustomFields.vue +294 -0
  58. package/src/components/Form/Form.vue +406 -0
  59. package/src/components/Form/FormField.vue +404 -0
  60. package/src/components/Form/FormFields.vue +161 -0
  61. package/src/components/Form/composables/useFileUpload.ts +112 -0
  62. package/src/components/Form/composables/useForm.ts +356 -0
  63. package/src/components/Form/index.ts +16 -0
  64. package/src/components/Form/types.ts +203 -0
  65. package/src/components/Form/utils/form.utils.ts +209 -0
  66. package/src/components/Heatmap/Heatmap.vue +629 -0
  67. package/src/components/Heatmap/index.ts +2 -0
  68. package/src/components/Heatmap/types.ts +84 -0
  69. package/src/components/Icon.vue +47 -0
  70. package/src/components/IconPicker.vue +138 -0
  71. package/src/components/Input.vue +366 -0
  72. package/src/components/Label.vue +25 -0
  73. package/src/components/Logo.vue +5 -0
  74. package/src/components/Masonry/Masonry.vue +148 -0
  75. package/src/components/Masonry/index.ts +2 -0
  76. package/src/components/Masonry/types.ts +44 -0
  77. package/src/components/Modal.vue +135 -0
  78. package/src/components/MultiSelect/MultiSelect.vue +176 -0
  79. package/src/components/MultiSelect/index.ts +1 -0
  80. package/src/components/Navbar/Navbar.vue +277 -0
  81. package/src/components/Navbar/NavbarGroup.vue +27 -0
  82. package/src/components/Navbar/NavbarItem.vue +124 -0
  83. package/src/components/Navbar/index.ts +3 -0
  84. package/src/components/OTPInput/OTPInput.vue +220 -0
  85. package/src/components/OTPInput/index.ts +1 -0
  86. package/src/components/Pagination/Pagination.vue +238 -0
  87. package/src/components/Pagination/index.ts +1 -0
  88. package/src/components/PricingPlan/PricingPlan.vue +102 -0
  89. package/src/components/PricingPlan/PricingPlanItem.vue +148 -0
  90. package/src/components/PricingPlan/index.ts +3 -0
  91. package/src/components/PricingPlan/types.ts +29 -0
  92. package/src/components/SidePanel.vue +184 -0
  93. package/src/components/SidebarMenu/SidebarMenu.vue +146 -0
  94. package/src/components/SidebarMenu/SidebarMenuItem.vue +333 -0
  95. package/src/components/SidebarMenu/index.ts +3 -0
  96. package/src/components/SidebarMenu/types.ts +54 -0
  97. package/src/components/Slider.vue +181 -0
  98. package/src/components/Switch.vue +51 -0
  99. package/src/components/Tabes/Tabes.vue +112 -0
  100. package/src/components/Tabes/index.ts +2 -0
  101. package/src/components/Tabes/types.ts +17 -0
  102. package/src/components/Textarea.vue +48 -0
  103. package/src/components/ThemeToggle.vue +14 -0
  104. package/src/components/Timeline.vue +250 -0
  105. package/src/components/ToastNotification.vue +257 -0
  106. package/src/components/Tooltip.vue +25 -0
  107. package/src/components/Workbook/Sheet.vue +185 -0
  108. package/src/components/Workbook/Workbook.vue +231 -0
  109. package/src/components/Workbook/WorkbookAddButton.vue +17 -0
  110. package/src/components/Workbook/index.ts +3 -0
  111. package/src/components/Workbook/types.ts +43 -0
  112. package/src/composables/useKeyStroke.ts +291 -0
  113. package/src/composables/useNotifications.ts +206 -0
  114. package/src/composables/useTheme.ts +55 -0
  115. package/src/core/config.ts +37 -0
  116. package/src/core/index.ts +49 -0
  117. package/src/css/base.css +148 -0
  118. package/src/css/input.css +61 -0
  119. package/src/css/main.css +6 -0
  120. package/src/css/theme.css +344 -0
  121. package/src/directives/vRipple.ts +38 -0
  122. package/src/index.ts +53 -0
  123. package/src/main.ts +5 -0
  124. package/src/playground/Playground.vue +429 -0
  125. package/src/playground/composables/useGetUsers.ts +538 -0
  126. package/src/playground/demos/AccordionDemo.vue +361 -0
  127. package/src/playground/demos/AlertDemo.vue +36 -0
  128. package/src/playground/demos/AvatarDemo.vue +41 -0
  129. package/src/playground/demos/AvatarUploaderDemo.vue +133 -0
  130. package/src/playground/demos/BadgeDemo.vue +31 -0
  131. package/src/playground/demos/BadgesDemo.vue +26 -0
  132. package/src/playground/demos/ButtonDemo.vue +99 -0
  133. package/src/playground/demos/ButtonGroupDemo.vue +39 -0
  134. package/src/playground/demos/ButtonsDemo.vue +111 -0
  135. package/src/playground/demos/CarouselDemo.vue +135 -0
  136. package/src/playground/demos/CheckBoxDemo.vue +43 -0
  137. package/src/playground/demos/ChipDemo.vue +190 -0
  138. package/src/playground/demos/ChoiceBoxDemo.vue +160 -0
  139. package/src/playground/demos/ColorPickerDemo.vue +30 -0
  140. package/src/playground/demos/ColorsDemo.vue +295 -0
  141. package/src/playground/demos/DataTableDemo.vue +215 -0
  142. package/src/playground/demos/DatePickerDemo.vue +43 -0
  143. package/src/playground/demos/DisplayDemo.vue +101 -0
  144. package/src/playground/demos/DropdownDemo.vue +651 -0
  145. package/src/playground/demos/FilePickerDemo.vue +175 -0
  146. package/src/playground/demos/FileTreeDemo.vue +150 -0
  147. package/src/playground/demos/FormDemo.vue +1144 -0
  148. package/src/playground/demos/HeatmapDemo.vue +467 -0
  149. package/src/playground/demos/IconPickerDemo.vue +27 -0
  150. package/src/playground/demos/InputDemo.vue +80 -0
  151. package/src/playground/demos/InputsDemo.vue +127 -0
  152. package/src/playground/demos/LabelDemo.vue +32 -0
  153. package/src/playground/demos/MasonryDemo.vue +241 -0
  154. package/src/playground/demos/ModalDemo.vue +67 -0
  155. package/src/playground/demos/MultiSelectDemo.vue +300 -0
  156. package/src/playground/demos/NavbarDemo.vue +59 -0
  157. package/src/playground/demos/NavigationDemo.vue +116 -0
  158. package/src/playground/demos/OTPInputDemo.vue +170 -0
  159. package/src/playground/demos/OverlaysDemo.vue +104 -0
  160. package/src/playground/demos/PaginationDemo.vue +130 -0
  161. package/src/playground/demos/PricingPlanDemo.vue +110 -0
  162. package/src/playground/demos/SidePanelDemo.vue +45 -0
  163. package/src/playground/demos/SidebarMenuDemo.vue +170 -0
  164. package/src/playground/demos/SliderDemo.vue +48 -0
  165. package/src/playground/demos/SwitchDemo.vue +40 -0
  166. package/src/playground/demos/TabesDemo.vue +178 -0
  167. package/src/playground/demos/TextareaDemo.vue +31 -0
  168. package/src/playground/demos/ThemeToggleDemo.vue +20 -0
  169. package/src/playground/demos/TimelineDemo.vue +43 -0
  170. package/src/playground/demos/ToastDemo.vue +111 -0
  171. package/src/playground/demos/TooltipDemo.vue +30 -0
  172. package/src/playground/demos/WorkbookDemo.vue +227 -0
  173. package/src/types/alert.type.ts +11 -0
  174. package/{types/avatar.type.d.ts → src/types/avatar.type.ts} +9 -8
  175. package/src/types/button.ts +36 -0
  176. package/src/types/buttongroup.type.ts +1 -0
  177. package/src/types/config.type.ts +31 -0
  178. package/src/types/form.type.ts +75 -0
  179. package/src/types/index.ts +11 -0
  180. package/src/types/navbar.type.ts +28 -0
  181. package/src/types/sidepanel.type.ts +14 -0
  182. package/src/types/styles.ts +42 -0
  183. package/src/types/timeline.type.ts +11 -0
  184. package/{utils/functions.d.ts → src/utils/functions.ts} +9 -1
  185. package/src/utils/index.ts +2 -0
  186. package/src/utils/object.ts +40 -0
  187. package/tsconfig.app.json +27 -0
  188. package/tsconfig.json +48 -0
  189. package/tsconfig.node.json +18 -0
  190. package/tsconfig.node.tsbuildinfo +1 -0
  191. package/tsconfig.tsbuildinfo +1 -0
  192. package/vercel.json +8 -0
  193. package/vite.config.d.ts +2 -0
  194. package/vite.config.js +63 -0
  195. package/vite.config.ts +64 -0
  196. package/vite.config.vercel.ts +17 -0
  197. package/_virtual/_plugin-vue_export-helper.js +0 -9
  198. package/components/Accordion/Accordion.vue.d.ts +0 -42
  199. package/components/Accordion/Accordion.vue.js +0 -102
  200. package/components/Accordion/Accordion.vue2.js +0 -4
  201. package/components/Accordion/AccordionContent.vue.d.ts +0 -22
  202. package/components/Accordion/AccordionContent.vue.js +0 -7
  203. package/components/Accordion/AccordionContent.vue2.js +0 -47
  204. package/components/Accordion/AccordionItem.vue.d.ts +0 -54
  205. package/components/Accordion/AccordionItem.vue.js +0 -102
  206. package/components/Accordion/AccordionItem.vue2.js +0 -4
  207. package/components/Accordion/AccordionTrigger.vue.d.ts +0 -40
  208. package/components/Accordion/AccordionTrigger.vue.js +0 -69
  209. package/components/Accordion/AccordionTrigger.vue2.js +0 -4
  210. package/components/Accordion/index.d.ts +0 -5
  211. package/components/Accordion/types.d.ts +0 -30
  212. package/components/Alert.vue.d.ts +0 -36
  213. package/components/Alert.vue.js +0 -81
  214. package/components/Alert.vue2.js +0 -4
  215. package/components/Avatar.vue.d.ts +0 -32
  216. package/components/Avatar.vue.js +0 -78
  217. package/components/Avatar.vue2.js +0 -4
  218. package/components/AvatarUploader/AvatarUploader.vue.d.ts +0 -32
  219. package/components/AvatarUploader/AvatarUploader.vue.js +0 -99
  220. package/components/AvatarUploader/AvatarUploader.vue2.js +0 -4
  221. package/components/Badge.vue.d.ts +0 -25
  222. package/components/Badge.vue.js +0 -27
  223. package/components/Badge.vue2.js +0 -4
  224. package/components/Button.vue.d.ts +0 -26
  225. package/components/Button.vue.js +0 -108
  226. package/components/Button.vue2.js +0 -4
  227. package/components/ButtonGroup.vue.d.ts +0 -29
  228. package/components/ButtonGroup.vue.js +0 -7
  229. package/components/ButtonGroup.vue2.js +0 -30
  230. package/components/Carousel/Carousel.vue.d.ts +0 -847
  231. package/components/Carousel/Carousel.vue.js +0 -7
  232. package/components/Carousel/Carousel.vue2.js +0 -68
  233. package/components/Carousel/index.d.ts +0 -2
  234. package/components/Carousel/types.d.ts +0 -24
  235. package/components/CheckBox.vue.d.ts +0 -27
  236. package/components/CheckBox.vue.js +0 -115
  237. package/components/CheckBox.vue2.js +0 -4
  238. package/components/Chip/Chip.vue.d.ts +0 -33
  239. package/components/Chip/Chip.vue.js +0 -113
  240. package/components/Chip/Chip.vue2.js +0 -4
  241. package/components/Chip/index.d.ts +0 -2
  242. package/components/Chip/types.d.ts +0 -12
  243. package/components/ChoiceBox/ChoiceBox.vue.d.ts +0 -32
  244. package/components/ChoiceBox/ChoiceBox.vue.js +0 -141
  245. package/components/ChoiceBox/ChoiceBox.vue2.js +0 -4
  246. package/components/ChoiceBox/index.d.ts +0 -2
  247. package/components/ColorPicker/ColorIro.vue.d.ts +0 -18
  248. package/components/ColorPicker/ColorIro.vue.js +0 -142
  249. package/components/ColorPicker/ColorIro.vue3.js +0 -5
  250. package/components/ColorPicker/ColorPicker.vue.d.ts +0 -22
  251. package/components/ColorPicker/ColorPicker.vue.js +0 -55
  252. package/components/ColorPicker/ColorPicker.vue2.js +0 -4
  253. package/components/ConfirmationModal.vue.d.ts +0 -23
  254. package/components/ConfirmationModal.vue.js +0 -50
  255. package/components/ConfirmationModal.vue2.js +0 -4
  256. package/components/DataTable/DataTable.vue.d.ts +0 -60
  257. package/components/DataTable/DataTable.vue.js +0 -7
  258. package/components/DataTable/DataTable.vue2.js +0 -310
  259. package/components/DataTable/DataTableHeader.vue.d.ts +0 -14
  260. package/components/DataTable/DataTableHeader.vue.js +0 -49
  261. package/components/DataTable/DataTableHeader.vue2.js +0 -4
  262. package/components/DataTable/DataTableRow.vue.d.ts +0 -51
  263. package/components/DataTable/DataTableRow.vue.js +0 -114
  264. package/components/DataTable/DataTableRow.vue2.js +0 -4
  265. package/components/DataTable/DataTableToolbar.vue.d.ts +0 -31
  266. package/components/DataTable/DataTableToolbar.vue.js +0 -45
  267. package/components/DataTable/DataTableToolbar.vue2.js +0 -4
  268. package/components/DataTable/index.d.ts +0 -4
  269. package/components/DataTable/types.d.ts +0 -75
  270. package/components/DatePicker.vue.d.ts +0 -44
  271. package/components/DatePicker.vue.js +0 -86
  272. package/components/DatePicker.vue2.js +0 -4
  273. package/components/Dropdown/Dropdown.vue.d.ts +0 -104
  274. package/components/Dropdown/Dropdown.vue.js +0 -200
  275. package/components/Dropdown/Dropdown.vue2.js +0 -4
  276. package/components/Dropdown/DropdownBooleanItem.vue.d.ts +0 -12
  277. package/components/Dropdown/DropdownBooleanItem.vue.js +0 -41
  278. package/components/Dropdown/DropdownBooleanItem.vue2.js +0 -4
  279. package/components/Dropdown/DropdownGroupedLayout.vue.d.ts +0 -21
  280. package/components/Dropdown/DropdownGroupedLayout.vue.js +0 -73
  281. package/components/Dropdown/DropdownGroupedLayout.vue2.js +0 -4
  282. package/components/Dropdown/DropdownItem.vue.d.ts +0 -35
  283. package/components/Dropdown/DropdownItem.vue.js +0 -56
  284. package/components/Dropdown/DropdownItem.vue2.js +0 -4
  285. package/components/Dropdown/DropdownMenu.vue.d.ts +0 -71
  286. package/components/Dropdown/DropdownMenu.vue.js +0 -226
  287. package/components/Dropdown/DropdownMenu.vue2.js +0 -4
  288. package/components/Dropdown/DropdownTrigger.vue.d.ts +0 -13
  289. package/components/Dropdown/DropdownTrigger.vue.js +0 -24
  290. package/components/Dropdown/DropdownTrigger.vue2.js +0 -4
  291. package/components/Dropdown/composables/useDropdownIds.d.ts +0 -5
  292. package/components/Dropdown/composables/useDropdownIds.js +0 -20
  293. package/components/Dropdown/composables/useDropdownNavigation.d.ts +0 -19
  294. package/components/Dropdown/composables/useDropdownNavigation.js +0 -49
  295. package/components/Dropdown/composables/useDropdownSelection.d.ts +0 -16
  296. package/components/Dropdown/composables/useDropdownSelection.js +0 -41
  297. package/components/Dropdown/index.d.ts +0 -6
  298. package/components/FilePicker/FilePicker.vue.d.ts +0 -65
  299. package/components/FilePicker/FilePicker.vue.js +0 -284
  300. package/components/FilePicker/FilePicker.vue2.js +0 -4
  301. package/components/FilePicker/index.d.ts +0 -2
  302. package/components/FileTree/FileTree.vue.d.ts +0 -20
  303. package/components/FileTree/FileTree.vue.js +0 -141
  304. package/components/FileTree/FileTree.vue2.js +0 -4
  305. package/components/FileTree/FileTreeNode.vue.d.ts +0 -28
  306. package/components/FileTree/FileTreeNode.vue.js +0 -155
  307. package/components/FileTree/FileTreeNode.vue2.js +0 -4
  308. package/components/FileTree/index.d.ts +0 -2
  309. package/components/FileTree/types.d.ts +0 -28
  310. package/components/FileTree/useTreeSelection.d.ts +0 -12
  311. package/components/Form/CustomFields.vue.d.ts +0 -38
  312. package/components/Form/CustomFields.vue.js +0 -7
  313. package/components/Form/CustomFields.vue2.js +0 -161
  314. package/components/Form/Form.vue.d.ts +0 -93
  315. package/components/Form/Form.vue.js +0 -7
  316. package/components/Form/Form.vue2.js +0 -236
  317. package/components/Form/FormField.vue.d.ts +0 -28
  318. package/components/Form/FormField.vue.js +0 -212
  319. package/components/Form/FormField.vue2.js +0 -4
  320. package/components/Form/FormFields.vue.d.ts +0 -29
  321. package/components/Form/FormFields.vue.js +0 -7
  322. package/components/Form/FormFields.vue2.js +0 -95
  323. package/components/Form/composables/useFileUpload.d.ts +0 -30
  324. package/components/Form/composables/useFileUpload.js +0 -32
  325. package/components/Form/composables/useForm.d.ts +0 -48
  326. package/components/Form/composables/useForm.js +0 -109
  327. package/components/Form/index.d.ts +0 -9
  328. package/components/Form/types.d.ts +0 -167
  329. package/components/Form/utils/form.utils.d.ts +0 -44
  330. package/components/Form/utils/form.utils.js +0 -97
  331. package/components/Heatmap/Heatmap.vue.d.ts +0 -26
  332. package/components/Heatmap/Heatmap.vue.js +0 -7
  333. package/components/Heatmap/Heatmap.vue2.js +0 -326
  334. package/components/Heatmap/index.d.ts +0 -2
  335. package/components/Heatmap/types.d.ts +0 -66
  336. package/components/Icon.vue.d.ts +0 -7
  337. package/components/Icon.vue.js +0 -25
  338. package/components/Icon.vue2.js +0 -4
  339. package/components/IconPicker.vue.d.ts +0 -38
  340. package/components/IconPicker.vue.js +0 -124
  341. package/components/IconPicker.vue2.js +0 -4
  342. package/components/Input.vue.d.ts +0 -54
  343. package/components/Input.vue.js +0 -259
  344. package/components/Input.vue2.js +0 -4
  345. package/components/Label.vue.d.ts +0 -23
  346. package/components/Label.vue.js +0 -23
  347. package/components/Label.vue2.js +0 -4
  348. package/components/Logo.vue.d.ts +0 -2
  349. package/components/Logo.vue.js +0 -10
  350. package/components/Logo.vue2.js +0 -4
  351. package/components/Masonry/Masonry.vue.d.ts +0 -31
  352. package/components/Masonry/Masonry.vue.js +0 -7
  353. package/components/Masonry/Masonry.vue2.js +0 -83
  354. package/components/Masonry/index.d.ts +0 -2
  355. package/components/Masonry/types.d.ts +0 -33
  356. package/components/Masonry/types.js +0 -10
  357. package/components/Modal.vue.d.ts +0 -43
  358. package/components/Modal.vue.js +0 -100
  359. package/components/Modal.vue2.js +0 -4
  360. package/components/MultiSelect/MultiSelect.vue.d.ts +0 -40
  361. package/components/MultiSelect/MultiSelect.vue.js +0 -126
  362. package/components/MultiSelect/MultiSelect.vue2.js +0 -4
  363. package/components/MultiSelect/index.d.ts +0 -1
  364. package/components/Navbar/Navbar.vue.d.ts +0 -50
  365. package/components/Navbar/Navbar.vue.js +0 -195
  366. package/components/Navbar/Navbar.vue2.js +0 -4
  367. package/components/Navbar/NavbarGroup.vue.d.ts +0 -24
  368. package/components/Navbar/NavbarGroup.vue.js +0 -23
  369. package/components/Navbar/NavbarGroup.vue2.js +0 -4
  370. package/components/Navbar/NavbarItem.vue.d.ts +0 -40
  371. package/components/Navbar/NavbarItem.vue.js +0 -89
  372. package/components/Navbar/NavbarItem.vue2.js +0 -4
  373. package/components/Navbar/index.d.ts +0 -3
  374. package/components/OTPInput/OTPInput.vue.d.ts +0 -33
  375. package/components/OTPInput/OTPInput.vue.js +0 -115
  376. package/components/OTPInput/OTPInput.vue2.js +0 -4
  377. package/components/OTPInput/index.d.ts +0 -1
  378. package/components/Pagination/Pagination.vue.d.ts +0 -34
  379. package/components/Pagination/Pagination.vue.js +0 -196
  380. package/components/Pagination/Pagination.vue2.js +0 -4
  381. package/components/Pagination/index.d.ts +0 -1
  382. package/components/PricingPlan/PricingPlan.vue.d.ts +0 -22
  383. package/components/PricingPlan/PricingPlan.vue.js +0 -55
  384. package/components/PricingPlan/PricingPlan.vue2.js +0 -4
  385. package/components/PricingPlan/PricingPlanItem.vue.d.ts +0 -17
  386. package/components/PricingPlan/PricingPlanItem.vue.js +0 -94
  387. package/components/PricingPlan/PricingPlanItem.vue2.js +0 -4
  388. package/components/PricingPlan/index.d.ts +0 -3
  389. package/components/PricingPlan/types.d.ts +0 -25
  390. package/components/SidePanel.vue.d.ts +0 -58
  391. package/components/SidePanel.vue.js +0 -7
  392. package/components/SidePanel.vue2.js +0 -123
  393. package/components/SidebarMenu/SidebarMenu.vue.d.ts +0 -9
  394. package/components/SidebarMenu/SidebarMenu.vue.js +0 -73
  395. package/components/SidebarMenu/SidebarMenu.vue2.js +0 -4
  396. package/components/SidebarMenu/SidebarMenuItem.vue.d.ts +0 -9
  397. package/components/SidebarMenu/SidebarMenuItem.vue.js +0 -7
  398. package/components/SidebarMenu/SidebarMenuItem.vue2.js +0 -205
  399. package/components/SidebarMenu/index.d.ts +0 -3
  400. package/components/SidebarMenu/types.d.ts +0 -52
  401. package/components/Slider.vue.d.ts +0 -29
  402. package/components/Slider.vue.js +0 -124
  403. package/components/Slider.vue2.js +0 -4
  404. package/components/Switch.vue.d.ts +0 -16
  405. package/components/Switch.vue.js +0 -40
  406. package/components/Switch.vue2.js +0 -4
  407. package/components/Tabes/Tabes.vue.d.ts +0 -21
  408. package/components/Tabes/Tabes.vue.js +0 -75
  409. package/components/Tabes/Tabes.vue2.js +0 -4
  410. package/components/Tabes/index.d.ts +0 -2
  411. package/components/Tabes/types.d.ts +0 -8
  412. package/components/Textarea.vue.d.ts +0 -22
  413. package/components/Textarea.vue.js +0 -34
  414. package/components/Textarea.vue2.js +0 -4
  415. package/components/ThemeToggle.vue.d.ts +0 -2
  416. package/components/ThemeToggle.vue.js +0 -18
  417. package/components/ThemeToggle.vue2.js +0 -4
  418. package/components/Timeline.vue.d.ts +0 -39
  419. package/components/Timeline.vue.js +0 -174
  420. package/components/Timeline.vue2.js +0 -4
  421. package/components/ToastNotification.vue.d.ts +0 -7
  422. package/components/ToastNotification.vue.js +0 -7
  423. package/components/ToastNotification.vue2.js +0 -162
  424. package/components/Tooltip.vue.d.ts +0 -25
  425. package/components/Tooltip.vue.js +0 -39
  426. package/components/Tooltip.vue2.js +0 -4
  427. package/components/Workbook/Sheet.vue.d.ts +0 -38
  428. package/components/Workbook/Sheet.vue.js +0 -141
  429. package/components/Workbook/Sheet.vue2.js +0 -4
  430. package/components/Workbook/Workbook.vue.d.ts +0 -54
  431. package/components/Workbook/Workbook.vue.js +0 -7
  432. package/components/Workbook/Workbook.vue2.js +0 -146
  433. package/components/Workbook/WorkbookAddButton.vue.d.ts +0 -6
  434. package/components/Workbook/WorkbookAddButton.vue.js +0 -20
  435. package/components/Workbook/WorkbookAddButton.vue2.js +0 -4
  436. package/components/Workbook/index.d.ts +0 -3
  437. package/components/Workbook/types.d.ts +0 -34
  438. package/composables/useKeyStroke.d.ts +0 -21
  439. package/composables/useKeyStroke.js +0 -93
  440. package/composables/useNotifications.d.ts +0 -93
  441. package/composables/useNotifications.js +0 -92
  442. package/composables/useTheme.d.ts +0 -6
  443. package/composables/useTheme.js +0 -32
  444. package/directives/vRipple.d.ts +0 -4
  445. package/directives/vRipple.js +0 -17
  446. package/index.d.ts +0 -48
  447. package/index.js +0 -141
  448. package/style.css +0 -545
  449. package/types/alert.type.d.ts +0 -10
  450. package/types/button.d.ts +0 -15
  451. package/types/buttongroup.type.d.ts +0 -1
  452. package/types/form.type.d.ts +0 -45
  453. package/types/index.d.ts +0 -9
  454. package/types/navbar.type.d.ts +0 -26
  455. package/types/sidepanel.type.d.ts +0 -13
  456. package/types/styles.d.ts +0 -28
  457. package/types/timeline.type.d.ts +0 -9
  458. package/utils/functions.js +0 -11
  459. package/utils/index.d.ts +0 -2
  460. package/utils/object.d.ts +0 -6
  461. package/utils/object.js +0 -14
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar"]
3
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Safdar Azeem
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -16,23 +16,19 @@ npm install vlite3
16
16
  yarn add vlite3
17
17
  ```
18
18
 
19
- ## Configuration
19
+ ## 2. Tailwind CSS Setup (Tailwind v4)
20
20
 
21
- ### 1. Import Styles
22
-
23
- Import the library's base styles (for custom component styles) in your main entry file (e.g., `main.ts` or `App.vue`):
21
+ `vite.config.ts`
24
22
 
25
23
  ```ts
26
- import 'vlite3/style.css'
27
- ```
28
-
29
- ### 2. Tailwind CSS Setup
30
-
31
- This library relies on Tailwind CSS for utility classes. You must configure your project to scan the library's files so that the necessary classes are generated.
24
+ import tailwindcss from '@tailwindcss/vite'
32
25
 
33
- #### Tailwind CSS v4
26
+ export default defineConfig({
27
+ plugins: [vue(), tailwindcss()],
28
+ })
29
+ ```
34
30
 
35
- If you are using the new CSS-first configuration, add the source path:
31
+ `style.css`
36
32
 
37
33
  ```css
38
34
  @import 'tailwindcss';
@@ -42,7 +38,7 @@ If you are using the new CSS-first configuration, add the source path:
42
38
  @source "../node_modules/vlite3";
43
39
  ```
44
40
 
45
- ## Usage
41
+ ## 3. Usage
46
42
 
47
43
  Import components directly in your Vue files:
48
44
 
@@ -52,9 +48,254 @@ import { Button, Input } from 'vlite3'
52
48
  </script>
53
49
 
54
50
  <template>
55
- <div class="p-4 space-y-4">
56
- <Button>Click Me</Button>
57
- <Input placeholder="Type here..." />
58
- </div>
51
+ <div class="p-4 space-y-4">
52
+ <Button>Click Me</Button>
53
+ <Input placeholder="Type here..." />
54
+ </div>
55
+ </template>
56
+ ```
57
+
58
+ ## 🎨 Theming & Customization
59
+
60
+ vlite3 uses a semantic theming system inspired by **shadcn/ui** and compatible with **Tailwind CSS v4**. All colors are defined as CSS variables, making it easy to customize the look and feel of your application including Dark Mode support.
61
+
62
+ ### Semantic Colors
63
+
64
+ You can customize these colors in your CSS by overriding the variables in `:root` or `.dark` classes (if you are using a class-based dark mode switcher).
65
+
66
+ | Variable | Class Name | Description | Recommended Usage |
67
+ | :------------------------- | :---------------------------- | :---------------------- | :-------------------------------------------------------------------------- |
68
+ | `--background` | `bg-background` | Default page background | The main background color of your app. |
69
+ | `--foreground` | `text-foreground` | Default text color | The primary text color for content. |
70
+ | `--card` | `bg-card` | Card background | Little Gray Background for cards, containers, surfece, panels, and dialogs. |
71
+ | `--primary` | `bg-primary` | Primary brand color | Used for main actions (buttons, active states). |
72
+ | `--primary-foreground` | `text-primary-foreground` | Primary text color | Text color for content on top of primary background. |
73
+ | `--secondary` | `bg-secondary` | Secondary background | Used for secondary actions or muted sections. |
74
+ | `--secondary-foreground` | `text-secondary-foreground` | Secondary text color | Text color for content on top of secondary background. |
75
+ | `--muted` | `bg-muted` | Muted background | Subtle backgrounds (e.g., table headers, disabled states). |
76
+ | `--muted-foreground` | `text-muted-foreground` | Muted text color | Secondary text, hints, placeholders. |
77
+ | `--accent` | `bg-accent` | Accent background | Used for hover states, selection highlights. |
78
+ | `--accent-foreground` | `text-accent-foreground` | Accent text color | Text color on accent backgrounds. |
79
+ | `--destructive` | `bg-destructive` | Destructive color | Used for error states and destructive actions. |
80
+ | `--destructive-foreground` | `text-destructive-foreground` | Destructive text color | Text color on destructive backgrounds. |
81
+ | `--border` | `border` | Default border color | Borders for inputs, cards, and dividers. |
82
+ | `--input` | `border-input` | Input border color | Borders specifically for form inputs. |
83
+ | `--ring` | `ring-ring` | Focus ring color | Outline color for focused elements. |
84
+ | `--radius` | `rounded` | Border radius | Global border radius for components. |
85
+
86
+ ### Extended Color Variants
87
+
88
+ For more complex components, vlite3 provides extended variants for main semantic colors (`primary`, `danger`, `warning`, `info`, `success`). These are useful for building nuanced UIs with subtle backgrounds, hover states, and accessible text.
89
+
90
+ | Base Color | Variant Variables | Usage Description |
91
+ | :---------- | :------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
92
+ | **Primary** | `--color-primary-light`<br>`--color-primary-dark`<br>`--color-primary-fg`<br>`--color-primary-fg-light` | **Light**: Subtle background (e.g., 10% opacity).<br>**Dark**: Hover state for the main color.<br>**Fg**: Text color on top of the _main_ color.<br>**Fg-Light**: Text color on top of the _light_ variant. |
93
+ | **Danger** | `--color-danger-light`<br>`--color-danger-dark`<br>`--color-danger-fg`<br>`--color-danger-fg-light` | **Light**: Error backgrounds (alerts).<br>**Dark**: Hover state for destructive buttons.<br>**Fg**: Text on destructive buttons.<br>**Fg-Light**: Text on error alerts. |
94
+ | **Warning** | `--color-warning-light`<br>`--color-warning-dark`<br>`--color-warning-fg`<br>`--color-warning-fg-light` | **Light**: Warning backgrounds.<br>**Dark**: Active/Determined warning states.<br>**Fg**: Text on warning badges.<br>**Fg-Light**: Text on warning backgrounds. |
95
+ | **Success** | `--color-success-light`<br>`--color-success-dark`<br>`--color-success-fg`<br>`--color-success-fg-light` | **Light**: Success backgrounds (toasts).<br>**Dark**: Hover/Active success actions.<br>**Fg**: Text on success buttons.<br>**Fg-Light**: Text on success backgrounds. |
96
+ | **Info** | `--color-info-light`<br>`--color-info-dark`<br>`--color-info-fg`<br>`--color-info-fg-light` | **Light**: Info backgrounds.<br>**Dark**: Hover/Active info actions.<br>**Fg**: Text on info buttons.<br>**Fg-Light**: Text on info backgrounds. |
97
+
98
+ **Example Usage:**
99
+
100
+ ```html
101
+ <!-- A success badge with subtle background and matching text -->
102
+ <div class="bg-success-light text-success-fg-light border border-success/20">
103
+ Operation Completed
104
+ </div>
105
+
106
+ <!-- A danger button with hover effect -->
107
+ <button class="bg-danger text-danger-fg hover:bg-danger-dark">Delete</button>
108
+ ```
109
+
110
+ ### Additional Colors
111
+
112
+ vlite3 also provides additional utility colors for specific feedback states:
113
+
114
+ | Variable | Class Name | Description |
115
+ | :---------------- | :--------------------------- | :-------------------------------------- |
116
+ | `--color-success` | `text-success`, `bg-success` | For success messages/badges. |
117
+ | `--color-warning` | `text-warning`, `bg-warning` | For warning messages/badges. |
118
+ | `--color-info` | `text-info`, `bg-info` | For informational messages/badges. |
119
+ | `--color-danger` | `text-danger`, `bg-danger` | Alias for destructive in some contexts. |
120
+
121
+ ### Example Customization
122
+
123
+ To customize the theme, simply override the CSS variables in your main CSS file:
124
+
125
+ ```css
126
+ @layer base {
127
+ :root {
128
+ --primary: #3b82f6; /* Blue-500 */
129
+ --primary-foreground: #ffffff;
130
+ --radius: 0.75rem;
131
+ }
132
+
133
+ .dark {
134
+ --primary: #60a5fa; /* Blue-400 */
135
+ --primary-foreground: #000000;
136
+ }
137
+ }
138
+ ```
139
+
140
+ ## ✅ Components
141
+
142
+ - **Button**
143
+ - **ButtonGroup**
144
+ - **Icon**
145
+ - **Label**
146
+ - **Badge**
147
+ - **Chip**
148
+ - **Logo**
149
+ - **Navbar**
150
+ - **SidebarMenu**
151
+ - **SidePanel**
152
+ - **Masonry Grid**
153
+ - **ThemeToggle**
154
+
155
+ ### Inputs & Forms
156
+
157
+ - **Input**
158
+ - **Textarea**
159
+ - **CheckBox**
160
+ - **Switch**
161
+ - **ChoiceBox**
162
+ - **Slider**
163
+ - **OTPInput**
164
+ - **DatePicker**
165
+ - **ColorPicker**
166
+ - **FilePicker**
167
+ - **AvatarUploader**
168
+ - **IconPicker**
169
+ - **MultiSelect**
170
+ - **Form**
171
+ - **CustomFields**
172
+
173
+ ### Data Display
174
+
175
+ - **Avatar**
176
+ - **Accordion**
177
+ - **Carousel**
178
+ - **DataTable**
179
+ - **Pagination**
180
+ - **Timeline**
181
+ - **Heatmap**
182
+ - **PricingPlan**
183
+ - **FileTree**
184
+ - **Workbook**
185
+ - **Tabes**
186
+
187
+ ### Feedback & Overlays
188
+
189
+ - **Alert**
190
+ - **Modal**
191
+ - **ConfirmationModal**
192
+ - **ToastNotification**
193
+ - **Tooltip**
194
+ - **Dropdown**
195
+
196
+ ## Global Configuration (Registry System)
197
+
198
+ vlite3 features a plugin-based architecture that allows you to register global services. This is particularly useful for dependency injection, such as defining how file uploads should be handled across all `Form` components in your app.
199
+
200
+ ### Setting up the Plugin
201
+
202
+ In your `main.ts` or `main.js`, import `createVLite` and register your services:
203
+
204
+ ```typescript
205
+ import { createApp } from 'vue'
206
+ import App from './App.vue'
207
+ import { createVLite } from 'vlite3'
208
+
209
+ const app = createApp(App)
210
+
211
+ // Initialize VLite with custom configuration
212
+ const vlite = createVLite({
213
+ services: {
214
+ /**
215
+ * Global File Upload Handler
216
+ *
217
+ * This function will be called automatically by:
218
+ * - useFileUpload() composable
219
+ * - Form components (when using 'file', 'fileUploader', or 'avatarUpload' types)
220
+ *
221
+ * @param file - The File object to upload
222
+ * @param folderId - (Optional) Folder ID passed from component props
223
+ * @returns Promise<string> - The public URL of the uploaded file
224
+ */
225
+ upload: async (file, folderId) => {
226
+ // Example: Upload to your own backend
227
+ const formData = new FormData()
228
+ formData.append('file', file)
229
+ if (folderId) formData.append('folder_id', folderId)
230
+
231
+ // Replace with your actual API call (e.g., Axios, Fetch)
232
+ const response = await fetch(
233
+ '[https://api.yourdomain.com/v1/upload](https://api.yourdomain.com/v1/upload)',
234
+ {
235
+ method: 'POST',
236
+ body: formData,
237
+ headers: {
238
+ Authorization: 'Bearer ...',
239
+ },
240
+ }
241
+ )
242
+
243
+ if (!response.ok) throw new Error('Upload failed')
244
+
245
+ const data = await response.json()
246
+ return data.url // MUST return the file URL string
247
+ },
248
+ },
249
+ })
250
+
251
+ app.use(vlite)
252
+ app.mount('#app')
253
+ ```
254
+
255
+ ### How it works
256
+
257
+ Once registered, you don't need to pass upload handlers to individual components.
258
+
259
+ 1. **Automatic Injection**: The `Form` component detects input types like `file`, `avatarUpload`, or `fileUploader`.
260
+ 2. **Parallel Processing**: When the form is submitted, it automatically uploads all files in **parallel** using your registered `upload` service.
261
+ 3. **URL Replacement**: The File objects in your form data are replaced with the returned URLs before the final `onSubmit` event is triggered.
262
+
263
+ ## 4. Usage
264
+
265
+ Import components directly in your Vue files:
266
+
267
+ ```vue
268
+ <script setup>
269
+ import { Button, Input, Form } from 'vlite3'
270
+
271
+ // The form will automatically use the global upload service defined in main.ts
272
+ const schema = [
273
+ {
274
+ name: 'avatar',
275
+ label: 'Profile Picture',
276
+ type: 'avatarUpload',
277
+ },
278
+ {
279
+ name: 'documents',
280
+ label: 'Attachments',
281
+ type: 'fileUploader',
282
+ props: { multiple: true },
283
+ },
284
+ ]
285
+
286
+ const handleSubmit = (payload) => {
287
+ // payload.values.avatar will be a URL string (e.g., "https://api...")
288
+ // payload.values.documents will be an array of URL strings
289
+ console.log(payload.values)
290
+ }
291
+ </script>
292
+
293
+ <template>
294
+ <div class="p-4 space-y-4">
295
+ <Button>Click Me</Button>
296
+ <Input placeholder="Type here..." />
297
+
298
+ <Form :schema="schema" @onSubmit="handleSubmit" />
299
+ </div>
59
300
  </template>
60
301
  ```
package/index.html ADDED
@@ -0,0 +1,16 @@
1
+ <!doctype html>
2
+ <html lang="en" cl>
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
+ <title>vLite3</title>
9
+ </head>
10
+
11
+ <body>
12
+ <div id="app"></div>
13
+ <script type="module" src="/src/main.ts"></script>
14
+ </body>
15
+
16
+ </html>
package/package.json CHANGED
@@ -1,16 +1,19 @@
1
1
  {
2
2
  "name": "vlite3",
3
3
  "private": false,
4
- "description": "A lightweight Vue 3 UI component library built with Tailwind CSS.",
4
+ "description": "A Vue 3 UI component library built with Tailwind CSS.",
5
5
  "license": "MIT",
6
- "version": "0.0.8",
6
+ "version": "0.1.0",
7
7
  "type": "module",
8
8
  "main": "index.js",
9
9
  "module": "index.js",
10
10
  "types": "index.d.ts",
11
+ "author": "safdar-azeem",
12
+ "repository": "https://github.com/safdar-azeem/vlite3",
11
13
  "scripts": {
12
14
  "dev": "vite",
13
15
  "build": "vue-tsc -b && vite build",
16
+ "build:vercel": "vue-tsc -b && vite build --config vite.config.vercel.ts",
14
17
  "postbuild": "node scripts/bundle-css.js",
15
18
  "preview": "vite preview",
16
19
  "prepare:dist": "npm run build && cp package.json README.md dist/",
@@ -63,4 +66,4 @@
63
66
  "endOfLine": "auto",
64
67
  "bracketSameLine": true
65
68
  }
66
- }
69
+ }
@@ -0,0 +1,45 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+
8
+ const distDir = path.resolve(__dirname, '../dist');
9
+ const srcDir = path.resolve(__dirname, '../src/css');
10
+
11
+ // Ensure dist directory exists
12
+ if (!fs.existsSync(distDir)) {
13
+ fs.mkdirSync(distDir, { recursive: true });
14
+ }
15
+
16
+ // Define the order of files to concatenate
17
+ // We recreate the structure of main.css manually but directly embedding content
18
+ // main.css has:
19
+ // @import 'tailwindcss';
20
+ // @layer theme, base, components, utilities;
21
+
22
+ let finalCss = `@import 'tailwindcss';\n@layer theme, base, components, utilities;\n\n`;
23
+
24
+ const filesToRead = ['theme.css', 'base.css', 'input.css'];
25
+
26
+ filesToRead.forEach(file => {
27
+ const filePath = path.join(srcDir, file);
28
+ if (fs.existsSync(filePath)) {
29
+ const content = fs.readFileSync(filePath, 'utf8');
30
+ finalCss += `/* --- ${file} --- */\n${content}\n\n`;
31
+ } else {
32
+ console.warn(`Warning: ${file} not found at ${filePath}`);
33
+ }
34
+ });
35
+
36
+ const outputPath = path.join(distDir, 'style.css');
37
+
38
+ if (fs.existsSync(outputPath)) {
39
+ const existingCss = fs.readFileSync(outputPath, 'utf8');
40
+ finalCss += `/* --- Vite Generated CSS --- */\n${existingCss}\n`;
41
+ }
42
+
43
+ fs.writeFileSync(outputPath, finalCss);
44
+
45
+ console.log(`CSS bundled successfully into ${outputPath}`);
package/src/App.vue ADDED
@@ -0,0 +1,7 @@
1
+ <script setup lang="ts">
2
+ import Playground from './playground/Playground.vue'
3
+ </script>
4
+
5
+ <template>
6
+ <Playground />
7
+ </template>
@@ -0,0 +1,139 @@
1
+ <script setup lang="ts">
2
+ import { ref, watch, computed } from 'vue'
3
+ import type { AccordionProps } from './types'
4
+ import AccordionItem from './AccordionItem.vue'
5
+
6
+ const props = withDefaults(defineProps<AccordionProps>(), {
7
+ allowMultiple: false,
8
+ variant: 'default',
9
+ attached: false,
10
+ items: () => [],
11
+ disabled: false,
12
+ showIndex: false,
13
+ iconVariant: 'simple',
14
+ })
15
+
16
+ const emit = defineEmits<{
17
+ (e: 'update:modelValue', value: string | string[]): void
18
+ (e: 'change', value: string | string[]): void
19
+ }>()
20
+
21
+ // Internal state
22
+ const internalValue = ref<string[]>([])
23
+
24
+ const normalizeValue = (val: string | string[] | undefined): string[] => {
25
+ if (Array.isArray(val)) return val
26
+ if (typeof val === 'string' && val) return [val]
27
+ return []
28
+ }
29
+
30
+ watch(
31
+ () => props.modelValue,
32
+ (newVal) => {
33
+ internalValue.value = normalizeValue(newVal)
34
+ },
35
+ { immediate: true }
36
+ )
37
+
38
+ watch(
39
+ () => props.defaultValue,
40
+ (newVal) => {
41
+ if (!props.modelValue && newVal) {
42
+ internalValue.value = normalizeValue(newVal)
43
+ }
44
+ },
45
+ { immediate: true }
46
+ )
47
+
48
+ const toggleItem = (id: string) => {
49
+ if (props.disabled) return
50
+
51
+ const isOpen = internalValue.value.includes(id)
52
+
53
+ if (props.allowMultiple) {
54
+ if (isOpen) {
55
+ internalValue.value = internalValue.value.filter((v) => v !== id)
56
+ } else {
57
+ internalValue.value = [...internalValue.value, id]
58
+ }
59
+ } else {
60
+ // Single mode
61
+ if (isOpen) {
62
+ internalValue.value = [] // Toggle off if clicking same
63
+ } else {
64
+ internalValue.value = [id]
65
+ }
66
+ }
67
+
68
+ emitChange()
69
+ }
70
+
71
+ const emitChange = () => {
72
+ const val = props.allowMultiple ? internalValue.value : internalValue.value[0] || ''
73
+ emit('update:modelValue', val)
74
+ emit('change', val)
75
+ }
76
+
77
+ const rootClasses = computed(() => {
78
+ const classes = ['w-full', props.class]
79
+
80
+ if (props.attached) {
81
+ // classes.push('rounded-lg overflow-hidden') -> Managed by Items for cleaner edges if separated logic used
82
+ // But for attached, usually the container clips.
83
+ classes.push('rounded-lg overflow-hidden')
84
+
85
+ // Add border to container if it's outline or default attached
86
+ // Solid usually doesn't have a container border if items are solid blocks?
87
+ // But if attached list, yes.
88
+ if (props.variant === 'outline' || props.variant === 'default') {
89
+ classes.push('border')
90
+ }
91
+ if (props.variant === 'solid') {
92
+ // If solid attached, usually no border or just internal dividers?
93
+ // Let's add border to keep it contained.
94
+ classes.push('border')
95
+ }
96
+ }
97
+
98
+ return classes.join(' ')
99
+ })
100
+ </script>
101
+
102
+ <template>
103
+ <div :class="rootClasses">
104
+ <slot>
105
+ <template v-for="(item, index) in items" :key="item.id">
106
+ <AccordionItem
107
+ :item="item"
108
+ :isOpen="internalValue.includes(item.id)"
109
+ :variant="variant"
110
+ :attached="attached"
111
+ :disabled="disabled"
112
+ :index="index + 1"
113
+ :showIndex="showIndex"
114
+ :openIcon="openIcon"
115
+ :closeIcon="closeIcon"
116
+ :iconVariant="iconVariant"
117
+ :activeIconVariant="activeIconVariant"
118
+ :triggerClass="triggerClass"
119
+ :contentClass="contentClass"
120
+ :itemClass="itemClass"
121
+ @toggle="toggleItem">
122
+ <!-- Pass Slots Down -->
123
+ <template v-if="$slots.trigger" #trigger="{ item, open, toggle, triggerClass }">
124
+ <slot
125
+ name="trigger"
126
+ :item="item"
127
+ :open="open"
128
+ :toggle="toggle"
129
+ :triggerClass="triggerClass" />
130
+ </template>
131
+
132
+ <template v-if="$slots.content" #content="{ item }">
133
+ <slot name="content" :close="toggleItem" :item="item" />
134
+ </template>
135
+ </AccordionItem>
136
+ </template>
137
+ </slot>
138
+ </div>
139
+ </template>
@@ -0,0 +1,63 @@
1
+ <script setup lang="ts">
2
+ import { computed, inject } from 'vue'
3
+
4
+ interface Props {
5
+ class?: string
6
+ }
7
+
8
+ const props = withDefaults(defineProps<Props>(), {
9
+ class: '',
10
+ })
11
+
12
+ // In simple implementations, the open state is checked in the parent Item or here.
13
+ // But mostly the Item decides if Content is rendered or if it is v-show.
14
+ // For smooth animation on v-if/v-show, we need a Transition.
15
+
16
+ const beforeEnter = (el: Element) => {
17
+ const element = el as HTMLElement
18
+ element.style.height = '0'
19
+ }
20
+
21
+ const enter = (el: Element) => {
22
+ const element = el as HTMLElement
23
+ element.style.height = element.scrollHeight + 'px'
24
+ }
25
+
26
+ const afterEnter = (el: Element) => {
27
+ const element = el as HTMLElement
28
+ element.style.height = 'auto'
29
+ }
30
+
31
+ const beforeLeave = (el: Element) => {
32
+ const element = el as HTMLElement
33
+ element.style.height = element.scrollHeight + 'px'
34
+ }
35
+
36
+ const leave = (el: Element) => {
37
+ const element = el as HTMLElement
38
+ element.style.height = '0'
39
+ }
40
+ </script>
41
+
42
+ <template>
43
+ <Transition
44
+ name="accordion"
45
+ @before-enter="beforeEnter"
46
+ @enter="enter"
47
+ @after-enter="afterEnter"
48
+ @before-leave="beforeLeave"
49
+ @leave="leave">
50
+ <div class="overflow-hidden text-sm transition-all duration-300 ease-in-out">
51
+ <div :class="['pb-4', props.class]">
52
+ <slot />
53
+ </div>
54
+ </div>
55
+ </Transition>
56
+ </template>
57
+
58
+ <style scoped>
59
+ .accordion-enter-active,
60
+ .accordion-leave-active {
61
+ transition: height 0.3s ease-in-out;
62
+ }
63
+ </style>