@stackframe/stack 2.7.23 → 2.7.25

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 (170) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/components/elements/sidebar-layout.js +2 -9
  3. package/dist/components/elements/sidebar-layout.js.map +1 -1
  4. package/dist/components-page/account-settings.js +70 -83
  5. package/dist/components-page/account-settings.js.map +1 -1
  6. package/dist/esm/components/elements/sidebar-layout.js +2 -9
  7. package/dist/esm/components/elements/sidebar-layout.js.map +1 -1
  8. package/dist/esm/components-page/account-settings.js +69 -80
  9. package/dist/esm/components-page/account-settings.js.map +1 -1
  10. package/dist/esm/generated/global-css.js +1 -1
  11. package/dist/esm/generated/global-css.js.map +1 -1
  12. package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +6 -10
  13. package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
  14. package/dist/esm/lib/stack-app/apps/implementations/common.js +1 -1
  15. package/dist/esm/lib/stack-app/apps/implementations/common.js.map +1 -1
  16. package/dist/esm/lib/stack-app/users/index.js.map +1 -1
  17. package/dist/generated/global-css.js +1 -1
  18. package/dist/generated/global-css.js.map +1 -1
  19. package/dist/index.d.mts +1054 -53
  20. package/dist/index.d.ts +1054 -53
  21. package/dist/lib/stack-app/apps/implementations/client-app-impl.js +5 -9
  22. package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
  23. package/dist/lib/stack-app/apps/implementations/common.js +1 -1
  24. package/dist/lib/stack-app/apps/implementations/common.js.map +1 -1
  25. package/dist/lib/stack-app/users/index.js.map +1 -1
  26. package/package.json +4 -4
  27. package/dist/admin-app-impl-CTQhv9tV.d.ts +0 -395
  28. package/dist/admin-app-impl-DpyRKp1e.d.mts +0 -395
  29. package/dist/components/credential-sign-in.d.mts +0 -5
  30. package/dist/components/credential-sign-in.d.ts +0 -5
  31. package/dist/components/credential-sign-up.d.mts +0 -7
  32. package/dist/components/credential-sign-up.d.ts +0 -7
  33. package/dist/components/elements/form-warning.d.mts +0 -7
  34. package/dist/components/elements/form-warning.d.ts +0 -7
  35. package/dist/components/elements/maybe-full-page.d.mts +0 -11
  36. package/dist/components/elements/maybe-full-page.d.ts +0 -11
  37. package/dist/components/elements/separator-with-text.d.mts +0 -7
  38. package/dist/components/elements/separator-with-text.d.ts +0 -7
  39. package/dist/components/elements/sidebar-layout.d.mts +0 -19
  40. package/dist/components/elements/sidebar-layout.d.ts +0 -19
  41. package/dist/components/elements/ssr-layout-effect.d.mts +0 -8
  42. package/dist/components/elements/ssr-layout-effect.d.ts +0 -8
  43. package/dist/components/elements/user-avatar.d.mts +0 -13
  44. package/dist/components/elements/user-avatar.d.ts +0 -13
  45. package/dist/components/iframe-preventer.d.mts +0 -8
  46. package/dist/components/iframe-preventer.d.ts +0 -8
  47. package/dist/components/link.d.mts +0 -14
  48. package/dist/components/link.d.ts +0 -14
  49. package/dist/components/magic-link-sign-in.d.mts +0 -5
  50. package/dist/components/magic-link-sign-in.d.ts +0 -5
  51. package/dist/components/message-cards/known-error-message-card.d.mts +0 -9
  52. package/dist/components/message-cards/known-error-message-card.d.ts +0 -9
  53. package/dist/components/message-cards/message-card.d.mts +0 -14
  54. package/dist/components/message-cards/message-card.d.ts +0 -14
  55. package/dist/components/message-cards/predefined-message-card.d.mts +0 -8
  56. package/dist/components/message-cards/predefined-message-card.d.ts +0 -8
  57. package/dist/components/oauth-button-group.d.mts +0 -14
  58. package/dist/components/oauth-button-group.d.ts +0 -14
  59. package/dist/components/oauth-button.d.mts +0 -8
  60. package/dist/components/oauth-button.d.ts +0 -8
  61. package/dist/components/passkey-button.d.mts +0 -7
  62. package/dist/components/passkey-button.d.ts +0 -7
  63. package/dist/components/profile-image-editor.d.mts +0 -11
  64. package/dist/components/profile-image-editor.d.ts +0 -11
  65. package/dist/components/selected-team-switcher.d.mts +0 -33
  66. package/dist/components/selected-team-switcher.d.ts +0 -33
  67. package/dist/components/team-icon.d.mts +0 -30
  68. package/dist/components/team-icon.d.ts +0 -30
  69. package/dist/components/user-button.d.mts +0 -15
  70. package/dist/components/user-button.d.ts +0 -15
  71. package/dist/components-page/account-settings.d.mts +0 -24
  72. package/dist/components-page/account-settings.d.ts +0 -24
  73. package/dist/components-page/auth-page.d.mts +0 -24
  74. package/dist/components-page/auth-page.d.ts +0 -24
  75. package/dist/components-page/email-verification.d.mts +0 -8
  76. package/dist/components-page/email-verification.d.ts +0 -8
  77. package/dist/components-page/error-page.d.mts +0 -8
  78. package/dist/components-page/error-page.d.ts +0 -8
  79. package/dist/components-page/forgot-password.d.mts +0 -10
  80. package/dist/components-page/forgot-password.d.ts +0 -10
  81. package/dist/components-page/magic-link-callback.d.mts +0 -8
  82. package/dist/components-page/magic-link-callback.d.ts +0 -8
  83. package/dist/components-page/oauth-callback.d.mts +0 -7
  84. package/dist/components-page/oauth-callback.d.ts +0 -7
  85. package/dist/components-page/password-reset.d.mts +0 -12
  86. package/dist/components-page/password-reset.d.ts +0 -12
  87. package/dist/components-page/sign-in.d.mts +0 -10
  88. package/dist/components-page/sign-in.d.ts +0 -10
  89. package/dist/components-page/sign-out.d.mts +0 -7
  90. package/dist/components-page/sign-out.d.ts +0 -7
  91. package/dist/components-page/sign-up.d.mts +0 -11
  92. package/dist/components-page/sign-up.d.ts +0 -11
  93. package/dist/components-page/stack-handler.d.mts +0 -72
  94. package/dist/components-page/stack-handler.d.ts +0 -72
  95. package/dist/components-page/team-creation.d.mts +0 -7
  96. package/dist/components-page/team-creation.d.ts +0 -7
  97. package/dist/components-page/team-invitation.d.mts +0 -8
  98. package/dist/components-page/team-invitation.d.ts +0 -8
  99. package/dist/generated/global-css.d.mts +0 -3
  100. package/dist/generated/global-css.d.ts +0 -3
  101. package/dist/generated/quetzal-translations.d.mts +0 -4
  102. package/dist/generated/quetzal-translations.d.ts +0 -4
  103. package/dist/global.d.d.mts +0 -2
  104. package/dist/global.d.d.ts +0 -2
  105. package/dist/index-C7D6Vt7X.d.mts +0 -560
  106. package/dist/index-DQk7XJpU.d.ts +0 -560
  107. package/dist/lib/auth.d.mts +0 -33
  108. package/dist/lib/auth.d.ts +0 -33
  109. package/dist/lib/cookie.d.mts +0 -33
  110. package/dist/lib/cookie.d.ts +0 -33
  111. package/dist/lib/hooks.d.mts +0 -53
  112. package/dist/lib/hooks.d.ts +0 -53
  113. package/dist/lib/stack-app/api-keys/index.d.mts +0 -40
  114. package/dist/lib/stack-app/api-keys/index.d.ts +0 -40
  115. package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.mts +0 -30
  116. package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.ts +0 -30
  117. package/dist/lib/stack-app/apps/implementations/client-app-impl.d.mts +0 -30
  118. package/dist/lib/stack-app/apps/implementations/client-app-impl.d.ts +0 -30
  119. package/dist/lib/stack-app/apps/implementations/common.d.mts +0 -45
  120. package/dist/lib/stack-app/apps/implementations/common.d.ts +0 -45
  121. package/dist/lib/stack-app/apps/implementations/index.d.mts +0 -36
  122. package/dist/lib/stack-app/apps/implementations/index.d.ts +0 -36
  123. package/dist/lib/stack-app/apps/implementations/server-app-impl.d.mts +0 -30
  124. package/dist/lib/stack-app/apps/implementations/server-app-impl.d.ts +0 -30
  125. package/dist/lib/stack-app/apps/index.d.mts +0 -23
  126. package/dist/lib/stack-app/apps/index.d.ts +0 -23
  127. package/dist/lib/stack-app/apps/interfaces/admin-app.d.mts +0 -23
  128. package/dist/lib/stack-app/apps/interfaces/admin-app.d.ts +0 -23
  129. package/dist/lib/stack-app/apps/interfaces/client-app.d.mts +0 -23
  130. package/dist/lib/stack-app/apps/interfaces/client-app.d.ts +0 -23
  131. package/dist/lib/stack-app/apps/interfaces/server-app.d.mts +0 -23
  132. package/dist/lib/stack-app/apps/interfaces/server-app.d.ts +0 -23
  133. package/dist/lib/stack-app/common.d.mts +0 -63
  134. package/dist/lib/stack-app/common.d.ts +0 -63
  135. package/dist/lib/stack-app/connected-accounts/index.d.mts +0 -13
  136. package/dist/lib/stack-app/connected-accounts/index.d.ts +0 -13
  137. package/dist/lib/stack-app/contact-channels/index.d.mts +0 -38
  138. package/dist/lib/stack-app/contact-channels/index.d.ts +0 -38
  139. package/dist/lib/stack-app/email-templates/index.d.mts +0 -15
  140. package/dist/lib/stack-app/email-templates/index.d.ts +0 -15
  141. package/dist/lib/stack-app/index.d.mts +0 -23
  142. package/dist/lib/stack-app/index.d.ts +0 -23
  143. package/dist/lib/stack-app/permissions/index.d.mts +0 -21
  144. package/dist/lib/stack-app/permissions/index.d.ts +0 -21
  145. package/dist/lib/stack-app/project-configs/index.d.mts +0 -82
  146. package/dist/lib/stack-app/project-configs/index.d.ts +0 -82
  147. package/dist/lib/stack-app/projects/index.d.mts +0 -23
  148. package/dist/lib/stack-app/projects/index.d.ts +0 -23
  149. package/dist/lib/stack-app/teams/index.d.mts +0 -23
  150. package/dist/lib/stack-app/teams/index.d.ts +0 -23
  151. package/dist/lib/stack-app/users/index.d.mts +0 -23
  152. package/dist/lib/stack-app/users/index.d.ts +0 -23
  153. package/dist/lib/translations.d.mts +0 -5
  154. package/dist/lib/translations.d.ts +0 -5
  155. package/dist/providers/stack-provider-client.d.mts +0 -39
  156. package/dist/providers/stack-provider-client.d.ts +0 -39
  157. package/dist/providers/stack-provider.d.mts +0 -42
  158. package/dist/providers/stack-provider.d.ts +0 -42
  159. package/dist/providers/theme-provider.d.mts +0 -40
  160. package/dist/providers/theme-provider.d.ts +0 -40
  161. package/dist/providers/translation-provider-client.d.mts +0 -14
  162. package/dist/providers/translation-provider-client.d.ts +0 -14
  163. package/dist/providers/translation-provider.d.mts +0 -10
  164. package/dist/providers/translation-provider.d.ts +0 -10
  165. package/dist/utils/browser-script.d.mts +0 -7
  166. package/dist/utils/browser-script.d.ts +0 -7
  167. package/dist/utils/constants.d.mts +0 -79
  168. package/dist/utils/constants.d.ts +0 -79
  169. package/dist/utils/url.d.mts +0 -3
  170. package/dist/utils/url.d.ts +0 -3
