@better-auth-ui/heroui 1.6.27 → 1.6.29

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.
Files changed (31) hide show
  1. package/dist/components/auth/forgot-password.d.ts +3 -1
  2. package/dist/components/auth/last-login-method/last-used-badge.d.ts +13 -0
  3. package/dist/components/auth/magic-link/magic-link-sent.d.ts +20 -0
  4. package/dist/components/auth/provider-button.d.ts +3 -1
  5. package/dist/components/auth/provider-buttons.d.ts +3 -1
  6. package/dist/components/auth/reset-link-sent.d.ts +20 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +280 -220
  9. package/dist/lib/auth/last-login-method-plugin.d.ts +12 -0
  10. package/dist/lib/auth/magic-link-plugin.d.ts +4 -0
  11. package/dist/plugins.d.ts +3 -0
  12. package/dist/plugins.js +1070 -1005
  13. package/dist/user-view-D9ial2fQ.js +150 -0
  14. package/package.json +1 -1
  15. package/src/components/auth/auth.tsx +8 -1
  16. package/src/components/auth/forgot-password.tsx +9 -6
  17. package/src/components/auth/last-login-method/last-used-badge.tsx +40 -0
  18. package/src/components/auth/magic-link/magic-link-sent.tsx +84 -0
  19. package/src/components/auth/magic-link/magic-link.tsx +12 -8
  20. package/src/components/auth/provider-button.tsx +17 -3
  21. package/src/components/auth/provider-buttons.tsx +5 -1
  22. package/src/components/auth/reset-link-sent.tsx +80 -0
  23. package/src/components/auth/settings/security/change-password.tsx +32 -14
  24. package/src/components/auth/sign-in.tsx +10 -3
  25. package/src/components/auth/sign-up.tsx +2 -2
  26. package/src/components/auth/username/sign-in-username.tsx +6 -3
  27. package/src/index.tsx +1 -0
  28. package/src/lib/auth/last-login-method-plugin.ts +12 -0
  29. package/src/lib/auth/magic-link-plugin.ts +2 -1
  30. package/src/plugins.ts +3 -0
  31. package/dist/user-view--47tVtJ3.js +0 -113
