@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,7 +1,8 @@
1
- import { defineComponent, useSlots, computed, ref, watch, nextTick, openBlock, createBlock, Teleport, createVNode, Transition, withCtx, createElementBlock, normalizeStyle, normalizeClass, createElementVNode, createCommentVNode, renderSlot, toDisplayString, Fragment, renderList, createTextVNode, unref } from "vue";
1
+ import { defineComponent, useSlots, computed, ref, watch, onBeforeUnmount, openBlock, createBlock, Teleport, createVNode, Transition, withCtx, createElementBlock, normalizeStyle, normalizeClass, createElementVNode, createCommentVNode, renderSlot, toDisplayString, Fragment, renderList, createTextVNode, unref } from "vue";
2
+ import { useLabels } from "../composables/useLpConfig.js";
2
3
  import { useBarStack } from "../components/actionBar.js";
3
4
  import { CLOSE_ICON } from "../components/dropdown.js";
4
- import { _ as _sfc_main$2 } from "./LpButton-5VXXCjwF.js";
5
+ import { _ as _sfc_main$2 } from "./LpButton-kqJBHIIb.js";
5
6
  import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
6
7
  const _hoisted_1 = ["aria-label"];
7
8
  const _hoisted_2 = {
@@ -21,6 +22,7 @@ const _hoisted_5 = {
21
22
  class: "flex-1"
22
23
  };
23
24
  const _hoisted_6 = { class: "flex shrink-0 items-center gap-2" };
25
+ const _hoisted_7 = ["aria-label"];
24
26
  const _sfc_main = /* @__PURE__ */ defineComponent({
25
27
  __name: "LpActionBar",
26
28
  props: {
@@ -33,13 +35,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
33
35
  variant: { default: "default" },
34
36
  width: { default: "contained" },
35
37
  maxWidth: {},
36
- ariaLabel: {}
38
+ ariaLabel: {},
39
+ labels: {}
37
40
  },
38
41
  emits: ["update:open", "dismiss"],
39
42
  setup(__props, { emit: __emit }) {
40
43
  const props = __props;
41
44
  const emit = __emit;
42
45
  const slots = useSlots();
46
+ const text = useLabels("actionBar", { dismiss: "Dismiss" }, () => props.labels);
43
47
  const resolvedActions = computed(
44
48
  () => props.actions.map((a, i) => ({
45
49
  ...a,
@@ -62,19 +66,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
62
66
  void bars.value;
63
67
  return offset();
64
68
  });
69
+ let observer = null;
65
70
  watch(
66
71
  () => props.open,
67
- async (isOpen) => {
72
+ (isOpen) => {
73
+ if (typeof window === "undefined") return;
68
74
  if (!isOpen) {
69
75
  unregister();
70
76
  return;
71
77
  }
72
78
  register();
73
- await nextTick();
74
- if (root.value) setHeight(root.value.getBoundingClientRect().height);
75
79
  },
76
80
  { immediate: true }
77
81
  );
82
+ watch(root, (el) => {
83
+ observer?.disconnect();
84
+ observer = null;
85
+ if (!el) return;
86
+ setHeight(el.getBoundingClientRect().height);
87
+ if (typeof ResizeObserver === "undefined") return;
88
+ observer = new ResizeObserver(() => setHeight(el.getBoundingClientRect().height));
89
+ observer.observe(el);
90
+ });
91
+ onBeforeUnmount(() => observer?.disconnect());
78
92
  return (_ctx, _cache) => {
79
93
  return openBlock(), createBlock(Teleport, { to: "body" }, [
80
94
  createVNode(Transition, {
@@ -88,8 +102,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
88
102
  ref: root,
89
103
  role: "region",
90
104
  "aria-label": __props.ariaLabel ?? __props.title,
91
- class: normalizeClass(["pointer-events-none fixed inset-x-0 bottom-0 z-(--z-modal) flex justify-center transition-[translate] duration-[var(--duration-medium)] ease-[var(--ease-emphasized)] motion-reduce:transition-none", __props.width === "full" ? "" : "p-3 sm:p-4"]),
92
- style: normalizeStyle({ translate: `0 -${stackOffset.value}px` })
105
+ class: normalizeClass(["pointer-events-none fixed inset-x-0 bottom-0 flex justify-center transition-[translate] duration-[var(--duration-medium)] ease-[var(--ease-emphasized)] motion-reduce:transition-none", __props.width === "full" ? "" : "p-3 sm:p-4"]),
106
+ style: normalizeStyle({ translate: `0 -${stackOffset.value}px`, zIndex: "calc(var(--z-overlay) - 1)" })
93
107
  }, [
94
108
  createElementVNode("div", {
95
109
  class: normalizeClass(["lp-skin-panel pointer-events-auto flex items-center gap-3 border-solid bg-surface-overlay", [
@@ -147,7 +161,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
147
161
  __props.dismissible ? (openBlock(), createElementBlock("button", {
148
162
  key: 0,
149
163
  type: "button",
150
- "aria-label": "Dismiss",
164
+ "aria-label": unref(text).dismiss,
151
165
  class: "group -mr-1 flex size-8 shrink-0 items-center justify-center rounded-control text-muted outline-none transition-colors duration-[var(--duration-fast)] hover:text-ink focus-visible:ring-2 focus-visible:ring-ring",
152
166
  onClick: dismiss
153
167
  }, [
@@ -156,7 +170,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
156
170
  size: 16,
157
171
  class: normalizeClass(unref(CLOSE_ICON))
158
172
  }, null, 8, ["class"])
159
- ])) : createCommentVNode("", true)
173
+ ], 8, _hoisted_7)) : createCommentVNode("", true)
160
174
  ])
161
175
  ], 4)
162
176
  ], 6)
@@ -1,13 +1,14 @@
1
- import { defineComponent, defineAsyncComponent, computed, ref, onMounted, watch, openBlock, createElementBlock, mergeProps, unref, createVNode, withCtx, createElementVNode, createBlock, createCommentVNode, createTextVNode, toDisplayString, renderSlot, normalizeClass } from "vue";
1
+ import { defineComponent, defineAsyncComponent, computed, watch, ref, onMounted, openBlock, createElementBlock, mergeProps, unref, createVNode, withCtx, createElementVNode, createBlock, createCommentVNode, createTextVNode, toDisplayString, renderSlot, normalizeClass } from "vue";
2
+ import { useAsyncTask } from "../composables/useAsyncTask.js";
2
3
  import { OSM_TILES, createNominatimProvider, emptyAddress, formatAddress } from "../components/address.js";
3
4
  import { flagEmoji, loadCountries } from "../components/countries.js";
4
- import { _ as _sfc_main$2 } from "./LpAutocomplete-DExlIZe_.js";
5
- import { _ as _sfc_main$3 } from "./LpButton-5VXXCjwF.js";
6
- import { _ as _sfc_main$1 } from "./LpFormField-CazBc2-a.js";
5
+ import { _ as _sfc_main$2 } from "./LpAutocomplete-DxV3Y9h4.js";
6
+ import { _ as _sfc_main$3 } from "./LpButton-kqJBHIIb.js";
7
+ import { _ as _sfc_main$1 } from "./LpFormField-CIk5qosh.js";
7
8
  import { _ as _sfc_main$4 } from "./LpIcon-CCnX5_2j.js";
8
- import { _ as _sfc_main$5 } from "./LpInput-9EXWUM9B.js";
9
- import { _ as _sfc_main$7 } from "./LpModal-Bt0pQCI_.js";
10
- import { _ as _sfc_main$6 } from "./LpSelect-ANIVtrpM.js";
9
+ import { _ as _sfc_main$5 } from "./LpInput-C0e8y8_d.js";
10
+ import { _ as _sfc_main$7 } from "./LpModal-DPwGKBPv.js";
11
+ import { _ as _sfc_main$6 } from "./LpSelect-DrRD9I7L.js";
11
12
  import { useMergedAttrs } from "../composables/useMergedClass.js";
12
13
  const _hoisted_1 = { class: "flex items-stretch gap-2" };
13
14
  const _hoisted_2 = { class: "grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]" };
@@ -67,10 +68,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
67
68
  const fallbackProvider = createNominatimProvider();
68
69
  const geocoder = computed(() => props.provider ?? fallbackProvider);
69
70
  const value = computed(() => props.modelValue ?? emptyAddress());
71
+ let latest;
72
+ watch(
73
+ () => props.modelValue,
74
+ () => latest = void 0
75
+ );
70
76
  function patch(changes) {
71
- emit("update:modelValue", { ...value.value, ...changes });
77
+ latest = { ...latest ?? value.value, ...changes };
78
+ emit("update:modelValue", latest);
79
+ }
80
+ function edit(changes) {
81
+ patch({ ...changes, lat: void 0, lon: void 0 });
72
82
  }
73
- const countries = ref([]);
83
+ const allCountries = ref([]);
84
+ const countries = computed(() => {
85
+ const only = props.only?.map((code) => code.toUpperCase());
86
+ return only?.length ? allCountries.value.filter((c) => only.includes(c.iso2)) : allCountries.value;
87
+ });
74
88
  const countryOptions = computed(
75
89
  () => countries.value.map((country) => ({
76
90
  value: country.iso2,
@@ -78,40 +92,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
78
92
  }))
79
93
  );
80
94
  onMounted(async () => {
81
- const list = await loadCountries();
82
- const only = props.only?.map((code) => code.toUpperCase());
83
- countries.value = only?.length ? list.filter((c) => only.includes(c.iso2)) : list;
95
+ allCountries.value = await loadCountries();
84
96
  });
85
97
  function useSuggestions(field) {
86
98
  const options = ref([]);
87
- const loading = ref(false);
88
- let timer;
89
- let controller;
99
+ const task = useAsyncTask();
90
100
  function query(term) {
91
- if (timer) clearTimeout(timer);
92
- controller?.abort();
93
101
  if (term.trim().length < props.minChars) {
102
+ task.cancel();
94
103
  options.value = [];
95
- loading.value = false;
96
104
  return;
97
105
  }
98
- loading.value = true;
99
- timer = setTimeout(async () => {
100
- controller = new AbortController();
101
- try {
102
- options.value = await geocoder.value.search(term.trim(), field, {
103
- country: value.value.country || void 0,
104
- language: props.language,
105
- signal: controller.signal
106
- });
107
- } catch {
108
- options.value = [];
109
- } finally {
110
- loading.value = false;
106
+ task.run(
107
+ (signal) => geocoder.value.search(term.trim(), field, {
108
+ country: value.value.country || void 0,
109
+ language: props.language,
110
+ signal
111
+ }),
112
+ {
113
+ delay: props.debounce,
114
+ apply: (found) => options.value = found,
115
+ // Network failure: leave the field usable as free text.
116
+ fail: () => options.value = []
111
117
  }
112
- }, props.debounce);
118
+ );
113
119
  }
114
- return { options, loading, query };
120
+ return { options, loading: task.pending, query };
115
121
  }
116
122
  const lineSuggestions = useSuggestions("line");
117
123
  const citySuggestions = useSuggestions("city");
@@ -159,19 +165,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
159
165
  point.value = value.value.lat != null && value.value.lon != null ? { lat: value.value.lat, lon: value.value.lon } : void 0;
160
166
  resolved.value = void 0;
161
167
  });
162
- async function onPick(next) {
168
+ const reverse = useAsyncTask();
169
+ watch(reverse.pending, (busy) => resolving.value = busy);
170
+ function onPick(next) {
163
171
  point.value = next;
164
- resolving.value = true;
165
172
  resolved.value = void 0;
166
- try {
167
- resolved.value = await geocoder.value.reverse(next.lat, next.lon, {
168
- language: props.language
169
- });
170
- } catch {
171
- resolved.value = void 0;
172
- } finally {
173
- resolving.value = false;
174
- }
173
+ reverse.run(
174
+ () => geocoder.value.reverse(next.lat, next.lon, { language: props.language }),
175
+ {
176
+ apply: (found) => resolved.value = found,
177
+ fail: () => resolved.value = void 0
178
+ }
179
+ );
175
180
  }
176
181
  function confirmPoint() {
177
182
  if (!point.value) return;
@@ -211,7 +216,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
211
216
  "loading-text": text.value.searching,
212
217
  icon: "lucide:map-pin",
213
218
  "onUpdate:modelValue": _cache[0] || (_cache[0] = (next) => {
214
- patch({ line: next });
219
+ edit({ line: next });
215
220
  unref(lineSuggestions).query(next);
216
221
  }),
217
222
  onSelect: onLineSelect
@@ -265,7 +270,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
265
270
  "empty-text": text.value.noSuggestions,
266
271
  "loading-text": text.value.searching,
267
272
  "onUpdate:modelValue": _cache[3] || (_cache[3] = (next) => {
268
- patch({ city: next });
273
+ edit({ city: next });
269
274
  unref(citySuggestions).query(next);
270
275
  }),
271
276
  onSelect: onCitySelect
@@ -280,7 +285,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
280
285
  disabled: __props.disabled,
281
286
  size: __props.size,
282
287
  autocomplete: "postal-code",
283
- "onUpdate:modelValue": _cache[4] || (_cache[4] = (next) => patch({ postalCode: next }))
288
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = (next) => edit({ postalCode: next }))
284
289
  }, null, 8, ["model-value", "label", "placeholder", "disabled", "size"])
285
290
  ]),
286
291
  createVNode(_sfc_main$1, {
@@ -295,7 +300,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
295
300
  disabled: __props.disabled,
296
301
  size: __props.size,
297
302
  searchable: "",
298
- "onUpdate:modelValue": _cache[5] || (_cache[5] = (next) => patch({ country: String(next ?? "") }))
303
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = (next) => edit({ country: String(next ?? "") }))
299
304
  }, null, 8, ["model-value", "options", "placeholder", "search-placeholder", "disabled", "size"])
300
305
  ]),
