@witchcraft/ui 0.3.26 → 0.4.0-beta.10

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 (287) hide show
  1. package/README.md +54 -61
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -1
  4. package/dist/runtime/assets/animations.css +1 -1
  5. package/dist/runtime/assets/locales/en.json +2 -0
  6. package/dist/runtime/build/WitchcraftUiResolver.js +2 -2
  7. package/dist/runtime/components/TestControls/TestControls.vue +3 -3
  8. package/dist/runtime/components/WButton/WButton.d.vue.ts +34 -0
  9. package/dist/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +26 -38
  10. package/dist/runtime/components/WButton/WButton.vue.d.ts +34 -0
  11. package/dist/runtime/components/WCheckbox/WCheckbox.d.vue.ts +33 -0
  12. package/dist/runtime/components/WCheckbox/WCheckbox.vue +110 -0
  13. package/dist/runtime/components/WCheckbox/WCheckbox.vue.d.ts +33 -0
  14. package/dist/runtime/components/WColorInput/WColorInput.d.vue.ts +45 -0
  15. package/dist/runtime/components/WColorInput/WColorInput.vue +85 -0
  16. package/dist/runtime/components/WColorInput/WColorInput.vue.d.ts +45 -0
  17. package/dist/runtime/components/WColorInput/WColorSwatchButton.d.vue.ts +28 -0
  18. package/dist/runtime/components/WColorInput/WColorSwatchButton.vue +86 -0
  19. package/dist/runtime/components/WColorInput/WColorSwatchButton.vue.d.ts +28 -0
  20. package/dist/runtime/components/{LibColorPicker/LibColorPicker.d.vue.ts → WColorPicker/WColorPicker.d.vue.ts} +7 -6
  21. package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +41 -29
  22. package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue.d.ts → WColorPicker/WColorPicker.vue.d.ts} +7 -6
  23. package/dist/runtime/components/WCombobox/WCombobox.d.vue.ts +111 -0
  24. package/dist/runtime/components/WCombobox/WCombobox.vue +405 -0
  25. package/dist/runtime/components/WCombobox/WCombobox.vue.d.ts +111 -0
  26. package/dist/runtime/components/WCombobox/storyPlays.d.ts +18 -0
  27. package/dist/runtime/components/WCombobox/storyPlays.js +68 -0
  28. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.d.vue.ts → WDarkModeSwitcher/WDarkModeSwitcher.d.vue.ts} +8 -13
  29. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +11 -14
  30. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts → WDarkModeSwitcher/WDarkModeSwitcher.vue.d.ts} +8 -13
  31. package/dist/runtime/components/WDatePicker/WDatePicker.d.vue.ts +40 -0
  32. package/dist/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
  33. package/dist/runtime/components/WDatePicker/WDatePicker.vue.d.ts +40 -0
  34. package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +21 -21
  35. package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
  36. package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.d.vue.ts → WDatePicker/WTimeZonePicker.d.vue.ts} +1 -11
  37. package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
  38. package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue.d.ts → WDatePicker/WTimeZonePicker.vue.d.ts} +1 -11
  39. package/dist/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +10 -12
  40. package/dist/runtime/components/{LibDevOnly/LibDevOnly.d.vue.ts → WDevOnly/WDevOnly.d.vue.ts} +0 -3
  41. package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue.d.ts → WDevOnly/WDevOnly.vue.d.ts} +0 -3
  42. package/dist/runtime/components/WFileInput/WFileInput.d.vue.ts +58 -0
  43. package/dist/runtime/components/{LibFileInput/LibFileInput.vue → WFileInput/WFileInput.vue} +74 -57
  44. package/dist/runtime/components/WFileInput/WFileInput.vue.d.ts +58 -0
  45. package/dist/runtime/components/{Icon/Icon.vue.d.ts → WIcon/WIcon.d.vue.ts} +2 -6
  46. package/dist/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +1 -1
  47. package/dist/runtime/components/{Icon/Icon.d.vue.ts → WIcon/WIcon.vue.d.ts} +2 -6
  48. package/dist/runtime/components/{LibMultiValues/LibMultiValues.d.vue.ts → WMultiValues/WMultiValues.d.vue.ts} +8 -14
  49. package/dist/runtime/components/WMultiValues/WMultiValues.vue +150 -0
  50. package/dist/runtime/components/{LibMultiValues/LibMultiValues.vue.d.ts → WMultiValues/WMultiValues.vue.d.ts} +8 -14
  51. package/dist/runtime/components/WNotifications/WNotification.d.vue.ts +37 -0
  52. package/dist/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +34 -47
  53. package/dist/runtime/components/WNotifications/WNotification.vue.d.ts +37 -0
  54. package/dist/runtime/components/WNotifications/WNotifications.d.vue.ts +11 -0
  55. package/dist/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +35 -17
  56. package/dist/runtime/components/WNotifications/WNotifications.vue.d.ts +11 -0
  57. package/dist/runtime/components/WNumberInput/WNumberInput.d.vue.ts +27 -0
  58. package/dist/runtime/components/WNumberInput/WNumberInput.vue +96 -0
  59. package/dist/runtime/components/WNumberInput/WNumberInput.vue.d.ts +27 -0
  60. package/dist/runtime/components/WPagination/WPagination.d.vue.ts +59 -0
  61. package/dist/runtime/components/WPagination/WPagination.vue +182 -0
  62. package/dist/runtime/components/WPagination/WPagination.vue.d.ts +59 -0
  63. package/dist/runtime/components/WPalette/WPalette.d.vue.ts +11 -0
  64. package/dist/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
  65. package/dist/runtime/components/WPalette/WPalette.vue.d.ts +11 -0
  66. package/dist/runtime/components/WPopover/WPopover.d.vue.ts +45 -0
  67. package/dist/runtime/components/WPopover/WPopover.vue +144 -0
  68. package/dist/runtime/components/WPopover/WPopover.vue.d.ts +45 -0
  69. package/dist/runtime/components/WPopup/WPopup.d.vue.ts +51 -0
  70. package/dist/runtime/components/WPopup/WPopup.vue +106 -0
  71. package/dist/runtime/components/WPopup/WPopup.vue.d.ts +51 -0
  72. package/dist/runtime/components/{LibProgressBar/LibProgressBar.d.vue.ts → WProgressBar/WProgressBar.d.vue.ts} +14 -18
  73. package/dist/runtime/components/WProgressBar/WProgressBar.vue +150 -0
  74. package/dist/runtime/components/{LibProgressBar/LibProgressBar.vue.d.ts → WProgressBar/WProgressBar.vue.d.ts} +14 -18
  75. package/dist/runtime/components/{LibRecorder/LibRecorder.d.vue.ts → WRecorder/WRecorder.d.vue.ts} +14 -29
  76. package/dist/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +37 -36
  77. package/dist/runtime/components/{LibRecorder/LibRecorder.vue.d.ts → WRecorder/WRecorder.vue.d.ts} +14 -29
  78. package/dist/runtime/components/{LibRoot/LibRoot.d.vue.ts → WRoot/WRoot.d.vue.ts} +6 -5
  79. package/dist/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +17 -15
  80. package/dist/runtime/components/{LibRoot/LibRoot.vue.d.ts → WRoot/WRoot.vue.d.ts} +6 -5
  81. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.d.vue.ts → WSimpleInput/WSimpleInput.d.vue.ts} +10 -16
  82. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +14 -24
  83. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue.d.ts → WSimpleInput/WSimpleInput.vue.d.ts} +10 -16
  84. package/dist/runtime/components/WTable/WTable.d.vue.ts +102 -0
  85. package/dist/runtime/components/{LibTable/LibTable.vue → WTable/WTable.vue} +13 -14
  86. package/dist/runtime/components/WTable/WTable.vue.d.ts +102 -0
  87. package/dist/runtime/components/WTooltip/WTooltip.d.vue.ts +40 -0
  88. package/dist/runtime/components/WTooltip/WTooltip.vue +112 -0
  89. package/dist/runtime/components/WTooltip/WTooltip.vue.d.ts +40 -0
  90. package/dist/runtime/components/index.d.ts +20 -20
  91. package/dist/runtime/components/index.js +20 -20
  92. package/dist/runtime/composables/index.d.ts +4 -4
  93. package/dist/runtime/composables/index.js +4 -4
  94. package/dist/runtime/composables/useDelayedLoadingIndicator.d.ts +9 -0
  95. package/dist/runtime/composables/useDelayedLoadingIndicator.js +18 -0
  96. package/dist/runtime/composables/useDisplayForReka.d.ts +25 -0
  97. package/dist/runtime/composables/useDisplayForReka.js +16 -0
  98. package/dist/runtime/composables/useFallbackId.d.ts +3 -0
  99. package/dist/runtime/composables/useFallbackId.js +5 -0
  100. package/dist/runtime/composables/useInjectedDarkMode.d.ts +1 -1
  101. package/dist/runtime/composables/usePopupConstrainToStyle.d.ts +8 -0
  102. package/dist/runtime/composables/usePopupConstrainToStyle.js +8 -0
  103. package/dist/runtime/composables/useSetupDarkMode.d.ts +2 -3
  104. package/dist/runtime/composables/useSetupDarkMode.js +90 -4
  105. package/dist/runtime/helpers/NotificationHandler.d.ts +2 -2
  106. package/dist/runtime/injectionKeys.d.ts +1 -5
  107. package/dist/runtime/injectionKeys.js +0 -2
  108. package/dist/runtime/types/index.d.ts +85 -27
  109. package/dist/runtime/types/index.js +1 -0
  110. package/package.json +1 -1
  111. package/src/module.ts +1 -1
  112. package/src/runtime/assets/animations.css +3 -3
  113. package/src/runtime/assets/locales/en.json +2 -0
  114. package/src/runtime/build/WitchcraftUiResolver.ts +2 -2
  115. package/src/runtime/components/TestControls/TestControls.vue +3 -3
  116. package/src/runtime/components/WButton/WButton.stories.ts +112 -0
  117. package/src/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +34 -50
  118. package/src/runtime/components/{LibCheckbox/LibCheckbox.stories.ts → WCheckbox/WCheckbox.stories.ts} +5 -5
  119. package/src/runtime/components/WCheckbox/WCheckbox.vue +125 -0
  120. package/src/runtime/components/{LibColorInput/LibColorInput.stories.ts → WColorInput/WColorInput.stories.ts} +8 -8
  121. package/src/runtime/components/WColorInput/WColorInput.vue +112 -0
  122. package/src/runtime/components/WColorInput/WColorSwatchButton.vue +102 -0
  123. package/src/runtime/components/{LibColorPicker/LibColorPicker.stories.ts → WColorPicker/WColorPicker.stories.ts} +12 -12
  124. package/src/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +44 -31
  125. package/src/runtime/components/WCombobox/WCombobox.stories.ts +209 -0
  126. package/src/runtime/components/WCombobox/WCombobox.vue +450 -0
  127. package/src/runtime/components/WCombobox/storyPlays.ts +92 -0
  128. package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.stories.ts → WDarkModeSwitcher/WDarkModeSwitcher.stories.ts} +6 -6
  129. package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +19 -30
  130. package/src/runtime/components/{LibDatePicker/LibDatePicker.stories.ts → WDatePicker/WDatePicker.stories.ts} +42 -34
  131. package/src/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
  132. package/src/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +21 -21
  133. package/src/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
  134. package/src/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
  135. package/src/runtime/components/{LibDebug/LibDebug.stories.ts → WDebug/WDebug.stories.ts} +5 -5
  136. package/src/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +9 -10
  137. package/src/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -4
  138. package/src/runtime/components/{LibFileInput/LibFileInput.stories.ts → WFileInput/WFileInput.stories.ts} +7 -7
  139. package/src/runtime/components/{LibFileInput/LibFileInput.vue → WFileInput/WFileInput.vue} +98 -97
  140. package/src/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +5 -8
  141. package/src/runtime/components/{LibMultiValues/LibMultiValues.stories.ts → WMultiValues/WMultiValues.stories.ts} +9 -9
  142. package/src/runtime/components/WMultiValues/WMultiValues.vue +163 -0
  143. package/src/runtime/components/{LibNotifications/LibNotification.stories.ts → WNotifications/WNotification.stories.ts} +9 -9
  144. package/src/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +45 -65
  145. package/src/runtime/components/WNotifications/WNotifications.stories.ts +139 -0
  146. package/src/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +51 -29
  147. package/src/runtime/components/WNumberInput/WNumberInput.vue +109 -0
  148. package/src/runtime/components/WPagination/WPagination.stories.ts +51 -0
  149. package/src/runtime/components/WPagination/WPagination.vue +207 -0
  150. package/src/runtime/components/{LibPalette/LibPalette.stories.ts → WPalette/WPalette.stories.ts} +6 -6
  151. package/src/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
  152. package/src/runtime/components/WPopover/WPopover.stories.ts +218 -0
  153. package/src/runtime/components/WPopover/WPopover.vue +168 -0
  154. package/src/runtime/components/WPopup/WPopup.stories.ts +104 -0
  155. package/src/runtime/components/WPopup/WPopup.vue +125 -0
  156. package/src/runtime/components/WProgressBar/WProgressBar.stories.ts +119 -0
  157. package/src/runtime/components/WProgressBar/WProgressBar.vue +185 -0
  158. package/src/runtime/components/{LibRecorder/LibRecorder.stories.ts → WRecorder/WRecorder.stories.ts} +9 -6
  159. package/src/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +69 -68
  160. package/src/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +18 -15
  161. package/src/runtime/components/{LibSimpleInput/LibSimpleInput.stories.ts → WSimpleInput/WSimpleInput.stories.ts} +11 -12
  162. package/src/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +28 -44
  163. package/src/runtime/components/{LibTable/LibTable.stories.ts → WTable/WTable.stories.ts} +60 -52
  164. package/src/runtime/components/{LibTable/LibTable.vue → WTable/WTable.vue} +85 -88
  165. package/src/runtime/components/WTooltip/WTooltip.stories.ts +82 -0
  166. package/src/runtime/components/WTooltip/WTooltip.vue +128 -0
  167. package/src/runtime/components/index.ts +20 -20
  168. package/src/runtime/composables/index.ts +4 -4
  169. package/src/runtime/composables/useDelayedLoadingIndicator.ts +30 -0
  170. package/src/runtime/composables/useDisplayForReka.ts +37 -0
  171. package/src/runtime/composables/useFallbackId.ts +6 -0
  172. package/src/runtime/composables/useInjectedDarkMode.ts +1 -2
  173. package/src/runtime/composables/usePopupConstrainToStyle.ts +29 -0
  174. package/src/runtime/composables/useSetupDarkMode.ts +122 -4
  175. package/src/runtime/helpers/NotificationHandler.ts +2 -2
  176. package/src/runtime/injectionKeys.ts +1 -7
  177. package/src/runtime/types/index.ts +105 -32
  178. package/types/components.d.ts +14 -15
  179. package/dist/runtime/components/Aria/Aria.d.vue.ts +0 -6
  180. package/dist/runtime/components/Aria/Aria.vue +0 -16
  181. package/dist/runtime/components/Aria/Aria.vue.d.ts +0 -6
  182. package/dist/runtime/components/LibButton/LibButton.d.vue.ts +0 -37
  183. package/dist/runtime/components/LibButton/LibButton.vue.d.ts +0 -37
  184. package/dist/runtime/components/LibCheckbox/LibCheckbox.d.vue.ts +0 -41
  185. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +0 -103
  186. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +0 -41
  187. package/dist/runtime/components/LibColorInput/LibColorInput.d.vue.ts +0 -64
  188. package/dist/runtime/components/LibColorInput/LibColorInput.vue +0 -162
  189. package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +0 -64
  190. package/dist/runtime/components/LibDatePicker/LibDatePicker.d.vue.ts +0 -191
  191. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +0 -191
  192. package/dist/runtime/components/LibFileInput/LibFileInput.d.vue.ts +0 -46
  193. package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +0 -46
  194. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.d.vue.ts +0 -256
  195. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -387
  196. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +0 -256
  197. package/dist/runtime/components/LibLabel/LibLabel.d.vue.ts +0 -27
  198. package/dist/runtime/components/LibLabel/LibLabel.vue +0 -45
  199. package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +0 -27
  200. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +0 -109
  201. package/dist/runtime/components/LibNotifications/LibNotification.d.vue.ts +0 -45
  202. package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +0 -45
  203. package/dist/runtime/components/LibNotifications/LibNotifications.d.vue.ts +0 -15
  204. package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +0 -15
  205. package/dist/runtime/components/LibPagination/LibPagination.d.vue.ts +0 -105
  206. package/dist/runtime/components/LibPagination/LibPagination.vue +0 -229
  207. package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +0 -105
  208. package/dist/runtime/components/LibPalette/LibPalette.d.vue.ts +0 -15
  209. package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +0 -15
  210. package/dist/runtime/components/LibPopup/LibPopup.d.vue.ts +0 -52
  211. package/dist/runtime/components/LibPopup/LibPopup.vue +0 -365
  212. package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +0 -52
  213. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +0 -169
  214. package/dist/runtime/components/LibSuggestions/LibSuggestions.d.vue.ts +0 -99
  215. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +0 -178
  216. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +0 -99
  217. package/dist/runtime/components/LibTable/LibTable.d.vue.ts +0 -125
  218. package/dist/runtime/components/LibTable/LibTable.vue.d.ts +0 -125
  219. package/dist/runtime/components/Template/NAME.d.vue.ts +0 -18
  220. package/dist/runtime/components/Template/NAME.vue +0 -27
  221. package/dist/runtime/components/Template/NAME.vue.d.ts +0 -18
  222. package/dist/runtime/components/Template/TemplateStory.d.ts +0 -7
  223. package/dist/runtime/components/Template/TemplateStory.js +0 -22
  224. package/dist/runtime/components/shared/props.d.ts +0 -171
  225. package/dist/runtime/components/shared/props.js +0 -2
  226. package/dist/runtime/composables/useAriaLabel.d.ts +0 -6
  227. package/dist/runtime/composables/useAriaLabel.js +0 -15
  228. package/dist/runtime/composables/useDarkMode.d.ts +0 -77
  229. package/dist/runtime/composables/useDarkMode.js +0 -89
  230. package/dist/runtime/composables/useDivideAttrs.d.ts +0 -27
  231. package/dist/runtime/composables/useDivideAttrs.js +0 -27
  232. package/dist/runtime/composables/useSuggestions.d.ts +0 -40
  233. package/dist/runtime/composables/useSuggestions.js +0 -263
  234. package/src/runtime/components/Aria/Aria.vue +0 -26
  235. package/src/runtime/components/LibButton/LibButton.stories.ts +0 -106
  236. package/src/runtime/components/LibCheckbox/LibCheckbox.vue +0 -131
  237. package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -203
  238. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +0 -405
  239. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -419
  240. package/src/runtime/components/LibLabel/LibLabel.stories.ts +0 -33
  241. package/src/runtime/components/LibLabel/LibLabel.vue +0 -65
  242. package/src/runtime/components/LibMultiValues/LibMultiValues.vue +0 -123
  243. package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +0 -131
  244. package/src/runtime/components/LibPagination/LibPagination.stories.ts +0 -49
  245. package/src/runtime/components/LibPagination/LibPagination.vue +0 -274
  246. package/src/runtime/components/LibPopup/LibPopup.stories.ts +0 -153
  247. package/src/runtime/components/LibPopup/LibPopup.vue +0 -396
  248. package/src/runtime/components/LibProgressBar/LibProgressBar.stories.ts +0 -90
  249. package/src/runtime/components/LibProgressBar/LibProgressBar.vue +0 -197
  250. package/src/runtime/components/LibSuggestions/LibSuggestions.stories.ts +0 -134
  251. package/src/runtime/components/LibSuggestions/LibSuggestions.vue +0 -212
  252. package/src/runtime/components/Template/NAME.vue +0 -49
  253. package/src/runtime/components/Template/TemplateStory.ts +0 -37
  254. package/src/runtime/components/shared/props.ts +0 -199
  255. package/src/runtime/composables/useAriaLabel.ts +0 -23
  256. package/src/runtime/composables/useDarkMode.ts +0 -199
  257. package/src/runtime/composables/useDivideAttrs.ts +0 -53
  258. package/src/runtime/composables/useSuggestions.ts +0 -339
  259. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.d.ts +0 -0
  260. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.js +0 -0
  261. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.d.ts +0 -0
  262. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.js +0 -0
  263. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.d.ts +0 -0
  264. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.js +0 -0
  265. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.d.ts +0 -0
  266. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.js +0 -0
  267. /package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.d.vue.ts → WDatePicker/WRangeDatePicker.d.vue.ts} +0 -0
  268. /package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue.d.ts → WDatePicker/WRangeDatePicker.vue.d.ts} +0 -0
  269. /package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.d.vue.ts → WDatePicker/WSingleDatePicker.d.vue.ts} +0 -0
  270. /package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue.d.ts → WDatePicker/WSingleDatePicker.vue.d.ts} +0 -0
  271. /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.d.ts +0 -0
  272. /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.js +0 -0
  273. /package/dist/runtime/components/{LibDebug/LibDebug.d.vue.ts → WDebug/WDebug.d.vue.ts} +0 -0
  274. /package/dist/runtime/components/{LibDebug/LibDebug.vue.d.ts → WDebug/WDebug.vue.d.ts} +0 -0
  275. /package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -0
  276. /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.d.vue.ts → WNotifications/WNotificationTestMessageComponent.d.vue.ts} +0 -0
  277. /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue → WNotifications/WNotificationTestMessageComponent.vue} +0 -0
  278. /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue.d.ts → WNotifications/WNotificationTestMessageComponent.vue.d.ts} +0 -0
  279. /package/dist/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.d.ts +0 -0
  280. /package/dist/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.js +0 -0
  281. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.ts +0 -0
  282. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.ts +0 -0
  283. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.ts +0 -0
  284. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.ts +0 -0
  285. /package/src/runtime/components/{LibDatePicker → WDatePicker}/helpers.ts +0 -0
  286. /package/src/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue → WNotifications/WNotificationTestMessageComponent.vue} +0 -0
  287. /package/src/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.ts +0 -0
