@lalternative/auth 0.7.0 → 0.8.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/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as better_auth_react from 'better-auth/react';
2
- import { P as PlatformAuthClientConfig } from './types-SieiPwdd.js';
2
+ import { P as PlatformAuthClientConfig } from './types-Dmjo9lEL.js';
3
3
  import 'better-auth';
4
4
 
5
5
  /**
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { L as LoginFormProps, R as RegisterFormProps, V as VerifyEmailFormProps, F as ForgotPasswordFormProps, a as ResetPasswordFormProps, A as AuthLayoutProps, I as InvitationNoticeProps } from './types-SieiPwdd.js';
2
- export { b as InvitationFailure, c as LoginFormLabels, P as PlatformAuthClientConfig, d as PlatformAuthConfig, e as PlatformAuthMailer, f as PlatformAuthMailerArgs, g as PlatformAuthMailerType, h as PlatformSession, i as PlatformSessionData, j as PlatformUser, k as RegisterFormLabels } from './types-SieiPwdd.js';
1
+ import { L as LoginFormProps, R as RegisterFormProps, V as VerifyEmailFormProps, F as ForgotPasswordFormProps, a as ResetPasswordFormProps, A as AuthLayoutProps, I as InvitationNoticeProps } from './types-Dmjo9lEL.js';
2
+ export { b as InvitationFailure, c as LoginFormLabels, P as PlatformAuthClientConfig, d as PlatformAuthConfig, e as PlatformAuthMailer, f as PlatformAuthMailerArgs, g as PlatformAuthMailerType, h as PlatformSession, i as PlatformSessionData, j as PlatformUser, k as RegisterFormLabels } from './types-Dmjo9lEL.js';
3
3
  import * as better_auth_react from 'better-auth/react';
4
4
  import * as better_auth from 'better-auth';
5
5
  import { PlatformAuthClient } from './client.js';
6
6
  import * as react from 'react';
7
7
  import { InputHTMLAttributes, ReactNode } from 'react';
8
- export { C as ClaimOutcome, i as isInvitationFailure } from './invitation-BUqM_BF8.js';
8
+ export { C as ClaimOutcome, i as isInvitationFailure } from './invitation-CfZAFUdJ.js';
9
9
 
10
10
  /**
11
11
  * Returns a useSession hook bound to the given auth client.
@@ -54,6 +54,8 @@ interface AuthFieldProps extends NativeProps {
54
54
  /** Persistent helper text under the field, tied to it for screen readers */
55
55
  description?: string;
56
56
  invalid?: boolean;
57
+ /** Replaces the default border and background utilities */
58
+ fieldClassName?: string;
57
59
  }
58
60
  /**
59
61
  * A single credential field.
@@ -70,13 +72,15 @@ interface AuthFieldProps extends NativeProps {
70
72
  * corners exactly, and the border darkens at the same time — the border is what
71
73
  * survives forced-colors mode, where the ring is dropped.
72
74
  */
73
- declare function AuthField({ label, hint, description, invalid, ...props }: AuthFieldProps): react.JSX.Element;
75
+ declare function AuthField({ label, hint, description, invalid, fieldClassName, ...props }: AuthFieldProps): react.JSX.Element;
74
76
 
75
77
  interface AuthSubmitProps {
76
78
  pending?: boolean;
77
79
  disabled?: boolean;
78
80
  pendingLabel: string;
79
81
  children: ReactNode;
82
+ /** Replaces the default `bg-primary text-primary-foreground hover:bg-primary/90` */
83
+ className?: string;
80
84
  }
81
85
  /**
82
86
  * The primary action of an auth screen.
@@ -88,11 +92,23 @@ interface AuthSubmitProps {
88
92
  * The press feedback is a 1px translate rather than a scale — scaling a
89
93
  * full-width button visibly blurs its text mid-transform.
90
94
  */
91
- declare function AuthSubmit({ pending, disabled, pendingLabel, children, }: AuthSubmitProps): react.JSX.Element;
95
+ declare function AuthSubmit({ pending, disabled, pendingLabel, children, className, }: AuthSubmitProps): react.JSX.Element;
92
96
 
93
- declare function LoginForm({ onSuccess, registerUrl, forgotPasswordUrl, socialCallbackUrl, socialProviders, coreTokenUrl, labels, titleClassName, error: externalError, authClient, }: LoginFormProps): react.JSX.Element;
97
+ declare function LoginForm({ onSuccess, registerUrl, forgotPasswordUrl, socialCallbackUrl, socialProviders, coreTokenUrl, labels, submitClassName, fieldClassName, error: externalError, authClient, }: LoginFormProps): react.JSX.Element;
98
+ declare namespace LoginForm {
99
+ var defaults: {
100
+ title: string;
101
+ subtitle: string;
102
+ };
103
+ }
94
104
 
