@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.
- package/README.de.md +4 -0
- package/README.md +4 -0
- package/dist/components/color-picker/ColorPicker.d.ts +1 -1
- package/dist/components/color-picker/ColorPicker.js +282 -266
- package/dist/components/color-picker/ColorPicker.types.d.ts +3 -1
- package/dist/components/color-picker/colorPickerClasses.d.ts +35 -0
- package/dist/components/color-picker/colorPickerClasses.js +15 -0
- package/dist/components/password-strength-meter/PasswordStrengthBar.d.ts +2 -1
- package/dist/components/password-strength-meter/PasswordStrengthBar.js +3 -1
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +258 -237
- package/dist/components/password-strength-meter/passwordStrengthMeterClasses.d.ts +40 -0
- package/dist/components/password-strength-meter/passwordStrengthMeterClasses.js +16 -0
- package/dist/components/rich-text-editor/RichTextEditorToolbar.js +115 -111
- package/dist/components/tag-selection/TagSelection.js +82 -79
- package/dist/components/tag-selection/TagSelectionAutocomplete.js +102 -98
- package/dist/components/tag-selection/TagSelectionChip.js +24 -21
- package/dist/components/tag-selection/TagSelectionSelectedTags.js +44 -38
- package/dist/components/tag-selection/tagSelectionClasses.d.ts +34 -0
- package/dist/components/tag-selection/tagSelectionClasses.js +15 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +31 -27
- package/dist/utils/muiTsClasses.d.ts +7 -0
- package/dist/utils/muiTsClasses.js +9 -0
- package/package.json +1 -1
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
|
5
|
-
let
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
size:
|
|
8
|
-
label:
|
|
9
|
-
onDelete:
|
|
10
|
-
onClick:
|
|
11
|
-
clickable: !!
|
|
12
|
-
disabled:
|
|
13
|
-
variant:
|
|
14
|
-
color:
|
|
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
|
-
...
|
|
17
|
-
color:
|
|
18
|
-
backgroundColor:
|
|
19
|
-
borderColor:
|
|
19
|
+
...u && {
|
|
20
|
+
color: i.foregroundColor ?? "inherit",
|
|
21
|
+
backgroundColor: i.backgroundColor ?? "transparent",
|
|
22
|
+
borderColor: i.backgroundColor ?? void 0,
|
|
20
23
|
"& .MuiChip-deleteIcon": {
|
|
21
|
-
color:
|
|
22
|
-
"&:hover": { color:
|
|
24
|
+
color: i.foregroundColor ? `${i.foregroundColor}99` : "inherit",
|
|
25
|
+
"&:hover": { color: i.foregroundColor ?? "inherit" }
|
|
23
26
|
}
|
|
24
27
|
},
|
|
25
|
-
cursor:
|
|
28
|
+
cursor: o && !i.disabled && !d ? "pointer" : "default"
|
|
26
29
|
}
|
|
27
30
|
});
|
|
28
31
|
}
|
|
29
32
|
//#endregion
|
|
30
|
-
export {
|
|
33
|
+
export { i as TagSelectionChip };
|
|
@@ -1,57 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
7
|
-
let [
|
|
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
|
-
},
|
|
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__ */
|
|
21
|
+
return /* @__PURE__ */ u(r, {
|
|
21
22
|
sx: { mb: 2 },
|
|
22
|
-
|
|
23
|
+
className: e.selectedTags,
|
|
24
|
+
children: [m && /* @__PURE__ */ l(s, {
|
|
23
25
|
variant: "subtitle2",
|
|
24
26
|
gutterBottom: !0,
|
|
25
|
-
|
|
26
|
-
|
|
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:
|
|
30
|
-
}) : /* @__PURE__ */
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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) =>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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 {
|
|
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 };
|