@gen3/frontend 0.10.77 → 0.10.79

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 (39) hide show
  1. package/dist/cjs/index.js +54 -22
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/components/Content/TextContent.d.ts +28 -7
  4. package/dist/dts/components/Content/TextContent.d.ts.map +1 -1
  5. package/dist/dts/components/Content/TextContent.js +31 -13
  6. package/dist/dts/components/Content/TextContent.js.map +1 -1
  7. package/dist/dts/components/Login/CredentialsLogin.d.ts.map +1 -1
  8. package/dist/dts/components/Login/CredentialsLogin.js +1 -1
  9. package/dist/dts/components/Login/CredentialsLogin.js.map +1 -1
  10. package/dist/dts/components/Login/LoginButton.d.ts +2 -1
  11. package/dist/dts/components/Login/LoginButton.d.ts.map +1 -1
  12. package/dist/dts/components/Login/LoginButton.js +4 -4
  13. package/dist/dts/components/Login/LoginButton.js.map +1 -1
  14. package/dist/dts/components/Login/LoginPanel.d.ts.map +1 -1
  15. package/dist/dts/components/Login/LoginPanel.js +2 -1
  16. package/dist/dts/components/Login/LoginPanel.js.map +1 -1
  17. package/dist/dts/components/Modals/Gen3ModalsProvider.js +1 -1
  18. package/dist/dts/components/Modals/Gen3ModalsProvider.js.map +1 -1
  19. package/dist/dts/components/Modals/SessionExpiredModal.d.ts +7 -3
  20. package/dist/dts/components/Modals/SessionExpiredModal.d.ts.map +1 -1
  21. package/dist/dts/components/Modals/SessionExpiredModal.js +2 -2
  22. package/dist/dts/components/Modals/SessionExpiredModal.js.map +1 -1
  23. package/dist/dts/components/Modals/types.d.ts +4 -0
  24. package/dist/dts/components/Modals/types.d.ts.map +1 -1
  25. package/dist/dts/features/DataLibrary/tables/DatasetContentsTable.d.ts.map +1 -1
  26. package/dist/dts/features/DataLibrary/tables/DatasetContentsTable.js +1 -1
  27. package/dist/dts/features/DataLibrary/tables/DatasetContentsTable.js.map +1 -1
  28. package/dist/dts/features/Navigation/Header.d.ts.map +1 -1
  29. package/dist/dts/features/Navigation/Header.js +1 -1
  30. package/dist/dts/features/Navigation/Header.js.map +1 -1
  31. package/dist/dts/features/Navigation/TopBar.d.ts +2 -1
  32. package/dist/dts/features/Navigation/TopBar.d.ts.map +1 -1
  33. package/dist/dts/features/Navigation/TopBar.js +2 -2
  34. package/dist/dts/features/Navigation/TopBar.js.map +1 -1
  35. package/dist/esm/index.js +54 -22
  36. package/dist/esm/index.js.map +1 -1
  37. package/dist/index.d.ts +26 -11
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +3 -3
package/dist/cjs/index.js CHANGED
@@ -890,8 +890,8 @@ var LoginButtonVisibility = /*#__PURE__*/ function(LoginButtonVisibility) {
890
890
  };
891
891
  const mergeTailwindClassnameWithDefault = (userValues, defaultValues)=>userValues ? tailwindMerge.twMerge(defaultValues, userValues) : defaultValues;
892
892
 
