@leavepulse/ui 0.94.0 → 0.95.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 (96) hide show
  1. package/dist/assets/{LpTable-DxnthVz4.css → LpTable-BJjNEvgJ.css} +57 -30
  2. package/dist/assets/LpTabs-7yQjX2ih.css +18 -0
  3. package/dist/chunks/{LpAddressInput-BCqR0zmv.js → LpAddressInput-C5VIgRp0.js} +1 -1
  4. package/dist/chunks/{LpAppShell-xEBmGV78.js → LpAppShell-C4b3ySa_.js} +3 -3
  5. package/dist/chunks/{LpCodeBlock-BgWcg2mk.js → LpCodeBlock-DTU40x8P.js} +1 -1
  6. package/dist/chunks/{LpCodeDisplay-DBi1YPLp.js → LpCodeDisplay-F2hjLb0X.js} +2 -2
  7. package/dist/chunks/{LpConfirmDialog-y6k0ryWR.js → LpConfirmDialog-DrHcIxRn.js} +1 -1
  8. package/dist/chunks/{LpConfirmHost-D-X0tDym.js → LpConfirmHost-D0Cd8FA_.js} +1 -1
  9. package/dist/chunks/{LpCopyButton-BGzw95Xc.js → LpCopyButton-CiqUS4SX.js} +1 -1
  10. package/dist/chunks/{LpDataList-B56Gu6Yt.js → LpDataList-Cit9fOSp.js} +2 -2
  11. package/dist/chunks/{LpDrawer-BkWjFdV0.js → LpDrawer-BHlqi62K.js} +1 -1
  12. package/dist/chunks/{LpFileTree-BN_zybBN.js → LpFileTree-gVjF_b6r.js} +1 -1
  13. package/dist/chunks/{LpInspector-oTfkOdYd.js → LpInspector-DSL1lINx.js} +2 -2
  14. package/dist/chunks/{LpLightbox-DPgz7IsT.js → LpLightbox--EwvQGe-.js} +1 -1
  15. package/dist/chunks/{LpLogViewer-BuIzr_6h.js → LpLogViewer-DSq9e8mT.js} +1 -1
  16. package/dist/chunks/{LpMediaGallery-CTejKF2-.js → LpMediaGallery-DlYJf3DS.js} +1 -1
  17. package/dist/chunks/{LpModal-D1E7rQzw.js → LpModal-COMHrBKL.js} +1 -1
  18. package/dist/chunks/{LpModalNav-DVXAF-DG.js → LpModalNav-Cj02cfhL.js} +2 -2
  19. package/dist/chunks/{LpNotificationBell-KRgdRZs-.js → LpNotificationBell-DNGijtmW.js} +1 -1
  20. package/dist/chunks/{LpNotificationFeed-CMGYU8c-.js → LpNotificationFeed-BoovbtfL.js} +3 -3
  21. package/dist/chunks/{LpPageScrollbar-C9sTeU-2.js → LpPageScrollbar-BniFeL2U.js} +5 -1
  22. package/dist/chunks/{LpPaletteTheme-CLwO-SDf.js → LpPaletteTheme-_FwkJO2o.js} +1 -1
  23. package/dist/chunks/{LpPasswordInput-LPVI7D3v.js → LpPasswordInput-BBDz2zyU.js} +1 -1
  24. package/dist/chunks/{LpPie-CsiBXe-e.js → LpPie-CtC4XdhC.js} +1 -1
  25. package/dist/chunks/{LpPipeline-DVcoSs--.js → LpPipeline-aCALaUY8.js} +1 -1
  26. package/dist/chunks/{LpRelativeTime-CN5bWD73.js → LpRelativeTime-9MHlbq6F.js} +1 -1
  27. package/dist/chunks/{LpScrollArea-CqvwfZs2.js → LpScrollArea-B_1KZOSS.js} +11 -1
  28. package/dist/chunks/{LpSecretField-BwrZ4TfT.js → LpSecretField-C9vwMFQ6.js} +4 -4
  29. package/dist/chunks/{LpSidebar-BIhusppV.js → LpSidebar-DPri9uyz.js} +4 -4
  30. package/dist/chunks/{LpSidebarNav-CFcI7--7.js → LpSidebarNav-CV1rU6La.js} +34 -20
  31. package/dist/chunks/{LpThemeStudio-BPPctXgd.js → LpThemeStudio-yiEdFJQL.js} +1 -1
  32. package/dist/chunks/{LpThemeSwitcher-B3c44xFH.js → LpThemeSwitcher-DKkCFaFk.js} +1 -1
  33. package/dist/chunks/{LpToaster-Cdx1tnHB.js → LpToaster-C7hHkGOA.js} +1 -1
  34. package/dist/chunks/LpTooltip-Bt1ZFViJ.js +333 -0
  35. package/dist/chunks/{LpTruncate-C_C8eiIE.js → LpTruncate-DEHWL1OA.js} +2 -2
  36. package/dist/chunks/{LpUptimeBar-Dt6SY_-m.js → LpUptimeBar-CXgzU5ym.js} +1 -1
  37. package/dist/chunks/{LpWorkspaceSwitcher-DCIiOQt_.js → LpWorkspaceSwitcher-CrUVSI7x.js} +1 -1
  38. package/dist/chunks/{RevealToggle-BsYxY6Oz.js → RevealToggle-D9Vs88kM.js} +1 -1
  39. package/dist/components/LpAddressInput.vue.js +1 -1
  40. package/dist/components/LpAppShell.vue.js +1 -1
  41. package/dist/components/LpCodeBlock.vue.js +1 -1
  42. package/dist/components/LpCodeDisplay.vue.js +1 -1
  43. package/dist/components/LpCommandPalette.vue.js +1 -1
  44. package/dist/components/LpConfirmDialog.vue.js +1 -1
  45. package/dist/components/LpConfirmHost.vue.js +1 -1
  46. package/dist/components/LpCopyButton.vue.js +1 -1
  47. package/dist/components/LpDataList.vue.js +1 -1
  48. package/dist/components/LpDock.vue.js +1 -1
  49. package/dist/components/LpDrawer.vue.js +1 -1
  50. package/dist/components/LpFileTree.vue.js +1 -1
  51. package/dist/components/LpInspector.vue.js +1 -1
  52. package/dist/components/LpLightbox.vue.js +1 -1
  53. package/dist/components/LpLogViewer.vue.js +1 -1
  54. package/dist/components/LpMediaGallery.vue.js +1 -1
  55. package/dist/components/LpModal.vue.js +1 -1
  56. package/dist/components/LpModalNav.vue.js +1 -1
  57. package/dist/components/LpNotificationBell.vue.js +1 -1
  58. package/dist/components/LpNotificationFeed.vue.js +1 -1
  59. package/dist/components/LpPageScrollbar.vue.js +1 -1
  60. package/dist/components/LpPaletteTheme.vue.js +1 -1
  61. package/dist/components/LpPasswordInput.vue.js +1 -1
  62. package/dist/components/LpPie.vue.js +1 -1
  63. package/dist/components/LpPipeline.vue.js +1 -1
  64. package/dist/components/LpRelativeTime.vue.js +1 -1
  65. package/dist/components/LpScrollArea.vue.js +1 -1
  66. package/dist/components/LpSecretField.vue.js +1 -1
  67. package/dist/components/LpShortcutsDialog.vue.js +1 -1
  68. package/dist/components/LpSidebar.vue.js +1 -1
  69. package/dist/components/LpSidebarNav.vue.js +1 -1
  70. package/dist/components/LpTable.vue.js +38 -12
  71. package/dist/components/LpTabs.vue.js +11 -6
  72. package/dist/components/LpThemeStudio.vue.js +1 -1
  73. package/dist/components/LpThemeSwitcher.vue.js +1 -1
  74. package/dist/components/LpToaster.vue.js +1 -1
  75. package/dist/components/LpTooltip.vue.d.ts +3 -3
  76. package/dist/components/LpTooltip.vue.js +1 -1
  77. package/dist/components/LpTruncate.vue.js +1 -1
  78. package/dist/components/LpUptimeBar.vue.js +1 -1
  79. package/dist/components/LpWorkspaceSwitcher.vue.js +1 -1
  80. package/dist/components/RevealToggle.vue.js +1 -1
  81. package/dist/components/tableFeatures.d.ts +1 -0
  82. package/dist/components/tableFeatures.js +25 -0
  83. package/dist/composables/useShift.js +28 -11
  84. package/dist/index.js +34 -34
  85. package/package.json +1 -1
  86. package/src/components/LpPageScrollbar.vue +14 -1
  87. package/src/components/LpScrollArea.vue +18 -1
  88. package/src/components/LpSidebar.vue +1 -1
  89. package/src/components/LpSidebarNav.vue +18 -8
  90. package/src/components/LpTable.vue +76 -4
  91. package/src/components/LpTabs.vue +14 -5
  92. package/src/components/LpTooltip.vue +153 -14
  93. package/src/components/tableFeatures.ts +36 -0
  94. package/src/composables/useShift.ts +45 -15
  95. package/dist/assets/LpTabs-D7EyG21l.css +0 -18
  96. package/dist/chunks/LpTooltip-BKde8Xjv.js +0 -230
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed, ref, openBlock, createBlock, mergeProps, unref, withCtx, createElementBlock, createElementVNode, createCommentVNode, Fragment, renderList, toDisplayString, createVNode, normalizeClass, createTextVNode, createSlots, renderSlot } from "vue";
1
+ import { defineComponent, computed, ref, openBlock, createBlock, mergeProps, unref, withCtx, createElementBlock, createElementVNode, createCommentVNode, Fragment, renderList, normalizeStyle, toDisplayString, createVNode, normalizeClass, createTextVNode, createSlots, renderSlot } from "vue";
2
2
  import { CollapsibleRoot, CollapsibleTrigger, CollapsibleContent } from "reka-ui";