@@ -14,7 +14,7 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionCel
14
14
  import { Edit, Trash, icons } from "lucide-react";
15
15
  import { TOTPController, createTOTPKeyURI } from "oslo/otp";
16
16
  import * as QRCode from "qrcode";
17
- import React, { Suspense, useEffect, useState } from "react";
17
+ import { Suspense, useEffect, useState } from "react";
18
18
  import { useForm } from "react-hook-form";
19
19
  import * as yup from "yup";
20
20
  import { MessageCard, useStackApp, useUser } from "..";
@@ -102,22 +102,19 @@ function AccountSettings(props) {
102
102
  ) }) });
103
103
  }
104
104
  function Section(props) {
105
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-2", children: [
106
- /* @__PURE__ */ jsxs("div", { className: "sm:flex-1 flex flex-col justify-center", children: [
107
- /* @__PURE__ */ jsx(Typography, { className: "font-medium", children: props.title }),
108
- props.description && /* @__PURE__ */ jsx(Typography, { variant: "secondary", type: "footnote", children: props.description })
109
- ] }),
110
- /* @__PURE__ */ jsx("div", { className: "sm:flex-1 sm:items-end flex flex-col gap-2 ", children: props.children })
105
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
106
+ /* @__PURE__ */ jsx(Separator, {}),
107
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-2", children: [
108
+ /* @__PURE__ */ jsxs("div", { className: "sm:flex-1 flex flex-col justify-center", children: [
109
+ /* @__PURE__ */ jsx(Typography, { className: "font-medium", children: props.title }),
110
+ props.description && /* @__PURE__ */ jsx(Typography, { variant: "secondary", type: "footnote", children: props.description })
111
+ ] }),
112
+ /* @__PURE__ */ jsx("div", { className: "sm:flex-1 sm:items-end flex flex-col gap-2 ", children: props.children })
113
+ ] })
111
114
  ] });
