@better-auth-ui/heroui 1.6.8 → 1.6.10

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 (195) hide show
  1. package/dist/components/auth/api-key/api-key.d.ts +5 -1
  2. package/dist/components/auth/api-key/api-keys-empty.d.ts +3 -1
  3. package/dist/components/auth/api-key/api-keys.d.ts +9 -1
  4. package/dist/components/auth/api-key/create-api-key-dialog.d.ts +3 -1
  5. package/dist/components/auth/api-key/delete-api-key-dialog.d.ts +3 -1
  6. package/dist/components/auth/api-key/organization-api-keys.d.ts +14 -0
  7. package/dist/components/auth/delete-user/danger-zone.d.ts +1 -1
  8. package/dist/components/auth/delete-user/{delete-user.d.ts → delete-account.d.ts} +2 -2
  9. package/dist/components/auth/email/organization-invitation-email.d.ts +3 -0
  10. package/dist/components/auth/multi-session/switch-account-submenu-content.d.ts +3 -1
  11. package/dist/components/auth/multi-session/switch-account-submenu-item.d.ts +2 -1
  12. package/dist/components/auth/multi-session/switch-account-submenu.d.ts +2 -1
  13. package/dist/components/auth/organization/change-organization-logo.d.ts +4 -0
  14. package/dist/components/auth/organization/create-organization-dialog.d.ts +13 -0
  15. package/dist/components/auth/organization/delete-organization-dialog.d.ts +7 -0
  16. package/dist/components/auth/organization/delete-organization-skeleton.d.ts +4 -0
  17. package/dist/components/auth/organization/delete-organization.d.ts +5 -0
  18. package/dist/components/auth/organization/invite-member-dialog.d.ts +13 -0
  19. package/dist/components/auth/organization/leave-organization-dialog.d.ts +7 -0
  20. package/dist/components/auth/organization/leave-organization.d.ts +4 -0
  21. package/dist/components/auth/organization/organization-danger-zone.d.ts +16 -0
  22. package/dist/components/auth/organization/organization-invitation-row-skeleton.d.ts +5 -0
  23. package/dist/components/auth/organization/organization-invitation-row.d.ts +5 -0
  24. package/dist/components/auth/organization/organization-invitations-empty.d.ts +8 -0
  25. package/dist/components/auth/organization/organization-invitations.d.ts +9 -0
  26. package/dist/components/auth/organization/organization-logo.d.ts +15 -0
  27. package/dist/components/auth/organization/organization-member-row-skeleton.d.ts +4 -0
  28. package/dist/components/auth/organization/organization-member-row.d.ts +9 -0
  29. package/dist/components/auth/organization/organization-members.d.ts +9 -0
  30. package/dist/components/auth/organization/organization-people.d.ts +10 -0
  31. package/dist/components/auth/organization/organization-profile.d.ts +9 -0
  32. package/dist/components/auth/organization/organization-row.d.ts +8 -0
  33. package/dist/components/auth/organization/organization-settings.d.ts +12 -0
  34. package/dist/components/auth/organization/organization-switcher.d.ts +20 -0
  35. package/dist/components/auth/organization/organization-view-skeleton.d.ts +6 -0
  36. package/dist/components/auth/organization/organization-view.d.ts +15 -0
  37. package/dist/components/auth/organization/organization.d.ts +17 -0
  38. package/dist/components/auth/organization/organizations-empty.d.ts +4 -0
  39. package/dist/components/auth/organization/organizations-settings.d.ts +17 -0
  40. package/dist/components/auth/organization/organizations.d.ts +10 -0
  41. package/dist/components/auth/organization/remove-member-dialog.d.ts +9 -0
  42. package/dist/components/auth/organization/slug-field.d.ts +19 -0
  43. package/dist/components/auth/organization/user-invitation-row-skeleton.d.ts +4 -0
  44. package/dist/components/auth/organization/user-invitation-row.d.ts +10 -0
  45. package/dist/components/auth/organization/user-invitations-empty.d.ts +4 -0
  46. package/dist/components/auth/organization/user-invitations.d.ts +10 -0
  47. package/dist/components/auth/settings/settings.d.ts +1 -1
  48. package/dist/components/auth/user/user-avatar.d.ts +1 -1
  49. package/dist/components/auth/user/user-button.d.ts +4 -5
  50. package/dist/components/auth/user/user-view.d.ts +10 -4
  51. package/dist/email.d.ts +1 -0
  52. package/dist/email.js +211 -8
  53. package/dist/index.js +1682 -22
  54. package/dist/lib/auth/api-key-plugin.d.ts +5 -2
  55. package/dist/lib/auth/auth-plugin.d.ts +6 -2
  56. package/dist/lib/auth/delete-user-plugin.d.ts +4 -4
  57. package/dist/lib/auth/magic-link-plugin.d.ts +2 -2
  58. package/dist/lib/auth/multi-session-plugin.d.ts +2 -2
  59. package/dist/lib/auth/organization-plugin.d.ts +37 -0
  60. package/dist/lib/auth/passkey-plugin.d.ts +2 -2
  61. package/dist/lib/auth/theme-plugin.d.ts +3 -3
  62. package/dist/lib/auth/username-plugin.d.ts +8 -8
  63. package/dist/plugins.d.ts +25 -1
  64. package/dist/plugins.js +2824 -22
  65. package/dist/user-view--47tVtJ3.js +113 -0
  66. package/package.json +23 -18
  67. package/src/components/auth/api-key/api-key.tsx +25 -16
  68. package/src/components/auth/api-key/api-keys-empty.tsx +8 -4
  69. package/src/components/auth/api-key/api-keys.tsx +52 -14
  70. package/src/components/auth/api-key/create-api-key-dialog.tsx +15 -2
  71. package/src/components/auth/api-key/delete-api-key-dialog.tsx +10 -2
  72. package/src/components/auth/api-key/organization-api-keys.tsx +55 -0
  73. package/src/components/auth/delete-user/danger-zone.tsx +3 -3
  74. package/src/components/auth/delete-user/{delete-user.tsx → delete-account.tsx} +9 -9
  75. package/src/components/auth/email/organization-invitation-email.tsx +38 -0
  76. package/src/components/auth/error-toaster.tsx +28 -10
  77. package/src/components/auth/forgot-password.tsx +10 -2
  78. package/src/components/auth/multi-session/manage-accounts.tsx +1 -1
  79. package/src/components/auth/multi-session/switch-account-submenu-content.tsx +7 -2
  80. package/src/components/auth/multi-session/switch-account-submenu-item.tsx +4 -2
  81. package/src/components/auth/multi-session/switch-account-submenu.tsx +8 -4
  82. package/src/components/auth/organization/change-organization-logo.tsx +171 -0
  83. package/src/components/auth/organization/create-organization-dialog.tsx +133 -0
  84. package/src/components/auth/organization/delete-organization-dialog.tsx +97 -0
  85. package/src/components/auth/organization/delete-organization-skeleton.tsx +17 -0
  86. package/src/components/auth/organization/delete-organization.tsx +77 -0
  87. package/src/components/auth/organization/invite-member-dialog.tsx +177 -0
  88. package/src/components/auth/organization/leave-organization-dialog.tsx +95 -0
  89. package/src/components/auth/organization/leave-organization.tsx +59 -0
  90. package/src/components/auth/organization/organization-danger-zone.tsx +68 -0
  91. package/src/components/auth/organization/organization-invitation-row-skeleton.tsx +29 -0
  92. package/src/components/auth/organization/organization-invitation-row.tsx +97 -0
  93. package/src/components/auth/organization/organization-invitations-empty.tsx +39 -0
  94. package/src/components/auth/organization/organization-invitations.tsx +351 -0
  95. package/src/components/auth/organization/organization-logo.tsx +64 -0
  96. package/src/components/auth/organization/organization-member-row-skeleton.tsx +24 -0
  97. package/src/components/auth/organization/organization-member-row.tsx +157 -0
  98. package/src/components/auth/organization/organization-members.tsx +284 -0
  99. package/src/components/auth/organization/organization-people.tsx +26 -0
  100. package/src/components/auth/organization/organization-profile.tsx +141 -0
  101. package/src/components/auth/organization/organization-row.tsx +66 -0
  102. package/src/components/auth/organization/organization-settings.tsx +38 -0
  103. package/src/components/auth/organization/organization-switcher.tsx +233 -0
  104. package/src/components/auth/organization/organization-view-skeleton.tsx +36 -0
  105. package/src/components/auth/organization/organization-view.tsx +109 -0
  106. package/src/components/auth/organization/organization.tsx +162 -0
  107. package/src/components/auth/organization/organizations-empty.tsx +35 -0
  108. package/src/components/auth/organization/organizations-settings.tsx +36 -0
  109. package/src/components/auth/organization/organizations.tsx +80 -0
  110. package/src/components/auth/organization/remove-member-dialog.tsx +95 -0
  111. package/src/components/auth/organization/slug-field.tsx +111 -0
  112. package/src/components/auth/organization/user-invitation-row-skeleton.tsx +17 -0
  113. package/src/components/auth/organization/user-invitation-row.tsx +90 -0
  114. package/src/components/auth/organization/user-invitations-empty.tsx +30 -0
  115. package/src/components/auth/organization/user-invitations.tsx +59 -0
  116. package/src/components/auth/settings/account/change-email.tsx +1 -1
  117. package/src/components/auth/settings/account/user-profile.tsx +5 -5
  118. package/src/components/auth/settings/security/active-sessions.tsx +6 -4
  119. package/src/components/auth/settings/security/linked-accounts.tsx +2 -2
  120. package/src/components/auth/settings/settings.tsx +77 -14
  121. package/src/components/auth/user/user-avatar.tsx +4 -1
  122. package/src/components/auth/user/user-button.tsx +14 -11
  123. package/src/components/auth/user/user-view.tsx +32 -12
  124. package/src/email.ts +1 -0
  125. package/src/lib/auth/api-key-plugin.ts +10 -4
  126. package/src/lib/auth/auth-plugin.ts +6 -1
  127. package/src/lib/auth/organization-plugin.tsx +32 -0
  128. package/src/plugins.ts +25 -1
  129. package/dist/components/auth/additional-field.js +0 -270
  130. package/dist/components/auth/api-key/api-key-skeleton.js +0 -21
  131. package/dist/components/auth/api-key/api-key.js +0 -55
  132. package/dist/components/auth/api-key/api-keys-empty.js +0 -35
  133. package/dist/components/auth/api-key/api-keys.js +0 -41
  134. package/dist/components/auth/api-key/create-api-key-dialog.js +0 -74
  135. package/dist/components/auth/api-key/delete-api-key-dialog.js +0 -51
  136. package/dist/components/auth/api-key/new-api-key-dialog.js +0 -60
  137. package/dist/components/auth/auth-provider.js +0 -17
  138. package/dist/components/auth/auth.js +0 -63
  139. package/dist/components/auth/delete-user/danger-zone.js +0 -18
  140. package/dist/components/auth/delete-user/delete-user.js +0 -95
  141. package/dist/components/auth/email/email-changed-email.js +0 -30
  142. package/dist/components/auth/email/email-verification-email.js +0 -30
  143. package/dist/components/auth/email/magic-link-email.js +0 -30
  144. package/dist/components/auth/email/new-device-email.js +0 -30
  145. package/dist/components/auth/email/otp-email.js +0 -29
  146. package/dist/components/auth/email/password-changed-email.js +0 -30
  147. package/dist/components/auth/email/reset-password-email.js +0 -30
  148. package/dist/components/auth/error-toaster.js +0 -17
  149. package/dist/components/auth/field-separator.js +0 -18
  150. package/dist/components/auth/forgot-password.js +0 -89
  151. package/dist/components/auth/magic-link/magic-link-button.js +0 -20
  152. package/dist/components/auth/magic-link/magic-link.js +0 -87
  153. package/dist/components/auth/multi-session/manage-account.js +0 -49
  154. package/dist/components/auth/multi-session/manage-accounts.js +0 -34
  155. package/dist/components/auth/multi-session/switch-account-submenu-content.js +0 -28
  156. package/dist/components/auth/multi-session/switch-account-submenu-item.js +0 -20
  157. package/dist/components/auth/multi-session/switch-account-submenu.js +0 -24
  158. package/dist/components/auth/passkey/add-passkey-dialog.js +0 -65
  159. package/dist/components/auth/passkey/delete-passkey-dialog.js +0 -47
  160. package/dist/components/auth/passkey/passkey-button.js +0 -24
  161. package/dist/components/auth/passkey/passkey-skeleton.js +0 -17
  162. package/dist/components/auth/passkey/passkey.js +0 -48
  163. package/dist/components/auth/passkey/passkeys-empty.js +0 -35
  164. package/dist/components/auth/passkey/passkeys.js +0 -42
  165. package/dist/components/auth/provider-button.js +0 -25
  166. package/dist/components/auth/provider-buttons.js +0 -19
  167. package/dist/components/auth/reset-password.js +0 -147
  168. package/dist/components/auth/settings/account/account-settings.js +0 -20
  169. package/dist/components/auth/settings/account/change-avatar.js +0 -89
  170. package/dist/components/auth/settings/account/change-email.js +0 -54
  171. package/dist/components/auth/settings/account/user-profile.js +0 -86
  172. package/dist/components/auth/settings/security/active-session.js +0 -59
  173. package/dist/components/auth/settings/security/active-sessions.js +0 -34
  174. package/dist/components/auth/settings/security/change-password.js +0 -189
  175. package/dist/components/auth/settings/security/linked-account.js +0 -56
  176. package/dist/components/auth/settings/security/linked-accounts.js +0 -45
  177. package/dist/components/auth/settings/security/security-settings.js +0 -22
  178. package/dist/components/auth/settings/settings.js +0 -45
  179. package/dist/components/auth/sign-in.js +0 -133
  180. package/dist/components/auth/sign-out.js +0 -27
  181. package/dist/components/auth/sign-up.js +0 -212
  182. package/dist/components/auth/theme/appearance.js +0 -72
  183. package/dist/components/auth/theme/theme-toggle-item.js +0 -62
  184. package/dist/components/auth/user/user-avatar.js +0 -29
  185. package/dist/components/auth/user/user-button.js +0 -74
  186. package/dist/components/auth/user/user-view.js +0 -37
  187. package/dist/components/auth/username/sign-in-username.js +0 -148
  188. package/dist/components/auth/username/username-field.js +0 -53
  189. package/dist/lib/auth/api-key-plugin.js +0 -10
  190. package/dist/lib/auth/delete-user-plugin.js +0 -10
  191. package/dist/lib/auth/magic-link-plugin.js +0 -13
  192. package/dist/lib/auth/multi-session-plugin.js +0 -12
  193. package/dist/lib/auth/passkey-plugin.js +0 -12
  194. package/dist/lib/auth/theme-plugin.js +0 -23
  195. package/dist/lib/auth/username-plugin.js +0 -18
