@thebuoyant-tsdev/mui-ts-library 3.8.0 → 3.9.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 +15 -1
- package/README.md +15 -1
- package/dist/components/gantt-chart/GanttChart.d.ts +1 -1
- package/dist/components/gantt-chart/GanttChart.types.d.ts +7 -6
- package/dist/components/password-strength-meter/PasswordStrengthMeter.d.ts +1 -1
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +156 -134
- package/dist/components/password-strength-meter/PasswordStrengthMeter.types.d.ts +7 -1
- package/dist/components/password-strength-meter/PasswordStrengthMeter.types.js +3 -1
- package/dist/index.cjs +1 -1
- package/package.json +1 -1
package/README.de.md
CHANGED
|
@@ -337,12 +337,26 @@ Dieses Projekt folgt [Semantic Versioning](https://semver.org/). In der Praxis b
|
|
|
337
337
|
|
|
338
338
|
**Bisher nur ein Breaking Release:** [`3.0.0`](#300--2026-06-15--breaking-changes) hat `ConfirmDialog` / `ConfirmDialogProvider` / `useConfirm` entfernt und die Signatur von `TagSelection`s `onTagCreate` geändert. Jedes Release seitdem war additiv.
|
|
339
339
|
|
|
340
|
-
**TypeScript-Hinweis:** Translation-Typen (z.B. `TagSelectionTranslation`, `SqlEditorTranslation`) bekommen mit der Zeit neue optionale Felder, wenn Features hinzukommen — ein `Partial<...>`-Objekt direkt an die `translation`-Prop zu übergeben (das in dieser README durchgängig verwendete Muster) ist immer vorwärtskompatibel. Eine eigenständige Variable, die gegen den vollen benannten Typ deklariert wird, bleibt nur kompatibel, solange neue Felder optional sind —
|
|
340
|
+
**TypeScript-Hinweis:** Translation-Typen (z.B. `TagSelectionTranslation`, `SqlEditorTranslation`, `GanttTranslations`) bekommen mit der Zeit neue optionale Felder, wenn Features hinzukommen — ein `Partial<...>`-Objekt direkt an die `translation`/`translations`-Prop zu übergeben (das in dieser README durchgängig verwendete Muster) ist immer vorwärtskompatibel. Eine eigenständige Variable, die gegen den vollen benannten Typ deklariert wird, bleibt nur kompatibel, solange neue Felder optional sind. Ein Audit über alle Komponenten fand eine Lücke — `GanttTranslations` hatte 3 nach Release ergänzte required Felder — behoben in `3.9.1` (siehe [Changelog](#391--2026-06-25)). Seit dieser Version ist jeder Translation-Typ optional-sicher.
|
|
341
341
|
|
|
342
342
|
---
|
|
343
343
|
|
|
344
344
|
## Changelog
|
|
345
345
|
|
|
346
|
+
### [3.9.1] — 2026-06-25
|
|
347
|
+
|
|
348
|
+
**Behoben**
|
|
349
|
+
- GanttChart: `GanttTranslations` hatte 3 required Keys, die nach Release ergänzt wurden (`todayLabel`, `columnAssignee`, `exportCsvTooltip`) — jetzt optional, konsistent mit jedem anderen Translation-Typ. Siehe [Versionierung & Abwärtskompatibilität](#versionierung--abwärtskompatibilität).
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
### [3.9.0] — 2026-06-24
|
|
354
|
+
|
|
355
|
+
**PasswordStrengthMeter**
|
|
356
|
+
- `showCopyButton`: Kopier-Icon neben dem Passwortfeld, passt zu `showPasswordGenerator`.
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
346
360
|
### [3.8.0] — 2026-06-23
|
|
347
361
|
|
|
348
362
|
**RichTextEditor**
|
package/README.md
CHANGED
|
@@ -337,12 +337,26 @@ This project follows [Semantic Versioning](https://semver.org/). In practice:
|
|
|
337
337
|
|
|
338
338
|
**Only one breaking release to date:** [`3.0.0`](#300--2026-06-15--breaking-changes) removed `ConfirmDialog` / `ConfirmDialogProvider` / `useConfirm` and changed `TagSelection`'s `onTagCreate` signature. Every other release since has been additive.
|
|
339
339
|
|
|
340
|
-
**TypeScript note:** translation types (e.g. `TagSelectionTranslation`, `SqlEditorTranslation`) gain new optional fields over time as features are added — passing a `Partial<...>` object straight to the `translation` prop (the pattern used throughout this README) is always forward-compatible. Declaring a standalone variable typed against the full named type only stays compatible if new fields are optional
|
|
340
|
+
**TypeScript note:** translation types (e.g. `TagSelectionTranslation`, `SqlEditorTranslation`, `GanttTranslations`) gain new optional fields over time as features are added — passing a `Partial<...>` object straight to the `translation`/`translations` prop (the pattern used throughout this README) is always forward-compatible. Declaring a standalone variable typed against the full named type only stays compatible if new fields are optional. An audit across all components turned up one gap — `GanttTranslations` had 3 required fields added after release — fixed in `3.9.1` (see [Changelog](#391--2026-06-25)). Every translation type is optional-safe as of that version.
|
|
341
341
|
|
|
342
342
|
---
|
|
343
343
|
|
|
344
344
|
## Changelog
|
|
345
345
|
|
|
346
|
+
### [3.9.1] — 2026-06-25
|
|
347
|
+
|
|
348
|
+
**Fixed**
|
|
349
|
+
- GanttChart: `GanttTranslations` had 3 required keys added after release (`todayLabel`, `columnAssignee`, `exportCsvTooltip`) — now optional, matching every other translation type. See [Versioning & Compatibility](#versioning--compatibility).
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
### [3.9.0] — 2026-06-24
|
|
354
|
+
|
|
355
|
+
**PasswordStrengthMeter**
|
|
356
|
+
- `showCopyButton`: copy-to-clipboard icon next to the password field, pairs with `showPasswordGenerator`.
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
346
360
|
### [3.8.0] — 2026-06-23
|
|
347
361
|
|
|
348
362
|
**RichTextEditor**
|
|
@@ -2,6 +2,6 @@ import { type GanttChartStore } from "./GanttChart.store";
|
|
|
2
2
|
import type { GanttChartProps, GanttTheme, GanttTranslations } from "./GanttChart.types";
|
|
3
3
|
export declare function useGanttChartStore<T>(selector: (state: ReturnType<GanttChartStore["getState"]>) => T): T;
|
|
4
4
|
export declare function useRawGanttChartStore(): GanttChartStore;
|
|
5
|
-
export declare function useGanttTranslations(): GanttTranslations
|
|
5
|
+
export declare function useGanttTranslations(): Required<GanttTranslations>;
|
|
6
6
|
export declare function useGanttTheme(): GanttTheme;
|
|
7
7
|
export declare function GanttChart({ tasks, timeScale, initialExpandAll, showToolbar, defaultRangeStart, defaultRangeEnd, translations, enableBuiltinDialogs, toolbarConfig, zoomable, draggable, resizable, inlineEdit, progressDraggable, showCriticalPath, virtualizeRows, showAssigneeColumn, cascadeDependencies, statusColors, ganttTheme, onExportCSV, onTaskClick, onMilestoneClick, onAddTask, onEditTask, onDeleteTask, onStatusChange, onTasksChange, onTaskMoved, onTaskResized, onTaskCreated, onTaskUpdated, onTaskDeleted, height, width, minPanelWidth, maxPanelWidth, }: GanttChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -33,7 +33,8 @@ export type GanttTranslations = {
|
|
|
33
33
|
statusDone: string;
|
|
34
34
|
statusBlocked: string;
|
|
35
35
|
weekColumnPrefix: string;
|
|
36
|
-
|
|
36
|
+
/** @since 2.0.0 */
|
|
37
|
+
todayLabel?: string;
|
|
37
38
|
dateLocale: string;
|
|
38
39
|
dialogAddTitle: string;
|
|
39
40
|
dialogEditTitle: string;
|
|
@@ -52,8 +53,8 @@ export type GanttTranslations = {
|
|
|
52
53
|
dialogFieldDependencies: string;
|
|
53
54
|
dialogFieldDependenciesNone: string;
|
|
54
55
|
columnActions: string;
|
|
55
|
-
/** Header label for the Assignee column — shown when showAssigneeColumn=true */
|
|
56
|
-
columnAssignee
|
|
56
|
+
/** Header label for the Assignee column — shown when showAssigneeColumn=true @since 2.7.0 */
|
|
57
|
+
columnAssignee?: string;
|
|
57
58
|
addTaskTooltip: string;
|
|
58
59
|
editTaskTooltip: string;
|
|
59
60
|
deleteTaskTooltip: string;
|
|
@@ -61,10 +62,10 @@ export type GanttTranslations = {
|
|
|
61
62
|
expandAllTooltip: string;
|
|
62
63
|
collapseAllTooltip: string;
|
|
63
64
|
resetViewTooltip: string;
|
|
64
|
-
/** Toolbar tooltip for the CSV export button */
|
|
65
|
-
exportCsvTooltip
|
|
65
|
+
/** Toolbar tooltip for the CSV export button @since 2.7.0 */
|
|
66
|
+
exportCsvTooltip?: string;
|
|
66
67
|
};
|
|
67
|
-
export declare const DEFAULT_GANTT_TRANSLATIONS: GanttTranslations
|
|
68
|
+
export declare const DEFAULT_GANTT_TRANSLATIONS: Required<GanttTranslations>;
|
|
68
69
|
export type GanttStatusColors = Partial<Record<GanttTaskStatus, string>>;
|
|
69
70
|
export type GanttTheme = {
|
|
70
71
|
statusColors?: GanttStatusColors;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PasswordStrengthMeterProps } from "./PasswordStrengthMeter.types";
|
|
2
|
-
export declare function PasswordStrengthMeter({ value, confirmValue, name, inputRef, disabled, error, helperText, autoComplete, customRequirements, generatorOptions, showConfirmField, showPasswordAdornment, showMeter, showPasswordGenerator, showSegmentedBar, showSummary, inputSize, translation, meterColors, passwordMinLength, checkColors, onPasswordChange, onConfirmChange, onPasswordGenerated, }: PasswordStrengthMeterProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function PasswordStrengthMeter({ value, confirmValue, name, inputRef, disabled, error, helperText, autoComplete, customRequirements, generatorOptions, showConfirmField, showPasswordAdornment, showMeter, showPasswordGenerator, showSegmentedBar, showSummary, showCopyButton, inputSize, translation, meterColors, passwordMinLength, checkColors, onPasswordChange, onConfirmChange, onPasswordGenerated, }: PasswordStrengthMeterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,17 +2,19 @@ import { scorePassword as e } from "./util/password-strength.util.js";
|
|
|
2
2
|
import { PasswordStrengthBar as t } from "./PasswordStrengthBar.js";
|
|
3
3
|
import { DEFAULT_CHECK_COLORS as n, DEFAULT_METER_COLORS as r, DEFAULT_PASSWORD_TRANSLATIONS as i } from "./PasswordStrengthMeter.types.js";
|
|
4
4
|
import { useId as a, useMemo as o, useState as s } from "react";
|
|
5
|
-
import { Box as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
5
|
+
import { Box as ee, Button as te, FormControl as c, FormHelperText as l, IconButton as u, InputAdornment as d, InputLabel as f, OutlinedInput as p, Stack as m, Tooltip as h, Typography as g } from "@mui/material";
|
|
6
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
7
|
+
import ne from "@mui/icons-material/ContentCopy";
|
|
8
|
+
import re from "@mui/icons-material/Check";
|
|
9
|
+
import ie from "@mui/icons-material/AutoFixHigh";
|
|
10
|
+
import y from "@mui/icons-material/CheckCircleOutlined";
|
|
11
|
+
import b from "@mui/icons-material/ErrorOutlined";
|
|
12
|
+
import ae from "@mui/icons-material/CheckCircle";
|
|
13
|
+
import oe from "@mui/icons-material/Cancel";
|
|
14
|
+
import x from "@mui/icons-material/Visibility";
|
|
15
|
+
import S from "@mui/icons-material/VisibilityOff";
|
|
14
16
|
//#region src/components/password-strength-meter/PasswordStrengthMeter.tsx
|
|
15
|
-
function
|
|
17
|
+
function se(e) {
|
|
16
18
|
let t = [];
|
|
17
19
|
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");
|
|
18
20
|
let n = t.join(""), r = new Uint32Array(e.length);
|
|
@@ -24,24 +26,24 @@ function re(e) {
|
|
|
24
26
|
}
|
|
25
27
|
return o.join("");
|
|
26
28
|
}
|
|
27
|
-
function
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
+
function C({ label: e, fulfilled: t, checkColors: n }) {
|
|
30
|
+
return /* @__PURE__ */ v(m, {
|
|
29
31
|
direction: "row",
|
|
30
32
|
sx: {
|
|
31
33
|
alignItems: "center",
|
|
32
34
|
mb: .25
|
|
33
35
|
},
|
|
34
36
|
spacing: .5,
|
|
35
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ _(g, {
|
|
36
38
|
variant: "caption",
|
|
37
39
|
children: e
|
|
38
|
-
}), t ? /* @__PURE__ */ y
|
|
40
|
+
}), t ? /* @__PURE__ */ _(y, {
|
|
39
41
|
"data-testid": "psm-req-success",
|
|
40
42
|
style: {
|
|
41
43
|
fontSize: 16,
|
|
42
44
|
color: n.success
|
|
43
45
|
}
|
|
44
|
-
}) : /* @__PURE__ */
|
|
46
|
+
}) : /* @__PURE__ */ _(b, {
|
|
45
47
|
"data-testid": "psm-req-failure",
|
|
46
48
|
style: {
|
|
47
49
|
fontSize: 16,
|
|
@@ -50,217 +52,237 @@ function T({ label: e, fulfilled: t, checkColors: n }) {
|
|
|
50
52
|
})]
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
|
-
function
|
|
54
|
-
let
|
|
55
|
+
function w({ value: y, confirmValue: b, name: w, inputRef: ce, disabled: T = !1, error: le = !1, helperText: E, autoComplete: ue, customRequirements: de, generatorOptions: D, showConfirmField: O = !1, showPasswordAdornment: k = !0, showMeter: fe = !0, showPasswordGenerator: pe = !1, showSegmentedBar: me = !1, showSummary: he = !0, showCopyButton: A = !1, inputSize: j = "medium", translation: ge, meterColors: _e, passwordMinLength: M = 8, checkColors: N = n, onPasswordChange: P, onConfirmChange: ve, onPasswordGenerated: ye }) {
|
|
56
|
+
let F = {
|
|
55
57
|
...i,
|
|
56
|
-
...
|
|
57
|
-
},
|
|
58
|
+
...ge
|
|
59
|
+
}, I = {
|
|
58
60
|
...r,
|
|
59
|
-
...
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
..._e
|
|
62
|
+
}, L = a(), R = `${L}-password`, [z, B] = s(!1), [V, be] = s(!1), [xe, H] = s(""), [U, W] = s(""), [G, K] = s(!1), q = y === void 0 ? xe : y, J = b === void 0 ? U : b, Y = O && J.length > 0, X = Y && q === J, Z = o(() => e(q, M), [q, M]), Se = () => {
|
|
63
|
+
B((e) => !e);
|
|
64
|
+
}, Q = (e) => {
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
}, $ = (e) => {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
};
|
|
69
|
+
return /* @__PURE__ */ v(m, { children: [
|
|
70
|
+
/* @__PURE__ */ v(c, {
|
|
63
71
|
variant: "outlined",
|
|
64
72
|
fullWidth: !0,
|
|
65
|
-
error:
|
|
73
|
+
error: le,
|
|
66
74
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
htmlFor:
|
|
69
|
-
size:
|
|
70
|
-
children:
|
|
75
|
+
/* @__PURE__ */ _(f, {
|
|
76
|
+
htmlFor: R,
|
|
77
|
+
size: j,
|
|
78
|
+
children: F.label
|
|
71
79
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
id:
|
|
74
|
-
type:
|
|
80
|
+
/* @__PURE__ */ _(p, {
|
|
81
|
+
id: R,
|
|
82
|
+
type: z ? "text" : "password",
|
|
75
83
|
fullWidth: !0,
|
|
76
|
-
size:
|
|
77
|
-
value:
|
|
84
|
+
size: j,
|
|
85
|
+
value: q,
|
|
78
86
|
onChange: (t) => {
|
|
79
87
|
let n = t.target.value;
|
|
80
|
-
|
|
88
|
+
y === void 0 && H(n), P && P(n, e(n, M));
|
|
81
89
|
},
|
|
82
|
-
disabled:
|
|
83
|
-
inputRef:
|
|
90
|
+
disabled: T,
|
|
91
|
+
inputRef: ce,
|
|
84
92
|
inputProps: {
|
|
85
93
|
"data-testid": "psm-input",
|
|
86
|
-
name:
|
|
87
|
-
autoComplete:
|
|
94
|
+
name: w,
|
|
95
|
+
autoComplete: ue
|
|
88
96
|
},
|
|
89
|
-
endAdornment:
|
|
97
|
+
endAdornment: k || A && q.length > 0 ? /* @__PURE__ */ v(d, {
|
|
90
98
|
position: "end",
|
|
91
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: [A && q.length > 0 && /* @__PURE__ */ _(h, {
|
|
100
|
+
title: G ? F.copiedLabel : F.copyPasswordLabel,
|
|
101
|
+
arrow: !0,
|
|
102
|
+
children: /* @__PURE__ */ _("span", { children: /* @__PURE__ */ _(u, {
|
|
103
|
+
"data-testid": "psm-copy",
|
|
104
|
+
disabled: T,
|
|
105
|
+
"aria-label": G ? F.copiedLabel : F.copyPasswordLabel,
|
|
106
|
+
onClick: () => {
|
|
107
|
+
navigator.clipboard.writeText(q).then(() => {
|
|
108
|
+
K(!0), setTimeout(() => K(!1), 2e3);
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
onMouseDown: Q,
|
|
112
|
+
onMouseUp: $,
|
|
113
|
+
edge: k ? !1 : "end",
|
|
114
|
+
children: G ? /* @__PURE__ */ _(re, {
|
|
115
|
+
fontSize: "small",
|
|
116
|
+
color: "success"
|
|
117
|
+
}) : /* @__PURE__ */ _(ne, { fontSize: "small" })
|
|
118
|
+
}) })
|
|
119
|
+
}), k && /* @__PURE__ */ _(u, {
|
|
92
120
|
"data-testid": "psm-toggle",
|
|
93
|
-
disabled:
|
|
94
|
-
"aria-label":
|
|
95
|
-
onClick:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
onMouseDown: (e) => {
|
|
99
|
-
e.preventDefault();
|
|
100
|
-
},
|
|
101
|
-
onMouseUp: (e) => {
|
|
102
|
-
e.preventDefault();
|
|
103
|
-
},
|
|
121
|
+
disabled: T,
|
|
122
|
+
"aria-label": z ? F.hidePasswordLabel : F.showPasswordLabel,
|
|
123
|
+
onClick: Se,
|
|
124
|
+
onMouseDown: Q,
|
|
125
|
+
onMouseUp: $,
|
|
104
126
|
edge: "end",
|
|
105
|
-
children:
|
|
106
|
-
})
|
|
127
|
+
children: _(z ? S : x, {})
|
|
128
|
+
})]
|
|
107
129
|
}) : null,
|
|
108
|
-
label:
|
|
130
|
+
label: F.label
|
|
109
131
|
}),
|
|
110
|
-
|
|
132
|
+
E && /* @__PURE__ */ _(l, { children: E })
|
|
111
133
|
]
|
|
112
134
|
}),
|
|
113
|
-
|
|
114
|
-
title:
|
|
135
|
+
pe && /* @__PURE__ */ _(h, {
|
|
136
|
+
title: F.generatePasswordLabel,
|
|
115
137
|
arrow: !0,
|
|
116
|
-
children: /* @__PURE__ */
|
|
138
|
+
children: /* @__PURE__ */ _("span", { children: /* @__PURE__ */ _(te, {
|
|
117
139
|
"data-testid": "psm-generate",
|
|
118
140
|
size: "small",
|
|
119
141
|
variant: "text",
|
|
120
|
-
startIcon: /* @__PURE__ */
|
|
121
|
-
disabled:
|
|
142
|
+
startIcon: /* @__PURE__ */ _(ie, { fontSize: "small" }),
|
|
143
|
+
disabled: T,
|
|
122
144
|
onClick: () => {
|
|
123
|
-
let t =
|
|
124
|
-
length:
|
|
125
|
-
upper:
|
|
126
|
-
lower:
|
|
127
|
-
numbers:
|
|
128
|
-
symbols:
|
|
145
|
+
let t = se({
|
|
146
|
+
length: D?.length ?? Math.max(16, M),
|
|
147
|
+
upper: D?.upper ?? !0,
|
|
148
|
+
lower: D?.lower ?? !0,
|
|
149
|
+
numbers: D?.numbers ?? !0,
|
|
150
|
+
symbols: D?.symbols ?? !0
|
|
129
151
|
});
|
|
130
|
-
|
|
152
|
+
y === void 0 && H(t), b === void 0 && W(""), P?.(t, e(t, M)), ye?.(t), B(!0);
|
|
131
153
|
},
|
|
132
154
|
sx: {
|
|
133
155
|
mt: .5,
|
|
134
156
|
alignSelf: "flex-start",
|
|
135
157
|
textTransform: "none"
|
|
136
158
|
},
|
|
137
|
-
children:
|
|
159
|
+
children: F.generatePasswordLabel
|
|
138
160
|
}) })
|
|
139
161
|
}),
|
|
140
|
-
|
|
162
|
+
O && /* @__PURE__ */ v(c, {
|
|
141
163
|
variant: "outlined",
|
|
142
164
|
fullWidth: !0,
|
|
143
|
-
error:
|
|
165
|
+
error: Y && !X,
|
|
144
166
|
sx: { mt: 1 },
|
|
145
167
|
children: [
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
htmlFor: `${
|
|
148
|
-
size:
|
|
149
|
-
children:
|
|
168
|
+
/* @__PURE__ */ _(f, {
|
|
169
|
+
htmlFor: `${L}-confirm`,
|
|
170
|
+
size: j,
|
|
171
|
+
children: F.confirmLabel
|
|
150
172
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
id: `${
|
|
153
|
-
type:
|
|
173
|
+
/* @__PURE__ */ _(p, {
|
|
174
|
+
id: `${L}-confirm`,
|
|
175
|
+
type: V ? "text" : "password",
|
|
154
176
|
fullWidth: !0,
|
|
155
|
-
size:
|
|
156
|
-
value:
|
|
177
|
+
size: j,
|
|
178
|
+
value: J,
|
|
157
179
|
onChange: (e) => {
|
|
158
180
|
let t = e.target.value;
|
|
159
|
-
|
|
181
|
+
b === void 0 && W(t), ve?.(t, t === q);
|
|
160
182
|
},
|
|
161
|
-
disabled:
|
|
183
|
+
disabled: T,
|
|
162
184
|
inputProps: { "data-testid": "psm-confirm-input" },
|
|
163
|
-
endAdornment: /* @__PURE__ */
|
|
185
|
+
endAdornment: /* @__PURE__ */ v(d, {
|
|
164
186
|
position: "end",
|
|
165
|
-
children: [
|
|
187
|
+
children: [Y && (X ? /* @__PURE__ */ _(ae, {
|
|
166
188
|
"data-testid": "psm-confirm-match",
|
|
167
189
|
sx: {
|
|
168
|
-
color:
|
|
190
|
+
color: N.success,
|
|
169
191
|
mr: .5
|
|
170
192
|
},
|
|
171
193
|
fontSize: "small"
|
|
172
|
-
}) : /* @__PURE__ */
|
|
194
|
+
}) : /* @__PURE__ */ _(oe, {
|
|
173
195
|
"data-testid": "psm-confirm-mismatch",
|
|
174
196
|
sx: {
|
|
175
|
-
color:
|
|
197
|
+
color: N.failure,
|
|
176
198
|
mr: .5
|
|
177
199
|
},
|
|
178
200
|
fontSize: "small"
|
|
179
|
-
})), /* @__PURE__ */
|
|
201
|
+
})), /* @__PURE__ */ _(u, {
|
|
180
202
|
size: "small",
|
|
181
|
-
disabled:
|
|
182
|
-
onClick: () =>
|
|
203
|
+
disabled: T,
|
|
204
|
+
onClick: () => be((e) => !e),
|
|
183
205
|
onMouseDown: (e) => e.preventDefault(),
|
|
184
206
|
edge: "end",
|
|
185
|
-
"aria-label":
|
|
186
|
-
children:
|
|
207
|
+
"aria-label": V ? F.hidePasswordLabel : F.showPasswordLabel,
|
|
208
|
+
children: _(V ? S : x, {})
|
|
187
209
|
})]
|
|
188
210
|
}),
|
|
189
|
-
label:
|
|
211
|
+
label: F.confirmLabel
|
|
190
212
|
}),
|
|
191
|
-
|
|
192
|
-
sx: { color:
|
|
193
|
-
children:
|
|
213
|
+
Y && /* @__PURE__ */ _(l, {
|
|
214
|
+
sx: { color: X ? N.success : N.failure },
|
|
215
|
+
children: X ? F.confirmMatchLabel : F.confirmMismatchLabel
|
|
194
216
|
})
|
|
195
217
|
]
|
|
196
218
|
}),
|
|
197
|
-
|
|
198
|
-
percent:
|
|
219
|
+
fe && /* @__PURE__ */ _(t, {
|
|
220
|
+
percent: Z.percent,
|
|
199
221
|
color: ((e) => {
|
|
200
222
|
switch (e.meterStatus) {
|
|
201
|
-
case "weak": return
|
|
202
|
-
case "ok": return
|
|
203
|
-
case "good": return
|
|
204
|
-
case "very good": return
|
|
223
|
+
case "weak": return I.weak;
|
|
224
|
+
case "ok": return I.ok;
|
|
225
|
+
case "good": return I.good;
|
|
226
|
+
case "very good": return I.veryGood;
|
|
205
227
|
default: return "transparent";
|
|
206
228
|
}
|
|
207
|
-
})(
|
|
208
|
-
ariaLabel:
|
|
209
|
-
segments:
|
|
229
|
+
})(Z),
|
|
230
|
+
ariaLabel: F.meterAriaLabel,
|
|
231
|
+
segments: me
|
|
210
232
|
}),
|
|
211
|
-
|
|
233
|
+
he && /* @__PURE__ */ v(ee, {
|
|
212
234
|
"data-testid": "psm-summary",
|
|
213
235
|
sx: {
|
|
214
236
|
mt: .5,
|
|
215
237
|
p: .5
|
|
216
238
|
},
|
|
217
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ _(g, {
|
|
218
240
|
variant: "caption",
|
|
219
241
|
gutterBottom: !0,
|
|
220
242
|
sx: {
|
|
221
243
|
display: "block",
|
|
222
244
|
fontSize: 14
|
|
223
245
|
},
|
|
224
|
-
children:
|
|
225
|
-
}), /* @__PURE__ */
|
|
246
|
+
children: F.summaryHeaderLabel
|
|
247
|
+
}), /* @__PURE__ */ v(m, {
|
|
226
248
|
direction: "row",
|
|
227
249
|
spacing: 6,
|
|
228
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ v(m, {
|
|
229
251
|
direction: "column",
|
|
230
252
|
children: [
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
label:
|
|
233
|
-
fulfilled:
|
|
234
|
-
checkColors:
|
|
253
|
+
/* @__PURE__ */ _(C, {
|
|
254
|
+
label: F.summaryMinChars.replace("{n}", String(M)),
|
|
255
|
+
fulfilled: Z.length >= M,
|
|
256
|
+
checkColors: N
|
|
235
257
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
label:
|
|
238
|
-
fulfilled:
|
|
239
|
-
checkColors:
|
|
258
|
+
/* @__PURE__ */ _(C, {
|
|
259
|
+
label: F.summaryCapitalLetter,
|
|
260
|
+
fulfilled: Z.hasUpper,
|
|
261
|
+
checkColors: N
|
|
240
262
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
label:
|
|
243
|
-
fulfilled:
|
|
244
|
-
checkColors:
|
|
263
|
+
/* @__PURE__ */ _(C, {
|
|
264
|
+
label: F.summaryLowerCaseLetter,
|
|
265
|
+
fulfilled: Z.hasLower,
|
|
266
|
+
checkColors: N
|
|
245
267
|
})
|
|
246
268
|
]
|
|
247
|
-
}), /* @__PURE__ */
|
|
269
|
+
}), /* @__PURE__ */ v(m, {
|
|
248
270
|
direction: "column",
|
|
249
271
|
children: [
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
label:
|
|
252
|
-
fulfilled:
|
|
253
|
-
checkColors:
|
|
272
|
+
/* @__PURE__ */ _(C, {
|
|
273
|
+
label: F.summaryNumber,
|
|
274
|
+
fulfilled: Z.hasDigit,
|
|
275
|
+
checkColors: N
|
|
254
276
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
label:
|
|
257
|
-
fulfilled:
|
|
258
|
-
checkColors:
|
|
277
|
+
/* @__PURE__ */ _(C, {
|
|
278
|
+
label: F.summarySpecialChar,
|
|
279
|
+
fulfilled: Z.hasSymbol,
|
|
280
|
+
checkColors: N
|
|
259
281
|
}),
|
|
260
|
-
|
|
282
|
+
de?.map((e, t) => /* @__PURE__ */ _(C, {
|
|
261
283
|
label: e.label,
|
|
262
|
-
fulfilled: typeof e.fulfilled == "function" ? e.fulfilled(
|
|
263
|
-
checkColors:
|
|
284
|
+
fulfilled: typeof e.fulfilled == "function" ? e.fulfilled(q) : e.fulfilled,
|
|
285
|
+
checkColors: N
|
|
264
286
|
}, t))
|
|
265
287
|
]
|
|
266
288
|
})]
|
|
@@ -269,4 +291,4 @@ function E({ value: x, confirmValue: S, name: E, inputRef: D, disabled: O = !1,
|
|
|
269
291
|
] });
|
|
270
292
|
}
|
|
271
293
|
//#endregion
|
|
272
|
-
export {
|
|
294
|
+
export { w as PasswordStrengthMeter };
|
|
@@ -40,6 +40,10 @@ export type PasswordStrengthMeterTranslation = {
|
|
|
40
40
|
confirmMatchLabel: string;
|
|
41
41
|
/** Shown when passwords do not match */
|
|
42
42
|
confirmMismatchLabel: string;
|
|
43
|
+
/** Tooltip for the copy-to-clipboard button @since 3.9.0 */
|
|
44
|
+
copyPasswordLabel?: string;
|
|
45
|
+
/** Tooltip shown briefly after a successful copy @since 3.9.0 */
|
|
46
|
+
copiedLabel?: string;
|
|
43
47
|
};
|
|
44
48
|
/**
|
|
45
49
|
* Options for the built-in password generator.
|
|
@@ -57,7 +61,7 @@ export type PasswordGeneratorOptions = {
|
|
|
57
61
|
/** Include symbols !@#$%^&*... (default: true) */
|
|
58
62
|
symbols?: boolean;
|
|
59
63
|
};
|
|
60
|
-
export declare const DEFAULT_PASSWORD_TRANSLATIONS: PasswordStrengthMeterTranslation
|
|
64
|
+
export declare const DEFAULT_PASSWORD_TRANSLATIONS: Required<PasswordStrengthMeterTranslation>;
|
|
61
65
|
export declare const DEFAULT_METER_COLORS: MeterColors;
|
|
62
66
|
export declare const DEFAULT_CHECK_COLORS: CheckColors;
|
|
63
67
|
/**
|
|
@@ -94,6 +98,8 @@ export type PasswordStrengthMeterProps = {
|
|
|
94
98
|
showSummary?: boolean;
|
|
95
99
|
/** Render the strength bar as 4 animated segments instead of a single growing bar. */
|
|
96
100
|
showSegmentedBar?: boolean;
|
|
101
|
+
/** Show a copy-to-clipboard button next to the password field (visible once a password is entered). */
|
|
102
|
+
showCopyButton?: boolean;
|
|
97
103
|
translation?: Partial<PasswordStrengthMeterTranslation>;
|
|
98
104
|
value?: string;
|
|
99
105
|
onPasswordChange?: (password: string, strengthResult: StrengthResult) => void;
|
|
@@ -13,7 +13,9 @@ var e = {
|
|
|
13
13
|
generatePasswordLabel: "Generate secure password",
|
|
14
14
|
confirmLabel: "Confirm password",
|
|
15
15
|
confirmMatchLabel: "Passwords match",
|
|
16
|
-
confirmMismatchLabel: "Passwords do not match"
|
|
16
|
+
confirmMismatchLabel: "Passwords do not match",
|
|
17
|
+
copyPasswordLabel: "Copy password",
|
|
18
|
+
copiedLabel: "Copied!"
|
|
17
19
|
}, t = {
|
|
18
20
|
weak: "#cc0000",
|
|
19
21
|
ok: "#fdc010",
|