112
115
  }
113
116
  function PageLayout(props) {
114
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
115
- /* @__PURE__ */ jsx(Separator, {}),
116
- React.Children.map(props.children, (child) => child && /* @__PURE__ */ jsxs(Fragment, { children: [
117
- child,
118
- /* @__PURE__ */ jsx(Separator, {})
119
- ] }))
120
- ] });
117
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-6", children: props.children });
121
118
  }
122
119
  function ProfilePage() {
123
120
  const { t } = useTranslation();
@@ -305,16 +302,12 @@ function EmailsSection() {
305
302
  ] });
306
303
  }
307
304
  function EmailsAndAuthPage() {
308
- const passwordSection = usePasswordSection();
309
- const mfaSection = useMfaSection();
310
- const otpSection = useOtpSection();
311
- const passkeySection = usePasskeySection();
312
305
  return /* @__PURE__ */ jsxs(PageLayout, { children: [
313
306
  /* @__PURE__ */ jsx(EmailsSection, {}),
314
- passwordSection,
315
- passkeySection,
316
- otpSection,
317
- mfaSection
307
+ /* @__PURE__ */ jsx(PasswordSection, {}),
308
+ /* @__PURE__ */ jsx(PasskeySection, {}),
309
+ /* @__PURE__ */ jsx(OtpSection, {}),
310
+ /* @__PURE__ */ jsx(MfaSection, {})
318
311
  ] });
319
312
  }
