@hex-core/components 1.8.0 → 1.9.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/_tsup-dts-rollup.d.ts +285 -5
- package/dist/auth-forgot-password.d.ts +2 -0
- package/dist/auth-forgot-password.js +400 -0
- package/dist/auth-forgot-password.js.map +1 -0
- package/dist/auth-reset-password.d.ts +2 -0
- package/dist/auth-reset-password.js +323 -0
- package/dist/auth-reset-password.js.map +1 -0
- package/dist/auth-sign-in-split.d.ts +3 -0
- package/dist/auth-sign-in-split.js +443 -0
- package/dist/auth-sign-in-split.js.map +1 -0
- package/dist/auth-sign-up-card.d.ts +3 -0
- package/dist/auth-sign-up-card.js +590 -0
- package/dist/auth-sign-up-card.js.map +1 -0
- package/dist/auth-verify-email.d.ts +2 -0
- package/dist/auth-verify-email.js +339 -0
- package/dist/auth-verify-email.js.map +1 -0
- package/dist/auth-verify-otp.d.ts +2 -0
- package/dist/auth-verify-otp.js +349 -0
- package/dist/auth-verify-otp.js.map +1 -0
- package/dist/color-picker.js.map +1 -1
- package/dist/data-table.js.map +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1029 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas.js +2 -2
- package/dist/schemas.js.map +1 -1
- package/dist/sonner.js.map +1 -1
- package/dist/terminal.js.map +1 -1
- package/dist/textarea.js.map +1 -1
- package/package.json +4 -4
|
@@ -401,6 +401,275 @@ export { AudioWaveformProps as AudioWaveformProps_alias_1 }
|
|
|
401
401
|
|
|
402
402
|
export declare const audioWaveformSchema: ComponentSchemaDefinition;
|
|
403
403
|
|
|
404
|
+
declare interface AuthAdapter {
|
|
405
|
+
signInWithPassword?(p: {
|
|
406
|
+
email: string;
|
|
407
|
+
password: string;
|
|
408
|
+
remember: boolean;
|
|
409
|
+
}): Promise<AuthAdapterResult>;
|
|
410
|
+
signUpWithPassword?(p: {
|
|
411
|
+
email: string;
|
|
412
|
+
password: string;
|
|
413
|
+
name?: string;
|
|
414
|
+
}): Promise<AuthAdapterResult>;
|
|
415
|
+
signInWithSocial?(p: {
|
|
416
|
+
provider: AuthSocialProvider;
|
|
417
|
+
}): Promise<AuthAdapterResult>;
|
|
418
|
+
sendMagicLink?(p: {
|
|
419
|
+
email: string;
|
|
420
|
+
}): Promise<AuthAdapterResult>;
|
|
421
|
+
verifyOtp?(p: {
|
|
422
|
+
code: string;
|
|
423
|
+
intent: AuthOtpIntent;
|
|
424
|
+
}): Promise<AuthAdapterResult>;
|
|
425
|
+
requestPasswordReset?(p: {
|
|
426
|
+
email: string;
|
|
427
|
+
}): Promise<AuthAdapterResult>;
|
|
428
|
+
resetPassword?(p: {
|
|
429
|
+
token: string;
|
|
430
|
+
password: string;
|
|
431
|
+
}): Promise<AuthAdapterResult>;
|
|
432
|
+
registerPasskey?(): Promise<AuthAdapterResult>;
|
|
433
|
+
signInWithPasskey?(): Promise<AuthAdapterResult>;
|
|
434
|
+
/**
|
|
435
|
+
* Re-send a magic link to the same address. Distinct from {@link sendMagicLink}
|
|
436
|
+
* so consumers can throttle resends and surface different analytics / error
|
|
437
|
+
* copy for the second-and-onward attempt. Used by the verify-email block.
|
|
438
|
+
*/
|
|
439
|
+
resendMagicLink?(p: {
|
|
440
|
+
email: string;
|
|
441
|
+
}): Promise<AuthAdapterResult>;
|
|
442
|
+
/**
|
|
443
|
+
* Re-send a one-time code for the given intent. Distinct from the initial
|
|
444
|
+
* code dispatch so consumers can throttle and log resends separately. Used
|
|
445
|
+
* by the verify-otp block.
|
|
446
|
+
*/
|
|
447
|
+
resendOtp?(p: {
|
|
448
|
+
intent: AuthOtpIntent;
|
|
449
|
+
}): Promise<AuthAdapterResult>;
|
|
450
|
+
}
|
|
451
|
+
export { AuthAdapter }
|
|
452
|
+
export { AuthAdapter as AuthAdapter_alias_1 }
|
|
453
|
+
export { AuthAdapter as AuthAdapter_alias_2 }
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* The contract every Hex Core auth block consumes via its `adapter` prop.
|
|
457
|
+
*
|
|
458
|
+
* Hex Core does not ship session management — auth blocks are presentation-
|
|
459
|
+
* only and delegate every credential, OTP, and OAuth handoff to whatever
|
|
460
|
+
* the consumer wires up (better-auth, Clerk, NextAuth, Supabase Auth, a
|
|
461
|
+
* custom server, …). The adapter is the single seam.
|
|
462
|
+
*
|
|
463
|
+
* Every method is **optional**. A block that needs `signInWithPassword` but
|
|
464
|
+
* not passkeys passes an adapter implementing only the methods it needs;
|
|
465
|
+
* the block surfaces a runtime error if the user hits a code path the
|
|
466
|
+
* adapter doesn't implement, rather than failing to render. This lets a
|
|
467
|
+
* consumer ship password-only on day one and add passkeys later without
|
|
468
|
+
* forking the block source.
|
|
469
|
+
*
|
|
470
|
+
* A reference {@link mockAuthAdapter} lives below — used by the docs
|
|
471
|
+
* showcase routes and unit tests; never ship it in production.
|
|
472
|
+
*/
|
|
473
|
+
declare interface AuthAdapterResult {
|
|
474
|
+
ok: boolean;
|
|
475
|
+
error?: {
|
|
476
|
+
code: string;
|
|
477
|
+
message: string;
|
|
478
|
+
};
|
|
479
|
+
redirect?: string;
|
|
480
|
+
}
|
|
481
|
+
export { AuthAdapterResult }
|
|
482
|
+
export { AuthAdapterResult as AuthAdapterResult_alias_1 }
|
|
483
|
+
export { AuthAdapterResult as AuthAdapterResult_alias_2 }
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* "Forgot password" page. Single email field; on success swaps to a
|
|
487
|
+
* confirmation state composed from `Empty` ("we sent you a link") plus a
|
|
488
|
+
* "back to sign in" affordance. Routes the dispatch through
|
|
489
|
+
* `adapter.requestPasswordReset`.
|
|
490
|
+
*/
|
|
491
|
+
declare function AuthForgotPassword({ adapter, signInHref, className, onSuccess, }: AuthForgotPasswordProps): JSX.Element;
|
|
492
|
+
export { AuthForgotPassword }
|
|
493
|
+
export { AuthForgotPassword as AuthForgotPassword_alias_1 }
|
|
494
|
+
export { AuthForgotPassword as AuthForgotPassword_alias_2 }
|
|
495
|
+
|
|
496
|
+
declare interface AuthForgotPasswordProps {
|
|
497
|
+
adapter: AuthAdapter;
|
|
498
|
+
signInHref?: string;
|
|
499
|
+
className?: string;
|
|
500
|
+
onSuccess?: () => void;
|
|
501
|
+
}
|
|
502
|
+
export { AuthForgotPasswordProps }
|
|
503
|
+
export { AuthForgotPasswordProps as AuthForgotPasswordProps_alias_1 }
|
|
504
|
+
export { AuthForgotPasswordProps as AuthForgotPasswordProps_alias_2 }
|
|
505
|
+
|
|
506
|
+
export declare const authForgotPasswordSchema: ComponentSchemaDefinition;
|
|
507
|
+
|
|
508
|
+
declare type AuthOtpIntent = "sign-in" | "verify-email" | "mfa";
|
|
509
|
+
export { AuthOtpIntent }
|
|
510
|
+
export { AuthOtpIntent as AuthOtpIntent_alias_1 }
|
|
511
|
+
export { AuthOtpIntent as AuthOtpIntent_alias_2 }
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* "Reset password" page. Two fields (new password + confirm) with manual
|
|
515
|
+
* confirm-match and minLength validation. The opaque `token` is forwarded
|
|
516
|
+
* verbatim to `adapter.resetPassword`. Routes the consumer-supplied adapter
|
|
517
|
+
* is responsible for binding the token to a user account on the backend.
|
|
518
|
+
*/
|
|
519
|
+
declare function AuthResetPassword({ adapter, token, signInHref, passwordMinLength, className, onSuccess, }: AuthResetPasswordProps): JSX.Element;
|
|
520
|
+
export { AuthResetPassword }
|
|
521
|
+
export { AuthResetPassword as AuthResetPassword_alias_1 }
|
|
522
|
+
export { AuthResetPassword as AuthResetPassword_alias_2 }
|
|
523
|
+
|
|
524
|
+
declare interface AuthResetPasswordProps {
|
|
525
|
+
adapter: AuthAdapter;
|
|
526
|
+
/** Reset token, typically read from `?token=…` by the showcase / consumer route. */
|
|
527
|
+
token: string;
|
|
528
|
+
signInHref?: string;
|
|
529
|
+
passwordMinLength?: number;
|
|
530
|
+
className?: string;
|
|
531
|
+
onSuccess?: (redirect: string | undefined) => void;
|
|
532
|
+
}
|
|
533
|
+
export { AuthResetPasswordProps }
|
|
534
|
+
export { AuthResetPasswordProps as AuthResetPasswordProps_alias_1 }
|
|
535
|
+
export { AuthResetPasswordProps as AuthResetPasswordProps_alias_2 }
|
|
536
|
+
|
|
537
|
+
export declare const authResetPasswordSchema: ComponentSchemaDefinition;
|
|
538
|
+
|
|
539
|
+
declare interface AuthSignInSocialProvider {
|
|
540
|
+
provider: AuthSocialProvider;
|
|
541
|
+
label: string;
|
|
542
|
+
icon?: React_2.ReactNode;
|
|
543
|
+
}
|
|
544
|
+
export { AuthSignInSocialProvider }
|
|
545
|
+
export { AuthSignInSocialProvider as AuthSignInSocialProvider_alias_1 }
|
|
546
|
+
export { AuthSignInSocialProvider as AuthSignInSocialProvider_alias_2 }
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Split-screen sign-in page. Marketing panel on the left (≥lg), credential
|
|
550
|
+
* form on the right. All submit paths route through the supplied
|
|
551
|
+
* `AuthAdapter` — Hex Core never touches credentials directly.
|
|
552
|
+
*/
|
|
553
|
+
declare function AuthSignInSplit({ adapter, socialProviders, brand, marketing, signUpHref, forgotPasswordHref, className, onSuccess, }: AuthSignInSplitProps): JSX.Element;
|
|
554
|
+
export { AuthSignInSplit }
|
|
555
|
+
export { AuthSignInSplit as AuthSignInSplit_alias_1 }
|
|
556
|
+
export { AuthSignInSplit as AuthSignInSplit_alias_2 }
|
|
557
|
+
|
|
558
|
+
declare interface AuthSignInSplitProps {
|
|
559
|
+
/** Wires every credential / OAuth call to the consumer's auth library. */
|
|
560
|
+
adapter: AuthAdapter;
|
|
561
|
+
/** Optional list of social-login buttons rendered above the email field. */
|
|
562
|
+
socialProviders?: ReadonlyArray<AuthSignInSocialProvider>;
|
|
563
|
+
/** Brand block (logo + product name) shown at the top of the marketing panel. */
|
|
564
|
+
brand?: React_2.ReactNode;
|
|
565
|
+
/** Marketing copy / quote / illustration shown below the brand block. */
|
|
566
|
+
marketing?: React_2.ReactNode;
|
|
567
|
+
/** Href for the "Sign up" link rendered below the form. */
|
|
568
|
+
signUpHref?: string;
|
|
569
|
+
/** Href for the "Forgot?" link inline with the password label. */
|
|
570
|
+
forgotPasswordHref?: string;
|
|
571
|
+
/** Additional classes applied to the root grid wrapper. */
|
|
572
|
+
className?: string;
|
|
573
|
+
/** Called after a successful sign-in (any flow) with the adapter's redirect target. */
|
|
574
|
+
onSuccess?: (redirect: string | undefined) => void;
|
|
575
|
+
}
|
|
576
|
+
export { AuthSignInSplitProps }
|
|
577
|
+
export { AuthSignInSplitProps as AuthSignInSplitProps_alias_1 }
|
|
578
|
+
export { AuthSignInSplitProps as AuthSignInSplitProps_alias_2 }
|
|
579
|
+
|
|
580
|
+
export declare const authSignInSplitSchema: ComponentSchemaDefinition;
|
|
581
|
+
|
|
582
|
+
/** Centered-card sign-up page. Composes Card + form fields + optional social. */
|
|
583
|
+
declare function AuthSignUpCard({ adapter, socialProviders, signInHref, termsHref, privacyHref, passwordMinLength, className, onSuccess, }: AuthSignUpCardProps): JSX.Element;
|
|
584
|
+
export { AuthSignUpCard }
|
|
585
|
+
export { AuthSignUpCard as AuthSignUpCard_alias_1 }
|
|
586
|
+
export { AuthSignUpCard as AuthSignUpCard_alias_2 }
|
|
587
|
+
|
|
588
|
+
declare interface AuthSignUpCardProps {
|
|
589
|
+
adapter: AuthAdapter;
|
|
590
|
+
socialProviders?: ReadonlyArray<AuthSignUpCardSocialProvider>;
|
|
591
|
+
signInHref?: string;
|
|
592
|
+
termsHref?: string;
|
|
593
|
+
privacyHref?: string;
|
|
594
|
+
passwordMinLength?: number;
|
|
595
|
+
className?: string;
|
|
596
|
+
onSuccess?: (redirect: string | undefined) => void;
|
|
597
|
+
}
|
|
598
|
+
export { AuthSignUpCardProps }
|
|
599
|
+
export { AuthSignUpCardProps as AuthSignUpCardProps_alias_1 }
|
|
600
|
+
export { AuthSignUpCardProps as AuthSignUpCardProps_alias_2 }
|
|
601
|
+
|
|
602
|
+
export declare const authSignUpCardSchema: ComponentSchemaDefinition;
|
|
603
|
+
|
|
604
|
+
declare interface AuthSignUpCardSocialProvider {
|
|
605
|
+
provider: AuthSocialProvider;
|
|
606
|
+
label: string;
|
|
607
|
+
icon?: React_2.ReactNode;
|
|
608
|
+
}
|
|
609
|
+
export { AuthSignUpCardSocialProvider }
|
|
610
|
+
export { AuthSignUpCardSocialProvider as AuthSignUpCardSocialProvider_alias_1 }
|
|
611
|
+
export { AuthSignUpCardSocialProvider as AuthSignUpCardSocialProvider_alias_2 }
|
|
612
|
+
|
|
613
|
+
declare type AuthSocialProvider = "github" | "google" | "microsoft" | (string & {});
|
|
614
|
+
export { AuthSocialProvider }
|
|
615
|
+
export { AuthSocialProvider as AuthSocialProvider_alias_1 }
|
|
616
|
+
export { AuthSocialProvider as AuthSocialProvider_alias_2 }
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Transactional "verify your email" page. Mostly visual — composes the
|
|
620
|
+
* `Empty` primitive with a mail icon plus an optional resend button. The
|
|
621
|
+
* resend button is hidden when `adapter.resendMagicLink` is absent. Rate-
|
|
622
|
+
* limit pressure handled client-side via a cooldown timer.
|
|
623
|
+
*/
|
|
624
|
+
declare function AuthVerifyEmail({ adapter, email, resendCooldownSeconds, signInHref, className, }: AuthVerifyEmailProps): JSX.Element;
|
|
625
|
+
export { AuthVerifyEmail }
|
|
626
|
+
export { AuthVerifyEmail as AuthVerifyEmail_alias_1 }
|
|
627
|
+
export { AuthVerifyEmail as AuthVerifyEmail_alias_2 }
|
|
628
|
+
|
|
629
|
+
declare interface AuthVerifyEmailProps {
|
|
630
|
+
adapter: AuthAdapter;
|
|
631
|
+
/** Optional address shown in the description ("we sent a link to <email>"). */
|
|
632
|
+
email?: string;
|
|
633
|
+
/** Seconds to disable the resend button after each successful resend. */
|
|
634
|
+
resendCooldownSeconds?: number;
|
|
635
|
+
/** Href for the "Back to sign in" affordance. */
|
|
636
|
+
signInHref?: string;
|
|
637
|
+
className?: string;
|
|
638
|
+
}
|
|
639
|
+
export { AuthVerifyEmailProps }
|
|
640
|
+
export { AuthVerifyEmailProps as AuthVerifyEmailProps_alias_1 }
|
|
641
|
+
export { AuthVerifyEmailProps as AuthVerifyEmailProps_alias_2 }
|
|
642
|
+
|
|
643
|
+
export declare const authVerifyEmailSchema: ComponentSchemaDefinition;
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* One-time-code verification page. Renders an `InputOTP` of `length` slots
|
|
647
|
+
* and submits automatically when the code is full. Routes verification
|
|
648
|
+
* through `adapter.verifyOtp({ code, intent })`. Optional resend button
|
|
649
|
+
* calls `adapter.resendOtp({ intent })` when implemented.
|
|
650
|
+
*/
|
|
651
|
+
declare function AuthVerifyOtp({ adapter, intent, length, resendCooldownSeconds, className, onSuccess, }: AuthVerifyOtpProps): JSX.Element;
|
|
652
|
+
export { AuthVerifyOtp }
|
|
653
|
+
export { AuthVerifyOtp as AuthVerifyOtp_alias_1 }
|
|
654
|
+
export { AuthVerifyOtp as AuthVerifyOtp_alias_2 }
|
|
655
|
+
|
|
656
|
+
declare interface AuthVerifyOtpProps {
|
|
657
|
+
adapter: AuthAdapter;
|
|
658
|
+
/** Forwarded verbatim to adapter.verifyOtp({ code, intent }). */
|
|
659
|
+
intent: AuthOtpIntent;
|
|
660
|
+
/** Total number of digits in the code. Defaults to 6. */
|
|
661
|
+
length?: number;
|
|
662
|
+
/** Seconds the resend button stays disabled after each successful resend. */
|
|
663
|
+
resendCooldownSeconds?: number;
|
|
664
|
+
className?: string;
|
|
665
|
+
onSuccess?: (redirect: string | undefined) => void;
|
|
666
|
+
}
|
|
667
|
+
export { AuthVerifyOtpProps }
|
|
668
|
+
export { AuthVerifyOtpProps as AuthVerifyOtpProps_alias_1 }
|
|
669
|
+
export { AuthVerifyOtpProps as AuthVerifyOtpProps_alias_2 }
|
|
670
|
+
|
|
671
|
+
export declare const authVerifyOtpSchema: ComponentSchemaDefinition;
|
|
672
|
+
|
|
404
673
|
/** Root container for an avatar (image + fallback). */
|
|
405
674
|
declare const Avatar: React_2.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React_2.RefAttributes<HTMLSpanElement>, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
|
|
406
675
|
export { Avatar }
|
|
@@ -1445,7 +1714,7 @@ export { DataTable }
|
|
|
1445
1714
|
export { DataTable as DataTable_alias_1 }
|
|
1446
1715
|
|
|
1447
1716
|
/**
|
|
1448
|
-
* Generic DataTable wrapper that renders a TanStack Table model using Hex
|
|
1717
|
+
* Generic DataTable wrapper that renders a TanStack Table model using Hex Core's
|
|
1449
1718
|
* Table primitives. Pass columns + data; use TanStack hooks for sorting,
|
|
1450
1719
|
* filtering, pagination, row-selection as needed.
|
|
1451
1720
|
* @template TData - Row data type. Cell value types are inferred per column by TanStack.
|
|
@@ -1461,7 +1730,7 @@ declare interface DataTableProps<TData> {
|
|
|
1461
1730
|
/**
|
|
1462
1731
|
* Accessible label for the table when no visible caption is shown.
|
|
1463
1732
|
* Forwarded as `aria-label` on the underlying `<table>` element. Kebab-case
|
|
1464
|
-
* to match the canonical ARIA prop convention used elsewhere in Hex
|
|
1733
|
+
* to match the canonical ARIA prop convention used elsewhere in Hex Core.
|
|
1465
1734
|
*/
|
|
1466
1735
|
"aria-label"?: string;
|
|
1467
1736
|
}
|
|
@@ -2525,7 +2794,7 @@ export { hslToRgb as hslToRgb_alias_1 }
|
|
|
2525
2794
|
* `@hex-core/tokens` themes (`H S% L%`, e.g. `"240 5.9% 10%"` — no `hsl()`
|
|
2526
2795
|
* wrapper, no commas).
|
|
2527
2796
|
*
|
|
2528
|
-
* The triplet is the round-trip-safe serialization for Hex
|
|
2797
|
+
* The triplet is the round-trip-safe serialization for Hex Core: tokens flow
|
|
2529
2798
|
* triplet → CSS `hsl(var(--token))` → rendered color, and the ColorPicker
|
|
2530
2799
|
* component edits triplets directly. Hex/RGB conversions are display
|
|
2531
2800
|
* adapters, not the source of truth.
|
|
@@ -3059,6 +3328,17 @@ declare const mindMapSchema: ComponentSchemaDefinition;
|
|
|
3059
3328
|
export { mindMapSchema }
|
|
3060
3329
|
export { mindMapSchema as mindMapSchema_alias_1 }
|
|
3061
3330
|
|
|
3331
|
+
/**
|
|
3332
|
+
* In-memory mock adapter for docs showcase + tests. Every method delays
|
|
3333
|
+
* 400ms to simulate a network round-trip and resolves `{ ok: true }`. Do
|
|
3334
|
+
* not use in production — there is no validation, no persistence, and no
|
|
3335
|
+
* security.
|
|
3336
|
+
*/
|
|
3337
|
+
declare const mockAuthAdapter: Required<AuthAdapter>;
|
|
3338
|
+
export { mockAuthAdapter }
|
|
3339
|
+
export { mockAuthAdapter as mockAuthAdapter_alias_1 }
|
|
3340
|
+
export { mockAuthAdapter as mockAuthAdapter_alias_2 }
|
|
3341
|
+
|
|
3062
3342
|
/**
|
|
3063
3343
|
* Searchable multi-select input built on Command + Popover.
|
|
3064
3344
|
*
|
|
@@ -4564,7 +4844,7 @@ export { Textarea as Textarea_alias_1 }
|
|
|
4564
4844
|
|
|
4565
4845
|
/**
|
|
4566
4846
|
* A styled multi-line text input with smooth focus transitions and shadow effects.
|
|
4567
|
-
* Extends the native HTML textarea element with Hex
|
|
4847
|
+
* Extends the native HTML textarea element with Hex Core styling.
|
|
4568
4848
|
*/
|
|
4569
4849
|
declare type TextareaProps = React_2.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
4570
4850
|
export { TextareaProps }
|
|
@@ -4732,7 +5012,7 @@ export { toast as toast_alias_1 }
|
|
|
4732
5012
|
|
|
4733
5013
|
/**
|
|
4734
5014
|
* The global toast container. Render once in your app root.
|
|
4735
|
-
* Re-export of Sonner's Toaster styled to use Hex
|
|
5015
|
+
* Re-export of Sonner's Toaster styled to use Hex Core theme tokens.
|
|
4736
5016
|
* @param props - Sonner Toaster props (position, richColors, etc.)
|
|
4737
5017
|
* @returns A styled portal container for toast notifications
|
|
4738
5018
|
*/
|