vueless 1.1.1-beta.9 → 1.2.1-beta.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 (421) 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 +90 -59
  6. package/bin/constants.d.ts +3 -0
  7. package/bin/constants.js +0 -14
  8. package/composables/tests/useUI.test.ts +3 -3
  9. package/composables/useAutoPosition.ts +1 -1
  10. package/composables/useBreakpoint.ts +1 -1
  11. package/composables/useComponentLocaleMassages.ts +3 -3
  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 +34 -10
  25. package/plugin-vite.d.ts +1 -28
  26. package/plugin-vite.js +33 -28
  27. package/tailwind.css +30 -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 +21 -9
  50. package/ui.container-accordion/config.ts +1 -1
  51. package/ui.container-accordion/storybook/docs.mdx +3 -3
  52. package/ui.container-accordion/storybook/stories.ts +19 -7
  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 +8 -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 +28 -20
  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 +9 -9
  224. package/ui.form-listbox/storybook/docs.mdx +3 -3
  225. package/ui.form-listbox/storybook/stories.ts +2 -2
  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/storybook/docs.mdx +3 -3
  242. package/ui.form-select/storybook/stories.ts +2 -2
  243. package/ui.form-select/tests/USelect.test.ts +1 -1
  244. package/ui.form-select/types.ts +3 -3
  245. package/ui.form-select/utilSelect.ts +1 -1
  246. package/ui.form-switch/USwitch.vue +6 -6
  247. package/ui.form-switch/storybook/docs.mdx +3 -3
  248. package/ui.form-switch/storybook/stories.ts +2 -2
  249. package/ui.form-switch/tests/USwitch.test.ts +1 -1
  250. package/ui.form-switch/types.ts +2 -2
  251. package/ui.form-textarea/UTextarea.vue +7 -7
  252. package/ui.form-textarea/storybook/docs.mdx +3 -3
  253. package/ui.form-textarea/storybook/stories.ts +3 -3
  254. package/ui.form-textarea/tests/UTextarea.test.ts +1 -1
  255. package/ui.form-textarea/types.ts +2 -2
  256. package/ui.image-avatar/UAvatar.vue +5 -5
  257. package/ui.image-avatar/storybook/docs.mdx +3 -3
  258. package/ui.image-avatar/storybook/stories.ts +3 -3
  259. package/ui.image-avatar/tests/UAvatar.test.ts +1 -1
  260. package/ui.image-avatar/types.ts +2 -2
  261. package/ui.image-icon/UIcon.vue +6 -6
  262. package/ui.image-icon/storybook/docs.mdx +3 -3
  263. package/ui.image-icon/storybook/stories.ts +2 -2
  264. package/ui.image-icon/tests/UIcon.test.ts +0 -1
  265. package/ui.image-icon/types.ts +2 -2
  266. package/ui.loader/ULoader.vue +5 -5
  267. package/ui.loader/storybook/docs.mdx +3 -3
  268. package/ui.loader/storybook/stories.ts +2 -2
  269. package/ui.loader/tests/ULoader.test.ts +1 -1
  270. package/ui.loader/types.ts +2 -2
  271. package/ui.loader-overlay/ULoaderOverlay.vue +6 -6
  272. package/ui.loader-overlay/storybook/docs.mdx +3 -3
  273. package/ui.loader-overlay/storybook/stories.ts +2 -2
  274. package/ui.loader-overlay/tests/ULoaderOverlay.test.ts +2 -2
  275. package/ui.loader-overlay/types.ts +2 -2
  276. package/ui.loader-progress/ULoaderProgress.vue +7 -7
  277. package/ui.loader-progress/storybook/docs.mdx +3 -3
  278. package/ui.loader-progress/storybook/stories.ts +4 -4
  279. package/ui.loader-progress/tests/ULoaderProgress.test.ts +2 -2
  280. package/ui.loader-progress/types.ts +2 -2
  281. package/ui.loader-progress/useLoaderProgress.ts +1 -1
  282. package/ui.navigation-breadcrumbs/UBreadcrumbs.vue +6 -6
  283. package/ui.navigation-breadcrumbs/storybook/docs.mdx +3 -3
  284. package/ui.navigation-breadcrumbs/storybook/stories.ts +13 -2
  285. package/ui.navigation-breadcrumbs/tests/UBreadcrumbs.test.ts +2 -2
  286. package/ui.navigation-breadcrumbs/types.ts +3 -3
  287. package/ui.navigation-pagination/UPagination.vue +5 -5
  288. package/ui.navigation-pagination/storybook/docs.mdx +3 -3
  289. package/ui.navigation-pagination/storybook/stories.ts +5 -3
  290. package/ui.navigation-pagination/tests/UPagination.test.ts +1 -1
  291. package/ui.navigation-pagination/types.ts +2 -2
  292. package/ui.navigation-progress/UProgress.vue +5 -5
  293. package/ui.navigation-progress/UStepperProgress.vue +3 -3
  294. package/ui.navigation-progress/storybook/docs.mdx +3 -3
  295. package/ui.navigation-progress/storybook/stories.ts +2 -2
  296. package/ui.navigation-progress/tests/UProgress.test.ts +1 -1
  297. package/ui.navigation-progress/types.ts +2 -2
  298. package/ui.navigation-tab/UTab.vue +6 -6
  299. package/ui.navigation-tab/storybook/docs.mdx +3 -3
  300. package/ui.navigation-tab/storybook/stories.ts +2 -2
  301. package/ui.navigation-tab/types.ts +2 -2
  302. package/ui.navigation-tabs/UTabs.vue +5 -5
  303. package/ui.navigation-tabs/storybook/docs.mdx +3 -3
  304. package/ui.navigation-tabs/storybook/stories.ts +2 -2
  305. package/ui.navigation-tabs/tests/UTabs.test.ts +1 -1
  306. package/ui.navigation-tabs/types.ts +2 -2
  307. package/ui.other-chip/UChip.vue +5 -5
  308. package/ui.other-chip/storybook/docs.mdx +3 -3
  309. package/ui.other-chip/storybook/stories.ts +13 -2
  310. package/ui.other-chip/tests/UChip.test.ts +1 -1
  311. package/ui.other-chip/types.ts +2 -2
  312. package/ui.other-dot/UDot.vue +5 -5
  313. package/ui.other-dot/storybook/docs.mdx +3 -3
  314. package/ui.other-dot/storybook/stories.ts +2 -2
  315. package/ui.other-dot/tests/UDot.test.ts +1 -1
  316. package/ui.other-dot/types.ts +2 -2
  317. package/ui.other-theme-color-toggle/UThemeColorToggle.vue +6 -6
  318. package/ui.other-theme-color-toggle/storybook/docs.mdx +3 -3
  319. package/ui.other-theme-color-toggle/storybook/stories.ts +2 -2
  320. package/ui.other-theme-color-toggle/tests/UThemeColorToggle.test.ts +1 -1
  321. package/ui.other-theme-color-toggle/types.ts +2 -2
  322. package/ui.skeleton/USkeleton.vue +5 -5
  323. package/ui.skeleton/storybook/docs.mdx +3 -3
  324. package/ui.skeleton/storybook/stories.ts +7 -2
  325. package/ui.skeleton/tests/USkeleton.test.ts +1 -1
  326. package/ui.skeleton/types.ts +2 -2
  327. package/ui.skeleton-choice/USkeletonChoice.vue +5 -5
  328. package/ui.skeleton-choice/storybook/docs.mdx +3 -3
  329. package/ui.skeleton-choice/storybook/stories.ts +7 -2
  330. package/ui.skeleton-choice/tests/USkeletonChoice.test.ts +1 -1
  331. package/ui.skeleton-choice/types.ts +2 -2
  332. package/ui.skeleton-input/USkeletonInput.vue +5 -5
  333. package/ui.skeleton-input/storybook/docs.mdx +3 -3
  334. package/ui.skeleton-input/storybook/stories.ts +13 -2
  335. package/ui.skeleton-input/tests/USkeletonInput.test.ts +1 -1
  336. package/ui.skeleton-input/types.ts +2 -2
  337. package/ui.skeleton-text/USkeletonText.vue +5 -5
  338. package/ui.skeleton-text/storybook/docs.mdx +3 -3
  339. package/ui.skeleton-text/storybook/stories.ts +7 -2
  340. package/ui.skeleton-text/tests/USkeletonText.test.ts +1 -1
  341. package/ui.skeleton-text/types.ts +2 -2
  342. package/ui.text-alert/UAlert.vue +6 -6
  343. package/ui.text-alert/storybook/docs.mdx +3 -3
  344. package/ui.text-alert/storybook/stories.ts +2 -2
  345. package/ui.text-alert/tests/UAlert.test.ts +1 -1
  346. package/ui.text-alert/types.ts +2 -2
  347. package/ui.text-badge/UBadge.vue +6 -6
  348. package/ui.text-badge/storybook/docs.mdx +3 -3
  349. package/ui.text-badge/storybook/stories.ts +2 -2
  350. package/ui.text-badge/tests/UBadge.test.ts +1 -1
  351. package/ui.text-badge/types.ts +2 -2
  352. package/ui.text-block/UText.vue +5 -5
  353. package/ui.text-block/storybook/docs.mdx +3 -3
  354. package/ui.text-block/storybook/stories.ts +2 -2
  355. package/ui.text-block/tests/UText.test.ts +1 -1
  356. package/ui.text-block/types.ts +2 -2
  357. package/ui.text-empty/UEmpty.vue +5 -5
  358. package/ui.text-empty/storybook/docs.mdx +3 -3
  359. package/ui.text-empty/storybook/stories.ts +2 -2
  360. package/ui.text-empty/tests/UEmpty.test.ts +1 -1
  361. package/ui.text-empty/types.ts +2 -2
  362. package/ui.text-file/UFile.vue +5 -5
  363. package/ui.text-file/storybook/docs.mdx +3 -3
  364. package/ui.text-file/storybook/stories.ts +2 -2
  365. package/ui.text-file/tests/UFile.test.ts +1 -1
  366. package/ui.text-file/types.ts +2 -2
  367. package/ui.text-files/UFiles.vue +6 -6
  368. package/ui.text-files/storybook/docs.mdx +3 -3
  369. package/ui.text-files/storybook/stories.ts +2 -2
  370. package/ui.text-files/tests/UFiles.test.ts +1 -1
  371. package/ui.text-files/types.ts +2 -2
  372. package/ui.text-header/UHeader.vue +5 -5
  373. package/ui.text-header/storybook/docs.mdx +3 -3
  374. package/ui.text-header/storybook/stories.ts +2 -2
  375. package/ui.text-header/tests/UHeader.test.ts +1 -1
  376. package/ui.text-header/types.ts +2 -2
  377. package/ui.text-notify/UNotify.vue +6 -6
  378. package/ui.text-notify/storybook/docs.mdx +3 -3
  379. package/ui.text-notify/storybook/stories.ts +3 -3
  380. package/ui.text-notify/tests/UNotify.test.ts +4 -4
  381. package/ui.text-notify/types.ts +3 -3
  382. package/ui.text-notify/utilNotify.ts +3 -3
  383. package/ui.text-number/UNumber.vue +6 -6
  384. package/ui.text-number/storybook/docs.mdx +3 -3
  385. package/ui.text-number/storybook/stories.ts +13 -2
  386. package/ui.text-number/tests/UNumber.test.ts +2 -2
  387. package/ui.text-number/types.ts +2 -2
  388. package/utils/helper.ts +1 -1
  389. package/utils/node/dynamicProps.d.ts +2 -0
  390. package/utils/node/dynamicProps.js +17 -8
  391. package/utils/node/helper.d.ts +15 -0
  392. package/utils/node/helper.js +73 -27
  393. package/utils/node/loaderIcon.d.ts +7 -0
  394. package/utils/node/loaderIcon.js +12 -8
  395. package/utils/node/loaderSvg.d.ts +1 -0
  396. package/utils/node/mergeConfigs.d.ts +13 -0
  397. package/utils/node/storybook.d.ts +2 -0
  398. package/utils/node/storybook.js +94 -0
  399. package/utils/node/tailwindSafelist.d.ts +6 -0
  400. package/utils/node/vuelessConfig.d.ts +9 -0
  401. package/utils/node/vuelessConfig.js +30 -11
  402. package/utils/node/vuelessResolver.d.ts +13 -0
  403. package/utils/node/vuelessResolver.js +30 -14
  404. package/utils/node/webTypes.d.ts +1 -0
  405. package/utils/node/webTypes.js +4 -2
  406. package/utils/platform.ts +1 -1
  407. package/utils/storybook.ts +2 -2
  408. package/utils/theme.ts +21 -19
  409. package/utils/ui.ts +33 -8
  410. package/{directives/clickOutside → v.click-outside}/storybook/docs.mdx +2 -2
  411. package/{directives/clickOutside → v.click-outside}/storybook/stories.ts +5 -5
  412. package/{directives/clickOutside → v.click-outside}/vClickOutside.ts +1 -1
  413. package/v.tooltip/storybook/docs.mdx +47 -0
  414. package/{directives/tooltip → v.tooltip}/storybook/stories.ts +14 -11
  415. package/{directives/tooltip → v.tooltip}/vTooltip.ts +4 -9
  416. package/directives/index.js +0 -7
  417. package/directives/tooltip/storybook/docs.mdx +0 -10
  418. package/utils/node/dynamicStories.js +0 -62
  419. package/utils/tailwindConfig.ts +0 -36
  420. /package/{directives/clickOutside → v.click-outside}/types.ts +0 -0
  421. /package/{directives/tooltip → v.tooltip}/types.ts +0 -0