301
306
  _: 1
@@ -1,8 +1,9 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, createVNode, createElementVNode, toDisplayString, createCommentVNode, renderSlot } from "vue";
2
2
  import { tv } from "tailwind-variants";
3
3
  import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
4
- const _hoisted_1 = { class: "min-w-0" };
5
- const _hoisted_2 = {
4
+ const _hoisted_1 = ["role"];
5
+ const _hoisted_2 = { class: "min-w-0" };
6
+ const _hoisted_3 = {
6
7
  key: 0,
7
8
  class: "font-semibold text-ink"
8
9
  };
@@ -11,7 +12,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
11
12
  props: {
12
13
  variant: { default: "info" },
13
14
  title: {},
14
- icon: {}
15
+ icon: {},
16
+ live: { type: [String, Boolean], default: void 0 }
15
17
  },
16
18
  setup(__props) {
17
19
  const alert = tv({
@@ -39,28 +41,33 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
41
  danger: "text-danger"
40
42
  };
41
43
  const props = __props;
44
+ const role = computed(() => {
45
+ const live = props.live ?? (props.variant === "danger" ? "assertive" : false);
46
+ return live === "assertive" ? "alert" : live === "polite" ? "status" : void 0;
47
+ });
42
48
  const classes = computed(() => alert({ variant: props.variant }));
43
49
  const resolvedIcon = computed(() => props.icon ?? ICONS[props.variant ?? "info"]);
44
50
  const iconTone = computed(() => ICON_TONE[props.variant ?? "info"]);
45
51
  return (_ctx, _cache) => {
46
52
  return openBlock(), createElementBlock("div", {
47
53
  class: normalizeClass(classes.value),
48
- role: "alert"
54
+ role: role.value
49
55
  }, [
50
56
  createVNode(_sfc_main$1, {
51
57
  name: resolvedIcon.value,
52
58
  size: 18,
53
- class: normalizeClass(["mt-0.5 shrink-0", iconTone.value])
59
+ class: normalizeClass(["mt-0.5 shrink-0", iconTone.value]),
60
+ "aria-hidden": "true"
54
61
  }, null, 8, ["name", "class"]),
55
- createElementVNode("div", _hoisted_1, [
56
- __props.title ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
62
+ createElementVNode("div", _hoisted_2, [
63
+ __props.title ? (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
57
64
  createElementVNode("div", {
58
65
  class: normalizeClass(["text-muted-strong", __props.title ? "mt-0.5" : ""])
59
66
  }, [
60
67
  renderSlot(_ctx.$slots, "default")
61
68
  ], 2)
62
69
  ])
63
- ], 2);
70
+ ], 10, _hoisted_1);
64
71
  };
65
72
  }
66
73
  });
@@ -1,14 +1,16 @@
1
- import { defineComponent, computed, watch, openBlock, createElementBlock, mergeProps, unref, createVNode, createSlots, withCtx, renderSlot, normalizeProps, guardReactiveProps, createElementVNode, normalizeClass, toDisplayString, createBlock } from "vue";
2
- import { _ as _sfc_main$2 } from "./LpButton-5VXXCjwF.js";
1
+ import { defineComponent, computed, ref, useId, watch, openBlock, createElementBlock, mergeProps, unref, createElementVNode, withModifiers, toDisplayString, createVNode, createSlots, withCtx, renderSlot, normalizeProps, guardReactiveProps, normalizeClass, createBlock } 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
5
  import { _ as _sfc_main$5 } from "./LpScrollArea-D8xyKXcF.js";
5
6
  import { _ as _sfc_main$4 } from "./LpShift-DXNsauQZ.js";
6
- import { _ as _sfc_main$1 } from "./LpSidebar-ClBUwoEz.js";
7
+ import { _ as _sfc_main$1 } from "./LpSidebar-BgwUNWpJ.js";
7
8
  import { useMergedAttrs } from "../composables/useMergedClass.js";
8
- const _hoisted_1 = { class: "flex min-w-0 flex-1 flex-col" };
9
- const _hoisted_2 = { class: "relative flex h-16 shrink-0 items-center gap-3 border-b border-line bg-surface px-4 md:px-6" };
10
- const _hoisted_3 = { class: "truncate text-lg font-semibold" };
11
- const _hoisted_4 = {
9
+ const _hoisted_1 = ["href"];
10
+ const _hoisted_2 = { class: "flex min-w-0 flex-1 flex-col" };
11
+ const _hoisted_3 = { class: "relative flex h-16 shrink-0 items-center gap-3 border-b border-line bg-surface px-4 md:px-6" };
12
+ const _hoisted_4 = { class: "truncate text-lg font-semibold" };
13
+ const _hoisted_5 = {
12
14
  key: 0,
13
15
  class: "min-h-0 flex-1 overflow-hidden"
14
16
  };
@@ -30,7 +32,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
30
32
  divider: { type: Boolean, default: true },
31
33
  contentClass: { default: "mx-auto w-full max-w-6xl" },
32
34
  fullBleed: { type: Boolean },
33
- loading: { type: Boolean }
35
+ loading: { type: Boolean },
36
+ labels: {}
34
37
  },
35
38
  emits: ["update:modelValue", "update:open", "update:collapsed", "select"],
36
39
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -61,10 +64,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
61
64
  get: () => props.open ?? false,
62
65
  set: (v) => emit("update:open", v)
63
66
  });
