@thebuoyant-tsdev/mui-ts-library 3.29.2 → 3.31.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 (53) hide show
  1. package/README.de.md +49 -1
  2. package/README.md +49 -1
  3. package/dist/components/chord-chart/ChordChart.js +112 -112
  4. package/dist/components/circle-packing-chart/CirclePackingChart.js +135 -135
  5. package/dist/components/color-picker/ColorPicker.js +217 -217
  6. package/dist/components/color-picker/PopoverColorPicker.js +7 -7
  7. package/dist/components/date-range-picker/DateRangePicker.js +9 -9
  8. package/dist/components/gantt-chart/GanttChart.js +18 -18
  9. package/dist/components/gantt-chart/GanttTaskDialog.js +43 -43
  10. package/dist/components/gantt-chart/GanttTaskPanel.js +128 -128
  11. package/dist/components/gantt-chart/GanttTimeline.js +16 -16
  12. package/dist/components/gantt-chart/GanttToolbar.js +24 -24
  13. package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +244 -244
  14. package/dist/components/json-editor/JsonEditor.js +9 -9
  15. package/dist/components/json-editor/JsonEditorContent.js +54 -54
  16. package/dist/components/json-editor/JsonEditorToolbar.js +12 -12
  17. package/dist/components/kanban-board/KanbanBoard.d.ts +2 -0
  18. package/dist/components/kanban-board/KanbanBoard.js +132 -0
  19. package/dist/components/kanban-board/KanbanBoard.types.d.ts +93 -0
  20. package/dist/components/kanban-board/KanbanBoard.types.js +19 -0
  21. package/dist/components/kanban-board/KanbanBoardCard.d.ts +14 -0
  22. package/dist/components/kanban-board/KanbanBoardCard.js +118 -0
  23. package/dist/components/kanban-board/KanbanBoardCardDialog.d.ts +23 -0
  24. package/dist/components/kanban-board/KanbanBoardCardDialog.js +120 -0
  25. package/dist/components/kanban-board/KanbanBoardColumn.d.ts +15 -0
  26. package/dist/components/kanban-board/KanbanBoardColumn.js +132 -0
  27. package/dist/components/kanban-board/kanbanBoardClasses.d.ts +47 -0
  28. package/dist/components/kanban-board/kanbanBoardClasses.js +18 -0
  29. package/dist/components/password-strength-meter/PasswordStrengthMeter.js +27 -27
  30. package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.js +48 -48
  31. package/dist/components/radial-tree-chart/RadialTreeChart.js +173 -173
  32. package/dist/components/rich-text-editor/RichTextEditor.js +32 -32
  33. package/dist/components/rich-text-editor/RichTextEditorColorPicker.js +20 -20
  34. package/dist/components/rich-text-editor/RichTextEditorEmojiPicker.js +12 -12
  35. package/dist/components/rich-text-editor/RichTextEditorImageDialog.js +11 -11
  36. package/dist/components/rich-text-editor/RichTextEditorLinkDialog.js +11 -11
  37. package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +14 -14
  38. package/dist/components/rich-text-editor/RichTextEditorMentionList.js +14 -14
  39. package/dist/components/rich-text-editor/RichTextEditorTableMenu.js +28 -28
  40. package/dist/components/rich-text-editor/RichTextEditorToolbar.js +35 -35
  41. package/dist/components/sql-editor/SqlEditor.js +24 -24
  42. package/dist/components/sql-editor/SqlEditorContent.js +16 -16
  43. package/dist/components/sql-editor/SqlEditorHistoryMenu.js +15 -15
  44. package/dist/components/sql-editor/SqlEditorToolbar.js +21 -21
  45. package/dist/components/sunburst-chart/SunburstChart.js +126 -126
  46. package/dist/components/tag-selection/TagSelection.js +18 -18
  47. package/dist/components/tag-selection/TagSelectionAutocomplete.js +120 -120
  48. package/dist/components/tag-selection/TagSelectionSelectedTags.js +10 -10
  49. package/dist/index.cjs +2 -2
  50. package/dist/index.d.cts +3 -0
  51. package/dist/index.d.ts +3 -0
  52. package/dist/index.js +38 -35
  53. package/package.json +9 -2
@@ -3,8 +3,8 @@ import { JsonEditorContent as n } from "./JsonEditorContent.js";
3
3
  import { JsonEditorToolbar as r } from "./JsonEditorToolbar.js";
