@mechane-ai/elements 0.9.0 → 0.10.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 (71) hide show
  1. package/NOTICE +24 -0
  2. package/README.md +7 -1
  3. package/dist/ai.js +129 -125
  4. package/dist/{categorical-values-DYRiw5Qd.js → categorical-values-DLRE4EEW.js} +4 -4
  5. package/dist/{chart-frame-RL1hCWBC.js → chart-frame-et6f6Vhg.js} +22 -14
  6. package/dist/{chart-input-Bm3ot1yD.js → chart-input-CdLkFomi.js} +2 -2
  7. package/dist/charts/cartesian.js +529 -450
  8. package/dist/charts/distribution.js +302 -261
  9. package/dist/charts/graph.js +137 -103
  10. package/dist/charts/hierarchy.js +7 -7
  11. package/dist/charts/matrix.js +187 -174
  12. package/dist/charts/timeline.js +118 -92
  13. package/dist/charts.js +1 -1
  14. package/dist/code-block-D77maJBB.js +180 -0
  15. package/dist/collections.js +280 -236
  16. package/dist/content/code.js +1 -1
  17. package/dist/content/diff.js +81 -63
  18. package/dist/content/link.js +1 -1
  19. package/dist/content/markdown.js +115 -96
  20. package/dist/content/tree.js +43 -38
  21. package/dist/{content-link-BrPrpBof.js → content-link-BpSZeTNK.js} +6 -2
  22. package/dist/content.js +172 -153
  23. package/dist/{assets/stylex.css → elements.css} +471 -185
  24. package/dist/feedback.js +1 -1
  25. package/dist/forms/dates.js +25 -25
  26. package/dist/forms.js +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/layout.js +239 -192
  29. package/dist/navigation/commands.js +45 -42
  30. package/dist/{navigation-yxK3iQXo.js → navigation-D2_sGy3C.js} +2 -2
  31. package/dist/navigation.js +10 -10
  32. package/dist/overlays.js +1 -1
  33. package/dist/packages/charts/src/cartesian/bar-chart.d.ts +5 -0
  34. package/dist/packages/charts/src/cartesian/index.d.ts +2 -2
  35. package/dist/packages/charts/src/chart-frame.d.ts +3 -0
  36. package/dist/packages/charts/src/chart-theme.d.ts +2 -1
  37. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +22 -2
  38. package/dist/packages/collections/src/collection-scroll.d.ts +2 -1
  39. package/dist/packages/content/src/diff/pierre-diff.d.ts +2 -1
  40. package/dist/packages/content/src/viewer-styles.d.ts +64 -0
  41. package/dist/packages/core/src/index.d.ts +1 -1
  42. package/dist/packages/core/src/surfaces.d.ts +5 -0
  43. package/dist/packages/feedback/src/index.d.ts +4 -1
  44. package/dist/packages/feedback/src/toast.d.ts +5 -27
  45. package/dist/packages/forms/src/field-styles.d.ts +9 -0
  46. package/dist/packages/forms/src/selection-styles.d.ts +18 -2
  47. package/dist/packages/foundations/src/overlay-styles.d.ts +3 -1
  48. package/dist/packages/foundations/src/popup-styles.d.ts +7 -0
  49. package/dist/packages/foundations/src/tokens.stylex.d.ts +9 -0
  50. package/dist/packages/layout/src/frame.stylex.d.ts +1 -0
  51. package/dist/packages/layout/src/sidebar.d.ts +3 -1
  52. package/dist/packages/overlays/src/alert-dialog.d.ts +5 -2
  53. package/dist/packages/overlays/src/dialog.d.ts +7 -3
  54. package/dist/pierre-diff--zsiHCCB.js +71 -0
  55. package/dist/pierre-theme-D9hnHv3Z.js +126 -0
  56. package/dist/{pierre-tree-CRk09rx7.js → pierre-tree-BFxEuxwb.js} +3 -3
  57. package/dist/{src-Cc0Sadzr.js → src-Be7NLG8c.js} +238 -186
  58. package/dist/src-CBspCKfO.js +969 -0
  59. package/dist/src-Cs0dRc4X.js +617 -0
  60. package/dist/{src-elMBQ2Dh.js → src-sU9b0oZW.js} +224 -143
  61. package/dist/tokens.js +9 -1
  62. package/dist/viewer-styles-CpHqp5Qv.js +70 -0
  63. package/package.json +2 -1
  64. package/packages/foundations/src/tokens.stylex.ts +7 -0
  65. package/styles.css +1 -1
  66. package/dist/code-block-B30xQKqg.js +0 -175
  67. package/dist/pierre-diff-CZdzgiYm.js +0 -66
  68. package/dist/pierre-theme-BpESNIsV.js +0 -96
  69. package/dist/popup-styles-CvtZDE2t.js +0 -135
  70. package/dist/src-CfDf8TY8.js +0 -466
  71. package/dist/src-DuuAmS-c.js +0 -360
