@witchcraft/ui 0.4.0 → 0.4.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 (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,7 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import NAME from "./NAME.vue";
3
- declare const meta: Meta<typeof NAME>;
4
- export default meta;
5
- type Story = StoryObj<typeof NAME>;
6
- export declare const Primary: Story;
7
- export declare const Secondary: Story;
@@ -1,22 +0,0 @@
1
- import NAME from "./NAME.vue";
2
- import * as components from "../index.js";
3
- const meta = {
4
- component: NAME,
5
- args: {}
6
- };
7
- export default meta;
8
- export const Primary = {
9
- render: (args) => ({
10
- components,
11
- setup: () => ({ args }),
12
- template: `
13
- <NAME v-bind="{...args}">{{args.value}}</NAME>
14
- `
15
- })
16
- };
17
- export const Secondary = {
18
- ...Primary,
19
- args: {
20
- ...Primary.args
21
- }
22
- };
@@ -1,171 +0,0 @@
1
- import type { PopupPositioner, PopupPositionModifier } from "../../types";
2
- export interface LinkableByIdProps {
3
- /**
4
- * The id for the input. Uses vue's useId if none provided.
5
- *
6
- * For components that are not inputs, the id passed to inputs should be shared with the corresponding label/suggestions/etc component to connect them.
7
- */
8
- id?: string;
9
- }
10
- export declare const getFallbackId: () => string;
11
- export interface ButtonProps {
12
- border?: boolean;
13
- color?: "warning" | "ok" | "danger" | "primary" | "secondary" | false;
14
- autoTitleFromAria?: boolean;
15
- }
16
- export interface LabelProps {
17
- /** For the label. Note the component might or might not support an actual label element. If none is supported, this is used for the `aria-label`. */
18
- label?: string;
19
- }
20
- export type SuggestionsProps<T = any> = {
21
- /**
22
- * A list of autocomplete suggestions. Can be a simple list of strings, or more complicated, like a list of objects. In the case of objects, you'll want to specify `suggestionsLabel`.
23
- *
24
- * Each item is passed to the suggestion slot via the `items` prop. You can access it like:
25
- * ```
26
- * <div #item={item}>
27
- * {{item}}
28
- * </div>
29
- * ```
30
- */
31
- suggestions?: T[];
32
- /** A function that specifies how to extract the label from a suggestion when it's an object, e.g. `(item) => item.label`. By default, if none is passed, it's assumed suggestions is a list of strings. */
33
- suggestionLabel?: (item: T) => string;
34
- /**
35
- * Whether to restrict the value to the suggestions list or merely use it to suggest values. Default is false.
36
- *
37
- * This stops v-modeling of what the user is typing when there is a value that does not match any values in the suggestions list. `update:modelValue` will only be emitted when they type/select/click a valid option.
38
- *
39
- * When the input is partially valid (it partially matches an option in the suggestions list), if the user presses enter or focuses away, the last selected suggestion is set as the value.
40
- *
41
- * When the input is completely invalid, the `errored` class is added to the component and the input goes red. If the user focuses away or tries to press enter anyways, the value is reset to the last valid value.
42
- *
43
- * Additionally when the input is invalid, the user can open the dropdown menu (it won't auto open) to view all the suggestions.
44
- */
45
- restrictToSuggestions?: boolean;
46
- /**
47
- * Usually when using autosuggest, we only want to update the modelValue when the user submits the input.
48
- * This happens by default if using `restrictToSuggestions`, but not if not restricting them.
49
- *
50
- * This can be worked around by listening a bit differently to events, but this is a common use case so there's now an option that automatically does this.
51
- *
52
- * By default it's false.
53
- */
54
- updateOnlyOnSubmit?: boolean;
55
- /** A function to filter the suggestions based on the current input. If none is given, will attempt to filter by the label using a basic case insensitive `includes` search. */
56
- suggestionsFilter?: (input: string | number, items: T[]) => any[];
57
- /** Allows opening the input dropdown when it's empty. Default is true. */
58
- allowOpenEmpty?: boolean;
59
- /** Whether the suggestions dropdown can be opened. Default is true. */
60
- canOpen?: boolean;
61
- /** Whether the suggestions dropdown can be closed. Default is true. */
62
- canClose?: boolean;
63
- /** Whether the input is valid. Default is true. */
64
- isValid?: boolean;
65
- /**
66
- * A function to determine which selection to auto select. By default, the start of the string must match and the longest match is used. If the input is 0 length, the first element is selected.
67
- *
68
- * You can implement custom behavior here like fuzzy matching. Note that an exactly matching selection is always picked (the function will not be called).
69
- */
70
- suggestionSelector?: (suggestions: T[], input: string) => number;
71
- /** In the case modelValue is an array of values, whether to show the selected values in the suggestions list. Default is true so users can deselect from the list as well. If false, the checkboxes will also not be shown. */
72
- showSelectedValues?: boolean;
73
- };
74
- export type SuggestionsOptions<T> = SuggestionsProps<T>;
75
- export interface SuggestionsEmits<TMultivalue extends boolean = false> {
76
- (e: "submit", val: string, suggestion?: any, wasRemoved?: boolean): void;
77
- (e: "update:isOpen", val: boolean): void;
78
- (e: "update:activeSuggestion", val: TMultivalue extends true ? number[] : number): void;
79
- }
80
- export interface PopupProps {
81
- /**
82
- * Whether to use the dialog element instead of a regular backdrop. While using the dialog element would be ideal, css variables won't be applied to it, tailwind themes will fail, etc, if the css variables are not applied to `::backdrop`.
83
- *
84
- * Using a div ends up easier to setup.
85
- *
86
- * The default is now false.
87
- */
88
- useDialogForBackdrop?: false;
89
- /** Wether to use a backdrop (clicking it will close the popup), or not (use is allowed to click elsewhere. */
90
- useBackdrop?: boolean;
91
- /**
92
- * The preferred horizontal positioning of the popup. The first position in the array to fit is used.
93
- *
94
- * All elements need to have box-sizing: border-box set. Also note that while the component should work with dynamic popup sizes, in practice there's issues with the positioning being slightly off. Giving the popup element a static size is better. If you need margins around the popup, this can be done with a wrapper element + padding.
95
- *
96
- * The positions `right`/`left`/`top`/`bottom` are relative to the opposite side of the button element so as to try not to cover the triggering button.
97
- *
98
- * So positioning `right` and `left` look like this:
99
- *
100
- * ```
101
- * // right
102
- * [button]
103
- * [----popup----]
104
- *
105
- * // left
106
- * [button]
107
- * [----popup----]
108
- * ```
109
- *
110
- * Positions `*-most` try to position the popup as close to that side of the screen as possible, otherwise limiting the popup to that edge. For example:
111
- *
112
- * ```
113
- * [--------------screen---------------]
114
- * // right-most
115
- * [button]
116
- * [----popup----]
117
- * // near the edge:
118
- * [button]
119
- * [----popup----]
120
- * ```
121
- *
122
- * There is also the `center-screen` position, which centers the popup on the screen.
123
- *
124
- * These last two (`*-most` and `center-screen`) are greedy, they will always find a position that fits. Positions listed after are ignored.
125
- *
126
- * You can also specify a function instead which is given some additional information regarding the space around the button reference element. It should a number for the x position (or y, if preferredVertical).
127
- *
128
- * If you only need to slightly modify the position, you can use the `modifyPosition` option instead.
129
- */
130
- preferredHorizontal?: ("center" | "right" | "left" | "either" | "center-screen" | "right-most" | "left-most" | "center-most")[] | PopupPositioner;
131
- /** See `preferredHorizontal`. */
132
- preferredVertical?: ("top" | "bottom" | "center" | "either" | "center-screen" | "top-most" | "bottom-most" | "center-most")[] | PopupPositioner;
133
- /**
134
- * When the user scrolls or resizes, normally the entire popup position is recomputed, taking into account the preferred positioning.
135
- *
136
- * This can cause it to shift around.
137
- *
138
- * Set this to true to only shift the popup depending on how much the button element moved and avoid recalculating the best position.
139
- */
140
- avoidRepositioning?: boolean;
141
- /**
142
- * Allows modifying the calculated position, to for example, clamp it.
143
- */
144
- modifyPosition?: PopupPositionModifier;
145
- canClose?: boolean;
146
- }
147
- export type BaseInteractiveProps = {
148
- /** Default is false. */
149
- disabled?: boolean;
150
- /** Default is false. */
151
- readonly?: boolean;
152
- /** Default is true. */
153
- border?: boolean;
154
- /** Removes styles from the component. Default is false. */
155
- unstyle?: boolean;
156
- };
157
- /**
158
- * @internal
159
- * For easily typing attributes created by useDivideAttrs. See readme.
160
- *
161
- * By default overrides the `class` prop to only take a string (to pass to tailwing).
162
- */
163
- export type WrapperProps<TPrefix extends string, T, TOverrides extends Record<string, any> | never = TailwindClassProp> = {
164
- [P in keyof T as P extends keyof TOverrides ? never : P extends string ? `${TPrefix}${Capitalize<P>}` : never]: T[P];
165
- } & {
166
- [P in keyof TOverrides as P extends string ? `${TPrefix}${Capitalize<P>}` : never]: TOverrides[P];
167
- };
168
- export type TailwindClassProp = {
169
- /** Tailwind classes. */
170
- class?: string | false;
171
- };
@@ -1,2 +0,0 @@
1
- import { useId } from "vue";
2
- export const getFallbackId = () => useId();
@@ -1,6 +0,0 @@
1
- import { type ComputedRef } from "vue";
2
- /** Returns a computed ref that creates aria-label and aria-labelledby with the correct id for labelledby. */
3
- export declare const useAriaLabel: (props: {
4
- id?: string;
5
- label?: string;
6
- }, fallbackId?: string) => ComputedRef<Record<string, string | undefined>>;
@@ -1,15 +0,0 @@
1
- import { computed, onMounted, ref } from "vue";
2
- export const useAriaLabel = (props, fallbackId) => {
3
- const id = computed(() => props.id ?? fallbackId);
4
- const labelExists = ref(false);
5
- const aria = computed(() => ({
6
- "aria-label": labelExists.value ? void 0 : props.label,
7
- "aria-labelledby": labelExists.value ? `label-${id.value}` : void 0
8
- }));
9
- onMounted(() => {
10
- if (id.value && document.querySelector(`#label-${id.value}`)) {
11
- labelExists.value = true;
12
- }
13
- });
14
- return aria;
15
- };
@@ -1,77 +0,0 @@
1
- import { type Ref } from "vue";
2
- /**
3
- * @deprecated Use `useSetupDarkMode` instead.
4
- *
5
- * A composable for setting up dark mode that automatically takes care of saving the user's preference.
6
- *
7
- * See the returned utilities for more details.
8
- *
9
- * It also provides injection keys with a ref so it can be accessed in deep nested components if needed. Alternatively you can use `useInjectedDarkMode` for ease of use.
10
- *
11
- * Note that this should only be called once at the root of the app.
12
- */
13
- export declare const useDarkMode: ({ useLocalStorage, darkModeOrder, isClientSide, useViewTransition }?: DarkModeOptions) => DarkModeState & DarkModeCommands;
14
- export declare const defaultDarkModeOrder: readonly ["system", "dark", "light"];
15
- export type DarkModeOptions = {
16
- useLocalStorage?: boolean | string;
17
- darkModeOrder?: readonly ("system" | "dark" | "light")[];
18
- /** True by default, should be passed import.meta.client if using nuxt, or false when running server side. */
19
- isClientSide?: boolean;
20
- /**
21
- * Whether to use the view transition to animate the dark mode switch (you just need to add the css).
22
- *
23
- * Note that the transitition is NOT triggered if visually the mode does not change (e.g. system mode is dark and the user switches from system to dark, visually nothing changes so transitioning is skipped).
24
- *
25
- * There is an example in storybook. But basically:
26
- *
27
- * ```css
28
- *
29
- * #root { // the dark mode switcher works on the WRoot component not the html root
30
- * view-transition-name: wroot;
31
- * height: 100dvh;
32
- * padding: 0;
33
- * }
34
- *
35
- * ::view-transition-new(wroot) {
36
- * animation: grow var(--story-anim-length) ease-in-out;
37
- * animation-fill-mode: both;
38
- * z-index: 2;
39
- * mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><circle cx="20" cy="20" r="20" fill="white"/></svg>') center / 0 no-repeat;
40
- * }
41
- *
42
- * ::view-transition-old(wroot) {
43
- * animation: none;
44
- * animation-fill-mode: both;
45
- * z-index: 1;
46
- * }
47
- *
48
- * @keyframes grow {
49
- * from {
50
- * mask-size: 0dvw;
51
- * }
52
- * to {
53
- * mask-size: 300dvw;
54
- * }
55
- * }
56
- * ```
57
- *
58
- * See https://theme-toggle.rdsx.dev/ for more ideas.
59
- *
60
- * @default true
61
- */
62
- useViewTransition?: boolean;
63
- };
64
- export interface DarkModeCommands {
65
- setDarkMode: (value: "dark" | "light" | "system") => void;
66
- cycleDarkMode: () => void;
67
- }
68
- export interface DarkModeState {
69
- /** Whether the dark mode should be enabled or not */
70
- darkMode: Ref<boolean>;
71
- /** The current state of the darkMode but as a string (dark, light, system) */
72
- darkModeState: Ref<"dark" | "light" | "system">;
73
- /** The value of the manuably controllable dark mode. You can set this to true/false or undefined to allow the systemDarkMode to take priority. Alternatively use setDarkMode instead. */
74
- manualDarkMode: Ref<boolean | undefined>;
75
- /** The value of the system dark mode. This is automatically set depending on the user's `prefer-color-scheme` and should not be set directly. */
76
- systemDarkMode: Ref<boolean>;
77
- }
@@ -1,89 +0,0 @@
1
- import { computed, nextTick, onMounted, provide, ref, watch } from "vue";
2
- import { darkModeCommandsInjectionKey, darkModeStateInjectionKey, isDarkModeInjectionKey, manualDarkModeInjectionKey } from "../injectionKeys.js";
3
- const defaultLocalStorageKey = "prefersColorSchemeDark";
4
- const defaultOrder = ["system", "dark", "light"];
5
- export const useDarkMode = ({
6
- useLocalStorage = true,
7
- darkModeOrder = defaultOrder,
8
- isClientSide = true,
9
- useViewTransition = true
10
- } = {}) => {
11
- const systemDarkMode = ref(false);
12
- const manualDarkMode = ref(void 0);
13
- if (useLocalStorage && isClientSide) {
14
- watch(manualDarkMode, () => {
15
- localStorage.setItem(defaultLocalStorageKey, manualDarkMode.value ? "true" : "false");
16
- });
17
- }
18
- const darkMode = computed(() => manualDarkMode.value ?? systemDarkMode.value);
19
- const darkModeState = computed(
20
- () => manualDarkMode.value === void 0 ? "system" : manualDarkMode.value ? "dark" : "light"
21
- );
22
- function setDarkMode(value) {
23
- manualDarkMode.value = value === "dark" ? true : value === "light" ? false : void 0;
24
- }
25
- function getNextValue() {
26
- const index = darkModeOrder.indexOf(darkModeState.value);
27
- return index === 2 ? darkModeOrder[0] : darkModeOrder[index + 1];
28
- }
29
- function _cycleDarkMode() {
30
- setDarkMode(getNextValue());
31
- }
32
- function cycleDarkMode() {
33
- if (!useViewTransition) {
34
- _cycleDarkMode();
35
- return;
36
- }
37
- const nextValue = getNextValue();
38
- const index = darkModeOrder.indexOf(darkModeState.value);
39
- const systemDarkModeName = systemDarkMode.value ? "dark" : "light";
40
- if (nextValue === "system" && systemDarkModeName === darkModeOrder[index]) {
41
- _cycleDarkMode();
42
- return;
43
- }
44
- if (!document.startViewTransition) _cycleDarkMode();
45
- document.startViewTransition(async () => {
46
- _cycleDarkMode();
47
- await nextTick();
48
- });
49
- }
50
- onMounted(() => {
51
- window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", ({ matches }) => {
52
- if (matches) {
53
- systemDarkMode.value = true;
54
- } else {
55
- systemDarkMode.value = false;
56
- }
57
- });
58
- if (useLocalStorage !== false) {
59
- const key = typeof useLocalStorage === "string" ? useLocalStorage : defaultLocalStorageKey;
60
- const value = localStorage.getItem(key);
61
- if (value === "true") {
62
- manualDarkMode.value = true;
63
- } else if (value === "false") {
64
- manualDarkMode.value = false;
65
- }
66
- }
67
- });
68
- provide(isDarkModeInjectionKey, darkMode);
69
- provide(manualDarkModeInjectionKey, manualDarkMode);
70
- provide(darkModeStateInjectionKey, {
71
- darkMode,
72
- darkModeState,
73
- manualDarkMode,
74
- systemDarkMode
75
- });
76
- provide(darkModeCommandsInjectionKey, {
77
- setDarkMode,
78
- cycleDarkMode
79
- });
80
- return {
81
- darkMode,
82
- darkModeState,
83
- setDarkMode,
84
- cycleDarkMode,
85
- manualDarkMode,
86
- systemDarkMode
87
- };
88
- };
89
- export const defaultDarkModeOrder = defaultOrder;
@@ -1,27 +0,0 @@
1
- import { type Ref } from "vue";
2
- /**
3
- * Allows users to more easily pass attributes to different parts of a component. Suppose a component has an input and a wrapper and you want most attributes to go to the input, but any that start with `wrapper` to go to the wrapper.
4
- *
5
- * You can do:
6
- *
7
- * ```ts
8
- * const extraAttrs = useDivideAttrs(["wrapper"] as const)
9
- * ```
10
- * This will correctly remove the start of the key. So if the user passes:
11
- * ```vue
12
- * <your-component regular-attr wrapper-attr wrapperAttrs/>
13
- * ```
14
- * You will get a ref like:
15
- *
16
- * ```ts
17
- * extraAttrs.value = {
18
- * attrs: { regular-attr: true },
19
- * wrapperAttrs: { attr: true, Attrs: true },
20
- * }
21
- *
22
- * Additionally attributes are properly reactive, tough this is probably a bit expensive given they weren't meant to be reactive.
23
- *
24
- * Note that if using multi-word prefixes, like `inner-wrapper`, they will appear as the key `inner-wrapperAttrs` internally, but users will be able to correctly pass `inner-wrapper-prop`. Aditionally these can be passed down to deeper components, allowing easy wrapping.
25
- * ```
26
- */
27
- export declare const useDivideAttrs: <T extends readonly string[]>(divisionKeys: T) => Ref<Record<`${T[number]}Attrs` | "attrs", Record<string, any>>>;
@@ -1,27 +0,0 @@
1
- import { keys } from "@alanscodelog/utils/keys";
2
- import { computed, useAttrs } from "vue";
3
- export const useDivideAttrs = (divisionKeys) => computed(() => {
4
- const attrs = useAttrs();
5
- const res = { attrs: {} };
6
- const unseen = keys(attrs);
7
- for (const key of divisionKeys) {
8
- res[`${key}Attrs`] = {};
9
- for (let i = 0; i < unseen.length; i++) {
10
- const attrKey = unseen[i];
11
- if (!attrKey) continue;
12
- if (attrKey.startsWith(`${key}-`)) {
13
- res[`${key}Attrs`][attrKey.slice(key.length + 1)] = attrs[attrKey];
14
- unseen.splice(i, 1);
15
- i--;
16
- } else if (attrKey.startsWith(key)) {
17
- res[`${key}Attrs`][attrKey.slice(key.length)] = attrs[attrKey];
18
- unseen.splice(i, 1);
19
- i--;
20
- }
21
- }
22
- }
23
- for (const attrKey of unseen) {
24
- res.attrs[attrKey] = attrs[attrKey];
25
- }
26
- return res;
27
- });
@@ -1,40 +0,0 @@
1
- import type { AnyFunction } from "@alanscodelog/utils";
2
- import { type Ref } from "vue";
3
- import type { SuggestionsEmits, SuggestionsOptions } from "../components/shared/props.js";
4
- /**
5
- * The logic for the suggestions component.
6
- *
7
- * Note that while object suggestions are supported, the `suggestionLabel` prop is required and $inputModel and $modelValue will still be string values (as returned by the suggestionLabel function).
8
- */
9
- export declare function useSuggestions<TSuggestion, TMultivalue extends boolean = false>($inputValue: Ref<string>, $modelValue: Ref<TMultivalue extends true ? string[] : string>, $open: Ref<boolean>, emit: SuggestionsEmits, opts: SuggestionsOptions<TSuggestion>, debug?: boolean): {
10
- list: import("vue").ComputedRef<any[] | undefined>;
11
- filtered: import("vue").ComputedRef<any[] | undefined>;
12
- active: Ref<number, number>;
13
- available: import("vue").ComputedRef<boolean>;
14
- moreThanOneAvailable: import("vue").ComputedRef<boolean>;
15
- hasExactlyMatching: import("vue").ComputedRef<TSuggestion | undefined>;
16
- /** Whether there is a valid suggestion that can be submitted. If `restrictToSuggestions` is true, this will be true if isValid is true, otherwise this is considered to be true if suggestions are available. */
17
- hasValidSuggestion: import("vue").ComputedRef<boolean>;
18
- openable: import("vue").ComputedRef<boolean | undefined>;
19
- getLabel: (item: any) => string;
20
- $open: Ref<boolean, boolean>;
21
- open: () => void;
22
- close: () => void;
23
- enterSelected: (doClose?: boolean) => void;
24
- enterIndex: (num: number, doClose?: boolean) => void;
25
- toggle: () => void;
26
- cancel: () => void;
27
- select: (num: number) => void;
28
- prev: () => void;
29
- next: () => void;
30
- first: () => void;
31
- last: () => void;
32
- };
33
- export declare function useSuggestionsInputAria(id: Ref<string>, $open: Ref<boolean>, activeSuggestion: Ref<number>, suggestions: Ref<any | undefined>): import("vue").ComputedRef<{
34
- "aria-autocomplete": "both" | undefined;
35
- "aria-controls": string | undefined;
36
- role: string | undefined;
37
- "aria-expanded": boolean | undefined;
38
- "aria-activedescendant": string | undefined;
39
- }>;
40
- export declare function suggestionLabelGuard<TFunction extends AnyFunction>(item: any, suggestionLabeler: TFunction | undefined): asserts suggestionLabeler is TFunction;