iryx-ui 0.14.0 → 0.16.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.
Files changed (40) hide show
  1. package/README.md +3 -1
  2. package/dist/component-names.d.ts +1 -1
  3. package/dist/component-names.js +1 -1
  4. package/dist/components/AppShell.vue.d.ts +31 -6
  5. package/dist/components/AppShell.vue_vue_type_script_setup_true_lang.js +68 -28
  6. package/dist/components/BarChart.vue.d.ts +10 -0
  7. package/dist/components/BarChart.vue_vue_type_script_setup_true_lang.js +170 -152
  8. package/dist/components/DonutChart.js +5 -0
  9. package/dist/components/DonutChart.vue.d.ts +96 -0
  10. package/dist/components/DonutChart.vue_vue_type_script_setup_true_lang.js +234 -0
  11. package/dist/components/Drawer.vue.d.ts +1 -1
  12. package/dist/components/LineChart.vue.d.ts +26 -0
  13. package/dist/components/LineChart.vue_vue_type_script_setup_true_lang.js +205 -139
  14. package/dist/components/Popover.vue.d.ts +1 -1
  15. package/dist/components/Sparkline.vue.d.ts +9 -0
  16. package/dist/components/Sparkline.vue_vue_type_script_setup_true_lang.js +90 -53
  17. package/dist/components/Stat.vue.d.ts +1 -1
  18. package/dist/components/Stat.vue_vue_type_script_setup_true_lang.js +13 -13
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/components/index.js +140 -138
  21. package/dist/composables/cartesian.d.ts +17 -2
  22. package/dist/composables/cartesian.js +6 -1
  23. package/dist/composables/chart-reveal.d.ts +45 -0
  24. package/dist/composables/chart-reveal.js +93 -0
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.js +147 -144
  27. package/dist/theme/app-shell.d.ts +42 -0
  28. package/dist/theme/app-shell.js +13 -1
  29. package/dist/theme/bar-chart.js +1 -1
  30. package/dist/theme/button.d.ts +2 -2
  31. package/dist/theme/button.js +1 -1
  32. package/dist/theme/command-palette.d.ts +3 -3
  33. package/dist/theme/donut-chart.d.ts +104 -0
  34. package/dist/theme/donut-chart.js +17 -0
  35. package/dist/theme/form.js +1 -1
  36. package/dist/theme/index.d.ts +1 -0
  37. package/dist/theme/line-chart.js +2 -2
  38. package/dist/theme/sidebar.js +1 -1
  39. package/dist/theme/sparkline.js +1 -1
  40. package/package.json +1 -1
@@ -1,42 +1,57 @@
1
1
  import { useIryxUiConfig as e } from "../config.js";
2
2
  import { useElementSize as t } from "../composables/element-size.js";
3
3
  import { cartesianLayout as n, clampTooltip as r, seriesColor as i, slotOf as a, warnOnSlotOverflow as o } from "../composables/cartesian.js";
4
- import ee from "./ChartLegend.js";
5
- import { lineChartTheme as s } from "../theme/line-chart.js";
6
- import { Fragment as c, computed as l, createBlock as te, createCommentVNode as u, createElementBlock as d, createElementVNode as f, defineComponent as p, guardReactiveProps as m, normalizeClass as h, normalizeProps as g, normalizeStyle as _, openBlock as v, ref as y, renderList as b, renderSlot as x, toDisplayString as S, unref as C } from "vue";
4
+ import { useChartAnimation as s, useChartReveal as c } from "../composables/chart-reveal.js";
5
+ import l from "./ChartLegend.js";
6
+ import { lineChartTheme as u } from "../theme/line-chart.js";
7
+ import { Fragment as d, computed as f, createBlock as ee, createCommentVNode as p, createElementBlock as m, createElementVNode as h, defineComponent as g, guardReactiveProps as _, normalizeClass as v, normalizeProps as y, normalizeStyle as b, openBlock as x, ref as S, renderList as C, renderSlot as w, toDisplayString as T, unref as E, useId as D } from "vue";
7
8
  //#region src/components/LineChart.vue?vue&type=script&setup=true&lang.ts
