@stackframe/stack 2.6.28 → 2.6.30

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 (62) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/elements/sidebar-layout.d.mts +1 -2
  3. package/dist/components/elements/sidebar-layout.d.ts +1 -2
  4. package/dist/components/elements/sidebar-layout.js +1 -1
  5. package/dist/components/elements/sidebar-layout.js.map +1 -1
  6. package/dist/components/message-cards/known-error-message-card.js +2 -2
  7. package/dist/components/message-cards/known-error-message-card.js.map +1 -1
  8. package/dist/components/message-cards/predefined-message-card.js +5 -5
  9. package/dist/components/message-cards/predefined-message-card.js.map +1 -1
  10. package/dist/components-page/account-settings.d.mts +7 -4
  11. package/dist/components-page/account-settings.d.ts +7 -4
  12. package/dist/components-page/account-settings.js +73 -41
  13. package/dist/components-page/account-settings.js.map +1 -1
  14. package/dist/components-page/email-verification.js +3 -3
  15. package/dist/components-page/email-verification.js.map +1 -1
  16. package/dist/components-page/error-page.js +6 -6
  17. package/dist/components-page/error-page.js.map +1 -1
  18. package/dist/components-page/magic-link-callback.js +4 -4
  19. package/dist/components-page/magic-link-callback.js.map +1 -1
  20. package/dist/components-page/team-invitation.js +2 -2
  21. package/dist/components-page/team-invitation.js.map +1 -1
  22. package/dist/esm/components/elements/sidebar-layout.js +1 -1
  23. package/dist/esm/components/elements/sidebar-layout.js.map +1 -1
  24. package/dist/esm/components/message-cards/known-error-message-card.js +2 -2
  25. package/dist/esm/components/message-cards/known-error-message-card.js.map +1 -1
  26. package/dist/esm/components/message-cards/predefined-message-card.js +5 -5
  27. package/dist/esm/components/message-cards/predefined-message-card.js.map +1 -1
  28. package/dist/esm/components-page/account-settings.js +75 -43
  29. package/dist/esm/components-page/account-settings.js.map +1 -1
  30. package/dist/esm/components-page/email-verification.js +3 -3
  31. package/dist/esm/components-page/email-verification.js.map +1 -1
  32. package/dist/esm/components-page/error-page.js +6 -6
  33. package/dist/esm/components-page/error-page.js.map +1 -1
  34. package/dist/esm/components-page/magic-link-callback.js +4 -4
  35. package/dist/esm/components-page/magic-link-callback.js.map +1 -1
  36. package/dist/esm/components-page/team-invitation.js +2 -2
  37. package/dist/esm/components-page/team-invitation.js.map +1 -1
  38. package/dist/esm/generated/global-css.js +1 -1
  39. package/dist/esm/generated/global-css.js.map +1 -1
  40. package/dist/esm/generated/quetzal-translations.js +1233 -1221
  41. package/dist/esm/generated/quetzal-translations.js.map +1 -1
  42. package/dist/esm/lib/stack-app.js +50 -1
  43. package/dist/esm/lib/stack-app.js.map +1 -1
  44. package/dist/esm/providers/theme-provider.js +1 -0
  45. package/dist/esm/providers/theme-provider.js.map +1 -1
  46. package/dist/generated/global-css.d.mts +1 -1
  47. package/dist/generated/global-css.d.ts +1 -1
  48. package/dist/generated/global-css.js +1 -1
  49. package/dist/generated/global-css.js.map +1 -1
  50. package/dist/generated/quetzal-translations.d.mts +2 -2
  51. package/dist/generated/quetzal-translations.d.ts +2 -2
  52. package/dist/generated/quetzal-translations.js +1233 -1221
  53. package/dist/generated/quetzal-translations.js.map +1 -1
  54. package/dist/index.d.mts +1 -1
  55. package/dist/index.d.ts +1 -1
  56. package/dist/lib/stack-app.d.mts +9 -1
  57. package/dist/lib/stack-app.d.ts +9 -1
  58. package/dist/lib/stack-app.js +50 -1
  59. package/dist/lib/stack-app.js.map +1 -1
  60. package/dist/providers/theme-provider.js +1 -0
  61. package/dist/providers/theme-provider.js.map +1 -1
  62. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @stackframe/stack
2
2
 
3
+ ## 2.6.30
4
+
5
+ ### Patch Changes
6
+
7
+ - Bugfixes
8
+ - Updated dependencies
9
+ - @stackframe/stack-shared@2.6.30
10
+ - @stackframe/stack-ui@2.6.30
11
+ - @stackframe/stack-sc@2.6.30
12
+
13
+ ## 2.6.29
14
+
15
+ ### Patch Changes
16
+
17
+ - Bugfixes
18
+ - Updated dependencies
19
+ - @stackframe/stack-shared@2.6.29
20
+ - @stackframe/stack-ui@2.6.29
21
+ - @stackframe/stack-sc@2.6.29
22
+
3
23
  ## 2.6.28
4
24
 
5
25
  ### Patch Changes
@@ -1,5 +1,4 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { LucideIcon } from 'lucide-react';
3
2
  import React__default, { ReactNode } from 'react';
4
3
 
