@mechane-ai/elements 0.39.0 → 0.41.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 (110) hide show
  1. package/NOTICE +11 -19
  2. package/README.md +49 -25
  3. package/dist/accessibility-P89UG9-r.js +25 -0
  4. package/dist/agent.js +1 -0
  5. package/dist/ai.js +50 -44
  6. package/dist/{categorical-values-BECG-J6R.js → categorical-values-DnGR_pQx.js} +3 -3
  7. package/dist/{chart-frame-CJFnI39T.js → chart-frame-BsyI1Zc8.js} +58 -57
  8. package/dist/{chart-input-DwAobO8Y.js → chart-input-r4S3-QCT.js} +2 -2
  9. package/dist/chart-navigation-D7OkLdSx.js +119 -0
  10. package/dist/charts/cartesian.js +560 -583
  11. package/dist/charts/distribution.js +218 -218
  12. package/dist/charts/graph.js +86 -85
  13. package/dist/charts/hierarchy.js +4 -4
  14. package/dist/charts/matrix.js +148 -147
  15. package/dist/charts/timeline.js +77 -76
  16. package/dist/charts.js +2 -2
  17. package/dist/code-block-C4K1sM9O.js +255 -0
  18. package/dist/collections.js +828 -607
  19. package/dist/constants.stylex-BILvnwUk.js +84 -0
  20. package/dist/content/code.js +1 -1
  21. package/dist/content/diff.js +3 -3
  22. package/dist/content/link.js +1 -1
  23. package/dist/content/markdown.js +2 -2
  24. package/dist/content/tree.js +184 -77
  25. package/dist/{content-link-B3ObdyZY.js → content-link-CBDqSvgP.js} +1 -1
  26. package/dist/content.js +1 -1
  27. package/dist/control-styles-D3q_Qyxi.js +179 -0
  28. package/dist/csp.js +14 -1
  29. package/dist/feedback.js +1 -1
  30. package/dist/forms/dates.js +359 -245
  31. package/dist/forms-I-WMHTkr.js +139 -0
  32. package/dist/forms.js +3 -3
  33. package/dist/index.js +1 -1
  34. package/dist/layout.js +271 -241
  35. package/dist/navigation/commands.js +87 -76
  36. package/dist/{navigation-D2_sGy3C.js → navigation-CveMIuXI.js} +1 -1
  37. package/dist/navigation.js +2 -2
  38. package/dist/overlays.js +1 -1
  39. package/dist/packages/ai/src/message-action.d.ts +1 -1
  40. package/dist/packages/charts/src/chart-navigation.d.ts +18 -2
  41. package/dist/packages/charts/src/chart-surface.d.ts +23 -0
  42. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +3 -2
  43. package/dist/packages/collections/src/data-table.d.ts +7 -2
  44. package/dist/packages/collections/src/index.d.ts +4 -1
  45. package/dist/packages/collections/src/query-controls.d.ts +18 -0
  46. package/dist/packages/collections/src/table-query.d.ts +64 -0
  47. package/dist/packages/collections/src/use-collection-controls.d.ts +3 -8
  48. package/dist/packages/content/src/pierre-theme.d.ts +0 -1
  49. package/dist/packages/core/src/actions.d.ts +15 -13
  50. package/dist/packages/core/src/copy-value.d.ts +3 -2
  51. package/dist/packages/core/src/disclosure.d.ts +14 -11
  52. package/dist/packages/feedback/src/notifications.d.ts +15 -15
  53. package/dist/packages/feedback/src/toast.d.ts +9 -3
  54. package/dist/packages/forms/src/combobox.d.ts +31 -41
  55. package/dist/packages/forms/src/dates/event-month.d.ts +17 -0
  56. package/dist/packages/forms/src/dates/index.d.ts +2 -0
  57. package/dist/packages/forms/src/field-styles.d.ts +0 -19
  58. package/dist/packages/forms/src/form-controls.d.ts +26 -24
  59. package/dist/packages/forms/src/forms.d.ts +17 -14
  60. package/dist/packages/forms/src/select-control.d.ts +6 -4
  61. package/dist/packages/forms/src/select.d.ts +14 -18
  62. package/dist/packages/forms/src/selection-state.d.ts +11 -0
  63. package/dist/packages/forms/src/selection-styles.d.ts +3 -0
  64. package/dist/packages/forms/src/selection.d.ts +21 -19
  65. package/dist/packages/foundations/src/agent/index.d.ts +2 -0
  66. package/dist/packages/foundations/src/control-state.d.ts +2 -3
  67. package/dist/packages/foundations/src/control-styles.d.ts +19 -0
  68. package/dist/packages/foundations/src/csp/index.d.ts +1 -1
  69. package/dist/packages/foundations/src/csp/provider.d.ts +3 -0
  70. package/dist/packages/foundations/src/style-composition.d.ts +4 -1
  71. package/dist/packages/layout/src/app-shell.d.ts +12 -1
  72. package/dist/packages/layout/src/index.d.ts +1 -1
  73. package/dist/packages/layout/src/navigation-rail.d.ts +15 -2
  74. package/dist/packages/layout/src/resizable.d.ts +2 -2
  75. package/dist/packages/layout/src/sidebar.d.ts +4 -3
  76. package/dist/packages/navigation/src/tab-styles.d.ts +1 -1
  77. package/dist/packages/navigation/src/tabs.d.ts +12 -10
  78. package/dist/packages/overlays/src/alert-dialog.d.ts +19 -13
  79. package/dist/packages/overlays/src/dialog.d.ts +39 -24
  80. package/dist/packages/overlays/src/drawer.d.ts +16 -26
  81. package/dist/packages/overlays/src/menu.d.ts +37 -44
  82. package/dist/packages/overlays/src/overlay-root.d.ts +10 -0
  83. package/dist/packages/overlays/src/popover.d.ts +11 -20
  84. package/dist/packages/overlays/src/preview.d.ts +6 -13
  85. package/dist/packages/overlays/src/tooltip.d.ts +12 -15
  86. package/dist/{pierre-diff-CaPsfQRo.js → pierre-diff-DJ3oOfPX.js} +5 -5
  87. package/dist/{src-DPRmO-JY.js → src-CNV1ewzb.js} +379 -407
  88. package/dist/{src-CSWIG_op.js → src-CQQvXi7a.js} +58 -81
  89. package/dist/{src-DWjAoOyd.js → src-D2OHco8V.js} +42 -41
  90. package/dist/src-DfOAlAd2.js +750 -0
  91. package/dist/src-na2DdkKI.js +561 -0
  92. package/dist/{src-C-Sx37kz.js → src-s3tWwnN4.js} +361 -518
  93. package/dist/styles.js +3 -0
  94. package/dist/{elements.css → styles2.css} +195 -97
  95. package/dist/tokens.js +3 -1
  96. package/dist/{tokens.stylex-CJbIDPB9.js → tokens.stylex-dF5CACEJ.js} +13 -93
  97. package/package.json +8 -9
  98. package/skills/elements-workspace/SKILL.md +12 -0
  99. package/dist/accessibility-C-aIZ1Yx.js +0 -15
  100. package/dist/chart-navigation-CBIeNtJq.js +0 -67
  101. package/dist/code-block-aC0Htt4N.js +0 -184
  102. package/dist/forms-BQQFas9g.js +0 -118
  103. package/dist/foundations.css +0 -7
  104. package/dist/packages/content/src/tree/pierre-tree.d.ts +0 -3
  105. package/dist/pierre-theme-BpNaWn1x.js +0 -126
  106. package/dist/pierre-tree-CYCRjdGG.js +0 -106
  107. package/dist/src-d7EAi61b.js +0 -617
  108. package/dist/src-nkgFDl-g.js +0 -1171
  109. package/dist/style-composition-uYlczSsB.js +0 -9
  110. package/styles.css +0 -2
