@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,10 +1,13 @@
1
1
  <template>
2
2
  <div
3
3
  v-if="notification"
4
- :class="twMerge(
5
- `
4
+ :role="notification.requiresAction ? 'alertdialog' : 'status'"
5
+ :aria-labelledby="notification.title ? `title-${notification.id}` : void 0"
6
+ :aria-describedby="notification.message ? `msg-${notification.id}` : void 0"
7
+ :class="
8
+ twMerge(
9
+ `
6
10
  notification
7
- max-w-700px
8
11
  bg-neutral-50
9
12
  dark:bg-neutral-900
10
13
  text-fg
@@ -20,11 +23,15 @@
20
23
  p-1
21
24
  text-sm
22
25
  focus:border-accent-500
26
+ focus-within:border-accent-500
23
27
  `,
24
- $attrs.class
25
- )"
26
- v-bind="{ ...$attrs, class: void 0 }"
28
+ $attrs.class,
29
+ notification.notificationAttrs?.class
30
+ )
31
+ "
32
+ v-bind="{ ...$attrs, ...notification?.notificationAttrs ?? {}, class: void 0 }"
27
33
  tabindex="0"
34
+ :data-id="notification.id"
28
35
  ref="notificationEl"
29
36
  @keydown.enter.self="NotificationHandler.resolveToDefault(notification)"
30
37
  >
@@ -32,27 +39,28 @@
32
39
  name="top"
33
40
  :notification="notification"
34
41
  />
42
+
35
43
  <div
36
44
  class="
37
- notification--header
38
- flex-reverse
39
- flex
40
- justify-between
41
- items-center
42
- "
45
+ notification--header
46
+ flex-reverse
47
+ flex
48
+ justify-between
49
+ items-center
50
+ "
43
51
  >
44
52
  <slot
45
53
  v-if="notification.title"
46
54
  name="title"
47
55
  v-bind="setSlotVar('title', {
56
+ id: `title-${notification.id}`,
48
57
  title: notification.title,
49
58
  class: `
50
59
  notification--title
51
60
  focus-outline
52
61
  rounded-sm
53
62
  font-bold
54
- `,
55
- tabindex: 0
63
+ `
56
64
  })"
57
65
  >
58
66
  <div
@@ -62,9 +70,10 @@
62
70
  </div>
63
71
  </slot>
64
72
  <div class="notification--spacer flex-1"/>
65
- <div class="actions flex">
66
- <LibButton
73
+ <div class="notification--actions flex">
74
+ <WButton
67
75
  :border="false"
76
+ aria-label="Copy notification content"
68
77
  class="
69
78
  notification--title-button
70
79
  notification--copy-button
@@ -73,10 +82,11 @@
73
82
  "
74
83
  @click="copy(handler ? handler.stringify(notification) : JSON.stringify(notification))"
75
84
  >
76
- <icon><i-fa6-regular-copy/></icon>
77
- </LibButton>
78
- <lib-button
85
+ <WIcon><i-lucide-copy/></WIcon>
86
+ </WButton>
87
+ <WButton
79
88
  v-if="notification.cancellable"
89
+ aria-label="Dismiss notification"
80
90
  class="
81
91
  notification--title-button
82
92
  notification--cancel-button
@@ -84,31 +94,49 @@
84
94
  :border="false"
85
95
  @click="NotificationHandler.dismiss(notification)"
86
96
  >
87
- <icon><i-fa6-solid-xmark/></icon>
88
- </lib-button>
97
+ <WIcon><i-lucide-x/></WIcon>
98
+ </Wbutton>
89
99
  </div>
90
100
  </div>
91
101
  <slot
92
- v-if="notification.message"
102
+ v-if="notification.message && !notification.component"
93
103
  name="message"
94
104
  v-bind="setSlotVar('message', {
95
105
  class: `
96
106
  notification--message
107
+ shrink-1
108
+ overflow-auto
97
109
  whitespace-pre-wrap
98
110
  text-neutral-800
99
111
  dark:text-neutral-200
100
112
  mb-1
101
113
  `,
102
- message: notification.message,
103
- tabindex: 0
114
+ message: notification.message
104
115
  })"
