@better-auth-ui/heroui 1.6.19 → 1.6.20
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/auth.d.ts +2 -1
- package/dist/components/auth/forgot-password.d.ts +1 -1
- package/dist/components/auth/magic-link/magic-link.d.ts +1 -1
- package/dist/components/auth/reset-password.d.ts +1 -1
- package/dist/components/auth/sign-in.d.ts +1 -1
- package/dist/components/auth/sign-up.d.ts +1 -1
- package/dist/components/auth/username/sign-in-username.d.ts +1 -1
- package/dist/index.js +446 -447
- package/dist/lib/auth/auth-plugin.d.ts +4 -2
- package/dist/plugins.js +925 -927
- package/package.json +3 -3
- package/src/components/auth/auth.tsx +11 -6
- package/src/components/auth/forgot-password.tsx +1 -6
- package/src/components/auth/magic-link/magic-link.tsx +2 -4
- package/src/components/auth/reset-password.tsx +1 -6
- package/src/components/auth/sign-in.tsx +2 -4
- package/src/components/auth/sign-up.tsx +2 -4
- package/src/components/auth/user/user-button.tsx +2 -2
- package/src/components/auth/username/sign-in-username.tsx +2 -4
- package/src/lib/auth/auth-plugin.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth-ui/heroui",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@types/react": "^19.2.15",
|
|
44
44
|
"@vitejs/plugin-react": "^6.0.2",
|
|
45
45
|
"@vitest/browser-playwright": "^4.1.7",
|
|
46
|
-
"better-auth": "^1.6.
|
|
46
|
+
"better-auth": "^1.6.17",
|
|
47
47
|
"bowser": "^2.11.0",
|
|
48
48
|
"playwright": "^1.60.0",
|
|
49
49
|
"react": "^19.2.6",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@internationalized/date": ">=3.12.2",
|
|
60
60
|
"@tanstack/react-pacer": ">=0.22.1",
|
|
61
61
|
"@tanstack/react-query": ">=5.100.14",
|
|
62
|
-
"better-auth": ">=1.6.
|
|
62
|
+
"better-auth": ">=1.6.17",
|
|
63
63
|
"react": ">=19.2.6",
|
|
64
64
|
"react-dom": ">=19.2.6",
|
|
65
65
|
"bowser": ">=2.11.0"
|
|
@@ -37,6 +37,7 @@ const AUTH_VIEWS: Partial<Record<AuthView, ComponentType<AuthProps>>> = {
|
|
|
37
37
|
/**
|
|
38
38
|
* Render the appropriate authentication view based on the provided `view` or `path`.
|
|
39
39
|
*
|
|
40
|
+
* @param className - Class name applied to the rendered view's card
|
|
40
41
|
* @param path - Route path used to resolve an auth view when `view` is not provided
|
|
41
42
|
* @param socialLayout - Social layout to apply to sign-in/sign-up/magic-link views
|
|
42
43
|
* @param socialPosition - Position for social buttons ("top" or "bottom")
|
|
@@ -45,12 +46,13 @@ const AUTH_VIEWS: Partial<Record<AuthView, ComponentType<AuthProps>>> = {
|
|
|
45
46
|
* @returns The React element for the resolved authentication view
|
|
46
47
|
*/
|
|
47
48
|
export function Auth({
|
|
49
|
+
className,
|
|
48
50
|
path,
|
|
49
51
|
socialLayout,
|
|
50
52
|
socialPosition,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}: AuthProps
|
|
53
|
+
variant,
|
|
54
|
+
view
|
|
55
|
+
}: AuthProps) {
|
|
54
56
|
const { basePaths, emailAndPassword, plugins, viewPaths, navigate } =
|
|
55
57
|
useAuth()
|
|
56
58
|
|
|
@@ -107,9 +109,10 @@ export function Auth({
|
|
|
107
109
|
|
|
108
110
|
return (
|
|
109
111
|
<PluginView
|
|
112
|
+
className={className}
|
|
110
113
|
socialLayout={socialLayout}
|
|
111
114
|
socialPosition={socialPosition}
|
|
112
|
-
{
|
|
115
|
+
variant={variant}
|
|
113
116
|
/>
|
|
114
117
|
)
|
|
115
118
|
}
|
|
@@ -125,9 +128,10 @@ export function Auth({
|
|
|
125
128
|
if (Fallback) {
|
|
126
129
|
return (
|
|
127
130
|
<Fallback
|
|
131
|
+
className={className}
|
|
128
132
|
socialLayout={socialLayout}
|
|
129
133
|
socialPosition={socialPosition}
|
|
130
|
-
{
|
|
134
|
+
variant={variant}
|
|
131
135
|
/>
|
|
132
136
|
)
|
|
133
137
|
}
|
|
@@ -143,9 +147,10 @@ export function Auth({
|
|
|
143
147
|
|
|
144
148
|
return (
|
|
145
149
|
<AuthView
|
|
150
|
+
className={className}
|
|
146
151
|
socialLayout={socialLayout}
|
|
147
152
|
socialPosition={socialPosition}
|
|
148
|
-
{
|
|
153
|
+
variant={variant}
|
|
149
154
|
/>
|
|
150
155
|
)
|
|
151
156
|
}
|
|
@@ -34,11 +34,7 @@ export type ForgotPasswordProps = {
|
|
|
34
34
|
* @param className - Optional additional CSS class names applied to the card
|
|
35
35
|
* @returns The forgot-password form UI as a JSX element
|
|
36
36
|
*/
|
|
37
|
-
export function ForgotPassword({
|
|
38
|
-
className,
|
|
39
|
-
variant,
|
|
40
|
-
...props
|
|
41
|
-
}: ForgotPasswordProps & Omit<CardProps, "children">) {
|
|
37
|
+
export function ForgotPassword({ className, variant }: ForgotPasswordProps) {
|
|
42
38
|
const {
|
|
43
39
|
authClient,
|
|
44
40
|
baseURL,
|
|
@@ -83,7 +79,6 @@ export function ForgotPassword({
|
|
|
83
79
|
<Card
|
|
84
80
|
className={cn("w-full max-w-sm gap-4 md:p-6", className)}
|
|
85
81
|
variant={variant}
|
|
86
|
-
{...props}
|
|
87
82
|
>
|
|
88
83
|
<Card.Header>
|
|
89
84
|
<Card.Title className="text-xl font-semibold mb-1">
|
|
@@ -45,9 +45,8 @@ export function MagicLink({
|
|
|
45
45
|
className,
|
|
46
46
|
socialLayout,
|
|
47
47
|
socialPosition = "bottom",
|
|
48
|
-
variant
|
|
49
|
-
|
|
50
|
-
}: MagicLinkProps & Omit<CardProps, "children">) {
|
|
48
|
+
variant
|
|
49
|
+
}: MagicLinkProps) {
|
|
51
50
|
const {
|
|
52
51
|
authClient,
|
|
53
52
|
basePaths,
|
|
@@ -90,7 +89,6 @@ export function MagicLink({
|
|
|
90
89
|
<Card
|
|
91
90
|
className={cn("w-full max-w-sm gap-4 md:p-6", className)}
|
|
92
91
|
variant={variant}
|
|
93
|
-
{...props}
|
|
94
92
|
>
|
|
95
93
|
<Card.Header>
|
|
96
94
|
<Card.Title className="text-xl font-semibold mb-1">
|
|
@@ -27,11 +27,7 @@ export type ResetPasswordProps = {
|
|
|
27
27
|
*
|
|
28
28
|
* Renders password (and optional confirm-password) inputs with visibility toggles, applies min/max length constraints from the auth configuration, shows field errors, and submits the new password to the auth client.
|
|
29
29
|
*/
|
|
30
|
-
export function ResetPassword({
|
|
31
|
-
className,
|
|
32
|
-
variant,
|
|
33
|
-
...props
|
|
34
|
-
}: ResetPasswordProps & Omit<CardProps, "children">) {
|
|
30
|
+
export function ResetPassword({ className, variant }: ResetPasswordProps) {
|
|
35
31
|
const {
|
|
36
32
|
authClient,
|
|
37
33
|
basePaths,
|
|
@@ -95,7 +91,6 @@ export function ResetPassword({
|
|
|
95
91
|
<Card
|
|
96
92
|
className={cn("w-full max-w-sm gap-4 md:p-6", className)}
|
|
97
93
|
variant={variant}
|
|
98
|
-
{...props}
|
|
99
94
|
>
|
|
100
95
|
<Card.Header>
|
|
101
96
|
<Card.Title className="text-xl font-semibold mb-1">
|
|
@@ -43,9 +43,8 @@ export function SignIn({
|
|
|
43
43
|
className,
|
|
44
44
|
socialLayout,
|
|
45
45
|
socialPosition = "bottom",
|
|
46
|
-
variant
|
|
47
|
-
|
|
48
|
-
}: SignInProps & Omit<CardProps, "children">) {
|
|
46
|
+
variant
|
|
47
|
+
}: SignInProps) {
|
|
49
48
|
const {
|
|
50
49
|
authClient,
|
|
51
50
|
basePaths,
|
|
@@ -128,7 +127,6 @@ export function SignIn({
|
|
|
128
127
|
<Card
|
|
129
128
|
className={cn("w-full max-w-sm gap-4 md:p-6", className)}
|
|
130
129
|
variant={variant}
|
|
131
|
-
{...props}
|
|
132
130
|
>
|
|
133
131
|
<Card.Header>
|
|
134
132
|
<Card.Title className="text-xl font-semibold mb-1">
|
|
@@ -47,9 +47,8 @@ export function SignUp({
|
|
|
47
47
|
className,
|
|
48
48
|
socialLayout,
|
|
49
49
|
socialPosition = "bottom",
|
|
50
|
-
variant
|
|
51
|
-
|
|
52
|
-
}: SignUpProps & Omit<CardProps, "children">) {
|
|
50
|
+
variant
|
|
51
|
+
}: SignUpProps) {
|
|
53
52
|
const {
|
|
54
53
|
additionalFields,
|
|
55
54
|
authClient,
|
|
@@ -156,7 +155,6 @@ export function SignUp({
|
|
|
156
155
|
<Card
|
|
157
156
|
className={cn("w-full max-w-sm gap-4 md:p-6", className)}
|
|
158
157
|
variant={variant}
|
|
159
|
-
{...props}
|
|
160
158
|
>
|
|
161
159
|
<Card.Header>
|
|
162
160
|
<Card.Title className="text-xl font-semibold mb-1">
|
|
@@ -123,8 +123,8 @@ export function UserButton({
|
|
|
123
123
|
return (
|
|
124
124
|
<Dropdown>
|
|
125
125
|
{size === "icon" ? (
|
|
126
|
-
<Dropdown.Trigger className={cn("rounded-full"
|
|
127
|
-
<UserAvatar />
|
|
126
|
+
<Dropdown.Trigger className={cn("rounded-full")}>
|
|
127
|
+
<UserAvatar className={className} />
|
|
128
128
|
</Dropdown.Trigger>
|
|
129
129
|
) : (
|
|
130
130
|
<Button
|
|
@@ -46,9 +46,8 @@ export function SignInUsername({
|
|
|
46
46
|
className,
|
|
47
47
|
socialLayout,
|
|
48
48
|
socialPosition = "bottom",
|
|
49
|
-
variant
|
|
50
|
-
|
|
51
|
-
}: SignInUsernameProps & Omit<CardProps, "children">) {
|
|
49
|
+
variant
|
|
50
|
+
}: SignInUsernameProps) {
|
|
52
51
|
const {
|
|
53
52
|
authClient,
|
|
54
53
|
basePaths,
|
|
@@ -154,7 +153,6 @@ export function SignInUsername({
|
|
|
154
153
|
<Card
|
|
155
154
|
className={cn("w-full max-w-sm gap-4 md:p-6", className)}
|
|
156
155
|
variant={variant}
|
|
157
|
-
{...props}
|
|
158
156
|
>
|
|
159
157
|
<Card.Header>
|
|
160
158
|
<Card.Title className="text-xl font-semibold mb-1">
|
|
@@ -55,10 +55,12 @@ export type AuthPluginComponents = Omit<
|
|
|
55
55
|
userMenuItems?: ComponentType<UserMenuItemProps>[]
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
/** Props the heroui `<Auth>` router
|
|
59
|
-
export type AuthViewProps =
|
|
58
|
+
/** Props the heroui `<Auth>` router passes to plugin-contributed auth views. */
|
|
59
|
+
export type AuthViewProps = {
|
|
60
|
+
className?: string
|
|
60
61
|
socialLayout?: SocialLayout
|
|
61
62
|
socialPosition?: "top" | "bottom"
|
|
63
|
+
variant?: CardProps["variant"]
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
/** Props the heroui `<Settings>` router spreads onto plugin-contributed settings views. */
|