@shafnas/react-password-validator 1.0.3 → 1.0.5
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.
|
@@ -1,148 +1,149 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import re, { useMemo as te } from "react";
|
|
2
|
+
import { Check as ne, X as ae } from "lucide-react";
|
|
3
|
+
var x = { exports: {} }, _ = {};
|
|
4
|
+
var F;
|
|
5
|
+
function oe() {
|
|
6
|
+
if (F) return _;
|
|
7
|
+
F = 1;
|
|
8
|
+
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), n = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
9
|
+
function o(f, s, u) {
|
|
10
|
+
var m = null;
|
|
11
|
+
if (u !== void 0 && (m = "" + u), s.key !== void 0 && (m = "" + s.key), "key" in s) {
|
|
12
|
+
u = {};
|
|
13
|
+
for (var b in s)
|
|
14
|
+
b !== "key" && (u[b] = s[b]);
|
|
15
|
+
} else u = s;
|
|
16
|
+
return s = u.ref, {
|
|
17
|
+
$$typeof: t,
|
|
18
|
+
type: f,
|
|
19
|
+
key: m,
|
|
20
|
+
ref: s !== void 0 ? s : null,
|
|
21
|
+
props: u
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
|
-
return _.Fragment =
|
|
24
|
+
return _.Fragment = n, _.jsx = o, _.jsxs = o, _;
|
|
24
25
|
}
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
function
|
|
28
|
-
return
|
|
29
|
-
function
|
|
26
|
+
var E = {};
|
|
27
|
+
var D;
|
|
28
|
+
function se() {
|
|
29
|
+
return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
30
|
+
function t(e) {
|
|
30
31
|
if (e == null) return null;
|
|
31
32
|
if (typeof e == "function")
|
|
32
|
-
return e.$$typeof ===
|
|
33
|
+
return e.$$typeof === Q ? null : e.displayName || e.name || null;
|
|
33
34
|
if (typeof e == "string") return e;
|
|
34
35
|
switch (e) {
|
|
35
36
|
case T:
|
|
36
37
|
return "Fragment";
|
|
37
|
-
case
|
|
38
|
+
case V:
|
|
38
39
|
return "Profiler";
|
|
39
|
-
case
|
|
40
|
+
case W:
|
|
40
41
|
return "StrictMode";
|
|
41
|
-
case
|
|
42
|
+
case X:
|
|
42
43
|
return "Suspense";
|
|
43
|
-
case
|
|
44
|
+
case Z:
|
|
44
45
|
return "SuspenseList";
|
|
45
|
-
case
|
|
46
|
+
case H:
|
|
46
47
|
return "Activity";
|
|
47
48
|
}
|
|
48
49
|
if (typeof e == "object")
|
|
49
50
|
switch (typeof e.tag == "number" && console.error(
|
|
50
51
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
51
52
|
), e.$$typeof) {
|
|
52
|
-
case
|
|
53
|
+
case U:
|
|
53
54
|
return "Portal";
|
|
54
|
-
case
|
|
55
|
+
case J:
|
|
55
56
|
return e.displayName || "Context";
|
|
56
|
-
case
|
|
57
|
+
case q:
|
|
57
58
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
58
|
-
case
|
|
59
|
-
var
|
|
60
|
-
return e = e.displayName, e || (e =
|
|
61
|
-
case
|
|
62
|
-
return
|
|
63
|
-
case
|
|
64
|
-
|
|
59
|
+
case G:
|
|
60
|
+
var r = e.render;
|
|
61
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
62
|
+
case B:
|
|
63
|
+
return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
|
|
64
|
+
case g:
|
|
65
|
+
r = e._payload, e = e._init;
|
|
65
66
|
try {
|
|
66
|
-
return
|
|
67
|
+
return t(e(r));
|
|
67
68
|
} catch {
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
return null;
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function n(e) {
|
|
73
74
|
return "" + e;
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
+
function o(e) {
|
|
76
77
|
try {
|
|
77
|
-
|
|
78
|
-
var
|
|
78
|
+
n(e);
|
|
79
|
+
var r = !1;
|
|
79
80
|
} catch {
|
|
80
|
-
|
|
81
|
+
r = !0;
|
|
81
82
|
}
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
var
|
|
85
|
-
return
|
|
86
|
-
|
|
83
|
+
if (r) {
|
|
84
|
+
r = console;
|
|
85
|
+
var a = r.error, l = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
86
|
+
return a.call(
|
|
87
|
+
r,
|
|
87
88
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
|
-
|
|
89
|
-
),
|
|
89
|
+
l
|
|
90
|
+
), n(e);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
+
function f(e) {
|
|
93
94
|
if (e === T) return "<>";
|
|
94
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
95
|
+
if (typeof e == "object" && e !== null && e.$$typeof === g)
|
|
95
96
|
return "<...>";
|
|
96
97
|
try {
|
|
97
|
-
var
|
|
98
|
-
return
|
|
98
|
+
var r = t(e);
|
|
99
|
+
return r ? "<" + r + ">" : "<...>";
|
|
99
100
|
} catch {
|
|
100
101
|
return "<...>";
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
-
var e =
|
|
104
|
+
function s() {
|
|
105
|
+
var e = h.A;
|
|
105
106
|
return e === null ? null : e.getOwner();
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
+
function u() {
|
|
108
109
|
return Error("react-stack-top-frame");
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
112
|
-
var
|
|
113
|
-
if (
|
|
111
|
+
function m(e) {
|
|
112
|
+
if (P.call(e, "key")) {
|
|
113
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
114
|
+
if (r && r.isReactWarning) return !1;
|
|
114
115
|
}
|
|
115
116
|
return e.key !== void 0;
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
-
function
|
|
119
|
-
|
|
118
|
+
function b(e, r) {
|
|
119
|
+
function a() {
|
|
120
|
+
w || (w = !0, console.error(
|
|
120
121
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
121
|
-
|
|
122
|
+
r
|
|
122
123
|
));
|
|
123
124
|
}
|
|
124
|
-
|
|
125
|
-
get:
|
|
125
|
+
a.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
126
|
+
get: a,
|
|
126
127
|
configurable: !0
|
|
127
128
|
});
|
|
128
129
|
}
|
|
129
|
-
function
|
|
130
|
-
var e =
|
|
131
|
-
return
|
|
130
|
+
function L() {
|
|
131
|
+
var e = t(this.type);
|
|
132
|
+
return $[e] || ($[e] = !0, console.error(
|
|
132
133
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
133
134
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
-
var
|
|
136
|
+
function M(e, r, a, l, p, j) {
|
|
137
|
+
var c = a.ref;
|
|
137
138
|
return e = {
|
|
138
|
-
$$typeof:
|
|
139
|
+
$$typeof: N,
|
|
139
140
|
type: e,
|
|
140
|
-
key:
|
|
141
|
-
props:
|
|
142
|
-
_owner:
|
|
143
|
-
}, (
|
|
141
|
+
key: r,
|
|
142
|
+
props: a,
|
|
143
|
+
_owner: l
|
|
144
|
+
}, (c !== void 0 ? c : null) !== null ? Object.defineProperty(e, "ref", {
|
|
144
145
|
enumerable: !1,
|
|
145
|
-
get:
|
|
146
|
+
get: L
|
|
146
147
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
147
148
|
configurable: !1,
|
|
148
149
|
enumerable: !1,
|
|
@@ -157,253 +158,177 @@ function ue() {
|
|
|
157
158
|
configurable: !1,
|
|
158
159
|
enumerable: !1,
|
|
159
160
|
writable: !0,
|
|
160
|
-
value:
|
|
161
|
+
value: p
|
|
161
162
|
}), Object.defineProperty(e, "_debugTask", {
|
|
162
163
|
configurable: !1,
|
|
163
164
|
enumerable: !1,
|
|
164
165
|
writable: !0,
|
|
165
|
-
value:
|
|
166
|
+
value: j
|
|
166
167
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
-
var
|
|
170
|
-
if (
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
for (
|
|
174
|
-
|
|
175
|
-
Object.freeze && Object.freeze(
|
|
169
|
+
function A(e, r, a, l, p, j) {
|
|
170
|
+
var c = r.children;
|
|
171
|
+
if (c !== void 0)
|
|
172
|
+
if (l)
|
|
173
|
+
if (K(c)) {
|
|
174
|
+
for (l = 0; l < c.length; l++)
|
|
175
|
+
S(c[l]);
|
|
176
|
+
Object.freeze && Object.freeze(c);
|
|
176
177
|
} else
|
|
177
178
|
console.error(
|
|
178
179
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
180
|
);
|
|
180
|
-
else
|
|
181
|
-
if (
|
|
182
|
-
|
|
183
|
-
var
|
|
184
|
-
return
|
|
181
|
+
else S(c);
|
|
182
|
+
if (P.call(r, "key")) {
|
|
183
|
+
c = t(e);
|
|
184
|
+
var d = Object.keys(r).filter(function(ee) {
|
|
185
|
+
return ee !== "key";
|
|
185
186
|
});
|
|
186
|
-
|
|
187
|
+
l = 0 < d.length ? "{key: someKey, " + d.join(": ..., ") + ": ...}" : "{key: someKey}", I[c + l] || (d = 0 < d.length ? "{" + d.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
188
|
`A props object containing a "key" prop is being spread into JSX:
|
|
188
189
|
let props = %s;
|
|
189
190
|
<%s {...props} />
|
|
190
191
|
React keys must be passed directly to JSX without using spread:
|
|
191
192
|
let props = %s;
|
|
192
193
|
<%s key={someKey} {...props} />`,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
),
|
|
194
|
+
l,
|
|
195
|
+
c,
|
|
196
|
+
d,
|
|
197
|
+
c
|
|
198
|
+
), I[c + l] = !0);
|
|
198
199
|
}
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
for (var
|
|
202
|
-
|
|
203
|
-
} else
|
|
204
|
-
return
|
|
205
|
-
|
|
200
|
+
if (c = null, a !== void 0 && (o(a), c = "" + a), m(r) && (o(r.key), c = "" + r.key), "key" in r) {
|
|
201
|
+
a = {};
|
|
202
|
+
for (var y in r)
|
|
203
|
+
y !== "key" && (a[y] = r[y]);
|
|
204
|
+
} else a = r;
|
|
205
|
+
return c && b(
|
|
206
|
+
a,
|
|
206
207
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
207
|
-
),
|
|
208
|
+
), M(
|
|
208
209
|
e,
|
|
209
|
-
i,
|
|
210
210
|
c,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
211
|
+
a,
|
|
212
|
+
s(),
|
|
213
|
+
p,
|
|
214
|
+
j
|
|
214
215
|
);
|
|
215
216
|
}
|
|
216
|
-
function P(e) {
|
|
217
|
-
S(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === y && (e._payload.status === "fulfilled" ? S(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
218
|
-
}
|
|
219
217
|
function S(e) {
|
|
220
|
-
|
|
218
|
+
O(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === g && (e._payload.status === "fulfilled" ? O(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
221
219
|
}
|
|
222
|
-
|
|
220
|
+
function O(e) {
|
|
221
|
+
return typeof e == "object" && e !== null && e.$$typeof === N;
|
|
222
|
+
}
|
|
223
|
+
var R = re, N = /* @__PURE__ */ Symbol.for("react.transitional.element"), U = /* @__PURE__ */ Symbol.for("react.portal"), T = /* @__PURE__ */ Symbol.for("react.fragment"), W = /* @__PURE__ */ Symbol.for("react.strict_mode"), V = /* @__PURE__ */ Symbol.for("react.profiler"), q = /* @__PURE__ */ Symbol.for("react.consumer"), J = /* @__PURE__ */ Symbol.for("react.context"), G = /* @__PURE__ */ Symbol.for("react.forward_ref"), X = /* @__PURE__ */ Symbol.for("react.suspense"), Z = /* @__PURE__ */ Symbol.for("react.suspense_list"), B = /* @__PURE__ */ Symbol.for("react.memo"), g = /* @__PURE__ */ Symbol.for("react.lazy"), H = /* @__PURE__ */ Symbol.for("react.activity"), Q = /* @__PURE__ */ Symbol.for("react.client.reference"), h = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, P = Object.prototype.hasOwnProperty, K = Array.isArray, k = console.createTask ? console.createTask : function() {
|
|
223
224
|
return null;
|
|
224
225
|
};
|
|
225
|
-
|
|
226
|
+
R = {
|
|
226
227
|
react_stack_bottom_frame: function(e) {
|
|
227
228
|
return e();
|
|
228
229
|
}
|
|
229
230
|
};
|
|
230
|
-
var
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
)(),
|
|
234
|
-
|
|
235
|
-
var
|
|
236
|
-
return
|
|
231
|
+
var w, $ = {}, C = R.react_stack_bottom_frame.bind(
|
|
232
|
+
R,
|
|
233
|
+
u
|
|
234
|
+
)(), Y = k(f(u)), I = {};
|
|
235
|
+
E.Fragment = T, E.jsx = function(e, r, a) {
|
|
236
|
+
var l = 1e4 > h.recentlyCreatedOwnerStacks++;
|
|
237
|
+
return A(
|
|
237
238
|
e,
|
|
238
|
-
|
|
239
|
-
|
|
239
|
+
r,
|
|
240
|
+
a,
|
|
240
241
|
!1,
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
l ? Error("react-stack-top-frame") : C,
|
|
243
|
+
l ? k(f(e)) : Y
|
|
243
244
|
);
|
|
244
|
-
},
|
|
245
|
-
var
|
|
246
|
-
return
|
|
245
|
+
}, E.jsxs = function(e, r, a) {
|
|
246
|
+
var l = 1e4 > h.recentlyCreatedOwnerStacks++;
|
|
247
|
+
return A(
|
|
247
248
|
e,
|
|
248
|
-
|
|
249
|
-
|
|
249
|
+
r,
|
|
250
|
+
a,
|
|
250
251
|
!0,
|
|
251
|
-
|
|
252
|
-
|
|
252
|
+
l ? Error("react-stack-top-frame") : C,
|
|
253
|
+
l ? k(f(e)) : Y
|
|
253
254
|
);
|
|
254
255
|
};
|
|
255
|
-
})()),
|
|
256
|
+
})()), E;
|
|
256
257
|
}
|
|
257
|
-
var
|
|
258
|
-
function
|
|
259
|
-
return
|
|
258
|
+
var z;
|
|
259
|
+
function le() {
|
|
260
|
+
return z || (z = 1, process.env.NODE_ENV === "production" ? x.exports = oe() : x.exports = se()), x.exports;
|
|
260
261
|
}
|
|
261
|
-
var
|
|
262
|
-
const
|
|
263
|
-
const
|
|
264
|
-
return { length:
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const be = (r) => r.replace(
|
|
269
|
-
/^([A-Z])|[\s-_]+(\w)/g,
|
|
270
|
-
(t, a, s) => s ? s.toUpperCase() : a.toLowerCase()
|
|
271
|
-
);
|
|
272
|
-
const z = (r) => {
|
|
273
|
-
const t = be(r);
|
|
274
|
-
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
275
|
-
};
|
|
276
|
-
var _e = {
|
|
277
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
278
|
-
width: 24,
|
|
279
|
-
height: 24,
|
|
280
|
-
viewBox: "0 0 24 24",
|
|
281
|
-
fill: "none",
|
|
282
|
-
stroke: "currentColor",
|
|
283
|
-
strokeWidth: 2,
|
|
284
|
-
strokeLinecap: "round",
|
|
285
|
-
strokeLinejoin: "round"
|
|
286
|
-
};
|
|
287
|
-
const pe = (r) => {
|
|
288
|
-
for (const t in r)
|
|
289
|
-
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
290
|
-
return !0;
|
|
291
|
-
return !1;
|
|
292
|
-
};
|
|
293
|
-
const ve = V(
|
|
294
|
-
({
|
|
295
|
-
color: r = "currentColor",
|
|
296
|
-
size: t = 24,
|
|
297
|
-
strokeWidth: a = 2,
|
|
298
|
-
absoluteStrokeWidth: s,
|
|
299
|
-
className: o = "",
|
|
300
|
-
children: l,
|
|
301
|
-
iconNode: d,
|
|
302
|
-
...m
|
|
303
|
-
}, k) => O(
|
|
304
|
-
"svg",
|
|
305
|
-
{
|
|
306
|
-
ref: k,
|
|
307
|
-
..._e,
|
|
308
|
-
width: t,
|
|
309
|
-
height: t,
|
|
310
|
-
stroke: r,
|
|
311
|
-
strokeWidth: s ? Number(a) * 24 / Number(t) : a,
|
|
312
|
-
className: q("lucide", o),
|
|
313
|
-
...!l && !pe(m) && { "aria-hidden": "true" },
|
|
314
|
-
...m
|
|
315
|
-
},
|
|
316
|
-
[
|
|
317
|
-
...d.map(([x, E]) => O(x, E)),
|
|
318
|
-
...Array.isArray(l) ? l : [l]
|
|
319
|
-
]
|
|
320
|
-
)
|
|
321
|
-
);
|
|
322
|
-
const J = (r, t) => {
|
|
323
|
-
const a = V(
|
|
324
|
-
({ className: s, ...o }, l) => O(ve, {
|
|
325
|
-
ref: l,
|
|
326
|
-
iconNode: t,
|
|
327
|
-
className: q(
|
|
328
|
-
`lucide-${me(z(r))}`,
|
|
329
|
-
`lucide-${r}`,
|
|
330
|
-
s
|
|
331
|
-
),
|
|
332
|
-
...o
|
|
333
|
-
})
|
|
334
|
-
);
|
|
335
|
-
return a.displayName = z(r), a;
|
|
336
|
-
};
|
|
337
|
-
const Ee = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], he = J("check", Ee);
|
|
338
|
-
const Re = [
|
|
339
|
-
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
340
|
-
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
341
|
-
], ge = J("x", Re), ke = (r) => {
|
|
342
|
-
let t = 0;
|
|
343
|
-
return r.length >= 2 && (t += 1), /[a-z]/.test(r) && (t += 1), /[A-Z]/.test(r) && (t += 1), /[0-9]/.test(r) && (t += 1), /[^A-Za-z0-9]/.test(r) && (t += 1), t <= 2 ? "weak" : t === 3 || t === 4 ? "medium" : "strong";
|
|
262
|
+
var i = le();
|
|
263
|
+
const ce = (t) => {
|
|
264
|
+
const n = t.length >= 8 && t.length <= 14, o = /[a-z]/.test(t), f = /[A-Z]/.test(t), s = /[0-9]/.test(t), u = /[^A-Za-z0-9]/.test(t);
|
|
265
|
+
return { length: n, lowercase: o, uppercase: f, number: s, symbol: u, valid: n && o && f && s && u };
|
|
266
|
+
}, ue = (t) => te(() => ce(t), [t]), ie = (t) => {
|
|
267
|
+
let n = 0;
|
|
268
|
+
return t.length >= 2 && (n += 1), /[a-z]/.test(t) && (n += 1), /[A-Z]/.test(t) && (n += 1), /[0-9]/.test(t) && (n += 1), /[^A-Za-z0-9]/.test(t) && (n += 1), n <= 2 ? "weak" : n === 3 || n === 4 ? "medium" : "strong";
|
|
344
269
|
}, v = ({
|
|
345
|
-
ok:
|
|
346
|
-
label:
|
|
347
|
-
className:
|
|
348
|
-
}) => /* @__PURE__ */
|
|
349
|
-
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
] }),
|
|
352
|
-
strength:
|
|
353
|
-
className:
|
|
270
|
+
ok: t,
|
|
271
|
+
label: n,
|
|
272
|
+
className: o = ""
|
|
273
|
+
}) => /* @__PURE__ */ i.jsxs("div", { className: `flex items-center gap-2 text-sm ${o}`, children: [
|
|
274
|
+
t ? /* @__PURE__ */ i.jsx(ne, { className: "w-4 h-4 text-green-600" }) : /* @__PURE__ */ i.jsx(ae, { className: "w-4 h-4 text-red-500" }),
|
|
275
|
+
/* @__PURE__ */ i.jsx("span", { className: t ? "text-green-600" : "text-gray-500", children: n })
|
|
276
|
+
] }), fe = ({
|
|
277
|
+
strength: t,
|
|
278
|
+
className: n = ""
|
|
354
279
|
}) => {
|
|
355
|
-
let
|
|
356
|
-
return
|
|
280
|
+
let o = "bg-red-500", f = "w-1/4";
|
|
281
|
+
return t === "medium" ? (o = "bg-yellow-400", f = "w-2/3") : t === "strong" && (o = "bg-green-600", f = "w-full"), /* @__PURE__ */ i.jsx("div", { className: `h-2 bg-gray-200 rounded-full mt-2 ${n}`, children: /* @__PURE__ */ i.jsx(
|
|
357
282
|
"div",
|
|
358
283
|
{
|
|
359
|
-
className: `${
|
|
284
|
+
className: `${f} ${o} h-2 rounded-full transition-all`
|
|
360
285
|
}
|
|
361
286
|
) });
|
|
362
|
-
},
|
|
363
|
-
password:
|
|
364
|
-
className:
|
|
365
|
-
itemClassName:
|
|
366
|
-
strengthBarClassName:
|
|
287
|
+
}, be = ({
|
|
288
|
+
password: t,
|
|
289
|
+
className: n = "",
|
|
290
|
+
itemClassName: o = "",
|
|
291
|
+
strengthBarClassName: f = ""
|
|
367
292
|
}) => {
|
|
368
|
-
const
|
|
369
|
-
return /* @__PURE__ */
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
293
|
+
const s = ue(t), u = ie(t);
|
|
294
|
+
return /* @__PURE__ */ i.jsxs("div", { className: `rounded-lg border p-4 shadow space-y-3 ${n}`, children: [
|
|
295
|
+
/* @__PURE__ */ i.jsxs("div", { className: "space-y-1", children: [
|
|
296
|
+
/* @__PURE__ */ i.jsx(
|
|
372
297
|
v,
|
|
373
298
|
{
|
|
374
|
-
ok:
|
|
299
|
+
ok: s.length,
|
|
375
300
|
label: "8–14 characters",
|
|
376
|
-
className:
|
|
301
|
+
className: o
|
|
377
302
|
}
|
|
378
303
|
),
|
|
379
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ i.jsx(
|
|
380
305
|
v,
|
|
381
306
|
{
|
|
382
|
-
ok:
|
|
307
|
+
ok: s.lowercase,
|
|
383
308
|
label: "Lowercase letter",
|
|
384
|
-
className:
|
|
309
|
+
className: o
|
|
385
310
|
}
|
|
386
311
|
),
|
|
387
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ i.jsx(
|
|
388
313
|
v,
|
|
389
314
|
{
|
|
390
|
-
ok:
|
|
315
|
+
ok: s.uppercase,
|
|
391
316
|
label: "Uppercase letter",
|
|
392
|
-
className:
|
|
317
|
+
className: o
|
|
393
318
|
}
|
|
394
319
|
),
|
|
395
|
-
/* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ i.jsx(v, { ok: s.number, label: "Number", className: o }),
|
|
321
|
+
/* @__PURE__ */ i.jsx(v, { ok: s.symbol, label: "Symbol", className: o })
|
|
397
322
|
] }),
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ i.jsx(fe, { strength: u, className: f }),
|
|
324
|
+
/* @__PURE__ */ i.jsxs("div", { className: "text-sm font-medium capitalize text-gray-700", children: [
|
|
400
325
|
"Strength: ",
|
|
401
|
-
|
|
326
|
+
u
|
|
402
327
|
] })
|
|
403
328
|
] });
|
|
404
329
|
};
|
|
405
330
|
export {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
331
|
+
be as PasswordValidator,
|
|
332
|
+
ue as usePasswordValidation,
|
|
333
|
+
ce as validatePassword
|
|
409
334
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(m
|
|
1
|
+
(function(d,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react"],m):(d=typeof globalThis<"u"?globalThis:d||self,m(d.ReactPasswordValidator={},d.React,d.LucideReact))})(this,(function(d,m,w){"use strict";var T={exports:{}},E={};var A;function q(){if(A)return E;A=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function o(f,s,u){var b=null;if(u!==void 0&&(b=""+u),s.key!==void 0&&(b=""+s.key),"key"in s){u={};for(var p in s)p!=="key"&&(u[p]=s[p])}else u=s;return s=u.ref,{$$typeof:t,type:f,key:b,ref:s!==void 0?s:null,props:u}}return E.Fragment=n,E.jsx=o,E.jsxs=o,E}var v={};var O;function J(){return O||(O=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ue?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case g:return"Fragment";case re:return"Profiler";case ee:return"StrictMode";case oe:return"Suspense";case se:return"SuspenseList";case ce:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case K:return"Portal";case ne:return e.displayName||"Context";case te:return(e._context.displayName||"Context")+".Consumer";case ae:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return r=e.displayName||null,r!==null?r:t(e.type)||"Memo";case k:r=e._payload,e=e._init;try{return t(e(r))}catch{}}return null}function n(e){return""+e}function o(e){try{n(e);var r=!1}catch{r=!0}if(r){r=console;var a=r.error,l=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",l),n(e)}}function f(e){if(e===g)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===k)return"<...>";try{var r=t(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function s(){var e=j.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function b(e){if(L.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function p(e,r){function a(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}function H(){var e=t(this.type);return V[e]||(V[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function Q(e,r,a,l,x,P){var c=a.ref;return e={$$typeof:D,type:e,key:r,props:a,_owner:l},(c!==void 0?c:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:H}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:x}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function $(e,r,a,l,x,P){var c=r.children;if(c!==void 0)if(l)if(ie(c)){for(l=0;l<c.length;l++)I(c[l]);Object.freeze&&Object.freeze(c)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else I(c);if(L.call(r,"key")){c=t(e);var _=Object.keys(r).filter(function(fe){return fe!=="key"});l=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",W[c+l]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,
|
|
6
|
+
<%s key={someKey} {...props} />`,l,c,_,c),W[c+l]=!0)}if(c=null,a!==void 0&&(o(a),c=""+a),b(r)&&(o(r.key),c=""+r.key),"key"in r){a={};for(var S in r)S!=="key"&&(a[S]=r[S])}else a=r;return c&&p(a,typeof e=="function"?e.displayName||e.name||"Unknown":e),Q(e,c,a,s(),x,P)}function I(e){F(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===k&&(e._payload.status==="fulfilled"?F(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function F(e){return typeof e=="object"&&e!==null&&e.$$typeof===D}var h=m,D=Symbol.for("react.transitional.element"),K=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),ee=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),te=Symbol.for("react.consumer"),ne=Symbol.for("react.context"),ae=Symbol.for("react.forward_ref"),oe=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),ue=Symbol.for("react.client.reference"),j=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,ie=Array.isArray,y=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(e){return e()}};var M,V={},z=h.react_stack_bottom_frame.bind(h,u)(),U=y(f(u)),W={};v.Fragment=g,v.jsx=function(e,r,a){var l=1e4>j.recentlyCreatedOwnerStacks++;return $(e,r,a,!1,l?Error("react-stack-top-frame"):z,l?y(f(e)):U)},v.jsxs=function(e,r,a){var l=1e4>j.recentlyCreatedOwnerStacks++;return $(e,r,a,!0,l?Error("react-stack-top-frame"):z,l?y(f(e)):U)}})()),v}var N;function G(){return N||(N=1,process.env.NODE_ENV==="production"?T.exports=q():T.exports=J()),T.exports}var i=G();const C=t=>{const n=t.length>=8&&t.length<=14,o=/[a-z]/.test(t),f=/[A-Z]/.test(t),s=/[0-9]/.test(t),u=/[^A-Za-z0-9]/.test(t);return{length:n,lowercase:o,uppercase:f,number:s,symbol:u,valid:n&&o&&f&&s&&u}},Y=t=>m.useMemo(()=>C(t),[t]),X=t=>{let n=0;return t.length>=2&&(n+=1),/[a-z]/.test(t)&&(n+=1),/[A-Z]/.test(t)&&(n+=1),/[0-9]/.test(t)&&(n+=1),/[^A-Za-z0-9]/.test(t)&&(n+=1),n<=2?"weak":n===3||n===4?"medium":"strong"},R=({ok:t,label:n,className:o=""})=>i.jsxs("div",{className:`flex items-center gap-2 text-sm ${o}`,children:[t?i.jsx(w.Check,{className:"w-4 h-4 text-green-600"}):i.jsx(w.X,{className:"w-4 h-4 text-red-500"}),i.jsx("span",{className:t?"text-green-600":"text-gray-500",children:n})]}),Z=({strength:t,className:n=""})=>{let o="bg-red-500",f="w-1/4";return t==="medium"?(o="bg-yellow-400",f="w-2/3"):t==="strong"&&(o="bg-green-600",f="w-full"),i.jsx("div",{className:`h-2 bg-gray-200 rounded-full mt-2 ${n}`,children:i.jsx("div",{className:`${f} ${o} h-2 rounded-full transition-all`})})},B=({password:t,className:n="",itemClassName:o="",strengthBarClassName:f=""})=>{const s=Y(t),u=X(t);return i.jsxs("div",{className:`rounded-lg border p-4 shadow space-y-3 ${n}`,children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(R,{ok:s.length,label:"8–14 characters",className:o}),i.jsx(R,{ok:s.lowercase,label:"Lowercase letter",className:o}),i.jsx(R,{ok:s.uppercase,label:"Uppercase letter",className:o}),i.jsx(R,{ok:s.number,label:"Number",className:o}),i.jsx(R,{ok:s.symbol,label:"Symbol",className:o})]}),i.jsx(Z,{strength:u,className:f}),i.jsxs("div",{className:"text-sm font-medium capitalize text-gray-700",children:["Strength: ",u]})]})};d.PasswordValidator=B,d.usePasswordValidation=Y,d.validatePassword=C,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|