3
3
  import { _ as _sfc_main$5 } from "./LpBadge-Bh5roBr_.js";
4
4
  import "../components/commandSearch.js";
@@ -8,7 +8,7 @@ import { _ as _sfc_main$4 } from "./LpIcon-CxHFPwKt.js";
8
8
  import "../composables/useHotkeys.js";
9
9
  import '../assets/MenuShortcut-Cyub0frr.css';import '../assets/LpKeys-5ijsXX-M.css';/* empty css */
10
10
  /* empty css */
11
- import { _ as _sfc_main$2 } from "./LpScrollArea-CqvwfZs2.js";
11
+ import { _ as _sfc_main$2 } from "./LpScrollArea-B_1KZOSS.js";
12
12
  import { _ as _sfc_main$1 } from "./LpSkeleton-leTl53V9.js";
13
13
  import { _ as _sfc_main$3 } from "./LpSidebarRow-C5jXpcRL.js";
14
14
  import { waiting } from "../components/sidebar.js";
@@ -17,25 +17,30 @@ const _hoisted_1 = {
17
17
  key: 0,
18
18
  class: "flex items-center gap-3 px-1"
19
19
  };
20
- const _hoisted_2 = { class: "space-y-1" };
20
+ const _hoisted_2 = { class: "flex flex-col gap-1" };
21
21
  const _hoisted_3 = {
22
+ key: 0,
23
+ class: "px-3 pb-1 pt-3"
24
+ };
25
+ const _hoisted_4 = { class: "flex h-9 items-center gap-3 px-3" };
26
+ const _hoisted_5 = {
22
27
  key: 0,
23
28
  class: "flex flex-col gap-0.5"
24
29
  };