320
313
  function EmailsAndAuthPageSkeleton() {
@@ -325,7 +318,7 @@ function EmailsAndAuthPageSkeleton() {
325
318
  /* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-full mt-1" })
326
319
  ] });
327
320
  }
328
- function usePasskeySection() {
321
+ function PasskeySection() {
329
322
  const { t } = useTranslation();
330
323
  const user = useUser({ or: "throw" });
331
324
  const stackApp = useStackApp();
@@ -380,7 +373,7 @@ function usePasskeySection() {
380
373
  ] })
381
374
  ] }) }) });
382
375
  }
383
- function useOtpSection() {
376
+ function OtpSection() {
384
377
  const { t } = useTranslation();
385
378
  const user = useUser({ or: "throw" });
386
379
  const project = useStackApp().useProject();
@@ -434,14 +427,12 @@ function useOtpSection() {
434
427
  ) : /* @__PURE__ */ jsx(Typography, { variant: "secondary", type: "label", children: t("To enable OTP sign-in, please add a verified sign-in email.") }) }) });
435
428
  }
436
429
  function SettingsPage() {
437
- const deleteAccountSection = useDeleteAccountSection();
438
- const signOutSection = useSignOutSection();
439
430
  return /* @__PURE__ */ jsxs(PageLayout, { children: [
440
- deleteAccountSection,
441
- signOutSection
431
+ /* @__PURE__ */ jsx(DeleteAccountSection, {}),
432
+ /* @__PURE__ */ jsx(SignOutSection, {})
442
433
  ] });
443
434
  }
