@gen3/frontend 0.10.83 → 0.10.85

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 (92) hide show
  1. package/dist/cjs/index.js +395 -177
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/features/Analysis/AnalysisCard.d.ts +5 -0
  4. package/dist/dts/features/Analysis/AnalysisCard.d.ts.map +1 -0
  5. package/dist/dts/features/Analysis/AnalysisCard.js +14 -0
  6. package/dist/dts/features/Analysis/AnalysisCard.js.map +1 -0
  7. package/dist/dts/features/Analysis/AnalysisCardCompact.d.ts +6 -0
  8. package/dist/dts/features/Analysis/AnalysisCardCompact.d.ts.map +1 -0
  9. package/dist/dts/features/Analysis/AnalysisCardCompact.js +12 -0
  10. package/dist/dts/features/Analysis/AnalysisCardCompact.js.map +1 -0
  11. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +32 -0
  12. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts.map +1 -0
  13. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.js +23 -0
  14. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.js.map +1 -0
  15. package/dist/dts/features/Analysis/AnalysisCardEditor.js.map +1 -1
  16. package/dist/dts/features/Analysis/AnalysisCenter.d.ts.map +1 -1
  17. package/dist/dts/features/Analysis/AnalysisCenter.js +3 -10
  18. package/dist/dts/features/Analysis/AnalysisCenter.js.map +1 -1
  19. package/dist/dts/features/Analysis/AnalysisCenterWithSections.d.ts +22 -0
  20. package/dist/dts/features/Analysis/AnalysisCenterWithSections.d.ts.map +1 -0
  21. package/dist/dts/features/Analysis/AnalysisCenterWithSections.js +53 -0
  22. package/dist/dts/features/Analysis/AnalysisCenterWithSections.js.map +1 -0
  23. package/dist/dts/features/Analysis/AnalysisCenterWithSections.stories.d.ts +13 -0
  24. package/dist/dts/features/Analysis/AnalysisCenterWithSections.stories.d.ts.map +1 -0
  25. package/dist/dts/features/Analysis/AnalysisCenterWithSections.stories.js +113 -0
  26. package/dist/dts/features/Analysis/AnalysisCenterWithSections.stories.js.map +1 -0
  27. package/dist/dts/features/Analysis/TextDescription.d.ts.map +1 -1
  28. package/dist/dts/features/Analysis/TextDescription.js +16 -2
  29. package/dist/dts/features/Analysis/TextDescription.js.map +1 -1
  30. package/dist/dts/features/Analysis/index.d.ts +3 -1
  31. package/dist/dts/features/Analysis/index.d.ts.map +1 -1
  32. package/dist/dts/features/Analysis/index.js +2 -1
  33. package/dist/dts/features/Analysis/index.js.map +1 -1
  34. package/dist/dts/features/Analysis/types.d.ts +15 -2
  35. package/dist/dts/features/Analysis/types.d.ts.map +1 -1
  36. package/dist/dts/features/Analysis/types.js +20 -1
  37. package/dist/dts/features/Analysis/types.js.map +1 -1
  38. package/dist/dts/features/Navigation/ActionMenu.d.ts +2 -2
  39. package/dist/dts/features/Navigation/ActionMenu.d.ts.map +1 -1
  40. package/dist/dts/features/Navigation/ActionMenu.js.map +1 -1
  41. package/dist/dts/features/Navigation/Header.js +1 -1
  42. package/dist/dts/features/Navigation/Header.js.map +1 -1
  43. package/dist/dts/features/Navigation/HorizontalClean/HorizontalNavigationBar.d.ts +1 -1
  44. package/dist/dts/features/Navigation/HorizontalClean/HorizontalNavigationBar.d.ts.map +1 -1
  45. package/dist/dts/features/Navigation/TopBar/AccountButton.d.ts +5 -0
  46. package/dist/dts/features/Navigation/TopBar/AccountButton.d.ts.map +1 -0
  47. package/dist/dts/features/Navigation/TopBar/AccountButton.js +78 -0
  48. package/dist/dts/features/Navigation/TopBar/AccountButton.js.map +1 -0
  49. package/dist/dts/features/Navigation/TopBar/IconButton.d.ts +11 -0
  50. package/dist/dts/features/Navigation/TopBar/IconButton.d.ts.map +1 -0
  51. package/dist/dts/features/Navigation/TopBar/IconButton.js +23 -0
  52. package/dist/dts/features/Navigation/TopBar/IconButton.js.map +1 -0
  53. package/dist/dts/features/Navigation/TopBar/IconButton.stories.d.ts +35 -0
  54. package/dist/dts/features/Navigation/TopBar/IconButton.stories.d.ts.map +1 -0
  55. package/dist/dts/features/Navigation/TopBar/IconButton.stories.js +40 -0
  56. package/dist/dts/features/Navigation/TopBar/IconButton.stories.js.map +1 -0
  57. package/dist/dts/features/Navigation/TopBar/LoginButton.d.ts +10 -0
  58. package/dist/dts/features/Navigation/TopBar/LoginButton.d.ts.map +1 -0
  59. package/dist/dts/features/Navigation/TopBar/LoginButton.js +80 -0
  60. package/dist/dts/features/Navigation/TopBar/LoginButton.js.map +1 -0
  61. package/dist/dts/features/Navigation/TopBar/TopBar.d.ts +13 -0
  62. package/dist/dts/features/Navigation/TopBar/TopBar.d.ts.map +1 -0
  63. package/dist/dts/features/Navigation/TopBar/TopBar.js +39 -0
  64. package/dist/dts/features/Navigation/TopBar/TopBar.js.map +1 -0
  65. package/dist/dts/features/Navigation/TopBar/TopBar.stories.d.ts +14 -0
  66. package/dist/dts/features/Navigation/TopBar/TopBar.stories.d.ts.map +1 -0
  67. package/dist/dts/features/Navigation/TopBar/TopBar.stories.js +44 -0
  68. package/dist/dts/features/Navigation/TopBar/TopBar.stories.js.map +1 -0
  69. package/dist/dts/features/Navigation/Vertical/VerticalTopBar.d.ts +1 -1
  70. package/dist/dts/features/Navigation/Vertical/VerticalTopBar.d.ts.map +1 -1
  71. package/dist/dts/features/Navigation/index.d.ts +1 -1
  72. package/dist/dts/features/Navigation/index.d.ts.map +1 -1
  73. package/dist/dts/features/Navigation/types.d.ts +8 -1
  74. package/dist/dts/features/Navigation/types.d.ts.map +1 -1
  75. package/dist/dts/index.d.ts +1 -1
  76. package/dist/dts/index.d.ts.map +1 -1
  77. package/dist/dts/index.js +1 -1
  78. package/dist/dts/index.js.map +1 -1
  79. package/dist/dts/pages/Analysis/Analysis.d.ts +1 -1
  80. package/dist/dts/pages/Analysis/Analysis.d.ts.map +1 -1
  81. package/dist/dts/pages/Analysis/Analysis.js +7 -4
  82. package/dist/dts/pages/Analysis/Analysis.js.map +1 -1
  83. package/dist/dts/pages/Analysis/data.d.ts.map +1 -1
  84. package/dist/dts/pages/Analysis/data.js +2 -2
  85. package/dist/dts/pages/Analysis/data.js.map +1 -1
  86. package/dist/dts/pages/Analysis/types.d.ts +4 -2
  87. package/dist/dts/pages/Analysis/types.d.ts.map +1 -1
  88. package/dist/esm/index.js +394 -177
  89. package/dist/esm/index.js.map +1 -1
  90. package/dist/index.d.ts +54 -16
  91. package/dist/tsconfig.tsbuildinfo +1 -1
  92. package/package.json +4 -4
