@lalternative/auth 0.4.2 → 0.4.4

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-DxllDyOa.js';
2
+ import { P as PlatformAuthClientConfig } from './types-BXyGxKtF.js';
3
3
  import 'better-auth';
4
4
 
5
5
  /**
package/dist/index.d.ts CHANGED
@@ -1,10 +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-DxllDyOa.js';
2
- export { b as InvitationFailure, P as PlatformAuthClientConfig, c as PlatformAuthConfig, d as PlatformAuthMailer, e as PlatformAuthMailerArgs, f as PlatformAuthMailerType, g as PlatformSession, h as PlatformSessionData, i as PlatformUser } from './types-DxllDyOa.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-BXyGxKtF.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-BXyGxKtF.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
- export { C as ClaimOutcome, i as isInvitationFailure } from './invitation-CzfLna7q.js';
7
+ import { InputHTMLAttributes, ReactNode } from 'react';
8
+ export { C as ClaimOutcome, i as isInvitationFailure } from './invitation-Bucmin-z.js';
8
9
 
9
10
  /**
10
11
  * Returns a useSession hook bound to the given auth client.
@@ -45,16 +46,64 @@ declare function useSession(authClient: PlatformAuthClient): {
45
46
  */
46
47
  declare function useLogout(authClient: PlatformAuthClient): () => Promise<void>;
47
48
 
48
- declare function LoginForm({ onSuccess, registerUrl, forgotPasswordUrl, socialCallbackUrl, socialProviders, coreTokenUrl, authClient, }: LoginFormProps): react.JSX.Element;
49
+ type NativeProps = Omit<InputHTMLAttributes<HTMLInputElement>, "id" | "className">;
50
+ interface AuthFieldProps extends NativeProps {
51
+ label: string;
52
+ /** Rendered on the right of the label row — typically a "forgot password" link */
53
+ hint?: ReactNode;
54
+ /** Persistent helper text under the field, tied to it for screen readers */
55
+ description?: string;
56
+ invalid?: boolean;
57
+ }
58
+ /**
59
+ * A single credential field.
60
+ *
61
+ * The label is a real <label>, always visible, never a placeholder standing in
62
+ * for one: a placeholder disappears the moment someone types, which is exactly
63
+ * when a person double-checking a long password needs to know what the box is.
64
+ *
65
+ * Touch targets are 52px tall on mobile and 44px from sm up. Below ~48px,
66
+ * thumbs miss; on a pointer device the same height reads as oversized, so the
67
+ * two are not one compromise value.
68
+ *
69
+ * The focus ring is drawn with box-shadow rather than outline so it follows the
70
+ * rounded corners exactly, and the border darkens at the same time — focus
71
+ * survives forced-colors mode, where shadows are dropped.
72
+ */
73
+ declare function AuthField({ label, hint, description, invalid, ...props }: AuthFieldProps): react.JSX.Element;
74
+
75
+ interface AuthSubmitProps {
76
+ pending?: boolean;
77
+ disabled?: boolean;
78
+ pendingLabel: string;
79
+ children: ReactNode;
80
+ }
81
+ /**
82
+ * The primary action of an auth screen.
83
+ *
84
+ * The label swaps to its pending form in place, with the spinner absolutely
85
+ * positioned: a spinner inserted into the flow would widen the row and shift
86
+ * the text sideways at the exact moment the person is watching it.
87
+ *
88
+ * The press feedback is a 1px translate rather than a scale — scaling a
89
+ * full-width button visibly blurs its text mid-transform.
90
+ */
91
+ declare function AuthSubmit({ pending, disabled, pendingLabel, children, }: AuthSubmitProps): react.JSX.Element;
92
+
93
+ declare function LoginForm({ onSuccess, registerUrl, forgotPasswordUrl, socialCallbackUrl, socialProviders, coreTokenUrl, labels, authClient, }: LoginFormProps): react.JSX.Element;
49
94
 
50
- declare function RegisterForm({ onSuccess, loginUrl, legal, socialCallbackUrl, socialProviders, authClient, }: RegisterFormProps): react.JSX.Element;
95
+ declare function RegisterForm({ onSuccess, loginUrl, legal, socialCallbackUrl, socialProviders, labels, authClient, }: RegisterFormProps): react.JSX.Element;
51
96
 
52
97
  interface SocialButtonsProps {
53
98
  providers: Array<"google" | "github">;
54
99
  onSelect: (provider: "google" | "github") => void | Promise<void>;
55
100
  disabled?: boolean;
101
+ /** Divider text between the password form and the providers */
102
+ separator?: string;
103
+ /** Per-provider button copy, merged over the French defaults */
104
+ labels?: Partial<Record<"google" | "github", string>>;
56
105
  }
57
- declare function SocialButtons({ providers, onSelect, disabled, }: SocialButtonsProps): react.JSX.Element | null;
106
+ declare function SocialButtons({ providers, onSelect, disabled, separator, labels, }: SocialButtonsProps): react.JSX.Element | null;
58
107
 
59
108
  declare function VerifyEmailForm({ email, onSuccess, authClient, }: VerifyEmailFormProps): react.JSX.Element;
60
109
 
@@ -62,6 +111,18 @@ declare function ForgotPasswordForm({ onSuccess, loginUrl, authClient, }: Forgot
62
111
 
63
112
  declare function ResetPasswordForm({ email, onSuccess, loginUrl, authClient, }: ResetPasswordFormProps): react.JSX.Element;
64
113
 
114
+ /**
115
+ * The frame every auth screen sits in.
116
+ *
117
+ * Mobile and desktop are two layouts, not one scaled down. On a phone the form
118
+ * IS the page: no card, no border, edge-to-edge padding, top-aligned so the
119
+ * fields stay above the keyboard instead of being pushed under it by vertical
120
+ * centering. From sm up it becomes a bounded card, centered, on a tinted
121
+ * ground — a full-width form on a 1440px display is unreadable.
122
+ *
123
+ * min-h-dvh rather than min-h-screen: on mobile browsers 100vh includes the
124
+ * retracting URL bar, so a screen-height container overflows by its height.
125
+ */
65
126
  declare function AuthLayout({ logo, title, subtitle, children, footer, }: AuthLayoutProps): react.JSX.Element;
66
127
 
67
128
  /**
@@ -78,4 +139,4 @@ declare function AuthLayout({ logo, title, subtitle, children, footer, }: AuthLa
78
139
  */
79
140
  declare function InvitationNotice({ reason, supportEmail, title, action, }: InvitationNoticeProps): react.JSX.Element;
80
141
 
81
- export { AuthLayout, AuthLayoutProps, ForgotPasswordForm, ForgotPasswordFormProps, InvitationNotice, InvitationNoticeProps, LoginForm, LoginFormProps, RegisterForm, RegisterFormProps, ResetPasswordForm, ResetPasswordFormProps, SocialButtons, VerifyEmailForm, VerifyEmailFormProps, useLogout, useSession };
142
+ export { AuthField, type AuthFieldProps, AuthLayout, AuthLayoutProps, AuthSubmit, ForgotPasswordForm, ForgotPasswordFormProps, InvitationNotice, InvitationNoticeProps, LoginForm, LoginFormProps, RegisterForm, RegisterFormProps, ResetPasswordForm, ResetPasswordFormProps, SocialButtons, VerifyEmailForm, VerifyEmailFormProps, useLogout, useSession };