105
116
  >
106
117
  <div
107
118
  v-bind="slotVars.message"
119
+ :id="`msg-${notification.id}`"
108
120
  >
109
121
  {{ notification.message }}
110
122
  </div>
111
123
  </slot>
124
+ <Component
125
+ v-if="notification.component"
126
+ :is="notification.component"
127
+ v-bind="{
128
+ notification,
129
+ message: notification.message,
130
+ messageClasses: `
131
+ notification--message
132
+ whitespace-pre-wrap
133
+ text-neutral-800
134
+ dark:text-neutral-200
135
+ mb-1
136
+ `,
137
+ ...notification.componentProps ?? {}
138
+ }"
139
+ />
112
140
  <div class="notification--footer flex items-end justify-between">
113
141
  <div
114
142
  v-if="notification.code"
@@ -127,7 +155,7 @@
127
155
  gap-2
128
156
  "
129
157
  >
130
- <lib-button
158
+ <WButton
131
159
  :label="option"
132
160
  :class="twMerge(
133
161
  `
@@ -149,16 +177,16 @@
149
177
 
150
178
  <script setup>
151
179
  import { computed, onMounted, ref, useAttrs } from "vue";
152
- import IFa6RegularCopy from "~icons/fa6-regular/copy";
153
- import IFa6SolidXmark from "~icons/fa6-solid/xmark";
180
+ import ILucideCopy from "~icons/lucide/copy";
181
+ import ILucideX from "~icons/lucide/x";
154
182
  import { useSlotVars } from "../../composables/useSlotVars.js";
155
183
  import { copy } from "../../helpers/copy.js";
156
184
  import { NotificationHandler } from "../../helpers/NotificationHandler.js";
157
185
  import { twMerge } from "../../utils/twMerge.js";
158
- import Icon from "../Icon/Icon.vue";
159
- import LibButton from "../LibButton/LibButton.vue";
186
+ import WButton from "../WButton/WButton.vue";
187
+ import WIcon from "../WIcon/WIcon.vue";
160
188
  defineOptions({
161
- name: "LibNotification",
189
+ name: "WNotification",
162
190
  inheritAttrs: false
163
191
  });
164
192
  const $attrs = useAttrs();
@@ -173,7 +201,9 @@ const getColor = (notification, option) => {
173
201
  const buttonColors = computed(() => props.notification.options.map((option) => getColor(props.notification, option)));
174
202
  const notificationEl = ref(null);
175
203
  onMounted(() => {
176
- notificationEl.value?.focus();
204
+ if (props.notification.requiresAction) {
205
+ notificationEl.value?.focus();
206
+ }
177
207
  });
178
208
  defineExpose({
179
209
  focus: () => {
@@ -181,7 +211,3 @@ defineExpose({
181
211
  }
182
212
  });
183
213
  </script>
184
-
185
- <script>
186
-
187
- </script>
@@ -0,0 +1,37 @@
1
+ import { type HTMLAttributes } from "vue";
2
+ import { type NotificationEntry, NotificationHandler } from "../../helpers/NotificationHandler.js";
3
+ import type { TailwindClassProp } from "../../types/index.js";
4
+ type __VLS_Props = {
5
+ notification: NotificationEntry;
6
+ handler?: NotificationHandler;
7
+ } & /** @vue-ignore */ Omit<HTMLAttributes, "class"> & /** @vue-ignore */ TailwindClassProp;
8
+ declare var __VLS_1: {
9
+ notification: NotificationEntry;
10
+ }, __VLS_3: {
11
+ id: string;
12
+ title: string;
13
+ class: string;
14
+ }, __VLS_43: {
15
+ class: string;
16
+ message: string;
17
+ };
18
+ type __VLS_Slots = {} & {
19
+ top?: (props: typeof __VLS_1) => any;
20
+ } & {
21
+ title?: (props: typeof __VLS_3) => any;
22
+ } & {
23
+ message?: (props: typeof __VLS_43) => any;
24
+ };
25
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
26
+ focus: () => void;
27
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
28
+ handler: NotificationHandler;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;
33
+ type __VLS_WithSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };
@@ -0,0 +1,7 @@
1
+ import type { CustomNotificationComponentProps } from "../../types/index.js";
2
+ type __VLS_Props = CustomNotificationComponentProps & {
3
+ customProp: string;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <div class="border-2 border-accent-500 p-1 px-2 rounded-sm bg-accent-500/10">
3
+ <div class="text-lg">
4
+ Custom Message Component
5
+ </div>
6
+ <div class="font-bold">
7
+ Original message:
8
+ </div>
9
+ <div
10
+ :class="props.messageClasses"
11
+ >
12
+ {{ props.message }}
13
+ </div>
14
+ <div class="font-bold">
15
+ Custom Prop:
16
+ </div>
17
+ <div>
18
+ {{ props.customProp }}
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <script setup>
24
+ const props = defineProps({
25
+ message: { type: String, required: true },
26
+ messageClasses: { type: String, required: false },
27
+ customProp: { type: String, required: true }
28
+ });
29
+ </script>
@@ -0,0 +1,7 @@
1
+ import type { CustomNotificationComponentProps } from "../../types/index.js";
2
+ type __VLS_Props = CustomNotificationComponentProps & {
3
+ customProp: string;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { HTMLAttributes } from "vue";
2
+ import { NotificationHandler } from "../../helpers/NotificationHandler.js";
3
+ import type { TailwindClassProp } from "../../types/index.js";
4
+ type __VLS_Props = {
5
+ /** If not provided, uses the global handler (this requires useNotificationHandler be called and configured). */
6
+ handler?: NotificationHandler;
7
+ progressUpdateInterval?: number;
8
+ } & /** @vue-ignore */ Omit<HTMLAttributes, "class"> & /** @vue-ignore */ TailwindClassProp;
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -5,17 +5,16 @@
5
5
  tag="div"
6
6
  :class="twMerge(`
