@witchcraft/ui 0.3.26 → 0.4.0-beta.2

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 +1 -1
  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 +109 -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} +40 -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 +109 -0
  24. package/dist/runtime/components/WCombobox/WCombobox.vue +402 -0
  25. package/dist/runtime/components/WCombobox/WCombobox.vue.d.ts +109 -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} +16 -21
  35. package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +16 -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} +9 -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} +71 -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 +149 -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} +32 -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 +43 -0
  67. package/dist/runtime/components/WPopover/WPopover.vue +138 -0
  68. package/dist/runtime/components/WPopover/WPopover.vue.d.ts +43 -0
  69. package/dist/runtime/components/WPopup/WPopup.d.vue.ts +41 -0
  70. package/dist/runtime/components/WPopup/WPopup.vue +74 -0
  71. package/dist/runtime/components/WPopup/WPopup.vue.d.ts +41 -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} +9 -16
  82. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +12 -23
  83. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue.d.ts → WSimpleInput/WSimpleInput.vue.d.ts} +9 -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 +111 -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 +1 -1
  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 +123 -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} +43 -32
  125. package/src/runtime/components/WCombobox/WCombobox.stories.ts +209 -0
  126. package/src/runtime/components/WCombobox/WCombobox.vue +446 -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} +16 -22
  133. package/src/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +16 -22
  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} +8 -11
  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} +95 -98
  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 +161 -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} +43 -66
  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 +161 -0
  154. package/src/runtime/components/WPopup/WPopup.stories.ts +60 -0
  155. package/src/runtime/components/WPopup/WPopup.vue +93 -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} +27 -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 -87
  165. package/src/runtime/components/WTooltip/WTooltip.stories.ts +82 -0
  166. package/src/runtime/components/WTooltip/WTooltip.vue +126 -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 +13 -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
@@ -4,8 +4,8 @@
4
4
  contenteditable=false is because of storybook, it's shortcuts interfere when not using real input elements
5
5
  -->
6
6
  <div
7
- :id="id?? fallbackId"
8
- :class="twMerge(`recorder
7
+ :class="twMerge(`
8
+ recorder
9
9
  flex items-center
10
10
  gap-2
11
11
  px-2
@@ -13,12 +13,11 @@
13
13
  focus-outline-no-offset
14
14
  rounded-sm
15
15
  `,
16
- border &&`
16
+ border && `
17
17
  border
18
18
  border-neutral-500
19
19
  focus:border-accent-500
20
20
  `,
21
-
22
21
  (disabled || readonly) && `
23
22
  text-neutral-400
24
23
  dark:text-neutral-600
@@ -30,37 +29,47 @@
30
29
  dark:border-neutral-600
31
30
  `,
32
31
  ($attrs as any).class)"
33
- :aria-disabled="disabled"
34
32
  :aria-readonly="readonly"
35
33
  :tabindex="disabled ? -1 : 0"
36
34
  :title="recording ? recordingTitle : tempValue"
37
35
  contenteditable="false"
36
+ v-bind="{ ...$attrs, class: undefined }"
37
+ role="button"
38
+ :aria-pressed="recording"
39
+ :aria-disabled="disabled"
38
40
  ref="recorderEl"
39
- v-bind="{ ...ariaLabel, ...$attrs, class: undefined }"
40
41
  @blur="handleBlurRecorder($event)"
41
- @click="handleClickRecorder($event)"
42
- @keydown.space.prevent="handleClickRecorder($event, true)"
42
+ @keydown.space.prevent.capture="handlePointerdownRecorder($event, true)"
43
43
  >
44
- <!-- :aria-description="recording ? recordingTitle : ''" -->
44
+ <span
45
+ class="sr-only"
46
+ aria-live="polite"
47
+ >
48
+ {{ recording ? (recordingTitle || t('recorder.recording')) : '' }}
49
+ </span>
45
50
  <div
46
- :class="twMerge(`recorder--indicator
47
- inline-block
48
- bg-red-700
49
- rounded-full
50
- w-[1em]
51
- h-[1em]
52
- shrink-0
53
- hover:bg-red-500
54
- `,
51
+ :class="twMerge(`
52
+ recorder--indicator
53
+ inline-block
54
+ bg-red-700
55
+ rounded-full
56
+ w-[1em]
57
+ h-[1em]
58
+ shrink-0
59
+ `,
55
60
  recording && `