95
- declare function RegisterForm({ onSuccess, loginUrl, legal, socialCallbackUrl, socialProviders, labels, titleClassName, error: externalError, authClient, }: RegisterFormProps): react.JSX.Element;
105
+ declare function RegisterForm({ onSuccess, loginUrl, legal, socialCallbackUrl, socialProviders, labels, submitClassName, fieldClassName, error: externalError, authClient, }: RegisterFormProps): react.JSX.Element;
106
+ declare namespace RegisterForm {
107
+ var defaults: {
108
+ title: string;
109
+ subtitle: string;
110
+ };
111
+ }
96
112
 
97
113
  interface SocialButtonsProps {
98
114
  providers: Array<"google" | "github">;
@@ -105,16 +121,38 @@ interface SocialButtonsProps {
105
121
  }
106
122
  declare function SocialButtons({ providers, onSelect, disabled, separator, labels, }: SocialButtonsProps): react.JSX.Element | null;
107
123
 
108
- declare function VerifyEmailForm({ email, onSuccess, loginUrl, labels, titleClassName, authClient, }: VerifyEmailFormProps): react.JSX.Element;
124
+ declare function VerifyEmailForm({ email, onSuccess, loginUrl, labels, submitClassName, fieldClassName, authClient, }: VerifyEmailFormProps): react.JSX.Element;
125
+ declare namespace VerifyEmailForm {
126
+ var defaults: {
127
+ title: string;
128
+ subtitle: string;
129
+ };
130
+ }
109
131
 
110
- declare function ForgotPasswordForm({ onSuccess, loginUrl, labels, titleClassName, authClient, }: ForgotPasswordFormProps): react.JSX.Element;
132
+ declare function ForgotPasswordForm({ onSuccess, loginUrl, labels, submitClassName, fieldClassName, authClient, }: ForgotPasswordFormProps): react.JSX.Element;
133
+ declare namespace ForgotPasswordForm {
134
+ var defaults: {
135
+ title: string;
136
+ subtitle: string;
137
+ };
138
+ }
111
139
 
112
- declare function ResetPasswordForm({ email, onSuccess, loginUrl, labels, titleClassName, authClient, }: ResetPasswordFormProps): react.JSX.Element;
140
+ declare function ResetPasswordForm({ email, onSuccess, loginUrl, labels, submitClassName, fieldClassName, authClient, }: ResetPasswordFormProps): react.JSX.Element;
141
+ declare namespace ResetPasswordForm {
142
+ var defaults: {
143
+ title: string;
144
+ subtitle: string;
145
+ };
146
+ }
113
147
 
114
148
  /**
115
- * The frame every auth screen sits in. It owns the ground, the card and the
116
- * app's own marks (logo, illustration, legal footer); the form it wraps owns
117
- * its title and its fields.
149
+ * The frame every auth screen sits in. It owns the ground, the heading and the
150
+ * app's own marks (logo, illustration, legal footer); the card holds only the
151
+ * fields and their actions.
152
+ *
153
+ * The heading sits ABOVE the card rather than inside it: the card is then
154
+ * exactly the thing you fill in, and the mark reads as the app's rather than
155
+ * as the form's first row.
118
156
  *
119
157
  * Mobile and desktop are two layouts, not one scaled down. On a phone the form
120
158
  * IS the page: no card, no border, edge-to-edge padding, top-aligned so the
@@ -122,16 +160,16 @@ declare function ResetPasswordForm({ email, onSuccess, loginUrl, labels, titleCl
122
160
  * centering. From sm up it becomes a bounded card on a tinted ground — a
123
161
  * full-width form on a 1440px display is unreadable.
124
162
  *
125
- * With a `panel` the card splits in two from md up, the form on the left and
126
- * the illustration on the right. The panel is dropped below that width rather
127
- * than stacked: a decorative half-screen above a form costs a full swipe
128
- * before the first field. Without a `panel` the card stays the single 420px
129
- * column it has always been.
163
+ * A `panel` is an app-supplied illustration and nothing else: without one the
164
+ * card stays a single column rather than inventing decoration to fill a half
165
+ * it has no content for. When given, it takes the LEFT half from md up and is
166
+ * dropped below that width a decorative half-screen above a form costs a
167
+ * full swipe before the first field.
130
168
  *
131
169
  * min-h-dvh rather than min-h-screen: on mobile browsers 100vh includes the
132
170
  * retracting URL bar, so a screen-height container overflows by its height.
133
171
  */
134
- declare function AuthLayout({ logo, panel, children, footer, }: AuthLayoutProps): react.JSX.Element;
172
+ declare function AuthLayout({ logo, panel, title, subtitle, titleClassName, children, footer, }: AuthLayoutProps): react.JSX.Element;
135
173
 
136
174
  /**
137
175
  * What an invitee sees when their link does not work.