@witchcraft/ui 0.0.1

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 (315) hide show
  1. package/README.md +236 -0
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.d.mts +34 -0
  4. package/dist/module.d.ts +34 -0
  5. package/dist/module.json +9 -0
  6. package/dist/module.mjs +124 -0
  7. package/dist/runtime/assets/base.css +1 -0
  8. package/dist/runtime/assets/locales/en.json +33 -0
  9. package/dist/runtime/assets/style.css +1 -0
  10. package/dist/runtime/assets/tailwind.css +1 -0
  11. package/dist/runtime/assets/theme.css +1 -0
  12. package/dist/runtime/build/WitchcraftUiResolver.d.ts +5 -0
  13. package/dist/runtime/build/WitchcraftUiResolver.js +17 -0
  14. package/dist/runtime/build/generateTheme.d.ts +1 -0
  15. package/dist/runtime/build/generateTheme.js +14 -0
  16. package/dist/runtime/build/unpluginIconViteOptions.d.ts +2 -0
  17. package/dist/runtime/build/unpluginIconViteOptions.js +10 -0
  18. package/dist/runtime/components/Aria/Aria.vue +18 -0
  19. package/dist/runtime/components/Focus.stories.d.ts +11 -0
  20. package/dist/runtime/components/Focus.stories.js +53 -0
  21. package/dist/runtime/components/Icon/Icon.vue +39 -0
  22. package/dist/runtime/components/LibButton/LibButton.stories.d.ts +12 -0
  23. package/dist/runtime/components/LibButton/LibButton.stories.js +94 -0
  24. package/dist/runtime/components/LibButton/LibButton.vue +247 -0
  25. package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.d.ts +14 -0
  26. package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.js +29 -0
  27. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +132 -0
  28. package/dist/runtime/components/LibColorInput/LibColorInput.stories.d.ts +7 -0
  29. package/dist/runtime/components/LibColorInput/LibColorInput.stories.js +58 -0
  30. package/dist/runtime/components/LibColorInput/LibColorInput.vue +125 -0
  31. package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.d.ts +7 -0
  32. package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.js +51 -0
  33. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +448 -0
  34. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.d.ts +7 -0
  35. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.js +36 -0
  36. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +95 -0
  37. package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.d.ts +11 -0
  38. package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.js +98 -0
  39. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue +67 -0
  40. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +370 -0
  41. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +314 -0
  42. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue +27 -0
  43. package/dist/runtime/components/LibDatePicker/helpers.d.ts +25 -0
  44. package/dist/runtime/components/LibDatePicker/helpers.js +28 -0
  45. package/dist/runtime/components/LibDebug/LibDebug.stories.d.ts +9 -0
  46. package/dist/runtime/components/LibDebug/LibDebug.stories.js +46 -0
  47. package/dist/runtime/components/LibDebug/LibDebug.vue +91 -0
  48. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +53 -0
  49. package/dist/runtime/components/LibFileInput/LibFileInput.stories.d.ts +10 -0
  50. package/dist/runtime/components/LibFileInput/LibFileInput.stories.js +63 -0
  51. package/dist/runtime/components/LibFileInput/LibFileInput.vue +273 -0
  52. package/dist/runtime/components/LibInput/LibInput.stories.d.ts +33 -0
  53. package/dist/runtime/components/LibInput/LibInput.stories.js +339 -0
  54. package/dist/runtime/components/LibInput/LibInput.vue +372 -0
  55. package/dist/runtime/components/LibLabel/LibLabel.stories.d.ts +6 -0
  56. package/dist/runtime/components/LibLabel/LibLabel.stories.js +25 -0
  57. package/dist/runtime/components/LibLabel/LibLabel.vue +66 -0
  58. package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.d.ts +23 -0
  59. package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.js +60 -0
  60. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +127 -0
  61. package/dist/runtime/components/LibNotifications/LibNotification.stories.d.ts +15 -0
  62. package/dist/runtime/components/LibNotifications/LibNotification.stories.js +126 -0
  63. package/dist/runtime/components/LibNotifications/LibNotification.vue +121 -0
  64. package/dist/runtime/components/LibNotifications/LibNotifications.stories.d.ts +6 -0
  65. package/dist/runtime/components/LibNotifications/LibNotifications.stories.js +109 -0
  66. package/dist/runtime/components/LibNotifications/LibNotifications.vue +133 -0
  67. package/dist/runtime/components/LibPagination/LibPagination.stories.d.ts +6 -0
  68. package/dist/runtime/components/LibPagination/LibPagination.stories.js +40 -0
  69. package/dist/runtime/components/LibPagination/LibPagination.vue +261 -0
  70. package/dist/runtime/components/LibPalette/LibPalette.stories.d.ts +6 -0
  71. package/dist/runtime/components/LibPalette/LibPalette.stories.js +20 -0
  72. package/dist/runtime/components/LibPalette/LibPalette.vue +49 -0
  73. package/dist/runtime/components/LibPopup/LibPopup.stories.d.ts +14 -0
  74. package/dist/runtime/components/LibPopup/LibPopup.stories.js +147 -0
  75. package/dist/runtime/components/LibPopup/LibPopup.vue +441 -0
  76. package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.d.ts +10 -0
  77. package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.js +81 -0
  78. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +192 -0
  79. package/dist/runtime/components/LibRecorder/LibRecorder.stories.d.ts +19 -0
  80. package/dist/runtime/components/LibRecorder/LibRecorder.stories.js +63 -0
  81. package/dist/runtime/components/LibRecorder/LibRecorder.vue +243 -0
  82. package/dist/runtime/components/LibRoot/LibRoot.vue +126 -0
  83. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.d.ts +26 -0
  84. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.js +78 -0
  85. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +148 -0
  86. package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.d.ts +27 -0
  87. package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.js +112 -0
  88. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +198 -0
  89. package/dist/runtime/components/LibTable/LibTable.stories.d.ts +16 -0
  90. package/dist/runtime/components/LibTable/LibTable.stories.js +156 -0
  91. package/dist/runtime/components/LibTable/LibTable.vue +177 -0
  92. package/dist/runtime/components/Template/NAME.vue +49 -0
  93. package/dist/runtime/components/Template/TemplateStory.d.ts +7 -0
  94. package/dist/runtime/components/Template/TemplateStory.js +22 -0
  95. package/dist/runtime/components/TestControls/TestControls.vue +19 -0
  96. package/dist/runtime/components/index.d.ts +19 -0
  97. package/dist/runtime/components/index.js +19 -0
  98. package/dist/runtime/components/reset.stories.d.ts +5 -0
  99. package/dist/runtime/components/reset.stories.js +19 -0
  100. package/dist/runtime/components/shared/props.d.ts +135 -0
  101. package/dist/runtime/components/shared/props.js +14 -0
  102. package/dist/runtime/components/shared/storyHelpers/playInput.d.ts +8 -0
  103. package/dist/runtime/components/shared/storyHelpers/playInput.js +26 -0
  104. package/dist/runtime/components/shared/storyHelpers/playSuggestions.d.ts +12 -0
  105. package/dist/runtime/components/shared/storyHelpers/playSuggestions.js +83 -0
  106. package/dist/runtime/composables/index.d.ts +11 -0
  107. package/dist/runtime/composables/index.js +11 -0
  108. package/dist/runtime/composables/useAccesibilityOutline.d.ts +41 -0
  109. package/dist/runtime/composables/useAccesibilityOutline.js +58 -0
  110. package/dist/runtime/composables/useAriaLabel.d.ts +6 -0
  111. package/dist/runtime/composables/useAriaLabel.js +15 -0
  112. package/dist/runtime/composables/useDarkMode.d.ts +38 -0
  113. package/dist/runtime/composables/useDarkMode.js +79 -0
  114. package/dist/runtime/composables/useDivideAttrs.d.ts +27 -0
  115. package/dist/runtime/composables/useDivideAttrs.js +26 -0
  116. package/dist/runtime/composables/useGlobalResizeObserver.d.ts +3 -0
  117. package/dist/runtime/composables/useGlobalResizeObserver.js +28 -0
  118. package/dist/runtime/composables/useInjectedDarkMode.d.ts +2 -0
  119. package/dist/runtime/composables/useInjectedDarkMode.js +13 -0
  120. package/dist/runtime/composables/useInjectedI18n.d.ts +2 -0
  121. package/dist/runtime/composables/useInjectedI18n.js +7 -0
  122. package/dist/runtime/composables/useInjectedLocale.d.ts +2 -0
  123. package/dist/runtime/composables/useInjectedLocale.js +21 -0
  124. package/dist/runtime/composables/useNotificationHandler.d.ts +4 -0
  125. package/dist/runtime/composables/useNotificationHandler.js +21 -0
  126. package/dist/runtime/composables/useScrollNearContainerEdges.d.ts +68 -0
  127. package/dist/runtime/composables/useScrollNearContainerEdges.js +116 -0
  128. package/dist/runtime/composables/useScrollNearContainerEdges.stories.d.ts +7 -0
  129. package/dist/runtime/composables/useScrollNearContainerEdges.stories.js +85 -0
  130. package/dist/runtime/composables/useSetupDarkMode.d.ts +12 -0
  131. package/dist/runtime/composables/useSetupDarkMode.js +4 -0
  132. package/dist/runtime/composables/useSetupI18n.d.ts +20 -0
  133. package/dist/runtime/composables/useSetupI18n.js +50 -0
  134. package/dist/runtime/composables/useSetupLocale.d.ts +9 -0
  135. package/dist/runtime/composables/useSetupLocale.js +21 -0
  136. package/dist/runtime/composables/useShowDevOnlyKey.d.ts +7 -0
  137. package/dist/runtime/composables/useShowDevOnlyKey.js +20 -0
  138. package/dist/runtime/composables/useSuggestions.d.ts +38 -0
  139. package/dist/runtime/composables/useSuggestions.js +226 -0
  140. package/dist/runtime/directives/index.d.ts +4 -0
  141. package/dist/runtime/directives/index.js +4 -0
  142. package/dist/runtime/directives/vDetectFlex.d.ts +2 -0
  143. package/dist/runtime/directives/vDetectFlex.js +109 -0
  144. package/dist/runtime/directives/vExtractRootEl.d.ts +22 -0
  145. package/dist/runtime/directives/vExtractRootEl.js +13 -0
  146. package/dist/runtime/directives/vResizableCols.d.ts +60 -0
  147. package/dist/runtime/directives/vResizableCols.js +252 -0
  148. package/dist/runtime/directives/vResizeObserver.d.ts +2 -0
  149. package/dist/runtime/directives/vResizeObserver.js +34 -0
  150. package/dist/runtime/globalResizeObserver.d.ts +5 -0
  151. package/dist/runtime/globalResizeObserver.js +5 -0
  152. package/dist/runtime/helpers/NotificationHandler.d.ts +48 -0
  153. package/dist/runtime/helpers/NotificationHandler.js +162 -0
  154. package/dist/runtime/helpers/addValue.d.ts +1 -0
  155. package/dist/runtime/helpers/addValue.js +8 -0
  156. package/dist/runtime/helpers/base64ToImg.d.ts +1 -0
  157. package/dist/runtime/helpers/base64ToImg.js +11 -0
  158. package/dist/runtime/helpers/copy.d.ts +1 -0
  159. package/dist/runtime/helpers/copy.js +10 -0
  160. package/dist/runtime/helpers/createNoonUtcDate.d.ts +7 -0
  161. package/dist/runtime/helpers/createNoonUtcDate.js +14 -0
  162. package/dist/runtime/helpers/defaultTranslationFunction.d.ts +16 -0
  163. package/dist/runtime/helpers/defaultTranslationFunction.js +14 -0
  164. package/dist/runtime/helpers/getTimeZoneList.d.ts +1 -0
  165. package/dist/runtime/helpers/getTimeZoneList.js +3 -0
  166. package/dist/runtime/helpers/hasModifiers.d.ts +1 -0
  167. package/dist/runtime/helpers/hasModifiers.js +1 -0
  168. package/dist/runtime/helpers/index.d.ts +8 -0
  169. package/dist/runtime/helpers/index.js +8 -0
  170. package/dist/runtime/helpers/readFile.d.ts +1 -0
  171. package/dist/runtime/helpers/readFile.js +13 -0
  172. package/dist/runtime/helpers/resizeObserverWrapper.d.ts +8 -0
  173. package/dist/runtime/helpers/resizeObserverWrapper.js +37 -0
  174. package/dist/runtime/helpers/storybook.d.ts +7 -0
  175. package/dist/runtime/helpers/storybook.js +42 -0
  176. package/dist/runtime/main.lib.d.ts +26 -0
  177. package/dist/runtime/main.lib.js +8 -0
  178. package/dist/runtime/nuxt/plugins/vue-plugin.d.ts +2 -0
  179. package/dist/runtime/nuxt/plugins/vue-plugin.js +12 -0
  180. package/dist/runtime/tailwind/index.d.ts +1 -0
  181. package/dist/runtime/tailwind/index.js +1 -0
  182. package/dist/runtime/tailwind/themeConvertionOpts.d.ts +2 -0
  183. package/dist/runtime/tailwind/themeConvertionOpts.js +12 -0
  184. package/dist/runtime/theme.d.ts +2 -0
  185. package/dist/runtime/theme.js +2 -0
  186. package/dist/runtime/types/index.d.ts +119 -0
  187. package/dist/runtime/types/index.js +0 -0
  188. package/dist/runtime/utils/twMerge.d.ts +10 -0
  189. package/dist/runtime/utils/twMerge.js +10 -0
  190. package/dist/runtime/vue/VueComponentsPlugin.d.ts +2 -0
  191. package/dist/runtime/vue/VueComponentsPlugin.js +10 -0
  192. package/dist/runtime/vue/registerComponents.d.ts +19 -0
  193. package/dist/runtime/vue/registerComponents.js +10 -0
  194. package/dist/runtime/vue/registerDirectives.d.ts +3 -0
  195. package/dist/runtime/vue/registerDirectives.js +9 -0
  196. package/dist/types.d.mts +7 -0
  197. package/dist/types.d.ts +7 -0
  198. package/package.json +207 -0
  199. package/src/module.ts +176 -0
  200. package/src/runtime/assets/base.css +67 -0
  201. package/src/runtime/assets/locales/en.json +33 -0
  202. package/src/runtime/assets/style.css +144 -0
  203. package/src/runtime/assets/tailwind.css +5 -0
  204. package/src/runtime/assets/theme.css +65 -0
  205. package/src/runtime/build/WitchcraftUiResolver.ts +27 -0
  206. package/src/runtime/build/generateTheme.ts +16 -0
  207. package/src/runtime/build/unpluginIconViteOptions.ts +11 -0
  208. package/src/runtime/components/Aria/Aria.vue +27 -0
  209. package/src/runtime/components/Focus.stories.ts +67 -0
  210. package/src/runtime/components/Icon/Icon.vue +39 -0
  211. package/src/runtime/components/LibButton/LibButton.stories.ts +107 -0
  212. package/src/runtime/components/LibButton/LibButton.vue +247 -0
  213. package/src/runtime/components/LibCheckbox/LibCheckbox.stories.ts +41 -0
  214. package/src/runtime/components/LibCheckbox/LibCheckbox.vue +132 -0
  215. package/src/runtime/components/LibColorInput/LibColorInput.stories.ts +69 -0
  216. package/src/runtime/components/LibColorInput/LibColorInput.vue +125 -0
  217. package/src/runtime/components/LibColorPicker/LibColorPicker.stories.ts +60 -0
  218. package/src/runtime/components/LibColorPicker/LibColorPicker.vue +448 -0
  219. package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.ts +51 -0
  220. package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +95 -0
  221. package/src/runtime/components/LibDatePicker/LibDatePicker.stories.ts +114 -0
  222. package/src/runtime/components/LibDatePicker/LibDatePicker.vue +67 -0
  223. package/src/runtime/components/LibDatePicker/LibRangeDatePicker.vue +370 -0
  224. package/src/runtime/components/LibDatePicker/LibSingleDatePicker.vue +314 -0
  225. package/src/runtime/components/LibDatePicker/LibTimeZonePicker.vue +27 -0
  226. package/src/runtime/components/LibDatePicker/helpers.ts +55 -0
  227. package/src/runtime/components/LibDebug/LibDebug.stories.ts +58 -0
  228. package/src/runtime/components/LibDebug/LibDebug.vue +91 -0
  229. package/src/runtime/components/LibDevOnly/LibDevOnly.vue +53 -0
  230. package/src/runtime/components/LibFileInput/LibFileInput.stories.ts +79 -0
  231. package/src/runtime/components/LibFileInput/LibFileInput.vue +273 -0
  232. package/src/runtime/components/LibInput/LibInput.stories.ts +367 -0
  233. package/src/runtime/components/LibInput/LibInput.vue +372 -0
  234. package/src/runtime/components/LibLabel/LibLabel.stories.ts +37 -0
  235. package/src/runtime/components/LibLabel/LibLabel.vue +66 -0
  236. package/src/runtime/components/LibMultiValues/LibMultiValues.stories.ts +83 -0
  237. package/src/runtime/components/LibMultiValues/LibMultiValues.vue +127 -0
  238. package/src/runtime/components/LibNotifications/LibNotification.stories.ts +142 -0
  239. package/src/runtime/components/LibNotifications/LibNotification.vue +121 -0
  240. package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +124 -0
  241. package/src/runtime/components/LibNotifications/LibNotifications.vue +133 -0
  242. package/src/runtime/components/LibPagination/LibPagination.stories.ts +53 -0
  243. package/src/runtime/components/LibPagination/LibPagination.vue +261 -0
  244. package/src/runtime/components/LibPalette/LibPalette.stories.ts +32 -0
  245. package/src/runtime/components/LibPalette/LibPalette.vue +49 -0
  246. package/src/runtime/components/LibPopup/LibPopup.stories.ts +157 -0
  247. package/src/runtime/components/LibPopup/LibPopup.vue +441 -0
  248. package/src/runtime/components/LibProgressBar/LibProgressBar.stories.ts +94 -0
  249. package/src/runtime/components/LibProgressBar/LibProgressBar.vue +192 -0
  250. package/src/runtime/components/LibRecorder/LibRecorder.stories.ts +81 -0
  251. package/src/runtime/components/LibRecorder/LibRecorder.vue +243 -0
  252. package/src/runtime/components/LibRoot/LibRoot.vue +126 -0
  253. package/src/runtime/components/LibSimpleInput/LibSimpleInput.stories.ts +98 -0
  254. package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +148 -0
  255. package/src/runtime/components/LibSuggestions/LibSuggestions.stories.ts +137 -0
  256. package/src/runtime/components/LibSuggestions/LibSuggestions.vue +198 -0
  257. package/src/runtime/components/LibTable/LibTable.stories.ts +170 -0
  258. package/src/runtime/components/LibTable/LibTable.vue +177 -0
  259. package/src/runtime/components/Template/NAME.vue +49 -0
  260. package/src/runtime/components/Template/TemplateStory.ts +38 -0
  261. package/src/runtime/components/TestControls/TestControls.vue +19 -0
  262. package/src/runtime/components/index.ts +22 -0
  263. package/src/runtime/components/reset.stories.ts +32 -0
  264. package/src/runtime/components/shared/props.ts +142 -0
  265. package/src/runtime/components/shared/storyHelpers/playInput.ts +35 -0
  266. package/src/runtime/components/shared/storyHelpers/playSuggestions.ts +105 -0
  267. package/src/runtime/composables/index.ts +13 -0
  268. package/src/runtime/composables/useAccesibilityOutline.ts +104 -0
  269. package/src/runtime/composables/useAriaLabel.ts +23 -0
  270. package/src/runtime/composables/useDarkMode.ts +146 -0
  271. package/src/runtime/composables/useDivideAttrs.ts +52 -0
  272. package/src/runtime/composables/useGlobalResizeObserver.ts +33 -0
  273. package/src/runtime/composables/useInjectedDarkMode.ts +15 -0
  274. package/src/runtime/composables/useInjectedI18n.ts +10 -0
  275. package/src/runtime/composables/useInjectedLocale.ts +24 -0
  276. package/src/runtime/composables/useNotificationHandler.ts +32 -0
  277. package/src/runtime/composables/useScrollNearContainerEdges.stories.ts +93 -0
  278. package/src/runtime/composables/useScrollNearContainerEdges.ts +205 -0
  279. package/src/runtime/composables/useSetupDarkMode.ts +14 -0
  280. package/src/runtime/composables/useSetupI18n.ts +77 -0
  281. package/src/runtime/composables/useSetupLocale.ts +32 -0
  282. package/src/runtime/composables/useShowDevOnlyKey.ts +28 -0
  283. package/src/runtime/composables/useSuggestions.ts +297 -0
  284. package/src/runtime/directives/index.ts +6 -0
  285. package/src/runtime/directives/vDetectFlex.ts +159 -0
  286. package/src/runtime/directives/vExtractRootEl.ts +38 -0
  287. package/src/runtime/directives/vResizableCols.ts +378 -0
  288. package/src/runtime/directives/vResizeObserver.ts +45 -0
  289. package/src/runtime/globalResizeObserver.ts +12 -0
  290. package/src/runtime/helpers/NotificationHandler.ts +227 -0
  291. package/src/runtime/helpers/addValue.ts +10 -0
  292. package/src/runtime/helpers/base64ToImg.ts +14 -0
  293. package/src/runtime/helpers/copy.ts +11 -0
  294. package/src/runtime/helpers/createNoonUtcDate.ts +21 -0
  295. package/src/runtime/helpers/defaultTranslationFunction.ts +33 -0
  296. package/src/runtime/helpers/getTimeZoneList.ts +4 -0
  297. package/src/runtime/helpers/hasModifiers.ts +1 -0
  298. package/src/runtime/helpers/index.ts +10 -0
  299. package/src/runtime/helpers/readFile.ts +22 -0
  300. package/src/runtime/helpers/resizeObserverWrapper.ts +45 -0
  301. package/src/runtime/helpers/storybook.ts +52 -0
  302. package/src/runtime/main.lib.ts +31 -0
  303. package/src/runtime/nuxt/plugins/vue-plugin.ts +19 -0
  304. package/src/runtime/tailwind/index.ts +3 -0
  305. package/src/runtime/tailwind/themeConvertionOpts.ts +15 -0
  306. package/src/runtime/theme.ts +5 -0
  307. package/src/runtime/types/index.ts +116 -0
  308. package/src/runtime/utils/twMerge.ts +13 -0
  309. package/src/runtime/vue/VueComponentsPlugin.ts +16 -0
  310. package/src/runtime/vue/registerComponents.ts +31 -0
  311. package/src/runtime/vue/registerDirectives.ts +12 -0
  312. package/types/components.d.ts +27 -0
  313. package/types/global.d.ts +16 -0
  314. package/types/index.d.ts +5 -0
  315. package/types/vite.d.ts +2 -0