package/README.md CHANGED
@@ -55,23 +55,6 @@ To make it easier to style parts of components or override behavior, some compon
55
55
 
56
56
  I think this is nicer in general than having to pass an object with extra attributes. The only weird part, is because of how vue changes the case of props, for attributes like `innerHTML` you will need to pass `{prefix}-inner-h-t-m-l`, but all components have proper types to help this. Similarly events look like `{prefix}-on-click`.
57
57
 
58
- # Slots
59
-
60
- Usually it is possible to do most modifications through props, but slots to replace parts of components are available.
61
-
62
- Most slots where possible are passed all properties needed to replace them except classes so you can do something like this, to for example replace the simple input component inside the input component.
63
-
64
- ```vue
65
- <lib-simple-input-deprecated>
66
- <template #input="slotProps">
67
- <lib-simple-input
68
- :class="'completely custom styles'"
69
- v-bind="slotProps"
70
- ></lib-simple-input>
71
- </template>
72
- </lib-simple-input>
73
-
74
- ```
75
58
 
76
59
  # Other
77
60
 
@@ -167,56 +150,66 @@ Note that using the strictTemplates compiler option can cause weird issues with
167
150
 
168
151
  ## Props
169
152
 
170
- Due to issues with vue 3 removing $listeners and the fact that we can't inherit from an existing HTML attribute types to specify props for wrapper components (most of them), we have to declare props in a convoluted way to get proper types when we consume the components.
153
+ Props and attribute typing used to have a lot of issues with vue. It's improved a bit. A typical component looks like this:
171
154
 