444
- function usePasswordSection() {
435
+ function PasswordSection() {
445
436
  const { t } = useTranslation();
446
437
  const user = useUser({ or: "throw" });
447
438
  const contactChannels = user.useContactChannels();
@@ -564,7 +555,7 @@ function usePasswordSection() {
564
555
  }
565
556
  );
566
557
  }
567
- function useMfaSection() {
558
+ function MfaSection() {
568
559
  const { t } = useTranslation();
569
560
  const project = useStackApp().useProject();
570
561
  const user = useUser({ or: "throw" });
@@ -658,7 +649,7 @@ async function generateTotpQrCode(project, user, secret) {
658
649
  const uri = createTOTPKeyURI(project.displayName, user.primaryEmail ?? user.id, secret);
659
650
  return await QRCode.toDataURL(uri);
660
651
  }
661
- function useSignOutSection() {
652
+ function SignOutSection() {
662
653
  const { t } = useTranslation();
663
654
  const user = useUser({ or: "throw" });
664
655
  return /* @__PURE__ */ jsx(
@@ -678,22 +669,16 @@ function useSignOutSection() {
678
669
  );
679
670
  }
680
671
  function TeamPage(props) {
681
- const teamUserProfileSection = useTeamUserProfileSection(props);
682
- const teamProfileImageSection = useTeamProfileImageSection(props);
683
- const teamDisplayNameSection = useTeamDisplayNameSection(props);
684
- const leaveTeamSection = useLeaveTeamSection(props);
685
- const memberInvitationSection = useMemberInvitationSection(props);
686
- const memberListSection = useMemberListSection(props);
687
672
  return /* @__PURE__ */ jsxs(PageLayout, { children: [
688
- teamUserProfileSection,
689
- memberListSection,
690
- memberInvitationSection,
691
- teamProfileImageSection,
692
- teamDisplayNameSection,
693
- leaveTeamSection
673
+ /* @__PURE__ */ jsx(TeamUserProfileSection, { team: props.team }),
674
+ /* @__PURE__ */ jsx(MemberListSection, { team: props.team }),
675
+ /* @__PURE__ */ jsx(MemberInvitationSection, { team: props.team }),
676
+ /* @__PURE__ */ jsx(TeamProfileImageSection, { team: props.team }),
677
+ /* @__PURE__ */ jsx(TeamDisplayNameSection, { team: props.team }),
678
+ /* @__PURE__ */ jsx(LeaveTeamSection, { team: props.team })
694
679
  ] });
695
680
  }
696
- function useLeaveTeamSection(props) {
681
+ function LeaveTeamSection(props) {
697
682
  const { t } = useTranslation();
698
683
  const user = useUser({ or: "redirect" });
699
684
  const [leaving, setLeaving] = useState(false);
@@ -736,7 +721,7 @@ function useLeaveTeamSection(props) {
736
721
  }
737
722
  );
738
723
  }
739
- function useTeamProfileImageSection(props) {
724
+ function TeamProfileImageSection(props) {
740
725
  const { t } = useTranslation();
741
726
  const user = useUser({ or: "redirect" });
742
727
  const updateTeamPermission = user.usePermission(props.team, "$update_team");
@@ -760,7 +745,7 @@ function useTeamProfileImageSection(props) {
760
745
  }
761
746
  );
762
747
  }
763
- function useTeamDisplayNameSection(props) {
748
+ function TeamDisplayNameSection(props) {
764
749
  const { t } = useTranslation();
765
750
  const user = useUser({ or: "redirect" });
766
751
  const updateTeamPermission = user.usePermission(props.team, "$update_team");
@@ -782,7 +767,7 @@ function useTeamDisplayNameSection(props) {
782
767
  }
783
768
  );
784
769
  }
785
- function useTeamUserProfileSection(props) {
770
+ function TeamUserProfileSection(props) {
786
771
  const { t } = useTranslation();
787
772
  const user = useUser({ or: "redirect" });
788
773
  const profile = user.useTeamProfile(props.team);
@@ -803,22 +788,39 @@ function useTeamUserProfileSection(props) {
803
788
  }
804
789
  );
805
790
  }
806
- function useMemberInvitationSection(props) {
807
- const { t } = useTranslation();
808
- const invitationSchema = yupObject({
809
- email: strictEmailSchema(t("Please enter a valid email address")).defined().nonEmpty(t("Please enter an email address"))
810
- });
791
+ function MemberInvitationSection(props) {
811
792
  const user = useUser({ or: "redirect" });
812
793
  const inviteMemberPermission = user.usePermission(props.team, "$invite_members");
813
- const readMemberPermission = user.usePermission(props.team, "$read_members");
814
- const removeMemberPermission = user.usePermission(props.team, "$remove_members");
815
794
  if (!inviteMemberPermission) {
816
795
  return null;
817
796
  }
818
- let invitationsToShow = [];
819
- if (readMemberPermission) {
820
- invitationsToShow = props.team.useInvitations();
821
- }
797
+ return /* @__PURE__ */ jsx(MemberInvitationSectionInner, { team: props.team });
798
+ }
799
+ function MemberInvitationsSectionInvitationsList(props) {
800
+ const user = useUser({ or: "redirect" });
801
+ const { t } = useTranslation();
802
+ const invitationsToShow = props.team.useInvitations();
803
+ const removeMemberPermission = user.usePermission(props.team, "$remove_members");
804
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Table, { className: "mt-6", children: [
805
+ /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
806
+ /* @__PURE__ */ jsx(TableHead, { className: "w-[200px]", children: t("Outstanding invitations") }),
807
+ /* @__PURE__ */ jsx(TableHead, { className: "w-[60px]", children: t("Expires") }),
808
+ /* @__PURE__ */ jsx(TableHead, { className: "w-[36px] max-w-[36px]" })
809
+ ] }) }),
810
+ /* @__PURE__ */ jsx(TableBody, { children: invitationsToShow.map((invitation, i) => /* @__PURE__ */ jsxs(TableRow, { children: [
811
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Typography, { children: invitation.recipientEmail }) }),
812
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Typography, { variant: "secondary", children: invitation.expiresAt.toLocaleString() }) }),
813
+ /* @__PURE__ */ jsx(TableCell, { align: "right", className: "max-w-[36px]", children: removeMemberPermission && /* @__PURE__ */ jsx(Button, { onClick: async () => await invitation.revoke(), size: "icon", variant: "ghost", children: /* @__PURE__ */ jsx(Trash, { className: "w-4 h-4" }) }) })
814
+ ] }, invitation.id)) })
815
+ ] }) });
816
+ }
817
+ function MemberInvitationSectionInner(props) {
818
+ const user = useUser({ or: "redirect" });
819
+ const { t } = useTranslation();
820
+ const readMemberPermission = user.usePermission(props.team, "$read_members");
821
+ const invitationSchema = yupObject({
822
+ email: strictEmailSchema(t("Please enter a valid email address")).defined().nonEmpty(t("Please enter an email address"))
823
+ });
822
824
  const { register, handleSubmit, formState: { errors }, watch } = useForm({
823
825
  resolver: yupResolver(invitationSchema)
824
826
  });
@@ -836,7 +838,7 @@ function useMemberInvitationSection(props) {
836
838
  useEffect(() => {
837
839
  setInvitedEmail(null);
838
840
  }, [watch("email")]);
839
- return /* @__PURE__ */ jsxs("div", { children: [
841
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
840
842
  /* @__PURE__ */ jsx(
841
843
  Section,
842
844
  {
@@ -869,32 +871,21 @@ function useMemberInvitationSection(props) {
869
871
  )
870
872
  }
871
873
  ),
872
- invitationsToShow.length > 0 && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Table, { className: "mt-6", children: [
873
- /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
874
- /* @__PURE__ */ jsx(TableHead, { className: "w-[200px]", children: t("Outstanding invitations") }),
875
- /* @__PURE__ */ jsx(TableHead, { className: "w-[60px]", children: t("Expires") }),
876
- /* @__PURE__ */ jsx(TableHead, { className: "w-[36px] max-w-[36px]" })
877
- ] }) }),
878
- /* @__PURE__ */ jsx(TableBody, { children: invitationsToShow.map((invitation, i) => /* @__PURE__ */ jsxs(TableRow, { children: [
879
- /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Typography, { children: invitation.recipientEmail }) }),
880
- /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Typography, { variant: "secondary", children: invitation.expiresAt.toLocaleString() }) }),
881
- /* @__PURE__ */ jsx(TableCell, { align: "right", className: "max-w-[36px]", children: removeMemberPermission && /* @__PURE__ */ jsx(Button, { onClick: async () => await invitation.revoke(), size: "icon", variant: "ghost", children: /* @__PURE__ */ jsx(Trash, { className: "w-4 h-4" }) }) })
882
- ] }, invitation.id)) })
883
- ] }) })
874
+ readMemberPermission && /* @__PURE__ */ jsx(MemberInvitationsSectionInvitationsList, { team: props.team })
884
875
  ] });
