vueless 1.1.1-beta.6 → 1.1.1-beta.61

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 (423) hide show
  1. package/LICENSE +1 -1
  2. package/adapter.locale/locales/en.ts +11 -11
  3. package/adapter.locale/vue-i18n.ts +2 -3
  4. package/adapter.locale/vueless.ts +3 -3
  5. package/bin/commands/init.js +15 -38
  6. package/bin/constants.d.ts +3 -0
  7. package/bin/constants.js +0 -14
  8. package/composables/tests/useUI.test.ts +30 -15
  9. package/composables/useAutoPosition.ts +1 -1
  10. package/composables/useBreakpoint.ts +1 -1
  11. package/composables/useComponentLocaleMassages.ts +9 -6
  12. package/composables/useDarkMode.ts +2 -2
  13. package/composables/useLocale.ts +2 -2
  14. package/composables/useMutationObserver.ts +1 -1
  15. package/composables/useUI.ts +5 -5
  16. package/constants.d.ts +334 -0
  17. package/constants.js +23 -1
  18. package/icons/storybook/contact_mail.svg +1 -0
  19. package/icons/storybook/vpn_key.svg +1 -0
  20. package/icons/storybook/web_traffic.svg +1 -0
  21. package/index.d.ts +153 -18
  22. package/index.ts +158 -20
  23. package/modules.d.ts +33 -0
  24. package/package.json +33 -10
  25. package/plugin-vite.d.ts +1 -28
  26. package/plugin-vite.js +33 -28
  27. package/tailwind.css +25 -0
  28. package/types.ts +66 -74
  29. package/ui.boilerplate/UBoilerplate.vue +5 -5
  30. package/ui.boilerplate/storybook/{docs.hidden.mdx → docs.mdx} +3 -3
  31. package/ui.boilerplate/storybook/{stories.hidden.ts → stories.ts} +2 -2
  32. package/ui.boilerplate/tests/UBoilerplate.test.ts +1 -1
  33. package/ui.boilerplate/types.ts +2 -2
  34. package/ui.button/UButton.vue +6 -6
  35. package/ui.button/storybook/docs.mdx +3 -3
  36. package/ui.button/storybook/stories.ts +2 -2
  37. package/ui.button/tests/UButton.test.ts +1 -1
  38. package/ui.button/types.ts +2 -2
  39. package/ui.button-link/ULink.vue +6 -6
  40. package/ui.button-link/storybook/docs.mdx +3 -3
  41. package/ui.button-link/storybook/stories.ts +3 -3
  42. package/ui.button-link/tests/ULink.test.ts +1 -1
  43. package/ui.button-link/types.ts +2 -2
  44. package/ui.button-toggle/UToggle.vue +5 -5
  45. package/ui.button-toggle/storybook/docs.mdx +3 -3
  46. package/ui.button-toggle/storybook/stories.ts +4 -3
  47. package/ui.button-toggle/tests/UToggle.test.ts +1 -1
  48. package/ui.button-toggle/types.ts +2 -2
  49. package/ui.container-accordion/UAccordion.vue +26 -8
  50. package/ui.container-accordion/config.ts +1 -0
  51. package/ui.container-accordion/storybook/docs.mdx +3 -3
  52. package/ui.container-accordion/storybook/stories.ts +30 -3
  53. package/ui.container-accordion/tests/UAccordion.test.ts +47 -1
  54. package/ui.container-accordion/types.ts +2 -2
  55. package/ui.container-card/UCard.vue +6 -6
  56. package/ui.container-card/storybook/docs.mdx +3 -3
  57. package/ui.container-card/storybook/stories.ts +2 -2
  58. package/ui.container-card/tests/UCard.test.ts +1 -1
  59. package/ui.container-card/types.ts +2 -2
  60. package/ui.container-col/UCol.vue +5 -5
  61. package/ui.container-col/storybook/docs.mdx +3 -3
  62. package/ui.container-col/storybook/stories.ts +2 -2
  63. package/ui.container-col/tests/UCol.test.ts +1 -1
  64. package/ui.container-col/types.ts +2 -2
  65. package/ui.container-divider/UDivider.vue +6 -6
  66. package/ui.container-divider/storybook/docs.mdx +3 -3
  67. package/ui.container-divider/storybook/stories.ts +2 -2
  68. package/ui.container-divider/tests/UDivider.test.ts +1 -1
  69. package/ui.container-divider/types.ts +2 -2
  70. package/ui.container-group/UGroup.vue +5 -5
  71. package/ui.container-group/storybook/docs.mdx +3 -3
  72. package/ui.container-group/storybook/stories.ts +2 -2
  73. package/ui.container-group/types.ts +2 -2
  74. package/ui.container-groups/UGroups.vue +5 -5
  75. package/ui.container-groups/storybook/docs.mdx +3 -3
  76. package/ui.container-groups/storybook/stories.ts +2 -2
  77. package/ui.container-groups/tests/UGroups.test.ts +1 -1
  78. package/ui.container-groups/types.ts +2 -2
  79. package/ui.container-modal/UModal.vue +6 -6
  80. package/ui.container-modal/storybook/docs.mdx +3 -3
  81. package/ui.container-modal/storybook/stories.ts +3 -3
  82. package/ui.container-modal/tests/UModal.test.ts +2 -2
  83. package/ui.container-modal/types.ts +2 -2
  84. package/ui.container-modal-confirm/UModalConfirm.vue +7 -7
  85. package/ui.container-modal-confirm/storybook/docs.mdx +3 -3
  86. package/ui.container-modal-confirm/storybook/stories.ts +3 -3
  87. package/ui.container-modal-confirm/tests/UModalConfirm.test.ts +1 -1
  88. package/ui.container-modal-confirm/types.ts +2 -2
  89. package/ui.container-page/UPage.vue +6 -6
  90. package/ui.container-page/storybook/docs.mdx +3 -3
  91. package/ui.container-page/storybook/stories.ts +2 -2
  92. package/ui.container-page/tests/UPage.test.ts +2 -2
  93. package/ui.container-page/types.ts +2 -2
  94. package/ui.container-row/URow.vue +5 -5
  95. package/ui.container-row/storybook/docs.mdx +3 -3
  96. package/ui.container-row/storybook/stories.ts +2 -2
  97. package/ui.container-row/tests/URow.test.ts +1 -1
  98. package/ui.container-row/types.ts +2 -2
  99. package/ui.data-list/UDataList.vue +10 -8
  100. package/ui.data-list/storybook/docs.mdx +3 -3
  101. package/ui.data-list/storybook/stories.ts +3 -3
  102. package/ui.data-list/tests/UDataList.test.ts +1 -1
  103. package/ui.data-list/types.ts +2 -2
  104. package/ui.data-table/UTable.vue +29 -23
  105. package/ui.data-table/UTableRow.vue +8 -8
  106. package/ui.data-table/config.ts +1 -1
  107. package/ui.data-table/storybook/docs.mdx +3 -3
  108. package/ui.data-table/storybook/stories.ts +14 -3
  109. package/ui.data-table/tests/UTable.test.ts +20 -2
  110. package/ui.data-table/tests/UTableRow.test.ts +1 -1
  111. package/ui.data-table/types.ts +3 -3
  112. package/ui.data-table/utilTable.ts +1 -1
  113. package/ui.dropdown-badge/UDropdownBadge.vue +7 -7
  114. package/ui.dropdown-badge/storybook/docs.mdx +3 -3
  115. package/ui.dropdown-badge/storybook/stories.ts +2 -2
  116. package/ui.dropdown-badge/tests/UDropdownBadge.test.ts +1 -1
  117. package/ui.dropdown-badge/types.ts +3 -3
  118. package/ui.dropdown-button/UDropdownButton.vue +8 -7
  119. package/ui.dropdown-button/config.ts +9 -1
  120. package/ui.dropdown-button/storybook/docs.mdx +3 -3
  121. package/ui.dropdown-button/storybook/stories.ts +3 -3
  122. package/ui.dropdown-button/tests/UDropdownButton.test.ts +17 -1
  123. package/ui.dropdown-button/types.ts +8 -3
  124. package/ui.dropdown-link/UDropdownLink.vue +7 -7
  125. package/ui.dropdown-link/config.ts +1 -1
  126. package/ui.dropdown-link/storybook/docs.mdx +3 -3
  127. package/ui.dropdown-link/storybook/stories.ts +2 -2
  128. package/ui.dropdown-link/tests/UDropdownLink.test.ts +1 -1
  129. package/ui.dropdown-link/types.ts +3 -3
  130. package/ui.form-calendar/UCalendar.vue +11 -11
  131. package/ui.form-calendar/UCalendarDayView.vue +6 -6
  132. package/ui.form-calendar/UCalendarMonthView.vue +6 -6
  133. package/ui.form-calendar/UCalendarYearView.vue +6 -6
  134. package/ui.form-calendar/storybook/docs.mdx +3 -3
  135. package/ui.form-calendar/storybook/stories.ts +3 -3
  136. package/ui.form-calendar/tests/UCalendar.test.ts +2 -2
  137. package/ui.form-calendar/tests/UCalendarDayView.test.ts +2 -2
  138. package/ui.form-calendar/tests/UCalendarMonthView.test.ts +2 -2
  139. package/ui.form-calendar/tests/UCalendarYearView.test.ts +2 -2
  140. package/ui.form-calendar/types.ts +3 -3
  141. package/ui.form-calendar/utilCalendar.ts +4 -4
  142. package/ui.form-calendar/utilDate.ts +1 -1
  143. package/ui.form-calendar/utilFormatting.ts +1 -1
  144. package/ui.form-checkbox/UCheckbox.vue +6 -6
  145. package/ui.form-checkbox/storybook/docs.mdx +3 -3
  146. package/ui.form-checkbox/storybook/stories.ts +2 -2
  147. package/ui.form-checkbox/tests/UCheckbox.test.ts +1 -1
  148. package/ui.form-checkbox/types.ts +2 -2
  149. package/ui.form-checkbox-group/UCheckboxGroup.vue +6 -6
  150. package/ui.form-checkbox-group/storybook/docs.mdx +3 -3
  151. package/ui.form-checkbox-group/storybook/stories.ts +2 -2
  152. package/ui.form-checkbox-group/tests/UCheckboxGroup.test.ts +1 -1
  153. package/ui.form-checkbox-group/types.ts +3 -3
  154. package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +8 -8
  155. package/ui.form-checkbox-multi-state/storybook/docs.mdx +3 -3
  156. package/ui.form-checkbox-multi-state/storybook/stories.ts +2 -2
  157. package/ui.form-checkbox-multi-state/tests/UCheckboxMultiState.test.ts +1 -1
  158. package/ui.form-checkbox-multi-state/types.ts +3 -3
  159. package/ui.form-color-picker/UColorPicker.vue +6 -6
  160. package/ui.form-color-picker/storybook/docs.mdx +3 -3
  161. package/ui.form-color-picker/storybook/stories.ts +2 -2
  162. package/ui.form-color-picker/tests/UColorPicker.test.ts +1 -1
  163. package/ui.form-color-picker/types.ts +2 -2
  164. package/ui.form-date-picker/UDatePicker.vue +14 -14
  165. package/ui.form-date-picker/storybook/docs.mdx +3 -3
  166. package/ui.form-date-picker/storybook/stories.ts +3 -3
  167. package/ui.form-date-picker/tests/UDatePicker.test.ts +1 -1
  168. package/ui.form-date-picker/types.ts +2 -2
  169. package/ui.form-date-picker-range/UDatePickerRange.vue +14 -14
  170. package/ui.form-date-picker-range/UDatePickerRangeInputs.vue +6 -6
  171. package/ui.form-date-picker-range/UDatePickerRangePeriodMenu.vue +5 -5
  172. package/ui.form-date-picker-range/storybook/docs.mdx +3 -3
  173. package/ui.form-date-picker-range/storybook/stories.ts +4 -4
  174. package/ui.form-date-picker-range/tests/UDatePickerRange.test.ts +1 -1
  175. package/ui.form-date-picker-range/types.ts +4 -4
  176. package/ui.form-date-picker-range/useLocale.ts +6 -6
  177. package/ui.form-date-picker-range/useUserFormat.ts +5 -5
  178. package/ui.form-date-picker-range/utilDateRange.ts +2 -2
  179. package/ui.form-date-picker-range/utilValidation.ts +1 -1
  180. package/ui.form-input/UInput.vue +7 -7
  181. package/ui.form-input/config.ts +1 -1
  182. package/ui.form-input/storybook/docs.mdx +3 -3
  183. package/ui.form-input/storybook/stories.ts +2 -2
  184. package/ui.form-input/tests/UInput.test.ts +1 -1
  185. package/ui.form-input/types.ts +2 -2
  186. package/ui.form-input-counter/UInputCounter.vue +5 -5
  187. package/ui.form-input-counter/storybook/docs.mdx +3 -3
  188. package/ui.form-input-counter/storybook/stories.ts +2 -2
  189. package/ui.form-input-counter/tests/UInputCounter.test.ts +1 -1
  190. package/ui.form-input-counter/types.ts +2 -2
  191. package/ui.form-input-file/UInputFile.vue +8 -8
  192. package/ui.form-input-file/storybook/docs.mdx +3 -3
  193. package/ui.form-input-file/storybook/stories.ts +2 -2
  194. package/ui.form-input-file/tests/UInputFile.test.ts +1 -1
  195. package/ui.form-input-file/types.ts +2 -2
  196. package/ui.form-input-number/UInputNumber.vue +7 -7
  197. package/ui.form-input-number/storybook/docs.mdx +3 -3
  198. package/ui.form-input-number/storybook/stories.ts +2 -2
  199. package/ui.form-input-number/tests/UInputNumber.test.ts +1 -1
  200. package/ui.form-input-number/types.ts +2 -2
  201. package/ui.form-input-number/useFormatNumber.ts +3 -3
  202. package/ui.form-input-number/utilFormat.ts +2 -2
  203. package/ui.form-input-password/UInputPassword.vue +6 -6
  204. package/ui.form-input-password/storybook/docs.mdx +3 -3
  205. package/ui.form-input-password/storybook/stories.ts +2 -2
  206. package/ui.form-input-password/tests/UInputPassword.test.ts +1 -1
  207. package/ui.form-input-password/types.ts +2 -2
  208. package/ui.form-input-rating/UInputRating.vue +6 -6
  209. package/ui.form-input-rating/storybook/docs.mdx +3 -3
  210. package/ui.form-input-rating/storybook/stories.ts +2 -2
  211. package/ui.form-input-rating/tests/UInputRating.test.ts +1 -1
  212. package/ui.form-input-rating/types.ts +2 -2
  213. package/ui.form-input-search/UInputSearch.vue +6 -6
  214. package/ui.form-input-search/storybook/docs.mdx +3 -3
  215. package/ui.form-input-search/storybook/stories.ts +2 -2
  216. package/ui.form-input-search/tests/UInputSearch.test.ts +1 -1
  217. package/ui.form-input-search/types.ts +2 -2
  218. package/ui.form-label/ULabel.vue +6 -6
  219. package/ui.form-label/storybook/docs.mdx +3 -3
  220. package/ui.form-label/storybook/stories.ts +2 -2
  221. package/ui.form-label/tests/ULabel.test.ts +1 -1
  222. package/ui.form-label/types.ts +2 -2
  223. package/ui.form-listbox/UListbox.vue +10 -10
  224. package/ui.form-listbox/storybook/docs.mdx +3 -3
  225. package/ui.form-listbox/storybook/stories.ts +7 -7
  226. package/ui.form-listbox/tests/UListbox.test.ts +1 -1
  227. package/ui.form-listbox/types.ts +2 -2
  228. package/ui.form-listbox/usePointer.ts +1 -1
  229. package/ui.form-listbox/utilListbox.ts +1 -1
  230. package/ui.form-radio/URadio.vue +6 -6
  231. package/ui.form-radio/storybook/docs.mdx +3 -3
  232. package/ui.form-radio/storybook/stories.ts +2 -2
  233. package/ui.form-radio/tests/URadio.test.ts +1 -1
  234. package/ui.form-radio/types.ts +2 -2
  235. package/ui.form-radio-group/URadioGroup.vue +5 -5
  236. package/ui.form-radio-group/storybook/docs.mdx +3 -3
  237. package/ui.form-radio-group/storybook/stories.ts +2 -2
  238. package/ui.form-radio-group/tests/URadioGroup.test.ts +6 -2
  239. package/ui.form-radio-group/types.ts +2 -2
  240. package/ui.form-select/USelect.vue +13 -12
  241. package/ui.form-select/config.ts +1 -1
  242. package/ui.form-select/storybook/docs.mdx +3 -3
  243. package/ui.form-select/storybook/stories.ts +7 -7
  244. package/ui.form-select/tests/USelect.test.ts +1 -1
  245. package/ui.form-select/types.ts +3 -3
  246. package/ui.form-select/utilSelect.ts +1 -1
  247. package/ui.form-switch/USwitch.vue +6 -6
  248. package/ui.form-switch/storybook/docs.mdx +3 -3
  249. package/ui.form-switch/storybook/stories.ts +2 -2
  250. package/ui.form-switch/tests/USwitch.test.ts +1 -1
  251. package/ui.form-switch/types.ts +2 -2
  252. package/ui.form-textarea/UTextarea.vue +7 -7
  253. package/ui.form-textarea/storybook/docs.mdx +3 -3
  254. package/ui.form-textarea/storybook/stories.ts +3 -3
  255. package/ui.form-textarea/tests/UTextarea.test.ts +1 -1
  256. package/ui.form-textarea/types.ts +2 -2
  257. package/ui.image-avatar/UAvatar.vue +5 -5
  258. package/ui.image-avatar/storybook/docs.mdx +3 -3
  259. package/ui.image-avatar/storybook/stories.ts +3 -3
  260. package/ui.image-avatar/tests/UAvatar.test.ts +1 -1
  261. package/ui.image-avatar/types.ts +2 -2
  262. package/ui.image-icon/UIcon.vue +6 -6
  263. package/ui.image-icon/storybook/docs.mdx +3 -3
  264. package/ui.image-icon/storybook/stories.ts +2 -2
  265. package/ui.image-icon/tests/UIcon.test.ts +0 -1
  266. package/ui.image-icon/types.ts +2 -2
  267. package/ui.loader/ULoader.vue +5 -5
  268. package/ui.loader/storybook/docs.mdx +3 -3
  269. package/ui.loader/storybook/stories.ts +2 -2
  270. package/ui.loader/tests/ULoader.test.ts +1 -1
  271. package/ui.loader/types.ts +2 -2
  272. package/ui.loader-overlay/ULoaderOverlay.vue +6 -6
  273. package/ui.loader-overlay/storybook/docs.mdx +3 -3
  274. package/ui.loader-overlay/storybook/stories.ts +2 -2
  275. package/ui.loader-overlay/tests/ULoaderOverlay.test.ts +2 -2
  276. package/ui.loader-overlay/types.ts +2 -2
  277. package/ui.loader-progress/ULoaderProgress.vue +7 -7
  278. package/ui.loader-progress/storybook/docs.mdx +3 -3
  279. package/ui.loader-progress/storybook/stories.ts +4 -4
  280. package/ui.loader-progress/tests/ULoaderProgress.test.ts +2 -2
  281. package/ui.loader-progress/types.ts +2 -2
  282. package/ui.loader-progress/useLoaderProgress.ts +1 -1
  283. package/ui.navigation-breadcrumbs/UBreadcrumbs.vue +6 -6
  284. package/ui.navigation-breadcrumbs/storybook/docs.mdx +3 -3
  285. package/ui.navigation-breadcrumbs/storybook/stories.ts +13 -2
  286. package/ui.navigation-breadcrumbs/tests/UBreadcrumbs.test.ts +2 -2
  287. package/ui.navigation-breadcrumbs/types.ts +3 -3
  288. package/ui.navigation-pagination/UPagination.vue +7 -12
  289. package/ui.navigation-pagination/config.ts +1 -0
  290. package/ui.navigation-pagination/storybook/docs.mdx +3 -3
  291. package/ui.navigation-pagination/storybook/stories.ts +5 -3
  292. package/ui.navigation-pagination/tests/UPagination.test.ts +2 -2
  293. package/ui.navigation-pagination/types.ts +3 -3
  294. package/ui.navigation-progress/UProgress.vue +5 -5
  295. package/ui.navigation-progress/UStepperProgress.vue +3 -3
  296. package/ui.navigation-progress/storybook/docs.mdx +3 -3
  297. package/ui.navigation-progress/storybook/stories.ts +2 -2
  298. package/ui.navigation-progress/tests/UProgress.test.ts +1 -1
  299. package/ui.navigation-progress/types.ts +2 -2
  300. package/ui.navigation-tab/UTab.vue +6 -6
  301. package/ui.navigation-tab/storybook/docs.mdx +3 -3
  302. package/ui.navigation-tab/storybook/stories.ts +2 -2
  303. package/ui.navigation-tab/types.ts +2 -2
  304. package/ui.navigation-tabs/UTabs.vue +5 -5
  305. package/ui.navigation-tabs/storybook/docs.mdx +3 -3
  306. package/ui.navigation-tabs/storybook/stories.ts +2 -2
  307. package/ui.navigation-tabs/tests/UTabs.test.ts +1 -1
  308. package/ui.navigation-tabs/types.ts +2 -2
  309. package/ui.other-chip/UChip.vue +5 -5
  310. package/ui.other-chip/storybook/docs.mdx +3 -3
  311. package/ui.other-chip/storybook/stories.ts +13 -2
  312. package/ui.other-chip/tests/UChip.test.ts +1 -1
  313. package/ui.other-chip/types.ts +2 -2
  314. package/ui.other-dot/UDot.vue +5 -5
  315. package/ui.other-dot/storybook/docs.mdx +3 -3
  316. package/ui.other-dot/storybook/stories.ts +2 -2
  317. package/ui.other-dot/tests/UDot.test.ts +1 -1
  318. package/ui.other-dot/types.ts +2 -2
  319. package/ui.other-theme-color-toggle/UThemeColorToggle.vue +6 -6
  320. package/ui.other-theme-color-toggle/storybook/docs.mdx +3 -3
  321. package/ui.other-theme-color-toggle/storybook/stories.ts +2 -2
  322. package/ui.other-theme-color-toggle/tests/UThemeColorToggle.test.ts +1 -1
  323. package/ui.other-theme-color-toggle/types.ts +2 -2
  324. package/ui.skeleton/USkeleton.vue +5 -5
  325. package/ui.skeleton/storybook/docs.mdx +3 -3
  326. package/ui.skeleton/storybook/stories.ts +7 -2
  327. package/ui.skeleton/tests/USkeleton.test.ts +1 -1
  328. package/ui.skeleton/types.ts +2 -2
  329. package/ui.skeleton-choice/USkeletonChoice.vue +5 -5
  330. package/ui.skeleton-choice/storybook/docs.mdx +3 -3
  331. package/ui.skeleton-choice/storybook/stories.ts +7 -2
  332. package/ui.skeleton-choice/tests/USkeletonChoice.test.ts +1 -1
  333. package/ui.skeleton-choice/types.ts +2 -2
  334. package/ui.skeleton-input/USkeletonInput.vue +5 -5
  335. package/ui.skeleton-input/storybook/docs.mdx +3 -3
  336. package/ui.skeleton-input/storybook/stories.ts +13 -2
  337. package/ui.skeleton-input/tests/USkeletonInput.test.ts +1 -1
  338. package/ui.skeleton-input/types.ts +2 -2
  339. package/ui.skeleton-text/USkeletonText.vue +5 -5
  340. package/ui.skeleton-text/storybook/docs.mdx +3 -3
  341. package/ui.skeleton-text/storybook/stories.ts +7 -2
  342. package/ui.skeleton-text/tests/USkeletonText.test.ts +1 -1
  343. package/ui.skeleton-text/types.ts +2 -2
  344. package/ui.text-alert/UAlert.vue +6 -6
  345. package/ui.text-alert/storybook/docs.mdx +3 -3
  346. package/ui.text-alert/storybook/stories.ts +2 -2
  347. package/ui.text-alert/tests/UAlert.test.ts +1 -1
  348. package/ui.text-alert/types.ts +2 -2
  349. package/ui.text-badge/UBadge.vue +6 -6
  350. package/ui.text-badge/storybook/docs.mdx +3 -3
  351. package/ui.text-badge/storybook/stories.ts +2 -2
  352. package/ui.text-badge/tests/UBadge.test.ts +1 -1
  353. package/ui.text-badge/types.ts +2 -2
  354. package/ui.text-block/UText.vue +5 -5
  355. package/ui.text-block/storybook/docs.mdx +3 -3
  356. package/ui.text-block/storybook/stories.ts +2 -2
  357. package/ui.text-block/tests/UText.test.ts +1 -1
  358. package/ui.text-block/types.ts +2 -2
  359. package/ui.text-empty/UEmpty.vue +5 -5
  360. package/ui.text-empty/storybook/docs.mdx +3 -3
  361. package/ui.text-empty/storybook/stories.ts +2 -2
  362. package/ui.text-empty/tests/UEmpty.test.ts +1 -1
  363. package/ui.text-empty/types.ts +2 -2
  364. package/ui.text-file/UFile.vue +5 -5
  365. package/ui.text-file/storybook/docs.mdx +3 -3
  366. package/ui.text-file/storybook/stories.ts +2 -2
  367. package/ui.text-file/tests/UFile.test.ts +1 -1
  368. package/ui.text-file/types.ts +2 -2
  369. package/ui.text-files/UFiles.vue +6 -6
  370. package/ui.text-files/storybook/docs.mdx +3 -3
  371. package/ui.text-files/storybook/stories.ts +2 -2
  372. package/ui.text-files/tests/UFiles.test.ts +1 -1
  373. package/ui.text-files/types.ts +2 -2
  374. package/ui.text-header/UHeader.vue +5 -5
  375. package/ui.text-header/storybook/docs.mdx +3 -3
  376. package/ui.text-header/storybook/stories.ts +2 -2
  377. package/ui.text-header/tests/UHeader.test.ts +1 -1
  378. package/ui.text-header/types.ts +2 -2
  379. package/ui.text-notify/UNotify.vue +6 -6
  380. package/ui.text-notify/storybook/docs.mdx +3 -3
  381. package/ui.text-notify/storybook/stories.ts +3 -3
  382. package/ui.text-notify/tests/UNotify.test.ts +4 -4
  383. package/ui.text-notify/types.ts +3 -3
  384. package/ui.text-notify/utilNotify.ts +3 -3
  385. package/ui.text-number/UNumber.vue +6 -6
  386. package/ui.text-number/storybook/docs.mdx +3 -3
  387. package/ui.text-number/storybook/stories.ts +13 -2
  388. package/ui.text-number/tests/UNumber.test.ts +2 -2
  389. package/ui.text-number/types.ts +2 -2
  390. package/utils/helper.ts +1 -1
  391. package/utils/node/dynamicProps.d.ts +2 -0
  392. package/utils/node/dynamicProps.js +17 -8
  393. package/utils/node/helper.d.ts +15 -0
  394. package/utils/node/helper.js +73 -27
  395. package/utils/node/loaderIcon.d.ts +7 -0
  396. package/utils/node/loaderIcon.js +12 -8
  397. package/utils/node/loaderSvg.d.ts +1 -0
  398. package/utils/node/mergeConfigs.d.ts +13 -0
  399. package/utils/node/storybook.d.ts +2 -0
  400. package/utils/node/storybook.js +89 -0
  401. package/utils/node/tailwindSafelist.d.ts +6 -0
  402. package/utils/node/vuelessConfig.d.ts +9 -0
  403. package/utils/node/vuelessConfig.js +30 -11
  404. package/utils/node/vuelessResolver.d.ts +13 -0
  405. package/utils/node/vuelessResolver.js +30 -14
  406. package/utils/node/webTypes.d.ts +1 -0
  407. package/utils/node/webTypes.js +4 -2
  408. package/utils/platform.ts +1 -1
  409. package/utils/storybook.ts +2 -2
  410. package/utils/theme.ts +20 -18
  411. package/utils/ui.ts +33 -8
  412. package/{directives/clickOutside → v.click-outside}/storybook/docs.mdx +2 -2
  413. package/{directives/clickOutside → v.click-outside}/storybook/stories.ts +5 -5
  414. package/{directives/clickOutside → v.click-outside}/vClickOutside.ts +1 -1
  415. package/v.tooltip/storybook/docs.mdx +47 -0
  416. package/{directives/tooltip → v.tooltip}/storybook/stories.ts +14 -11
  417. package/{directives/tooltip → v.tooltip}/vTooltip.ts +4 -9
  418. package/directives/index.js +0 -7
  419. package/directives/tooltip/storybook/docs.mdx +0 -10
  420. package/utils/node/dynamicStories.js +0 -62
  421. package/utils/tailwindConfig.ts +0 -36
  422. /package/{directives/clickOutside → v.click-outside}/types.ts +0 -0
  423. /package/{directives/tooltip → v.tooltip}/types.ts +0 -0
