@better-auth-ui/heroui 1.6.1 → 1.6.3

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.
Files changed (117) hide show
  1. package/dist/components/auth/auth-provider.d.ts +1 -1
  2. package/dist/components/auth/auth-provider.js +16 -11
  3. package/dist/components/auth/auth.d.ts +4 -4
  4. package/dist/components/auth/auth.js +36 -41
  5. package/dist/components/auth/error-toaster.d.ts +1 -0
  6. package/dist/components/auth/error-toaster.js +17 -0
  7. package/dist/components/auth/field-separator.d.ts +1 -1
  8. package/dist/components/auth/field-separator.js +17 -4
  9. package/dist/components/auth/forgot-password.d.ts +2 -2
  10. package/dist/components/auth/forgot-password.js +66 -27
  11. package/dist/components/auth/magic-link-button.d.ts +1 -1
  12. package/dist/components/auth/magic-link-button.js +15 -18
  13. package/dist/components/auth/magic-link.d.ts +3 -3
  14. package/dist/components/auth/magic-link.js +98 -43
  15. package/dist/components/auth/passkey-button.js +20 -12
  16. package/dist/components/auth/provider-button.d.ts +15 -0
  17. package/dist/components/auth/provider-button.js +29 -0
  18. package/dist/components/auth/provider-buttons.d.ts +4 -10
  19. package/dist/components/auth/provider-buttons.js +19 -33
  20. package/dist/components/auth/reset-password.d.ts +2 -2
  21. package/dist/components/auth/reset-password.js +143 -57
  22. package/dist/components/auth/sign-in.d.ts +3 -3
  23. package/dist/components/auth/sign-in.js +151 -64
  24. package/dist/components/auth/sign-out.js +26 -32
  25. package/dist/components/auth/sign-up.d.ts +3 -3
  26. package/dist/components/auth/sign-up.js +231 -70
  27. package/dist/components/email/email-changed-email.d.ts +2 -2
  28. package/dist/components/email/email-changed-email.js +29 -22
  29. package/dist/components/email/email-verification-email.d.ts +2 -2
  30. package/dist/components/email/email-verification-email.js +29 -22
  31. package/dist/components/email/magic-link-email.d.ts +2 -2
  32. package/dist/components/email/magic-link-email.js +29 -22
  33. package/dist/components/email/new-device-email.d.ts +2 -2
  34. package/dist/components/email/new-device-email.js +29 -22
  35. package/dist/components/email/otp-email.d.ts +2 -2
  36. package/dist/components/email/otp-email.js +28 -21
  37. package/dist/components/email/password-changed-email.d.ts +2 -2
  38. package/dist/components/email/password-changed-email.js +29 -22
  39. package/dist/components/email/reset-password-email.d.ts +2 -2
  40. package/dist/components/email/reset-password-email.js +29 -22
  41. package/dist/components/settings/account/account-settings.d.ts +2 -2
  42. package/dist/components/settings/account/account-settings.js +22 -19
  43. package/dist/components/settings/account/appearance.d.ts +2 -2
  44. package/dist/components/settings/account/appearance.js +70 -27
  45. package/dist/components/settings/account/change-avatar.js +88 -55
  46. package/dist/components/settings/account/change-email.d.ts +2 -2
  47. package/dist/components/settings/account/change-email.js +53 -28
  48. package/dist/components/settings/account/manage-account.d.ts +1 -1
  49. package/dist/components/settings/account/manage-account.js +47 -31
  50. package/dist/components/settings/account/manage-accounts.d.ts +2 -2
  51. package/dist/components/settings/account/manage-accounts.js +32 -36
  52. package/dist/components/settings/account/user-profile.d.ts +4 -4
  53. package/dist/components/settings/account/user-profile.js +102 -22
  54. package/dist/components/settings/security/active-session.d.ts +1 -1
  55. package/dist/components/settings/security/active-session.js +57 -51
  56. package/dist/components/settings/security/active-sessions.d.ts +2 -2
  57. package/dist/components/settings/security/active-sessions.js +32 -26
  58. package/dist/components/settings/security/change-password.d.ts +2 -2
  59. package/dist/components/settings/security/change-password.js +186 -76
  60. package/dist/components/settings/security/danger-zone.d.ts +2 -2
  61. package/dist/components/settings/security/danger-zone.js +17 -11
  62. package/dist/components/settings/security/delete-user.d.ts +2 -2
  63. package/dist/components/settings/security/delete-user.js +91 -46
  64. package/dist/components/settings/security/linked-account.d.ts +1 -1
  65. package/dist/components/settings/security/linked-account.js +55 -47
  66. package/dist/components/settings/security/linked-accounts.d.ts +2 -2
  67. package/dist/components/settings/security/linked-accounts.js +43 -40
  68. package/dist/components/settings/security/passkey.js +42 -13
  69. package/dist/components/settings/security/passkeys.d.ts +2 -2
  70. package/dist/components/settings/security/passkeys.js +51 -19
  71. package/dist/components/settings/security/security-settings.d.ts +2 -2
  72. package/dist/components/settings/security/security-settings.js +24 -21
  73. package/dist/components/settings/settings.d.ts +3 -3
  74. package/dist/components/settings/settings.js +44 -27
  75. package/dist/components/user/switch-account-item.d.ts +1 -1
  76. package/dist/components/user/switch-account-item.js +19 -15
  77. package/dist/components/user/switch-account-menu.js +27 -28
  78. package/dist/components/user/user-avatar.d.ts +3 -3
  79. package/dist/components/user/user-avatar.js +28 -30
  80. package/dist/components/user/user-button.d.ts +1 -1
  81. package/dist/components/user/user-button.js +90 -23
  82. package/dist/components/user/user-view.d.ts +3 -3
  83. package/dist/components/user/user-view.js +36 -23
  84. package/dist/core.d.ts +1 -1
  85. package/dist/index.d.ts +36 -35
  86. package/dist/index.js +37 -35
  87. package/dist/react-exports.d.ts +1 -1
  88. package/package.json +15 -11
  89. package/src/components/auth/auth-provider.tsx +4 -0
  90. package/src/components/auth/auth.tsx +2 -2
  91. package/src/components/auth/error-toaster.tsx +25 -0
  92. package/src/components/auth/forgot-password.tsx +1 -2
  93. package/src/components/auth/magic-link.tsx +3 -23
  94. package/src/components/auth/passkey-button.tsx +1 -2
  95. package/src/components/auth/provider-button.tsx +67 -0
  96. package/src/components/auth/provider-buttons.tsx +26 -43
  97. package/src/components/auth/reset-password.tsx +1 -2
  98. package/src/components/auth/sign-in.tsx +63 -48
  99. package/src/components/auth/sign-up.tsx +99 -20
  100. package/src/components/settings/account/appearance.tsx +1 -1
  101. package/src/components/settings/account/change-avatar.tsx +1 -3
  102. package/src/components/settings/account/change-email.tsx +2 -3
  103. package/src/components/settings/account/manage-account.tsx +1 -4
  104. package/src/components/settings/account/manage-accounts.tsx +3 -8
  105. package/src/components/settings/account/user-profile.tsx +122 -8
  106. package/src/components/settings/security/active-session.tsx +0 -1
  107. package/src/components/settings/security/active-sessions.tsx +3 -8
  108. package/src/components/settings/security/change-password.tsx +7 -4
  109. package/src/components/settings/security/delete-user.tsx +1 -4
  110. package/src/components/settings/security/linked-account.tsx +4 -14
  111. package/src/components/settings/security/linked-accounts.tsx +3 -8
  112. package/src/components/settings/security/passkey.tsx +2 -4
  113. package/src/components/settings/security/passkeys.tsx +4 -12
  114. package/src/components/settings/settings.tsx +1 -1
  115. package/src/components/user/switch-account-item.tsx +2 -4
  116. package/src/components/user/switch-account-menu.tsx +2 -7
  117. package/src/index.tsx +1 -0