@@ -1,32 +1,32 @@
1
- import { c as e } from "../src-nkgFDl-g.js";
2
- import { n as t, t as n } from "../chart-navigation-CBIeNtJq.js";
3
- import { i as r, n as i, t as a } from "../chart-frame-CJFnI39T.js";
4
- import { n as o, r as s, t as c } from "../chart-input-DwAobO8Y.js";
5
- import { n as l, t as u } from "../plot-width-BQQS-mw9.js";
6
- import * as d from "@stylexjs/stylex";
7
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
8
- import { scaleLinear as h } from "@visx/scale";
9
- import { Bar as g } from "@visx/shape";
1
+ import { c as e } from "../src-DfOAlAd2.js";
2
+ import { a as t, n, t as r } from "../chart-navigation-D7OkLdSx.js";
3
+ import { i, n as a, t as o } from "../chart-frame-BsyI1Zc8.js";
4
+ import { n as s, r as c, t as l } from "../chart-input-r4S3-QCT.js";
5
+ import { n as u, t as d } from "../plot-width-BQQS-mw9.js";
6
+ import * as f from "@stylexjs/stylex";
7
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
8
+ import { scaleLinear as g } from "@visx/scale";
9
+ import { Bar as _ } from "@visx/shape";
10
10
  // packages/charts/src/distribution/distribution-input.ts