@@ -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, basePath: string): Promise<string[]>;
@@ -0,0 +1,94 @@
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: [
21
+ ...config.stories,
22
+ ...(await getVuelessStoriesGlob(config?.vuelessEnv, config?.basePath)),
23
+ ],
24
+ addons: [
25
+ ...new Set([
26
+ ...(config.addons || []),
27
+ "@storybook/addon-docs",
28
+ "@storybook/addon-links",
29
+ "@vueless/storybook-dark-mode",
30
+ "@storybook/addon-themes",
31
+ ]),
32
+ ],
33
+ staticDirs: ["public"],
34
+ framework: {
35
+ ...config.framework,
36
+ name: "@storybook/vue3-vite",
37
+ options: {
38
+ ...config.framework?.options,
39
+ builder: {
40
+ ...config.framework?.options?.builder,
41
+ viteConfigPath: ".storybook/vite.config.js",
42
+ },
43
+ },
44
+ },
45
+ env: (envConfig) => ({
46
+ ...envConfig,
47
+ BASE_URL: "/",
48
+ }),
49
+ }))();
50
+ }
51
+
52
+ /**
53
+ * Retrieves the glob pattern for Vueless stories based on the provided Vueless environment.
54
+ *
55
+ * @param {string} vuelessEnv - The Vueless environment.
56
+ * @param {string} basePath - The Project base path.
57
+ * @return {Promise<string[]>} A promise that resolves to an array of glob patterns for Vueless stories.
58
+ */
59
+ export async function getVuelessStoriesGlob(vuelessEnv, basePath) {
60
+ /* Auto import user configs. */
61
+ await autoImportUserConfigs(basePath);
62
+
63
+ const vuelessSrcDir = vuelessEnv === INTERNAL_ENV ? VUELESS_LOCAL_DIR : VUELESS_PACKAGE_DIR;
64
+ const vuelessConfig = await getVuelessConfig();
65
+ const storiesGlob = [];
66
+
67
+ for (const [directiveName, directiveDir] of Object.entries(DIRECTIVES)) {
68
+ const directiveGlobalConfig = vuelessConfig.directives?.[directiveName];
69
+ const isHiddenStoriesByDirective = directiveGlobalConfig === false;
70
+ const isHiddenStoriesByKey = directiveGlobalConfig?.storybook === false;
71
+
72
+ if (isHiddenStoriesByDirective || isHiddenStoriesByKey) {
73
+ continue;
74
+ }
75
+
76
+ storiesGlob.push(`../${vuelessSrcDir}/${directiveDir}/storybook/stories.{js,ts}`);
77
+ storiesGlob.push(`../${vuelessSrcDir}/${directiveDir}/storybook/docs.mdx`);
78
+ }
79
+
80
+ for (const [componentName, componentDir] of Object.entries(COMPONENTS)) {
81
+ const componentGlobalConfig = vuelessConfig.components?.[componentName];
82
+ const isHiddenStoriesByComponent = componentGlobalConfig === false;
83
+ const isHiddenStoriesByKey = componentGlobalConfig?.storybook === false;
84
+
85
+ if (isHiddenStoriesByComponent || isHiddenStoriesByKey) {
86
+ continue;
87
+ }
88
+
89
+ storiesGlob.push(`../${vuelessSrcDir}/${componentDir}/storybook/stories.{js,ts}`);
90
+ storiesGlob.push(`../${vuelessSrcDir}/${componentDir}/storybook/docs.mdx`);
91
+ }
92
+
93
+ return storiesGlob;
94
+ }
@@ -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
+ }
@@ -8,25 +8,41 @@
8
8
  Docs: https://github.com/unplugin/unplugin-vue-components?tab=readme-ov-file#importing-from-ui-libraries
