@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/esm/index.js CHANGED
@@ -870,8 +870,8 @@ var LoginButtonVisibility = /*#__PURE__*/ function(LoginButtonVisibility) {
870
870
  };
871
871
  const mergeTailwindClassnameWithDefault = (userValues, defaultValues)=>userValues ? twMerge(defaultValues, userValues) : defaultValues;
872
872
 
873
- const handleSelected = async (isAuthenticated, router, referrer, endSession)=>{
874
- if (!isAuthenticated) await router.push(`Login?redirect=${referrer}`);
873
+ const handleSelected = async (isAuthenticated, router, referrer, endSession, externalLoginUrl)=>{
874
+ if (!isAuthenticated) await router.push(externalLoginUrl || `Login?redirect=${referrer}`);
875
875
  else {
876
876
  if (endSession) endSession();
877
877
  }
@@ -879,7 +879,7 @@ const handleSelected = async (isAuthenticated, router, referrer, endSession)=>{
879
879
  const LoginButton = ({ icon = /*#__PURE__*/ jsx(MdLogin, {
880
880
  className: "pl-1",
881
881
  size: '1.55rem'
882
- }), hideText = false, className = undefined, tooltip, visibility })=>{
882
+ }), hideText = false, className = undefined, tooltip, visibility, externalLoginUrl })=>{
883
883
  const router = useRouter();
884
884
  const pathname = usePathname();
885
885
  const { endSession } = useContext(SessionContext) ?? {
@@ -898,7 +898,7 @@ const LoginButton = ({ icon = /*#__PURE__*/ jsx(MdLogin, {
898
898
  disabled: tooltip === undefined,
899
899
  classNames: TooltipStyle,
900
900
  children: /*#__PURE__*/ jsx(UnstyledButton, {
901
- onClick: ()=>handleSelected(authenticated, router, pathname, endSession),
901
+ onClick: ()=>handleSelected(authenticated, router, pathname, endSession, externalLoginUrl),
902
902
  children: /*#__PURE__*/ jsxs("div", {
903
903
  className: mergedClassname,
904
904
  children: [
@@ -1106,6 +1106,7 @@ const CredentialsLogin = ({ handleLogin })=>{
1106
1106
  className: "w-1/3",
1107
1107
  label: /*#__PURE__*/ jsx(Text, {
1108
1108
  size: "md",
1109
+ c: "primary.4",
1109
1110
  children: "Authorize with credentials"
1110
1111
  }),
1111
1112
  labelPosition: "center"
@@ -1168,17 +1169,33 @@ function hashCode(str) {
1168
1169
  return hashString(str);
1169
1170
  }
1170
1171
 
1171
- var ContentType = /*#__PURE__*/ function(ContentType) {
1172
+ /**
1173
+ * Enum representing various content types for text-based data.
1174
+ *
1175
+ * Each content type corresponds to a specific format or structure of textual content.
1176
+ */ var ContentType = /*#__PURE__*/ function(ContentType) {
1172
1177
  ContentType["Text"] = "text";
1173
1178
  ContentType["TextArray"] = "textArray";
1174
1179
  ContentType["Html"] = "html";
1175
1180
  ContentType["Markdown"] = "markdown";
1176
1181
  ContentType["TextWithEmail"] = "textWithEmail";
1177
1182
  ContentType["TextWithLink"] = "textWithLink";
1178
- ContentType["Link"] = "link";
1179
1183
  return ContentType;
1180
1184
  }({});
1181
- 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 })=>{
1185
+ /**
1186
+ * Renders textual content dynamically based on the provided type and additional properties.
1187
+ *
1188
+ * 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.
1189
+ *
1190
+ * @param {Object} props - Properties for rendering the TextContent component.
1191
+ * @param {string | string[]} props.text - The content to be displayed. It can be a single string or an array of strings.
1192
+ * @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.
1193
+ * @param {ContentType} [props.type=ContentType.Text] - Specifies the type of content being passed. Determines how the content will be rendered.
1194
+ * @param {string} [props.email] - Optional email address to be rendered as a clickable "mailto" link when type is `ContentType.TextWithEmail`.
1195
+ * @param {string} [props.link] - Optional URL to be rendered as a clickable hyperlink when type is `ContentType.TextWithLink`.
1196
+ * @param {string} [props.linkText] - Optional link text to display instead of the raw URL when type is `ContentType.TextWithLink`.
1197
+ * @returns {JSX.Element} A JSX element that renders the content dynamically based on the input type and properties.
1198
+ */ 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 })=>{
1182
1199
  switch(type){
1183
1200
  case "html":
1184
1201
  {
@@ -1187,7 +1204,8 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1187
1204
  className: className,
1188
1205
  dangerouslySetInnerHTML: {
1189
1206
  __html: textString
1190
- }
1207
+ },
1208
+ "aria-label": "HTML content" // Provide context for HTML rendered content
1191
1209
  });
1192
1210
  }
1193
1211
  case "textArray":
@@ -1197,8 +1215,11 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1197
1215
  ] : text;
1198
1216
  return /*#__PURE__*/ jsx("div", {
1199
1217
  className: className,
1218
+ role: "list",
1219
+ "aria-label": "Text array",
1200
1220
  children: textArray.map((item)=>/*#__PURE__*/ jsx("p", {
1201
1221
  className: "my-2",
1222
+ role: "listitem",
1202
1223
  children: item
1203
1224
  }, hashCode(item)))
1204
1225
  });
@@ -1207,16 +1228,16 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1207
1228
  {
1208
1229
  const textString = Array.isArray(text) ? text.join('') : text;
1209
1230
  return /*#__PURE__*/ jsx("div", {
1231
+ "aria-label": "Markdown content",
1210
1232
  children: /*#__PURE__*/ jsx(Markdown, {
1211
1233
  remarkPlugins: [
1212
1234
  remarkGfm
1213
1235
  ],
1214
1236
  components: {
1215
- // define some formatting for the ai response
1216
1237
  p (props) {
1217
1238
  const { node, ...rest } = props;
1218
1239
  return /*#__PURE__*/ jsx("p", {
1219
- className: "text-lg text-primary-contrast my-1",
1240
+ className: "text-lg my-1",
1220
1241
  ...rest
1221
1242
  });
1222
1243
  },
@@ -1248,7 +1269,7 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1248
1269
  }
1249
1270
  case "textWithEmail":
1250
1271
  {
1251
- const DEFAULT_STYLE = 'inline text-base-contrast-min font-medium margin-block-start-1 margin-block-end-1';
1272
+ const DEFAULT_STYLE = 'inline text-base-contrast-max font-medium margin-block-start-1 margin-block-end-1';
1252
1273
  const mergedClassname = className ? twMerge(DEFAULT_STYLE, className) : DEFAULT_STYLE;
1253
1274
  const textString = Array.isArray(text) ? text.join('') : text;
1254
1275
  return /*#__PURE__*/ jsx("div", {
@@ -1261,6 +1282,7 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1261
1282
  root: mergedClassname
1262
1283
  },
1263
1284
  href: `mailto:${email}`,
1285
+ "aria-label": `Send an email to ${email}`,
1264
1286
  children: ` ${email}.`
1265
1287
  })
1266
1288
  ]
@@ -1269,13 +1291,14 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1269
1291
  }
1270
1292
  case "textWithLink":
1271
1293
  {
1272
- const DEFAULT_STYLE = 'inline text-base-contrast-min font-medium margin-block-start-1 margin-block-end-1';
1294
+ const DEFAULT_STYLE = 'inline text-base-contrast-max font-medium margin-block-start-1 margin-block-end-1';
1273
1295
  const mergedClassname = className ? twMerge(DEFAULT_STYLE, className) : DEFAULT_STYLE;
1274
1296
  const textString = Array.isArray(text) ? text.join('') : text;
1275
1297
  if (!link) {
1276
1298
  return /*#__PURE__*/ jsx("div", {
1277
1299
  className: mergedClassname,
1278
- children: " Link is not defined."
1300
+ "aria-label": "No link defined",
1301
+ children: "Link is not defined."
1279
1302
  });
1280
1303
  }
1281
1304
  return /*#__PURE__*/ jsx("div", {
@@ -1288,6 +1311,7 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1288
1311
  root: mergedClassname
1289
1312
  },
1290
1313
  href: link,
1314
+ "aria-label": `Visit the link: ${linkText || link}`,
1291
1315
  children: ` ${linkText ?? link}.`
1292
1316
  })
1293
1317
  ]
@@ -1298,6 +1322,7 @@ const TextContent = ({ text, className = 'inline text-base-contrast-min font-med
1298
1322
  default:
1299
1323
  return /*#__PURE__*/ jsx("div", {
1300
1324
  className: className,
1325
+ "aria-label": "Plain text content",
1301
1326
  children: /*#__PURE__*/ jsx("p", {
1302
1327
  children: text.toString()
1303
1328
  })
@@ -1360,10 +1385,14 @@ const LoginPanel = (loginConfig)=>{
1360
1385
  loginConfig?.showCredentialsLogin && process.env.NODE_ENV === 'development' && /*#__PURE__*/ jsx(CredentialsLogin, {
1361
1386
  handleLogin: handleCredentialsLogin
1362
1387
  }),
1363
- bottomContent?.map((content, index)=>/*#__PURE__*/ createElement(TextContent, {
1364
- ...content,
1365
- key: `bottomContent-${index}`
1366
- }))
1388
+ /*#__PURE__*/ jsx(Center, {
1389
+ children: /*#__PURE__*/ jsx(Stack, {
1390
+ children: bottomContent?.map((content, index)=>/*#__PURE__*/ createElement(TextContent, {
1391
+ ...content,
1392
+ key: `bottomContent-${index}`
1393
+ }))
1394
+ })
1395
+ })
1367
1396
  ]
1368
1397
  }),
1369
1398
  /*#__PURE__*/ jsx(TexturedSidePanel, {
@@ -1528,10 +1557,10 @@ const FirstTimeModal = ({ openModal, config })=>{
1528
1557
  });
1529
1558
  };
1530
1559
 
1531
- const SessionExpiredModal = ({ openModal })=>{
1560
+ const SessionExpiredModal = ({ openModal, config })=>{
1532
1561
  const router = useRouter();
1533
1562
  const onLogout = useCallback(()=>{
1534
- router.push('/Login');
1563
+ router.push(config?.externalLoginUrl || '/Login');
1535
1564
  }, [
1536
1565
  router
1537
1566
  ]);
@@ -1706,7 +1735,8 @@ const getModal = (modal, config)=>{
1706
1735
  case Modals.SessionExpireModal:
1707
1736
  {
1708
1737
  res = /*#__PURE__*/ jsx(SessionExpiredModal, {
1709
- openModal: true
1738
+ openModal: true,
1739
+ config: config.sessionExpiredModal
1710
1740
  });
1711
1741
  break;
1712
1742
  }
@@ -2954,7 +2984,7 @@ const processTopBarItems = (items, showLogin)=>{
2954
2984
  return acc;
2955
2985
  }, []);
2956
2986
  };
2957
- const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, classNames = {} })=>{
2987
+ const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, externalLoginUrl, classNames = {} })=>{
2958
2988
  const classNamesDefaults = {
2959
2989
  root: 'flex justify-end items-center align-middle w-100 bg-secondary-lighter',
2960
2990
  login: 'font-content hover:border-accent'
@@ -2986,6 +3016,7 @@ const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, c
2986
3016
  className: "flex items-center",
2987
3017
  children: /*#__PURE__*/ jsx(LoginButton, {
2988
3018
  visibility: loginButtonVisibility,
3019
+ externalLoginUrl: externalLoginUrl,
2989
3020
  className: extractClassName('login', mergedClassnames)
2990
3021
  })
2991
3022
  }) : null
@@ -3384,6 +3415,7 @@ const HorizontalNavigationBar = ({ actions, items, logo = undefined, loginIcon =
3384
3415
  /*#__PURE__*/ jsx(TopBar, {
3385
3416
  items: top.items,
3386
3417
  loginButtonVisibility: top?.loginButtonVisibility,
3418
+ externalLoginUrl: top?.externalLoginUrl,
3387
3419
  classNames: {
3388
3420
  ...top.classNames
3389
3421
  }
@@ -19210,7 +19242,7 @@ const DataSetContentsTable = ({ listId, data, removeList, size = 'sm' })=>{
19210
19242
  listId: listId,
19211
19243
  data: rowData?.files
19212
19244
  }),
19213
- rowData.additionalData.length > 0 && /*#__PURE__*/ jsx(AdditionalDataTableTable, {
19245
+ rowData?.additionalData.length > 0 && /*#__PURE__*/ jsx(AdditionalDataTableTable, {
19214
19246
  header: 'Additional Data',
19215
19247
  data: rowData?.additionalData
19216
19248
  }),