@@ -1,15 +1,15 @@
1
- import { o as e, r as t, t as n } from "../chart-frame-RL1hCWBC.js";
2
- import { n as r, t as i } from "../chart-input-Bm3ot1yD.js";
3
- import * as a from "@stylexjs/stylex";
4
- import { useId as o } from "react";
5
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
1
+ import { a as e, n as t, r as n, s as r, t as i } from "../chart-frame-et6f6Vhg.js";
2
+ import { n as a, t as o } from "../chart-input-CdLkFomi.js";
3
+ import * as s from "@stylexjs/stylex";
4
+ import { useId as c } from "react";
5
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
6
6
  // packages/charts/src/graph/relation-graph.tsx
7
- var u = {
7
+ var f = {
8
8
  kVAEAm: "x1n2onr6",
9
9
  $$css: !0
10
- }, d = {
10
+ }, p = {
11
11
  canvas: (e, t) => [
12
- u,
12
+ f,
13
13
  {
14
14
  kzqmXN: e == null ? e : "x5lhr3w",
15
15
  kZKoxP: t == null ? t : "x16ye13r",
@@ -37,6 +37,7 @@ var u = {
37
37
  kWkggS: "xpvm0e4",
38
38
  k9WMMc: "x1yc453h",
39
39
  kMv6JI: "x1hz01jw",
40
+ k63SB2: "xj57cvi",
40
41
  kAzted: "xaeotn9 xwu7q15",
41
42
  $$css: !0
42
43
  },
@@ -62,151 +63,184 @@ var u = {
62
63
  }, { "--x-borderLeftColor": e ?? void 0 }],
63
64
  action: {
64
65
  kkrTdU: "x1ypdohk",
66
+ k3XXqK: "x1t137rt",
65
67
  kGzVvX: "xzro8vx",
68
+ kSReZ0: "x1ecmtor",
66
69
  kPJHz1: "x13qnu6",
67
70
  kZs9gx: "x19rmrnh",
68
71
  k7shQP: "x9v5kkp",
69
- kiEn40: "x7s97pk",
72
+ kiEn40: "x1bqaal",
70
73
  $$css: !0
71
74
  },
72
75
  selected: {
73
76
  kMeerF: "x12ei19c",
74
77
  kjBf7l: "xx9gdjd",
75
78
  k3XXqK: "xaatb59",
76
- kInvED: "x1y3gkto",
79
+ kInvED: "x2ssjo2",
77
80
  $$css: !0
78
81
  }
79
- }, f = 256, p = 1024, m = 256, h = 8192;
80
- function g({ title: r, description: u, nodes: f, edges: p, groups: m = [], width: h, height: g, selection: y, emptyLabel: b }) {
81
- let x = o(), S = _({
82
- nodes: f,
83
- edges: p,
84
- groups: m,
85
- width: h,
86
- height: g
82
+ }, m = 256, h = 1024, g = 256, _ = 8192;
83
+ function v({ title: a, description: f, nodes: m, edges: h, groups: g = [], width: _, height: v, selection: x, emptyLabel: S }) {
84
+ let C = c(), w = y({
85
+ nodes: m,
86
+ edges: h,
87
+ groups: g,
88
+ width: _,
89
+ height: v
87
90
  });
88
- if (S !== null) return /* @__PURE__ */ c(i, {
89
- title: r,
90
- description: u,
91
- message: S
91
+ if (w !== null) return /* @__PURE__ */ u(o, {
92
+ title: a,
93
+ description: f,
94
+ message: w
92
95
  });
93
- let C = new Map(f.map((e) => [e.id, e])), w = v(p, C);
94
- return w === null ? /* @__PURE__ */ c(i, {
95
- title: r,
96
- description: u,
96
+ let T = new Map(m.map((e) => [e.id, e])), E = b(h, T), D = x?.selectedId === void 0 ? void 0 : T.get(x.selectedId), O = m.length > 0;
97
+ return E === null ? /* @__PURE__ */ u(o, {
98
+ title: a,
99
+ description: f,
97
100
  message: "Every relationship must refer to two supplied nodes."
98
- }) : /* @__PURE__ */ l(t, {
99
- title: r,
100
- description: u,
101
- children: [f.length === 0 ? /* @__PURE__ */ c("p", {
102
- className: "x1ghz6dp x153jb6y",
103
- children: b
104
- }) : /* @__PURE__ */ c("div", {
101
+ }) : /* @__PURE__ */ d(n, {
102
+ title: a,
103
+ description: f,
104
+ footer: x !== void 0 && O ? /* @__PURE__ */ u(e, { children: D === void 0 ? "Select a node to inspect its record." : [D.label, D.description].filter((e) => e !== void 0).join(" · ") }) : void 0,
105
+ children: [O ? /* @__PURE__ */ u("div", {
105
106
  role: "region",
106
- "aria-label": `${r} graph`,
107
+ "aria-label": `${a} graph`,
107
108
  tabIndex: 0,
108
- className: "xysyzu8 xzuc9lq xmkeg23 x1y0btm7 x1ey3b81 x13qnu6 x19rmrnh x9v5kkp x1bqaal",
109
- children: /* @__PURE__ */ l("div", {
110
- ...a.props(d.canvas(h, g)),
111
- children: [/* @__PURE__ */ l("svg", {
112
- width: h,
113
- height: g,
109
+ className: "xysyzu8 xzuc9lq xeuugli x1t137rt xmkeg23 x1y0btm7 x1ey3b81 x13qnu6 x19rmrnh x9v5kkp x1bqaal",
110
+ children: /* @__PURE__ */ d("div", {
111
+ ...s.props(p.canvas(_, v)),
112
+ children: [/* @__PURE__ */ d("svg", {
113
+ width: _,
114
+ height: v,
114
115
  "aria-hidden": !0,
115
116
  className: "x10l6tqk x10a8y8t x1lliihq",
116
117
  children: [
117
- /* @__PURE__ */ c("defs", { children: /* @__PURE__ */ c("marker", {
118
- id: x,
118
+ /* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("marker", {
119
+ id: C,
119
120
  markerWidth: 8,
120
121
  markerHeight: 8,
121
122
  refX: 7,
122
123
  refY: 4,
123
124
  orient: "auto",
124
125
  markerUnits: "userSpaceOnUse",
125
- children: /* @__PURE__ */ c("path", {
126
+ children: /* @__PURE__ */ u("path", {
126
127
  d: "M0,0 L8,4 L0,8 Z",
127
128
  className: "x8futc7"
128
129
  })
129
130
  }) }),
130
- m.map((e) => /* @__PURE__ */ l("g", { children: [/* @__PURE__ */ c("rect", {
131
+ g.map((e) => /* @__PURE__ */ d("g", { children: [/* @__PURE__ */ u("rect", {
131
132
  x: e.x,
132
133
  y: e.y,
133
134
  width: e.width,
134
135
  height: e.height,
135
136
  className: "x2wnxhi x13hfdr1 xnpr05h"
136
- }), /* @__PURE__ */ c("text", {
137
- x: e.x + 12,
138
- y: e.y + 20,
139
- className: "x1q7gtio x1hz01jw xy8obcc",
140
- children: e.label
137
+ }), /* @__PURE__ */ u("svg", {
138
+ x: e.x,
139
+ y: e.y,
140
+ width: e.width,
141
+ height: e.height,
142
+ overflow: "hidden",
143
+ children: /* @__PURE__ */ u("text", {
144
+ x: 12,
145
+ y: 20,
146
+ className: "x1q7gtio x1hz01jw xy8obcc",
147
+ children: e.label
148
+ })
141
149
  })] }, e.id)),
142
- w.map(({ edge: e, source: t, target: n }) => {
143
- let r = t.x < n.x, i = t.x + (r ? t.width : 0), a = n.x + (r ? 0 : n.width), o = t.y + t.height / 2, s = n.y + n.height / 2, l = (i + a) / 2, u = t.x + t.width / 2, d = t.id === n.id ? `M${u - 12},${t.y} C${u - 48},${t.y - 36} ${u + 48},${t.y - 36} ${u + 12},${t.y}` : `M${i},${o} C${l},${o} ${l},${s} ${a},${s}`;
144
- return /* @__PURE__ */ c("path", {
150
+ E.map(({ edge: e, source: t, target: n }) => {
151
+ let r = t.x < n.x, i = t.x + (r ? t.width : 0), a = n.x + (r ? 0 : n.width), o = t.y + t.height / 2, s = n.y + n.height / 2, c = (i + a) / 2, l = t.x + t.width / 2, d = t.id === n.id ? `M${l - 12},${t.y} C${l - 48},${t.y - 36} ${l + 48},${t.y - 36} ${l + 12},${t.y}` : `M${i},${o} C${c},${o} ${c},${s} ${a},${s}`;
152
+ return /* @__PURE__ */ u("path", {
145
153
  d,
146
- markerEnd: e.direction === "directed" ? `url(#${x})` : void 0,
154
+ markerEnd: e.direction === "directed" ? `url(#${C})` : void 0,
147
155
  className: "xbh8q5q x1crw9hw xhr4kjn",
148
- children: /* @__PURE__ */ c("title", { children: e.label })
156
+ children: /* @__PURE__ */ u("title", { children: e.label })
149
157
  }, e.id);
150
158
  })
151
159
  ]
152
- }), f.map((t) => {
153
- let n = [
154
- ...m.filter((e) => e.nodeIds.includes(t.id)).map((e) => e.label),
155
- t.label,
156
- t.description
157
- ].filter((e) => e !== void 0).join(", "), r = a.props(d.node, d.position(t.x, t.y), d.size(t.width, t.height), d.tone(e[t.tone]), y !== void 0 && d.action, y?.selectedId === t.id && d.selected), i = /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
158
- className: "xtqrqnz x1778rvt xk50ysn xj0a0fe",
159
- children: t.label
160
- }), t.description !== void 0 && /* @__PURE__ */ c("span", {
161
- className: "xy8obcc xas2l8k x153jb6y xj0a0fe",
162
- children: t.description
160
+ }), m.map((e) => {
161
+ let t = [
162
+ ...g.filter((t) => t.nodeIds.includes(e.id)).map((e) => e.label),
163
+ e.label,
164
+ e.description
165
+ ].filter((e) => e !== void 0).join(", "), n = s.props(p.node, p.position(e.x, e.y), p.size(e.width, e.height), p.tone(r[e.tone]), x !== void 0 && p.action, x?.selectedId === e.id && p.selected), i = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", {
166
+ className: "xtqrqnz x1778rvt xk4h15q xb3r6kr xlyipyv xuxw1ft",
167
+ children: e.label
168
+ }), e.description !== void 0 && e.height >= 56 && /* @__PURE__ */ u("span", {
169
+ className: "xy8obcc xas2l8k x153jb6y xb3r6kr xlyipyv xuxw1ft",
170
+ children: e.description
163
171
  })] });
164
- return y === void 0 ? /* @__PURE__ */ c("div", {
172
+ return x === void 0 ? /* @__PURE__ */ u("div", {
165
173
  role: "group",
166
- "aria-label": n,
167
- ...r,
174
+ "aria-label": t,
175
+ title: t,
176
+ ...n,
168
177
  children: i
169
- }, t.id) : /* @__PURE__ */ c("button", {
178
+ }, e.id) : /* @__PURE__ */ u("button", {
170
179
  type: "button",
171
- "aria-label": n,
172
- "aria-pressed": y.selectedId === t.id,
173
- onClick: () => y.onSelect(t.id),
174
- ...r,
180
+ "aria-label": t,
181
+ title: t,
182
+ "aria-pressed": x.selectedId === e.id,
183
+ onClick: () => x.onSelect(e.id),
184
+ ...n,
175
185
  children: i
176
- }, t.id);
186
+ }, e.id);
177
187
  })]
178
188
  })
179
- }), p.length > 0 && /* @__PURE__ */ l(n, {
180
- label: "Relationships",
181
- children: [m.length > 0 && /* @__PURE__ */ c("ul", {
182
- className: "xo02m6d xv06hpe x153jb6y",
183
- children: m.map((e) => /* @__PURE__ */ l("li", { children: [
184
- e.label,
185
- ": ",
186
- e.nodeIds.map((e) => C.get(e)?.label).join(", ")
187
- ] }, e.id))
188
- }), /* @__PURE__ */ c("ul", {
189
- className: "xo02m6d xv06hpe x153jb6y",
190
- children: w.map(({ edge: e, source: t, target: n }) => /* @__PURE__ */ l("li", { children: [
191
- t.label,
192
- " ",
193
- e.direction === "directed" ? "→" : "↔",
194
- " ",
195
- n.label,
196
- ": ",
197
- e.label
198
- ] }, e.id))
199
- })]
200
- })]
189
+ }) : /* @__PURE__ */ u("p", {
190
+ className: "x1ghz6dp x153jb6y",
191
+ children: S
192
+ }), O ? /* @__PURE__ */ d(i, {
193
+ label: "Graph data",
194
+ children: [
195
+ /* @__PURE__ */ u("ul", {
196
+ "aria-label": "Nodes",
197
+ className: "x1ghz6dp x1717udv xe8uvvx",
198
+ children: m.map((e) => /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u(t, {
199
+ label: [e.label, e.description].filter((e) => e !== void 0).join(", "),
200
+ selected: x?.selectedId === e.id,
201
+ onSelect: x === void 0 ? void 0 : () => x.onSelect(e.id),
202
+ children: /* @__PURE__ */ d("span", {
203
+ className: "xrvj5dj xfko13i xeuugli xh8yej3",
204
+ children: [/* @__PURE__ */ u("span", { children: e.label }), e.description !== void 0 && /* @__PURE__ */ u("span", {
205
+ className: "x153jb6y xy8obcc xas2l8k",
206
+ children: e.description
207
+ })]
208
+ })
209
+ }) }, e.id))
210
+ }),
211
+ g.length > 0 && /* @__PURE__ */ u("ul", {
212
+ "aria-label": "Groups",
213
+ className: "xo02m6d xv06hpe x153jb6y xj0a0fe",
214
+ children: g.map((e) => /* @__PURE__ */ d("li", { children: [
215
+ e.label,
216
+ ": ",
217
+ e.nodeIds.map((e) => T.get(e)?.label).join(", ")
218
+ ] }, e.id))
219
+ }),
220
+ E.length > 0 && /* @__PURE__ */ u("ul", {
221
+ "aria-label": "Relationships",
222
+ className: "xo02m6d xv06hpe x153jb6y xj0a0fe",
223
+ children: E.map(({ edge: e, source: t, target: n }) => /* @__PURE__ */ d("li", { children: [
224
+ t.label,
225
+ " ",
226
+ e.direction === "directed" ? "→" : "↔",
227
+ " ",
228
+ n.label,
229
+ ": ",
230
+ e.label
231
+ ] }, e.id))
232
+ })
233
+ ]
234
+ }) : null]
201
235
  });
202
236
  }
203
- function _({ nodes: e, edges: t, groups: n, width: i, height: a }) {
204
- if (!Number.isFinite(i) || i <= 0 || i > 8192 || !Number.isFinite(a) || a <= 0 || a > 8192) return `Graph dimensions must be finite, positive, and at most ${h} pixels.`;
205
- if (e.length > 256 || t.length > 1024 || n.length > 256) return `This graph exceeds the render limit of 256 nodes, ${p} relationships, or 256 groups. Supply a smaller, labelled neighborhood.`;
237
+ function y({ nodes: e, edges: t, groups: n, width: r, height: i }) {
238
+ if (!Number.isFinite(r) || r <= 0 || r > 8192 || !Number.isFinite(i) || i <= 0 || i > 8192) return `Graph dimensions must be finite, positive, and at most ${_} pixels.`;
239
+ if (e.length > 256 || t.length > 1024 || n.length > 256) return `This graph exceeds the render limit of 256 nodes, ${h} relationships, or 256 groups. Supply a smaller, labelled neighborhood.`;
206
240
  let o = new Set(e.map((e) => e.id));
207
- return !r(e) || !r(t) || !r(n) ? "Graph nodes, relationships, and groups must have unique identifiers." : [...e, ...n].some((e) => {
241
+ return !a(e) || !a(t) || !a(n) ? "Graph nodes, relationships, and groups must have unique identifiers." : [...e, ...n].some((e) => {
208
242
  if (!Number.isFinite(e.width) || !Number.isFinite(e.height) || e.width <= 0 || e.height <= 0) return !0;
209
- let t = !Number.isFinite(e.x) || e.x < 0 || e.x + e.width > i, n = !Number.isFinite(e.y) || e.y < 0 || e.y + e.height > a;
243
+ let t = !Number.isFinite(e.x) || e.x < 0 || e.x + e.width > r, n = !Number.isFinite(e.y) || e.y < 0 || e.y + e.height > i;
210
244
  return t || n;
211
245
  }) ? "Graph boxes must have finite, positive dimensions and fit inside the supplied canvas." : e.some((e) => e.width < 44 || e.height < 44) ? "Graph node boxes must be at least 44 by 44 pixels." : t.some((t) => t.sourceId === t.targetId && e.some((e) => e.id === t.sourceId && e.y < 36)) ? "A self-relationship needs at least 36 pixels of space above its node." : n.some((e) => new Set(e.nodeIds).size !== e.nodeIds.length || e.nodeIds.some((e) => !o.has(e))) ? "Each group must contain unique references to supplied nodes." : n.some((t) => t.nodeIds.some((n) => {
212
246
  let r = e.find((e) => e.id === n);
@@ -215,7 +249,7 @@ function _({ nodes: e, edges: t, groups: n, width: i, height: a }) {
215
249
  return i || a;
216
250
  })) ? "A group box must contain the node boxes assigned to it." : null;
217
251
  }
218
- function v(e, t) {
252
+ function b(e, t) {
219
253
  let n = [];
220
254
  for (let r of e) {
221
255
  let e = t.get(r.sourceId), i = t.get(r.targetId);
@@ -228,4 +262,4 @@ function v(e, t) {
228
262
  }
229
263
  return n;
230
264
  }
231
- export { h as MAX_RELATION_DIMENSION, p as MAX_RELATION_EDGES, m as MAX_RELATION_GROUPS, f as MAX_RELATION_NODES, g as RelationGraph };
265
+ export { _ as MAX_RELATION_DIMENSION, h as MAX_RELATION_EDGES, g as MAX_RELATION_GROUPS, m as MAX_RELATION_NODES, v as RelationGraph };
@@ -1,6 +1,6 @@
1
- import { i as e, r as t, t as n } from "../categorical-values-DYRiw5Qd.js";
2
- import { a as r, o as i, r as a } from "../chart-frame-RL1hCWBC.js";
3
- import { t as o } from "../chart-input-Bm3ot1yD.js";
1
+ import { i as e, r as t, t as n } from "../categorical-values-DLRE4EEW.js";
2
+ import { o as r, r as i, s as a } from "../chart-frame-et6f6Vhg.js";
3
+ import { t as o } from "../chart-input-CdLkFomi.js";
4
4
  import { t as s } from "../plot-width--OgdohB5.js";
5
5
  import * as c from "@stylexjs/stylex";
6
6
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
@@ -30,7 +30,7 @@ function m({ title: m, description: h, items: g, formatValue: _, selection: v, h
30
30
  tone: "neutral",
31
31
  children: w
32
32
  }, (e) => e.children === void 0 ? void 0 : [...e.children]).sum((e) => e.value);
33
- return /* @__PURE__ */ u(a, {
33
+ return /* @__PURE__ */ u(i, {
34
34
  title: m,
35
35
  description: h,
36
36
  children: [
@@ -51,14 +51,14 @@ function m({ title: m, description: h, items: g, formatValue: _, selection: v, h
51
51
  size: [C, y],
52
52
  paddingInner: 2,
53
53
  children: (e) => e.leaves().map((e) => {
54
- let t = e.x1 - e.x0 > 96 && e.y1 - e.y0 > 40;
54
+ let t = e.x1 - e.x0 > 96 && e.y1 - e.y0 > 40, n = Math.max(1, Math.floor((e.x1 - e.x0 - 16) / 7)), i = e.data.label.length > n ? `${e.data.label.slice(0, n - 1)}…` : e.data.label;
55
55
  return /* @__PURE__ */ u("g", { children: [
56
56
  /* @__PURE__ */ l("rect", {
57
57
  x: e.x0,
58
58
  y: e.y0,
59
59
  width: e.x1 - e.x0,
60
60
  height: e.y1 - e.y0,
61
- fill: i[e.data.tone],
61
+ fill: a[e.data.tone],
62
62
  fillOpacity: .18,
63
63
  ...c.props(p.treeRect, v?.selectedId === e.data.id && r.selected)
64
64
  }),
@@ -77,7 +77,7 @@ function m({ title: m, description: h, items: g, formatValue: _, selection: v, h
77
77
  x: 8,
78
78
  y: 18,
79
79
  className: "xlrhuyr x1hz01jw xy8obcc",
80
- children: e.data.label.slice(0, Math.floor((e.x1 - e.x0 - 16) / 7))
80
+ children: i
81
81
  }), _(e.data.value).length * 12 < e.x1 - e.x0 - 16 && /* @__PURE__ */ l("text", {
82
82
  x: 8,
83
83
  y: 34,