@witchcraft/ui 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/README.md +56 -61
  2. package/dist/module.d.mts +1 -1
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +13 -9
  5. package/dist/runtime/assets/animations.css +1 -1
  6. package/dist/runtime/assets/locales/en.json +2 -0
  7. package/dist/runtime/assets/utils.css +1 -1
  8. package/dist/runtime/build/WitchcraftUiResolver.js +1 -2
  9. package/dist/runtime/components/TestControls/TestControls.d.vue.ts +2 -1
  10. package/dist/runtime/components/TestControls/TestControls.vue +3 -3
  11. package/dist/runtime/components/TestControls/TestControls.vue.d.ts +2 -1
  12. package/dist/runtime/components/WButton/WButton.d.vue.ts +34 -0
  13. package/dist/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +26 -38
  14. package/dist/runtime/components/WButton/WButton.vue.d.ts +34 -0
  15. package/dist/runtime/components/WCheckbox/WCheckbox.d.vue.ts +33 -0
  16. package/dist/runtime/components/WCheckbox/WCheckbox.vue +110 -0
  17. package/dist/runtime/components/WCheckbox/WCheckbox.vue.d.ts +33 -0
  18. package/dist/runtime/components/{LibColorInput/LibColorInput.d.vue.ts → WColorInput/WColorInput.d.vue.ts} +18 -36
  19. package/dist/runtime/components/WColorInput/WColorInput.vue +85 -0
  20. package/dist/runtime/components/{LibColorInput/LibColorInput.vue.d.ts → WColorInput/WColorInput.vue.d.ts} +18 -36
  21. package/dist/runtime/components/WColorInput/WColorSwatchButton.d.vue.ts +28 -0
  22. package/dist/runtime/components/WColorInput/WColorSwatchButton.vue +86 -0
  23. package/dist/runtime/components/WColorInput/WColorSwatchButton.vue.d.ts +28 -0
  24. package/dist/runtime/components/{LibColorPicker/LibColorPicker.d.vue.ts → WColorPicker/WColorPicker.d.vue.ts} +12 -9
  25. package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +41 -29
  26. package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue.d.ts → WColorPicker/WColorPicker.vue.d.ts} +12 -9
  27. package/dist/runtime/components/WCombobox/WCombobox.d.vue.ts +111 -0
  28. package/dist/runtime/components/WCombobox/WCombobox.vue +405 -0
  29. package/dist/runtime/components/WCombobox/WCombobox.vue.d.ts +111 -0
  30. package/dist/runtime/components/WCombobox/storyPlays.d.ts +18 -0
  31. package/dist/runtime/components/WCombobox/storyPlays.js +68 -0
  32. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.d.vue.ts → WDarkModeSwitcher/WDarkModeSwitcher.d.vue.ts} +9 -13
  33. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +11 -14
  34. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts → WDarkModeSwitcher/WDarkModeSwitcher.vue.d.ts} +9 -13
  35. package/dist/runtime/components/{LibDatePicker/LibDatePicker.d.vue.ts → WDatePicker/WDatePicker.d.vue.ts} +7 -7
  36. package/dist/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
  37. package/dist/runtime/components/{LibDatePicker/LibDatePicker.vue.d.ts → WDatePicker/WDatePicker.vue.d.ts} +7 -7
  38. package/dist/runtime/components/WDatePicker/WRangeDatePicker.d.vue.ts +182 -0
  39. package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +29 -25
  40. package/dist/runtime/components/WDatePicker/WRangeDatePicker.vue.d.ts +182 -0
  41. package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.d.vue.ts → WDatePicker/WSingleDatePicker.d.vue.ts} +7 -5
  42. package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
  43. package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue.d.ts → WDatePicker/WSingleDatePicker.vue.d.ts} +7 -5
  44. package/dist/runtime/components/WDatePicker/WTimeZonePicker.d.vue.ts +13 -0
  45. package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
  46. package/dist/runtime/components/WDatePicker/WTimeZonePicker.vue.d.ts +13 -0
  47. package/dist/runtime/components/{LibDebug/LibDebug.d.vue.ts → WDebug/WDebug.d.vue.ts} +3 -2
  48. package/dist/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +10 -12
  49. package/dist/runtime/components/{LibDebug/LibDebug.vue.d.ts → WDebug/WDebug.vue.d.ts} +3 -2
  50. package/dist/runtime/components/{LibDevOnly/LibDevOnly.d.vue.ts → WDevOnly/WDevOnly.d.vue.ts} +3 -5
  51. package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue.d.ts → WDevOnly/WDevOnly.vue.d.ts} +3 -5
  52. package/dist/runtime/components/WFileInput/WFileInput.d.vue.ts +58 -0
  53. package/dist/runtime/components/WFileInput/WFileInput.vue +348 -0
  54. package/dist/runtime/components/WFileInput/WFileInput.vue.d.ts +58 -0
  55. package/dist/runtime/components/WIcon/WIcon.d.vue.ts +18 -0
  56. package/dist/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +1 -1
  57. package/dist/runtime/components/WIcon/WIcon.vue.d.ts +18 -0
  58. package/dist/runtime/components/WMultiValues/WMultiValues.d.vue.ts +28 -0
  59. package/dist/runtime/components/WMultiValues/WMultiValues.vue +150 -0
  60. package/dist/runtime/components/WMultiValues/WMultiValues.vue.d.ts +28 -0
  61. package/dist/runtime/components/WNotifications/WNotification.d.vue.ts +37 -0
  62. package/dist/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +61 -35
  63. package/dist/runtime/components/WNotifications/WNotification.vue.d.ts +37 -0
  64. package/dist/runtime/components/WNotifications/WNotificationTestMessageComponent.d.vue.ts +7 -0
  65. package/dist/runtime/components/WNotifications/WNotificationTestMessageComponent.vue +29 -0
  66. package/dist/runtime/components/WNotifications/WNotificationTestMessageComponent.vue.d.ts +7 -0
  67. package/dist/runtime/components/WNotifications/WNotifications.d.vue.ts +11 -0
  68. package/dist/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +72 -36
  69. package/dist/runtime/components/WNotifications/WNotifications.vue.d.ts +11 -0
  70. package/dist/runtime/components/WNotifications/calculateNotificationProgress.d.ts +2 -0
  71. package/dist/runtime/components/WNotifications/calculateNotificationProgress.js +4 -0
  72. package/dist/runtime/components/WNumberInput/WNumberInput.d.vue.ts +27 -0
  73. package/dist/runtime/components/WNumberInput/WNumberInput.vue +96 -0
  74. package/dist/runtime/components/WNumberInput/WNumberInput.vue.d.ts +27 -0
  75. package/dist/runtime/components/WPagination/WPagination.d.vue.ts +59 -0
  76. package/dist/runtime/components/WPagination/WPagination.vue +182 -0
  77. package/dist/runtime/components/WPagination/WPagination.vue.d.ts +59 -0
  78. package/dist/runtime/components/WPalette/WPalette.d.vue.ts +11 -0
  79. package/dist/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
  80. package/dist/runtime/components/WPalette/WPalette.vue.d.ts +11 -0
  81. package/dist/runtime/components/WPopover/WPopover.d.vue.ts +45 -0
  82. package/dist/runtime/components/WPopover/WPopover.vue +144 -0
  83. package/dist/runtime/components/WPopover/WPopover.vue.d.ts +45 -0
  84. package/dist/runtime/components/WPopup/WPopup.d.vue.ts +51 -0
  85. package/dist/runtime/components/WPopup/WPopup.vue +115 -0
  86. package/dist/runtime/components/WPopup/WPopup.vue.d.ts +51 -0
  87. package/dist/runtime/components/{LibProgressBar/LibProgressBar.d.vue.ts → WProgressBar/WProgressBar.d.vue.ts} +13 -16
  88. package/dist/runtime/components/WProgressBar/WProgressBar.vue +150 -0
  89. package/dist/runtime/components/{LibProgressBar/LibProgressBar.vue.d.ts → WProgressBar/WProgressBar.vue.d.ts} +13 -16
  90. package/dist/runtime/components/{LibRecorder/LibRecorder.d.vue.ts → WRecorder/WRecorder.d.vue.ts} +13 -27
  91. package/dist/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +37 -36
  92. package/dist/runtime/components/{LibRecorder/LibRecorder.vue.d.ts → WRecorder/WRecorder.vue.d.ts} +13 -27
  93. package/dist/runtime/components/{LibRoot/LibRoot.d.vue.ts → WRoot/WRoot.d.vue.ts} +11 -9
  94. package/dist/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +17 -15
  95. package/dist/runtime/components/{LibRoot/LibRoot.vue.d.ts → WRoot/WRoot.vue.d.ts} +11 -9
  96. package/dist/runtime/components/WSimpleInput/WSimpleInput.d.vue.ts +34 -0
  97. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +14 -24
  98. package/dist/runtime/components/WSimpleInput/WSimpleInput.vue.d.ts +34 -0
  99. package/dist/runtime/components/WTable/WTable.d.vue.ts +102 -0
  100. package/dist/runtime/components/WTable/WTable.vue +370 -0
  101. package/dist/runtime/components/WTable/WTable.vue.d.ts +102 -0
  102. package/dist/runtime/components/WTooltip/WTooltip.d.vue.ts +40 -0
  103. package/dist/runtime/components/WTooltip/WTooltip.vue +112 -0
  104. package/dist/runtime/components/WTooltip/WTooltip.vue.d.ts +40 -0
  105. package/dist/runtime/components/index.d.ts +20 -20
  106. package/dist/runtime/components/index.js +20 -20
  107. package/dist/runtime/composables/index.d.ts +4 -4
  108. package/dist/runtime/composables/index.js +4 -4
  109. package/dist/runtime/composables/useDelayedLoadingIndicator.d.ts +9 -0
  110. package/dist/runtime/composables/useDelayedLoadingIndicator.js +18 -0
  111. package/dist/runtime/composables/useDisplayForReka.d.ts +25 -0
  112. package/dist/runtime/composables/useDisplayForReka.js +16 -0
  113. package/dist/runtime/composables/useFallbackId.d.ts +3 -0
  114. package/dist/runtime/composables/useFallbackId.js +5 -0
  115. package/dist/runtime/composables/useInjectedDarkMode.d.ts +1 -1
  116. package/dist/runtime/composables/usePopupConstrainToStyle.d.ts +8 -0
  117. package/dist/runtime/composables/usePopupConstrainToStyle.js +8 -0
  118. package/dist/runtime/composables/useSetupDarkMode.d.ts +2 -3
  119. package/dist/runtime/composables/useSetupDarkMode.js +90 -4
  120. package/dist/runtime/composables/useTimeConditionally.d.ts +16 -0
  121. package/dist/runtime/composables/useTimeConditionally.js +27 -0
  122. package/dist/runtime/directives/vResizableCols.js +101 -34
  123. package/dist/runtime/helpers/NotificationHandler.d.ts +28 -3
  124. package/dist/runtime/helpers/NotificationHandler.js +7 -10
  125. package/dist/runtime/injectionKeys.d.ts +1 -5
  126. package/dist/runtime/injectionKeys.js +0 -2
  127. package/dist/runtime/types/index.d.ts +97 -31
  128. package/dist/runtime/types/index.js +1 -0
  129. package/dist/runtime/utils/notifyIfError.d.ts +3 -1
  130. package/dist/runtime/utils/notifyIfError.js +4 -2
  131. package/dist/runtime/utils/twMerge.d.ts +1 -0
  132. package/dist/runtime/utils/twMerge.js +2 -1
  133. package/package.json +59 -56
  134. package/src/module.ts +16 -8
  135. package/src/runtime/assets/animations.css +53 -6
  136. package/src/runtime/assets/locales/en.json +2 -0
  137. package/src/runtime/assets/tailwind.css +1 -1
  138. package/src/runtime/assets/utils.css +52 -4
  139. package/src/runtime/build/WitchcraftUiResolver.ts +1 -2
  140. package/src/runtime/components/TestControls/TestControls.vue +3 -3
  141. package/src/runtime/components/WButton/WButton.stories.ts +112 -0
  142. package/src/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +34 -50
  143. package/src/runtime/components/{LibCheckbox/LibCheckbox.stories.ts → WCheckbox/WCheckbox.stories.ts} +5 -5
  144. package/src/runtime/components/WCheckbox/WCheckbox.vue +125 -0
  145. package/src/runtime/components/{LibColorInput/LibColorInput.stories.ts → WColorInput/WColorInput.stories.ts} +8 -8
  146. package/src/runtime/components/WColorInput/WColorInput.vue +112 -0
  147. package/src/runtime/components/WColorInput/WColorSwatchButton.vue +102 -0
  148. package/src/runtime/components/{LibColorPicker/LibColorPicker.stories.ts → WColorPicker/WColorPicker.stories.ts} +12 -12
  149. package/src/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +44 -31
  150. package/src/runtime/components/WCombobox/WCombobox.stories.ts +209 -0
  151. package/src/runtime/components/WCombobox/WCombobox.vue +450 -0
  152. package/src/runtime/components/WCombobox/storyPlays.ts +92 -0
  153. package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.stories.ts → WDarkModeSwitcher/WDarkModeSwitcher.stories.ts} +6 -6
  154. package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +19 -30
  155. package/src/runtime/components/{LibDatePicker/LibDatePicker.stories.ts → WDatePicker/WDatePicker.stories.ts} +42 -34
  156. package/src/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
  157. package/src/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +29 -25
  158. package/src/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
  159. package/src/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
  160. package/src/runtime/components/{LibDebug/LibDebug.stories.ts → WDebug/WDebug.stories.ts} +5 -5
  161. package/src/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +9 -10
  162. package/src/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -4
  163. package/src/runtime/components/{LibFileInput/LibFileInput.stories.ts → WFileInput/WFileInput.stories.ts} +20 -10
  164. package/src/runtime/components/WFileInput/WFileInput.vue +392 -0
  165. package/src/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +5 -8
  166. package/src/runtime/components/{LibMultiValues/LibMultiValues.stories.ts → WMultiValues/WMultiValues.stories.ts} +9 -9
  167. package/src/runtime/components/WMultiValues/WMultiValues.vue +163 -0
  168. package/src/runtime/components/{LibNotifications/LibNotification.stories.ts → WNotifications/WNotification.stories.ts} +42 -6
  169. package/src/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +72 -45
  170. package/src/runtime/components/WNotifications/WNotificationTestMessageComponent.vue +27 -0
  171. package/src/runtime/components/WNotifications/WNotifications.stories.ts +139 -0
  172. package/src/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +87 -47
  173. package/src/runtime/components/WNotifications/calculateNotificationProgress.ts +8 -0
  174. package/src/runtime/components/WNumberInput/WNumberInput.vue +109 -0
  175. package/src/runtime/components/WPagination/WPagination.stories.ts +51 -0
  176. package/src/runtime/components/WPagination/WPagination.vue +207 -0
  177. package/src/runtime/components/{LibPalette/LibPalette.stories.ts → WPalette/WPalette.stories.ts} +6 -6
  178. package/src/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
  179. package/src/runtime/components/WPopover/WPopover.stories.ts +218 -0
  180. package/src/runtime/components/WPopover/WPopover.vue +168 -0
  181. package/src/runtime/components/WPopup/WPopup.stories.ts +104 -0
  182. package/src/runtime/components/WPopup/WPopup.vue +134 -0
  183. package/src/runtime/components/WProgressBar/WProgressBar.stories.ts +119 -0
  184. package/src/runtime/components/WProgressBar/WProgressBar.vue +185 -0
  185. package/src/runtime/components/{LibRecorder/LibRecorder.stories.ts → WRecorder/WRecorder.stories.ts} +9 -6
  186. package/src/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +69 -68
  187. package/src/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +18 -15
  188. package/src/runtime/components/{LibSimpleInput/LibSimpleInput.stories.ts → WSimpleInput/WSimpleInput.stories.ts} +11 -12
  189. package/src/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +28 -42
  190. package/src/runtime/components/WTable/WTable.stories.ts +334 -0
  191. package/src/runtime/components/WTable/WTable.vue +471 -0
  192. package/src/runtime/components/WTooltip/WTooltip.stories.ts +82 -0
  193. package/src/runtime/components/WTooltip/WTooltip.vue +128 -0
  194. package/src/runtime/components/index.ts +20 -20
  195. package/src/runtime/composables/index.ts +4 -4
  196. package/src/runtime/composables/useDelayedLoadingIndicator.ts +30 -0
  197. package/src/runtime/composables/useDisplayForReka.ts +37 -0
  198. package/src/runtime/composables/useFallbackId.ts +6 -0
  199. package/src/runtime/composables/useInjectedDarkMode.ts +1 -2
  200. package/src/runtime/composables/usePopupConstrainToStyle.ts +29 -0
  201. package/src/runtime/composables/useSetupDarkMode.ts +122 -4
  202. package/src/runtime/composables/useTimeConditionally.ts +51 -0
  203. package/src/runtime/directives/vResizableCols.ts +121 -38
  204. package/src/runtime/helpers/NotificationHandler.ts +30 -11
  205. package/src/runtime/injectionKeys.ts +1 -7
  206. package/src/runtime/types/index.ts +118 -36
  207. package/src/runtime/utils/notifyIfError.ts +6 -2
  208. package/src/runtime/utils/twMerge.ts +2 -1
  209. package/types/components.d.ts +14 -15
  210. package/dist/runtime/components/Aria/Aria.d.vue.ts +0 -5
  211. package/dist/runtime/components/Aria/Aria.vue +0 -16
  212. package/dist/runtime/components/Aria/Aria.vue.d.ts +0 -5
  213. package/dist/runtime/components/Icon/Icon.d.vue.ts +0 -21
  214. package/dist/runtime/components/Icon/Icon.vue.d.ts +0 -21
  215. package/dist/runtime/components/LibButton/LibButton.d.vue.ts +0 -36
  216. package/dist/runtime/components/LibButton/LibButton.vue.d.ts +0 -36
  217. package/dist/runtime/components/LibCheckbox/LibCheckbox.d.vue.ts +0 -42
  218. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +0 -103
  219. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +0 -42
  220. package/dist/runtime/components/LibColorInput/LibColorInput.vue +0 -162
  221. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.d.vue.ts +0 -34
  222. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +0 -34
  223. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.d.vue.ts +0 -22
  224. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +0 -22
  225. package/dist/runtime/components/LibFileInput/LibFileInput.d.vue.ts +0 -43
  226. package/dist/runtime/components/LibFileInput/LibFileInput.vue +0 -274
  227. package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +0 -43
  228. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.d.vue.ts +0 -165
  229. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -387
  230. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +0 -165
  231. package/dist/runtime/components/LibLabel/LibLabel.d.vue.ts +0 -26
  232. package/dist/runtime/components/LibLabel/LibLabel.vue +0 -45
  233. package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +0 -26
  234. package/dist/runtime/components/LibMultiValues/LibMultiValues.d.vue.ts +0 -29
  235. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +0 -109
  236. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +0 -29
  237. package/dist/runtime/components/LibNotifications/LibNotification.d.vue.ts +0 -30
  238. package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +0 -30
  239. package/dist/runtime/components/LibNotifications/LibNotifications.d.vue.ts +0 -13
  240. package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +0 -13
  241. package/dist/runtime/components/LibPagination/LibPagination.d.vue.ts +0 -104
  242. package/dist/runtime/components/LibPagination/LibPagination.vue +0 -229
  243. package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +0 -104
  244. package/dist/runtime/components/LibPalette/LibPalette.d.vue.ts +0 -14
  245. package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +0 -14
  246. package/dist/runtime/components/LibPopup/LibPopup.d.vue.ts +0 -46
  247. package/dist/runtime/components/LibPopup/LibPopup.vue +0 -365
  248. package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +0 -46
  249. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +0 -169
  250. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.d.vue.ts +0 -35
  251. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +0 -35
  252. package/dist/runtime/components/LibSuggestions/LibSuggestions.d.vue.ts +0 -94
  253. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +0 -178
  254. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +0 -94
  255. package/dist/runtime/components/LibTable/LibTable.d.vue.ts +0 -45
  256. package/dist/runtime/components/LibTable/LibTable.vue +0 -155
  257. package/dist/runtime/components/LibTable/LibTable.vue.d.ts +0 -45
  258. package/dist/runtime/components/Template/NAME.d.vue.ts +0 -17
  259. package/dist/runtime/components/Template/NAME.vue +0 -27
  260. package/dist/runtime/components/Template/NAME.vue.d.ts +0 -17
  261. package/dist/runtime/components/Template/TemplateStory.d.ts +0 -7
  262. package/dist/runtime/components/Template/TemplateStory.js +0 -22
  263. package/dist/runtime/components/shared/props.d.ts +0 -171
  264. package/dist/runtime/components/shared/props.js +0 -2
  265. package/dist/runtime/composables/useAriaLabel.d.ts +0 -6
  266. package/dist/runtime/composables/useAriaLabel.js +0 -15
  267. package/dist/runtime/composables/useDarkMode.d.ts +0 -77
  268. package/dist/runtime/composables/useDarkMode.js +0 -89
  269. package/dist/runtime/composables/useDivideAttrs.d.ts +0 -27
  270. package/dist/runtime/composables/useDivideAttrs.js +0 -27
  271. package/dist/runtime/composables/useSuggestions.d.ts +0 -40
  272. package/dist/runtime/composables/useSuggestions.js +0 -263
  273. package/src/runtime/components/Aria/Aria.vue +0 -26
  274. package/src/runtime/components/LibButton/LibButton.stories.ts +0 -106
  275. package/src/runtime/components/LibCheckbox/LibCheckbox.vue +0 -129
  276. package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -203
  277. package/src/runtime/components/LibFileInput/LibFileInput.vue +0 -320
  278. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +0 -405
  279. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -414
  280. package/src/runtime/components/LibLabel/LibLabel.stories.ts +0 -33
  281. package/src/runtime/components/LibLabel/LibLabel.vue +0 -65
  282. package/src/runtime/components/LibMultiValues/LibMultiValues.vue +0 -123
  283. package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +0 -120
  284. package/src/runtime/components/LibPagination/LibPagination.stories.ts +0 -49
  285. package/src/runtime/components/LibPagination/LibPagination.vue +0 -274
  286. package/src/runtime/components/LibPopup/LibPopup.stories.ts +0 -153
  287. package/src/runtime/components/LibPopup/LibPopup.vue +0 -396
  288. package/src/runtime/components/LibProgressBar/LibProgressBar.stories.ts +0 -90
  289. package/src/runtime/components/LibProgressBar/LibProgressBar.vue +0 -197
  290. package/src/runtime/components/LibSuggestions/LibSuggestions.stories.ts +0 -134
  291. package/src/runtime/components/LibSuggestions/LibSuggestions.vue +0 -212
  292. package/src/runtime/components/LibTable/LibTable.stories.ts +0 -167
  293. package/src/runtime/components/LibTable/LibTable.vue +0 -190
  294. package/src/runtime/components/Template/NAME.vue +0 -49
  295. package/src/runtime/components/Template/TemplateStory.ts +0 -37
  296. package/src/runtime/components/shared/props.ts +0 -199
  297. package/src/runtime/composables/useAriaLabel.ts +0 -23
  298. package/src/runtime/composables/useDarkMode.ts +0 -199
  299. package/src/runtime/composables/useDivideAttrs.ts +0 -53
  300. package/src/runtime/composables/useSuggestions.ts +0 -339
  301. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.d.ts +0 -0
  302. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.js +0 -0
  303. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.d.ts +0 -0
  304. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.js +0 -0
  305. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.d.ts +0 -0
  306. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.js +0 -0
  307. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.d.ts +0 -0
  308. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.js +0 -0
  309. /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.d.ts +0 -0
  310. /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.js +0 -0
  311. /package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -0
  312. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.ts +0 -0
  313. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.ts +0 -0
  314. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.ts +0 -0
  315. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.ts +0 -0
  316. /package/src/runtime/components/{LibDatePicker → WDatePicker}/helpers.ts +0 -0