7
7
  notifications
8
- [--notification-width:300px]
8
+ [--notification-width:calc(100dvw-var(--spacing)*4)]
9
+ sm:[--notification-width:300px]
9
10
  fixed
10
11
  top-0
11
12
  z-50
12
13
  right-[calc(var(--notification-width)*-1)]
13
14
  w-[calc(var(--spacing)*2+var(--notification-width)*2)]
14
- [&_.notification]:w-[var(--notification-width)]
15
15
  max-h-[100dvh]
16
16
  flex
17
17
  flex-col
18
- [&_.notification]:shrink-0
19
18
  gap-1
20
19
  list-none
21
20
  outline-none
@@ -25,18 +24,25 @@
25
24
  `, $attrs.class)"
26
25
  v-bind="{ ...$attrs, class: void 0 }"
27
26
  >
28
- <lib-notification
27
+ <WNotification
29
28
  :handler="handler"
30
29
  tabindex="0"
31
30
  :notification="notification"
32
- class="overflow-hidden my-2"
31
+ class="
32
+ overflow-hidden
33
+ my-2
34
+ max-h-[300px]
35
+ w-[var(--notification-width)]
36
+ shrink-0
37
+ max-sm:[&_.notification--button]:p-2
38
+ max-sm:[&_.notification--button]:py-1
39
+ max-sm:[&_.notification--header]:text-lg
40
+ "
33
41
  v-for="notification of notifications"
34
42
  :key="notification.id"
35
- @pointerenter="notification.timeout && !notification.isPaused && handler.pause(notification)"
36
- @blur="notification.timeout && notification.isPaused && handler.resume(notification)"
37
43
  >
38
44
  <template #top>
39
- <LibProgressBar
45
+ <WProgressBar
40
46
  v-if="notification.timeout !== void 0"
41
47
  class="
42
48
  w-full
@@ -46,10 +52,10 @@
46
52
  -mx-[calc(var(--spacing)*2+2px)]
47
53
  rounded-none
48
54
  "
49
- :progress="100 - (notification.isPaused ? notification._timer.elapsedBeforePause : notification._timer.elapsedBeforePause + (time - notification.startTime)) / notification.timeout * 100"
55
+ :progress="calculateNotificationProgress(notification, time)"
50
56
  />
51
57
  </template>
52
- </lib-notification>
58
+ </Wnotification>
53
59
  </TransitionGroup>
54
60
  <!-- we don't need to worry about the user accidentally closing a non-closable dialog as keeping open=true (which the handler handles when the component tries to close) is enough to keep it open without issues -->
55
61
  <AlertDialogRoot
@@ -59,7 +65,7 @@
59
65
  <AlertDialogPortal :to="'#root'">
60
66
  <AlertDialogOverlay
61
67
  class="
62
- fixed inset-0 z-30
68
+ fixed inset-0 z-90
63
69
  bg-neutral-950/20
64
70
  data-[state=open]:animate-overlayShow
65
71
  "
@@ -67,18 +73,27 @@
67
73
  <AlertDialogContent
68
74
  class="
69
75
  data-[state=open]:animate-contentShow
76
+ max-sm:data-[state=open]:animate-slideInUp
70
77
  fixed
71
- top-[50%]
72
- left-[50%]
73
- translate-x-[-50%]
74
- translate-y-[-50%]
75
- max-h-[80dvh]
76
- max-w-[700px]
78
+ flex justify-center
79
+ top-1/2
80
+ left-1/2
81
+ w-full
82
+ sm:translate-x-[-50%]
83
+ sm:translate-y-[-50%]
84
+ p-2
85
+ max-sm:bottom-0
86
+ max-sm:top-[unset]
87
+ max-sm:left-0
77
88
  z-100
78
89
  "
90
+ @interact-outside="topNotifications[0] && NotificationHandler.dismiss(topNotifications[0])"
79
91
  >
80
- <lib-notification
92
+ <WNotification
81
93
  class="
94
+ w-full
95
+ sm:max-w-[700px]
96
+ max-h-[80dvh]
82
97
  top-notification
83
98
  text-md
84
99
  gap-2
@@ -102,7 +117,7 @@
102
117
  {{ slotProps.message }}
103
118
  </AlertDialogDescription>
104
119
  </template>
105
- </lib-notification>
120
+ </Wnotification>
106
121
  </AlertDialogContent>
107
122
  </AlertDialogPortal>
108
123
  </AlertDialogRoot>
@@ -117,31 +132,52 @@ import {
117
132
  AlertDialogRoot,
118
133
  AlertDialogTitle
119
134
  } from "reka-ui";
120
- import { computed, ref } from "vue";
121
- import LibNotification from "./LibNotification.vue";
135
+ import { computed, onBeforeUnmount, onMounted, useAttrs } from "vue";
136
+ import { calculateNotificationProgress } from "./calculateNotificationProgress.js";
137
+ import WNotification from "./WNotification.vue";
122
138
  import { useNotificationHandler } from "../../composables/useNotificationHandler.js";
139
+ import { useTimeConditionally } from "../../composables/useTimeConditionally.js";
123
140
  import { NotificationHandler } from "../../helpers/NotificationHandler.js";
124
141
  import { twMerge } from "../../utils/twMerge.js";
125
- import LibProgressBar from "../LibProgressBar/LibProgressBar.vue";
142
+ import WProgressBar from "../WProgressBar/WProgressBar.vue";
126
143
  defineOptions({
127
- name: "LibNotifications",
144
+ name: "WNotifications",
128
145
  inheritAttrs: false
129
146
  });
147
+ const $attrs = useAttrs();
130
148
  const props = defineProps({
131
- id: { type: String, required: false },
132
- handler: { type: Object, required: false }
149
+ handler: { type: Object, required: false },
150
+ progressUpdateInterval: { type: Number, required: false }
133
151
  });
152
+ const handler = props.handler ?? useNotificationHandler();
134
153
  const topNotifications = computed(() => handler.queue.filter((entry) => entry.requiresAction).reverse());
135
154
  const notifications = computed(() => handler.queue.filter((entry) => !entry.requiresAction));
136
- const time = ref(Date.now());
137
- setInterval(() => {
138
- requestAnimationFrame(() => {
139
- time.value = Date.now();
140
- });
141
- }, 50);
142
- const handler = props.handler ?? useNotificationHandler();
143
- </script>
144
-
145
- <script>
146
-
155
+ const fetchTime = computed(() => {
156
+ return notifications.value.filter((entry) => entry.timeout !== void 0 && !entry.isPaused).length > 0;
157
+ });
158
+ const { time } = useTimeConditionally(fetchTime, { refreshInterval: props.progressUpdateInterval });
159
+ function handleGlobalPointerDown(e) {
160
+ const target = e.target;
161
+ const notificationEl = target.closest(".notification");
162
+ const rawId = notificationEl?.dataset.id;
163
+ const clickedId = rawId ? Number.parseInt(rawId, 10) : null;
164
+ if (clickedId !== null) {
165
+ const entry = handler.queue.find((n) => n.id === clickedId);
166
+ if (entry && entry.timeout && !entry.isPaused) {
167
+ handler.pause(entry);
168
+ }
169
+ } else {
170
+ handler.queue.forEach((entry) => {
171
+ if (entry.timeout && entry.isPaused) {
172
+ handler.resume(entry);
173
+ }
174
+ });
175
+ }
176
+ }
177
+ onMounted(() => {
178
+ window.addEventListener("pointerdown", handleGlobalPointerDown);
179
+ });
180
+ onBeforeUnmount(() => {
181
+ window.removeEventListener("pointerdown", handleGlobalPointerDown);
182
+ });
147
183
  </script>
@@ -0,0 +1,11 @@
1
+ import type { HTMLAttributes } from "vue";
2
+ import { NotificationHandler } from "../../helpers/NotificationHandler.js";
3
+ import type { TailwindClassProp } from "../../types/index.js";
4
+ type __VLS_Props = {
5
+ /** If not provided, uses the global handler (this requires useNotificationHandler be called and configured). */
6
+ handler?: NotificationHandler;
7
+ progressUpdateInterval?: number;
8
+ } & /** @vue-ignore */ Omit<HTMLAttributes, "class"> & /** @vue-ignore */ TailwindClassProp;
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import type { NotificationEntry } from "../../helpers/NotificationHandler.js";
2
+ export declare function calculateNotificationProgress(notification: NotificationEntry, time: number): number;
@@ -0,0 +1,4 @@
1
+ export function calculateNotificationProgress(notification, time) {
2
+ if (notification.timeout === void 0) return 0;
3
+ return 100 - (notification.isPaused ? notification._timer.elapsedBeforePause : notification._timer.elapsedBeforePause + (time - notification.startTime)) / notification.timeout * 100;
4
+ }
@@ -0,0 +1,27 @@
1
+ import type { NumberFieldInputProps, NumberFieldRootEmits, NumberFieldRootProps } from "reka-ui";
2
+ import type { HTMLAttributes, InputHTMLAttributes } from "vue";
3
+ import type { EmitsToProps, TailwindClassProp } from "../../types/index.js";
4
+ type __VLS_Props = {
5
+ id?: string;
6
+ max?: NumberFieldRootProps["max"];
7
+ min?: NumberFieldRootProps["min"];
8
+ step?: NumberFieldRootProps["step"];
9
+ isValid?: (value: any) => boolean;
10
+ inputProps?: NumberFieldInputProps & Omit<InputHTMLAttributes, "class"> & TailwindClassProp;
11
+ rootProps?: NumberFieldRootProps & EmitsToProps<NumberFieldRootEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
12
+ };
13
+ type __VLS_ModelProps = {
14
+ modelValue: number;
15
+ };
16
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
17
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ "update:modelValue": (value: number) => any;
19
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ "onUpdate:modelValue"?: ((value: number) => any) | undefined;
21
+ }>, {
22
+ max: number;
23
+ min: number;
24
+ isValid: (value: any) => boolean;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;
@@ -0,0 +1,96 @@
1
+ <template>
2
+ <NumberFieldRoot
3
+ :min="props.min"
4
+ :max="props.max"
5
+ :step="props.step"
6
+ :format-options="{
7
+ signDisplay: 'exceptZero',
8
+ ...rootProps?.formatOptions
9
+ }"
10
+ :class="twMerge(
11
+ `
12
+ flex
13
+ items-center
14
+ justify-center
15
+ metadata-input-border
16
+ rounded-sm
17
+ focus-outline-within
18
+ gap-2
19
+ `,
20
+ !isValid && 'text-danger-500',
21
+ rootProps?.class
22
+ )"
23
+ v-bind="{ ...rootProps, class: void 0 }"
24
+ v-model="modelValue"
25
+ >
26
+ <NumberFieldDecrement
27
+ class="
28
+ px-1
29
+ flex-1
30
+ hover:bg-neutral-200
31
+ dark:hover:bg-neutral-800
32
+ [&_.button--label]:justify-start
33
+ rounded-bl-sm
34
+ rounded-tl-sm
35
+ cursor-pointer
36
+ disabled:cursor-not-allowed
37
+ "
38
+ >
39
+ <WIcon><i-radix-icons-minus/></WIcon>
40
+ </NumberFieldDecrement>
41
+
42
+ <NumberFieldInput
43
+ :class="twMerge(
44
+ `
45
+ bg-transparent
46
+ tabular-nums
47
+ text-center
48
+ focus-outline-none
49
+ px-1
50
+ shrink-1
51
+ basis-[20ch]
52
+ grow-0
53
+ min-w-0
54
+ [&::-webkit-outer-spin-button]:appearance-none
55
+ [&::-webkit-inner-spin-button]:appearance-none
56
+ [-moz-appearance:textfield]
57
+ `,
58
+ !isValid && 'text-danger-500',
59
+ inputProps?.class
60
+ )"
61
+ v-bind="{ ...inputProps, class: void 0 }"
62
+ />
63
+
64
+ <NumberFieldIncrement
65
+ class="
66
+ px-1
67
+ flex-1
68
+ hover:bg-neutral-200
69
+ dark:hover:bg-neutral-800
70
+ [&_.button--label]:justify-end
71
+ rounded-br-sm
72
+ rounded-tr-sm
73
+ cursor-pointer
74
+ disabled:cursor-not-allowed
75
+ "
76
+ >
77
+ <WIcon><i-radix-icons-plus/></WIcon>
78
+ </NumberFieldIncrement>
79
+ </NumberFieldRoot>
80
+ </template>
81
+
82
+ <script setup>
83
+ import { twMerge } from "../../utils/twMerge.js";
84
+ const props = defineProps({
85
+ id: { type: String, required: false },
86
+ max: { type: Number, required: false, default: Number.MAX_SAFE_INTEGER },
87
+ min: { type: Number, required: false, default: Number.MIN_SAFE_INTEGER },
88
+ step: { type: Number, required: false },
89
+ isValid: { type: Function, required: false, default: (value) => {
90
+ return typeof value === "number" && !Number.isNaN(value);
91
+ } },
92
+ inputProps: { type: Object, required: false },
93
+ rootProps: { type: Object, required: false }
94
+ });
95
+ const modelValue = defineModel({ type: Number, ...{ required: true } });
96
+ </script>
@@ -0,0 +1,27 @@
1
+ import type { NumberFieldInputProps, NumberFieldRootEmits, NumberFieldRootProps } from "reka-ui";
2
+ import type { HTMLAttributes, InputHTMLAttributes } from "vue";
3
+ import type { EmitsToProps, TailwindClassProp } from "../../types/index.js";
4
+ type __VLS_Props = {
5
+ id?: string;
6
+ max?: NumberFieldRootProps["max"];
7
+ min?: NumberFieldRootProps["min"];
8
+ step?: NumberFieldRootProps["step"];
9
+ isValid?: (value: any) => boolean;
10
+ inputProps?: NumberFieldInputProps & Omit<InputHTMLAttributes, "class"> & TailwindClassProp;
11
+ rootProps?: NumberFieldRootProps & EmitsToProps<NumberFieldRootEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
12
+ };
13
+ type __VLS_ModelProps = {
14
+ modelValue: number;
15
+ };
16
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
17
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ "update:modelValue": (value: number) => any;
19
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ "onUpdate:modelValue"?: ((value: number) => any) | undefined;
21
+ }>, {
22
+ max: number;
23
+ min: number;
24
+ isValid: (value: any) => boolean;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;