56
61
  animate-blinkInf
57
62
  bg-red-500
58
63
  `,
59
64
  (disabled || readonly) && `
60
65
  bg-neutral-500
66
+ `,
67
+ !(disabled || readonly) && `
68
+ hover:bg-red-500
61
69
  `
62
70
  )"
63
71
  ref="recorderIndicatorEl"
72
+ @pointerdown.capture.prevent="handlePointerdownRecorder($event)"
64
73
  />
65
74
  <div class="recorder--value before:content-vertical-holder truncate">
66
75
  {{ recording
@@ -72,15 +81,16 @@
72
81
 
73
82
  <script setup lang="ts">
74
83
  import { keys } from "@alanscodelog/utils/keys"
75
- import { computed, type HTMLAttributes, onBeforeUnmount, onMounted, ref, watch, watchPostEffect } from "vue"
84
+ import type { HTMLAttributes } from "vue"
85
+ import { computed, onBeforeUnmount, onMounted, ref, useAttrs, watch, watchPostEffect } from "vue"
76
86
 
77
- import { useAriaLabel } from "../../composables/useAriaLabel.js"
78
87
  import { useInjectedI18n } from "../../composables/useInjectedI18n.js"
88
+ import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js"
79
89
  import { twMerge } from "../../utils/twMerge.js"
80
- import { type BaseInteractiveProps, getFallbackId, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js"
90
+
81
91
 
82
92
  defineOptions({
83
- name: "LibRecorder",
93
+ name: "WRecorder",
84
94
  inheritAttrs: false
85
95
  })
86
96
  const t = useInjectedI18n()
@@ -88,18 +98,40 @@ const t = useInjectedI18n()
88
98
  const emits = defineEmits<{
89
99
  /** Recorder is blurred */
90
100
  (e: "recorder:blur", $event: FocusEvent): void
91
- /** Recorder is clicked. The component's indicator and recorder elements are passed to help filter out those clicks. */
92
- (e: "recorder:click", { event, indicator, input }: { event: MouseEvent | KeyboardEvent, indicator: HTMLElement, input: HTMLInputElement }): void
101
+ /** Recorder pointerdown event. The component's indicator and recorder elements are passed to help filter out those clicks. */
102
+ (e: "recorder:pointerdown", { event, indicator, input }: { event: MouseEvent | KeyboardEvent, indicator: HTMLElement, input: HTMLInputElement }): void
93
103
  /* User presses enter. Not emitted when multiple values are used. */
94
104
  (e: "focus:parent"): void
95
105
  }>()
96
- const fallbackId = getFallbackId()
97
- const props = withDefaults(defineProps<Props>(), {
106
+
107
+ const $attrs = useAttrs()
108
+
109
+ const props = withDefaults(defineProps<
110
+ & /** @vue-ignore */ Omit<HTMLAttributes, "class">
111
+ & /** @vue-ignore */ TailwindClassProp
112
+ & BaseInteractiveProps
113
+ & {
114
+ border?: boolean
115
+ /** A value to display while recording, if none given the i18n `recorder.recording` key is used. */
116
+ recordingValue?: string
117
+ /** A title to display on the input div while recording. Is also used as the aria-description. */
118
+ recordingTitle?: string
119
+ /**
120
+ * The recorder object is a series of event listeners to attach to the input div while recording is started. If you need to bind directly to the element, see the `binders` prop.
121
+ *
122
+ * The listeners are then unbound when recording is set to false again.
123
+ *
124
+ * Note that the component does not handle the setting of `recording` (unless the component is disabled), `modelValue`, or `recordingValue` at all and has no mechanism for cancelling a recording. It is left to the recorder listeners and any `recorder:*` handlers to determine what to do.
125
+ */
126
+ recorder?: undefined | Record<string, any>
127
+ /** This provides a way to manually attach/remove event listeners to/from the element. It is an alternative to the `recorder` prop, see it for more details. Both cannot be specified at the same time. */
128
+ binders?: undefined | { bind: (el: HTMLElement) => void, unbind: (el: HTMLElement) => void }
129
+ }
130
+ >(), {
98
131
  recordingTitle: "",
99
- id: undefined,
100
132
  binders: undefined,
101
133
  recorder: undefined,
102
- unstyle: false, disabled: false, readonly: false, border: true
134
+ border: true
103
135
  })
104
136
  /**
105
137
  * Puts the element into recording mode if true. See {@link props.recorder}.
@@ -109,12 +141,12 @@ const recording = defineModel<boolean>("recording", { required: false, default:
109
141
  /** The final value of the recorder. For intermediate values while recording, pass a recorder and set an appropriate recording value. */
110
142
  const modelValue = defineModel<string>({ required: true })
111
143
 
112
- const recorderEl = ref<HTMLInputElement | null>(null)
144
+ const recorderEl = ref<HTMLElement | null>(null)
113
145
  const recorderIndicatorEl = ref<HTMLElement | null>(null)
114
146
  const canEdit = computed(() => !props.disabled && !props.readonly)
115
147
  const tempValue = ref(modelValue.value)
116
148
 
117
- watch([() => props.binders, () => props.binders], () => {
149
+ watch([() => props.binders, () => props.recorder], () => {
118
150
  if (recording.value) {
119
151
  throw new Error("Component was not designed to allow swapping out of binders/recorders while recording")
120
152
  }
@@ -123,7 +155,6 @@ watch([() => props.binders, () => props.binders], () => {
123
155
  watch(modelValue, () => {
124
156
  tempValue.value = modelValue.value
125
157
  })
126
- const ariaLabel = useAriaLabel(props)
127
158
 
128
159
  const boundListeners: Record<string, any> = {}
129
160
  let isBound = false
@@ -138,12 +169,13 @@ const unbindListeners = (): void => {
138
169
  }
139
170
  }
140
171
  if (props.binders && recorderEl.value) {
141
- props.binders.unbind(recorderEl.value as HTMLInputElement)
172
+ props.binders.unbind(recorderEl.value)
142
173
  }
143
174
  }
175
+
144
176
  const bindListeners = (): void => {
145
177
  if (!props.recorder && !props.binders) {
146
- throw new Error("Record is true but no recorder or binders props was passed")
178
+ throw new Error("Recording is true but no recorder or binders props was passed")
147
179
  }
148
180
  if (props.recorder && props.binders) {
149
181
  throw new Error("Recording is true and was passed both a recorder and a binders prop. Both cannot be used at the same time.")
@@ -156,7 +188,7 @@ const bindListeners = (): void => {
156
188
  }
157
189
  }
158
190
  if (props.binders && recorderEl.value) {
159
- props.binders.bind(recorderEl.value as HTMLInputElement)
191
+ props.binders.bind(recorderEl.value)
160
192
  }
161
193
  }
162
194
 
@@ -182,6 +214,7 @@ watchPostEffect(() => {
182
214
  onBeforeUnmount(() => {
183
215
  unbindListeners()
184
216
  })
217
+
185
218
  onMounted(() => {
186
219
  if (recording.value) {
187
220
  bindListeners()
@@ -195,7 +228,7 @@ const handleBlurRecorder = (e: FocusEvent): void => {
195
228
  }
196
229
  }
197
230
 
198
- const handleClickRecorder = (e: MouseEvent | KeyboardEvent, isSpaceKey: boolean = false): void => {
231
+ const handlePointerdownRecorder = (e: MouseEvent | KeyboardEvent, isSpaceKey: boolean = false): void => {
199
232
  if (!canEdit.value) return
200
233
  if (!recording.value) {
201
234
  recorderEl.value?.focus()
@@ -203,40 +236,8 @@ const handleClickRecorder = (e: MouseEvent | KeyboardEvent, isSpaceKey: boolean
203
236
  // toggle if clicking on the recording indicator, otherwise only allow starting recording, so if needed, clicks can be recorded
204
237
  if (props.recorder || props.binders) {
205
238
  if (isSpaceKey) { return }
206
- emits("recorder:click", { event: e as MouseEvent, indicator: recorderIndicatorEl.value! as HTMLElement, input: recorderEl.value! as HTMLInputElement })
239
+ emits("recorder:pointerdown", { event: e as MouseEvent, indicator: recorderIndicatorEl.value! as HTMLElement, input: recorderEl.value! as HTMLInputElement })
207
240
  }
208
241
  }
209
242
  </script>
210
243
 
211
- <script lang="ts">
212
- type RealProps
213
- = & LinkableByIdProps
214
- & BaseInteractiveProps
215
- & LabelProps
216
- & {
217
- border?: boolean
218
- /** A value to display while recording, if none given the i18n `recorder.recording` key is used. */
219
- recordingValue?: string
220
- /** A title to display on the input div while recording. Is also used as the aria-description. */
221
- recordingTitle?: string
222
- /**
223
- * The recorder object is a series of event listeners to attach to the input div while recording is started. If you need to bind directly to the element, see the `binders` prop.
224
- *
225
- * The listeners are then unbound when recording is set to false again.
226
- *
227
- * Note that the component does not handle the setting of `recording` (unless the component is disabled), `modelValue`, or `recordingValue` at all and has no mechanism for cancelling a recording. It is left to the recorder listeners and any `recorder:*` handlers to determine what to do.
228
- */
229
- recorder?: undefined | Record<string, any>
230
- /** This provides a way to manually attach/remove event listeners to/from the element. It is an alternative to the `recorder` prop, see it for more details. Both cannot be specified at the same time. */
231
- binders?: undefined | { bind: (el: HTMLElement) => void, unbind: (el: HTMLElement) => void }
232
- /** The id of the element. If not provided, the id will be generated automatically. */
233
- id?: string
234
- }
235
-
236
- interface Props
237
- extends
238
- /** @vue-ignore */
239
- Partial<Omit<HTMLAttributes, "class"> & TailwindClassProp>,
240
- RealProps
241
- { }
242
- </script>
@@ -1,25 +1,28 @@
1
1
  <template>
2
2
  <div
3
- :id="id"
4
3
  tabindex="-1"
5
4
  :class="twMerge(
6
5
  (showOutline ? 'group outlined outlined-visible' : '[&_*]:outline-hidden'),
7
6
  darkMode && ' dark',
8
- ($attrs['wrapperAttrs'] as any)?.class
7
+ wrapperAttrs?.class
9
8
  )"
10
- v-bind="{ ...($attrs['wrapperAttrs']), attrs: undefined, class: undefined }"
9
+ v-bind="{
10
+ id: 'app',
11
+ ...wrapperAttrs,
12
+ class: undefined
13
+ }"
11
14
  :ref="handleRef"
12
15
  >
13
16
  <!-- id root is useful for teleports, so they are at the topmost level where they can still be styled -->
14
17
  <!-- See TestControls for why the margins here -->
15
18
  <div
16
19
  id="root"
17
- v-bind="{ ...$attrs.attrs, class: undefined, wrapperAttrs: undefined }"
20
+ v-bind="{ ...$attrs, class: undefined }"
18
21
  :class="twMerge(`
