kiban-design-system 3.5.0 → 3.7.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/dist/components/register-form.d.ts +3 -1
- package/dist/components/register-form.d.ts.map +1 -1
- package/dist/components/register-form.js +84 -81
- package/dist/components/reset-password-form.d.ts.map +1 -1
- package/dist/components/reset-password-form.js +116 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +60 -58
- package/package.json +1 -1
|
@@ -23,6 +23,8 @@ interface IRegisterFormProps extends React.ComponentProps<"div"> {
|
|
|
23
23
|
passwordPlaceholder?: string;
|
|
24
24
|
emailFormatError?: string;
|
|
25
25
|
showPasswordTitle?: string;
|
|
26
|
+
passwordPattern?: RegExp | string;
|
|
27
|
+
passwordPatternError?: string;
|
|
26
28
|
signInButtonProps?: {
|
|
27
29
|
text?: string;
|
|
28
30
|
onClick?: () => void;
|
|
@@ -34,6 +36,6 @@ interface IRegisterFormProps extends React.ComponentProps<"div"> {
|
|
|
34
36
|
error?: TErrorAlert;
|
|
35
37
|
isLoading?: boolean;
|
|
36
38
|
}
|
|
37
|
-
export declare function RegisterForm({ className, logo, title, description, onSubmit, email, names, lastName, password, onEmailChange, onPasswordChange, onNamesChange, onLastNameChange, submitButtonText, emailLabel, emailPlaceholder, namesLabel, namesPlaceholder, lastNameLabel, lastNamePlaceholder, passwordLabel, passwordPlaceholder, emailFormatError, showPasswordTitle, signInButtonProps, footerLinks, error, isLoading, ...props }: IRegisterFormProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare function RegisterForm({ className, logo, title, description, onSubmit, email, names, lastName, password, onEmailChange, onPasswordChange, onNamesChange, onLastNameChange, submitButtonText, emailLabel, emailPlaceholder, namesLabel, namesPlaceholder, lastNameLabel, lastNamePlaceholder, passwordLabel, passwordPlaceholder, emailFormatError, showPasswordTitle, passwordPattern, passwordPatternError, signInButtonProps, footerLinks, error, isLoading, ...props }: IRegisterFormProps): import("react/jsx-runtime").JSX.Element;
|
|
38
40
|
export {};
|
|
39
41
|
//# sourceMappingURL=register-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-form.d.ts","sourceRoot":"","sources":["../../src/components/register-form.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;KACtB,CAAC;IACF,WAAW,CAAC,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,UAAiC,EACjC,gBAAwC,EACxC,UAAwB,EACxB,gBAA+B,EAC/B,aAA6B,EAC7B,mBAAqC,EACrC,aAA4B,EAC5B,mBAAkD,EAClD,gBAA6D,EAC7D,iBAA4C,EAC5C,iBAAiB,EACjB,WAAgB,EAChB,KAAK,EACL,SAAiB,EACjB,GAAG,KAAK,EACT,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"register-form.d.ts","sourceRoot":"","sources":["../../src/components/register-form.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CA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WAAW,EACX,QAAQ,EACR,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,UAAiC,EACjC,gBAAwC,EACxC,UAAwB,EACxB,gBAA+B,EAC/B,aAA6B,EAC7B,mBAAqC,EACrC,aAA4B,EAC5B,mBAAkD,EAClD,gBAA6D,EAC7D,iBAA4C,EAC5C,eAAe,EACf,oBAAmE,EACnE,iBAAiB,EACjB,WAAgB,EAChB,KAAK,EACL,SAAiB,EACjB,GAAG,KAAK,EACT,EAAE,kBAAkB,2CAmIpB"}
|
|
@@ -1,119 +1,122 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { isEmailValid as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { FieldGroup as
|
|
5
|
-
import { TextField as
|
|
6
|
-
import { useState as
|
|
7
|
-
import { EyeOffIcon as
|
|
8
|
-
import { Spinner as
|
|
9
|
-
import { AuthCard as
|
|
10
|
-
function
|
|
2
|
+
import { isEmailValid as f } from "../lib/utils.js";
|
|
3
|
+
import { Button as K } from "./ui/button.js";
|
|
4
|
+
import { FieldGroup as M, Field as Q } from "./ui/field.js";
|
|
5
|
+
import { TextField as a } from "./text-field.js";
|
|
6
|
+
import { useState as U } from "react";
|
|
7
|
+
import { EyeOffIcon as W, EyeIcon as X } from "lucide-react";
|
|
8
|
+
import { Spinner as Y } from "./ui/spinner.js";
|
|
9
|
+
import { AuthCard as Z, AuthCardFooter as _ } from "./auth-card.js";
|
|
10
|
+
function ce({
|
|
11
11
|
className: h,
|
|
12
|
-
logo:
|
|
13
|
-
title:
|
|
14
|
-
description:
|
|
15
|
-
onSubmit:
|
|
16
|
-
email:
|
|
17
|
-
names:
|
|
18
|
-
lastName:
|
|
19
|
-
password:
|
|
20
|
-
onEmailChange:
|
|
21
|
-
onPasswordChange:
|
|
22
|
-
onNamesChange:
|
|
23
|
-
onLastNameChange:
|
|
24
|
-
submitButtonText:
|
|
25
|
-
emailLabel:
|
|
26
|
-
emailPlaceholder:
|
|
27
|
-
namesLabel:
|
|
28
|
-
namesPlaceholder:
|
|
29
|
-
lastNameLabel:
|
|
30
|
-
lastNamePlaceholder:
|
|
31
|
-
passwordLabel:
|
|
32
|
-
passwordPlaceholder:
|
|
33
|
-
emailFormatError:
|
|
12
|
+
logo: x,
|
|
13
|
+
title: b,
|
|
14
|
+
description: v,
|
|
15
|
+
onSubmit: g,
|
|
16
|
+
email: l,
|
|
17
|
+
names: s,
|
|
18
|
+
lastName: m,
|
|
19
|
+
password: t,
|
|
20
|
+
onEmailChange: C,
|
|
21
|
+
onPasswordChange: y,
|
|
22
|
+
onNamesChange: F,
|
|
23
|
+
onLastNameChange: E,
|
|
24
|
+
submitButtonText: j,
|
|
25
|
+
emailLabel: A = "Correo electrónico",
|
|
26
|
+
emailPlaceholder: N = "ej. email@kiban.com",
|
|
27
|
+
namesLabel: S = "Nombre(s)",
|
|
28
|
+
namesPlaceholder: w = "ej. Andrés",
|
|
29
|
+
lastNameLabel: V = "Apellido(s)",
|
|
30
|
+
lastNamePlaceholder: q = "ej. Hernández",
|
|
31
|
+
passwordLabel: z = "Contraseña",
|
|
32
|
+
passwordPlaceholder: P = "Ingresa aquí tu contraseña",
|
|
33
|
+
emailFormatError: R = "Formato de correo electrónico incorrecto",
|
|
34
34
|
showPasswordTitle: k = "Show and hide password",
|
|
35
|
-
|
|
35
|
+
passwordPattern: i,
|
|
36
|
+
passwordPatternError: D = "La contraseña no cumple con los requisitos",
|
|
37
|
+
signInButtonProps: c,
|
|
36
38
|
footerLinks: p = [],
|
|
37
|
-
error:
|
|
38
|
-
isLoading:
|
|
39
|
-
...
|
|
39
|
+
error: G,
|
|
40
|
+
isLoading: o = !1,
|
|
41
|
+
...H
|
|
40
42
|
}) {
|
|
41
|
-
const [
|
|
43
|
+
const [n, I] = U(!1), O = () => I(!n), u = i ? t ? typeof i == "string" ? new RegExp(i).test(t) : i.test(t) : !1 : !0, T = i && t && t.trim() && !u ? D : void 0, B = !l?.trim() || !t?.trim() || !s?.trim() || !m?.trim() || !f(l ?? "") || !u || o, J = l && l.trim() && !f(l) ? R : void 0;
|
|
42
44
|
return /* @__PURE__ */ e(
|
|
43
|
-
|
|
45
|
+
Z,
|
|
44
46
|
{
|
|
45
47
|
className: h,
|
|
46
|
-
title:
|
|
47
|
-
description:
|
|
48
|
-
logo:
|
|
49
|
-
error:
|
|
50
|
-
renderForm: () => /* @__PURE__ */ d(
|
|
48
|
+
title: b,
|
|
49
|
+
description: v,
|
|
50
|
+
logo: x,
|
|
51
|
+
error: G,
|
|
52
|
+
renderForm: () => /* @__PURE__ */ d(M, { className: "flex flex-col gap-3", children: [
|
|
51
53
|
/* @__PURE__ */ e(
|
|
52
|
-
|
|
54
|
+
a,
|
|
53
55
|
{
|
|
54
|
-
label:
|
|
55
|
-
disabled:
|
|
56
|
-
error:
|
|
56
|
+
label: A,
|
|
57
|
+
disabled: o,
|
|
58
|
+
error: J,
|
|
57
59
|
inputProps: {
|
|
58
|
-
placeholder:
|
|
60
|
+
placeholder: N,
|
|
59
61
|
type: "email",
|
|
60
|
-
value:
|
|
61
|
-
onChange: (r) =>
|
|
62
|
+
value: l,
|
|
63
|
+
onChange: (r) => C?.(r.target.value)
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
),
|
|
65
67
|
/* @__PURE__ */ d("div", { className: "flex flex-row gap-3", children: [
|
|
66
68
|
/* @__PURE__ */ e(
|
|
67
|
-
|
|
69
|
+
a,
|
|
68
70
|
{
|
|
69
|
-
label:
|
|
70
|
-
disabled:
|
|
71
|
+
label: S,
|
|
72
|
+
disabled: o,
|
|
71
73
|
inputProps: {
|
|
72
|
-
placeholder:
|
|
74
|
+
placeholder: w,
|
|
73
75
|
type: "text",
|
|
74
|
-
value:
|
|
75
|
-
onChange: (r) =>
|
|
76
|
+
value: s,
|
|
77
|
+
onChange: (r) => F?.(r.target.value)
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
),
|
|
79
81
|
/* @__PURE__ */ e(
|
|
80
|
-
|
|
82
|
+
a,
|
|
81
83
|
{
|
|
82
|
-
label:
|
|
83
|
-
disabled:
|
|
84
|
+
label: V,
|
|
85
|
+
disabled: o,
|
|
84
86
|
inputProps: {
|
|
85
|
-
placeholder:
|
|
87
|
+
placeholder: q,
|
|
86
88
|
type: "text",
|
|
87
|
-
value:
|
|
88
|
-
onChange: (r) =>
|
|
89
|
+
value: m,
|
|
90
|
+
onChange: (r) => E?.(r.target.value)
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
)
|
|
92
94
|
] }),
|
|
93
95
|
/* @__PURE__ */ e(
|
|
94
|
-
|
|
96
|
+
a,
|
|
95
97
|
{
|
|
96
|
-
label:
|
|
97
|
-
disabled:
|
|
98
|
+
label: z,
|
|
99
|
+
disabled: o,
|
|
100
|
+
error: T,
|
|
98
101
|
inputProps: {
|
|
99
|
-
placeholder:
|
|
100
|
-
type:
|
|
101
|
-
value:
|
|
102
|
-
onChange: (r) =>
|
|
102
|
+
placeholder: P,
|
|
103
|
+
type: n ? "text" : "password",
|
|
104
|
+
value: t,
|
|
105
|
+
onChange: (r) => y?.(r.target.value)
|
|
103
106
|
},
|
|
104
107
|
action: {
|
|
105
108
|
title: k,
|
|
106
|
-
onClick:
|
|
107
|
-
icon:
|
|
109
|
+
onClick: O,
|
|
110
|
+
icon: n ? /* @__PURE__ */ e(W, {}) : /* @__PURE__ */ e(X, {})
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
),
|
|
111
|
-
/* @__PURE__ */ e(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
/* @__PURE__ */ e(Q, { className: "flex flex-col", children: /* @__PURE__ */ d(K, { type: "submit", size: "lg", disabled: B, children: [
|
|
115
|
+
o ? /* @__PURE__ */ e(Y, {}) : null,
|
|
116
|
+
j
|
|
114
117
|
] }) })
|
|
115
118
|
] }),
|
|
116
|
-
renderFooter: p.length > 0 ? () => /* @__PURE__ */ e(
|
|
119
|
+
renderFooter: p.length > 0 ? () => /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e("div", { className: "flex gap-4 flex-wrap", children: p.map((r) => /* @__PURE__ */ e(
|
|
117
120
|
"a",
|
|
118
121
|
{
|
|
119
122
|
href: r.href,
|
|
@@ -122,16 +125,16 @@ function oe({
|
|
|
122
125
|
},
|
|
123
126
|
r.text
|
|
124
127
|
)) }) }) : void 0,
|
|
125
|
-
extraAction:
|
|
126
|
-
text:
|
|
127
|
-
onClick:
|
|
128
|
-
disabled:
|
|
128
|
+
extraAction: c ? {
|
|
129
|
+
text: c.text,
|
|
130
|
+
onClick: c.onClick,
|
|
131
|
+
disabled: o
|
|
129
132
|
} : void 0,
|
|
130
|
-
onSubmit:
|
|
131
|
-
...
|
|
133
|
+
onSubmit: g,
|
|
134
|
+
...H
|
|
132
135
|
}
|
|
133
136
|
);
|
|
134
137
|
}
|
|
135
138
|
export {
|
|
136
|
-
|
|
139
|
+
ce as RegisterForm
|
|
137
140
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-password-form.d.ts","sourceRoot":"","sources":["../../src/components/reset-password-form.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AAEpB,UAAU,uBAAwB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,uBAAuB,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,0BAA0B,CAAC,EAAE,MAAM,CAAC;QACpC,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAChC,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,WAAW,CAAC,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;KACzB,CAAC;CACH;AAED,wBAAgB,iBAAiB,CAAC,EAChC,SAAS,EACT,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,WAAgB,EAChB,KAAK,EACL,SAAiB,EACjB,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"reset-password-form.d.ts","sourceRoot":"","sources":["../../src/components/reset-password-form.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AAEp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AuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,WAAgB,EAChB,KAAK,EACL,SAAiB,EACjB,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,uBAAuB,2CAoIzB"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { Button as $ } from "./ui/button.js";
|
|
3
|
+
import { FieldGroup as q, Field as J } from "./ui/field.js";
|
|
4
|
+
import { TextField as f } from "./text-field.js";
|
|
5
|
+
import { useState as p } from "react";
|
|
6
|
+
import { CheckCircle2Icon as K, EyeOffIcon as u, EyeIcon as w } from "lucide-react";
|
|
7
|
+
import { Spinner as Q } from "./ui/spinner.js";
|
|
8
|
+
import { AuthCard as U, AuthCardFooter as X } from "./auth-card.js";
|
|
9
|
+
import { Alert as Y, AlertTitle as Z, AlertDescription as ee, AlertActions as re } from "./ui/alert.js";
|
|
10
|
+
function me({
|
|
11
|
+
className: g,
|
|
12
|
+
logo: v,
|
|
13
|
+
title: x,
|
|
14
|
+
description: b,
|
|
15
|
+
onSubmit: C,
|
|
16
|
+
password: t,
|
|
17
|
+
confirmPassword: a,
|
|
18
|
+
onPasswordChange: E,
|
|
19
|
+
onConfirmPasswordChange: F,
|
|
20
|
+
submitButtonText: N,
|
|
21
|
+
passwordFieldProps: P,
|
|
22
|
+
footerLinks: c = [],
|
|
23
|
+
error: S,
|
|
24
|
+
isLoading: n = !1,
|
|
25
|
+
successAlertProps: o,
|
|
26
|
+
...y
|
|
27
|
+
}) {
|
|
28
|
+
const [l, M] = p(!1), [s, D] = p(!1), I = () => M(!l), T = () => D(!s), {
|
|
29
|
+
passwordLabel: A = "Nueva contraseña",
|
|
30
|
+
passwordPlaceholder: L = "Nueva contraseña",
|
|
31
|
+
confirmPasswordLabel: V = "Confirma tu nueva contraseña",
|
|
32
|
+
confirmPasswordPlaceholder: j = "Confirma tu contraseña",
|
|
33
|
+
passwordMinLengthError: k,
|
|
34
|
+
passwordMismatchError: B = "Las contraseñas no coinciden",
|
|
35
|
+
showPasswordTitle: d = "Show and hide password"
|
|
36
|
+
} = P || {}, m = 12, h = t && t.trim().length >= m, G = !t?.trim() || !a?.trim() || !h || t !== a || n, O = `La contraseña debe tener al menos ${m} caracteres`, R = t && t.trim() && !h ? k || O : void 0, _ = a && a.trim() && t !== a ? B : void 0, z = o ? /* @__PURE__ */ i(Y, { variant: "success", children: [
|
|
37
|
+
/* @__PURE__ */ e(K, {}),
|
|
38
|
+
/* @__PURE__ */ e(Z, { children: o.title }),
|
|
39
|
+
/* @__PURE__ */ e(ee, { children: o.description }),
|
|
40
|
+
o.actions && o.actions.length > 0 && /* @__PURE__ */ e(re, { actions: o.actions })
|
|
41
|
+
] }) : null, H = o ? null : /* @__PURE__ */ i(q, { className: "flex flex-col gap-3", children: [
|
|
42
|
+
/* @__PURE__ */ e(
|
|
43
|
+
f,
|
|
44
|
+
{
|
|
45
|
+
label: A,
|
|
46
|
+
disabled: n,
|
|
47
|
+
error: R,
|
|
48
|
+
inputProps: {
|
|
49
|
+
placeholder: L,
|
|
50
|
+
type: l ? "text" : "password",
|
|
51
|
+
value: t,
|
|
52
|
+
onChange: (r) => E?.(r.target.value)
|
|
53
|
+
},
|
|
54
|
+
action: {
|
|
55
|
+
title: d,
|
|
56
|
+
onClick: I,
|
|
57
|
+
icon: l ? /* @__PURE__ */ e(u, {}) : /* @__PURE__ */ e(w, {})
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ e(
|
|
62
|
+
f,
|
|
63
|
+
{
|
|
64
|
+
label: V,
|
|
65
|
+
disabled: n,
|
|
66
|
+
error: _,
|
|
67
|
+
inputProps: {
|
|
68
|
+
placeholder: j,
|
|
69
|
+
type: s ? "text" : "password",
|
|
70
|
+
value: a,
|
|
71
|
+
onChange: (r) => F?.(r.target.value),
|
|
72
|
+
onPaste: (r) => {
|
|
73
|
+
r.preventDefault();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
action: {
|
|
77
|
+
title: d,
|
|
78
|
+
onClick: T,
|
|
79
|
+
icon: s ? /* @__PURE__ */ e(u, {}) : /* @__PURE__ */ e(w, {})
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ e(J, { className: "flex flex-col", children: /* @__PURE__ */ i($, { type: "submit", size: "lg", disabled: G, children: [
|
|
84
|
+
n ? /* @__PURE__ */ e(Q, {}) : null,
|
|
85
|
+
N
|
|
86
|
+
] }) })
|
|
87
|
+
] });
|
|
88
|
+
return /* @__PURE__ */ e(
|
|
89
|
+
U,
|
|
90
|
+
{
|
|
91
|
+
className: g,
|
|
92
|
+
title: x,
|
|
93
|
+
description: b,
|
|
94
|
+
logo: v,
|
|
95
|
+
error: S,
|
|
96
|
+
renderForm: () => /* @__PURE__ */ i(W, { children: [
|
|
97
|
+
z,
|
|
98
|
+
H
|
|
99
|
+
] }),
|
|
100
|
+
renderFooter: c.length > 0 ? () => /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e("div", { className: "flex gap-4 flex-wrap", children: c.map((r) => /* @__PURE__ */ e(
|
|
101
|
+
"a",
|
|
102
|
+
{
|
|
103
|
+
href: r.href,
|
|
104
|
+
className: "hover:underline",
|
|
105
|
+
children: r.text
|
|
106
|
+
},
|
|
107
|
+
r.text
|
|
108
|
+
)) }) }) : void 0,
|
|
109
|
+
onSubmit: C,
|
|
110
|
+
...y
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
me as ResetPasswordForm
|
|
116
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { ForgotPasswordForm } from "./components/forgot-password-form";
|
|
|
3
3
|
export { Labelled } from "./components/labelled";
|
|
4
4
|
export { LoginForm } from "./components/login-form";
|
|
5
5
|
export { RegisterForm } from "./components/register-form";
|
|
6
|
+
export { ResetPasswordForm } from "./components/reset-password-form";
|
|
6
7
|
export { OTPField } from "./components/otp-field";
|
|
7
8
|
export { OTPForm } from "./components/otp-form";
|
|
8
9
|
export { TextField } from "./components/text-field";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,iBAA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uBAAuB,CAAC;AAC/B,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,67 +1,69 @@
|
|
|
1
1
|
import { AuthCard as t, AuthCardFooter as e } from "./components/auth-card.js";
|
|
2
2
|
import { ForgotPasswordForm as n } from "./components/forgot-password-form.js";
|
|
3
3
|
import { Labelled as a } from "./components/labelled.js";
|
|
4
|
-
import { LoginForm as
|
|
5
|
-
import { RegisterForm as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
4
|
+
import { LoginForm as m } from "./components/login-form.js";
|
|
5
|
+
import { RegisterForm as x } from "./components/register-form.js";
|
|
6
|
+
import { ResetPasswordForm as f } from "./components/reset-password-form.js";
|
|
7
|
+
import { OTPField as T } from "./components/otp-field.js";
|
|
8
|
+
import { OTPForm as C } from "./components/otp-form.js";
|
|
9
|
+
import { TextField as G } from "./components/text-field.js";
|
|
10
|
+
import { Alert as A, AlertDescription as O, AlertTitle as S } from "./components/ui/alert.js";
|
|
11
|
+
import { Button as b, buttonVariants as c } from "./components/ui/button.js";
|
|
12
|
+
import { Card as D, CardAction as h, CardContent as w, CardDescription as B, CardFooter as R, CardHeader as E, CardTitle as H } from "./components/ui/card.js";
|
|
13
|
+
import { Field as j, FieldContent as k, FieldDescription as q, FieldError as v, FieldGroup as y, FieldLabel as z, FieldLegend as J, FieldSeparator as K, FieldSet as M, FieldTitle as N } from "./components/ui/field.js";
|
|
14
|
+
import { InputGroup as U, InputGroupAddon as W, InputGroupButton as X, InputGroupInput as Y, InputGroupText as Z, InputGroupTextarea as _ } from "./components/ui/input-group.js";
|
|
15
|
+
import { InputOTP as rr, InputOTPGroup as or, InputOTPSeparator as tr, InputOTPSlot as er } from "./components/ui/input-otp.js";
|
|
16
|
+
import { Input as nr } from "./components/ui/input.js";
|
|
17
|
+
import { Label as ar } from "./components/ui/label.js";
|
|
18
|
+
import { Separator as mr } from "./components/ui/separator.js";
|
|
19
|
+
import { Spinner as xr } from "./components/ui/spinner.js";
|
|
20
|
+
import { Textarea as fr } from "./components/ui/textarea.js";
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
A as Alert,
|
|
23
|
+
O as AlertDescription,
|
|
24
|
+
S as AlertTitle,
|
|
24
25
|
t as AuthCard,
|
|
25
26
|
e as AuthCardFooter,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
b as Button,
|
|
28
|
+
D as Card,
|
|
29
|
+
h as CardAction,
|
|
30
|
+
w as CardContent,
|
|
31
|
+
B as CardDescription,
|
|
32
|
+
R as CardFooter,
|
|
33
|
+
E as CardHeader,
|
|
34
|
+
H as CardTitle,
|
|
35
|
+
j as Field,
|
|
36
|
+
k as FieldContent,
|
|
37
|
+
q as FieldDescription,
|
|
38
|
+
v as FieldError,
|
|
39
|
+
y as FieldGroup,
|
|
40
|
+
z as FieldLabel,
|
|
41
|
+
J as FieldLegend,
|
|
42
|
+
K as FieldSeparator,
|
|
43
|
+
M as FieldSet,
|
|
44
|
+
N as FieldTitle,
|
|
44
45
|
n as ForgotPasswordForm,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
nr as Input,
|
|
47
|
+
U as InputGroup,
|
|
48
|
+
W as InputGroupAddon,
|
|
49
|
+
X as InputGroupButton,
|
|
50
|
+
Y as InputGroupInput,
|
|
51
|
+
Z as InputGroupText,
|
|
52
|
+
_ as InputGroupTextarea,
|
|
53
|
+
rr as InputOTP,
|
|
54
|
+
or as InputOTPGroup,
|
|
55
|
+
tr as InputOTPSeparator,
|
|
56
|
+
er as InputOTPSlot,
|
|
57
|
+
ar as Label,
|
|
57
58
|
a as Labelled,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
m as LoginForm,
|
|
60
|
+
T as OTPField,
|
|
61
|
+
C as OTPForm,
|
|
62
|
+
x as RegisterForm,
|
|
63
|
+
f as ResetPasswordForm,
|
|
64
|
+
mr as Separator,
|
|
65
|
+
xr as Spinner,
|
|
66
|
+
G as TextField,
|
|
67
|
+
fr as Textarea,
|
|
68
|
+
c as buttonVariants
|
|
67
69
|
};
|