885
876
  }
886
- function useMemberListSection(props) {
887
- const { t } = useTranslation();
877
+ function MemberListSection(props) {
888
878
  const user = useUser({ or: "redirect" });
889
879
  const readMemberPermission = user.usePermission(props.team, "$read_members");
890
880
  const inviteMemberPermission = user.usePermission(props.team, "$invite_members");
891
881
  if (!readMemberPermission && !inviteMemberPermission) {
892
882
  return null;
893
883
  }
884
+ return /* @__PURE__ */ jsx(MemberListSectionInner, { team: props.team });
885
+ }
886
+ function MemberListSectionInner(props) {
887
+ const { t } = useTranslation();
894
888
  const users = props.team.useUsers();
895
- if (!readMemberPermission) {
896
- return null;
897
- }
898
889
  return /* @__PURE__ */ jsxs("div", { children: [
899
890
  /* @__PURE__ */ jsx(Typography, { className: "font-medium mb-2", children: t("Members") }),
900
891
  /* @__PURE__ */ jsx("div", { className: "border rounded-md", children: /* @__PURE__ */ jsxs(Table, { children: [
@@ -958,7 +949,7 @@ function TeamCreation() {
958
949
  }
959
950
  ) }) });
960
951
  }
961
- function useDeleteAccountSection() {
952
+ function DeleteAccountSection() {
962
953
  const { t } = useTranslation();
963
954
  const user = useUser({ or: "redirect" });
964
955
  const app = useStackApp();
@@ -1051,8 +1042,6 @@ function EditableText(props) {
1051
1042
  }
1052
1043
  export {
1053
1044
  AccountSettings,
1054
- EditableText,
1055
- TeamCreation,
1056
- useDeleteAccountSection
1045
+ EditableText
1057
1046
  };
1058
1047
  //# sourceMappingURL=account-settings.js.map