11
- var _ = {
11
+ var v = {
12
12
  bins: 200,
13
13
  cumulativePoints: 2e3,
14
14
  rows: 200
15
15
  };
16
- function v({ items: e, domain: t, maxEntries: n }) {
17
- if (!s(t)) return "The chart domain must contain two finite, increasing values.";
18
- if (!o(e)) return "Chart records must have unique identifiers.";
16
+ function y({ items: e, domain: t, maxEntries: n }) {
17
+ if (!c(t)) return "The chart domain must contain two finite, increasing values.";
18
+ if (!s(e)) return "Chart records must have unique identifiers.";
19
19
  if (e.length > n) return `This chart supports at most ${n} records. Supply an explicit data window or aggregation.`;
20
20
  }
21
- function y(e, t) {
21
+ function b(e, t) {
22
22
  return !Number.isFinite(e) || e < t[0] || e > t[1];
23
23
  }
24
24
  // packages/charts/src/distribution/distribution-plot.tsx
25
- var b = { height: 160 }, x = [
25
+ var x = { height: 160 }, S = [
26
26
  0,
27
27
  .5,
28
28
  1
29
- ], S = {
29
+ ], C = {
30
30
  plot: {
31
31
  k7Eaqz: "xeuugli",
32
32
  k1xSpc: "xrvj5dj",
@@ -183,171 +183,171 @@ var b = { height: 160 }, x = [
183
183
  $$css: !0
184
184
  }
185
185
  };
186
- function C({ navigation: e, onInspectValue: t, xDomain: n, yDomain: r, xLabel: i, yLabel: a, formatX: o, formatY: s, children: c }) {
187
- let { ref: l, width: d } = u(), f = x.map((e) => n[0] + e * (n[1] - n[0])), h = x.map((e) => r[1] - e * (r[1] - r[0]));
188
- return /* @__PURE__ */ m("div", {
186
+ function w({ navigation: e, onInspectValue: t, xDomain: r, yDomain: i, xLabel: a, yLabel: o, formatX: s, formatY: c, children: l }) {
187
+ let { ref: u, width: f } = d(), p = S.map((e) => r[0] + e * (r[1] - r[0])), g = S.map((e) => i[1] - e * (i[1] - i[0]));
188
+ return /* @__PURE__ */ h("div", {
189
189
  className: "xeuugli xrvj5dj x37z1gs x1hnptsi",
190
190
  children: [
191
- /* @__PURE__ */ m("div", {
191
+ /* @__PURE__ */ h("div", {
192
192
  className: "x1osaytk x78zum5 x1qughib x1n8ia3y",
193
- children: [/* @__PURE__ */ p("span", {
193
+ children: [/* @__PURE__ */ m("span", {
194
194
  className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
195
- children: a
196
- }), /* @__PURE__ */ p("span", {
195
+ children: o
196
+ }), /* @__PURE__ */ m("span", {
197
197
  className: "x153jb6y xy8obcc xas2l8k xj0a0fe",
198
- children: i
198
+ children: a
199
199
  })]
200
200
  }),
201
- /* @__PURE__ */ p("div", {
201
+ /* @__PURE__ */ m("div", {
202
202
  "aria-hidden": !0,
203
203
  className: "x1ymw6g x78zum5 xdt5ytf x1qughib xp4054r x153jb6y xy8obcc xas2l8k xss6m8b x2aouup xj0a0fe",
204
- children: h.map((e) => /* @__PURE__ */ p("span", { children: s(e) }, e))
204
+ children: g.map((e) => /* @__PURE__ */ m("span", { children: c(e) }, e))
205
205
  }),
206
- /* @__PURE__ */ p("div", {
207
- ref: l,
206
+ /* @__PURE__ */ m(n, {
207
+ ref: u,
208
208
  ...e,
209
209
  className: "xeuugli",
210
- children: /* @__PURE__ */ m("svg", {
210
+ children: /* @__PURE__ */ h("svg", {
211
211
  "aria-hidden": !0,
212
212
  onPointerMove: (e) => {
213
- let r = e.currentTarget.getBoundingClientRect();
214
- t?.(n[0] + (e.clientX - r.left) / r.width * (n[1] - n[0]));
213
+ let n = e.currentTarget.getBoundingClientRect();
214
+ t?.(r[0] + (e.clientX - n.left) / n.width * (r[1] - r[0]));
215
215
  },
216
216
  onPointerDown: (e) => {
217
- let r = e.currentTarget.getBoundingClientRect();
218
- t?.(n[0] + (e.clientX - r.left) / r.width * (n[1] - n[0]));
217
+ let n = e.currentTarget.getBoundingClientRect();
218
+ t?.(r[0] + (e.clientX - n.left) / n.width * (r[1] - r[0]));
219
219
  },
220
- viewBox: `0 0 ${d} ${b.height}`,
220
+ viewBox: `0 0 ${f} ${x.height}`,
221
221
  preserveAspectRatio: "none",
222
222
  className: "x1lliihq xh8yej3 x1ymw6g xb3r6kr",
223
- children: [x.map((e) => /* @__PURE__ */ p("line", {
223
+ children: [S.map((e) => /* @__PURE__ */ m("line", {
224
224
  x1: 0,
225
- x2: d,
226
- y1: b.height * e,
227
- y2: b.height * e,
225
+ x2: f,
226
+ y1: x.height * e,
227
+ y2: x.height * e,
228
228
  className: "x13hfdr1 x1ntoi03 x13efnbd"
229
- }, e)), c(d)]
229
+ }, e)), l(f)]
230
230
  })
231
231
  }),
232
- /* @__PURE__ */ p("span", {}),
233
- /* @__PURE__ */ p("div", {
232
+ /* @__PURE__ */ m("span", {}),
233
+ /* @__PURE__ */ m("div", {
234
234
  "aria-hidden": !0,
235
235
  className: "x78zum5 x1qughib x1hnptsi x153jb6y xy8obcc xas2l8k xss6m8b",
236
- children: f.map((e, t) => /* @__PURE__ */ p("span", {
236
+ children: p.map((e, t) => /* @__PURE__ */ m("span", {
237
237
  ...{
238
238
  0: { className: "x1cqoux5 xeuugli xj0a0fe" },
239
239
  2: { className: "x1cqoux5 xeuugli xj0a0fe x2b8uid" },
240
240
  1: { className: "x1cqoux5 xeuugli xj0a0fe xp4054r" },
241
241
  3: { className: "x1cqoux5 xeuugli xj0a0fe xp4054r" }
242
242
  }[(t === 1) << 1 | t === 2],
243
- children: o(e)
243
+ children: s(e)
244
244
  }, e))
245
245
  })
246
246
  ]
247
247
  });
248
248
  }
249
- function w({ domain: e, formatValue: t }) {
250
- return /* @__PURE__ */ m("div", {
249
+ function T({ domain: e, formatValue: t }) {
250
+ return /* @__PURE__ */ h("div", {
251
251
  className: "x78zum5 x1qughib x1hnptsi x153jb6y xy8obcc xas2l8k xss6m8b",
252
- children: [/* @__PURE__ */ p("span", {
252
+ children: [/* @__PURE__ */ m("span", {
253
253
  className: "x1cqoux5 xeuugli xj0a0fe",
254
254
  children: t(e[0])
255
- }), /* @__PURE__ */ p("span", {
255
+ }), /* @__PURE__ */ m("span", {
256
256
  className: "x1cqoux5 xeuugli xj0a0fe xp4054r",
257
257
  children: t(e[1])
258
258
  })]
259
259
  });
260
260
  }
261
261
  // packages/charts/src/distribution/ecdf.tsx
262
- function T({ title: a, report: o, description: s, points: l, domain: u, valueLabel: g, probabilityLabel: _, formatValue: v, formatProbability: y, tone: x = "series1", selection: w, emptyLabel: T = "No cumulative distribution points are available." }) {
263
- let D = l.map((e) => ({
262
+ function E({ title: n, report: o, description: s, points: c, domain: u, valueLabel: d, probabilityLabel: _, formatValue: v, formatProbability: y, tone: b = "series1", selection: S, emptyLabel: T = "No cumulative distribution points are available." }) {
263
+ let E = c.map((e) => ({
264
264
  id: e.id,
265
- label: `${g}: ${v(e.value)}, ${_}: ${e.probability === null ? "Unavailable" : y(e.probability)}`
266
- })), O = n({
267
- title: a,
268
- items: D,
269
- selection: w
270
- }), k = E({
271
- points: l,
265
+ label: `${d}: ${v(e.value)}, ${_}: ${e.probability === null ? "Unavailable" : y(e.probability)}`
266
+ })), O = r({
267
+ title: n,
268
+ items: E,
269
+ selection: S
270
+ }), k = D({
271
+ points: c,
272
272
  domain: u
273
273
  });
274
- if (k !== void 0) return /* @__PURE__ */ p(c, {
275
- title: a,
274
+ if (k !== void 0) return /* @__PURE__ */ m(l, {
275
+ title: n,
276
276
  report: o,
277
277
  description: s,
278
278
  message: k
279
279
  });
280
- let A = h({
280
+ let A = g({
281
281
  domain: [0, 1],
282
- range: [b.height, 0]
282
+ range: [x.height, 0]
283
283
  });
284
- return /* @__PURE__ */ p(i, {
285
- title: a,
284
+ return /* @__PURE__ */ m(a, {
285
+ title: n,
286
286
  report: o,
287
287
  description: s,
288
- footer: /* @__PURE__ */ p(r, {
288
+ footer: /* @__PURE__ */ m(i, {
289
289
  id: O.id,
290
290
  children: O.label ?? "\xA0"
291
291
  }),
292
- children: l.length === 0 ? /* @__PURE__ */ p("p", {
293
- ...d.props(S.empty),
292
+ children: c.length === 0 ? /* @__PURE__ */ m("p", {
293
+ ...f.props(C.empty),
294
294
  children: T
295
- }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(C, {
295
+ }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(w, {
296
296
  navigation: O.props,
297
297
  onInspectValue: (e) => {
298
- let t = { point: l[0] };
299
- for (let n of l) (t.point === void 0 || Math.abs(n.value - e) < Math.abs(t.point.value - e)) && (t.point = n);
298
+ let t = { point: c[0] };
299
+ for (let n of c) (t.point === void 0 || Math.abs(n.value - e) < Math.abs(t.point.value - e)) && (t.point = n);
300
300
  let n = t.point;
301
301
  n !== void 0 && O.inspect(n.id);
302
302
  },
303
303
  xDomain: u,
304
304
  yDomain: [0, 1],
305
- xLabel: g,
305
+ xLabel: d,
306
306
  yLabel: _,
307
307
  formatX: v,
308
308
  formatY: y,
309
309
  children: (t) => {
310
- let n = h({
310
+ let n = g({
311
311
  domain: [...u],
312
312
  range: [0, t]
313
- }), r = l.map((e, t) => {
313
+ }), r = c.map((e, t) => {
314
314
  if (e.probability === null) return "";
315
- let r = n(e.value), i = A(e.probability), a = l[t - 1];
315
+ let r = n(e.value), i = A(e.probability), a = c[t - 1];
316
316
  return a === void 0 || a.probability === null ? `M ${r} ${i}` : `H ${r} V ${i}`;
317
317
  }).join(" ");
318
- return /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("path", {
318
+ return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("path", {
319
319
  d: r,
320
320
  fill: "none",
321
- stroke: e[x],
321
+ stroke: e[b],
322
322
  strokeWidth: 2,
323
323
  vectorEffect: "non-scaling-stroke"
324
- }), l.map((t) => t.probability === null ? null : /* @__PURE__ */ p("circle", {
324
+ }), c.map((t) => t.probability === null ? null : /* @__PURE__ */ m("circle", {
325
325
  onPointerEnter: () => O.inspect(t.id),
326
- onClick: () => w?.onSelect(t.id),
326
+ onClick: () => S?.onSelect(t.id),
327
327
  cx: n(t.value),
328
328
  cy: A(t.probability),
329
- r: w?.selectedId === t.id || O.label !== void 0 && O.activeId === t.id ? 4 : 2,
330
- fill: e[x]
329
+ r: S?.selectedId === t.id || O.label !== void 0 && O.activeId === t.id ? 4 : 2,
330
+ fill: e[b]
331
331
  }, t.id))] });
332
332
  }
333
- }), /* @__PURE__ */ p(t, {
334
- label: `${a} observations`,
333
+ }), /* @__PURE__ */ m(t, {
334
+ label: `${n} observations`,
335
335
  columns: [{
336
336
  id: "observation",
337
337
  label: "Observation"
338
338
  }],
339
- rows: D.map((e) => ({
339
+ rows: E.map((e) => ({
340
340
  id: e.id,
341
341
  values: [e.label]
342
342
  }))
343
343
  })] })
344
344
  });
345
345
  }
346
- function E({ points: e, domain: t }) {
347
- let n = v({
346
+ function D({ points: e, domain: t }) {
347
+ let n = y({
348
348
  items: e,
349
349
  domain: t,
350
- maxEntries: _.cumulativePoints
350
+ maxEntries: v.cumulativePoints
351
351
  });
352
352
  if (n !== void 0) return n;
353
353
  let r = {
@@ -355,7 +355,7 @@ function E({ points: e, domain: t }) {
355
355
  probability: 0
356
356
  };
357
357
  for (let n of e) {
358
- if (y(n.value, t) || n.value < r.value) return `Cumulative point ${n.id} is non-finite, outside the domain, or out of order.`;
358
+ if (b(n.value, t) || n.value < r.value) return `Cumulative point ${n.id} is non-finite, outside the domain, or out of order.`;
359
359
  if (n.probability !== null) {
360
360
  if (!Number.isFinite(n.probability) || n.probability < r.probability || n.probability > 1) return `Cumulative point ${n.id} must have a probability from zero to one that does not decrease.`;
361
361
  r.probability = n.probability;
@@ -364,84 +364,84 @@ function E({ points: e, domain: t }) {
364
364
  }
365
365
  }
366
366
  // packages/charts/src/distribution/histogram.tsx
367
- function D({ title: a, report: o, description: s, bins: u, domain: _, maximumCount: v, valueLabel: y, countLabel: x, formatValue: w, formatCount: T, tone: E = "series1", selection: D, emptyLabel: k = "No histogram bins are available." }) {
368
- let A = u.map((e) => ({
367
+ function O({ title: n, report: o, description: s, bins: c, domain: d, maximumCount: v, valueLabel: y, countLabel: b, formatValue: S, formatCount: T, tone: E = "series1", selection: D, emptyLabel: O = "No histogram bins are available." }) {
368
+ let A = c.map((e) => ({
369
369
  id: e.id,
370
- label: `${e.label}, ${w(e.lowerBound)} – ${w(e.upperBound)}, ${x}: ${e.count === null ? "Unavailable" : T(e.count)}`
371
- })), j = n({
372
- title: a,
370
+ label: `${e.label}, ${S(e.lowerBound)} – ${S(e.upperBound)}, ${b}: ${e.count === null ? "Unavailable" : T(e.count)}`
371
+ })), j = r({
372
+ title: n,
373
373
  items: A,
374
374
  selection: D
375
- }), M = O({
376
- bins: u,
377
- domain: _,
375
+ }), M = k({
376
+ bins: c,
377
+ domain: d,
378
378
  maximumCount: v
379
379
  });
380
- if (M !== void 0) return /* @__PURE__ */ p(c, {
381
- title: a,
380
+ if (M !== void 0) return /* @__PURE__ */ m(l, {
381
+ title: n,
382
382
  report: o,
383
383
  description: s,
384
384
  message: M
385
385
  });
386
- let N = h({
386
+ let N = g({
387
387
  domain: [0, v],
388
- range: [b.height, 0]
388
+ range: [x.height, 0]
389
389
  });
390
- return /* @__PURE__ */ p(i, {
391
- title: a,
390
+ return /* @__PURE__ */ m(a, {
391
+ title: n,
392
392
  report: o,
393
393
  description: s,
394
- footer: /* @__PURE__ */ p(r, {
394
+ footer: /* @__PURE__ */ m(i, {
395
395
  id: j.id,
396
396
  children: j.label ?? "\xA0"
397
397
  }),
398
- children: u.length === 0 ? /* @__PURE__ */ p("p", {
399
- ...d.props(S.empty),
400
- children: k
401
- }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(C, {
398
+ children: c.length === 0 ? /* @__PURE__ */ m("p", {
399
+ ...f.props(C.empty),
400
+ children: O
401
+ }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(w, {
402
402
  navigation: j.props,
403
403
  onInspectValue: (e) => {
404
- let t = u.find((t) => e >= t.lowerBound && e <= t.upperBound);
404
+ let t = c.find((t) => e >= t.lowerBound && e <= t.upperBound);
405
405
  t !== void 0 && j.inspect(t.id);
406
406
  },
407
- xDomain: _,
407
+ xDomain: d,
408
408
  yDomain: [0, v],
409
409
  xLabel: y,
410
- yLabel: x,
411
- formatX: w,
410
+ yLabel: b,
411
+ formatX: S,
412
412
  formatY: T,
413
413
  children: (t) => {
414
- let n = h({
415
- domain: [..._],
414
+ let n = g({
415
+ domain: [...d],
416
416
  range: [0, t]
417
417
  });
418
- return u.map((t) => {
418
+ return c.map((t) => {
419
419
  let r = n(t.lowerBound), i = n(t.upperBound) - r, a = Math.min(2, i * .2), o = D?.selectedId === t.id || j.label !== void 0 && j.activeId === t.id;
420
- if (t.count === null) return /* @__PURE__ */ p(g, {
420
+ if (t.count === null) return /* @__PURE__ */ m(_, {
421
421
  onPointerEnter: () => j.inspect(t.id),
422
422
  onClick: () => D?.onSelect(t.id),
423
423
  x: r + a / 2,
424
- y: b.height - 6,
424
+ y: x.height - 6,
425
425
  width: i - a,
426
426
  height: 5,
427
- ...d.props(S.missing)
427
+ ...f.props(C.missing)
428
428
  }, t.id);
429
429
  let s = N(t.count);
430
- return /* @__PURE__ */ p(g, {
430
+ return /* @__PURE__ */ m(_, {
431
431
  onPointerEnter: () => j.inspect(t.id),
432
432
  onClick: () => D?.onSelect(t.id),
433
433
  x: r + a / 2,
434
434
  y: s,
435
435
  width: i - a,
436
- height: b.height - s,
436
+ height: x.height - s,
437
437
  fill: e[E],
438
- ...d.props(o && l.selected),
438
+ ...f.props(o && u.selected),
439
439
  opacity: D?.selectedId === void 0 || o ? 1 : .45
440
440
  }, t.id);
441
441
  });
442
442
  }
443
- }), /* @__PURE__ */ p(t, {
444
- label: `${a} observations`,
443
+ }), /* @__PURE__ */ m(t, {
444
+ label: `${n} observations`,
445
445
  columns: [{
446
446
  id: "observation",
447
447
  label: "Observation"
@@ -453,108 +453,108 @@ function D({ title: a, report: o, description: s, bins: u, domain: _, maximumCou
453
453
  })] })
454
454
  });
455
455
  }
456
- function O({ bins: e, domain: t, maximumCount: n }) {
457
- let r = v({
456
+ function k({ bins: e, domain: t, maximumCount: n }) {
457
+ let r = y({
458
458
  items: e,
459
459
  domain: t,
460
- maxEntries: _.bins
460
+ maxEntries: v.bins
461
461
  });
462
462
  if (r !== void 0) return r;
463
463
  if (!Number.isFinite(n) || n <= 0) return "The histogram count domain must have a finite maximum greater than zero.";
464
464
  for (let [r, i] of e.entries()) {
465
- if (y(i.lowerBound, t) || y(i.upperBound, t)) return `Histogram bin ${i.id} has a non-finite bound or lies outside the declared domain.`;
465
+ if (b(i.lowerBound, t) || b(i.upperBound, t)) return `Histogram bin ${i.id} has a non-finite bound or lies outside the declared domain.`;
466
466
  let a = e[r - 1];
467
467
  if (i.lowerBound >= i.upperBound || a !== void 0 && i.lowerBound < a.upperBound) return `Histogram bin ${i.id} is reversed, overlaps another bin, or is out of order.`;
468
468
  if (i.count !== null && (!Number.isFinite(i.count) || i.count < 0 || i.count > n)) return `Histogram bin ${i.id} has a count outside the declared count domain.`;
469
469
  }
470
470
  }
471
471
  // packages/charts/src/distribution/interval-plot.tsx
472
- function k({ title: t, report: n, description: r, items: o, domain: s, valueLabel: l, intervalLabel: f, formatValue: g, selection: _, emptyLabel: v = "No interval estimates are available." }) {
473
- let { ref: y, width: b } = u(), x = A({
474
- items: o,
472
+ function A({ title: t, report: n, description: r, items: i, domain: s, valueLabel: c, intervalLabel: u, formatValue: p, selection: _, emptyLabel: v = "No interval estimates are available." }) {
473
+ let { ref: y, width: b } = d(), x = j({
474
+ items: i,
475
475
  domain: s
476
476
  });
477
- if (x !== void 0) return /* @__PURE__ */ p(c, {
477
+ if (x !== void 0) return /* @__PURE__ */ m(l, {
478
478
  title: t,
479
479
  report: n,
480
480
  description: r,
481
481
  message: x
482
482
  });
483
- let C = h({
483
+ let S = g({
484
484
  domain: [...s],
485
485
  range: [0, b]
486
486
  });
487
- return /* @__PURE__ */ p(i, {
487
+ return /* @__PURE__ */ m(a, {
488
488
  title: t,
489
489
  report: n,
490
490
  description: r,
491
- footer: `${l} · ${f}`,
492
- children: o.length === 0 ? /* @__PURE__ */ p("p", {
493
- ...d.props(S.empty),
491
+ footer: `${c} · ${u}`,
492
+ children: i.length === 0 ? /* @__PURE__ */ m("p", {
493
+ ...f.props(C.empty),
494
494
  children: v
495
- }) : /* @__PURE__ */ m("div", {
496
- ...d.props(S.values),
497
- children: [o.map((t) => {
498
- let n = t.estimate === null ? "Estimate unavailable" : g(t.estimate), r = `${f}: ${t.lower === null ? "Unavailable" : g(t.lower)} – ${t.upper === null ? "Unavailable" : g(t.upper)}`, i = e[t.tone ?? "series1"];
499
- return /* @__PURE__ */ p(a, {
500
- label: `${t.label}, ${l}: ${n}, ${r}`,
495
+ }) : /* @__PURE__ */ h("div", {
496
+ ...f.props(C.values),
497
+ children: [i.map((t) => {
498
+ let n = t.estimate === null ? "Estimate unavailable" : p(t.estimate), r = `${u}: ${t.lower === null ? "Unavailable" : p(t.lower)} – ${t.upper === null ? "Unavailable" : p(t.upper)}`, i = e[t.tone ?? "series1"];
499
+ return /* @__PURE__ */ m(o, {
500
+ label: `${t.label}, ${c}: ${n}, ${r}`,
501
501
  isSelected: _?.selectedId === t.id,
502
502
  onSelect: _ === void 0 ? void 0 : () => _.onSelect(t.id),
503
- children: /* @__PURE__ */ m("span", {
504
- ...d.props(S.row),
505
- children: [/* @__PURE__ */ m("span", {
506
- ...d.props(S.rowLabel),
503
+ children: /* @__PURE__ */ h("span", {
504
+ ...f.props(C.row),
505
+ children: [/* @__PURE__ */ h("span", {
506
+ ...f.props(C.rowLabel),
507
507
  children: [
508
- /* @__PURE__ */ p("span", { children: t.label }),
509
- /* @__PURE__ */ p("span", {
510
- ...d.props(S.rowValue),
508
+ /* @__PURE__ */ m("span", { children: t.label }),
509
+ /* @__PURE__ */ m("span", {
510
+ ...f.props(C.rowValue),
511
511
  children: n
512
512
  }),
513
- /* @__PURE__ */ p("span", {
514
- ...d.props(S.label),
513
+ /* @__PURE__ */ m("span", {
514
+ ...f.props(C.label),
515
515
  children: r
516
516
  })
517
517
  ]
518
- }), /* @__PURE__ */ m("svg", {
518
+ }), /* @__PURE__ */ h("svg", {
519
519
  "aria-hidden": !0,
520
520
  viewBox: `0 0 ${b} 28`,
521
521
  preserveAspectRatio: "none",
522
- ...d.props(S.rowSvg),
522
+ ...f.props(C.rowSvg),
523
523
  children: [
524
- /* @__PURE__ */ p("line", {
524
+ /* @__PURE__ */ m("line", {
525
525
  x1: 0,
526
526
  x2: b,
527
527
  y1: 14,
528
528
  y2: 14,
529
- ...d.props(S.baseline)
529
+ ...f.props(C.baseline)
530
530
  }),
531
- t.lower !== null && t.upper !== null && /* @__PURE__ */ m("g", {
531
+ t.lower !== null && t.upper !== null && /* @__PURE__ */ h("g", {
532
532
  stroke: i,
533
533
  strokeWidth: 2,
534
534
  vectorEffect: "non-scaling-stroke",
535
535
  children: [
536
- /* @__PURE__ */ p("line", {
537
- x1: C(t.lower),
538
- x2: C(t.upper),
536
+ /* @__PURE__ */ m("line", {
537
+ x1: S(t.lower),
538
+ x2: S(t.upper),
539
539
  y1: 14,
540
540
  y2: 14
541
541
  }),
542
- /* @__PURE__ */ p("line", {
543
- x1: C(t.lower),
544
- x2: C(t.lower),
542
+ /* @__PURE__ */ m("line", {
543
+ x1: S(t.lower),
544
+ x2: S(t.lower),
545
545
  y1: 9,
546
546
  y2: 19
547
547
  }),
548
- /* @__PURE__ */ p("line", {
549
- x1: C(t.upper),
550
- x2: C(t.upper),
548
+ /* @__PURE__ */ m("line", {
549
+ x1: S(t.upper),
550
+ x2: S(t.upper),
551
551
  y1: 9,
552
552
  y2: 19
553
553
  })
554
554
  ]
555
555
  }),
556
- t.estimate !== null && /* @__PURE__ */ p("circle", {
557
- cx: C(t.estimate),
556
+ t.estimate !== null && /* @__PURE__ */ m("circle", {
557
+ cx: S(t.estimate),
558
558
  cy: 14,
559
559
  r: 4,
560
560
  fill: i
@@ -563,24 +563,24 @@ function k({ title: t, report: n, description: r, items: o, domain: s, valueLabe
563
563
  })]
564
564
  })
565
565
  }, t.id);
566
- }), /* @__PURE__ */ m("div", {
567
- ...d.props(S.row, S.rowAxis),
568
- children: [/* @__PURE__ */ p("span", { ...d.props(S.axisSpacer) }), /* @__PURE__ */ p("div", {
566
+ }), /* @__PURE__ */ h("div", {
567
+ ...f.props(C.row, C.rowAxis),
568
+ children: [/* @__PURE__ */ m("span", { ...f.props(C.axisSpacer) }), /* @__PURE__ */ m("div", {
569
569
  ref: y,
570
- children: /* @__PURE__ */ p(w, {
570
+ children: /* @__PURE__ */ m(T, {
571
571
  domain: s,
572
- formatValue: g
572
+ formatValue: p
573
573
  })
574
574
  })]
575
575
  })]
576
576
  })
577
577
  });
578
578
  }
579
- function A({ items: e, domain: t }) {
580
- let n = v({
579
+ function j({ items: e, domain: t }) {
580
+ let n = y({
581
581
  items: e,
582
582
  domain: t,
583
- maxEntries: _.rows
583
+ maxEntries: v.rows
584
584
  });
585
585
  if (n !== void 0) return n;
586
586
  for (let n of e) {
@@ -588,7 +588,7 @@ function A({ items: e, domain: t }) {
588
588
  n.lower,
589
589
  n.estimate,
590
590
  n.upper
591
- ].some((e) => e !== null && y(e, t))) return `Interval ${n.id} has a non-finite value or lies outside the declared domain.`;
591
+ ].some((e) => e !== null && b(e, t))) return `Interval ${n.id} has a non-finite value or lies outside the declared domain.`;
592
592
  if (n.lower !== null && n.upper !== null && n.lower > n.upper) return `Interval ${n.id} has reversed endpoints.`;
593
593
  if (n.estimate !== null) {
594
594
  if (n.lower !== null && n.estimate < n.lower) return `Interval ${n.id} has an estimate below its lower endpoint.`;
@@ -597,95 +597,95 @@ function A({ items: e, domain: t }) {
597
597
  }
598
598
  }
599
599
  // packages/charts/src/distribution/ranked-bars.tsx
600
- function j({ title: t, report: n, description: r, items: o, domain: s, valueLabel: l, formatValue: f, selection: _, emptyLabel: v = "No ranked values are available." }) {
601
- let { ref: y, width: b } = u(), x = M({
602
- items: o,
600
+ function M({ title: t, report: n, description: r, items: i, domain: s, valueLabel: c, formatValue: u, selection: p, emptyLabel: v = "No ranked values are available." }) {
601
+ let { ref: y, width: b } = d(), x = N({
602
+ items: i,
603
603
  domain: s
604
604
  });
605
- if (x !== void 0) return /* @__PURE__ */ p(c, {
605
+ if (x !== void 0) return /* @__PURE__ */ m(l, {
606
606
  title: t,
607
607
  report: n,
608
608
  description: r,
609
609
  message: x
610
610
  });
611
- let C = h({
611
+ let S = g({
612
612
  domain: [...s],
613
613
  range: [0, b]
614
- }), T = C(0);
615
- return /* @__PURE__ */ p(i, {
614
+ }), w = S(0);
615
+ return /* @__PURE__ */ m(a, {
616
616
  title: t,
617
617
  report: n,
618
618
  description: r,
619
- footer: l,
620
- children: o.length === 0 ? /* @__PURE__ */ p("p", {
621
- ...d.props(S.empty),
619
+ footer: c,
620
+ children: i.length === 0 ? /* @__PURE__ */ m("p", {
621
+ ...f.props(C.empty),
622
622
  children: v
623
- }) : /* @__PURE__ */ m("div", {
624
- ...d.props(S.values),
625
- children: [o.map((t) => {
626
- let n = t.value === null ? "Unavailable" : f(t.value), r = t.rank === void 0 ? t.label : `${t.rank} · ${t.label}`, i = e[t.tone ?? "series1"];
627
- return /* @__PURE__ */ p(a, {
628
- label: `${r}, ${l}: ${n}`,
629
- isSelected: _?.selectedId === t.id,
630
- onSelect: _ === void 0 ? void 0 : () => _.onSelect(t.id),
631
- children: /* @__PURE__ */ m("span", {
632
- ...d.props(S.row),
633
- children: [/* @__PURE__ */ m("span", {
634
- ...d.props(S.rowLabel),
635
- children: [/* @__PURE__ */ p("span", { children: r }), /* @__PURE__ */ p("span", {
636
- ...d.props(S.rowValue),
623
+ }) : /* @__PURE__ */ h("div", {
624
+ ...f.props(C.values),
625
+ children: [i.map((t) => {
626
+ let n = t.value === null ? "Unavailable" : u(t.value), r = t.rank === void 0 ? t.label : `${t.rank} · ${t.label}`, i = e[t.tone ?? "series1"];
627
+ return /* @__PURE__ */ m(o, {
628
+ label: `${r}, ${c}: ${n}`,
629
+ isSelected: p?.selectedId === t.id,
630
+ onSelect: p === void 0 ? void 0 : () => p.onSelect(t.id),
631
+ children: /* @__PURE__ */ h("span", {
632
+ ...f.props(C.row),
633
+ children: [/* @__PURE__ */ h("span", {
634
+ ...f.props(C.rowLabel),
635
+ children: [/* @__PURE__ */ m("span", { children: r }), /* @__PURE__ */ m("span", {
636
+ ...f.props(C.rowValue),
637
637
  children: n
638
638
  })]
639
- }), /* @__PURE__ */ m("svg", {
639
+ }), /* @__PURE__ */ h("svg", {
640
640
  "aria-hidden": !0,
641
641
  viewBox: `0 0 ${b} 28`,
642
642
  preserveAspectRatio: "none",
643
- ...d.props(S.rowSvg),
644
- children: [/* @__PURE__ */ p("line", {
645
- x1: T,
646
- x2: T,
643
+ ...f.props(C.rowSvg),
644
+ children: [/* @__PURE__ */ m("line", {
645
+ x1: w,
646
+ x2: w,
647
647
  y1: 3,
648
648
  y2: 25,
649
- ...d.props(S.baseline)
650
- }), t.value !== null && (t.value === 0 ? /* @__PURE__ */ p("line", {
651
- x1: T,
652
- x2: T,
649
+ ...f.props(C.baseline)
650
+ }), t.value !== null && (t.value === 0 ? /* @__PURE__ */ m("line", {
651
+ x1: w,
652
+ x2: w,
653
653
  y1: 10,
654
654
  y2: 18,
655
655
  stroke: i,
656
656
  strokeWidth: 2,
657
657
  vectorEffect: "non-scaling-stroke"
658
- }) : /* @__PURE__ */ p(g, {
659
- x: Math.min(T, C(t.value)),
658
+ }) : /* @__PURE__ */ m(_, {
659
+ x: Math.min(w, S(t.value)),
660
660
  y: 10,
661
- width: Math.abs(C(t.value) - T),
661
+ width: Math.abs(S(t.value) - w),
662
662
  height: 8,
663
663
  fill: i
664
664
  }))]
665
665
  })]
666
666
  })
667
667
  }, t.id);
668
- }), /* @__PURE__ */ m("div", {
669
- ...d.props(S.row, S.rowAxis),
670
- children: [/* @__PURE__ */ p("span", { ...d.props(S.axisSpacer) }), /* @__PURE__ */ p("div", {
668
+ }), /* @__PURE__ */ h("div", {
669
+ ...f.props(C.row, C.rowAxis),
670
+ children: [/* @__PURE__ */ m("span", { ...f.props(C.axisSpacer) }), /* @__PURE__ */ m("div", {
671
671
  ref: y,
672
- children: /* @__PURE__ */ p(w, {
672
+ children: /* @__PURE__ */ m(T, {
673
673
  domain: s,
674
- formatValue: f
674
+ formatValue: u
675
675
  })
676
676
  })]
677
677
  })]
678
678
  })
679
679
  });
680
680
  }
681
- function M({ items: e, domain: t }) {
682
- let n = v({
681
+ function N({ items: e, domain: t }) {
682
+ let n = y({
683
683
  items: e,
684
684
  domain: t,
685
- maxEntries: _.rows
685
+ maxEntries: v.rows
686
686
  });
687
687
  if (n !== void 0) return n;
688
688
  if (t[0] > 0 || t[1] < 0) return "The ranked-value domain must include zero.";
689
- for (let n of e) if (n.value !== null && y(n.value, t)) return `Ranked value ${n.id} is non-finite or lies outside the declared domain.`;
689
+ for (let n of e) if (n.value !== null && b(n.value, t)) return `Ranked value ${n.id} is non-finite or lies outside the declared domain.`;
690
690
  }
691
- export { T as ECDF, D as Histogram, k as IntervalPlot, j as RankedBars };
691
+ export { E as ECDF, O as Histogram, A as IntervalPlot, M as RankedBars };