@better-auth-ui/heroui 1.6.4 → 1.6.6
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/auth/delete-user/danger-zone.d.ts +3 -2
- package/dist/components/auth/delete-user/danger-zone.js +1 -1
- package/dist/components/auth/delete-user/delete-user.js +53 -53
- package/dist/components/auth/forgot-password.js +67 -48
- package/dist/components/auth/sign-in.js +72 -67
- package/dist/components/auth/sign-up.js +82 -77
- package/dist/components/auth/theme/theme-toggle-item.js +50 -46
- package/dist/components/auth/user/user-button.d.ts +27 -2
- package/dist/components/auth/user/user-button.js +48 -29
- package/dist/components/auth/username/sign-in-username.js +80 -74
- package/dist/components/auth/username/username-field.js +4 -2
- package/package.json +12 -12
- package/src/components/auth/delete-user/danger-zone.tsx +10 -3
- package/src/components/auth/delete-user/delete-user.tsx +2 -7
- package/src/components/auth/forgot-password.tsx +29 -7
- package/src/components/auth/sign-in.tsx +13 -1
- package/src/components/auth/sign-up.tsx +12 -2
- package/src/components/auth/theme/theme-toggle-item.tsx +2 -1
- package/src/components/auth/user/user-button.tsx +80 -13
- package/src/components/auth/username/sign-in-username.tsx +40 -24
- package/src/components/auth/username/username-field.tsx +4 -2
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CardProps } from '@heroui/react';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
|
-
export type DangerZoneProps =
|
|
3
|
+
export type DangerZoneProps = {
|
|
4
|
+
className?: string;
|
|
4
5
|
variant?: CardProps["variant"];
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
8
|
* Renders the danger zone heading and {@link DeleteUser}.
|
|
8
9
|
* Registered as a `securityCard` by `deleteUserPlugin()`; gate by registering the plugin.
|
|
9
10
|
*/
|
|
10
|
-
export declare function DangerZone({ className, variant, ...props }: DangerZoneProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function DangerZone({ className, variant, ...props }: DangerZoneProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,7 +9,7 @@ function a({ className: a, variant: o, ...s }) {
|
|
|
9
9
|
className: n("flex w-full flex-col", a),
|
|
10
10
|
...s,
|
|
11
11
|
children: [/* @__PURE__ */ r("h2", {
|
|
12
|
-
className: n("text-sm font-semibold mb-3"),
|
|
12
|
+
className: n("text-sm font-semibold mb-3 text-danger"),
|
|
13
13
|
children: c.settings.dangerZone
|
|
14
14
|
}), /* @__PURE__ */ r(e, { variant: o })]
|
|
15
15
|
});
|
|
@@ -2,88 +2,88 @@ import { deleteUserPlugin as e } from "../../../lib/auth/delete-user-plugin.js";
|
|
|
2
2
|
import { authQueryKeys as t } from "@better-auth-ui/core";
|
|
3
3
|
import { useAuth as n, useAuthPlugin as r, useDeleteUser as i, useListAccounts as a } from "@better-auth-ui/react";
|
|
4
4
|
import { TriangleExclamation as o } from "@gravity-ui/icons";
|
|
5
|
-
import { AlertDialog as s, Button as c, Card as l, FieldError as u, Form as d, Input as f, Label as p, Spinner as m, TextField as h,
|
|
6
|
-
import { useState as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { useQueryClient as
|
|
5
|
+
import { AlertDialog as s, Button as c, Card as l, FieldError as u, Form as d, Input as f, Label as p, Spinner as m, TextField as h, toast as g } from "@heroui/react";
|
|
6
|
+
import { useState as _ } from "react";
|
|
7
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
8
|
+
import { useQueryClient as b } from "@tanstack/react-query";
|
|
9
9
|
//#region src/components/auth/delete-user/delete-user.tsx
|
|
10
|
-
function
|
|
11
|
-
let { authClient:
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
e.preventDefault(),
|
|
15
|
-
|
|
16
|
-
to: `${
|
|
10
|
+
function x({ className: x, variant: S, ...C }) {
|
|
11
|
+
let { authClient: w, basePaths: T, localization: E, navigate: D, viewPaths: O } = n(), { localization: k, sendDeleteAccountVerification: A } = r(e), { data: j } = a(w), M = b(), [N, P] = _(!1), [F, I] = _(""), L = j?.some((e) => e.providerId === "credential"), R = !A && L, { mutate: z, isPending: B } = i(w), V = (e) => {
|
|
12
|
+
P(e), I("");
|
|
13
|
+
}, H = async (e) => {
|
|
14
|
+
e.preventDefault(), z({ ...R ? { password: F } : {} }, { onSuccess: () => {
|
|
15
|
+
P(!1), I(""), A ? g.success(k.deleteUserVerificationSent) : (g.success(k.deleteUserSuccess), M.removeQueries({ queryKey: t.all }), D({
|
|
16
|
+
to: `${T.auth}/${O.auth.signIn}`,
|
|
17
17
|
replace: !0
|
|
18
18
|
}));
|
|
19
19
|
} });
|
|
20
20
|
};
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
className:
|
|
23
|
-
variant:
|
|
24
|
-
...
|
|
25
|
-
children: /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ v(l, {
|
|
22
|
+
className: x,
|
|
23
|
+
variant: S,
|
|
24
|
+
...C,
|
|
25
|
+
children: /* @__PURE__ */ y(l.Content, {
|
|
26
26
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
27
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
28
28
|
className: "text-sm font-medium leading-tight",
|
|
29
|
-
children:
|
|
30
|
-
}), /* @__PURE__ */
|
|
29
|
+
children: k.deleteUser
|
|
30
|
+
}), /* @__PURE__ */ v("p", {
|
|
31
31
|
className: "text-muted text-xs mt-0.5",
|
|
32
|
-
children:
|
|
33
|
-
})] }), /* @__PURE__ */
|
|
34
|
-
isDisabled: !
|
|
32
|
+
children: k.deleteUserDescription
|
|
33
|
+
})] }), /* @__PURE__ */ y(s, { children: [/* @__PURE__ */ v(c, {
|
|
34
|
+
isDisabled: !j,
|
|
35
35
|
size: "sm",
|
|
36
|
-
variant: "danger",
|
|
37
|
-
onPress: () =>
|
|
38
|
-
children:
|
|
39
|
-
}), /* @__PURE__ */
|
|
40
|
-
isOpen:
|
|
41
|
-
onOpenChange:
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
onSubmit:
|
|
36
|
+
variant: "danger-soft",
|
|
37
|
+
onPress: () => P(!0),
|
|
38
|
+
children: k.deleteUser
|
|
39
|
+
}), /* @__PURE__ */ v(s.Backdrop, {
|
|
40
|
+
isOpen: N,
|
|
41
|
+
onOpenChange: V,
|
|
42
|
+
children: /* @__PURE__ */ v(s.Container, { children: /* @__PURE__ */ v(s.Dialog, { children: /* @__PURE__ */ y(d, {
|
|
43
|
+
onSubmit: H,
|
|
44
44
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ v(s.CloseTrigger, {}),
|
|
46
|
+
/* @__PURE__ */ y(s.Header, { children: [/* @__PURE__ */ v(s.Icon, {
|
|
47
47
|
status: "danger",
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
-
}), /* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ v(o, {})
|
|
49
|
+
}), /* @__PURE__ */ v(s.Heading, { children: k.deleteUser })] }),
|
|
50
|
+
/* @__PURE__ */ y(s.Body, {
|
|
51
51
|
className: "overflow-visible",
|
|
52
|
-
children: [/* @__PURE__ */
|
|
52
|
+
children: [/* @__PURE__ */ v("p", {
|
|
53
53
|
className: "text-muted text-sm",
|
|
54
|
-
children:
|
|
55
|
-
}),
|
|
54
|
+
children: k.deleteUserDescription
|
|
55
|
+
}), R && /* @__PURE__ */ y(h, {
|
|
56
56
|
className: "mt-4",
|
|
57
57
|
name: "password",
|
|
58
58
|
type: "password",
|
|
59
|
-
isDisabled:
|
|
60
|
-
value:
|
|
61
|
-
onChange:
|
|
59
|
+
isDisabled: B,
|
|
60
|
+
value: F,
|
|
61
|
+
onChange: I,
|
|
62
62
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ v(p, { children: E.auth.password }),
|
|
64
|
+
/* @__PURE__ */ v(f, {
|
|
65
65
|
autoComplete: "current-password",
|
|
66
|
-
placeholder:
|
|
66
|
+
placeholder: E.auth.passwordPlaceholder,
|
|
67
67
|
required: !0,
|
|
68
68
|
variant: "secondary"
|
|
69
69
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ v(u, {})
|
|
71
71
|
]
|
|
72
72
|
})]
|
|
73
73
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ y(s.Footer, { children: [/* @__PURE__ */ v(c, {
|
|
75
75
|
slot: "close",
|
|
76
76
|
variant: "tertiary",
|
|
77
|
-
isDisabled:
|
|
78
|
-
children:
|
|
79
|
-
}), /* @__PURE__ */
|
|
77
|
+
isDisabled: B,
|
|
78
|
+
children: E.settings.cancel
|
|
79
|
+
}), /* @__PURE__ */ y(c, {
|
|
80
80
|
type: "submit",
|
|
81
81
|
variant: "danger",
|
|
82
|
-
isPending:
|
|
83
|
-
children: [
|
|
82
|
+
isPending: B,
|
|
83
|
+
children: [B && /* @__PURE__ */ v(m, {
|
|
84
84
|
color: "current",
|
|
85
85
|
size: "sm"
|
|
86
|
-
}),
|
|
86
|
+
}), k.deleteUser]
|
|
87
87
|
})] })
|
|
88
88
|
]
|
|
89
89
|
}) }) })
|
|
@@ -92,4 +92,4 @@ function S({ className: S, variant: C, ...w }) {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
//#endregion
|
|
95
|
-
export {
|
|
95
|
+
export { x as DeleteUser };
|
|
@@ -1,64 +1,83 @@
|
|
|
1
|
-
import { useAuth as e,
|
|
2
|
-
import { Button as
|
|
3
|
-
import { jsx as
|
|
1
|
+
import { useAuth as e, useFetchOptions as t, useRequestPasswordReset as n } from "@better-auth-ui/react";
|
|
2
|
+
import { Button as r, Card as i, Description as a, FieldError as o, Form as s, Input as c, Label as l, Link as u, Spinner as d, TextField as f, cn as p, toast as m } from "@heroui/react";
|
|
3
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/auth/forgot-password.tsx
|
|
5
|
-
function
|
|
6
|
-
let { authClient:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
function _({ className: _, variant: v, ...y }) {
|
|
6
|
+
let { authClient: b, basePaths: x, localization: S, viewPaths: C, navigate: w, plugins: T } = e(), { fetchOptions: E, resetFetchOptions: D } = t(), { mutate: O, isPending: k } = n(b, {
|
|
7
|
+
onError: (e) => {
|
|
8
|
+
m.danger(e.error?.message || e.message), D();
|
|
9
|
+
},
|
|
10
|
+
onSuccess: () => {
|
|
11
|
+
m.success(S.auth.passwordResetEmailSent), w({ to: `${x.auth}/${C.auth.signIn}` });
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
function A(e) {
|
|
15
|
+
e.preventDefault(), O({
|
|
16
|
+
email: new FormData(e.currentTarget).get("email"),
|
|
17
|
+
fetchOptions: E
|
|
18
|
+
});
|
|
11
19
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
let j = T.find((e) => e.captchaComponent)?.captchaComponent;
|
|
21
|
+
return /* @__PURE__ */ g(i, {
|
|
22
|
+
className: p("w-full max-w-sm gap-4 md:p-6", _),
|
|
23
|
+
variant: v,
|
|
24
|
+
...y,
|
|
16
25
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ h(i.Header, { children: /* @__PURE__ */ h(i.Title, {
|
|
18
27
|
className: "text-xl font-semibold mb-1",
|
|
19
|
-
children:
|
|
28
|
+
children: S.auth.forgotPassword
|
|
20
29
|
}) }),
|
|
21
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ h(i.Content, {
|
|
22
31
|
className: "gap-4",
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
-
onSubmit:
|
|
32
|
+
children: /* @__PURE__ */ g(s, {
|
|
33
|
+
onSubmit: A,
|
|
25
34
|
className: "flex flex-col gap-4",
|
|
26
|
-
children: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ g(f, {
|
|
37
|
+
name: "email",
|
|
38
|
+
type: "email",
|
|
39
|
+
autoComplete: "email",
|
|
40
|
+
isDisabled: k,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ h(l, { children: S.auth.email }),
|
|
43
|
+
/* @__PURE__ */ h(c, {
|
|
44
|
+
placeholder: S.auth.emailPlaceholder,
|
|
45
|
+
required: !0,
|
|
46
|
+
variant: v === "transparent" ? "primary" : "secondary"
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ h(o, {})
|
|
49
|
+
]
|
|
50
|
+
}),
|
|
51
|
+
j && /* @__PURE__ */ h("div", {
|
|
52
|
+
className: "flex justify-center",
|
|
53
|
+
children: j
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ h("div", {
|
|
56
|
+
className: "flex flex-col gap-3",
|
|
57
|
+
children: /* @__PURE__ */ g(r, {
|
|
58
|
+
type: "submit",
|
|
59
|
+
className: "w-full",
|
|
60
|
+
isPending: k,
|
|
61
|
+
children: [k && /* @__PURE__ */ h(d, {
|
|
62
|
+
color: "current",
|
|
63
|
+
size: "sm"
|
|
64
|
+
}), S.auth.sendResetLink]
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
]
|
|
49
68
|
})
|
|
50
69
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ h(i.Footer, {
|
|
52
71
|
className: "flex-col gap-3",
|
|
53
|
-
children: /* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ g(a, {
|
|
54
73
|
className: "text-sm",
|
|
55
74
|
children: [
|
|
56
|
-
|
|
75
|
+
S.auth.rememberYourPassword,
|
|
57
76
|
" ",
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
href: `${
|
|
77
|
+
/* @__PURE__ */ h(u, {
|
|
78
|
+
href: `${x.auth}/${C.auth.signIn}`,
|
|
60
79
|
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
61
|
-
children:
|
|
80
|
+
children: S.auth.signIn
|
|
62
81
|
})
|
|
63
82
|
]
|
|
64
83
|
})
|
|
@@ -67,4 +86,4 @@ function g({ className: g, variant: _, ...v }) {
|
|
|
67
86
|
});
|
|
68
87
|
}
|
|
69
88
|
//#endregion
|
|
70
|
-
export {
|
|
89
|
+
export { _ as ForgotPassword };
|
|
@@ -1,122 +1,127 @@
|
|
|
1
1
|
import { FieldSeparator as e } from "./field-separator.js";
|
|
2
2
|
import { ProviderButtons as t } from "./provider-buttons.js";
|
|
3
3
|
import { authMutationKeys as n } from "@better-auth-ui/core";
|
|
4
|
-
import { useAuth as r,
|
|
5
|
-
import { Button as
|
|
6
|
-
import { useState as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { useIsMutating as
|
|
4
|
+
import { useAuth as r, useFetchOptions as i, useSendVerificationEmail as a, useSignInEmail as o } from "@better-auth-ui/react";
|
|
5
|
+
import { Button as s, Card as c, Checkbox as l, Description as u, FieldError as d, Form as f, Input as p, Label as m, Link as h, Spinner as g, TextField as _, cn as v, toast as y } from "@heroui/react";
|
|
6
|
+
import { useState as b } from "react";
|
|
7
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
8
|
+
import { useIsMutating as w } from "@tanstack/react-query";
|
|
9
9
|
//#region src/components/auth/sign-in.tsx
|
|
10
|
-
function
|
|
11
|
-
let { authClient:
|
|
10
|
+
function T({ className: T, socialLayout: E, socialPosition: D = "bottom", variant: O, ...k }) {
|
|
11
|
+
let { authClient: A, basePaths: j, baseURL: M, emailAndPassword: N, localization: P, plugins: F, redirectTo: I, socialProviders: L, viewPaths: R, navigate: z } = r(), { fetchOptions: B, resetFetchOptions: V } = i(), [H, U] = b(""), { mutate: W } = a(A, { onSuccess: () => y.success(P.auth.verificationEmailSent) }), { mutate: G, isPending: K } = o(A, {
|
|
12
12
|
onError: (e, { email: t }) => {
|
|
13
|
-
|
|
14
|
-
children:
|
|
15
|
-
onClick: () =>
|
|
13
|
+
U(""), e.error?.code === "EMAIL_NOT_VERIFIED" ? y.danger(e.error?.message || e.message, { actionProps: {
|
|
14
|
+
children: P.auth.resend,
|
|
15
|
+
onClick: () => W({
|
|
16
16
|
email: t,
|
|
17
|
-
callbackURL: `${
|
|
17
|
+
callbackURL: `${M}${I}`
|
|
18
18
|
})
|
|
19
|
-
} }) :
|
|
19
|
+
} }) : y.danger(e.error?.message || e.message), V();
|
|
20
20
|
},
|
|
21
|
-
onSuccess: () =>
|
|
22
|
-
}),
|
|
21
|
+
onSuccess: () => z({ to: I })
|
|
22
|
+
}), q = (e) => {
|
|
23
23
|
e.preventDefault();
|
|
24
24
|
let t = new FormData(e.currentTarget), n = t.get("email"), r = t.get("rememberMe") === "on";
|
|
25
|
-
|
|
25
|
+
G({
|
|
26
26
|
email: n,
|
|
27
|
-
password:
|
|
28
|
-
...
|
|
27
|
+
password: H,
|
|
28
|
+
...N?.rememberMe ? { rememberMe: r } : {},
|
|
29
|
+
fetchOptions: B
|
|
29
30
|
});
|
|
30
|
-
},
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
className:
|
|
33
|
-
variant:
|
|
34
|
-
...
|
|
31
|
+
}, J = w({ mutationKey: n.signIn.all }) + w({ mutationKey: n.signUp.all }) > 0, Y = F.find((e) => e.captchaComponent)?.captchaComponent, X = N?.enabled && !!L?.length;
|
|
32
|
+
return /* @__PURE__ */ C(c, {
|
|
33
|
+
className: v("w-full max-w-sm gap-4 md:p-6", T),
|
|
34
|
+
variant: O,
|
|
35
|
+
...k,
|
|
35
36
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ S(c.Header, { children: /* @__PURE__ */ S(c.Title, {
|
|
37
38
|
className: "text-xl font-semibold mb-1",
|
|
38
|
-
children:
|
|
39
|
+
children: P.auth.signIn
|
|
39
40
|
}) }),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ C(c.Content, {
|
|
41
42
|
className: "gap-4",
|
|
42
43
|
children: [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
onSubmit:
|
|
44
|
+
D === "top" && /* @__PURE__ */ C(x, { children: [!!L?.length && /* @__PURE__ */ S(t, { socialLayout: E }), X && /* @__PURE__ */ S(e, { children: P.auth.or })] }),
|
|
45
|
+
N?.enabled && /* @__PURE__ */ C(f, {
|
|
46
|
+
onSubmit: q,
|
|
46
47
|
className: "flex flex-col gap-4",
|
|
47
48
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ C(_, {
|
|
49
50
|
name: "email",
|
|
50
51
|
type: "email",
|
|
51
52
|
autoComplete: "email",
|
|
52
|
-
isDisabled:
|
|
53
|
+
isDisabled: J,
|
|
53
54
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
placeholder:
|
|
57
|
-
variant:
|
|
55
|
+
/* @__PURE__ */ S(m, { children: P.auth.email }),
|
|
56
|
+
/* @__PURE__ */ S(p, {
|
|
57
|
+
placeholder: P.auth.emailPlaceholder,
|
|
58
|
+
variant: O === "transparent" ? "primary" : "secondary",
|
|
58
59
|
required: !0
|
|
59
60
|
}),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ S(d, {})
|
|
61
62
|
]
|
|
62
63
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
minLength:
|
|
65
|
-
maxLength:
|
|
64
|
+
/* @__PURE__ */ C(_, {
|
|
65
|
+
minLength: N?.minPasswordLength,
|
|
66
|
+
maxLength: N?.maxPasswordLength,
|
|
66
67
|
name: "password",
|
|
67
68
|
type: "password",
|
|
68
69
|
autoComplete: "current-password",
|
|
69
|
-
isDisabled:
|
|
70
|
-
value:
|
|
71
|
-
onChange:
|
|
70
|
+
isDisabled: J,
|
|
71
|
+
value: H,
|
|
72
|
+
onChange: U,
|
|
72
73
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
placeholder:
|
|
76
|
-
variant:
|
|
74
|
+
/* @__PURE__ */ S(m, { children: P.auth.password }),
|
|
75
|
+
/* @__PURE__ */ S(p, {
|
|
76
|
+
placeholder: P.auth.passwordPlaceholder,
|
|
77
|
+
variant: O === "transparent" ? "primary" : "secondary",
|
|
77
78
|
required: !0
|
|
78
79
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ S(d, {})
|
|
80
81
|
]
|
|
81
82
|
}),
|
|
82
|
-
|
|
83
|
+
N?.rememberMe && /* @__PURE__ */ C(l, {
|
|
83
84
|
name: "rememberMe",
|
|
84
|
-
isDisabled:
|
|
85
|
-
variant:
|
|
86
|
-
children: [/* @__PURE__ */
|
|
85
|
+
isDisabled: J,
|
|
86
|
+
variant: O === "transparent" ? "primary" : "secondary",
|
|
87
|
+
children: [/* @__PURE__ */ S(l.Control, { children: /* @__PURE__ */ S(l.Indicator, {}) }), /* @__PURE__ */ S(l.Content, { children: /* @__PURE__ */ S(m, { children: P.auth.rememberMe }) })]
|
|
87
88
|
}),
|
|
88
|
-
/* @__PURE__ */ S("div", {
|
|
89
|
+
Y && /* @__PURE__ */ S("div", {
|
|
90
|
+
className: "flex justify-center",
|
|
91
|
+
children: Y
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ C("div", {
|
|
89
94
|
className: "flex flex-col gap-3",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
95
|
+
children: [/* @__PURE__ */ C(s, {
|
|
91
96
|
type: "submit",
|
|
92
97
|
className: "w-full",
|
|
93
|
-
isPending:
|
|
94
|
-
children: [
|
|
98
|
+
isPending: J,
|
|
99
|
+
children: [K && /* @__PURE__ */ S(g, {
|
|
95
100
|
color: "current",
|
|
96
101
|
size: "sm"
|
|
97
|
-
}),
|
|
98
|
-
}),
|
|
102
|
+
}), P.auth.signIn]
|
|
103
|
+
}), F.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */ S(t, { view: "signIn" }, `${e.id}-${n.toString()}`)))]
|
|
99
104
|
})
|
|
100
105
|
]
|
|
101
106
|
}),
|
|
102
|
-
|
|
107
|
+
D === "bottom" && /* @__PURE__ */ C(x, { children: [X && /* @__PURE__ */ S(e, { children: P.auth.or }), !!L?.length && /* @__PURE__ */ S(t, { socialLayout: E })] })
|
|
103
108
|
]
|
|
104
109
|
}),
|
|
105
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ C(c.Footer, {
|
|
106
111
|
className: "flex-col gap-3",
|
|
107
|
-
children: [
|
|
108
|
-
href: `${
|
|
112
|
+
children: [N?.forgotPassword && /* @__PURE__ */ S(h, {
|
|
113
|
+
href: `${j.auth}/${R.auth.forgotPassword}`,
|
|
109
114
|
className: "no-underline hover:underline",
|
|
110
|
-
children:
|
|
111
|
-
}),
|
|
115
|
+
children: P.auth.forgotPasswordLink
|
|
116
|
+
}), N?.enabled && /* @__PURE__ */ C(u, {
|
|
112
117
|
className: "text-sm",
|
|
113
118
|
children: [
|
|
114
|
-
|
|
119
|
+
P.auth.needToCreateAnAccount,
|
|
115
120
|
" ",
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
href: `${
|
|
121
|
+
/* @__PURE__ */ S(h, {
|
|
122
|
+
href: `${j.auth}/${R.auth.signUp}`,
|
|
118
123
|
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
119
|
-
children:
|
|
124
|
+
children: P.auth.signUp
|
|
120
125
|
})
|
|
121
126
|
]
|
|
122
127
|
})]
|
|
@@ -125,4 +130,4 @@ function w({ className: w, socialLayout: T, socialPosition: E = "bottom", varian
|
|
|
125
130
|
});
|
|
126
131
|
}
|
|
127
132
|
//#endregion
|
|
128
|
-
export {
|
|
133
|
+
export { T as SignIn };
|