19
- dark:bg-fg
20
- dark:text-bg
21
- bg-bg
22
- text-fg
22
+ dark:bg-neutral-900
23
+ dark:text-white
24
+ bg-neutral-50
25
+ text-black
23
26
  `,
24
27
  testWrapperMode && `
25
28
  px-10
@@ -30,7 +33,7 @@
30
33
  flex
31
34
  flex-col
32
35
  `,
33
- ($attrs as any).attrs?.class)"
36
+ ($attrs as any).class)"
34
37
  >
35
38
  <TestControls
36
39
  v-if="testWrapperMode"
@@ -48,10 +51,10 @@
48
51
  <script setup lang="ts">
49
52
  import { unreachable } from "@alanscodelog/utils/unreachable"
50
53
  import type { Theme } from "metamorphosis"
51
- import { type ComponentPublicInstance, computed, onBeforeUnmount, onMounted, ref, toRaw } from "vue"
54
+ import type { ComponentPublicInstance, HTMLAttributes } from "vue"
55
+ import { computed, onBeforeUnmount, onMounted, ref, toRaw, useAttrs } from "vue"
52
56
 
53
57
  import { useAccesibilityOutline } from "../../composables/useAccesibilityOutline.js"
54
- import { useDivideAttrs } from "../../composables/useDivideAttrs.js"
55
58
  import { useNotificationHandler } from "../../composables/useNotificationHandler.js"
56
59
  import { useSetupDarkMode } from "../../composables/useSetupDarkMode.js"
57
60
  import { useSetupI18n } from "../../composables/useSetupI18n.js"
@@ -59,19 +62,19 @@ import { useSetupLocale } from "../../composables/useSetupLocale.js"
59
62
  import { useShowDevOnlyKey } from "../../composables/useShowDevOnlyKey.js"
60
63
  import { NotificationHandler } from "../../helpers/NotificationHandler.js"
61
64
  import { theme as defaultTheme } from "../../theme.js"
65
+ import type { TailwindClassProp } from "../../types/index.js"
62
66
  import { twMerge } from "../../utils/twMerge.js"
63
- import Notifications from "../LibNotifications/LibNotifications.vue"
64
67
  import TestControls from "../TestControls/TestControls.vue"
68
+ import Notifications from "../WNotifications/WNotifications.vue"
65
69
 
66
- const $attrs = useDivideAttrs(["wrapper"])
67
70
 
68
71
  defineOptions({ name: "Root", inheritAttrs: false, suspensible: false })
72
+ const $attrs = useAttrs()
69
73
  const props = withDefaults(defineProps<{
70
74
  theme?: Theme
71
75
  outline?: boolean
72
76
  forceOutline?: boolean
73
77
  testWrapperMode?: boolean
74
- id?: string
75
78
  /** You can set a ref to the root element by passing :getRef="_ => el = _" */
76
79
  getRef?: (el: HTMLElement | null) => void
77
80
  /** True by default, should be passed import.meta.client if using nuxt, or false when running server side. */
@@ -79,12 +82,12 @@ const props = withDefaults(defineProps<{
79
82
  useBuiltinTranslations?: boolean
80
83
  useNotifications?: boolean
81
84
  notificationHandler?: NotificationHandler
85
+ wrapperAttrs?: Omit<HTMLAttributes, "class"> & TailwindClassProp
82
86
  }>(), {
83
87
  theme: undefined,
84
88
  testWrapperMode: false,
85
89
  outline: true,
86
90
  forceOutline: false,
87
- id: "app",
88
91
  getRef: undefined,
89
92
  isClientSide: true,
90
93
  useBuiltinTranslations: true,
@@ -1,19 +1,21 @@
1
1
  /* eslint-disable @typescript-eslint/naming-convention */
2
- import type { Meta, StoryObj } from "@storybook/vue3"
2
+ import type { StoryObj } from "@storybook/vue3"
3
+
4
+ import WSimpleInput from "./WSimpleInput.vue"
3
5
 
4
6
  import * as components from "../index.js"
5
7
 
6
8
  const meta = {
7
- component: components.LibSimpleInput,
9
+ component: WSimpleInput,
8
10
  title: "Components/Input",
9
11
  args: {
10
12
  modelValue: "Value",
11
13
  placeholder: "Placeholder"
12
14
  }
13
- } satisfies Meta<typeof components.LibSimpleInput> & Meta<{ custom: string }>
15
+ }
14
16
 
15
17
  export default meta
16
- type Story = StoryObj<typeof components.LibSimpleInput> // & StoryObj<typeof extraArgs>
18
+ type Story = StoryObj<typeof components.WSimpleInput>
17
19
 
18
20
  /** Input */
19
21
  export const Primary: Story = {
@@ -25,10 +27,10 @@ export const Primary: Story = {
25
27
  // eslint-disable-next-line no-console
26
28
  setup: () => ({ args, test: () => console.log("Enter") }),
27
29
  template: `
