@insforge/react 0.1.7 → 0.2.1
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/README.md +286 -570
- package/dist/atoms.js +5 -5
- package/dist/atoms.js.map +1 -1
- package/dist/atoms.mjs +5 -5
- package/dist/atoms.mjs.map +1 -1
- package/dist/components.js +413 -219
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +413 -219
- package/dist/components.mjs.map +1 -1
- package/dist/forms.js +413 -219
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +413 -219
- package/dist/forms.mjs.map +1 -1
- package/dist/hooks.d.mts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +471 -220
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +471 -221
- package/dist/index.mjs.map +1 -1
- package/dist/router.d.mts +105 -0
- package/dist/router.d.ts +105 -0
- package/dist/router.js +140 -0
- package/dist/router.js.map +1 -0
- package/dist/router.mjs +138 -0
- package/dist/router.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/types.d.mts +257 -39
- package/dist/types.d.ts +257 -39
- package/package.json +8 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode, FormEvent, InputHTMLAttributes, CSSProperties } from 'react';
|
|
2
|
-
import { OAuthProvidersSchema,
|
|
2
|
+
import { OAuthProvidersSchema, PublicEmailAuthConfig } from '@insforge/shared-schemas';
|
|
3
3
|
|
|
4
4
|
type OAuthProvider = OAuthProvidersSchema;
|
|
5
|
-
type AuthConfig =
|
|
5
|
+
type AuthConfig = PublicEmailAuthConfig;
|
|
6
6
|
/**
|
|
7
7
|
* Insforge User type
|
|
8
8
|
*/
|
|
@@ -165,6 +165,78 @@ interface OAuthProviderConfig {
|
|
|
165
165
|
svg: ReactNode;
|
|
166
166
|
className: string;
|
|
167
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Hierarchical appearance configuration for SignIn/SignUp forms
|
|
170
|
+
*/
|
|
171
|
+
interface SignInAppearance {
|
|
172
|
+
/** Container (outermost wrapper) className */
|
|
173
|
+
container?: string;
|
|
174
|
+
/** Card (inner box) className */
|
|
175
|
+
card?: string;
|
|
176
|
+
/** Header section appearance */
|
|
177
|
+
header?: {
|
|
178
|
+
/** Header container className */
|
|
179
|
+
container?: string;
|
|
180
|
+
/** Title text className */
|
|
181
|
+
title?: string;
|
|
182
|
+
/** Subtitle text className */
|
|
183
|
+
subtitle?: string;
|
|
184
|
+
};
|
|
185
|
+
/** Error banner className */
|
|
186
|
+
errorBanner?: string;
|
|
187
|
+
/** Form section appearance */
|
|
188
|
+
form?: {
|
|
189
|
+
/** Form container className */
|
|
190
|
+
container?: string;
|
|
191
|
+
/** Email field appearance */
|
|
192
|
+
emailField?: {
|
|
193
|
+
/** Email field container className */
|
|
194
|
+
container?: string;
|
|
195
|
+
/** Email label className */
|
|
196
|
+
label?: string;
|
|
197
|
+
/** Email input className */
|
|
198
|
+
input?: string;
|
|
199
|
+
};
|
|
200
|
+
/** Password field appearance */
|
|
201
|
+
passwordField?: {
|
|
202
|
+
/** Password field container className */
|
|
203
|
+
container?: string;
|
|
204
|
+
/** Password label className */
|
|
205
|
+
label?: string;
|
|
206
|
+
/** Password input className */
|
|
207
|
+
input?: string;
|
|
208
|
+
/** Forgot password link className */
|
|
209
|
+
forgotPasswordLink?: string;
|
|
210
|
+
/** Password strength indicator appearance */
|
|
211
|
+
strengthIndicator?: {
|
|
212
|
+
/** Strength indicator container className */
|
|
213
|
+
container?: string;
|
|
214
|
+
/** Strength requirement item className */
|
|
215
|
+
requirement?: string;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
/** Submit button className */
|
|
220
|
+
button?: string;
|
|
221
|
+
/** Sign up/in link section appearance */
|
|
222
|
+
link?: {
|
|
223
|
+
/** Link section container className */
|
|
224
|
+
container?: string;
|
|
225
|
+
/** Link text className */
|
|
226
|
+
text?: string;
|
|
227
|
+
/** Anchor link className */
|
|
228
|
+
link?: string;
|
|
229
|
+
};
|
|
230
|
+
/** Divider className */
|
|
231
|
+
divider?: string;
|
|
232
|
+
/** OAuth providers section appearance */
|
|
233
|
+
oauth?: {
|
|
234
|
+
/** OAuth container className */
|
|
235
|
+
container?: string;
|
|
236
|
+
/** OAuth button className */
|
|
237
|
+
button?: string;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
168
240
|
/**
|
|
169
241
|
* Props for SignInForm component
|
|
170
242
|
*/
|
|
@@ -180,12 +252,8 @@ interface SignInFormProps {
|
|
|
180
252
|
availableProviders?: OAuthProvider[];
|
|
181
253
|
onOAuthClick?: (provider: OAuthProvider) => void;
|
|
182
254
|
emailAuthConfig: AuthConfig;
|
|
183
|
-
appearance
|
|
184
|
-
|
|
185
|
-
cardClassName?: string;
|
|
186
|
-
formClassName?: string;
|
|
187
|
-
buttonClassName?: string;
|
|
188
|
-
};
|
|
255
|
+
/** Hierarchical appearance configuration for deep customization */
|
|
256
|
+
appearance?: SignInAppearance;
|
|
189
257
|
title?: string;
|
|
190
258
|
subtitle?: string;
|
|
191
259
|
emailLabel?: string;
|
|
@@ -201,6 +269,77 @@ interface SignInFormProps {
|
|
|
201
269
|
signUpUrl?: string;
|
|
202
270
|
dividerText?: string;
|
|
203
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Hierarchical appearance configuration for SignUp forms
|
|
274
|
+
* Allows deep customization of all nested components
|
|
275
|
+
*/
|
|
276
|
+
interface SignUpAppearance {
|
|
277
|
+
/** Container (outermost wrapper) className */
|
|
278
|
+
container?: string;
|
|
279
|
+
/** Card (inner box) className */
|
|
280
|
+
card?: string;
|
|
281
|
+
/** Header section appearance */
|
|
282
|
+
header?: {
|
|
283
|
+
/** Header container className */
|
|
284
|
+
container?: string;
|
|
285
|
+
/** Title text className */
|
|
286
|
+
title?: string;
|
|
287
|
+
/** Subtitle text className */
|
|
288
|
+
subtitle?: string;
|
|
289
|
+
};
|
|
290
|
+
/** Error banner className */
|
|
291
|
+
errorBanner?: string;
|
|
292
|
+
/** Form section appearance */
|
|
293
|
+
form?: {
|
|
294
|
+
/** Form container className */
|
|
295
|
+
container?: string;
|
|
296
|
+
/** Email field appearance */
|
|
297
|
+
emailField?: {
|
|
298
|
+
/** Email field container className */
|
|
299
|
+
container?: string;
|
|
300
|
+
/** Email label className */
|
|
301
|
+
label?: string;
|
|
302
|
+
/** Email input className */
|
|
303
|
+
input?: string;
|
|
304
|
+
};
|
|
305
|
+
/** Password field appearance */
|
|
306
|
+
passwordField?: {
|
|
307
|
+
/** Password field container className */
|
|
308
|
+
container?: string;
|
|
309
|
+
/** Password label className */
|
|
310
|
+
label?: string;
|
|
311
|
+
/** Password input className */
|
|
312
|
+
input?: string;
|
|
313
|
+
/** Password strength indicator appearance */
|
|
314
|
+
strengthIndicator?: {
|
|
315
|
+
/** Strength indicator container className */
|
|
316
|
+
container?: string;
|
|
317
|
+
/** Strength requirement item className */
|
|
318
|
+
requirement?: string;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
/** Submit button className */
|
|
323
|
+
button?: string;
|
|
324
|
+
/** Sign in link section appearance */
|
|
325
|
+
link?: {
|
|
326
|
+
/** Link section container className */
|
|
327
|
+
container?: string;
|
|
328
|
+
/** Link text className */
|
|
329
|
+
text?: string;
|
|
330
|
+
/** Anchor link className */
|
|
331
|
+
link?: string;
|
|
332
|
+
};
|
|
333
|
+
/** Divider className */
|
|
334
|
+
divider?: string;
|
|
335
|
+
/** OAuth providers section appearance */
|
|
336
|
+
oauth?: {
|
|
337
|
+
/** OAuth container className */
|
|
338
|
+
container?: string;
|
|
339
|
+
/** OAuth button className */
|
|
340
|
+
button?: string;
|
|
341
|
+
};
|
|
342
|
+
}
|
|
204
343
|
/**
|
|
205
344
|
* Props for SignUpForm component
|
|
206
345
|
*/
|
|
@@ -216,12 +355,8 @@ interface SignUpFormProps {
|
|
|
216
355
|
availableProviders?: OAuthProvider[];
|
|
217
356
|
onOAuthClick?: (provider: OAuthProvider) => void;
|
|
218
357
|
emailAuthConfig: AuthConfig;
|
|
219
|
-
appearance
|
|
220
|
-
|
|
221
|
-
cardClassName?: string;
|
|
222
|
-
formClassName?: string;
|
|
223
|
-
buttonClassName?: string;
|
|
224
|
-
};
|
|
358
|
+
/** Hierarchical appearance configuration for deep customization */
|
|
359
|
+
appearance?: SignUpAppearance;
|
|
225
360
|
title?: string;
|
|
226
361
|
subtitle?: string;
|
|
227
362
|
emailLabel?: string;
|
|
@@ -235,6 +370,51 @@ interface SignUpFormProps {
|
|
|
235
370
|
signInUrl?: string;
|
|
236
371
|
dividerText?: string;
|
|
237
372
|
}
|
|
373
|
+
/**
|
|
374
|
+
* Hierarchical appearance configuration for ForgotPassword forms
|
|
375
|
+
*/
|
|
376
|
+
interface ForgotPasswordAppearance {
|
|
377
|
+
/** Container (outermost wrapper) className */
|
|
378
|
+
container?: string;
|
|
379
|
+
/** Card (inner box) className */
|
|
380
|
+
card?: string;
|
|
381
|
+
/** Header section appearance */
|
|
382
|
+
header?: {
|
|
383
|
+
/** Header container className */
|
|
384
|
+
container?: string;
|
|
385
|
+
/** Title text className */
|
|
386
|
+
title?: string;
|
|
387
|
+
/** Subtitle text className */
|
|
388
|
+
subtitle?: string;
|
|
389
|
+
};
|
|
390
|
+
/** Error banner className */
|
|
391
|
+
errorBanner?: string;
|
|
392
|
+
/** Form section appearance */
|
|
393
|
+
form?: {
|
|
394
|
+
/** Form container className */
|
|
395
|
+
container?: string;
|
|
396
|
+
/** Email field appearance */
|
|
397
|
+
emailField?: {
|
|
398
|
+
/** Email field container className */
|
|
399
|
+
container?: string;
|
|
400
|
+
/** Email label className */
|
|
401
|
+
label?: string;
|
|
402
|
+
/** Email input className */
|
|
403
|
+
input?: string;
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
/** Submit button className */
|
|
407
|
+
button?: string;
|
|
408
|
+
/** Back to sign in link section appearance */
|
|
409
|
+
link?: {
|
|
410
|
+
/** Link section container className */
|
|
411
|
+
container?: string;
|
|
412
|
+
/** Link text className */
|
|
413
|
+
text?: string;
|
|
414
|
+
/** Anchor link className */
|
|
415
|
+
link?: string;
|
|
416
|
+
};
|
|
417
|
+
}
|
|
238
418
|
/**
|
|
239
419
|
* Props for ForgotPasswordForm component
|
|
240
420
|
*/
|
|
@@ -245,12 +425,8 @@ interface ForgotPasswordFormProps {
|
|
|
245
425
|
error?: string;
|
|
246
426
|
loading?: boolean;
|
|
247
427
|
success?: boolean;
|
|
248
|
-
appearance
|
|
249
|
-
|
|
250
|
-
cardClassName?: string;
|
|
251
|
-
formClassName?: string;
|
|
252
|
-
buttonClassName?: string;
|
|
253
|
-
};
|
|
428
|
+
/** Hierarchical appearance configuration for deep customization */
|
|
429
|
+
appearance?: ForgotPasswordAppearance;
|
|
254
430
|
title?: string;
|
|
255
431
|
subtitle?: string;
|
|
256
432
|
emailLabel?: string;
|
|
@@ -262,6 +438,60 @@ interface ForgotPasswordFormProps {
|
|
|
262
438
|
successTitle?: string;
|
|
263
439
|
successMessage?: string;
|
|
264
440
|
}
|
|
441
|
+
/**
|
|
442
|
+
* Hierarchical appearance configuration for ResetPassword forms
|
|
443
|
+
*/
|
|
444
|
+
interface ResetPasswordAppearance {
|
|
445
|
+
/** Container (outermost wrapper) className */
|
|
446
|
+
container?: string;
|
|
447
|
+
/** Card (inner box) className */
|
|
448
|
+
card?: string;
|
|
449
|
+
/** Header section appearance */
|
|
450
|
+
header?: {
|
|
451
|
+
/** Header container className */
|
|
452
|
+
container?: string;
|
|
453
|
+
/** Title text className */
|
|
454
|
+
title?: string;
|
|
455
|
+
/** Subtitle text className */
|
|
456
|
+
subtitle?: string;
|
|
457
|
+
};
|
|
458
|
+
/** Error banner className */
|
|
459
|
+
errorBanner?: string;
|
|
460
|
+
/** Form section appearance */
|
|
461
|
+
form?: {
|
|
462
|
+
/** Form container className */
|
|
463
|
+
container?: string;
|
|
464
|
+
/** New password field appearance */
|
|
465
|
+
newPasswordField?: {
|
|
466
|
+
/** Password field container className */
|
|
467
|
+
container?: string;
|
|
468
|
+
/** Password label className */
|
|
469
|
+
label?: string;
|
|
470
|
+
/** Password input className */
|
|
471
|
+
input?: string;
|
|
472
|
+
/** Password strength indicator appearance */
|
|
473
|
+
strengthIndicator?: {
|
|
474
|
+
/** Strength indicator container className */
|
|
475
|
+
container?: string;
|
|
476
|
+
/** Strength requirement item className */
|
|
477
|
+
requirement?: string;
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
/** Confirm password field appearance */
|
|
481
|
+
confirmPasswordField?: {
|
|
482
|
+
/** Password field container className */
|
|
483
|
+
container?: string;
|
|
484
|
+
/** Password label className */
|
|
485
|
+
label?: string;
|
|
486
|
+
/** Password input className */
|
|
487
|
+
input?: string;
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
/** Submit button className */
|
|
491
|
+
button?: string;
|
|
492
|
+
/** Back to sign in text/link className */
|
|
493
|
+
backToSignIn?: string;
|
|
494
|
+
}
|
|
265
495
|
/**
|
|
266
496
|
* Props for ResetPasswordForm component
|
|
267
497
|
*/
|
|
@@ -274,12 +504,8 @@ interface ResetPasswordFormProps {
|
|
|
274
504
|
error?: string;
|
|
275
505
|
loading?: boolean;
|
|
276
506
|
emailAuthConfig: AuthConfig;
|
|
277
|
-
appearance
|
|
278
|
-
|
|
279
|
-
cardClassName?: string;
|
|
280
|
-
formClassName?: string;
|
|
281
|
-
buttonClassName?: string;
|
|
282
|
-
};
|
|
507
|
+
/** Hierarchical appearance configuration for deep customization */
|
|
508
|
+
appearance?: ResetPasswordAppearance;
|
|
283
509
|
title?: string;
|
|
284
510
|
subtitle?: string;
|
|
285
511
|
newPasswordLabel?: string;
|
|
@@ -311,12 +537,8 @@ interface VerifyEmailStatusProps {
|
|
|
311
537
|
*/
|
|
312
538
|
interface SignInProps {
|
|
313
539
|
afterSignInUrl?: string;
|
|
314
|
-
appearance
|
|
315
|
-
|
|
316
|
-
cardClassName?: string;
|
|
317
|
-
formClassName?: string;
|
|
318
|
-
buttonClassName?: string;
|
|
319
|
-
};
|
|
540
|
+
/** Hierarchical appearance configuration for deep customization */
|
|
541
|
+
appearance?: SignInAppearance;
|
|
320
542
|
title?: string;
|
|
321
543
|
subtitle?: string;
|
|
322
544
|
emailLabel?: string;
|
|
@@ -344,12 +566,8 @@ interface SignInProps {
|
|
|
344
566
|
*/
|
|
345
567
|
interface SignUpProps {
|
|
346
568
|
afterSignUpUrl?: string;
|
|
347
|
-
appearance
|
|
348
|
-
|
|
349
|
-
cardClassName?: string;
|
|
350
|
-
formClassName?: string;
|
|
351
|
-
buttonClassName?: string;
|
|
352
|
-
};
|
|
569
|
+
/** Hierarchical appearance configuration for deep customization */
|
|
570
|
+
appearance?: SignUpAppearance;
|
|
353
571
|
title?: string;
|
|
354
572
|
subtitle?: string;
|
|
355
573
|
emailLabel?: string;
|
|
@@ -401,4 +619,4 @@ interface UserButtonProps {
|
|
|
401
619
|
};
|
|
402
620
|
}
|
|
403
621
|
|
|
404
|
-
export type { AuthConfig, AuthContainerProps, AuthDividerProps, AuthErrorBannerProps, AuthFormFieldProps, AuthHeaderProps, AuthLinkProps, AuthOAuthButtonProps, AuthOAuthProvidersProps, AuthPasswordFieldProps, AuthPasswordStrengthIndicatorProps, AuthSubmitButtonProps, AuthVerificationCodeInputProps, BaseAppearance, ConditionalProps, ForgotPasswordFormProps, InsforgeUser, OAuthProvider, OAuthProviderConfig, ProtectProps, ResetPasswordFormProps, SignInFormProps, SignInProps, SignUpFormProps, SignUpProps, UserButtonProps, VerifyEmailStatusProps };
|
|
622
|
+
export type { AuthConfig, AuthContainerProps, AuthDividerProps, AuthErrorBannerProps, AuthFormFieldProps, AuthHeaderProps, AuthLinkProps, AuthOAuthButtonProps, AuthOAuthProvidersProps, AuthPasswordFieldProps, AuthPasswordStrengthIndicatorProps, AuthSubmitButtonProps, AuthVerificationCodeInputProps, BaseAppearance, ConditionalProps, ForgotPasswordAppearance, ForgotPasswordFormProps, InsforgeUser, OAuthProvider, OAuthProviderConfig, ProtectProps, ResetPasswordAppearance, ResetPasswordFormProps, SignInAppearance, SignInFormProps, SignInProps, SignUpAppearance, SignUpFormProps, SignUpProps, UserButtonProps, VerifyEmailStatusProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insforge/react",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Framework-agnostic React authentication UI components for Insforge - reusable across all frameworks",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -41,6 +41,11 @@
|
|
|
41
41
|
"import": "./dist/types.mjs",
|
|
42
42
|
"require": "./dist/types.js"
|
|
43
43
|
},
|
|
44
|
+
"./router": {
|
|
45
|
+
"types": "./dist/router.d.ts",
|
|
46
|
+
"import": "./dist/router.mjs",
|
|
47
|
+
"require": "./dist/router.js"
|
|
48
|
+
},
|
|
44
49
|
"./styles.css": "./src/styles.css"
|
|
45
50
|
},
|
|
46
51
|
"files": [
|
|
@@ -68,7 +73,8 @@
|
|
|
68
73
|
"license": "MIT",
|
|
69
74
|
"peerDependencies": {
|
|
70
75
|
"react": "^18.0.0 || ^19.0.0",
|
|
71
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
76
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
77
|
+
"react-router-dom": "^6.0.0"
|
|
72
78
|
},
|
|
73
79
|
"dependencies": {
|
|
74
80
|
"@insforge/sdk": "0.0.58-dev.6",
|