172
- Here is an example of the needed code for props to work correctly:
173
155
  ```vue
156
+ <template>
157
+ <div
158
+ :class="twMerge(`
159
+ our-classes
160
+ `, ($attrs as any).class)"
161
+ v-bind="{ ...$attrs, class: undefined }"
162
+ >
163
+ ...
164
+ </div>
165
+ </template>
174
166
  <script lang="ts">
175
- // this is done in a seperate script so that it actually compiles
176
- // and we can have interface merging, a setup script cannot interface merge
177
-
178
- import type { BaseInteractiveProps } from "../shared/props.js"
179
-
180
- // real props vue can understand, they will show up under props.*
181
- type RealProps =
182
- // simple types are okay
183
- & BaseInteractiveProps
184
- & {
185
- // any ignored props that we need to use in the component template
186
- // will need to be re-defined so vue can see them
187
- // in a way vue can see them if it's one of the problem properties
188
- id?: InputHTMLAttributes["id"]
189
- }
190
-
191
- interface Props
192
- extends
193
- // we need to ignore the complex InputHTMLAttributes type
194
- // otherwise vue compilation fails
195
- // if we ignore it, all it's properties are passed as fallback attrs
196
- // NOT to props as normal
197
- // we also need to omit properties or events that the component overrides with a different type
198
- /** @vue-ignore */
199
- Partial<Omit<InputHTMLAttributes,"class" | "onSubmit"> & {
200
- // overrides for the components
201
- // usually, for example, class can only be a string (because of tailwind)
202
- // this will be passed as an attr
203
- class?:string
204
- }>,
205
- /** @vue-ignore */
206
- RealProps
207
- { }
208
- </script>
167
+ import type { BaseInteractiveProps } from "../../types/index.js"
209
168
 
210
- <script lang="ts" setup>
211
- const props = withDefaults(defineProps<Props>(), {
212
- id: "",
213
- unstyle: false, disabled:false, readonly:false, border:true,
214
- })
169
+ // only if it makes sense, otherwise prefer a prop (___Attrs for attributes, ___Props if it wraps reka-ui props)
170
+ // we do this regardless of whether we pass to the root or not (since we never allow non-tailwind classes)
215
171
  const $attrs = useAttrs()
216
- </script>
217
- ```
172
+ const props = withDefaults(defineProps<
173
+ & BaseInteractiveProps
174
+ & {
175
+ // if we need an id for hydration or some internal aria connection
176
+ id?: string
177
+ // if we allow setting a label via text
178
+ label?: string
179
+ // note we omitted it above, will be available via props.disabled
180
+ disabled?: boolean
181
+ // if we just need to pass "attributes" to the root
182
+ inputAttrs?: Omit<InputHTMLAttributes, "class"> & TailwindClassProp
183
+ // if we need to pass, to for example, a reka-ui Content component
184
+ contentProps?: PopoverContentProps & EmitsToProps<DialogContentEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp
185
+ }
186
+ // the parts under the ignore type the $attrs and are NOT available on props.*
187
+ // they must be accessed via $attrs and are not reactive
188
+ // if we need to change the type or need access to the prop via props.* we can omit it here
189
+ & /** @vue-ignore */ Omit<InputHTMLAttributes, "class" | "disabled">
190
+ & /** @vue-ignore */ TailwindClassProp
191
+ >(), {
192
+ label: "",
193
+ // the defaults for BaseInteractiveProps that are not false by default, and no, they can't be spread
194
+ // see https://github.com/nuxt/module-builder/issues/649
195
+ border: true
196
+ })
197
+ // uses useId if id is not set so we have an id if we need it for hydration
198
+ const finalId = useFallbackId(props)
199
+ const modelValue = defineModel<string>({ required: false, default: "" })
200
+ // use for inputs or elements where it's highly likely the user can start setting a value before hydration
201
+ usePreHydrationValue(finalId, modelValue)
218
202
 
