@thebuoyant-tsdev/mui-ts-library 3.2.1 → 3.4.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.
- package/README.de.md +15 -0
- package/README.md +15 -0
- package/dist/components/chord-chart/ChordChart.js +284 -0
- package/dist/components/chord-chart/ChordChart.types.js +4 -0
- package/dist/components/circle-packing-chart/CirclePackingChart.js +382 -0
- package/dist/components/circle-packing-chart/CirclePackingChart.types.js +4 -0
- package/dist/components/gantt-chart/GanttBarRow.js +202 -0
- package/dist/components/gantt-chart/GanttChart.constants.js +14 -0
- package/dist/components/gantt-chart/GanttChart.js +258 -0
- package/dist/components/gantt-chart/GanttChart.store.js +119 -0
- package/dist/components/gantt-chart/GanttChart.types.js +47 -0
- package/dist/components/gantt-chart/GanttDeleteDialog.js +30 -0
- package/dist/components/gantt-chart/GanttDependencyArrows.js +54 -0
- package/dist/components/gantt-chart/GanttStatusContextMenu.js +36 -0
- package/dist/components/gantt-chart/GanttTaskDialog.js +324 -0
- package/dist/components/gantt-chart/GanttTaskPanel.js +415 -0
- package/dist/components/gantt-chart/GanttTimeline.js +223 -0
- package/dist/components/gantt-chart/GanttTimelineHeader.js +90 -0
- package/dist/components/gantt-chart/GanttToolbar.js +157 -0
- package/dist/components/gantt-chart/GanttWeekendStrips.js +29 -0
- package/dist/components/gantt-chart/hooks/useGanttDrag.js +104 -0
- package/dist/components/gantt-chart/util/gantt-chart.util.js +150 -0
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +488 -0
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.types.js +8 -0
- package/dist/components/json-editor/JsonEditor.js +102 -0
- package/dist/components/json-editor/JsonEditor.types.js +21 -0
- package/dist/components/json-editor/JsonEditorContent.js +185 -0
- package/dist/components/json-editor/JsonEditorFooter.js +55 -0
- package/dist/components/json-editor/JsonEditorToolbar.js +148 -0
- package/dist/components/password-strength-meter/PasswordStrengthBar.js +66 -0
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +272 -0
- package/dist/components/password-strength-meter/PasswordStrengthMeter.types.js +27 -0
- package/dist/components/password-strength-meter/util/password-strength.util.js +38 -0
- package/dist/components/radial-tree-chart/RadialTreeChart.js +447 -0
- package/dist/components/radial-tree-chart/RadialTreeChart.types.js +8 -0
- package/dist/components/rich-text-editor/RichTextEditor.js +135 -0
- package/dist/components/rich-text-editor/RichTextEditor.types.js +74 -0
- package/dist/components/rich-text-editor/RichTextEditorColorPicker.js +185 -0
- package/dist/components/rich-text-editor/RichTextEditorContent.js +129 -0
- package/dist/components/rich-text-editor/RichTextEditorEmojiPicker.js +110 -0
- package/dist/components/rich-text-editor/RichTextEditorFooter.js +33 -0
- package/dist/components/rich-text-editor/RichTextEditorImageDialog.js +74 -0
- package/dist/components/rich-text-editor/RichTextEditorLinkDialog.js +70 -0
- package/dist/components/rich-text-editor/RichTextEditorTableMenu.js +97 -0
- package/dist/components/rich-text-editor/RichTextEditorToolbar.js +362 -0
- package/dist/components/rich-text-editor/util/emojis.js +739 -0
- package/dist/components/shared/ToolbarButton.js +22 -0
- package/dist/components/shared/normalizeSize.js +6 -0
- package/dist/components/sql-editor/SqlEditor.js +100 -0
- package/dist/components/sql-editor/SqlEditor.types.js +20 -0
- package/dist/components/sql-editor/SqlEditorContent.js +248 -0
- package/dist/components/sql-editor/SqlEditorFooter.js +45 -0
- package/dist/components/sql-editor/SqlEditorToolbar.js +151 -0
- package/dist/components/sunburst-chart/SunburstChart.js +292 -0
- package/dist/components/sunburst-chart/SunburstChart.types.js +4 -0
- package/dist/components/tag-selection/TagSelection.js +102 -0
- package/dist/components/tag-selection/TagSelection.store.js +40 -0
- package/dist/components/tag-selection/TagSelection.types.d.ts +2 -0
- package/dist/components/tag-selection/TagSelection.types.js +18 -0
- package/dist/components/tag-selection/TagSelectionAutocomplete.js +382 -0
- package/dist/components/tag-selection/TagSelectionChip.js +30 -0
- package/dist/components/tag-selection/TagSelectionSelectedTags.js +73 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +23 -8035
- package/package.json +1 -1
package/README.de.md
CHANGED
|
@@ -313,6 +313,21 @@ import type {
|
|
|
313
313
|
|
|
314
314
|
## Changelog
|
|
315
315
|
|
|
316
|
+
### [3.4.0] — 2026-06-21
|
|
317
|
+
|
|
318
|
+
**Accessibility & Test-Coverage**
|
|
319
|
+
- Fehlendes `aria-label` an 13 Icon-only-Buttons in GanttChart, TagSelection und RichTextEditor ergänzt — diese verließen sich bisher nur auf `Tooltip`, was Screenreadern keinen Accessible Name liefert.
|
|
320
|
+
- `SqlEditor`: 0 Tests → 82% Line-Coverage. Gesamt-Coverage der Library: 68% → 74% Lines.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
### [3.3.0] — 2026-06-21
|
|
325
|
+
|
|
326
|
+
**Tree-Shaking — Build-Output pro Komponente**
|
|
327
|
+
- `import { TagSelection } from '@thebuoyant-tsdev/mui-ts-library'` zieht kein D3, TipTap oder CodeMirror mehr ins Bundle — gemessener Rückgang von 1.1 MB auf 22 KB in einem minimalen Testbundle. Keine API-Änderungen.
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
316
331
|
### [3.2.1] — 2026-06-17
|
|
317
332
|
|
|
318
333
|
**Bugfixes**
|
package/README.md
CHANGED
|
@@ -313,6 +313,21 @@ import type {
|
|
|
313
313
|
|
|
314
314
|
## Changelog
|
|
315
315
|
|
|
316
|
+
### [3.4.0] — 2026-06-21
|
|
317
|
+
|
|
318
|
+
**Accessibility & Test Coverage**
|
|
319
|
+
- Added missing `aria-label` to 13 icon-only buttons across GanttChart, TagSelection, and RichTextEditor — these previously relied on `Tooltip` alone, which doesn't provide a screen-reader accessible name.
|
|
320
|
+
- `SqlEditor` went from 0 tests to 82% line coverage. Overall library coverage: 68% → 74% lines.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
### [3.3.0] — 2026-06-21
|
|
325
|
+
|
|
326
|
+
**Tree-Shaking — Per-Component Build Output**
|
|
327
|
+
- `import { TagSelection } from '@thebuoyant-tsdev/mui-ts-library'` no longer pulls D3, TipTap, or CodeMirror into your bundle — measured drop from 1.1 MB to 22 KB in a minimal test bundle. No API changes.
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
316
331
|
### [3.2.1] — 2026-06-17
|
|
317
332
|
|
|
318
333
|
**Bug Fixes**
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { useCallback as e, useLayoutEffect as t, useMemo as n, useRef as r, useState as i } from "react";
|
|
2
|
+
import { Box as a, Tooltip as o, Typography as s, useTheme as ee } from "@mui/material";
|
|
3
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
4
|
+
import * as u from "d3";
|
|
5
|
+
//#region src/components/chord-chart/ChordChart.tsx
|
|
6
|
+
function d(e, t = 0, n = ".", r = ",") {
|
|
7
|
+
if (!isFinite(e)) return String(e);
|
|
8
|
+
let [i, a] = e.toFixed(Math.max(0, t)).split("."), o = i.replace(/\B(?=(\d{3})+(?!\d))/g, r);
|
|
9
|
+
return a ? `${o}${n}${a}` : o;
|
|
10
|
+
}
|
|
11
|
+
function f({ name: e, valueOut: t, valueIn: n, fmt: r }) {
|
|
12
|
+
return /* @__PURE__ */ l(a, {
|
|
13
|
+
sx: { py: .25 },
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ c(s, {
|
|
16
|
+
variant: "caption",
|
|
17
|
+
sx: {
|
|
18
|
+
fontWeight: "bold",
|
|
19
|
+
display: "block"
|
|
20
|
+
},
|
|
21
|
+
children: e
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ l(s, {
|
|
24
|
+
variant: "caption",
|
|
25
|
+
sx: {
|
|
26
|
+
display: "block",
|
|
27
|
+
opacity: .85
|
|
28
|
+
},
|
|
29
|
+
children: [r(t), " outgoing →"]
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ l(s, {
|
|
32
|
+
variant: "caption",
|
|
33
|
+
sx: {
|
|
34
|
+
display: "block",
|
|
35
|
+
opacity: .85
|
|
36
|
+
},
|
|
37
|
+
children: [r(n), " incoming ←"]
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function te({ sourceName: e, targetName: t, sourceValue: n, targetValue: r, directed: i, fmt: o }) {
|
|
43
|
+
return /* @__PURE__ */ l(a, {
|
|
44
|
+
sx: { py: .25 },
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ l(s, {
|
|
47
|
+
variant: "caption",
|
|
48
|
+
sx: {
|
|
49
|
+
fontWeight: "bold",
|
|
50
|
+
display: "block"
|
|
51
|
+
},
|
|
52
|
+
children: [
|
|
53
|
+
e,
|
|
54
|
+
" → ",
|
|
55
|
+
t
|
|
56
|
+
]
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ c(s, {
|
|
59
|
+
variant: "caption",
|
|
60
|
+
sx: {
|
|
61
|
+
display: "block",
|
|
62
|
+
opacity: .85
|
|
63
|
+
},
|
|
64
|
+
children: o(n)
|
|
65
|
+
}),
|
|
66
|
+
i && r > 0 && r !== n && /* @__PURE__ */ l(s, {
|
|
67
|
+
variant: "caption",
|
|
68
|
+
sx: {
|
|
69
|
+
display: "block",
|
|
70
|
+
opacity: .7,
|
|
71
|
+
mt: .25
|
|
72
|
+
},
|
|
73
|
+
children: [
|
|
74
|
+
t,
|
|
75
|
+
" → ",
|
|
76
|
+
e,
|
|
77
|
+
": ",
|
|
78
|
+
o(r)
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function p({ data: s, size: p = 500, innerRadius: m, ringThickness: h = 20, padAngle: ne, ribbonPadAngle: re, sortSubgroups: g = "descending", sortChords: _ = "descending", chartColors: v, groupColorConfigs: y, showGroupLabels: b = !0, labelOffset: ie = 8, ribbonOpacity: x = .75, ribbonBlendMode: ae, directed: S = !0, valueDecimalCount: C = 0, valueDecimalSeparator: w = ".", valueThousandsSeparator: T = ",", onGroupClick: E, onChordClick: D, zoomable: O = !1, disabled: k = !1 }) {
|
|
85
|
+
let A = ee(), j = ae ?? (A.palette.mode === "dark" ? "normal" : "multiply"), oe = [
|
|
86
|
+
A.palette.primary.main,
|
|
87
|
+
A.palette.secondary.main,
|
|
88
|
+
A.palette.error.main,
|
|
89
|
+
A.palette.warning.main,
|
|
90
|
+
A.palette.success.main,
|
|
91
|
+
A.palette.info.main
|
|
92
|
+
], M = v && v.length > 0 ? v : oe, se = m ?? Math.min(p, p) * .5 - 90, N = Math.max(10, se), P = N + Math.max(1, h), F = ne ?? 10 / N, I = re ?? 1 / N, L = e((e) => d(e, C, w, T), [
|
|
93
|
+
C,
|
|
94
|
+
w,
|
|
95
|
+
T
|
|
96
|
+
]), { names: R, matrix: z } = n(() => {
|
|
97
|
+
let e = u.sort(u.union(s.map((e) => e.source), s.map((e) => e.target))), t = new Map(e.map((e, t) => [e, t])), n = Array.from({ length: e.length }, () => Array(e.length).fill(0));
|
|
98
|
+
for (let { source: e, target: r, value: i } of s) {
|
|
99
|
+
let a = t.get(e), o = t.get(r);
|
|
100
|
+
a == null || o == null || (n[a][o] += i);
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
names: e,
|
|
104
|
+
matrix: n
|
|
105
|
+
};
|
|
106
|
+
}, [s]), B = n(() => {
|
|
107
|
+
let e = (S ? u.chordDirected() : u.chord()).padAngle(F);
|
|
108
|
+
return g === "ascending" && (e = e.sortSubgroups(u.ascending)), g === "descending" && (e = e.sortSubgroups(u.descending)), _ === "ascending" && (e = e.sortChords(u.ascending)), _ === "descending" && (e = e.sortChords(u.descending)), e(z);
|
|
109
|
+
}, [
|
|
110
|
+
z,
|
|
111
|
+
F,
|
|
112
|
+
S,
|
|
113
|
+
g,
|
|
114
|
+
_
|
|
115
|
+
]), V = n(() => u.arc().innerRadius(N).outerRadius(P), [N, P]), H = n(() => (S ? u.ribbonArrow() : u.ribbon()).radius(N - 1).padAngle(I), [
|
|
116
|
+
N,
|
|
117
|
+
I,
|
|
118
|
+
S
|
|
119
|
+
]), U = e((e) => H({
|
|
120
|
+
source: {
|
|
121
|
+
startAngle: e.source.startAngle,
|
|
122
|
+
endAngle: e.source.endAngle,
|
|
123
|
+
radius: N - 1
|
|
124
|
+
},
|
|
125
|
+
target: {
|
|
126
|
+
startAngle: e.target.startAngle,
|
|
127
|
+
endAngle: e.target.endAngle,
|
|
128
|
+
radius: N - 1
|
|
129
|
+
}
|
|
130
|
+
}) ?? "", [H, N]), W = n(() => u.scaleOrdinal().domain(u.range(R.length)).range(M.length >= R.length ? M : [...Array(Math.ceil(R.length / M.length))].flatMap(() => M).slice(0, R.length)), [M, R.length]), G = e((e) => y?.[R[e]]?.fill ?? W(e), [
|
|
131
|
+
y,
|
|
132
|
+
R,
|
|
133
|
+
W
|
|
134
|
+
]), K = r(null), [q, J] = i(`-${p / 2} -${p / 2} ${p} ${p}`), [Y, X] = i(1), ce = n(() => {
|
|
135
|
+
if (Y === 1) return q;
|
|
136
|
+
let [e, t, n, r] = q.split(" ").map(Number), i = n / Y, a = r / Y;
|
|
137
|
+
return `${e + (n - i) / 2} ${t + (r - a) / 2} ${i} ${a}`;
|
|
138
|
+
}, [q, Y]);
|
|
139
|
+
t(() => {
|
|
140
|
+
let e = K.current;
|
|
141
|
+
if (!e) return;
|
|
142
|
+
let t = requestAnimationFrame(() => {
|
|
143
|
+
try {
|
|
144
|
+
let t = e.getBBox();
|
|
145
|
+
J(`${t.x - 8} ${t.y - 8} ${t.width + 16} ${t.height + 16}`);
|
|
146
|
+
} catch {
|
|
147
|
+
J(`-${p / 2} -${p / 2} ${p} ${p}`);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
return () => cancelAnimationFrame(t);
|
|
151
|
+
}, [
|
|
152
|
+
p,
|
|
153
|
+
N,
|
|
154
|
+
P,
|
|
155
|
+
R.length,
|
|
156
|
+
B
|
|
157
|
+
]);
|
|
158
|
+
let [Z, Q] = i(null), le = e((e) => ({
|
|
159
|
+
name: R[e.index],
|
|
160
|
+
index: e.index,
|
|
161
|
+
valueOut: u.sum(B, (t) => t.source.index === e.index ? t.source.value : 0),
|
|
162
|
+
valueIn: u.sum(B, (t) => t.target.index === e.index ? t.source.value : 0)
|
|
163
|
+
}), [R, B]), ue = e((e) => ({
|
|
164
|
+
source: {
|
|
165
|
+
name: R[e.source.index],
|
|
166
|
+
index: e.source.index,
|
|
167
|
+
value: e.source.value
|
|
168
|
+
},
|
|
169
|
+
target: {
|
|
170
|
+
name: R[e.target.index],
|
|
171
|
+
index: e.target.index,
|
|
172
|
+
value: e.target.value
|
|
173
|
+
}
|
|
174
|
+
}), [R]), de = (e) => {
|
|
175
|
+
let t = (e.startAngle + e.endAngle) / 2, n = t * 180 / Math.PI - 90, r = t > Math.PI ? " rotate(180)" : "";
|
|
176
|
+
return `rotate(${n}) translate(${P + ie})${r}`;
|
|
177
|
+
}, fe = (e) => (e.startAngle + e.endAngle) / 2 > Math.PI ? "end" : "start", pe = e((e) => {
|
|
178
|
+
if (!O || k || !e.ctrlKey) return;
|
|
179
|
+
e.preventDefault();
|
|
180
|
+
let t = e.deltaY < 0 ? 1.15 : 1 / 1.15;
|
|
181
|
+
X((e) => Math.max(.25, Math.min(8, e * t)));
|
|
182
|
+
}, [O, k]);
|
|
183
|
+
t(() => {
|
|
184
|
+
if (!O) return;
|
|
185
|
+
let e = (e) => {
|
|
186
|
+
e.key === "Escape" && X(1);
|
|
187
|
+
};
|
|
188
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
189
|
+
}, [O]);
|
|
190
|
+
let $ = {
|
|
191
|
+
followCursor: !0,
|
|
192
|
+
enterDelay: 50,
|
|
193
|
+
enterNextDelay: 0,
|
|
194
|
+
disableHoverListener: k,
|
|
195
|
+
slotProps: { tooltip: { sx: { maxWidth: 240 } } }
|
|
196
|
+
}, me = A.palette.text.primary, he = A.typography.fontFamily;
|
|
197
|
+
return /* @__PURE__ */ c(a, {
|
|
198
|
+
sx: {
|
|
199
|
+
display: "inline-flex",
|
|
200
|
+
opacity: k ? .5 : 1,
|
|
201
|
+
cursor: k ? "not-allowed" : "default",
|
|
202
|
+
userSelect: "none"
|
|
203
|
+
},
|
|
204
|
+
children: /* @__PURE__ */ c("svg", {
|
|
205
|
+
width: p,
|
|
206
|
+
height: p,
|
|
207
|
+
viewBox: ce,
|
|
208
|
+
onWheel: pe,
|
|
209
|
+
style: {
|
|
210
|
+
fontFamily: he ?? "sans-serif",
|
|
211
|
+
overflow: O && Y > 1 ? "hidden" : "visible"
|
|
212
|
+
},
|
|
213
|
+
role: "img",
|
|
214
|
+
"aria-label": "Chord chart",
|
|
215
|
+
children: /* @__PURE__ */ l("g", {
|
|
216
|
+
ref: K,
|
|
217
|
+
children: [/* @__PURE__ */ c("g", { children: B.groups.map((e) => {
|
|
218
|
+
let t = le(e), n = Z === e.index, r = Z !== null && !n;
|
|
219
|
+
return /* @__PURE__ */ c(o, {
|
|
220
|
+
...$,
|
|
221
|
+
title: /* @__PURE__ */ c(f, {
|
|
222
|
+
name: t.name,
|
|
223
|
+
valueOut: t.valueOut,
|
|
224
|
+
valueIn: t.valueIn,
|
|
225
|
+
fmt: L
|
|
226
|
+
}),
|
|
227
|
+
children: /* @__PURE__ */ l("g", {
|
|
228
|
+
style: { cursor: k ? "not-allowed" : "pointer" },
|
|
229
|
+
onMouseEnter: () => !k && Q(e.index),
|
|
230
|
+
onMouseLeave: () => Q(null),
|
|
231
|
+
onClick: (e) => !k && E?.(t, e),
|
|
232
|
+
children: [/* @__PURE__ */ c("path", {
|
|
233
|
+
d: V(e) || "",
|
|
234
|
+
fill: G(e.index),
|
|
235
|
+
stroke: A.palette.divider,
|
|
236
|
+
opacity: r ? .35 : 1,
|
|
237
|
+
style: { transition: "opacity 0.15s" }
|
|
238
|
+
}), b && /* @__PURE__ */ c("text", {
|
|
239
|
+
dy: "0.35em",
|
|
240
|
+
fontSize: 11,
|
|
241
|
+
fill: me,
|
|
242
|
+
transform: de(e),
|
|
243
|
+
textAnchor: fe(e),
|
|
244
|
+
pointerEvents: "none",
|
|
245
|
+
children: R[e.index]
|
|
246
|
+
})]
|
|
247
|
+
})
|
|
248
|
+
}, `grp-tt-${e.index}`);
|
|
249
|
+
}) }), /* @__PURE__ */ c("g", {
|
|
250
|
+
fillOpacity: x,
|
|
251
|
+
style: { mixBlendMode: j },
|
|
252
|
+
children: B.map((e, t) => {
|
|
253
|
+
let n = ue(e), r = Z === null || e.source.index === Z || e.target.index === Z;
|
|
254
|
+
return /* @__PURE__ */ c(o, {
|
|
255
|
+
...$,
|
|
256
|
+
title: /* @__PURE__ */ c(te, {
|
|
257
|
+
sourceName: n.source.name,
|
|
258
|
+
targetName: n.target.name,
|
|
259
|
+
sourceValue: n.source.value,
|
|
260
|
+
targetValue: n.target.value,
|
|
261
|
+
directed: S,
|
|
262
|
+
fmt: L
|
|
263
|
+
}),
|
|
264
|
+
children: /* @__PURE__ */ c("path", {
|
|
265
|
+
d: U(e),
|
|
266
|
+
fill: G(e.target.index),
|
|
267
|
+
stroke: "none",
|
|
268
|
+
opacity: r ? 1 : .12,
|
|
269
|
+
style: {
|
|
270
|
+
cursor: k ? "not-allowed" : "pointer",
|
|
271
|
+
transition: "opacity 0.15s"
|
|
272
|
+
},
|
|
273
|
+
onClick: (e) => !k && D?.(n, e)
|
|
274
|
+
})
|
|
275
|
+
}, `chord-tt-${t}`);
|
|
276
|
+
})
|
|
277
|
+
})]
|
|
278
|
+
})
|
|
279
|
+
})
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
p.displayName = "ChordChart";
|
|
283
|
+
//#endregion
|
|
284
|
+
export { p as ChordChart };
|