@leavepulse/ui 0.43.4 → 0.44.0

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 (337) hide show
  1. package/README.md +75 -7
  2. package/dist/assets/{LpCommandPalette-B-0Est4Z.css → LpCommandPalette-DCP5g2ik.css} +21 -21
  3. package/dist/assets/{LpDropzone-BBoWvi-J.css → LpDropzone-i4BdMi1H.css} +12 -12
  4. package/dist/assets/{LpImageEditor-Ct7Y3aNu.css → LpImageEditor-CbMA82g8.css} +6 -6
  5. package/dist/assets/{LpShortcutsDialog-C6YoQ8_M.css → LpShortcutsDialog-ChUyU7oV.css} +7 -7
  6. package/dist/assets/{LpSkeleton-D7xU8IPV.css → LpSkeleton-H3Z5dEIk.css} +4 -1
  7. package/dist/assets/{LpTable-BgPLJOXa.css → LpTable-DDQNdf86.css} +9 -9
  8. package/dist/chunks/ContextMenuItems-CrfeNPWT.js +123 -0
  9. package/dist/chunks/{LayoutCanvas-Dd20boUG.js → LayoutCanvas-D-jPOAvg.js} +26 -9
  10. package/dist/chunks/{LayoutNode-DGpZA9LX.js → LayoutNode-D8Xy9N-o.js} +20 -8
  11. package/dist/chunks/{LpActionBar-BlvtGB2P.js → LpActionBar-BbwCF6l5.js} +24 -10
  12. package/dist/chunks/{LpAddressInput-B-Zvxsn7.js → LpAddressInput-BrOqkZqg.js} +53 -48
  13. package/dist/chunks/{LpAlert-BAYHDSS1.js → LpAlert-DkOIjsbq.js} +15 -8
  14. package/dist/chunks/{LpAppShell-BGQVIY-3.js → LpAppShell-BUKPcHco.js} +51 -24
  15. package/dist/chunks/{LpAutocomplete-DExlIZe_.js → LpAutocomplete-DxV3Y9h4.js} +50 -23
  16. package/dist/chunks/{LpAvatar-B3-xAOH3.js → LpAvatar-ClBbEYZN.js} +17 -8
  17. package/dist/chunks/LpBreadcrumbs-B8IJgFIc.js +95 -0
  18. package/dist/chunks/{LpButton-5VXXCjwF.js → LpButton-kqJBHIIb.js} +44 -14
  19. package/dist/chunks/{LpCard-BhI1N_vL.js → LpCard-CpRByR0q.js} +1 -1
  20. package/dist/chunks/{LpCheckbox-CVccKYaH.js → LpCheckbox-DpqchzH4.js} +7 -3
  21. package/dist/chunks/{LpCodeBlock-Bo0B4TFR.js → LpCodeBlock-DeHJPq7p.js} +48 -16
  22. package/dist/chunks/{LpColorPicker-BlXea7LM.js → LpColorPicker-Bhf1qxhB.js} +32 -9
  23. package/dist/chunks/{LpConfirmDialog-Q-bxff8z.js → LpConfirmDialog-CIUOSnWo.js} +58 -16
  24. package/dist/chunks/LpConfirmHost-CDm0Wtpv.js +49 -0
  25. package/dist/chunks/LpContextMenu-DQw5dGfG.js +68 -0
  26. package/dist/chunks/LpDatePicker-Drirx1AK.js +191 -0
  27. package/dist/chunks/{LpDrawer-BZ6k3hvo.js → LpDrawer-bScx-KMO.js} +63 -26
  28. package/dist/chunks/{LpFileTree-_5vFBgaK.js → LpFileTree-CSI_5SK2.js} +23 -8
  29. package/dist/chunks/{LpFileTreeNode-BdcIYKIE.js → LpFileTreeNode-B4MiSQX2.js} +2 -2
  30. package/dist/chunks/LpFormField-CIk5qosh.js +87 -0
  31. package/dist/chunks/{LpInput-9EXWUM9B.js → LpInput-C0e8y8_d.js} +26 -11
  32. package/dist/chunks/{LpLightbox-2sYVMY-S.js → LpLightbox-Mr0W_6HK.js} +147 -60
  33. package/dist/chunks/{LpLink-DCND-zyu.js → LpLink-Krkjhe_y.js} +15 -6
  34. package/dist/chunks/{LpLogViewer-CaRy5MeS.js → LpLogViewer-YBOaFnc_.js} +68 -34
  35. package/dist/chunks/{LpMapPicker-ul4oYno6.js → LpMapPicker-NUzS9e37.js} +38 -13
  36. package/dist/chunks/{LpMediaGallery-FF-NquIo.js → LpMediaGallery-DfJmMW0I.js} +6 -3
  37. package/dist/chunks/{LpModal-Bt0pQCI_.js → LpModal-DPwGKBPv.js} +49 -26
  38. package/dist/chunks/{LpModalNav-YaifHrXC.js → LpModalNav-DPg5H9f3.js} +9 -6
  39. package/dist/chunks/{LpNotificationBell-DyGGsMAM.js → LpNotificationBell-t5yn-siX.js} +58 -24
  40. package/dist/chunks/{LpNumberField-CWuX08iX.js → LpNumberField-DWnQKktS.js} +20 -7
  41. package/dist/chunks/{LpNumberFlow-amWYaeuA.js → LpNumberFlow-z4WPZcZu.js} +22 -12
  42. package/dist/chunks/{LpOtpInput-y2v-pmiN.js → LpOtpInput-CziPF3Oq.js} +37 -8
  43. package/dist/chunks/{LpPagination-5FxjmmB5.js → LpPagination-DFngX7Xo.js} +30 -19
  44. package/dist/chunks/{LpPasswordInput--sjYCkLS.js → LpPasswordInput-CWVDuBJ5.js} +10 -7
  45. package/dist/chunks/{LpPhoneInput-BDSKVl_z.js → LpPhoneInput-CD-ZTeSd.js} +57 -33
  46. package/dist/chunks/{LpPie-D6OnzwlJ.js → LpPie-BLco31Nx.js} +78 -21
  47. package/dist/chunks/{LpPopover-8268UmlC.js → LpPopover-p_e_shN3.js} +4 -2
  48. package/dist/chunks/{LpProgress-Btq5W4Ut.js → LpProgress-CBU1iI69.js} +5 -4
  49. package/dist/chunks/{LpRadioGroup-xPIuVDO_.js → LpRadioGroup-DmEW0l78.js} +9 -2
  50. package/dist/chunks/{LpSegmented-fV0Sk92p.js → LpSegmented-Dejd7cIx.js} +7 -3
  51. package/dist/chunks/{LpSelect-ANIVtrpM.js → LpSelect-DrRD9I7L.js} +40 -18
  52. package/dist/chunks/{LpSidebar-ClBUwoEz.js → LpSidebar-BgwUNWpJ.js} +30 -22
  53. package/dist/chunks/{LpSidebarNav-llOcs_Fn.js → LpSidebarNav-Bqxz8aWT.js} +14 -9
  54. package/dist/chunks/{LpSkeleton-CTI-vBgW.js → LpSkeleton-BB6XIV-w.js} +1 -1
  55. package/dist/chunks/{LpSlider-BwNIBkAK.js → LpSlider-Cuzmrd7p.js} +7 -2
  56. package/dist/chunks/{LpSparkline-C6xQ2dwv.js → LpSparkline-CB80N8SJ.js} +11 -4
  57. package/dist/chunks/{LpStat-CQaW8R--.js → LpStat-dXtyrdX9.js} +1 -1
  58. package/dist/chunks/{LpSwitch-Blizvqyt.js → LpSwitch-B1aLKulj.js} +40 -26
  59. package/dist/chunks/{LpTableOfContents-CjvxPMpU.js → LpTableOfContents-BUcAfGPQ.js} +36 -41
  60. package/dist/chunks/{LpTabs-Cefe_lys.js → LpTabs-_qMVaZJ6.js} +19 -5
  61. package/dist/chunks/LpTextarea-yP8hGedR.js +77 -0
  62. package/dist/chunks/LpThemeProvider-Wjm7Tuit.js +35 -0
  63. package/dist/chunks/LpThemeSwitcher-CKLc10KZ.js +169 -0
  64. package/dist/chunks/{LpTilt-DuyKbpkA.js → LpTilt-B7KHX1zH.js} +2 -2
  65. package/dist/chunks/{LpTimeField-K6nAGboX.js → LpTimeField-C5HRgS5H.js} +13 -7
  66. package/dist/chunks/{LpToaster-gDB1EaU3.js → LpToaster--oT6lfhL.js} +57 -28
  67. package/dist/chunks/{LpTooltip-hCLPAqMG.js → LpTooltip-CBdzeKNf.js} +13 -6
  68. package/dist/chunks/LpTooltipProvider-CftjV7Xc.js +25 -0
  69. package/dist/chunks/{LpTopologyCanvas-Cm1L39uL.js → LpTopologyCanvas-DocsLal3.js} +6 -1
  70. package/dist/chunks/{LpUptimeBar-DvAMno0S.js → LpUptimeBar-DLtxOMRy.js} +43 -14
  71. package/dist/chunks/{LpThemeSwitcher-Cue-myST.js → useTheme-C8JHUlPM.js} +173 -215
  72. package/dist/component-names.d.ts +1 -1
  73. package/dist/components/ContextMenuItems.vue.d.ts +8 -0
  74. package/dist/components/ContextMenuItems.vue.js +4 -0
  75. package/dist/components/LayoutCanvas.vue.js +1 -1
  76. package/dist/components/LayoutNode.vue.d.ts +4 -0
  77. package/dist/components/LayoutNode.vue.js +1 -1
  78. package/dist/components/LpActionBar.vue.d.ts +3 -0
  79. package/dist/components/LpActionBar.vue.js +1 -1
  80. package/dist/components/LpAddressInput.vue.d.ts +1 -1
  81. package/dist/components/LpAddressInput.vue.js +1 -1
  82. package/dist/components/LpAlert.vue.d.ts +9 -0
  83. package/dist/components/LpAlert.vue.js +1 -1
  84. package/dist/components/LpAppShell.vue.d.ts +10 -0
  85. package/dist/components/LpAppShell.vue.js +1 -1
  86. package/dist/components/LpAutocomplete.vue.d.ts +31 -6
  87. package/dist/components/LpAutocomplete.vue.js +1 -1
  88. package/dist/components/LpAvatar.vue.d.ts +3 -3
  89. package/dist/components/LpAvatar.vue.js +1 -1
  90. package/dist/components/LpBadge.vue.d.ts +2 -2
  91. package/dist/components/LpBreadcrumbs.vue.d.ts +13 -9
  92. package/dist/components/LpBreadcrumbs.vue.js +1 -1
  93. package/dist/components/LpButton.vue.d.ts +35 -98
  94. package/dist/components/LpButton.vue.js +1 -1
  95. package/dist/components/LpCard.vue.js +1 -1
  96. package/dist/components/LpChart.vue.d.ts +31 -2
  97. package/dist/components/LpChart.vue.js +317 -95
  98. package/dist/components/LpCheckbox.vue.js +1 -1
  99. package/dist/components/LpCodeBlock.vue.d.ts +2 -0
  100. package/dist/components/LpCodeBlock.vue.js +1 -1
  101. package/dist/components/LpColorPicker.vue.js +1 -1
  102. package/dist/components/LpCommandPalette.vue.d.ts +8 -3
  103. package/dist/components/LpCommandPalette.vue.js +86 -72
  104. package/dist/components/LpConfirmDialog.vue.d.ts +15 -3
  105. package/dist/components/LpConfirmDialog.vue.js +1 -1
  106. package/dist/components/LpConfirmHost.vue.d.ts +9 -0
  107. package/dist/components/LpConfirmHost.vue.js +4 -0
  108. package/dist/components/LpContextMenu.vue.d.ts +3 -5
  109. package/dist/components/LpContextMenu.vue.js +1 -1
  110. package/dist/components/LpDatePicker.vue.d.ts +24 -6
  111. package/dist/components/LpDatePicker.vue.js +1 -1
  112. package/dist/components/LpDrawer.vue.d.ts +10 -0
  113. package/dist/components/LpDrawer.vue.js +1 -1
  114. package/dist/components/LpDropzone.vue.js +22 -6
  115. package/dist/components/LpFileTree.vue.d.ts +11 -2
  116. package/dist/components/LpFileTree.vue.js +1 -1
  117. package/dist/components/LpFileTreeNode.vue.js +1 -1
  118. package/dist/components/LpFormField.vue.d.ts +9 -0
  119. package/dist/components/LpFormField.vue.js +1 -1
  120. package/dist/components/LpImageEditor.vue.js +92 -57
  121. package/dist/components/LpInput.vue.d.ts +3 -3
  122. package/dist/components/LpInput.vue.js +1 -1
  123. package/dist/components/LpLightbox.vue.d.ts +17 -0
  124. package/dist/components/LpLightbox.vue.js +1 -1
  125. package/dist/components/LpLink.vue.d.ts +11 -11
  126. package/dist/components/LpLink.vue.js +1 -1
  127. package/dist/components/LpLogViewer.vue.d.ts +20 -2
  128. package/dist/components/LpLogViewer.vue.js +1 -1
  129. package/dist/components/LpMapPicker.vue.d.ts +4 -4
  130. package/dist/components/LpMapPicker.vue.js +1 -1
  131. package/dist/components/LpMediaGallery.vue.js +1 -1
  132. package/dist/components/LpModal.vue.d.ts +16 -6
  133. package/dist/components/LpModal.vue.js +1 -1
  134. package/dist/components/LpModalNav.vue.d.ts +0 -1
  135. package/dist/components/LpModalNav.vue.js +1 -1
  136. package/dist/components/LpNotificationBell.vue.d.ts +11 -2
  137. package/dist/components/LpNotificationBell.vue.js +1 -1
  138. package/dist/components/LpNumberField.vue.d.ts +2 -0
  139. package/dist/components/LpNumberField.vue.js +1 -1
  140. package/dist/components/LpNumberFlow.vue.js +1 -1
  141. package/dist/components/LpOtpInput.vue.js +1 -1
  142. package/dist/components/LpPagination.vue.d.ts +2 -0
  143. package/dist/components/LpPagination.vue.js +1 -1
  144. package/dist/components/LpPasswordInput.vue.js +1 -1
  145. package/dist/components/LpPhoneInput.vue.js +1 -1
  146. package/dist/components/LpPie.vue.d.ts +21 -2
  147. package/dist/components/LpPie.vue.js +1 -1
  148. package/dist/components/LpPopover.vue.d.ts +2 -0
  149. package/dist/components/LpPopover.vue.js +1 -1
  150. package/dist/components/LpProgress.vue.js +1 -1
  151. package/dist/components/LpRadioGroup.vue.js +1 -1
  152. package/dist/components/LpSection.vue.d.ts +1 -1
  153. package/dist/components/LpSegmented.vue.d.ts +5 -0
  154. package/dist/components/LpSegmented.vue.js +1 -1
  155. package/dist/components/LpSelect.vue.d.ts +1 -0
  156. package/dist/components/LpSelect.vue.js +1 -1
  157. package/dist/components/LpShortcutsDialog.vue.d.ts +1 -1
  158. package/dist/components/LpShortcutsDialog.vue.js +11 -8
  159. package/dist/components/LpSidebar.vue.d.ts +6 -2
  160. package/dist/components/LpSidebar.vue.js +1 -1
  161. package/dist/components/LpSidebarNav.vue.js +1 -1
  162. package/dist/components/LpSkeleton.vue.js +1 -1
  163. package/dist/components/LpSlider.vue.js +1 -1
  164. package/dist/components/LpSparkline.vue.d.ts +1 -0
  165. package/dist/components/LpSparkline.vue.js +1 -1
  166. package/dist/components/LpStat.vue.js +1 -1
  167. package/dist/components/LpSwitch.vue.js +1 -1
  168. package/dist/components/LpTable.vue.d.ts +23 -1
  169. package/dist/components/LpTable.vue.js +74 -36
  170. package/dist/components/LpTableOfContents.vue.d.ts +4 -2
  171. package/dist/components/LpTableOfContents.vue.js +1 -1
  172. package/dist/components/LpTabs.vue.d.ts +2 -0
  173. package/dist/components/LpTabs.vue.js +1 -1
  174. package/dist/components/LpTextarea.vue.d.ts +19 -6
  175. package/dist/components/LpTextarea.vue.js +1 -1
  176. package/dist/components/LpThemeProvider.vue.d.ts +22 -0
  177. package/dist/components/LpThemeProvider.vue.js +4 -0
  178. package/dist/components/LpThemeSwitcher.vue.d.ts +13 -0
  179. package/dist/components/LpThemeSwitcher.vue.js +1 -1
  180. package/dist/components/LpTilt.vue.js +1 -1
  181. package/dist/components/LpTimeField.vue.js +1 -1
  182. package/dist/components/LpToaster.vue.d.ts +6 -1
  183. package/dist/components/LpToaster.vue.js +1 -1
  184. package/dist/components/LpTooltip.vue.d.ts +1 -2
  185. package/dist/components/LpTooltip.vue.js +1 -1
  186. package/dist/components/LpTooltipProvider.vue.d.ts +22 -0
  187. package/dist/components/LpTooltipProvider.vue.js +4 -0
  188. package/dist/components/LpTopologyCanvas.vue.js +1 -1
  189. package/dist/components/LpUptimeBar.vue.d.ts +4 -0
  190. package/dist/components/LpUptimeBar.vue.js +1 -1
  191. package/dist/components/chart.d.ts +32 -1
  192. package/dist/components/chart.js +39 -4
  193. package/dist/components/codeHighlight.d.ts +6 -0
  194. package/dist/components/codeHighlight.js +92 -20
  195. package/dist/components/color.d.ts +1 -1
  196. package/dist/components/color.js +20 -9
  197. package/dist/components/confirm.d.ts +25 -0
  198. package/dist/components/confirm.js +26 -0
  199. package/dist/components/countries.d.ts +6 -0
  200. package/dist/components/countries.js +7 -0
  201. package/dist/components/fileTree.js +16 -7
  202. package/dist/components/imageCrop.d.ts +42 -0
  203. package/dist/components/imageCrop.js +47 -0
  204. package/dist/components/link.d.ts +12 -0
  205. package/dist/components/link.js +19 -0
  206. package/dist/components/modalDepth.d.ts +18 -2
  207. package/dist/components/modalDepth.js +17 -5
  208. package/dist/components/otp.d.ts +5 -0
  209. package/dist/components/otp.js +10 -0
  210. package/dist/components/sidebar.d.ts +7 -1
  211. package/dist/components/tableSort.d.ts +8 -0
  212. package/dist/components/tableSort.js +31 -0
  213. package/dist/composables/useField.d.ts +34 -0
  214. package/dist/composables/useField.js +45 -0
  215. package/dist/composables/useFormDraft.d.ts +10 -3
  216. package/dist/composables/useFormDraft.js +9 -14
  217. package/dist/composables/useHotkeys.d.ts +17 -1
  218. package/dist/composables/useHotkeys.js +55 -18
  219. package/dist/composables/useInputFilter.d.ts +17 -0
  220. package/dist/composables/useInputFilter.js +47 -10
  221. package/dist/composables/useLpConfig.d.ts +24 -0
  222. package/dist/composables/useLpConfig.js +44 -0
  223. package/dist/composables/useRovingFocus.js +7 -0
  224. package/dist/composables/useTilt.d.ts +2 -2
  225. package/dist/composables/useTilt.js +5 -6
  226. package/dist/composables/useToast.d.ts +20 -0
  227. package/dist/composables/useToast.js +28 -4
  228. package/dist/composables/useZoomPan.d.ts +3 -3
  229. package/dist/composables/useZoomPan.js +4 -4
  230. package/dist/index.d.ts +32 -2
  231. package/dist/index.js +184 -137
  232. package/dist/layout/tree.d.ts +2 -0
  233. package/dist/layout/tree.js +16 -1
  234. package/dist/layout/useLayout.d.ts +15 -0
  235. package/dist/layout/useLayout.js +41 -14
  236. package/dist/theme/useTheme.d.ts +32 -9
  237. package/package.json +8 -7
  238. package/src/component-names.ts +5 -7
  239. package/src/components/ContextMenuItems.vue +88 -0
  240. package/src/components/LayoutCanvas.vue +26 -6
  241. package/src/components/LayoutNode.vue +19 -2
  242. package/src/components/LpActionBar.vue +30 -7
  243. package/src/components/LpAddressInput.vue +57 -41
  244. package/src/components/LpAlert.vue +16 -3
  245. package/src/components/LpAppShell.vue +45 -12
  246. package/src/components/LpAutocomplete.vue +46 -10
  247. package/src/components/LpAvatar.vue +19 -5
  248. package/src/components/LpBreadcrumbs.vue +65 -41
  249. package/src/components/LpButton.vue +59 -13
  250. package/src/components/LpChart.vue +272 -28
  251. package/src/components/LpCheckbox.vue +7 -3
  252. package/src/components/LpCodeBlock.vue +50 -14
  253. package/src/components/LpColorPicker.vue +39 -9
  254. package/src/components/LpCommandPalette.vue +34 -13
  255. package/src/components/LpConfirmDialog.vue +68 -17
  256. package/src/components/LpConfirmHost.vue +59 -0
  257. package/src/components/LpContextMenu.vue +14 -115
  258. package/src/components/LpDatePicker.vue +99 -68
  259. package/src/components/LpDrawer.vue +56 -19
  260. package/src/components/LpDropzone.vue +21 -4
  261. package/src/components/LpFileTree.vue +33 -7
  262. package/src/components/LpFormField.vue +30 -7
  263. package/src/components/LpImageEditor.vue +96 -57
  264. package/src/components/LpInput.vue +18 -7
  265. package/src/components/LpLightbox.vue +140 -29
  266. package/src/components/LpLink.vue +24 -13
  267. package/src/components/LpLogViewer.vue +86 -17
  268. package/src/components/LpMapPicker.vue +36 -13
  269. package/src/components/LpMediaGallery.vue +8 -2
  270. package/src/components/LpModal.vue +53 -27
  271. package/src/components/LpModalNav.vue +5 -2
  272. package/src/components/LpNotificationBell.vue +63 -17
  273. package/src/components/LpNumberField.vue +21 -6
  274. package/src/components/LpNumberFlow.vue +26 -10
  275. package/src/components/LpOtpInput.vue +43 -8
  276. package/src/components/LpPagination.vue +23 -7
  277. package/src/components/LpPasswordInput.vue +4 -1
  278. package/src/components/LpPhoneInput.vue +53 -27
  279. package/src/components/LpPie.vue +94 -15
  280. package/src/components/LpPopover.vue +3 -0
  281. package/src/components/LpProgress.vue +5 -3
  282. package/src/components/LpRadioGroup.vue +9 -2
  283. package/src/components/LpSegmented.vue +12 -2
  284. package/src/components/LpSelect.vue +0 -0
  285. package/src/components/LpShortcutsDialog.vue +8 -3
  286. package/src/components/LpSidebar.vue +14 -9
  287. package/src/components/LpSidebarNav.vue +17 -5
  288. package/src/components/LpSkeleton.vue +4 -1
  289. package/src/components/LpSlider.vue +7 -1
  290. package/src/components/LpSparkline.vue +11 -3
  291. package/src/components/LpSwitch.vue +30 -7
  292. package/src/components/LpTable.vue +91 -32
  293. package/src/components/LpTableOfContents.vue +50 -32
  294. package/src/components/LpTabs.vue +23 -6
  295. package/src/components/LpTextarea.vue +44 -6
  296. package/src/components/LpThemeProvider.vue +41 -0
  297. package/src/components/LpThemeSwitcher.vue +64 -17
  298. package/src/components/LpTilt.vue +2 -2
  299. package/src/components/LpTimeField.vue +14 -3
  300. package/src/components/LpToaster.vue +66 -26
  301. package/src/components/LpTooltip.vue +22 -5
  302. package/src/components/LpTooltipProvider.vue +24 -0
  303. package/src/components/LpTopologyCanvas.vue +12 -1
  304. package/src/components/LpUptimeBar.vue +46 -8
  305. package/src/components/chart.ts +77 -5
  306. package/src/components/codeHighlight.ts +111 -15
  307. package/src/components/color.ts +30 -9
  308. package/src/components/confirm.ts +58 -0
  309. package/src/components/countries.ts +12 -0
  310. package/src/components/fileTree.ts +19 -7
  311. package/src/components/imageCrop.ts +107 -0
  312. package/src/components/link.ts +34 -0
  313. package/src/components/modalDepth.ts +48 -6
  314. package/src/components/otp.ts +16 -0
  315. package/src/components/sidebar.ts +7 -1
  316. package/src/components/tableSort.ts +37 -0
  317. package/src/composables/useField.ts +79 -0
  318. package/src/composables/useFormDraft.ts +25 -20
  319. package/src/composables/useHotkeys.ts +89 -18
  320. package/src/composables/useInputFilter.ts +77 -14
  321. package/src/composables/useLpConfig.ts +87 -0
  322. package/src/composables/useRovingFocus.ts +11 -0
  323. package/src/composables/useTilt.ts +5 -6
  324. package/src/composables/useToast.ts +56 -4
  325. package/src/composables/useZoomPan.ts +6 -6
  326. package/src/index.ts +37 -2
  327. package/src/layout/tree.ts +30 -0
  328. package/src/layout/useLayout.ts +68 -18
  329. package/src/nuxt.ts +59 -17
  330. package/src/runtime/config.plugin.ts +14 -0
  331. package/src/runtime/theme.plugin.ts +42 -22
  332. package/src/theme/useTheme.ts +206 -100
  333. package/dist/chunks/LpBreadcrumbs-p4jHe_V-.js +0 -62
  334. package/dist/chunks/LpContextMenu-CwW1QXe_.js +0 -217
  335. package/dist/chunks/LpDatePicker-CwOToxGq.js +0 -164
  336. package/dist/chunks/LpFormField-CazBc2-a.js +0 -62
  337. package/dist/chunks/LpTextarea-t7F6gv8E.js +0 -47