8
- var w = ["role", "aria-label"], T = [
9
+ var te = ["role", "aria-label"], ne = [
9
10
  "width",
10
11
  "height",
11
12
  "viewBox"
12
- ], E = [
13
+ ], O = [
13
14
  "x1",
14
15
  "y1",
15
16
  "x2",
16
17
  "y2"
17
- ], D = ["x", "y"], O = ["d"], k = [
18
+ ], re = ["x", "y"], ie = { key: 1 }, ae = [
19
+ "x",
20
+ "y",
21
+ "width",
22
+ "height"
23
+ ], oe = [
18
24
  "x1",
19
25
  "y1",
20
26
  "x2",
21
27
  "y2"
22
- ], A = ["d"], j = ["cx", "cy"], M = ["cx", "cy"], ne = ["x", "y"], re = [
28
+ ], se = ["clip-path"], ce = ["d", "fill"], le = ["d"], ue = ["cx", "cy"], de = ["cx", "cy"], fe = ["x", "y"], pe = [
23
29
  "x",
24
30
  "y",
25
31
  "width",
26
32
  "height",
27
33
  "onPointerenter"
28
- ], ie = { scope: "row" }, N = /*@__PURE__*/ p({
34
+ ], me = { scope: "row" }, k = /*@__PURE__*/ g({
29
35
  __name: "LineChart",
30
36
  props: {
31
37
  data: { default: () => [] },
32
38
  series: {},
33
39
  variant: { default: "line" },
40
+ tension: { default: 0 },
41
+ flush: {
42
+ type: Boolean,
43
+ default: void 0
44
+ },
34
45
  height: { default: 240 },
35
46
  ticks: { default: 5 },
36
47
  axis: {
37
48
  type: Boolean,
38
49
  default: !0
39
50
  },
51
+ animate: {
52
+ type: [Boolean, Object],
53
+ default: !0
54
+ },
40
55
  legend: {
41
56
  type: Boolean,
42
57
  default: !0
@@ -55,44 +70,44 @@ var w = ["role", "aria-label"], T = [
55
70
  class: {},
56
71
  ui: {}
57
72
  },
58
- setup(p) {
59
- let N = p, ae = e(), P = l(() => N.unstyled ?? ae.unstyled), F = y(), { width: I } = t(F), L = l(() => new Intl.NumberFormat(N.locale, N.format));
60
- function R(e) {
61
- return L.value.format(e);
73
+ setup(g) {
74
+ let k = g, he = e(), A = f(() => k.unstyled ?? he.unstyled), j = S(), { width: M } = t(j), ge = f(() => new Intl.NumberFormat(k.locale, k.format));
75
+ function N(e) {
76
+ return ge.value.format(e);
62
77
  }
63
- let z = l(() => {
64
- let e = N.series?.length ? [...N.series] : [{ key: "value" }];
78
+ let P = f(() => {
79
+ let e = k.series?.length ? [...k.series] : [{ key: "value" }];
65
80
  return o(e.length), e;
66
- }), B = l(() => z.value.length > 1), V = l(() => B.value || N.legend && z.value[0].name != null);
67
- function H(e, t) {
81
+ }), F = f(() => P.value.length > 1), _e = f(() => F.value || k.legend && P.value[0].name != null);
82
+ function I(e, t) {
68
83
  let n = e[t];
69
84
  return typeof n == "number" && Number.isFinite(n) ? n : null;
70
85
  }
71
- let U = l(() => n({
72
- values: N.data.flatMap((e) => z.value.map((t) => H(e, t.key))),
73
- categories: N.data.length,
74
- longestLabel: Math.max(...N.data.map((e) => e.label.length), 1),
75
- width: I.value,
76
- height: N.height,
77
- tickCount: N.ticks,
78
- showAxis: N.axis,
79
- formatTick: R,
80
- includeZero: N.zero
86
+ let L = f(() => n({
87
+ values: k.data.flatMap((e) => P.value.map((t) => I(e, t.key))),
88
+ categories: k.data.length,
89
+ longestLabel: Math.max(...k.data.map((e) => e.label.length), 1),
90
+ width: M.value,
91
+ height: k.height,
92
+ tickCount: k.ticks,
93
+ showAxis: k.axis,
94
+ formatTick: N,
95
+ includeZero: k.zero
81
96
  }));
82
- function W(e) {
97
+ function R(e) {
83
98
  return Math.round(e * 100) / 100;
84
99
  }
85
- let G = l(() => I.value ? z.value.map((e, t) => {
100
+ let z = f(() => M.value ? P.value.map((e, t) => {
86
101
  let n = [], r = [];
87
- return N.data.forEach((t, i) => {
88
- let a = H(t, e.key);
102
+ return k.data.forEach((t, i) => {
103
+ let a = I(t, e.key);
89
104
  if (a == null) {
90
105
  r.length && n.push(r), r = [];
91
106
  return;
92
107
  }
93
108
  r.push({
94
- x: W(U.value.bandCentre(i)),
95
- y: W(U.value.y(a)),
109
+ x: R(L.value.pointAt(i)),
110
+ y: R(L.value.y(a)),
96
111
  index: i
97
112
  });
98
113
  }), r.length && n.push(r), {
@@ -100,166 +115,217 @@ var w = ["role", "aria-label"], T = [
100
115
  color: i(a(e, t)),
101
116
  seriesIndex: t
102
117
  };
103
- }) : []), K = l(() => N.variant === "area" && !B.value && G.value.length > 0);
104
- function q(e) {
105
- return e.map((e, t) => `${t === 0 ? "M" : "L"}${e.x} ${e.y}`).join(" ");
118
+ }) : []), B = f(() => k.variant === "area" && !F.value && z.value.length > 0), V = f(() => {
119
+ let e = k.data?.length ?? 0;
120
+ return {
121
+ first: e ? R(L.value.pointAt(0)) : 0,
122
+ last: e ? R(L.value.pointAt(e - 1)) : 0,
123
+ left: R(L.value.plot.left),
124
+ right: R(L.value.plot.left + L.value.plot.width)
125
+ };
126
+ });
127
+ function H(e) {
128
+ return k.flush && e.x === V.value.last ? `L${V.value.right} ${e.y}` : "";
106
129
  }
107
- function oe(e) {
108
- let t = U.value.plot.top + U.value.plot.height, n = e[0], r = e[e.length - 1];
109
- return `${q(e)} L${r.x} ${t} L${n.x} ${t} Z`;
130
+ let U = f(() => Math.min(Math.max(k.tension, 0), 1) / 6);
131
+ function W(e) {
132
+ let t = e[0], n = e[e.length - 1], r = k.flush && t.x === V.value.first ? `M${V.value.left} ${t.y} L${t.x} ${t.y}` : `M${t.x} ${t.y}`;
133
+ if (U.value === 0 || e.length < 2) return [
134
+ r,
135
+ ...e.slice(1).map((e) => `L${e.x} ${e.y}`),
136
+ H(n)
137
+ ].filter(Boolean).join(" ");
138
+ let i = (e, t, n) => Math.min(Math.max(e, Math.min(t, n)), Math.max(t, n));
139
+ return [
140
+ r,
141
+ ...e.slice(1).map((t, n) => {
142
+ let r = e[n], a = e[n - 1] ?? r, o = t, s = e[n + 2] ?? o, c = r.x + (o.x - a.x) * U.value, l = i(r.y + (o.y - a.y) * U.value, r.y, o.y), u = o.x - (s.x - r.x) * U.value, d = i(o.y - (s.y - r.y) * U.value, r.y, o.y);
143
+ return `C${R(c)} ${R(l)}, ${R(u)} ${R(d)}, ${o.x} ${o.y}`;
144
+ }),
145
+ H(n)
146
+ ].filter(Boolean).join(" ");
147
+ }
148
+ function ve(e) {
149
+ let t = L.value.plot.top + L.value.plot.height, n = e[0], r = e[e.length - 1], i = k.flush && n.x === V.value.first ? V.value.left : n.x, a = k.flush && r.x === V.value.last ? V.value.right : r.x;
150
+ return `${W(e)} L${a} ${t} L${i} ${t} Z`;
110
151
  }
111
- let J = y(), Y = l(() => J.value == null ? [] : G.value.flatMap((e) => {
152
+ let G = `iryx-area-${D()}`, K = `iryx-plot-clip-${D()}`, q = S(), J = f(() => q.value == null ? [] : z.value.flatMap((e) => {
112
153
  for (let t of e.runs) {
113
- let n = t.find((e) => e.index === J.value);
154
+ let n = t.find((e) => e.index === q.value);
114
155
  if (n) return [{
115
156
  ...n,
116
157
  color: e.color
117
158
  }];
118
159
  }
119
160
  return [];
120
- })), X = l(() => J.value == null ? void 0 : W(U.value.bandCentre(J.value))), Z = l(() => {
121
- if (J.value == null) return;
122
- let e = N.data[J.value];
161
+ })), Y = f(() => q.value == null ? void 0 : R(L.value.pointAt(q.value))), X = f(() => {
162
+ if (q.value == null) return;
163
+ let e = k.data[q.value];
123
164
  if (!e) return;
124
- let t = z.value.map((t, n) => ({
165
+ let t = P.value.map((t, n) => ({
125
166
  name: t.name ?? t.key,
126
167
  color: i(a(t, n)),
127
- value: H(e, t.key)
168
+ value: I(e, t.key)
128
169
  })).filter((e) => e.value != null).map((e) => ({
129
170
  ...e,
130
- value: R(e.value)
171
+ value: N(e.value)
131
172
  }));
132
173
  if (!t.length) return;
133
- let n = B.value ? Math.max(e.label.length, ...t.map((e) => e.name.length + e.value.length + 3)) : e.label.length + t[0].value.length + 2;
174
+ let n = F.value ? Math.max(e.label.length, ...t.map((e) => e.name.length + e.value.length + 3)) : e.label.length + t[0].value.length + 2;
134
175
  return {
135
176
  label: e.label,
136
177
  rows: t,
137
- multi: B.value,
138
- x: r(U.value.bandCentre(J.value), "x".repeat(n), I.value),
139
- y: Math.min(...Y.value.map((e) => e.y), U.value.plot.top + U.value.plot.height)
178
+ multi: F.value,
179
+ x: r(L.value.pointAt(q.value), "x".repeat(n), M.value),
180
+ y: Math.min(...J.value.map((e) => e.y), L.value.plot.top + L.value.plot.height)
140
181
  };
141
- }), Q = l(() => s());
182
+ }), Z = s(f(() => k.animate)), { revealed: ye } = c(f(() => !!(M.value && z.value.length)), Z), be = f(() => ({
183
+ transform: `scaleX(${+!!ye.value})`,
184
+ transformOrigin: `${L.value.plot.left}px 0px`,
185
+ transition: `transform ${Z.value.duration}ms ${Z.value.css}`
186
+ })), Q = f(() => u());
142
187
  function $(e, t) {
143
- let n = N.ui?.[e];
144
- return P.value ? [n, t] : Q.value[e]({ class: [n, t] });
188
+ let n = k.ui?.[e];
189
+ return A.value ? [n, t] : Q.value[e]({ class: [n, t] });
145
190
  }
146
- return (e, t) => (v(), d("div", {
191
+ return (e, t) => (x(), m("div", {
147
192
  ref_key: "root",
148
- ref: F,
149
- role: N.label ? "figure" : void 0,
150
- "aria-label": N.label,
151
- class: h($("root", N.class))
193
+ ref: j,
194
+ role: k.label ? "figure" : void 0,
195
+ "aria-label": k.label,
196
+ class: v($("root", k.class))
152
197
  }, [
153
- V.value ? (v(), te(ee, {
198
+ _e.value ? (x(), ee(l, {
154
199
  key: 0,
155
- series: z.value,
156
- unstyled: N.unstyled
157
- }, null, 8, ["series", "unstyled"])) : u("", !0),
158
- f("div", { class: h(P.value ? void 0 : Q.value.plot()) }, [(v(), d("svg", {
159
- width: C(I),
160
- height: N.height,
161
- viewBox: `0 0 ${C(I)} ${N.height}`,
200
+ series: P.value,
201
+ unstyled: k.unstyled
202
+ }, null, 8, ["series", "unstyled"])) : p("", !0),
203
+ h("div", { class: v(A.value ? void 0 : Q.value.plot()) }, [(x(), m("svg", {
204
+ width: E(M),
205
+ height: k.height,
206
+ viewBox: `0 0 ${E(M)} ${k.height}`,
162
207
  "aria-hidden": "true",
163
- class: h($("svg"))
208
+ class: v($("svg"))
164
209
  }, [
165
- N.axis ? (v(!0), d(c, { key: 0 }, b(U.value.ticks, (e) => (v(), d("g", { key: `tick-${e}` }, [f("line", {
166
- x1: U.value.plot.left,
167
- y1: U.value.y(e),
168
- x2: U.value.plot.left + U.value.plot.width,
169
- y2: U.value.y(e),
210
+ k.axis ? (x(!0), m(d, { key: 0 }, C(L.value.ticks, (e) => (x(), m("g", { key: `tick-${e}` }, [h("line", {
211
+ x1: L.value.plot.left,
212
+ y1: L.value.y(e),
213
+ x2: L.value.plot.left + L.value.plot.width,
214
+ y2: L.value.y(e),
170
215
  "stroke-width": "1",
171
- class: h($("grid"))
172
- }, null, 10, E), f("text", {
173
- x: U.value.plot.left - C(8),
174
- y: U.value.y(e),
216
+ class: v($("grid"))
217
+ }, null, 10, O), h("text", {
218
+ x: L.value.plot.left - E(8),
219
+ y: L.value.y(e),
175
220
  "text-anchor": "end",
176
221
  "dominant-baseline": "middle",
177
- class: h($("tick"))
178
- }, S(R(e)), 11, D)]))), 128)) : u("", !0),
179
- x(e.$slots, "underlay", g(m(U.value))),
180
- K.value ? (v(!0), d(c, { key: 1 }, b(G.value[0].runs, (e, t) => (v(), d("path", {
181
- key: `area-${t}`,
182
- d: oe(e),
183
- style: _({ fill: G.value[0].color }),
184
- class: h($("area"))
185
- }, null, 14, O))), 128)) : u("", !0),
186
- X.value == null ? u("", !0) : (v(), d("line", {
222
+ class: v($("tick"))
223
+ }, T(N(e)), 11, re)]))), 128)) : p("", !0),
224
+ w(e.$slots, "underlay", y(_(L.value))),
225
+ B.value ? (x(), m("defs", ie, [h("linearGradient", {
226
+ id: G,
227
+ x1: "0",
228
+ y1: "0",
229
+ x2: "0",
230
+ y2: "1"
231
+ }, [...t[1] ||= [h("stop", {
232
+ offset: "0%",
233
+ "stop-color": "currentColor",
234
+ "stop-opacity": "0.35"
235
+ }, null, -1), h("stop", {
236
+ offset: "100%",
237
+ "stop-color": "currentColor",
238
+ "stop-opacity": "0"
239
+ }, null, -1)]]), h("clipPath", { id: K }, [h("rect", {
240
+ x: L.value.plot.left,
241
+ y: L.value.plot.top,
242
+ width: L.value.plot.width,
243
+ height: L.value.plot.height,
244
+ style: b(be.value)
245
+ }, null, 12, ae)])])) : p("", !0),
246
+ Y.value == null ? p("", !0) : (x(), m("line", {
187
247
  key: 2,
188
- x1: X.value,
189
- y1: U.value.plot.top,
190
- x2: X.value,
191
- y2: U.value.plot.top + U.value.plot.height,
248
+ x1: Y.value,
249
+ y1: L.value.plot.top,
250
+ x2: Y.value,
251
+ y2: L.value.plot.top + L.value.plot.height,
192
252
  "stroke-width": "1",
193
- class: h($("crosshair"))
194
- }, null, 10, k)),
195
- (v(!0), d(c, null, b(G.value, (e) => (v(), d(c, { key: `series-${e.seriesIndex}` }, [(v(!0), d(c, null, b(e.runs, (t, n) => (v(), d("path", {
253
+ class: v($("crosshair"))
254
+ }, null, 10, oe)),
255
+ h("g", { "clip-path": `url(#${K})` }, [(x(!0), m(d, null, C(B.value ? z.value[0].runs : [], (e, t) => (x(), m("path", {
256
+ key: `area-${t}`,
257
+ d: ve(e),
258
+ fill: `url(#${G})`,
259
+ style: b({ color: z.value[0].color }),
260
+ class: v($("area"))
261
+ }, null, 14, ce))), 128)), (x(!0), m(d, null, C(z.value, (e) => (x(), m(d, { key: `series-${e.seriesIndex}` }, [(x(!0), m(d, null, C(e.runs, (t, n) => (x(), m("path", {
196
262
  key: `line-${e.seriesIndex}-${n}`,
197
- d: q(t),
198
- style: _({ stroke: e.color }),
199
- class: h($("line"))
200
- }, null, 14, A))), 128))], 64))), 128)),
201
- (v(!0), d(c, null, b(Y.value, (e, t) => (v(), d(c, { key: `marker-${t}` }, [f("circle", {
263
+ d: W(t),
264
+ style: b({ stroke: e.color }),
265
+ class: v($("line"))
266
+ }, null, 14, le))), 128))], 64))), 128))], 8, se),
267
+ (x(!0), m(d, null, C(J.value, (e, t) => (x(), m(d, { key: `marker-${t}` }, [h("circle", {
202
268
  cx: e.x,
203
269
  cy: e.y,
204
270
  r: "6",
205
- class: h($("markerRing"))
206
- }, null, 10, j), f("circle", {
271
+ class: v($("markerRing"))
272
+ }, null, 10, ue), h("circle", {
207
273
  cx: e.x,
208
274
  cy: e.y,
209
275
  r: "4",
210
- style: _({ fill: e.color }),
211
- class: h($("marker"))
212
- }, null, 14, M)], 64))), 128)),
213
- (v(!0), d(c, null, b(N.data, (e, t) => (v(), d(c, { key: `label-${e.label}-${t}` }, [t % U.value.labelStep === 0 ? (v(), d("text", {
276
+ style: b({ fill: e.color }),
277
+ class: v($("marker"))
278
+ }, null, 14, de)], 64))), 128)),
279
+ (x(!0), m(d, null, C(k.data, (e, t) => (x(), m(d, { key: `label-${e.label}-${t}` }, [t % L.value.labelStep === 0 ? (x(), m("text", {
214
280
  key: 0,
215
- x: U.value.bandCentre(t),
216
- y: U.value.plot.top + U.value.plot.height + 14,
281
+ x: L.value.pointAt(t),
282
+ y: L.value.plot.top + L.value.plot.height + 14,
217
283
  "text-anchor": "middle",
218
- class: h($("category"))
219
- }, S(e.label), 11, ne)) : u("", !0)], 64))), 128)),
220
- x(e.$slots, "overlay", g(m(U.value))),
221
- (v(!0), d(c, null, b(N.data, (e, n) => (v(), d("rect", {
284
+ class: v($("category"))
285
+ }, T(e.label), 11, fe)) : p("", !0)], 64))), 128)),
286
+ w(e.$slots, "overlay", y(_(L.value))),
287
+ (x(!0), m(d, null, C(k.data, (e, n) => (x(), m("rect", {
222
288
  key: `hit-${e.label}-${n}`,
223
- x: U.value.plot.left + U.value.bandWidth * n,
224
- y: U.value.plot.top,
225
- width: U.value.bandWidth,
226
- height: U.value.plot.height,
227
- class: h(P.value ? void 0 : Q.value.hit()),
228
- onPointerenter: (e) => J.value = n,
229
- onPointerleave: t[0] ||= (e) => J.value = void 0
230
- }, null, 42, re))), 128))
231
- ], 10, T)), Z.value ? (v(), d("div", {
289
+ x: L.value.plot.left + L.value.bandWidth * n,
290
+ y: L.value.plot.top,
291
+ width: L.value.bandWidth,
292
+ height: L.value.plot.height,
293
+ class: v(A.value ? void 0 : Q.value.hit()),
294
+ onPointerenter: (e) => q.value = n,
295
+ onPointerleave: t[0] ||= (e) => q.value = void 0
296
+ }, null, 42, pe))), 128))
297
+ ], 10, ne)), X.value ? (x(), m("div", {
232
298
  key: 0,
233
- class: h($("tooltip", Z.value.multi ? "flex-col items-start gap-1" : void 0)),
234
- style: _({
235
- left: `${Z.value.x}px`,
236
- top: `${Z.value.y}px`,
299
+ class: v($("tooltip", X.value.multi ? "flex-col items-start gap-1" : void 0)),
300
+ style: b({
301
+ left: `${X.value.x}px`,
302
+ top: `${X.value.y}px`,
237
303
  transform: "translate(-50%, -100%) translateY(-12px)"
238
304
  })
239
- }, [f("span", { class: h($("tooltipLabel")) }, S(Z.value.label), 3), Z.value.multi ? (v(!0), d(c, { key: 0 }, b(Z.value.rows, (e) => (v(), d("span", {
305
+ }, [h("span", { class: v($("tooltipLabel")) }, T(X.value.label), 3), X.value.multi ? (x(!0), m(d, { key: 0 }, C(X.value.rows, (e) => (x(), m("span", {
240
306
  key: e.name,
241
307
  class: "flex items-center gap-1.5"
242
308
  }, [
243
- f("span", {
309
+ h("span", {
244
310
  class: "size-2 shrink-0 rounded-full",
245
- style: _({ background: e.color })
311
+ style: b({ background: e.color })
246
312
  }, null, 4),
247
- f("span", { class: h($("tooltipLabel")) }, S(e.name), 3),
248
- f("span", { class: h($("tooltipValue")) }, S(e.value), 3)
249
- ]))), 128)) : (v(), d("span", {
313
+ h("span", { class: v($("tooltipLabel")) }, T(e.name), 3),
314
+ h("span", { class: v($("tooltipValue")) }, T(e.value), 3)
315
+ ]))), 128)) : (x(), m("span", {
250
316
  key: 1,
251
- class: h($("tooltipValue"))
252
- }, S(Z.value.rows[0].value), 3))], 6)) : u("", !0)], 2),
253
- f("table", { class: h($("table")) }, [
254
- f("caption", null, S(N.label), 1),
255
- f("thead", null, [f("tr", null, [t[1] ||= f("th", { scope: "col" }, " Category ", -1), (v(!0), d(c, null, b(z.value, (e) => (v(), d("th", {
317
+ class: v($("tooltipValue"))
318
+ }, T(X.value.rows[0].value), 3))], 6)) : p("", !0)], 2),
319
+ h("div", { class: v($("table")) }, [h("table", null, [
320
+ h("caption", null, T(k.label), 1),
321
+ h("thead", null, [h("tr", null, [t[2] ||= h("th", { scope: "col" }, " Category ", -1), (x(!0), m(d, null, C(P.value, (e) => (x(), m("th", {
256
322
  key: e.key,
257
323
  scope: "col"
258
- }, S(e.name ?? "Value"), 1))), 128))])]),
259
- f("tbody", null, [(v(!0), d(c, null, b(N.data, (e, t) => (v(), d("tr", { key: `row-${e.label}-${t}` }, [f("th", ie, S(e.label), 1), (v(!0), d(c, null, b(z.value, (t) => (v(), d("td", { key: t.key }, S(H(e, t.key) == null ? "—" : R(H(e, t.key))), 1))), 128))]))), 128))])
260
- ], 2)
261
- ], 10, w));
324
+ }, T(e.name ?? "Value"), 1))), 128))])]),
325
+ h("tbody", null, [(x(!0), m(d, null, C(k.data, (e, t) => (x(), m("tr", { key: `row-${e.label}-${t}` }, [h("th", me, T(e.label), 1), (x(!0), m(d, null, C(P.value, (t) => (x(), m("td", { key: t.key }, T(I(e, t.key) == null ? "—" : N(I(e, t.key))), 1))), 128))]))), 128))])
326
+ ])], 2)
327
+ ], 10, te));
262
328
  }
263
329
  });
264
330
  //#endregion
265
- export { N as default };
331
+ export { k as default };
@@ -61,8 +61,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
61
61
  }>, {
62
62
  unstyled: boolean;
63
63
  closeLabel: string;
64
- align: "start" | "center" | "end";
65
64
  side: "top" | "right" | "bottom" | "left";
65
+ align: "start" | "center" | "end";
66
66
  sideOffset: number;
67
67
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
68
68
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,3 +1,4 @@
1
+ import type { ChartAnimate } from '../composables/chart-reveal';
1
2
  import type { SparseValue } from '../composables/scale';
2
3
  export interface SparklineProps {
3
4
  /** Values, oldest first. `null` is a gap in the series, not a zero. */
@@ -21,6 +22,13 @@ export interface SparklineProps {
21
22
  label?: string;
22
23
  /** Rendered height in px. Width always fills the container. */
23
24
  height?: number;
25
+ /**
26
+ * Draw the line on across the box on the first paint. Off by default here,
27
+ * unlike the full-size charts: a sparkline usually sits inside a stat tile
28
+ * or a table row, and a page of them animating at once is a distraction
29
+ * rather than an arrival.
30
+ */
31
+ animate?: ChartAnimate;
24
32
  /** Skip built-in classes; you take over styling entirely. */
25
33
  unstyled?: boolean;
26
34
  class?: string;
@@ -31,6 +39,7 @@ declare const __VLS_export: import("vue").DefineComponent<SparklineProps, {}, {}
31
39
  variant: "line" | "area";
32
40
  unstyled: boolean;
33
41
  data: readonly SparseValue[];
42
+ animate: ChartAnimate;
34
43
  height: number;
35
44
  baseline: "min" | "zero";
36
45
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;