@leavepulse/ui 0.24.1 → 0.26.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.
- package/dist/assets/LpNumberFlow-rZkwQwlU.css +116 -0
- package/dist/assets/LpRollingText-CR1mb0Vt.css +74 -0
- package/dist/assets/LpSkeleton-D7xU8IPV.css +29 -0
- package/dist/assets/LpSparkline-0mKTq7pb.css +51 -0
- package/dist/assets/LpTooltip-B61SYd4K.css +17 -0
- package/dist/assets/LpUptimeBar-B98o9krI.css +18 -0
- package/dist/chunks/LpChart-tNXs1ttr.js +671 -0
- package/dist/chunks/{LpConfirmDialog-CObRah9c.js → LpConfirmDialog-CjOGcj1e.js} +32 -4
- package/dist/chunks/{LpFileTree-H7Ho8uoq.js → LpFileTree-BaV7f0O7.js} +1 -1
- package/dist/chunks/{LpFileTreeNode-BEZIvxHi.js → LpFileTreeNode-BzpBa7R7.js} +5 -7
- package/dist/chunks/{LpLogViewer-B1aLUVdz.js → LpLogViewer-CcQ3s3Fp.js} +2 -1
- package/dist/chunks/{LpMapPicker-DFKrd1Ne.js → LpMapPicker-CXvoTrAe.js} +2 -4
- package/dist/chunks/{LpNotificationBell-X1M30e0X.js → LpNotificationBell-Dvu-b6Vn.js} +56 -27
- package/dist/chunks/LpNumberFlow-amWYaeuA.js +221 -0
- package/dist/chunks/LpPie-BkjWlfSw.js +525 -0
- package/dist/chunks/LpProgress-DoIP4jQR.js +198 -0
- package/dist/chunks/LpRollingText-CM5gkSeF.js +50 -0
- package/dist/chunks/LpSkeleton-t5mMYl3a.js +29 -0
- package/dist/chunks/LpSparkline-C6xQ2dwv.js +175 -0
- package/dist/chunks/{LpStat-CdbEFOvn.js → LpStat-CDanpzU0.js} +43 -5
- package/dist/chunks/{LpThemeSwitcher-BgpJgrnP.js → LpThemeSwitcher-7mAK6bI7.js} +2 -4
- package/dist/chunks/LpTooltip-hCLPAqMG.js +131 -0
- package/dist/chunks/LpUptimeBar-DcQ8HikG.js +152 -0
- package/dist/component-names.d.ts +1 -1
- package/dist/components/LpChart.vue.d.ts +88 -0
- package/dist/components/LpChart.vue.js +4 -0
- package/dist/components/LpConfirmDialog.vue.d.ts +18 -2
- package/dist/components/LpConfirmDialog.vue.js +1 -1
- package/dist/components/LpFileTree.vue.d.ts +1 -1
- package/dist/components/LpFileTree.vue.js +1 -1
- package/dist/components/LpFileTreeNode.vue.js +1 -1
- package/dist/components/LpLightbox.vue.d.ts +1 -1
- package/dist/components/LpLogViewer.vue.d.ts +1 -1
- package/dist/components/LpLogViewer.vue.js +1 -1
- package/dist/components/LpMapPicker.vue.js +1 -1
- package/dist/components/LpNotificationBell.vue.d.ts +12 -0
- package/dist/components/LpNotificationBell.vue.js +1 -1
- package/dist/components/LpNumberFlow.vue.d.ts +35 -0
- package/dist/components/LpNumberFlow.vue.js +4 -0
- package/dist/components/LpPie.vue.d.ts +134 -0
- package/dist/components/LpPie.vue.js +4 -0
- package/dist/components/LpProgress.vue.d.ts +56 -2
- package/dist/components/LpProgress.vue.js +1 -1
- package/dist/components/LpRollingText.vue.d.ts +33 -0
- package/dist/components/LpRollingText.vue.js +4 -0
- package/dist/components/LpSkeleton.vue.d.ts +11 -1
- package/dist/components/LpSkeleton.vue.js +1 -1
- package/dist/components/LpSparkline.vue.d.ts +48 -0
- package/dist/components/LpSparkline.vue.js +4 -0
- package/dist/components/LpStat.vue.d.ts +25 -2
- package/dist/components/LpStat.vue.js +1 -1
- package/dist/components/LpThemeSwitcher.vue.js +1 -1
- package/dist/components/LpTooltip.vue.d.ts +24 -3
- package/dist/components/LpTooltip.vue.js +1 -1
- package/dist/components/LpUptimeBar.vue.js +1 -1
- package/dist/components/chart.d.ts +180 -0
- package/dist/components/chart.js +353 -0
- package/dist/composables/easing.d.ts +46 -0
- package/dist/composables/easing.js +23 -0
- package/dist/composables/usePillTransition.d.ts +13 -1
- package/dist/composables/usePillTransition.js +22 -2
- package/dist/composables/useReveal.d.ts +26 -0
- package/dist/composables/useReveal.js +45 -0
- package/dist/composables/useSettled.js +2 -2
- package/dist/composables/useShift.js +2 -4
- package/dist/index.d.ts +14 -0
- package/dist/index.js +125 -102
- package/package.json +2 -1
- package/src/component-names.ts +5 -0
- package/src/components/LpChart.vue +846 -0
- package/src/components/LpConfirmDialog.vue +49 -0
- package/src/components/LpFileTreeNode.vue +5 -9
- package/src/components/LpLogViewer.vue +2 -3
- package/src/components/LpMapPicker.vue +2 -5
- package/src/components/LpNotificationBell.vue +76 -15
- package/src/components/LpNumberFlow.vue +524 -0
- package/src/components/LpPie.vue +778 -0
- package/src/components/LpProgress.vue +283 -6
- package/src/components/LpRollingText.vue +157 -0
- package/src/components/LpSkeleton.vue +81 -8
- package/src/components/LpSparkline.vue +312 -0
- package/src/components/LpStat.vue +52 -4
- package/src/components/LpTooltip.vue +185 -3
- package/src/components/LpUptimeBar.vue +150 -53
- package/src/components/chart.ts +686 -0
- package/src/composables/easing.ts +88 -0
- package/src/composables/usePillTransition.ts +71 -6
- package/src/composables/useReveal.ts +113 -0
- package/src/composables/useSettled.ts +2 -4
- package/src/composables/useShift.ts +2 -8
- package/src/index.ts +19 -0
- package/src/theme/useTheme.ts +2 -8
- package/src/tokens/tokens.css +36 -0
- package/dist/chunks/LpProgress-BhI0IbjC.js +0 -37
- package/dist/chunks/LpSkeleton-eSFIo4kD.js +0 -22
- package/dist/chunks/LpTooltip-D1hbjQWG.js +0 -63
- package/dist/chunks/LpUptimeBar-CB366k0O.js +0 -127
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { defineComponent, ref, watch, onBeforeUnmount, openBlock, createBlock, unref, withCtx, createVNode, renderSlot, normalizeStyle, normalizeClass, createTextVNode, toDisplayString } from "vue";
|
|
2
|
+
import { TooltipProvider, TooltipRoot, TooltipTrigger, TooltipPortal, TooltipContent } from "reka-ui";
|
|
3
|
+
import { springStep, springSettled } from "../composables/usePillTransition.js";
|
|
4
|
+
import { PANEL_SURFACE, TOOLTIP_ANIM } from "../components/dropdown.js";
|
|
5
|
+
import '../assets/LpTooltip-B61SYd4K.css';const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "LpTooltip",
|
|
7
|
+
props: {
|
|
8
|
+
content: {},
|
|
9
|
+
sideOffset: {},
|
|
10
|
+
side: { default: "top" },
|
|
11
|
+
label: { type: Boolean },
|
|
12
|
+
delay: { default: 200 },
|
|
13
|
+
showOnPointerFocus: { type: Boolean },
|
|
14
|
+
followCursor: { type: Boolean },
|
|
15
|
+
disabled: { type: Boolean }
|
|
16
|
+
},
|
|
17
|
+
setup(__props) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
const target = { x: 0, y: 0 };
|
|
20
|
+
const offset = ref({ x: 0, y: 0 });
|
|
21
|
+
let sx = { value: 0, velocity: 0 };
|
|
22
|
+
let sy = { value: 0, velocity: 0 };
|
|
23
|
+
let frame = 0;
|
|
24
|
+
let lastFrame = 0;
|
|
25
|
+
const settle = (now) => {
|
|
26
|
+
const dt = lastFrame ? (now - lastFrame) / 1e3 : 1 / 60;
|
|
27
|
+
lastFrame = now;
|
|
28
|
+
frame = 0;
|
|
29
|
+
sx = springStep(sx, target.x, "float", dt);
|
|
30
|
+
sy = springStep(sy, target.y, "float", dt);
|
|
31
|
+
if (springSettled(sx, target.x) && springSettled(sy, target.y)) {
|
|
32
|
+
sx = { value: target.x, velocity: 0 };
|
|
33
|
+
sy = { value: target.y, velocity: 0 };
|
|
34
|
+
offset.value = { x: target.x, y: target.y };
|
|
35
|
+
lastFrame = 0;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
offset.value = { x: sx.value, y: sy.value };
|
|
39
|
+
frame = requestAnimationFrame(settle);
|
|
40
|
+
};
|
|
41
|
+
const onPointerMove = (e) => {
|
|
42
|
+
if (!props.followCursor) return;
|
|
43
|
+
const el = e.currentTarget;
|
|
44
|
+
if (!el) return;
|
|
45
|
+
const rect = el.getBoundingClientRect();
|
|
46
|
+
const halfX = props.side === "left" || props.side === "right" ? rect.width / 2 : 0;
|
|
47
|
+
const dirX = props.side === "right" ? -1 : 1;
|
|
48
|
+
target.x = e.clientX - (rect.left + rect.width / 2) + halfX * dirX;
|
|
49
|
+
const half = props.side === "top" || props.side === "bottom" ? rect.height / 2 : 0;
|
|
50
|
+
const dir = props.side === "bottom" ? -1 : 1;
|
|
51
|
+
target.y = e.clientY - (rect.top + rect.height / 2) + half * dir;
|
|
52
|
+
if (!frame) frame = requestAnimationFrame(settle);
|
|
53
|
+
};
|
|
54
|
+
const open = ref(false);
|
|
55
|
+
const wanted = ref(false);
|
|
56
|
+
const onOpenChange = (next) => {
|
|
57
|
+
wanted.value = next;
|
|
58
|
+
open.value = next && !props.disabled;
|
|
59
|
+
if (!open.value || !props.followCursor) return;
|
|
60
|
+
offset.value = { x: target.x, y: target.y };
|
|
61
|
+
sx = { value: target.x, velocity: 0 };
|
|
62
|
+
sy = { value: target.y, velocity: 0 };
|
|
63
|
+
lastFrame = 0;
|
|
64
|
+
};
|
|
65
|
+
watch(
|
|
66
|
+
() => props.disabled,
|
|
67
|
+
(off) => {
|
|
68
|
+
if (off) open.value = false;
|
|
69
|
+
else if (wanted.value) open.value = true;
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
onBeforeUnmount(() => {
|
|
73
|
+
if (frame) cancelAnimationFrame(frame);
|
|
74
|
+
});
|
|
75
|
+
return (_ctx, _cache) => {
|
|
76
|
+
return openBlock(), createBlock(unref(TooltipProvider), { "delay-duration": __props.delay }, {
|
|
77
|
+
default: withCtx(() => [
|
|
78
|
+
createVNode(unref(TooltipRoot), {
|
|
79
|
+
open: open.value,
|
|
80
|
+
"ignore-non-keyboard-focus": !__props.showOnPointerFocus,
|
|
81
|
+
"disable-hoverable-content": __props.followCursor,
|
|
82
|
+
"disable-closing-trigger": __props.followCursor,
|
|
83
|
+
"onUpdate:open": onOpenChange
|
|
84
|
+
}, {
|
|
85
|
+
default: withCtx(() => [
|
|
86
|
+
createVNode(unref(TooltipTrigger), {
|
|
87
|
+
"as-child": "",
|
|
88
|
+
"aria-label": __props.label ? __props.content : void 0,
|
|
89
|
+
onPointermove: onPointerMove
|
|
90
|
+
}, {
|
|
91
|
+
default: withCtx(() => [
|
|
92
|
+
renderSlot(_ctx.$slots, "default")
|
|
93
|
+
]),
|
|
94
|
+
_: 3
|
|
95
|
+
}, 8, ["aria-label"]),
|
|
96
|
+
createVNode(unref(TooltipPortal), null, {
|
|
97
|
+
default: withCtx(() => [
|
|
98
|
+
createVNode(unref(TooltipContent), {
|
|
99
|
+
side: __props.side,
|
|
100
|
+
"side-offset": __props.sideOffset ?? 6,
|
|
101
|
+
"collision-padding": 8,
|
|
102
|
+
"data-lp-follow": __props.followCursor ? "" : void 0,
|
|
103
|
+
class: normalizeClass([
|
|
104
|
+
unref(PANEL_SURFACE),
|
|
105
|
+
unref(TOOLTIP_ANIM),
|
|
106
|
+
"z-(--z-tooltip) max-w-[min(20rem,90vw)] px-2.5 py-1.5 text-xs text-ink"
|
|
107
|
+
]),
|
|
108
|
+
style: normalizeStyle(__props.followCursor ? { translate: `${offset.value.x}px ${offset.value.y}px` } : void 0)
|
|
109
|
+
}, {
|
|
110
|
+
default: withCtx(() => [
|
|
111
|
+
renderSlot(_ctx.$slots, "content", {}, () => [
|
|
112
|
+
createTextVNode(toDisplayString(__props.content), 1)
|
|
113
|
+
])
|
|
114
|
+
]),
|
|
115
|
+
_: 3
|
|
116
|
+
}, 8, ["side", "side-offset", "data-lp-follow", "class", "style"])
|
|
117
|
+
]),
|
|
118
|
+
_: 3
|
|
119
|
+
})
|
|
120
|
+
]),
|
|
121
|
+
_: 3
|
|
122
|
+
}, 8, ["open", "ignore-non-keyboard-focus", "disable-hoverable-content", "disable-closing-trigger"])
|
|
123
|
+
]),
|
|
124
|
+
_: 3
|
|
125
|
+
}, 8, ["delay-duration"]);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
export {
|
|
130
|
+
_sfc_main as _
|
|
131
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, createVNode, withCtx, Fragment, renderList, normalizeStyle, createBlock, createTextVNode } from "vue";
|
|
2
|
+
import { _ as _sfc_main$3 } from "./LpNumberFlow-amWYaeuA.js";
|
|
3
|
+
import { _ as _sfc_main$2 } from "./LpRollingText-CM5gkSeF.js";
|
|
4
|
+
import { _ as _sfc_main$1 } from "./LpTooltip-hCLPAqMG.js";
|
|
5
|
+
import '../assets/LpUptimeBar-B98o9krI.css';const _hoisted_1 = { class: "flex flex-col gap-1.5" };
|
|
6
|
+
const _hoisted_2 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "text-xs"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_3 = { class: "font-medium text-ink" };
|
|
11
|
+
const _hoisted_4 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "flex items-center gap-1.5"
|
|
14
|
+
};
|
|
15
|
+
const _hoisted_5 = ["aria-label", "onPointerenter"];
|
|
16
|
+
const _hoisted_6 = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "flex items-center gap-2 text-xs text-muted"
|
|
19
|
+
};
|
|
20
|
+
const _hoisted_7 = { class: "shrink-0" };
|
|
21
|
+
const _hoisted_8 = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "shrink-0 text-muted-strong"
|
|
24
|
+
};
|
|
25
|
+
const _hoisted_9 = { class: "shrink-0" };
|
|
26
|
+
const MARK_WIDTH = 0.64;
|
|
27
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
28
|
+
__name: "LpUptimeBar",
|
|
29
|
+
props: {
|
|
30
|
+
segments: {},
|
|
31
|
+
startLabel: {},
|
|
32
|
+
endLabel: {},
|
|
33
|
+
showUptime: { type: Boolean, default: true },
|
|
34
|
+
title: {},
|
|
35
|
+
colors: {}
|
|
36
|
+
},
|
|
37
|
+
setup(__props) {
|
|
38
|
+
const props = __props;
|
|
39
|
+
const defaultColor = {
|
|
40
|
+
operational: "var(--color-action)",
|
|
41
|
+
degraded: "var(--color-accent)",
|
|
42
|
+
down: "var(--color-danger)",
|
|
43
|
+
maintenance: "var(--color-brand)",
|
|
44
|
+
empty: "var(--color-surface-soft)"
|
|
45
|
+
};
|
|
46
|
+
const opacityFor = (status) => status === "empty" ? 0.4 : 1;
|
|
47
|
+
const colorFor = (status) => props.colors?.[status] ?? defaultColor[status];
|
|
48
|
+
const statusLabel = {
|
|
49
|
+
operational: "Operational",
|
|
50
|
+
degraded: "Degraded",
|
|
51
|
+
down: "Down",
|
|
52
|
+
maintenance: "Maintenance",
|
|
53
|
+
empty: "No data"
|
|
54
|
+
};
|
|
55
|
+
const uptimePct = computed(() => {
|
|
56
|
+
const tracked = props.segments.filter((s) => s.status !== "empty");
|
|
57
|
+
if (!tracked.length) return null;
|
|
58
|
+
const up = tracked.filter((s) => s.status === "operational" || s.status === "maintenance").length;
|
|
59
|
+
return up / tracked.length * 100;
|
|
60
|
+
});
|
|
61
|
+
const hovered = ref(null);
|
|
62
|
+
const tip = computed(() => {
|
|
63
|
+
const i = hovered.value;
|
|
64
|
+
if (i == null) return null;
|
|
65
|
+
const seg = props.segments[i];
|
|
66
|
+
if (!seg) return null;
|
|
67
|
+
return { status: seg.status, text: seg.label ?? statusLabel[seg.status] };
|
|
68
|
+
});
|
|
69
|
+
const uptimeDecimals = computed(() => {
|
|
70
|
+
const v = uptimePct.value;
|
|
71
|
+
if (v == null) return 0;
|
|
72
|
+
const trimmed = Number(v.toFixed(2));
|
|
73
|
+
return Number.isInteger(trimmed) ? 0 : String(trimmed).split(".")[1].length;
|
|
74
|
+
});
|
|
75
|
+
return (_ctx, _cache) => {
|
|
76
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
77
|
+
__props.title ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
78
|
+
createElementVNode("span", _hoisted_3, toDisplayString(__props.title), 1)
|
|
79
|
+
])) : createCommentVNode("", true),
|
|
80
|
+
createVNode(_sfc_main$1, {
|
|
81
|
+
delay: 80,
|
|
82
|
+
"follow-cursor": "",
|
|
83
|
+
side: "top",
|
|
84
|
+
disabled: hovered.value === null
|
|
85
|
+
}, {
|
|
86
|
+
content: withCtx(() => [
|
|
87
|
+
tip.value ? (openBlock(), createElementBlock("span", _hoisted_4, [
|
|
88
|
+
createElementVNode("span", {
|
|
89
|
+
class: "size-1.5 shrink-0 rounded-full",
|
|
90
|
+
style: normalizeStyle({ backgroundColor: colorFor(tip.value.status) })
|
|
91
|
+
}, null, 4),
|
|
92
|
+
createVNode(_sfc_main$2, {
|
|
93
|
+
value: tip.value.text,
|
|
94
|
+
duration: 180,
|
|
95
|
+
align: "start"
|
|
96
|
+
}, null, 8, ["value"])
|
|
97
|
+
])) : createCommentVNode("", true)
|
|
98
|
+
]),
|
|
99
|
+
default: withCtx(() => [
|
|
100
|
+
createElementVNode("div", {
|
|
101
|
+
class: "lp-uptime flex h-[34px] items-stretch",
|
|
102
|
+
onPointerleave: _cache[0] || (_cache[0] = ($event) => hovered.value = null)
|
|
103
|
+
}, [
|
|
104
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.segments, (seg, i) => {
|
|
105
|
+
return openBlock(), createElementBlock("button", {
|
|
106
|
+
key: i,
|
|
107
|
+
type: "button",
|
|
108
|
+
class: "lp-uptime__slot min-w-0 flex-1 outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
109
|
+
"aria-label": seg.label ?? statusLabel[seg.status],
|
|
110
|
+
onPointerenter: ($event) => hovered.value = i
|
|
111
|
+
}, [
|
|
112
|
+
createElementVNode("span", {
|
|
113
|
+
class: "lp-uptime__mark block h-full rounded-[1px] transition-[opacity,scale] duration-[var(--duration-fast)] motion-reduce:transition-none",
|
|
114
|
+
style: normalizeStyle({
|
|
115
|
+
backgroundColor: colorFor(seg.status),
|
|
116
|
+
opacity: hovered.value === i ? 1 : opacityFor(seg.status),
|
|
117
|
+
// Both axes every time: the x factor is what holds the gap open
|
|
118
|
+
// (see the stylesheet), so a hover that set only y would widen
|
|
119
|
+
// the slice into its neighbours' spacing.
|
|
120
|
+
scale: hovered.value === i ? `${MARK_WIDTH} 1.12` : void 0
|
|
121
|
+
})
|
|
122
|
+
}, null, 4)
|
|
123
|
+
], 40, _hoisted_5);
|
|
124
|
+
}), 128))
|
|
125
|
+
], 32)
|
|
126
|
+
]),
|
|
127
|
+
_: 1
|
|
128
|
+
}, 8, ["disabled"]),
|
|
129
|
+
__props.startLabel || __props.endLabel || __props.showUptime ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
130
|
+
createElementVNode("span", _hoisted_7, toDisplayString(__props.startLabel), 1),
|
|
131
|
+
_cache[2] || (_cache[2] = createElementVNode("span", { class: "h-px flex-1 bg-line" }, null, -1)),
|
|
132
|
+
__props.showUptime ? (openBlock(), createElementBlock("span", _hoisted_8, [
|
|
133
|
+
uptimePct.value != null ? (openBlock(), createBlock(_sfc_main$3, {
|
|
134
|
+
key: 0,
|
|
135
|
+
value: uptimePct.value,
|
|
136
|
+
decimals: uptimeDecimals.value,
|
|
137
|
+
suffix: "%"
|
|
138
|
+
}, null, 8, ["value", "decimals"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
139
|
+
createTextVNode("—")
|
|
140
|
+
], 64)),
|
|
141
|
+
_cache[1] || (_cache[1] = createElementVNode("span", { class: "text-muted" }, " uptime", -1))
|
|
142
|
+
])) : createCommentVNode("", true),
|
|
143
|
+
_cache[3] || (_cache[3] = createElementVNode("span", { class: "h-px flex-1 bg-line" }, null, -1)),
|
|
144
|
+
createElementVNode("span", _hoisted_9, toDisplayString(__props.endLabel), 1)
|
|
145
|
+
])) : createCommentVNode("", true)
|
|
146
|
+
]);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
export {
|
|
151
|
+
_sfc_main as _
|
|
152
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const COMPONENT_NAMES: readonly ["LayoutCanvas", "LayoutNode", "LpAddressInput", "LpAlert", "LpAppShell", "LpAutocomplete", "LpAvatar", "LpBadge", "LpBreadcrumbs", "LpButton", "LpCalendar", "LpCard", "LpCheckbox", "LpCodeBlock", "LpCommandPalette", "LpConfirmDialog", "LpContextMenu", "LpDatePicker", "LpDisclosure", "LpDivider", "LpDrawer", "LpDropdownMenu", "LpEmptyState", "LpFileTree", "LpFileTreeNode", "LpFormField", "LpIcon", "LpInfraNode", "LpInput", "LpLaneNode", "LpLightbox", "LpLink", "LpLogViewer", "LpMapPicker", "LpModal", "LpNotificationBell", "LpNumberField", "LpOtpInput", "LpPagination", "LpPasswordInput", "LpPhoneInput", "LpPopover", "LpProgress", "LpRadio", "LpRadioGroup", "LpScrollArea", "LpSegmented", "LpSelect", "LpServiceNode", "LpShift", "LpShortcutsDialog", "LpSidebar", "LpSidebarNav", "LpSkeleton", "LpSlider", "LpStat", "LpStepper", "LpSwitch", "LpTable", "LpTableOfContents", "LpTabs", "LpTextarea", "LpThemeSwitcher", "LpTilt", "LpToaster", "LpTooltip", "LpTopologyCanvas", "LpUptimeBar", "LpWaypointEdge"];
|
|
1
|
+
export declare const COMPONENT_NAMES: readonly ["LayoutCanvas", "LayoutNode", "LpAddressInput", "LpAlert", "LpAppShell", "LpAutocomplete", "LpAvatar", "LpBadge", "LpBreadcrumbs", "LpButton", "LpCalendar", "LpCard", "LpChart", "LpCheckbox", "LpCodeBlock", "LpCommandPalette", "LpConfirmDialog", "LpContextMenu", "LpDatePicker", "LpDisclosure", "LpDivider", "LpDrawer", "LpDropdownMenu", "LpEmptyState", "LpFileTree", "LpFileTreeNode", "LpFormField", "LpIcon", "LpInfraNode", "LpInput", "LpLaneNode", "LpLightbox", "LpLink", "LpLogViewer", "LpMapPicker", "LpModal", "LpNotificationBell", "LpNumberField", "LpNumberFlow", "LpOtpInput", "LpPagination", "LpPasswordInput", "LpPhoneInput", "LpPie", "LpPopover", "LpProgress", "LpRadio", "LpRadioGroup", "LpRollingText", "LpScrollArea", "LpSegmented", "LpSelect", "LpServiceNode", "LpShift", "LpShortcutsDialog", "LpSidebar", "LpSidebarNav", "LpSkeleton", "LpSlider", "LpSparkline", "LpStat", "LpStepper", "LpSwitch", "LpTable", "LpTableOfContents", "LpTabs", "LpTextarea", "LpThemeSwitcher", "LpTilt", "LpToaster", "LpTooltip", "LpTopologyCanvas", "LpUptimeBar", "LpWaypointEdge"];
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ChartSeries } from './chart';
|
|
2
|
+
import { ContextMenuItemDef } from './LpContextMenu.vue';
|
|
3
|
+
/** What was under the pointer when a point was clicked or right-clicked. */
|
|
4
|
+
export interface ChartPointEvent {
|
|
5
|
+
index: number;
|
|
6
|
+
label: string;
|
|
7
|
+
/** Every series' value at this index, in `series` order (hidden included). */
|
|
8
|
+
values: (number | null)[];
|
|
9
|
+
/** The original event, for callers that need modifiers or coordinates. */
|
|
10
|
+
originalEvent: MouseEvent;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Props = {
|
|
13
|
+
series: ChartSeries[];
|
|
14
|
+
/** Shared x-axis labels; a point's own `x` overrides its slot. */
|
|
15
|
+
labels?: string[];
|
|
16
|
+
type?: "line" | "area" | "bar";
|
|
17
|
+
/** Plot height in px. The width always fills the container. */
|
|
18
|
+
height?: number;
|
|
19
|
+
/** Headline above the plot. */
|
|
20
|
+
title?: string;
|
|
21
|
+
/** Sub-headline under the title. */
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
/** Curve tension for line/area. 0 = straight polyline, 1 = fully smooth. */
|
|
24
|
+
smooth?: number;
|
|
25
|
+
/** Draw a dot at every point rather than only the hovered one. */
|
|
26
|
+
showPoints?: boolean;
|
|
27
|
+
showGrid?: boolean;
|
|
28
|
+
showXAxis?: boolean;
|
|
29
|
+
showYAxis?: boolean;
|
|
30
|
+
/** Legend also toggles series visibility on click. */
|
|
31
|
+
showLegend?: boolean;
|
|
32
|
+
/** Roughly how many y ticks to aim for; bounds are rounded to fit. */
|
|
33
|
+
yTicks?: number;
|
|
34
|
+
/** Force the y-axis to include 0 (bars always do). */
|
|
35
|
+
includeZero?: boolean;
|
|
36
|
+
/** Appended to values in ticks and the tooltip, e.g. "%" or " ms". */
|
|
37
|
+
unit?: string;
|
|
38
|
+
/** Unit for series on the right axis. Falls back to `unit`. */
|
|
39
|
+
rightUnit?: string;
|
|
40
|
+
/** Custom value formatter; overrides the compact 1.2k default. */
|
|
41
|
+
formatValue?: (v: number) => string;
|
|
42
|
+
/** Formatter for the right axis. Falls back to `formatValue`. */
|
|
43
|
+
formatRightValue?: (v: number) => string;
|
|
44
|
+
/** Stack bars instead of grouping them side by side. */
|
|
45
|
+
stacked?: boolean;
|
|
46
|
+
/** Grow the marks in on mount and on data change. */
|
|
47
|
+
animate?: boolean;
|
|
48
|
+
/** Shown when every series is empty. */
|
|
49
|
+
emptyLabel?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Right-click menu for a point, built from whatever was hit. Return [] to
|
|
52
|
+
* leave the browser's own menu alone for that point. Which actions a point
|
|
53
|
+
* offers is an application question — "compare with last week", "open the
|
|
54
|
+
* incident", "copy value" — so the chart supplies the context and the
|
|
55
|
+
* caller supplies the items.
|
|
56
|
+
*/
|
|
57
|
+
menuItems?: (point: ChartPointEvent) => ContextMenuItemDef[];
|
|
58
|
+
};
|
|
59
|
+
declare var __VLS_1: {};
|
|
60
|
+
type __VLS_Slots = {} & {
|
|
61
|
+
actions?: (props: typeof __VLS_1) => any;
|
|
62
|
+
};
|
|
63
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
64
|
+
pointClick: (payload: ChartPointEvent) => any;
|
|
65
|
+
pointContextMenu: (payload: ChartPointEvent) => any;
|
|
66
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
67
|
+
onPointClick?: ((payload: ChartPointEvent) => any) | undefined;
|
|
68
|
+
onPointContextMenu?: ((payload: ChartPointEvent) => any) | undefined;
|
|
69
|
+
}>, {
|
|
70
|
+
type: "line" | "area" | "bar";
|
|
71
|
+
height: number;
|
|
72
|
+
animate: boolean;
|
|
73
|
+
smooth: number;
|
|
74
|
+
showGrid: boolean;
|
|
75
|
+
showXAxis: boolean;
|
|
76
|
+
showYAxis: boolean;
|
|
77
|
+
showLegend: boolean;
|
|
78
|
+
yTicks: number;
|
|
79
|
+
emptyLabel: string;
|
|
80
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
81
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
82
|
+
declare const _default: typeof __VLS_export;
|
|
83
|
+
export default _default;
|
|
84
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
85
|
+
new (): {
|
|
86
|
+
$slots: S;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
@@ -4,7 +4,23 @@ type __VLS_Props = {
|
|
|
4
4
|
description?: string;
|
|
5
5
|
confirmLabel?: string;
|
|
6
6
|
cancelLabel?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The action destroys something. Colours the confirm button, and marks the
|
|
9
|
+
* title with a warning glyph — a destructive prompt should be recognisable
|
|
10
|
+
* before the words are read, since it is the one dialog people dismiss on
|
|
11
|
+
* reflex.
|
|
12
|
+
*/
|
|
7
13
|
danger?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Override the marker: any iconify name, or `""` to leave the title plain —
|
|
16
|
+
* for a `danger` action whose dialog body already carries the warning and
|
|
17
|
+
* would otherwise state it twice.
|
|
18
|
+
*
|
|
19
|
+
* A string rather than `string | false`, deliberately: a union including
|
|
20
|
+
* Boolean makes Vue boolean-cast the prop, so an absent `icon` would arrive
|
|
21
|
+
* as `false` and be indistinguishable from a caller suppressing the marker.
|
|
22
|
+
*/
|
|
23
|
+
icon?: string;
|
|
8
24
|
/**
|
|
9
25
|
* The confirm action is in flight: the button disables and swaps to
|
|
10
26
|
* `loadingLabel`, and confirming no longer closes the dialog — the owner
|
|
@@ -13,9 +29,9 @@ type __VLS_Props = {
|
|
|
13
29
|
loading?: boolean;
|
|
14
30
|
loadingLabel?: string;
|
|
15
31
|
};
|
|
16
|
-
declare var
|
|
32
|
+
declare var __VLS_16: {};
|
|
17
33
|
type __VLS_Slots = {} & {
|
|
18
|
-
default?: (props: typeof
|
|
34
|
+
default?: (props: typeof __VLS_16) => any;
|
|
19
35
|
};
|
|
20
36
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
21
37
|
cancel: () => any;
|
|
@@ -89,11 +89,11 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
|
|
|
89
89
|
sort: boolean;
|
|
90
90
|
loading: boolean;
|
|
91
91
|
skeletonRows: number;
|
|
92
|
+
emptyLabel: string;
|
|
92
93
|
iconSize: number;
|
|
93
94
|
checkable: boolean;
|
|
94
95
|
showSize: boolean;
|
|
95
96
|
showModified: boolean;
|
|
96
|
-
emptyLabel: string;
|
|
97
97
|
emptyDescription: string;
|
|
98
98
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
99
99
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -47,8 +47,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
47
47
|
loop: boolean;
|
|
48
48
|
open: boolean;
|
|
49
49
|
maxZoom: number;
|
|
50
|
-
copyable: boolean;
|
|
51
50
|
index: number;
|
|
51
|
+
copyable: boolean;
|
|
52
52
|
rotatable: boolean;
|
|
53
53
|
downloadable: boolean;
|
|
54
54
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -80,8 +80,8 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
|
|
|
80
80
|
}>, {
|
|
81
81
|
height: string;
|
|
82
82
|
wrap: boolean;
|
|
83
|
-
lineNumbers: boolean;
|
|
84
83
|
emptyLabel: string;
|
|
84
|
+
lineNumbers: boolean;
|
|
85
85
|
showTime: boolean;
|
|
86
86
|
showLevel: boolean;
|
|
87
87
|
tail: boolean;
|
|
@@ -5,6 +5,15 @@ export interface NotificationItem {
|
|
|
5
5
|
body?: string;
|
|
6
6
|
/** Optional icon name (e.g. "lucide:check-circle"). */
|
|
7
7
|
icon?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Colours the row's icon by what KIND of notification it is — a billing
|
|
10
|
+
* notice and a security one should not look alike at a glance.
|
|
11
|
+
*
|
|
12
|
+
* A named tone rather than a class, so the categories stay themeable:
|
|
13
|
+
* consumers were mapping their own types onto raw palette classes, which is
|
|
14
|
+
* the one place a theme cannot follow them.
|
|
15
|
+
*/
|
|
16
|
+
tone?: "brand" | "action" | "danger" | "accent" | "muted";
|
|
8
17
|
/** Optional deep link; the row becomes clickable when set. */
|
|
9
18
|
link?: string;
|
|
10
19
|
/** ISO-8601 creation time; rendered as a relative label. */
|
|
@@ -20,6 +29,7 @@ export interface NotificationItem {
|
|
|
20
29
|
export interface NotificationLabels {
|
|
21
30
|
title?: string;
|
|
22
31
|
markAllRead?: string;
|
|
32
|
+
clear?: string;
|
|
23
33
|
markAsRead?: string;
|
|
24
34
|
markAsUnread?: string;
|
|
25
35
|
open?: string;
|
|
@@ -53,12 +63,14 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
|
53
63
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
54
64
|
"update:open": (value: boolean) => any;
|
|
55
65
|
} & {
|
|
66
|
+
clear: () => any;
|
|
56
67
|
select: (item: NotificationItem) => any;
|
|
57
68
|
markRead: (id: string) => any;
|
|
58
69
|
markUnread: (id: string) => any;
|
|
59
70
|
markAllRead: () => any;
|
|
60
71
|
dismiss: (id: string) => any;
|
|
61
72
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
73
|
+
onClear?: (() => any) | undefined;
|
|
62
74
|
onSelect?: ((item: NotificationItem) => any) | undefined;
|
|
63
75
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
64
76
|
onMarkRead?: ((id: string) => any) | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
value: number;
|
|
3
|
+
/** Travel time in ms. Distance changes the feel, not the duration. */
|
|
4
|
+
duration?: number;
|
|
5
|
+
/** Fixed decimal places. Ignored under `compact`. */
|
|
6
|
+
decimals?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Abbreviate large numbers — 1.2k, 3.4M. Off by default: an exact figure
|
|
9
|
+
* should stay exact unless asked otherwise.
|
|
10
|
+
*/
|
|
11
|
+
compact?: boolean;
|
|
12
|
+
/** Thousands separators. Ignored under `compact`. */
|
|
13
|
+
grouped?: boolean;
|
|
14
|
+
prefix?: string;
|
|
15
|
+
suffix?: string;
|
|
16
|
+
/** Custom formatter; overrides compact/decimals/grouped entirely. */
|
|
17
|
+
format?: (v: number) => string;
|
|
18
|
+
/** Start from 0 on first render rather than showing the value outright. */
|
|
19
|
+
animateOnMount?: boolean;
|
|
20
|
+
locale?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Force the roll direction: "up" and "down" make every column travel the
|
|
23
|
+
* same way regardless of the digit, which reads as one mechanism turning.
|
|
24
|
+
* "auto" lets each column take the shorter route.
|
|
25
|
+
*/
|
|
26
|
+
trend?: "auto" | "up" | "down";
|
|
27
|
+
};
|
|
28
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
29
|
+
duration: number;
|
|
30
|
+
decimals: number;
|
|
31
|
+
animateOnMount: boolean;
|
|
32
|
+
trend: "auto" | "up" | "down";
|
|
33
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|