@@ -7,7 +7,9 @@ export type ForgotPasswordProps = {
7
7
  * Render a card-based "Forgot Password" form that sends a password-reset email.
8
8
  *
9
9
  * The form displays an email input, submit button, and a link back to sign-in.
10
- * Success toasts are shown via `useRequestPasswordReset`; errors are handled globally by `ErrorToaster`.
10
+ * After a successful request the submitted email is stored in `sessionStorage`
11
+ * and the user is redirected to the reset-link-sent view, which offers to open
12
+ * their email provider. Errors are handled globally by `ErrorToaster`.
11
13
  *
12
14
  * @param className - Optional additional CSS class names applied to the card
13
15
  * @returns The forgot-password form UI as a JSX element
@@ -0,0 +1,13 @@
1
+ export type LastUsedBadgeProps = {
2
+ /** Login method IDs that should display the indicator. */
3
+ method: string | string[];
4
+ /** Use the shorter label in constrained layouts. */
5
+ compact?: boolean;
6
+ /** Float the compact indicator over the top-right edge of its container. */
7
+ floating?: boolean;
8
+ };
9
+ /**
10
+ * Displays an indicator when one of the supplied method IDs matches Better
11
+ * Auth's stored last login method.
12
+ */
13
+ export declare function LastUsedBadge({ method, compact, floating }: LastUsedBadgeProps): import("react").JSX.Element | null;
@@ -0,0 +1,20 @@
1
+ import { CardProps } from '@heroui/react';
2
+ /** `sessionStorage` key the magic-link form stores the submitted email under. */
3
+ export declare const MAGIC_LINK_SENT_STORAGE_KEY = "better-auth-ui.magic-link-sent";
4
+ export type MagicLinkSentProps = {
5
+ className?: string;
6
+ variant?: CardProps["variant"];
7
+ };
8
+ /**
9
+ * Render a card confirming that a magic-link email was sent, with a button
10
+ * to open the user's email provider.
11
+ *
12
+ * The target email is read from `sessionStorage` (set when the magic-link
13
+ * form redirects here); the OpenEmail button is only shown when an email is
14
+ * stored and resolves to a known provider.
15
+ *
16
+ * @param className - Additional CSS classes applied to the outer card container
17
+ * @param variant - Variant to apply to the card
18
+ * @returns The magic-link-sent card React element
19
+ */
20
+ export declare function MagicLinkSent({ className, variant }: MagicLinkSentProps): import("react").JSX.Element;
@@ -1,8 +1,10 @@
1
+ import { AuthView } from '@better-auth-ui/core';
1
2
  import { ButtonProps } from '@heroui/react';
2
3
  import { SocialProvider } from 'better-auth/social-providers';
3
4
  export type ProviderButtonProps = {
4
5
  provider: SocialProvider;
5
6
  display?: "full" | "name" | "icon";
7
+ view?: AuthView;
6
8
  } & Omit<ButtonProps, "children" | "onPress" | "isPending" | "isDisabled">;
7
9
  /**
8
10
  * Social provider sign-in button.
@@ -10,4 +12,4 @@ export type ProviderButtonProps = {
10
12
  * @param provider - Provider to sign in with.
11
13
  * @param display - `"full"` (e.g. "Continue with Google"), `"name"` (just the provider name), or `"icon"` (icon only).
12
14
  */
13
- export declare function ProviderButton({ provider, display, variant, ...props }: ProviderButtonProps): import("react").JSX.Element;
15
+ export declare function ProviderButton({ provider, display, view, variant, className, ...props }: ProviderButtonProps): import("react").JSX.Element;
@@ -1,5 +1,7 @@
1
+ import { AuthView } from '@better-auth-ui/core';
1
2
  export type ProviderButtonsProps = {
2
3
  socialLayout?: SocialLayout;
4
+ view?: AuthView;
3
5
  };
4
6
  export type SocialLayout = "auto" | "horizontal" | "vertical" | "grid";
5
7
  /**
@@ -9,4 +11,4 @@ export type SocialLayout = "auto" | "horizontal" | "vertical" | "grid";
9
11
  * @param socialLayout - Preferred layout for the buttons; `"auto"` picks `"horizontal"` when there are four or more providers, otherwise `"vertical"`.
10
12
  * @returns The JSX element that renders the configured social provider buttons.
11
13
  */
12
- export declare function ProviderButtons({ socialLayout }: ProviderButtonsProps): import("react").JSX.Element;
14
+ export declare function ProviderButtons({ socialLayout, view }: ProviderButtonsProps): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { CardProps } from '@heroui/react';
2
+ /** `sessionStorage` key the forgot-password form stores the submitted email under. */
3
+ export declare const RESET_LINK_SENT_STORAGE_KEY = "better-auth-ui.reset-link-sent";
4
+ export type ResetLinkSentProps = {
5
+ className?: string;
6
+ variant?: CardProps["variant"];
7
+ };
8
+ /**
9
+ * Render a card confirming that a password-reset email was sent, with a
10
+ * button to open the user's email provider.
11
+ *
12
+ * The target email is read from `sessionStorage` (set when the forgot-password
13
+ * form redirects here); the OpenEmail button is only shown when an email is
14
+ * stored and resolves to a known provider.
15
+ *
16
+ * @param className - Additional CSS classes applied to the outer card container
17
+ * @param variant - Variant to apply to the card
18
+ * @returns The reset-link-sent card React element
19
+ */
20
+ export declare function ResetLinkSent({ className, variant }: ResetLinkSentProps): import("react").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './components/auth/forgot-password';
5
5
  export * from './components/auth/open-email-button';
6
6
  export * from './components/auth/provider-button';
7
7
  export * from './components/auth/provider-buttons';
8
+ export * from './components/auth/reset-link-sent';
8
9
  export * from './components/auth/reset-password';
9
10
  export * from './components/auth/settings/account/account-settings';
10
11
  export * from './components/auth/settings/account/change-email';