@thebuoyant-tsdev/mui-ts-library 3.22.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 (26) hide show
  1. package/README.de.md +4 -0
  2. package/README.md +4 -0
  3. package/dist/components/color-picker/ColorPicker.d.ts +1 -1
  4. package/dist/components/color-picker/ColorPicker.js +282 -266
  5. package/dist/components/color-picker/ColorPicker.types.d.ts +3 -1
  6. package/dist/components/color-picker/colorPickerClasses.d.ts +35 -0
  7. package/dist/components/color-picker/colorPickerClasses.js +15 -0
  8. package/dist/components/password-strength-meter/PasswordStrengthBar.d.ts +2 -1
  9. package/dist/components/password-strength-meter/PasswordStrengthBar.js +3 -1
  10. package/dist/components/password-strength-meter/PasswordStrengthMeter.js +258 -237
  11. package/dist/components/password-strength-meter/passwordStrengthMeterClasses.d.ts +40 -0
  12. package/dist/components/password-strength-meter/passwordStrengthMeterClasses.js +16 -0
  13. package/dist/components/rich-text-editor/RichTextEditorToolbar.js +115 -111
  14. package/dist/components/tag-selection/TagSelection.js +82 -79
  15. package/dist/components/tag-selection/TagSelectionAutocomplete.js +102 -98
  16. package/dist/components/tag-selection/TagSelectionChip.js +24 -21
  17. package/dist/components/tag-selection/TagSelectionSelectedTags.js +44 -38
  18. package/dist/components/tag-selection/tagSelectionClasses.d.ts +34 -0
  19. package/dist/components/tag-selection/tagSelectionClasses.js +15 -0
  20. package/dist/index.cjs +2 -2
  21. package/dist/index.d.cts +4 -0
  22. package/dist/index.d.ts +4 -0
  23. package/dist/index.js +31 -27
  24. package/dist/utils/muiTsClasses.d.ts +7 -0
  25. package/dist/utils/muiTsClasses.js +9 -0
  26. package/package.json +1 -1
@@ -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 };