@insforge/nextjs 0.7.3 → 0.7.5

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/index.d.mts CHANGED
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ReactNode, CSSProperties, InputHTMLAttributes } from 'react';
4
4
  import { UserSchema, OAuthProvidersSchema, GetPublicEmailAuthConfigResponse } from '@insforge/shared-schemas';
5
+ import { ClassValue } from 'clsx';
5
6
 
6
7
  type OAuthProvider = OAuthProvidersSchema;
7
8
  interface InsforgeUser {
@@ -9,7 +10,6 @@ interface InsforgeUser {
9
10
  email: string;
10
11
  name: string;
11
12
  nickname?: string | null;
12
- avatar_url?: string | null;
13
13
  avatarUrl?: string | null;
14
14
  }
15
15
  interface InsforgeSession {
@@ -66,9 +66,14 @@ interface SignUpProps {
66
66
  interface UserButtonProps {
67
67
  afterSignOutUrl?: string;
68
68
  mode?: 'detailed' | 'simple';
69
+ className?: string;
69
70
  appearance?: {
70
71
  button?: React.CSSProperties;
71
72
  dropdown?: React.CSSProperties;
73
+ buttonClassName?: string;
74
+ dropdownClassName?: string;
75
+ nameClassName?: string;
76
+ emailClassName?: string;
72
77
  };
73
78
  }
74
79
  interface ProtectProps {
@@ -132,7 +137,7 @@ declare function SignIn({ afterSignInUrl, appearance, title, subtitle, emailLabe
132
137
 
133
138
  declare function SignUp({ afterSignUpUrl, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, signInText, signInLinkText, signInUrl, dividerText, onSuccess, onError, }: SignUpProps): react_jsx_runtime.JSX.Element;
134
139
 
135
- declare function UserButton({ afterSignOutUrl, mode, appearance, }: UserButtonProps): react_jsx_runtime.JSX.Element | null;
140
+ declare function UserButton({ afterSignOutUrl, mode, appearance, className, }: UserButtonProps): react_jsx_runtime.JSX.Element | null;
136
141
 
137
142
  declare function SignedIn({ children }: ConditionalProps): react_jsx_runtime.JSX.Element | null;
138
143
 
@@ -143,27 +148,34 @@ declare function Protect({ children, fallback, redirectTo, condition, }: Protect
143
148
  interface AuthContainerProps {
144
149
  children: ReactNode;
145
150
  style?: CSSProperties;
151
+ className?: string;
146
152
  }
147
- declare function AuthContainer({ children, style }: AuthContainerProps): react_jsx_runtime.JSX.Element;
153
+ declare function AuthContainer({ children, style, className, }: AuthContainerProps): react_jsx_runtime.JSX.Element;
148
154
 
149
155
  interface AuthHeaderProps {
150
156
  title: string;
151
157
  subtitle?: string;
158
+ className?: string;
159
+ titleClassName?: string;
160
+ subtitleClassName?: string;
152
161
  }
153
- declare function AuthHeader({ title, subtitle }: AuthHeaderProps): react_jsx_runtime.JSX.Element;
162
+ declare function AuthHeader({ title, subtitle, className, titleClassName, subtitleClassName }: AuthHeaderProps): react_jsx_runtime.JSX.Element;
154
163
 
155
164
  interface AuthErrorBannerProps {
156
165
  error: string;
166
+ className?: string;
157
167
  }
158
- declare function AuthErrorBanner({ error }: AuthErrorBannerProps): react_jsx_runtime.JSX.Element | null;
168
+ declare function AuthErrorBanner({ error, className }: AuthErrorBannerProps): react_jsx_runtime.JSX.Element | null;
159
169
 
160
170
  interface AuthFormFieldProps extends InputHTMLAttributes<HTMLInputElement> {
161
171
  label: string;
162
172
  id: string;
173
+ labelClassName?: string;
174
+ inputClassName?: string;
163
175
  }
164
- declare function AuthFormField({ label, id, className, ...props }: AuthFormFieldProps): react_jsx_runtime.JSX.Element;
176
+ declare function AuthFormField({ label, id, className, labelClassName, inputClassName, ...props }: AuthFormFieldProps): react_jsx_runtime.JSX.Element;
165
177
 
166
- interface AuthPasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
178
+ interface AuthPasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
167
179
  label: string;
168
180
  id: string;
169
181
  showStrengthIndicator?: boolean;
@@ -172,8 +184,10 @@ interface AuthPasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputEleme
172
184
  href: string;
173
185
  text?: string;
174
186
  };
187
+ labelClassName?: string;
188
+ inputClassName?: string;
175
189
  }
176
- declare function AuthPasswordField({ label, id, showStrengthIndicator, emailAuthConfig, forgotPasswordLink, value, className, onFocus, ...props }: AuthPasswordFieldProps): react_jsx_runtime.JSX.Element;
190
+ declare function AuthPasswordField({ label, id, showStrengthIndicator, emailAuthConfig, forgotPasswordLink, value, className, labelClassName, inputClassName, onFocus, ...props }: AuthPasswordFieldProps): react_jsx_runtime.JSX.Element;
177
191
 
178
192
  interface AuthSubmitButtonProps {
179
193
  children: ReactNode;
@@ -181,34 +195,40 @@ interface AuthSubmitButtonProps {
181
195
  confirmed?: boolean;
182
196
  disabled?: boolean;
183
197
  style?: CSSProperties;
198
+ className?: string;
184
199
  }
185
- declare function AuthSubmitButton({ children, isLoading, confirmed, disabled, style, }: AuthSubmitButtonProps): react_jsx_runtime.JSX.Element;
200
+ declare function AuthSubmitButton({ children, isLoading, confirmed, disabled, style, className, }: AuthSubmitButtonProps): react_jsx_runtime.JSX.Element;
186
201
 
187
202
  interface AuthDividerProps {
188
203
  text?: string;
204
+ className?: string;
189
205
  }
190
- declare function AuthDivider({ text }: AuthDividerProps): react_jsx_runtime.JSX.Element;
206
+ declare function AuthDivider({ text, className }: AuthDividerProps): react_jsx_runtime.JSX.Element;
191
207
 
192
208
  interface AuthLinkProps {
193
209
  text: string;
194
210
  linkText: string;
195
211
  href: string;
212
+ className?: string;
213
+ linkClassName?: string;
196
214
  }
197
- declare function AuthLink({ text, linkText, href }: AuthLinkProps): react_jsx_runtime.JSX.Element;
215
+ declare function AuthLink({ text, linkText, href, className, linkClassName }: AuthLinkProps): react_jsx_runtime.JSX.Element;
198
216
 
199
217
  interface AuthOAuthProvidersProps {
200
218
  providers: OAuthProvider[];
201
219
  onClick: (provider: OAuthProvider) => void;
202
220
  disabled?: boolean;
203
221
  loading: OAuthProvider | null;
222
+ className?: string;
204
223
  }
205
- declare function AuthOAuthProviders({ providers, onClick, disabled, loading, }: AuthOAuthProvidersProps): react_jsx_runtime.JSX.Element | null;
224
+ declare function AuthOAuthProviders({ providers, onClick, disabled, loading, className, }: AuthOAuthProvidersProps): react_jsx_runtime.JSX.Element | null;
206
225
 
207
226
  interface AuthBrandingProps {
208
227
  text?: string;
209
228
  href?: string;
229
+ className?: string;
210
230
  }
211
- declare function AuthBranding({ text, href }: AuthBrandingProps): react_jsx_runtime.JSX.Element;
231
+ declare function AuthBranding({ text, href, className }: AuthBrandingProps): react_jsx_runtime.JSX.Element;
212
232
 
213
233
  type DisplayMode = 'full' | 'short' | 'icon';
214
234
  interface AuthOAuthButtonProps {
@@ -218,15 +238,17 @@ interface AuthOAuthButtonProps {
218
238
  loading?: boolean;
219
239
  displayMode?: DisplayMode;
220
240
  style?: React.CSSProperties;
241
+ className?: string;
221
242
  }
222
- declare function AuthOAuthButton({ provider, onClick, disabled, loading, displayMode, style }: AuthOAuthButtonProps): react_jsx_runtime.JSX.Element | null;
243
+ declare function AuthOAuthButton({ provider, onClick, disabled, loading, displayMode, style, className }: AuthOAuthButtonProps): react_jsx_runtime.JSX.Element | null;
223
244
 
224
245
  interface AuthPasswordStrengthIndicatorProps {
225
246
  password: string;
226
247
  config: GetPublicEmailAuthConfigResponse;
248
+ className?: string;
227
249
  }
228
250
  declare function validatePasswordStrength(password: string, config: GetPublicEmailAuthConfigResponse): boolean;
229
- declare function AuthPasswordStrengthIndicator({ password, config }: AuthPasswordStrengthIndicatorProps): react_jsx_runtime.JSX.Element;
251
+ declare function AuthPasswordStrengthIndicator({ password, config, className }: AuthPasswordStrengthIndicatorProps): react_jsx_runtime.JSX.Element;
230
252
 
231
253
  interface AuthVerificationCodeInputProps {
232
254
  length?: number;
@@ -234,12 +256,16 @@ interface AuthVerificationCodeInputProps {
234
256
  email: string;
235
257
  onChange: (value: string) => void;
236
258
  disabled?: boolean;
259
+ className?: string;
260
+ inputClassName?: string;
237
261
  }
238
- declare function AuthVerificationCodeInput({ length, value, email, onChange, disabled, }: AuthVerificationCodeInputProps): react_jsx_runtime.JSX.Element;
262
+ declare function AuthVerificationCodeInput({ length, value, email, onChange, disabled, className, inputClassName, }: AuthVerificationCodeInputProps): react_jsx_runtime.JSX.Element;
239
263
 
240
264
  declare const OAUTH_PROVIDER_CONFIG: Record<OAuthProvider, OAuthProviderConfig>;
241
265
  declare function getProviderConfig(provider: OAuthProvider): OAuthProviderConfig | null;
242
266
  declare function getProviderName(provider: OAuthProvider): string;
243
267
  declare function isProviderSupported(provider: string): provider is OAuthProvider;
244
268
 
245
- export { AuthBranding, AuthContainer, AuthDivider, AuthErrorBanner, AuthFormField, AuthHeader, AuthLink, AuthOAuthButton, AuthOAuthProviders, AuthPasswordField, AuthPasswordStrengthIndicator, AuthSubmitButton, AuthVerificationCodeInput, type ConditionalProps, InsforgeProvider, type InsforgeSession, type InsforgeUser, OAUTH_PROVIDER_CONFIG, type OAuthProviderConfig, Protect, type ProtectProps, SignIn, type SignInProps, SignUp, type SignUpProps, SignedIn, SignedOut, UserButton, type UserButtonProps, getProviderConfig, getProviderName, isProviderSupported, useAuth, useInsforge, useSession, useUser, validatePasswordStrength };
269
+ declare function cn(...inputs: ClassValue[]): string;
270
+
271
+ export { AuthBranding, AuthContainer, AuthDivider, AuthErrorBanner, AuthFormField, AuthHeader, AuthLink, AuthOAuthButton, AuthOAuthProviders, AuthPasswordField, AuthPasswordStrengthIndicator, AuthSubmitButton, AuthVerificationCodeInput, type ConditionalProps, InsforgeProvider, type InsforgeSession, type InsforgeUser, OAUTH_PROVIDER_CONFIG, type OAuthProviderConfig, Protect, type ProtectProps, SignIn, type SignInProps, SignUp, type SignUpProps, SignedIn, SignedOut, UserButton, type UserButtonProps, cn, getProviderConfig, getProviderName, isProviderSupported, useAuth, useInsforge, useSession, useUser, validatePasswordStrength };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ReactNode, CSSProperties, InputHTMLAttributes } from 'react';
4
4
  import { UserSchema, OAuthProvidersSchema, GetPublicEmailAuthConfigResponse } from '@insforge/shared-schemas';
5
+ import { ClassValue } from 'clsx';
5
6
 
6
7
  type OAuthProvider = OAuthProvidersSchema;
7
8
  interface InsforgeUser {
@@ -9,7 +10,6 @@ interface InsforgeUser {
9
10
  email: string;
10
11
  name: string;
11
12
  nickname?: string | null;
12
- avatar_url?: string | null;
13
13
  avatarUrl?: string | null;
14
14
  }
15
15
  interface InsforgeSession {
@@ -66,9 +66,14 @@ interface SignUpProps {
66
66
  interface UserButtonProps {
67
67
  afterSignOutUrl?: string;
68
68
  mode?: 'detailed' | 'simple';
69
+ className?: string;
69
70
  appearance?: {
70
71
  button?: React.CSSProperties;
71
72
  dropdown?: React.CSSProperties;
73
+ buttonClassName?: string;
74
+ dropdownClassName?: string;
75
+ nameClassName?: string;
76
+ emailClassName?: string;
72
77
  };
73
78
  }
74
79
  interface ProtectProps {
@@ -132,7 +137,7 @@ declare function SignIn({ afterSignInUrl, appearance, title, subtitle, emailLabe
132
137
 
133
138
  declare function SignUp({ afterSignUpUrl, appearance, title, subtitle, emailLabel, emailPlaceholder, passwordLabel, passwordPlaceholder, submitButtonText, loadingButtonText, signInText, signInLinkText, signInUrl, dividerText, onSuccess, onError, }: SignUpProps): react_jsx_runtime.JSX.Element;
134
139
 
135
- declare function UserButton({ afterSignOutUrl, mode, appearance, }: UserButtonProps): react_jsx_runtime.JSX.Element | null;
140
+ declare function UserButton({ afterSignOutUrl, mode, appearance, className, }: UserButtonProps): react_jsx_runtime.JSX.Element | null;
136
141
 
137
142
  declare function SignedIn({ children }: ConditionalProps): react_jsx_runtime.JSX.Element | null;
138
143
 
@@ -143,27 +148,34 @@ declare function Protect({ children, fallback, redirectTo, condition, }: Protect
143
148
  interface AuthContainerProps {
144
149
  children: ReactNode;
145
150
  style?: CSSProperties;
151
+ className?: string;
146
152
  }
147
- declare function AuthContainer({ children, style }: AuthContainerProps): react_jsx_runtime.JSX.Element;
153
+ declare function AuthContainer({ children, style, className, }: AuthContainerProps): react_jsx_runtime.JSX.Element;
148
154
 
149
155
  interface AuthHeaderProps {
150
156
  title: string;
151
157
  subtitle?: string;
158
+ className?: string;
159
+ titleClassName?: string;
160
+ subtitleClassName?: string;
152
161
  }
153
- declare function AuthHeader({ title, subtitle }: AuthHeaderProps): react_jsx_runtime.JSX.Element;
162
+ declare function AuthHeader({ title, subtitle, className, titleClassName, subtitleClassName }: AuthHeaderProps): react_jsx_runtime.JSX.Element;
154
163
 
155
164
  interface AuthErrorBannerProps {
156
165
  error: string;
166
+ className?: string;
157
167
  }
158
- declare function AuthErrorBanner({ error }: AuthErrorBannerProps): react_jsx_runtime.JSX.Element | null;
168
+ declare function AuthErrorBanner({ error, className }: AuthErrorBannerProps): react_jsx_runtime.JSX.Element | null;
159
169
 
160
170
  interface AuthFormFieldProps extends InputHTMLAttributes<HTMLInputElement> {
161
171
  label: string;
162
172
  id: string;
173
+ labelClassName?: string;
174
+ inputClassName?: string;
163
175
  }
164
- declare function AuthFormField({ label, id, className, ...props }: AuthFormFieldProps): react_jsx_runtime.JSX.Element;
176
+ declare function AuthFormField({ label, id, className, labelClassName, inputClassName, ...props }: AuthFormFieldProps): react_jsx_runtime.JSX.Element;
165
177
 
166
- interface AuthPasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
178
+ interface AuthPasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
167
179
  label: string;
168
180
  id: string;
169
181
  showStrengthIndicator?: boolean;
@@ -172,8 +184,10 @@ interface AuthPasswordFieldProps extends Omit<InputHTMLAttributes<HTMLInputEleme
172
184
  href: string;
173
185
  text?: string;
174
186
  };
187
+ labelClassName?: string;
188
+ inputClassName?: string;
175
189
  }
176
- declare function AuthPasswordField({ label, id, showStrengthIndicator, emailAuthConfig, forgotPasswordLink, value, className, onFocus, ...props }: AuthPasswordFieldProps): react_jsx_runtime.JSX.Element;
190
+ declare function AuthPasswordField({ label, id, showStrengthIndicator, emailAuthConfig, forgotPasswordLink, value, className, labelClassName, inputClassName, onFocus, ...props }: AuthPasswordFieldProps): react_jsx_runtime.JSX.Element;
177
191
 
178
192
  interface AuthSubmitButtonProps {
179
193
  children: ReactNode;
@@ -181,34 +195,40 @@ interface AuthSubmitButtonProps {
181
195
  confirmed?: boolean;
182
196
  disabled?: boolean;
183
197
  style?: CSSProperties;
198
+ className?: string;
184
199
  }
185
- declare function AuthSubmitButton({ children, isLoading, confirmed, disabled, style, }: AuthSubmitButtonProps): react_jsx_runtime.JSX.Element;
200
+ declare function AuthSubmitButton({ children, isLoading, confirmed, disabled, style, className, }: AuthSubmitButtonProps): react_jsx_runtime.JSX.Element;
186
201
 
187
202
  interface AuthDividerProps {
188
203
  text?: string;
204
+ className?: string;
189
205
  }
190
- declare function AuthDivider({ text }: AuthDividerProps): react_jsx_runtime.JSX.Element;
206
+ declare function AuthDivider({ text, className }: AuthDividerProps): react_jsx_runtime.JSX.Element;
191
207
 
192
208
  interface AuthLinkProps {
193
209
  text: string;
194
210
  linkText: string;
195
211
  href: string;
212
+ className?: string;
213
+ linkClassName?: string;
196
214
  }
197
- declare function AuthLink({ text, linkText, href }: AuthLinkProps): react_jsx_runtime.JSX.Element;
215
+ declare function AuthLink({ text, linkText, href, className, linkClassName }: AuthLinkProps): react_jsx_runtime.JSX.Element;
198
216
 
199
217
  interface AuthOAuthProvidersProps {
200
218
  providers: OAuthProvider[];
201
219
  onClick: (provider: OAuthProvider) => void;
202
220
  disabled?: boolean;
203
221
  loading: OAuthProvider | null;
222
+ className?: string;
204
223
  }
205
- declare function AuthOAuthProviders({ providers, onClick, disabled, loading, }: AuthOAuthProvidersProps): react_jsx_runtime.JSX.Element | null;
224
+ declare function AuthOAuthProviders({ providers, onClick, disabled, loading, className, }: AuthOAuthProvidersProps): react_jsx_runtime.JSX.Element | null;
206
225
 
207
226
  interface AuthBrandingProps {
208
227
  text?: string;
209
228
  href?: string;
229
+ className?: string;
210
230
  }
211
- declare function AuthBranding({ text, href }: AuthBrandingProps): react_jsx_runtime.JSX.Element;
231
+ declare function AuthBranding({ text, href, className }: AuthBrandingProps): react_jsx_runtime.JSX.Element;
212
232
 
213
233
  type DisplayMode = 'full' | 'short' | 'icon';
214
234
  interface AuthOAuthButtonProps {
@@ -218,15 +238,17 @@ interface AuthOAuthButtonProps {
218
238
  loading?: boolean;
219
239
  displayMode?: DisplayMode;
220
240
  style?: React.CSSProperties;
241
+ className?: string;
221
242
  }
222
- declare function AuthOAuthButton({ provider, onClick, disabled, loading, displayMode, style }: AuthOAuthButtonProps): react_jsx_runtime.JSX.Element | null;
243
+ declare function AuthOAuthButton({ provider, onClick, disabled, loading, displayMode, style, className }: AuthOAuthButtonProps): react_jsx_runtime.JSX.Element | null;
223
244
 
224
245
  interface AuthPasswordStrengthIndicatorProps {
225
246
  password: string;
226
247
  config: GetPublicEmailAuthConfigResponse;
248
+ className?: string;
227
249
  }
228
250
  declare function validatePasswordStrength(password: string, config: GetPublicEmailAuthConfigResponse): boolean;
229
- declare function AuthPasswordStrengthIndicator({ password, config }: AuthPasswordStrengthIndicatorProps): react_jsx_runtime.JSX.Element;
251
+ declare function AuthPasswordStrengthIndicator({ password, config, className }: AuthPasswordStrengthIndicatorProps): react_jsx_runtime.JSX.Element;
230
252
 
231
253
  interface AuthVerificationCodeInputProps {
232
254
  length?: number;
@@ -234,12 +256,16 @@ interface AuthVerificationCodeInputProps {
234
256
  email: string;
235
257
  onChange: (value: string) => void;
236
258
  disabled?: boolean;
259
+ className?: string;
260
+ inputClassName?: string;
237
261
  }
238
- declare function AuthVerificationCodeInput({ length, value, email, onChange, disabled, }: AuthVerificationCodeInputProps): react_jsx_runtime.JSX.Element;
262
+ declare function AuthVerificationCodeInput({ length, value, email, onChange, disabled, className, inputClassName, }: AuthVerificationCodeInputProps): react_jsx_runtime.JSX.Element;
239
263
 
240
264
  declare const OAUTH_PROVIDER_CONFIG: Record<OAuthProvider, OAuthProviderConfig>;
241
265
  declare function getProviderConfig(provider: OAuthProvider): OAuthProviderConfig | null;
242
266
  declare function getProviderName(provider: OAuthProvider): string;
243
267
  declare function isProviderSupported(provider: string): provider is OAuthProvider;
244
268
 
245
- export { AuthBranding, AuthContainer, AuthDivider, AuthErrorBanner, AuthFormField, AuthHeader, AuthLink, AuthOAuthButton, AuthOAuthProviders, AuthPasswordField, AuthPasswordStrengthIndicator, AuthSubmitButton, AuthVerificationCodeInput, type ConditionalProps, InsforgeProvider, type InsforgeSession, type InsforgeUser, OAUTH_PROVIDER_CONFIG, type OAuthProviderConfig, Protect, type ProtectProps, SignIn, type SignInProps, SignUp, type SignUpProps, SignedIn, SignedOut, UserButton, type UserButtonProps, getProviderConfig, getProviderName, isProviderSupported, useAuth, useInsforge, useSession, useUser, validatePasswordStrength };
269
+ declare function cn(...inputs: ClassValue[]): string;
270
+
271
+ export { AuthBranding, AuthContainer, AuthDivider, AuthErrorBanner, AuthFormField, AuthHeader, AuthLink, AuthOAuthButton, AuthOAuthProviders, AuthPasswordField, AuthPasswordStrengthIndicator, AuthSubmitButton, AuthVerificationCodeInput, type ConditionalProps, InsforgeProvider, type InsforgeSession, type InsforgeUser, OAUTH_PROVIDER_CONFIG, type OAuthProviderConfig, Protect, type ProtectProps, SignIn, type SignInProps, SignUp, type SignUpProps, SignedIn, SignedOut, UserButton, type UserButtonProps, cn, getProviderConfig, getProviderName, isProviderSupported, useAuth, useInsforge, useSession, useUser, validatePasswordStrength };