9
9
  */
10
10
 
11
- import { COMPONENTS } from "../../constants.js";
11
+ import { COMPONENTS, DIRECTIVES } from "../../constants.js";
12
12
 
13
- export function componentResolver(componentName) {
14
- const folder = COMPONENTS[componentName];
13
+ /**
14
+ * Resolver for Vueless components.
15
+ * @param {string} componentName
16
+ * @return {Object} Component path
17
+ */
18
+ export const componentResolver = {
19
+ type: "component",
20
+ resolve(componentName) {
21
+ const folder = COMPONENTS[componentName];
15
22
 
16
- if (folder) {
17
- return {
18
- from: `vueless/${folder}/${componentName}.vue`,
19
- };
20
- }
21
- }
23
+ if (folder) {
24
+ return {
25
+ from: `vueless/${folder}/${componentName}.vue`,
26
+ };
27
+ }
28
+ },
29
+ };
22
30
 
31
+ /**
32
+ * Resolver for Vueless directives.
33
+ * @param {string} directiveName
34
+ * @return {Object} Directive path
35
+ */
23
36
  export const directiveResolver = {
24
37
  type: "directive",
25
- resolve(name) {
26
- const folder = name[0].toLowerCase() + name.slice(1);
38
+ resolve(directive) {
39
+ const directiveName = `v${directive}`;
40
+ const folder = DIRECTIVES[directiveName];
27
41
 
28
- return {
29
- from: `vueless/directives/${folder}/v${name}.ts`,
30
- };
42
+ if (folder) {
43
+ return {
44
+ from: `vueless/${folder}/${directiveName}.ts`,
45
+ };
46
+ }
31
47
  },
32
48
  };
@@ -0,0 +1 @@
1
+ export function buildWebTypes(srcDir: any): Promise<void>;
@@ -6,7 +6,9 @@ export async function buildWebTypes(srcDir) {
6
6
 
7
7
  await build(vuelessConfig, srcDir);
8
8
  } catch (error) {
9
- // eslint-disable-next-line no-console
10
- console.warn(error);
9
+ if (error.code !== "ERR_MODULE_NOT_FOUND") {
10
+ // eslint-disable-next-line no-console
11
+ console.warn(error);
12
+ }
11
13
  }
12
14
  }
