@leavepulse/ui 0.24.1 → 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/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/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/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/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
|
@@ -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;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { PieSlice } from './chart';
|
|
2
|
+
import { ContextMenuItemDef } from './LpContextMenu.vue';
|
|
3
|
+
/** A slice, as reported by every interaction event. */
|
|
4
|
+
export interface SliceEvent {
|
|
5
|
+
index: number;
|
|
6
|
+
label: string;
|
|
7
|
+
value: number;
|
|
8
|
+
isOther: boolean;
|
|
9
|
+
}
|
|
10
|
+
type __VLS_Props = {
|
|
11
|
+
slices: PieSlice[];
|
|
12
|
+
type?: "pie" | "donut";
|
|
13
|
+
/** Outer diameter in px. */
|
|
14
|
+
size?: number;
|
|
15
|
+
/** Donut only: hole diameter as a fraction of the outer radius (0–1). */
|
|
16
|
+
innerRatio?: number;
|
|
17
|
+
title?: string;
|
|
18
|
+
subtitle?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Keep the largest N-1 slices and sum the rest into "Other". `0` disables
|
|
21
|
+
* the fold and draws every slice — for a caller that knows its data is
|
|
22
|
+
* already few, or that would rather show a crowded circle than a bucket.
|
|
23
|
+
*/
|
|
24
|
+
maxSlices?: number;
|
|
25
|
+
/** Label for the folded remainder. */
|
|
26
|
+
otherLabel?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Draw the slices largest-first instead of in the order given. Ranking
|
|
29
|
+
* always decides which slices survive `maxSlices`; this decides whether it
|
|
30
|
+
* also reorders them.
|
|
31
|
+
*/
|
|
32
|
+
sortBySize?: boolean;
|
|
33
|
+
/** Appended to values in the legend and tooltip, e.g. " GB". */
|
|
34
|
+
unit?: string;
|
|
35
|
+
/** Custom value formatter; overrides the compact 1.2k default. */
|
|
36
|
+
formatValue?: (v: number) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Name the slices with leader lines around the circle instead of a legend
|
|
39
|
+
* beside it. Better when the labels are long and self-explanatory (versions,
|
|
40
|
+
* hostnames) and the reader wants share-per-name without cross-referencing a
|
|
41
|
+
* colour; the legend stays better for short, repeated categories.
|
|
42
|
+
*/
|
|
43
|
+
labels?: boolean;
|
|
44
|
+
/** Callout width reserved for text on each side, in px. */
|
|
45
|
+
labelWidth?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Defaults to true, except in `labels` mode — callouts already name every
|
|
48
|
+
* slice, and a legend beside them says the same thing twice. Set it
|
|
49
|
+
* explicitly to have both.
|
|
50
|
+
*/
|
|
51
|
+
showLegend?: boolean;
|
|
52
|
+
/** Print each slice's percentage next to its legend entry. */
|
|
53
|
+
showPercent?: boolean;
|
|
54
|
+
/** Donut only: print the total in the hole. Ignored when #center is used. */
|
|
55
|
+
showTotal?: boolean;
|
|
56
|
+
/** Gap between slices in degrees — reads as separate parts, not one disc. */
|
|
57
|
+
padAngle?: number;
|
|
58
|
+
/** Corner radius of each slice in px. 0 for hard edges. */
|
|
59
|
+
cornerRadius?: number;
|
|
60
|
+
/** How far the hovered slice lifts out of the circle, in px. */
|
|
61
|
+
hoverOffset?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Sweep the circle open, clockwise from twelve, when it first comes into
|
|
64
|
+
* view. Turn it off where several are drawn at once and the sweeps would
|
|
65
|
+
* compete rather than read as one arrival.
|
|
66
|
+
*/
|
|
67
|
+
animate?: boolean;
|
|
68
|
+
/** Sweep time in ms. */
|
|
69
|
+
duration?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Right-click menu, built from the slice that was hit and the whole current
|
|
72
|
+
* selection — so an action can apply to one slice or to all the picked ones.
|
|
73
|
+
*/
|
|
74
|
+
menuItems?: (slice: SliceEvent, selection: SliceEvent[]) => ContextMenuItemDef[];
|
|
75
|
+
emptyLabel?: string;
|
|
76
|
+
};
|
|
77
|
+
declare var __VLS_40: {
|
|
78
|
+
total: number;
|
|
79
|
+
active: {
|
|
80
|
+
d: string;
|
|
81
|
+
lift: string;
|
|
82
|
+
label: string;
|
|
83
|
+
value: number;
|
|
84
|
+
color: string;
|
|
85
|
+
fraction: number;
|
|
86
|
+
isOther: boolean;
|
|
87
|
+
count: number;
|
|
88
|
+
} | null;
|
|
89
|
+
selection: {
|
|
90
|
+
d: string;
|
|
91
|
+
lift: string;
|
|
92
|
+
label: string;
|
|
93
|
+
value: number;
|
|
94
|
+
color: string;
|
|
95
|
+
fraction: number;
|
|
96
|
+
isOther: boolean;
|
|
97
|
+
count: number;
|
|
98
|
+
}[];
|
|
99
|
+
};
|
|
100
|
+
type __VLS_Slots = {} & {
|
|
101
|
+
center?: (props: typeof __VLS_40) => any;
|
|
102
|
+
};
|
|
103
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
104
|
+
sliceClick: (payload: SliceEvent) => any;
|
|
105
|
+
selectionChange: (payload: SliceEvent[]) => any;
|
|
106
|
+
sliceContextMenu: (payload: SliceEvent) => any;
|
|
107
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
108
|
+
onSliceClick?: ((payload: SliceEvent) => any) | undefined;
|
|
109
|
+
onSelectionChange?: ((payload: SliceEvent[]) => any) | undefined;
|
|
110
|
+
onSliceContextMenu?: ((payload: SliceEvent) => any) | undefined;
|
|
111
|
+
}>, {
|
|
112
|
+
size: number;
|
|
113
|
+
type: "pie" | "donut";
|
|
114
|
+
animate: boolean;
|
|
115
|
+
duration: number;
|
|
116
|
+
emptyLabel: string;
|
|
117
|
+
innerRatio: number;
|
|
118
|
+
maxSlices: number;
|
|
119
|
+
otherLabel: string;
|
|
120
|
+
labelWidth: number;
|
|
121
|
+
showPercent: boolean;
|
|
122
|
+
showTotal: boolean;
|
|
123
|
+
padAngle: number;
|
|
124
|
+
cornerRadius: number;
|
|
125
|
+
hoverOffset: number;
|
|
126
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
127
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
128
|
+
declare const _default: typeof __VLS_export;
|
|
129
|
+
export default _default;
|
|
130
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
131
|
+
new (): {
|
|
132
|
+
$slots: S;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
@@ -1,12 +1,66 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
value?: number;
|
|
3
3
|
max?: number;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* `"auto"` colours by how full the bar is — calm up to `warnAt`, accent
|
|
6
|
+
* past it, danger past `dangerAt`.
|
|
7
|
+
*
|
|
8
|
+
* A gauge of a finite resource (disk, memory, quota) means something
|
|
9
|
+
* different at 92% than at 12%, and consumers were each re-deriving that
|
|
10
|
+
* with their own palette — which also put raw colours back into components
|
|
11
|
+
* the theme can no longer reach.
|
|
12
|
+
*/
|
|
13
|
+
tone?: "brand" | "action" | "danger" | "accent" | "auto";
|
|
14
|
+
/** `auto` tone: the fill fraction, 0–1, where the bar turns accent. */
|
|
15
|
+
warnAt?: number;
|
|
16
|
+
/** `auto` tone: the fill fraction, 0–1, where it turns danger. */
|
|
17
|
+
dangerAt?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Bar only: a name for what is being measured, printed above the bar. With
|
|
20
|
+
* `caption` it forms the "CPU … 42%" header a usage row wants.
|
|
21
|
+
*/
|
|
22
|
+
title?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Bar only: the reading, printed opposite `title`. `true` prints the
|
|
25
|
+
* rounded percentage; a string says it in the units that matter
|
|
26
|
+
* ("23 GB / 64 GB"), which a percentage alone cannot.
|
|
27
|
+
*/
|
|
28
|
+
caption?: boolean | string;
|
|
29
|
+
/** `bar` (default) fills horizontally; `ring` draws a dial. */
|
|
30
|
+
variant?: "bar" | "ring";
|
|
31
|
+
/** Ring only: outer diameter in px. */
|
|
32
|
+
size?: number;
|
|
33
|
+
/** Ring only: stroke width in px. */
|
|
34
|
+
thickness?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Ring only: print the rounded percentage in the middle. Pass a string to
|
|
37
|
+
* label it with something else ("12.4k", "3/8") — the ring shows progress,
|
|
38
|
+
* the caption says what it is progress of.
|
|
39
|
+
*/
|
|
40
|
+
label?: boolean | string;
|
|
41
|
+
/**
|
|
42
|
+
* Grow from empty on first render instead of appearing already filled.
|
|
43
|
+
*
|
|
44
|
+
* A dial that arrives complete states a fact; one that fills shows a
|
|
45
|
+
* quantity being measured, and the eye follows the sweep to where it stops —
|
|
46
|
+
* which is the number the tile is actually about. Both variants already ease
|
|
47
|
+
* every later change, so this only concerns the first paint.
|
|
48
|
+
*/
|
|
49
|
+
animateOnMount?: boolean;
|
|
50
|
+
/** How long the fill takes, in ms. The counter in a ring matches it. */
|
|
51
|
+
duration?: number;
|
|
5
52
|
};
|
|
6
53
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
54
|
+
size: number;
|
|
7
55
|
max: number;
|
|
8
56
|
value: number;
|
|
9
|
-
|
|
57
|
+
duration: number;
|
|
58
|
+
variant: "bar" | "ring";
|
|
59
|
+
tone: "brand" | "action" | "danger" | "accent" | "auto";
|
|
60
|
+
animateOnMount: boolean;
|
|
61
|
+
warnAt: number;
|
|
62
|
+
dangerAt: number;
|
|
63
|
+
thickness: number;
|
|
10
64
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
65
|
declare const _default: typeof __VLS_export;
|
|
12
66
|
export default _default;
|