@thebuoyant-tsdev/mui-ts-library 3.33.1 → 3.35.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.
@@ -13,11 +13,12 @@ type KanbanBoardCardDialogProps = {
13
13
  state: KanbanDialogState | null;
14
14
  columns: KanbanColumn[];
15
15
  t: Required<KanbanBoardTranslation>;
16
+ showSubtasks: boolean;
16
17
  onSave: (task: KanbanTask) => void;
17
18
  onDelete: (taskId: string) => void;
18
19
  onClose: () => void;
19
20
  /** Switch from edit to delete confirmation — handled in parent. */
20
21
  onRequestDelete: (task: KanbanTask) => void;
21
22
  };
22
- export declare function KanbanBoardCardDialog({ state, columns, t, onSave, onDelete, onClose, onRequestDelete }: KanbanBoardCardDialogProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function KanbanBoardCardDialog({ state, columns, t, showSubtasks, onSave, onDelete, onClose, onRequestDelete }: KanbanBoardCardDialogProps): import("react/jsx-runtime").JSX.Element;
23
24
  export {};
@@ -1,120 +1,216 @@
1
- import { Button as e, Dialog as t, DialogActions as n, DialogContent as r, DialogContentText as i, DialogTitle as a, MenuItem as o, Stack as s, TextField as c } from "@mui/material";
2
- import { useState as l } from "react";
3
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
4
- import p from "@mui/icons-material/Delete";
1
+ import { Box as e, Button as t, Checkbox as n, Dialog as r, DialogActions as i, DialogContent as a, DialogContentText as o, DialogTitle as s, FormControlLabel as c, IconButton as l, InputAdornment as u, MenuItem as d, Stack as f, TextField as p, Typography as m } from "@mui/material";
2
+ import { useState as h } from "react";
3
+ import g from "@mui/icons-material/Add";
4
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
5
+ import b from "@mui/icons-material/Close";
6
+ import x from "@mui/icons-material/Delete";
5
7
  //#region src/components/kanban-board/KanbanBoardCardDialog.tsx
6
- function m({ state: m, columns: h, t: g, onSave: _, onDelete: v, onClose: y, onRequestDelete: b }) {
7
- let x = m?.mode === "add", S = m?.mode === "edit", C = m?.mode === "delete", w = S ? m.task : null, T = C ? m.task : null, E = x ? m.columnId : null, [D, O] = l(() => S && w ? { ...w } : x && E ? {
8
+ function S({ state: S, columns: C, t: w, showSubtasks: T, onSave: E, onDelete: D, onClose: O, onRequestDelete: k }) {
9
+ let A = S?.mode === "add", j = S?.mode === "edit", M = S?.mode === "delete", N = j ? S.task : null, P = M ? S.task : null, F = A ? S.columnId : null, [I, L] = h(() => j && N ? { ...N } : A && F ? {
8
10
  id: "",
9
11
  title: "",
10
- status: E
12
+ status: F
11
13
  } : {
12
14
  id: "",
13
15
  title: "",
14
- status: h[0]?.id ?? ""
15
- });
16
- function k() {
17
- let e = D.title.trim();
18
- e && _({
19
- ...D,
16
+ status: C[0]?.id ?? ""
17
+ }), [R, z] = h("");
18
+ function B() {
19
+ let e = R.trim();
20
+ if (!e) return;
21
+ let t = {
22
+ id: crypto.randomUUID(),
23
+ title: e,
24
+ done: !1
25
+ };
26
+ L((e) => ({
27
+ ...e,
28
+ subtasks: [...e.subtasks ?? [], t]
29
+ })), z("");
30
+ }
31
+ function V(e) {
32
+ L((t) => ({
33
+ ...t,
34
+ subtasks: t.subtasks?.map((t) => t.id === e ? {
35
+ ...t,
36
+ done: !t.done
37
+ } : t)
38
+ }));
39
+ }
40
+ function H(e) {
41
+ L((t) => ({
42
+ ...t,
43
+ subtasks: t.subtasks?.filter((t) => t.id !== e)
44
+ }));
45
+ }
46
+ function U() {
47
+ let e = I.title.trim();
48
+ e && E({
49
+ ...I,
20
50
  title: e,
21
- id: S ? D.id : crypto.randomUUID()
51
+ id: j ? I.id : crypto.randomUUID()
22
52
  });
23
53
  }
24
- function A(e, t) {
25
- O((n) => ({
54
+ function W(e, t) {
55
+ L((n) => ({
26
56
  ...n,
27
57
  [e]: t
28
58
  }));
29
59
  }
30
- let j = x ? g.dialogAddTitle : S ? g.dialogEditTitle : g.dialogDeleteTitle;
31
- return /* @__PURE__ */ f(t, {
32
- open: !!m,
33
- onClose: y,
60
+ let G = A ? w.dialogAddTitle : j ? w.dialogEditTitle : w.dialogDeleteTitle;
61
+ return /* @__PURE__ */ y(r, {
62
+ open: !!S,
63
+ onClose: O,
34
64
  maxWidth: "xs",
35
65
  fullWidth: !0,
36
- children: [/* @__PURE__ */ d(a, { children: j }), C && T ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(r, { children: /* @__PURE__ */ d(i, { children: g.dialogDeleteConfirm.replace("{title}", T.title) }) }), /* @__PURE__ */ f(n, { children: [/* @__PURE__ */ d(e, {
37
- onClick: y,
38
- children: g.dialogCancel
39
- }), /* @__PURE__ */ d(e, {
66
+ children: [/* @__PURE__ */ v(s, { children: G }), M && P ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(a, { children: /* @__PURE__ */ v(o, { children: w.dialogDeleteConfirm.replace("{title}", P.title) }) }), /* @__PURE__ */ y(i, { children: [/* @__PURE__ */ v(t, {
67
+ onClick: O,
68
+ children: w.dialogCancel
69
+ }), /* @__PURE__ */ v(t, {
40
70
  color: "error",
41
- startIcon: /* @__PURE__ */ d(p, {}),
42
- onClick: () => v(T.id),
43
- children: g.dialogDelete
44
- })] })] }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(r, { children: /* @__PURE__ */ f(s, {
71
+ startIcon: /* @__PURE__ */ v(x, {}),
72
+ onClick: () => D(P.id),
73
+ children: w.dialogDelete
74
+ })] })] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(a, { children: /* @__PURE__ */ y(f, {
45
75
  spacing: 2,
46
76
  sx: { pt: .5 },
47
77
  children: [
48
- /* @__PURE__ */ d(c, {
49
- label: g.dialogFieldTitle,
50
- value: D.title,
51
- onChange: (e) => A("title", e.target.value),
78
+ /* @__PURE__ */ v(p, {
79
+ label: w.dialogFieldTitle,
80
+ value: I.title,
81
+ onChange: (e) => W("title", e.target.value),
52
82
  required: !0,
53
83
  fullWidth: !0,
54
84
  size: "small",
55
85
  autoFocus: !0,
56
- onKeyDown: (e) => e.key === "Enter" && k()
86
+ onKeyDown: (e) => e.key === "Enter" && U()
57
87
  }),
58
- /* @__PURE__ */ d(c, {
59
- label: g.dialogFieldDescription,
60
- value: D.description ?? "",
61
- onChange: (e) => A("description", e.target.value || void 0),
88
+ /* @__PURE__ */ v(p, {
89
+ label: w.dialogFieldDescription,
90
+ value: I.description ?? "",
91
+ onChange: (e) => W("description", e.target.value || void 0),
62
92
  fullWidth: !0,
63
93
  size: "small",
64
94
  multiline: !0,
65
95
  rows: 3
66
96
  }),
67
- /* @__PURE__ */ d(c, {
68
- label: g.dialogFieldAssignee,
69
- value: D.assignee ?? "",
70
- onChange: (e) => A("assignee", e.target.value || void 0),
97
+ /* @__PURE__ */ v(p, {
98
+ label: w.dialogFieldAssignee,
99
+ value: I.assignee ?? "",
100
+ onChange: (e) => W("assignee", e.target.value || void 0),
71
101
  fullWidth: !0,
72
102
  size: "small"
73
103
  }),
74
- /* @__PURE__ */ d(c, {
75
- label: g.dialogFieldDueDate,
104
+ /* @__PURE__ */ v(p, {
105
+ label: w.dialogFieldDueDate,
76
106
  type: "date",
77
- value: D.dueDate ? D.dueDate.toISOString().split("T")[0] : "",
78
- onChange: (e) => A("dueDate", e.target.value ? /* @__PURE__ */ new Date(e.target.value + "T00:00:00") : void 0),
107
+ value: I.dueDate ? I.dueDate.toISOString().split("T")[0] : "",
108
+ onChange: (e) => W("dueDate", e.target.value ? /* @__PURE__ */ new Date(e.target.value + "T00:00:00") : void 0),
79
109
  fullWidth: !0,
80
110
  size: "small",
81
111
  slotProps: { inputLabel: { shrink: !0 } }
82
112
  }),
83
- /* @__PURE__ */ d(c, {
113
+ /* @__PURE__ */ v(p, {
84
114
  select: !0,
85
- label: g.dialogFieldStatus,
86
- value: D.status,
87
- onChange: (e) => A("status", e.target.value),
115
+ label: w.dialogFieldStatus,
116
+ value: I.status,
117
+ onChange: (e) => W("status", e.target.value),
88
118
  fullWidth: !0,
89
119
  size: "small",
90
- children: h.map((e) => /* @__PURE__ */ d(o, {
120
+ children: C.map((e) => /* @__PURE__ */ v(d, {
91
121
  value: e.id,
92
122
  children: e.label
93
123
  }, e.id))
94
- })
124
+ }),
125
+ T && /* @__PURE__ */ y(e, { children: [
126
+ /* @__PURE__ */ v(m, {
127
+ variant: "caption",
128
+ color: "text.secondary",
129
+ sx: {
130
+ display: "block",
131
+ mb: .5
132
+ },
133
+ children: w.dialogFieldSubtasks
134
+ }),
135
+ /* @__PURE__ */ v(f, {
136
+ spacing: .25,
137
+ children: (I.subtasks ?? []).map((t) => /* @__PURE__ */ y(e, {
138
+ sx: {
139
+ display: "flex",
140
+ alignItems: "center"
141
+ },
142
+ children: [/* @__PURE__ */ v(c, {
143
+ sx: {
144
+ flex: 1,
145
+ m: 0
146
+ },
147
+ control: /* @__PURE__ */ v(n, {
148
+ size: "small",
149
+ checked: t.done,
150
+ onChange: () => V(t.id),
151
+ sx: { p: .5 }
152
+ }),
153
+ label: /* @__PURE__ */ v(m, {
154
+ variant: "body2",
155
+ sx: {
156
+ textDecoration: t.done ? "line-through" : "none",
157
+ color: t.done ? "text.disabled" : "text.primary"
158
+ },
159
+ children: t.title
160
+ })
161
+ }), /* @__PURE__ */ v(l, {
162
+ size: "small",
163
+ onClick: () => H(t.id),
164
+ "aria-label": `Remove ${t.title}`,
165
+ children: /* @__PURE__ */ v(b, { fontSize: "small" })
166
+ })]
167
+ }, t.id))
168
+ }),
169
+ /* @__PURE__ */ v(p, {
170
+ size: "small",
171
+ placeholder: w.dialogSubtaskAdd,
172
+ value: R,
173
+ onChange: (e) => z(e.target.value),
174
+ onKeyDown: (e) => {
175
+ e.key === "Enter" && (e.preventDefault(), B());
176
+ },
177
+ fullWidth: !0,
178
+ sx: { mt: 1 },
179
+ slotProps: { input: { endAdornment: /* @__PURE__ */ v(u, {
180
+ position: "end",
181
+ children: /* @__PURE__ */ v(l, {
182
+ size: "small",
183
+ onClick: B,
184
+ disabled: !R.trim(),
185
+ "aria-label": w.dialogSubtaskAdd,
186
+ children: /* @__PURE__ */ v(g, { fontSize: "small" })
187
+ })
188
+ }) } }
189
+ })
190
+ ] })
95
191
  ]
96
- }) }), /* @__PURE__ */ f(n, {
97
- sx: { justifyContent: S ? "space-between" : "flex-end" },
98
- children: [S && w && /* @__PURE__ */ d(e, {
192
+ }) }), /* @__PURE__ */ y(i, {
193
+ sx: { justifyContent: j ? "space-between" : "flex-end" },
194
+ children: [j && N && /* @__PURE__ */ v(t, {
99
195
  color: "error",
100
- startIcon: /* @__PURE__ */ d(p, {}),
101
- onClick: () => b(w),
102
- children: g.dialogDelete
103
- }), /* @__PURE__ */ f(s, {
196
+ startIcon: /* @__PURE__ */ v(x, {}),
197
+ onClick: () => k(N),
198
+ children: w.dialogDelete
199
+ }), /* @__PURE__ */ y(f, {
104
200
  direction: "row",
105
201
  spacing: 1,
106
- children: [/* @__PURE__ */ d(e, {
107
- onClick: y,
108
- children: g.dialogCancel
109
- }), /* @__PURE__ */ d(e, {
202
+ children: [/* @__PURE__ */ v(t, {
203
+ onClick: O,
204
+ children: w.dialogCancel
205
+ }), /* @__PURE__ */ v(t, {
110
206
  variant: "contained",
111
- onClick: k,
112
- disabled: !D.title.trim(),
113
- children: g.dialogSave
207
+ onClick: U,
208
+ disabled: !I.title.trim(),
209
+ children: w.dialogSave
114
210
  })]
115
211
  })]
116
212
  })] })]
117
213
  });
118
214
  }
119
215
  //#endregion
120
- export { m as KanbanBoardCardDialog };
216
+ export { S as KanbanBoardCardDialog };
@@ -8,11 +8,12 @@ type KanbanBoardColumnProps = {
8
8
  showAssignee: boolean;
9
9
  showDueDate: boolean;
10
10
  showDueDateWarning: boolean;
11
+ showSubtasks: boolean;
11
12
  chipVariant: "outlined" | "filled";
12
13
  t: Required<KanbanBoardTranslation>;
13
14
  enableBuiltinDialogs: boolean;
14
15
  onCardClick: (task: KanbanTask) => void;
15
16
  onAddClick: (columnId: string) => void;
16
17
  };
17
- export declare function KanbanBoardColumn({ column, tasks, totalCount, showPriority, showAssignee, showDueDate, showDueDateWarning, chipVariant, t, enableBuiltinDialogs, onCardClick, onAddClick, }: KanbanBoardColumnProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function KanbanBoardColumn({ column, tasks, totalCount, showPriority, showAssignee, showDueDate, showDueDateWarning, showSubtasks, chipVariant, t, enableBuiltinDialogs, onCardClick, onAddClick, }: KanbanBoardColumnProps): import("react/jsx-runtime").JSX.Element;
18
19
  export {};
@@ -3,12 +3,12 @@ import { KanbanBoardCard as t } from "./KanbanBoardCard.js";
3
3
  import { useDroppable as n } from "@dnd-kit/core";
4
4
  import { SortableContext as r, verticalListSortingStrategy as i } from "@dnd-kit/sortable";
5
5
  import { Box as a, Button as o, Chip as s, Typography as c } from "@mui/material";
6
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
7
- import d from "@mui/icons-material/Add";
6
+ import l from "@mui/icons-material/Add";
7
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
8
  //#region src/components/kanban-board/KanbanBoardColumn.tsx
9
- function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee: g, showDueDate: _, showDueDateWarning: v, chipVariant: y, t: b, enableBuiltinDialogs: x, onCardClick: S, onAddClick: C }) {
10
- let { setNodeRef: w, isOver: T } = n({ id: f.id }), E = f.wipLimit !== void 0 && m > f.wipLimit, D = f.wipLimit === void 0 ? `${p.length}` : `${p.length} / ${f.wipLimit}`, O = f.color ?? "primary.main";
11
- return /* @__PURE__ */ u(a, {
9
+ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee: g, showDueDate: _, showDueDateWarning: v, showSubtasks: y, chipVariant: b, t: x, enableBuiltinDialogs: S, onCardClick: C, onAddClick: w }) {
10
+ let { setNodeRef: T, isOver: E } = n({ id: f.id }), D = f.wipLimit !== void 0 && m > f.wipLimit, O = f.wipLimit === void 0 ? `${p.length}` : `${p.length} / ${f.wipLimit}`, k = f.color ?? "primary.main";
11
+ return /* @__PURE__ */ d(a, {
12
12
  className: e.column,
13
13
  sx: {
14
14
  display: "flex",
@@ -23,7 +23,7 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
23
23
  borderColor: "divider"
24
24
  },
25
25
  children: [
26
- /* @__PURE__ */ u(a, {
26
+ /* @__PURE__ */ d(a, {
27
27
  className: e.columnHeader,
28
28
  sx: {
29
29
  px: 2,
@@ -36,7 +36,7 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
36
36
  borderTop: `3px solid ${f.color ?? "transparent"}`,
37
37
  bgcolor: (e) => e.palette.mode === "dark" ? "grey.800" : "grey.300"
38
38
  },
39
- children: [/* @__PURE__ */ l(c, {
39
+ children: [/* @__PURE__ */ u(c, {
40
40
  className: e.columnTitle,
41
41
  variant: "subtitle2",
42
42
  sx: {
@@ -44,15 +44,15 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
44
44
  fontWeight: 700
45
45
  },
46
46
  children: f.label
47
- }), /* @__PURE__ */ l(s, {
47
+ }), /* @__PURE__ */ u(s, {
48
48
  className: e.columnCount,
49
- label: D,
49
+ label: O,
50
50
  size: "small",
51
- color: E ? "error" : "default",
51
+ color: D ? "error" : "default",
52
52
  sx: {
53
53
  height: 20,
54
54
  fontSize: "0.7rem",
55
- ...!E && f.color && {
55
+ ...!D && f.color && {
56
56
  bgcolor: f.color,
57
57
  color: "#fff"
58
58
  }
@@ -60,11 +60,11 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
60
60
  "aria-label": `${p.length} cards${f.wipLimit ? ` of ${f.wipLimit} limit` : ""}${p.length === m ? "" : ` (${m} total)`}`
61
61
  })]
62
62
  }),
63
- /* @__PURE__ */ l(r, {
63
+ /* @__PURE__ */ u(r, {
64
64
  items: p.map((e) => e.id),
65
65
  strategy: i,
66
- children: /* @__PURE__ */ u(a, {
67
- ref: w,
66
+ children: /* @__PURE__ */ d(a, {
67
+ ref: T,
68
68
  className: e.columnBody,
69
69
  sx: {
70
70
  flex: 1,
@@ -73,10 +73,10 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
73
73
  "&::-webkit-scrollbar": { display: "none" },
74
74
  p: 1,
75
75
  minHeight: 80,
76
- bgcolor: (e) => T ? e.palette.action.selected : e.palette.mode === "dark" ? e.palette.grey[900] : e.palette.grey[100],
76
+ bgcolor: (e) => E ? e.palette.action.selected : e.palette.mode === "dark" ? e.palette.grey[900] : e.palette.grey[100],
77
77
  transition: "background-color 0.15s"
78
78
  },
79
- children: [p.length === 0 && !T && /* @__PURE__ */ l(c, {
79
+ children: [p.length === 0 && !E && /* @__PURE__ */ u(c, {
80
80
  variant: "caption",
81
81
  color: "text.disabled",
82
82
  sx: {
@@ -84,36 +84,38 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
84
84
  textAlign: "center",
85
85
  mt: 2
86
86
  },
87
- children: b.noCardsLabel
88
- }), p.map((e) => /* @__PURE__ */ l(t, {
87
+ children: x.noCardsLabel
88
+ }), p.map((e) => /* @__PURE__ */ u(t, {
89
89
  task: e,
90
90
  showPriority: h,
91
91
  showAssignee: g,
92
92
  showDueDate: _,
93
93
  showDueDateWarning: v,
94
- chipVariant: y,
95
- t: b,
96
- onCardClick: S
94
+ showSubtasks: y,
95
+ enableBuiltinDialogs: S,
96
+ chipVariant: b,
97
+ t: x,
98
+ onCardClick: C
97
99
  }, e.id))]
98
100
  })
99
101
  }),
100
- x && /* @__PURE__ */ l(a, {
102
+ S && /* @__PURE__ */ u(a, {
101
103
  sx: {
102
104
  p: 1,
103
105
  borderTop: "1px solid",
104
106
  borderColor: "divider"
105
107
  },
106
- children: /* @__PURE__ */ l(o, {
108
+ children: /* @__PURE__ */ u(o, {
107
109
  className: e.addButton,
108
- startIcon: /* @__PURE__ */ l(d, {}),
110
+ startIcon: /* @__PURE__ */ u(l, {}),
109
111
  size: "small",
110
112
  fullWidth: !0,
111
- onClick: () => C(f.id),
113
+ onClick: () => w(f.id),
112
114
  sx: {
113
115
  justifyContent: "flex-start",
114
- color: O,
116
+ color: k,
115
117
  border: "1px dashed",
116
- borderColor: O,
118
+ borderColor: k,
117
119
  borderRadius: 1,
118
120
  py: .75,
119
121
  fontWeight: 600,
@@ -123,7 +125,7 @@ function f({ column: f, tasks: p, totalCount: m, showPriority: h, showAssignee:
123
125
  borderStyle: "dashed"
124
126
  }
125
127
  },
126
- children: b.addCardLabel
128
+ children: x.addCardLabel
127
129
  })
128
130
  })
129
131
  ]
@@ -46,4 +46,12 @@ export declare const kanbanBoardClasses: {
46
46
  readonly cardPriorityDot: "MuiTsKanbanBoard-cardPriorityDot";
47
47
  /** The "+ Add card" button at the bottom of each column. */
48
48
  readonly addButton: "MuiTsKanbanBoard-addButton";
49
+ /** The wrapper Box around the built-in search field (`showSearchField={true}`). */
50
+ readonly searchFieldWrapper: "MuiTsKanbanBoard-searchFieldWrapper";
51
+ /** The built-in search TextField (`showSearchField={true}`). */
52
+ readonly searchField: "MuiTsKanbanBoard-searchField";
53
+ /** The subtask progress row at the bottom of a card (bar + "N / M ✓" label). */
54
+ readonly cardSubtasks: "MuiTsKanbanBoard-cardSubtasks";
55
+ /** The LinearProgress bar inside the subtask row. */
56
+ readonly cardSubtasksBar: "MuiTsKanbanBoard-cardSubtasksBar";
49
57
  };
@@ -13,7 +13,11 @@ var e = {
13
13
  cardAssignee: "MuiTsKanbanBoard-cardAssignee",
14
14
  cardDueDate: "MuiTsKanbanBoard-cardDueDate",
15
15
  cardPriorityDot: "MuiTsKanbanBoard-cardPriorityDot",
16
- addButton: "MuiTsKanbanBoard-addButton"
16
+ addButton: "MuiTsKanbanBoard-addButton",
17
+ searchFieldWrapper: "MuiTsKanbanBoard-searchFieldWrapper",
18
+ searchField: "MuiTsKanbanBoard-searchField",
19
+ cardSubtasks: "MuiTsKanbanBoard-cardSubtasks",
20
+ cardSubtasksBar: "MuiTsKanbanBoard-cardSubtasksBar"
17
21
  };
18
22
  //#endregion
19
23
  export { e as kanbanBoardClasses };
@@ -1,11 +1,11 @@
1
1
  import { EMOJI_CATEGORIES as e } from "./util/emojis.js";
2
- import { Box as t, InputAdornment as n, Popover as r, TextField as i, Typography as a } from "@mui/material";
3
- import { useMemo as o, useState as s } from "react";
4
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
- import u from "@mui/icons-material/Search";
2
+ import t from "@mui/icons-material/Search";
3
+ import { Box as n, InputAdornment as r, Popover as i, TextField as a, Typography as o } from "@mui/material";
4
+ import { useMemo as s, useState as c } from "react";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
6
  //#region src/components/rich-text-editor/RichTextEditorEmojiPicker.tsx
7
7
  function d({ anchorEl: d, open: f, onClose: p, onSelect: m, translation: h }) {
8
- let [g, _] = s(""), v = o(() => {
8
+ let [g, _] = c(""), v = s(() => {
9
9
  let t = g.trim().toLowerCase();
10
10
  return t ? e.map((e) => ({
11
11
  ...e,
@@ -18,7 +18,7 @@ function d({ anchorEl: d, open: f, onClose: p, onSelect: m, translation: h }) {
18
18
  function b() {
19
19
  p(), _("");
20
20
  }
21
- return /* @__PURE__ */ l(r, {
21
+ return /* @__PURE__ */ u(i, {
22
22
  open: f,
23
23
  anchorEl: d,
24
24
  onClose: b,
@@ -36,32 +36,32 @@ function d({ anchorEl: d, open: f, onClose: p, onSelect: m, translation: h }) {
36
36
  display: "flex",
37
37
  flexDirection: "column"
38
38
  } } },
39
- children: [/* @__PURE__ */ c(t, {
39
+ children: [/* @__PURE__ */ l(n, {
40
40
  sx: {
41
41
  p: 1,
42
42
  borderBottom: 1,
43
43
  borderColor: "divider"
44
44
  },
45
- children: /* @__PURE__ */ c(i, {
45
+ children: /* @__PURE__ */ l(a, {
46
46
  autoFocus: !0,
47
47
  fullWidth: !0,
48
48
  size: "small",
49
49
  placeholder: h.emojiSearchPlaceholder,
50
50
  value: g,
51
51
  onChange: (e) => _(e.target.value),
52
- slotProps: { input: { startAdornment: /* @__PURE__ */ c(n, {
52
+ slotProps: { input: { startAdornment: /* @__PURE__ */ l(r, {
53
53
  position: "start",
54
- children: /* @__PURE__ */ c(u, { fontSize: "small" })
54
+ children: /* @__PURE__ */ l(t, { fontSize: "small" })
55
55
  }) } }
56
56
  })
57
- }), /* @__PURE__ */ l(t, {
57
+ }), /* @__PURE__ */ u(n, {
58
58
  sx: {
59
59
  overflowY: "auto",
60
60
  flex: 1,
61
61
  px: 1,
62
62
  pb: 1
63
63
  },
64
- children: [v.map((e) => /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(a, {
64
+ children: [v.map((e) => /* @__PURE__ */ u(n, { children: [/* @__PURE__ */ l(o, {
65
65
  variant: "caption",
66
66
  sx: {
67
67
  display: "block",
@@ -71,13 +71,13 @@ function d({ anchorEl: d, open: f, onClose: p, onSelect: m, translation: h }) {
71
71
  px: .5
72
72
  },
73
73
  children: e.label
74
- }), /* @__PURE__ */ c(t, {
74
+ }), /* @__PURE__ */ l(n, {
75
75
  sx: {
76
76
  display: "flex",
77
77
  flexWrap: "wrap",
78
78
  gap: .25
79
79
  },
80
- children: e.emojis.map((e) => /* @__PURE__ */ c(t, {
80
+ children: e.emojis.map((e) => /* @__PURE__ */ l(n, {
81
81
  component: "button",
82
82
  title: e.name,
83
83
  "aria-label": e.name,
@@ -94,7 +94,7 @@ function d({ anchorEl: d, open: f, onClose: p, onSelect: m, translation: h }) {
94
94
  },
95
95
  children: e.emoji
96
96
  }, e.emoji))
97
- })] }, e.label)), v.length === 0 && /* @__PURE__ */ c(a, {
97
+ })] }, e.label)), v.length === 0 && /* @__PURE__ */ l(o, {
98
98
  variant: "body2",
99
99
  color: "text.secondary",
100
100
  sx: {