@lilt-ui/charts 0.11.0 → 0.12.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/CHANGELOG.md +253 -242
- package/README.md +10 -0
- package/dist/cards/range-select.d.ts +2 -6
- package/dist/finance.js +2 -2
- package/dist/index.js +2036 -2021
- package/dist/interaction/inspection-layer.d.ts +5 -1
- package/dist/motion/animated-number.d.ts +2 -6
- package/dist/motion/area-flow.d.ts +36 -0
- package/dist/motion/motion-layout-features.d.ts +1 -0
- package/dist/motion/motion-scope.d.ts +12 -0
- package/dist/motion/use-glide.d.ts +1 -1
- package/dist/motion/use-motion-blur.d.ts +6 -0
- package/dist/motion-layout-features-CJq3xh5t.js +2 -0
- package/dist/{report-context-UrwaoLYZ.js → report-context-DLA3I57K.js} +314 -288
- package/dist/{skeleton-block-CPaKI7op.js → skeleton-block-CxrRuqe0.js} +2564 -2476
- package/dist/styles.css +1 -1
- package/dist/watch/board/chart-board.d.ts +2 -6
- package/dist/watch.js +160 -154
- package/package.json +1 -1
|
@@ -79,12 +79,6 @@ export declare function useBoardItem(): {
|
|
|
79
79
|
acknowledge: () => void;
|
|
80
80
|
pin: (pinned: boolean) => void;
|
|
81
81
|
};
|
|
82
|
-
/**
|
|
83
|
-
* A board of charts that arranges itself: what needs attention rises to the top, what you have
|
|
84
|
-
* seen calms down, and what clears settles back. Nothing moves while you point at or work inside
|
|
85
|
-
* the board; changes wait and apply when you leave, or when you ask.
|
|
86
|
-
*/
|
|
87
|
-
export declare function ChartBoard({ children, 'aria-label': label, settleAfter, memory, storage, onEvent, toast, toolbar, status, motion: motionMode, className, style, }: ChartBoardProps): ReactElement;
|
|
88
82
|
/**
|
|
89
83
|
* The default tab for an item's card: what is going on, how new it is, and quiet actions to
|
|
90
84
|
* acknowledge it or keep it pinned.
|
|
@@ -95,3 +89,5 @@ export declare function BoardItemTab(): ReactElement;
|
|
|
95
89
|
* to finish reading; `useBoard` builds a summary of your own.
|
|
96
90
|
*/
|
|
97
91
|
export declare function BoardToolbar(): ReactElement | null;
|
|
92
|
+
/** ChartBoard with its own MotionScope, so it animates wherever it is rendered. */
|
|
93
|
+
export declare function ChartBoard(props: ChartBoardProps): ReactElement;
|
package/dist/watch.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { C as e, a as t, b as n, i as r, l as i, n as a, o, r as s, s as c, t as l } from "./report-context-
|
|
3
|
-
import { Children as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { C as e, a as t, b as n, i as r, l as i, n as a, o, r as s, s as c, t as l, w as u } from "./report-context-DLA3I57K.js";
|
|
3
|
+
import { Children as d, createContext as f, isValidElement as ee, useCallback as p, useContext as m, useEffect as h, useMemo as g, useReducer as te, useRef as _, useState as v } from "react";
|
|
4
|
+
import { AnimatePresence as y, m as b } from "motion/react";
|
|
5
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
6
6
|
import { createPortal as w } from "react-dom";
|
|
7
7
|
//#region src/watch/engine/rules.ts
|
|
8
8
|
function T({ points: e = 6, severity: t = "warning", message: n = "Value has not changed" } = {}) {
|
|
@@ -153,7 +153,7 @@ function M(e) {
|
|
|
153
153
|
}).map((e) => e.id);
|
|
154
154
|
}
|
|
155
155
|
var N = (e) => e.sinceAt ?? e.raisedAt ?? Infinity, P = 8e3;
|
|
156
|
-
function
|
|
156
|
+
function ne({ alerts: e, reducedMotion: t, onView: n, onDismiss: r }) {
|
|
157
157
|
let [i, a] = v(null);
|
|
158
158
|
h(() => a(document.body), []);
|
|
159
159
|
let [o, s] = v(!1), c = e.some((e) => e.severity === "critical"), l = e.map((e) => `${e.id}:${e.severity}`).join(), u = _(r);
|
|
@@ -171,10 +171,10 @@ function te({ alerts: e, reducedMotion: t, onView: n, onDismiss: r }) {
|
|
|
171
171
|
y: 16,
|
|
172
172
|
filter: "blur(6px)"
|
|
173
173
|
};
|
|
174
|
-
return w(/* @__PURE__ */
|
|
174
|
+
return w(/* @__PURE__ */ S("div", {
|
|
175
175
|
"data-lilt-chart": "",
|
|
176
176
|
className: "lilt-toast-region",
|
|
177
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ S(y, { children: d ? /* @__PURE__ */ C(b.div, {
|
|
178
178
|
role: "group",
|
|
179
179
|
"aria-label": "Chart alert",
|
|
180
180
|
className: "lilt-toast",
|
|
@@ -198,29 +198,29 @@ function te({ alerts: e, reducedMotion: t, onView: n, onDismiss: r }) {
|
|
|
198
198
|
e.currentTarget.contains(e.relatedTarget) || s(!1);
|
|
199
199
|
},
|
|
200
200
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ S("span", {
|
|
202
202
|
className: "lilt-toast__text",
|
|
203
|
-
children: e.length === 1 ? /* @__PURE__ */ x
|
|
203
|
+
children: e.length === 1 ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("strong", { children: d.title }), d.reason ? /* @__PURE__ */ S("span", {
|
|
204
204
|
className: "lilt-toast__reason",
|
|
205
205
|
children: d.reason
|
|
206
|
-
}) : null] }) : /* @__PURE__ */
|
|
206
|
+
}) : null] }) : /* @__PURE__ */ C("strong", { children: [e.length, " charts need attention"] })
|
|
207
207
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ S("button", {
|
|
209
209
|
type: "button",
|
|
210
210
|
className: "lilt-toast__view",
|
|
211
211
|
onClick: n,
|
|
212
212
|
children: "View"
|
|
213
213
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ S("button", {
|
|
215
215
|
type: "button",
|
|
216
216
|
className: "lilt-card-badge__clear",
|
|
217
217
|
"aria-label": "Dismiss",
|
|
218
218
|
onClick: r,
|
|
219
|
-
children: /* @__PURE__ */
|
|
219
|
+
children: /* @__PURE__ */ S("svg", {
|
|
220
220
|
"aria-hidden": "true",
|
|
221
221
|
viewBox: "0 0 16 16",
|
|
222
222
|
fill: "none",
|
|
223
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ S("path", {
|
|
224
224
|
d: "m4 4 8 8M12 4l-8 8",
|
|
225
225
|
stroke: "currentColor",
|
|
226
226
|
strokeWidth: "1.5",
|
|
@@ -234,12 +234,12 @@ function te({ alerts: e, reducedMotion: t, onView: n, onDismiss: r }) {
|
|
|
234
234
|
}
|
|
235
235
|
//#endregion
|
|
236
236
|
//#region src/watch/board/chart-board.tsx
|
|
237
|
-
function
|
|
238
|
-
return /* @__PURE__ */
|
|
237
|
+
function re({ children: e }) {
|
|
238
|
+
return /* @__PURE__ */ S(x, { children: e });
|
|
239
239
|
}
|
|
240
|
-
var
|
|
241
|
-
function
|
|
242
|
-
let e = m(
|
|
240
|
+
var ie = f(null), ae = f(null);
|
|
241
|
+
function F() {
|
|
242
|
+
let e = m(ie);
|
|
243
243
|
if (!e) throw Error("Lilt Charts: useBoard must be used inside a ChartBoard.");
|
|
244
244
|
let t = Object.values(e.state);
|
|
245
245
|
return {
|
|
@@ -252,8 +252,8 @@ function I() {
|
|
|
252
252
|
pin: e.pin
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
let e = m(
|
|
255
|
+
function I() {
|
|
256
|
+
let e = m(ie), t = m(ae);
|
|
257
257
|
if (!e || !t) throw Error("Lilt Charts: useBoardItem must be used inside a BoardItem.");
|
|
258
258
|
return {
|
|
259
259
|
item: e.state[t],
|
|
@@ -263,74 +263,74 @@ function L() {
|
|
|
263
263
|
pin: (n) => e.pin(t, n)
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
-
var
|
|
267
|
-
function
|
|
268
|
-
let
|
|
266
|
+
var oe = 500;
|
|
267
|
+
function L({ children: t, "aria-label": n, settleAfter: r = 8e3, memory: i, storage: a, onEvent: o, toast: s = !1, toolbar: c = !0, status: l = !0, motion: u = "auto", className: f, style: m }) {
|
|
268
|
+
let y = g(() => d.toArray(t).flatMap((e) => ee(e) && e.type === re ? [e.props] : []), [t]), x = g(() => new Map(y.map((e) => [e.id, e.title])), [y]), [w, T] = te(O, y, (e) => e.reduce((e, t, n) => O(e, {
|
|
269
269
|
type: "register",
|
|
270
270
|
id: t.id,
|
|
271
271
|
order: n
|
|
272
|
-
}), {})),
|
|
272
|
+
}), {})), E = y.map((e) => e.id).join("\0");
|
|
273
273
|
h(() => {
|
|
274
|
-
let e = new Set(
|
|
275
|
-
|
|
274
|
+
let e = new Set(y.map((e) => e.id));
|
|
275
|
+
y.forEach((e, t) => T({
|
|
276
276
|
type: "register",
|
|
277
277
|
id: e.id,
|
|
278
278
|
order: t
|
|
279
279
|
}));
|
|
280
|
-
for (let t of Object.keys(
|
|
280
|
+
for (let t of Object.keys(w)) e.has(t) || T({
|
|
281
281
|
type: "unregister",
|
|
282
282
|
id: t
|
|
283
283
|
});
|
|
284
|
-
}, [
|
|
285
|
-
let
|
|
286
|
-
clearTimeout(
|
|
287
|
-
},
|
|
288
|
-
clearTimeout(
|
|
284
|
+
}, [E]);
|
|
285
|
+
let D = M(w), k = D.join("\0"), [A, j] = v(D), [N, P] = v(!1), F = _(void 0), I = () => {
|
|
286
|
+
clearTimeout(F.current), P(!0);
|
|
287
|
+
}, L = () => {
|
|
288
|
+
clearTimeout(F.current), F.current = setTimeout(() => P(!1), oe);
|
|
289
289
|
};
|
|
290
|
-
h(() => () => clearTimeout(
|
|
291
|
-
|
|
292
|
-
}, [
|
|
293
|
-
let
|
|
290
|
+
h(() => () => clearTimeout(F.current), []), h(() => {
|
|
291
|
+
N || j(D);
|
|
292
|
+
}, [N, k]);
|
|
293
|
+
let R = [...A.filter((e) => w[e]), ...D.filter((e) => !A.includes(e))], z = R.join("|"), B = R.join("\0") !== k, V = p(() => j(M(w)), [w]);
|
|
294
294
|
h(() => {
|
|
295
|
-
let e = Object.values(
|
|
295
|
+
let e = Object.values(w).filter((e) => e.alarm === "cleared" && e.clearedAt !== null).map((e) => setTimeout(() => T({
|
|
296
296
|
type: "settle",
|
|
297
297
|
id: e.id
|
|
298
298
|
}), Math.max(0, e.clearedAt + r - Date.now())));
|
|
299
299
|
return () => e.forEach(clearTimeout);
|
|
300
|
-
}, [
|
|
301
|
-
let
|
|
300
|
+
}, [w, r]);
|
|
301
|
+
let H = e(u), U = _(/* @__PURE__ */ new Map()), pe = _(/* @__PURE__ */ new Map());
|
|
302
302
|
h(() => {
|
|
303
303
|
if (typeof IntersectionObserver > "u") return;
|
|
304
304
|
let e = new IntersectionObserver((e) => {
|
|
305
305
|
for (let t of e) {
|
|
306
306
|
let e = t.target.dataset.boardItem;
|
|
307
|
-
e &&
|
|
307
|
+
e && pe.current.set(e, t.intersectionRatio >= .5);
|
|
308
308
|
}
|
|
309
309
|
}, { threshold: [
|
|
310
310
|
0,
|
|
311
311
|
.5,
|
|
312
312
|
1
|
|
313
313
|
] });
|
|
314
|
-
return
|
|
315
|
-
}, [
|
|
316
|
-
let [
|
|
317
|
-
|
|
318
|
-
let
|
|
319
|
-
let t =
|
|
314
|
+
return U.current.forEach((t) => e.observe(t)), () => e.disconnect();
|
|
315
|
+
}, [E]);
|
|
316
|
+
let [W, me] = v(null), he = _(H);
|
|
317
|
+
he.current = H;
|
|
318
|
+
let G = p((e) => {
|
|
319
|
+
let t = U.current.get(e);
|
|
320
320
|
t && (t.scrollIntoView?.({
|
|
321
|
-
behavior:
|
|
321
|
+
behavior: he.current ? "auto" : "smooth",
|
|
322
322
|
block: "center"
|
|
323
|
-
}), t.focus({ preventScroll: !0 }),
|
|
323
|
+
}), t.focus({ preventScroll: !0 }), me(e));
|
|
324
324
|
}, []);
|
|
325
325
|
h(() => {
|
|
326
|
-
if (!
|
|
327
|
-
let e = setTimeout(() =>
|
|
326
|
+
if (!W) return;
|
|
327
|
+
let e = setTimeout(() => me(null), 1600);
|
|
328
328
|
return () => clearTimeout(e);
|
|
329
|
-
}, [
|
|
330
|
-
let [
|
|
329
|
+
}, [W]);
|
|
330
|
+
let [ge, K] = v([]), q = _(null), J = _(0);
|
|
331
331
|
h(() => {
|
|
332
332
|
let e = () => {
|
|
333
|
-
|
|
333
|
+
q.current !== null && (document.title = q.current), q.current = null, J.current = 0;
|
|
334
334
|
}, t = () => {
|
|
335
335
|
document.visibilityState === "visible" && e();
|
|
336
336
|
};
|
|
@@ -338,35 +338,35 @@ function R({ children: t, "aria-label": n, settleAfter: r = 8e3, memory: i, stor
|
|
|
338
338
|
document.removeEventListener("visibilitychange", t), e();
|
|
339
339
|
};
|
|
340
340
|
}, []);
|
|
341
|
-
let [
|
|
341
|
+
let [_e, ve] = v({
|
|
342
342
|
polite: "",
|
|
343
343
|
assertive: ""
|
|
344
|
-
}),
|
|
344
|
+
}), ye = _(w), Y = _({
|
|
345
345
|
onEvent: o,
|
|
346
|
-
titles:
|
|
346
|
+
titles: x,
|
|
347
347
|
toast: s
|
|
348
348
|
});
|
|
349
|
-
|
|
349
|
+
Y.current = {
|
|
350
350
|
onEvent: o,
|
|
351
|
-
titles:
|
|
351
|
+
titles: x,
|
|
352
352
|
toast: s
|
|
353
353
|
}, h(() => {
|
|
354
|
-
let e =
|
|
355
|
-
|
|
354
|
+
let e = ye.current;
|
|
355
|
+
ye.current = w;
|
|
356
356
|
let t = [], n = [], r = [], i = /* @__PURE__ */ new Set();
|
|
357
|
-
for (let a of Object.values(
|
|
357
|
+
for (let a of Object.values(w)) {
|
|
358
358
|
let o = e[a.id];
|
|
359
359
|
if (!o) continue;
|
|
360
|
-
let s =
|
|
360
|
+
let s = le(o, a);
|
|
361
361
|
if (!s) continue;
|
|
362
|
-
let c =
|
|
363
|
-
|
|
362
|
+
let c = Y.current.titles.get(a.id) ?? a.id;
|
|
363
|
+
Y.current.onEvent?.({
|
|
364
364
|
type: s,
|
|
365
365
|
id: a.id,
|
|
366
366
|
title: c,
|
|
367
367
|
item: a,
|
|
368
|
-
show: () =>
|
|
369
|
-
}), s === "raised" || s === "escalated" ?
|
|
368
|
+
show: () => G(a.id)
|
|
369
|
+
}), s === "raised" || s === "escalated" ? pe.current.get(a.id) || r.push({
|
|
370
370
|
id: a.id,
|
|
371
371
|
title: c,
|
|
372
372
|
reason: a.why ?? a.reason,
|
|
@@ -375,33 +375,33 @@ function R({ children: t, "aria-label": n, settleAfter: r = 8e3, memory: i, stor
|
|
|
375
375
|
let l = a.reason ? `: ${a.reason}${a.since ? ` since ${a.since}` : ""}` : "";
|
|
376
376
|
s === "raised" || s === "escalated" ? (a.severity === "critical" ? n : t).push(`${c} needs attention${l}.${a.why ? ` ${a.why}.` : ""}`) : s === "cleared" && t.push(`${c} is back to normal.`);
|
|
377
377
|
}
|
|
378
|
-
if ((t.length || n.length) &&
|
|
378
|
+
if ((t.length || n.length) && ve({
|
|
379
379
|
polite: t.join(" "),
|
|
380
380
|
assertive: n.join(" ")
|
|
381
|
-
}),
|
|
381
|
+
}), Y.current.toast) {
|
|
382
382
|
if (r.length || i.size) {
|
|
383
383
|
let e = new Set(r.map((e) => e.id));
|
|
384
|
-
|
|
384
|
+
K((t) => [...t.filter((t) => !e.has(t.id) && !i.has(t.id)), ...r].sort((e, t) => ce(e.severity) - ce(t.severity)));
|
|
385
385
|
}
|
|
386
|
-
r.length && document.visibilityState === "hidden" && (
|
|
386
|
+
r.length && document.visibilityState === "hidden" && (q.current ??= document.title, J.current += r.length, document.title = `(${J.current}) ${q.current}`);
|
|
387
387
|
}
|
|
388
|
-
}, [
|
|
389
|
-
let
|
|
388
|
+
}, [w, G]);
|
|
389
|
+
let X = i ? `lilt-board:${i}` : null, Z = _(null), [be, xe] = v(() => /* @__PURE__ */ new Set()), Q = g(() => a ?? ue(), [a]);
|
|
390
390
|
h(() => {
|
|
391
|
-
if (!
|
|
392
|
-
let e =
|
|
391
|
+
if (!X || !Q) return;
|
|
392
|
+
let e = Q.get(X);
|
|
393
393
|
try {
|
|
394
|
-
|
|
394
|
+
Z.current = e === null ? null : new Set(JSON.parse(e));
|
|
395
395
|
} catch {
|
|
396
|
-
|
|
396
|
+
Z.current = null;
|
|
397
397
|
}
|
|
398
|
-
}, [
|
|
399
|
-
let
|
|
398
|
+
}, [X, Q]);
|
|
399
|
+
let Se = (e) => `${e.id}@${e.sinceAt ?? e.since ?? ""}`, Ce = Object.values(w).filter((e) => e.alarm !== "normal" && e.alarm !== "cleared").map(Se).sort().join("\0");
|
|
400
400
|
h(() => {
|
|
401
|
-
if (!
|
|
402
|
-
let e =
|
|
403
|
-
e &&
|
|
404
|
-
let n = () =>
|
|
401
|
+
if (!X || !Q) return;
|
|
402
|
+
let e = Z.current, t = Object.values(w).filter((e) => e.alarm === "active" || e.alarm === "acknowledged");
|
|
403
|
+
e && xe(new Set(t.filter((t) => t.alarm === "active" && !e.has(Se(t))).map((e) => e.id)));
|
|
404
|
+
let n = () => Q.set(X, JSON.stringify(t.map(Se))), r = () => {
|
|
405
405
|
document.visibilityState === "hidden" && n();
|
|
406
406
|
};
|
|
407
407
|
return window.addEventListener("pagehide", n), document.addEventListener("visibilitychange", r), () => {
|
|
@@ -409,65 +409,65 @@ function R({ children: t, "aria-label": n, settleAfter: r = 8e3, memory: i, stor
|
|
|
409
409
|
};
|
|
410
410
|
}, [
|
|
411
411
|
Ce,
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
X,
|
|
413
|
+
Q
|
|
414
414
|
]);
|
|
415
|
-
let we = p((e) =>
|
|
415
|
+
let we = p((e) => T({
|
|
416
416
|
type: "acknowledge",
|
|
417
417
|
id: e,
|
|
418
418
|
now: Date.now()
|
|
419
|
-
}), []), Te = p((e, t) =>
|
|
419
|
+
}), []), Te = p((e, t) => T({
|
|
420
420
|
type: "pin",
|
|
421
421
|
id: e,
|
|
422
422
|
pinned: t
|
|
423
423
|
}), []), Ee = g(() => ({
|
|
424
|
-
state:
|
|
425
|
-
titles:
|
|
426
|
-
fresh:
|
|
424
|
+
state: w,
|
|
425
|
+
titles: x,
|
|
426
|
+
fresh: be,
|
|
427
427
|
acknowledge: we,
|
|
428
428
|
pin: Te,
|
|
429
|
-
pending:
|
|
430
|
-
apply:
|
|
429
|
+
pending: B,
|
|
430
|
+
apply: V
|
|
431
431
|
}), [
|
|
432
|
-
T,
|
|
433
432
|
w,
|
|
434
|
-
|
|
433
|
+
x,
|
|
434
|
+
be,
|
|
435
435
|
we,
|
|
436
436
|
Te,
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
]), De = new Map(
|
|
440
|
-
return /* @__PURE__ */
|
|
437
|
+
B,
|
|
438
|
+
V
|
|
439
|
+
]), De = new Map(y.map((e) => [e.id, e])), $ = ge.filter((e) => w[e.id]);
|
|
440
|
+
return /* @__PURE__ */ C(ie.Provider, {
|
|
441
441
|
value: Ee,
|
|
442
|
-
children: [/* @__PURE__ */
|
|
442
|
+
children: [/* @__PURE__ */ C("section", {
|
|
443
443
|
"data-lilt-chart": "",
|
|
444
|
-
className: ["lilt-board",
|
|
445
|
-
style:
|
|
444
|
+
className: ["lilt-board", f].filter(Boolean).join(" "),
|
|
445
|
+
style: m,
|
|
446
446
|
"aria-label": n,
|
|
447
|
-
onPointerEnter:
|
|
448
|
-
onPointerLeave:
|
|
449
|
-
onFocus:
|
|
447
|
+
onPointerEnter: I,
|
|
448
|
+
onPointerLeave: L,
|
|
449
|
+
onFocus: I,
|
|
450
450
|
onBlur: (e) => {
|
|
451
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
451
|
+
e.currentTarget.contains(e.relatedTarget) || L();
|
|
452
452
|
},
|
|
453
453
|
children: [
|
|
454
|
-
c ? /* @__PURE__ */
|
|
455
|
-
/* @__PURE__ */ b
|
|
454
|
+
c ? /* @__PURE__ */ S(fe, {}) : null,
|
|
455
|
+
/* @__PURE__ */ S(b.div, {
|
|
456
456
|
layoutRoot: !0,
|
|
457
457
|
className: "lilt-board__grid",
|
|
458
|
-
children:
|
|
459
|
-
let t = De.get(e), n =
|
|
460
|
-
return !t || !n ? null : /* @__PURE__ */ b
|
|
458
|
+
children: R.map((e) => {
|
|
459
|
+
let t = De.get(e), n = w[e];
|
|
460
|
+
return !t || !n ? null : /* @__PURE__ */ S(b.div, {
|
|
461
461
|
ref: (t) => {
|
|
462
|
-
t ?
|
|
462
|
+
t ? U.current.set(e, t) : U.current.delete(e);
|
|
463
463
|
},
|
|
464
464
|
role: "group",
|
|
465
465
|
"aria-label": t.title,
|
|
466
466
|
tabIndex: -1,
|
|
467
467
|
"data-board-item": e,
|
|
468
|
-
"data-flash":
|
|
469
|
-
layout: !
|
|
470
|
-
layoutDependency:
|
|
468
|
+
"data-flash": W === e || void 0,
|
|
469
|
+
layout: !H && "position",
|
|
470
|
+
layoutDependency: z,
|
|
471
471
|
transition: {
|
|
472
472
|
type: "spring",
|
|
473
473
|
stiffness: 420,
|
|
@@ -479,14 +479,14 @@ function R({ children: t, "aria-label": n, settleAfter: r = 8e3, memory: i, stor
|
|
|
479
479
|
"data-severity": n.severity ?? void 0,
|
|
480
480
|
"data-pinned": n.pinned || void 0,
|
|
481
481
|
style: t.span === 2 ? { gridColumn: "span 2" } : void 0,
|
|
482
|
-
children: /* @__PURE__ */
|
|
482
|
+
children: /* @__PURE__ */ S(ae.Provider, {
|
|
483
483
|
value: e,
|
|
484
|
-
children: /* @__PURE__ */
|
|
484
|
+
children: /* @__PURE__ */ S(de, {
|
|
485
485
|
item: n,
|
|
486
486
|
status: l,
|
|
487
|
-
children: /* @__PURE__ */
|
|
487
|
+
children: /* @__PURE__ */ S(se, {
|
|
488
488
|
id: e,
|
|
489
|
-
dispatch:
|
|
489
|
+
dispatch: T,
|
|
490
490
|
children: t.children
|
|
491
491
|
})
|
|
492
492
|
})
|
|
@@ -494,48 +494,48 @@ function R({ children: t, "aria-label": n, settleAfter: r = 8e3, memory: i, stor
|
|
|
494
494
|
}, e);
|
|
495
495
|
})
|
|
496
496
|
}),
|
|
497
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ S("div", {
|
|
498
498
|
className: "lilt-chart__sr-only",
|
|
499
499
|
"aria-live": "polite",
|
|
500
|
-
children:
|
|
500
|
+
children: _e.polite
|
|
501
501
|
}),
|
|
502
|
-
/* @__PURE__ */
|
|
502
|
+
/* @__PURE__ */ S("div", {
|
|
503
503
|
className: "lilt-chart__sr-only",
|
|
504
504
|
"aria-live": "assertive",
|
|
505
|
-
children:
|
|
505
|
+
children: _e.assertive
|
|
506
506
|
})
|
|
507
507
|
]
|
|
508
|
-
}), s ? /* @__PURE__ */
|
|
508
|
+
}), s ? /* @__PURE__ */ S(ne, {
|
|
509
509
|
alerts: $,
|
|
510
|
-
reducedMotion:
|
|
510
|
+
reducedMotion: H,
|
|
511
511
|
onView: () => {
|
|
512
|
-
$[0] &&
|
|
512
|
+
$[0] && G($[0].id), K([]);
|
|
513
513
|
},
|
|
514
|
-
onDismiss: () =>
|
|
514
|
+
onDismiss: () => K([])
|
|
515
515
|
}) : null]
|
|
516
516
|
});
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function se({ id: e, dispatch: t, children: n }) {
|
|
519
519
|
let r = p((n) => t({
|
|
520
520
|
type: "report",
|
|
521
521
|
id: e,
|
|
522
522
|
report: n,
|
|
523
523
|
now: Date.now()
|
|
524
524
|
}), [t, e]);
|
|
525
|
-
return /* @__PURE__ */
|
|
525
|
+
return /* @__PURE__ */ S(l.Provider, {
|
|
526
526
|
value: r,
|
|
527
527
|
children: n
|
|
528
528
|
});
|
|
529
529
|
}
|
|
530
|
-
var
|
|
531
|
-
function
|
|
530
|
+
var ce = (e) => e === "critical" ? 0 : 1;
|
|
531
|
+
function le(e, t) {
|
|
532
532
|
return e.alarm === t.alarm ? t.alarm === "active" && e.severity === "warning" && t.severity === "critical" ? "escalated" : null : {
|
|
533
533
|
active: e.alarm === "acknowledged" ? "escalated" : "raised",
|
|
534
534
|
acknowledged: "acknowledged",
|
|
535
535
|
cleared: "cleared"
|
|
536
536
|
}[t.alarm] ?? null;
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function ue() {
|
|
539
539
|
return typeof window > "u" ? null : {
|
|
540
540
|
get: (e) => {
|
|
541
541
|
try {
|
|
@@ -551,74 +551,74 @@ function ce() {
|
|
|
551
551
|
}
|
|
552
552
|
};
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function de({ item: e, status: t, children: n }) {
|
|
555
555
|
let r = t && (e.alarm !== "normal" || e.pinned), a = g(() => ({
|
|
556
|
-
badge: r ? /* @__PURE__ */
|
|
556
|
+
badge: r ? /* @__PURE__ */ S(z, {}) : void 0,
|
|
557
557
|
tone: e.alarm === "active" ? e.severity : null,
|
|
558
|
-
handle: t && !r ? /* @__PURE__ */
|
|
558
|
+
handle: t && !r ? /* @__PURE__ */ S(B, {}) : void 0
|
|
559
559
|
}), [
|
|
560
560
|
r,
|
|
561
561
|
t,
|
|
562
562
|
e.alarm,
|
|
563
563
|
e.severity
|
|
564
564
|
]);
|
|
565
|
-
return /* @__PURE__ */
|
|
565
|
+
return /* @__PURE__ */ S(i.Provider, {
|
|
566
566
|
value: a,
|
|
567
567
|
children: n
|
|
568
568
|
});
|
|
569
569
|
}
|
|
570
|
-
var
|
|
570
|
+
var R = new Intl.DateTimeFormat(void 0, {
|
|
571
571
|
hour: "numeric",
|
|
572
572
|
minute: "2-digit"
|
|
573
573
|
});
|
|
574
|
-
function
|
|
575
|
-
let { item: e, title: t, fresh: r, acknowledge: i, pin: a } =
|
|
576
|
-
return /* @__PURE__ */
|
|
574
|
+
function z() {
|
|
575
|
+
let { item: e, title: t, fresh: r, acknowledge: i, pin: a } = I(), o = e.alarm === "active" ? "Needs attention" : e.alarm === "acknowledged" ? `Seen ${R.format(e.acknowledgedAt)}` : e.alarm === "cleared" ? "Back to normal" : "Pinned";
|
|
576
|
+
return /* @__PURE__ */ C("span", {
|
|
577
577
|
className: "lilt-board-tab",
|
|
578
578
|
"data-alarm": e.alarm,
|
|
579
579
|
"data-severity": e.severity ?? void 0,
|
|
580
|
-
children: [/* @__PURE__ */
|
|
580
|
+
children: [/* @__PURE__ */ C("span", {
|
|
581
581
|
className: "lilt-board-tab__state",
|
|
582
|
-
children: [o, r ? /* @__PURE__ */
|
|
582
|
+
children: [o, r ? /* @__PURE__ */ S("span", {
|
|
583
583
|
className: "lilt-board-tab__new",
|
|
584
584
|
children: "· New"
|
|
585
585
|
}) : null]
|
|
586
|
-
}), /* @__PURE__ */
|
|
586
|
+
}), /* @__PURE__ */ C("span", {
|
|
587
587
|
className: "lilt-board-tab__actions",
|
|
588
|
-
children: [e.alarm === "active" ? /* @__PURE__ */
|
|
588
|
+
children: [e.alarm === "active" ? /* @__PURE__ */ S("button", {
|
|
589
589
|
type: "button",
|
|
590
590
|
className: "lilt-board-tab__action",
|
|
591
591
|
onClick: i,
|
|
592
592
|
children: "Acknowledge"
|
|
593
|
-
}) : null, /* @__PURE__ */
|
|
593
|
+
}) : null, /* @__PURE__ */ S("button", {
|
|
594
594
|
type: "button",
|
|
595
595
|
className: "lilt-card-badge__clear lilt-board-tab__pin",
|
|
596
596
|
"aria-pressed": e.pinned,
|
|
597
597
|
"aria-label": e.pinned ? `Unpin ${t}` : `Pin ${t}`,
|
|
598
598
|
title: e.pinned ? "Unpin" : "Keep at the top",
|
|
599
599
|
onClick: () => a(!e.pinned),
|
|
600
|
-
children: /* @__PURE__ */
|
|
600
|
+
children: /* @__PURE__ */ S(n, { release: e.pinned })
|
|
601
601
|
})]
|
|
602
602
|
})]
|
|
603
603
|
});
|
|
604
604
|
}
|
|
605
|
-
function
|
|
606
|
-
let { title: e, pin: t } =
|
|
607
|
-
return /* @__PURE__ */
|
|
605
|
+
function B() {
|
|
606
|
+
let { title: e, pin: t } = I();
|
|
607
|
+
return /* @__PURE__ */ S("button", {
|
|
608
608
|
type: "button",
|
|
609
609
|
className: "lilt-board-handle",
|
|
610
610
|
"aria-pressed": !1,
|
|
611
611
|
"aria-label": `Pin ${e}`,
|
|
612
612
|
title: "Keep at the top",
|
|
613
613
|
onClick: () => t(!0),
|
|
614
|
-
children: /* @__PURE__ */
|
|
614
|
+
children: /* @__PURE__ */ S(n, {})
|
|
615
615
|
});
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
let { pending: e, apply: t } =
|
|
619
|
-
return e ? /* @__PURE__ */
|
|
617
|
+
function fe() {
|
|
618
|
+
let { pending: e, apply: t } = F();
|
|
619
|
+
return e ? /* @__PURE__ */ S("div", {
|
|
620
620
|
className: "lilt-board__toolbar",
|
|
621
|
-
children: /* @__PURE__ */
|
|
621
|
+
children: /* @__PURE__ */ S("button", {
|
|
622
622
|
type: "button",
|
|
623
623
|
className: "lilt-board__apply",
|
|
624
624
|
onClick: t,
|
|
@@ -626,5 +626,11 @@ function de() {
|
|
|
626
626
|
})
|
|
627
627
|
}) : null;
|
|
628
628
|
}
|
|
629
|
+
function V(e) {
|
|
630
|
+
return /* @__PURE__ */ S(u, {
|
|
631
|
+
layout: !0,
|
|
632
|
+
children: /* @__PURE__ */ S(L, { ...e })
|
|
633
|
+
});
|
|
634
|
+
}
|
|
629
635
|
//#endregion
|
|
630
|
-
export {
|
|
636
|
+
export { re as BoardItem, z as BoardItemTab, fe as BoardToolbar, V as ChartBoard, O as boardReducer, a as describeExplanation, t as describeFlag, c as evaluateNormal, s as explainDeviation, r as explainReadings, T as flatline, E as jump, M as rankBoard, o as trackNormalStatus, F as useBoard, I as useBoardItem };
|