28
- <lib-simple-input
30
+ <WSimpleInput
29
31
  @keydown="test"
30
- class="m-2" v-bind="args" v-model="args.modelValue" ></lib-simple-input>
31
- <lib-simple-input class="m-2" v-bind="{...args, modelValue:''}" ></lib-simple-input>
32
+ class="m-2" v-bind="args" v-model="args.modelValue" ></WSimpleInput>
33
+ <WSimpleInput class="m-2" v-bind="{...args, modelValue:''}" ></WSimpleInput>
32
34
  `
33
35
  })
34
36
  }
@@ -41,14 +43,11 @@ export const InsideAFlexbox: Story = {
41
43
  template: `
42
44
  Inside a flexbox:
43
45
  <div class="flex flex-wrap">
44
- <lib-simple-input v-bind="args" v-model="args.modelValue"></lib-simple-input>
46
+ <WSimpleInput v-bind="args" v-model="args.modelValue"></WSimpleInput>
45
47
  <div class="border-1 border-danger-500 flex-1 whitespace-nowrap">Flex Grow: 1</div>
46
48
  </div>
47
49
  `
48
- }),
49
- args: {
50
- stretch: true
51
- }
50
+ })
52
51
  }
53
52
 
54
53
  export const Disabled = {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <input
3
- :id="id ?? fallbackId"
4
- :class="twMerge(`
3
+ :id="finalId"
4
+ :class="!unstyle && twMerge(`
5
5
  simple-input
