@cloudflare/kumo 2.2.0 → 2.2.1

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 (85) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/ai/component-registry.json +3 -6
  3. package/ai/component-registry.md +1 -1
  4. package/dist/.build-complete +1 -1
  5. package/dist/chunks/SankeyChart-dkq90770ad7hgzx3.js +635 -0
  6. package/dist/chunks/{SankeyChart-h1kzhs1tyt20luha.js.map → SankeyChart-dkq90770ad7hgzx3.js.map} +1 -1
  7. package/dist/chunks/{autocomplete-nw1ig02pawtj3il9.js → autocomplete-mhrvtq4y5n21vr0t.js} +3 -3
  8. package/dist/chunks/{autocomplete-nw1ig02pawtj3il9.js.map → autocomplete-mhrvtq4y5n21vr0t.js.map} +1 -1
  9. package/dist/chunks/banner-ip2lm8r87hich557.js +88 -0
  10. package/dist/chunks/banner-ip2lm8r87hich557.js.map +1 -0
  11. package/dist/chunks/{breadcrumbs-f7bi3g8tx6dfcgl6.js → breadcrumbs-ohstavaqvycoremm.js} +2 -2
  12. package/dist/chunks/{breadcrumbs-f7bi3g8tx6dfcgl6.js.map → breadcrumbs-ohstavaqvycoremm.js.map} +1 -1
  13. package/dist/chunks/{button-gflkhovvkmt0ftzz.js → button-oevxukl0zmwoq4tb.js} +2 -2
  14. package/dist/chunks/{button-gflkhovvkmt0ftzz.js.map → button-oevxukl0zmwoq4tb.js.map} +1 -1
  15. package/dist/chunks/{checkbox-imuc4c45j7sds6wk.js → checkbox-h6vkv17lnq854z2c.js} +2 -2
  16. package/dist/chunks/{checkbox-imuc4c45j7sds6wk.js.map → checkbox-h6vkv17lnq854z2c.js.map} +1 -1
  17. package/dist/chunks/{clipboard-text-dp5eb2c2qudgusnc.js → clipboard-text-kyy71jmx7umdh8k8.js} +3 -3
  18. package/dist/chunks/{clipboard-text-dp5eb2c2qudgusnc.js.map → clipboard-text-kyy71jmx7umdh8k8.js.map} +1 -1
  19. package/dist/chunks/{combobox-42i2nyvfgkqjb5a4.js → combobox-g3cudlfajecou4va.js} +3 -3
  20. package/dist/chunks/{combobox-42i2nyvfgkqjb5a4.js.map → combobox-g3cudlfajecou4va.js.map} +1 -1
  21. package/dist/chunks/{empty-jwan4d5hqjocakhm.js → empty-n3r7xutkb9sxjaso.js} +2 -2
  22. package/dist/chunks/{empty-jwan4d5hqjocakhm.js.map → empty-n3r7xutkb9sxjaso.js.map} +1 -1
  23. package/dist/chunks/{field-yhlyu6fy0qi1ewtl.js → field-l1oapopp6kjnephi.js} +2 -2
  24. package/dist/chunks/{field-yhlyu6fy0qi1ewtl.js.map → field-l1oapopp6kjnephi.js.map} +1 -1
  25. package/dist/chunks/{input-area-d85jzxlnvx7mc3x9.js → input-area-gudamx1ruz8rxiw2.js} +3 -3
  26. package/dist/chunks/{input-area-d85jzxlnvx7mc3x9.js.map → input-area-gudamx1ruz8rxiw2.js.map} +1 -1
  27. package/dist/chunks/{input-group-mu8yklweljytpt04.js → input-group-gy08vju7eoogil8k.js} +5 -5
  28. package/dist/chunks/{input-group-mu8yklweljytpt04.js.map → input-group-gy08vju7eoogil8k.js.map} +1 -1
  29. package/dist/chunks/{input-cyils8jxj8e0udr7.js → input-i3os21puacqw4r75.js} +2 -2
  30. package/dist/chunks/{input-cyils8jxj8e0udr7.js.map → input-i3os21puacqw4r75.js.map} +1 -1
  31. package/dist/chunks/{label-kaz4uxdt1yf3i5x5.js → label-i0bj94d43irz0k1x.js} +3 -3
  32. package/dist/chunks/{label-kaz4uxdt1yf3i5x5.js.map → label-i0bj94d43irz0k1x.js.map} +1 -1
  33. package/dist/chunks/{menubar-gk322oew1y1lr851.js → menubar-jalggrag4utvdpey.js} +2 -2
  34. package/dist/chunks/{menubar-gk322oew1y1lr851.js.map → menubar-jalggrag4utvdpey.js.map} +1 -1
  35. package/dist/chunks/{pagination-kswioh2znglyq7as.js → pagination-ceetno8sc1rd0wr2.js} +3 -3
  36. package/dist/chunks/{pagination-kswioh2znglyq7as.js.map → pagination-ceetno8sc1rd0wr2.js.map} +1 -1
  37. package/dist/chunks/{select-hz8wwd2msvp1u0jp.js → select-g1xvti1k1hj7xe5t.js} +5 -5
  38. package/dist/chunks/{select-hz8wwd2msvp1u0jp.js.map → select-g1xvti1k1hj7xe5t.js.map} +1 -1
  39. package/dist/chunks/{sensitive-input-mdtjukbb3wimz1iy.js → sensitive-input-hokm527ollnz9dqc.js} +3 -3
  40. package/dist/chunks/{sensitive-input-mdtjukbb3wimz1iy.js.map → sensitive-input-hokm527ollnz9dqc.js.map} +1 -1
  41. package/dist/chunks/{sidebar-dlh79t5uliezwniq.js → sidebar-oan40ylmqkyui21w.js} +2 -2
  42. package/dist/chunks/{sidebar-dlh79t5uliezwniq.js.map → sidebar-oan40ylmqkyui21w.js.map} +1 -1
  43. package/dist/chunks/{switch-luut1d75u179g7x6.js → switch-fv0ttj24uhocvuh8.js} +2 -2
  44. package/dist/chunks/{switch-luut1d75u179g7x6.js.map → switch-fv0ttj24uhocvuh8.js.map} +1 -1
  45. package/dist/chunks/{table-ef63hg1r1zia9u9j.js → table-nsfcgpo93gfetrhh.js} +2 -2
  46. package/dist/chunks/{table-ef63hg1r1zia9u9j.js.map → table-nsfcgpo93gfetrhh.js.map} +1 -1
  47. package/dist/chunks/{toast-e5id2hx8pv0x3vue.js → toast-ofqlfmddcyka091n.js} +2 -2
  48. package/dist/chunks/{toast-e5id2hx8pv0x3vue.js.map → toast-ofqlfmddcyka091n.js.map} +1 -1
  49. package/dist/chunks/{tooltip-caka3fmn1ogdc7q8.js → tooltip-icvb67awe1zolz61.js} +6 -6
  50. package/dist/chunks/tooltip-icvb67awe1zolz61.js.map +1 -0
  51. package/dist/code.js +1 -1
  52. package/dist/components/autocomplete.js +1 -1
  53. package/dist/components/banner.js +1 -1
  54. package/dist/components/breadcrumbs.js +1 -1
  55. package/dist/components/button.js +1 -1
  56. package/dist/components/chart.js +1 -1
  57. package/dist/components/checkbox.js +1 -1
  58. package/dist/components/clipboard-text.js +1 -1
  59. package/dist/components/combobox.js +1 -1
  60. package/dist/components/empty.js +1 -1
  61. package/dist/components/field.js +1 -1
  62. package/dist/components/input-group.js +1 -1
  63. package/dist/components/input.js +3 -3
  64. package/dist/components/label.js +1 -1
  65. package/dist/components/menubar.js +1 -1
  66. package/dist/components/pagination.js +1 -1
  67. package/dist/components/select.js +1 -1
  68. package/dist/components/sensitive-input.js +1 -1
  69. package/dist/components/sidebar.js +1 -1
  70. package/dist/components/switch.js +1 -1
  71. package/dist/components/table.js +1 -1
  72. package/dist/components/toast.js +1 -1
  73. package/dist/components/tooltip.js +1 -1
  74. package/dist/index.js +26 -26
  75. package/dist/src/components/banner/banner.d.ts +3 -3
  76. package/dist/src/components/banner/banner.d.ts.map +1 -1
  77. package/dist/src/components/chart/SankeyChart.d.ts +5 -1
  78. package/dist/src/components/chart/SankeyChart.d.ts.map +1 -1
  79. package/dist/src/components/tooltip/tooltip.d.ts.map +1 -1
  80. package/dist/styles/kumo-standalone.css +1 -1
  81. package/package.json +1 -1
  82. package/dist/chunks/SankeyChart-h1kzhs1tyt20luha.js +0 -629
  83. package/dist/chunks/banner-eux4y8xaogjg64af.js +0 -80
  84. package/dist/chunks/banner-eux4y8xaogjg64af.js.map +0 -1
  85. package/dist/chunks/tooltip-caka3fmn1ogdc7q8.js.map +0 -1