@@ -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,42 @@
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" | "type"
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
+ type?: InputHTMLAttributes["type"]
112
+ }
113
+ >(), {
101
114
  id: "",
102
115
  placeholder: "",
103
116
  valid: true,
104
117
  label: "",
105
118
  type: undefined,
106
- unstyle: false, disabled: false, readonly: false, border: true
119
+ border: true
107
120
  })
121
+ const finalId = useFallbackId(props)
108
122
 
109
123
  const modelValue = defineModel<T>({ required: true })
110
124
 
@@ -114,40 +128,12 @@ const emit = defineEmits<{
114
128
  (e: "input", val: InputEvent): void
115
129
  }>()
116
130
  const $attrs = useAttrs()
117
- const ariaLabel = useAriaLabel(props, fallbackId)
118
131
 
119
132
  function handleKeydown(e: KeyboardEvent) {
120
133
  if (e.key === "Enter" && !hasModifiers(e)) {
121
134
  emit("submit", modelValue.value)
122
135
  }
123
136
  }
124
- usePreHydrationValue(props.id ?? fallbackId, modelValue)
137
+ usePreHydrationValue(finalId, modelValue)
125
138
  </script>
126
139
 
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
- > & TailwindClassProp>,
151
- RealProps
152
- {}
153
- </script>
@@ -0,0 +1,334 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention */
2
+ import { faker } from "@faker-js/faker"
3
+ import type { Meta, StoryObj } from "@storybook/vue3"
4
+ import { reactive, ref } from "vue"
5
+
6
+ import WTable from "./WTable.vue"
7
+
8
+ // todo
9
+ import * as components from "../index.js"
10
+
11
+ // faker is slow, we can just choose from a few hundred pre-generated sentences
12
+ const fakerSentences = Array.from({ length: 100 }).fill(0).map(_ => faker.lorem.sentence(faker.number.int({ min: 1, max: 50 })))
13
+
14
+
15
+ type ExtraTestArgs = {
16
+ _slots?: string
17
+ }
18
+ const meta: Meta<typeof WTable> = {
19
+ component: WTable as any,
20
+ title: "Components/Table"
21
+ }
22
+
23
+ export default meta
24
+ type Story = StoryObj<typeof WTable> & { args: ExtraTestArgs }
25
+
26
+ export const Primary: Story = {
27
+ render: args => {
28
+ const extraArgs = args as ExtraTestArgs
29
+ return {
30
+ components,
31
+ setup: () => {
32
+ const show = ref(true)
33
+ const debugGrips = ref(false)
34
+ // careful, storybook passes refs as is causing issues
35
+ const argsReactive = reactive({
36
+ ...args,
37
+ resizable: {
38
+ enabled: true,
39
+ ...args.resizable
40
+ }
41
+ })
42
+
43
+ return {
44
+ args: argsReactive,
45
+ debugGrips,
46
+ show
47
+ }
48
+ },
49
+ template: `
50
+ <div class="p-2 flex flex-col gap-2 border rounded-md mb-10">
51
+ Controls:
52
+ <WButton class="flex-1" @click="args.resizable.enabled = !args.resizable.enabled">Toggle Resizable (currently {{args.resizable.enabled}})</WButton>
53
+ <WButton @click="args.stickyHeader = !args.stickyHeader">Toggle Sticky Header (currently {{args.stickyHeader}})</WButton>
54
+ <WButton @click="show = !show">Toggle Table</WButton>
55
+ <WButton @click="debugGrips = !debugGrips">Toggle Debug Grips (currently {{debugGrips}})</WButton>
56
+ </div>
57
+ <div :class="debugGrips ? ' [&_.grip]:bg-red-500': ''">
58
+ <WTable
59
+ v-if="show"
60
+ v-bind="args"
61
+ >
62
+ ${extraArgs._slots}
63
+ </WTable>
64
+ </div>
65
+ `
66
+ }
67
+ },
68
+ args: {
69
+ cols: ["prop1", "prop2", "prop3"] as any,
70
+ values: [
71
+ { prop1: "Item1 Prop 1", prop2: "Item1 Prop 2", prop3: "Item1 Prop 3" },
72
+ { prop1: "Item2 Prop 1", prop2: "Item2 Prop 2", prop3: "Item2 Prop 3" },
73
+ { prop1: "Item3 Prop 1", prop2: "Item3 Prop 2", prop3: "Item3 Prop 3" }
74
+ ],
75
+ colConfig: { prop1: { name: "Header 1" }, prop2: { name: "Header 2" } }
76
+ }
77
+ }
78
+
79
+ export const NoCellBorders: Story = {
80
+ ...Primary,
81
+ args: {
82
+ ...Primary.args,
83
+ cellBorder: false
84
+ }
85
+ }
86
+
87
+ export const NoBorders: Story = {
88
+ ...Primary,
89
+ args: {
90
+ ...Primary.args,
91
+ border: false
92
+ }
93
+ }
94
+ export const NoCellBordersNoBorders: Story = {
95
+ ...Primary,
96
+ args: {
97
+ ...Primary.args,
98
+ cellBorder: false,
99
+ border: false
100
+ }
101
+ }
102
+
103
+ export const SquareBorders: Story = {
104
+ ...Primary,
105
+ args: {
106
+ ...Primary.args,
107
+ rounded: false
108
+ }
109
+ }
110
+ export const NoHeader: Story = {
111
+ ...Primary,
112
+ args: {
113
+ ...Primary.args,
114
+ header: false
115
+ }
116
+ }
117
+ export const NoHeaderNoBorders: Story = {
118
+ ...Primary,
119
+ args: {
120
+ ...Primary.args,
121
+ header: false,
122
+ border: false
123
+ }
124
+ }
125
+ export const NoHeaderNoCellBorders: Story = {
126
+ ...Primary,
127
+ args: {
128
+ ...Primary.args,
129
+ header: false,
130
+ cellBorder: false
131
+ }
132
+ }
133
+
134
+ export const InitialSize: Story = {
135
+ ...Primary,
136
+ args: {
137
+ ...Primary.args,
138
+ colConfig: {
139
+ prop1: { name: "Initially Flex 1", resizable: true },
140
+ prop2: { name: "Initially Flex 2", resizable: true },
141
+ prop3: { name: "Initially Size of Header", resizable: true }
142
+ },
143
+ resizable: {
144
+ enabled: true
145
+ },
146
+ class: `
147
+ [&:not(.resizable-cols-setup)]:w-full
148
+ [&:not(.resizable-cols-setup)]:block
149
+ [&:not(.resizable-cols-setup)_thead]:block
150
+ [&:not(.resizable-cols-setup)_thead_tr]:w-full
151
+ [&:not(.resizable-cols-setup)_thead_tr]:flex
152
+ [&:not(.resizable-cols-setup)_thead_tr]:flex-nowrap
153
+ [&:not(.resizable-cols-setup)_thead_th:not(.override-initial)]:flex-1
154
+ `,
155
+ _slots: `
156
+ <template #header-prop3="colProps">
157
+ <th
158
+ :class="\`\${colProps.class} [table:not(.resizable-cols-setup)_&]:w-[min-content] whitespace-nowrap override-initial\`"
159
+ :style="colProps.style"
160
+ >
161
+ {{ colProps.config.name }}
162
+ </th>
163
+ </template>
164
+ `
165
+ }
166
+ }
167
+
168
+ export const FitWidthFalse: Story = {
169
+ ...Primary,
170
+ args: {
171
+ ...Primary.args,
172
+ resizable: {
173
+ fitWidth: false
174
+ }
175
+ }
176
+ }
177
+
178
+
179
+ export const StickyHeader: Story = {
180
+ ...Primary,
181
+ args: {
182
+ ...Primary.args,
183
+ resizable: {
184
+ enabled: true
185
+ },
186
+ stickyHeader: true,
187
+ // moving the border to the wrapper is to hide the little bits of border sticking out
188
+ // added back the right straight border otherwise the scrollbar looks ass
189
+ // this is ever so slightly visible if there is no scrollbar
190
+ wrapperAttrs: {
191
+ class: `
192
+ max-h-[50dvh]
193
+ `
194
+ },
195
+ values: Array.from({ length: 200 }).fill(0).map((_, i) => ({
196
+ prop1: `Item${i + 1} Prop 1`,
197
+ prop2: `Item${i + 1} Prop 2`,
198
+ prop3: `Item${i + 1} Prop 3`
199
+ }))
200
+ }
201
+ }
202
+
203
+
204
+ export const VirtualizedFixedHeight: Story = {
205
+ ...Primary,
206
+ args: {
207
+ ...Primary.args,
208
+ resizable: {
209
+ enabled: true
210
+ },
211
+ virtualizerOptions: {
212
+ enabled: true
213
+ },
214
+ stickyHeader: true,
215
+ wrapperAttrs: {
216
+ class: `
217
+ max-h-[50dvh]
218
+ `
219
+ },
220
+ values: Array.from({ length: 10000 }).fill(0).map((_, i) => ({
221
+ prop1: `Item${i + 1} Prop 1`,
222
+ prop2: `Item${i + 1} Prop 2`,
223
+ prop3: `Item${i + 1} Prop 3`
224
+ }))
225
+ }
226
+ }
227
+
228
+
229
+ // this is not the smoothest ever, but then the tan stack example isn't either
230
+ // i think the issue is when the scrollbar gets to it's min height
231
+ export const VirtualizedDynamicHeightExperimental: Story = {
232
+ ...VirtualizedFixedHeight,
233
+ args: {
234
+ ...VirtualizedFixedHeight.args,
235
+ virtualizerOptions: {
236
+ enabled: true,
237
+ method: "dynamic",
238
+ overscan: 5 // overscan is more expensive in dynamic mode
239
+ },
240
+ class: `
241
+ [&_td]:no-truncate!
242
+ [&_th]:no-truncate!
243
+ `,
244
+ values: Array.from({ length: 10000 }).fill(0).map((_, i) => ({
245
+ prop1: `Item${i + 1} Prop 1: ${faker.helpers.arrayElement(fakerSentences)}`,
246
+ prop2: `Item${i + 1} Prop 2: ${faker.helpers.arrayElement(fakerSentences)}`,
247
+ prop3: `Item${i + 1} Prop 3: ${faker.helpers.arrayElement(fakerSentences)}`
248
+ }))
249
+ },
250
+ parameters: {
251
+ tags: ["skip-smoke-test"]
252
+ }
253
+ }
254
+
255
+
256
+ export const VirtualizedFitWidthFalse: Story = {
257
+ ...VirtualizedFixedHeight,
258
+ args: {
259
+ ...VirtualizedFixedHeight.args,
260
+ resizable: {
261
+ fitWidth: false
262
+ },
263
+
264
+ class: `
265
+ [&_th]:no-truncate!
266
+ [&_th]:whitespace-nowrap!
267
+ [&:not(.resizable-cols-setup)]:w-max
268
+ [&:not(.resizable-cols-setup)_th]:w-max
269
+ `,
270
+ wrapperAttrs: {
271
+ class: `max-h-[50dvh]`
272
+ },
273
+ values: Array.from({ length: 10000 }).fill(0).map((_, i) => ({
274
+ prop1: `Item${i + 1} Prop 1`,
275
+ prop2: `Item${i + 1} Prop 2`,
276
+ prop3: `Item${i + 1} Prop 3`
277
+ }))
278
+
279
+ }
280
+ }
281
+
282
+ export const ThreeColSomeColsNotResizable: Story = {
283
+ render: args => ({
284
+ components,
285
+ setup: () => {
286
+ const debugGrips = ref(false)
287
+ return { args, debugGrips }
288
+ },
289
+ template: `
290
+ <div class="flex flex-col gap-2 w-full border rounded-md mb-10">
291
+ <WButton @click="debugGrips = !debugGrips">Toggle Debug Grips (currently {{debugGrips}})</WButton>
292
+ </div>
293
+ <div :class="debugGrips ? ' [&_.grip]:bg-red-500': ''">
294
+ <div class="flex flex-col gap-2 w-full">
295
+ <WTable
296
+ v-bind="args"
297
+ >
298
+ </WTable>
299
+ <WTable
300
+ v-bind="{...args, colConfig:args.colConfig2}"
301
+ >
302
+ </WTable>
303
+ <WTable
304
+ v-bind="{...args, colConfig:args.colConfig3}"
305
+ >
306
+ </WTable>
307
+ </div>
308
+ </div>
309
+ `
310
+ }),
311
+ args: {
312
+ cols: ["prop1", "prop2", "prop3"],
313
+ itemKey: "prop1",
314
+ values: [
315
+ { prop1: "Prop 1", prop2: "Prop 2", prop3: "Prop 3" }
316
+ ],
317
+ colConfig: { prop1: { name: "No Resize", resizable: false } },
318
+ colConfig2: { prop2: { name: "No Resize", resizable: false } },
319
+ colConfig3: { prop3: { name: "No Resize", resizable: false } }
320
+ } as any
321
+ }
322
+ export const FourColSomeColsNotResizable: Story = {
323
+ render: ThreeColSomeColsNotResizable.render,
324
+ args: {
325
+ cols: ["prop1", "prop2", "prop3", "prop4"],
326
+ values: [
327
+ { prop1: "Prop 1", prop2: "Prop 2", prop3: "Prop 3", prop4: "Prop 4" }
328
+ ],
329
+ itemKey: "prop1",
330
+ colConfig: { prop1: { name: "No Resize", resizable: false }, prop3: { name: "No Resize", resizable: false } },
331
+ colConfig2: { prop2: { name: "No Resize", resizable: false }, prop3: { name: "No Resize", resizable: false } },
332
+ colConfig3: { prop1: { name: "No Resize", resizable: false }, prop4: { name: "No Resize", resizable: false } }
333
+ } as any
334
+ }