@@ -1,35 +1,75 @@
1
- import { defineComponent, computed, openBlock, createBlock, createSlots, withCtx, renderSlot, createVNode, createTextVNode, toDisplayString, createElementVNode, normalizeClass } from "vue";
2
- import { _ as _sfc_main$2 } from "./LpButton-5VXXCjwF.js";
1
+ import { defineComponent, computed, ref, watch, openBlock, createBlock, createSlots, withCtx, renderSlot, createElementBlock, toDisplayString, createCommentVNode, createVNode, createTextVNode, unref, createElementVNode, normalizeClass, nextTick } from "vue";
2
+ import { useLabels } from "../composables/useLpConfig.js";
3
+ import { _ as _sfc_main$2 } from "./LpButton-kqJBHIIb.js";
3
4
  import { _ as _sfc_main$3 } from "./LpIcon-CCnX5_2j.js";
4
- import { _ as _sfc_main$1 } from "./LpModal-Bt0pQCI_.js";
5
+ import { _ as _sfc_main$1 } from "./LpModal-DPwGKBPv.js";
5
6
  const _hoisted_1 = { class: "inline-flex items-center gap-2.5" };
7
+ const _hoisted_2 = {
8
+ key: 0,
9
+ role: "alert",
10
+ class: "mt-3 text-sm text-danger"
11
+ };
6
12
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
13
  __name: "LpConfirmDialog",