@@ -1,71 +1,232 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useAuth, useSignInSocial, useSignUpEmail } from "@better-auth-ui/react";
3
- import { Eye, EyeSlash } from "@gravity-ui/icons";
4
- import { Button, Card, cn, Description, FieldError, Form, Input, InputGroup, Label, Link, Spinner, TextField, toast } from "@heroui/react";
5
- import { useState } from "react";
6
- import { FieldSeparator } from "./field-separator";
7
- import { MagicLinkButton } from "./magic-link-button";
8
- import { ProviderButtons } from "./provider-buttons";
9
- /**
10
- * Render a sign-up form with name, email, password (and optional confirm password) fields, optional social provider buttons, and password visibility controls.
11
- *
12
- * The component reflects request state by disabling inputs and showing a pending indicator during sign-up or social sign-in.
13
- *
14
- * @param className - Additional CSS classes applied to the outer card container
15
- * @param socialLayout - Social layout to apply to the provider buttons component
16
- * @param socialPosition - Position of social provider buttons relative to the form; `"top"` or `"bottom"` (default `"bottom"`)
17
- * @returns The sign-up form React element
18
- */
19
- export function SignUp({ className, socialLayout, socialPosition = "bottom", variant, ...props }) {
20
- const { basePaths, emailAndPassword, localization, magicLink, redirectTo, socialProviders, viewPaths, navigate } = useAuth();
21
- const [password, setPassword] = useState("");
22
- const [confirmPassword, setConfirmPassword] = useState("");
23
- const { mutate: signUpEmail, isPending: signUpPending } = useSignUpEmail({
24
- onError: (error) => {
25
- setPassword("");
26
- setConfirmPassword("");
27
- toast.danger(error.error?.message || error.message);
28
- },
29
- onSuccess: () => {
30
- if (emailAndPassword?.requireEmailVerification) {
31
- toast.success(localization.auth.verifyYourEmail);
32
- navigate({ to: `${basePaths.auth}/${viewPaths.auth.signIn}` });
33
- }
34
- else {
35
- navigate({ to: redirectTo });
36
- }
37
- }
38
- });
39
- const [socialRedirecting, setSocialRedirecting] = useState(false);
40
- const { mutate: signInSocial, isPending: socialPending } = useSignInSocial({
41
- onError: (error) => toast.danger(error.error?.message || error.message),
42
- onSuccess: () => {
43
- setSocialRedirecting(true);
44
- setTimeout(() => {
45
- setSocialRedirecting(false);
46
- }, 5000);
47
- }
48
- });
49
- const [isPasswordVisible, setIsPasswordVisible] = useState(false);
50
- const [isConfirmPasswordVisible, setIsConfirmPasswordVisible] = useState(false);
51
- const isPending = signUpPending || socialPending || socialRedirecting;
52
- const handleSubmit = (e) => {
53
- e.preventDefault();
54
- const formData = new FormData(e.currentTarget);
55
- const name = formData.get("name");
56
- const email = formData.get("email");
57
- if (emailAndPassword?.confirmPassword && password !== confirmPassword) {
58
- toast.danger(localization.auth.passwordsDoNotMatch);
59
- setPassword("");
60
- setConfirmPassword("");
61
- return;
62
- }
63
- signUpEmail({ name, email, password });
64
- };
65
- const showSeparator = emailAndPassword?.enabled && !!socialProviders?.length;
66
- return (_jsxs(Card, { className: cn("w-full max-w-sm p-4 md:p-6", className), variant: variant, ...props, children: [_jsx(Card.Header, { children: _jsx(Card.Title, { className: "text-xl font-semibold mb-1", children: localization.auth.signUp }) }), _jsxs(Card.Content, { className: "gap-4", children: [socialPosition === "top" && (_jsxs(_Fragment, { children: [!!socialProviders?.length && (_jsx(ProviderButtons, { isPending: isPending, socialLayout: socialLayout, signInSocial: signInSocial })), showSeparator && (_jsx(FieldSeparator, { children: localization.auth.or }))] })), emailAndPassword?.enabled && (_jsxs(Form, { onSubmit: handleSubmit, className: "flex flex-col gap-4", children: [_jsxs(TextField, { name: "name", type: "text", autoComplete: "name", isDisabled: isPending, children: [_jsx(Label, { children: localization.auth.name }), _jsx(Input, { placeholder: localization.auth.namePlaceholder, required: true, variant: variant === "transparent" ? "primary" : "secondary" }), _jsx(FieldError, {})] }), _jsxs(TextField, { name: "email", type: "email", autoComplete: "email", isDisabled: isPending, children: [_jsx(Label, { children: localization.auth.email }), _jsx(Input, { placeholder: localization.auth.emailPlaceholder, required: true, variant: variant === "transparent" ? "primary" : "secondary" }), _jsx(FieldError, {})] }), _jsxs(TextField, { minLength: emailAndPassword?.minPasswordLength, maxLength: emailAndPassword?.maxPasswordLength, name: "password", autoComplete: "new-password", isDisabled: isPending, value: password, onChange: setPassword, children: [_jsx(Label, { children: localization.auth.password }), _jsxs(InputGroup, { variant: variant === "transparent" ? "primary" : "secondary", children: [_jsx(InputGroup.Input, { placeholder: localization.auth.passwordPlaceholder, type: isPasswordVisible ? "text" : "password", name: "password", required: true }), _jsx(InputGroup.Suffix, { className: "px-0", children: _jsx(Button, { isIconOnly: true, "aria-label": isPasswordVisible
67
- ? localization.auth.hidePassword
68
- : localization.auth.showPassword, size: "sm", variant: "ghost", onPress: () => setIsPasswordVisible(!isPasswordVisible), isDisabled: isPending, children: isPasswordVisible ? _jsx(EyeSlash, {}) : _jsx(Eye, {}) }) })] }), _jsx(FieldError, {})] }), emailAndPassword?.confirmPassword && (_jsxs(TextField, { minLength: emailAndPassword?.minPasswordLength, maxLength: emailAndPassword?.maxPasswordLength, name: "confirmPassword", autoComplete: "new-password", isDisabled: isPending, value: confirmPassword, onChange: setConfirmPassword, children: [_jsx(Label, { children: localization.auth.confirmPassword }), _jsxs(InputGroup, { variant: variant === "transparent" ? "primary" : "secondary", children: [_jsx(InputGroup.Input, { name: "confirmPassword", placeholder: localization.auth.confirmPasswordPlaceholder, type: isConfirmPasswordVisible ? "text" : "password", required: true }), _jsx(InputGroup.Suffix, { className: "px-0", children: _jsx(Button, { isIconOnly: true, "aria-label": isConfirmPasswordVisible
69
- ? localization.auth.hidePassword
70
- : localization.auth.showPassword, size: "sm", variant: "ghost", onPress: () => setIsConfirmPasswordVisible(!isConfirmPasswordVisible), isDisabled: isPending, children: isConfirmPasswordVisible ? _jsx(EyeSlash, {}) : _jsx(Eye, {}) }) })] }), _jsx(FieldError, {})] })), _jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs(Button, { type: "submit", className: "w-full", isPending: isPending, children: [isPending && _jsx(Spinner, { color: "current", size: "sm" }), localization.auth.signUp] }), magicLink && (_jsx(MagicLinkButton, { view: "signUp", isPending: isPending }))] })] })), socialPosition === "bottom" && (_jsxs(_Fragment, { children: [showSeparator && (_jsx(FieldSeparator, { children: localization.auth.or })), !!socialProviders?.length && (_jsx(ProviderButtons, { socialLayout: socialLayout, signInSocial: signInSocial, isPending: isPending }))] }))] }), _jsx(Card.Footer, { className: "flex-col", children: _jsxs(Description, { className: "text-sm", children: [localization.auth.alreadyHaveAnAccount, " ", _jsx(Link, { href: `${basePaths.auth}/${viewPaths.auth.signIn}`, className: "text-accent decoration-accent no-underline hover:underline", children: localization.auth.signIn })] }) })] }));
1
+ import { FieldSeparator as e } from "./field-separator.js";
2
+ import { MagicLinkButton as t } from "./magic-link-button.js";
3
+ import { ProviderButtons as n } from "./provider-buttons.js";
4
+ import { useAuth as r, useIsUsernameAvailable as i, useSignUpEmail as ee } from "@better-auth-ui/react";
5
+ import { Button as a, Card as o, Description as te, FieldError as s, Form as ne, Input as c, InputGroup as l, Label as u, Link as re, Spinner as d, TextField as f, cn as p, toast as m } from "@heroui/react";
6
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
7
+ import { useState as v } from "react";
8
+ import { Check as y, Eye as b, EyeSlash as x, Xmark as S } from "@gravity-ui/icons";
9
+ import { useDebouncer as C } from "@tanstack/react-pacer";
10
+ //#region src/components/auth/sign-up.tsx
11
+ function w({ className: w, socialLayout: T, socialPosition: E = "bottom", variant: D, ...O }) {
12
+ let { basePaths: k, emailAndPassword: A, localization: j, magicLink: M, redirectTo: N, socialProviders: P, username: F, viewPaths: I, navigate: L } = r(), [R, z] = v(""), [B, V] = v(""), [H, U] = v(""), { mutate: W, data: G, error: K, reset: q } = i(), J = C((e) => {
13
+ if (!e.trim()) {
14
+ q();
15
+ return;
16
+ }
17
+ W({ username: e.trim() });
18
+ }, { wait: 500 });
19
+ function Y(e) {
20
+ U(e), q(), F?.isUsernameAvailable && J.maybeExecute(e);
21
+ }
22
+ let { mutate: ie, isPending: ae } = ee({
23
+ onError: (e) => {
24
+ z(""), V(""), m.danger(e.error?.message || e.message);
25
+ },
26
+ onSuccess: () => {
27
+ A?.requireEmailVerification ? (m.success(j.auth.verifyYourEmail), L({ to: `${k.auth}/${I.auth.signIn}` })) : L({ to: N });
28
+ }
29
+ }), [X, oe] = v(!1), [Z, se] = v(!1), Q = ae, ce = (e) => {
30
+ e.preventDefault();
31
+ let t = new FormData(e.currentTarget), n = t.get("name"), r = t.get("email");
32
+ if (A?.confirmPassword && R !== B) {
33
+ m.danger(j.auth.passwordsDoNotMatch), z(""), V("");
34
+ return;
35
+ }
36
+ ie({
37
+ name: n,
38
+ email: r,
39
+ password: R,
40
+ ...F?.enabled ? {
41
+ username: H.trim(),
42
+ ...F.displayUsername ? { displayUsername: H.trim() } : {}
43
+ } : {}
44
+ });
45
+ }, $ = A?.enabled && !!P?.length;
46
+ return /* @__PURE__ */ _(o, {
47
+ className: p("w-full max-w-sm p-4 md:p-6", w),
48
+ variant: D,
49
+ ...O,
50
+ children: [
51
+ /* @__PURE__ */ g(o.Header, { children: /* @__PURE__ */ g(o.Title, {
52
+ className: "text-xl font-semibold mb-1",
53
+ children: j.auth.signUp
54
+ }) }),
55
+ /* @__PURE__ */ _(o.Content, {
56
+ className: "gap-4",
57
+ children: [
58
+ E === "top" && /* @__PURE__ */ _(h, { children: [!!P?.length && /* @__PURE__ */ g(n, {
59
+ isPending: Q,
60
+ socialLayout: T
61
+ }), $ && /* @__PURE__ */ g(e, { children: j.auth.or })] }),
62
+ A?.enabled && /* @__PURE__ */ _(ne, {
63
+ onSubmit: ce,
64
+ className: "flex flex-col gap-4",
65
+ children: [
66
+ /* @__PURE__ */ _(f, {
67
+ name: "name",
68
+ type: "text",
69
+ autoComplete: "name",
70
+ isDisabled: Q,
71
+ children: [
72
+ /* @__PURE__ */ g(u, { children: j.auth.name }),
73
+ /* @__PURE__ */ g(c, {
74
+ placeholder: j.auth.namePlaceholder,
75
+ required: !0,
76
+ variant: D === "transparent" ? "primary" : "secondary"
77
+ }),
78
+ /* @__PURE__ */ g(s, {})
79
+ ]
80
+ }),
81
+ F?.enabled && /* @__PURE__ */ _(f, {
82
+ name: "username",
83
+ type: "text",
84
+ autoComplete: "username",
85
+ minLength: F.minUsernameLength,
86
+ maxLength: F.maxUsernameLength,
87
+ isDisabled: Q,
88
+ value: H,
89
+ onChange: Y,
90
+ isInvalid: !!K || G && !G.available,
91
+ children: [
92
+ /* @__PURE__ */ g(u, { children: j.auth.username }),
93
+ /* @__PURE__ */ _(l, {
94
+ variant: D === "transparent" ? "primary" : "secondary",
95
+ children: [/* @__PURE__ */ g(l.Input, {
96
+ placeholder: j.auth.usernamePlaceholder,
97
+ required: !0
98
+ }), F.isUsernameAvailable && H.trim() && /* @__PURE__ */ g(l.Suffix, {
99
+ className: "px-2",
100
+ children: G?.available ? /* @__PURE__ */ g(y, { className: "text-success" }) : K || G?.available === !1 ? /* @__PURE__ */ g(S, { className: "text-danger" }) : /* @__PURE__ */ g(d, {
101
+ size: "sm",
102
+ color: "current"
103
+ })
104
+ })]
105
+ }),
106
+ /* @__PURE__ */ g(s, { children: K?.error?.message || K?.message || (G?.available === !1 ? j.auth.usernameTaken : null) })
107
+ ]
108
+ }),
109
+ /* @__PURE__ */ _(f, {
110
+ name: "email",
111
+ type: "email",
112
+ autoComplete: "email",
113
+ isDisabled: Q,
114
+ children: [
115
+ /* @__PURE__ */ g(u, { children: j.auth.email }),
116
+ /* @__PURE__ */ g(c, {
117
+ placeholder: j.auth.emailPlaceholder,
118
+ required: !0,
119
+ variant: D === "transparent" ? "primary" : "secondary"
120
+ }),
121
+ /* @__PURE__ */ g(s, {})
122
+ ]
123
+ }),
124
+ /* @__PURE__ */ _(f, {
125
+ minLength: A?.minPasswordLength,
126
+ maxLength: A?.maxPasswordLength,
127
+ name: "password",
128
+ autoComplete: "new-password",
129
+ isDisabled: Q,
130
+ value: R,
131
+ onChange: z,
132
+ children: [
133
+ /* @__PURE__ */ g(u, { children: j.auth.password }),
134
+ /* @__PURE__ */ _(l, {
135
+ variant: D === "transparent" ? "primary" : "secondary",
136
+ children: [/* @__PURE__ */ g(l.Input, {
137
+ placeholder: j.auth.passwordPlaceholder,
138
+ type: X ? "text" : "password",
139
+ name: "password",
140
+ required: !0
141
+ }), /* @__PURE__ */ g(l.Suffix, {
142
+ className: "px-0",
143
+ children: /* @__PURE__ */ g(a, {
144
+ isIconOnly: !0,
145
+ "aria-label": X ? j.auth.hidePassword : j.auth.showPassword,
146
+ size: "sm",
147
+ variant: "ghost",
148
+ onPress: () => oe(!X),
149
+ isDisabled: Q,
150
+ children: g(X ? x : b, {})
151
+ })
152
+ })]
153
+ }),
154
+ /* @__PURE__ */ g(s, {})
155
+ ]
156
+ }),
157
+ A?.confirmPassword && /* @__PURE__ */ _(f, {
158
+ minLength: A?.minPasswordLength,
159
+ maxLength: A?.maxPasswordLength,
160
+ name: "confirmPassword",
161
+ autoComplete: "new-password",
162
+ isDisabled: Q,
163
+ value: B,
164
+ onChange: V,
165
+ children: [
166
+ /* @__PURE__ */ g(u, { children: j.auth.confirmPassword }),
167
+ /* @__PURE__ */ _(l, {
168
+ variant: D === "transparent" ? "primary" : "secondary",
169
+ children: [/* @__PURE__ */ g(l.Input, {
170
+ name: "confirmPassword",
171
+ placeholder: j.auth.confirmPasswordPlaceholder,
172
+ type: Z ? "text" : "password",
173
+ required: !0
174
+ }), /* @__PURE__ */ g(l.Suffix, {
175
+ className: "px-0",
176
+ children: /* @__PURE__ */ g(a, {
177
+ isIconOnly: !0,
178
+ "aria-label": Z ? j.auth.hidePassword : j.auth.showPassword,
179
+ size: "sm",
180
+ variant: "ghost",
181
+ onPress: () => se(!Z),
182
+ isDisabled: Q,
183
+ children: g(Z ? x : b, {})
184
+ })
185
+ })]
186
+ }),
187
+ /* @__PURE__ */ g(s, {})
188
+ ]
189
+ }),
190
+ /* @__PURE__ */ _("div", {
191
+ className: "flex flex-col gap-3",
192
+ children: [/* @__PURE__ */ _(a, {
193
+ type: "submit",
194
+ className: "w-full",
195
+ isPending: Q,
196
+ children: [Q && /* @__PURE__ */ g(d, {
197
+ color: "current",
198
+ size: "sm"
199
+ }), j.auth.signUp]
200
+ }), M && /* @__PURE__ */ g(t, {
201
+ view: "signUp",
202
+ isPending: Q
203
+ })]
204
+ })
205
+ ]
206
+ }),
207
+ E === "bottom" && /* @__PURE__ */ _(h, { children: [$ && /* @__PURE__ */ g(e, { children: j.auth.or }), !!P?.length && /* @__PURE__ */ g(n, {
208
+ socialLayout: T,
209
+ isPending: Q
210
+ })] })
211
+ ]
212
+ }),
213
+ /* @__PURE__ */ g(o.Footer, {
214
+ className: "flex-col",
215
+ children: /* @__PURE__ */ _(te, {
216
+ className: "text-sm",
217
+ children: [
218
+ j.auth.alreadyHaveAnAccount,
219
+ " ",
220
+ /* @__PURE__ */ g(re, {
221
+ href: `${k.auth}/${I.auth.signIn}`,
222
+ className: "text-accent decoration-accent no-underline hover:underline",
223
+ children: j.auth.signIn
224
+ })
225
+ ]
226
+ })
227
+ })
228
+ ]
229
+ });
71
230
  }