@@ -1,14 +1,14 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, useTemplateRef } from "vue";
3
3
 
4
- import useUI from "../composables/useUI.ts";
5
- import { getDefaults } from "../utils/ui.ts";
4
+ import useUI from "../composables/useUI";
5
+ import { getDefaults } from "../utils/ui";
6
6
 
7
- import { COMPONENT_NAME } from "./constants.ts";
8
- import defaultConfig from "./config.ts";
9
- import { separatedNumber, MATH_SIGN_TYPE, MATH_SIGN } from "./utilNumber.ts";
7
+ import { COMPONENT_NAME } from "./constants";
8
+ import defaultConfig from "./config";
9
+ import { separatedNumber, MATH_SIGN_TYPE, MATH_SIGN } from "./utilNumber";
10
10
 
11
- import type { Props, Config } from "./types.ts";
11
+ import type { Props, Config } from "./types";
12
12
 
13
13
  defineOptions({ inheritAttrs: false });
14
14
 
@@ -1,8 +1,8 @@
1
1
  import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/addon-docs/blocks";
2
- import { getSource } from "../../utils/storybook.ts";
2
+ import { getSource } from "../../utils/storybook";
3
3
 
4
- import * as stories from "./stories.ts";
5
- import defaultConfig from "../config.ts?raw"
4
+ import * as stories from "./stories";
5
+ import defaultConfig from "../config?raw"
6
6
 
