@witchcraft/ui 0.3.26 → 0.4.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/README.md +54 -61
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -1
  4. package/dist/runtime/assets/animations.css +1 -1
  5. package/dist/runtime/assets/locales/en.json +2 -0
  6. package/dist/runtime/build/WitchcraftUiResolver.js +2 -2
  7. package/dist/runtime/components/TestControls/TestControls.vue +3 -3
  8. package/dist/runtime/components/WButton/WButton.d.vue.ts +34 -0
  9. package/dist/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +26 -38
  10. package/dist/runtime/components/WButton/WButton.vue.d.ts +34 -0
  11. package/dist/runtime/components/WCheckbox/WCheckbox.d.vue.ts +33 -0
  12. package/dist/runtime/components/WCheckbox/WCheckbox.vue +110 -0
  13. package/dist/runtime/components/WCheckbox/WCheckbox.vue.d.ts +33 -0
  14. package/dist/runtime/components/WColorInput/WColorInput.d.vue.ts +45 -0
  15. package/dist/runtime/components/WColorInput/WColorInput.vue +85 -0
  16. package/dist/runtime/components/WColorInput/WColorInput.vue.d.ts +45 -0
  17. package/dist/runtime/components/WColorInput/WColorSwatchButton.d.vue.ts +28 -0
  18. package/dist/runtime/components/WColorInput/WColorSwatchButton.vue +86 -0
  19. package/dist/runtime/components/WColorInput/WColorSwatchButton.vue.d.ts +28 -0
  20. package/dist/runtime/components/{LibColorPicker/LibColorPicker.d.vue.ts → WColorPicker/WColorPicker.d.vue.ts} +7 -6
  21. package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +41 -29
  22. package/dist/runtime/components/{LibColorPicker/LibColorPicker.vue.d.ts → WColorPicker/WColorPicker.vue.d.ts} +7 -6
  23. package/dist/runtime/components/WCombobox/WCombobox.d.vue.ts +111 -0
  24. package/dist/runtime/components/WCombobox/WCombobox.vue +405 -0
  25. package/dist/runtime/components/WCombobox/WCombobox.vue.d.ts +111 -0
  26. package/dist/runtime/components/WCombobox/storyPlays.d.ts +18 -0
  27. package/dist/runtime/components/WCombobox/storyPlays.js +68 -0
  28. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.d.vue.ts → WDarkModeSwitcher/WDarkModeSwitcher.d.vue.ts} +8 -13
  29. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +11 -14
  30. package/dist/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts → WDarkModeSwitcher/WDarkModeSwitcher.vue.d.ts} +8 -13
  31. package/dist/runtime/components/WDatePicker/WDatePicker.d.vue.ts +40 -0
  32. package/dist/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
  33. package/dist/runtime/components/WDatePicker/WDatePicker.vue.d.ts +40 -0
  34. package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +21 -21
  35. package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
  36. package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.d.vue.ts → WDatePicker/WTimeZonePicker.d.vue.ts} +1 -11
  37. package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
  38. package/dist/runtime/components/{LibDatePicker/LibTimeZonePicker.vue.d.ts → WDatePicker/WTimeZonePicker.vue.d.ts} +1 -11
  39. package/dist/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +10 -12
  40. package/dist/runtime/components/{LibDevOnly/LibDevOnly.d.vue.ts → WDevOnly/WDevOnly.d.vue.ts} +0 -3
  41. package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue.d.ts → WDevOnly/WDevOnly.vue.d.ts} +0 -3
  42. package/dist/runtime/components/WFileInput/WFileInput.d.vue.ts +58 -0
  43. package/dist/runtime/components/{LibFileInput/LibFileInput.vue → WFileInput/WFileInput.vue} +74 -57
  44. package/dist/runtime/components/WFileInput/WFileInput.vue.d.ts +58 -0
  45. package/dist/runtime/components/{Icon/Icon.vue.d.ts → WIcon/WIcon.d.vue.ts} +2 -6
  46. package/dist/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +1 -1
  47. package/dist/runtime/components/{Icon/Icon.d.vue.ts → WIcon/WIcon.vue.d.ts} +2 -6
  48. package/dist/runtime/components/{LibMultiValues/LibMultiValues.d.vue.ts → WMultiValues/WMultiValues.d.vue.ts} +8 -14
  49. package/dist/runtime/components/WMultiValues/WMultiValues.vue +150 -0
  50. package/dist/runtime/components/{LibMultiValues/LibMultiValues.vue.d.ts → WMultiValues/WMultiValues.vue.d.ts} +8 -14
  51. package/dist/runtime/components/WNotifications/WNotification.d.vue.ts +37 -0
  52. package/dist/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +34 -47
  53. package/dist/runtime/components/WNotifications/WNotification.vue.d.ts +37 -0
  54. package/dist/runtime/components/WNotifications/WNotifications.d.vue.ts +11 -0
  55. package/dist/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +35 -17
  56. package/dist/runtime/components/WNotifications/WNotifications.vue.d.ts +11 -0
  57. package/dist/runtime/components/WNumberInput/WNumberInput.d.vue.ts +27 -0
  58. package/dist/runtime/components/WNumberInput/WNumberInput.vue +96 -0
  59. package/dist/runtime/components/WNumberInput/WNumberInput.vue.d.ts +27 -0
  60. package/dist/runtime/components/WPagination/WPagination.d.vue.ts +59 -0
  61. package/dist/runtime/components/WPagination/WPagination.vue +182 -0
  62. package/dist/runtime/components/WPagination/WPagination.vue.d.ts +59 -0
  63. package/dist/runtime/components/WPalette/WPalette.d.vue.ts +11 -0
  64. package/dist/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
  65. package/dist/runtime/components/WPalette/WPalette.vue.d.ts +11 -0
  66. package/dist/runtime/components/WPopover/WPopover.d.vue.ts +45 -0
  67. package/dist/runtime/components/WPopover/WPopover.vue +144 -0
  68. package/dist/runtime/components/WPopover/WPopover.vue.d.ts +45 -0
  69. package/dist/runtime/components/WPopup/WPopup.d.vue.ts +51 -0
  70. package/dist/runtime/components/WPopup/WPopup.vue +106 -0
  71. package/dist/runtime/components/WPopup/WPopup.vue.d.ts +51 -0
  72. package/dist/runtime/components/{LibProgressBar/LibProgressBar.d.vue.ts → WProgressBar/WProgressBar.d.vue.ts} +14 -18
  73. package/dist/runtime/components/WProgressBar/WProgressBar.vue +150 -0
  74. package/dist/runtime/components/{LibProgressBar/LibProgressBar.vue.d.ts → WProgressBar/WProgressBar.vue.d.ts} +14 -18
  75. package/dist/runtime/components/{LibRecorder/LibRecorder.d.vue.ts → WRecorder/WRecorder.d.vue.ts} +14 -29
  76. package/dist/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +37 -36
  77. package/dist/runtime/components/{LibRecorder/LibRecorder.vue.d.ts → WRecorder/WRecorder.vue.d.ts} +14 -29
  78. package/dist/runtime/components/{LibRoot/LibRoot.d.vue.ts → WRoot/WRoot.d.vue.ts} +6 -5
  79. package/dist/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +17 -15
  80. package/dist/runtime/components/{LibRoot/LibRoot.vue.d.ts → WRoot/WRoot.vue.d.ts} +6 -5
  81. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.d.vue.ts → WSimpleInput/WSimpleInput.d.vue.ts} +10 -16
  82. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +14 -24
  83. package/dist/runtime/components/{LibSimpleInput/LibSimpleInput.vue.d.ts → WSimpleInput/WSimpleInput.vue.d.ts} +10 -16
  84. package/dist/runtime/components/WTable/WTable.d.vue.ts +102 -0
  85. package/dist/runtime/components/{LibTable/LibTable.vue → WTable/WTable.vue} +13 -14
  86. package/dist/runtime/components/WTable/WTable.vue.d.ts +102 -0
  87. package/dist/runtime/components/WTooltip/WTooltip.d.vue.ts +40 -0
  88. package/dist/runtime/components/WTooltip/WTooltip.vue +112 -0
  89. package/dist/runtime/components/WTooltip/WTooltip.vue.d.ts +40 -0
  90. package/dist/runtime/components/index.d.ts +20 -20
  91. package/dist/runtime/components/index.js +20 -20
  92. package/dist/runtime/composables/index.d.ts +4 -4
  93. package/dist/runtime/composables/index.js +4 -4
  94. package/dist/runtime/composables/useDelayedLoadingIndicator.d.ts +9 -0
  95. package/dist/runtime/composables/useDelayedLoadingIndicator.js +18 -0
  96. package/dist/runtime/composables/useDisplayForReka.d.ts +25 -0
  97. package/dist/runtime/composables/useDisplayForReka.js +16 -0
  98. package/dist/runtime/composables/useFallbackId.d.ts +3 -0
  99. package/dist/runtime/composables/useFallbackId.js +5 -0
  100. package/dist/runtime/composables/useInjectedDarkMode.d.ts +1 -1
  101. package/dist/runtime/composables/usePopupConstrainToStyle.d.ts +8 -0
  102. package/dist/runtime/composables/usePopupConstrainToStyle.js +8 -0
  103. package/dist/runtime/composables/useSetupDarkMode.d.ts +2 -3
  104. package/dist/runtime/composables/useSetupDarkMode.js +90 -4
  105. package/dist/runtime/helpers/NotificationHandler.d.ts +2 -2
  106. package/dist/runtime/injectionKeys.d.ts +1 -5
  107. package/dist/runtime/injectionKeys.js +0 -2
  108. package/dist/runtime/types/index.d.ts +85 -27
  109. package/dist/runtime/types/index.js +1 -0
  110. package/package.json +1 -1
  111. package/src/module.ts +1 -1
  112. package/src/runtime/assets/animations.css +3 -3
  113. package/src/runtime/assets/locales/en.json +2 -0
  114. package/src/runtime/build/WitchcraftUiResolver.ts +2 -2
  115. package/src/runtime/components/TestControls/TestControls.vue +3 -3
  116. package/src/runtime/components/WButton/WButton.stories.ts +112 -0
  117. package/src/runtime/components/{LibButton/LibButton.vue → WButton/WButton.vue} +34 -50
  118. package/src/runtime/components/{LibCheckbox/LibCheckbox.stories.ts → WCheckbox/WCheckbox.stories.ts} +5 -5
  119. package/src/runtime/components/WCheckbox/WCheckbox.vue +125 -0
  120. package/src/runtime/components/{LibColorInput/LibColorInput.stories.ts → WColorInput/WColorInput.stories.ts} +8 -8
  121. package/src/runtime/components/WColorInput/WColorInput.vue +112 -0
  122. package/src/runtime/components/WColorInput/WColorSwatchButton.vue +102 -0
  123. package/src/runtime/components/{LibColorPicker/LibColorPicker.stories.ts → WColorPicker/WColorPicker.stories.ts} +12 -12
  124. package/src/runtime/components/{LibColorPicker/LibColorPicker.vue → WColorPicker/WColorPicker.vue} +44 -31
  125. package/src/runtime/components/WCombobox/WCombobox.stories.ts +209 -0
  126. package/src/runtime/components/WCombobox/WCombobox.vue +450 -0
  127. package/src/runtime/components/WCombobox/storyPlays.ts +92 -0
  128. package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.stories.ts → WDarkModeSwitcher/WDarkModeSwitcher.stories.ts} +6 -6
  129. package/src/runtime/components/{LibDarkModeSwitcher/LibDarkModeSwitcher.vue → WDarkModeSwitcher/WDarkModeSwitcher.vue} +19 -30
  130. package/src/runtime/components/{LibDatePicker/LibDatePicker.stories.ts → WDatePicker/WDatePicker.stories.ts} +42 -34
  131. package/src/runtime/components/{LibDatePicker/LibDatePicker.vue → WDatePicker/WDatePicker.vue} +3 -7
  132. package/src/runtime/components/{LibDatePicker/LibRangeDatePicker.vue → WDatePicker/WRangeDatePicker.vue} +21 -21
  133. package/src/runtime/components/{LibDatePicker/LibSingleDatePicker.vue → WDatePicker/WSingleDatePicker.vue} +21 -21
  134. package/src/runtime/components/{LibDatePicker/LibTimeZonePicker.vue → WDatePicker/WTimeZonePicker.vue} +5 -12
  135. package/src/runtime/components/{LibDebug/LibDebug.stories.ts → WDebug/WDebug.stories.ts} +5 -5
  136. package/src/runtime/components/{LibDebug/LibDebug.vue → WDebug/WDebug.vue} +9 -10
  137. package/src/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -4
  138. package/src/runtime/components/{LibFileInput/LibFileInput.stories.ts → WFileInput/WFileInput.stories.ts} +7 -7
  139. package/src/runtime/components/{LibFileInput/LibFileInput.vue → WFileInput/WFileInput.vue} +98 -97
  140. package/src/runtime/components/{Icon/Icon.vue → WIcon/WIcon.vue} +5 -8
  141. package/src/runtime/components/{LibMultiValues/LibMultiValues.stories.ts → WMultiValues/WMultiValues.stories.ts} +9 -9
  142. package/src/runtime/components/WMultiValues/WMultiValues.vue +163 -0
  143. package/src/runtime/components/{LibNotifications/LibNotification.stories.ts → WNotifications/WNotification.stories.ts} +9 -9
  144. package/src/runtime/components/{LibNotifications/LibNotification.vue → WNotifications/WNotification.vue} +45 -65
  145. package/src/runtime/components/WNotifications/WNotifications.stories.ts +139 -0
  146. package/src/runtime/components/{LibNotifications/LibNotifications.vue → WNotifications/WNotifications.vue} +51 -29
  147. package/src/runtime/components/WNumberInput/WNumberInput.vue +109 -0
  148. package/src/runtime/components/WPagination/WPagination.stories.ts +51 -0
  149. package/src/runtime/components/WPagination/WPagination.vue +207 -0
  150. package/src/runtime/components/{LibPalette/LibPalette.stories.ts → WPalette/WPalette.stories.ts} +6 -6
  151. package/src/runtime/components/{LibPalette/LibPalette.vue → WPalette/WPalette.vue} +3 -8
  152. package/src/runtime/components/WPopover/WPopover.stories.ts +218 -0
  153. package/src/runtime/components/WPopover/WPopover.vue +168 -0
  154. package/src/runtime/components/WPopup/WPopup.stories.ts +104 -0
  155. package/src/runtime/components/WPopup/WPopup.vue +125 -0
  156. package/src/runtime/components/WProgressBar/WProgressBar.stories.ts +119 -0
  157. package/src/runtime/components/WProgressBar/WProgressBar.vue +185 -0
  158. package/src/runtime/components/{LibRecorder/LibRecorder.stories.ts → WRecorder/WRecorder.stories.ts} +9 -6
  159. package/src/runtime/components/{LibRecorder/LibRecorder.vue → WRecorder/WRecorder.vue} +69 -68
  160. package/src/runtime/components/{LibRoot/LibRoot.vue → WRoot/WRoot.vue} +18 -15
  161. package/src/runtime/components/{LibSimpleInput/LibSimpleInput.stories.ts → WSimpleInput/WSimpleInput.stories.ts} +11 -12
  162. package/src/runtime/components/{LibSimpleInput/LibSimpleInput.vue → WSimpleInput/WSimpleInput.vue} +28 -44
  163. package/src/runtime/components/{LibTable/LibTable.stories.ts → WTable/WTable.stories.ts} +60 -52
  164. package/src/runtime/components/{LibTable/LibTable.vue → WTable/WTable.vue} +85 -88
  165. package/src/runtime/components/WTooltip/WTooltip.stories.ts +82 -0
  166. package/src/runtime/components/WTooltip/WTooltip.vue +128 -0
  167. package/src/runtime/components/index.ts +20 -20
  168. package/src/runtime/composables/index.ts +4 -4
  169. package/src/runtime/composables/useDelayedLoadingIndicator.ts +30 -0
  170. package/src/runtime/composables/useDisplayForReka.ts +37 -0
  171. package/src/runtime/composables/useFallbackId.ts +6 -0
  172. package/src/runtime/composables/useInjectedDarkMode.ts +1 -2
  173. package/src/runtime/composables/usePopupConstrainToStyle.ts +29 -0
  174. package/src/runtime/composables/useSetupDarkMode.ts +122 -4
  175. package/src/runtime/helpers/NotificationHandler.ts +2 -2
  176. package/src/runtime/injectionKeys.ts +1 -7
  177. package/src/runtime/types/index.ts +105 -32
  178. package/types/components.d.ts +14 -15
  179. package/dist/runtime/components/Aria/Aria.d.vue.ts +0 -6
  180. package/dist/runtime/components/Aria/Aria.vue +0 -16
  181. package/dist/runtime/components/Aria/Aria.vue.d.ts +0 -6
  182. package/dist/runtime/components/LibButton/LibButton.d.vue.ts +0 -37
  183. package/dist/runtime/components/LibButton/LibButton.vue.d.ts +0 -37
  184. package/dist/runtime/components/LibCheckbox/LibCheckbox.d.vue.ts +0 -41
  185. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +0 -103
  186. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +0 -41
  187. package/dist/runtime/components/LibColorInput/LibColorInput.d.vue.ts +0 -64
  188. package/dist/runtime/components/LibColorInput/LibColorInput.vue +0 -162
  189. package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +0 -64
  190. package/dist/runtime/components/LibDatePicker/LibDatePicker.d.vue.ts +0 -191
  191. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +0 -191
  192. package/dist/runtime/components/LibFileInput/LibFileInput.d.vue.ts +0 -46
  193. package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +0 -46
  194. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.d.vue.ts +0 -256
  195. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -387
  196. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +0 -256
  197. package/dist/runtime/components/LibLabel/LibLabel.d.vue.ts +0 -27
  198. package/dist/runtime/components/LibLabel/LibLabel.vue +0 -45
  199. package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +0 -27
  200. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +0 -109
  201. package/dist/runtime/components/LibNotifications/LibNotification.d.vue.ts +0 -45
  202. package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +0 -45
  203. package/dist/runtime/components/LibNotifications/LibNotifications.d.vue.ts +0 -15
  204. package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +0 -15
  205. package/dist/runtime/components/LibPagination/LibPagination.d.vue.ts +0 -105
  206. package/dist/runtime/components/LibPagination/LibPagination.vue +0 -229
  207. package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +0 -105
  208. package/dist/runtime/components/LibPalette/LibPalette.d.vue.ts +0 -15
  209. package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +0 -15
  210. package/dist/runtime/components/LibPopup/LibPopup.d.vue.ts +0 -52
  211. package/dist/runtime/components/LibPopup/LibPopup.vue +0 -365
  212. package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +0 -52
  213. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +0 -169
  214. package/dist/runtime/components/LibSuggestions/LibSuggestions.d.vue.ts +0 -99
  215. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +0 -178
  216. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +0 -99
  217. package/dist/runtime/components/LibTable/LibTable.d.vue.ts +0 -125
  218. package/dist/runtime/components/LibTable/LibTable.vue.d.ts +0 -125
  219. package/dist/runtime/components/Template/NAME.d.vue.ts +0 -18
  220. package/dist/runtime/components/Template/NAME.vue +0 -27
  221. package/dist/runtime/components/Template/NAME.vue.d.ts +0 -18
  222. package/dist/runtime/components/Template/TemplateStory.d.ts +0 -7
  223. package/dist/runtime/components/Template/TemplateStory.js +0 -22
  224. package/dist/runtime/components/shared/props.d.ts +0 -171
  225. package/dist/runtime/components/shared/props.js +0 -2
  226. package/dist/runtime/composables/useAriaLabel.d.ts +0 -6
  227. package/dist/runtime/composables/useAriaLabel.js +0 -15
  228. package/dist/runtime/composables/useDarkMode.d.ts +0 -77
  229. package/dist/runtime/composables/useDarkMode.js +0 -89
  230. package/dist/runtime/composables/useDivideAttrs.d.ts +0 -27
  231. package/dist/runtime/composables/useDivideAttrs.js +0 -27
  232. package/dist/runtime/composables/useSuggestions.d.ts +0 -40
  233. package/dist/runtime/composables/useSuggestions.js +0 -263
  234. package/src/runtime/components/Aria/Aria.vue +0 -26
  235. package/src/runtime/components/LibButton/LibButton.stories.ts +0 -106
  236. package/src/runtime/components/LibCheckbox/LibCheckbox.vue +0 -131
  237. package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -203
  238. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.ts +0 -405
  239. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -419
  240. package/src/runtime/components/LibLabel/LibLabel.stories.ts +0 -33
  241. package/src/runtime/components/LibLabel/LibLabel.vue +0 -65
  242. package/src/runtime/components/LibMultiValues/LibMultiValues.vue +0 -123
  243. package/src/runtime/components/LibNotifications/LibNotifications.stories.ts +0 -131
  244. package/src/runtime/components/LibPagination/LibPagination.stories.ts +0 -49
  245. package/src/runtime/components/LibPagination/LibPagination.vue +0 -274
  246. package/src/runtime/components/LibPopup/LibPopup.stories.ts +0 -153
  247. package/src/runtime/components/LibPopup/LibPopup.vue +0 -396
  248. package/src/runtime/components/LibProgressBar/LibProgressBar.stories.ts +0 -90
  249. package/src/runtime/components/LibProgressBar/LibProgressBar.vue +0 -197
  250. package/src/runtime/components/LibSuggestions/LibSuggestions.stories.ts +0 -134
  251. package/src/runtime/components/LibSuggestions/LibSuggestions.vue +0 -212
  252. package/src/runtime/components/Template/NAME.vue +0 -49
  253. package/src/runtime/components/Template/TemplateStory.ts +0 -37
  254. package/src/runtime/components/shared/props.ts +0 -199
  255. package/src/runtime/composables/useAriaLabel.ts +0 -23
  256. package/src/runtime/composables/useDarkMode.ts +0 -199
  257. package/src/runtime/composables/useDivideAttrs.ts +0 -53
  258. package/src/runtime/composables/useSuggestions.ts +0 -339
  259. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.d.ts +0 -0
  260. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.js +0 -0
  261. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.d.ts +0 -0
  262. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.js +0 -0
  263. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.d.ts +0 -0
  264. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.js +0 -0
  265. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.d.ts +0 -0
  266. /package/dist/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.js +0 -0
  267. /package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.d.vue.ts → WDatePicker/WRangeDatePicker.d.vue.ts} +0 -0
  268. /package/dist/runtime/components/{LibDatePicker/LibRangeDatePicker.vue.d.ts → WDatePicker/WRangeDatePicker.vue.d.ts} +0 -0
  269. /package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.d.vue.ts → WDatePicker/WSingleDatePicker.d.vue.ts} +0 -0
  270. /package/dist/runtime/components/{LibDatePicker/LibSingleDatePicker.vue.d.ts → WDatePicker/WSingleDatePicker.vue.d.ts} +0 -0
  271. /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.d.ts +0 -0
  272. /package/dist/runtime/components/{LibDatePicker → WDatePicker}/helpers.js +0 -0
  273. /package/dist/runtime/components/{LibDebug/LibDebug.d.vue.ts → WDebug/WDebug.d.vue.ts} +0 -0
  274. /package/dist/runtime/components/{LibDebug/LibDebug.vue.d.ts → WDebug/WDebug.vue.d.ts} +0 -0
  275. /package/dist/runtime/components/{LibDevOnly/LibDevOnly.vue → WDevOnly/WDevOnly.vue} +0 -0
  276. /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.d.vue.ts → WNotifications/WNotificationTestMessageComponent.d.vue.ts} +0 -0
  277. /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue → WNotifications/WNotificationTestMessageComponent.vue} +0 -0
  278. /package/dist/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue.d.ts → WNotifications/WNotificationTestMessageComponent.vue.d.ts} +0 -0
  279. /package/dist/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.d.ts +0 -0
  280. /package/dist/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.js +0 -0
  281. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToHsva.ts +0 -0
  282. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/safeConvertToRgba.ts +0 -0
  283. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/toLowPrecisionRgbaString.ts +0 -0
  284. /package/src/runtime/components/{LibColorPicker → WColorPicker}/utils/truncate.ts +0 -0
  285. /package/src/runtime/components/{LibDatePicker → WDatePicker}/helpers.ts +0 -0
  286. /package/src/runtime/components/{LibNotifications/LibNotificationTestMessageComponent.vue → WNotifications/WNotificationTestMessageComponent.vue} +0 -0
  287. /package/src/runtime/components/{LibNotifications → WNotifications}/calculateNotificationProgress.ts +0 -0
