@mechane-ai/elements 0.41.0 → 0.43.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 (92) hide show
  1. package/README.md +72 -41
  2. package/bin/catalog.d.mts +17 -0
  3. package/bin/mechane-elements-catalog.mjs +60 -0
  4. package/dist/agent.js +1 -1
  5. package/dist/ai.js +23 -23
  6. package/dist/catalog.json +1984 -0
  7. package/dist/{categorical-values-DnGR_pQx.js → categorical-values-DzhbfZ5w.js} +3 -3
  8. package/dist/{chart-frame-BsyI1Zc8.js → chart-frame-9dQQNF3F.js} +74 -22
  9. package/dist/{chart-input-r4S3-QCT.js → chart-input-DT0STflx.js} +2 -2
  10. package/dist/{chart-navigation-D7OkLdSx.js → chart-navigation-BAbb5PV9.js} +67 -32
  11. package/dist/charts/cartesian.js +1728 -559
  12. package/dist/charts/distribution.js +5 -5
  13. package/dist/charts/graph.js +443 -76
  14. package/dist/charts/hierarchy.js +5 -5
  15. package/dist/charts/matrix.js +232 -63
  16. package/dist/charts/timeline.js +3 -3
  17. package/dist/charts.js +2 -2
  18. package/dist/{code-block-C4K1sM9O.js → code-block-Cpfr7B6a.js} +1 -1
  19. package/dist/collections.js +475 -354
  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 +2 -2
  25. package/dist/{content-link-CBDqSvgP.js → content-link-CGeFFb9F.js} +1 -1
  26. package/dist/content.js +1 -1
  27. package/dist/feedback.js +1 -1
  28. package/dist/forms/dates.js +11 -11
  29. package/dist/{forms-I-WMHTkr.js → forms-DeU0Tiv3.js} +6 -2
  30. package/dist/forms.js +3 -3
  31. package/dist/index.js +1 -1
  32. package/dist/label-spacing-BncjePGb.js +6 -0
  33. package/dist/layout.js +275 -249
  34. package/dist/mechane-elements-catalog.mjs +4 -0
  35. package/dist/navigation.js +2 -2
  36. package/dist/packages/charts/src/cartesian/bar-chart.d.ts +15 -3
  37. package/dist/packages/charts/src/cartesian/bar-data.d.ts +43 -0
  38. package/dist/packages/charts/src/cartesian/bar-overlays.d.ts +32 -0
  39. package/dist/packages/charts/src/cartesian/bridge-chart.d.ts +29 -0
  40. package/dist/packages/charts/src/cartesian/bridge-data.d.ts +40 -0
  41. package/dist/packages/charts/src/cartesian/index.d.ts +7 -2
  42. package/dist/packages/charts/src/cartesian/reference-lines.d.ts +34 -0
  43. package/dist/packages/charts/src/cartesian/sparkline.d.ts +10 -1
  44. package/dist/packages/charts/src/cartesian/time-series-bands.d.ts +66 -0
  45. package/dist/packages/charts/src/cartesian/time-series-data.d.ts +11 -1
  46. package/dist/packages/charts/src/cartesian/time-series-overlays.d.ts +35 -0
  47. package/dist/packages/charts/src/cartesian/time-series.d.ts +6 -1
  48. package/dist/packages/charts/src/chart-inspection.d.ts +4 -1
  49. package/dist/packages/charts/src/chart-navigation.d.ts +5 -1
  50. package/dist/packages/charts/src/chart-series-marker.d.ts +8 -1
  51. package/dist/packages/charts/src/chart-surface.d.ts +4 -0
  52. package/dist/packages/charts/src/chart-theme.d.ts +26 -0
  53. package/dist/packages/charts/src/graph/flow-diagram.d.ts +26 -0
  54. package/dist/packages/charts/src/graph/flow-layout.d.ts +70 -0
  55. package/dist/packages/charts/src/graph/index.d.ts +2 -0
  56. package/dist/packages/charts/src/index.d.ts +1 -1
  57. package/dist/packages/charts/src/label-spacing.d.ts +15 -0
  58. package/dist/packages/charts/src/matrix/matrix-cells.d.ts +4 -0
  59. package/dist/packages/charts/src/matrix/matrix-strip.d.ts +20 -0
  60. package/dist/packages/charts/src/matrix/matrix-types.d.ts +21 -0
  61. package/dist/packages/charts/src/matrix/matrix.d.ts +8 -19
  62. package/dist/packages/collections/src/collection-controls.d.ts +2 -1
  63. package/dist/packages/collections/src/data-table.d.ts +12 -8
  64. package/dist/packages/collections/src/index.d.ts +1 -0
  65. package/dist/packages/collections/src/table-results.d.ts +26 -0
  66. package/dist/packages/core/src/actions.d.ts +6 -0
  67. package/dist/packages/core/src/index.d.ts +1 -1
  68. package/dist/packages/forms/src/form-status.d.ts +7 -0
  69. package/dist/packages/forms/src/forms.d.ts +3 -1
  70. package/dist/packages/forms/src/index.d.ts +2 -0
  71. package/dist/packages/foundations/src/agent/index.d.ts +2 -2
  72. package/dist/packages/layout/src/page-context.d.ts +4 -0
  73. package/dist/packages/navigation/src/index.d.ts +1 -0
  74. package/dist/packages/navigation/src/route-link.d.ts +2 -0
  75. package/dist/{pierre-diff-DJ3oOfPX.js → pierre-diff-B3tD3-6z.js} +1 -1
  76. package/dist/{plot-width-BQQS-mw9.js → plot-width-DzCmthQW.js} +28 -0
  77. package/dist/{src-D2OHco8V.js → src-Bk7M67zy.js} +3 -3
  78. package/dist/{src-DfOAlAd2.js → src-BpvnBWrF.js} +1 -1
  79. package/dist/{src-CQQvXi7a.js → src-DBNncL7_.js} +70 -50
  80. package/dist/{src-s3tWwnN4.js → src-DcW_gMX8.js} +178 -168
  81. package/dist/{src-CNV1ewzb.js → src-gqEebHEa.js} +319 -285
  82. package/dist/styles2.css +115 -0
  83. package/package.json +9 -2
  84. package/recipes/allocation-report.tsx +115 -0
  85. package/recipes/consequential-form.tsx +132 -0
  86. package/recipes/searchable-collection.tsx +106 -0
  87. package/recipes/sectioned-report.tsx +58 -0
  88. package/recipes/tabbed-workspace.tsx +84 -0
  89. package/skills/extend-elements/SKILL.md +28 -0
  90. package/skills/use-elements/SKILL.md +36 -0
  91. package/skills/{elements-presentation/SKILL.md → use-elements/references/reports.md} +0 -6
  92. package/skills/{elements-workspace/SKILL.md → use-elements/references/workspace.md} +0 -6
@@ -1,8 +1,8 @@
1
- import { c as e } from "../src-DfOAlAd2.js";
1
+ import { c as e } from "../src-BpvnBWrF.js";
2
2
  import { r as t } from "../tokens.stylex-dF5CACEJ.js";
3
- import { n, r, t as i } from "../chart-input-r4S3-QCT.js";
4
- import { a, i as o, n as s, t as c } from "../chart-navigation-D7OkLdSx.js";
5
- import { i as l, n as u } from "../chart-frame-BsyI1Zc8.js";
3
+ import { n, r, t as i } from "../chart-input-DT0STflx.js";
4
+ import { a, i as o, n as s, t as c } from "../chart-navigation-BAbb5PV9.js";
5
+ import { i as l, n as u } from "../chart-frame-9dQQNF3F.js";
6
6
  import * as d from "@stylexjs/stylex";
7
7
  import { Button as f } from "@ui-sdk/react/button";
8
8
  import { jsx as p, jsxs as m } from "react/jsx-runtime";
@@ -72,11 +72,157 @@ function S({ label: e, domain: t, palette: n, formatValue: r }) {
72
72
  ]
73
73
  });
74
74
  }
75
+ function C(e, t, n) {
76
+ switch (e.kind) {
77
+ case "masked": return "×";
78
+ case "missing": return "—";
79
+ case "value": return n ? "!" : t.length <= 6 ? t : e.value === 0 ? "0" : "•";
80
+ }
81
+ }
82
+ function w(e, t, n) {
83
+ if (e === void 0) return "Not supplied";
84
+ switch (e.kind) {
85
+ case "value": return `${n(e.value)}${_(e.value, t) ? "" : " (outside domain)"}`;
86
+ case "masked": return `Masked: ${e.reason}`;
87
+ case "missing": return `Missing: ${e.reason}`;
88
+ }
89
+ }
90
+ // packages/charts/src/matrix/matrix-strip.tsx
91
+ var T = {
92
+ k1xSpc: "xrvj5dj",
93
+ kumcoG: "xqketvx",
94
+ k1C7PZ: "xuwhhnn",
95
+ khm7nJ: "x1hm1d26",
96
+ kGNEyG: "x6s0dn4",
97
+ k7Eaqz: "xeuugli",
98
+ kMv6JI: "x1hz01jw",
99
+ $$css: !0
100
+ }, E = {
101
+ kKwaWg: "x1e87kdn",
102
+ $$css: !0
103
+ }, D = {
104
+ grid: (e) => [T, { "--x-gridTemplateColumns": `minmax(48px, max-content) repeat(${e}, minmax(14px, 1fr))` == null ? void 0 : `minmax(48px, max-content) repeat(${e}, minmax(14px, 1fr))` }],
105
+ cell: {
106
+ k1xSpc: "x78zum5",
107
+ kGNEyG: "x6s0dn4",
108
+ kjj79g: "xl56j7k",
109
+ kB7OPa: "x9f619",
110
+ kzqmXN: "xh8yej3",
111
+ kZKoxP: "x17rw0jw x1ilzfib",
112
+ kogj98: "x1ghz6dp",
113
+ kmVPX3: "x1717udv",
114
+ kMzoRj: "xmkeg23",
115
+ ksu8eU: "x1y0btm7",
116
+ kVAM5u: "x1ey3b81",
117
+ kWkggS: "xpvm0e4",
118
+ kMwMTN: "x153jb6y",
119
+ kMv6JI: "x1hz01jw",
120
+ kGuDYH: "xy8obcc",
121
+ kLWn49: "xo5v014",
122
+ $$css: !0
123
+ },
124
+ measured: (e) => [E, { "--x-backgroundImage": `linear-gradient(${e}, ${e})` == null ? void 0 : `linear-gradient(${e}, ${e})` }],
125
+ empty: {
126
+ kWkggS: "x1r7kqkb",
127
+ $$css: !0
128
+ },
129
+ dashed: {
130
+ ksu8eU: "xbsl7fq",
131
+ kVAM5u: "xqrc7c3",
132
+ kWkggS: "x1r7kqkb",
133
+ $$css: !0
134
+ },
135
+ interactive: {
136
+ kkrTdU: "x1ypdohk",
137
+ k3XXqK: "x1t137rt",
138
+ kUjPgX: "xqd9x96",
139
+ $$css: !0
140
+ },
141
+ inspected: {
142
+ kMeerF: "x12ei19c",
143
+ kjBf7l: "xx9gdjd",
144
+ k3XXqK: "xaatb59",
145
+ kInvED: "x2ssjo2",
146
+ $$css: !0
147
+ },
148
+ selected: {
149
+ kMeerF: "x12ei19c",
150
+ kjBf7l: "xj5pgkc",
151
+ k3XXqK: "xaatb59",
152
+ kInvED: "x2ssjo2",
153
+ $$css: !0
154
+ }
155
+ };
156
+ function O({ cell: e, domain: t, palette: n }) {
157
+ if (e === void 0) return [D.empty];
158
+ switch (e.kind) {
159
+ case "masked": return [D.empty];
160
+ case "missing": return [D.dashed];
161
+ case "value": return _(e.value, t) ? [D.measured(v(e.value, {
162
+ domain: t,
163
+ palette: n
164
+ }))] : [D.dashed];
165
+ }
166
+ }
167
+ function k({ cell: e, text: t, domain: n }) {
168
+ return e === void 0 ? "·" : e.kind === "value" && _(e.value, n) ? "" : C(e, t, e.kind === "value");
169
+ }
170
+ function A({ rows: e, columns: t, cellAt: n, coordinateId: r, inspectedId: i, onInspect: a, domain: o, palette: s, formatValue: c, selection: l }) {
171
+ return /* @__PURE__ */ m("div", {
172
+ ...d.props(D.grid(t.length)),
173
+ children: [
174
+ /* @__PURE__ */ p("span", { "aria-hidden": !0 }),
175
+ t.map((e) => /* @__PURE__ */ p("span", {
176
+ "aria-hidden": !0,
177
+ title: e.label,
178
+ className: "xeuugli xb3r6kr xbrixnn xuxw1ft x2b8uid x153jb6y xy8obcc xas2l8k",
179
+ children: e.axisLabel ?? e.label
180
+ }, e.id)),
181
+ e.map((e) => /* @__PURE__ */ m("div", {
182
+ className: "xjp7ctv",
183
+ children: [/* @__PURE__ */ p("span", {
184
+ "aria-hidden": !0,
185
+ title: e.label,
186
+ className: "x18qnofl xb3r6kr xlyipyv xuxw1ft x1fa0jp5 xbixft xy8obcc xas2l8k",
187
+ children: e.label
188
+ }), t.map((t) => {
189
+ let u = n(e.id, t.id), m = u?.id ?? r(e.id, t.id), h = w(u, o, c), g = `${e.label}, ${t.label}: ${h}`, _ = u !== void 0 && l?.selectedId === u.id, v = d.props(D.cell, ...O({
190
+ cell: u,
191
+ domain: o,
192
+ palette: s
193
+ }), l !== void 0 && u !== void 0 && D.interactive, i === m && D.inspected, _ && D.selected), y = k({
194
+ cell: u,
195
+ text: h,
196
+ domain: o
197
+ });
198
+ return l === void 0 || u === void 0 ? /* @__PURE__ */ p("span", {
199
+ role: "img",
200
+ "aria-label": g,
201
+ title: g,
202
+ onPointerEnter: () => a(m),
203
+ ...v,
204
+ children: y
205
+ }, t.id) : /* @__PURE__ */ p(f, {
206
+ type: "button",
207
+ tabIndex: -1,
208
+ "aria-label": g,
209
+ title: g,
210
+ "aria-pressed": _,
211
+ onPointerEnter: () => a(m),
212
+ onClick: () => l.onSelect(u.id),
213
+ ...v,
214
+ children: y
215
+ }, t.id);
216
+ })]
217
+ }, e.id))
218
+ ]
219
+ });
220
+ }
75
221
  // packages/charts/src/matrix/matrix.tsx
76
- var C = {
222
+ var j = {
77
223
  kKwaWg: "x1e87kdn",
78
224
  $$css: !0
79
- }, w = {
225
+ }, M = {
80
226
  value: {
81
227
  k1xSpc: "x78zum5",
82
228
  kGNEyG: "x6s0dn4",
@@ -115,7 +261,7 @@ var C = {
115
261
  kInvED: "x2ssjo2",
116
262
  $$css: !0
117
263
  },
118
- measured: (e) => [C, { "--x-backgroundImage": `linear-gradient(${e}, ${e})` == null ? void 0 : `linear-gradient(${e}, ${e})` }],
264
+ measured: (e) => [j, { "--x-backgroundImage": `linear-gradient(${e}, ${e})` == null ? void 0 : `linear-gradient(${e}, ${e})` }],
119
265
  missing: {
120
266
  kMwMTN: "x153jb6y",
121
267
  kWkggS: "x1r7kqkb",
@@ -127,36 +273,58 @@ var C = {
127
273
  kWkggS: "x1r7kqkb",
128
274
  $$css: !0
129
275
  }
130
- }, T = {
276
+ };
277
+ function N(e, t) {
278
+ return JSON.stringify([e, t]);
279
+ }
280
+ var P = {
131
281
  value: void 0,
132
- masked: w.masked,
133
- missing: w.missing
134
- }, E = 4096, D = 6;
135
- function O({ title: e, report: t, description: n, rows: r, columns: o, cells: d, domain: f, palette: h, valueLabel: g, formatValue: v, selection: y, emptyLabel: b }) {
136
- let x = c({
282
+ masked: M.masked,
283
+ missing: M.missing
284
+ }, F = 4096;
285
+ function I({ title: e, report: t, description: n, rows: r, columns: o, cells: d, domain: f, palette: h, valueLabel: g, formatValue: v, selection: y, emptyLabel: b, variant: x = "values" }) {
286
+ let C = x === "strip";
287
+ function T(e, t) {
288
+ return d.find((n) => n.rowId === e && n.columnId === t);
289
+ }
290
+ let E = r.flatMap((e) => o.map((t) => {
291
+ let n = T(e.id, t.id);
292
+ return {
293
+ id: n?.id ?? N(e.id, t.id),
294
+ label: `${e.label} → ${t.label}: ${w(n, f, v)}`
295
+ };
296
+ })), D = c({
137
297
  title: e,
138
- selection: y,
139
- items: d.map((e) => ({
298
+ selection: C && y !== void 0 ? {
299
+ ...y,
300
+ onSelect: O
301
+ } : y,
302
+ columnCount: C ? o.length : void 0,
303
+ items: C ? E : d.map((e) => ({
140
304
  id: e.id,
141
- label: `${r.find((t) => t.id === e.rowId)?.label ?? e.rowId} → ${o.find((t) => t.id === e.columnId)?.label ?? e.columnId}: ${j(e, f, v)}`
305
+ label: `${r.find((t) => t.id === e.rowId)?.label ?? e.rowId} → ${o.find((t) => t.id === e.columnId)?.label ?? e.columnId}: ${w(e, f, v)}`
142
306
  }))
143
- }), C = M({
307
+ });
308
+ function O(e) {
309
+ d.some((t) => t.id === e) && y?.onSelect(e);
310
+ }
311
+ let k = R({
144
312
  rows: r,
145
313
  columns: o,
146
314
  cells: d,
147
315
  domain: f,
148
316
  palette: h
149
317
  });
150
- if (C !== null) return /* @__PURE__ */ p(i, {
318
+ if (k !== null) return /* @__PURE__ */ p(i, {
151
319
  title: e,
152
320
  report: t,
153
321
  description: n,
154
- message: C
322
+ message: k
155
323
  });
156
- let w = /* @__PURE__ */ new Map();
324
+ let j = /* @__PURE__ */ new Map();
157
325
  for (let e of d) {
158
- let t = w.get(e.rowId) ?? /* @__PURE__ */ new Map();
159
- t.set(e.columnId, e), w.set(e.rowId, t);
326
+ let t = j.get(e.rowId) ?? /* @__PURE__ */ new Map();
327
+ t.set(e.columnId, e), j.set(e.rowId, t);
160
328
  }
161
329
  return /* @__PURE__ */ p(u, {
162
330
  title: e,
@@ -179,12 +347,13 @@ function O({ title: e, report: t, description: n, rows: r, columns: o, cells: d,
179
347
  d.some((e) => e.kind === "missing") && /* @__PURE__ */ p("li", { children: "— Missing" }),
180
348
  d.length < r.length * o.length && /* @__PURE__ */ p("li", { children: "· Not supplied" }),
181
349
  d.some((e) => e.kind === "value" && !_(e.value, f)) && /* @__PURE__ */ p("li", { children: "! Outside domain" }),
182
- d.some((e) => e.kind === "value" && v(e.value).length > D) && /* @__PURE__ */ p("li", { children: "• Inspect a cell for its exact value" })
350
+ C && /* @__PURE__ */ p("li", { children: "Inspect a cell for its exact value" }),
351
+ !C && d.some((e) => e.kind === "value" && v(e.value).length > 6) && /* @__PURE__ */ p("li", { children: "• Inspect a cell for its exact value" })
183
352
  ]
184
353
  }),
185
354
  /* @__PURE__ */ p(l, {
186
- id: x.id,
187
- children: x.label ?? "\xA0"
355
+ id: D.id,
356
+ children: D.label ?? "\xA0"
188
357
  }),
189
358
  /* @__PURE__ */ p(a, {
190
359
  label: `${e} cells`,
@@ -197,7 +366,7 @@ function O({ title: e, report: t, description: n, rows: r, columns: o, cells: d,
197
366
  }],
198
367
  rows: r.flatMap((e) => o.map((t) => ({
199
368
  id: JSON.stringify([e.id, t.id]),
200
- values: [`${e.label} → ${t.label}`, j(w.get(e.id)?.get(t.id), f, v)]
369
+ values: [`${e.label} → ${t.label}`, w(j.get(e.id)?.get(t.id), f, v)]
201
370
  })))
202
371
  })
203
372
  ]
@@ -205,8 +374,23 @@ function O({ title: e, report: t, description: n, rows: r, columns: o, cells: d,
205
374
  children: r.length === 0 || o.length === 0 ? /* @__PURE__ */ p("p", {
206
375
  className: "x1ghz6dp x153jb6y xtqrqnz x1778rvt",
207
376
  children: b
377
+ }) : C ? /* @__PURE__ */ p(s, {
378
+ ...D.props,
379
+ className: "xysyzu8 x14eurpq xeuugli x1t137rt x13qnu6 x19rmrnh x9v5kkp x1bqaal x10dazmo",
380
+ children: /* @__PURE__ */ p(A, {
381
+ rows: r,
382
+ columns: o,
383
+ cellAt: (e, t) => j.get(e)?.get(t),
384
+ coordinateId: N,
385
+ inspectedId: D.label === void 0 ? void 0 : D.activeId,
386
+ onInspect: D.inspect,
387
+ domain: f,
388
+ palette: h,
389
+ formatValue: v,
390
+ selection: y
391
+ })
208
392
  }) : /* @__PURE__ */ p(s, {
209
- ...x.props,
393
+ ...D.props,
210
394
  className: "xysyzu8 x14eurpq xeuugli x1t137rt x13qnu6 x19rmrnh x9v5kkp x1bqaal",
211
395
  children: /* @__PURE__ */ m("table", {
212
396
  className: "x1vathgz x1jkpq5q xezivpi x1hz01jw",
@@ -230,15 +414,15 @@ function O({ title: e, report: t, description: n, rows: r, columns: o, cells: d,
230
414
  children: e.label
231
415
  })
232
416
  }), o.map((t) => {
233
- let n = w.get(e.id)?.get(t.id);
417
+ let n = j.get(e.id)?.get(t.id);
234
418
  return /* @__PURE__ */ p("td", {
235
419
  onPointerEnter: () => {
236
- n !== void 0 && x.inspect(n.id);
420
+ n !== void 0 && D.inspect(n.id);
237
421
  },
238
422
  className: "x1717udv x100vrsf x1ff4b4a x2b8uid",
239
- children: /* @__PURE__ */ p(k, {
423
+ children: /* @__PURE__ */ p(L, {
240
424
  cell: n,
241
- isInspected: x.label !== void 0 && x.activeId === n?.id,
425
+ isInspected: D.label !== void 0 && D.activeId === n?.id,
242
426
  label: `${e.label}, ${t.label}`,
243
427
  domain: f,
244
428
  palette: h,
@@ -251,7 +435,7 @@ function O({ title: e, report: t, description: n, rows: r, columns: o, cells: d,
251
435
  })
252
436
  });
253
437
  }
254
- function k({ cell: e, isInspected: t, label: n, domain: r, palette: i, formatValue: a, selection: o }) {
438
+ function L({ cell: e, isInspected: t, label: n, domain: r, palette: i, formatValue: a, selection: o }) {
255
439
  if (e === void 0) return /* @__PURE__ */ p("span", {
256
440
  role: "img",
257
441
  "aria-label": `${n}: not supplied`,
@@ -259,10 +443,10 @@ function k({ cell: e, isInspected: t, label: n, domain: r, palette: i, formatVal
259
443
  className: "x78zum5 x6s0dn4 xl56j7k x100vrsf x1ff4b4a x1vqgdyp x992rv9 x9f619 xmkeg23 x1ey3b81 x1717udv x1hz01jw xy8obcc xj57cvi xas2l8k xss6m8b x153jb6y x1r7kqkb xbsl7fq",
260
444
  children: "·"
261
445
  });
262
- let s = e.kind === "value" && !_(e.value, r), c = j(e, r, a), l = `${n}: ${c}`, u = e.kind === "value" && !s ? v(e.value, {
446
+ let s = e.kind === "value" && !_(e.value, r), c = w(e, r, a), l = `${n}: ${c}`, u = e.kind === "value" && !s ? v(e.value, {
263
447
  domain: r,
264
448
  palette: i
265
- }) : void 0, m = d.props(w.value, T[e.kind], u !== void 0 && w.measured(u), s && w.missing, o !== void 0 && w.interactive, (t || o?.selectedId === e.id) && w.selected), h = A(e, c, s), g = e.kind === "value" ? /* @__PURE__ */ p("span", {
449
+ }) : void 0, m = d.props(M.value, P[e.kind], u !== void 0 && M.measured(u), s && M.missing, o !== void 0 && M.interactive, (t || o?.selectedId === e.id) && M.selected), h = C(e, c, s), g = e.kind === "value" ? /* @__PURE__ */ p("span", {
266
450
  className: "xpvm0e4 x1r97e56",
267
451
  children: h
268
452
  }) : h;
@@ -283,28 +467,13 @@ function k({ cell: e, isInspected: t, label: n, domain: r, palette: i, formatVal
283
467
  children: g
284
468
  });
285
469
  }
286
- function A(e, t, n) {
287
- switch (e.kind) {
288
- case "masked": return "×";
289
- case "missing": return "—";
290
- case "value": return n ? "!" : t.length <= D ? t : e.value === 0 ? "0" : "•";
291
- }
292
- }
293
- function j(e, t, n) {
294
- if (e === void 0) return "Not supplied";
295
- switch (e.kind) {
296
- case "value": return `${n(e.value)}${_(e.value, t) ? "" : " (outside domain)"}`;
297
- case "masked": return `Masked: ${e.reason}`;
298
- case "missing": return `Missing: ${e.reason}`;
299
- }
300
- }
301
- function M({ rows: e, columns: t, cells: r, domain: i, palette: a }) {
470
+ function R({ rows: e, columns: t, cells: r, domain: i, palette: a }) {
302
471
  let o = g({
303
472
  domain: i,
304
473
  palette: a
305
474
  });
306
475
  if (o !== null) return o;
307
- if (e.length * t.length > 4096 || r.length > 4096) return `This matrix exceeds the ${E}-cell render limit. Supply a smaller, labelled window.`;
476
+ if (e.length * t.length > 4096 || r.length > 4096) return `This matrix exceeds the ${F}-cell render limit. Supply a smaller, labelled window.`;
308
477
  let s = new Set(e.map((e) => e.id)), c = new Set(t.map((e) => e.id));
309
478
  if (!n(e) || !n(t) || !n(r)) return "Matrix rows, columns, and cells must have unique identifiers.";
310
479
  let l = /* @__PURE__ */ new Map();
@@ -318,7 +487,7 @@ function M({ rows: e, columns: t, cells: r, domain: i, palette: a }) {
318
487
  return null;
319
488
  }
320
489
  // packages/charts/src/matrix/token-heatmap.tsx
321
- var N = {
490
+ var z = {
322
491
  token: {
323
492
  k1xSpc: "xt0psk2",
324
493
  kmVPX3: "x1717udv",
@@ -363,16 +532,16 @@ var N = {
363
532
  kInvED: "x1y3gkto",
364
533
  $$css: !0
365
534
  }
366
- }, P = 2048;
367
- function F({ title: e, report: t, description: n, tokens: r, domain: s, palette: h, valueLabel: g, formatValue: y, selection: b, emptyLabel: x }) {
535
+ }, B = 2048;
536
+ function V({ title: e, report: t, description: n, tokens: r, domain: s, palette: h, valueLabel: g, formatValue: y, selection: b, emptyLabel: x }) {
368
537
  let C = r.map((e) => ({
369
538
  id: e.id,
370
- label: `Token ${e.index}, ${JSON.stringify(e.text)}, ${g}: ${I(e, s, y)}`
539
+ label: `Token ${e.index}, ${JSON.stringify(e.text)}, ${g}: ${H(e, s, y)}`
371
540
  })), w = c({
372
541
  title: e,
373
542
  items: C,
374
543
  selection: b
375
- }), T = L({
544
+ }), T = U({
376
545
  tokens: r,
377
546
  domain: s,
378
547
  palette: h
@@ -400,10 +569,10 @@ function F({ title: e, report: t, description: n, tokens: r, domain: s, palette:
400
569
  ...w.props,
401
570
  className: "x1ghz6dp xbixft xiard35 xtqrqnz x1778rvt x126k92a xj0a0fe",
402
571
  children: r.map((e) => {
403
- let t = w.label !== void 0 && w.activeId === e.id, n = e.score !== null && !_(e.score, s), r = `Token ${e.index}, ${JSON.stringify(e.text)}, ${g}: ${I(e, s, y)}`, i = d.props(N.token, e.score === null || n ? N.missing : N.color(v(e.score, {
572
+ let t = w.label !== void 0 && w.activeId === e.id, n = e.score !== null && !_(e.score, s), r = `Token ${e.index}, ${JSON.stringify(e.text)}, ${g}: ${H(e, s, y)}`, i = d.props(z.token, e.score === null || n ? z.missing : z.color(v(e.score, {
404
573
  domain: s,
405
574
  palette: h
406
- })), b !== void 0 && N.interactive, (b?.selectedId === e.id || t) && N.selected);
575
+ })), b !== void 0 && z.interactive, (b?.selectedId === e.id || t) && z.selected);
407
576
  return b === void 0 ? /* @__PURE__ */ p("span", {
408
577
  title: r,
409
578
  onPointerEnter: () => w.inspect(e.id),
@@ -441,7 +610,7 @@ function F({ title: e, report: t, description: n, tokens: r, domain: s, palette:
441
610
  values: [
442
611
  String(e.index),
443
612
  JSON.stringify(e.text),
444
- I(e, s, y)
613
+ H(e, s, y)
445
614
  ]
446
615
  }))
447
616
  })]
@@ -452,17 +621,17 @@ function F({ title: e, report: t, description: n, tokens: r, domain: s, palette:
452
621
  message: T
453
622
  });
454
623
  }
455
- function I(e, t, n) {
624
+ function H(e, t, n) {
456
625
  return e.score === null ? "Unavailable" : `${n(e.score)}${_(e.score, t) ? "" : " (outside domain)"}`;
457
626
  }
458
- function L({ tokens: e, domain: t, palette: r }) {
627
+ function U({ tokens: e, domain: t, palette: r }) {
459
628
  let i = g({
460
629
  domain: t,
461
630
  palette: r
462
631
  });
463
- return i === null ? e.length > 2048 ? `This token view exceeds the ${P}-token render limit. Supply a smaller, labelled window.` : !n(e) || new Set(e.map((e) => e.index)).size !== e.length ? "Tokens must have unique identifiers and supplied indices." : e.some((e) => {
632
+ return i === null ? e.length > 2048 ? `This token view exceeds the ${B}-token render limit. Supply a smaller, labelled window.` : !n(e) || new Set(e.map((e) => e.index)).size !== e.length ? "Tokens must have unique identifiers and supplied indices." : e.some((e) => {
464
633
  let t = !Number.isSafeInteger(e.index) || e.index < 0, n = e.score !== null && !Number.isFinite(e.score);
465
634
  return t || n;
466
635
  }) ? "Token indices must be nonnegative integers and measured scores must be finite. Use null for unavailable scores." : null : i;
467
636
  }
468
- export { S as ColorLegend, P as MAX_HEATMAP_TOKENS, E as MAX_MATRIX_CELLS, O as Matrix, F as TokenHeatmap };
637
+ export { S as ColorLegend, B as MAX_HEATMAP_TOKENS, F as MAX_MATRIX_CELLS, I as Matrix, V as TokenHeatmap };
@@ -1,6 +1,6 @@
1
- import { c as e } from "../src-s3tWwnN4.js";
2
- import { n as t } from "../chart-frame-BsyI1Zc8.js";
3
- import { n, t as r } from "../chart-input-r4S3-QCT.js";
1
+ import { c as e } from "../src-DcW_gMX8.js";
2
+ import { n as t } from "../chart-frame-9dQQNF3F.js";
3
+ import { n, t as r } from "../chart-input-DT0STflx.js";
4
4
  import * as i from "@stylexjs/stylex";
5
5
  import { Button as a } from "@ui-sdk/react/button";
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
package/dist/charts.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as e, n as t, r as n } from "./chart-frame-BsyI1Zc8.js";
2
- import { c as r } from "./src-DfOAlAd2.js";
1
+ import { a as e, n as t, r as n } from "./chart-frame-9dQQNF3F.js";
2
+ import { c as r } from "./src-BpvnBWrF.js";
3
3
  export { t as ChartFrame, n as ChartLegend, e as ChartSeriesMarker, r as chartToneColors };
@@ -1,4 +1,4 @@
1
- import { v as e } from "./src-s3tWwnN4.js";
1
+ import { v as e } from "./src-DcW_gMX8.js";
2
2
  import { d as t, f as n, i as r, r as i, u as a } from "./tokens.stylex-dF5CACEJ.js";
3
3
  import { t as o } from "./use-scroll-tab-index-Dxpdh4W7.js";
4
4
  import { t as s } from "./viewer-styles-DsFYri4K.js";