@thebuoyant-tsdev/mui-ts-library 3.21.0 → 3.24.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 (38) hide show
  1. package/README.de.md +17 -6
  2. package/README.md +17 -6
  3. package/dist/components/chord-chart/ChordChart.d.ts +1 -1
  4. package/dist/components/chord-chart/ChordChart.js +66 -65
  5. package/dist/components/chord-chart/ChordChart.types.d.ts +7 -0
  6. package/dist/components/circle-packing-chart/CirclePackingChart.d.ts +1 -1
  7. package/dist/components/circle-packing-chart/CirclePackingChart.js +128 -128
  8. package/dist/components/circle-packing-chart/CirclePackingChart.types.d.ts +7 -0
  9. package/dist/components/color-picker/ColorPicker.d.ts +1 -1
  10. package/dist/components/color-picker/ColorPicker.js +282 -266
  11. package/dist/components/color-picker/ColorPicker.types.d.ts +3 -1
  12. package/dist/components/color-picker/colorPickerClasses.d.ts +35 -0
  13. package/dist/components/color-picker/colorPickerClasses.js +15 -0
  14. package/dist/components/password-strength-meter/PasswordStrengthBar.d.ts +2 -1
  15. package/dist/components/password-strength-meter/PasswordStrengthBar.js +3 -1
  16. package/dist/components/password-strength-meter/PasswordStrengthMeter.js +258 -237
  17. package/dist/components/password-strength-meter/passwordStrengthMeterClasses.d.ts +40 -0
  18. package/dist/components/password-strength-meter/passwordStrengthMeterClasses.js +16 -0
  19. package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.d.ts +1 -1
  20. package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.js +85 -84
  21. package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.types.d.ts +8 -0
  22. package/dist/components/rich-text-editor/RichTextEditorToolbar.js +115 -111
  23. package/dist/components/sunburst-chart/SunburstChart.d.ts +1 -1
  24. package/dist/components/sunburst-chart/SunburstChart.js +41 -40
  25. package/dist/components/sunburst-chart/SunburstChart.types.d.ts +7 -0
  26. package/dist/components/tag-selection/TagSelection.js +82 -79
  27. package/dist/components/tag-selection/TagSelectionAutocomplete.js +102 -98
  28. package/dist/components/tag-selection/TagSelectionChip.js +24 -21
  29. package/dist/components/tag-selection/TagSelectionSelectedTags.js +44 -38
  30. package/dist/components/tag-selection/tagSelectionClasses.d.ts +34 -0
  31. package/dist/components/tag-selection/tagSelectionClasses.js +15 -0
  32. package/dist/index.cjs +2 -2
  33. package/dist/index.d.cts +4 -0
  34. package/dist/index.d.ts +4 -0
  35. package/dist/index.js +31 -27
  36. package/dist/utils/muiTsClasses.d.ts +7 -0
  37. package/dist/utils/muiTsClasses.js +9 -0
  38. package/package.json +1 -1
@@ -1,10 +1,11 @@
1
- import { useState as e } from "react";
2
- import { Autocomplete as t, Box as n, Chip as r, IconButton as i, Stack as a, Switch as o, TextField as s, Tooltip as c, Typography as l } from "@mui/material";
3
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
4
- import p from "@mui/icons-material/Check";
1
+ import { tagSelectionClasses as e } from "./tagSelectionClasses.js";
2
+ import { useState as t } from "react";
3
+ import { Autocomplete as n, Box as r, Chip as i, IconButton as a, Stack as o, Switch as s, TextField as c, Tooltip as l, Typography as u } from "@mui/material";
4
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
5
+ import m from "@mui/icons-material/Check";
5
6
  import ee from "@mui/icons-material/Close";
6
7
  //#region src/components/tag-selection/TagSelectionAutocomplete.tsx
