@leavepulse/ui 0.24.0 → 0.25.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/LpSparkline-0mKTq7pb.css +51 -0
- package/dist/assets/LpTooltip-B61SYd4K.css +17 -0
- package/dist/assets/LpUptimeBar-B98o9krI.css +18 -0
- package/dist/chunks/{LpAppShell-CaQYQKZV.js → LpAppShell-B5k0J3Cf.js} +1 -1
- package/dist/chunks/LpChart-tNXs1ttr.js +671 -0
- package/dist/chunks/{LpCodeBlock-CSiOSPs8.js → LpCodeBlock-rS_6mO3D.js} +1 -1
- package/dist/chunks/{LpConfirmDialog-CObRah9c.js → LpConfirmDialog-CjOGcj1e.js} +32 -4
- package/dist/chunks/{LpDisclosure-DP6yfgfM.js → LpDisclosure-BnwP4Q-b.js} +1 -1
- package/dist/chunks/{LpFileTree-nU1wRRxZ.js → LpFileTree-BaV7f0O7.js} +1 -1
- package/dist/chunks/{LpFileTreeNode-D7WgUPcJ.js → LpFileTreeNode-BzpBa7R7.js} +6 -8
- 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/{LpSidebar-D3GGLSE7.js → LpSidebar-7Vpy2IJc.js} +1 -1
- package/dist/chunks/{LpSidebarNav-X14xMdPa.js → LpSidebarNav-CFX5NxGs.js} +1 -1
- 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/LpAppShell.vue.js +1 -1
- package/dist/components/LpChart.vue.d.ts +88 -0
- package/dist/components/LpChart.vue.js +4 -0
- package/dist/components/LpCodeBlock.vue.js +1 -1
- package/dist/components/LpConfirmDialog.vue.d.ts +18 -2
- package/dist/components/LpConfirmDialog.vue.js +1 -1
- package/dist/components/LpDisclosure.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/LpSidebar.vue.js +1 -1
- package/dist/components/LpSidebarNav.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 +126 -103
- package/package.json +2 -1
- package/src/component-names.ts +5 -0
- package/src/components/LpChart.vue +846 -0
- package/src/components/LpCodeBlock.vue +1 -1
- package/src/components/LpConfirmDialog.vue +49 -0
- package/src/components/LpDisclosure.vue +1 -1
- package/src/components/LpFileTreeNode.vue +9 -10
- 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/LpSidebarNav.vue +1 -1
- 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/LpTooltip-D1hbjQWG.js +0 -63
- package/dist/chunks/LpUptimeBar-CB366k0O.js +0 -127
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createElementBlock, toDisplayString, createTextVNode, createElementVNode, createCommentVNode, createVNode, unref, withCtx, Fragment, renderList, createBlock, normalizeStyle, normalizeClass } from "vue";
|
|
2
|
-
import { TooltipProvider, TooltipRoot, TooltipTrigger, TooltipPortal, TooltipContent } from "reka-ui";
|
|
3
|
-
import { PANEL_SURFACE, TOOLTIP_ANIM } from "../components/dropdown.js";
|
|
4
|
-
const _hoisted_1 = { class: "flex flex-col gap-1.5" };
|
|
5
|
-
const _hoisted_2 = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "flex items-baseline justify-between gap-3 text-xs"
|
|
8
|
-
};
|
|
9
|
-
const _hoisted_3 = {
|
|
10
|
-
key: 0,
|
|
11
|
-
class: "font-medium text-ink"
|
|
12
|
-
};
|
|
13
|
-
const _hoisted_4 = { key: 1 };
|
|
14
|
-
const _hoisted_5 = {
|
|
15
|
-
key: 2,
|
|
16
|
-
class: "tabular-nums text-muted-strong"
|
|
17
|
-
};
|
|
18
|
-
const _hoisted_6 = { class: "flex h-7 items-stretch gap-0.5" };
|
|
19
|
-
const _hoisted_7 = ["aria-label"];
|
|
20
|
-
const _hoisted_8 = { class: "flex items-center gap-1.5" };
|
|
21
|
-
const _hoisted_9 = {
|
|
22
|
-
key: 1,
|
|
23
|
-
class: "flex items-center justify-between text-xs text-muted"
|
|
24
|
-
};
|
|
25
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
26
|
-
__name: "LpUptimeBar",
|
|
27
|
-
props: {
|
|
28
|
-
segments: {},
|
|
29
|
-
startLabel: {},
|
|
30
|
-
endLabel: {},
|
|
31
|
-
showUptime: { type: Boolean, default: true },
|
|
32
|
-
title: {},
|
|
33
|
-
colors: {}
|
|
34
|
-
},
|
|
35
|
-
setup(__props) {
|
|
36
|
-
const props = __props;
|
|
37
|
-
const defaultColor = {
|
|
38
|
-
operational: "var(--color-brand)",
|
|
39
|
-
degraded: "var(--color-accent)",
|
|
40
|
-
down: "var(--color-danger)",
|
|
41
|
-
maintenance: "var(--color-action)",
|
|
42
|
-
empty: "var(--color-surface-soft)"
|
|
43
|
-
};
|
|
44
|
-
const colorFor = (status) => props.colors?.[status] ?? defaultColor[status];
|
|
45
|
-
const statusLabel = {
|
|
46
|
-
operational: "Operational",
|
|
47
|
-
degraded: "Degraded",
|
|
48
|
-
down: "Down",
|
|
49
|
-
maintenance: "Maintenance",
|
|
50
|
-
empty: "No data"
|
|
51
|
-
};
|
|
52
|
-
const uptimePct = computed(() => {
|
|
53
|
-
const tracked = props.segments.filter((s) => s.status !== "empty");
|
|
54
|
-
if (!tracked.length) return null;
|
|
55
|
-
const up = tracked.filter((s) => s.status === "operational" || s.status === "maintenance").length;
|
|
56
|
-
return up / tracked.length * 100;
|
|
57
|
-
});
|
|
58
|
-
const uptimeText = computed(() => {
|
|
59
|
-
const v = uptimePct.value;
|
|
60
|
-
if (v == null) return "—";
|
|
61
|
-
return `${Number(v.toFixed(2))}%`;
|
|
62
|
-
});
|
|
63
|
-
return (_ctx, _cache) => {
|
|
64
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
65
|
-
__props.showUptime || __props.title ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
66
|
-
__props.title ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.title), 1)) : (openBlock(), createElementBlock("span", _hoisted_4)),
|
|
67
|
-
__props.showUptime ? (openBlock(), createElementBlock("span", _hoisted_5, [
|
|
68
|
-
createTextVNode(toDisplayString(uptimeText.value), 1),
|
|
69
|
-
_cache[0] || (_cache[0] = createElementVNode("span", { class: "text-muted" }, " uptime", -1))
|
|
70
|
-
])) : createCommentVNode("", true)
|
|
71
|
-
])) : createCommentVNode("", true),
|
|
72
|
-
createVNode(unref(TooltipProvider), { "delay-duration": 120 }, {
|
|
73
|
-
default: withCtx(() => [
|
|
74
|
-
createElementVNode("div", _hoisted_6, [
|
|
75
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.segments, (seg, i) => {
|
|
76
|
-
return openBlock(), createBlock(unref(TooltipRoot), { key: i }, {
|
|
77
|
-
default: withCtx(() => [
|
|
78
|
-
createVNode(unref(TooltipTrigger), { "as-child": "" }, {
|
|
79
|
-
default: withCtx(() => [
|
|
80
|
-
createElementVNode("button", {
|
|
81
|
-
type: "button",
|
|
82
|
-
class: normalizeClass(["min-w-0 flex-1 rounded-xs outline-none transition-[scale,opacity] duration-150 hover:scale-y-110 focus-visible:ring-2 focus-visible:ring-ring", seg.status === "empty" ? "opacity-50" : ""]),
|
|
83
|
-
style: normalizeStyle({ backgroundColor: colorFor(seg.status) }),
|
|
84
|
-
"aria-label": seg.label ?? statusLabel[seg.status]
|
|
85
|
-
}, null, 14, _hoisted_7)
|
|
86
|
-
]),
|
|
87
|
-
_: 2
|
|
88
|
-
}, 1024),
|
|
89
|
-
createVNode(unref(TooltipPortal), null, {
|
|
90
|
-
default: withCtx(() => [
|
|
91
|
-
createVNode(unref(TooltipContent), {
|
|
92
|
-
"side-offset": 6,
|
|
93
|
-
class: normalizeClass([unref(PANEL_SURFACE), unref(TOOLTIP_ANIM), "z-(--z-tooltip) px-2.5 py-1.5 text-xs text-ink"])
|
|
94
|
-
}, {
|
|
95
|
-
default: withCtx(() => [
|
|
96
|
-
createElementVNode("span", _hoisted_8, [
|
|
97
|
-
createElementVNode("span", {
|
|
98
|
-
class: "size-1.5 shrink-0 rounded-full",
|
|
99
|
-
style: normalizeStyle({ backgroundColor: colorFor(seg.status) })
|
|
100
|
-
}, null, 4),
|
|
101
|
-
createTextVNode(" " + toDisplayString(seg.label ?? statusLabel[seg.status]), 1)
|
|
102
|
-
])
|
|
103
|
-
]),
|
|
104
|
-
_: 2
|
|
105
|
-
}, 1032, ["class"])
|
|
106
|
-
]),
|
|
107
|
-
_: 2
|
|
108
|
-
}, 1024)
|
|
109
|
-
]),
|
|
110
|
-
_: 2
|
|
111
|
-
}, 1024);
|
|
112
|
-
}), 128))
|
|
113
|
-
])
|
|
114
|
-
]),
|
|
115
|
-
_: 1
|
|
116
|
-
}),
|
|
117
|
-
__props.startLabel || __props.endLabel ? (openBlock(), createElementBlock("div", _hoisted_9, [
|
|
118
|
-
createElementVNode("span", null, toDisplayString(__props.startLabel), 1),
|
|
119
|
-
createElementVNode("span", null, toDisplayString(__props.endLabel), 1)
|
|
120
|
-
])) : createCommentVNode("", true)
|
|
121
|
-
]);
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
export {
|
|
126
|
-
_sfc_main as _
|
|
127
|
-
};
|