8
14
  props: {
9
15
  open: { type: Boolean },
10
16
  title: {},
11
17
  description: {},
12
- confirmLabel: { default: "Confirm" },
13
- cancelLabel: { default: "Cancel" },
18
+ confirmLabel: {},
19
+ cancelLabel: {},
14
20
  danger: { type: Boolean },
15
21
  icon: {},
16
22
  loading: { type: Boolean },
17
- loadingLabel: { default: "Working…" },
18
- glass: { type: Boolean, default: void 0 }
23
+ loadingLabel: {},
24
+ action: {},
25
+ glass: { type: Boolean, default: void 0 },
26
+ labels: {}
19
27
  },
20
28
  emits: ["update:open", "confirm", "cancel"],
21
29
  setup(__props, { emit: __emit }) {
22
30
  const props = __props;
23
31
  const emit = __emit;
32
+ const text = useLabels(
33
+ "confirm",
34
+ { confirm: "Confirm", cancel: "Cancel", loading: "Working…", failed: "Something went wrong." },
35
+ () => props.labels
36
+ );
24
37
  const marker = computed(() => {
25
38
  if (props.icon !== void 0) return props.icon;
26
39
  return props.danger ? "lucide:triangle-alert" : "";
27
40
  });
28
- function confirm() {
41
+ const running = ref(false);
42
+ const error = ref("");
43
+ const busy = computed(() => props.loading || running.value);
44
+ watch(
45
+ () => props.open,
46
+ (open) => {
47
+ if (open) error.value = "";
48
+ }
49
+ );
50
+ async function confirm() {
51
+ if (busy.value) return;
52
+ error.value = "";
29
53
  emit("confirm");
54
+ if (props.action) {
55
+ running.value = true;
56
+ try {
57
+ await props.action();
58
+ } catch (e) {
59
+ error.value = e instanceof Error && e.message ? e.message : text.value.failed;
60
+ return;
61
+ } finally {
62
+ running.value = false;
63
+ }
64
+ emit("update:open", false);
65
+ return;
66
+ }
67
+ await nextTick();
30
68
  if (!props.loading) emit("update:open", false);
31
69
  }
32
- function cancel() {
70
+ function dismiss(open) {
71
+ if (open) return emit("update:open", true);
72
+ if (busy.value) return;
33
73
  emit("cancel");
34
74
  emit("update:open", false);
35
75
  }
@@ -39,32 +79,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
79
  open: __props.open,
40
80
  title: __props.title,
41
81
  description: __props.description,
42
- "onUpdate:open": _cache[0] || (_cache[0] = (v) => _ctx.$emit("update:open", v))
82
+ role: "alertdialog",
83
+ "onUpdate:open": dismiss
43
84
  }, createSlots({
44
85
  footer: withCtx(() => [
45
86
  createVNode(_sfc_main$2, {
46
87
  variant: "ghost",
47
- disabled: __props.loading,
48
- onClick: cancel
88
+ disabled: busy.value,
89
+ onClick: _cache[0] || (_cache[0] = ($event) => dismiss(false))
49
90
  }, {
50
91
  default: withCtx(() => [
51
- createTextVNode(toDisplayString(__props.cancelLabel), 1)
92
+ createTextVNode(toDisplayString(__props.cancelLabel ?? unref(text).cancel), 1)
52
93
  ]),
53
94
  _: 1
54
95
  }, 8, ["disabled"]),
55
96
  createVNode(_sfc_main$2, {
56
97
  variant: __props.danger ? "danger" : "solid",
57
- disabled: __props.loading,
98
+ disabled: busy.value,
58
99
  onClick: confirm
59
100
  }, {
60
101
  default: withCtx(() => [
61
- createTextVNode(toDisplayString(__props.loading ? __props.loadingLabel : __props.confirmLabel), 1)
102
+ createTextVNode(toDisplayString(busy.value ? __props.loadingLabel ?? unref(text).loading : __props.confirmLabel ?? unref(text).confirm), 1)
62
103
  ]),
63
104
  _: 1
64
105
  }, 8, ["variant", "disabled"])
65
106
  ]),
66
107
  default: withCtx(() => [
67
- renderSlot(_ctx.$slots, "default")
108
+ renderSlot(_ctx.$slots, "default"),
109
+ error.value ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(error.value), 1)) : createCommentVNode("", true)
68
110
  ]),
69
111
  _: 2
70
112
  }, [
@@ -0,0 +1,49 @@
1
+ import { defineComponent, computed, ref, watch, openBlock, createBlock, createCommentVNode } from "vue";
2
+ import { confirmQueue, settleConfirm } from "../components/confirm.js";
3
+ import { _ as _sfc_main$1 } from "./LpConfirmDialog-CIUOSnWo.js";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "LpConfirmHost",
6
+ props: {
7
+ glass: { type: Boolean, default: void 0 }
8
+ },
9
+ setup(__props) {
10
+ const current = computed(() => confirmQueue[0]);
11
+ const open = ref(false);
12
+ let confirmed = false;
13
+ const answer = (value) => confirmed = value;
14
+ watch(
15
+ () => current.value?.id,
16
+ (id) => {
17
+ confirmed = false;
18
+ open.value = id !== void 0;
19
+ },
20
+ { immediate: true }
21
+ );
22
+ function onOpen(value) {
23
+ open.value = value;
24
+ const request = current.value;
25
+ if (!value && request) settleConfirm(request.id, confirmed);
26
+ }
27
+ return (_ctx, _cache) => {
28
+ return current.value ? (openBlock(), createBlock(_sfc_main$1, {
29
+ key: current.value.id,
30
+ open: open.value,
31
+ glass: __props.glass,
32
+ title: current.value.title,
33
+ description: current.value.description,
34
+ danger: current.value.danger,
35
+ icon: current.value.icon,
36
+ "confirm-label": current.value.confirmLabel,
37
+ "cancel-label": current.value.cancelLabel,
38
+ "loading-label": current.value.loadingLabel,
39
+ action: current.value.action,
40
+ onConfirm: _cache[0] || (_cache[0] = ($event) => answer(true)),
41
+ onCancel: _cache[1] || (_cache[1] = ($event) => answer(false)),
42
+ "onUpdate:open": onOpen
43
+ }, null, 8, ["open", "glass", "title", "description", "danger", "icon", "confirm-label", "cancel-label", "loading-label", "action"])) : createCommentVNode("", true);
44
+ };
45
+ }
46
+ });
47
+ export {
48
+ _sfc_main as _
49
+ };
@@ -0,0 +1,68 @@
1
+ import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createVNode, renderSlot, normalizeClass, createCommentVNode } from "vue";
2
+ import { ContextMenuRoot, ContextMenuTrigger, ContextMenuPortal, ContextMenuContent } from "reka-ui";
3
+ import { _ as _sfc_main$1 } from "./ContextMenuItems-CrfeNPWT.js";
4
+ import { POPOVER_PANEL } from "../components/dropdown.js";
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "LpContextMenu",
7
+ props: {
8
+ items: {},
9
+ always: { type: Boolean }
10
+ },
11
+ setup(__props) {
12
+ const props = __props;
13
+ const enabled = computed(() => props.always || props.items.length > 0);
14
+ const PANEL = `${POPOVER_PANEL} z-(--z-popover) min-w-48 p-1 outline-none`;
15
+ const SELECTABLE = /* @__PURE__ */ new Set(["text", "search", "url", "tel", "password"]);
16
+ let field = null;
17
+ function rememberField() {
18
+ const el = document.activeElement;
19
+ const text = el instanceof HTMLTextAreaElement || el instanceof HTMLInputElement && SELECTABLE.has(el.type);
20
+ field = text ? { el, value: el.value, start: el.selectionStart ?? 0, end: el.selectionEnd ?? 0 } : null;
21
+ }
22
+ function returnFocus(event) {
23
+ const saved = field;
24
+ field = null;
25
+ if (!saved || !saved.el.isConnected) return;
26
+ event.preventDefault();
27
+ saved.el.focus();
28
+ if (saved.el.value === saved.value) saved.el.setSelectionRange(saved.start, saved.end);
29
+ }
30
+ return (_ctx, _cache) => {
31
+ return openBlock(), createBlock(unref(ContextMenuRoot), null, {
32
+ default: withCtx(() => [
33
+ createVNode(unref(ContextMenuTrigger), {
34
+ "as-child": "",
35
+ disabled: !enabled.value,
36
+ onContextmenuCapture: rememberField
37
+ }, {
38
+ default: withCtx(() => [
39
+ renderSlot(_ctx.$slots, "default")
40
+ ]),
41
+ _: 3
42
+ }, 8, ["disabled"]),
43
+ __props.items.length ? (openBlock(), createBlock(unref(ContextMenuPortal), { key: 0 }, {
44
+ default: withCtx(() => [
45
+ createVNode(unref(ContextMenuContent), {
46
+ class: normalizeClass(PANEL),
47
+ onCloseAutoFocus: returnFocus
48
+ }, {
49
+ default: withCtx(() => [
50
+ createVNode(_sfc_main$1, {
51
+ items: __props.items,
52
+ panel: PANEL
53
+ }, null, 8, ["items"])
54
+ ]),
55
+ _: 1
56
+ })
57
+ ]),
58
+ _: 1
59
+ })) : createCommentVNode("", true)
60
+ ]),
61
+ _: 3
62
+ });
63
+ };
64
+ }
65
+ });
66
+ export {
67
+ _sfc_main as _
68
+ };
@@ -0,0 +1,191 @@
1
+ import { defineComponent, ref, computed, useAttrs, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, createVNode, withCtx, createElementVNode, mergeProps, toDisplayString, createCommentVNode } from "vue";
2
+ import { PopoverRoot, PopoverTrigger, PopoverPortal, PopoverContent } from "reka-ui";
3
+ import { useFieldControl } from "../composables/useField.js";
4
+ import { useLabels } from "../composables/useLpConfig.js";
5
+ import { mergeClass } from "../composables/useMergedClass.js";
6
+ import { POPOVER_PANEL } from "../components/dropdown.js";
7
+ import { _ as _sfc_main$2 } from "./LpCalendar-B7Ko5RdR.js";
8
+ import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
9
+ import { _ as _sfc_main$3 } from "./LpTimeField-C5HRgS5H.js";
10
+ const _hoisted_1 = ["id", "disabled", "aria-invalid", "aria-describedby"];
11
+ const _hoisted_2 = {
12
+ key: 0,
13
+ class: "w-[15px] shrink-0",
14
+ "aria-hidden": "true"
15
+ };
16
+ const _hoisted_3 = {
17
+ key: 0,
18
+ class: "flex items-center gap-2 border-t border-line px-3 py-2"
19
+ };
20
+ const _hoisted_4 = ["aria-label"];
21
+ const __default__ = { inheritAttrs: false };
22
+ const _sfc_main = /* @__PURE__ */ defineComponent({
23
+ ...__default__,
24
+ __name: "LpDatePicker",
25
+ props: {
26
+ modelValue: {},
27
+ placeholder: { default: "Pick a date" },
28
+ min: {},
29
+ max: {},
30
+ isDisabled: {},
31
+ clearable: { type: Boolean },
32
+ disabled: { type: Boolean },
33
+ invalid: { type: Boolean },
34
+ size: { default: "md" },
35
+ format: { default: () => ({ year: "numeric", month: "short", day: "numeric" }) },
36
+ time: { type: Boolean },
37
+ defaultTime: { default: "00:00" },
38
+ doneLabel: { default: "Done" }
39
+ },
40
+ emits: ["update:modelValue"],
41
+ setup(__props, { emit: __emit }) {
42
+ const props = __props;
43
+ const emit = __emit;
44
+ const open = ref(false);
45
+ const day = computed(() => (props.modelValue || "").slice(0, 10));
46
+ const minute = computed(() => {
47
+ const at = (props.modelValue || "").slice(11, 16);
48
+ return /^\d{2}:\d{2}$/.test(at) ? at : "";
49
+ });
50
+ const display = computed(() => {
51
+ if (!props.modelValue) return "";
52
+ const [y, m, d] = day.value.split("-").map(Number);
53
+ if (!y || !m || !d) return props.modelValue;
54
+ const shown = new Intl.DateTimeFormat(void 0, props.format).format(new Date(y, m - 1, d));
55
+ return props.time && minute.value ? `${shown}, ${minute.value}` : shown;
56
+ });
57
+ const shellSize = {
58
+ sm: "h-(--size-control-sm) text-xs",
59
+ md: "h-(--size-control-md) text-sm",
60
+ lg: "h-(--size-control-lg) text-sm"
61
+ };
62
+ function onPick(picked) {
63
+ const v = picked ?? (day.value || void 0);
64
+ if (!props.time) {
65
+ emit("update:modelValue", v);
66
+ open.value = false;
67
+ return;
68
+ }
69
+ emit("update:modelValue", v ? `${v}T${minute.value || props.defaultTime}` : void 0);
70
+ }
71
+ function onTime(at) {
72
+ if (!day.value) return;
73
+ emit("update:modelValue", `${day.value}T${at || props.defaultTime}`);
74
+ }
75
+ function clear() {
76
+ emit("update:modelValue", void 0);
77
+ }
78
+ const attrs = useAttrs();
79
+ const field = useFieldControl(() => ({
80
+ wrapped: false,
81
+ id: typeof attrs.id === "string" ? attrs.id : void 0,
82
+ invalid: props.invalid,
83
+ disabled: props.disabled
84
+ }));
85
+ const labels = useLabels("datePicker", { clear: "Clear" });
86
+ const showClear = computed(() => props.clearable && !!props.modelValue && !field.value.disabled);
87
+ return (_ctx, _cache) => {
88
+ return openBlock(), createElementBlock("div", {
89
+ class: normalizeClass(unref(mergeClass)("relative w-full", unref(attrs).class)),
90
+ style: normalizeStyle(unref(attrs).style)
91
+ }, [
92
+ createVNode(unref(PopoverRoot), {
93
+ open: open.value,
94
+ "onUpdate:open": _cache[2] || (_cache[2] = ($event) => open.value = $event)
95
+ }, {
96
+ default: withCtx(() => [
97
+ createVNode(unref(PopoverTrigger), { "as-child": "" }, {
98
+ default: withCtx(() => [
99
+ createElementVNode("button", mergeProps({ ...unref(attrs), class: void 0, style: void 0 }, {
100
+ id: unref(field).id,
101
+ type: "button",
102
+ disabled: unref(field).disabled,
103
+ "aria-invalid": unref(field).invalid || void 0,
104
+ "aria-describedby": unref(field).describedBy,
105
+ class: ["group flex w-full items-center gap-2 rounded-control border bg-surface-soft px-3 text-left text-ink outline-none transition-colors duration-[var(--duration-fast)] focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:border-brand disabled:cursor-not-allowed disabled:opacity-55", [
106
+ shellSize[__props.size],
107
+ unref(field).invalid ? "border-danger focus-visible:ring-danger-soft" : "border-line focus-visible:border-brand"
108
+ ]]
109
+ }), [
110
+ createVNode(_sfc_main$1, {
111
+ name: "lucide:calendar",
112
+ size: 16,
113
+ class: "shrink-0 text-muted"
114
+ }),
115
+ createElementVNode("span", {
116
+ class: normalizeClass(["min-w-0 flex-1 truncate", display.value ? "" : "text-muted"])
117
+ }, toDisplayString(display.value || __props.placeholder), 3),
118
+ showClear.value ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("", true),
119
+ createVNode(_sfc_main$1, {
120
+ name: "lucide:chevron-down",
121
+ size: 15,
122
+ class: "shrink-0 text-muted transition-transform duration-[var(--duration-fast)] ease-[var(--ease-emphasized)] group-data-[state=open]:rotate-180"
123
+ })
124
+ ], 16, _hoisted_1)
125
+ ]),
126
+ _: 1
127
+ }),
128
+ createVNode(unref(PopoverPortal), null, {
129
+ default: withCtx(() => [
130
+ createVNode(unref(PopoverContent), {
131
+ "side-offset": 6,
132
+ align: "start",
133
+ class: normalizeClass([unref(POPOVER_PANEL), "z-(--z-popover) rounded-card p-0 outline-none"])
134
+ }, {
135
+ default: withCtx(() => [
136
+ createVNode(_sfc_main$2, {
137
+ "model-value": day.value,
138
+ min: __props.min,
139
+ max: __props.max,
140
+ "is-disabled": __props.isDisabled,
141
+ class: "border-0 bg-transparent",
142
+ "onUpdate:modelValue": onPick
143
+ }, null, 8, ["model-value", "min", "max", "is-disabled"]),
144
+ __props.time ? (openBlock(), createElementBlock("div", _hoisted_3, [
145
+ createVNode(_sfc_main$1, {
146
+ name: "lucide:clock",
147
+ size: 15,
148
+ class: "shrink-0 text-muted"
149
+ }),
150
+ createVNode(_sfc_main$3, {
151
+ "model-value": minute.value || void 0,
152
+ disabled: !day.value,
153
+ icon: false,
154
+ size: "sm",
155
+ class: "flex-1",
156
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = (at) => onTime(at || ""))
157
+ }, null, 8, ["model-value", "disabled"]),
158
+ createElementVNode("button", {
159
+ type: "button",
160
+ class: "shrink-0 rounded-control px-2 py-1 text-xs text-muted transition-colors hover:text-ink",
161
+ onClick: _cache[1] || (_cache[1] = ($event) => open.value = false)
162
+ }, toDisplayString(__props.doneLabel), 1)
163
+ ])) : createCommentVNode("", true)
164
+ ]),
165
+ _: 1
166
+ }, 8, ["class"])
167
+ ]),
168
+ _: 1
169
+ })
170
+ ]),
171
+ _: 1
172
+ }, 8, ["open"]),
173
+ showClear.value ? (openBlock(), createElementBlock("button", {
174
+ key: 0,
175
+ type: "button",
176
+ "aria-label": unref(labels).clear,
177
+ class: "absolute top-1/2 right-[calc(0.75rem+15px+0.5rem)] flex -translate-y-1/2 items-center rounded-sm text-muted outline-none transition-colors hover:text-ink focus-visible:ring-2 focus-visible:ring-ring",
178
+ onClick: clear
179
+ }, [
180
+ createVNode(_sfc_main$1, {
181
+ name: "lucide:x",
182
+ size: 15
183
+ })
184
+ ], 8, _hoisted_4)) : createCommentVNode("", true)
185
+ ], 6);
186
+ };
187
+ }
188
+ });
189
+ export {
190
+ _sfc_main as _
191
+ };
@@ -1,7 +1,8 @@
1
- import { ref, defineComponent, computed, watch, onBeforeUnmount, useSlots, openBlock, createElementBlock, Fragment, withDirectives, createElementVNode, normalizeStyle, unref, normalizeClass, vShow, toDisplayString, createCommentVNode, renderSlot, createVNode, withCtx, createBlock, createTextVNode } from "vue";
2
- import { DrawerRoot, DrawerPortal, DrawerOverlay, DrawerContent, DrawerHandle, DrawerTitle, DrawerDescription, DrawerClose } from "vaul-vue";
1
+ import { ref, defineComponent, computed, watch, onBeforeUnmount, useSlots, openBlock, createElementBlock, Fragment, withDirectives, createElementVNode, normalizeStyle, unref, normalizeClass, vShow, toDisplayString, createCommentVNode, renderSlot, createVNode, withCtx, mergeProps, createBlock, createTextVNode } from "vue";
2
+ import { DrawerRoot, DrawerPortal, DrawerOverlay, DrawerContent, DrawerTitle, DrawerHandle, DrawerDescription, DrawerClose } from "vaul-vue";
3
3
  import { CLOSE_ICON } from "../components/dropdown.js";