@@ -0,0 +1,182 @@
1
+ <template>
2
+ <PaginationRoot
3
+ :total="total"
4
+ :items-per-page="itemsPerPage"
5
+ :sibling-count="siblingCount"
6
+ show-edges
7
+ :class="twMerge(`
8
+ pagination--wrapper
9
+ flex flex-wrap items-center justify-center gap-2
10
+ `, $attrs.class)"
11
+ v-model:page="current"
12
+ v-bind="{ ...$attrs, class: void 0 }"
13
+ >
14
+ <PaginationList
15
+ v-slot="{ items }"
16
+ class="flex items-center gap-2 w-full"
17
+ >
18
+ <PaginationFirst
19
+ as-child
20
+ :class="`pagination--link ${pageClasses}`"
21
+ >
22
+ <a
23
+ :href="customRoute(route, 1).href"
24
+ :aria-label="t('pagination.aria.go-to-first-page')"
25
+ >
26
+ <slot name="first">
27
+ <i-lucide-chevrons-left class="w-4 h-4"/>
28
+ </slot>
29
+ </a>
30
+ </PaginationFirst>
31
+
32
+ <PaginationPrev
33
+ as-child
34
+ :class="`pagination--link ${pageClasses}`"
35
+ >
36
+ <a
37
+ :href="customRoute(route, current - 1).href"
38
+ :aria-label="t('pagination.aria.go-to-previous-page')"
39
+ @click="onLinkClick($event, current - 1)"
40
+ >
41
+ <slot name="prev">
42
+ <i-lucide-chevron-left class="w-4 h-4"/>
43
+ </slot>
44
+ </a>
45
+ </PaginationPrev>
46
+
47
+ <div class="pagination--spacer flex-1"/>
48
+
49
+ <template v-for="(page, index) in items">
50
+ <PaginationListItem
51
+ v-if="page.type === 'page'"
52
+ :value="page.value"
53
+ as-child
54
+ :key="index"
55
+ >
56
+ <a
57
+ :href="customRoute(route, page.value).href"
58
+ :aria-label="t('pagination.aria.go-to-page', { count: page.value })"
59
+ :class="page.value === current ? currentPageClasses : pageClasses"
60
+ @click="onLinkClick($event, page.value)"
61
+ >
62
+ <slot
63
+ name="page"
64
+ :value="page.value"
65
+ >
66
+ {{ page.value }}
67
+ </slot>
68
+ </a>
69
+ </PaginationListItem>
70
+
71
+ <!-- @vue-expect-error index is a prop... -->
72
+ <PaginationEllipsis
73
+ v-else
74
+ :index="index"
75
+ class="pagination--page-fill flex items-center justify-center w-8 h-8"
76
+ :key="page.type"
77
+ >
78
+ ...
79
+ </PaginationEllipsis>
80
+ </template>
81
+
82
+ <div class="pagination--spacer flex-1"/>
83
+
84
+ <PaginationNext
85
+ as-child
86
+ :class="`pagination--link ${pageClasses}`"
87
+ >
88
+ <a
89
+ :href="customRoute(route, current + 1).href"
90
+ :aria-label="t('pagination.aria.go-to-next-page')"
91
+ @click="onLinkClick($event, current + 1)"
92
+ >
93
+ <slot name="next">
94
+ <i-lucide-chevron-right class="w-4 h-4"/>
95
+ </slot>
96
+ </a>
97
+ </PaginationNext>
98
+
99
+ <PaginationLast
100
+ as-child
101
+ :class="`pagination--link ${pageClasses}`"
102
+ >
103
+ <a
104
+ :href="customRoute(route, Math.ceil(total / itemsPerPage)).href"
105
+ :aria-label="t('pagination.aria.go-to-last-page')"
106
+ @click="onLinkClick($event, Math.ceil(total / itemsPerPage))"
107
+ >
108
+ <slot name="last">
109
+ <i-lucide-chevrons-right class="w-4 h-4"/>
110
+ </slot>
111
+ </a>
112
+ </PaginationLast>
113
+ </PaginationList>
114
+ </PaginationRoot>
115
+ </template>
116
+
117
+ <script setup>
118
+ import {
119
+ PaginationEllipsis,
120
+ PaginationFirst,
121
+ PaginationLast,
122
+ PaginationList,
123
+ PaginationListItem,
124
+ PaginationNext,
125
+ PaginationPrev,
126
+ PaginationRoot
127
+ } from "reka-ui";
128
+ import { useAttrs } from "vue";
129
+ import ILucideChevronLeft from "~icons/lucide/chevron-left";
130
+ import ILucideChevronRight from "~icons/lucide/chevron-right";
131
+ import ILucideChevronsLeft from "~icons/lucide/chevrons-left";
132
+ import ILucideChevronsRight from "~icons/lucide/chevrons-right";
133
+ import { useInjectedI18n } from "../../composables/useInjectedI18n.js";
134
+ import { twMerge } from "../../utils/twMerge.js";
135
+ defineOptions({
136
+ name: "WPagination",
137
+ inheritAttrs: false
138
+ });
139
+ const t = useInjectedI18n();
140
+ const $attrs = useAttrs();
141
+ const props = defineProps({
142
+ defaultPage: { type: Number, required: false, default: 1 },
143
+ siblingCount: { type: Number, required: false, default: 1 },
144
+ itemsPerPage: { type: Number, required: true, default: 1 },
145
+ route: { type: String, required: true },
146
+ customRoute: { type: Function, required: false, default: (route = "", i) => {
147
+ if (i <= 1) return { href: route, i: 1 };
148
+ return { href: `${route}${i}`, i };
149
+ } },
150
+ total: { type: Number, required: true }
151
+ });
152
+ const current = defineModel("current", { type: Number, ...{ required: true } });
153
+ const emit = defineEmits(["link-click"]);
154
+ function onLinkClick(event, pageNum) {
155
+ const routeInfo = props.customRoute(props.route, pageNum);
156
+ emit("link-click", event, routeInfo);
157
+ }
158
+ const commonClasses = `
159
+ flex
160
+ items-center
161
+ justify-center
162
+ w-8
163
+ h-8
164
+ focus-outline
165
+ border-b-2
166
+ border-transparent
167
+ transition-all
168
+ outlined:rounded-sm
169
+ `;
170
+ const pageClasses = `
171
+ ${commonClasses}
172
+ focus-outline
173
+ hover:text-accent-600
174
+ hover:border-b-accent-500
175
+ hover:scale-125
176
+ `;
177
+ const currentPageClasses = `
178
+ ${commonClasses}
179
+ border-b-accent-500
180
+ scale-125
181
+ `;
182
+ </script>
@@ -0,0 +1,59 @@
1
+ import { type PaginationRootProps } from "reka-ui";
2
+ import { type HTMLAttributes } from "vue";
3
+ import type { TailwindClassProp } from "../../types/index.js";
4
+ type __VLS_Props = /** @vue-ignore */ Omit<HTMLAttributes, "class"> & /** @vue-ignore */ TailwindClassProp & Pick<PaginationRootProps, "defaultPage" | "siblingCount" | "itemsPerPage"> & {
5
+ route: string;
6
+ customRoute?: (route: string, i: number) => {
7
+ i: number;
8
+ href: string;
9
+ };
10
+ total: number;
11
+ };
12
+ type __VLS_ModelProps = {
13
+ "current": number;
14
+ };
15
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
16
+ declare var __VLS_20: {}, __VLS_33: {}, __VLS_46: {
17
+ value: number;
18
+ }, __VLS_60: {}, __VLS_73: {};
19
+ type __VLS_Slots = {} & {
20
+ first?: (props: typeof __VLS_20) => any;
21
+ } & {
22
+ prev?: (props: typeof __VLS_33) => any;
23
+ } & {
24
+ page?: (props: typeof __VLS_46) => any;
25
+ } & {
26
+ next?: (props: typeof __VLS_60) => any;
27
+ } & {
28
+ last?: (props: typeof __VLS_73) => any;
29
+ };
30
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
+ "update:current": (value: number) => any;
32
+ } & {
33
+ "link-click": (event: MouseEvent, payload: {
34
+ i: number;
35
+ href: string;
36
+ }) => any;
37
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
38
+ "onLink-click"?: ((event: MouseEvent, payload: {
39
+ i: number;
40
+ href: string;
41
+ }) => any) | undefined;
42
+ "onUpdate:current"?: ((value: number) => any) | undefined;
43
+ }>, {
44
+ defaultPage: number;
45
+ siblingCount: number;
46
+ itemsPerPage: number;
47
+ customRoute: (route: string, i: number) => {
48
+ i: number;
49
+ href: string;
50
+ };
51
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
52
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
53
+ declare const _default: typeof __VLS_export;
54
+ export default _default;
55
+ type __VLS_WithSlots<T, S> = T & {
56
+ new (): {
57
+ $slots: S;
58
+ };
59
+ };
@@ -0,0 +1,11 @@
1
+ import type { Theme } from "metamorphosis";
2
+ import type { BaseInteractiveProps } from "../../types/index.js";
3
+ type __VLS_Props = BaseInteractiveProps & {
4
+ theme?: Theme;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
+ theme: Theme;
8
+ border: boolean;
9
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -25,18 +25,13 @@
25
25
  </div>
26
26
  </template>
27
27
 
28
- <script>
29
- export default { name: "LibPalette" };
30
- </script>
31
-
32
28
  <script setup>
33
29
  import { keys } from "@alanscodelog/utils/keys";
34
30
  const props = defineProps({
35
- id: { type: String, required: false },
36
- disabled: { type: Boolean, required: false, default: false },
37
- readonly: { type: Boolean, required: false, default: false },
31
+ disabled: { type: Boolean, required: false },
32
+ readonly: { type: Boolean, required: false },
38
33
  border: { type: Boolean, required: false, default: true },
39
- unstyle: { type: Boolean, required: false, default: false },
34
+ unstyle: { type: Boolean, required: false },
40
35
  theme: { type: Object, required: false, default: () => ({}) }
41
36
  });
42
37
  const exclude = ["--color-bg", "--color-fg"];
@@ -0,0 +1,11 @@
1
+ import type { Theme } from "metamorphosis";
2
+ import type { BaseInteractiveProps } from "../../types/index.js";
3
+ type __VLS_Props = BaseInteractiveProps & {
4
+ theme?: Theme;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
+ theme: Theme;
8
+ border: boolean;
9
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,45 @@
1
+ import { type DialogContentEmits, type DialogRootEmits, type PopoverContentProps, type PopoverRootProps } from "reka-ui";
2
+ import type { HTMLAttributes } from "vue";
3
+ import type { EmitsToProps, PopupConstrainToProps, TailwindClassProp } from "../../types/index.js";
4
+ type __VLS_Props = PopupConstrainToProps & {
5
+ backdropClass?: string;
6
+ showBackdrop?: boolean;
7
+ showArrow?: boolean;
8
+ animationDirection?: "use-side" | "use-align" | "left" | "right" | "up" | "down" | "show" | "none";
9
+ /** Overrides teleport target. */
10
+ to?: string;
11
+ /** Overrides reka-ui's PopoverRootProps */
12
+ rootProps?: PopoverRootProps & EmitsToProps<DialogRootEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
13
+ /** Overrides reka-ui's PopoverContentProps */
14
+ contentProps?: PopoverContentProps & EmitsToProps<DialogContentEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
15
+ };
16
+ type __VLS_ModelProps = {
17
+ modelValue?: boolean;
18
+ };
19
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
20
+ declare var __VLS_14: {}, __VLS_34: {};
21
+ type __VLS_Slots = {} & {
22
+ button?: (props: typeof __VLS_14) => any;
23
+ } & {
24
+ popover?: (props: typeof __VLS_34) => any;
25
+ };
26
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ "update:modelValue": (value: boolean) => any;
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
29
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
30
+ }>, {
31
+ constrainWidthTo: number | "trigger" | "available" | string | null;
32
+ constrainHeightTo: number | "trigger" | "available" | string | null;
33
+ showBackdrop: boolean;
34
+ showArrow: boolean;
35
+ animationDirection: "use-side" | "use-align" | "left" | "right" | "up" | "down" | "show" | "none";
36
+ to: string;
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
39
+ declare const _default: typeof __VLS_export;
40
+ export default _default;
41
+ type __VLS_WithSlots<T, S> = T & {
42
+ new (): {
43
+ $slots: S;
44
+ };
45
+ };
@@ -0,0 +1,144 @@
1
+ <template>
2
+ <PopoverRoot
3
+ v-model:open="modelValue"
4
+ v-bind="rootProps"
5
+ >
6
+ <PopoverAnchor
7
+ v-if="$slots.button"
8
+ as-child
9
+ >
10
+ <slot name="button"/>
11
+ </PopoverAnchor>
12
+
13
+ <PopoverPortal :to="to">
14
+ <transition>
15
+ <div
16
+ v-if="showBackdrop && modelValue"
17
+ :class="twMerge(`popover--backdrop absolute inset-0 bg-black/50`, backdropClass)"
18
+ @click="modelValue = false"
19
+ />
20
+ </transition>
21
+
22
+ <PopoverContent
23
+ v-bind="{
24
+ disableOutsidePointerEvents: false,
25
+ side: 'bottom',
26
+ sideFlip: true,
27
+ align: 'center',
28
+ sideOffset: 0,
29
+ alignOffset: 0,
30
+ avoidCollisions: true,
31
+ prioritizePosition: false,
32
+ sticky: 'always',
33
+ collisionPadding: 10,
34
+ positionStrategy: 'absolute',
35
+ ...contentProps,
36
+ style: void 0
37
+ }"
38
+ :style="contentStyle"
39
+ :class="twMerge(
40
+ `
41
+ popover--content
42
+ focus:outline-none
43
+ overflow-auto
44
+ scrollbar-hidden
45
+ `,
46
+ animationDirection === `use-side` && `
47
+ data-[side=top]:animate-slideInUp
48
+ data-[side=bottom]:animate-slideInDown
49
+ data-[side=left]:animate-slideInLeft
50
+ data-[side=right]:animate-slideInRight
51
+ `,
52
+ animationDirection === `use-align` && (contentProps?.side === 'top' || contentProps?.side === 'bottom' || !contentProps?.side) && `
53
+ data-[align=start]:animate-slideInLeft
54
+ data-[align=end]:animate-slideInRight
55
+ data-[align=center]:animate-contentShow
56
+ `,
57
+ animationDirection === `use-align` && (contentProps?.side === 'left' || contentProps?.side === 'right' || !contentProps?.side) && `
58
+ data-[align=start]:animate-slideInDown
59
+ data-[align=end]:animate-slideInUp
60
+ data-[align=center]:animate-contentShow
61
+ `,
62
+ animationDirection === `left` && `
63
+ animate-slideInLeft
64
+ `,
65
+ animationDirection === `right` && `
66
+ animate-slideInRight
67
+ `,
68
+ animationDirection === `up` && `
69
+ data-[side=top]:animate-slideInUp
70
+ `,
71
+ animationDirection === `down` && `
72
+ animate-slideInDown
73
+ `,
74
+ animationDirection === `show` && `
75
+ animate-contentShow
76
+ `,
77
+ contentProps?.class
78
+ )"
79
+ >
80
+ <div
81
+ :class="twMerge(`
82
+ popover--content-inner
83
+ flex
84
+ flex-col
85
+ bg-neutral-50
86
+ dark:bg-neutral-900
87
+ rounded-sm
88
+ p-2
89
+ shadow-sm
90
+ shadow-black/30
91
+ border
92
+ border-black/30
93
+ whitespace-pre-wrap
94
+ overflow-auto
95
+ `)"
96
+ >
97
+ <slot name="popover"/>
98
+ </div>
99
+
100
+ <PopoverArrow
101
+ v-if="showArrow"
102
+ :class="twMerge(`
103
+ popover--arrow
104
+ -mt-px
105
+ fill-neutral-50
106
+ dark:fill-neutral-800
107
+ drop-shadow-[0_2px_1px_rgba(0,0,0,0.3)]
108
+ relative
109
+ stroke-black/30
110
+ `)"
111
+ />
112
+ </PopoverContent>
113
+ </PopoverPortal>
114
+ </PopoverRoot>
115
+ </template>
116
+
117
+ <script setup>
118
+ import {
119
+ PopoverAnchor,
120
+ PopoverArrow,
121
+ PopoverContent,
122
+ PopoverPortal,
123
+ PopoverRoot
124
+ } from "reka-ui";
125
+ import { usePopupConstrainToStyle } from "../../composables/usePopupConstrainToStyle.js";
126
+ import { twMerge } from "../../utils/twMerge.js";
127
+ defineOptions({
128
+ name: "WPopover",
129
+ inheritAttrs: false
130
+ });
131
+ const props = defineProps({
132
+ constrainWidthTo: { type: [Number, String, null], required: false, default: 400 },
133
+ constrainHeightTo: { type: [Number, String, null], required: false, default: "available" },
134
+ backdropClass: { type: String, required: false },
135
+ showBackdrop: { type: Boolean, required: false, default: false },
136
+ showArrow: { type: Boolean, required: false, default: true },
137
+ animationDirection: { type: String, required: false, default: "use-side" },
138
+ to: { type: String, required: false, default: "#root" },
139
+ rootProps: { type: Object, required: false },
140
+ contentProps: { type: Object, required: false }
141
+ });
142
+ const modelValue = defineModel({ type: Boolean, ...{ default: false } });
143
+ const contentStyle = usePopupConstrainToStyle("popover", props, [props?.contentProps?.style]);
144
+ </script>
@@ -0,0 +1,45 @@
1
+ import { type DialogContentEmits, type DialogRootEmits, type PopoverContentProps, type PopoverRootProps } from "reka-ui";
2
+ import type { HTMLAttributes } from "vue";
3
+ import type { EmitsToProps, PopupConstrainToProps, TailwindClassProp } from "../../types/index.js";
4
+ type __VLS_Props = PopupConstrainToProps & {
5
+ backdropClass?: string;
6
+ showBackdrop?: boolean;
7
+ showArrow?: boolean;
8
+ animationDirection?: "use-side" | "use-align" | "left" | "right" | "up" | "down" | "show" | "none";
9
+ /** Overrides teleport target. */
10
+ to?: string;
11
+ /** Overrides reka-ui's PopoverRootProps */
12
+ rootProps?: PopoverRootProps & EmitsToProps<DialogRootEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
13
+ /** Overrides reka-ui's PopoverContentProps */
14
+ contentProps?: PopoverContentProps & EmitsToProps<DialogContentEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
15
+ };
16
+ type __VLS_ModelProps = {
17
+ modelValue?: boolean;
18
+ };
19
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
20
+ declare var __VLS_14: {}, __VLS_34: {};
21
+ type __VLS_Slots = {} & {
22
+ button?: (props: typeof __VLS_14) => any;
23
+ } & {
24
+ popover?: (props: typeof __VLS_34) => any;
25
+ };
26
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ "update:modelValue": (value: boolean) => any;
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
29
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
30
+ }>, {
31
+ constrainWidthTo: number | "trigger" | "available" | string | null;
32
+ constrainHeightTo: number | "trigger" | "available" | string | null;
33
+ showBackdrop: boolean;
34
+ showArrow: boolean;
35
+ animationDirection: "use-side" | "use-align" | "left" | "right" | "up" | "down" | "show" | "none";
36
+ to: string;
37
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
39
+ declare const _default: typeof __VLS_export;
40
+ export default _default;
41
+ type __VLS_WithSlots<T, S> = T & {
42
+ new (): {
43
+ $slots: S;
44
+ };
45
+ };
@@ -0,0 +1,51 @@
1
+ import type { DialogContentEmits, DialogContentProps, DialogRootEmits, DialogRootProps } from "reka-ui";
2
+ import type { EmitsToProps, HTMLAttributes } from "vue";
3
+ import type { TailwindClassProp } from "../../types/index.js";
4
+ type __VLS_Props = {
5
+ title?: string;
6
+ description?: string;
7
+ backdropClass?: string;
8
+ /** Overrides reka-ui's DialogContentProps */
9
+ contentProps?: DialogContentProps & EmitsToProps<DialogContentEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
10
+ /** Overrides reka-ui's DialogRootProps */
11
+ rootProps?: DialogRootProps & EmitsToProps<DialogRootEmits> & Omit<HTMLAttributes, "class"> & TailwindClassProp;
12
+ /** Overrides teleport target. */
13
+ to?: string;
14
+ };
15
+ type __VLS_ModelProps = {
16
+ modelValue?: boolean;
17
+ };
18
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
19
+ declare var __VLS_14: {}, __VLS_28: {
20
+ class: string;
21
+ }, __VLS_36: {}, __VLS_38: {}, __VLS_46: {}, __VLS_54: {}, __VLS_62: {};
22
+ type __VLS_Slots = {} & {
23
+ button?: (props: typeof __VLS_14) => any;
24
+ } & {
25
+ backdrop?: (props: typeof __VLS_28) => any;
26
+ } & {
27
+ popup?: (props: typeof __VLS_36) => any;
28
+ } & {
29
+ title?: (props: typeof __VLS_38) => any;
30
+ } & {
31
+ description?: (props: typeof __VLS_46) => any;
32
+ } & {
33
+ extra?: (props: typeof __VLS_54) => any;
34
+ } & {
35
+ close?: (props: typeof __VLS_62) => any;
36
+ };
37
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
38
+ "update:modelValue": (value: boolean) => any;
39
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
40
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
41
+ }>, {
42
+ to: string;
43
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
44
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
45
+ declare const _default: typeof __VLS_export;
46
+ export default _default;
47
+ type __VLS_WithSlots<T, S> = T & {
48
+ new (): {
49
+ $slots: S;
50
+ };
51
+ };
@@ -0,0 +1,106 @@
1
+ <template>
2
+ <DialogRoot
3
+ v-bind="rootProps"
4
+ v-model:open="modelValue"
5
+ >
6
+ <DialogTrigger
7
+ v-if="$slots.button"
8
+ as-child
9
+ >
10
+ <slot name="button"/>
11
+ </DialogTrigger>
12
+
13
+ <DialogPortal :to="to">
14
+ <DialogOverlay
15
+ as-child
16
+ >
17
+ <slot
18
+ name="backdrop"
19
+ class="popup--backdrop absolute inset-0 bg-black/50"
20
+ >
21
+ <div
22
+ class="popup--backdrop absolute inset-0 bg-black/50"
23
+ />
24
+ </slot>
25
+ </DialogOverlay>
26
+
27
+ <DialogContent
28
+ v-bind="{ ...contentProps, class: void 0 }"
29
+ :class="twMerge(`
30
+ popup--content
31
+ z-100
32
+ focus:outline-none
33
+ fixed
34
+ top-1/2
35
+ left-1/2
36
+ -translate-x-1/2
37
+ -translate-y-1/2
38
+ animate-contentShow
39
+ max-w-[100dvw]
40
+ max-h-[100dvh]
41
+ overflow-auto
42
+ scrollbar-hidden
43
+ p-5
44
+ `, contentProps?.class)"
45
+ >
46
+ <div
47
+ :class="twMerge(`
48
+ popup--content-inner
49
+ flex
50
+ flex-col
51
+ bg-neutral-100
52
+ dark:bg-neutral-800
53
+ rounded-md
54
+ flex
55
+ flex-col
56
+ gap-3
57
+ p-2
58
+ `)"
59
+ >
60
+ <slot name="popup">
61
+ <slot name="title">
62
+ <DialogTitle
63
+ v-if="title"
64
+ class="text-lg font-bold"
65
+ >
66
+ {{ title }}
67
+ </DialogTitle>
68
+ </slot>
69
+ <slot name="description">
70
+ <DialogDescription v-if="description">
71
+ {{ description }}
72
+ </DialogDescription>
73
+ </slot>
74
+ <slot name="extra"/>
75
+ </slot>
76
+ <DialogCloseButton as-child>
77
+ <slot name="close">
78
+ <WButton
79
+ class="justify-self-end"
80
+ @click="modelValue = false"
81
+ >
82
+ Close
83
+ </WButton>
84
+ </slot>
85
+ </DialogCloseButton>
86
+ </div>
87
+ </DialogContent>
88
+ </DialogPortal>
89
+ </DialogRoot>
90
+ </template>
91
+
92
+ <script setup>
93
+ import { DialogContent, DialogOverlay, DialogPortal, DialogRoot, DialogTrigger } from "reka-ui";
94
+ import { twMerge } from "../../utils/twMerge.js";
95
+ import WButton from "../WButton/WButton.vue";
96
+ defineOptions({ name: "WPopup", inheritAttrs: false });
97
+ defineProps({
98
+ title: { type: String, required: false },
99
+ description: { type: String, required: false },
100
+ backdropClass: { type: String, required: false },
101
+ contentProps: { type: Object, required: false },
102
+ rootProps: { type: Object, required: false },
103
+ to: { type: String, required: false, default: "#root" }
104
+ });
105
+ const modelValue = defineModel({ type: Boolean, ...{ default: false } });
106
+ </script>