@@ -0,0 +1,144 @@
1
+ @custom-variant dark (&:where(.dark, .dark *));
2
+ @custom-variant outlined {
3
+ .group.outlined &:focus-visible {
4
+ @slot;
5
+ }
6
+ .group.outlined-visible &:focus-visible {
7
+ @slot;
8
+ }
9
+ }
10
+ @custom-variant outlined-focus {
11
+ .group.outlined &:focus {
12
+ @slot;
13
+ }
14
+ }
15
+ @custom-variant outlined-within {
16
+ .group.outlined &:focus-within {
17
+ @slot;
18
+ }
19
+ }
20
+ @custom-variant dark-outlined {
21
+ .group.dark.outlined &:focus-visible {
22
+ @slot;
23
+ }
24
+ .group.dark.outlined-visible &:focus-visible {
25
+ @slot;
26
+ }
27
+ }
28
+ @custom-variant dark-outlined-focus {
29
+ .group.dark.outlined &:focus {
30
+ @slot;
31
+ }
32
+ }
33
+ @custom-variant dark-outlined-within {
34
+ &:group.dark.outlined &:focus-within {
35
+ @slot;
36
+ }
37
+ }
38
+
39
+ @utility focus-outline-within {
40
+ @apply outlined-within:outline-hidden outlined-within:ring-2 outlined-within:ring-accent-500 outlined-within:ring-offset-2;
41
+ }
42
+
43
+ @utility focus-outline {
44
+ @apply outlined:outline-hidden outlined:ring-2 outlined:ring-accent-500 outlined:ring-offset-2;
45
+ }
46
+ @utility focus-outline-no-offset {
47
+ @apply outlined:outline-hidden outlined:ring-2 outlined:ring-accent-500;
48
+ }
49
+ @utility focus-outline-hidden {
50
+ @apply outlined:outline-hidden;
51
+ }
52
+
53
+ /* .bg-squares-gradient { */
54
+
55
+ /* } */
56
+
57
+ @utility bg-squares-gradient {
58
+ /* local defaults */
59
+ --_square: var(--squareSize, 5px);
60
+ --_double_square: calc(2*var(--_square));
61
+ --_light_square: var(--lightSquare, var(--color-white));
62
+ --_dark_square: var(--darkSquare, var(--color-black));
63
+ background-color: var(--_light_square);
64
+ background: repeating-conic-gradient(var(--_dark_square) 0% 25%, var(--_light_square) 0% 50%) 50% / var(--_double_square) var(--_double_square);
65
+ }
66
+
67
+ @utility square-light-* {
68
+ --lightSquare: --value(--color- *);
69
+ }
70
+ @utility square-dark-* {
71
+ --darkSquare: --value(--color- *);
72
+ }
73
+
74
+ @utility square-size-* {
75
+ --squareSize: calc(--value(integer) * 1px);
76
+ }
77
+
78
+ @utility bg-bars-gradient {
79
+ /* local defaults */
80
+ --_bg_color: var(--bars-bg-color, var(--color-accent-700));
81
+ --_fg_color: var(--bars-fg-color, var(--color-accent-800));
82
+ --_angle: var(--bars-angle, 45deg);
83
+ --_fg_width: var(--bars-fg-width, 50%);
84
+ --_bg_width: calc(100% - var(--_fg_width));
85
+
86
+ background-color: var(--_bg_color);
87
+ --_pos_1: calc(var(--_bg_width)/2);
88
+ --_pos_2: calc(var(--_bg_width)/2 + var(--_fg_width)/2);
89
+ --_pos_3: calc(var(--_bg_width) + var(--_fg_width)/2);
90
+ background-image:
91
+ repeating-linear-gradient(
92
+ var(--_angle),
93
+ var(--_bg_color),
94
+ var(--_bg_color) var(--_pos_1),
95
+ var(--_fg_color) var(--_pos_1),
96
+ var(--_fg_color) var(--_pos_2),
97
+ var(--_bg_color) var(--_pos_2),
98
+ var(--_bg_color) var(--_pos_3),
99
+ var(--_fg_color) var(--_pos_3),
100
+ var(--_fg_color)
101
+ );
102
+ }
103
+
104
+ @utility bars-angle-* {
105
+ --bars-angle: var(--value(integer) * 1deg);
106
+ }
107
+
108
+ @utility bars-fg-* {
109
+ --bars-fg-color: --value(--color-*);
110
+ }
111
+ @utility bars-bg-* {
112
+ --bars-bg-color: --value(--color-*);
113
+ }
114
+ @utility bars-w-* {
115
+ --bars-fg-width: calc(--value(integer) * 1%, 50%);
116
+ }
117
+
118
+ @utility scrollbar-hidden {
119
+ /* IE and Edge */
120
+ -ms-overflow-style: none;
121
+ /* Firefox */
122
+ scrollbar-width: none;
123
+ /* Safari and Chrome */
124
+ &::-webkit-scrollbar {
125
+ display: none;
126
+ }
127
+ }
128
+ @utility content-vertical-holder {
129
+ --tw-content: "\200b";
130
+ content: var(--tw-content);
131
+ }
132
+
133
+ @utility no-touch-action {
134
+ touch-action: none;
135
+ }
136
+
137
+ @utility bg-transparency-squares {
138
+ @apply bg-squares-gradient square-light-white square-dark-neutral-300 square-size-6;
139
+ }
140
+
141
+ @utility link-like {
142
+ @apply cursor-pointer hover:text-accent-500;
143
+ }
144
+
@@ -0,0 +1,5 @@
1
+ /* For storybook, not exported. */
2
+ @import "tailwindcss" source("../../");
3
+ @import "./theme.css";
4
+ @import "./base.css";
5
+ @import "./style.css";
@@ -0,0 +1,65 @@
1
+ /* Auto-generated, see gen:theme script. */
2
+ @theme {
3
+ --spacing: 0.25rem;
4
+ --color-neutral-50: oklch(0.9850000000000003 0 0);
5
+ --color-neutral-100: oklch(0.9700000000000002 0 0);
6
+ --color-neutral-200: oklch(0.922 0 0);
7
+ --color-neutral-300: oklch(0.8700000000000001 0 0);
8
+ --color-neutral-400: oklch(0.708 0 0);
9
+ --color-neutral-500: oklch(0.5560000000000002 0 0);
10
+ --color-neutral-600: oklch(0.4390000000000001 0 0);
11
+ --color-neutral-700: oklch(0.371 0 0);
12
+ --color-neutral-800: oklch(0.2690000000000001 0 0);
13
+ --color-neutral-900: oklch(0.20500000000000004 0 0);
14
+ --color-neutral-950: oklch(0.14500000000000002 0 0);
15
+ --color-neutral-50: oklch(0.9850000000000003 0 0);
16
+ --color-bg: oklch(0.9924098465974739 0 0);
17
+ --color-fg: oklch(0.09181475833376385 0 0);
18
+ --color-ok-50: oklch(0.9820000000000003 0.018000000000000457 155.82600000000036);
19
+ --color-ok-100: oklch(0.9620000000000002 0.0440000000000005 156.7430000000004);
20
+ --color-ok-200: oklch(0.9250000000000002 0.08400000000000035 155.99500000000012);
21
+ --color-ok-300: oklch(0.8710000000000001 0.1500000000000003 154.44900000000007);
22
+ --color-ok-400: oklch(0.7920000000000003 0.20900000000000052 151.71100000000013);
23
+ --color-ok-500: oklch(0.7230000000000002 0.21900000000000014 149.57900000000006);
24
+ --color-ok-600: oklch(0.6270000000000001 0.19400000000000042 149.21400000000006);
25
+ --color-ok-700: oklch(0.527 0.15400000000000028 150.06900000000007);
26
+ --color-ok-800: oklch(0.448 0.11900000000000009 151.32800000000003);
27
+ --color-ok-900: oklch(0.39299999999999996 0.09500000000000014 152.53500000000008);
28
+ --color-ok-950: oklch(0.26600000000000007 0.06499999999999999 152.93399999999997);
29
+ --color-ok-500: oklch(0.7230000000000002 0.21900000000000014 149.57900000000006);
30
+ --color-warning-50: oklch(0.9870000000000002 0.026000000000000044 102.2120000000017);
31
+ --color-warning-100: oklch(0.9730000000000001 0.07100000000000001 103.19300000000027);
32
+ --color-warning-200: oklch(0.9450000000000003 0.12900000000000011 101.54000000000019);
33
+ --color-warning-300: oklch(0.9050000000000001 0.18200000000000002 98.11100000000027);
34
+ --color-warning-400: oklch(0.8520000000000003 0.19900000000000007 91.93600000000015);
35
+ --color-warning-500: oklch(0.7950000000000003 0.18400000000000002 86.0470000000002);
36
+ --color-warning-600: oklch(0.6810000000000002 0.16200000000000006 75.83400000000023);
37
+ --color-warning-700: oklch(0.5540000000000002 0.135 66.44200000000001);
38
+ --color-warning-800: oklch(0.4760000000000001 0.11399999999999987 61.90700000000004);
39
+ --color-warning-900: oklch(0.4210000000000002 0.0949999999999999 57.70800000000014);
40
+ --color-warning-950: oklch(0.28600000000000014 0.06599999999999996 53.8130000000001);
41
+ --color-warning-500: oklch(0.7950000000000003 0.18400000000000002 86.0470000000002);
42
+ --color-danger-50: oklch(0.9710000000000001 0.012999999999999515 17.380000000000223);
43
+ --color-danger-100: oklch(0.936 0.03199999999999968 17.717000000000212);
44
+ --color-danger-200: oklch(0.8850000000000001 0.062000000000000006 18.33400000000006);
45
+ --color-danger-300: oklch(0.8079999999999999 0.11399999999999981 19.57099999999997);
46
+ --color-danger-400: oklch(0.7040000000000002 0.19099999999999973 22.216000000000008);
47
+ --color-danger-500: oklch(0.637 0.2369999999999997 25.331000000000017);
48
+ --color-danger-600: oklch(0.5770000000000002 0.24499999999999952 27.325000000000045);
49
+ --color-danger-700: oklch(0.5050000000000001 0.21299999999999994 27.51800000000003);
50
+ --color-danger-800: oklch(0.444 0.1769999999999998 26.899);
51
+ --color-danger-900: oklch(0.3960000000000002 0.14099999999999965 25.723000000000127);
52
+ --color-danger-950: oklch(0.25800000000000006 0.09199999999999989 26.04200000000003);
53
+ --color-accent-50: oklch(0.9700000000000001 0.01400000000000012 254.60399999999714);
54
+ --color-accent-100: oklch(0.9320000000000002 0.03200000000000015 255.5850000000001);
55
+ --color-accent-200: oklch(0.8820000000000002 0.059000000000000094 254.1279999999993);
56
+ --color-accent-300: oklch(0.8090000000000002 0.10499999999999995 251.81299999999993);
57
+ --color-accent-400: oklch(0.7070000000000002 0.16500000000000012 254.6239999999998);
58
+ --color-accent-500: oklch(0.6230000000000001 0.2140000000000002 259.81499999999994);
59
+ --color-accent-600: oklch(0.5460000000000002 0.245 262.8809999999998);
60
+ --color-accent-700: oklch(0.48800000000000004 0.2430000000000002 264.376);
61
+ --color-accent-800: oklch(0.4240000000000001 0.19900000000000004 265.63799999999986);
62
+ --color-accent-900: oklch(0.37900000000000006 0.146 265.52199999999993);
63
+ --color-accent-950: oklch(0.2820000000000001 0.09099999999999996 267.935);
64
+ --color-accent-500: oklch(0.6230000000000001 0.2140000000000002 259.81499999999994);
65
+ }
@@ -0,0 +1,27 @@
1
+ import { type ComponentResolver } from "unplugin-vue-components"
2
+
3
+ const prefixless = ["Icon", "Aria", "TestWrapper"]
4
+ // eslint-disable-next-line @typescript-eslint/naming-convention
5
+ export const WitchcraftUiResolver = (
6
+ {
7
+ prefix = "W",
8
+ filter = () => true,
9
+ }: {
10
+ prefix?: string
11
+ filter?: (name: string) => boolean
12
+ } = {}
13
+ ): ComponentResolver => (
14
+ componentName: string,
15
+ ): { from: string } | undefined => {
16
+ if (componentName.startsWith(prefix)) {
17
+ const n = componentName.slice(1)
18
+ const filename = prefixless.includes(n) ? n : `Lib${n}`
19
+ if (!filter(n)) {
20
+ return undefined
21
+ }
22
+ return {
23
+ from: `@witchcraft/ui/components/${filename}`
24
+ }
25
+ }
26
+ return undefined
27
+ }
@@ -0,0 +1,16 @@
1
+ import { themeAsTailwindCss } from "metamorphosis/tailwind.js"
2
+ import fs from "node:fs"
3
+ import { resolve } from "path"
4
+
5
+ import { themeConvertionOpts } from "../tailwind/themeConvertionOpts.js"
6
+ import { theme } from "../theme.js"
7
+ const css = themeAsTailwindCss(theme, themeConvertionOpts)
8
+ import url from "url"
9
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10
+ const __dirname = url.fileURLToPath(new URL(".", import.meta.url))
11
+ const filepath = resolve(__dirname, "../assets/theme.css")
12
+
13
+ const content = `/* Auto-generated, see gen:theme script. */\n${css}`
14
+ fs.writeFile(filepath, content, err => {
15
+ if (err) throw err
16
+ })
@@ -0,0 +1,11 @@
1
+ import type Icons from "unplugin-icons/vite"
2
+
3
+ export const unpluginIconViteOptions: Parameters<typeof Icons>[0] = {
4
+ scale: 0, // removes the scale
5
+ iconCustomizer: async (_, __, props) => {
6
+ props.width = "unset"
7
+ },
8
+ // note that we can't use tailwind classes
9
+ // i mean we could, but we have to tell it to include them manually (pain)
10
+ defaultStyle: "vertical-align: -0.125em; height: 1em; display: inline-block; width:auto;",
11
+ }
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <div tabindex="0">{{ value }}</div>
3
+ </template>
4
+
5
+ <script setup lang="ts">
6
+ import type { PropType } from "vue"
7
+
8
+
9
+ defineOptions({ name: "aria" })
10
+ defineProps<{
11
+ // eslint-disable-next-line vue/no-restricted-props
12
+ value: string
13
+ }>()
14
+ </script>
15
+
16
+ <style scoped>
17
+ div {
18
+ position: absolute;
19
+ height: 1px;
20
+ width: 1px;
21
+ padding: 0;
22
+ margin: -1px;
23
+ overflow: hidden;
24
+ clip: rect(0, 0, 0, 0);
25
+ white-space: nowrap;
26
+ }
27
+ </style>
@@ -0,0 +1,67 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention */
2
+ import type { Meta, StoryObj } from "@storybook/vue3"
3
+ import { onMounted, ref } from "vue"
4
+
5
+ // eslint-disable-next-line @typescript-eslint/no-restricted-imports
6
+ import * as components from "./index.js"
7
+ // TODO move docs to composable
8
+ /**
9
+ * For testing the focus styles. The (still WIP) idea is that normally the outlined class is set by whether the user is using the keyboard or not. When true, outlines generated by the focus-outline-* or outlined-* utilities are allowed (they might not always appear since most components have focus-visible styles), when false, they are not allowed, but components can still set custom focus styles that will always appear. Either or is usually not a good idea unless all components set custom focus styles. For something like a web app, focus-visible should be allowed. For an app, this setup allows that to be configurable.
10
+ */
11
+ const meta: Meta = {
12
+ title: "Other/Focus",
13
+ args: {
14
+ outline: true,
15
+ },
16
+ }
17
+ const template = `
18
+ <div class="focus-outline-no-offset border border-accent-600" tabindex="0">focus-outline-no-offset (outlined i.e. outlined-focus-visible)</div>
19
+ <div class="focus-outline border border-accent-600" tabindex="0">focus-outline (outlined i.e. outlined-focus-visible)</div>
20
+ <div class="outline-hidden outlined-focus:border-danger-500 border border-accent-600" tabindex="0">outlined-focus</div>
21
+ <div class="outline-hidden outlined-within:border-danger-500 border border-accent-600" >
22
+ outlined-within<div tabindex="0">Inner</div>
23
+ </div>
24
+ <div class="outline-hidden focus:border-danger-500 border border-accent-600" tabindex="0">Has Manual Focus Classes</div>
25
+ `
26
+ export default meta
27
+ type Story = StoryObj<typeof NAME>
28
+
29
+ export const Primary: Story = {
30
+ render: args => ({
31
+ components,
32
+ setup: () => {
33
+ const el = ref<HTMLElement>(null)
34
+ onMounted(() => {
35
+ // el.value.focus()
36
+ })
37
+ return { ...args, el }
38
+ },
39
+ template,
40
+ }),
41
+ }
42
+ /* As in force allow, not force show. */
43
+ export const OutlineForcedTrue: Story = {
44
+ ...Primary,
45
+ args: {
46
+ ...Primary.args,
47
+ forceOutline: true,
48
+ },
49
+ }
50
+ export const OutlineFalse: Story = {
51
+ ...Primary,
52
+ args: {
53
+ ...Primary.args,
54
+ outline: false,
55
+ },
56
+ }
57
+ /* We can also allow focus-visible outlines regardless of the state of outline, by wrapping in `.group.outlined-visible`. This is the default for the test wrapper.*/
58
+ export const AlwaysAllowFocusVisible: Story = {
59
+ render: args => ({
60
+ components,
61
+ setup: () => args,
62
+ template: `
63
+ <div class="outlined-visible group">${template}</div>
64
+ `,
65
+
66
+ }),
67
+ }
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div
3
+ class="icon inline-block"
4
+ v-bind="{...$attrs, class:undefined}"
5
+ >
6
+ <slot/>
7
+ </div>
8
+ </template>
9
+
10
+ <script setup lang="ts">
11
+ import { computed, type HTMLAttributes,useAttrs } from "vue"
12
+
13
+ const $attrs = useAttrs()
14
+
15
+ // eslint-disable-next-line no-use-before-define
16
+ const props = defineProps<Props>()
17
+
18
+
19
+ </script>
20
+
21
+ <script lang="ts">
22
+ /**
23
+ * Just a very simple wrapper for wrapping unplugin-icons in an inline-block div so the icon in the slot take's up a normal line height when it's alone.
24
+ *
25
+ * ```vue
26
+ * <icon><i-...></icon>
27
+ * ``
28
+ */
29
+ export default {
30
+ name: "icon",
31
+ }
32
+
33
+ interface Props
34
+ extends
35
+ /** @vue-ignore */
36
+ Partial<Omit<HTMLAttributes, "class">
37
+ > { }
38
+ </script>
39
+
@@ -0,0 +1,107 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention */
2
+ import { capitalize } from "@alanscodelog/utils/capitalize.js"
3
+ import type { Meta, StoryObj } from "@storybook/vue3"
4
+
5
+ import IconFaSolidBell from "~icons/fa-solid/bell"
6
+
7
+ // eslint-disable-next-line @typescript-eslint/no-restricted-imports
8
+ import * as components from "../index.js"
9
+
10
+
11
+ const meta: Meta<typeof components.LibButton> = {
12
+ component: components.LibButton,
13
+ title: "Components/Button",
14
+ args: {
15
+ label: "Label",
16
+ // @ts-expect-error - custom prop for story
17
+ _iconAfter: true,
18
+ },
19
+ }
20
+
21
+ export default meta
22
+ type Story = StoryObj<typeof components.LibButton>
23
+
24
+
25
+ export const Primary: Story = {
26
+ render: (args: any) => ({
27
+ components: {
28
+ ...components,
29
+ IconFaSolidBell,
30
+ },
31
+ setup: () => ({ args, capitalize }),
32
+ template: `
33
+ <div class="flex gap-4 justify-center">
34
+ <template v-for="type of [false, 'ok', 'warning', 'danger', 'primary', 'secondary' ]">
35
+ <lib-button v-bind="{...args, color: type, label: !args.label ? undefined : args.label + ' ' + capitalize(type || 'false')}">
36
+ <template #icon>
37
+ <icon class="w-[1em]"><icon-fa-solid-bell /></icon>
38
+ </template>
39
+ </lib-button>
40
+ </template>
41
+ </div>
42
+ <div class="flex flex-col gap-4 pt-10">
43
+ <template v-for="type of [false, 'ok', 'warning', 'danger', 'primary', 'secondary']">
44
+ <lib-button v-bind="{...args, color: type , label: !args.label ? undefined : args.label + ' ' + capitalize(type || 'false') }">
45
+ ${args._iconAfter ? `
46
+ <template #icon-after>
47
+ <icon class="w-[1em]"><icon-fa-solid-bell /></icon>
48
+ </template>
49
+ ` : ``}
50
+ </lib-button>
51
+ </template>
52
+ </div>
53
+ `,
54
+ }),
55
+ }
56
+
57
+ export const IconAfter: Story = {
58
+ ...Primary,
59
+ args: {
60
+ ...Primary.args,
61
+ // @ts-expect-error - .
62
+ _iconAfter: true,
63
+ },
64
+ }
65
+
66
+ export const OnlyIcon: Story = {
67
+ ...Primary,
68
+ args: {
69
+ ...Primary.args,
70
+ label: undefined,
71
+ },
72
+ }
73
+ export const Disabled: Story = {
74
+ ...Primary,
75
+ args: {
76
+ ...Primary.args,
77
+ disabled: true,
78
+ },
79
+ }
80
+ export const Borderless: Story = {
81
+ ...Primary,
82
+ args: {
83
+ ...Primary.args,
84
+ border: false,
85
+ },
86
+ }
87
+ export const BorderlessDisabled: Story = {
88
+ ...Primary,
89
+ args: {
90
+ ...Primary.args,
91
+ border: false,
92
+ disabled: true,
93
+ },
94
+ }
95
+ export const WithDivInside: Story = {
96
+ render: (args: any) => ({
97
+ components,
98
+ setup: () => ({ args }),
99
+ template: `
100
+ <div class="flex gap-4 justify-center">
101
+ <lib-button v-bind="{...args}">
102
+ <div>Div inside button still has a pointer cursor.</div>
103
+ </lib-button>
104
+ </div>
105
+ `,
106
+ }),
107
+ }