@thebuoyant-tsdev/mui-ts-library 3.22.0 → 3.25.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.
- package/README.de.md +30 -0
- package/README.md +30 -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/gantt-chart/GanttTaskPanel.js +187 -160
- package/dist/components/json-editor/JsonEditor.d.ts +1 -1
- package/dist/components/json-editor/JsonEditor.js +32 -31
- package/dist/components/json-editor/JsonEditor.types.d.ts +5 -0
- package/dist/components/json-editor/JsonEditor.types.js +3 -0
- package/dist/components/json-editor/JsonEditorToolbar.d.ts +2 -1
- package/dist/components/json-editor/JsonEditorToolbar.js +78 -61
- 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 +2 -1
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { muiTsStateClasses as e } from "../../utils/muiTsClasses.js";
|
|
2
|
+
import { passwordStrengthMeterClasses as t } from "./passwordStrengthMeterClasses.js";
|
|
3
|
+
import { useTimedFlag as n } from "../shared/useTimedFlag.js";
|
|
4
|
+
import { scorePassword as r } from "./util/password-strength.util.js";
|
|
5
|
+
import { PasswordStrengthBar as i } from "./PasswordStrengthBar.js";
|
|
6
|
+
import { DEFAULT_CHECK_COLORS as a, DEFAULT_METER_COLORS as o, DEFAULT_PASSWORD_TRANSLATIONS as s } from "./PasswordStrengthMeter.types.js";
|
|
7
|
+
import { useId as ee, useMemo as te, useState as c } from "react";
|
|
8
|
+
import { Box as ne, Button as re, FormControl as l, FormHelperText as u, IconButton as d, InputAdornment as f, InputLabel as p, OutlinedInput as m, Stack as h, Tooltip as g, Typography as _ } from "@mui/material";
|
|
7
9
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
10
|
+
import ie from "@mui/icons-material/ContentCopy";
|
|
11
|
+
import ae from "@mui/icons-material/Check";
|
|
12
|
+
import oe from "@mui/icons-material/AutoFixHigh";
|
|
11
13
|
import b from "@mui/icons-material/CheckCircleOutlined";
|
|
12
14
|
import x from "@mui/icons-material/ErrorOutlined";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
+
import se from "@mui/icons-material/CheckCircle";
|
|
16
|
+
import ce from "@mui/icons-material/Cancel";
|
|
15
17
|
import S from "@mui/icons-material/Visibility";
|
|
16
18
|
import C from "@mui/icons-material/VisibilityOff";
|
|
17
19
|
//#region src/components/password-strength-meter/PasswordStrengthMeter.tsx
|
|
18
|
-
function
|
|
20
|
+
function le(e) {
|
|
19
21
|
let t = [];
|
|
20
22
|
e.upper && t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZ"), e.lower && t.push("abcdefghijklmnopqrstuvwxyz"), e.numbers && t.push("0123456789"), e.symbols && t.push("!@#$%^&*()-_=+[]{}|;:,.<>?"), t.length === 0 && t.push("abcdefghijklmnopqrstuvwxyz");
|
|
21
23
|
let n = t.join(""), r = Math.max(e.length, t.length), i = new Uint32Array(Math.max(0, r - t.length));
|
|
@@ -27,7 +29,7 @@ function se(e) {
|
|
|
27
29
|
}
|
|
28
30
|
return s.join("");
|
|
29
31
|
}
|
|
30
|
-
function w({ label: e, fulfilled:
|
|
32
|
+
function w({ label: e, fulfilled: n, checkColors: r }) {
|
|
31
33
|
return /* @__PURE__ */ y(h, {
|
|
32
34
|
direction: "row",
|
|
33
35
|
sx: {
|
|
@@ -35,261 +37,280 @@ function w({ label: e, fulfilled: t, checkColors: n }) {
|
|
|
35
37
|
mb: .25
|
|
36
38
|
},
|
|
37
39
|
spacing: .5,
|
|
40
|
+
className: t.requirementItem,
|
|
38
41
|
children: [/* @__PURE__ */ v(_, {
|
|
39
42
|
variant: "caption",
|
|
40
43
|
children: e
|
|
41
|
-
}),
|
|
44
|
+
}), n ? /* @__PURE__ */ v(b, {
|
|
42
45
|
"data-testid": "psm-req-success",
|
|
43
46
|
style: {
|
|
44
47
|
fontSize: 16,
|
|
45
|
-
color:
|
|
48
|
+
color: r.success
|
|
46
49
|
}
|
|
47
50
|
}) : /* @__PURE__ */ v(x, {
|
|
48
51
|
"data-testid": "psm-req-failure",
|
|
49
52
|
style: {
|
|
50
53
|
fontSize: 16,
|
|
51
|
-
color:
|
|
54
|
+
color: r.failure
|
|
52
55
|
}
|
|
53
56
|
})]
|
|
54
57
|
});
|
|
55
58
|
}
|
|
56
|
-
function T({ value: b, confirmValue: x, name: T, inputRef:
|
|
59
|
+
function T({ value: b, confirmValue: x, name: T, inputRef: ue, disabled: E = !1, error: D = !1, helperText: O, autoComplete: de, customRequirements: fe, generatorOptions: k, showConfirmField: A = !1, showPasswordAdornment: j = !0, showMeter: pe = !0, showPasswordGenerator: me = !1, showSegmentedBar: he = !1, showSummary: ge = !0, showCopyButton: M = !1, inputSize: N = "medium", translation: _e, meterColors: ve, passwordMinLength: P = 8, checkColors: F = a, onPasswordChange: I, onConfirmChange: ye, onPasswordGenerated: be }) {
|
|
57
60
|
let L = {
|
|
58
|
-
...
|
|
59
|
-
...
|
|
61
|
+
...s,
|
|
62
|
+
..._e
|
|
60
63
|
}, R = {
|
|
61
|
-
...
|
|
62
|
-
...
|
|
63
|
-
}, z =
|
|
64
|
+
...o,
|
|
65
|
+
...ve
|
|
66
|
+
}, z = ee(), B = `${z}-password`, [V, H] = c(!1), [U, xe] = c(!1), [Se, W] = c(""), [Ce, G] = c(""), [K, we] = n(), q = b === void 0 ? Se : b, J = x === void 0 ? Ce : x, Y = A && J.length > 0, X = Y && q === J, Z = te(() => r(q, P), [q, P]), Te = () => {
|
|
64
67
|
H((e) => !e);
|
|
65
68
|
}, Q = (e) => {
|
|
66
69
|
e.preventDefault();
|
|
67
70
|
}, $ = (e) => {
|
|
68
71
|
e.preventDefault();
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
72
|
+
}, Ee = (e) => {
|
|
73
|
+
let t = e.target.value;
|
|
74
|
+
b === void 0 && W(t), I && I(t, r(t, P));
|
|
75
|
+
}, De = (e) => {
|
|
76
|
+
let t = e.target.value;
|
|
77
|
+
x === void 0 && G(t), ye?.(t, t === q);
|
|
78
|
+
}, Oe = () => {
|
|
79
|
+
let e = le({
|
|
80
|
+
length: k?.length ?? Math.max(16, P),
|
|
81
|
+
upper: k?.upper ?? !0,
|
|
82
|
+
lower: k?.lower ?? !0,
|
|
83
|
+
numbers: k?.numbers ?? !0,
|
|
84
|
+
symbols: k?.symbols ?? !0
|
|
85
|
+
});
|
|
86
|
+
b === void 0 && W(e), x === void 0 && G(""), I?.(e, r(e, P)), be?.(e), H(!0);
|
|
87
|
+
}, ke = () => {
|
|
88
|
+
navigator.clipboard.writeText(q).then(() => {
|
|
89
|
+
we();
|
|
90
|
+
});
|
|
91
|
+
}, Ae = (e) => {
|
|
92
|
+
switch (e.meterStatus) {
|
|
93
|
+
case "weak": return R.weak;
|
|
94
|
+
case "ok": return R.ok;
|
|
95
|
+
case "good": return R.good;
|
|
96
|
+
case "very good": return R.veryGood;
|
|
97
|
+
default: return "transparent";
|
|
98
|
+
}
|
|
99
|
+
}, je = [
|
|
100
|
+
t.strengthBar,
|
|
101
|
+
Z.meterStatus === "weak" && t.strengthBarWeak,
|
|
102
|
+
Z.meterStatus === "ok" && t.strengthBarOk,
|
|
103
|
+
Z.meterStatus === "good" && t.strengthBarGood,
|
|
104
|
+
Z.meterStatus === "very good" && t.strengthBarVeryGood
|
|
105
|
+
].filter(Boolean).join(" ");
|
|
106
|
+
return /* @__PURE__ */ y(h, {
|
|
107
|
+
className: [
|
|
108
|
+
t.root,
|
|
109
|
+
E && e.disabled,
|
|
110
|
+
D && e.error
|
|
111
|
+
].filter(Boolean).join(" "),
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ y(l, {
|
|
114
|
+
variant: "outlined",
|
|
115
|
+
fullWidth: !0,
|
|
116
|
+
error: D,
|
|
117
|
+
className: t.input,
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ v(p, {
|
|
120
|
+
htmlFor: B,
|
|
121
|
+
size: N,
|
|
122
|
+
children: L.label
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ v(m, {
|
|
125
|
+
id: B,
|
|
126
|
+
type: V ? "text" : "password",
|
|
127
|
+
fullWidth: !0,
|
|
128
|
+
size: N,
|
|
129
|
+
value: q,
|
|
130
|
+
onChange: Ee,
|
|
131
|
+
disabled: E,
|
|
132
|
+
inputRef: ue,
|
|
133
|
+
inputProps: {
|
|
134
|
+
"data-testid": "psm-input",
|
|
135
|
+
name: T,
|
|
136
|
+
autoComplete: de
|
|
137
|
+
},
|
|
138
|
+
endAdornment: j || M && q.length > 0 ? /* @__PURE__ */ y(f, {
|
|
139
|
+
position: "end",
|
|
140
|
+
children: [M && q.length > 0 && /* @__PURE__ */ v(g, {
|
|
141
|
+
title: K ? L.copiedLabel : L.copyPasswordLabel,
|
|
142
|
+
arrow: !0,
|
|
143
|
+
children: /* @__PURE__ */ v("span", { children: /* @__PURE__ */ v(d, {
|
|
144
|
+
"data-testid": "psm-copy",
|
|
145
|
+
disabled: E,
|
|
146
|
+
"aria-label": K ? L.copiedLabel : L.copyPasswordLabel,
|
|
147
|
+
onClick: ke,
|
|
148
|
+
onMouseDown: Q,
|
|
149
|
+
onMouseUp: $,
|
|
150
|
+
edge: j ? !1 : "end",
|
|
151
|
+
children: K ? /* @__PURE__ */ v(ae, {
|
|
152
|
+
fontSize: "small",
|
|
153
|
+
color: "success"
|
|
154
|
+
}) : /* @__PURE__ */ v(ie, { fontSize: "small" })
|
|
155
|
+
}) })
|
|
156
|
+
}), j && /* @__PURE__ */ v(d, {
|
|
157
|
+
"data-testid": "psm-toggle",
|
|
105
158
|
disabled: E,
|
|
106
|
-
"aria-label":
|
|
107
|
-
onClick:
|
|
108
|
-
navigator.clipboard.writeText(q).then(() => {
|
|
109
|
-
Se();
|
|
110
|
-
});
|
|
111
|
-
},
|
|
159
|
+
"aria-label": V ? L.hidePasswordLabel : L.showPasswordLabel,
|
|
160
|
+
onClick: Te,
|
|
112
161
|
onMouseDown: Q,
|
|
113
162
|
onMouseUp: $,
|
|
114
|
-
edge:
|
|
115
|
-
children:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
label: L.label
|
|
132
|
-
}),
|
|
133
|
-
D && /* @__PURE__ */ v(u, { children: D })
|
|
134
|
-
]
|
|
135
|
-
}),
|
|
136
|
-
fe && /* @__PURE__ */ v(g, {
|
|
137
|
-
title: L.generatePasswordLabel,
|
|
138
|
-
arrow: !0,
|
|
139
|
-
children: /* @__PURE__ */ v("span", { children: /* @__PURE__ */ v(te, {
|
|
140
|
-
"data-testid": "psm-generate",
|
|
141
|
-
size: "small",
|
|
142
|
-
variant: "text",
|
|
143
|
-
startIcon: /* @__PURE__ */ v(ie, { fontSize: "small" }),
|
|
144
|
-
disabled: E,
|
|
145
|
-
onClick: () => {
|
|
146
|
-
let e = se({
|
|
147
|
-
length: O?.length ?? Math.max(16, P),
|
|
148
|
-
upper: O?.upper ?? !0,
|
|
149
|
-
lower: O?.lower ?? !0,
|
|
150
|
-
numbers: O?.numbers ?? !0,
|
|
151
|
-
symbols: O?.symbols ?? !0
|
|
152
|
-
});
|
|
153
|
-
b === void 0 && W(e), x === void 0 && G(""), I?.(e, t(e, P)), ve?.(e), H(!0);
|
|
154
|
-
},
|
|
155
|
-
sx: {
|
|
156
|
-
mt: .5,
|
|
157
|
-
alignSelf: "flex-start",
|
|
158
|
-
textTransform: "none"
|
|
159
|
-
},
|
|
160
|
-
children: L.generatePasswordLabel
|
|
161
|
-
}) })
|
|
162
|
-
}),
|
|
163
|
-
k && /* @__PURE__ */ y(l, {
|
|
164
|
-
variant: "outlined",
|
|
165
|
-
fullWidth: !0,
|
|
166
|
-
error: Y && !X,
|
|
167
|
-
sx: { mt: 1 },
|
|
168
|
-
children: [
|
|
169
|
-
/* @__PURE__ */ v(p, {
|
|
170
|
-
htmlFor: `${z}-confirm`,
|
|
171
|
-
size: N,
|
|
172
|
-
children: L.confirmLabel
|
|
173
|
-
}),
|
|
174
|
-
/* @__PURE__ */ v(m, {
|
|
175
|
-
id: `${z}-confirm`,
|
|
176
|
-
type: U ? "text" : "password",
|
|
177
|
-
fullWidth: !0,
|
|
178
|
-
size: N,
|
|
179
|
-
value: J,
|
|
180
|
-
onChange: (e) => {
|
|
181
|
-
let t = e.target.value;
|
|
182
|
-
x === void 0 && G(t), _e?.(t, t === q);
|
|
183
|
-
},
|
|
163
|
+
edge: "end",
|
|
164
|
+
children: v(V ? C : S, {})
|
|
165
|
+
})]
|
|
166
|
+
}) : null,
|
|
167
|
+
label: L.label
|
|
168
|
+
}),
|
|
169
|
+
O && /* @__PURE__ */ v(u, { children: O })
|
|
170
|
+
]
|
|
171
|
+
}),
|
|
172
|
+
me && /* @__PURE__ */ v(g, {
|
|
173
|
+
title: L.generatePasswordLabel,
|
|
174
|
+
arrow: !0,
|
|
175
|
+
children: /* @__PURE__ */ v("span", { children: /* @__PURE__ */ v(re, {
|
|
176
|
+
"data-testid": "psm-generate",
|
|
177
|
+
size: "small",
|
|
178
|
+
variant: "text",
|
|
179
|
+
startIcon: /* @__PURE__ */ v(oe, { fontSize: "small" }),
|
|
184
180
|
disabled: E,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
207
|
-
edge: "end",
|
|
208
|
-
"aria-label": U ? L.hidePasswordLabel : L.showPasswordLabel,
|
|
209
|
-
children: v(U ? C : S, {})
|
|
210
|
-
})]
|
|
181
|
+
onClick: Oe,
|
|
182
|
+
className: t.generatorButton,
|
|
183
|
+
sx: {
|
|
184
|
+
mt: .5,
|
|
185
|
+
alignSelf: "flex-start",
|
|
186
|
+
textTransform: "none"
|
|
187
|
+
},
|
|
188
|
+
children: L.generatePasswordLabel
|
|
189
|
+
}) })
|
|
190
|
+
}),
|
|
191
|
+
A && /* @__PURE__ */ y(l, {
|
|
192
|
+
variant: "outlined",
|
|
193
|
+
fullWidth: !0,
|
|
194
|
+
error: Y && !X,
|
|
195
|
+
sx: { mt: 1 },
|
|
196
|
+
className: t.confirmInput,
|
|
197
|
+
children: [
|
|
198
|
+
/* @__PURE__ */ v(p, {
|
|
199
|
+
htmlFor: `${z}-confirm`,
|
|
200
|
+
size: N,
|
|
201
|
+
children: L.confirmLabel
|
|
211
202
|
}),
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
203
|
+
/* @__PURE__ */ v(m, {
|
|
204
|
+
id: `${z}-confirm`,
|
|
205
|
+
type: U ? "text" : "password",
|
|
206
|
+
fullWidth: !0,
|
|
207
|
+
size: N,
|
|
208
|
+
value: J,
|
|
209
|
+
onChange: De,
|
|
210
|
+
disabled: E,
|
|
211
|
+
inputProps: { "data-testid": "psm-confirm-input" },
|
|
212
|
+
endAdornment: /* @__PURE__ */ y(f, {
|
|
213
|
+
position: "end",
|
|
214
|
+
children: [Y && (X ? /* @__PURE__ */ v(se, {
|
|
215
|
+
"data-testid": "psm-confirm-match",
|
|
216
|
+
sx: {
|
|
217
|
+
color: F.success,
|
|
218
|
+
mr: .5
|
|
219
|
+
},
|
|
220
|
+
fontSize: "small"
|
|
221
|
+
}) : /* @__PURE__ */ v(ce, {
|
|
222
|
+
"data-testid": "psm-confirm-mismatch",
|
|
223
|
+
sx: {
|
|
224
|
+
color: F.failure,
|
|
225
|
+
mr: .5
|
|
226
|
+
},
|
|
227
|
+
fontSize: "small"
|
|
228
|
+
})), /* @__PURE__ */ v(d, {
|
|
229
|
+
size: "small",
|
|
230
|
+
disabled: E,
|
|
231
|
+
onClick: () => xe((e) => !e),
|
|
232
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
233
|
+
edge: "end",
|
|
234
|
+
"aria-label": U ? L.hidePasswordLabel : L.showPasswordLabel,
|
|
235
|
+
children: v(U ? C : S, {})
|
|
236
|
+
})]
|
|
237
|
+
}),
|
|
238
|
+
label: L.confirmLabel
|
|
239
|
+
}),
|
|
240
|
+
Y && /* @__PURE__ */ v(u, {
|
|
241
|
+
sx: { color: X ? F.success : F.failure },
|
|
242
|
+
children: X ? L.confirmMatchLabel : L.confirmMismatchLabel
|
|
243
|
+
})
|
|
244
|
+
]
|
|
245
|
+
}),
|
|
246
|
+
pe && /* @__PURE__ */ v(i, {
|
|
247
|
+
percent: Z.percent,
|
|
248
|
+
color: Ae(Z),
|
|
249
|
+
ariaLabel: L.meterAriaLabel,
|
|
250
|
+
segments: he,
|
|
251
|
+
className: je
|
|
252
|
+
}),
|
|
253
|
+
ge && /* @__PURE__ */ y(ne, {
|
|
254
|
+
"data-testid": "psm-summary",
|
|
243
255
|
sx: {
|
|
244
|
-
|
|
245
|
-
|
|
256
|
+
mt: .5,
|
|
257
|
+
p: .5
|
|
246
258
|
},
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
fulfilled: Z.length >= P,
|
|
257
|
-
checkColors: F
|
|
258
|
-
}),
|
|
259
|
-
/* @__PURE__ */ v(w, {
|
|
260
|
-
label: L.summaryCapitalLetter,
|
|
261
|
-
fulfilled: Z.hasUpper,
|
|
262
|
-
checkColors: F
|
|
263
|
-
}),
|
|
264
|
-
/* @__PURE__ */ v(w, {
|
|
265
|
-
label: L.summaryLowerCaseLetter,
|
|
266
|
-
fulfilled: Z.hasLower,
|
|
267
|
-
checkColors: F
|
|
268
|
-
})
|
|
269
|
-
]
|
|
259
|
+
className: t.summary,
|
|
260
|
+
children: [/* @__PURE__ */ v(_, {
|
|
261
|
+
variant: "caption",
|
|
262
|
+
gutterBottom: !0,
|
|
263
|
+
sx: {
|
|
264
|
+
display: "block",
|
|
265
|
+
fontSize: 14
|
|
266
|
+
},
|
|
267
|
+
children: L.summaryHeaderLabel
|
|
270
268
|
}), /* @__PURE__ */ y(h, {
|
|
271
|
-
direction: "
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
269
|
+
direction: "row",
|
|
270
|
+
spacing: 6,
|
|
271
|
+
children: [/* @__PURE__ */ y(h, {
|
|
272
|
+
direction: "column",
|
|
273
|
+
children: [
|
|
274
|
+
/* @__PURE__ */ v(w, {
|
|
275
|
+
label: L.summaryMinChars.replace("{n}", String(P)),
|
|
276
|
+
fulfilled: Z.length >= P,
|
|
277
|
+
checkColors: F
|
|
278
|
+
}),
|
|
279
|
+
/* @__PURE__ */ v(w, {
|
|
280
|
+
label: L.summaryCapitalLetter,
|
|
281
|
+
fulfilled: Z.hasUpper,
|
|
282
|
+
checkColors: F
|
|
283
|
+
}),
|
|
284
|
+
/* @__PURE__ */ v(w, {
|
|
285
|
+
label: L.summaryLowerCaseLetter,
|
|
286
|
+
fulfilled: Z.hasLower,
|
|
287
|
+
checkColors: F
|
|
288
|
+
})
|
|
289
|
+
]
|
|
290
|
+
}), /* @__PURE__ */ y(h, {
|
|
291
|
+
direction: "column",
|
|
292
|
+
children: [
|
|
293
|
+
/* @__PURE__ */ v(w, {
|
|
294
|
+
label: L.summaryNumber,
|
|
295
|
+
fulfilled: Z.hasDigit,
|
|
296
|
+
checkColors: F
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ v(w, {
|
|
299
|
+
label: L.summarySpecialChar,
|
|
300
|
+
fulfilled: Z.hasSymbol,
|
|
301
|
+
checkColors: F
|
|
302
|
+
}),
|
|
303
|
+
fe?.map((e, t) => /* @__PURE__ */ v(w, {
|
|
304
|
+
label: e.label,
|
|
305
|
+
fulfilled: typeof e.fulfilled == "function" ? e.fulfilled(q) : e.fulfilled,
|
|
306
|
+
checkColors: F
|
|
307
|
+
}, t))
|
|
308
|
+
]
|
|
309
|
+
})]
|
|
289
310
|
})]
|
|
290
|
-
})
|
|
291
|
-
|
|
292
|
-
|
|
311
|
+
})
|
|
312
|
+
]
|
|
313
|
+
});
|
|
293
314
|
}
|
|
294
315
|
//#endregion
|
|
295
316
|
export { T as PasswordStrengthMeter };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS class names for every named slot in the PasswordStrengthMeter 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
|
+
* .MuiTsPasswordStrengthMeter-strengthBar.MuiTsPasswordStrengthMeter-strengthBarWeak {
|
|
10
|
+
* /* custom weak-strength color *\/
|
|
11
|
+
* }
|
|
12
|
+
* .MuiTsPasswordStrengthMeter-root.MuiTs-error .MuiTsPasswordStrengthMeter-input {
|
|
13
|
+
* border-color: red;
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const passwordStrengthMeterClasses: {
|
|
18
|
+
/** The outermost wrapper element. Also receives `MuiTs-disabled` and `MuiTs-error` state classes. */
|
|
19
|
+
readonly root: "MuiTsPasswordStrengthMeter-root";
|
|
20
|
+
/** The FormControl wrapping the main password input field. */
|
|
21
|
+
readonly input: "MuiTsPasswordStrengthMeter-input";
|
|
22
|
+
/** The "Generate password" button (only present when `showPasswordGenerator={true}`). */
|
|
23
|
+
readonly generatorButton: "MuiTsPasswordStrengthMeter-generatorButton";
|
|
24
|
+
/** The FormControl wrapping the confirm password input (only when `showConfirmField={true}`). */
|
|
25
|
+
readonly confirmInput: "MuiTsPasswordStrengthMeter-confirmInput";
|
|
26
|
+
/** The strength progress bar element. Also receives one of the strength state classes below. */
|
|
27
|
+
readonly strengthBar: "MuiTsPasswordStrengthMeter-strengthBar";
|
|
28
|
+
/** Added to the strength bar when the password is weak (score 0–25 %). */
|
|
29
|
+
readonly strengthBarWeak: "MuiTsPasswordStrengthMeter-strengthBarWeak";
|
|
30
|
+
/** Added to the strength bar when the password is acceptable (score ~50 %). */
|
|
31
|
+
readonly strengthBarOk: "MuiTsPasswordStrengthMeter-strengthBarOk";
|
|
32
|
+
/** Added to the strength bar when the password is good (score ~75 %). */
|
|
33
|
+
readonly strengthBarGood: "MuiTsPasswordStrengthMeter-strengthBarGood";
|
|
34
|
+
/** Added to the strength bar when the password is very good (score 100 %). */
|
|
35
|
+
readonly strengthBarVeryGood: "MuiTsPasswordStrengthMeter-strengthBarVeryGood";
|
|
36
|
+
/** The requirements summary box below the bar (only when `showSummary={true}`). */
|
|
37
|
+
readonly summary: "MuiTsPasswordStrengthMeter-summary";
|
|
38
|
+
/** Each individual requirement row (label + check/error icon). */
|
|
39
|
+
readonly requirementItem: "MuiTsPasswordStrengthMeter-requirementItem";
|
|
40
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/components/password-strength-meter/passwordStrengthMeterClasses.ts
|
|
2
|
+
var e = {
|
|
3
|
+
root: "MuiTsPasswordStrengthMeter-root",
|
|
4
|
+
input: "MuiTsPasswordStrengthMeter-input",
|
|
5
|
+
generatorButton: "MuiTsPasswordStrengthMeter-generatorButton",
|
|
6
|
+
confirmInput: "MuiTsPasswordStrengthMeter-confirmInput",
|
|
7
|
+
strengthBar: "MuiTsPasswordStrengthMeter-strengthBar",
|
|
8
|
+
strengthBarWeak: "MuiTsPasswordStrengthMeter-strengthBarWeak",
|
|
9
|
+
strengthBarOk: "MuiTsPasswordStrengthMeter-strengthBarOk",
|
|
10
|
+
strengthBarGood: "MuiTsPasswordStrengthMeter-strengthBarGood",
|
|
11
|
+
strengthBarVeryGood: "MuiTsPasswordStrengthMeter-strengthBarVeryGood",
|
|
12
|
+
summary: "MuiTsPasswordStrengthMeter-summary",
|
|
13
|
+
requirementItem: "MuiTsPasswordStrengthMeter-requirementItem"
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { e as passwordStrengthMeterClasses };
|