package/dist/esm/index.js CHANGED
@@ -992,13 +992,13 @@ var LoginButtonVisibility = /*#__PURE__*/ function(LoginButtonVisibility) {
992
992
  };
993
993
  const mergeTailwindClassnameWithDefault = (userValues, defaultValues)=>userValues ? twMerge(defaultValues, userValues) : defaultValues;
994
994
 
995
- const handleSelected = async (isAuthenticated, router, referrer, endSession, externalLoginUrl)=>{
995
+ const handleSelected$1 = async (isAuthenticated, router, referrer, endSession, externalLoginUrl)=>{
996
996
  if (!isAuthenticated) await router.push(externalLoginUrl || `Login?redirect=${referrer}`);
997
997
  else {
998
998
  if (endSession) endSession();
999
999
  }
1000
1000
  };
1001
- const LoginButton = ({ icon = /*#__PURE__*/ jsx(MdLogin, {
1001
+ const LoginButton$1 = ({ icon = /*#__PURE__*/ jsx(MdLogin, {
1002
1002
  className: "pl-1",
1003
1003
  size: '1.55rem'
1004
1004
  }), hideText = false, className = undefined, tooltip, visibility, externalLoginUrl })=>{
@@ -1020,7 +1020,7 @@ const LoginButton = ({ icon = /*#__PURE__*/ jsx(MdLogin, {
1020
1020
  disabled: tooltip === undefined,
1021
1021
  classNames: TooltipStyle,
1022
1022
  children: /*#__PURE__*/ jsx(UnstyledButton, {
1023
- onClick: ()=>handleSelected(authenticated, router, pathname, endSession, externalLoginUrl),
1023
+ onClick: ()=>handleSelected$1(authenticated, router, pathname, endSession, externalLoginUrl),
1024
1024
  children: /*#__PURE__*/ jsxs("div", {
1025
1025
  className: mergedClassname,
1026
1026
  children: [
@@ -3037,27 +3037,6 @@ const Gen3Link = ({ className, href, linkType, text, showExternalIcon = false })
3037
3037
  });
3038
3038
  };
3039
3039
 
3040
- const LoginAccountButton = ({ className = undefined })=>{
3041
- const router = useRouter();
3042
- const handleSelected = async ()=>{
3043
- await router.push('Profile');
3044
- };
3045
- const userStatus = useCoreSelector((state)=>selectUserAuthStatus(state));
3046
- const userInfo = useCoreSelector((state)=>selectUserDetails(state));
3047
- const mergedClassname = mergeTailwindClassnameWithDefault(className, 'flex flex-nowrap items-center align-middle border-b-2 hover:border-accent border-transparent');
3048
- if (userStatus && isAuthenticated(userStatus)) {
3049
- return /*#__PURE__*/ jsx(UnstyledButton, {
3050
- className: "mx-2",
3051
- onClick: ()=>handleSelected(),
3052
- children: /*#__PURE__*/ jsx("div", {
3053
- className: mergedClassname,
3054
- children: userInfo?.username
3055
- })
3056
- });
3057
- }
3058
- return null;
3059
- };
3060
-
3061
3040
  const IconSize = {
3062
3041
  xs: 14,
3063
3042
  sm: 16,
@@ -3067,7 +3046,7 @@ const IconSize = {
3067
3046
  'xl-2': 36
3068
3047
  };
3069
3048
 
3070
- const TopIconButton = ({ name, leftIcon = undefined, rightIcon = undefined, iconSize = 'md', classNames = {}, drawBorder = true })=>{
3049
+ const IconButton = ({ name, leftIcon = undefined, rightIcon = undefined, iconSize = 'md', tooltip = undefined, classNames = {}, clickHandler = undefined, ariaLabel = undefined })=>{
3071
3050
  const classNamesDefaults = {
3072
3051
  root: `flex items-center align-middle px-2 my-2`,
3073
3052
  button: 'flex flex-nowrap items-center align-middle border-b-2 hover:border-accent border-transparent',
@@ -3080,53 +3059,111 @@ const TopIconButton = ({ name, leftIcon = undefined, rightIcon = undefined, icon
3080
3059
  const iconSz = IconSize[iconSize] ?? iconSize;
3081
3060
  return /*#__PURE__*/ jsx("div", {
3082
3061
  className: extractClassName('root', mergedClassnames),
3083
- "aria-label": name,
3084
- children: /*#__PURE__*/ jsxs("div", {
3085
- className: extractClassName('button', mergedClassnames),
3086
- role: "button",
3087
- children: [
3088
- leftIcon ? /*#__PURE__*/ jsx(Icon, {
3089
- icon: leftIcon,
3090
- width: iconSz,
3091
- height: iconSz,
3092
- className: extractClassName('leftIcon', mergedClassnames)
3093
- }) : null,
3094
- /*#__PURE__*/ jsxs("p", {
3095
- className: extractClassName('label', mergedClassnames),
3096
- children: [
3097
- " ",
3098
- name,
3099
- " "
3100
- ]
3101
- }),
3102
- rightIcon && rightIcon.length > 0 ? /*#__PURE__*/ jsx(Icon, {
3103
- width: iconSz,
3104
- height: iconSz,
3105
- icon: rightIcon,
3106
- className: extractClassName('rightIcon', mergedClassnames)
3107
- }) : null
3108
- ]
3062
+ children: /*#__PURE__*/ jsx(Tooltip, {
3063
+ label: tooltip,
3064
+ position: "bottom",
3065
+ withArrow: true,
3066
+ multiline: true,
3067
+ color: "base",
3068
+ disabled: tooltip === undefined,
3069
+ classNames: TooltipStyle,
3070
+ children: /*#__PURE__*/ jsxs("div", {
3071
+ className: extractClassName('button', mergedClassnames),
3072
+ role: "button",
3073
+ "aria-label": ariaLabel ?? name,
3074
+ onClick: (event)=>clickHandler && clickHandler(),
3075
+ children: [
3076
+ leftIcon ? /*#__PURE__*/ jsx(Icon, {
3077
+ icon: leftIcon,
3078
+ width: iconSz,
3079
+ height: iconSz,
3080
+ className: extractClassName('leftIcon', mergedClassnames)
3081
+ }) : null,
3082
+ /*#__PURE__*/ jsx("p", {
3083
+ className: extractClassName('label', mergedClassnames),
3084
+ children: name
3085
+ }),
3086
+ rightIcon && rightIcon.length > 0 ? /*#__PURE__*/ jsx(Icon, {
3087
+ width: iconSz,
3088
+ height: iconSz,
3089
+ icon: rightIcon,
3090
+ className: extractClassName('rightIcon', mergedClassnames)
3091
+ }) : null
3092
+ ]
3093
+ })
3109
3094
  })
3110
3095
  });
3111
3096
  };
3112
- const processTopBarItems = (items, showLogin, classNames, dividerClassname)=>{
3097
+
3098
+ const AccountButton = ({ leftIcon = undefined, rightIcon = undefined, iconSize = 'md', classNames = {}, tooltip = 'See account profile' })=>{
3099
+ const classNamesDefaults = {
3100
+ root: `flex items-center align-middle px-2 my-2`,
3101
+ button: 'flex flex-nowrap items-center align-middle border-b-2 hover:border-accent border-transparent',
3102
+ leftIcon: 'text-secondary-contrast-lighter pr-1',
3103
+ label: 'font-content text-secondary-contrast-lighter block',
3104
+ rightIcon: 'text-secondary-contrast-lighter pl-1'
3105
+ };
3106
+ const mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
3107
+ const router = useRouter();
3108
+ const handleSelected = async ()=>{
3109
+ await router.push('Profile');
3110
+ };
3111
+ const userInfo = useCoreSelector((state)=>selectUserDetails(state));
3112
+ const userStatus = useCoreSelector((state)=>selectUserAuthStatus(state));
3113
+ const authenticated = isAuthenticated(userStatus);
3114
+ if (!authenticated) return null;
3115
+ return /*#__PURE__*/ jsx(IconButton, {
3116
+ name: userInfo?.username ?? 'Profile',
3117
+ leftIcon: leftIcon,
3118
+ rightIcon: rightIcon,
3119
+ iconSize: iconSize,
3120
+ classNames: mergedClassnames,
3121
+ clickHandler: handleSelected,
3122
+ tooltip: tooltip
3123
+ });
3124
+ };
3125
+
3126
+ const handleSelected = async (isAuthenticated, router, referrer, endSession, externalLoginUrl)=>{
3127
+ if (!isAuthenticated) await router.push(externalLoginUrl || `Login?redirect=${referrer}`);
3128
+ else {
3129
+ if (endSession) endSession();
3130
+ }
3131
+ };
3132
+ const LoginButton = ({ name = 'login', leftIcon = undefined, rightIcon = undefined, tooltip = 'Login to your account', visibility, externalLoginUrl, iconSize = 'md', classNames = {} })=>{
3133
+ const router = useRouter();
3134
+ const pathname = usePathname();
3135
+ const { endSession } = useContext(SessionContext) ?? {
3136
+ endSession: undefined
3137
+ };
3138
+ const userStatus = useCoreSelector((state)=>selectUserAuthStatus(state));
3139
+ const authenticated = isAuthenticated(userStatus);
3140
+ if (visibility === LoginButtonVisibility.LogoutOnly && !authenticated) return null;
3141
+ return /*#__PURE__*/ jsx(IconButton, {
3142
+ name: authenticated ? 'Logout' : 'Login',
3143
+ leftIcon: leftIcon,
3144
+ rightIcon: authenticated ? 'gen3:logout' : 'gen3:login',
3145
+ iconSize: iconSize,
3146
+ classNames: classNames,
3147
+ clickHandler: ()=>handleSelected(authenticated, router, pathname, endSession, externalLoginUrl)
3148
+ });
3149
+ };
3150
+
3151
+ const processTopBarItems = (items, classNames, dividerClassname)=>{
3113
3152
  return items.reduce((acc, item, index)=>{
3114
- const needsBorder = !(index === items.length - 1 && !showLogin);
3115
3153
  const mergedClassnames = item?.classNames ? mergeDefaultTailwindClassnames(classNames, item.classNames) : classNames;
3116
- acc.push(/*#__PURE__*/ jsxs("a", {
3117
- className: "flex",
3118
- href: item.href,
3154
+ acc.push(/*#__PURE__*/ jsxs(Fragment, {
3119
3155
  children: [
3120
- ' ',
3121
- /*#__PURE__*/ jsx(TopIconButton, {
3122
- name: item.name,
3123
- iconSize: item.iconSize,
3124
- leftIcon: item.leftIcon,
3125
- rightIcon: item.rightIcon,
3126
- classNames: mergedClassnames,
3127
- drawBorder: needsBorder
3128
- }),
3129
- ' ',
3156
+ /*#__PURE__*/ jsx("a", {
3157
+ className: "flex",
3158
+ href: item.href,
3159
+ children: /*#__PURE__*/ jsx(IconButton, {
3160
+ name: item.name,
3161
+ iconSize: item.iconSize,
3162
+ leftIcon: item.leftIcon,
3163
+ rightIcon: item.rightIcon,
3164
+ classNames: mergedClassnames
3165
+ })
3166
+ }, `${item.href}_${item.name}`),
3130
3167
  /*#__PURE__*/ jsx(Divider, {
3131
3168
  size: "md",
3132
3169
  orientation: "vertical",
@@ -3135,7 +3172,7 @@ const processTopBarItems = (items, showLogin, classNames, dividerClassname)=>{
3135
3172
  }
3136
3173
  })
3137
3174
  ]
3138
- }, `${item.href}_${item.name}`));
3175
+ }));
3139
3176
  return acc;
3140
3177
  }, []);
3141
3178
  };
@@ -3162,29 +3199,30 @@ const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, e
3162
3199
  "aria-label": "top most navigation",
3163
3200
  className: "flex items-center align-middle",
3164
3201
  children: [
3165
- processTopBarItems(items, loginButtonVisibility === LoginButtonVisibility.Visible, mergedItemClassnames, extractClassName('divider', mergedClassnames)),
3166
- loginButtonVisibility != LoginButtonVisibility.Hidden ? /*#__PURE__*/ jsxs("div", {
3167
- className: "flex items-center",
3202
+ processTopBarItems(items, mergedItemClassnames, extractClassName('divider', mergedClassnames)),
3203
+ loginButtonVisibility != LoginButtonVisibility.Hidden ? /*#__PURE__*/ jsxs(Fragment, {
3168
3204
  children: [
3169
- /*#__PURE__*/ jsx(LoginAccountButton, {
3170
- className: extractClassName('login', mergedClassnames)
3205
+ /*#__PURE__*/ jsxs("span", {
3206
+ className: "flex items-center align-middle [&>*:only-child]:hidden",
3207
+ children: [
3208
+ /*#__PURE__*/ jsx(AccountButton, {
3209
+ classNames: mergedItemClassnames
3210
+ }),
3211
+ /*#__PURE__*/ jsx(Divider, {
3212
+ size: "md",
3213
+ classNames: {
3214
+ root: extractClassName('divider', mergedClassnames)
3215
+ },
3216
+ orientation: "vertical"
3217
+ })
3218
+ ]
3171
3219
  }),
3172
- /*#__PURE__*/ jsx(Divider, {
3173
- size: "md",
3174
- classNames: {
3175
- root: extractClassName('divider', mergedClassnames)
3176
- },
3177
- orientation: "vertical"
3220
+ /*#__PURE__*/ jsx(LoginButton, {
3221
+ visibility: loginButtonVisibility,
3222
+ externalLoginUrl: externalLoginUrl,
3223
+ classNames: mergedItemClassnames
3178
3224
  })
3179
3225
  ]
3180
- }) : null,
3181
- loginButtonVisibility != LoginButtonVisibility.Hidden ? /*#__PURE__*/ jsx("div", {
3182
- className: "flex items-center",
3183
- children: /*#__PURE__*/ jsx(LoginButton, {
3184
- visibility: loginButtonVisibility,
3185
- externalLoginUrl: externalLoginUrl,
3186
- className: extractClassName('login', mergedClassnames)
3187
- })
3188
3226
  }) : null
3189
3227
  ]
3190
3228
  })
@@ -3518,7 +3556,7 @@ const HorizontalNavigationBar = ({ actions, items, logo = undefined, loginIcon =
3518
3556
  /*#__PURE__*/ jsxs("div", {
3519
3557
  className: "flex items-center align-middle mr-3",
3520
3558
  children: [
3521
- actions.loginButtonVisibility === LoginButtonVisibility.Visible ? /*#__PURE__*/ jsx(LoginButton, {
3559
+ actions.loginButtonVisibility === LoginButtonVisibility.Visible ? /*#__PURE__*/ jsx(LoginButton$1, {
3522
3560
  icon: loginIcon,
3523
3561
  hideText: true,
3524
3562
  className: `${extractClassName('login', mergedClassnames)}`,
@@ -11896,18 +11934,35 @@ const Workspace = ({ config })=>{
11896
11934
 
11897
11935
  const TextDescription = ({ description })=>{
11898
11936
  const [extend, setExtend] = useState(false);
11937
+ const textRef = useRef(null);
11938
+ const [isClamped, setClamped] = useState(false);
11939
+ useEffect(()=>{
11940
+ // Function that should be called on window resize
11941
+ function handleResize() {
11942
+ if (textRef && textRef.current) {
11943
+ setClamped(textRef.current.scrollHeight > textRef.current.clientHeight);
11944
+ }
11945
+ }
11946
+ // Add event listener to window resize
11947
+ window.addEventListener('resize', handleResize);
11948
+ // Remove event listener on cleanup
11949
+ return ()=>window.removeEventListener('resize', handleResize);
11950
+ }, []); // Empty array ensures that it would only run on mount
11899
11951
  return /*#__PURE__*/ jsxs(Fragment, {
11900
11952
  children: [
11901
11953
  !extend ? /*#__PURE__*/ jsx(Text, {
11954
+ ref: textRef,
11955
+ size: "sm",
11902
11956
  lineClamp: 4,
11903
11957
  children: description
11904
11958
  }) : /*#__PURE__*/ jsx(Text, {
11959
+ size: "sm",
11905
11960
  children: description
11906
11961
  }),
11907
- /*#__PURE__*/ jsx("button", {
11962
+ isClamped && /*#__PURE__*/ jsx("button", {
11908
11963
  onClick: ()=>setExtend((extend)=>!extend),
11909
11964
  children: /*#__PURE__*/ jsxs("div", {
11910
- className: "flex text-xs font-semibold text-gray-400",
11965
+ className: "flex text-xs font-semibold text-base-contrast-light",
11911
11966
  children: [
11912
11967
  !extend ? 'Extend Text' : 'Collapse Text',
11913
11968
  ' ',
@@ -11922,6 +11977,90 @@ const TextDescription = ({ description })=>{
11922
11977
  });
11923
11978
  };
11924
11979
 
11980
+ const AnalysisCard = ({ title, description, type, icon, image, hasDemo, loginRequired, href })=>{
11981
+ return /*#__PURE__*/ jsx(Stack, {
11982
+ children: /*#__PURE__*/ jsxs("div", {
11983
+ className: "rounded-sm bg-base-max",
11984
+ children: [
11985
+ /*#__PURE__*/ jsx("div", {
11986
+ className: "p-0 rounded-sm",
11987
+ children: /*#__PURE__*/ jsx(Image$1, {
11988
+ component: Image,
11989
+ src: `${image}`,
11990
+ alt: `${title} image`,
11991
+ height: 1000,
11992
+ width: 1000,
11993
+ radius: "md"
11994
+ })
11995
+ }),
11996
+ /*#__PURE__*/ jsxs("div", {
11997
+ className: "flex -mt-5 relative z-10",
11998
+ children: [
11999
+ /*#__PURE__*/ jsx("div", {
12000
+ className: "p-0.5 rounded-sm bg-base-lightest ml-5 border-2 border-base",
12001
+ children: /*#__PURE__*/ jsx(Image$1, {
12002
+ component: Image,
12003
+ src: `${icon}`,
12004
+ alt: `${title} logo`,
12005
+ width: 40,
12006
+ height: 40,
12007
+ radius: "lg"
12008
+ })
12009
+ }),
12010
+ /*#__PURE__*/ jsx("div", {
12011
+ className: "relative mb-0 ml-2",
12012
+ children: /*#__PURE__*/ jsx("span", {
12013
+ className: "absolute bottom-0 left-0 text-xs text-gray-700 w-max",
12014
+ children: type === 'application' ? 'Application' : 'Jupyter Notebook'
12015
+ })
12016
+ })
12017
+ ]
12018
+ }),
12019
+ /*#__PURE__*/ jsxs("div", {
12020
+ className: "flex flex-col mt-2 ml-2",
12021
+ children: [
12022
+ /*#__PURE__*/ jsx("div", {
12023
+ className: "text-sm font-black h-6",
12024
+ children: title
12025
+ }),
12026
+ /*#__PURE__*/ jsx("div", {
12027
+ className: "text-xs text-gray-400 h-6",
12028
+ children: loginRequired ? 'Login Required' : ' '
12029
+ }),
12030
+ /*#__PURE__*/ jsx("div", {
12031
+ className: "text-sm p-2 h-fit",
12032
+ children: /*#__PURE__*/ jsx(TextDescription, {
12033
+ description: description
12034
+ })
12035
+ }),
12036
+ /*#__PURE__*/ jsx("div", {
12037
+ className: "flex mb-4 rounded-b-md",
12038
+ children: /*#__PURE__*/ jsxs("div", {
12039
+ className: "m-auto",
12040
+ children: [
12041
+ /*#__PURE__*/ jsx(NavLink, {
12042
+ component: Link,
12043
+ href: href ?? '_blank',
12044
+ classNames: {
12045
+ root: 'bg-accent text-accent-contrast hover:bg-accent-darker p-2 rounded-sm',
12046
+ label: 'text-sm font-semibold'
12047
+ },
12048
+ label: `Run ${type === 'application' ? 'App' : 'Notebook'}`
12049
+ }),
12050
+ hasDemo && /*#__PURE__*/ jsx("button", {
12051
+ className: "ml-2 p-1.5 rounded-sm text-sm font-semibold",
12052
+ children: "Demo"
12053
+ })
12054
+ ]
12055
+ })
12056
+ })
12057
+ ]
12058
+ })
12059
+ ]
12060
+ })
12061
+ }, title);
12062
+ };
12063
+
11925
12064
  const AnalysisCenter = ({ tools, showFilterAndSort = false })=>{
11926
12065
  const [cards, setCards] = useState({
11927
12066
  type: '',
@@ -11991,91 +12130,158 @@ const AnalysisCenter = ({ tools, showFilterAndSort = false })=>{
11991
12130
  children: /*#__PURE__*/ jsx("div", {
11992
12131
  className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 p-1 mx-4 overflow-y-scroll",
11993
12132
  children: tools.map(({ title, description, type, icon, image, hasDemo, loginRequired, href }, key)=>{
11994
- return /*#__PURE__*/ jsx(Stack, {
11995
- children: /*#__PURE__*/ jsxs("div", {
11996
- className: "rounded-sm bg-base-max",
12133
+ return /*#__PURE__*/ jsx(AnalysisCard, {
12134
+ title,
12135
+ description,
12136
+ type,
12137
+ icon,
12138
+ image,
12139
+ hasDemo,
12140
+ loginRequired,
12141
+ href,
12142
+ cardType: 'regular'
12143
+ }, title);
12144
+ })
12145
+ })
12146
+ })
12147
+ ]
12148
+ });
12149
+ };
12150
+
12151
+ const AnalysisCardCompact = ({ title, description, type = 'application', icon, hasDemo = false, loginRequired = false, href, count, countUnits })=>{
12152
+ return /*#__PURE__*/ jsxs(Stack, {
12153
+ gap: "xs",
12154
+ classNames: {
12155
+ root: 'rounded-lg border-3 border-contrast bg-base-max h-full'
12156
+ },
12157
+ children: [
12158
+ /*#__PURE__*/ jsx("div", {
12159
+ className: "rounded-t-lg bg-secondary border-b-4 border-accent-warm h-12"
12160
+ }),
12161
+ /*#__PURE__*/ jsx("div", {
12162
+ className: "flex relative -mt-10 z-10 p-2 max-w-90",
12163
+ children: /*#__PURE__*/ jsx("div", {
12164
+ className: "relative rounded-lg bg-base-lightest ml-5 border-4 border-base-light mx-2 w-1/4 aspect-square",
12165
+ children: /*#__PURE__*/ jsx(Image$1, {
12166
+ component: Image,
12167
+ src: `${icon}`,
12168
+ alt: `${title} logo`,
12169
+ fill: true,
12170
+ fit: "cover",
12171
+ radius: "lg"
12172
+ })
12173
+ })
12174
+ }),
12175
+ /*#__PURE__*/ jsxs("div", {
12176
+ className: "flex flex-col ml-2 px-4 pb-2 h-full justify-between",
12177
+ children: [
12178
+ /*#__PURE__*/ jsxs("div", {
12179
+ className: "flex flex-col",
12180
+ children: [
12181
+ /*#__PURE__*/ jsx(Text, {
12182
+ fw: "bold",
12183
+ classNames: {
12184
+ root: 'font-header sm:text-xl lg:text-2xl'
12185
+ },
12186
+ children: title
12187
+ }),
12188
+ /*#__PURE__*/ jsxs(Text, {
12189
+ size: "md",
12190
+ fw: "semibold",
12191
+ c: "base-contrast.5",
11997
12192
  children: [
11998
- /*#__PURE__*/ jsx("div", {
11999
- className: "p-0 rounded-sm",
12000
- children: /*#__PURE__*/ jsx(Image$1, {
12001
- component: Image,
12002
- src: `${image}`,
12003
- alt: `${title} image`,
12004
- height: 1000,
12005
- width: 1000,
12006
- radius: "md"
12007
- })
12008
- }),
12009
- /*#__PURE__*/ jsxs("div", {
12010
- className: "flex -mt-5 relative z-10",
12011
- children: [
12012
- /*#__PURE__*/ jsx("div", {
12013
- className: "p-0.5 rounded-sm bg-base-lightest ml-5 border-2 border-base",
12014
- children: /*#__PURE__*/ jsx(Image$1, {
12015
- component: Image,
12016
- src: `${icon}`,
12017
- alt: `${title} logo`,
12018
- width: 40,
12019
- height: 40,
12020
- radius: "lg"
12021
- })
12022
- }),
12023
- /*#__PURE__*/ jsx("div", {
12024
- className: "relative mb-0 ml-2",
12025
- children: /*#__PURE__*/ jsx("span", {
12026
- className: "absolute bottom-0 left-0 text-xs text-gray-700 w-max",
12027
- children: type === 'application' ? 'Application' : 'Jupyter Notebook'
12028
- })
12029
- })
12030
- ]
12031
- }),
12032
- /*#__PURE__*/ jsxs("div", {
12033
- className: "flex flex-col mt-2 ml-2",
12034
- children: [
12035
- /*#__PURE__*/ jsx("div", {
12036
- className: "text-sm font-black h-6",
12037
- children: title
12038
- }),
12039
- /*#__PURE__*/ jsx("div", {
12040
- className: "text-xs text-gray-400 h-6",
12041
- children: loginRequired ? 'Login Required' : ' '
12042
- }),
12043
- /*#__PURE__*/ jsx("div", {
12044
- className: "text-sm p-2 h-fit",
12045
- children: /*#__PURE__*/ jsx(TextDescription, {
12046
- description: description
12047
- })
12048
- }),
12049
- /*#__PURE__*/ jsx("div", {
12050
- className: "flex mb-4 rounded-b-md",
12051
- children: /*#__PURE__*/ jsxs("div", {
12052
- className: "m-auto",
12053
- children: [
12054
- /*#__PURE__*/ jsx(NavLink, {
12055
- component: Link,
12056
- href: href ?? '_blank',
12057
- classNames: {
12058
- root: 'bg-accent text-accent-contrast hover:bg-accent-darker p-2 rounded-sm',
12059
- label: 'text-sm font-semibold'
12060
- },
12061
- label: `Run ${type === 'application' ? 'App' : 'Notebook'}`
12062
- }),
12063
- hasDemo && /*#__PURE__*/ jsx("button", {
12064
- className: "ml-2 p-1.5 rounded-sm text-sm font-semibold",
12065
- children: "Demo"
12066
- })
12067
- ]
12068
- })
12069
- })
12070
- ]
12071
- })
12193
+ count?.toLocaleString(),
12194
+ " ",
12195
+ countUnits
12072
12196
  ]
12197
+ }),
12198
+ /*#__PURE__*/ jsx("div", {
12199
+ className: "py-2 min-h-24 h-full",
12200
+ children: /*#__PURE__*/ jsx(TextDescription, {
12201
+ description: description
12202
+ })
12073
12203
  })
12074
- }, key);
12204
+ ]
12205
+ }),
12206
+ /*#__PURE__*/ jsxs(Group, {
12207
+ className: "mb-4",
12208
+ children: [
12209
+ /*#__PURE__*/ jsxs(Button, {
12210
+ color: "primary.4",
12211
+ children: [
12212
+ "Run ",
12213
+ type === 'application' ? 'App' : 'Notebook'
12214
+ ]
12215
+ }),
12216
+ hasDemo && /*#__PURE__*/ jsx(Button, {
12217
+ variant: "outline",
12218
+ color: "primary.4",
12219
+ children: "Demo"
12220
+ })
12221
+ ]
12075
12222
  })
12076
- })
12223
+ ]
12077
12224
  })
12078
12225
  ]
12226
+ }, title);
12227
+ };
12228
+
12229
+ /**
12230
+ * AnalysisPanelWithSections component.
12231
+ *
12232
+ * This React functional component renders a panel that organizes tools into sections. Each section
12233
+ * includes a title, a divider, and a grid of tool cards. The component supports customizable styling
12234
+ * for global and section-specific classNames.
12235
+ *
12236
+ * @type {React.FC<AnalysisCenterWithSectionsConfiguration>}
12237
+ *
12238
+ * @param {Object} props - The component properties.
12239
+ * @param {Array} props.sections - The array of sections to display in the panel. Each section includes
12240
+ * a label, an optional classNames object for custom styling, and an array of tools.
12241
+ * @param {Object} [props.classNames] - An optional object of global classNames used for styling
12242
+ * components within the panel. These can be overridden on a per-section basis.
12243
+ *
12244
+ * @returns {ReactElement} A React element that renders the analysis panel with sections.
12245
+ */ const AnalysisCenterWithSections = ({ sections, classNames })=>{
12246
+ const rootClassNamesDefaults = {
12247
+ title: 'font-header font-bold text-2xl uppercase',
12248
+ divider: 'text-accent w-[100px] border-accent mb-4'
12249
+ };
12250
+ const mergedGlobalClassnames = mergeDefaultTailwindClassnames(rootClassNamesDefaults, classNames ?? {});
12251
+ const sectionPanels = useMemo(()=>sections.map((section)=>{
12252
+ const sectionClassnames = mergeDefaultTailwindClassnames(mergedGlobalClassnames, section.classNames ?? {});
12253
+ return /*#__PURE__*/ jsxs(Stack, {
12254
+ gap: "xs",
12255
+ children: [
12256
+ /*#__PURE__*/ jsx(Text, {
12257
+ classNames: {
12258
+ root: sectionClassnames['title']
12259
+ },
12260
+ children: section.label
12261
+ }),
12262
+ /*#__PURE__*/ jsx(Divider, {
12263
+ size: "lg",
12264
+ classNames: {
12265
+ root: sectionClassnames['divider']
12266
+ }
12267
+ }),
12268
+ /*#__PURE__*/ jsx("div", {
12269
+ className: "grid sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-4 items-stretch",
12270
+ children: section.tools.map((tool)=>{
12271
+ return /*#__PURE__*/ jsx("div", {
12272
+ children: /*#__PURE__*/ jsx(AnalysisCardCompact, {
12273
+ ...tool
12274
+ })
12275
+ }, tool.title);
12276
+ })
12277
+ })
12278
+ ]
12279
+ }, section.label);
12280
+ }), [
12281
+ sections
12282
+ ]);
12283
+ return /*#__PURE__*/ jsx(Stack, {
12284
+ children: sectionPanels
12079
12285
  });
12080
12286
  };
12081
12287
 
@@ -17601,8 +17807,8 @@ const AnalysisPanel = ({ tools })=>{
17601
17807
  });
17602
17808
  };
17603
17809
 
17604
- const AnalysisPage = ({ headerProps, footerProps, tools })=>{
17605
- return /*#__PURE__*/ jsx(NavPageLayout, {
17810
+ const AnalysisPage = ({ headerProps, footerProps, tools, sections, classNames })=>{
17811
+ return /*#__PURE__*/ jsxs(NavPageLayout, {
17606
17812
  headerProps,
17607
17813
  footerProps,
17608
17814
  headerData: {
@@ -17610,9 +17816,21 @@ const AnalysisPage = ({ headerProps, footerProps, tools })=>{
17610
17816
  content: 'Analysis Center',
17611
17817
  key: 'gen3-analysis-center'
17612
17818
  },
17613
- children: /*#__PURE__*/ jsx(AnalysisPanel, {
17614
- tools: tools
17615
- })
17819
+ children: [
17820
+ !tools && !sections && /*#__PURE__*/ jsx(Center, {
17821
+ className: "mt-20",
17822
+ children: /*#__PURE__*/ jsx(ErrorCard, {
17823
+ message: "No tools or sections found"
17824
+ })
17825
+ }),
17826
+ tools && /*#__PURE__*/ jsx(AnalysisPanel, {
17827
+ tools: tools
17828
+ }),
17829
+ sections && /*#__PURE__*/ jsx(AnalysisCenterWithSections, {
17830
+ sections: sections,
17831
+ classNames: classNames
17832
+ })
17833
+ ]
17616
17834
  });
17617
17835
  };
17618
17836
 
@@ -17626,11 +17844,10 @@ const AnalysisPageGetServerSideProps = async ()=>{
17626
17844
  }
17627
17845
  };
17628
17846
  } catch (err) {
17629
- console.error(err);
17847
+ console.warn(err);
17630
17848
  return {
17631
17849
  props: {
17632
- ...await getNavPageLayoutPropsFromConfig(),
17633
- tools: []
17850
+ ...await getNavPageLayoutPropsFromConfig()
17634
17851
  }
17635
17852
  };
17636
17853
  }
@@ -20792,5 +21009,5 @@ async function credentialsLogout(req, res) {
20792
21009
  res.redirect(307, '/');
20793
21010
  }
20794
21011
 
20795
- export { AISearchPageGetServerSideProps, ActionButton, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AnalysisCenter, AnalysisEditorPage, AnalysisEditorPageGetServerSideProps, AnalysisPage, AnalysisPageGetServerSideProps, AuthzPage, BaseModal, Charts, CohortBuilder, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, ContentSource, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom404Page, DataLibraryPage, DataLibraryPageGetServerSideProps, DictionaryPage, DictionaryPageGetServerSideProps, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DiscoveryRowRendererFactory, DropdownButton, EnumFacetChart, ErrorCard, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor$1 as GqlQueryEditor, Header, HoverLink, LandingPage, LandingPageGetStaticProps, LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MinutesToMilliseconds, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, QueryPage, QueryPageGetServerSideProps, ReactECharts, ResourcesFilters, SPECIAL_CASE_FIELDS, SessionExpiredModal, StudyGroup, SubmissionPage, SubmissionPageGetServerSideProps, TagCloud, TailwindConfig, TopBar, UploadJSONButton, User, Workspace, WorkspaceNoAccessPage, WorkspaceNoAccessPageServerSideProps, WorkspacePage, WorkspacePageGetServerSideProps, capitalize, computeRowSpan, convertMinutesToMilliseconds, convertSecondsToMilliseconds, create10ColorAccessibleContrast, create10ColorPallet, createMantineTheme, credentialsLogin, credentialsLogout, extractObjectKey, focusStyles, getCurrentUnixTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isPropertyKey, isTextTransform$1 as isTextTransform, processLabel$1 as processLabel, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, registerMetadataSchemaApp, removeKey$1 as removeKey, resourcePathFromProjectID, sessionLogout, sessionToken, stripTrailingSlash, toDisplayName, truncateString, unixTimeToString, useDiscoveryContext, userHasMethodForServiceOnResource$1 as userHasMethodForServiceOnResource };
21012
+ export { AISearchPageGetServerSideProps, ActionButton, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AnalysisCenter, AnalysisCenterWithSections, AnalysisEditorPage, AnalysisEditorPageGetServerSideProps, AnalysisPage, AnalysisPageGetServerSideProps, AuthzPage, BaseModal, Charts, CohortBuilder, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, ContentSource, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom404Page, DataLibraryPage, DataLibraryPageGetServerSideProps, DictionaryPage, DictionaryPageGetServerSideProps, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DiscoveryRowRendererFactory, DropdownButton, EnumFacetChart, ErrorCard, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor$1 as GqlQueryEditor, Header, HoverLink, LandingPage, LandingPageGetStaticProps, LoginButton$1 as LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MinutesToMilliseconds, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, QueryPage, QueryPageGetServerSideProps, ReactECharts, ResourcesFilters, SPECIAL_CASE_FIELDS, SessionExpiredModal, StudyGroup, SubmissionPage, SubmissionPageGetServerSideProps, TagCloud, TailwindConfig, TopBar, UploadJSONButton, User, Workspace, WorkspaceNoAccessPage, WorkspaceNoAccessPageServerSideProps, WorkspacePage, WorkspacePageGetServerSideProps, capitalize, computeRowSpan, convertMinutesToMilliseconds, convertSecondsToMilliseconds, create10ColorAccessibleContrast, create10ColorPallet, createMantineTheme, credentialsLogin, credentialsLogout, extractObjectKey, focusStyles, getCurrentUnixTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isPropertyKey, isTextTransform$1 as isTextTransform, processLabel$1 as processLabel, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, registerMetadataSchemaApp, removeKey$1 as removeKey, resourcePathFromProjectID, sessionLogout, sessionToken, stripTrailingSlash, toDisplayName, truncateString, unixTimeToString, useDiscoveryContext, userHasMethodForServiceOnResource$1 as userHasMethodForServiceOnResource };
20796
21013
  //# sourceMappingURL=index.js.map