231
+ //#endregion
232
+ export { w as SignUp };
@@ -1,3 +1,3 @@
1
- import { type EmailChangedEmailProps } from "@better-auth-ui/react";
2
- export type { EmailChangedEmailProps } from "@better-auth-ui/react";
1
+ import { EmailChangedEmailProps } from '@better-auth-ui/react';
2
+ export type { EmailChangedEmailProps } from '@better-auth-ui/react';
3
3
  export declare function EmailChangedEmail({ colors, classNames, ...props }: EmailChangedEmailProps): import("react/jsx-runtime").JSX.Element;
@@ -1,23 +1,30 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { EmailChangedEmail as EmailChangedEmailPrimitive } from "@better-auth-ui/react";
3
- import { cn } from "@heroui/react";
4
- export function EmailChangedEmail({ colors, classNames, ...props }) {
5
- return (_jsx(EmailChangedEmailPrimitive, { colors: {
6
- light: {
7
- background: "#F5F5F5",
8
- primary: "#0285F7",
9
- primaryForeground: "#FCFCFC",
10
- ...colors?.light
11
- },
12
- dark: {
13
- background: "#060607",
14
- primary: "#0584F6",
15
- primaryForeground: "#FCFCFC",
16
- ...colors?.dark
17
- }
18
- }, classNames: {
19
- ...classNames,
20
- card: cn("border-none rounded-3xl", classNames?.card),
21
- button: cn("rounded-full", classNames?.button)
22
- }, ...props }));
1
+ import { EmailChangedEmail as e } from "@better-auth-ui/react";
2
+ import { cn as t } from "@heroui/react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/email/email-changed-email.tsx
5
+ function r({ colors: r, classNames: i, ...a }) {
6
+ return /* @__PURE__ */ n(e, {
7
+ colors: {
8
+ light: {
9
+ background: "#F5F5F5",
10
+ primary: "#0285F7",
11
+ primaryForeground: "#FCFCFC",
12
+ ...r?.light
13
+ },
14
+ dark: {
15
+ background: "#060607",
16
+ primary: "#0584F6",
17
+ primaryForeground: "#FCFCFC",
18
+ ...r?.dark
19
+ }
20
+ },
21
+ classNames: {
22
+ ...i,
23
+ card: t("border-none rounded-3xl", i?.card),
24
+ button: t("rounded-full", i?.button)
25
+ },
26
+ ...a
27
+ });
23
28
  }
29
+ //#endregion
30
+ export { r as EmailChangedEmail };
@@ -1,3 +1,3 @@
1
- import { type EmailVerificationEmailProps } from "@better-auth-ui/react";
2
- export type { EmailVerificationEmailProps } from "@better-auth-ui/react";
1
+ import { EmailVerificationEmailProps } from '@better-auth-ui/react';
2
+ export type { EmailVerificationEmailProps } from '@better-auth-ui/react';
3
3
  export declare function EmailVerificationEmail({ colors, classNames, ...props }: EmailVerificationEmailProps): import("react/jsx-runtime").JSX.Element;
@@ -1,23 +1,30 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { EmailVerificationEmail as EmailVerificationEmailPrimitive } from "@better-auth-ui/react";
3
- import { cn } from "@heroui/react";
4
- export function EmailVerificationEmail({ colors, classNames, ...props }) {
5
- return (_jsx(EmailVerificationEmailPrimitive, { colors: {
6
- light: {
7
- background: "#F5F5F5",
8
- primary: "#0285F7",
9
- primaryForeground: "#FCFCFC",
10
- ...colors?.light
11
- },
12
- dark: {
13
- background: "#060607",
14
- primary: "#0584F6",
15
- primaryForeground: "#FCFCFC",
16
- ...colors?.dark
17
- }
18
- }, classNames: {
19
- ...classNames,
20
- card: cn("border-none rounded-3xl", classNames?.card),
21
- button: cn("rounded-full", classNames?.button)
22
- }, ...props }));
1
+ import { EmailVerificationEmail as e } from "@better-auth-ui/react";
2
+ import { cn as t } from "@heroui/react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/email/email-verification-email.tsx
5
+ function r({ colors: r, classNames: i, ...a }) {
6
+ return /* @__PURE__ */ n(e, {
7
+ colors: {
8
+ light: {
9
+ background: "#F5F5F5",
10
+ primary: "#0285F7",
11
+ primaryForeground: "#FCFCFC",
12
+ ...r?.light
13
+ },
14
+ dark: {
15
+ background: "#060607",
16
+ primary: "#0584F6",
17
+ primaryForeground: "#FCFCFC",
18
+ ...r?.dark
19
+ }
20
+ },
21
+ classNames: {
22
+ ...i,
23
+ card: t("border-none rounded-3xl", i?.card),
24
+ button: t("rounded-full", i?.button)
25
+ },
26
+ ...a
27
+ });
23
28
  }
29
+ //#endregion
30
+ export { r as EmailVerificationEmail };
@@ -1,3 +1,3 @@
1
- import { type MagicLinkEmailProps } from "@better-auth-ui/react";
2
- export type { MagicLinkEmailProps } from "@better-auth-ui/react";
1
+ import { MagicLinkEmailProps } from '@better-auth-ui/react';
2
+ export type { MagicLinkEmailProps } from '@better-auth-ui/react';
3
3
  export declare function MagicLinkEmail({ colors, classNames, ...props }: MagicLinkEmailProps): import("react/jsx-runtime").JSX.Element;
@@ -1,23 +1,30 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { MagicLinkEmail as MagicLinkEmailPrimitive } from "@better-auth-ui/react";
3
- import { cn } from "@heroui/react";
4
- export function MagicLinkEmail({ colors, classNames, ...props }) {
5
- return (_jsx(MagicLinkEmailPrimitive, { colors: {
6
- light: {
7
- background: "#F5F5F5",
8
- primary: "#0285F7",
9
- primaryForeground: "#FCFCFC",
10
- ...colors?.light
11
- },
12
- dark: {
13
- background: "#060607",
14
- primary: "#0584F6",
15
- primaryForeground: "#FCFCFC",
16
- ...colors?.dark
17
- }
18
- }, classNames: {
19
- ...classNames,
20
- card: cn("border-none rounded-3xl", classNames?.card),
21
- button: cn("rounded-full", classNames?.button)
22
- }, ...props }));
1
+ import { MagicLinkEmail as e } from "@better-auth-ui/react";
2
+ import { cn as t } from "@heroui/react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/email/magic-link-email.tsx
5
+ function r({ colors: r, classNames: i, ...a }) {
6
+ return /* @__PURE__ */ n(e, {
7
+ colors: {
8
+ light: {
9
+ background: "#F5F5F5",
10
+ primary: "#0285F7",
11
+ primaryForeground: "#FCFCFC",
12
+ ...r?.light
13
+ },
14
+ dark: {
15
+ background: "#060607",
16
+ primary: "#0584F6",
17
+ primaryForeground: "#FCFCFC",
18
+ ...r?.dark
19
+ }
20
+ },
21
+ classNames: {
22
+ ...i,
23
+ card: t("border-none rounded-3xl", i?.card),
24
+ button: t("rounded-full", i?.button)
25
+ },
26
+ ...a
27
+ });
23
28
  }
29
+ //#endregion
30
+ export { r as MagicLinkEmail };
@@ -1,3 +1,3 @@
1
- import { type NewDeviceEmailProps } from "@better-auth-ui/react";
2
- export type { NewDeviceEmailProps } from "@better-auth-ui/react";
1
+ import { NewDeviceEmailProps } from '@better-auth-ui/react';
2
+ export type { NewDeviceEmailProps } from '@better-auth-ui/react';
3
3
  export declare function NewDeviceEmail({ colors, classNames, ...props }: NewDeviceEmailProps): import("react/jsx-runtime").JSX.Element;
@@ -1,23 +1,30 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { NewDeviceEmail as NewDeviceEmailPrimitive } from "@better-auth-ui/react";
3
- import { cn } from "@heroui/react";
4
- export function NewDeviceEmail({ colors, classNames, ...props }) {
5
- return (_jsx(NewDeviceEmailPrimitive, { colors: {
6
- light: {
7
- background: "#F5F5F5",
8
- primary: "#0285F7",
9
- primaryForeground: "#FCFCFC",
10
- ...colors?.light
11
- },
12
- dark: {
13
- background: "#060607",
14
- primary: "#0584F6",
15
- primaryForeground: "#FCFCFC",
16
- ...colors?.dark
17
- }
18
- }, classNames: {
19
- ...classNames,
20
- card: cn("border-none rounded-3xl", classNames?.card),
21
- button: cn("rounded-full", classNames?.button)
22
- }, ...props }));
1
+ import { NewDeviceEmail as e } from "@better-auth-ui/react";
2
+ import { cn as t } from "@heroui/react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/email/new-device-email.tsx
5
+ function r({ colors: r, classNames: i, ...a }) {
6
+ return /* @__PURE__ */ n(e, {
7
+ colors: {
8
+ light: {
9
+ background: "#F5F5F5",
10
+ primary: "#0285F7",
11
+ primaryForeground: "#FCFCFC",
12
+ ...r?.light
13
+ },
14
+ dark: {
15
+ background: "#060607",
16
+ primary: "#0584F6",
17
+ primaryForeground: "#FCFCFC",
18
+ ...r?.dark
19
+ }
20
+ },
21
+ classNames: {
22
+ ...i,
23
+ card: t("border-none rounded-3xl", i?.card),
24
+ button: t("rounded-full", i?.button)
25
+ },
26
+ ...a
27
+ });
23
28
  }
29
+ //#endregion
30
+ export { r as NewDeviceEmail };
@@ -1,3 +1,3 @@
1
- import { type OtpEmailProps } from "@better-auth-ui/react";
2
- export type { OtpEmailProps } from "@better-auth-ui/react";
1
+ import { OtpEmailProps } from '@better-auth-ui/react';
2
+ export type { OtpEmailProps } from '@better-auth-ui/react';
3
3
  export declare function OtpEmail({ colors, classNames, ...props }: OtpEmailProps): import("react/jsx-runtime").JSX.Element;
@@ -1,22 +1,29 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { OtpEmail as OtpEmailPrimitive } from "@better-auth-ui/react";
3
- import { cn } from "@heroui/react";
4
- export function OtpEmail({ colors, classNames, ...props }) {
5
- return (_jsx(OtpEmailPrimitive, { colors: {
6
- light: {
7
- background: "#F5F5F5",
8
- primary: "#0285F7",
9
- primaryForeground: "#FCFCFC",
10
- ...colors?.light
11
- },
12
- dark: {
13
- background: "#060607",
14
- primary: "#0584F6",
15
- primaryForeground: "#FCFCFC",
16
- ...colors?.dark
17
- }
18
- }, classNames: {
19
- ...classNames,
20
- card: cn("border-none rounded-3xl", classNames?.card)
21
- }, ...props }));
1
+ import { OtpEmail as e } from "@better-auth-ui/react";
2
+ import { cn as t } from "@heroui/react";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/email/otp-email.tsx
5
+ function r({ colors: r, classNames: i, ...a }) {
6
+ return /* @__PURE__ */ n(e, {
7
+ colors: {
8
+ light: {
9
+ background: "#F5F5F5",
10
+ primary: "#0285F7",
11
+ primaryForeground: "#FCFCFC",
12
+ ...r?.light
13
+ },
14
+ dark: {
15
+ background: "#060607",
16
+ primary: "#0584F6",
17
+ primaryForeground: "#FCFCFC",
18
+ ...r?.dark
19
+ }
20
+ },
21
+ classNames: {
22
+ ...i,
23
+ card: t("border-none rounded-3xl", i?.card)
24
+ },
25
+ ...a
26
+ });
22
27
  }
28
+ //#endregion
29
+ export { r as OtpEmail };
@@ -1,3 +1,3 @@
1
- import { type PasswordChangedEmailProps } from "@better-auth-ui/react";
2
- export type { PasswordChangedEmailProps } from "@better-auth-ui/react";
1
+ import { PasswordChangedEmailProps } from '@better-auth-ui/react';
2
+ export type { PasswordChangedEmailProps } from '@better-auth-ui/react';
3
3
  export declare function PasswordChangedEmail({ colors, classNames, ...props }: PasswordChangedEmailProps): import("react/jsx-runtime").JSX.Element;