6
6
  flex-1
7
7
  grow-[999999]
@@ -70,12 +70,11 @@
70
70
  )"
71
71
  :data-border="border"
72
72
  :data-invalid="!valid"
73
- :type="type"
74
- :placeholder="placeholder"
75
- :disabled="disabled"
76
- :readonly="readonly"
77
73
  v-model="modelValue"
78
- v-bind="{ ...$attrs, class: undefined, ...ariaLabel }"
74
+ v-bind="{
75
+ ...$attrs,
76
+ class: undefined
77
+ }"
79
78
  @keydown="handleKeydown"
80
79
  @input="emit('input', $event as InputEvent)"
81
80
  >
@@ -84,27 +83,41 @@
84
83
  <script lang="ts" setup generic="T">
85
84
  import { type InputHTMLAttributes, useAttrs } from "vue"
86
85
 
87
- import { useAriaLabel } from "../../composables/useAriaLabel.js"
86
+ import { useFallbackId } from "../../composables/useFallbackId.js"
88
87
  import { usePreHydrationValue } from "../../composables/usePreHydrationValue.js"
89
88
  import { hasModifiers } from "../../helpers/hasModifiers.js"
89
+ import type { BaseInteractiveProps, TailwindClassProp } from "../../types/index.js"
90
90
  import { twMerge } from "../../utils/twMerge.js"
