@leavepulse/ui 0.94.1 → 0.95.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{LpTable-DxnthVz4.css → LpTable-BJjNEvgJ.css} +57 -30
- package/dist/chunks/{LpAddressInput-BCqR0zmv.js → LpAddressInput-C5VIgRp0.js} +1 -1
- package/dist/chunks/{LpAppShell-DlpQierx.js → LpAppShell-C4b3ySa_.js} +3 -3
- package/dist/chunks/{LpCodeBlock-BgWcg2mk.js → LpCodeBlock-DTU40x8P.js} +1 -1
- package/dist/chunks/{LpCodeDisplay-DBi1YPLp.js → LpCodeDisplay-F2hjLb0X.js} +2 -2
- package/dist/chunks/{LpConfirmDialog-y6k0ryWR.js → LpConfirmDialog-DrHcIxRn.js} +1 -1
- package/dist/chunks/{LpConfirmHost-D-X0tDym.js → LpConfirmHost-D0Cd8FA_.js} +1 -1
- package/dist/chunks/{LpCopyButton-BGzw95Xc.js → LpCopyButton-CiqUS4SX.js} +1 -1
- package/dist/chunks/{LpDataList-B56Gu6Yt.js → LpDataList-Cit9fOSp.js} +2 -2
- package/dist/chunks/{LpDrawer-BkWjFdV0.js → LpDrawer-BHlqi62K.js} +1 -1
- package/dist/chunks/{LpFileTree-BN_zybBN.js → LpFileTree-gVjF_b6r.js} +1 -1
- package/dist/chunks/{LpInspector-oTfkOdYd.js → LpInspector-DSL1lINx.js} +2 -2
- package/dist/chunks/{LpLightbox-DPgz7IsT.js → LpLightbox--EwvQGe-.js} +1 -1
- package/dist/chunks/{LpLogViewer-BuIzr_6h.js → LpLogViewer-DSq9e8mT.js} +1 -1
- package/dist/chunks/{LpMediaGallery-CTejKF2-.js → LpMediaGallery-DlYJf3DS.js} +1 -1
- package/dist/chunks/{LpModal-D1E7rQzw.js → LpModal-COMHrBKL.js} +1 -1
- package/dist/chunks/{LpModalNav-BFjiHWbr.js → LpModalNav-Cj02cfhL.js} +2 -2
- package/dist/chunks/{LpNotificationBell-KRgdRZs-.js → LpNotificationBell-DNGijtmW.js} +1 -1
- package/dist/chunks/{LpNotificationFeed-CMGYU8c-.js → LpNotificationFeed-BoovbtfL.js} +3 -3
- package/dist/chunks/{LpPageScrollbar-C9sTeU-2.js → LpPageScrollbar-BniFeL2U.js} +5 -1
- package/dist/chunks/{LpPaletteTheme-CLwO-SDf.js → LpPaletteTheme-_FwkJO2o.js} +1 -1
- package/dist/chunks/{LpPasswordInput-LPVI7D3v.js → LpPasswordInput-BBDz2zyU.js} +1 -1
- package/dist/chunks/{LpPie-CsiBXe-e.js → LpPie-CtC4XdhC.js} +1 -1
- package/dist/chunks/{LpPipeline-DVcoSs--.js → LpPipeline-aCALaUY8.js} +1 -1
- package/dist/chunks/{LpRelativeTime-CN5bWD73.js → LpRelativeTime-9MHlbq6F.js} +1 -1
- package/dist/chunks/{LpScrollArea-CqvwfZs2.js → LpScrollArea-B_1KZOSS.js} +11 -1
- package/dist/chunks/{LpSecretField-BwrZ4TfT.js → LpSecretField-C9vwMFQ6.js} +4 -4
- package/dist/chunks/{LpSidebar-BKhVDsMt.js → LpSidebar-DPri9uyz.js} +3 -3
- package/dist/chunks/{LpSidebarNav-DbCap8z1.js → LpSidebarNav-CV1rU6La.js} +1 -1
- package/dist/chunks/{LpThemeStudio-BPPctXgd.js → LpThemeStudio-yiEdFJQL.js} +1 -1
- package/dist/chunks/{LpThemeSwitcher-B3c44xFH.js → LpThemeSwitcher-DKkCFaFk.js} +1 -1
- package/dist/chunks/{LpToaster-Cdx1tnHB.js → LpToaster-C7hHkGOA.js} +1 -1
- package/dist/chunks/LpTooltip-Bt1ZFViJ.js +333 -0
- package/dist/chunks/{LpTruncate-C_C8eiIE.js → LpTruncate-DEHWL1OA.js} +2 -2
- package/dist/chunks/{LpUptimeBar-Dt6SY_-m.js → LpUptimeBar-CXgzU5ym.js} +1 -1
- package/dist/chunks/{LpWorkspaceSwitcher-DCIiOQt_.js → LpWorkspaceSwitcher-CrUVSI7x.js} +1 -1
- package/dist/chunks/{RevealToggle-BsYxY6Oz.js → RevealToggle-D9Vs88kM.js} +1 -1
- package/dist/components/LpAddressInput.vue.js +1 -1
- package/dist/components/LpAppShell.vue.js +1 -1
- package/dist/components/LpCodeBlock.vue.js +1 -1
- package/dist/components/LpCodeDisplay.vue.js +1 -1
- package/dist/components/LpCommandPalette.vue.js +1 -1
- package/dist/components/LpConfirmDialog.vue.js +1 -1
- package/dist/components/LpConfirmHost.vue.js +1 -1
- package/dist/components/LpCopyButton.vue.js +1 -1
- package/dist/components/LpDataList.vue.js +1 -1
- package/dist/components/LpDock.vue.js +1 -1
- package/dist/components/LpDrawer.vue.js +1 -1
- package/dist/components/LpFileTree.vue.js +1 -1
- package/dist/components/LpInspector.vue.js +1 -1
- package/dist/components/LpLightbox.vue.js +1 -1
- package/dist/components/LpLogViewer.vue.js +1 -1
- package/dist/components/LpMediaGallery.vue.js +1 -1
- package/dist/components/LpModal.vue.js +1 -1
- package/dist/components/LpModalNav.vue.js +1 -1
- package/dist/components/LpNotificationBell.vue.js +1 -1
- package/dist/components/LpNotificationFeed.vue.js +1 -1
- package/dist/components/LpPageScrollbar.vue.js +1 -1
- package/dist/components/LpPaletteTheme.vue.js +1 -1
- package/dist/components/LpPasswordInput.vue.js +1 -1
- package/dist/components/LpPie.vue.js +1 -1
- package/dist/components/LpPipeline.vue.js +1 -1
- package/dist/components/LpRelativeTime.vue.js +1 -1
- package/dist/components/LpScrollArea.vue.js +1 -1
- package/dist/components/LpSecretField.vue.js +1 -1
- package/dist/components/LpShortcutsDialog.vue.js +1 -1
- package/dist/components/LpSidebar.vue.js +1 -1
- package/dist/components/LpSidebarNav.vue.js +1 -1
- package/dist/components/LpTable.vue.js +38 -12
- package/dist/components/LpThemeStudio.vue.js +1 -1
- package/dist/components/LpThemeSwitcher.vue.js +1 -1
- package/dist/components/LpToaster.vue.js +1 -1
- package/dist/components/LpTooltip.vue.d.ts +3 -3
- package/dist/components/LpTooltip.vue.js +1 -1
- package/dist/components/LpTruncate.vue.js +1 -1
- package/dist/components/LpUptimeBar.vue.js +1 -1
- package/dist/components/LpWorkspaceSwitcher.vue.js +1 -1
- package/dist/components/RevealToggle.vue.js +1 -1
- package/dist/components/tableFeatures.d.ts +1 -0
- package/dist/components/tableFeatures.js +25 -0
- package/dist/composables/useShift.js +28 -11
- package/dist/index.d.ts +2 -0
- package/dist/index.js +36 -34
- package/package.json +1 -1
- package/src/components/LpPageScrollbar.vue +14 -1
- package/src/components/LpScrollArea.vue +18 -1
- package/src/components/LpTable.vue +76 -4
- package/src/components/LpTooltip.vue +153 -14
- package/src/components/tableFeatures.ts +36 -0
- package/src/composables/useShift.ts +45 -15
- package/src/index.ts +2 -0
- package/dist/chunks/LpTooltip-BKde8Xjv.js +0 -230
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, onBeforeUnmount, useAttrs, computed, mergeProps, openBlock, createBlock, resolveDynamicComponent, unref, normalizeProps, guardReactiveProps, withCtx, createVNode, renderSlot, normalizeStyle, normalizeClass, createElementVNode, createTextVNode, toDisplayString } from "vue";
|
|
2
|
-
import { clamp } from "../composables/clamp.js";
|
|
3
|
-
import { injectTooltipProviderContext, 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
|
-
heldOpen.value = true;
|
|
111
|
-
wanted.value = true;
|
|
112
|
-
open.value = true;
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
function release() {
|
|
116
|
-
heldOpen.value = false;
|
|
117
|
-
wanted.value = false;
|
|
118
|
-
open.value = false;
|
|
119
|
-
}
|
|
120
|
-
const onOpenChange = (next) => {
|
|
121
|
-
if (!next && heldOpen.value) return;
|
|
122
|
-
wanted.value = next;
|
|
123
|
-
open.value = next && !props.disabled;
|
|
124
|
-
if (!open.value || !props.followCursor) return;
|
|
125
|
-
jumpToTarget();
|
|
126
|
-
};
|
|
127
|
-
watch(
|
|
128
|
-
() => props.disabled,
|
|
129
|
-
(off) => {
|
|
130
|
-
if (off) {
|
|
131
|
-
hold.cancel();
|
|
132
|
-
heldOpen.value = false;
|
|
133
|
-
open.value = false;
|
|
134
|
-
} else if (wanted.value) open.value = true;
|
|
135
|
-
}
|
|
136
|
-
);
|
|
137
|
-
const view = useView();
|
|
138
|
-
watch(
|
|
139
|
-
() => open.value && props.followCursor,
|
|
140
|
-
(following, _, onCleanup) => {
|
|
141
|
-
if (!following) {
|
|
142
|
-
stopSpring();
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const win = viewWindow(view.value);
|
|
146
|
-
win.addEventListener("resize", follow);
|
|
147
|
-
onCleanup(() => win.removeEventListener("resize", follow));
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
watch(heldOpen, (held, _, onCleanup) => {
|
|
151
|
-
if (!held) return;
|
|
152
|
-
const win = viewWindow(view.value);
|
|
153
|
-
const onKey = (event) => event.key === "Escape" && release();
|
|
154
|
-
win.addEventListener("pointerdown", release, true);
|
|
155
|
-
win.addEventListener("keydown", onKey, true);
|
|
156
|
-
onCleanup(() => {
|
|
157
|
-
win.removeEventListener("pointerdown", release, true);
|
|
158
|
-
win.removeEventListener("keydown", onKey, true);
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
onBeforeUnmount(stopSpring);
|
|
162
|
-
const portalTo = usePortalTarget();
|
|
163
|
-
const guardOutside = useOutsideGuard();
|
|
164
|
-
const attrs = useAttrs();
|
|
165
|
-
const triggerAttrs = computed(() => mergeProps(attrs, hold.handlers));
|
|
166
|
-
return (_ctx, _cache) => {
|
|
167
|
-
return openBlock(), createBlock(resolveDynamicComponent(unref(shared) ? PassThrough : unref(TooltipProvider)), normalizeProps(guardReactiveProps(unref(shared) ? {} : { delayDuration: __props.delay ?? 200 })), {
|
|
168
|
-
default: withCtx(() => [
|
|
169
|
-
createVNode(unref(TooltipRoot), {
|
|
170
|
-
open: open.value,
|
|
171
|
-
"delay-duration": __props.delay,
|
|
172
|
-
"ignore-non-keyboard-focus": !__props.showOnPointerFocus,
|
|
173
|
-
"disable-hoverable-content": __props.followCursor,
|
|
174
|
-
"disable-closing-trigger": __props.followCursor,
|
|
175
|
-
"onUpdate:open": onOpenChange
|
|
176
|
-
}, {
|
|
177
|
-
default: withCtx(() => [
|
|
178
|
-
createVNode(unref(TooltipTrigger), mergeProps({ "as-child": "" }, triggerAttrs.value, {
|
|
179
|
-
"aria-label": __props.label ? __props.content : void 0,
|
|
180
|
-
class: __props.touch === "hold" && !__props.followCursor ? "[-webkit-touch-callout:none]" : void 0,
|
|
181
|
-
onPointermove: onPointerMove
|
|
182
|
-
}), {
|
|
183
|
-
default: withCtx(() => [
|
|
184
|
-
renderSlot(_ctx.$slots, "default")
|
|
185
|
-
]),
|
|
186
|
-
_: 3
|
|
187
|
-
}, 16, ["aria-label", "class"]),
|
|
188
|
-
createVNode(unref(TooltipPortal), { to: unref(portalTo) }, {
|
|
189
|
-
default: withCtx(() => [
|
|
190
|
-
createVNode(unref(TooltipContent), {
|
|
191
|
-
onInteractOutside: unref(guardOutside),
|
|
192
|
-
onEscapeKeyDown: unref(guardOutside),
|
|
193
|
-
side: __props.side,
|
|
194
|
-
"side-offset": __props.sideOffset ?? 6,
|
|
195
|
-
"collision-padding": 8,
|
|
196
|
-
"data-lp-follow": __props.followCursor ? "" : void 0,
|
|
197
|
-
class: normalizeClass([
|
|
198
|
-
unref(PANEL_SURFACE),
|
|
199
|
-
unref(TOOLTIP_ANIM),
|
|
200
|
-
"z-(--z-tooltip) max-w-[min(20rem,90vw)] px-2.5 py-1.5 text-xs text-ink"
|
|
201
|
-
]),
|
|
202
|
-
style: normalizeStyle(__props.followCursor ? { translate: `${offset.value.x}px ${offset.value.y}px` } : void 0)
|
|
203
|
-
}, {
|
|
204
|
-
default: withCtx(() => [
|
|
205
|
-
createElementVNode("div", {
|
|
206
|
-
ref_key: "tipBody",
|
|
207
|
-
ref: tipBody
|
|
208
|
-
}, [
|
|
209
|
-
renderSlot(_ctx.$slots, "content", {}, () => [
|
|
210
|
-
createTextVNode(toDisplayString(__props.content), 1)
|
|
211
|
-
])
|
|
212
|
-
], 512)
|
|
213
|
-
]),
|
|
214
|
-
_: 3
|
|
215
|
-
}, 8, ["onInteractOutside", "onEscapeKeyDown", "side", "side-offset", "data-lp-follow", "class", "style"])
|
|
216
|
-
]),
|
|
217
|
-
_: 3
|
|
218
|
-
}, 8, ["to"])
|
|
219
|
-
]),
|
|
220
|
-
_: 3
|
|
221
|
-
}, 8, ["open", "delay-duration", "ignore-non-keyboard-focus", "disable-hoverable-content", "disable-closing-trigger"])
|
|
222
|
-
]),
|
|
223
|
-
_: 3
|
|
224
|
-
}, 16);
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
export {
|
|
229
|
-
_sfc_main as _
|
|
230
|
-
};
|