893
- const handleSelected = async (isAuthenticated, router, referrer, endSession)=>{
894
- if (!isAuthenticated) await router.push(`Login?redirect=${referrer}`);
893
+ const handleSelected = async (isAuthenticated, router, referrer, endSession, externalLoginUrl)=>{
894
+ if (!isAuthenticated) await router.push(externalLoginUrl || `Login?redirect=${referrer}`);
895
895
  else {
896
896
  if (endSession) endSession();
897
897
  }
@@ -899,7 +899,7 @@ const handleSelected = async (isAuthenticated, router, referrer, endSession)=>{
899
899
  const LoginButton = ({ icon = /*#__PURE__*/ jsxRuntime.jsx(md.MdLogin, {
900
900
  className: "pl-1",
901
901
  size: '1.55rem'
902
- }), hideText = false, className = undefined, tooltip, visibility })=>{
902
+ }), hideText = false, className = undefined, tooltip, visibility, externalLoginUrl })=>{
903
903
  const router$1 = router.useRouter();
904
904
  const pathname = navigation.usePathname();
905
905
  const { endSession } = React.useContext(SessionContext) ?? {
@@ -918,7 +918,7 @@ const LoginButton = ({ icon = /*#__PURE__*/ jsxRuntime.jsx(md.MdLogin, {
918
918
  disabled: tooltip === undefined,
919
919
  classNames: TooltipStyle,
920
920
  children: /*#__PURE__*/ jsxRuntime.jsx(core$1.UnstyledButton, {
921
- onClick: ()=>handleSelected(authenticated, router$1, pathname, endSession),
921
+ onClick: ()=>handleSelected(authenticated, router$1, pathname, endSession, externalLoginUrl),
922
922
  children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
923
923
  className: mergedClassname,
924
924
  children: [
@@ -1126,6 +1126,7 @@ const CredentialsLogin = ({ handleLogin })=>{
1126
1126
  className: "w-1/3",
1127
1127
  label: /*#__PURE__*/ jsxRuntime.jsx(core$1.Text, {
1128
1128
  size: "md",
1129
+ c: "primary.4",
1129
1130
  children: "Authorize with credentials"
1130
1131
  }),
1131
1132
  labelPosition: "center"
@@ -1188,17 +1189,33 @@ function hashCode(str) {
1188
1189
  return hashString(str);
1189
1190
  }
1190
1191
 
1191
- var ContentType = /*#__PURE__*/ function(ContentType) {
1192
+ /**
1193
+ * Enum representing various content types for text-based data.
1194
+ *
1195
+ * Each content type corresponds to a specific format or structure of textual content.
1196
+ */ var ContentType = /*#__PURE__*/ function(ContentType) {
1192
1197
  ContentType["Text"] = "text";
1193
1198
  ContentType["TextArray"] = "textArray";
1194
1199
  ContentType["Html"] = "html";
1195
1200
  ContentType["Markdown"] = "markdown";
1196
1201
  ContentType["TextWithEmail"] = "textWithEmail";
1197
1202
  ContentType["TextWithLink"] = "textWithLink";
1198
- ContentType["Link"] = "link";
1199
1203
  return ContentType;
1200
1204
  }({});
1201
- const TextContent = ({ text, className = 'inline text-base-contrast-min font-medium margin-block-start-1 margin-block-end-1', type = "text", email = undefined, link = undefined, linkText = undefined })=>{
1205
+ /**
1206
+ * Renders textual content dynamically based on the provided type and additional properties.
1207
+ *
1208
+ * The `TextContent` function creates a user interface element conditioned on the type of input content, such as plain text, HTML, Markdown, text arrays, text with email links, or text with hyperlinks. It also provides default styling and customizable CSS class support.
1209
+ *
1210
+ * @param {Object} props - Properties for rendering the TextContent component.
1211
+ * @param {string | string[]} props.text - The content to be displayed. It can be a single string or an array of strings.
1212
+ * @param {string} [props.className='inline text-base-contrast-max font-medium margin-block-start-1 margin-block-end-1'] - Custom CSS classes to apply for styling. Defaults to a predefined inline style.
1213
+ * @param {ContentType} [props.type=ContentType.Text] - Specifies the type of content being passed. Determines how the content will be rendered.
1214
+ * @param {string} [props.email] - Optional email address to be rendered as a clickable "mailto" link when type is `ContentType.TextWithEmail`.
1215
+ * @param {string} [props.link] - Optional URL to be rendered as a clickable hyperlink when type is `ContentType.TextWithLink`.
1216
+ * @param {string} [props.linkText] - Optional link text to display instead of the raw URL when type is `ContentType.TextWithLink`.
1217
+ * @returns {JSX.Element} A JSX element that renders the content dynamically based on the input type and properties.
1218
+ */ const TextContent = ({ text, className = 'inline text-base-contrast-max font-medium margin-block-start-1 margin-block-end-1', type = "text", email = undefined, link = undefined, linkText = undefined })=>{
1202
1219
  switch(type){
1203
1220
  case "html":
1204
1221
  {
@@ -1207,7 +1224,8 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1207
1224
  className: className,
1208
1225
  dangerouslySetInnerHTML: {
1209
1226
  __html: textString
1210
- }
1227
+ },
1228
+ "aria-label": "HTML content" // Provide context for HTML rendered content
1211
1229
  });
1212
1230
  }
1213
1231
  case "textArray":
@@ -1217,8 +1235,11 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1217
1235
  ] : text;
1218
1236
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
1219
1237
  className: className,
1238
+ role: "list",
1239
+ "aria-label": "Text array",
1220
1240
  children: textArray.map((item)=>/*#__PURE__*/ jsxRuntime.jsx("p", {
1221
1241
  className: "my-2",
1242
+ role: "listitem",
1222
1243
  children: item
1223
1244
  }, hashCode(item)))
1224
1245
  });
@@ -1227,16 +1248,16 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1227
1248
  {
1228
1249
  const textString = Array.isArray(text) ? text.join('') : text;
1229
1250
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
1251
+ "aria-label": "Markdown content",
1230
1252
  children: /*#__PURE__*/ jsxRuntime.jsx(Markdown, {
1231
1253
  remarkPlugins: [
1232
1254
  remarkGfm
1233
1255
  ],
1234
1256
  components: {
1235
- // define some formatting for the ai response
1236
1257
  p (props) {
1237
1258
  const { node, ...rest } = props;
1238
1259
  return /*#__PURE__*/ jsxRuntime.jsx("p", {
1239
- className: "text-lg text-primary-contrast my-1",
1260
+ className: "text-lg my-1",
1240
1261
  ...rest
1241
1262
  });
1242
1263
  },
@@ -1268,7 +1289,7 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1268
1289
  }
1269
1290
  case "textWithEmail":
1270
1291
  {
1271
- const DEFAULT_STYLE = 'inline text-base-contrast-min font-medium margin-block-start-1 margin-block-end-1';
1292
+ const DEFAULT_STYLE = 'inline text-base-contrast-max font-medium margin-block-start-1 margin-block-end-1';
1272
1293
  const mergedClassname = className ? tailwindMerge.twMerge(DEFAULT_STYLE, className) : DEFAULT_STYLE;
1273
1294
  const textString = Array.isArray(text) ? text.join('') : text;
1274
1295
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
@@ -1281,6 +1302,7 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1281
1302
  root: mergedClassname
1282
1303
  },
1283
1304
  href: `mailto:${email}`,
1305
+ "aria-label": `Send an email to ${email}`,
1284
1306
  children: ` ${email}.`
1285
1307
  })
1286
1308
  ]
@@ -1289,13 +1311,14 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1289
1311
  }
1290
1312
  case "textWithLink":
1291
1313
  {
1292
- const DEFAULT_STYLE = 'inline text-base-contrast-min font-medium margin-block-start-1 margin-block-end-1';
1314
+ const DEFAULT_STYLE = 'inline text-base-contrast-max font-medium margin-block-start-1 margin-block-end-1';
1293
1315
  const mergedClassname = className ? tailwindMerge.twMerge(DEFAULT_STYLE, className) : DEFAULT_STYLE;
1294
1316
  const textString = Array.isArray(text) ? text.join('') : text;
1295
1317
  if (!link) {
1296
1318
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
1297
1319
  className: mergedClassname,
1298
- children: " Link is not defined."
1320
+ "aria-label": "No link defined",
1321
+ children: "Link is not defined."
1299
1322
  });
1300
1323
  }
1301
1324
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
@@ -1308,6 +1331,7 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1308
1331
  root: mergedClassname
1309
1332
  },
1310
1333
  href: link,
1334
+ "aria-label": `Visit the link: ${linkText || link}`,
1311
1335
  children: ` ${linkText ?? link}.`
1312
1336
  })
1313
1337
  ]
@@ -1318,6 +1342,7 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1318
1342
  default:
1319
1343
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
1320
1344
  className: className,
1345
+ "aria-label": "Plain text content",
1321
1346
  children: /*#__PURE__*/ jsxRuntime.jsx("p", {
1322
1347
  children: text.toString()
1323
1348
  })
@@ -1380,10 +1405,14 @@ const LoginPanel = (loginConfig)=>{
1380
1405
  loginConfig?.showCredentialsLogin && process.env.NODE_ENV === 'development' && /*#__PURE__*/ jsxRuntime.jsx(CredentialsLogin, {
1381
1406
  handleLogin: handleCredentialsLogin
1382
1407
  }),
1383
- bottomContent?.map((content, index)=>/*#__PURE__*/ React.createElement(TextContent, {
1384
- ...content,
1385
- key: `bottomContent-${index}`
1386
- }))
1408
+ /*#__PURE__*/ jsxRuntime.jsx(core$1.Center, {
1409
+ children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Stack, {
1410
+ children: bottomContent?.map((content, index)=>/*#__PURE__*/ React.createElement(TextContent, {
1411
+ ...content,
1412
+ key: `bottomContent-${index}`
1413
+ }))
1414
+ })
1415
+ })
1387
1416
  ]
1388
1417
  }),
