@alfadocs/ui-kit-debug 1.28.3 → 1.30.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/_chunks/{anamnesis-summary-rows-DwjqZgR5.js → anamnesis-summary-rows-DMO3MWSt.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-DwjqZgR5.js.map → anamnesis-summary-rows-DMO3MWSt.js.map} +1 -1
- package/dist/_chunks/{booking-BtSOKjQu.js → booking-AabCk7CI.js} +1205 -1148
- package/dist/_chunks/booking-AabCk7CI.js.map +1 -0
- package/dist/_chunks/{sparkline-BmGcEyZO.js → sparkline-Dx_sxK3J.js} +228 -198
- package/dist/_chunks/sparkline-Dx_sxK3J.js.map +1 -0
- package/dist/_chunks/use-zoom-drilldown-qCX34w9I.js +210 -0
- package/dist/_chunks/use-zoom-drilldown-qCX34w9I.js.map +1 -0
- package/dist/agent-catalog.json +5 -2
- package/dist/agent-i18n/en.json +1 -1
- package/dist/components/booking/booking-types.d.ts +15 -0
- package/dist/components/booking/booking-types.d.ts.map +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/details-form.d.ts +7 -0
- package/dist/components/booking/details-form.d.ts.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/sparkline/sparkline.agent.d.ts.map +1 -1
- package/dist/components/sparkline/sparkline.d.ts +6 -0
- package/dist/components/sparkline/sparkline.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +56 -54
- package/dist/hooks/use-zoom-drilldown.d.ts +23 -0
- package/dist/hooks/use-zoom-drilldown.d.ts.map +1 -0
- package/dist/host-compat.css +4 -1
- package/dist/i18n/locales/ar.d.ts +4 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +4 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +4 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +4 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +4 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +4 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +4 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +4 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +4 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +4 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +4 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +4 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +4 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +4 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +4 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +4 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +4 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +4 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +4 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +4 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +4 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +4 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +4 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +4 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +4 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +4 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +4 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +4 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +4 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +4 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +4 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +4 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +4 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +4 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +4 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +4 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +1072 -1070
- package/dist/locales/ar.json +4 -0
- package/dist/locales/de.json +4 -0
- package/dist/locales/el.json +4 -0
- package/dist/locales/en.json +4 -0
- package/dist/locales/es.json +4 -0
- package/dist/locales/fr.json +4 -0
- package/dist/locales/hi.json +4 -0
- package/dist/locales/it.json +4 -0
- package/dist/locales/ja.json +4 -0
- package/dist/locales/nl.json +4 -0
- package/dist/locales/pl.json +4 -0
- package/dist/locales/pt.json +4 -0
- package/dist/locales/ro.json +4 -0
- package/dist/locales/ru.json +4 -0
- package/dist/locales/sq.json +4 -0
- package/dist/locales/sv.json +4 -0
- package/dist/locales/tr.json +4 -0
- package/dist/locales/zh.json +4 -0
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/booking-BtSOKjQu.js.map +0 -1
- package/dist/_chunks/sparkline-BmGcEyZO.js.map +0 -1
- package/dist/_chunks/use-signing-session-CyOZWinp.js +0 -147
- package/dist/_chunks/use-signing-session-CyOZWinp.js.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { g as
|
|
8
|
-
import { m as
|
|
9
|
-
import { u as
|
|
10
|
-
function
|
|
11
|
-
if (
|
|
1
|
+
import { jsx as u, jsxs as K } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ve, useId as we, useMemo as _, useRef as k, useState as $, useEffect as H, useImperativeHandle as ke } from "react";
|
|
3
|
+
import { c as j } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as xe } from "react-i18next";
|
|
5
|
+
import Ie from "react-apexcharts";
|
|
6
|
+
import P from "apexcharts";
|
|
7
|
+
import { g as re, u as Ne } from "./apexcharts-theme-B_AxGC_h.js";
|
|
8
|
+
import { m as Re } from "./annotation-marker-CsUJGZjQ.js";
|
|
9
|
+
import { u as Me } from "./registry-DvAUVLHh.js";
|
|
10
|
+
function Te(n) {
|
|
11
|
+
if (n.length < 2)
|
|
12
12
|
return { slope: 0, direction: "steady" };
|
|
13
|
-
const
|
|
14
|
-
let
|
|
15
|
-
for (let
|
|
16
|
-
const
|
|
17
|
-
|
|
13
|
+
const r = n.length, g = (r - 1) / 2, p = n.reduce((c, d) => c + d, 0) / r;
|
|
14
|
+
let a = 0, h = 0;
|
|
15
|
+
for (let c = 0; c < r; c++) {
|
|
16
|
+
const d = c - g;
|
|
17
|
+
a += d * (n[c] - p), h += d * d;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
return { slope:
|
|
19
|
+
const f = h === 0 ? 0 : a / h, N = 0.01 * (Math.max(...n) - Math.min(...n) || 1), b = Math.abs(f) < N ? "steady" : f > 0 ? "increasing" : "decreasing";
|
|
20
|
+
return { slope: f, direction: b };
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const Ce = {
|
|
23
23
|
id: "sparkline",
|
|
24
24
|
capabilities: [],
|
|
25
25
|
// `select_annotation` enforces two preconditions silently and
|
|
@@ -39,19 +39,19 @@ const we = {
|
|
|
39
39
|
type: "string[]",
|
|
40
40
|
descriptionKey: "ui.agent.sparkline.state.annotationIds",
|
|
41
41
|
description: "Ids of the annotations currently drawn, in declaration order. The only ids `select_annotation` will accept — check against this before calling. Ids only, never annotation labels.",
|
|
42
|
-
read: (
|
|
42
|
+
read: (n) => n.getAnnotationIds()
|
|
43
43
|
},
|
|
44
44
|
selectable: {
|
|
45
45
|
type: "boolean",
|
|
46
46
|
descriptionKey: "ui.agent.sparkline.state.selectable",
|
|
47
47
|
description: "True when the host wired an annotation-select handler. False means every `select_annotation` call is a no-op, whatever id is passed.",
|
|
48
|
-
read: (
|
|
48
|
+
read: (n) => n.isSelectable()
|
|
49
49
|
},
|
|
50
50
|
pointCount: {
|
|
51
51
|
type: "number",
|
|
52
52
|
descriptionKey: "ui.agent.sparkline.state.pointCount",
|
|
53
53
|
description: "Number of positions in the currently rendered series, unmeasured gaps included — reflecting whichever applied last, the `data` prop or an `update_series` call. A count only; the plotted values are never exposed.",
|
|
54
|
-
read: (
|
|
54
|
+
read: (n) => n.getPointCount()
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
actions: {
|
|
@@ -73,9 +73,12 @@ const we = {
|
|
|
73
73
|
},
|
|
74
74
|
idempotent: !0,
|
|
75
75
|
descriptionKey: "ui.agent.sparkline.actions.updateSeries",
|
|
76
|
-
description: "Replace the sparkline data without remounting. Writes straight into ApexCharts, bypassing React — read the `pointCount` slot back rather than expecting the host tree to reflect it.",
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
description: "Replace the sparkline data without remounting. Writes straight into ApexCharts, bypassing React — read the `pointCount` slot back rather than expecting the host tree to reflect it. Host-supplied point labels are not updated, so the tooltip title is hidden after this call.",
|
|
77
|
+
errors: [
|
|
78
|
+
"Per-point tooltip titles are hidden after this call — the host point labels describe the previous series, not the one written."
|
|
79
|
+
],
|
|
80
|
+
invoke: (n, r) => {
|
|
81
|
+
n.updateSeries(r.data);
|
|
79
82
|
}
|
|
80
83
|
},
|
|
81
84
|
export_png: {
|
|
@@ -88,7 +91,7 @@ const we = {
|
|
|
88
91
|
},
|
|
89
92
|
descriptionKey: "ui.agent.sparkline.actions.exportPng",
|
|
90
93
|
description: "Return a PNG data URI of the sparkline.",
|
|
91
|
-
invoke: (
|
|
94
|
+
invoke: (n) => n.dataURI()
|
|
92
95
|
},
|
|
93
96
|
select_annotation: {
|
|
94
97
|
// Routes the host somewhere — the same thing a pointer press on the
|
|
@@ -113,8 +116,8 @@ const we = {
|
|
|
113
116
|
"Silently ignored when `selectable` is false — the host wired no annotation-select handler.",
|
|
114
117
|
"Silently ignored when the id is not in `annotationIds` — that annotation is not currently drawn."
|
|
115
118
|
],
|
|
116
|
-
invoke: (
|
|
117
|
-
|
|
119
|
+
invoke: (n, r) => {
|
|
120
|
+
n.selectAnnotation(r.annotationId);
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
123
|
},
|
|
@@ -126,7 +129,7 @@ const we = {
|
|
|
126
129
|
description: "Sourced from the id prop."
|
|
127
130
|
}
|
|
128
131
|
}
|
|
129
|
-
},
|
|
132
|
+
}, ae = j("ds:relative ds:inline-block ds:w-full", {
|
|
130
133
|
variants: {
|
|
131
134
|
size: {
|
|
132
135
|
xs: "ds:h-6",
|
|
@@ -138,7 +141,7 @@ const we = {
|
|
|
138
141
|
}
|
|
139
142
|
},
|
|
140
143
|
defaultVariants: { size: "md" }
|
|
141
|
-
}),
|
|
144
|
+
}), se = j("", {
|
|
142
145
|
variants: {
|
|
143
146
|
tone: {
|
|
144
147
|
neutral: "ds:[--annotation-color:var(--muted-foreground)]",
|
|
@@ -153,7 +156,7 @@ const we = {
|
|
|
153
156
|
}
|
|
154
157
|
},
|
|
155
158
|
defaultVariants: { tone: "neutral" }
|
|
156
|
-
}),
|
|
159
|
+
}), Ae = j(
|
|
157
160
|
"ds:pointer-events-none ds:absolute ds:inset-x-[2px]",
|
|
158
161
|
{
|
|
159
162
|
variants: {
|
|
@@ -169,204 +172,231 @@ const we = {
|
|
|
169
172
|
},
|
|
170
173
|
defaultVariants: { size: "md" }
|
|
171
174
|
}
|
|
172
|
-
),
|
|
175
|
+
), Oe = {
|
|
173
176
|
increasing: "↑",
|
|
174
177
|
decreasing: "↓",
|
|
175
178
|
steady: "→"
|
|
176
|
-
},
|
|
179
|
+
}, Se = {
|
|
177
180
|
xs: 24,
|
|
178
181
|
sm: 32,
|
|
179
182
|
md: 40
|
|
180
|
-
},
|
|
181
|
-
function
|
|
182
|
-
const
|
|
183
|
-
annotation:
|
|
184
|
-
centre:
|
|
185
|
-
})).sort((
|
|
186
|
-
return
|
|
187
|
-
const
|
|
188
|
-
Math.max(
|
|
189
|
-
|
|
183
|
+
}, M = 2, ie = 2.5, oe = 44;
|
|
184
|
+
function ze(n, r, g = oe) {
|
|
185
|
+
const p = n.map((a) => ({
|
|
186
|
+
annotation: a,
|
|
187
|
+
centre: de(a.position) * r
|
|
188
|
+
})).sort((a, h) => a.centre - h.centre);
|
|
189
|
+
return p.map((a, h) => {
|
|
190
|
+
const f = p[h - 1], x = p[h + 1], N = f ? (f.centre + a.centre) / 2 : 0, b = x ? (a.centre + x.centre) / 2 : r, c = Math.max(0, N), d = Math.min(r, b), s = Math.min(g, Math.max(0, d - c)), y = Math.min(
|
|
191
|
+
Math.max(a.centre - s / 2, c),
|
|
192
|
+
d - s
|
|
190
193
|
);
|
|
191
|
-
return { annotation:
|
|
194
|
+
return { annotation: a.annotation, x: y, width: s };
|
|
192
195
|
});
|
|
193
196
|
}
|
|
194
|
-
function
|
|
195
|
-
return Number.isFinite(
|
|
197
|
+
function de(n) {
|
|
198
|
+
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 0;
|
|
196
199
|
}
|
|
197
|
-
function
|
|
198
|
-
return
|
|
200
|
+
function _e(n) {
|
|
201
|
+
return n.filter((r) => r != null);
|
|
199
202
|
}
|
|
200
|
-
function
|
|
203
|
+
function He() {
|
|
201
204
|
return typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
202
205
|
}
|
|
203
|
-
const
|
|
206
|
+
const Pe = ve(
|
|
204
207
|
({
|
|
205
|
-
id:
|
|
206
|
-
data:
|
|
207
|
-
variant:
|
|
208
|
-
size:
|
|
209
|
-
label:
|
|
210
|
-
color:
|
|
211
|
-
showEndpoint:
|
|
212
|
-
showTooltip:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
208
|
+
id: n,
|
|
209
|
+
data: r,
|
|
210
|
+
variant: g = "line",
|
|
211
|
+
size: p = "md",
|
|
212
|
+
label: a,
|
|
213
|
+
color: h,
|
|
214
|
+
showEndpoint: f = !1,
|
|
215
|
+
showTooltip: x = !1,
|
|
216
|
+
seriesName: N,
|
|
217
|
+
pointLabels: b,
|
|
218
|
+
width: c,
|
|
219
|
+
height: d,
|
|
220
|
+
annotations: s,
|
|
221
|
+
onAnnotationSelect: y,
|
|
222
|
+
className: G,
|
|
223
|
+
...L
|
|
224
|
+
}, ce) => {
|
|
225
|
+
var ne;
|
|
226
|
+
const { t: v, i18n: q } = xe(), Z = we(), w = _(
|
|
227
|
+
() => `sparkline-${Z.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
228
|
+
[Z]
|
|
229
|
+
), T = k(null), [D, le] = $(0), [ue, pe] = $(oe), m = _(() => _e(r), [r]), { direction: F } = Te(m), J = _(() => {
|
|
230
|
+
const e = s && s.length > 0 ? v("sparkline.annotations", {
|
|
231
|
+
list: s.map((I) => I.label).join(", ")
|
|
232
|
+
}) : "", t = (I) => e ? `${I}. ${e}` : I;
|
|
233
|
+
if (m.length === 0)
|
|
234
|
+
return t(v("sparkline.noData", "No data"));
|
|
235
|
+
const i = (I) => new Intl.NumberFormat(q.language).format(I), l = v(`sparkline.direction.${F}`), o = {
|
|
236
|
+
min: i(Math.min(...m)),
|
|
237
|
+
max: i(Math.max(...m)),
|
|
238
|
+
current: i(m[m.length - 1]),
|
|
239
|
+
direction: l
|
|
235
240
|
};
|
|
236
|
-
return
|
|
237
|
-
}, [
|
|
241
|
+
return t(a ? v("sparkline.summary", { label: a, ...o }) : v("sparkline.summaryNoLabel", o));
|
|
242
|
+
}, [m, s, a, F, q.language, v]), [C, he] = $(
|
|
238
243
|
() => {
|
|
239
244
|
try {
|
|
240
|
-
return
|
|
245
|
+
return re();
|
|
241
246
|
} catch {
|
|
242
247
|
return {};
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
250
|
);
|
|
246
|
-
|
|
251
|
+
H(() => {
|
|
247
252
|
let e;
|
|
248
|
-
const
|
|
253
|
+
const t = new MutationObserver(() => {
|
|
249
254
|
clearTimeout(e), e = setTimeout(() => {
|
|
250
255
|
try {
|
|
251
|
-
|
|
256
|
+
he(re());
|
|
252
257
|
} catch {
|
|
253
258
|
}
|
|
254
259
|
}, 50);
|
|
255
260
|
});
|
|
256
|
-
return
|
|
261
|
+
return t.observe(document.documentElement, {
|
|
257
262
|
attributes: !0,
|
|
258
263
|
attributeFilter: ["class"]
|
|
259
264
|
}), () => {
|
|
260
|
-
clearTimeout(e),
|
|
265
|
+
clearTimeout(e), t.disconnect();
|
|
261
266
|
};
|
|
262
|
-
}, []),
|
|
263
|
-
const e =
|
|
267
|
+
}, []), H(() => {
|
|
268
|
+
const e = T.current;
|
|
264
269
|
if (!e) return;
|
|
265
|
-
const
|
|
266
|
-
const
|
|
267
|
-
Number.isFinite(
|
|
270
|
+
const t = () => {
|
|
271
|
+
const l = getComputedStyle(e).getPropertyValue("--min-target-size"), o = Number.parseFloat(l);
|
|
272
|
+
Number.isFinite(o) && o > 0 && pe(o);
|
|
268
273
|
};
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
const
|
|
272
|
-
|
|
274
|
+
t();
|
|
275
|
+
const i = new ResizeObserver((l) => {
|
|
276
|
+
const o = l[0];
|
|
277
|
+
o && le(Math.floor(o.contentRect.width)), t();
|
|
273
278
|
});
|
|
274
|
-
return
|
|
275
|
-
}, []),
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}, [
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
279
|
+
return i.observe(e), () => i.disconnect();
|
|
280
|
+
}, []), Ne(T);
|
|
281
|
+
const R = k(y);
|
|
282
|
+
H(() => {
|
|
283
|
+
R.current = y;
|
|
284
|
+
}, [y]);
|
|
285
|
+
const U = k(s);
|
|
286
|
+
U.current = s;
|
|
287
|
+
const V = N ?? a ?? "", Q = k(V);
|
|
288
|
+
Q.current = V;
|
|
289
|
+
const W = k(r.length), A = k({ shown: !1 }), O = k(!1);
|
|
290
|
+
H(() => {
|
|
291
|
+
var e;
|
|
292
|
+
W.current = r.length, O.current && (O.current = !1, A.current.shown && ((e = P.getChartByID(w)) == null || e.updateOptions({
|
|
293
|
+
tooltip: { x: { show: !0 } }
|
|
294
|
+
})));
|
|
295
|
+
}, [r, w]);
|
|
296
|
+
const B = _(
|
|
287
297
|
() => ({
|
|
288
298
|
updateSeries(e) {
|
|
289
|
-
|
|
290
|
-
|
|
299
|
+
const t = P.getChartByID(w);
|
|
300
|
+
t == null || t.updateSeries([{ name: Q.current, data: e }]), W.current = e.length, A.current.shown && (O.current = !0, t == null || t.updateOptions({ tooltip: { x: { show: !1 } } }));
|
|
291
301
|
},
|
|
292
302
|
updateOptions(e) {
|
|
293
|
-
var
|
|
294
|
-
(
|
|
303
|
+
var t;
|
|
304
|
+
(t = P.getChartByID(w)) == null || t.updateOptions(e);
|
|
295
305
|
},
|
|
296
306
|
async dataURI() {
|
|
297
|
-
const e =
|
|
307
|
+
const e = P.getChartByID(w);
|
|
298
308
|
return e ? (await e.dataURI()).imgURI : "";
|
|
299
309
|
},
|
|
300
310
|
selectAnnotation(e) {
|
|
301
|
-
var
|
|
302
|
-
(
|
|
311
|
+
var i, l;
|
|
312
|
+
(i = U.current) != null && i.some((o) => o.id === e) && ((l = R.current) == null || l.call(R, e));
|
|
303
313
|
},
|
|
304
314
|
// Read-back for the two preconditions `selectAnnotation` enforces
|
|
305
315
|
// silently — without these an agent can check neither and gets no
|
|
306
316
|
// signal from either failure.
|
|
307
|
-
getAnnotationIds: () => (
|
|
308
|
-
isSelectable: () =>
|
|
309
|
-
getPointCount: () =>
|
|
317
|
+
getAnnotationIds: () => (U.current ?? []).map((e) => e.id),
|
|
318
|
+
isSelectable: () => R.current != null,
|
|
319
|
+
getPointCount: () => W.current
|
|
310
320
|
}),
|
|
311
|
-
[
|
|
321
|
+
[w]
|
|
312
322
|
);
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
if (
|
|
316
|
-
return /* @__PURE__ */
|
|
323
|
+
ke(ce, () => B, [B]), Me(Ce, B, n);
|
|
324
|
+
const E = h ?? ((ne = C.colors) == null ? void 0 : ne[0]) ?? "currentColor";
|
|
325
|
+
if (m.length === 0)
|
|
326
|
+
return /* @__PURE__ */ u(
|
|
317
327
|
"div",
|
|
318
328
|
{
|
|
319
|
-
ref:
|
|
329
|
+
ref: T,
|
|
320
330
|
role: "img",
|
|
321
|
-
"aria-label":
|
|
331
|
+
"aria-label": J,
|
|
322
332
|
dir: "ltr",
|
|
323
|
-
className:
|
|
324
|
-
size:
|
|
325
|
-
className:
|
|
333
|
+
className: ae({
|
|
334
|
+
size: d !== void 0 ? "auto" : p,
|
|
335
|
+
className: G
|
|
326
336
|
}),
|
|
327
337
|
"data-component": "sparkline",
|
|
328
|
-
"data-component-id":
|
|
329
|
-
...
|
|
338
|
+
"data-component-id": n,
|
|
339
|
+
...L
|
|
330
340
|
}
|
|
331
341
|
);
|
|
332
|
-
const
|
|
342
|
+
const X = He(), S = r.length > m.length, Y = S ? r.flatMap((e, t) => e == null ? [] : [{ x: t, y: e }]) : m, me = S ? r.flatMap((e, t) => e == null ? [] : [t]) : void 0;
|
|
343
|
+
A.current = {
|
|
344
|
+
labels: b,
|
|
345
|
+
slotOf: me,
|
|
346
|
+
shown: x && b !== void 0
|
|
347
|
+
};
|
|
348
|
+
const fe = x ? {
|
|
349
|
+
enabled: !0,
|
|
350
|
+
x: b ? {
|
|
351
|
+
show: !0,
|
|
352
|
+
formatter: (e, t) => {
|
|
353
|
+
const { labels: i, slotOf: l } = A.current;
|
|
354
|
+
if (O.current || !i) return "";
|
|
355
|
+
const o = (t == null ? void 0 : t.dataPointIndex) ?? -1;
|
|
356
|
+
return i[l ? l[o] ?? -1 : o] ?? "";
|
|
357
|
+
}
|
|
358
|
+
} : (
|
|
359
|
+
// No labels: hide the title rather than show a raw index.
|
|
360
|
+
{ show: !1 }
|
|
361
|
+
)
|
|
362
|
+
} : { enabled: !1 }, ge = {
|
|
333
363
|
...C,
|
|
334
364
|
chart: {
|
|
335
365
|
...C.chart,
|
|
336
|
-
id:
|
|
337
|
-
type:
|
|
366
|
+
id: w,
|
|
367
|
+
type: g,
|
|
338
368
|
sparkline: { enabled: !0 },
|
|
339
369
|
toolbar: { show: !1 },
|
|
340
370
|
animations: {
|
|
341
|
-
enabled: !
|
|
371
|
+
enabled: !X,
|
|
342
372
|
// A gapped series is re-rendered as {x, y} pairs, and Apex's
|
|
343
373
|
// update tween interpolates between the old and new paths point by
|
|
344
374
|
// point. Across a width change the two have different lengths and
|
|
345
375
|
// the tween emits `d="… NaN …"` for a few frames. The finished
|
|
346
376
|
// render is correct either way; switching the tween off keeps the
|
|
347
377
|
// console clean.
|
|
348
|
-
dynamicAnimation: { enabled: !
|
|
378
|
+
dynamicAnimation: { enabled: !X && !S }
|
|
349
379
|
},
|
|
350
380
|
zoom: { enabled: !1 },
|
|
351
381
|
parentHeightOffset: 0
|
|
352
382
|
},
|
|
353
|
-
colors: [
|
|
383
|
+
colors: [E],
|
|
354
384
|
stroke: {
|
|
355
385
|
curve: "smooth",
|
|
356
|
-
width:
|
|
386
|
+
width: g === "bar" ? 0 : 2
|
|
357
387
|
},
|
|
358
388
|
fill: {
|
|
359
|
-
opacity:
|
|
389
|
+
opacity: g === "area" ? 0.15 : 1
|
|
360
390
|
},
|
|
361
391
|
xaxis: {
|
|
362
392
|
crosshairs: { show: !1 },
|
|
363
393
|
// Pin the extent to the slot count so a gap at either end still holds
|
|
364
394
|
// its place — otherwise the plot would rescale to the measurements
|
|
365
395
|
// and the annotation fractions would no longer mean the same thing.
|
|
366
|
-
...
|
|
396
|
+
...S ? { type: "numeric", min: 0, max: r.length - 1 } : {}
|
|
367
397
|
},
|
|
368
|
-
tooltip:
|
|
369
|
-
markers:
|
|
398
|
+
tooltip: fe,
|
|
399
|
+
markers: f ? {
|
|
370
400
|
size: [0],
|
|
371
401
|
discrete: [
|
|
372
402
|
{
|
|
@@ -374,9 +404,9 @@ const Ce = pe(
|
|
|
374
404
|
// removed — so this is the last MEASURED point, never a slot
|
|
375
405
|
// the parameter was not measured at.
|
|
376
406
|
seriesIndex: 0,
|
|
377
|
-
dataPointIndex:
|
|
378
|
-
fillColor:
|
|
379
|
-
strokeColor:
|
|
407
|
+
dataPointIndex: Y.length - 1,
|
|
408
|
+
fillColor: E,
|
|
409
|
+
strokeColor: E,
|
|
380
410
|
size: 4
|
|
381
411
|
}
|
|
382
412
|
]
|
|
@@ -387,40 +417,40 @@ const Ce = pe(
|
|
|
387
417
|
// ApexCharts grid.padding uses physical keys (not CSS logical properties).
|
|
388
418
|
// The chart wrapper enforces dir="ltr" so these always resolve correctly.
|
|
389
419
|
padding: {
|
|
390
|
-
top:
|
|
391
|
-
right:
|
|
392
|
-
bottom:
|
|
393
|
-
left:
|
|
420
|
+
top: M,
|
|
421
|
+
right: M,
|
|
422
|
+
bottom: M,
|
|
423
|
+
left: M
|
|
394
424
|
}
|
|
395
425
|
}
|
|
396
|
-
},
|
|
397
|
-
return /* @__PURE__ */
|
|
426
|
+
}, ye = c ?? (D > 0 ? D : "100%"), be = d ?? Se[p ?? "md"], z = s != null && s.length ? s : void 0, ee = D - M * 2, te = y && z && ee > 0 ? ze(z, ee, ue) : void 0;
|
|
427
|
+
return /* @__PURE__ */ K(
|
|
398
428
|
"div",
|
|
399
429
|
{
|
|
400
|
-
ref:
|
|
430
|
+
ref: T,
|
|
401
431
|
role: "img",
|
|
402
|
-
"aria-label":
|
|
432
|
+
"aria-label": J,
|
|
403
433
|
dir: "ltr",
|
|
404
|
-
className:
|
|
405
|
-
size:
|
|
406
|
-
className:
|
|
434
|
+
className: ae({
|
|
435
|
+
size: d !== void 0 ? "auto" : p,
|
|
436
|
+
className: G
|
|
407
437
|
}),
|
|
408
438
|
"data-component": "sparkline",
|
|
409
|
-
"data-component-id":
|
|
410
|
-
...
|
|
439
|
+
"data-component-id": n,
|
|
440
|
+
...L,
|
|
411
441
|
children: [
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
|
|
442
|
+
/* @__PURE__ */ u(
|
|
443
|
+
Ie,
|
|
414
444
|
{
|
|
415
|
-
type:
|
|
416
|
-
series: [{ data:
|
|
417
|
-
options:
|
|
418
|
-
width:
|
|
419
|
-
height:
|
|
445
|
+
type: g,
|
|
446
|
+
series: [{ name: V, data: Y }],
|
|
447
|
+
options: ge,
|
|
448
|
+
width: ye,
|
|
449
|
+
height: be,
|
|
420
450
|
"aria-hidden": "true"
|
|
421
451
|
}
|
|
422
452
|
),
|
|
423
|
-
|
|
453
|
+
z && /* Drawn over the plot rather than through ApexCharts' own xaxis
|
|
424
454
|
annotations: a fraction of the measured extent is the one
|
|
425
455
|
positioning rule that survives series of different lengths, which
|
|
426
456
|
is what makes a column of sparklines share an x. */
|
|
@@ -430,32 +460,32 @@ const Ce = pe(
|
|
|
430
460
|
equal PLOT_EDGE_PADDING — Tailwind needs a static literal, so the
|
|
431
461
|
two cannot share one source; change them together or the first and
|
|
432
462
|
last annotation drift off the first and last data point. */
|
|
433
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ u("div", { className: "ds:pointer-events-none ds:absolute ds:inset-y-0 ds:inset-x-[2px]", children: /* @__PURE__ */ u(
|
|
434
464
|
"svg",
|
|
435
465
|
{
|
|
436
466
|
"aria-hidden": "true",
|
|
437
467
|
focusable: "false",
|
|
438
468
|
"data-testid": "sparkline-annotations",
|
|
439
469
|
className: "ds:size-full",
|
|
440
|
-
children:
|
|
441
|
-
const
|
|
470
|
+
children: z.map((e) => {
|
|
471
|
+
const t = de(e.position);
|
|
442
472
|
return (
|
|
443
473
|
/* A nested viewport placed at a percentage of the plot: the
|
|
444
474
|
one positioning rule that needs no measurement, so a column
|
|
445
475
|
of sparklines shares an x whatever their widths. */
|
|
446
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ K(
|
|
447
477
|
"svg",
|
|
448
478
|
{
|
|
449
|
-
x: `${
|
|
479
|
+
x: `${t * 100}%`,
|
|
450
480
|
y: "0",
|
|
451
481
|
width: "1",
|
|
452
482
|
height: "100%",
|
|
453
483
|
overflow: "visible",
|
|
454
484
|
"data-annotation-id": e.id,
|
|
455
|
-
"data-annotation-position":
|
|
456
|
-
className:
|
|
485
|
+
"data-annotation-position": t,
|
|
486
|
+
className: se({ tone: e.tone }),
|
|
457
487
|
children: [
|
|
458
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ u(
|
|
459
489
|
"line",
|
|
460
490
|
{
|
|
461
491
|
x1: 0,
|
|
@@ -465,14 +495,14 @@ const Ce = pe(
|
|
|
465
495
|
className: "ds:[stroke:var(--annotation-color)] ds:[stroke-dasharray:2_3] ds:[stroke-width:1]"
|
|
466
496
|
}
|
|
467
497
|
),
|
|
468
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ u(
|
|
469
499
|
"path",
|
|
470
500
|
{
|
|
471
|
-
d:
|
|
501
|
+
d: Re(
|
|
472
502
|
e.shape ?? "diamond",
|
|
473
503
|
0,
|
|
474
|
-
|
|
475
|
-
|
|
504
|
+
ie,
|
|
505
|
+
ie
|
|
476
506
|
),
|
|
477
507
|
className: "ds:[fill:var(--annotation-color)]"
|
|
478
508
|
}
|
|
@@ -485,41 +515,41 @@ const Ce = pe(
|
|
|
485
515
|
})
|
|
486
516
|
}
|
|
487
517
|
) }),
|
|
488
|
-
|
|
518
|
+
te && y && /* Sized in px, not percentages: the target size is a measurement,
|
|
489
519
|
not a fraction of a box the reader can resize.
|
|
490
520
|
`pointer-events-none` holds all the way down to the bands, so the
|
|
491
521
|
only live pixels are the token-width each annotation owns. */
|
|
492
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ u(
|
|
493
523
|
"div",
|
|
494
524
|
{
|
|
495
|
-
className:
|
|
496
|
-
size:
|
|
525
|
+
className: Ae({
|
|
526
|
+
size: d !== void 0 ? "auto" : p
|
|
497
527
|
}),
|
|
498
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ u(
|
|
499
529
|
"svg",
|
|
500
530
|
{
|
|
501
531
|
"aria-hidden": "true",
|
|
502
532
|
focusable: "false",
|
|
503
533
|
"data-testid": "sparkline-annotation-hits",
|
|
504
534
|
className: "ds:size-full",
|
|
505
|
-
children:
|
|
535
|
+
children: te.map(({ annotation: e, x: t, width: i }) => /* @__PURE__ */ K(
|
|
506
536
|
"g",
|
|
507
537
|
{
|
|
508
538
|
"data-annotation-hit-id": e.id,
|
|
509
|
-
onClick: () =>
|
|
510
|
-
className: `ds:group ds:pointer-events-auto ds:cursor-pointer ${
|
|
539
|
+
onClick: () => y(e.id),
|
|
540
|
+
className: `ds:group ds:pointer-events-auto ds:cursor-pointer ${se(
|
|
511
541
|
{ tone: e.tone }
|
|
512
542
|
)}`,
|
|
513
543
|
children: [
|
|
514
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ u("title", { children: v("sparkline.annotationAction", {
|
|
515
545
|
label: e.label
|
|
516
546
|
}) }),
|
|
517
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ u(
|
|
518
548
|
"rect",
|
|
519
549
|
{
|
|
520
|
-
x:
|
|
550
|
+
x: t,
|
|
521
551
|
y: 0,
|
|
522
|
-
width:
|
|
552
|
+
width: i,
|
|
523
553
|
height: "100%",
|
|
524
554
|
className: "ds:[fill:var(--annotation-color)] ds:opacity-0 ds:transition-opacity ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:group-hover:opacity-20"
|
|
525
555
|
}
|
|
@@ -532,12 +562,12 @@ const Ce = pe(
|
|
|
532
562
|
)
|
|
533
563
|
}
|
|
534
564
|
),
|
|
535
|
-
|
|
565
|
+
f && /* @__PURE__ */ u(
|
|
536
566
|
"span",
|
|
537
567
|
{
|
|
538
568
|
"aria-hidden": "true",
|
|
539
569
|
className: "ds:pointer-events-none ds:absolute ds:end-0 ds:top-0 ds:text-[length:var(--font-size-xs)] ds:leading-none",
|
|
540
|
-
children:
|
|
570
|
+
children: Oe[F]
|
|
541
571
|
}
|
|
542
572
|
)
|
|
543
573
|
]
|
|
@@ -545,10 +575,10 @@ const Ce = pe(
|
|
|
545
575
|
);
|
|
546
576
|
}
|
|
547
577
|
);
|
|
548
|
-
|
|
578
|
+
Pe.displayName = "Sparkline";
|
|
549
579
|
export {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
580
|
+
Pe as S,
|
|
581
|
+
Ce as s,
|
|
582
|
+
Te as u
|
|
553
583
|
};
|
|
554
|
-
//# sourceMappingURL=sparkline-
|
|
584
|
+
//# sourceMappingURL=sparkline-Dx_sxK3J.js.map
|