@@ -1,5 +1,9 @@
1
1
  import { ListedApiKey } from '@better-auth-ui/react';
2
2
  export type ApiKeyProps = {
3
3
  apiKey: ListedApiKey;
4
+ /** Hide the row's delete button (e.g., when caller lacks `apiKey:delete`). */
5
+ hideDelete?: boolean;
6
+ /** Scope the delete payload to an organization (sets `configId`). */
7
+ organizationId?: string;
4
8
  };
5
- export declare function ApiKey({ apiKey }: ApiKeyProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function ApiKey({ apiKey, hideDelete, organizationId }: ApiKeyProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,6 @@
1
1
  export type ApiKeysEmptyProps = {
2
2
  onCreatePress: () => void;
3
+ /** Hide the empty-state "Create API key" button. */
4
+ hideCreate?: boolean;
3
5
  };
4
- export declare function ApiKeysEmpty({ onCreatePress }: ApiKeysEmptyProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function ApiKeysEmpty({ onCreatePress, hideCreate }: ApiKeysEmptyProps): import("react/jsx-runtime").JSX.Element;
@@ -2,5 +2,13 @@ import { CardProps } from '@heroui/react';
2
2
  export type ApiKeysProps = {
3
3
  className?: string;
4
4
  variant?: CardProps["variant"];
5
+ /** Scope the list and create payload to an organization. */
6
+ organizationId?: string;
7
+ /** Force the loading skeleton and disable the list query. */
8
+ isPending?: boolean;
9
+ /** Hide the "Create API key" button (header + empty state). */
10
+ hideCreate?: boolean;
11
+ /** Hide the per-row delete button on listed keys. */
12
+ hideDelete?: boolean;
5
13
  };
6
- export declare function ApiKeys({ className, variant }: ApiKeysProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function ApiKeys({ className, variant, organizationId, isPending: isPendingProp, hideCreate, hideDelete }: ApiKeysProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,7 @@
1
1
  export type CreateApiKeyDialogProps = {
2
2
  isOpen: boolean;
3
3
  onOpenChange: (open: boolean) => void;
4
+ /** Create an organization-owned key by passing the organization id. */
5
+ organizationId?: string;
4
6
  };
5
- export declare function CreateApiKeyDialog({ isOpen, onOpenChange }: CreateApiKeyDialogProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function CreateApiKeyDialog({ isOpen, onOpenChange, organizationId }: CreateApiKeyDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -3,5 +3,7 @@ export type DeleteApiKeyDialogProps = {
3
3
  isOpen: boolean;
4
4
  onOpenChange: (open: boolean) => void;
5
5
  apiKey: ListedApiKey;
6
+ /** Scope the delete payload to an organization (sets `configId`). */
7
+ organizationId?: string;
6
8
  };
7
- export declare function DeleteApiKeyDialog({ isOpen, onOpenChange, apiKey }: DeleteApiKeyDialogProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function DeleteApiKeyDialog({ isOpen, onOpenChange, apiKey, organizationId }: DeleteApiKeyDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { CardProps } from '@heroui/react';
2
+ export type OrganizationApiKeysProps = {
3
+ className?: string;
4
+ variant?: CardProps["variant"];
5
+ };
6
+ /**
7
+ * {@link ApiKeys} scoped to the active organization.
8
+ *
9
+ * Hidden for members whose role isn't `owner`. Better Auth's
10
+ * `/organization/has-permission` endpoint isn't usable for `apiKey:*` checks
11
+ * (it doesn't pass `allowCreatorAllPermissions` and the default org AC has no
12
+ * `apiKey` statements), so we gate on role directly.
13
+ */
14
+ export declare function OrganizationApiKeys({ className, variant }: OrganizationApiKeysProps): import("react/jsx-runtime").JSX.Element | null;
@@ -5,7 +5,7 @@ export type DangerZoneProps = {
5
5
  variant?: CardProps["variant"];
6
6
  };
7
7
  /**
8
- * Renders the danger zone heading and {@link DeleteUser}.
8
+ * Renders the danger zone heading and {@link DeleteAccount}.
9
9
  * Registered as a `securityCard` by `deleteUserPlugin()`; gate by registering the plugin.
10
10
  */
11
11
  export declare function DangerZone({ className, variant, ...props }: DangerZoneProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import { CardProps } from '@heroui/react';
2
- export type DeleteUserProps = {
2
+ export type DeleteAccountProps = {
3
3
  className?: string;
4
4
  variant?: CardProps["variant"];
5
5
  };
6
6
  /**
7
7
  * Danger-zone card to delete the authenticated account, with a confirmation dialog and toasts.
8
8
  */
9
- export declare function DeleteUser({ className, variant, ...props }: DeleteUserProps & Omit<CardProps, "children">): import("react/jsx-runtime").JSX.Element;
9
+ export declare function DeleteAccount({ className, variant, ...props }: DeleteAccountProps & Omit<CardProps, "children">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { OrganizationInvitationEmailProps } from '@better-auth-ui/react/email';
2
+ export type { OrganizationInvitationEmailProps } from '@better-auth-ui/react/email';
3
+ export declare function OrganizationInvitationEmail({ colors, classNames, ...props }: OrganizationInvitationEmailProps): import("react/jsx-runtime").JSX.Element;
@@ -7,4 +7,6 @@
7
7
  *
8
8
  * @returns The switch account submenu content as a JSX element
9
9
  */
10
- export declare function SwitchAccountSubmenuContent(): import("react/jsx-runtime").JSX.Element;
10
+ export declare function SwitchAccountSubmenuContent({ hideSubtitle }: {
11
+ hideSubtitle?: boolean;
12
+ }): import("react/jsx-runtime").JSX.Element;
@@ -5,6 +5,7 @@ type DeviceSession = {
5
5
  };
6
6
  export type SwitchAccountSubmenuItemProps = {
7
7
  deviceSession: DeviceSession;
8
+ hideSubtitle?: boolean;
8
9
  };
9
10
  /**
10
11
  * Render a dropdown item for switching to a different authenticated session.
@@ -12,5 +13,5 @@ export type SwitchAccountSubmenuItemProps = {
12
13
  * @param deviceSession - The device session to display and switch to when pressed
13
14
  * @returns The switch account dropdown item as a JSX element
14
15
  */
15
- export declare function SwitchAccountSubmenuItem({ deviceSession }: SwitchAccountSubmenuItemProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function SwitchAccountSubmenuItem({ deviceSession, hideSubtitle }: SwitchAccountSubmenuItemProps): import("react/jsx-runtime").JSX.Element;
16
17
  export {};
@@ -1,5 +1,6 @@
1
1
  export type SwitchAccountSubmenuProps = {
2
2
  className?: string;
3
+ hideSubtitle?: boolean;
3
4
  };
4
5
  /**
5
6
  * Render a dropdown submenu for switching between multiple authenticated sessions.
@@ -10,4 +11,4 @@ export type SwitchAccountSubmenuProps = {
10
11
  * @param className - Optional additional CSS class names
11
12
  * @returns The switch account submenu as a JSX element
12
13
  */
13
- export declare function SwitchAccountSubmenu({ className }: SwitchAccountSubmenuProps): import("react/jsx-runtime").JSX.Element | null;
14
+ export declare function SwitchAccountSubmenu({ className, hideSubtitle }: SwitchAccountSubmenuProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ export type ChangeOrganizationLogoProps = {
2
+ className?: string;
3
+ };
4
+ export declare function ChangeOrganizationLogo({ className }: ChangeOrganizationLogoProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ /** Props for the {@link CreateOrganizationDialog} component. */
2
+ export type CreateOrganizationDialogProps = {
3
+ isOpen: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ };
6
+ /**
7
+ * Render a dialog for creating a new organization.
8
+ *
9
+ * @param isOpen - Whether the dialog is open
10
+ * @param onOpenChange - Callback for when the dialog open state changes
11
+ * @returns The create organization dialog as a JSX element
12
+ */
13
+ export declare function CreateOrganizationDialog({ isOpen, onOpenChange }: CreateOrganizationDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { Organization } from 'better-auth/client';
2
+ export type DeleteOrganizationDialogProps = {
3
+ isOpen: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ organization: Organization;
6
+ };
7
+ export declare function DeleteOrganizationDialog({ isOpen, onOpenChange, organization }: DeleteOrganizationDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Placeholder matching {@link DeleteOrganization} while the delete permission resolves.
3
+ */
4
+ export declare function DeleteOrganizationSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Danger-zone row to delete the active organization. Hidden for members without
3
+ * the `organization:delete` permission.
4
+ */
5
+ export declare function DeleteOrganization(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ /** Props for the {@link InviteMemberDialog} component. */
2
+ export type InviteMemberDialogProps = {
3
+ isOpen: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ };
6
+ /**
7
+ * Render a dialog for inviting a member to the organization.
8
+ *
9
+ * @param isOpen - Whether the dialog is open
10
+ * @param onOpenChange - Callback for when the dialog open state changes
11
+ * @returns The invite member dialog as a JSX element
12
+ */
13
+ export declare function InviteMemberDialog({ isOpen, onOpenChange }: InviteMemberDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { Organization } from 'better-auth/client';
2
+ export type LeaveOrganizationDialogProps = {
3
+ isOpen: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ organization: Organization;
6
+ };
7
+ export declare function LeaveOrganizationDialog({ isOpen, onOpenChange, organization }: LeaveOrganizationDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Danger-zone row to leave the active organization.
3
+ */
4
+ export declare function LeaveOrganization(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { CardProps } from '@heroui/react';
2
+ import { ComponentProps } from 'react';
3
+ export type OrganizationDangerZoneProps = {
4
+ className?: string;
5
+ variant?: CardProps["variant"];
6
+ };
7
+ /**
8
+ * Danger zone heading with {@link LeaveOrganization} and {@link DeleteOrganization}
9
+ * for the active organization in a single card.
10
+ *
11
+ * Resolves the `organization:delete` permission before rendering anything to
12
+ * avoid flashing {@link LeaveOrganization} (and a stray separator) before the
13
+ * delete row appears or disappears. Inner {@link DeleteOrganization} also
14
+ * self-gates so it stays safe to use standalone.
15
+ */
16
+ export declare function OrganizationDangerZone({ className, variant, ...props }: OrganizationDangerZoneProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Placeholder row matching {@link OrganizationInvitationTableRow} while
3
+ * invitations load.
4
+ */
5
+ export declare function OrganizationInvitationRowSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Invitation } from 'better-auth/client';
2
+ export type OrganizationInvitationTableRowProps = {
3
+ invitation: Invitation;
4
+ };
5
+ export declare function OrganizationInvitationTableRow({ invitation }: OrganizationInvitationTableRowProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export type OrganizationInvitationsEmptyProps = {
2
+ onInvitePress: () => void;
3
+ };
4
+ /**
5
+ * Empty state for {@link OrganizationInvitations} — mirrors `ApiKeysEmpty`
6
+ * (icon, title, description) with an "Invite member" call to action.
7
+ */
8
+ export declare function OrganizationInvitationsEmpty({ onInvitePress }: OrganizationInvitationsEmptyProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ComponentProps } from 'react';
2
+ /** Props for the {@link OrganizationInvitations} component. */
3
+ export type OrganizationInvitationsProps = {
4
+ className?: string;
5
+ };
6
+ /**
7
+ * Organization invitations table with invite control and per-row actions.
8
+ */
9
+ export declare function OrganizationInvitations({ className, ...props }: OrganizationInvitationsProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { AvatarProps } from '@heroui/react';
2
+ import { Organization } from 'better-auth/client';
3
+ import { ReactNode } from 'react';
4
+ export type OrganizationLogoProps = {
5
+ className?: string;
6
+ fallback?: ReactNode;
7
+ isPending?: boolean;
8
+ organization?: Partial<Organization>;
9
+ size?: AvatarProps["size"];
10
+ };
11
+ /**
12
+ * Renders an organization logo image, initials fallback, or a briefcase icon;
13
+ * shows a circular skeleton while loading when `isPending` is set and `organization` is undefined.
14
+ */
15
+ export declare function OrganizationLogo({ className, fallback, isPending, organization, size, style, ...props }: OrganizationLogoProps & AvatarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Placeholder row matching {@link OrganizationMemberRow} while members load.
3
+ */
4
+ export declare function OrganizationMemberRowSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { Member, Organization, User } from 'better-auth/client';
2
+ export type OrganizationMemberRowProps = {
3
+ member: Member & {
4
+ user: Partial<User>;
5
+ };
6
+ isOwner?: boolean;
7
+ organization: Organization;
8
+ };
9
+ export declare function OrganizationMemberRow({ member, isOwner, organization }: OrganizationMemberRowProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ComponentProps } from 'react';
2
+ /** Props for the {@link OrganizationMembers} component. */
3
+ export type OrganizationMembersProps = {
4
+ className?: string;
5
+ };
6
+ /**
7
+ * Organization members table with title, invite control, and per-row actions.
8
+ */
9
+ export declare function OrganizationMembers({ className, ...props }: OrganizationMembersProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { ComponentProps } from 'react';
2
+ /** Props for the {@link OrganizationPeople} component. */
3
+ export type OrganizationPeopleProps = {
4
+ className?: string;
5
+ };
6
+ /**
7
+ * Organization people UI: members table (see {@link OrganizationMembers}), then org
8
+ * invitations.
9
+ */
10
+ export declare function OrganizationPeople({ className, ...props }: OrganizationPeopleProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { CardProps } from '@heroui/react';
2
+ export type OrganizationProfileProps = {
3
+ className?: string;
4
+ variant?: CardProps["variant"];
5
+ };
6
+ /**
7
+ * Profile card for the active organization: logo (when enabled), display name, and slug.
8
+ */
9
+ export declare function OrganizationProfile({ className, variant, ...props }: OrganizationProfileProps & Omit<CardProps, "children">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Organization } from 'better-auth/client';
2
+ export type OrganizationRowProps = {
3
+ organization: Organization;
4
+ };
5
+ /**
6
+ * Single organization row: logo and labels via {@link OrganizationView}, plus Manage.
7
+ */
8
+ export declare function OrganizationRow({ organization }: OrganizationRowProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { CardProps } from '@heroui/react';
2
+ import { ComponentProps } from 'react';
3
+ /** Props for the {@link OrganizationSettings} component. */
4
+ export type OrganizationSettingsProps = {
5
+ className?: string;
6
+ variant?: CardProps["variant"];
7
+ };
8
+ /**
9
+ * Organization settings UI: profile card, plugin-contributed cards
10
+ * (`organizationCards`), then danger zone.
11
+ */
12
+ export declare function OrganizationSettings({ className, variant, ...props }: OrganizationSettingsProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { ButtonProps, DropdownPopoverProps } from '@heroui/react';
2
+ import { Organization } from 'better-auth/client';
3
+ import { ReactNode } from 'react';
4
+ /** Props for the {@link OrganizationSwitcher} component. */
5
+ export type OrganizationSwitcherProps = {
6
+ className?: string;
7
+ placement?: DropdownPopoverProps["placement"];
8
+ variant?: ButtonProps["variant"];
9
+ trigger?: ReactNode;
10
+ hideCreate?: boolean;
11
+ hidePersonal?: boolean;
12
+ hideSettings?: boolean;
13
+ hideSlug?: boolean;
14
+ setActive?: (organization: Organization | null) => void;
15
+ };
16
+ /**
17
+ * Renders an organizations dropdown with a trigger button,
18
+ * header summary, and a menu of organizations to switch to.
19
+ */
20
+ export declare function OrganizationSwitcher({ className, hideCreate, hidePersonal, hideSettings, hideSlug, setActive, placement, variant, size, trigger, ...props }: OrganizationSwitcherProps & ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ComponentProps } from 'react';
2
+ import { OrganizationViewProps } from './organization-view';
3
+ /**
4
+ * Placeholder matching {@link OrganizationView} while organization data loads.
5
+ */
6
+ export declare function OrganizationViewSkeleton({ className, hideSlug, size, ...props }: OrganizationViewProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { AvatarProps } from '@heroui/react';
2
+ import { Organization } from 'better-auth/client';
3
+ import { ComponentProps } from 'react';
4
+ export type OrganizationViewProps = {
5
+ className?: string;
6
+ isPending?: boolean;
7
+ size?: AvatarProps["size"];
8
+ hideRole?: boolean;
9
+ hideSlug?: boolean;
10
+ organization?: Partial<Organization>;
11
+ };
12
+ /**
13
+ * Compact organization row: logo, primary name, secondary slug — analogous to {@link UserView}.
14
+ */
15
+ export declare function OrganizationView({ className, isPending, size, hideSlug, hideRole, organization, ...props }: OrganizationViewProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { OrganizationView } from '@better-auth-ui/core/plugins';
2
+ import { CardProps } from '@heroui/react';
3
+ import { ComponentProps } from 'react';
4
+ export type OrganizationProps = {
5
+ className?: string;
6
+ hideNav?: boolean;
7
+ path?: string;
8
+ variant?: CardProps["variant"];
9
+ /** @remarks `OrganizationView` */
10
+ view?: OrganizationView;
11
+ };
12
+ /**
13
+ * Organization management shell: tabs for profile / danger zone and for
14
+ * people (members / invitations). Path segments come from
15
+ * `useAuthPlugin(organizationPlugin).viewPaths.organization`.
16
+ */
17
+ export declare function Organization({ className, hideNav, path, variant, view, ...props }: OrganizationProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ export type OrganizationsEmptyProps = {
2
+ onCreatePress: () => void;
3
+ };
4
+ export declare function OrganizationsEmpty({ onCreatePress }: OrganizationsEmptyProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { CardProps } from '@heroui/react';
2
+ import { ComponentProps } from 'react';
3
+ export type OrganizationsSettingsProps = {
4
+ className?: string;
5
+ variant?: CardProps["variant"];
6
+ };
7
+ /**
8
+ * Renders the organizations settings panel.
9
+ *
10
+ * Displays all organizations the user belongs to with an empty state and
11
+ * create button, followed by a card for invitations to the user.
12
+ *
13
+ * @param className - Optional additional CSS class names for the outer container.
14
+ * @param variant - Card variant forwarded to each card.
15
+ * @returns The organizations settings UI as a JSX element.
16
+ */
17
+ export declare function OrganizationsSettings({ className, variant, ...props }: OrganizationsSettingsProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { CardProps } from '@heroui/react';
2
+ export type OrganizationsProps = {
3
+ variant?: CardProps["variant"];
4
+ };
5
+ /**
6
+ * Lists organizations the user belongs to (via {@link useListOrganizations}): loading skeleton,
7
+ * empty state with create, or a card of rows with a Manage control per organization.
8
+ * Owns {@link CreateOrganizationDialog} open state and the create actions.
9
+ */
10
+ export declare function Organizations({ variant }: OrganizationsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { Member, User } from 'better-auth/client';
2
+ export type RemoveMemberDialogProps = {
3
+ isOpen: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ member: Member & {
6
+ user: Partial<User>;
7
+ };
8
+ };
9
+ export declare function RemoveMemberDialog({ isOpen, onOpenChange, member }: RemoveMemberDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { InputProps, TextFieldProps } from '@heroui/react';
2
+ /** Props for the {@link SlugField} component. */
3
+ export type SlugFieldProps = {
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ currentSlug?: string;
7
+ isDisabled?: boolean;
8
+ variant?: InputProps["variant"];
9
+ };
10
+ /**
11
+ * Sanitize a slug value so it only contains lowercase alphanumeric characters
12
+ * and dashes. Runs of disallowed characters are collapsed to a single dash, but
13
+ * leading/trailing dashes are preserved while the user is still typing.
14
+ */
15
+ export declare function sanitizeSlug(value: string): string;
16
+ /**
17
+ * Organization slug field with debounced availability checking.
18
+ */
19
+ export declare function SlugField({ value, onChange, currentSlug, variant, ...props }: SlugFieldProps & TextFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Placeholder row matching {@link UserInvitationRow} while invitations load.
3
+ */
4
+ export declare function UserInvitationRowSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { Invitation } from 'better-auth/client';
2
+ export type UserInvitationRowProps = {
3
+ invitation: Invitation & {
4
+ organizationName?: string;
5
+ };
6
+ };
7
+ /**
8
+ * Single invitation row with accept/reject actions for the current user.
9
+ */
10
+ export declare function UserInvitationRow({ invitation }: UserInvitationRowProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Empty state for `UserInvitations`
3
+ */
4
+ export declare function UserInvitationsEmpty(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { CardProps } from '@heroui/react';
2
+ export type UserInvitationsProps = {
3
+ variant?: CardProps["variant"];
4
+ };
5
+ /**
6
+ * Organization invitations for the signed-in user (from
7
+ * {@link useListUserInvitations}). Always renders the section card; uses
8
+ * {@link UserInvitationsEmpty} when there are no pending invitations.
9
+ */
10
+ export declare function UserInvitations({ variant }: UserInvitationsProps): import("react/jsx-runtime").JSX.Element;
@@ -19,6 +19,6 @@ export type SettingsProps = {
19
19
  * @param variant - Card variant forwarded to each settings section card
20
20
  * @returns A DOM tree containing the responsive settings tabs and the currently selected settings panel
21
21
  *
22
- * @throws Error if neither `view` nor `path` is provided
22
+ * @throws Error if neither `view` nor `path` is provided, or if `path` does not match any settings view
23
23
  */
24
24
  export declare function Settings({ className, hideNav, path, variant, view, ...props }: SettingsProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
@@ -6,7 +6,7 @@ export type UserAvatarProps = {
6
6
  fallback?: ReactNode;
7
7
  isPending?: boolean;
8
8
  /** @remarks `User` */
9
- user?: User & {
9
+ user?: Partial<User> & {
10
10
  username?: string | null;
11
11
  displayUsername?: string | null;
12
12
  };
@@ -21,16 +21,15 @@ export type UserButtonLink = {
21
21
  export type UserButtonProps = {
22
22
  className?: string;
23
23
  size?: "default" | "icon";
24
- /**
25
- * The placement of the element with respect to its anchor element.
26
- * @default "bottom"
27
- */
24
+ /** The placement of the element with respect to its anchor element. */
28
25
  placement?: DropdownPopoverProps["placement"];
29
26
  variant?: ButtonProps["variant"];
30
27
  /** Additional menu entries rendered above the built-in items. */
31
28
  links?: (UserButtonLink | ReactElement)[];
32
29
  /** Hide the built-in "Settings" link. Useful when replacing it via `links`. */
33
30
  hideSettings?: boolean;
31
+ /** When true, the subtitle line (email when name/username is shown) is hidden. */
32
+ hideSubtitle?: boolean;
34
33
  };
35
34
  /**
36
35
  * Render a user account dropdown button that shows account actions.
@@ -43,4 +42,4 @@ export type UserButtonProps = {
43
42
  * @param hideSettings - Hide the built-in "Settings" link
44
43
  * @returns The user button and its dropdown menu as a JSX element
45
44
  */
46
- export declare function UserButton({ className, placement, size, variant, links, hideSettings }: UserButtonProps): import("react/jsx-runtime").JSX.Element;
45
+ export declare function UserButton({ className, placement, size, variant, links, hideSettings, hideSubtitle }: UserButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -5,18 +5,24 @@ export type UserViewProps = {
5
5
  className?: string;
6
6
  isPending?: boolean;
7
7
  size?: AvatarProps["size"];
8
+ /**
9
+ * When true, the subtitle line (email when name/username is shown) is hidden.
10
+ * @default false
11
+ */
12
+ hideSubtitle?: boolean;
8
13
  /** @remarks `User` */
9
- user?: User & {
14
+ user?: Partial<User> & {
10
15
  username?: string | null;
11
16
  displayUsername?: string | null;
12
17
  };
13
18
  };
14
19
  /**
15
- * Render a compact user item with an avatar, a primary label (display username, name, or email), and an optional secondary email line.
20
+ * Render a compact user item with an avatar, a primary label (display username, name, or email), and an optional subtitle (email).
16
21
  *
17
22
  * @param isPending - If true and no `user` prop is provided, renders a loading skeleton instead of user details
18
- * @param size - Avatar size variant; defaults to `"sm"`
23
+ * @param size - Avatar size variant; defaults to `"md"`
24
+ * @param hideSubtitle - When true, omits the muted subtitle row under the primary label
19
25
  * @param user - Optional user to display; when omitted the current session user is used if available
20
26
  * @returns A React element containing the user's avatar and text labels
21
27
  */
22
- export declare function UserView({ className, isPending, size, user, ...props }: UserViewProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
28
+ export declare function UserView({ className, isPending, size, hideSubtitle, user, ...props }: UserViewProps & ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
package/dist/email.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from './components/auth/email/email-changed-email';
2
2
  export * from './components/auth/email/email-verification-email';
3
3
  export * from './components/auth/email/magic-link-email';
4
4
  export * from './components/auth/email/new-device-email';
5
+ export * from './components/auth/email/organization-invitation-email';
5
6
  export * from './components/auth/email/otp-email';
6
7
  export * from './components/auth/email/password-changed-email';
7
8
  export * from './components/auth/email/reset-password-email';