1389
1418
  /*#__PURE__*/ jsxRuntime.jsx(TexturedSidePanel, {
@@ -1548,10 +1577,10 @@ const FirstTimeModal = ({ openModal, config })=>{
1548
1577
  });
1549
1578
  };
1550
1579
 
1551
- const SessionExpiredModal = ({ openModal })=>{
1580
+ const SessionExpiredModal = ({ openModal, config })=>{
1552
1581
  const router$1 = router.useRouter();
1553
1582
  const onLogout = React.useCallback(()=>{
1554
- router$1.push('/Login');
1583
+ router$1.push(config?.externalLoginUrl || '/Login');
1555
1584
  }, [
1556
1585
  router$1
1557
1586
  ]);
@@ -1726,7 +1755,8 @@ const getModal = (modal, config)=>{
1726
1755
  case core.Modals.SessionExpireModal:
1727
1756
  {
1728
1757
  res = /*#__PURE__*/ jsxRuntime.jsx(SessionExpiredModal, {
1729
- openModal: true
1758
+ openModal: true,
1759
+ config: config.sessionExpiredModal
1730
1760
  });
1731
1761
  break;
1732
1762
  }
@@ -2974,7 +3004,7 @@ const processTopBarItems = (items, showLogin)=>{
2974
3004
  return acc;
2975
3005
  }, []);
2976
3006
  };
2977
- const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, classNames = {} })=>{
3007
+ const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, externalLoginUrl, classNames = {} })=>{
2978
3008
  const classNamesDefaults = {
2979
3009
  root: 'flex justify-end items-center align-middle w-100 bg-secondary-lighter',
2980
3010
  login: 'font-content hover:border-accent'
@@ -3006,6 +3036,7 @@ const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, c
3006
3036
  className: "flex items-center",
3007
3037
  children: /*#__PURE__*/ jsxRuntime.jsx(LoginButton, {
3008
3038
  visibility: loginButtonVisibility,
3039
+ externalLoginUrl: externalLoginUrl,
3009
3040
  className: extractClassName('login', mergedClassnames)
3010
3041
  })
3011
3042
  }) : null
@@ -3404,6 +3435,7 @@ const HorizontalNavigationBar = ({ actions, items, logo = undefined, loginIcon =
3404
3435
  /*#__PURE__*/ jsxRuntime.jsx(TopBar, {
3405
3436
  items: top.items,
3406
3437
  loginButtonVisibility: top?.loginButtonVisibility,
3438
+ externalLoginUrl: top?.externalLoginUrl,
3407
3439
  classNames: {
3408
3440
  ...top.classNames
3409
3441
  }
@@ -19230,7 +19262,7 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
19230
19262
  listId: listId,
19231
19263
  data: rowData?.files
19232
19264
  }),
19233
- rowData.additionalData.length > 0 && /*#__PURE__*/ jsxRuntime.jsx(AdditionalDataTableTable, {
19265
+ rowData?.additionalData.length > 0 && /*#__PURE__*/ jsxRuntime.jsx(AdditionalDataTableTable, {
19234
19266
  header: 'Additional Data',
19235
19267
  data: rowData?.additionalData
19236
19268
  }),