4
4
  import { JsonEditorFooter as i } from "./JsonEditorFooter.js";
5
5
  import { normalizeSize as a } from "../shared/normalizeSize.js";
6
- import { useCallback as o, useRef as s, useState as c } from "react";
7
- import { Box as l, Divider as u, Paper as d } from "@mui/material";
6
+ import { Box as o, Divider as s, Paper as c } from "@mui/material";
7
+ import { useCallback as l, useRef as u, useState as d } from "react";
8
8
  import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
9
9
  //#region src/components/json-editor/JsonEditor.tsx
10
10
  function h(e) {
@@ -22,21 +22,21 @@ function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b,
22
22
  }, H = {
23
23
  ...e,
24
24
  ...I
25
- }, U = a(b), W = a(x), G = U === "auto", K = G ? void 0 : U ?? 300, q = s(null), [J, Y] = c(null), [X, Z] = c({
25
+ }, U = a(b), W = a(x), G = U === "auto", K = G ? void 0 : U ?? 300, q = u(null), [J, Y] = d(null), [X, Z] = d({
26
26
  line: 1,
27
27
  col: 1
28
- }), [Q, $] = c(() => h(g ?? "")), te = o((e) => {
28
+ }), [Q, $] = d(() => h(g ?? "")), te = l((e) => {
29
29
  q.current = e, Y(e);
30
- }, []), ne = o((e, t) => {
30
+ }, []), ne = l((e, t) => {
31
31
  Z({
32
32
  line: e,
33
33
  col: t
34
34
  });
35
- }, []), re = o((e) => {
35
+ }, []), re = l((e) => {
36
36
  let t = h(e);
37
37
  $(t), v?.(t), _?.(e);
38
38
  }, [_, v]), ie = A || N || !!T;
39
- return /* @__PURE__ */ m(l, {
39
+ return /* @__PURE__ */ m(o, {
40
40
  sx: {
41
41
  width: W ?? "100%",
42
42
  ...G ? {
@@ -46,7 +46,7 @@ function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b,
46
46
  } : {}
47
47
  },
48
48
  children: [
49
- /* @__PURE__ */ m(d, {
49
+ /* @__PURE__ */ m(c, {
50
50
  variant: "outlined",
51
51
  sx: {
52
52
  display: "flex",
@@ -66,7 +66,7 @@ function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b,
66
66
  indent: D,
67
67
  downloadFilename: F,
68
68
  disabled: S
69
- }), /* @__PURE__ */ p(u, {})] }), /* @__PURE__ */ p(n, {
69
+ }), /* @__PURE__ */ p(s, {})] }), /* @__PURE__ */ p(n, {
70
70
  value: g,
71
71
  onChange: re,
72
72
  placeholder: y,
@@ -1,7 +1,7 @@
1
1
  import { computeJsonPath as e } from "./util/jsonPathFinder.js";
2
2
  import { findRangeForPath as t, validateAgainstSchema as n } from "./util/jsonSchemaValidator.js";
3
- import { useEffect as r, useRef as i, useState as a } from "react";
4
- import { Box as o, Fade as s, Paper as c, Typography as ee, useTheme as te } from "@mui/material";
3
+ import { Box as r, Fade as i, Paper as a, Typography as o, useTheme as ee } from "@mui/material";
4
+ import { useEffect as s, useRef as c, useState as te } from "react";
5
5
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
6
  import { EditorView as d, highlightActiveLine as ne, highlightActiveLineGutter as f, keymap as re, lineNumbers as p, placeholder as m } from "@codemirror/view";
7
7
  import { Compartment as h, EditorState as g } from "@codemirror/state";
@@ -22,24 +22,24 @@ function S(e) {
22
22
  return e ? [m(e)] : [];
23
23
  }
24
24
  function C({ value: f, onChange: p, placeholder: m, disabled: _ = !1, readonly: C = !1, schema: w, showLineNumbers: T = !0, showMinimap: E = !1, showFolding: D = !0, enablePathFinder: O = !0, highlightColors: k, onViewReady: A, onCursorChange: j, onBlur: M, onFocus: N, onPathCopy: P }) {
25
- let F = i(null), I = i(null), L = i(null), R = i(p), z = i(j), he = i(M), B = i(N), V = i(A), H = i(P), U = i(O), W = i(w), [G, K] = a(null), q = i(new h()), J = i(new h()), Y = i(new h()), X = i(new h()), Z = i(new h()), Q = te(), $ = Q.palette.mode === "dark", ge = k?.propertyName ?? Q.palette.primary.main, _e = k?.string ?? Q.palette.success.main, ve = k?.number ?? Q.palette.warning.main, ye = k?.boolean ?? Q.palette.info.main, be = k?.null ?? Q.palette.text.secondary;
26
- return r(() => {
25
+ let F = c(null), I = c(null), L = c(null), R = c(p), z = c(j), B = c(M), V = c(N), H = c(A), U = c(P), W = c(O), G = c(w), [K, q] = te(null), J = c(new h()), Y = c(new h()), X = c(new h()), Z = c(new h()), he = c(new h()), Q = ee(), $ = Q.palette.mode === "dark", ge = k?.propertyName ?? Q.palette.primary.main, _e = k?.string ?? Q.palette.success.main, ve = k?.number ?? Q.palette.warning.main, ye = k?.boolean ?? Q.palette.info.main, be = k?.null ?? Q.palette.text.secondary;
26
+ return s(() => {
27
27
  R.current = p;
28
- }, [p]), r(() => {
28
+ }, [p]), s(() => {
29
29
  z.current = j;
30
- }, [j]), r(() => {
31
- he.current = M;
32
- }, [M]), r(() => {
33
- B.current = N;
34
- }, [N]), r(() => {
35
- V.current = A;
36
- }, [A]), r(() => {
37
- H.current = P;
38
- }, [P]), r(() => {
39
- U.current = O;
40
- }, [O]), r(() => {
41
- W.current = w, L.current && fe(L.current);
42
- }, [w]), r(() => {
30
+ }, [j]), s(() => {
31
+ B.current = M;
32
+ }, [M]), s(() => {
33
+ V.current = N;
34
+ }, [N]), s(() => {
35
+ H.current = A;
36
+ }, [A]), s(() => {
37
+ U.current = P;
38
+ }, [P]), s(() => {
39
+ W.current = O;
40
+ }, [O]), s(() => {
41
+ G.current = w, L.current && fe(L.current);
42
+ }, [w]), s(() => {
43
43
  if (!I.current) return;
44
44
  let r = L.current?.state.doc.toString() ?? f ?? "", i = le.define([
45
45
  {
@@ -136,14 +136,14 @@ function C({ value: f, onChange: p, placeholder: m, disabled: _ = !1, readonly:
136
136
  },
137
137
  displayText: "blocks",
138
138
  showOverlay: "always"
139
- })] : [], s = [
139
+ })] : [], ee = [
140
140
  a,
141
141
  de(i),
142
142
  ie(),
143
143
  pe(),
144
144
  v(ae()),
145
145
  v((e) => {
146
- let r = W.current;
146
+ let r = G.current;
147
147
  if (!r) return [];
148
148
  let i;
149
149
  try {
@@ -169,12 +169,12 @@ function C({ value: f, onChange: p, placeholder: m, disabled: _ = !1, readonly:
169
169
  ...ce,
170
170
  ...ue
171
171
  ]),
172
- q.current.of(d.editable.of(!_ && !C)),
173
- J.current.of(g.readOnly.of(C)),
172
+ J.current.of(d.editable.of(!_ && !C)),
173
+ Y.current.of(g.readOnly.of(C)),
174
174
  ne(),
175
- X.current.of(b(T)),
176
- Y.current.of(x(D)),
177
- Z.current.of(S(m)),
175
+ Z.current.of(b(T)),
176
+ X.current.of(x(D)),
177
+ he.current.of(S(m)),
178
178
  ...o,
179
179
  d.updateListener.of((e) => {
180
180
  e.docChanged && R.current?.(e.state.doc.toString());
@@ -183,13 +183,13 @@ function C({ value: f, onChange: p, placeholder: m, disabled: _ = !1, readonly:
183
183
  }),
184
184
  d.domEventHandlers({
185
185
  blur: () => {
186
- he.current?.();
186
+ B.current?.();
187
187
  },
188
188
  focus: () => {
189
- B.current?.();
189
+ V.current?.();
190
190
  },
191
191
  click: (t, n) => {
192
- if (!U.current || !(t.ctrlKey || t.metaKey)) return !1;
192
+ if (!W.current || !(t.ctrlKey || t.metaKey)) return !1;
193
193
  let r;
194
194
  try {
195
195
  r = n.posAtCoords({
@@ -203,23 +203,23 @@ function C({ value: f, onChange: p, placeholder: m, disabled: _ = !1, readonly:
203
203
  let i = e(n.state, r);
204
204
  return i ? (navigator.clipboard.writeText(i).then(() => {
205
205
  let e = F.current?.getBoundingClientRect();
206
- K({
206
+ q({
207
207
  x: t.clientX - (e?.left ?? 0),
208
208
  y: t.clientY - (e?.top ?? 0),
209
209
  path: i
210
- }), H.current?.(i);
210
+ }), U.current?.(i);
211
211
  }), !0) : !1;
212
212
  }
213
213
  })
214
- ], c = new d({
214
+ ], s = new d({
215
215
  state: g.create({
216
216
  doc: r,
217
- extensions: s
217
+ extensions: ee
218
218
  }),
219
219
  parent: I.current
220
220
  });
221
- return L.current = c, V.current(c), () => {
222
- V.current(null), c.destroy(), L.current = null;
221
+ return L.current = s, H.current(s), () => {
222
+ H.current(null), s.destroy(), L.current = null;
223
223
  };
224
224
  }, [
225
225
  $,
@@ -229,7 +229,7 @@ function C({ value: f, onChange: p, placeholder: m, disabled: _ = !1, readonly:
229
229
  ye,
230
230
  be,
231
231
  E
232
- ]), r(() => {
232
+ ]), s(() => {
233
233
  let e = L.current;
234
234
  if (!e) return;
235
235
  let t = e.state.doc.toString();
@@ -238,19 +238,19 @@ function C({ value: f, onChange: p, placeholder: m, disabled: _ = !1, readonly:
238
238
  to: t.length,
239
239
  insert: f ?? ""
240
240
  } });
241
- }, [f]), r(() => {
242
- L.current?.dispatch({ effects: [q.current.reconfigure(d.editable.of(!_ && !C)), J.current.reconfigure(g.readOnly.of(C))] });
243
- }, [_, C]), r(() => {
244
- L.current?.dispatch({ effects: X.current.reconfigure(b(T)) });
245
- }, [T]), r(() => {
246
- L.current?.dispatch({ effects: Y.current.reconfigure(x(D)) });
247
- }, [D]), r(() => {
248
- L.current?.dispatch({ effects: Z.current.reconfigure(S(m)) });
249
- }, [m]), r(() => {
250
- if (!G) return;
251
- let e = setTimeout(() => K(null), 1500);
241
+ }, [f]), s(() => {
242
+ L.current?.dispatch({ effects: [J.current.reconfigure(d.editable.of(!_ && !C)), Y.current.reconfigure(g.readOnly.of(C))] });
243
+ }, [_, C]), s(() => {
244
+ L.current?.dispatch({ effects: Z.current.reconfigure(b(T)) });
245
+ }, [T]), s(() => {
246
+ L.current?.dispatch({ effects: X.current.reconfigure(x(D)) });
247
+ }, [D]), s(() => {
248
+ L.current?.dispatch({ effects: he.current.reconfigure(S(m)) });
249
+ }, [m]), s(() => {
250
+ if (!K) return;
251
+ let e = setTimeout(() => q(null), 1500);
252
252
  return () => clearTimeout(e);
253
- }, [G]), /* @__PURE__ */ u(o, {
253
+ }, [K]), /* @__PURE__ */ u(r, {
254
254
  ref: F,
255
255
  sx: {
256
256
  position: "relative",
@@ -258,7 +258,7 @@ function C({ value: f, onChange: p, placeholder: m, disabled: _ = !1, readonly:
258
258
  overflow: "hidden",
259
259
  display: "flex"
260
260
  },
261
- children: [/* @__PURE__ */ l(o, {
261
+ children: [/* @__PURE__ */ l(r, {
262
262
  ref: I,
263
263
  sx: {
264
264
  flex: 1,
@@ -273,14 +273,14 @@ function C({ value: f, onChange: p, placeholder: m, disabled: _ = !1, readonly:
273
273
  flexDirection: "column"
274
274
  }
275
275
  }
276
- }), G && /* @__PURE__ */ l(s, {
276
+ }), K && /* @__PURE__ */ l(i, {
277
277
  in: !0,
278
- children: /* @__PURE__ */ l(c, {
278
+ children: /* @__PURE__ */ l(a, {
279
279
  elevation: 3,
280
280
  sx: {
281
281
  position: "absolute",
282
- left: G.x,
283
- top: G.y,
282
+ left: K.x,
283
+ top: K.y,
284
284
  transform: "translate(-50%, -130%)",
285
285
  px: 1,
286
286
  py: .5,
@@ -289,10 +289,10 @@ function C({ value: f, onChange: p, placeholder: m, disabled: _ = !1, readonly:
289
289
  bgcolor: "grey.900",
290
290
  color: "common.white"
291
291
  },
292
- children: /* @__PURE__ */ u(ee, {
292
+ children: /* @__PURE__ */ u(o, {
293
293
  variant: "caption",
294
294
  sx: { fontFamily: "monospace" },
295
- children: ["Copied: ", G.path]
295
+ children: ["Copied: ", K.path]
296
296
  })
297
297
  })
298
298
  })]
@@ -2,11 +2,11 @@ import { ToolbarButton as e } from "../shared/ToolbarButton.js";
2
2
  import { useTimedFlag as t } from "../shared/useTimedFlag.js";
3
3
  import { Box as n, Divider as r } from "@mui/material";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import { redo as o, undo as s } from "@codemirror/commands";
6
- import c from "@mui/icons-material/ContentCopy";
7
- import l from "@mui/icons-material/Download";
8
- import u from "@mui/icons-material/Check";
9
- import d from "@mui/icons-material/Delete";
5
+ import o from "@mui/icons-material/Delete";
6
+ import { redo as s, undo as c } from "@codemirror/commands";
7
+ import l from "@mui/icons-material/ContentCopy";
8
+ import u from "@mui/icons-material/Download";
9
+ import d from "@mui/icons-material/Check";
10
10
  import f from "@mui/icons-material/Undo";
11
11
  import p from "@mui/icons-material/Redo";
12
12
  import m from "@mui/icons-material/AutoFixHigh";
@@ -62,11 +62,11 @@ function g({ editorView: g, toolbarConfig: _, translation: v, indent: y, downloa
62
62
  }
63
63
  function M() {
64
64
  let e = g;
65
- e && (s(e), e.focus());
65
+ e && (c(e), e.focus());
66
66
  }
67
67
  function N() {
68
68
  let e = g;
69
- e && (o(e), e.focus());
69
+ e && (s(e), e.focus());
70
70
  }
71
71
  let P = _.showFormat || _.showCompact, F = _.showCopy || _.showDownload || _.showClear, I = _.showUndoRedo;
72
72
  return /* @__PURE__ */ a(n, {
@@ -111,25 +111,25 @@ function g({ editorView: g, toolbarConfig: _, translation: v, indent: y, downloa
111
111
  children: [
112
112
  _.showCopy && /* @__PURE__ */ i(e, {
113
113
  label: S ? v.copySuccess : v.copy,
114
- icon: S ? /* @__PURE__ */ i(u, {
114
+ icon: S ? /* @__PURE__ */ i(d, {
115
115
  fontSize: "small",
116
116
  color: "success"
117
- }) : /* @__PURE__ */ i(c, { fontSize: "small" }),
117
+ }) : /* @__PURE__ */ i(l, { fontSize: "small" }),
118
118
  onClick: k,
119
119
  disabled: E
120
120
  }),
121
121
  _.showDownload && /* @__PURE__ */ i(e, {
122
122
  label: w ? v.downloadSuccess : v.download,
123
- icon: w ? /* @__PURE__ */ i(u, {
123
+ icon: w ? /* @__PURE__ */ i(d, {
124
124
  fontSize: "small",
125
125
  color: "success"
126
- }) : /* @__PURE__ */ i(l, { fontSize: "small" }),
126
+ }) : /* @__PURE__ */ i(u, { fontSize: "small" }),
127
127
  onClick: A,
128
128
  disabled: E
129
129
  }),
130
130
  _.showClear && /* @__PURE__ */ i(e, {
131
131
  label: v.clear,
132
- icon: /* @__PURE__ */ i(d, { fontSize: "small" }),
132
+ icon: /* @__PURE__ */ i(o, { fontSize: "small" }),
133
133
  onClick: j,
134
134
  disabled: E
135
135
  })
@@ -0,0 +1,2 @@
1
+ import { type KanbanBoardProps } from "./KanbanBoard.types";
2
+ export declare function KanbanBoard({ tasks, columns, onTasksChange, onCardClick, enableBuiltinDialogs, onTaskCreated, onTaskUpdated, onTaskDeleted, onTaskMoved, showAssignee, showDueDate, showDueDateWarning, chipVariant, width, height, translation, }: KanbanBoardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,132 @@
1
+ import { kanbanBoardClasses as e } from "./kanbanBoardClasses.js";
2
+ import { DEFAULT_KANBAN_BOARD_TRANSLATION as t } from "./KanbanBoard.types.js";
3
+ import { KanbanBoardCard as n } from "./KanbanBoardCard.js";
4
+ import { KanbanBoardCardDialog as r } from "./KanbanBoardCardDialog.js";
5
+ import { KanbanBoardColumn as i } from "./KanbanBoardColumn.js";
6
+ import { DndContext as a, DragOverlay as o, KeyboardSensor as s, PointerSensor as c, closestCorners as l, useSensor as u, useSensors as d } from "@dnd-kit/core";
7
+ import { arrayMove as f, sortableKeyboardCoordinates as p } from "@dnd-kit/sortable";
8
+ import { Box as m } from "@mui/material";
9
+ import { useEffect as h, useState as g } from "react";
10
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
11
+ //#region src/components/kanban-board/KanbanBoard.tsx
12
+ function y({ tasks: y, columns: b, onTasksChange: x, onCardClick: S, enableBuiltinDialogs: C = !0, onTaskCreated: w, onTaskUpdated: T, onTaskDeleted: E, onTaskMoved: D, showAssignee: O = !0, showDueDate: k = !0, showDueDateWarning: A = !0, chipVariant: j = "outlined", width: M = "100%", height: N = "100%", translation: P }) {
13
+ let F = {
14
+ ...t,
15
+ ...P
16
+ }, [I, L] = g(y);
17
+ h(() => {
18
+ L(y);
19
+ }, [y]);
20
+ let [R, z] = g(null), [B, V] = g(null), H = d(u(c, { activationConstraint: { distance: 8 } }), u(s, { coordinateGetter: p }));
21
+ function U({ active: e }) {
22
+ z(I.find((t) => t.id === e.id) ?? null);
23
+ }
24
+ function W({ active: e, over: t }) {
25
+ if (!t) return;
26
+ let n = e.id, r = t.id, i = I.find((e) => e.id === n);
27
+ if (!i) return;
28
+ let a = b.find((e) => e.id === r), o = I.find((e) => e.id === r), s = a?.id ?? o?.status;
29
+ !s || i.status === s || L((e) => e.map((e) => e.id === n ? {
30
+ ...e,
31
+ status: s
32
+ } : e));
33
+ }
34
+ function G({ active: e, over: t }) {
35
+ let n = R?.status;
36
+ if (z(null), !t) {
37
+ L(y);
38
+ return;
39
+ }
40
+ let r = e.id, i = t.id, a = I.findIndex((e) => e.id === r), o = I.findIndex((e) => e.id === i), s;
41
+ if (s = a !== -1 && o !== -1 && a !== o ? f(I, a, o) : [...I], L(s), x?.(s), n) {
42
+ let e = s.find((e) => e.id === r);
43
+ e && e.status !== n && D?.(e, n, e.status);
44
+ }
45
+ }
46
+ function K(e) {
47
+ C ? V({
48
+ mode: "edit",
49
+ task: e
50
+ }) : S?.(e);
51
+ }
52
+ function q(e) {
53
+ V({
54
+ mode: "add",
55
+ columnId: e
56
+ });
57
+ }
58
+ function J(e) {
59
+ let t = !I.find((t) => t.id === e.id), n = t ? [...I, e] : I.map((t) => t.id === e.id ? e : t);
60
+ L(n), x?.(n), t ? w?.(e) : T?.(e), V(null);
61
+ }
62
+ function Y(e) {
63
+ let t = I.filter((t) => t.id !== e);
64
+ L(t), x?.(t), E?.(e), V(null);
65
+ }
66
+ function X(e) {
67
+ V({
68
+ mode: "delete",
69
+ task: e
70
+ });
71
+ }
72
+ return /* @__PURE__ */ v(m, {
73
+ className: e.root,
74
+ sx: {
75
+ width: M,
76
+ height: N,
77
+ display: "flex",
78
+ flexDirection: "column",
79
+ overflow: "hidden"
80
+ },
81
+ children: [/* @__PURE__ */ v(a, {
82
+ sensors: H,
83
+ collisionDetection: l,
84
+ onDragStart: U,
85
+ onDragOver: W,
86
+ onDragEnd: G,
87
+ children: [/* @__PURE__ */ _(m, {
88
+ className: e.columns,
89
+ sx: {
90
+ flex: 1,
91
+ display: "flex",
92
+ gap: 2,
93
+ p: 2,
94
+ overflowX: "auto",
95
+ overflowY: "hidden",
96
+ alignItems: "stretch"
97
+ },
98
+ children: b.map((e) => /* @__PURE__ */ _(i, {
99
+ column: e,
100
+ tasks: I.filter((t) => t.status === e.id),
101
+ showAssignee: O,
102
+ showDueDate: k,
103
+ showDueDateWarning: A,
104
+ chipVariant: j,
105
+ t: F,
106
+ enableBuiltinDialogs: C,
107
+ onCardClick: K,
108
+ onAddClick: q
109
+ }, e.id))
110
+ }), /* @__PURE__ */ _(o, { children: R && /* @__PURE__ */ _(n, {
111
+ task: R,
112
+ showAssignee: O,
113
+ showDueDate: k,
114
+ showDueDateWarning: A,
115
+ chipVariant: j,
116
+ t: F,
117
+ onCardClick: () => {},
118
+ isOverlay: !0
119
+ }) })]
120
+ }), C && /* @__PURE__ */ _(r, {
121
+ state: B,
122
+ columns: b,
123
+ t: F,
124
+ onSave: J,
125
+ onDelete: Y,
126
+ onRequestDelete: X,
127
+ onClose: () => V(null)
128
+ }, B ? `${B.mode}-${B.mode === "add" ? B.columnId : B.task.id}` : "closed")]
129
+ });
130
+ }
131
+ //#endregion
132
+ export { y as KanbanBoard };
@@ -0,0 +1,93 @@
1
+ export type KanbanTask = {
2
+ id: string;
3
+ title: string;
4
+ /** Must match a `KanbanColumn.id`. */
5
+ status: string;
6
+ description?: string;
7
+ assignee?: string;
8
+ /** Overrides the column's default card color for this individual card. Any CSS color value. */
9
+ color?: string;
10
+ dueDate?: Date;
11
+ };
12
+ export type KanbanColumn = {
13
+ /** Used as the key — must match `KanbanTask.status` values. */
14
+ id: string;
15
+ label: string;
16
+ /** Accent color for the column header bar. Any CSS color value. */
17
+ color?: string;
18
+ /** Optional WIP limit — shown as "{count} / {wipLimit}" in the column header. */
19
+ wipLimit?: number;
20
+ };
21
+ export type KanbanBoardTranslation = {
22
+ addCardLabel: string;
23
+ dialogAddTitle: string;
24
+ dialogEditTitle: string;
25
+ dialogDeleteTitle: string;
26
+ dialogSave: string;
27
+ dialogCancel: string;
28
+ dialogDelete: string;
29
+ /** "{title}" is replaced with the card title. */
30
+ dialogDeleteConfirm: string;
31
+ dialogFieldTitle: string;
32
+ dialogFieldDescription: string;
33
+ dialogFieldAssignee: string;
34
+ dialogFieldDueDate: string;
35
+ dialogFieldStatus: string;
36
+ noCardsLabel: string;
37
+ };
38
+ export declare const DEFAULT_KANBAN_BOARD_TRANSLATION: Required<KanbanBoardTranslation>;
39
+ export type KanbanBoardProps = {
40
+ tasks: KanbanTask[];
41
+ columns: KanbanColumn[];
42
+ /**
43
+ * Called after every CRUD action and after every drag-and-drop.
44
+ * Receives the complete updated task list.
45
+ */
46
+ onTasksChange?: (tasks: KanbanTask[]) => void;
47
+ /**
48
+ * Called when a card is clicked.
49
+ * When `enableBuiltinDialogs` is true this opens the Edit dialog instead.
50
+ */
51
+ onCardClick?: (task: KanbanTask) => void;
52
+ /**
53
+ * When true (default), clicking a card opens the built-in Edit dialog and
54
+ * the "+" button opens the built-in Add dialog.
55
+ */
56
+ enableBuiltinDialogs?: boolean;
57
+ /** Called after a new card is saved via the built-in Add dialog. */
58
+ onTaskCreated?: (task: KanbanTask) => void;
59
+ /** Called after an existing card is saved via the built-in Edit dialog. */
60
+ onTaskUpdated?: (task: KanbanTask) => void;
61
+ /** Called after a card is deleted via the built-in Delete confirmation. */
62
+ onTaskDeleted?: (taskId: string) => void;
63
+ /**
64
+ * Called when a card is moved to a different column via drag and drop.
65
+ * NOT fired for in-column reordering or dialog-based status changes — use
66
+ * `onTaskUpdated` for those. Carries the full updated task plus both column ids
67
+ * so consumers can issue a targeted API call without diffing the full list.
68
+ */
69
+ onTaskMoved?: (task: KanbanTask, fromColumnId: string, toColumnId: string) => void;
70
+ /** Show the assignee label on cards (default: true). */
71
+ showAssignee?: boolean;
72
+ /** Show the due date on cards (default: true). */
73
+ showDueDate?: boolean;
74
+ /**
75
+ * Highlight cards whose `dueDate` is in the past (default: true).
76
+ * When true, the due-date chip turns red (`color="error"`) and the card
77
+ * receives a subtle red background tint and left border stripe.
78
+ * Has no effect when `showDueDate` is false or when the card has no `dueDate`.
79
+ */
80
+ showDueDateWarning?: boolean;
81
+ /**
82
+ * MUI Chip variant for assignee and due-date chips on cards.
83
+ * `"outlined"` (default) — subtle border, transparent background.
84
+ * `"filled"` — solid background, more prominent.
85
+ */
86
+ chipVariant?: "outlined" | "filled";
87
+ /** Width of the board. Default: "100%". */
88
+ width?: number | string;
89
+ /** Height of the board. Default: "100%". */
90
+ height?: number | string;
91
+ /** Override any label or message — unset keys fall back to English defaults. */
92
+ translation?: Partial<KanbanBoardTranslation>;
93
+ };
@@ -0,0 +1,19 @@
1
+ //#region src/components/kanban-board/KanbanBoard.types.ts
2
+ var e = {
3
+ addCardLabel: "Add card",
4
+ dialogAddTitle: "Add card",
5
+ dialogEditTitle: "Edit card",
6
+ dialogDeleteTitle: "Delete card",
7
+ dialogSave: "Save",
8
+ dialogCancel: "Cancel",
9
+ dialogDelete: "Delete",
10
+ dialogDeleteConfirm: "Delete \"{title}\"?",
11
+ dialogFieldTitle: "Title",
12
+ dialogFieldDescription: "Description",
13
+ dialogFieldAssignee: "Assignee",
14
+ dialogFieldDueDate: "Due date",
15
+ dialogFieldStatus: "Status",
16
+ noCardsLabel: "No cards"
17
+ };
18
+ //#endregion
19
+ export { e as DEFAULT_KANBAN_BOARD_TRANSLATION };
@@ -0,0 +1,14 @@
1
+ import type { KanbanBoardTranslation, KanbanTask } from "./KanbanBoard.types";
2
+ type KanbanBoardCardProps = {
3
+ task: KanbanTask;
4
+ showAssignee: boolean;
5
+ showDueDate: boolean;
6
+ showDueDateWarning: boolean;
7
+ chipVariant: "outlined" | "filled";
8
+ t: Required<KanbanBoardTranslation>;
9
+ onCardClick: (task: KanbanTask) => void;
10
+ /** True when this card is the drag overlay ghost — rendered without transform/listeners. */
11
+ isOverlay?: boolean;
12
+ };
13
+ export declare function KanbanBoardCard({ task, showAssignee, showDueDate, showDueDateWarning, chipVariant, t, onCardClick, isOverlay, }: KanbanBoardCardProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};