7
- var te = [
8
+ var h = [
8
9
  "default",
9
10
  "primary",
10
11
  "secondary",
@@ -12,7 +13,7 @@ var te = [
12
13
  "info",
13
14
  "success",
14
15
  "warning"
15
- ], m = [
16
+ ], g = [
16
17
  "#f44336",
17
18
  "#e91e63",
18
19
  "#9c27b0",
@@ -34,26 +35,26 @@ var te = [
34
35
  "#607d8b",
35
36
  "#000000"
36
37
  ];
37
- function h(e) {
38
+ function _(e) {
38
39
  return /^#[0-9A-Fa-f]{6}$/.test(e);
39
40
  }
40
- function g(e) {
41
+ function v(e) {
41
42
  let t = parseInt(e.slice(1, 3), 16), n = parseInt(e.slice(3, 5), 16), r = parseInt(e.slice(5, 7), 16);
42
43
  return (.299 * t + .587 * n + .114 * r) / 255 > .5 ? "#000000" : "#ffffff";
43
44
  }
44
- function _(e, t) {
45
+ function y(e, t) {
45
46
  let n = t.trim();
46
47
  if (!n) return e;
47
48
  let r = e.toLowerCase().indexOf(n.toLowerCase());
48
- return r === -1 ? e : /* @__PURE__ */ f(u, { children: [
49
+ return r === -1 ? e : /* @__PURE__ */ p(d, { children: [
49
50
  e.slice(0, r),
50
- /* @__PURE__ */ d("strong", { children: e.slice(r, r + n.length) }),
51
+ /* @__PURE__ */ f("strong", { children: e.slice(r, r + n.length) }),
51
52
  e.slice(r + n.length)
52
53
  ] });
53
54
  }
54
- function v({ color: e, selected: t, onClick: r }) {
55
- return /* @__PURE__ */ d(n, {
56
- onClick: r,
55
+ function b({ color: e, selected: t, onClick: n }) {
56
+ return /* @__PURE__ */ f(r, {
57
+ onClick: n,
57
58
  sx: {
58
59
  width: 24,
59
60
  height: 24,
@@ -74,15 +75,15 @@ function v({ color: e, selected: t, onClick: r }) {
74
75
  }
75
76
  });
76
77
  }
77
- function y({ value: e, onChange: t, disabled: r = !1 }) {
78
- return /* @__PURE__ */ d(s, {
78
+ function x({ value: e, onChange: t, disabled: n = !1 }) {
79
+ return /* @__PURE__ */ f(c, {
79
80
  size: "small",
80
81
  fullWidth: !0,
81
82
  value: e,
82
83
  onChange: (e) => t(e.target.value),
83
84
  placeholder: "#rrggbb",
84
- disabled: r,
85
- error: !r && e.length > 1 && !h(e),
85
+ disabled: n,
86
+ error: !n && e.length > 1 && !_(e),
86
87
  sx: {
87
88
  "& .MuiInputBase-root": { height: 28 },
88
89
  "& .MuiInputBase-input": {
@@ -92,22 +93,22 @@ function y({ value: e, onChange: t, disabled: r = !1 }) {
92
93
  fontFamily: "monospace"
93
94
  }
94
95
  },
95
- slotProps: { input: { startAdornment: /* @__PURE__ */ d(n, { sx: {
96
+ slotProps: { input: { startAdornment: /* @__PURE__ */ f(r, { sx: {
96
97
  width: 12,
97
98
  height: 12,
98
99
  borderRadius: .25,
99
100
  flexShrink: 0,
100
101
  mr: .5,
101
- backgroundColor: h(e) ? e : "action.disabledBackground",
102
+ backgroundColor: _(e) ? e : "action.disabledBackground",
102
103
  border: "1px solid",
103
104
  borderColor: "divider"
104
105
  } }) } }
105
106
  });
106
107
  }
107
- function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C, onTagSelect: w, onTagCreate: ne, inputSize: re = "medium", chipSize: T = "medium", chipVariant: ie = "filled", disabled: E = !1, loading: D = !1, isMaxReached: O = !1, allowCreate: k = !1, listboxMaxHeight: A, serverSideFilter: j = !1 }) {
108
- let [M, N] = e("default"), [P, F] = e(null), [I, L] = e(null), [R, z] = e(!0), [B, V] = e(!1), [H, U] = e(!1), [W, G] = e("#1976d2"), [K, q] = e("#ffffff"), J = E || O, Y = P !== null, ae = j ? b : b.filter((e) => e.label.toLowerCase().includes(x.trim().toLowerCase())), X = k && x.trim() !== "" && ae.length === 0, oe = H && !X, Z = Y ? R ? g(P) : I ?? "#000000" : void 0, Q = () => {
108
+ function S({ availableTags: S, searchValue: C, translation: w, onSearchChange: T, onTagSelect: te, onTagCreate: ne, inputSize: re = "medium", chipSize: E = "medium", chipVariant: ie = "filled", disabled: D = !1, loading: O = !1, isMaxReached: k = !1, allowCreate: ae = !1, listboxMaxHeight: A, serverSideFilter: j = !1 }) {
109
+ let [M, N] = t("default"), [P, F] = t(null), [I, L] = t(null), [R, z] = t(!0), [B, V] = t(!1), [H, U] = t(!1), [W, G] = t("#1976d2"), [K, q] = t("#ffffff"), J = D || k, Y = P !== null, oe = j ? S : S.filter((e) => e.label.toLowerCase().includes(C.trim().toLowerCase())), X = ae && C.trim() !== "" && oe.length === 0, se = H && !X, Z = Y ? R ? v(P) : I ?? "#000000" : void 0, Q = () => {
109
110
  if (J) return;
110
- let e = x.trim(), t = e.toLowerCase().replace(/\s+/g, "-");
111
+ let e = C.trim(), t = e.toLowerCase().replace(/\s+/g, "-");
111
112
  ne?.(Y && P ? {
112
113
  id: t,
113
114
  label: e,
@@ -120,45 +121,46 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
120
121
  label: e,
121
122
  selected: !0,
122
123
  color: M
123
- }), N("default"), F(null), L(null), z(!0), V(!1), C("");
124
- }, se = () => {
125
- C(""), N("default"), F(null), L(null), z(!0), V(!1);
126
- }, ce = (e) => {
127
- F(e), G(e), N("default");
124
+ }), N("default"), F(null), L(null), z(!0), V(!1), T("");
125
+ }, ce = () => {
126
+ T(""), N("default"), F(null), L(null), z(!0), V(!1);
128
127
  }, le = (e) => {
129
- G(e), h(e) && (F(e), N("default"));
128
+ F(e), G(e), N("default");
130
129
  }, ue = (e) => {
131
- L(e), q(e);
130
+ G(e), _(e) && (F(e), N("default"));
132
131
  }, de = (e) => {
133
- q(e), h(e) && L(e);
132
+ L(e), q(e);
134
133
  }, fe = (e) => {
134
+ q(e), _(e) && L(e);
135
+ }, pe = (e) => {
135
136
  if (z(e), e) L(null);
136
137
  else if (P) {
137
- let e = g(P);
138
+ let e = v(P);
138
139
  L(e), q(e);
139
140
  }
140
141
  }, $ = (e) => e.preventDefault();
141
- return /* @__PURE__ */ f(n, {
142
+ return /* @__PURE__ */ p(r, {
142
143
  sx: { mb: 2 },
143
- children: [/* @__PURE__ */ d(t, {
144
- options: b,
144
+ className: e.autocomplete,
145
+ children: [/* @__PURE__ */ f(n, {
146
+ options: S,
145
147
  filterOptions: j ? (e) => e : void 0,
146
148
  value: null,
147
- open: oe,
149
+ open: se,
148
150
  onOpen: () => {
149
151
  X || U(!0);
150
152
  },
151
153
  onClose: () => U(!1),
152
154
  size: re,
153
155
  disabled: J,
154
- loading: D,
156
+ loading: O,
155
157
  getOptionLabel: (e) => e.label,
156
- inputValue: x,
158
+ inputValue: C,
157
159
  onInputChange: (e, t, n) => {
158
- n === "input" && C(t);
160
+ n === "input" && T(t);
159
161
  },
160
162
  onChange: (e, t) => {
161
- t && w(t);
163
+ t && te(t);
162
164
  },
163
165
  slotProps: { listbox: { sx: {
164
166
  display: "flex",
@@ -170,11 +172,11 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
170
172
  overflowY: "auto"
171
173
  }
172
174
  } } },
173
- renderInput: (e) => /* @__PURE__ */ d(s, {
175
+ renderInput: (e) => /* @__PURE__ */ f(c, {
174
176
  ...e,
175
- label: S.autoCompleteLabel,
176
- placeholder: S.placeholder,
177
- helperText: O && !E ? S.maxTagsReachedText : void 0,
177
+ label: w.autoCompleteLabel,
178
+ placeholder: w.placeholder,
179
+ helperText: k && !D ? w.maxTagsReachedText : void 0,
178
180
  onKeyDown: (e) => {
179
181
  X && !J && e.key === "Enter" && (e.preventDefault(), Q());
180
182
  },
@@ -182,52 +184,54 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
182
184
  ...e.slotProps,
183
185
  input: {
184
186
  ...e.slotProps?.input,
185
- endAdornment: /* @__PURE__ */ f(u, { children: [X && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(i, {
187
+ endAdornment: /* @__PURE__ */ p(d, { children: [X && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(a, {
186
188
  size: "small",
187
189
  sx: { color: "success.main" },
188
190
  onMouseDown: $,
189
191
  onClick: Q,
190
192
  disabled: J,
191
- "aria-label": S.confirmCreateLabel,
192
- children: /* @__PURE__ */ d(p, { fontSize: "small" })
193
- }), /* @__PURE__ */ d(i, {
193
+ "aria-label": w.confirmCreateLabel,
194
+ children: /* @__PURE__ */ f(m, { fontSize: "small" })
195
+ }), /* @__PURE__ */ f(a, {
194
196
  size: "small",
195
197
  onMouseDown: $,
196
- onClick: se,
197
- "aria-label": S.cancelCreateLabel,
198
- children: /* @__PURE__ */ d(ee, { fontSize: "small" })
198
+ onClick: ce,
199
+ "aria-label": w.cancelCreateLabel,
200
+ children: /* @__PURE__ */ f(ee, { fontSize: "small" })
199
201
  })] }), e.slotProps?.input?.endAdornment] })
200
202
  }
201
203
  }
202
204
  }),
203
- renderOption: ({ key: e, ...t }, n) => {
204
- let i = !!(n.foregroundColor || n.backgroundColor);
205
- return /* @__PURE__ */ d("li", {
206
- ...t,
205
+ renderOption: ({ key: t, ...n }, r) => {
206
+ let a = !!(r.foregroundColor || r.backgroundColor);
207
+ return /* @__PURE__ */ f("li", {
208
+ ...n,
207
209
  style: {
208
210
  width: "auto",
209
211
  padding: 0,
210
212
  margin: 0
211
213
  },
212
- children: /* @__PURE__ */ d(r, {
213
- size: T,
214
+ children: /* @__PURE__ */ f(i, {
215
+ size: E,
214
216
  variant: ie,
215
- label: _(n.label, x),
216
- color: i ? void 0 : n.color ?? "default",
217
- sx: i ? {
218
- color: n.foregroundColor ?? "inherit",
219
- backgroundColor: n.backgroundColor ?? "transparent"
217
+ label: y(r.label, C),
218
+ color: a ? void 0 : r.color ?? "default",
219
+ className: e.option,
220
+ sx: a ? {
221
+ color: r.foregroundColor ?? "inherit",
222
+ backgroundColor: r.backgroundColor ?? "transparent"
220
223
  } : void 0
221
224
  })
222
- }, e);
225
+ }, t);
223
226
  },
224
227
  isOptionEqualToValue: (e, t) => e.id === t.id,
225
- noOptionsText: S.noAvailableTagsText,
226
- loadingText: S.loadingText
227
- }), X && /* @__PURE__ */ f(n, {
228
+ noOptionsText: w.noAvailableTagsText,
229
+ loadingText: w.loadingText
230
+ }), X && /* @__PURE__ */ p(r, {
228
231
  sx: { position: "relative" },
229
232
  onMouseDown: $,
230
- children: [/* @__PURE__ */ f(a, {
233
+ className: e.createPanel,
234
+ children: [/* @__PURE__ */ p(o, {
231
235
  direction: "row",
232
236
  sx: {
233
237
  mt: .5,
@@ -235,8 +239,8 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
235
239
  gap: .5,
236
240
  alignItems: "center"
237
241
  },
238
- children: [te.map((e) => /* @__PURE__ */ d(r, {
239
- size: T,
242
+ children: [h.map((e) => /* @__PURE__ */ f(i, {
243
+ size: E,
240
244
  color: e,
241
245
  label: e,
242
246
  variant: !Y && M === e ? "filled" : "outlined",
@@ -244,10 +248,10 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
244
248
  N(e), F(null), L(null), V(!1);
245
249
  },
246
250
  clickable: !0
247
- }, e)), /* @__PURE__ */ d(c, {
248
- title: S.colorPickerLabel,
249
- children: /* @__PURE__ */ d(r, {
250
- size: T,
251
+ }, e)), /* @__PURE__ */ f(l, {
252
+ title: w.colorPickerLabel,
253
+ children: /* @__PURE__ */ f(i, {
254
+ size: E,
251
255
  label: Y ? P : "···",
252
256
  variant: "outlined",
253
257
  onClick: () => {
@@ -274,7 +278,7 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
274
278
  clickable: !0
275
279
  })
276
280
  })]
277
- }), B && /* @__PURE__ */ d(n, {
281
+ }), B && /* @__PURE__ */ f(r, {
278
282
  sx: {
279
283
  position: "absolute",
280
284
  top: "calc(100% + 4px)",
@@ -288,13 +292,13 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
288
292
  p: 1.25,
289
293
  width: "max-content"
290
294
  },
291
- children: /* @__PURE__ */ f(n, {
295
+ children: /* @__PURE__ */ p(r, {
292
296
  sx: {
293
297
  display: "grid",
294
298
  gridTemplateColumns: "auto auto",
295
299
  gap: 2
296
300
  },
297
- children: [/* @__PURE__ */ f(n, { children: [/* @__PURE__ */ d(l, {
301
+ children: [/* @__PURE__ */ p(r, { children: [/* @__PURE__ */ f(u, {
298
302
  variant: "caption",
299
303
  sx: {
300
304
  fontWeight: 700,
@@ -302,29 +306,29 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
302
306
  display: "block",
303
307
  mb: .5
304
308
  },
305
- children: S.backgroundColorLabel
306
- }), /* @__PURE__ */ f(n, {
309
+ children: w.backgroundColorLabel
310
+ }), /* @__PURE__ */ p(r, {
307
311
  sx: {
308
312
  display: "grid",
309
313
  gridTemplateColumns: "repeat(5, 24px)",
310
314
  gap: .5
311
315
  },
312
- children: [m.map((e) => /* @__PURE__ */ d(v, {
316
+ children: [g.map((e) => /* @__PURE__ */ f(b, {
313
317
  color: e,
314
318
  selected: P === e,
315
- onClick: () => ce(e)
316
- }, e)), /* @__PURE__ */ d(n, {
319
+ onClick: () => le(e)
320
+ }, e)), /* @__PURE__ */ f(r, {
317
321
  sx: {
318
322
  gridColumn: "span 5",
319
323
  mt: .25
320
324
  },
321
- children: /* @__PURE__ */ d(y, {
325
+ children: /* @__PURE__ */ f(x, {
322
326
  value: W,
323
- onChange: le
327
+ onChange: ue
324
328
  })
325
329
  })]
326
- })] }), /* @__PURE__ */ f(n, { children: [
327
- /* @__PURE__ */ d(l, {
330
+ })] }), /* @__PURE__ */ p(r, { children: [
331
+ /* @__PURE__ */ f(u, {
328
332
  variant: "caption",
329
333
  sx: {
330
334
  fontWeight: 700,
@@ -332,9 +336,9 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
332
336
  display: "block",
333
337
  mb: .5
334
338
  },
335
- children: S.textColorLabel
339
+ children: w.textColorLabel
336
340
  }),
337
- /* @__PURE__ */ f(n, {
341
+ /* @__PURE__ */ p(r, {
338
342
  sx: {
339
343
  display: "grid",
340
344
  gridTemplateColumns: "repeat(5, 24px)",
@@ -343,23 +347,23 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
343
347
  pointerEvents: R ? "none" : "auto",
344
348
  transition: "opacity 0.15s"
345
349
  },
346
- children: [m.map((e) => /* @__PURE__ */ d(v, {
350
+ children: [g.map((e) => /* @__PURE__ */ f(b, {
347
351
  color: e,
348
352
  selected: I === e,
349
- onClick: () => ue(e)
350
- }, e)), /* @__PURE__ */ d(n, {
353
+ onClick: () => de(e)
354
+ }, e)), /* @__PURE__ */ f(r, {
351
355
  sx: {
352
356
  gridColumn: "span 5",
353
357
  mt: .25
354
358
  },
355
- children: /* @__PURE__ */ d(y, {
359
+ children: /* @__PURE__ */ f(x, {
356
360
  value: R ? Z ?? "#000000" : K,
357
- onChange: de,
361
+ onChange: fe,
358
362
  disabled: R
359
363
  })
360
364
  })]
361
365
  }),
362
- /* @__PURE__ */ f(a, {
366
+ /* @__PURE__ */ p(o, {
363
367
  direction: "row",
364
368
  sx: {
365
369
  width: "100%",
@@ -368,14 +372,14 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
368
372
  gap: .5,
369
373
  mt: .25
370
374
  },
371
- children: [/* @__PURE__ */ d(l, {
375
+ children: [/* @__PURE__ */ f(u, {
372
376
  variant: "caption",
373
377
  color: "text.secondary",
374
- children: S.autoTextColorLabel
375
- }), /* @__PURE__ */ d(o, {
378
+ children: w.autoTextColorLabel
379
+ }), /* @__PURE__ */ f(s, {
376
380
  size: "small",
377
381
  checked: R,
378
- onChange: (e) => fe(e.target.checked)
382
+ onChange: (e) => pe(e.target.checked)
379
383
  })]
380
384
  })
381
385
  ] })]
@@ -385,4 +389,4 @@ function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C
385
389
  });
386
390
  }
387
391
  //#endregion
388
- export { b as TagSelectionAutocomplete };
392
+ export { S as TagSelectionAutocomplete };
@@ -1,30 +1,33 @@
1
- import { Chip as e } from "@mui/material";
2
- import { jsx as t } from "react/jsx-runtime";
1
+ import { muiTsStateClasses as e } from "../../utils/muiTsClasses.js";
2
+ import { tagSelectionClasses as t } from "./tagSelectionClasses.js";
3
+ import { Chip as n } from "@mui/material";
4
+ import { jsx as r } from "react/jsx-runtime";
3
5
  //#region src/components/tag-selection/TagSelectionChip.tsx
4
- function n({ tag: n, onDelete: r, onClick: i, chipSize: a = "medium", chipVariant: o = "filled", disabled: s = !1 }) {
5
- let c = !!(n.foregroundColor || n.backgroundColor);
6
- return /* @__PURE__ */ t(e, {
7
- size: a,
8
- label: n.label,
9
- onDelete: r ? () => r(n) : void 0,
10
- onClick: i ? () => i(n) : void 0,
11
- clickable: !!i && !n.disabled && !s,
12
- disabled: s || n.disabled,
13
- variant: o,
14
- color: c ? void 0 : n.color ?? "default",
6
+ function i({ tag: i, onDelete: a, onClick: o, chipSize: s = "medium", chipVariant: c = "filled", disabled: l = !1 }) {
7
+ let u = !!(i.foregroundColor || i.backgroundColor), d = l || i.disabled;
8
+ return /* @__PURE__ */ r(n, {
9
+ size: s,
10
+ label: i.label,
11
+ onDelete: a ? () => a(i) : void 0,
12
+ onClick: o ? () => o(i) : void 0,
13
+ clickable: !!o && !i.disabled && !l,
14
+ disabled: d,
15
+ variant: c,
16
+ color: u ? void 0 : i.color ?? "default",
17
+ className: [t.chip, d && e.disabled].filter(Boolean).join(" "),
15
18
  sx: {
16
- ...c && {
17
- color: n.foregroundColor ?? "inherit",
18
- backgroundColor: n.backgroundColor ?? "transparent",
19
- borderColor: n.backgroundColor ?? void 0,
19
+ ...u && {
20
+ color: i.foregroundColor ?? "inherit",
21
+ backgroundColor: i.backgroundColor ?? "transparent",
22
+ borderColor: i.backgroundColor ?? void 0,
20
23
  "& .MuiChip-deleteIcon": {
21
- color: n.foregroundColor ? `${n.foregroundColor}99` : "inherit",
22
- "&:hover": { color: n.foregroundColor ?? "inherit" }
24
+ color: i.foregroundColor ? `${i.foregroundColor}99` : "inherit",
25
+ "&:hover": { color: i.foregroundColor ?? "inherit" }
23
26
  }
24
27
  },
25
- cursor: i && !n.disabled && !s ? "pointer" : "default"
28
+ cursor: o && !i.disabled && !d ? "pointer" : "default"
26
29
  }
27
30
  });
28
31
  }
29
32
  //#endregion
30
- export { n as TagSelectionChip };
33
+ export { i as TagSelectionChip };
@@ -1,57 +1,62 @@
1
- import { TagSelectionChip as e } from "./TagSelectionChip.js";
2
- import { useState as t } from "react";
3
- import { Box as n, Chip as r, Popover as i, Stack as a, Typography as o } from "@mui/material";
4
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
1
+ import { tagSelectionClasses as e } from "./tagSelectionClasses.js";
2
+ import { TagSelectionChip as t } from "./TagSelectionChip.js";
3
+ import { useState as n } from "react";
4
+ import { Box as r, Chip as i, Popover as a, Stack as o, Typography as s } from "@mui/material";
5
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
5
6
  //#region src/components/tag-selection/TagSelectionSelectedTags.tsx
6
- function u({ selectedTags: u, translation: d, onTagDelete: f, showSelectedTagsLabel: p, chipSize: m = "medium", chipVariant: h = "filled", disabled: g = !1, maxVisibleChips: _, popoverPlacement: v = "bottom" }) {
7
- let [y, b] = t(null), x = _ === void 0 ? u : u.slice(0, _), S = _ === void 0 ? [] : u.slice(_), C = !!y && S.length > 0, w = v === "top" ? {
7
+ function d({ selectedTags: d, translation: f, onTagDelete: p, showSelectedTagsLabel: m, chipSize: h = "medium", chipVariant: g = "filled", disabled: _ = !1, maxVisibleChips: v, popoverPlacement: y = "bottom" }) {
8
+ let [b, x] = n(null), S = v === void 0 ? d : d.slice(0, v), C = v === void 0 ? [] : d.slice(v), w = !!b && C.length > 0, T = y === "top" ? {
8
9
  vertical: "top",
9
10
  horizontal: "left"
10
11
  } : {
11
12
  vertical: "bottom",
12
13
  horizontal: "left"
13
- }, T = v === "top" ? {
14
+ }, E = y === "top" ? {
14
15
  vertical: "bottom",
15
16
  horizontal: "left"
16
17
  } : {
17
18
  vertical: "top",
18
19
  horizontal: "left"
19
20
  };
20
- return /* @__PURE__ */ l(n, {
21
+ return /* @__PURE__ */ u(r, {
21
22
  sx: { mb: 2 },
22
- children: [p && /* @__PURE__ */ c(o, {
23
+ className: e.selectedTags,
24
+ children: [m && /* @__PURE__ */ l(s, {
23
25
  variant: "subtitle2",
24
26
  gutterBottom: !0,
25
- children: d.selectedTagsLabel
26
- }), u.length === 0 ? /* @__PURE__ */ c(o, {
27
+ className: e.selectedTagsLabel,
28
+ children: f.selectedTagsLabel
29
+ }), d.length === 0 ? /* @__PURE__ */ l(s, {
27
30
  variant: "body2",
28
31
  color: "text.secondary",
29
- children: d.noSelectedTagsText
30
- }) : /* @__PURE__ */ l(a, {
32
+ children: f.noSelectedTagsText
33
+ }) : /* @__PURE__ */ u(o, {
31
34
  direction: "row",
32
35
  sx: {
33
36
  flexWrap: "wrap",
34
37
  gap: 1
35
38
  },
36
- children: [x.map((t) => /* @__PURE__ */ c(e, {
37
- tag: t,
38
- onDelete: f,
39
- chipSize: m,
40
- chipVariant: h,
41
- disabled: g
42
- }, t.id)), S.length > 0 && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(r, {
43
- size: m,
44
- label: `+${S.length}`,
39
+ className: e.chipsStack,
40
+ children: [S.map((e) => /* @__PURE__ */ l(t, {
41
+ tag: e,
42
+ onDelete: p,
43
+ chipSize: h,
44
+ chipVariant: g,
45
+ disabled: _
46
+ }, e.id)), C.length > 0 && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(i, {
47
+ size: h,
48
+ label: `+${C.length}`,
45
49
  variant: "outlined",
46
50
  clickable: !0,
47
- onClick: (e) => b(e.currentTarget)
48
- }), /* @__PURE__ */ c(i, {
49
- open: C,
50
- anchorEl: y,
51
- onClose: () => b(null),
52
- anchorOrigin: w,
53
- transformOrigin: T,
54
- children: /* @__PURE__ */ c(n, {
51
+ onClick: (e) => x(e.currentTarget),
52
+ className: e.overflowChip
53
+ }), /* @__PURE__ */ l(a, {
54
+ open: w,
55
+ anchorEl: b,
56
+ onClose: () => x(null),
57
+ anchorOrigin: T,
58
+ transformOrigin: E,
59
+ children: /* @__PURE__ */ l(r, {
55
60
  sx: {
56
61
  p: 1,
57
62
  display: "flex",
@@ -59,17 +64,18 @@ function u({ selectedTags: u, translation: d, onTagDelete: f, showSelectedTagsLa
59
64
  gap: .5,
60
65
  maxWidth: 320
61
66
  },
62
- children: S.map((t) => /* @__PURE__ */ c(e, {
63
- tag: t,
64
- onDelete: g ? void 0 : f,
65
- chipSize: m,
66
- chipVariant: h,
67
- disabled: g
68
- }, t.id))
67
+ className: e.overflowPopover,
68
+ children: C.map((e) => /* @__PURE__ */ l(t, {
69
+ tag: e,
70
+ onDelete: _ ? void 0 : p,
71
+ chipSize: h,
72
+ chipVariant: g,
73
+ disabled: _
74
+ }, e.id))
69
75
  })
70
76
  })] })]
71
77
  })]
72
78
  });
73
79
  }
74
80
  //#endregion
75
- export { u as TagSelectionSelectedTags };
81
+ export { d as TagSelectionSelectedTags };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * CSS class names for every named slot in the TagSelection component.
3
+ *
4
+ * Use these to style individual parts of the component without relying on
5
+ * MUI's internal class names, which can change between versions.
6
+ *
7
+ * @example
8
+ * ```css
9
+ * .MuiTsTagSelection-chip { border-radius: 4px; }
10
+ * .MuiTsTagSelection-chip.MuiTs-disabled { opacity: 0.5; }
11
+ * ```
12
+ */
13
+ export declare const tagSelectionClasses: {
14
+ /** The outermost wrapper element of the TagSelection component. Also receives `MuiTs-disabled` when `disabled={true}`. */
15
+ readonly root: "MuiTsTagSelection-root";
16
+ /** The area that shows the selected-tags section (label + chips). */
17
+ readonly selectedTags: "MuiTsTagSelection-selectedTags";
18
+ /** The label text above the selected chips ("Selected tags"). */
19
+ readonly selectedTagsLabel: "MuiTsTagSelection-selectedTagsLabel";
20
+ /** The flex row that wraps all selected chips. */
21
+ readonly chipsStack: "MuiTsTagSelection-chipsStack";
22
+ /** Each selected tag chip. Also receives `MuiTs-disabled` when the chip is disabled. */
23
+ readonly chip: "MuiTsTagSelection-chip";
24
+ /** The overflow "+N" chip shown when `maxVisibleChips` is exceeded. */
25
+ readonly overflowChip: "MuiTsTagSelection-overflowChip";
26
+ /** The content box inside the overflow popover. */
27
+ readonly overflowPopover: "MuiTsTagSelection-overflowPopover";
28
+ /** The autocomplete section (search input + dropdown). */
29
+ readonly autocomplete: "MuiTsTagSelection-autocomplete";
30
+ /** Each option chip rendered inside the autocomplete dropdown list. */
31
+ readonly option: "MuiTsTagSelection-option";
32
+ /** The create-tag panel (color row + palette) shown when `allowCreate={true}` and search has no match. */
33
+ readonly createPanel: "MuiTsTagSelection-createPanel";
34
+ };
@@ -0,0 +1,15 @@
1
+ //#region src/components/tag-selection/tagSelectionClasses.ts
2
+ var e = {
3
+ root: "MuiTsTagSelection-root",
4
+ selectedTags: "MuiTsTagSelection-selectedTags",
5
+ selectedTagsLabel: "MuiTsTagSelection-selectedTagsLabel",
6
+ chipsStack: "MuiTsTagSelection-chipsStack",
7
+ chip: "MuiTsTagSelection-chip",
8
+ overflowChip: "MuiTsTagSelection-overflowChip",
9
+ overflowPopover: "MuiTsTagSelection-overflowPopover",
10
+ autocomplete: "MuiTsTagSelection-autocomplete",
11
+ option: "MuiTsTagSelection-option",
12
+ createPanel: "MuiTsTagSelection-createPanel"
13
+ };
14
+ //#endregion
15
+ export { e as tagSelectionClasses };