iryx-ui 0.14.0 → 0.15.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.
@@ -1,36 +1,41 @@
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 s from "./ChartLegend.js";
5
+ import { lineChartTheme as c } from "../theme/line-chart.js";
6
+ import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, defineComponent as h, guardReactiveProps as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, openBlock as b, ref as x, renderList as S, renderSlot as C, toDisplayString as w, unref as T, useId as ee } from "vue";
7
7
  //#region src/components/LineChart.vue?vue&type=script&setup=true&lang.ts
8
- var w = ["role", "aria-label"], T = [
8
+ var te = ["role", "aria-label"], ne = [
9
9
  "width",
10
10
  "height",
11
11
  "viewBox"
12
- ], E = [
12
+ ], re = [
13
13
  "x1",
14
14
  "y1",
15
15
  "x2",
16
16
  "y2"
17
- ], D = ["x", "y"], O = ["d"], k = [
17
+ ], ie = ["x", "y"], ae = { key: 1 }, oe = ["d", "fill"], se = [
18
18
  "x1",
19
19
  "y1",
20
20
  "x2",
21
21
  "y2"
22
- ], A = ["d"], j = ["cx", "cy"], M = ["cx", "cy"], ne = ["x", "y"], re = [
22
+ ], ce = ["d"], le = ["cx", "cy"], ue = ["cx", "cy"], E = ["x", "y"], D = [
23
23
  "x",
24
24
  "y",
25
25
  "width",
26
26
  "height",
27
27
  "onPointerenter"
28
- ], ie = { scope: "row" }, N = /*@__PURE__*/ p({
28
+ ], O = { scope: "row" }, k = /*@__PURE__*/ h({
29
29
  __name: "LineChart",
30
30
  props: {
31
31
  data: { default: () => [] },
32
32
  series: {},
33
33
  variant: { default: "line" },
34
+ tension: { default: 0 },
35
+ flush: {
36
+ type: Boolean,
37
+ default: void 0
38
+ },
34
39
  height: { default: 240 },
35
40
  ticks: { default: 5 },
36
41
  axis: {
@@ -55,44 +60,44 @@ var w = ["role", "aria-label"], T = [
55
60
  class: {},
56
61
  ui: {}
57
62
  },
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);
63
+ setup(h) {
64
+ let k = h, A = e(), j = u(() => k.unstyled ?? A.unstyled), M = x(), { width: N } = t(M), P = u(() => new Intl.NumberFormat(k.locale, k.format));
65
+ function F(e) {
66
+ return P.value.format(e);
62
67
  }
63
- let z = l(() => {
64
- let e = N.series?.length ? [...N.series] : [{ key: "value" }];
68
+ let I = u(() => {
69
+ let e = k.series?.length ? [...k.series] : [{ key: "value" }];
65
70
  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) {
71
+ }), L = u(() => I.value.length > 1), de = u(() => L.value || k.legend && I.value[0].name != null);
72
+ function R(e, t) {
68
73
  let n = e[t];
69
74
  return typeof n == "number" && Number.isFinite(n) ? n : null;
70
75
  }
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
76
+ let z = u(() => n({
77
+ values: k.data.flatMap((e) => I.value.map((t) => R(e, t.key))),
78
+ categories: k.data.length,
79
+ longestLabel: Math.max(...k.data.map((e) => e.label.length), 1),
80
+ width: N.value,
81
+ height: k.height,
82
+ tickCount: k.ticks,
83
+ showAxis: k.axis,
84
+ formatTick: F,
85
+ includeZero: k.zero
81
86
  }));
82
- function W(e) {
87
+ function B(e) {
83
88
  return Math.round(e * 100) / 100;
84
89
  }
85
- let G = l(() => I.value ? z.value.map((e, t) => {
90
+ let V = u(() => N.value ? I.value.map((e, t) => {
86
91
  let n = [], r = [];
87
- return N.data.forEach((t, i) => {
88
- let a = H(t, e.key);
92
+ return k.data.forEach((t, i) => {
93
+ let a = R(t, e.key);
89
94
  if (a == null) {
90
95
  r.length && n.push(r), r = [];
91
96
  return;
92
97
  }
93
98
  r.push({
94
- x: W(U.value.bandCentre(i)),
95
- y: W(U.value.y(a)),
99
+ x: B(z.value.pointAt(i)),
100
+ y: B(z.value.y(a)),
96
101
  index: i
97
102
  });
98
103
  }), r.length && n.push(r), {
@@ -100,15 +105,41 @@ var w = ["role", "aria-label"], T = [
100
105
  color: i(a(e, t)),
101
106
  seriesIndex: t
102
107
  };
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(" ");
108
+ }) : []), H = u(() => k.variant === "area" && !L.value && V.value.length > 0), U = u(() => {
109
+ let e = k.data?.length ?? 0;
110
+ return {
111
+ first: e ? B(z.value.pointAt(0)) : 0,
112
+ last: e ? B(z.value.pointAt(e - 1)) : 0,
113
+ left: B(z.value.plot.left),
114
+ right: B(z.value.plot.left + z.value.plot.width)
115
+ };
116
+ });
117
+ function W(e) {
118
+ return k.flush && e.x === U.value.last ? `L${U.value.right} ${e.y}` : "";
119
+ }
120
+ let G = u(() => Math.min(Math.max(k.tension, 0), 1) / 6);
121
+ function K(e) {
122
+ let t = e[0], n = e[e.length - 1], r = k.flush && t.x === U.value.first ? `M${U.value.left} ${t.y} L${t.x} ${t.y}` : `M${t.x} ${t.y}`;
123
+ if (G.value === 0 || e.length < 2) return [
124
+ r,
125
+ ...e.slice(1).map((e) => `L${e.x} ${e.y}`),
126
+ W(n)
127
+ ].filter(Boolean).join(" ");
128
+ let i = (e, t, n) => Math.min(Math.max(e, Math.min(t, n)), Math.max(t, n));
129
+ return [
130
+ r,
131
+ ...e.slice(1).map((t, n) => {
132
+ let r = e[n], a = e[n - 1] ?? r, o = t, s = e[n + 2] ?? o, c = r.x + (o.x - a.x) * G.value, l = i(r.y + (o.y - a.y) * G.value, r.y, o.y), u = o.x - (s.x - r.x) * G.value, d = i(o.y - (s.y - r.y) * G.value, r.y, o.y);
133
+ return `C${B(c)} ${B(l)}, ${B(u)} ${B(d)}, ${o.x} ${o.y}`;
134
+ }),
135
+ W(n)
136
+ ].filter(Boolean).join(" ");
106
137
  }
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`;
138
+ function fe(e) {
139
+ let t = z.value.plot.top + z.value.plot.height, n = e[0], r = e[e.length - 1], i = k.flush && n.x === U.value.first ? U.value.left : n.x, a = k.flush && r.x === U.value.last ? U.value.right : r.x;
140
+ return `${K(e)} L${a} ${t} L${i} ${t} Z`;
110
141
  }
111
- let J = y(), Y = l(() => J.value == null ? [] : G.value.flatMap((e) => {
142
+ let q = `iryx-area-${ee()}`, J = x(), Y = u(() => J.value == null ? [] : V.value.flatMap((e) => {
112
143
  for (let t of e.runs) {
113
144
  let n = t.find((e) => e.index === J.value);
114
145
  if (n) return [{
@@ -117,149 +148,165 @@ var w = ["role", "aria-label"], T = [
117
148
  }];
118
149
  }
119
150
  return [];
120
- })), X = l(() => J.value == null ? void 0 : W(U.value.bandCentre(J.value))), Z = l(() => {
151
+ })), X = u(() => J.value == null ? void 0 : B(z.value.pointAt(J.value))), Z = u(() => {
121
152
  if (J.value == null) return;
122
- let e = N.data[J.value];
153
+ let e = k.data[J.value];
123
154
  if (!e) return;
124
- let t = z.value.map((t, n) => ({
155
+ let t = I.value.map((t, n) => ({
125
156
  name: t.name ?? t.key,
126
157
  color: i(a(t, n)),
127
- value: H(e, t.key)
158
+ value: R(e, t.key)
128
159
  })).filter((e) => e.value != null).map((e) => ({
129
160
  ...e,
130
- value: R(e.value)
161
+ value: F(e.value)
131
162
  }));
132
163
  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;
164
+ let n = L.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
165
  return {
135
166
  label: e.label,
136
167
  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)
168
+ multi: L.value,
169
+ x: r(z.value.pointAt(J.value), "x".repeat(n), N.value),
170
+ y: Math.min(...Y.value.map((e) => e.y), z.value.plot.top + z.value.plot.height)
140
171
  };
141
- }), Q = l(() => s());
172
+ }), Q = u(() => c());
142
173
  function $(e, t) {
143
- let n = N.ui?.[e];
144
- return P.value ? [n, t] : Q.value[e]({ class: [n, t] });
174
+ let n = k.ui?.[e];
175
+ return j.value ? [n, t] : Q.value[e]({ class: [n, t] });
145
176
  }
146
- return (e, t) => (v(), d("div", {
177
+ return (e, t) => (b(), p("div", {
147
178
  ref_key: "root",
148
- ref: F,
149
- role: N.label ? "figure" : void 0,
150
- "aria-label": N.label,
151
- class: h($("root", N.class))
179
+ ref: M,
180
+ role: k.label ? "figure" : void 0,
181
+ "aria-label": k.label,
182
+ class: _($("root", k.class))
152
183
  }, [
153
- V.value ? (v(), te(ee, {
184
+ de.value ? (b(), d(s, {
154
185
  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}`,
186
+ series: I.value,
187
+ unstyled: k.unstyled
188
+ }, null, 8, ["series", "unstyled"])) : f("", !0),
189
+ m("div", { class: _(j.value ? void 0 : Q.value.plot()) }, [(b(), p("svg", {
190
+ width: T(N),
191
+ height: k.height,
192
+ viewBox: `0 0 ${T(N)} ${k.height}`,
162
193
  "aria-hidden": "true",
163
- class: h($("svg"))
194
+ class: _($("svg"))
164
195
  }, [
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),
196
+ k.axis ? (b(!0), p(l, { key: 0 }, S(z.value.ticks, (e) => (b(), p("g", { key: `tick-${e}` }, [m("line", {
197
+ x1: z.value.plot.left,
198
+ y1: z.value.y(e),
199
+ x2: z.value.plot.left + z.value.plot.width,
200
+ y2: z.value.y(e),
170
201
  "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),
202
+ class: _($("grid"))
203
+ }, null, 10, re), m("text", {
204
+ x: z.value.plot.left - T(8),
205
+ y: z.value.y(e),
175
206
  "text-anchor": "end",
176
207
  "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", {
208
+ class: _($("tick"))
209
+ }, w(F(e)), 11, ie)]))), 128)) : f("", !0),
210
+ C(e.$slots, "underlay", v(g(z.value))),
211
+ H.value ? (b(), p("defs", ae, [m("linearGradient", {
212
+ id: q,
213
+ x1: "0",
214
+ y1: "0",
215
+ x2: "0",
216
+ y2: "1"
217
+ }, [...t[1] ||= [m("stop", {
218
+ offset: "0%",
219
+ "stop-color": "currentColor",
220
+ "stop-opacity": "0.35"
221
+ }, null, -1), m("stop", {
222
+ offset: "100%",
223
+ "stop-color": "currentColor",
224
+ "stop-opacity": "0"
225
+ }, null, -1)]])])) : f("", !0),
226
+ H.value ? (b(!0), p(l, { key: 2 }, S(V.value[0].runs, (e, t) => (b(), p("path", {
181
227
  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", {
187
- key: 2,
228
+ d: fe(e),
229
+ fill: `url(#${q})`,
230
+ style: y({ color: V.value[0].color }),
231
+ class: _($("area"))
232
+ }, null, 14, oe))), 128)) : f("", !0),
233
+ X.value == null ? f("", !0) : (b(), p("line", {
234
+ key: 3,
188
235
  x1: X.value,
189
- y1: U.value.plot.top,
236
+ y1: z.value.plot.top,
190
237
  x2: X.value,
191
- y2: U.value.plot.top + U.value.plot.height,
238
+ y2: z.value.plot.top + z.value.plot.height,
192
239
  "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", {
240
+ class: _($("crosshair"))
241
+ }, null, 10, se)),
242
+ (b(!0), p(l, null, S(V.value, (e) => (b(), p(l, { key: `series-${e.seriesIndex}` }, [(b(!0), p(l, null, S(e.runs, (t, n) => (b(), p("path", {
196
243
  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", {
244
+ d: K(t),
245
+ style: y({ stroke: e.color }),
246
+ class: _($("line"))
247
+ }, null, 14, ce))), 128))], 64))), 128)),
248
+ (b(!0), p(l, null, S(Y.value, (e, t) => (b(), p(l, { key: `marker-${t}` }, [m("circle", {
202
249
  cx: e.x,
203
250
  cy: e.y,
204
251
  r: "6",
205
- class: h($("markerRing"))
206
- }, null, 10, j), f("circle", {
252
+ class: _($("markerRing"))
253
+ }, null, 10, le), m("circle", {
207
254
  cx: e.x,
208
255
  cy: e.y,
209
256
  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", {
257
+ style: y({ fill: e.color }),
258
+ class: _($("marker"))
259
+ }, null, 14, ue)], 64))), 128)),
260
+ (b(!0), p(l, null, S(k.data, (e, t) => (b(), p(l, { key: `label-${e.label}-${t}` }, [t % z.value.labelStep === 0 ? (b(), p("text", {
214
261
  key: 0,
215
- x: U.value.bandCentre(t),
216
- y: U.value.plot.top + U.value.plot.height + 14,
262
+ x: z.value.pointAt(t),
263
+ y: z.value.plot.top + z.value.plot.height + 14,
217
264
  "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", {
265
+ class: _($("category"))
266
+ }, w(e.label), 11, E)) : f("", !0)], 64))), 128)),
267
+ C(e.$slots, "overlay", v(g(z.value))),
268
+ (b(!0), p(l, null, S(k.data, (e, n) => (b(), p("rect", {
222
269
  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()),
270
+ x: z.value.plot.left + z.value.bandWidth * n,
271
+ y: z.value.plot.top,
272
+ width: z.value.bandWidth,
273
+ height: z.value.plot.height,
274
+ class: _(j.value ? void 0 : Q.value.hit()),
228
275
  onPointerenter: (e) => J.value = n,
229
276
  onPointerleave: t[0] ||= (e) => J.value = void 0
230
- }, null, 42, re))), 128))
231
- ], 10, T)), Z.value ? (v(), d("div", {
277
+ }, null, 42, D))), 128))
278
+ ], 10, ne)), Z.value ? (b(), p("div", {
232
279
  key: 0,
233
- class: h($("tooltip", Z.value.multi ? "flex-col items-start gap-1" : void 0)),
234
- style: _({
280
+ class: _($("tooltip", Z.value.multi ? "flex-col items-start gap-1" : void 0)),
281
+ style: y({
235
282
  left: `${Z.value.x}px`,
236
283
  top: `${Z.value.y}px`,
237
284
  transform: "translate(-50%, -100%) translateY(-12px)"
238
285
  })
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", {
286
+ }, [m("span", { class: _($("tooltipLabel")) }, w(Z.value.label), 3), Z.value.multi ? (b(!0), p(l, { key: 0 }, S(Z.value.rows, (e) => (b(), p("span", {
240
287
  key: e.name,
241
288
  class: "flex items-center gap-1.5"
242
289
  }, [
243
- f("span", {
290
+ m("span", {
244
291
  class: "size-2 shrink-0 rounded-full",
245
- style: _({ background: e.color })
292
+ style: y({ background: e.color })
246
293
  }, 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", {
294
+ m("span", { class: _($("tooltipLabel")) }, w(e.name), 3),
295
+ m("span", { class: _($("tooltipValue")) }, w(e.value), 3)
296
+ ]))), 128)) : (b(), p("span", {
250
297
  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", {
298
+ class: _($("tooltipValue"))
299
+ }, w(Z.value.rows[0].value), 3))], 6)) : f("", !0)], 2),
300
+ m("div", { class: _($("table")) }, [m("table", null, [
301
+ m("caption", null, w(k.label), 1),
302
+ m("thead", null, [m("tr", null, [t[2] ||= m("th", { scope: "col" }, " Category ", -1), (b(!0), p(l, null, S(I.value, (e) => (b(), p("th", {
256
303
  key: e.key,
257
304
  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));
305
+ }, w(e.name ?? "Value"), 1))), 128))])]),
306
+ m("tbody", null, [(b(!0), p(l, null, S(k.data, (e, t) => (b(), p("tr", { key: `row-${e.label}-${t}` }, [m("th", O, w(e.label), 1), (b(!0), p(l, null, S(I.value, (t) => (b(), p("td", { key: t.key }, w(R(e, t.key) == null ? "—" : F(R(e, t.key))), 1))), 128))]))), 128))])
307
+ ])], 2)
308
+ ], 10, te));
262
309
  }
263
310
  });
264
311
  //#endregion
265
- export { N as default };
312
+ 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>;
@@ -32,7 +32,7 @@ export interface StatProps {
32
32
  };
33
33
  }
34
34
  declare var __VLS_8: {}, __VLS_10: {}, __VLS_12: {
35
- trend: "neutral" | "up" | "down";
35
+ trend: "up" | "down" | "neutral";
36
36
  }, __VLS_19: {};
37
37
  type __VLS_Slots = {} & {
38
38
  label?: (props: typeof __VLS_8) => any;
@@ -24,35 +24,35 @@ var x = /*@__PURE__*/ u({
24
24
  ui: {}
25
25
  },
26
26
  setup(u) {
27
- let x = u, S = r(() => x.trend ? x.trend : x.delta == null || x.delta === 0 ? "neutral" : x.delta > 0 ? "up" : "down"), C = r(() => ({
27
+ let x = u, S = r(() => x.delta == null || x.delta === 0 ? "neutral" : x.delta > 0 ? "up" : "down"), C = r(() => x.trend ?? S.value), w = r(() => ({
28
28
  up: y,
29
29
  down: _,
30
30
  neutral: v
31
- })[S.value]), w = r(() => {
31
+ })[S.value]), T = r(() => {
32
32
  if (x.delta != null) return x.formatDelta ? x.formatDelta(x.delta) : `${x.delta > 0 ? "+" : ""}${x.delta}%`;
33
- }), T = e(), E = r(() => x.unstyled ?? T.unstyled), D = r(() => n({
33
+ }), E = e(), D = r(() => x.unstyled ?? E.unstyled), O = r(() => n({
34
34
  size: x.size,
35
- trend: S.value
36
- })), O = r(() => E.value ? [x.ui?.root, x.class] : D.value.root({ class: [x.ui?.root, x.class] })), k = r(() => E.value ? x.ui?.label : D.value.label({ class: x.ui?.label })), A = r(() => E.value ? x.ui?.value : D.value.value({ class: x.ui?.value })), j = r(() => E.value ? x.ui?.delta : D.value.delta({ class: x.ui?.delta })), M = r(() => E.value ? x.ui?.hint : D.value.hint({ class: x.ui?.hint })), N = r(() => E.value ? x.ui?.row : D.value.row({ class: x.ui?.row }));
35
+ trend: C.value
36
+ })), k = r(() => D.value ? [x.ui?.root, x.class] : O.value.root({ class: [x.ui?.root, x.class] })), A = r(() => D.value ? x.ui?.label : O.value.label({ class: x.ui?.label })), j = r(() => D.value ? x.ui?.value : O.value.value({ class: x.ui?.value })), M = r(() => D.value ? x.ui?.delta : O.value.delta({ class: x.ui?.delta })), N = r(() => D.value ? x.ui?.hint : O.value.hint({ class: x.ui?.hint })), P = r(() => D.value ? x.ui?.row : O.value.row({ class: x.ui?.row }));
37
37
  return (e, n) => (f(), i(h(b), {
38
38
  as: x.as,
39
- class: d(O.value)
39
+ class: d(k.value)
40
40
  }, {
41
41
  default: g(() => [
42
42
  x.label || e.$slots.label ? (f(), o("span", {
43
43
  key: 0,
44
- class: d(k.value)
44
+ class: d(A.value)
45
45
  }, [p(e.$slots, "label", {}, () => [c(m(x.label), 1)])], 2)) : a("", !0),
46
- s("span", { class: d(N.value) }, [s("span", { class: d(A.value) }, [p(e.$slots, "default", {}, () => [c(m(x.value), 1)])], 2), w.value || e.$slots.delta ? (f(), o("span", {
46
+ s("span", { class: d(P.value) }, [s("span", { class: d(j.value) }, [p(e.$slots, "default", {}, () => [c(m(x.value), 1)])], 2), T.value || e.$slots.delta ? (f(), o("span", {
47
47
  key: 0,
48
- class: d(j.value)
49
- }, [p(e.$slots, "delta", { trend: S.value }, () => [l(t, {
50
- icon: C.value,
48
+ class: d(M.value)
49
+ }, [p(e.$slots, "delta", { trend: C.value }, () => [l(t, {
50
+ icon: w.value,
51
51
  "data-icon": "inline-start"
52
- }, null, 8, ["icon"]), c(" " + m(w.value), 1)])], 2)) : a("", !0)], 2),
52
+ }, null, 8, ["icon"]), c(" " + m(T.value), 1)])], 2)) : a("", !0)], 2),
53
53
  x.hint || e.$slots.hint ? (f(), o("span", {
54
54
  key: 1,
55
- class: d(M.value)
55
+ class: d(N.value)
56
56
  }, [p(e.$slots, "hint", {}, () => [c(m(x.hint), 1)])], 2)) : a("", !0)
57
57
  ]),
58
58
  _: 3
@@ -3,31 +3,31 @@ import t from "./Icon.js";
3
3
  import n from "./Accordion.js";
4
4
  import r from "./Alert.js";
5
5
  import i from "./App.js";
6
- import a from "./AppShell.js";
7
- import o from "./AspectRatio.js";
8
- import s from "./Avatar.js";
9
- import c from "./AvatarGroup.js";
10
- import l from "./Badge.js";
11
- import u from "./Banner.js";
12
- import d from "./ChartLegend.js";
13
- import f from "./BarChart.js";
14
- import p from "./Breadcrumb.js";
15
- import m from "./Button.js";
16
- import h from "./ButtonGroup.js";
17
- import g from "./Card.js";
18
- import _ from "./Checkbox.js";
19
- import v from "./Collapsible.js";
20
- import y from "./ColorPicker.js";
21
- import b from "./Combobox.js";
22
- import x from "./Kbd.js";
23
- import S from "./CommandPalette.js";
24
- import C from "./Dialog.js";
25
- import w from "./ConfirmDialog.js";
26
- import T from "./Container.js";
27
- import E from "./ContextMenu.js";
28
- import D from "./DatePicker.js";
29
- import O from "./DateRangePicker.js";
30
- import k from "./Drawer.js";
6
+ import a from "./Drawer.js";
7
+ import o from "./AppShell.js";
8
+ import s from "./AspectRatio.js";
9
+ import c from "./Avatar.js";
10
+ import l from "./AvatarGroup.js";
11
+ import u from "./Badge.js";
12
+ import d from "./Banner.js";
13
+ import f from "./ChartLegend.js";
14
+ import p from "./BarChart.js";
15
+ import m from "./Breadcrumb.js";
16
+ import h from "./Button.js";
17
+ import g from "./ButtonGroup.js";
18
+ import _ from "./Card.js";
19
+ import v from "./Checkbox.js";
20
+ import y from "./Collapsible.js";
21
+ import b from "./ColorPicker.js";
22
+ import x from "./Combobox.js";
23
+ import S from "./Kbd.js";
24
+ import C from "./CommandPalette.js";
25
+ import w from "./Dialog.js";
26
+ import T from "./ConfirmDialog.js";
27
+ import E from "./Container.js";
28
+ import D from "./ContextMenu.js";
29
+ import O from "./DatePicker.js";
30
+ import k from "./DateRangePicker.js";
31
31
  import A from "./DropdownMenu.js";
32
32
  import j from "./EmptyState.js";
33
33
  import M from "./FileUpload.js";
@@ -76,30 +76,30 @@ var ye = /* @__PURE__ */ e({
76
76
  Accordion: () => n,
77
77
  Alert: () => r,
78
78
  App: () => i,
79
- AppShell: () => a,
80
- AspectRatio: () => o,
81
- Avatar: () => s,
82
- AvatarGroup: () => c,
83
- Badge: () => l,
84
- Banner: () => u,
85
- BarChart: () => f,
86
- Breadcrumb: () => p,
87
- Button: () => m,
88
- ButtonGroup: () => h,
89
- Card: () => g,
90
- ChartLegend: () => d,
91
- Checkbox: () => _,
92
- Collapsible: () => v,
93
- ColorPicker: () => y,
94
- Combobox: () => b,
95
- CommandPalette: () => S,
96
- ConfirmDialog: () => w,
97
- Container: () => T,
98
- ContextMenu: () => E,
99
- DatePicker: () => D,
100
- DateRangePicker: () => O,
101
- Dialog: () => C,
102
- Drawer: () => k,
79
+ AppShell: () => o,
80
+ AspectRatio: () => s,
81
+ Avatar: () => c,
82
+ AvatarGroup: () => l,
83
+ Badge: () => u,
84
+ Banner: () => d,
85
+ BarChart: () => p,
86
+ Breadcrumb: () => m,
87
+ Button: () => h,
88
+ ButtonGroup: () => g,
89
+ Card: () => _,
90
+ ChartLegend: () => f,
91
+ Checkbox: () => v,
92
+ Collapsible: () => y,
93
+ ColorPicker: () => b,
94
+ Combobox: () => x,
95
+ CommandPalette: () => C,
96
+ ConfirmDialog: () => T,
97
+ Container: () => E,
98
+ ContextMenu: () => D,
99
+ DatePicker: () => O,
100
+ DateRangePicker: () => k,
101
+ Dialog: () => w,
102
+ Drawer: () => a,
103
103
  DropdownMenu: () => A,
104
104
  EmptyState: () => j,
105
105
  FileUpload: () => M,
@@ -107,7 +107,7 @@ var ye = /* @__PURE__ */ e({
107
107
  FormField: () => F,
108
108
  Icon: () => t,
109
109
  Input: () => I,
110
- Kbd: () => x,
110
+ Kbd: () => S,
111
111
  Label: () => P,
112
112
  LineChart: () => L,
113
113
  Menubar: () => R,
@@ -62,6 +62,13 @@ export interface CartesianLayout {
62
62
  labelStep: number;
63
63
  /** Centre of a category slot, in px along the category axis. */
64
64
  bandCentre: (index: number) => number;
65
+ /**
66
+ * Where a *point* sits, as against the middle of a band. The first lands
67
+ * on the left edge of the plot and the last on the right, so a line spans
68
+ * the full width instead of floating half a band clear of both sides.
69
+ * Bars want `bandCentre`; lines and areas want this.
70
+ */
71
+ pointAt: (index: number) => number;
65
72
  }
66
73
  export declare function cartesianLayout(input: CartesianInput): CartesianLayout;
67
74
  /** One plotted measure. `key` reads a field off each row; `name` labels it. */