7
7
  <Meta of={stories} />
8
8
  <Title of={stories} />
@@ -1,4 +1,10 @@
1
- import { getArgs, getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
1
+ import {
2
+ getArgs,
3
+ getArgTypes,
4
+ getSlotNames,
5
+ getSlotsFragment,
6
+ getDocsDescription,
7
+ } from "../../utils/storybook";
2
8
 
3
9
  import UNumber from "../../ui.text-number/UNumber.vue";
4
10
  import UIcon from "../../ui.image-icon/UIcon.vue";
@@ -6,7 +12,7 @@ import URow from "../../ui.container-row/URow.vue";
6
12
  import UCol from "../../ui.container-col/UCol.vue";
7
13
 
8
14
  import type { Meta, StoryFn } from "@storybook/vue3-vite";
9
- import type { Props } from "../types.ts";
15
+ import type { Props } from "../types";
10
16
 
11
17
  interface UNumberArgs extends Props {
12
18
  slotTemplate?: string;
@@ -23,6 +29,11 @@ export default {
23
29
  argTypes: {
24
30
  ...getArgTypes(UNumber.__name),
25
31
  },
32
+ parameters: {
33
+ docs: {
34
+ ...getDocsDescription(UNumber.__name),
35
+ },
36
+ },
26
37
  } as Meta;
27
38
 
28
39
  const DefaultTemplate: StoryFn<UNumberArgs> = (args: UNumberArgs) => ({
@@ -2,9 +2,9 @@ import { mount } from "@vue/test-utils";
2
2
  import { describe, it, expect, beforeAll } from "vitest";
3
3
 
4
4
  import UNumber from "../UNumber.vue";
5
- import { MATH_SIGN, MATH_SIGN_TYPE } from "../utilNumber.ts";
5
+ import { MATH_SIGN, MATH_SIGN_TYPE } from "../utilNumber";
6
6
 
7
- import type { Props } from "../types.ts";
7
+ import type { Props } from "../types";
8
8
 
9
9
  describe("UNumber.vue", () => {
10
10
  let value: number;
@@ -1,5 +1,5 @@
1
- import defaultConfig from "./config.ts";
2
- import type { ComponentConfig } from "../types.ts";
1
+ import defaultConfig from "./config";
2
+ import type { ComponentConfig } from "../types";
3
3
 
4
4
  export type Config = typeof defaultConfig;
5
5
 
package/utils/helper.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { UnknownObject } from "../types.ts";
1
+ import type { UnknownObject } from "../types";
2
2
  import { Comment, Text, Fragment } from "vue";
3
3
 
4
4
  import type { Slot, VNode } from "vue";
@@ -0,0 +1,2 @@
1
+ export function setCustomPropTypes(srcDir: any): Promise<void>;
2
+ export function removeCustomPropTypes(srcDir: any): Promise<void>;
@@ -2,9 +2,11 @@ import fs from "node:fs/promises";
2
2
  import { existsSync } from "node:fs";
3
3
  import path from "node:path";
4
4
 
5
+ import { removeFolderIfEmpty } from "./helper.js";
5
6
  import { vuelessConfig } from "./vuelessConfig.js";
6
7
 
7
8
  import {
9
+ CACHE_DIR,
8
10
  COMPONENTS,
9
11
  GRAYSCALE_COLOR,
10
12
  INHERIT_COLOR,
@@ -74,9 +76,8 @@ export async function setCustomPropTypes(srcDir) {
74
76
  }
75
77
 
76
78
  const isCustomProps = componentGlobalConfig && componentGlobalConfig.props;
77
- const isHiddenStories = componentGlobalConfig && componentGlobalConfig.storybook === false;
78
79
 
79
- if (isCustomProps && !isHiddenStories) {
80
+ if (isCustomProps) {
80
81
  await cacheComponentTypes(path.join(srcDir, componentDir));
81
82
  await modifyComponentTypes(path.join(srcDir, componentDir), componentGlobalConfig.props);
82
83
  }
@@ -91,26 +92,34 @@ export async function removeCustomPropTypes(srcDir) {
91
92
  }
92
93
 
93
94
  async function cacheComponentTypes(filePath) {
94
- const cacheDir = path.join(filePath, ".cache");
95
+ const cacheDir = path.join(filePath, CACHE_DIR);
95
96
  const sourceFile = path.join(filePath, "types.ts");
96
97
  const destFile = path.join(cacheDir, "types.ts");
97
98
 
98
- if (existsSync(cacheDir)) {
99
+ if (existsSync(destFile) || !existsSync(sourceFile)) {
99
100
  return;
100
101
  }
101
102
 
102
- if (existsSync(sourceFile)) {
103
+ if (!existsSync(cacheDir)) {
103
104
  await fs.mkdir(cacheDir);
104
- await fs.cp(sourceFile, destFile);
105
105
  }
106
+
107
+ await fs.cp(sourceFile, destFile);
106
108
  }
107
109
 
108
110
  async function clearComponentTypesCache(filePath) {
109
- await fs.rm(path.join(filePath, ".cache"), { force: true, recursive: true });
111
+ const cacheDir = path.join(filePath, CACHE_DIR);
112
+ const sourceFile = path.join(cacheDir, "types.ts");
113
+
114
+ if (existsSync(sourceFile)) {
115
+ await fs.rm(sourceFile, { force: true });
116
+ }
117
+
118
+ await removeFolderIfEmpty(cacheDir);
110
119
  }
111
120
 
112
121
  async function restoreComponentTypes(filePath) {
113
- const cacheDir = path.join(filePath, ".cache");
122
+ const cacheDir = path.join(filePath, CACHE_DIR);
114
123
  const sourceFile = path.join(cacheDir, "types.ts");
115
124
  const destFile = path.join(filePath, "types.ts");
116
125
 
@@ -0,0 +1,15 @@
1
+ export function getDirFiles(dirPath: any, ext: any, { recursive, exclude }?: {
2
+ recursive?: boolean | undefined;
3
+ exclude?: never[] | undefined;
4
+ }): Promise<string[]>;
5
+ export function getNuxtDirs(): string[];
6
+ export function getVueDirs(): string[];
7
+ export function getVuelessConfigDirs(): string[];
8
+ export function getMergedComponentConfig(name: any): Promise<any>;
9
+ export function getDefaultComponentConfig(name: any, configDir: any): Promise<{}>;
10
+ export function cacheMergedConfigs(srcDir: any): Promise<void>;
11
+ export function buildTSFile(entryPath: any, configOutFile: any): Promise<void>;
12
+ export function removeFolderIfEmpty(dirPath: any): Promise<void>;
13
+ export function detectTypeScript(): Promise<boolean>;
14
+ export function autoImportUserConfigs(basePath?: string): Promise<void>;
15
+ export function generateConfigIndexContent(imports?: string[], componentEntries?: string[]): Promise<string>;
@@ -3,7 +3,7 @@ import path from "node:path";
3
3
  import { cwd } from "node:process";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import { existsSync, statSync } from "node:fs";
6
- import { mkdir, readdir, readFile, writeFile } from "node:fs/promises";
6
+ import { mkdir, readdir, rmdir, readFile, writeFile } from "node:fs/promises";
7
7
 
8
8
  import { vuelessConfig, getMergedConfig } from "./vuelessConfig.js";
9
9
 
@@ -11,15 +11,14 @@ import {
11
11
  COMPONENTS,
12
12
  JAVASCRIPT_EXT,
13
13
  TYPESCRIPT_EXT,
14
- VUELESS_CONFIGS_CACHED_DIR,
15
- VUELESS_MERGED_CONFIGS_CACHED_DIR,
16
- } from "../../constants.js";
17
-
18
- import {
19
14
  SUPPRESS_TS_CHECK,
15
+ VUELESS_CONFIG_DIR,
20
16
  COMPONENTS_INDEX_EXPORT,
21
17
  COMPONENTS_INDEX_COMMENT,
22
- } from "../../bin/constants.js";
18
+ VUELESS_CONFIGS_CACHED_DIR,
19
+ VUELESS_MERGED_CONFIGS_CACHED_DIR,
20
+ CONFIG_INDEX_FILE_NAME,
21
+ } from "../../constants.js";
23
22
 
24
23
  export async function getDirFiles(dirPath, ext, { recursive = true, exclude = [] } = {}) {
25
24
  let fileNames = [];
@@ -68,6 +67,7 @@ export async function getDirFiles(dirPath, ext, { recursive = true, exclude = []
68
67
 
69
68
  export function getNuxtDirs() {
70
69
  return [
70
+ path.join(cwd(), "app"),
71
71
  path.join(cwd(), "composables"),
72
72
  path.join(cwd(), "components"),
73
73
  path.join(cwd(), "layouts"),
@@ -87,7 +87,7 @@ export function getVueDirs() {
87
87
  }
88
88
 
89
89
  export function getVuelessConfigDirs() {
90
- return [path.join(cwd(), ".vueless")];
90
+ return [path.join(cwd(), VUELESS_CONFIG_DIR)];
91
91
  }
92
92
 
93
93
  export async function getMergedComponentConfig(name) {
@@ -157,25 +157,64 @@ export async function buildTSFile(entryPath, configOutFile) {
157
157
  });
158
158
  }
159
159
 
160
- export async function autoImportUserConfigs() {
161
- const vuelessConfigDir = path.join(cwd(), ".vueless");
160
+ export async function removeFolderIfEmpty(dirPath) {
161
+ if (existsSync(dirPath)) {
162
+ const files = await readdir(dirPath);
163
+
164
+ if (!files.length) {
165
+ await rmdir(dirPath);
166
+ }
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Detects if TypeScript is a dependency in the project's package.json
172
+ * @returns {Promise<boolean>} True if TypeScript is found in dependencies or devDependencies
173
+ */
174
+ export async function detectTypeScript() {
175
+ try {
176
+ const packageJsonPath = path.join(cwd(), "package.json");
177
+ const packageJsonContent = await readFile(packageJsonPath, "utf-8");
178
+ const pkg = JSON.parse(packageJsonContent);
179
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
162
180
 
163
- const indexTsPath = path.join(vuelessConfigDir, "index.ts");
164
- const indexJsPath = path.join(vuelessConfigDir, "index.js");
181
+ return Boolean(deps.typescript);
182
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
183
+ } catch (error) {
184
+ return false;
185
+ }
186
+ }
165
187
 
166
- const hasTsIndex = existsSync(indexTsPath);
167
- const indexFilePath = hasTsIndex ? indexTsPath : indexJsPath;
168
- const fileExt = hasTsIndex ? TYPESCRIPT_EXT : JAVASCRIPT_EXT;
188
+ /**
189
+ * Automatically imports user configuration files from a specified directory, generates index file entries for them,
190
+ * and writes the configuration index file in the appropriate format (TypeScript or JavaScript).
191
+ *
192
+ * @param {string} [basePath=""] The base directory path where the user configuration files are located.
193
+ * @return {Promise<void>} A promise that resolves when the configuration import and index file generation is completed.
194
+ */
195
+ export async function autoImportUserConfigs(basePath = "") {
196
+ const vuelessConfigDir = path.join(cwd(), basePath, VUELESS_CONFIG_DIR);
197
+
198
+ const indexTsPath = path.join(vuelessConfigDir, `${CONFIG_INDEX_FILE_NAME}${TYPESCRIPT_EXT}`);
199
+ const indexJsPath = path.join(vuelessConfigDir, `${CONFIG_INDEX_FILE_NAME}${JAVASCRIPT_EXT}`);
200
+
201
+ const hasTypeScript = await detectTypeScript();
202
+
203
+ const indexFilePath = hasTypeScript ? indexTsPath : indexJsPath;
204
+ const fileExt = hasTypeScript ? TYPESCRIPT_EXT : JAVASCRIPT_EXT;
169
205
 
170
206
  const configFiles = await getDirFiles(vuelessConfigDir, fileExt, {
171
207
  recursive: true,
172
- exclude: ["index.ts", "index.js"],
208
+ exclude: [
209
+ `${CONFIG_INDEX_FILE_NAME}${TYPESCRIPT_EXT}`,
210
+ `${CONFIG_INDEX_FILE_NAME}${JAVASCRIPT_EXT}`,
211
+ ],
173
212
  });
174
213
 
175
214
  const componentConfigFiles = configFiles.filter((filePath) => {
176
215
  const fileName = path.basename(filePath);
177
216
 
178
- return /^U\w+\.config\.(ts|js)$/.test(fileName);
217
+ return /^U\w+\.(ts|js)$/.test(fileName);
179
218
  });
180
219
 
181
220
  const imports = [];
@@ -184,12 +223,11 @@ export async function autoImportUserConfigs() {
184
223
  if (componentConfigFiles.length) {
185
224
  for (const configFilePath of componentConfigFiles) {
186
225
  const fileName = path.basename(configFilePath, path.extname(configFilePath));
187
- const componentName = fileName.replace(".config", "");
188
226
  const relativePath = path.relative(vuelessConfigDir, configFilePath);
189
227
  const importPath = "./" + relativePath.replace(/\\/g, "/");
190
228
 
191
- imports.push(`import ${componentName} from "${importPath}";`);
192
- componentEntries.push(` ${componentName},`);
229
+ imports.push(`import ${fileName} from "${importPath}";`);
230
+ componentEntries.push(` ${fileName},`);
193
231
  }
194
232
  }
195
233
 
@@ -197,17 +235,25 @@ export async function autoImportUserConfigs() {
197
235
  await mkdir(vuelessConfigDir, { recursive: true });
198
236
  }
199
237
 
200
- await writeFile(
201
- indexFilePath,
202
- generateConfigIndexContent(imports, componentEntries, hasTsIndex),
203
- "utf-8",
204
- );
238
+ const indexFileContent = await generateConfigIndexContent(imports, componentEntries);
239
+
240
+ await writeFile(indexFilePath, indexFileContent, "utf-8");
205
241
  }
206
242
 
207
- function generateConfigIndexContent(imports = [], componentEntries = [], isTypeScript) {
243
+ /**
244
+ * Generates the content for a configuration index file by combining imports, component entries,
245
+ * and TypeScript-related handling.
246
+ *
247
+ * @param {string[]} imports - An array of import statements to include in the configuration index file.
248
+ * @param {string[]} componentEntries - An array of component entry definitions to export in the configuration index file.
249
+ * @return {Promise<string>} The constructed configuration indexes file content as a string.
250
+ */
251
+ export async function generateConfigIndexContent(imports = [], componentEntries = []) {
208
252
  const importsSection = imports.length ? `\n${imports.join("\n")}\n\n` : "";
209
253
  const entriesSection = componentEntries.length ? `\n${componentEntries.join("\n")}\n` : "";
210
- const suppressTsCheck = isTypeScript ? `${SUPPRESS_TS_CHECK}\n` : "";
254
+
255
+ const hasTypeScript = await detectTypeScript();
256
+ const suppressTsCheck = hasTypeScript ? `${SUPPRESS_TS_CHECK}\n` : "";
211
257
 
212
258
  return `${suppressTsCheck}${COMPONENTS_INDEX_COMMENT}\n${importsSection}${COMPONENTS_INDEX_EXPORT.replace(
213
259
  "{}",
@@ -0,0 +1,7 @@
1
+ export function createIconsCache({ env, debug, targetFiles }?: string): Promise<void>;
2
+ export function removeIconsCache(basePath: string, isVuelessEnv?: boolean): Promise<void>;
3
+ export function copyIconsCache(basePath: string, isVuelessEnv?: boolean): Promise<void>;
4
+ export function generateIconExports(): string;
5
+ export function reloadServerOnIconsCacheUpdate(server: Object): void;
6
+ export function extractIconLines(content: string): string[];
7
+ export function isIconChanged(currentLines: string[], previousLines: string[]): boolean;
@@ -77,18 +77,20 @@ export async function createIconsCache({ env, debug = false, targetFiles = [] }
77
77
 
78
78
  /**
79
79
  * Remove cached icons.
80
- * @param {string} mirrorCacheDir
80
+ * @param {string} basePath
81
+ * @param {boolean} isVuelessEnv
81
82
  * @returns {Promise<void>}
82
83
  */
83
- export async function removeIconsCache(mirrorCacheDir) {
84
+ export async function removeIconsCache(basePath, isVuelessEnv = false) {
84
85
  const cachePath = path.join(cwd(), ICONS_CACHED_DIR);
85
86
 
86
87
  if (fs.existsSync(cachePath)) {
87
88
  await rm(cachePath, { recursive: true, force: true });
88
89
  }
89
90
 
90
- if (mirrorCacheDir) {
91
- const mirrorCacheIconsPath = path.join(cwd(), mirrorCacheDir, ICONS_DIR);
91
+ if (basePath) {
92
+ const iconsDir = isVuelessEnv ? ICONS_DIR : ICONS_CACHED_DIR;
93
+ const mirrorCacheIconsPath = path.join(cwd(), basePath, iconsDir);
92
94
 
93
95
  if (fs.existsSync(mirrorCacheIconsPath)) {
94
96
  await rm(mirrorCacheIconsPath, { recursive: true, force: true });
@@ -98,14 +100,16 @@ export async function removeIconsCache(mirrorCacheDir) {
98
100
 
99
101
  /**
100
102
  * Copy cached icons in the provided folder by path.
101
- * @param {string} mirrorCacheDir
103
+ * @param {string} basePath
104
+ * @param {boolean} isVuelessEnv
102
105
  * @returns {Promise<void>}
103
106
  */
104
- export async function copyIconsCache(mirrorCacheDir) {
107
+ export async function copyIconsCache(basePath, isVuelessEnv = false) {
105
108
  const cachePath = path.join(cwd(), ICONS_CACHED_DIR);
106
109
 
107
- if (mirrorCacheDir && fs.existsSync(cachePath)) {
108
- const mirrorPath = path.join(cwd(), mirrorCacheDir, ICONS_DIR);
110
+ if (basePath && fs.existsSync(cachePath)) {
111
+ const iconsDir = isVuelessEnv ? ICONS_DIR : ICONS_CACHED_DIR;
112
+ const mirrorPath = path.join(cwd(), basePath, iconsDir);
109
113
 
110
114
  await cp(cachePath, mirrorPath, { recursive: true });
111
115
  }
@@ -0,0 +1 @@
1
+ export function loadSvg(id: any, options: any): Promise<string | undefined>;
@@ -0,0 +1,13 @@
1
+ export function createMergeConfigs(cx: any): ({ defaultConfig, globalConfig, propsConfig, config, isVariants, }: {
2
+ defaultConfig: any;
3
+ globalConfig: any;
4
+ propsConfig: any;
5
+ config?: {} | undefined;
6
+ isVariants?: boolean | undefined;
7
+ }) => {};
8
+ export function createGetMergedConfig(cx: any): ({ defaultConfig, globalConfig, propsConfig, unstyled }: {
9
+ defaultConfig: any;
10
+ globalConfig: any;
11
+ propsConfig: any;
12
+ unstyled: any;
13
+ }) => {};
@@ -0,0 +1,2 @@
1
+ export function defineConfigWithVueless(config: Object): Promise<Object>;
2
+ export function getVuelessStoriesGlob(vuelessEnv: string): Promise<string[]>;
@@ -0,0 +1,89 @@
1
+ import { getVuelessConfig } from "./vuelessConfig.js";
2
+ import { autoImportUserConfigs } from "./helper.js";
3
+ import {
4
+ COMPONENTS,
5
+ DIRECTIVES,
6
+ INTERNAL_ENV,
7
+ VUELESS_LOCAL_DIR,
8
+ VUELESS_PACKAGE_DIR,
9
+ } from "../../constants.js";
10
+
11
+ /**
12
+ * Defines the config for Storybook.
13
+ *
14
+ * @param {Object} config - The config object.
15
+ * @return {Promise<Object>} A promise that resolves to the modified config object.
16
+ */
17
+ export function defineConfigWithVueless(config) {
18
+ return (async () => ({
19
+ ...config,
20
+ stories: [...config.stories, ...(await getVuelessStoriesGlob(config?.vuelessEnv))],
21
+ addons: [
22
+ ...new Set([
23
+ ...(config.addons || []),
24
+ "@storybook/addon-docs",
25
+ "@storybook/addon-links",
26
+ "@vueless/storybook-dark-mode",
27
+ "@storybook/addon-themes",
28
+ ]),
29
+ ],
30
+ framework: {
31
+ ...config.framework,
32
+ name: "@storybook/vue3-vite",
33
+ options: {
34
+ ...config.framework?.options,
35
+ builder: {
36
+ ...config.framework?.options?.builder,
37
+ viteConfigPath: ".storybook/vite.config.js",
38
+ },
39
+ },
40
+ },
41
+ env: (envConfig) => ({
42
+ ...envConfig,
43
+ BASE_URL: "/",
44
+ }),
45
+ }))();
46
+ }
47
+
48
+ /**
49
+ * Retrieves the glob pattern for Vueless stories based on the provided Vueless environment.
50
+ *
51
+ * @param {string} vuelessEnv - The Vueless environment.
52
+ * @return {Promise<string[]>} A promise that resolves to an array of glob patterns for Vueless stories.
53
+ */
54
+ export async function getVuelessStoriesGlob(vuelessEnv) {
55
+ /* Auto import user configs. */
56
+ await autoImportUserConfigs();
57
+
58
+ const vuelessSrcDir = vuelessEnv === INTERNAL_ENV ? VUELESS_LOCAL_DIR : VUELESS_PACKAGE_DIR;
59
+ const vuelessConfig = await getVuelessConfig();
60
+ const storiesGlob = [];
61
+
62
+ for (const [directiveName, directiveDir] of Object.entries(DIRECTIVES)) {
63
+ const directiveGlobalConfig = vuelessConfig.directives?.[directiveName];
64
+ const isHiddenStoriesByDirective = directiveGlobalConfig === false;
65
+ const isHiddenStoriesByKey = directiveGlobalConfig?.storybook === false;
66
+
67
+ if (isHiddenStoriesByDirective || isHiddenStoriesByKey) {
68
+ continue;
69
+ }
70
+
71
+ storiesGlob.push(`../${vuelessSrcDir}/${directiveDir}/storybook/stories.{js,ts}`);
72
+ storiesGlob.push(`../${vuelessSrcDir}/${directiveDir}/storybook/docs.mdx`);
73
+ }
74
+
75
+ for (const [componentName, componentDir] of Object.entries(COMPONENTS)) {
76
+ const componentGlobalConfig = vuelessConfig.components?.[componentName];
77
+ const isHiddenStoriesByComponent = componentGlobalConfig === false;
78
+ const isHiddenStoriesByKey = componentGlobalConfig?.storybook === false;
79
+
80
+ if (isHiddenStoriesByComponent || isHiddenStoriesByKey) {
81
+ continue;
82
+ }
83
+
84
+ storiesGlob.push(`../${vuelessSrcDir}/${componentDir}/storybook/stories.{js,ts}`);
85
+ storiesGlob.push(`../${vuelessSrcDir}/${componentDir}/storybook/docs.mdx`);
86
+ }
87
+
88
+ return storiesGlob;
89
+ }
@@ -0,0 +1,6 @@
1
+ export function clearTailwindSafelist(): Promise<void>;
2
+ export function createTailwindSafelist({ env, srcDir, targetFiles }?: {
3
+ env: string;
4
+ srcDir: string;
5
+ targetFiles?: string[] | undefined;
6
+ }): Promise<void>;
@@ -0,0 +1,9 @@
1
+ export function getVuelessConfig(basePath?: string): Promise<Object>;
2
+ export let vuelessConfig: {};
3
+ export const cx: import("cva").CX;
4
+ export const getMergedConfig: ({ defaultConfig, globalConfig, propsConfig, unstyled }: {
5
+ defaultConfig: any;
6
+ globalConfig: any;
7
+ propsConfig: any;
8
+ unstyled: any;
9
+ }) => {};
@@ -3,10 +3,10 @@ import path from "node:path";
3
3
  import { cwd } from "node:process";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import { defineConfig } from "cva";
6
- import { createGetMergedConfig } from "./mergeConfigs.js";
7
6
  import { merge } from "lodash-es";
8
7
  import { extendTailwindMerge } from "tailwind-merge";
9
8
 
9
+ import { createGetMergedConfig } from "./mergeConfigs.js";
10
10
  import { buildTSFile } from "./helper.js";
11
11
  import {
12
12
  VUELESS_CACHE_DIR,
@@ -15,21 +15,33 @@ import {
15
15
  NESTED_COMPONENT_PATTERN_REG_EXP,
16
16
  } from "../../constants.js";
17
17
 
18
+ export let vuelessConfig = {};
19
+
18
20
  /**
19
21
  * Load Vueless config from the project root.
20
22
  * IIFE is used to prevent top level await issue.
21
23
  */
22
- export let vuelessConfig = {};
23
-
24
24
  (async () => {
25
- const configPathJs = path.join(cwd(), `${VUELESS_CONFIG_FILE_NAME}.js`);
26
- const configPathTs = path.join(cwd(), `${VUELESS_CONFIG_FILE_NAME}.ts`);
27
- const configOutPath = path.join(cwd(), `${VUELESS_CACHE_DIR}/${VUELESS_CONFIG_FILE_NAME}.mjs`);
25
+ vuelessConfig = await getVuelessConfig();
26
+ })();
28
27
 
29
- if (!fs.existsSync(configPathJs) && !fs.existsSync(configPathTs)) {
30
- vuelessConfig = {};
28
+ /**
29
+ * Retrieves the Vueless config from the project root.
30
+ *
31
+ * This method checks for the existence of a `vueless.config.{js,ts}` file in the project root.
32
+ * If the file exists, it reads the config and returns it as an object.
33
+ * @param {string} basePath - The application base path.
34
+ *
35
+ * @return {Promise<Object>} A promise that resolves to the Vueless configuration object.
36
+ */
37
+ export async function getVuelessConfig(basePath = "") {
38
+ const configPathJs = path.join(cwd(), basePath, `${VUELESS_CONFIG_FILE_NAME}.js`);
39
+ const configPathTs = path.join(cwd(), basePath, `${VUELESS_CONFIG_FILE_NAME}.ts`);
40
+ // eslint-disable-next-line prettier/prettier
41
+ const configOutPath = path.join(cwd(), basePath, `${VUELESS_CACHE_DIR}/${VUELESS_CONFIG_FILE_NAME}.mjs`);
31
42
 
32
- return;
43
+ if (!fs.existsSync(configPathJs) && !fs.existsSync(configPathTs)) {
44
+ return {};
33
45
  }
34
46
 
35
47
  fs.existsSync(configPathJs) && (await buildTSFile(configPathJs, configOutPath));
@@ -38,16 +50,23 @@ export let vuelessConfig = {};
38
50
  if (fs.existsSync(configOutPath)) {
39
51
  const module = await import(pathToFileURL(configOutPath));
40
52
 
41
- vuelessConfig = module.default;
53
+ return module.default;
42
54
  }
43
- })();
55
+ }
44
56
 
57
+ /* Merge tailwind classes with removing duplicates. */
45
58
  const twMerge = extendTailwindMerge(merge(TAILWIND_MERGE_EXTENSION, vuelessConfig.tailwindMerge));
46
59
 
60
+ /**
61
+ * Export cx (class merge) method:
62
+ * – extended with tailwind-merge
63
+ * – remove all Vueless nested component names ({U...} strings) from the class list string.
64
+ */
47
65
  export const { cx } = defineConfig({
48
66
  hooks: {
49
67
  onComplete: (classNames) => twMerge(classNames).replace(NESTED_COMPONENT_PATTERN_REG_EXP, ""),
50
68
  },
51
69
  });
52
70
 
71
+ /* Get merged config based on config merging strategy. */
53
72
  export const getMergedConfig = createGetMergedConfig(cx);
@@ -0,0 +1,13 @@
1
+ export namespace componentResolver {
2
+ let type: string;
3
+ function resolve(componentName: any): {
4
+ from: string;
5
+ } | undefined;
6
+ }
7
+ export namespace directiveResolver {
8
+ let type_1: string;
9
+ export { type_1 as type };
10
+ export function resolve(directive: any): {
11
+ from: string;
12
+ } | undefined;
13
+ }