67
+ const text = useLabels(
68
+ "appShell",
69
+ { openMenu: "Open menu", skipToContent: "Skip to content" },
70
+ () => props.labels
71
+ );
72
+ const scrollArea = ref(null);
73
+ const mainId = `lp-main-${useId()}`;
74
+ function skipToMain() {
75
+ document.getElementById(mainId)?.focus();
76
+ }
64
77
  watch(
65
78
  () => props.path,
66
79
  () => {
67
80
  if (drawerOpen.value) emit("update:open", false);
81
+ scrollArea.value?.viewportEl?.scrollTo({ top: 0, left: 0, behavior: "instant" });
68
82
  }
69
83
  );
70
84
  function onSelect(item) {
@@ -87,6 +101,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
87
101
  );
88
102
  return (_ctx, _cache) => {
89
103
  return openBlock(), createElementBlock("div", mergeProps({ class: unref(rootClass) }, unref(rest)), [
104
+ createElementVNode("a", {
105
+ href: `#${mainId}`,
106
+ onClick: withModifiers(skipToMain, ["prevent"]),
107
+ class: "sr-only z-(--z-toast) rounded-control bg-surface-raised px-3 py-2 text-sm font-medium text-ink focus:not-sr-only focus:fixed focus:left-3 focus:top-3 focus:outline-none focus:ring-2 focus:ring-ring"
108
+ }, toDisplayString(unref(text).skipToContent), 9, _hoisted_1),
90
109
  createVNode(_sfc_main$1, {
91
110
  "model-value": __props.modelValue,
92
111
  items: __props.items,
@@ -135,14 +154,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
135
154
  key: "3"
136
155
  } : void 0
137
156
  ]), 1032, ["model-value", "items", "sections", "is-active", "open", "mobile-breakpoint", "divider", "loading", "collapsed", "auto-collapse-after"]),
138
- createElementVNode("div", _hoisted_1, [
139
- createElementVNode("header", _hoisted_2, [
157
+ createElementVNode("div", _hoisted_2, [
158
+ createElementVNode("header", _hoisted_3, [
140
159
  createVNode(_sfc_main$2, {
141
160
  class: normalizeClass(burgerClass.value),
142
161
  variant: "ghost",
143
162
  size: "sm",
144
163
  square: "",
145
- "aria-label": "Open menu",
164
+ "aria-label": unref(text).openMenu,
146
165
  onClick: _cache[2] || (_cache[2] = ($event) => emit("update:open", true))
147
166
  }, {
148
167
  default: withCtx(() => [
@@ -152,14 +171,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
152
171
  })
153
172
  ]),
154
173
  _: 1
155
- }, 8, ["class"]),
174
+ }, 8, ["class", "aria-label"]),
156
175
  createVNode(_sfc_main$4, {
157
176
  axis: "height",
158
177
  class: "flex min-w-0 flex-1 items-center"
159
178
  }, {
160
179
  default: withCtx(() => [
161
180
  renderSlot(_ctx.$slots, "header-title", {}, () => [
162
- createElementVNode("h1", _hoisted_3, toDisplayString(pageTitle.value), 1)
181
+ createElementVNode("h1", _hoisted_4, toDisplayString(pageTitle.value), 1)
163
182
  ])
164
183
  ]),
165
184
  _: 3
@@ -174,18 +193,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
174
193
  _: 3
175
194
  })
176
195
  ]),
177
- __props.fullBleed ? (openBlock(), createElementBlock("div", _hoisted_4, [
178
- renderSlot(_ctx.$slots, "default")
179
- ])) : (openBlock(), createBlock(_sfc_main$5, {
180
- key: 1,
181
- class: "min-h-0 flex-1",
182
- "content-class": `px-4 py-6 md:px-6 ${__props.contentClass}`
183
- }, {
184
- default: withCtx(() => [
196
+ createElementVNode("main", {
197
+ id: mainId,
198
+ tabindex: "-1",
199
+ class: "flex min-h-0 flex-1 flex-col outline-none"
200
+ }, [
201
+ __props.fullBleed ? (openBlock(), createElementBlock("div", _hoisted_5, [
185
202
  renderSlot(_ctx.$slots, "default")
186
- ]),
187
- _: 3
188
- }, 8, ["content-class"]))
203
+ ])) : (openBlock(), createBlock(_sfc_main$5, {
204
+ key: 1,
205
+ ref_key: "scrollArea",
206
+ ref: scrollArea,
207
+ class: "min-h-0 flex-1",
208
+ "content-class": `px-4 py-6 md:px-6 ${__props.contentClass}`
209
+ }, {
210
+ default: withCtx(() => [
211
+ renderSlot(_ctx.$slots, "default")
212
+ ]),
213
+ _: 3
214
+ }, 8, ["content-class"]))
215
+ ])
189
216
  ]),
190
217
  renderSlot(_ctx.$slots, "overlays")
191
218
  ], 16);