4
4
  import { useGlass } from "../composables/useGlass.js";
5
+ import { useLabels } from "../composables/useLpConfig.js";
5
6
  import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
6
7
  import { _ as _sfc_main$2 } from "./LpScrollArea-D8xyKXcF.js";
7
8
  import { useModalLayer, anyModalOpen } from "../components/modalDepth.js";
@@ -9,10 +10,11 @@ const _hoisted_1 = { class: "text-base font-semibold text-ink" };
9
10
  const _hoisted_2 = { class: "flex flex-col gap-1" };
10
11
  const _hoisted_3 = ["data-vaul-no-drag"];
11
12
  const _hoisted_4 = {
12
- key: 3,
13
+ key: 4,
13
14
  class: "flex justify-end gap-2 px-5 pb-5 pt-4"
14
15
  };
15
- const edgeOwner = ref(null);
16
+ const EDGE_KEY = /* @__PURE__ */ Symbol.for("@leavepulse/ui:drawer-edge-owner");
17
+ const edgeOwner = globalThis[EDGE_KEY] ??= ref(null);
16
18
  const _sfc_main = /* @__PURE__ */ defineComponent({
17
19
  __name: "LpDrawer",
18
20
  props: {
@@ -38,19 +40,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
40
  resizable: { type: Boolean },
39
41
  minSize: { default: "22rem" },
40
42
  maxSize: { default: "96vw" },
41
- glass: { type: Boolean, default: void 0 }
43
+ glass: { type: Boolean, default: void 0 },
44
+ ariaLabel: {},
45
+ labels: {}
42
46
  },
43
47
  emits: ["update:open"],
44
48
  setup(__props, { emit: __emit }) {
45
49
  const props = __props;
46
50
  const frosted = useGlass(() => props.glass);
51
+ const text = useLabels("drawer", { close: "Close" }, () => props.labels);
47
52
  const emit = __emit;
48
53
  const dir = computed(() => props.direction ?? props.side ?? "right");
49
54
  const isHorizontal = computed(() => dir.value === "left" || dir.value === "right");
50
55
  const isSheet = computed(() => dir.value === "top" || dir.value === "bottom");
51
56
  const showHandle = computed(() => props.handle ?? isSheet.value);
52
57
  const SIZES = { sm: 22, md: 28, lg: 36, xl: 48 };
53
- const { claim, release, layer } = useModalLayer();
58
+ const contentRef = ref(null);
59
+ const { claim, release, layer } = useModalLayer({ element: () => contentRef.value?.$el });
54
60
  watch(() => props.open, (open) => open ? claim() : release(), { immediate: true });
55
61
  onBeforeUnmount(release);
56
62
  const contentClass = computed(() => {
@@ -73,32 +79,50 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
73
79
  const len = props.width ?? `min(${isHorizontal.value ? "94vw" : "94vh"}, ${SIZES[props.size]}rem)`;
74
80
  return isHorizontal.value ? { width: len } : { height: len };
75
81
  });
82
+ function toPx(css) {
83
+ const n = Number.parseFloat(css);
84
+ if (css.endsWith("rem")) {
85
+ const root = typeof document === "undefined" ? 16 : Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
86
+ return n * root;
87
+ }
88
+ if (css.endsWith("vw")) return n / 100 * window.innerWidth;
89
+ if (css.endsWith("vh")) return n / 100 * window.innerHeight;
90
+ if (css.endsWith("px") || /^[\d.]+$/.test(css.trim())) return n;
91
+ return Number.NaN;
92
+ }
93
+ let endResize = null;
76
94
  function startResize(e) {
77
95
  if (!props.resizable || !isHorizontal.value) return;
78
96
  e.preventDefault();
97
+ endResize?.();
98
+ const grip = e.currentTarget instanceof HTMLElement ? e.currentTarget : null;
99
+ grip?.setPointerCapture(e.pointerId);
79
100
  const fromRight = dir.value === "right";
80
- const toPx = (css) => {
81
- if (css.endsWith("rem")) return Number.parseFloat(css) * 16;
82
- if (css.endsWith("vw")) return Number.parseFloat(css) / 100 * window.innerWidth;
83
- return Number.parseFloat(css);
84
- };
85
101
  const min = toPx(props.minSize);
86
102
  const max = toPx(props.maxSize);
87
103
  const onMove = (ev) => {
104
+ if (ev.pointerId !== e.pointerId) return;
88
105
  const raw = fromRight ? window.innerWidth - ev.clientX : ev.clientX;
89
- resizedPx.value = Math.max(min, Math.min(max, raw));
106
+ resizedPx.value = Math.max(Number.isNaN(min) ? 0 : min, Math.min(Number.isNaN(max) ? Infinity : max, raw));
90
107
  };
91
- const onUp = () => {
108
+ const end = () => {
92
109
  window.removeEventListener("pointermove", onMove);
93
- window.removeEventListener("pointerup", onUp);
110
+ window.removeEventListener("pointerup", end);
111
+ window.removeEventListener("pointercancel", end);
112
+ grip?.removeEventListener("lostpointercapture", end);
94
113
  document.body.style.userSelect = "";
95
114
  document.body.style.cursor = "";
115
+ endResize = null;
96
116
  };
117
+ endResize = end;
97
118
  document.body.style.userSelect = "none";
98
119
  document.body.style.cursor = "ew-resize";
99
120
  window.addEventListener("pointermove", onMove);
100
- window.addEventListener("pointerup", onUp);
121
+ window.addEventListener("pointerup", end);
122
+ window.addEventListener("pointercancel", end);
123
+ grip?.addEventListener("lostpointercapture", end);
101
124
  }
125
+ onBeforeUnmount(() => endResize?.());
102
126
  const slots = useSlots();
103
127
  const hasHeader = computed(() => Boolean(props.title || slots.title));
104
128
  const padClass = computed(() => {
@@ -134,8 +158,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
134
158
  );
135
159
  function panelPx() {
136
160
  const vw = typeof window === "undefined" ? 0 : window.innerWidth;
137
- const cap = props.width ? Number.parseFloat(props.width) : SIZES[props.size] * 16;
138
- return Math.min(vw * 0.94, Number.isFinite(cap) ? cap : SIZES[props.size] * 16);
161
+ const preset = toPx(`${SIZES[props.size]}rem`);
162
+ const cap = props.width ? toPx(props.width) : preset;
163
+ return Math.min(vw * 0.94, Number.isFinite(cap) ? cap : preset);
139
164
  }
140
165
  function edgeEnabled() {
141
166
  if (!props.edgeOpen || !isHorizontal.value || props.open || handingOff.value) return false;
@@ -313,11 +338,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
313
338
  style: normalizeStyle({ zIndex: unref(layer).scrim }),
314
339
  class: normalizeClass(["lp-scrim fixed inset-0 z-(--z-overlay) data-[state=open]:animate-[fade-in_150ms_ease] data-[state=closed]:animate-[fade-out_130ms_ease]", { "lp-scrim--light": unref(frosted), "lp-scrim--nested": unref(layer).nested }])
315
340
  }, null, 8, ["style", "class"]),
316
- createVNode(unref(DrawerContent), {
317
- class: normalizeClass(contentClass.value),
318
- style: normalizeStyle([sizeStyle.value, { zIndex: unref(layer).panel }]),
341
+ createVNode(unref(DrawerContent), mergeProps({
342
+ ref_key: "contentRef",
343
+ ref: contentRef
344
+ }, __props.description ? {} : { "aria-describedby": void 0 }, {
345
+ class: contentClass.value,
346
+ style: [sizeStyle.value, { zIndex: unref(layer).panel }],
319
347
  "data-vaul-animate": handingOff.value || skipOpenSlide.value ? "false" : void 0
320
- }, {
348
+ }), {
321
349
  default: withCtx(() => [
322
350
  __props.resizable && isHorizontal.value ? (openBlock(), createElementBlock("div", {
323
351
  key: 0,
@@ -329,12 +357,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
329
357
  class: normalizeClass(["absolute inset-y-0 w-px bg-line transition-colors group-hover/resize:bg-brand", dir.value === "right" ? "left-0" : "right-0"])
330
358
  }, null, 2)
331
359
  ], 34)) : createCommentVNode("", true),
332
- showHandle.value ? (openBlock(), createBlock(unref(DrawerHandle), {
360
+ !hasHeader.value && __props.ariaLabel ? (openBlock(), createBlock(unref(DrawerTitle), {
333
361
  key: 1,
362
+ class: "sr-only"
363
+ }, {
364
+ default: withCtx(() => [
365
+ createTextVNode(toDisplayString(__props.ariaLabel), 1)
366
+ ]),
367
+ _: 1
368
+ })) : createCommentVNode("", true),
369
+ showHandle.value ? (openBlock(), createBlock(unref(DrawerHandle), {
370
+ key: 2,
334
371
  class: "mx-auto my-2 h-1.5 w-12 shrink-0 cursor-grab rounded-pill bg-line-strong transition-colors hover:bg-muted active:cursor-grabbing"
335
372
  })) : createCommentVNode("", true),
336
373
  hasHeader.value ? (openBlock(), createElementBlock("header", {
337
- key: 2,
374
+ key: 3,
338
375
  class: normalizeClass(["flex items-start justify-between gap-4", headerClass.value])
339
376
  }, [
340
377
  createElementVNode("div", _hoisted_2, [
@@ -358,7 +395,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
358
395
  ]),
359
396
  createVNode(unref(DrawerClose), {
360
397
  class: "group flex shrink-0 items-center rounded-md p-1 text-muted outline-none transition-colors duration-[var(--duration-fast)] hover:text-ink focus-visible:ring-2 focus-visible:ring-ring",
361
- "aria-label": "Close"
398
+ "aria-label": unref(text).close
362
399
  }, {
363
400
  default: withCtx(() => [
364
401
  createVNode(_sfc_main$1, {
@@ -368,7 +405,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
368
405
  }, null, 8, ["class"])
369
406
  ]),
370
407
  _: 1
371
- })
408
+ }, 8, ["aria-label"])
372
409
  ], 2)) : createCommentVNode("", true),
373
410
  withDirectives((openBlock(), createElementBlock("div", {
374
411
  class: "flex min-h-0 min-w-0 flex-1 flex-col [-webkit-user-select:text]! [user-select:text]!",
@@ -391,7 +428,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
391
428
  ])) : createCommentVNode("", true)
392
429
  ]),
393
430
  _: 3
394
- }, 8, ["class", "style", "data-vaul-animate"])
431
+ }, 16, ["class", "style", "data-vaul-animate"])
395
432
  ]),
396
433
  _: 3
397
434
  })