91
- import { type BaseInteractiveProps, getFallbackId, type LabelProps, type LinkableByIdProps, type TailwindClassProp } from "../shared/props.js"
92
91
 
93
92
  defineOptions({
94
- name: "LibSimpleInput",
93
+ name: "WSimpleInput",
95
94
  inheritAttrs: false
96
95
  })
97
96
 
98
- const fallbackId = getFallbackId()
99
97
 
100
- const props = withDefaults(defineProps<Props>(), {
98
+ const props = withDefaults(defineProps<
99
+ & /** @vue-ignore */ Omit<
100
+ InputHTMLAttributes,
101
+ | "class" | "readonly" | "disabled" | "onSubmit" | "onInput"
102
+ // https://github.com/vuejs/core/pull/14237
103
+ | "autocomplete"
104
+ >
105
+ & /** @vue-ignore */ TailwindClassProp
106
+ & Pick<BaseInteractiveProps, "unstyle" | "border">
107
+ & {
108
+ id?: string
109
+ label?: string
110
+ valid?: boolean
111
+ }
112
+ >(), {
101
113
  id: "",
102
114
  placeholder: "",
103
115
  valid: true,
104
116
  label: "",
105
117
  type: undefined,
106
- unstyle: false, disabled: false, readonly: false, border: true
118
+ border: true
107
119
  })
120
+ const finalId = useFallbackId(props)
108
121
 
109
122
  const modelValue = defineModel<T>({ required: true })
110
123
 
@@ -114,42 +127,12 @@ const emit = defineEmits<{
114
127
  (e: "input", val: InputEvent): void
115
128
  }>()
116
129
  const $attrs = useAttrs()
117
- const ariaLabel = useAriaLabel(props, fallbackId)
118
130
 
119
131
  function handleKeydown(e: KeyboardEvent) {
120
132
  if (e.key === "Enter" && !hasModifiers(e)) {
121
133
  emit("submit", modelValue.value)
122
134
  }
123
135
  }
124
- usePreHydrationValue(props.id ?? fallbackId, modelValue)
136
+ usePreHydrationValue(finalId, modelValue)
125
137
  </script>
126
138
 
127
- <script lang="ts">
128
- type RealProps
129
- = & LinkableByIdProps
130
- & LabelProps
131
- & BaseInteractiveProps
132
- & {
133
- placeholder?: InputHTMLAttributes["placeholder"]
134
- disabled?: InputHTMLAttributes["disabled"]
135
- id?: InputHTMLAttributes["id"]
136
- type?: InputHTMLAttributes["type"]
137
- valid?: boolean
138
- }
139
-
140
- interface Props
141
- extends
142
- /** @vue-ignore */
143
- Partial<Omit<
144
- InputHTMLAttributes,
145
- | "class"
146
- | "readonly"
147
- | "disabled"
148
- | "onSubmit"
149
- | "onInput"
150
- // https://github.com/vuejs/core/pull/14237
151
- | "autocomplete"
152
- > & TailwindClassProp>,
153
- RealProps
154
- {}
155
- </script>