@@ -1,19 +1,24 @@
1
- import { defineComponent, computed, ref, watch, openBlock, createBlock, unref, withCtx, createVNode, normalizeClass, createCommentVNode, createElementBlock, withModifiers, toDisplayString, createTextVNode, Fragment, renderList, normalizeStyle, createElementVNode } from "vue";
1
+ import { defineComponent, computed, useAttrs, ref, watch, openBlock, createBlock, unref, normalizeStyle, normalizeClass, withCtx, createVNode, createCommentVNode, mergeProps, createElementBlock, withModifiers, toDisplayString, createTextVNode, Fragment, renderList, createElementVNode } from "vue";
2
2
  import { ComboboxRoot, ComboboxAnchor, ComboboxInput, ComboboxPortal, ComboboxContent, ComboboxViewport, ComboboxEmpty, ComboboxItem } from "reka-ui";
3
+ import { useFieldControl } from "../composables/useField.js";
3
4
  import { useInputFilter } from "../composables/useInputFilter.js";
5
+ import { useLabels } from "../composables/useLpConfig.js";
4
6
  import { CLOSE_ICON, POPOVER_PANEL, OPTION_ITEM } from "../components/dropdown.js";
5
7
  import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
6
- const _hoisted_1 = {
8
+ const _hoisted_1 = ["aria-label"];
9
+ const _hoisted_2 = {
7
10
  key: 0,
8
11
  class: "px-3 py-4 text-center text-sm italic text-muted"
9
12
  };
10
- const _hoisted_2 = { class: "flex min-w-0 flex-col" };
11
- const _hoisted_3 = { class: "truncate" };
12
- const _hoisted_4 = {
13
+ const _hoisted_3 = { class: "flex min-w-0 flex-col" };
14
+ const _hoisted_4 = { class: "truncate" };
15
+ const _hoisted_5 = {
13
16
  key: 0,
14
17
  class: "truncate text-xs text-muted"
15
18
  };
19
+ const __default__ = { inheritAttrs: false };
16
20
  const _sfc_main = /* @__PURE__ */ defineComponent({
21
+ ...__default__,
17
22
  __name: "LpAutocomplete",
18
23
  props: {
19
24
  modelValue: {},
@@ -36,7 +41,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
36
41
  setup(__props, { emit: __emit }) {
37
42
  const props = __props;
38
43
  const emit = __emit;
39
- const { isInvalid, onBeforeInput, onPaste } = useInputFilter({
44
+ const { isInvalid, onBeforeInput, onInput: filterInput, onCompositionEnd, onPaste } = useInputFilter({
40
45
  pattern: () => props.pattern,
41
46
  restrict: () => props.restrict
42
47
  });
@@ -44,7 +49,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
44
49
  get: () => props.modelValue ?? "",
45
50
  set: (v) => emit("update:modelValue", v)
46
51
  });
47
- const isInvalidState = computed(() => props.invalid || isInvalid(props.modelValue));
52
+ const attrs = useAttrs();
53
+ const inputAttrs = computed(() => {
54
+ const { class: _c, style: _s, ...rest } = attrs;
55
+ return rest;
56
+ });
57
+ const field = useFieldControl(() => ({
58
+ wrapped: false,
59
+ id: typeof attrs.id === "string" ? attrs.id : void 0,
60
+ invalid: props.invalid || isInvalid(props.modelValue),
61
+ disabled: props.disabled
62
+ }));
63
+ const isInvalidState = computed(() => field.value.invalid);
64
+ const labels = useLabels("autocomplete", { clear: "Clear" });
48
65
  const items = computed(
49
66
  () => (props.options ?? []).map(
50
67
  (o) => typeof o === "string" ? { value: o } : o
@@ -67,6 +84,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
67
84
  watch(canOpen, (can) => {
68
85
  if (focused.value && can) open.value = true;
69
86
  });
87
+ function onOpenChange(next) {
88
+ open.value = next && canOpen.value;
89
+ }
70
90
  const hasValue = computed(() => (props.modelValue ?? "").length > 0);
71
91
  const anchorSize = {
72
92
  sm: "h-(--size-control-sm) text-xs",
@@ -74,6 +94,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
74
94
  lg: "h-(--size-control-lg) text-sm"
75
95
  };
76
96
  function onInput(event) {
97
+ filterInput(event);
77
98
  typing.value = true;
78
99
  text.value = event.target.value;
79
100
  }
@@ -96,12 +117,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
96
117
  return (_ctx, _cache) => {
97
118
  return openBlock(), createBlock(unref(ComboboxRoot), {
98
119
  open: open.value,
99
- "onUpdate:open": _cache[2] || (_cache[2] = ($event) => open.value = $event),
100
120
  "ignore-filter": true,
101
121
  "reset-search-term-on-blur": false,
102
122
  "reset-search-term-on-select": false,
103
- disabled: __props.disabled,
104
- class: "relative"
123
+ disabled: unref(field).disabled,
124
+ class: normalizeClass(["relative", unref(attrs).class]),
125
+ style: normalizeStyle(unref(attrs).style),
126
+ "onUpdate:open": onOpenChange
105
127
  }, {
106
128
  default: withCtx(() => [
107
129
  createVNode(unref(ComboboxAnchor), {
@@ -118,32 +140,37 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
118
140
  size: 16,
119
141
  class: "shrink-0 text-muted"
120
142
  }, null, 8, ["name"])) : createCommentVNode("", true),
121
- createVNode(unref(ComboboxInput), {
143
+ createVNode(unref(ComboboxInput), mergeProps(inputAttrs.value, {
144
+ id: unref(field).id,
122
145
  "model-value": text.value,
123
146
  placeholder: __props.placeholder,
124
- disabled: __props.disabled,
147
+ disabled: unref(field).disabled,
148
+ required: unref(field).required || void 0,
125
149
  "aria-invalid": isInvalidState.value || void 0,
126
- "auto-focus": "",
150
+ "aria-describedby": unref(field).describedBy,
127
151
  class: "lp-autofill min-w-0 flex-1 self-stretch bg-transparent outline-none placeholder:text-muted",
128
152
  onBeforeinput: unref(onBeforeInput),
129
153
  onPaste: unref(onPaste),
154
+ onCompositionend: unref(onCompositionEnd),
130
155
  onInput,
131
156
  onFocus,
132
157
  onBlur: _cache[0] || (_cache[0] = ($event) => focused.value = false)
133
- }, null, 8, ["model-value", "placeholder", "disabled", "aria-invalid", "onBeforeinput", "onPaste"]),
158
+ }), null, 16, ["id", "model-value", "placeholder", "disabled", "required", "aria-invalid", "aria-describedby", "onBeforeinput", "onPaste", "onCompositionend"]),
134
159
  __props.clearable && hasValue.value ? (openBlock(), createElementBlock("button", {
135
160
  key: 1,
136
161
  type: "button",
137
162
  class: "group flex shrink-0 items-center text-muted outline-none transition-colors duration-[var(--duration-fast)] hover:text-ink",
138
- "aria-label": "Clear",
139
- onPointerdown: withModifiers(clear, ["prevent"])
163
+ "aria-label": unref(labels).clear,
164
+ onPointerdown: _cache[1] || (_cache[1] = withModifiers(() => {
165
+ }, ["prevent"])),
166
+ onClick: clear
140
167
  }, [
141
168
  createVNode(_sfc_main$1, {
142
169
  name: "lucide:x",
143
170
  size: 16,
144
171
  class: normalizeClass(unref(CLOSE_ICON))
145
172
  }, null, 8, ["class"])
146
- ], 32)) : createCommentVNode("", true)
173
+ ], 40, _hoisted_1)) : createCommentVNode("", true)
147
174
  ]),
148
175
  _: 1
149
176
  }, 8, ["class"]),
@@ -153,13 +180,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
153
180
  position: "popper",
154
181
  "side-offset": 6,
155
182
  class: normalizeClass([unref(POPOVER_PANEL), "z-(--z-popover) max-h-72 w-(--reka-combobox-trigger-width) overflow-hidden"]),
156
- onOpenAutoFocus: _cache[1] || (_cache[1] = withModifiers(() => {
183
+ onOpenAutoFocus: _cache[2] || (_cache[2] = withModifiers(() => {
157
184
  }, ["prevent"]))
158
185
  }, {
159
186
  default: withCtx(() => [
160
187
  createVNode(unref(ComboboxViewport), { class: "max-h-72 overflow-y-auto p-1" }, {
161
188
  default: withCtx(() => [
162
- __props.loading ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(__props.loadingText), 1)) : (openBlock(), createBlock(unref(ComboboxEmpty), {
189
+ __props.loading ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(__props.loadingText), 1)) : (openBlock(), createBlock(unref(ComboboxEmpty), {
163
190
  key: 1,
164
191
  class: "px-3 py-4 text-center text-sm italic text-muted"
165
192
  }, {
@@ -177,9 +204,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
177
204
  onSelect: withModifiers(($event) => choose(opt), ["prevent"])
178
205
  }, {
179
206
  default: withCtx(() => [
180
- createElementVNode("span", _hoisted_2, [
181
- createElementVNode("span", _hoisted_3, toDisplayString(opt.label ?? opt.value), 1),
182
- opt.description ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(opt.description), 1)) : createCommentVNode("", true)
207
+ createElementVNode("span", _hoisted_3, [
208
+ createElementVNode("span", _hoisted_4, toDisplayString(opt.label ?? opt.value), 1),
209
+ opt.description ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(opt.description), 1)) : createCommentVNode("", true)
183
210
  ])
184
211
  ]),
185
212
  _: 2
@@ -196,7 +223,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
196
223
  })
197
224
  ]),
198
225
  _: 1
199
- }, 8, ["open", "disabled"]);
226
+ }, 8, ["open", "disabled", "class", "style"]);
200
227
  };
201
228
  }
202
229
  });