25
- const _hoisted_4 = {
30
+ const _hoisted_6 = {
26
31
  key: 0,
27
32
  class: "px-2 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted"
28
33
  };
29
- const _hoisted_5 = {
34
+ const _hoisted_7 = {
30
35
  key: 0,
31
36
  class: "flex flex-col gap-0.5"
32
37
  };
33
- const _hoisted_6 = {
38
+ const _hoisted_8 = {
34
39
  key: 0,
35
40
  class: "mx-3 mb-1 border-t border-line"
36
41
  };
37
- const _hoisted_7 = { class: "min-w-0 flex-1 truncate text-left" };
38
- const _hoisted_8 = {
42
+ const _hoisted_9 = { class: "min-w-0 flex-1 truncate text-left" };
43
+ const _hoisted_10 = {
39
44
  key: 2,
40
45
  class: "px-2 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted"
41
46
  };
@@ -49,7 +54,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
49
54
  itemActive: {},
50
55
  loading: { type: Boolean },
51
56
  skeletonRows: { default: 6 },
52
- skeletonHeader: { type: Boolean, default: true },
57
+ skeletonHeader: { type: Boolean, default: false },
53
58
  collapsedKeys: { default: () => [] },
54
59
  hoverFollow: { type: Boolean, default: false },
55
60
  compact: { type: Boolean },
@@ -172,13 +177,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
172
177
  if (item.children?.length && !item.to && !item.href) toggle(item);
173
178
  emit("activate", item);
174
179
  }
180
+ const SKELETON_WIDTHS = ["55%", "70%", "45%", "62%", "50%", "68%"];
175
181
  const { class: rootClass, attrs: rest } = useMergedAttrs(
176
182
  "flex min-h-0 flex-1 flex-col gap-4"
177
183
  );
178
184
  return (_ctx, _cache) => {
179
185
  return __props.loading ? (openBlock(), createBlock(_sfc_main$1, mergeProps({
180
186
  key: 0,
181
- class: unref(rootClass)
187
+ class: [unref(rootClass), "overflow-hidden"]
182
188
  }, unref(rest)), {
183
189
  default: withCtx(() => [
184
190
  __props.skeletonHeader ? (openBlock(), createElementBlock("div", _hoisted_1, [..._cache[1] || (_cache[1] = [
@@ -190,10 +196,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
190
196
  ])])) : createCommentVNode("", true),
191
197
  createElementVNode("div", _hoisted_2, [
192
198
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.skeletonRows, (n) => {
193
- return openBlock(), createElementBlock("div", {
194
- key: n,
195
- class: "lp-skeleton-item h-9 rounded-control bg-surface-soft"
196
- });
199
+ return openBlock(), createElementBlock(Fragment, { key: n }, [
200
+ n === 4 ? (openBlock(), createElementBlock("div", _hoisted_3, [..._cache[2] || (_cache[2] = [
201
+ createElementVNode("div", { class: "lp-skeleton-item h-2.5 w-20 rounded-small bg-surface-soft/60" }, null, -1)
202
+ ])])) : createCommentVNode("", true),
203
+ createElementVNode("div", _hoisted_4, [
204
+ _cache[3] || (_cache[3] = createElementVNode("div", { class: "lp-skeleton-item size-4 shrink-0 rounded-small bg-surface-soft" }, null, -1)),
205
+ createElementVNode("div", {
206
+ class: "lp-skeleton-item h-3 rounded-small bg-surface-soft",
207
+ style: normalizeStyle({ width: SKELETON_WIDTHS[(n - 1) % SKELETON_WIDTHS.length] })
208
+ }, null, 4)
209
+ ])
210
+ ], 64);
197
211
  }), 128))
198
212
  ])
199
213
  ]),
@@ -209,8 +223,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
209
223
  class: "contents",
210
224
  onKeydown: onKey
211
225
  }, [
212
- __props.pinned.length ? (openBlock(), createElementBlock("div", _hoisted_3, [
213
- !__props.compact ? (openBlock(), createElementBlock("p", _hoisted_4, toDisplayString(__props.labels.pinned), 1)) : createCommentVNode("", true),
226
+ __props.pinned.length ? (openBlock(), createElementBlock("div", _hoisted_5, [
227
+ !__props.compact ? (openBlock(), createElementBlock("p", _hoisted_6, toDisplayString(__props.labels.pinned), 1)) : createCommentVNode("", true),
214
228
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.pinned, (item) => {
215
229
  return openBlock(), createBlock(_sfc_main$3, {
216
230
  key: `pinned:${item.id}`,
@@ -230,7 +244,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
230
244
  return openBlock(), createElementBlock(Fragment, {
231
245
  key: sectionKey(section) || si
232
246
  }, [
233
- __props.compact && section.collapsible && section.title ? (openBlock(), createElementBlock("div", _hoisted_5, [
247
+ __props.compact && section.collapsible && section.title ? (openBlock(), createElementBlock("div", _hoisted_7, [
234
248
  createVNode(_sfc_main$3, {
235
249
  item: sectionItem(section),
236
250
  active: false,
@@ -252,7 +266,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
252
266
  "onUpdate:open": (o) => emit("toggle-section", sectionKey(section), !o)
253
267
  }, {
254
268
  default: withCtx(() => [
255
- __props.compact && (si > 0 || __props.pinned.length) ? (openBlock(), createElementBlock("div", _hoisted_6)) : !__props.compact && section.title && section.collapsible ? (openBlock(), createBlock(unref(CollapsibleTrigger), {
269
+ __props.compact && (si > 0 || __props.pinned.length) ? (openBlock(), createElementBlock("div", _hoisted_8)) : !__props.compact && section.title && section.collapsible ? (openBlock(), createBlock(unref(CollapsibleTrigger), {
256
270
  key: 1,
257
271
  "data-lp-nav-row": "",
258
272
  class: "group/section mt-2 flex cursor-pointer items-center gap-2 rounded-control px-2 py-1 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted outline-none transition-colors duration-[var(--duration-fast)] hover:bg-ink/[0.04] hover:text-ink focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"
@@ -264,7 +278,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
264
278
  size: 14,
265
279
  class: "shrink-0"
266
280
  }, null, 8, ["name"])) : createCommentVNode("", true),
267
- createElementVNode("span", _hoisted_7, toDisplayString(section.title), 1),
281
+ createElementVNode("span", _hoisted_9, toDisplayString(section.title), 1),
268
282
  section.items.some(unref(waiting)) ? (openBlock(), createElementBlock("span", {
269
283
  key: 1,
270
284
  class: normalizeClass(["size-1.5 shrink-0 rounded-full bg-brand transition-opacity duration-[var(--duration-fast)] motion-reduce:transition-none", isOpen(section) ? "opacity-0" : "opacity-100"])
@@ -286,7 +300,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
286
300
  })
287
301
  ]),
288
302
  _: 2
289
- }, 1024)) : !__props.compact && section.title ? (openBlock(), createElementBlock("p", _hoisted_8, toDisplayString(section.title), 1)) : createCommentVNode("", true),
303
+ }, 1024)) : !__props.compact && section.title ? (openBlock(), createElementBlock("p", _hoisted_10, toDisplayString(section.title), 1)) : createCommentVNode("", true),
290
304
  createVNode(unref(CollapsibleContent), { class: "flex flex-col gap-0.5 overflow-hidden data-[state=open]:animate-[collapsible-down_260ms_var(--ease-emphasized)] data-[state=closed]:animate-[collapsible-up_200ms_var(--ease-emphasized)] motion-reduce:animate-none" }, {
291
305
  default: withCtx(() => [
292
306
  (openBlock(true), createElementBlock(Fragment, null, renderList(section.items, (item) => {
@@ -3,7 +3,7 @@ import { usePaletteTheme } from "../theme/palette.js";
3
3
  import { useLabels } from "../composables/useLpConfig.js";
4
4
  import { useThemeStudio, STUDIO_BRANDS, STUDIO_SYSTEM } from "../theme/studio.js";
5
5
  import { _ as _sfc_main$1 } from "./LpButton-BvVoF-PO.js";
6
- import { _ as _sfc_main$7 } from "./LpCodeBlock-BgWcg2mk.js";
6
+ import { _ as _sfc_main$7 } from "./LpCodeBlock-DTU40x8P.js";
7
7
  import { _ as _sfc_main$4 } from "./LpColorPicker-KGMG8QEh.js";
8
8
  import { _ as _sfc_main$2 } from "./LpIcon-CxHFPwKt.js";
9
9
  import { _ as _sfc_main$5 } from "./LpSegmented-DzFYP0ZF.js";
@@ -11,7 +11,7 @@ import { _ as _sfc_main$1 } from "./LpContextMenu-DEFirphS.js";
11
11
  import { _ as _sfc_main$2 } from "./LpIcon-CxHFPwKt.js";
12
12
  import { _ as _sfc_main$4 } from "./LpRollingText-B54Pje7P.js";
13
13
  import { _ as _sfc_main$3 } from "./LpShift-DAgS_d2x.js";
14
- import { _ as _sfc_main$5 } from "./LpThemeStudio-BPPctXgd.js";
14
+ import { _ as _sfc_main$5 } from "./LpThemeStudio-yiEdFJQL.js";
15
15
  const _hoisted_1 = ["aria-label", "title"];
16
16
  const _hoisted_2 = {
17
17
  key: 1,
@@ -4,7 +4,7 @@ import { prefersReducedMotion } from "../composables/easing.js";
4
4
  import { useLabels } from "../composables/useLpConfig.js";
5
5
  import { useToast } from "../composables/useToast.js";
6
6
  import { CLOSE_ICON } from "../components/dropdown.js";
7
- import { _ as _sfc_main$2 } from "./LpCopyButton-BGzw95Xc.js";
7
+ import { _ as _sfc_main$2 } from "./LpCopyButton-CiqUS4SX.js";
8
8
  import { _ as _sfc_main$1 } from "./LpIcon-CxHFPwKt.js";
9
9
  import { toneLook } from "../components/tone.js";
10
10
  import { useView, viewDocument, usePortalTarget, viewWindow } from "../composables/useView.js";
@@ -0,0 +1,333 @@
1
+ import { defineComponent, ref, watch, onBeforeUnmount, useAttrs, shallowRef, onMounted, onUpdated, computed, mergeProps, openBlock, createElementBlock, Fragment, createVNode, unref, withCtx, renderSlot, createBlock, resolveDynamicComponent, normalizeProps, normalizeStyle, normalizeClass, createElementVNode, createTextVNode, toDisplayString, createCommentVNode } from "vue";
2
+ import { clamp } from "../composables/clamp.js";
3
+ import { injectTooltipProviderContext, injectTooltipRootContext, Slot, TooltipProvider, TooltipRoot, TooltipTrigger, TooltipPortal, TooltipContent } from "reka-ui";
4
+ import { springStep, springSettled } from "../composables/usePillTransition.js";
5
+ import { PANEL_SURFACE, TOOLTIP_ANIM } from "../components/dropdown.js";
6
+ import { useTouchHold } from "../composables/useTouchHold.js";
7
+ import { prefersReducedMotion } from "../composables/easing.js";
8
+ import { useView, viewWindow, usePortalTarget, useOutsideGuard } from "../composables/useView.js";
9
+ import '../assets/LpTooltip-B61SYd4K.css';const HOLD_MS = 450;
10
+ const EDGE = 8;
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ ...{ inheritAttrs: false },
13
+ __name: "LpTooltip",
14
+ props: {
15
+ content: {},
16
+ sideOffset: {},
17
+ side: { default: "top" },
18
+ label: { type: Boolean },
19
+ delay: {},
20
+ showOnPointerFocus: { type: Boolean },
21
+ followCursor: { type: Boolean },
22
+ disabled: { type: Boolean },
23
+ touch: { default: "hold" }
24
+ },
25
+ setup(__props) {
26
+ const props = __props;
27
+ const shared = injectTooltipProviderContext(null);
28
+ const PassThrough = (_, { slots }) => slots.default?.();
29
+ const target = { x: 0, y: 0 };
30
+ const offset = ref({ x: 0, y: 0 });
31
+ const tipBody = ref(null);
32
+ function inView(x, y) {
33
+ const panel = tipBody.value?.parentElement;
34
+ if (!panel) return { x, y };
35
+ const rect = panel.getBoundingClientRect();
36
+ const win = panel.ownerDocument.defaultView ?? window;
37
+ return {
38
+ x: withinRoom(x, rect.left - offset.value.x, rect.width, win.innerWidth),
39
+ y: withinRoom(y, rect.top - offset.value.y, rect.height, win.innerHeight)
40
+ };
41
+ }
42
+ function withinRoom(value, placed, size, room) {
43
+ const min = EDGE - placed;
44
+ const max = room - EDGE - size - placed;
45
+ return max < min ? value : clamp(value, min, max);
46
+ }
47
+ let sx = { value: 0, velocity: 0 };
48
+ let sy = { value: 0, velocity: 0 };
49
+ let frame = 0;
50
+ let lastFrame = 0;
51
+ let pointer = null;
52
+ function stopSpring() {
53
+ if (frame) cancelAnimationFrame(frame);
54
+ frame = 0;
55
+ lastFrame = 0;
56
+ }
57
+ function jumpToTarget() {
58
+ stopSpring();
59
+ offset.value = { x: target.x, y: target.y };
60
+ sx = { value: target.x, velocity: 0 };
61
+ sy = { value: target.y, velocity: 0 };
62
+ }
63
+ const settle = (now) => {
64
+ const dt = lastFrame ? (now - lastFrame) / 1e3 : 1 / 60;
65
+ lastFrame = now;
66
+ frame = 0;
67
+ sx = springStep(sx, target.x, "float", dt);
68
+ sy = springStep(sy, target.y, "float", dt);
69
+ if (springSettled(sx, target.x) && springSettled(sy, target.y)) {
70
+ sx = { value: target.x, velocity: 0 };
71
+ sy = { value: target.y, velocity: 0 };
72
+ offset.value = { x: target.x, y: target.y };
73
+ lastFrame = 0;
74
+ return;
75
+ }
76
+ offset.value = { x: sx.value, y: sy.value };
77
+ frame = requestAnimationFrame(settle);
78
+ };
79
+ const onPointerMove = (e) => {
80
+ if (!props.followCursor) return;
81
+ const el = e.currentTarget;
82
+ if (!el) return;
83
+ pointer = { el, x: e.clientX, y: e.clientY };
84
+ follow();
85
+ };
86
+ function follow() {
87
+ if (!pointer) return;
88
+ const { el, x: clientX, y: clientY } = pointer;
89
+ const rect = el.getBoundingClientRect();
90
+ const halfX = props.side === "left" || props.side === "right" ? rect.width / 2 : 0;
91
+ const dirX = props.side === "right" ? -1 : 1;
92
+ target.x = clientX - (rect.left + rect.width / 2) + halfX * dirX;
93
+ const half = props.side === "top" || props.side === "bottom" ? rect.height / 2 : 0;
94
+ const dir = props.side === "bottom" ? -1 : 1;
95
+ target.y = clientY - (rect.top + rect.height / 2) + half * dir;
96
+ Object.assign(target, inView(target.x, target.y));
97
+ if (prefersReducedMotion()) {
98
+ jumpToTarget();
99
+ return;
100
+ }
101
+ if (!frame) frame = requestAnimationFrame(settle);
102
+ }
103
+ const open = ref(false);
104
+ const wanted = ref(false);
105
+ const heldOpen = ref(false);
106
+ const hold = useTouchHold({
107
+ enabled: () => props.touch === "hold" && !props.followCursor && !props.disabled,
108
+ delay: () => HOLD_MS,
109
+ onHold: () => {
110
+ armed.value = true;
111
+ heldOpen.value = true;
112
+ wanted.value = true;
113
+ open.value = true;
114
+ }
115
+ });
116
+ function release() {
117
+ heldOpen.value = false;
118
+ wanted.value = false;
119
+ open.value = false;
120
+ }
121
+ const onOpenChange = (next) => {
122
+ if (!next && heldOpen.value) return;
123
+ wanted.value = next;
124
+ open.value = next && !props.disabled;
125
+ if (!open.value || !props.followCursor) return;
126
+ jumpToTarget();
127
+ };
128
+ watch(
129
+ () => props.disabled,
130
+ (off) => {
131
+ if (off) {
132
+ hold.cancel();
133
+ heldOpen.value = false;
134
+ open.value = false;
135
+ } else if (wanted.value) open.value = true;
136
+ }
137
+ );
138
+ const view = useView();
139
+ watch(
140
+ () => open.value && props.followCursor,
141
+ (following, _, onCleanup) => {
142
+ if (!following) {
143
+ stopSpring();
144
+ return;
145
+ }
146
+ const win = viewWindow(view.value);
147
+ win.addEventListener("resize", follow);
148
+ onCleanup(() => win.removeEventListener("resize", follow));
149
+ }
150
+ );
151
+ watch(heldOpen, (held, _, onCleanup) => {
152
+ if (!held) return;
153
+ const win = viewWindow(view.value);
154
+ const onKey = (event) => event.key === "Escape" && release();
155
+ win.addEventListener("pointerdown", release, true);
156
+ win.addEventListener("keydown", onKey, true);
157
+ onCleanup(() => {
158
+ win.removeEventListener("pointerdown", release, true);
159
+ win.removeEventListener("keydown", onKey, true);
160
+ });
161
+ });
162
+ onBeforeUnmount(stopSpring);
163
+ const portalTo = usePortalTarget();
164
+ const guardOutside = useOutsideGuard();
165
+ const attrs = useAttrs();
166
+ const armed = ref(false);
167
+ const root = shallowRef(null);
168
+ let provider = null;
169
+ const triggerRef = ref(null);
170
+ const triggerEl = shallowRef();
171
+ function readTrigger() {
172
+ const el = triggerRef.value?.$el;
173
+ const next = el && el.nodeType === 1 ? el : void 0;
174
+ if (next === triggerEl.value) return;
175
+ triggerEl.value = next;
176
+ root.value?.onTriggerChange(next);
177
+ }
178
+ onMounted(readTrigger);
179
+ onUpdated(readTrigger);
180
+ let hovering = false;
181
+ let focusedBy = null;
182
+ let pointerDown = false;
183
+ let pointerMoveOpened = false;
184
+ const live = () => root.value && !root.value.disabled.value ? root.value : null;
185
+ function enter() {
186
+ const tip = live();
187
+ if (!tip || pointerMoveOpened || provider?.isPointerInTransitRef.value) return;
188
+ tip.onTriggerEnter();
189
+ pointerMoveOpened = true;
190
+ }
191
+ function focusOpen(target2) {
192
+ const tip = live();
193
+ if (!tip || pointerDown) return;
194
+ if (tip.ignoreNonKeyboardFocus.value && !target2.matches?.(":focus-visible")) return;
195
+ tip.onOpen();
196
+ }
197
+ const triggerEvents = {
198
+ onPointerenter(event) {
199
+ if (event.pointerType === "touch") return;
200
+ hovering = true;
201
+ armed.value = true;
202
+ },
203
+ onPointermove(event) {
204
+ onPointerMove(event);
205
+ if (event.pointerType === "touch") return;
206
+ hovering = true;
207
+ armed.value = true;
208
+ enter();
209
+ },
210
+ onPointerleave() {
211
+ hovering = false;
212
+ const tip = live();
213
+ if (!tip) return;
214
+ tip.onTriggerLeave();
215
+ pointerMoveOpened = false;
216
+ },
217
+ onPointerdown(event) {
218
+ const tip = live();
219
+ if (tip?.open.value && !tip.disableClosingTrigger.value) tip.onClose();
220
+ pointerDown = true;
221
+ const doc = event.currentTarget?.ownerDocument ?? document;
222
+ doc.addEventListener("pointerup", () => setTimeout(() => pointerDown = false, 1), { once: true });
223
+ },
224
+ onFocus(event) {
225
+ focusedBy = event.currentTarget;
226
+ armed.value = true;
227
+ focusOpen(focusedBy);
228
+ },
229
+ onBlur() {
230
+ focusedBy = null;
231
+ live()?.onClose();
232
+ },
233
+ onClick() {
234
+ const tip = live();
235
+ if (tip && !tip.disableClosingTrigger.value) tip.onClose();
236
+ }
237
+ };
238
+ const RootBridge = defineComponent({
239
+ setup() {
240
+ root.value = injectTooltipRootContext();
241
+ provider = injectTooltipProviderContext();
242
+ onMounted(() => {
243
+ root.value?.onTriggerChange(triggerEl.value);
244
+ if (hovering) enter();
245
+ if (focusedBy && focusedBy.ownerDocument.activeElement === focusedBy) focusOpen(focusedBy);
246
+ });
247
+ onBeforeUnmount(() => {
248
+ root.value = null;
249
+ provider = null;
250
+ });
251
+ return () => null;
252
+ }
253
+ });
254
+ const triggerProps = computed(
255
+ () => mergeProps(attrs, hold.handlers, triggerEvents, {
256
+ "aria-label": props.label ? props.content : void 0,
257
+ "aria-describedby": root.value?.open.value ? root.value.contentId : void 0,
258
+ "data-state": root.value?.stateAttribute.value ?? "closed",
259
+ "data-grace-area-trigger": "",
260
+ class: props.touch === "hold" && !props.followCursor ? "[-webkit-touch-callout:none]" : void 0
261
+ })
262
+ );
263
+ return (_ctx, _cache) => {
264
+ return openBlock(), createElementBlock(Fragment, null, [
265
+ createVNode(unref(Slot), mergeProps({
266
+ ref_key: "triggerRef",
267
+ ref: triggerRef
268
+ }, triggerProps.value), {
269
+ default: withCtx(() => [
270
+ renderSlot(_ctx.$slots, "default")
271
+ ]),
272
+ _: 3
273
+ }, 16),
274
+ armed.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(shared) ? PassThrough : unref(TooltipProvider)), normalizeProps(mergeProps({ key: 0 }, unref(shared) ? {} : { delayDuration: __props.delay ?? 200 })), {
275
+ default: withCtx(() => [
276
+ createVNode(unref(TooltipRoot), {
277
+ open: open.value,
278
+ "delay-duration": __props.delay,
279
+ "ignore-non-keyboard-focus": !__props.showOnPointerFocus,
280
+ "disable-hoverable-content": __props.followCursor,
281
+ "disable-closing-trigger": __props.followCursor,
282
+ "onUpdate:open": onOpenChange
283
+ }, {
284
+ default: withCtx(() => [
285
+ createVNode(unref(TooltipTrigger), {
286
+ "as-child": "",
287
+ reference: triggerEl.value
288
+ }, null, 8, ["reference"]),
289
+ createVNode(unref(RootBridge)),
290
+ createVNode(unref(TooltipPortal), { to: unref(portalTo) }, {
291
+ default: withCtx(() => [
292
+ createVNode(unref(TooltipContent), {
293
+ onInteractOutside: unref(guardOutside),
294
+ onEscapeKeyDown: unref(guardOutside),
295
+ side: __props.side,
296
+ "side-offset": __props.sideOffset ?? 6,
297
+ "collision-padding": 8,
298
+ "data-lp-follow": __props.followCursor ? "" : void 0,
299
+ class: normalizeClass([
300
+ unref(PANEL_SURFACE),
301
+ unref(TOOLTIP_ANIM),
302
+ "z-(--z-tooltip) max-w-[min(20rem,90vw)] px-2.5 py-1.5 text-xs text-ink"
303
+ ]),
304
+ style: normalizeStyle(__props.followCursor ? { translate: `${offset.value.x}px ${offset.value.y}px` } : void 0)
305
+ }, {
306
+ default: withCtx(() => [
307
+ createElementVNode("div", {
308
+ ref_key: "tipBody",
309
+ ref: tipBody
310
+ }, [
311
+ renderSlot(_ctx.$slots, "content", {}, () => [
312
+ createTextVNode(toDisplayString(__props.content), 1)
313
+ ])
314
+ ], 512)
315
+ ]),
316
+ _: 3
317
+ }, 8, ["onInteractOutside", "onEscapeKeyDown", "side", "side-offset", "data-lp-follow", "class", "style"])
318
+ ]),
319
+ _: 3
320
+ }, 8, ["to"])
321
+ ]),
322
+ _: 3
323
+ }, 8, ["open", "delay-duration", "ignore-non-keyboard-focus", "disable-hoverable-content", "disable-closing-trigger"])
324
+ ]),
325
+ _: 3
326
+ }, 16)) : createCommentVNode("", true)
327
+ ], 64);
328
+ };
329
+ }
330
+ });
331
+ export {
332
+ _sfc_main as _
333
+ };
@@ -2,8 +2,8 @@ import { defineComponent, ref, onMounted, watch, nextTick, computed, openBlock,
2
2
  import { nodeWindow } from "../composables/realm.js";
3
3
  import { useMergedAttrs } from "../composables/useMergedClass.js";
4
4
  import { useResizeObserver } from "../composables/useResizeObserver.js";
5
- import { _ as _sfc_main$2 } from "./LpCopyButton-BGzw95Xc.js";
6
- import { _ as _sfc_main$1 } from "./LpTooltip-BKde8Xjv.js";
5
+ import { _ as _sfc_main$2 } from "./LpCopyButton-CiqUS4SX.js";
6
+ import { _ as _sfc_main$1 } from "./LpTooltip-Bt1ZFViJ.js";
7
7
  import { middleTruncate } from "../components/fieldText.js";
8
8
  const _hoisted_1 = ["tabindex"];
9
9
  const _hoisted_2 = { "aria-hidden": "true" };
@@ -4,7 +4,7 @@ import { _ as _sfc_main$5 } from "./LpRollingText-B54Pje7P.js";
4
4
  import { _ as _sfc_main$4 } from "./LpShift-DAgS_d2x.js";
5
5
  import { _ as _sfc_main$2 } from "./LpSkeleton-leTl53V9.js";
6
6
  import { _ as _sfc_main$1 } from "./LpSwap-M7nFeW3C.js";
7
- import { _ as _sfc_main$3 } from "./LpTooltip-BKde8Xjv.js";
7
+ import { _ as _sfc_main$3 } from "./LpTooltip-Bt1ZFViJ.js";
8
8
  import { TONES } from "../components/tone.js";
9
9
  import { useMergedAttrs } from "../composables/useMergedClass.js";
10
10
  import { useLabels } from "../composables/useLpConfig.js";
@@ -3,7 +3,7 @@ import { useLabels } from "../composables/useLpConfig.js";
3
3
  import { _ as _sfc_main$2 } from "./LpButton-BvVoF-PO.js";
4
4
  import { _ as _sfc_main$1 } from "./LpDropdownMenu-CdCe7D2d.js";
5
5
  import { _ as _sfc_main$4 } from "./LpInput-DGMpxrcg.js";
6
- import { _ as _sfc_main$3 } from "./LpModal-D1E7rQzw.js";
6
+ import { _ as _sfc_main$3 } from "./LpModal-COMHrBKL.js";
7
7
  const _sfc_main = /* @__PURE__ */ defineComponent({
8
8
  __name: "LpWorkspaceSwitcher",
9
9
  props: {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, useModel, openBlock, createBlock, withCtx, createVNode, mergeProps, createElementVNode, mergeModels } from "vue";
2
2
  import { _ as _sfc_main$2 } from "./LpButton-BvVoF-PO.js";
3
3
  import { _ as _sfc_main$3 } from "./LpIcon-CxHFPwKt.js";
4
- import { _ as _sfc_main$1 } from "./LpTooltip-BKde8Xjv.js";
4
+ import { _ as _sfc_main$1 } from "./LpTooltip-Bt1ZFViJ.js";
5
5
  const _hoisted_1 = { class: "grid place-items-center" };
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  ...{ inheritAttrs: false },
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpAddressInput-BCqR0zmv.js";
1
+ import { _ as _sfc_main } from "../chunks/LpAddressInput-C5VIgRp0.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpAppShell-xEBmGV78.js";
1
+ import { _ as _sfc_main } from "../chunks/LpAppShell-C4b3ySa_.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpCodeBlock-BgWcg2mk.js";
1
+ import { _ as _sfc_main } from "../chunks/LpCodeBlock-DTU40x8P.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpCodeDisplay-DBi1YPLp.js";
1
+ import { _ as _sfc_main } from "../chunks/LpCodeDisplay-F2hjLb0X.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -10,7 +10,7 @@ import { _ as _sfc_main$6 } from "../chunks/PalettePreviewBoundary-B0Hhu3Yw.js";
10
10
  import { _ as _sfc_main$5 } from "../chunks/LpAvatar-CfLBqlY1.js";
11
11
  import { _ as _sfc_main$1 } from "../chunks/LpIcon-CxHFPwKt.js";
12
12
  import { _ as _sfc_main$2 } from "../chunks/LpLoader-Bf1yZwaU.js";
13
- import { _ as _sfc_main$4 } from "../chunks/LpScrollArea-CqvwfZs2.js";
13
+ import { _ as _sfc_main$4 } from "../chunks/LpScrollArea-B_1KZOSS.js";
14
14
  import MenuShortcut from "./MenuShortcut.vue.js";
15
15
  import { staggerDelay } from "./reveal.js";
16
16
  import { usePersisted } from "../composables/usePersisted.js";
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpConfirmDialog-y6k0ryWR.js";
1
+ import { _ as _sfc_main } from "../chunks/LpConfirmDialog-DrHcIxRn.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpConfirmHost-D-X0tDym.js";
1
+ import { _ as _sfc_main } from "../chunks/LpConfirmHost-D0Cd8FA_.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpCopyButton-BGzw95Xc.js";
1
+ import { _ as _sfc_main } from "../chunks/LpCopyButton-CiqUS4SX.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpDataList-B56Gu6Yt.js";
1
+ import { _ as _sfc_main } from "../chunks/LpDataList-Cit9fOSp.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -6,7 +6,7 @@ import { useRovingFocus } from "../composables/useRovingFocus.js";
6
6
  import { isHTMLElement } from "../composables/realm.js";
7
7
  import { dockSize } from "./dock.js";
8
8
  import { _ as _sfc_main$2 } from "../chunks/LpIcon-CxHFPwKt.js";
9
- import { _ as _sfc_main$1 } from "../chunks/LpTooltip-BKde8Xjv.js";
9
+ import { _ as _sfc_main$1 } from "../chunks/LpTooltip-Bt1ZFViJ.js";
10
10
  import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper-1tPrXgE0.js";
11
11
  import '../assets/LpDock-Dw82tWVD.css';const _hoisted_1 = ["aria-orientation", "data-orientation"];
12
12
  const __default__ = { inheritAttrs: false };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpDrawer-BkWjFdV0.js";
1
+ import { _ as _sfc_main } from "../chunks/LpDrawer-BHlqi62K.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpFileTree-BN_zybBN.js";
1
+ import { _ as _sfc_main } from "../chunks/LpFileTree-gVjF_b6r.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "../chunks/LpInspector-oTfkOdYd.js";
1
+ import { _ as _sfc_main } from "../chunks/LpInspector-DSL1lINx.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };