@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,69 +1,70 @@
1
- import { c as e } from "../src-nkgFDl-g.js";
2
- import { r as t } from "../tokens.stylex-CJbIDPB9.js";
3
- import { n, r, t as i } from "../chart-input-DwAobO8Y.js";
4
- import { n as a, t as o } from "../chart-navigation-CBIeNtJq.js";
5
- import { i as s, n as c } from "../chart-frame-CJFnI39T.js";
6
- import * as l from "@stylexjs/stylex";
7
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
1
+ import { c as e } from "../src-DfOAlAd2.js";
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";
6
+ import * as d from "@stylexjs/stylex";
7
+ import { Button as f } from "@ui-sdk/react/button";
8
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
8
9
  // packages/charts/src/matrix/heatmap-scale.ts
9
- var f = 100;
10
- function p({ domain: e, palette: t }) {
10
+ var h = 100;
11
+ function g({ domain: e, palette: t }) {
11
12
  return r(e) ? t === "diverging" && (e[0] >= 0 || e[1] <= 0) ? "A diverging color domain must include negative and positive values." : null : "The color domain must contain two finite, increasing endpoints.";
12
13
  }
13
- function m(e, t) {
14
+ function _(e, t) {
14
15
  return e >= t[0] && e <= t[1];
15
16
  }
16
- function h(n, { domain: r, palette: i }) {
17
+ function v(n, { domain: r, palette: i }) {
17
18
  if (i === "diverging") {
18
- let i = n < 0 ? r[0] : r[1], a = Math.abs(n) / Math.abs(i) * f;
19
+ let i = n < 0 ? r[0] : r[1], a = Math.abs(n) / Math.abs(i) * h;
19
20
  return `color-mix(in srgb, ${n < 0 ? e.negative : e.positive} ${a}%, ${t.surface})`;
20
21
  }
21
- let a = (n - r[0]) / (r[1] - r[0]) * f;
22
+ let a = (n - r[0]) / (r[1] - r[0]) * h;
22
23
  return `color-mix(in srgb, ${e.series1} ${a}%, ${t.surface})`;
23
24
  }
24
25
  // packages/charts/src/matrix/color-legend.tsx
25
- var g = {
26
+ var y = {
26
27
  kUk6DE: "x98rzlu",
27
28
  $$css: !0
28
- }, _ = { sample: (e) => [
29
- g,
29
+ }, b = { sample: (e) => [
30
+ y,
30
31
  {
31
32
  kWkggS: e == null ? e : "xl8spv7",
32
33
  $$css: !0
33
34
  },
34
35
  { "--x-backgroundColor": e ?? void 0 }
35
- ] }, v = 20;
36
- function y({ label: e, domain: t, palette: n, formatValue: r }) {
37
- let i = p({
36
+ ] }, x = 20;
37
+ function S({ label: e, domain: t, palette: n, formatValue: r }) {
38
+ let i = g({
38
39
  domain: t,
39
40
  palette: n
40
41
  });
41
- if (i !== null) return /* @__PURE__ */ u("p", {
42
+ if (i !== null) return /* @__PURE__ */ p("p", {
42
43
  role: "status",
43
44
  className: "xrvj5dj xunmzkg x1ghz6dp xeuugli x1jkqq1h x153jb6y x1hz01jw xy8obcc xas2l8k xj0a0fe",
44
45
  children: i
45
46
  });
46
- let a = Array.from({ length: 21 }, (e, n) => t[0] + (t[1] - t[0]) * n / v);
47
- return /* @__PURE__ */ d("div", {
47
+ let a = Array.from({ length: 21 }, (e, n) => t[0] + (t[1] - t[0]) * n / x);
48
+ return /* @__PURE__ */ m("div", {
48
49
  "aria-label": `${e}: ${r(t[0])} to ${r(t[1])}`,
49
50
  className: "xrvj5dj xunmzkg x1ghz6dp xeuugli x1jkqq1h x153jb6y x1hz01jw xy8obcc xas2l8k xj0a0fe",
50
51
  children: [
51
- /* @__PURE__ */ d("span", { children: [e, n === "diverging" && ` · Neutral: ${r(0)}`] }),
52
- /* @__PURE__ */ u("div", {
52
+ /* @__PURE__ */ m("span", { children: [e, n === "diverging" && ` · Neutral: ${r(0)}`] }),
53
+ /* @__PURE__ */ p("div", {
53
54
  "aria-hidden": !0,
54
55
  className: "x78zum5 xdk7pt xmkeg23 x1y0btm7 x1ey3b81",
55
- children: a.map((e) => /* @__PURE__ */ u("span", { ...l.props(_.sample(h(e, {
56
+ children: a.map((e) => /* @__PURE__ */ p("span", { ...d.props(b.sample(v(e, {
56
57
  domain: t,
57
58
  palette: n
58
59
  }))) }, e))
59
60
  }),
60
- /* @__PURE__ */ d("div", {
61
+ /* @__PURE__ */ m("div", {
61
62
  "aria-hidden": !0,
62
63
  className: "x78zum5 x1qughib x1n8ia3y xss6m8b",
63
- children: [/* @__PURE__ */ u("span", {
64
+ children: [/* @__PURE__ */ p("span", {
64
65
  className: "xeuugli",
65
66
  children: r(t[0])
66
- }), /* @__PURE__ */ u("span", {
67
+ }), /* @__PURE__ */ p("span", {
67
68
  className: "xeuugli xp4054r",
68
69
  children: r(t[1])
69
70
  })]
@@ -72,10 +73,10 @@ function y({ label: e, domain: t, palette: n, formatValue: r }) {
72
73
  });
73
74
  }
74
75
  // packages/charts/src/matrix/matrix.tsx
75
- var b = {
76
+ var C = {
76
77
  kKwaWg: "x1e87kdn",
77
78
  $$css: !0
78
- }, x = {
79
+ }, w = {
79
80
  value: {
80
81
  k1xSpc: "x78zum5",
81
82
  kGNEyG: "x6s0dn4",
@@ -114,7 +115,7 @@ var b = {
114
115
  kInvED: "x2ssjo2",
115
116
  $$css: !0
116
117
  },
117
- measured: (e) => [b, { "--x-backgroundImage": `linear-gradient(${e}, ${e})` == null ? void 0 : `linear-gradient(${e}, ${e})` }],
118
+ measured: (e) => [C, { "--x-backgroundImage": `linear-gradient(${e}, ${e})` == null ? void 0 : `linear-gradient(${e}, ${e})` }],
118
119
  missing: {
119
120
  kMwMTN: "x153jb6y",
120
121
  kWkggS: "x1r7kqkb",
@@ -126,66 +127,66 @@ var b = {
126
127
  kWkggS: "x1r7kqkb",
127
128
  $$css: !0
128
129
  }
129
- }, S = {
130
+ }, T = {
130
131
  value: void 0,
131
- masked: x.masked,
132
- missing: x.missing
133
- }, C = 4096, w = 6;
134
- function T({ title: e, report: t, description: n, rows: r, columns: l, cells: f, domain: p, palette: h, valueLabel: g, formatValue: _, selection: v, emptyLabel: b }) {
135
- let x = o({
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({
136
137
  title: e,
137
- selection: v,
138
- items: f.map((e) => ({
138
+ selection: y,
139
+ items: d.map((e) => ({
139
140
  id: e.id,
140
- label: `${r.find((t) => t.id === e.rowId)?.label ?? e.rowId} → ${l.find((t) => t.id === e.columnId)?.label ?? e.columnId}: ${O(e, p, _)}`
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)}`
141
142
  }))
142
- }), S = k({
143
+ }), C = M({
143
144
  rows: r,
144
- columns: l,
145
- cells: f,
146
- domain: p,
145
+ columns: o,
146
+ cells: d,
147
+ domain: f,
147
148
  palette: h
148
149
  });
149
- if (S !== null) return /* @__PURE__ */ u(i, {
150
+ if (C !== null) return /* @__PURE__ */ p(i, {
150
151
  title: e,
151
152
  report: t,
152
153
  description: n,
153
- message: S
154
+ message: C
154
155
  });
155
- let C = /* @__PURE__ */ new Map();
156
- for (let e of f) {
157
- let t = C.get(e.rowId) ?? /* @__PURE__ */ new Map();
158
- t.set(e.columnId, e), C.set(e.rowId, t);
156
+ let w = /* @__PURE__ */ new Map();
157
+ 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);
159
160
  }
160
- return /* @__PURE__ */ u(c, {
161
+ return /* @__PURE__ */ p(u, {
161
162
  title: e,
162
163
  report: t,
163
164
  description: n,
164
- footer: /* @__PURE__ */ d("div", {
165
+ footer: /* @__PURE__ */ m("div", {
165
166
  className: "xrvj5dj x1n8ia3y",
166
167
  children: [
167
- /* @__PURE__ */ u(y, {
168
+ /* @__PURE__ */ p(S, {
168
169
  label: g,
169
- domain: p,
170
+ domain: f,
170
171
  palette: h,
171
- formatValue: _
172
+ formatValue: v
172
173
  }),
173
- /* @__PURE__ */ d("ul", {
174
+ /* @__PURE__ */ m("ul", {
174
175
  "aria-label": "Cell states",
175
176
  className: "x78zum5 x1a02dak x1n8ia3y x1ghz6dp x1717udv xe8uvvx x153jb6y xy8obcc",
176
177
  children: [
177
- f.some((e) => e.kind === "masked") && /* @__PURE__ */ u("li", { children: "× Masked" }),
178
- f.some((e) => e.kind === "missing") && /* @__PURE__ */ u("li", { children: "— Missing" }),
179
- f.length < r.length * l.length && /* @__PURE__ */ u("li", { children: "· Not supplied" }),
180
- f.some((e) => e.kind === "value" && !m(e.value, p)) && /* @__PURE__ */ u("li", { children: "! Outside domain" }),
181
- f.some((e) => e.kind === "value" && _(e.value).length > w) && /* @__PURE__ */ u("li", { children: "• Inspect a cell for its exact value" })
178
+ d.some((e) => e.kind === "masked") && /* @__PURE__ */ p("li", { children: "× Masked" }),
179
+ d.some((e) => e.kind === "missing") && /* @__PURE__ */ p("li", { children: "— Missing" }),
180
+ d.length < r.length * o.length && /* @__PURE__ */ p("li", { children: "· Not supplied" }),
181
+ 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" })
182
183
  ]
183
184
  }),
184
- /* @__PURE__ */ u(s, {
185
+ /* @__PURE__ */ p(l, {
185
186
  id: x.id,
186
187
  children: x.label ?? "\xA0"
187
188
  }),
188
- /* @__PURE__ */ u(a, {
189
+ /* @__PURE__ */ p(a, {
189
190
  label: `${e} cells`,
190
191
  columns: [{
191
192
  id: "cell",
@@ -194,55 +195,55 @@ function T({ title: e, report: t, description: n, rows: r, columns: l, cells: f,
194
195
  id: "value",
195
196
  label: g
196
197
  }],
197
- rows: r.flatMap((e) => l.map((t) => ({
198
+ rows: r.flatMap((e) => o.map((t) => ({
198
199
  id: JSON.stringify([e.id, t.id]),
199
- values: [`${e.label} → ${t.label}`, O(C.get(e.id)?.get(t.id), p, _)]
200
+ values: [`${e.label} → ${t.label}`, j(w.get(e.id)?.get(t.id), f, v)]
200
201
  })))
201
202
  })
202
203
  ]
203
204
  }),
204
- children: r.length === 0 || l.length === 0 ? /* @__PURE__ */ u("p", {
205
+ children: r.length === 0 || o.length === 0 ? /* @__PURE__ */ p("p", {
205
206
  className: "x1ghz6dp x153jb6y xtqrqnz x1778rvt",
206
207
  children: b
207
- }) : /* @__PURE__ */ u("div", {
208
+ }) : /* @__PURE__ */ p(s, {
208
209
  ...x.props,
209
210
  className: "xysyzu8 x14eurpq xeuugli x1t137rt x13qnu6 x19rmrnh x9v5kkp x1bqaal",
210
- children: /* @__PURE__ */ d("table", {
211
+ children: /* @__PURE__ */ m("table", {
211
212
  className: "x1vathgz x1jkpq5q xezivpi x1hz01jw",
212
- children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ d("tr", { children: [/* @__PURE__ */ u("th", {
213
+ children: [/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ m("tr", { children: [/* @__PURE__ */ p("th", {
213
214
  "aria-label": "Row",
214
215
  className: "x1717udv xy8obcc xas2l8k xj57cvi x153jb6y x1yc453h xuxw1ft"
215
- }), l.map((e) => /* @__PURE__ */ u("th", {
216
+ }), o.map((e) => /* @__PURE__ */ p("th", {
216
217
  scope: "col",
217
218
  title: e.label,
218
219
  className: "x1717udv xy8obcc xas2l8k xj57cvi x153jb6y x1yc453h xuxw1ft",
219
- children: /* @__PURE__ */ u("span", {
220
+ children: /* @__PURE__ */ p("span", {
220
221
  className: "x1lliihq x100vrsf x1ff4b4a xb3r6kr xlyipyv x2b8uid x1hmw7ec",
221
222
  children: e.label
222
223
  })
223
- }, e.id))] }) }), /* @__PURE__ */ u("tbody", { children: r.map((e) => /* @__PURE__ */ d("tr", { children: [/* @__PURE__ */ u("th", {
224
+ }, e.id))] }) }), /* @__PURE__ */ p("tbody", { children: r.map((e) => /* @__PURE__ */ m("tr", { children: [/* @__PURE__ */ p("th", {
224
225
  scope: "row",
225
226
  title: e.label,
226
227
  className: "x1717udv xy8obcc xas2l8k xj57cvi x153jb6y x1yc453h xuxw1ft",
227
- children: /* @__PURE__ */ u("span", {
228
+ children: /* @__PURE__ */ p("span", {
228
229
  className: "x1lliihq x18qnofl xb3r6kr xlyipyv xx67isq",
229
230
  children: e.label
230
231
  })
231
- }), l.map((t) => {
232
- let n = C.get(e.id)?.get(t.id);
233
- return /* @__PURE__ */ u("td", {
232
+ }), o.map((t) => {
233
+ let n = w.get(e.id)?.get(t.id);
234
+ return /* @__PURE__ */ p("td", {
234
235
  onPointerEnter: () => {
235
236
  n !== void 0 && x.inspect(n.id);
236
237
  },
237
238
  className: "x1717udv x100vrsf x1ff4b4a x2b8uid",
238
- children: /* @__PURE__ */ u(E, {
239
+ children: /* @__PURE__ */ p(k, {
239
240
  cell: n,
240
241
  isInspected: x.label !== void 0 && x.activeId === n?.id,
241
242
  label: `${e.label}, ${t.label}`,
242
- domain: p,
243
+ domain: f,
243
244
  palette: h,
244
- formatValue: _,
245
- selection: v
245
+ formatValue: v,
246
+ selection: y
246
247
  })
247
248
  }, t.id);
248
249
  })] }, e.id)) })]
@@ -250,60 +251,60 @@ function T({ title: e, report: t, description: n, rows: r, columns: l, cells: f,
250
251
  })
251
252
  });
252
253
  }
253
- function E({ cell: e, isInspected: t, label: n, domain: r, palette: i, formatValue: a, selection: o }) {
254
- if (e === void 0) return /* @__PURE__ */ u("span", {
254
+ function k({ cell: e, isInspected: t, label: n, domain: r, palette: i, formatValue: a, selection: o }) {
255
+ if (e === void 0) return /* @__PURE__ */ p("span", {
255
256
  role: "img",
256
257
  "aria-label": `${n}: not supplied`,
257
258
  title: `${n}: not supplied`,
258
259
  className: "x78zum5 x6s0dn4 xl56j7k x100vrsf x1ff4b4a x1vqgdyp x992rv9 x9f619 xmkeg23 x1ey3b81 x1717udv x1hz01jw xy8obcc xj57cvi xas2l8k xss6m8b x153jb6y x1r7kqkb xbsl7fq",
259
260
  children: "·"
260
261
  });
261
- let s = e.kind === "value" && !m(e.value, r), c = O(e, r, a), d = `${n}: ${c}`, f = e.kind === "value" && !s ? h(e.value, {
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, {
262
263
  domain: r,
263
264
  palette: i
264
- }) : void 0, p = l.props(x.value, S[e.kind], f !== void 0 && x.measured(f), s && x.missing, o !== void 0 && x.interactive, (t || o?.selectedId === e.id) && x.selected), g = D(e, c, s), _ = e.kind === "value" ? /* @__PURE__ */ u("span", {
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", {
265
266
  className: "xpvm0e4 x1r97e56",
266
- children: g
267
- }) : g;
268
- return o === void 0 ? /* @__PURE__ */ u("span", {
267
+ children: h
268
+ }) : h;
269
+ return o === void 0 ? /* @__PURE__ */ p("span", {
269
270
  role: "img",
270
- "aria-label": d,
271
- title: d,
272
- ...p,
273
- children: _
274
- }) : /* @__PURE__ */ u("button", {
271
+ "aria-label": l,
272
+ title: l,
273
+ ...m,
274
+ children: g
275
+ }) : /* @__PURE__ */ p(f, {
275
276
  type: "button",
276
277
  tabIndex: -1,
277
- "aria-label": d,
278
- title: d,
278
+ "aria-label": l,
279
+ title: l,
279
280
  "aria-pressed": o.selectedId === e.id,
280
281
  onClick: () => o.onSelect(e.id),
281
- ...p,
282
- children: _
282
+ ...m,
283
+ children: g
283
284
  });
284
285
  }
285
- function D(e, t, n) {
286
+ function A(e, t, n) {
286
287
  switch (e.kind) {
287
288
  case "masked": return "×";
288
289
  case "missing": return "—";
289
- case "value": return n ? "!" : t.length <= w ? t : e.value === 0 ? "0" : "•";
290
+ case "value": return n ? "!" : t.length <= D ? t : e.value === 0 ? "0" : "•";
290
291
  }
291
292
  }
292
- function O(e, t, n) {
293
+ function j(e, t, n) {
293
294
  if (e === void 0) return "Not supplied";
294
295
  switch (e.kind) {
295
- case "value": return `${n(e.value)}${m(e.value, t) ? "" : " (outside domain)"}`;
296
+ case "value": return `${n(e.value)}${_(e.value, t) ? "" : " (outside domain)"}`;
296
297
  case "masked": return `Masked: ${e.reason}`;
297
298
  case "missing": return `Missing: ${e.reason}`;
298
299
  }
299
300
  }
300
- function k({ rows: e, columns: t, cells: r, domain: i, palette: a }) {
301
- let o = p({
301
+ function M({ rows: e, columns: t, cells: r, domain: i, palette: a }) {
302
+ let o = g({
302
303
  domain: i,
303
304
  palette: a
304
305
  });
305
306
  if (o !== null) return o;
306
- if (e.length * t.length > 4096 || r.length > 4096) return `This matrix exceeds the ${C}-cell render limit. Supply a smaller, labelled window.`;
307
+ if (e.length * t.length > 4096 || r.length > 4096) return `This matrix exceeds the ${E}-cell render limit. Supply a smaller, labelled window.`;
307
308
  let s = new Set(e.map((e) => e.id)), c = new Set(t.map((e) => e.id));
308
309
  if (!n(e) || !n(t) || !n(r)) return "Matrix rows, columns, and cells must have unique identifiers.";
309
310
  let l = /* @__PURE__ */ new Map();
@@ -317,7 +318,7 @@ function k({ rows: e, columns: t, cells: r, domain: i, palette: a }) {
317
318
  return null;
318
319
  }
319
320
  // packages/charts/src/matrix/token-heatmap.tsx
320
- var A = {
321
+ var N = {
321
322
  token: {
322
323
  k1xSpc: "xt0psk2",
323
324
  kmVPX3: "x1717udv",
@@ -362,64 +363,64 @@ var A = {
362
363
  kInvED: "x1y3gkto",
363
364
  $$css: !0
364
365
  }
365
- }, j = 2048;
366
- function M({ title: e, report: t, description: n, tokens: r, domain: f, palette: p, valueLabel: g, formatValue: _, selection: v, emptyLabel: b }) {
367
- let x = r.map((e) => ({
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 }) {
368
+ let C = r.map((e) => ({
368
369
  id: e.id,
369
- label: `Token ${e.index}, ${JSON.stringify(e.text)}, ${g}: ${N(e, f, _)}`
370
- })), S = o({
370
+ label: `Token ${e.index}, ${JSON.stringify(e.text)}, ${g}: ${I(e, s, y)}`
371
+ })), w = c({
371
372
  title: e,
372
- items: x,
373
- selection: v
374
- }), C = P({
373
+ items: C,
374
+ selection: b
375
+ }), T = L({
375
376
  tokens: r,
376
- domain: f,
377
- palette: p
377
+ domain: s,
378
+ palette: h
378
379
  });
379
- return C === null ? /* @__PURE__ */ d(c, {
380
+ return T === null ? /* @__PURE__ */ m(u, {
380
381
  title: e,
381
382
  report: t,
382
383
  description: n,
383
- footer: /* @__PURE__ */ d("div", {
384
+ footer: /* @__PURE__ */ m("div", {
384
385
  className: "xrvj5dj x1n8ia3y",
385
- children: [/* @__PURE__ */ u(y, {
386
+ children: [/* @__PURE__ */ p(S, {
386
387
  label: g,
387
- domain: f,
388
- palette: p,
389
- formatValue: _
390
- }), /* @__PURE__ */ u(s, {
391
- id: S.id,
392
- children: S.label ?? "\xA0"
388
+ domain: s,
389
+ palette: h,
390
+ formatValue: y
391
+ }), /* @__PURE__ */ p(l, {
392
+ id: w.id,
393
+ children: w.label ?? "\xA0"
393
394
  })]
394
395
  }),
395
- children: [r.length === 0 ? /* @__PURE__ */ u("p", {
396
+ children: [r.length === 0 ? /* @__PURE__ */ p("p", {
396
397
  className: "x1ghz6dp x153jb6y xtqrqnz x1778rvt",
397
- children: b
398
- }) : /* @__PURE__ */ u("p", {
399
- ...S.props,
398
+ children: x
399
+ }) : /* @__PURE__ */ p(o, {
400
+ ...w.props,
400
401
  className: "x1ghz6dp xbixft xiard35 xtqrqnz x1778rvt x126k92a xj0a0fe",
401
402
  children: r.map((e) => {
402
- let t = S.label !== void 0 && S.activeId === e.id, n = e.score !== null && !m(e.score, f), r = `Token ${e.index}, ${JSON.stringify(e.text)}, ${g}: ${N(e, f, _)}`, i = l.props(A.token, e.score === null || n ? A.missing : A.color(h(e.score, {
403
- domain: f,
404
- palette: p
405
- })), v !== void 0 && A.interactive, (v?.selectedId === e.id || t) && A.selected);
406
- return v === void 0 ? /* @__PURE__ */ u("span", {
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, {
404
+ domain: s,
405
+ palette: h
406
+ })), b !== void 0 && N.interactive, (b?.selectedId === e.id || t) && N.selected);
407
+ return b === void 0 ? /* @__PURE__ */ p("span", {
407
408
  title: r,
408
- onPointerEnter: () => S.inspect(e.id),
409
+ onPointerEnter: () => w.inspect(e.id),
409
410
  ...i,
410
411
  children: e.text
411
- }, e.id) : /* @__PURE__ */ u("button", {
412
+ }, e.id) : /* @__PURE__ */ p(f, {
412
413
  type: "button",
413
414
  tabIndex: -1,
414
- onPointerEnter: () => S.inspect(e.id),
415
+ onPointerEnter: () => w.inspect(e.id),
415
416
  "aria-label": r,
416
- "aria-pressed": v.selectedId === e.id,
417
- onClick: () => v.onSelect(e.id),
417
+ "aria-pressed": b.selectedId === e.id,
418
+ onClick: () => b.onSelect(e.id),
418
419
  ...i,
419
420
  children: e.text
420
421
  }, e.id);
421
422
  })
422
- }), /* @__PURE__ */ u(a, {
423
+ }), /* @__PURE__ */ p(a, {
423
424
  label: `${e} token values`,
424
425
  columns: [
425
426
  {
@@ -440,28 +441,28 @@ function M({ title: e, report: t, description: n, tokens: r, domain: f, palette:
440
441
  values: [
441
442
  String(e.index),
442
443
  JSON.stringify(e.text),
443
- N(e, f, _)
444
+ I(e, s, y)
444
445
  ]
445
446
  }))
446
447
  })]
447
- }) : /* @__PURE__ */ u(i, {
448
+ }) : /* @__PURE__ */ p(i, {
448
449
  title: e,
449
450
  report: t,
450
451
  description: n,
451
- message: C
452
+ message: T
452
453
  });
453
454
  }
454
- function N(e, t, n) {
455
- return e.score === null ? "Unavailable" : `${n(e.score)}${m(e.score, t) ? "" : " (outside domain)"}`;
455
+ function I(e, t, n) {
456
+ return e.score === null ? "Unavailable" : `${n(e.score)}${_(e.score, t) ? "" : " (outside domain)"}`;
456
457
  }
457
- function P({ tokens: e, domain: t, palette: r }) {
458
- let i = p({
458
+ function L({ tokens: e, domain: t, palette: r }) {
459
+ let i = g({
459
460
  domain: t,
460
461
  palette: r
461
462
  });
462
- return i === null ? e.length > 2048 ? `This token view exceeds the ${j}-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) => {
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) => {
463
464
  let t = !Number.isSafeInteger(e.index) || e.index < 0, n = e.score !== null && !Number.isFinite(e.score);
464
465
  return t || n;
465
466
  }) ? "Token indices must be nonnegative integers and measured scores must be finite. Use null for unavailable scores." : null : i;
466
467
  }
467
- export { y as ColorLegend, j as MAX_HEATMAP_TOKENS, C as MAX_MATRIX_CELLS, T as Matrix, M as TokenHeatmap };
468
+ export { S as ColorLegend, P as MAX_HEATMAP_TOKENS, E as MAX_MATRIX_CELLS, O as Matrix, F as TokenHeatmap };