219
- For prop types that don't error, I think we can just define them normally, but then it turns into a mess, some components will have their values in props, some in $attrs, this way. This is consistent and also more in line with what we expect.
203
+ </script>
204
+ <script lang="ts">
205
+ /**
206
+ * If the component requires general docs, they should be written here over the export default.
207
+ */
208
+ export default {
209
+ name: "WComponentName"
210
+ // https://v3.vuejs.org/guide/typescript-support.html#annotating-props
211
+ }
212
+ </script>```
220
213
 
221
214
  Related Links:
222
215
  - https://github.com/vuejs/rfcs/discussions/397
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "witchcraftUi",
3
3
  "configKey": "witchcraftUi",
4
- "version": "0.3.26",
4
+ "version": "0.4.0-beta.10",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -19,7 +19,7 @@ const componentsInfo = globFiles([
19
19
  `!**/Template/**.vue`
20
20
  ], [], (filepath, name) => ({
21
21
  originalName: name,
22
- name: name.startsWith("Lib") ? name.replace("Lib", "PREFIX") : `PREFIX${name}`,
22
+ name: name.startsWith("W") ? name.replace("W", "PREFIX") : `PREFIX${name}`,
23
23
  filepath
24
24
  }));
25
25
  const module$1 = defineNuxtModule({
@@ -1 +1 @@
1
- @utility animate-from-*{--animate-from:--value([length],[percentage]);--animate-from:calc(var(--spacing) * --value(integer))}@utility -animate-from-*{--animate-from:--value([length],[percentage]);--animate-from:calc(var(--spacing) * -1 * --value(integer))}@theme{--animate-blinkInf:blink 1s linear infinite;@keyframes blink{0%{opacity:0}25%{opacity:1}75%{opacity:1}to{opacity:0}}--animate-slideBgInf:slide-bg 10s ease-in-out linear-infinite;@keyframes slide{0%{background-position:0}to{background-position:100%}}--animate-hide:hide 500ms ease-in;@keyframes hide{0%{opacity:1}to{opacity:0}}--animate-slideInLeft:slideInLeft 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInLeft{0%{opacity:0;transform:translateX(var(--animate-from,100%))}to{opacity:1;transform:translateX(0)}}--animate-slideInRight:slideInLeft 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInRight{0%{opacity:0;transform:translateX(var(--animate-from,-100%))}to{opacity:1;transform:translateX(0)}}--animate-slideInUp:slideInUp 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInUp{0%{opacity:0;transform:translateY(var(--animate-from,100%))}to{opacity:1;transform:translateY(0)}}--animate-slideInDown:slideInDown 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInDown{0%{opacity:0;transform:translateY(var(--animate-from,-100%))}to{opacity:1;transform:translateY(0)}}--animate-overlayShow:overlayShow 500ms cubic-bezier(0.16,1,0.3,1);@keyframes overlayShow{0%{opacity:0}to{opacity:1}}--animate-contentShow:contentShow 500ms cubic-bezier(0.16,1,0.3,1);@keyframes contentShow{0%{opacity:0;transform:translateY(-10%) scale(.96)}to{opacity:1;transform:scale(1)}}}
1
+ @utility animate-from-*{--animate-from:--value([length],[percentage]);--animate-from:calc(var(--spacing) * --value(integer))}@utility -animate-from-*{--animate-from:--value([length],[percentage]);--animate-from:calc(var(--spacing) * -1 * --value(integer))}@theme{--animate-blinkInf:blink 1s linear infinite;@keyframes blink{0%{opacity:0}25%{opacity:1}75%{opacity:1}to{opacity:0}}--animate-slideBgInf:slideBg 10s ease-in-out linear-infinite;@keyframes slideBg{0%{background-position:0}to{background-position:100%}}--animate-hide:hide 500ms ease-in;@keyframes hide{0%{opacity:1}to{opacity:0}}--animate-slideInLeft:slideInLeft 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInLeft{0%{opacity:0;transform:translateX(var(--animate-from,100%))}to{opacity:1;transform:translateX(0)}}--animate-slideInRight:slideInRight 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInRight{0%{opacity:0;transform:translateX(var(--animate-from,-100%))}to{opacity:1;transform:translateX(0)}}--animate-slideInUp:slideInUp 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInUp{0%{opacity:0;transform:translateY(var(--animate-from,100%))}to{opacity:1;transform:translateY(0)}}--animate-slideInDown:slideInDown 500ms cubic-bezier(0.16,1,0.3,1);@keyframes slideInDown{0%{opacity:0;transform:translateY(var(--animate-from,-100%))}to{opacity:1;transform:translateY(0)}}--animate-overlayShow:overlayShow 500ms cubic-bezier(0.16,1,0.3,1);@keyframes overlayShow{0%{opacity:0}to{opacity:1}}--animate-contentShow:contentShow 500ms cubic-bezier(0.16,1,0.3,1);@keyframes contentShow{0%{opacity:0;transform:translateY(-10%) scale(.96)}to{opacity:1;transform:scale(1)}}}
@@ -25,6 +25,8 @@
25
25
  "pagination.aria.go-to-next-page": "Go to next page. Page {count}",
26
26
  "pagination.aria.go-to-page": "Go to page {count}",
27
27
  "pagination.aria.current-page": "Current page {count}",
28
+ "pagination.aria.go-to-first-page": "Go to first page",
29
+ "pagination.aria.go-to-last-page": "Go to last page",
28
30
  "pagination.previous-page": "Prev",
29
31
  "pagination.next-page": "Next",
30
32
  "recorder.recording": "Recording",
@@ -1,11 +1,11 @@
1
- const prefixless = ["Icon", "Aria"];
1
+ const prefixless = ["Icon"];
2
2
  export const WitchcraftUiResolver = ({
3
3
  prefix = "W",
4
4
  filter = () => true
5
5
  } = {}) => (componentName) => {
6
6
  if (componentName.startsWith(prefix)) {
7
7
  const n = componentName.slice(1);
8
- const filename = prefixless.includes(n) ? n : `Lib${n}`;
8
+ const filename = prefixless.includes(n) ? n : `W${n}`;
9
9
  if (!filter(n)) {
10
10
  return void 0;
11
11
  }
@@ -1,16 +1,16 @@
1
1
  <template>
2
- <!-- Width 100% + 2xmargin in combination with the margins in LibRoot is a bit of a hack so that it looks like there's padding around the content in test mode (for storybook). We can't just absolutely position these controls or they make the container scroll. -->
2
+ <!-- Width 100% + 2xmargin in combination with the margins in WRoot is a bit of a hack so that it looks like there's padding around the content in test mode (for storybook). We can't just absolutely position these controls or they make the container scroll. -->
3
3
  <div class="test-controls flex gap-2 p-1 pb-10 -ml-10 w-[calc(100%_+_var(--spacing)*20)]">
4
4
  <div class="flex-grow"/>
5
5
  <div class="outline-indicator">
6
6
  {{ showOutline ? "Outline Enabled" : "Outline Disabled" }}
7
7
  </div>
8
- <lib-dark-mode-switcher/>
8
+ <WDarkModeSwitcher/>
9
9
  </div>
10
10
  </template>
11
11
 
12
12
  <script setup>
13
- import LibDarkModeSwitcher from "../LibDarkModeSwitcher/LibDarkModeSwitcher.vue";
13
+ import WDarkModeSwitcher from "../WDarkModeSwitcher/WDarkModeSwitcher.vue";
14
14
  defineOptions({ name: "TestControls" });
15
15
  defineProps({
16
16
  showOutline: { type: Boolean, required: true }
@@ -0,0 +1,34 @@
1
+ import { type ButtonHTMLAttributes } from "vue";
2
+ import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js";
3
+ type __VLS_Props = BaseInteractiveProps & {
4
+ label?: string;
5
+ border?: boolean;
6
+ color?: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
7
+ } & /** @vue-ignore */ Omit<ButtonHTMLAttributes, "class" | "color"> & /** @vue-ignore */ TailwindClassProp;
8
+ declare var __VLS_1: {
9
+ classes: string;
10
+ }, __VLS_3: {}, __VLS_5: {
11
+ label: string;
12
+ }, __VLS_7: {};
13
+ type __VLS_Slots = {} & {
14
+ label?: (props: typeof __VLS_1) => any;
15
+ } & {
16
+ icon?: (props: typeof __VLS_3) => any;
17
+ } & {
18
+ default?: (props: typeof __VLS_5) => any;
19
+ } & {
20
+ 'icon-after'?: (props: typeof __VLS_7) => any;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
23
+ color: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
24
+ border: boolean;
25
+ label: string;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <button
3
- :id="id ?? fallbackId"
4
- :class="!$attrs.unstyle && twMerge(
3
+ :class="!unstyle && twMerge(
5
4
  `
6
5
  button
7
6
  flex
@@ -27,7 +26,8 @@
27
26
  border && `
28
27
  transition-all
29
28
  bg-neutral-100
30
- dark:bg-neutral-800
29
+ dark:tint-neutral-800/10
30
+ dark:bg-(--mix)
31
31
  shadow-[0_1px_1px_0]
32
32
  shadow-neutral-950/20
33
33
  hover:shadow-[0_1px_3px_0]
@@ -42,6 +42,7 @@
42
42
  after:shadow-[0_1px_0_0_inset]
43
43
  after:shadow-bg/20
44
44
  hover:after:shadow-bg/60
45
+ disabled:after:hidden
45
46
  dark:after:shadow-bg/10
46
47
  dark:hover:after:shadow-bg/50
47
48
  after:pointer-events-none
@@ -50,15 +51,16 @@
50
51
  active:shadow-fg/20
51
52
  active:border-transparent
52
53
  border
53
- border-neutral-300
54
+ border-black/10
54
55
  disabled:border-neutral-200
55
- disabled:bg-neutral-50
56
+ disabled:bg-neutral-100
56
57
  dark:hover:shadow-neutral-950/70
57
58
  dark:active:shadow-fg/40
58
59
  dark:active:border-neutral-900
59
- dark:border-neutral-900
60
+ dark:border-black/50
60
61
  dark:disabled:border-neutral-800
61
- dark:disabled:bg-neutral-900
62
+ dark:disabled:bg-(--mix)
63
+ dark:disabled:shade-neutral-900/10
62
64
  `,
63
65
  border && (!color || color === `secondary`) && `
64
66
  after:shadow-bg/90
@@ -154,26 +156,24 @@
154
156
  `,
155
157
  $attrs?.class
156
158
  )"
157
- :type="$attrs.type"
159
+ :type="$attrs?.type || 'button'"
158
160
  :tabindex="0"
159
161
  :disabled="disabled"
160
162
  :data-border="border"
161
163
  :data-color="color"
162
- :aria-disabled="disabled"
163
164
  v-bind="{
164
- ...autoTitle,
165
165
  ...$attrs,
166
- class: void 0,
167
- ...ariaLabel
166
+ class: void 0
168
167
  }"
169
168
  >
170
169
  <slot
171
170
  name="label"
172
- v-bind="{ id: `label-${id ?? fallbackId}`, classes: 'button--label pointer-events-none flex flex-1 items-center justify-center gap-1' }"
171
+ v-bind="{
172
+ classes: 'button--label pointer-events-none flex flex-1 items-center justify-center gap-1'
173
+ }"
173
174
  >
174
- <label
175
- :id="`label-${id ?? fallbackId}`"
176
- class="button--label pointer-events-none flex flex-1 items-center justify-center gap-1"
175
+ <div
176
+ :class="!unstyle && 'button--label pointer-events-none flex flex-1 items-center justify-center gap-1'"
177
177
  >
178
178
  <slot name="icon"/>
179
179
  <slot
@@ -184,38 +184,26 @@
184
184
  </span>
185
185
  </slot>
186
186
  <slot name="icon-after"/>
187
- </label>
187
+ </div>
188
188
  </slot>
189
189
  </button>
190
190
  </template>
191
191
 
192
192
  <script setup>
193
193
  import { isBlank } from "@alanscodelog/utils/isBlank";
194
- import { computed, useAttrs } from "vue";
195
- import { useAriaLabel } from "../../composables/useAriaLabel.js";
194
+ import { useAttrs } from "vue";
196
195
  import { twMerge } from "../../utils/twMerge.js";
197
- import { getFallbackId } from "../shared/props.js";
198
196
  const $attrs = useAttrs();
199
197
  defineOptions({
200
- name: "LibButton"
198
+ name: "WButton",
199
+ inheritAttrs: false
201
200
  });
202
- const fallbackId = getFallbackId();
203
- const props = defineProps({
204
- id: { type: String, required: false },
205
- label: { type: String, required: false, default: "" },
206
- disabled: { type: Boolean, required: false, default: false },
207
- readonly: { type: Boolean, required: false, default: false },
201
+ defineProps({
202
+ disabled: { type: Boolean, required: false },
203
+ readonly: { type: Boolean, required: false },
208
204
  border: { type: Boolean, required: false, default: true },
209
- unstyle: { type: Boolean, required: false, default: false },
210
- color: { type: [String, Boolean], required: false, default: false },
211
- autoTitleFromAria: { type: Boolean, required: false }
205
+ unstyle: { type: Boolean, required: false },
206
+ label: { type: String, required: false, default: "" },
207
+ color: { type: [String, Boolean], required: false, default: false }
212
208
  });
213
- const ariaLabel = useAriaLabel(props, fallbackId);
214
- const autoTitle = computed(() => ({
215
- title: props.autoTitleFromAria ? $attrs["aria-label"] ?? props.label : void 0
216
- }));
217
- </script>
218
-
219
- <script>
220
-
221
209
  </script>
@@ -0,0 +1,34 @@
1
+ import { type ButtonHTMLAttributes } from "vue";
2
+ import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js";
3
+ type __VLS_Props = BaseInteractiveProps & {
4
+ label?: string;
5
+ border?: boolean;
6
+ color?: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
7
+ } & /** @vue-ignore */ Omit<ButtonHTMLAttributes, "class" | "color"> & /** @vue-ignore */ TailwindClassProp;
8
+ declare var __VLS_1: {
9
+ classes: string;
10
+ }, __VLS_3: {}, __VLS_5: {
11
+ label: string;
12
+ }, __VLS_7: {};
13
+ type __VLS_Slots = {} & {
14
+ label?: (props: typeof __VLS_1) => any;
15
+ } & {
16
+ icon?: (props: typeof __VLS_3) => any;
17
+ } & {
18
+ default?: (props: typeof __VLS_5) => any;
19
+ } & {
20
+ 'icon-after'?: (props: typeof __VLS_7) => any;
21
+ };
22
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
23
+ color: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
24
+ border: boolean;
25
+ label: string;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
+ declare const _default: typeof __VLS_export;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -0,0 +1,33 @@
1
+ import type { HTMLAttributes, InputHTMLAttributes } from "vue";
2
+ import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js";
3
+ type __VLS_Props = BaseInteractiveProps & {
4
+ id?: string;
5
+ label?: string;
6
+ labelAttrs?: Omit<HTMLAttributes, "class"> & TailwindClassProp;
7
+ wrapperAttrs?: Omit<HTMLAttributes, "class"> & TailwindClassProp;
8
+ } & /** @vue-ignore */ Omit<InputHTMLAttributes, "class" | "readonly" | "disabled" | "onSumbit" | "autocomplete"> & /** @vue-ignore */ TailwindClassProp;
9
+ type __VLS_ModelProps = {
10
+ "modelValue"?: boolean | "indeterminate";
11
+ };
12
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
13
+ declare var __VLS_1: {}, __VLS_26: {};
14
+ type __VLS_Slots = {} & {
15
+ left?: (props: typeof __VLS_1) => any;
16
+ } & {
17
+ default?: (props: typeof __VLS_26) => any;
18
+ };
19
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ "update:modelValue": (value: boolean | "indeterminate") => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: boolean | "indeterminate") => any) | undefined;
23
+ }>, {
24
+ border: boolean;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <div
3
+ :class="twMerge(
4
+ `
5
+ checkbox--wrapper
6
+ flex
7
+ items-center
8
+ gap-1
9
+ `,
10
+ (disabled || readonly) && `
11
+ cursor-not-allowed
12
+ text-neutral-500
13
+ `,
14
+ wrapperAttrs?.class
15
+ )"
16
+ v-bind="{ ...wrapperAttrs, class: void 0 }"
17
+ ref="el"
18
+ >
19
+ <slot name="left"/>
20
+ <label
21
+ :class="twMerge(
22
+ `
23
+ checkbox--label
24
+ flex
25
+ items-center
26
+ gap-1
27
+ `,
28
+ labelAttrs?.class
29
+ )"
30
+ v-bind="{ ...labelAttrs, class: void 0 }"
31
+ >
32
+ <CheckboxRoot
33
+ :id="finalId"
34
+ :disabled="disabled || readonly"
35
+ :class="!unstyle && twMerge(
36
+ `
37
+ checkbox
38
+ flex
39
+ items-center
40
+ justify-center
41
+ focus-outline-no-offset
42
+ m-0
43
+ h-[1.2em]
44
+ w-[1.2em]
45
+ aspect-square
46
+ bg-neutral-500/10
47
+ text-white
48
+ dark:text-white
49
+ border
50
+ border-neutral-500
51
+ data-[state=checked]:border-accent-800/50
52
+ data-[state=checked]:bg-accent-500
53
+ data-[state=checked]:shadow-2xs
54
+ data-[state=checked]:shadow-black/20
55
+ data-[state=unchecked]:inset-shadow-2xs
56
+ data-[state=unchecked]:inset-shadow-black/20
57
+ focus:border-accent-600
58
+ rounded-sm
59
+ relative
60
+ transition-colors
61
+ dark:disabled:bg-neutral-800
62
+ cursor-pointer
63
+ disabled:text-neutral-500
64
+ disabled:bg-neutral-500/50
65
+ disabled:cursor-not-allowed
66
+ disabled:data-[state=checked]:border-neutral-500
67
+ `,
68
+ $attrs?.class
69
+ )"
70
+ v-bind="{ ...$attrs, class: void 0 }"
71
+
72
+ v-model="modelValue"
73
+ >
74
+ <CheckboxIndicator class="checkbox--indicator">
75
+ <WIcon class="scale-110 mt-[2px] ml-[0.5px] [&_path]:stroke-3"><i-lucide-check/></WIcon>
76
+ </CheckboxIndicator>
77
+ </CheckboxRoot>
78
+
79
+ <slot/> {{ label }}
80
+ </label>
81
+ </div>
82
+ </template>
83
+
84
+ <script setup>
85
+ import { CheckboxIndicator, CheckboxRoot } from "reka-ui";
86
+ import { useAttrs } from "vue";
87
+ import ILucideCheck from "~icons/lucide/check";
88
+ import { useFallbackId } from "../../composables/useFallbackId.js";
89
+ import { usePreHydrationValue } from "../../composables/usePreHydrationValue.js";
90
+ import { twMerge } from "../../utils/twMerge.js";
91
+ import WIcon from "../WIcon/WIcon.vue";
92
+ const $attrs = useAttrs();
93
+ defineOptions({
94
+ name: "WCheckbox",
95
+ inheritAttrs: false
96
+ });
97
+ const props = defineProps({
98
+ disabled: { type: Boolean, required: false },
99
+ readonly: { type: Boolean, required: false },
100
+ border: { type: Boolean, required: false, default: true },
101
+ unstyle: { type: Boolean, required: false },
102
+ id: { type: String, required: false },
103
+ label: { type: String, required: false },
104
+ labelAttrs: { type: Object, required: false },
105
+ wrapperAttrs: { type: Object, required: false }
106
+ });
107
+ const modelValue = defineModel("modelValue", { type: [Boolean, String], ...{ default: false } });
108
+ const finalId = useFallbackId(props);
109
+ usePreHydrationValue(finalId, modelValue);
110
+ </script>
@@ -0,0 +1,33 @@
1
+ import type { HTMLAttributes, InputHTMLAttributes } from "vue";
2
+ import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js";
3
+ type __VLS_Props = BaseInteractiveProps & {
4
+ id?: string;
5
+ label?: string;
6
+ labelAttrs?: Omit<HTMLAttributes, "class"> & TailwindClassProp;
7
+ wrapperAttrs?: Omit<HTMLAttributes, "class"> & TailwindClassProp;
8
+ } & /** @vue-ignore */ Omit<InputHTMLAttributes, "class" | "readonly" | "disabled" | "onSumbit" | "autocomplete"> & /** @vue-ignore */ TailwindClassProp;
9
+ type __VLS_ModelProps = {
10
+ "modelValue"?: boolean | "indeterminate";
11
+ };
12
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
13
+ declare var __VLS_1: {}, __VLS_26: {};
14
+ type __VLS_Slots = {} & {
15
+ left?: (props: typeof __VLS_1) => any;
16
+ } & {
17
+ default?: (props: typeof __VLS_26) => any;
18
+ };
19
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ "update:modelValue": (value: boolean | "indeterminate") => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: boolean | "indeterminate") => any) | undefined;
23
+ }>, {
24
+ border: boolean;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,45 @@
1
+ import type { DialogRootEmits, PopoverRootProps } from "reka-ui";
2
+ import { type ButtonHTMLAttributes, type EmitsToProps, type HTMLAttributes } from "vue";
3
+ import type { HsvaColor, RgbaColor, TailwindClassProp } from "../../types/index.js";
4
+ type __VLS_Props = {
5
+ id?: string;
6
+ label?: string;
7
+ allowAlpha?: boolean;
8
+ border?: boolean;
9
+ /** See ColorPicker.copyTransform */
10
+ copyTransform?: (val: HsvaColor, stringVal: string) => any;
11
+ /** See ColorPicker.allowAlpha */
12
+ stringPrecision?: number;
13
+ /** See ColorPicker.customRepresentation */
14
+ customRepresentation?: {
15
+ fromHsvaToString: (hsva: HsvaColor, includeAlpha: boolean) => string;
16
+ };
17
+ rootProps?: PopoverRootProps & EmitsToProps<DialogRootEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
18
+ } & /** @vue-ignore */ Omit<ButtonHTMLAttributes, "class"> & /** @vue-ignore */ TailwindClassProp;
19
+ type __VLS_ModelProps = {
20
+ modelValue?: RgbaColor;
21
+ "tempValue"?: RgbaColor | undefined;
22
+ };
23
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
24
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ "update:modelValue": (value: RgbaColor) => any;
26
+ "update:tempValue": (value: RgbaColor | undefined) => any;
27
+ } & {
28
+ save: () => any;
29
+ cancel: () => any;
30
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
31
+ "onUpdate:modelValue"?: ((value: RgbaColor) => any) | undefined;
32
+ onSave?: (() => any) | undefined;
33
+ onCancel?: (() => any) | undefined;
34
+ "onUpdate:tempValue"?: ((value: RgbaColor | undefined) => any) | undefined;
35
+ }>, {
36
+ border: boolean;
37
+ allowAlpha: boolean;
38
+ copyTransform: (val: HsvaColor, stringVal: string) => any;
39
+ stringPrecision: number;
40
+ customRepresentation: {
41
+ fromHsvaToString: (hsva: HsvaColor, includeAlpha: boolean) => string;
42
+ };
43
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
44
+ declare const _default: typeof __VLS_export;
45
+ export default _default;