@@ -1,629 +0,0 @@
1
- "use client";
2
- import { jsx as $, jsxs as k } from "react/jsx-runtime";
3
- import { forwardRef as re, useRef as C, useEffect as D, useMemo as P, useCallback as se } from "react";
4
- import { c as T } from "./cn-ct4n7r74mh8y0f48.js";
5
- var ee = /* @__PURE__ */ ((e) => (e.Attention = "#FC574A", e.Warning = "#F8A054", e.Success = "#00A63E", e.Neutral = "#B9D6FF", e.Disabled = "#CBCBCB", e.Skeleton = "#DDDDDD", e))(ee || {}), te = /* @__PURE__ */ ((e) => (e.Attention = "#FC574A", e.Warning = "#F8A054", e.Success = "#00A63E", e.Neutral = "#8EC5FF", e.Disabled = "#878787", e.Skeleton = "#5C5C5C", e))(te || {});
6
- const oe = {
7
- blues: ["#E1EAF4", "#8EBCF6", "#4290F0", "#0E58B4", "#03254F"]
8
- }, ae = {
9
- blues: ["#03254F", "#0E58B4", "#4290F0", "#A6BFDD", "#E1EAF4"]
10
- }, U = [
11
- "#4290F0",
12
- "#F5B647",
13
- "#E8649D",
14
- "#8D58EE",
15
- "#50C3B6",
16
- "#D37536"
17
- /* Orange */
18
- ], X = [
19
- "#4290F0",
20
- "#EEB720",
21
- "#E8649D",
22
- "#8D58EE",
23
- "#50C3B6",
24
- "#D37536"
25
- /* Orange */
26
- ];
27
- var G;
28
- ((e) => {
29
- function n(s, u = !1) {
30
- return u ? te[s] : ee[s];
31
- }
32
- e.semantic = n;
33
- function o(s, u = !1) {
34
- return u ? X[s % X.length] : U[s % U.length];
35
- }
36
- e.categorical = o;
37
- function l(s, u = !1) {
38
- return u ? [...ae[s]] : [...oe[s]];
39
- }
40
- e.sequential = l;
41
- function r(s, u = !1) {
42
- const g = {
43
- light: { primary: "#6B7280", secondary: "#9CA3AF" },
44
- dark: { primary: "#9CA3AF", secondary: "#6B7280" }
45
- };
46
- return u ? g.dark[s] : g.light[s];
47
- }
48
- e.text = r;
49
- })(G || (G = {}));
50
- const J = (e) => {
51
- const { dangerousHtmlFormatter: n, ...o } = e;
52
- return {
53
- ...o,
54
- formatter: n
55
- };
56
- }, ce = (e) => e.tooltip ? {
57
- ...e,
58
- tooltip: Array.isArray(e.tooltip) ? e.tooltip.map(J) : J(e.tooltip)
59
- } : e, K = re(function({
60
- echarts: n,
61
- options: o,
62
- optionUpdateBehavior: l,
63
- className: r,
64
- isDarkMode: s,
65
- height: u = 350,
66
- onEvents: g
67
- }, p) {
68
- const d = C(null), w = C(null), N = C({}), A = C({}), F = C(/* @__PURE__ */ new Set());
69
- return D(() => {
70
- if (!d.current) return;
71
- const i = n.init(
72
- d.current,
73
- s ? "dark" : {
74
- color: s ? X : U
75
- }
76
- );
77
- return w.current = i, typeof p == "function" ? p(i) : p && (p.current = i), () => {
78
- for (const m of F.current) {
79
- const a = A.current[m];
80
- a && i.off(m, a);
81
- }
82
- F.current.clear(), typeof p == "function" ? p(null) : p && (p.current = null), w.current = null, i.dispose();
83
- };
84
- }, [d, s]), D(() => {
85
- const i = w.current;
86
- i && i.setOption(ce(o), {
87
- notMerge: !1,
88
- lazyUpdate: !0,
89
- ...l
90
- });
91
- }, [s, l, o]), D(() => {
92
- N.current = g ?? {};
93
- }, [g]), D(() => {
94
- const i = w.current;
95
- if (!i) return;
96
- const m = /* @__PURE__ */ new Set();
97
- for (const [a, S] of Object.entries(g ?? {}))
98
- typeof S == "function" && (m.add(a), A.current[a] || (A.current[a] = (L) => {
99
- N.current[a]?.(L);
100
- }), F.current.has(a) || i.on(a, A.current[a]));
101
- for (const a of F.current) {
102
- if (m.has(a)) continue;
103
- const S = A.current[a];
104
- S && i.off(a, S);
105
- }
106
- F.current = m;
107
- }, [n, s, g]), D(() => {
108
- const i = w.current, m = d.current;
109
- if (!i || !m) return;
110
- let a = !0;
111
- const S = new ResizeObserver(() => {
112
- if (a) {
113
- a = !1;
114
- return;
115
- }
116
- i.resize();
117
- });
118
- return S.observe(m), () => S.disconnect();
119
- }, []), /* @__PURE__ */ $(
120
- "div",
121
- {
122
- ref: d,
123
- className: T("w-full", r),
124
- style: { height: u },
125
- tabIndex: o.aria?.enabled ? 0 : void 0,
126
- role: o.aria?.enabled ? "img" : void 0
127
- }
128
- );
129
- });
130
- K.displayName = "Chart";
131
- function ye({
132
- echarts: e,
133
- type: n = "line",
134
- data: o,
135
- xAxisName: l,
136
- xAxisTickCount: r,
137
- xAxisTickFormat: s,
138
- yAxisTickFormat: u,
139
- yAxisTickLabelFormat: g,
140
- yAxisName: p,
141
- yAxisTickCount: d,
142
- tooltipValueFormat: w,
143
- onTimeRangeChange: N,
144
- height: A = 350,
145
- incomplete: F,
146
- isDarkMode: i,
147
- gradient: m,
148
- loading: a,
149
- ariaDescription: S,
150
- optionUpdateBehavior: L
151
- }) {
152
- const O = C(null), M = F?.before, z = F?.after, h = P(() => {
153
- const b = [], E = n === "bar" ? { type: "bar", stack: "total" } : { type: "line", showSymbol: !1 };
154
- for (const t of o) {
155
- const c = M && n === "line" ? t.data.filter((H) => H[0] <= M) : [], f = z && n === "line" ? t.data.filter((H) => H[0] >= z) : [], v = c.length > 0 || f.length > 0 ? t.data.slice(
156
- Math.max(0, c.length - 1),
157
- Math.max(0, t.data.length - f.length + 1)
158
- ) : t.data, x = m && n === "line" ? {
159
- color: new e.graphic.LinearGradient(0, 0, 0, 1, [
160
- { offset: 0, color: Q(t.color, 0.4) },
161
- { offset: 1, color: Q(t.color, 0) }
162
- ])
163
- } : void 0;
164
- b.push({
165
- data: v,
166
- color: t.color,
167
- name: t.name,
168
- emphasis: { focus: "series" },
169
- ...x ? { areaStyle: x } : {},
170
- ...E
171
- });
172
- const R = {
173
- color: t.color,
174
- name: t.name,
175
- type: "line",
176
- lineStyle: { type: "dashed" },
177
- showSymbol: !1,
178
- emphasis: { focus: "series" }
179
- };
180
- c.length > 0 && b.push({
181
- ...R,
182
- data: c
183
- }), f.length > 0 && b.push({
184
- ...R,
185
- data: f
186
- });
187
- }
188
- return {
189
- aria: {
190
- enabled: !0,
191
- ...S && { label: { description: S } }
192
- },
193
- brush: {
194
- xAxisIndex: "all",
195
- brushType: "lineX",
196
- brushMode: "single",
197
- outOfBrush: {
198
- colorAlpha: 0.3
199
- },
200
- brushStyle: {
201
- borderWidth: 1,
202
- color: "rgba(120,140,180,0.3)",
203
- borderColor: "rgba(120,140,180,0.8)"
204
- }
205
- },
206
- tooltip: {
207
- trigger: "axis",
208
- appendTo: "body",
209
- axisPointer: { type: "shadow" },
210
- dangerousHtmlFormatter: (t) => {
211
- const c = Array.isArray(t) ? t : [t], f = /* @__PURE__ */ new Set(), v = c.filter((I) => f.has(I.seriesName) ? !1 : (f.add(I.seriesName), !0)), x = v[0], R = x?.value?.[0] ?? x?.axisValue, H = R != null ? `<div style="font-weight:600;margin-bottom:4px;">${e.format.encodeHTML(ie(R))}</div>` : "", _ = v.map((I) => {
212
- const W = I?.value?.[1], Y = w ?? g, ne = Y ? e.format.encodeHTML(String(Y(W))) : e.format.encodeHTML(String(W));
213
- return `${I.marker} ${e.format.encodeHTML(I.seriesName)}: <strong>${ne}</strong>`;
214
- }).join("<br/>");
215
- return `${H}${_}`;
216
- }
217
- },
218
- backgroundColor: "transparent",
219
- toolbox: { show: !1 },
220
- xAxis: {
221
- name: l,
222
- nameLocation: "middle",
223
- nameGap: 30,
224
- type: "time",
225
- splitLine: {
226
- show: !1
227
- },
228
- axisLine: { show: !1 },
229
- splitNumber: r ?? 5,
230
- ...s && {
231
- axisLabel: {
232
- formatter: (t) => s(t)
233
- }
234
- }
235
- },
236
- yAxis: {
237
- name: p,
238
- nameLocation: "middle",
239
- nameGap: 40,
240
- type: "value",
241
- axisTick: { show: !0 },
242
- axisLabel: {
243
- margin: 15,
244
- ...u && {
245
- formatter: (t) => u(t)
246
- }
247
- },
248
- splitLine: {
249
- show: !0,
250
- lineStyle: { type: "dashed", width: 1 }
251
- },
252
- splitNumber: d
253
- },
254
- grid: {
255
- left: p ? 30 : 24,
256
- right: 24,
257
- top: 24,
258
- bottom: l ? 30 : 24
259
- },
260
- series: b
261
- };
262
- }, [
263
- o,
264
- l,
265
- r,
266
- s,
267
- u,
268
- g,
269
- p,
270
- d,
271
- w,
272
- M,
273
- z,
274
- n,
275
- m,
276
- e,
277
- S
278
- ]), y = P(() => N ? {
279
- brushend: (b) => {
280
- const E = b.areas[0].coordRange;
281
- N(E[0], E[1]), O.current?.dispatchAction({ type: "brush", areas: [] });
282
- }
283
- } : {}, [N]), B = !!N;
284
- return D(() => {
285
- const b = O.current;
286
- if (b && B)
287
- return b.dispatchAction({
288
- type: "takeGlobalCursor",
289
- key: "brush",
290
- brushOption: {
291
- brushType: "lineX",
292
- brushMode: "single"
293
- }
294
- }), () => {
295
- b.dispatchAction({
296
- type: "takeGlobalCursor",
297
- key: "brush",
298
- brushOption: {
299
- brushType: !1
300
- }
301
- });
302
- };
303
- }, [O, B, a]), /* @__PURE__ */ k("div", { className: "relative w-full", style: { height: A }, children: [
304
- a && /* @__PURE__ */ $(le, { height: A, isDarkMode: i }),
305
- !a && /* @__PURE__ */ $(
306
- K,
307
- {
308
- echarts: e,
309
- ref: O,
310
- options: h,
311
- height: A,
312
- isDarkMode: i,
313
- onEvents: y,
314
- optionUpdateBehavior: L
315
- }
316
- )
317
- ] });
318
- }
319
- function le({
320
- height: e,
321
- isDarkMode: n
322
- }) {
323
- const o = e / 2, l = Math.min(e * 0.12, 28), r = 400, s = 120, u = [];
324
- for (let d = 0; d <= s; d++) {
325
- const w = -r + d / s * r * 3, N = o + Math.sin(d / s * 2 * Math.PI * 3) * l;
326
- u.push(`${d === 0 ? "M" : "L"}${w.toFixed(2)},${N.toFixed(2)}`);
327
- }
328
- const g = u.join(" "), p = n ? "rgba(255,255,255,0.5)" : "rgba(0,0,0,0.2)";
329
- return /* @__PURE__ */ $(
330
- "div",
331
- {
332
- "aria-hidden": "true",
333
- className: "absolute inset-0 overflow-hidden",
334
- style: { height: e },
335
- children: /* @__PURE__ */ $(
336
- "svg",
337
- {
338
- width: "100%",
339
- height: e,
340
- viewBox: `0 0 ${r} ${e}`,
341
- preserveAspectRatio: "none",
342
- className: "w-full animate-pulse",
343
- children: /* @__PURE__ */ $(
344
- "path",
345
- {
346
- d: g,
347
- fill: "none",
348
- stroke: p,
349
- strokeWidth: "2",
350
- style: {
351
- animation: "kumo-chart-wave 2.4s linear infinite",
352
- transformOrigin: "0 0"
353
- }
354
- }
355
- )
356
- }
357
- )
358
- }
359
- );
360
- }
361
- function Q(e, n) {
362
- const o = Math.max(0, Math.min(1, n)), l = e.match(
363
- /rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i
364
- );
365
- if (l)
366
- return `rgba(${l[1]}, ${l[2]}, ${l[3]}, ${o})`;
367
- let r = e.replace(/^#/, "");
368
- r.length === 3 && (r = r[0] + r[0] + r[1] + r[1] + r[2] + r[2]), r.length === 8 && (r = r.slice(0, 6));
369
- const s = parseInt(r.slice(0, 2), 16), u = parseInt(r.slice(2, 4), 16), g = parseInt(r.slice(4, 6), 16);
370
- return `rgba(${s}, ${u}, ${g}, ${o})`;
371
- }
372
- function j(e) {
373
- return e.toString().padStart(2, "0");
374
- }
375
- function ie(e) {
376
- const n = new Date(e);
377
- return `${n.getFullYear()}-${j(n.getMonth() + 1)}-${j(n.getDate())} ${j(n.getHours())}:${j(n.getMinutes())}:${j(n.getSeconds())}`;
378
- }
379
- function ue({ color: e, value: n, name: o, unit: l, inactive: r }) {
380
- return /* @__PURE__ */ k("div", { className: "inline-flex flex-col gap-2 min-w-42 py-2", children: [
381
- /* @__PURE__ */ k("div", { className: "flex items-center gap-2", children: [
382
- /* @__PURE__ */ $(
383
- "span",
384
- {
385
- className: T("size-2 rounded-full inline-block", {
386
- "opacity-50": r
387
- }),
388
- style: { backgroundColor: e }
389
- }
390
- ),
391
- /* @__PURE__ */ $("span", { className: T("text-xs", { "opacity-50": r }), children: o })
392
- ] }),
393
- /* @__PURE__ */ k("div", { className: "flex items-baseline gap-0.5", children: [
394
- /* @__PURE__ */ $(
395
- "span",
396
- {
397
- className: T("text-lg font-medium leading-none", {
398
- "opacity-50": r
399
- }),
400
- children: n
401
- }
402
- ),
403
- l && /* @__PURE__ */ $(
404
- "span",
405
- {
406
- className: T("text-xs text-kumo-subtle leading-none", {
407
- "opacity-50": r
408
- }),
409
- children: l
410
- }
411
- )
412
- ] })
413
- ] });
414
- }
415
- function de({ color: e, value: n, name: o, inactive: l }) {
416
- return /* @__PURE__ */ k("div", { className: "inline-flex items-center gap-2", children: [
417
- /* @__PURE__ */ $(
418
- "span",
419
- {
420
- className: T("size-2 rounded-full inline-block", {
421
- "opacity-50": l
422
- }),
423
- style: { backgroundColor: e }
424
- }
425
- ),
426
- /* @__PURE__ */ $("span", { className: T("text-xs", { "opacity-50": l }), children: o }),
427
- /* @__PURE__ */ $("span", { className: T("text-xs font-medium", { "opacity-50": l }), children: n })
428
- ] });
429
- }
430
- const ve = {
431
- SmallItem: de,
432
- LargeItem: ue
433
- }, fe = (e) => e.toLocaleString();
434
- function pe(e) {
435
- return typeof e == "object" && e !== null;
436
- }
437
- const q = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), Z = (e) => e.replace(/[{}|]/g, (n) => `\\${n}`), V = (e) => {
438
- const n = "#666";
439
- return !e || typeof e != "string" ? n : /^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e) || /^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*(?:,\s*[\d.]+\s*)?\)$/i.test(
440
- e
441
- ) || /^hsla?\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*(?:,\s*[\d.]+\s*)?\)$/i.test(
442
- e
443
- ) || /^[a-z]{3,20}$/i.test(e) ? e : n;
444
- };
445
- function ge({
446
- echarts: e,
447
- nodes: n,
448
- links: o,
449
- height: l = 400,
450
- nodeWidth: r = 8,
451
- nodePadding: s = 10,
452
- showTooltip: u = !0,
453
- showNodeValues: g,
454
- formatValue: p = fe,
455
- tooltipFormatter: d,
456
- defaultNodeColor: w,
457
- linkColor: N = "gradient",
458
- linkOpacity: A = 0.5,
459
- className: F,
460
- isDarkMode: i,
461
- onNodeClick: m,
462
- onLinkClick: a
463
- }) {
464
- const S = n.some((h) => h.value !== void 0), L = g ?? S, O = P(() => {
465
- const h = G.text("primary", i), y = G.text("secondary", i), B = new Map(n.map((t) => [t.name, t])), b = n.map((t, c) => ({
466
- name: t.name,
467
- value: t.value,
468
- itemStyle: {
469
- color: t.color ?? w ?? G.categorical(c, i)
470
- }
471
- })), E = o.map((t) => ({
472
- source: n[t.source]?.name ?? "",
473
- target: n[t.target]?.name ?? "",
474
- value: t.value
475
- }));
476
- return {
477
- backgroundColor: "transparent",
478
- animation: !0,
479
- animationDuration: 500,
480
- animationDurationUpdate: 300,
481
- animationEasingUpdate: "cubicInOut",
482
- tooltip: u ? {
483
- trigger: "item",
484
- triggerOn: "mousemove",
485
- dangerousHtmlFormatter: (t) => {
486
- if (!pe(t)) return "";
487
- if (t.dataType === "node" && t.name) {
488
- const c = B.get(t.name), f = V(
489
- c?.color ?? t.color ?? "#666"
490
- );
491
- if (d)
492
- return d({
493
- type: "node",
494
- name: t.name,
495
- node: c,
496
- color: f
497
- });
498
- const v = q(t.name);
499
- return `<div style="display:flex;align-items:center;gap:6px;"><span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:${f}"></span><strong>${v}</strong></div>`;
500
- }
501
- if (t.dataType === "edge" && t.data) {
502
- const { source: c, target: f, value: v } = t.data;
503
- if (d)
504
- return d({
505
- type: "link",
506
- name: `${c} → ${f}`,
507
- link: {
508
- source: c ?? "",
509
- target: f ?? "",
510
- value: v ?? 0
511
- }
512
- });
513
- const x = B.get(c ?? ""), R = B.get(f ?? ""), H = V(x?.color ?? "#666"), _ = V(R?.color ?? "#666"), I = q(c ?? ""), W = q(f ?? "");
514
- return `<div style="display:flex;align-items:center;gap:6px;margin-bottom:4px;">
515
- <span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:${H}"></span>
516
- <strong>${I}</strong>
517
- <span style="color:${y}">→</span>
518
- <span style="display:inline-block;width:10px;height:10px;border-radius:50%;background:${_}"></span>
519
- <strong>${W}</strong>
520
- </div>
521
- <strong>${v !== void 0 ? q(p(v)) : ""}</strong>`;
522
- }
523
- return "";
524
- }
525
- } : void 0,
526
- series: [
527
- {
528
- type: "sankey",
529
- data: b,
530
- links: E,
531
- draggable: !1,
532
- emphasis: {
533
- focus: "adjacency"
534
- },
535
- nodeWidth: r,
536
- nodeGap: s,
537
- lineStyle: {
538
- color: N === "gradient" ? "source" : "#d1d5db",
539
- opacity: N === "gradient" ? A : 0.4,
540
- curveness: 0.5
541
- },
542
- label: {
543
- show: !0,
544
- color: h,
545
- fontSize: 12,
546
- formatter: L ? (t) => {
547
- const c = t.name ?? "", f = B.get(c), v = Z(c);
548
- return f?.value !== void 0 ? `{value|${Z(p(f.value))}}
549
- {name|${v}}` : v;
550
- } : void 0,
551
- rich: L ? {
552
- value: {
553
- fontSize: 11,
554
- color: h,
555
- lineHeight: 16
556
- },
557
- name: {
558
- fontSize: 12,
559
- color: h,
560
- fontWeight: 700
561
- }
562
- } : void 0
563
- }
564
- }
565
- ]
566
- };
567
- }, [
568
- n,
569
- o,
570
- u,
571
- r,
572
- s,
573
- w,
574
- i,
575
- N,
576
- A,
577
- L,
578
- p,
579
- d
580
- ]), M = se(
581
- (h) => {
582
- if (h.dataType === "node" && m && h.name) {
583
- const y = n.findIndex((E) => E.name === h.name), b = {
584
- ...y >= 0 ? n[y] : null,
585
- name: h.name
586
- };
587
- m(b);
588
- } else if (h.dataType === "edge" && a && h.data) {
589
- const y = h.data, B = typeof y == "object" && y !== null && "source" in y ? String(y.source) : "", b = typeof y == "object" && y !== null && "target" in y ? String(y.target) : "", E = n.findIndex((x) => x.name === B), t = n.findIndex((x) => x.name === b);
590
- if (E === -1 || t === -1) return;
591
- const c = h.value, f = typeof c == "number" ? c : Array.isArray(c) && typeof c[0] == "number" ? c[0] : 0, v = o.find(
592
- (x) => x.source === E && x.target === t
593
- );
594
- a({
595
- ...v,
596
- source: E,
597
- target: t,
598
- value: f
599
- });
600
- }
601
- },
602
- [n, o, m, a]
603
- ), z = P(
604
- () => ({
605
- click: M
606
- }),
607
- [M]
608
- );
609
- return /* @__PURE__ */ $(
610
- K,
611
- {
612
- echarts: e,
613
- options: O,
614
- className: F,
615
- isDarkMode: i,
616
- height: l,
617
- onEvents: z
618
- }
619
- );
620
- }
621
- ge.displayName = "SankeyChart";
622
- export {
623
- K as C,
624
- ge as S,
625
- ye as T,
626
- ve as a,
627
- G as b
628
- };
629
- //# sourceMappingURL=SankeyChart-h1kzhs1tyt20luha.js.map
@@ -1,80 +0,0 @@
1
- "use client";
2
- import { jsxs as i, jsx as n } from "react/jsx-runtime";
3
- import { forwardRef as h, isValidElement as g } from "react";
4
- import { c as r } from "./cn-ct4n7r74mh8y0f48.js";
5
- import { r as k } from "./resolve-variant-gw6eh7fa4st8ej7m.js";
6
- const E = "flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-base", N = {
7
- variant: {
8
- default: {
9
- classes: "bg-kumo-info-tint/30 border-kumo-info/50 text-kumo-info selection:bg-kumo-info",
10
- iconClasses: "text-kumo-info",
11
- description: "Informational banner for general messages"
12
- },
13
- alert: {
14
- classes: "bg-kumo-warning-tint/15 border-kumo-warning/50 text-kumo-warning selection:bg-kumo-warning",
15
- iconClasses: "text-kumo-warning",
16
- description: "Warning banner for cautionary messages"
17
- },
18
- error: {
19
- classes: "bg-kumo-danger-tint/15 border-kumo-danger/50 text-kumo-danger selection:bg-kumo-danger",
20
- iconClasses: "text-kumo-danger",
21
- description: "Error banner for critical issues"
22
- }
23
- }
24
- }, t = {
25
- variant: "default"
26
- };
27
- function x({
28
- variant: e = t.variant
29
- } = {}) {
30
- return r(
31
- // Base styles (exported as KUMO_BANNER_BASE_STYLES for Figma plugin)
32
- E,
33
- // Apply variant styles from KUMO_BANNER_VARIANTS
34
- k(N.variant, e, t.variant).classes
35
- );
36
- }
37
- var R = /* @__PURE__ */ ((e) => (e[e.DEFAULT = 0] = "DEFAULT", e[e.ALERT = 1] = "ALERT", e[e.ERROR = 2] = "ERROR", e))(R || {});
38
- const A = h(function({
39
- icon: a,
40
- title: o,
41
- description: s,
42
- action: m,
43
- children: b,
44
- text: p,
45
- variant: l = t.variant,
46
- className: d
47
- }, u) {
48
- const f = k(N.variant, l, t.variant);
49
- if (o || s)
50
- return /* @__PURE__ */ i("div", { ref: u, className: r(x({ variant: l }), d), children: [
51
- a && /* @__PURE__ */ n(
52
- "span",
53
- {
54
- className: r(
55
- "shrink-0 flex items-center h-[1.375em]",
56
- f.iconClasses
57
- ),
58
- children: a
59
- }
60
- ),
61
- /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 items-center justify-between gap-3", children: [
62
- /* @__PURE__ */ i("div", { className: "flex flex-col gap-0.5", children: [
63
- o && /* @__PURE__ */ n("p", { className: "font-medium leading-snug", children: o }),
64
- s && /* @__PURE__ */ n("div", { className: "text-sm leading-snug", children: g(s) ? s : /* @__PURE__ */ n("p", { children: s }) })
65
- ] }),
66
- m && /* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-2", children: m })
67
- ] })
68
- ] });
69
- const c = b ?? p, v = g(c) ? c : /* @__PURE__ */ n("p", { children: c });
70
- return /* @__PURE__ */ i("div", { ref: u, className: r(x({ variant: l }), d), children: [
71
- a && /* @__PURE__ */ n("span", { className: r("shrink-0", f.iconClasses), children: a }),
72
- v
73
- ] });
74
- });
75
- A.displayName = "Banner";
76
- export {
77
- A as B,
78
- R as a
79
- };
80
- //# sourceMappingURL=banner-eux4y8xaogjg64af.js.map