package/utils/platform.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { isCSR } from "./helper.ts";
1
+ import { isCSR } from "./helper";
2
2
 
3
3
  interface ModernNavigator extends Navigator {
4
4
  standalone: string;
@@ -1,4 +1,4 @@
1
- import { COMPONENTS } from "../constants.js";
1
+ import { COMPONENTS } from "../constants";
2
2
 
3
3
  import type {
4
4
  WebTypes,
@@ -8,7 +8,7 @@ import type {
8
8
  SlotBinding,
9
9
  ExposeProperty,
10
10
  UnknownObject,
11
- } from "../types.ts";
11
+ } from "../types";
12
12
 
13
13
  interface Types {
14
14
  [key: string]: ArgType | undefined;
package/utils/theme.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { cloneDeep, merge } from "lodash-es";
2
2
 
3
- import { vuelessConfig } from "./ui.ts";
4
- import { isCSR, setCookie } from "./helper.ts";
3
+ import { vuelessConfig } from "./ui";
4
+ import { isCSR, setCookie } from "./helper";
5
5
 
6
6
  import {
7
7
  PX_IN_REM,
@@ -33,7 +33,7 @@ import {
33
33
  TEXT_DECREMENT,
34
34
  DISABLED_OPACITY,
35
35
  DEFAULT_DISABLED_OPACITY,
36
- } from "../constants.js";
36
+ } from "../constants";
37
37
 
38
38
  import type {
39
39
  NeutralColors,
@@ -43,8 +43,8 @@ import type {
43
43
  ThemeConfigOutline,
44
44
  ThemeConfigRounding,
45
45
  VuelessCssVariables,
46
- } from "../types.ts";
47
- import { ColorMode } from "../types.ts";
46
+ } from "../types";
47
+ import { ColorMode } from "../types";
48
48
 
49
49
  declare interface RootCSSVariableOptions {
50
50
  primary: PrimaryColors | string;
@@ -78,7 +78,7 @@ function toggleColorModeClass() {
78
78
  * @param {boolean} isCachedAutoMode
79
79
  * @return {string} current color mode
80
80
  */
81
- function setColorMode(mode: `${ColorMode}`, isCachedAutoMode?: boolean): string {
81
+ function setColorMode(mode: `${ColorMode}`, isCachedAutoMode: boolean = false): string {
82
82
  const colorMode = mode || getStored(COLOR_MODE_KEY) || vuelessConfig.colorMode || ColorMode.Light;
83
83
 
84
84
  isCachedAutoMode = isCachedAutoMode ?? !!Number(getStored(AUTO_MODE_KEY));
@@ -314,10 +314,10 @@ function getText(text?: ThemeConfig["text"]) {
314
314
  };
315
315
 
316
316
  const mergedText = {
317
- xs: runtimeText.xs === undefined ? textXs : definedText.xs,
318
- sm: runtimeText.sm === undefined ? textSm : definedText.sm,
319
- md: runtimeText.md === undefined ? textMd : definedText.md,
320
- lg: runtimeText.lg === undefined ? textLg : definedText.lg,
317
+ xs: runtimeText.xs === undefined && globalText.xs === undefined ? textXs : definedText.xs,
318
+ sm: runtimeText.sm === undefined && globalText.sm === undefined ? textSm : definedText.sm,
319
+ md: runtimeText.md === undefined && globalText.md === undefined ? textMd : definedText.md,
320
+ lg: runtimeText.lg === undefined && globalText.lg === undefined ? textLg : definedText.lg,
321
321
  };
322
322
 
323
323
  if (isCSR && text) {
@@ -346,8 +346,8 @@ function getOutlines(outline?: ThemeConfig["outline"]) {
346
346
  lg: `vl-${OUTLINE}-lg`,
347
347
  };
348
348
 
349
- const runtimeOutline = primitiveToObject(outline) as ThemeConfigText;
350
- const globalOutline = primitiveToObject(vuelessConfig.outline) as ThemeConfigText;
349
+ const runtimeOutline = primitiveToObject(outline) as ThemeConfigOutline;
350
+ const globalOutline = primitiveToObject(vuelessConfig.outline) as ThemeConfigOutline;
351
351
 
352
352
  const outlineMd = Math.max(0, Number(runtimeOutline.md ?? globalOutline.md ?? DEFAULT_OUTLINE));
353
353
  const outlineSm = Math.max(0, outlineMd - OUTLINE_DECREMENT);
@@ -363,11 +363,13 @@ function getOutlines(outline?: ThemeConfig["outline"]) {
363
363
  lg: Math.max(0, Number(runtimeOutline.lg ?? getStored(storageKey.lg) ?? globalOutline.lg ?? 0)),
364
364
  };
365
365
 
366
+ /* eslint-disable prettier/prettier */
366
367
  const mergedOutline = {
367
- sm: runtimeOutline.sm === undefined ? outlineSm : definedOutline.sm,
368
- md: runtimeOutline.md === undefined ? outlineMd : definedOutline.md,
369
- lg: runtimeOutline.lg === undefined ? outlineLg : definedOutline.lg,
368
+ sm: runtimeOutline.sm === undefined && globalOutline.sm === undefined ? outlineSm : definedOutline.sm,
369
+ md: runtimeOutline.md === undefined && globalOutline.md === undefined ? outlineMd : definedOutline.md,
370
+ lg: runtimeOutline.lg === undefined && globalOutline.lg === undefined ? outlineLg : definedOutline.lg,
370
371
  };
372
+ /* eslint-enable prettier/prettier */
371
373
 
372
374
  if (isCSR && outline) {
373
375
  setCookie(storageKey.sm, String(mergedOutline.sm));
@@ -419,13 +421,13 @@ function getRoundings(rounding?: ThemeConfig["rounding"]) {
419
421
  md: Math.max(0, Number(runtimeRounding.md ?? getStored(storageKey.md) ?? globalRounding.md ?? 0)),
420
422
  lg: Math.max(0, Number(runtimeRounding.lg ?? getStored(storageKey.lg) ?? globalRounding.lg ?? 0)),
421
423
  };
422
- /* eslint-enable prettier/prettier */
423
424
 
424
425
  const mergedRounding = {
425
- sm: runtimeRounding.sm === undefined ? roundingSm : definedRounding.sm,
426
- md: runtimeRounding.md === undefined ? roundingMd : definedRounding.md,
427
- lg: runtimeRounding.lg === undefined ? roundingLg : definedRounding.lg,
426
+ sm: runtimeRounding.sm === undefined && globalRounding.sm === undefined ? roundingSm : definedRounding.sm,
427
+ md: runtimeRounding.md === undefined && globalRounding.md === undefined ? roundingMd : definedRounding.md,
428
+ lg: runtimeRounding.lg === undefined && globalRounding.lg === undefined ? roundingLg : definedRounding.lg,
428
429
  };
430
+ /* eslint-enable prettier/prettier */
429
431
 
430
432
  if (isCSR && rounding) {
431
433
  setCookie(storageKey.sm, String(mergedRounding.sm));