5
4
  type SidebarItem = {
@@ -7,7 +6,7 @@ type SidebarItem = {
7
6
  type: 'item' | 'divider';
8
7
  description?: React__default.ReactNode;
9
8
  id?: string;
10
- icon?: LucideIcon;
9
+ icon?: React__default.ReactNode;
11
10
  content?: React__default.ReactNode;
12
11
  contentTitle?: React__default.ReactNode;
13
12
  };
@@ -1,5 +1,4 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { LucideIcon } from 'lucide-react';
3
2
  import React__default, { ReactNode } from 'react';
4
3
 
5
4
  type SidebarItem = {
@@ -7,7 +6,7 @@ type SidebarItem = {
7
6
  type: 'item' | 'divider';
8
7
  description?: React__default.ReactNode;
9
8
  id?: string;
10
- icon?: LucideIcon;
9
+ icon?: React__default.ReactNode;
11
10
  content?: React__default.ReactNode;
12
11
  contentTitle?: React__default.ReactNode;
13
12
  };
@@ -62,7 +62,7 @@ function Items(props) {
62
62
  }
63
63
  },
64
64
  children: [
65
- item.icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(item.icon, { className: "mr-2 h-4 w-4" }),
65
+ item.icon,
66
66
  item.title
67
67
  ]
68
68
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/elements/sidebar-layout.tsx"],"sourcesContent":["'use client';\n\nimport { useHash } from '@stackframe/stack-shared/dist/hooks/use-hash';\nimport { Button, Typography, cn } from '@stackframe/stack-ui';\nimport { LucideIcon, XIcon } from 'lucide-react';\nimport { useRouter } from 'next/navigation';\nimport React, { ReactNode, useEffect } from 'react';\n\nexport type SidebarItem = {\n title: React.ReactNode,\n type: 'item' | 'divider',\n description?: React.ReactNode,\n id?: string,\n icon?: LucideIcon,\n content?: React.ReactNode,\n contentTitle?: React.ReactNode,\n}\n\nexport function SidebarLayout(props: { items: SidebarItem[], title?: ReactNode, className?: string }) {\n const router = useRouter();\n const hash = useHash();\n const selectedIndex = props.items.findIndex(item => item.id && (item.id === hash));\n\n useEffect(() => {\n if (selectedIndex === -1) {\n router.push('#' + props.items[0].id);\n }\n }, [hash]);\n\n return (\n <>\n <div className={cn(\"hidden sm:flex stack-scope h-full\", props.className)}>\n <DesktopLayout items={props.items} title={props.title} selectedIndex={selectedIndex} />\n </div>\n <div className={cn(\"sm:hidden stack-scope h-full\", props.className)}>\n <MobileLayout items={props.items} title={props.title} selectedIndex={selectedIndex} />\n </div>\n </>\n );\n}\n\nfunction Items(props: { items: SidebarItem[], selectedIndex: number }) {\n const router = useRouter();\n\n return props.items.map((item, index) => (\n item.type === 'item' ?\n <Button\n key={index}\n variant='ghost'\n size='sm'\n className={cn(\n props.selectedIndex === index && \"bg-muted\",\n \"justify-start text-md text-zinc-800 dark:text-zinc-300 px-2 text-left\",\n )}\n onClick={() => {\n if (item.id) {\n router.push('#' + item.id);\n }\n }}\n >\n {item.icon && <item.icon className=\"mr-2 h-4 w-4\" />}\n {item.title}\n </Button> :\n <Typography key={index}>\n {item.title}\n </Typography>\n ));\n\n}\n\nfunction DesktopLayout(props: { items: SidebarItem[], title?: ReactNode, selectedIndex: number }) {\n const selectedItem = props.items[props.selectedIndex === -1 ? 0 : props.selectedIndex];\n\n return (\n <div className=\"stack-scope flex w-full h-full max-w-full relative\">\n <div className=\"flex max-w-[200px] min-w-[200px] border-r flex-col items-stretch gap-2 p-2 overflow-y-auto\">\n {props.title && <div className='mb-2 ml-2'>\n <Typography type='h2' className=\"text-lg font-semibold text-zinc-800 dark:text-zinc-300\">{props.title}</Typography>\n </div>}\n\n <Items items={props.items} selectedIndex={props.selectedIndex} />\n </div>\n <div className=\"flex-1 w-0 flex justify-center gap-4 py-2 px-4\">\n <div className='flex flex-col max-w-[800px] w-[800px]'>\n <div className='mt-4 mb-6'>\n <Typography type='h4' className='font-semibold'>{selectedItem.title}</Typography>\n {selectedItem.description && <Typography variant='secondary' type='label'>{selectedItem.description}</Typography>}\n </div>\n <div className='flex-1'>\n {selectedItem.content}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction MobileLayout(props: { items: SidebarItem[], title?: ReactNode, selectedIndex: number }) {\n const selectedItem = props.items[props.selectedIndex];\n const router = useRouter();\n\n if (props.selectedIndex === -1) {\n return (\n <div className=\"flex flex-col gap-2 p-2\">\n {props.title && <div className='mb-2 ml-2'>\n <Typography type='h2' className=\"text-lg font-semibold text-zinc-800 dark:text-zinc-300\">{props.title}</Typography>\n </div>}\n\n <Items items={props.items} selectedIndex={props.selectedIndex} />\n </div>\n );\n } else {\n return (\n <div className=\"flex-1 flex flex-col gap-4 py-2 px-4\">\n <div className='flex flex-col'>\n <div className='flex justify-between'>\n <Typography type='h4' className='font-semibold'>{selectedItem.title}</Typography>\n <Button\n variant='ghost'\n size='icon'\n onClick={() => { router.push('#'); }}\n >\n <XIcon className='h-5 w-5' />\n </Button>\n </div>\n {selectedItem.description && <Typography variant='secondary' type='label'>{selectedItem.description}</Typography>}\n </div>\n <div className='flex-1'>\n {selectedItem.content}\n </div>\n </div>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sBAAwB;AACxB,sBAAuC;AACvC,0BAAkC;AAClC,wBAA0B;AAC1B,mBAA4C;AAwBxC;AAZG,SAAS,cAAc,OAAwE;AACpG,QAAM,aAAS,6BAAU;AACzB,QAAM,WAAO,yBAAQ;AACrB,QAAM,gBAAgB,MAAM,MAAM,UAAU,UAAQ,KAAK,MAAO,KAAK,OAAO,IAAK;AAEjF,8BAAU,MAAM;AACd,QAAI,kBAAkB,IAAI;AACxB,aAAO,KAAK,MAAM,MAAM,MAAM,CAAC,EAAE,EAAE;AAAA,IACrC;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useHash } from '@stackframe/stack-shared/dist/hooks/use-hash';\nimport { Button, Typography, cn } from '@stackframe/stack-ui';\nimport { XIcon } from 'lucide-react';\nimport { useRouter } from 'next/navigation';\nimport React, { ReactNode, useEffect } from 'react';\n\nexport type SidebarItem = {\n title: React.ReactNode,\n type: 'item' | 'divider',\n description?: React.ReactNode,\n id?: string,\n icon?: React.ReactNode,\n content?: React.ReactNode,\n contentTitle?: React.ReactNode,\n}\n\nexport function SidebarLayout(props: { items: SidebarItem[], title?: ReactNode, className?: string }) {\n const router = useRouter();\n const hash = useHash();\n const selectedIndex = props.items.findIndex(item => item.id && (item.id === hash));\n\n useEffect(() => {\n if (selectedIndex === -1) {\n router.push('#' + props.items[0].id);\n }\n }, [hash]);\n\n return (\n <>\n <div className={cn(\"hidden sm:flex stack-scope h-full\", props.className)}>\n <DesktopLayout items={props.items} title={props.title} selectedIndex={selectedIndex} />\n </div>\n <div className={cn(\"sm:hidden stack-scope h-full\", props.className)}>\n <MobileLayout items={props.items} title={props.title} selectedIndex={selectedIndex} />\n </div>\n </>\n );\n}\n\nfunction Items(props: { items: SidebarItem[], selectedIndex: number }) {\n const router = useRouter();\n\n return props.items.map((item, index) => (\n item.type === 'item' ?\n <Button\n key={index}\n variant='ghost'\n size='sm'\n className={cn(\n props.selectedIndex === index && \"bg-muted\",\n \"justify-start text-md text-zinc-800 dark:text-zinc-300 px-2 text-left\",\n )}\n onClick={() => {\n if (item.id) {\n router.push('#' + item.id);\n }\n }}\n >\n {item.icon}\n {item.title}\n </Button> :\n <Typography key={index}>\n {item.title}\n </Typography>\n ));\n\n}\n\nfunction DesktopLayout(props: { items: SidebarItem[], title?: ReactNode, selectedIndex: number }) {\n const selectedItem = props.items[props.selectedIndex === -1 ? 0 : props.selectedIndex];\n\n return (\n <div className=\"stack-scope flex w-full h-full max-w-full relative\">\n <div className=\"flex max-w-[200px] min-w-[200px] border-r flex-col items-stretch gap-2 p-2 overflow-y-auto\">\n {props.title && <div className='mb-2 ml-2'>\n <Typography type='h2' className=\"text-lg font-semibold text-zinc-800 dark:text-zinc-300\">{props.title}</Typography>\n </div>}\n\n <Items items={props.items} selectedIndex={props.selectedIndex} />\n </div>\n <div className=\"flex-1 w-0 flex justify-center gap-4 py-2 px-4\">\n <div className='flex flex-col max-w-[800px] w-[800px]'>\n <div className='mt-4 mb-6'>\n <Typography type='h4' className='font-semibold'>{selectedItem.title}</Typography>\n {selectedItem.description && <Typography variant='secondary' type='label'>{selectedItem.description}</Typography>}\n </div>\n <div className='flex-1'>\n {selectedItem.content}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction MobileLayout(props: { items: SidebarItem[], title?: ReactNode, selectedIndex: number }) {\n const selectedItem = props.items[props.selectedIndex];\n const router = useRouter();\n\n if (props.selectedIndex === -1) {\n return (\n <div className=\"flex flex-col gap-2 p-2\">\n {props.title && <div className='mb-2 ml-2'>\n <Typography type='h2' className=\"text-lg font-semibold text-zinc-800 dark:text-zinc-300\">{props.title}</Typography>\n </div>}\n\n <Items items={props.items} selectedIndex={props.selectedIndex} />\n </div>\n );\n } else {\n return (\n <div className=\"flex-1 flex flex-col gap-4 py-2 px-4\">\n <div className='flex flex-col'>\n <div className='flex justify-between'>\n <Typography type='h4' className='font-semibold'>{selectedItem.title}</Typography>\n <Button\n variant='ghost'\n size='icon'\n onClick={() => { router.push('#'); }}\n >\n <XIcon className='h-5 w-5' />\n </Button>\n </div>\n {selectedItem.description && <Typography variant='secondary' type='label'>{selectedItem.description}</Typography>}\n </div>\n <div className='flex-1'>\n {selectedItem.content}\n </div>\n </div>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sBAAwB;AACxB,sBAAuC;AACvC,0BAAsB;AACtB,wBAA0B;AAC1B,mBAA4C;AAwBxC;AAZG,SAAS,cAAc,OAAwE;AACpG,QAAM,aAAS,6BAAU;AACzB,QAAM,WAAO,yBAAQ;AACrB,QAAM,gBAAgB,MAA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Aa,SAChB;AAAA,OACF;AAAA,EAEJ;AACF;","names":[]}
@@ -25,8 +25,8 @@ __export(known_error_message_card_exports, {
25
25
  KnownErrorMessageCard: () => KnownErrorMessageCard
26
26
  });
27
27
  module.exports = __toCommonJS(known_error_message_card_exports);
28
- var import__ = require("../..");
29
28
  var import_stack_ui = require("@stackframe/stack-ui");
29
+ var import__ = require("../..");
30
30
  var import_message_card = require("./message-card");
31
31
  var import_jsx_runtime = require("react/jsx-runtime");
32
32
  function KnownErrorMessageCard({
@@ -39,7 +39,7 @@ function KnownErrorMessageCard({
39
39
  {
40
40
  title: "An error occurred",
41
41
  fullPage,
42
- primaryButtonText: "Go to Home",
42
+ primaryButtonText: "Go Home",
43
43
  primaryAction: () => stackApp.redirectToHome(),
44
44
  children: [
45
45
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.Typography, { children: [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/message-cards/known-error-message-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { useStackApp } from \"../..\";\nimport { Typography } from \"@stackframe/stack-ui\";\nimport { MessageCard } from \"./message-card\";\nimport { KnownError } from \"@stackframe/stack-shared\";\n\nexport function KnownErrorMessageCard({\n error,\n fullPage=false,\n}: {\n error: KnownError,\n fullPage?: boolean,\n}) {\n const stackApp = useStackApp();\n\n return (\n <MessageCard\n title={\"An error occurred\"}\n fullPage={fullPage}\n primaryButtonText={\"Go to Home\"}\n primaryAction={() => stackApp.redirectToHome()}\n >\n {<Typography>Error Code: {error.errorCode}</Typography>}\n {<Typography>Error Message: {error.message}</Typography>}\n </MessageCard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,eAA4B;AAC5B,sBAA2B;AAC3B,0BAA4B;AAmBrB;AAhBA,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA,WAAS;AACX,GAGG;AACD,QAAM,eAAW,sBAAY;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP;AAAA,MACA,mBAAmB;AAAA,MACnB,eAAe,MAAM,SAAS,eAAe;AAAA,MAE5C;AAAA,qDAAC,8BAAW;AAAA;AAAA,UAAa,MAAM;AAAA,WAAU;AAAA,QACzC,6CAAC,8BAAW;AAAA;AAAA,UAAgB,MAAM;AAAA,WAAQ;AAAA;AAAA;AAAA,EAC7C;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/message-cards/known-error-message-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { KnownError } from \"@stackframe/stack-shared\";\nimport { Typography } from \"@stackframe/stack-ui\";\nimport { useStackApp } from \"../..\";\nimport { MessageCard } from \"./message-card\";\n\nexport function KnownErrorMessageCard({\n error,\n fullPage=false,\n}: {\n error: KnownError,\n fullPage?: boolean,\n}) {\n const stackApp = useStackApp();\n\n return (\n <MessageCard\n title={\"An error occurred\"}\n fullPage={fullPage}\n primaryButtonText={\"Go Home\"}\n primaryAction={() => stackApp.redirectToHome()}\n >\n {<Typography>Error Code: {error.errorCode}</Typography>}\n {<Typography>Error Message: {error.message}</Typography>}\n </MessageCard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAA2B;AAC3B,eAA4B;AAC5B,0BAA4B;AAkBrB;AAhBA,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA,WAAS;AACX,GAGG;AACD,QAAM,eAAW,sBAAY;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAO;AAAA,MACP;AAAA,MACA,mBAAmB;AAAA,MACnB,eAAe,MAAM,SAAS,eAAe;AAAA,MAE5C;AAAA,qDAAC,8BAAW;AAAA;AAAA,UAAa,MAAM;AAAA,WAAU;AAAA,QACzC,6CAAC,8BAAW;AAAA;AAAA,UAAgB,MAAM;AAAA,WAAQ;AAAA;AAAA;AAAA,EAC7C;AAEJ;","names":[]}
@@ -27,8 +27,8 @@ __export(predefined_message_card_exports, {
27
27
  module.exports = __toCommonJS(predefined_message_card_exports);
28
28
  var import_stack_ui = require("@stackframe/stack-ui");
29
29
  var import__ = require("../..");
30
- var import_message_card = require("./message-card");
31
30
  var import_translations = require("../../lib/translations");
31
+ var import_message_card = require("./message-card");
32
32
  var import_jsx_runtime = require("react/jsx-runtime");
33
33
  function PredefinedMessageCard({
34
34
  type,
@@ -47,7 +47,7 @@ function PredefinedMessageCard({
47
47
  title = t("You are already signed in");
48
48
  primaryAction = () => stackApp.redirectToHome();
49
49
  secondaryAction = () => stackApp.redirectToSignOut();
50
- primaryButton = t("Go to home");
50
+ primaryButton = t("Go home");
51
51
  secondaryButton = t("Sign out");
52
52
  break;
53
53
  }
@@ -61,7 +61,7 @@ function PredefinedMessageCard({
61
61
  title = t("Sign up for new users is not enabled at the moment.");
62
62
  primaryAction = () => stackApp.redirectToHome();
63
63
  secondaryAction = () => stackApp.redirectToSignIn();
64
- primaryButton = t("Go to home");
64
+ primaryButton = t("Go home");
65
65
  secondaryButton = t("Sign in");
66
66
  break;
67
67
  }
@@ -69,7 +69,7 @@ function PredefinedMessageCard({
69
69
  title = t("Email sent!");
70
70
  message = t("If the user with this e-mail address exists, an e-mail was sent to your inbox. Make sure to check your spam folder.");
71
71
  primaryAction = () => stackApp.redirectToHome();
72
- primaryButton = t("Go to home");
72
+ primaryButton = t("Go home");
73
73
  break;
74
74
  }
75
75
  case "passwordReset": {
@@ -83,7 +83,7 @@ function PredefinedMessageCard({
83
83
  title = t("An unknown error occurred");
84
84
  message = t("Please try again and if the problem persists, contact support.");
85
85
  primaryAction = () => stackApp.redirectToHome();
86
- primaryButton = t("Go to home");
86
+ primaryButton = t("Go home");
87
87
  break;
88
88
  }
89
89
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/message-cards/predefined-message-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { Typography } from \"@stackframe/stack-ui\";\nimport { useStackApp, useUser } from \"../..\";\nimport { MessageCard } from \"./message-card\";\nimport { useTranslation } from \"../../lib/translations\";\n\nexport function PredefinedMessageCard({\n type,\n fullPage=false,\n}: {\n type: 'signedIn' | 'signedOut' | 'emailSent' | 'passwordReset' | 'unknownError' | 'signUpDisabled',\n fullPage?: boolean,\n}) {\n const stackApp = useStackApp();\n const { t } = useTranslation();\n\n let title: string;\n let message: string | null = null;\n let primaryButton: string | null = null;\n let secondaryButton: string | null = null;\n let primaryAction: (() => Promise<void> | void) | null = null;\n let secondaryAction: (() => Promise<void> | void) | null = null;\n\n switch (type) {\n case 'signedIn': {\n title = t(\"You are already signed in\");\n primaryAction = () => stackApp.redirectToHome();\n secondaryAction = () => stackApp.redirectToSignOut();\n primaryButton = t(\"Go to home\");\n secondaryButton = t(\"Sign out\");\n break;\n }\n case 'signedOut': {\n title = t(\"You are not currently signed in.\");\n primaryAction = () => stackApp.redirectToSignIn();\n primaryButton = t(\"Sign in\");\n break;\n }\n case 'signUpDisabled': {\n title = t(\"Sign up for new users is not enabled at the moment.\");\n primaryAction = () => stackApp.redirectToHome();\n secondaryAction = () => stackApp.redirectToSignIn();\n primaryButton = t(\"Go to home\");\n secondaryButton = t(\"Sign in\");\n break;\n }\n case 'emailSent': {\n title = t(\"Email sent!\");\n message = t(\"If the user with this e-mail address exists, an e-mail was sent to your inbox. Make sure to check your spam folder.\");\n primaryAction = () => stackApp.redirectToHome();\n primaryButton = t(\"Go to home\");\n break;\n }\n case 'passwordReset': {\n title = t(\"Password reset successfully!\");\n message = t(\"Your password has been reset. You can now sign in with your new password.\");\n primaryAction = () => stackApp.redirectToSignIn({ noRedirectBack: true });\n primaryButton = t(\"Sign in\");\n break;\n }\n case 'unknownError': {\n title = t(\"An unknown error occurred\");\n message = t(\"Please try again and if the problem persists, contact support.\");\n primaryAction = () => stackApp.redirectToHome();\n primaryButton = t(\"Go to home\");\n break;\n }\n }\n\n return (\n <MessageCard\n title={title}\n fullPage={fullPage}\n primaryButtonText={primaryButton}\n primaryAction={primaryAction}\n secondaryButtonText={secondaryButton || undefined}\n secondaryAction={secondaryAction || undefined}\n >\n {message && <Typography>{message}</Typography>}\n </MessageCard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sBAA2B;AAC3B,eAAqC;AACrC,0BAA4B;AAC5B,0BAA+B;AA0Eb;AAxEX,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA,WAAS;AACX,GAGG;AACD,QAAM,eAAW,sBAAY;AAC7B,QAAM,EAAE,EAAE,QAAI,oCAAe;AAE7B,MAAI;AACJ,MAAI,UAAyB;AAC7B,MAAI,gBAA+B;AACnC,MAAI,kBAAiC;AACrC,MAAI,gBAAqD;AACzD,MAAI,kBAAuD;AAE3D,UAAQ,MAAM;AAAA,IACZ,KAAK,YAAY;AACf,cAAQ,EAAE,2BAA2B;AACrC,sBAAgB,MAAM,SAAS,eAAe;AAC9C,wBAAkB,MAAM,SAAS,kBAAkB;AACnD,sBAAgB,EAAE,YAAY;AAC9B,wBAAkB,EAAE,UAAU;AAC9B;AAAA,IACF;AAAA,IACA,KAAK,aAAa;AAChB,cAAQ,EAAE,kCAAkC;AAC5C,sBAAgB,MAAM,SAAS,iBAAiB;AAChD,sBAAgB,EAAE,SAAS;AAC3B;AAAA,IACF;AAAA,IACA,KAAK,kBAAkB;AACrB,cAAQ,EAAE,qDAAqD;AAC/D,sBAAgB,MAAM,SAAS,eAAe;AAC9C,wBAAkB,MAAM,SAAS,iBAAiB;AAClD,sBAAgB,EAAE,YAAY;AAC9B,wBAAkB,EAAE,SAAS;AAC7B;AAAA,IACF;AAAA,IACA,KAAK,aAAa;AAChB,cAAQ,EAAE,aAAa;AACvB,gBAAU,EAAE,qHAAqH;AACjI,sBAAgB,MAAM,SAAS,eAAe;AAC9C,sBAAgB,EAAE,YAAY;AAC9B;AAAA,IACF;AAAA,IACA,KAAK,iBAAiB;AACpB,cAAQ,EAAE,8BAA8B;AACxC,gBAAU,EAAE,2EAA2E;AACvF,sBAAgB,MAAM,SAAS,iBAAiB,EAAE,gBAAgB,KAAK,CAAC;AACxE,sBAAgB,EAAE,SAAS;AAC3B;AAAA,IACF;AAAA,IACA,KAAK,gBAAgB;AACnB,cAAQ,EAAE,2BAA2B;AACrC,gBAAU,EAAE,gEAAgE;AAC5E,sBAAgB,MAAM,SAAS,eAAe;AAC9C,sBAAgB,EAAE,YAAY;AAC9B;AAAA,IACF;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,mBAAmB;AAAA,MACnB;AAAA,MACA,qBAAqB,mBAAmB;AAAA,MACxC,iBAAiB,mBAAmB;AAAA,MAEnC,qBAAW,4CAAC,8BAAY,mBAAQ;AAAA;AAAA,EACnC;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/message-cards/predefined-message-card.tsx"],"sourcesContent":["\"use client\";\n\nimport { Typography } from \"@stackframe/stack-ui\";\nimport { useStackApp } from \"../..\";\nimport { useTranslation } from \"../../lib/translations\";\nimport { MessageCard } from \"./message-card\";\n\nexport function PredefinedMessageCard({\n type,\n fullPage=false,\n}: {\n type: 'signedIn' | 'signedOut' | 'emailSent' | 'passwordReset' | 'unknownError' | 'signUpDisabled',\n fullPage?: boolean,\n}) {\n const stackApp = useStackApp();\n const { t } = useTranslation();\n\n let title: string;\n let message: string | null = null;\n let primaryButton: string | null = null;\n let secondaryButton: string | null = null;\n let primaryAction: (() => Promise<void> | void) | null = null;\n let secondaryAction: (() => Promise<void> | void) | null = null;\n\n switch (type) {\n case 'signedIn': {\n title = t(\"You are already signed in\");\n primaryAction = () => stackApp.redirectToHome();\n secondaryAction = () => stackApp.redirectToSignOut();\n primaryButton = t(\"Go home\");\n secondaryButton = t(\"Sign out\");\n break;\n }\n case 'signedOut': {\n title = t(\"You are not currently signed in.\");\n primaryAction = () => stackApp.redirectToSignIn();\n primaryButton = t(\"Sign in\");\n break;\n }\n case 'signUpDisabled': {\n title = t(\"Sign up for new users is not enabled at the moment.\");\n primaryAction = () => stackApp.redirectToHome();\n secondaryAction = () => stackApp.redirectToSignIn();\n primaryButton = t(\"Go home\");\n secondaryButton = t(\"Sign in\");\n break;\n }\n case 'emailSent': {\n title = t(\"Email sent!\");\n message = t(\"If the user with this e-mail address exists, an e-mail was sent to your inbox. Make sure to check your spam folder.\");\n primaryAction = () => stackApp.redirectToHome();\n primaryButton = t(\"Go home\");\n break;\n }\n case 'passwordReset': {\n title = t(\"Password reset successfully!\");\n message = t(\"Your password has been reset. You can now sign in with your new password.\");\n primaryAction = () => stackApp.redirectToSignIn({ noRedirectBack: true });\n primaryButton = t(\"Sign in\");\n break;\n }\n case 'unknownError': {\n title = t(\"An unknown error occurred\");\n message = t(\"Please try again and if the problem persists, contact support.\");\n primaryAction = () => stackApp.redirectToHome();\n primaryButton = t(\"Go home\");\n break;\n }\n }\n\n return (\n <MessageCard\n title={title}\n fullPage={fullPage}\n primaryButtonText={primaryButton}\n primaryAction={primaryAction}\n secondaryButtonText={secondaryButton || undefined}\n secondaryAction={secondaryAction || undefined}\n >\n {message && <Typography>{message}</Typography>}\n </MessageCard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,sBAA2B;AAC3B,eAA4B;AAC5B,0BAA+B;AAC/B,0BAA4B;AA0EV;AAxEX,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA,WAAS;AACX,GAGG;AACD,QAAM,eAAW,sBAAY;AAC7B,QAAM,EAAE,EAAE,QAAI,oCAAe;AAE7B,MAAI;AACJ,MAAI,UAAyB;AAC7B,MAAI,gBAA+B;AACnC,MAAI,kBAAiC;AACrC,MAAI,gBAAqD;AACzD,MAAI,kBAAuD;AAE3D,UAAQ,MAAM;AAAA,IACZ,KAAK,YAAY;AACf,cAAQ,EAAE,2BAA2B;AACrC,sBAAgB,MAAM,SAAS,eAAe;AAC9C,wBAAkB,MAAM,SAAS,kBAAkB;AACnD,sBAAgB,EAAE,SAAS;AAC3B,wBAAkB,EAAE,UAAU;AAC9B;AAAA,IACF;AAAA,IACA,KAAK,aAAa;AAChB,cAAQ,EAAE,kCAAkC;AAC5C,sBAAgB,MAAM,SAAS,iBAAiB;AAChD,sBAAgB,EAAE,SAAS;AAC3B;AAAA,IACF;AAAA,IACA,KAAK,kBAAkB;AACrB,cAAQ,EAAE,qDAAqD;AAC/D,sBAAgB,MAAM,SAAS,eAAe;AAC9C,wBAAkB,MAAM,SAAS,iBAAiB;AAClD,sBAAgB,EAAE,SAAS;AAC3B,wBAAkB,EAAE,SAAS;AAC7B;AAAA,IACF;AAAA,IACA,KAAK,aAAa;AAChB,cAAQ,EAAE,aAAa;AACvB,gBAAU,EAAE,qHAAqH;AACjI,sBAAgB,MAAM,SAAS,eAAe;AAC9C,sBAAgB,EAAE,SAAS;AAC3B;AAAA,IACF;AAAA,IACA,KAAK,iBAAiB;AACpB,cAAQ,EAAE,8BAA8B;AACxC,gBAAU,EAAE,2EAA2E;AACvF,sBAAgB,MAAM,SAAS,iBAAiB,EAAE,gBAAgB,KAAK,CAAC;AACxE,sBAAgB,EAAE,SAAS;AAC3B;AAAA,IACF;AAAA,IACA,KAAK,gBAAgB;AACnB,cAAQ,EAAE,2BAA2B;AACrC,gBAAU,EAAE,gEAAgE;AAC5E,sBAAgB,MAAM,SAAS,eAAe;AAC9C,sBAAgB,EAAE,SAAS;AAC3B;AAAA,IACF;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,mBAAmB;AAAA,MACnB;AAAA,MACA,qBAAqB,mBAAmB;AAAA,MACxC,iBAAiB,mBAAmB;AAAA,MAEnC,qBAAW,4CAAC,8BAAY,mBAAQ;AAAA;AAAA,EACnC;AAEJ;","names":[]}
@@ -1,15 +1,18 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { LucideIcon } from 'lucide-react';
2
+ import { icons } from 'lucide-react';
3
3
  import React__default from 'react';
4
4
 
5
5
  declare function AccountSettings(props: {
6
6
  fullPage?: boolean;
7
- extraItems?: {
7
+ extraItems?: ({
8
8
  title: string;
9
- icon: LucideIcon;
10
9
  content: React__default.ReactNode;
11
10
  id: string;
12
- }[];
11
+ } & ({
12
+ icon?: React__default.ReactNode;
13
+ } | {
14
+ iconName?: keyof typeof icons;
15
+ }))[];
13
16
  }): react_jsx_runtime.JSX.Element;
14
17
  declare function TeamCreation(): react_jsx_runtime.JSX.Element;
15
18
  declare function useDeleteAccountSection(): react_jsx_runtime.JSX.Element | null;
@@ -1,15 +1,18 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { LucideIcon } from 'lucide-react';
2
+ import { icons } from 'lucide-react';
3
3
  import React__default from 'react';
4
4
 
5
5
  declare function AccountSettings(props: {
6
6
  fullPage?: boolean;
7
- extraItems?: {
7
+ extraItems?: ({
8
8
  title: string;
9
- icon: LucideIcon;
10
9
  content: React__default.ReactNode;
11
10
  id: string;
12
- }[];
11
+ } & ({
12
+ icon?: React__default.ReactNode;
13
+ } | {
14
+ iconName?: keyof typeof icons;
15
+ }))[];
13
16
  }): react_jsx_runtime.JSX.Element;
14
17
  declare function TeamCreation(): react_jsx_runtime.JSX.Element;
15
18
  declare function useDeleteAccountSection(): react_jsx_runtime.JSX.Element | null;
@@ -62,6 +62,10 @@ var import_profile_image_editor = require("../components/profile-image-editor");
62
62
  var import_team_icon = require("../components/team-icon");
63
63
  var import_translations = require("../lib/translations");
64
64
  var import_jsx_runtime = require("react/jsx-runtime");
65
+ var Icon = ({ name }) => {
66
+ const LucideIcon = import_lucide_react.icons[name];
67
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LucideIcon, { className: "mr-2 h-4 w-4" });
68
+ };
65
69
  function AccountSettings(props) {
66
70
  const { t } = (0, import_translations.useTranslation)();
67
71
  const user = (0, import__.useUser)({ or: "redirect" });
@@ -76,28 +80,36 @@ function AccountSettings(props) {
76
80
  title: t("My Profile"),
77
81
  type: "item",
78
82
  id: "profile",
79
- icon: import_lucide_react.Contact,
83
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { name: "Contact" }),
80
84
  content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProfilePage, {})
81
85
  },
82
86
  {
83
87
  title: t("Emails & Auth"),
84
88
  type: "item",
85
89
  id: "auth",
86
- icon: import_lucide_react.ShieldCheck,
90
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { name: "ShieldCheck" }),
87
91
  content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmailsAndAuthPage, {})
88
92
  },
89
93
  {
90
94
  title: t("Settings"),
91
95
  type: "item",
92
96
  id: "settings",
93
- icon: import_lucide_react.Settings,
97
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { name: "Settings" }),
94
98
  content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SettingsPage, {})
95
99
  },
96
100
  ...props.extraItems?.map((item) => ({
97
101
  title: item.title,
98
102
  type: "item",
99
103
  id: item.id,
100
- icon: item.icon,
104
+ icon: (() => {
105
+ const iconName = item.iconName;
106
+ if (iconName) {
107
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { name: iconName });
108
+ } else if (item.icon) {
109
+ return item.icon;
110
+ }
111
+ return null;
112
+ })(),
101
113
  content: item.content
102
114
  })) || [],
103
115
  ...teams.length > 0 || project.config.clientTeamCreationEnabled ? [{
@@ -115,7 +127,7 @@ function AccountSettings(props) {
115
127
  })),
116
128
  ...project.config.clientTeamCreationEnabled ? [{
117
129
  title: t("Create a team"),
118
- icon: import_lucide_react.CirclePlus,
130
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { name: "CirclePlus" }),
119
131
  type: "item",
120
132
  id: "team-creation",
121
133
  content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TeamCreation, {})
@@ -200,11 +212,11 @@ function EmailsSection() {
200
212
  });
201
213
  }
202
214
  }, [contactChannels, addedEmail]);
203
- const emailSchema2 = (0, import_schema_fields.yupObject)({
215
+ const emailSchema = (0, import_schema_fields.yupObject)({
204
216
  email: (0, import_schema_fields.strictEmailSchema)(t("Please enter a valid email address")).notOneOf(contactChannels.map((x) => x.value), t("Email already exists")).defined().nonEmpty(t("Email is required"))
205
217
  });
206
218
  const { register, handleSubmit, formState: { errors }, reset } = (0, import_react_hook_form.useForm)({
207
- resolver: (0, import_yup.yupResolver)(emailSchema2)
219
+ resolver: (0, import_yup.yupResolver)(emailSchema)
208
220
  });
209
221
  const onSubmit = async (data) => {
210
222
  setAddingEmailLoading(true);
@@ -696,8 +708,8 @@ function TeamPage(props) {
696
708
  const memberListSection = useMemberListSection(props);
697
709
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PageLayout, { children: [
698
710
  teamUserProfileSection,
699
- memberInvitationSection,
700
711
  memberListSection,
712
+ memberInvitationSection,
701
713
  teamProfileImageSection,
702
714
  teamDisplayNameSection,
703
715
  leaveTeamSection
@@ -816,13 +828,19 @@ function useTeamUserProfileSection(props) {
816
828
  function useMemberInvitationSection(props) {
817
829
  const { t } = (0, import_translations.useTranslation)();
818
830
  const invitationSchema = (0, import_schema_fields.yupObject)({
819
- email: import_schema_fields.emailSchema.defined().nonEmpty(t("Please enter an email address"))
831
+ email: (0, import_schema_fields.strictEmailSchema)(t("Please enter a valid email address")).defined().nonEmpty(t("Please enter an email address"))
820
832
  });
821
833
  const user = (0, import__.useUser)({ or: "redirect" });
822
834
  const inviteMemberPermission = user.usePermission(props.team, "$invite_members");
835
+ const readMemberPermission = user.usePermission(props.team, "$read_members");
836
+ const removeMemberPermission = user.usePermission(props.team, "$remove_members");
823
837
  if (!inviteMemberPermission) {
824
838
  return null;
825
839
  }
840
+ let invitationsToShow = [];
841
+ if (readMemberPermission) {
842
+ invitationsToShow = props.team.useInvitations();
843
+ }
826
844
  const { register, handleSubmit, formState: { errors }, watch } = (0, import_react_hook_form.useForm)({
827
845
  resolver: (0, import_yup.yupResolver)(invitationSchema)
828
846
  });
@@ -840,38 +858,52 @@ function useMemberInvitationSection(props) {
840
858
  (0, import_react.useEffect)(() => {
841
859
  setInvitedEmail(null);
842
860
  }, [watch("email")]);
843
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
844
- Section,
845
- {
846
- title: t("Invite member"),
847
- description: t("Invite a user to your team through email"),
848
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
849
- "form",
850
- {
851
- onSubmit: (e) => (0, import_promises.runAsynchronouslyWithAlert)(handleSubmit(onSubmit)(e)),
852
- noValidate: true,
853
- className: "w-full",
854
- children: [
855
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-4 sm:flex-row w-full", children: [
856
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
857
- import_stack_ui.Input,
858
- {
859
- placeholder: t("Email"),
860
- ...register("email")
861
- }
862
- ),
863
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Button, { type: "submit", loading, children: t("Invite User") })
864
- ] }),
865
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form_warning.FormWarningText, { text: errors.email?.message?.toString() }),
866
- invitedEmail && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.Typography, { type: "label", variant: "secondary", children: [
867
- "Invited ",
868
- invitedEmail
869
- ] })
870
- ]
871
- }
872
- )
873
- }
874
- );
861
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
862
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
863
+ Section,
864
+ {
865
+ title: t("Invite member"),
866
+ description: t("Invite a user to your team through email"),
867
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
868
+ "form",
869
+ {
870
+ onSubmit: (e) => (0, import_promises.runAsynchronouslyWithAlert)(handleSubmit(onSubmit)(e)),
871
+ noValidate: true,
872
+ className: "w-full",
873
+ children: [
874
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-4 sm:flex-row w-full", children: [
875
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
876
+ import_stack_ui.Input,
877
+ {
878
+ placeholder: t("Email"),
879
+ ...register("email")
880
+ }
881
+ ),
882
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Button, { type: "submit", loading, children: t("Invite User") })
883
+ ] }),
884
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form_warning.FormWarningText, { text: errors.email?.message?.toString() }),
885
+ invitedEmail && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.Typography, { type: "label", variant: "secondary", children: [
886
+ "Invited ",
887
+ invitedEmail
888
+ ] })
889
+ ]
890
+ }
891
+ )
892
+ }
893
+ ),
894
+ invitationsToShow.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.Table, { className: "mt-6", children: [
895
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.TableRow, { children: [
896
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHead, { className: "w-[200px]", children: t("Outstanding invitations") }),
897
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHead, { className: "w-[60px]", children: t("Expires") }),
898
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHead, { className: "w-[36px] max-w-[36px]" })
899
+ ] }) }),
900
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableBody, { children: invitationsToShow.map((invitation, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.TableRow, { children: [
901
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Typography, { children: invitation.recipientEmail }) }),
902
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Typography, { variant: "secondary", children: invitation.expiresAt.toLocaleString() }) }),
903
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableCell, { align: "right", className: "max-w-[36px]", children: removeMemberPermission && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Button, { onClick: async () => await invitation.revoke(), size: "icon", variant: "ghost", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Trash, { className: "w-4 h-4" }) }) })
904
+ ] }, invitation.id)) })
905
+ ] }) })
906
+ ] });
875
907
  }
876
908
  function useMemberListSection(props) {
877
909
  const { t } = (0, import_translations.useTranslation)();