@gen3/frontend 0.10.44 → 0.10.46

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 (183) hide show
  1. package/dist/cjs/index.js +435 -214
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/api/auth/credentialsLogin.js +2 -2
  4. package/dist/dts/api/auth/credentialsLogout.js +2 -2
  5. package/dist/dts/api/auth/sessionLogout.js +2 -2
  6. package/dist/dts/api/auth/sessionToken.js +2 -2
  7. package/dist/dts/components/Buttons/DownloadButtons/DownloadButton.d.ts.map +1 -1
  8. package/dist/dts/components/Buttons/DownloadButtons/DownloadButton.js +6 -2
  9. package/dist/dts/components/Buttons/DownloadButtons/DownloadButton.js.map +1 -1
  10. package/dist/dts/components/Details/DetailsModal.d.ts +1 -1
  11. package/dist/dts/components/Details/DetailsModal.d.ts.map +1 -1
  12. package/dist/dts/components/Details/DetailsModal.js +5 -4
  13. package/dist/dts/components/Details/DetailsModal.js.map +1 -1
  14. package/dist/dts/components/Details/types.d.ts +3 -0
  15. package/dist/dts/components/Details/types.d.ts.map +1 -1
  16. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.js +2 -1
  17. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.js.map +1 -1
  18. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.unit.test.js +2 -2
  19. package/dist/dts/components/Login/CredentialsLogin.js +2 -2
  20. package/dist/dts/components/Login/LoginAccountButton.js +2 -2
  21. package/dist/dts/components/Login/LoginButton.js +4 -3
  22. package/dist/dts/components/Login/LoginButton.js.map +1 -1
  23. package/dist/dts/components/Login/LoginPanel.js +2 -2
  24. package/dist/dts/components/Modals/FirstTimeModal.d.ts.map +1 -1
  25. package/dist/dts/components/Modals/FirstTimeModal.js +5 -3
  26. package/dist/dts/components/Modals/FirstTimeModal.js.map +1 -1
  27. package/dist/dts/components/Modals/Gen3ModalsProvider.js +2 -1
  28. package/dist/dts/components/Modals/Gen3ModalsProvider.js.map +1 -1
  29. package/dist/dts/components/Profile/Credentials.js +2 -2
  30. package/dist/dts/components/Profile/ExternalProviderCard.js +2 -2
  31. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/ExplorerTableDetailsPanelFactory.d.ts.map +1 -1
  32. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/ExplorerTableDetailsPanelFactory.js +4 -2
  33. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/ExplorerTableDetailsPanelFactory.js.map +1 -1
  34. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/QueryRowDetailsPanel.d.ts +4 -0
  35. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/QueryRowDetailsPanel.d.ts.map +1 -0
  36. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/{TableDetailsPanel.js → QueryRowDetailsPanel.js} +5 -5
  37. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/QueryRowDetailsPanel.js.map +1 -0
  38. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/RowTableDetailsPanel.d.ts +4 -0
  39. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/RowTableDetailsPanel.d.ts.map +1 -0
  40. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/RowTableDetailsPanel.js +14 -0
  41. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/RowTableDetailsPanel.js.map +1 -0
  42. package/dist/dts/features/CohortBuilder/ExplorerTable/ExplorerTable.d.ts.map +1 -1
  43. package/dist/dts/features/CohortBuilder/ExplorerTable/ExplorerTable.js +10 -8
  44. package/dist/dts/features/CohortBuilder/ExplorerTable/ExplorerTable.js.map +1 -1
  45. package/dist/dts/features/CohortBuilder/downloads/CohortDropdownActionButton.js +2 -1
  46. package/dist/dts/features/CohortBuilder/downloads/CohortDropdownActionButton.js.map +1 -1
  47. package/dist/dts/features/CohortBuilder/downloads/actions/downloadManifest.js +10 -6
  48. package/dist/dts/features/CohortBuilder/downloads/actions/downloadManifest.js.map +1 -1
  49. package/dist/dts/features/CohortBuilder/downloads/actions/downloadToFile.js +8 -5
  50. package/dist/dts/features/CohortBuilder/downloads/actions/downloadToFile.js.map +1 -1
  51. package/dist/dts/features/CohortBuilder/downloads/actions/registeredActions.js +2 -1
  52. package/dist/dts/features/CohortBuilder/downloads/actions/registeredActions.js.map +1 -1
  53. package/dist/dts/features/CohortBuilder/downloads/actions/tests/downloadManifest.unit.test.js +2 -2
  54. package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.d.ts.map +1 -1
  55. package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.js +11 -7
  56. package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.js.map +1 -1
  57. package/dist/dts/features/Discovery/DiscoveryTable.d.ts +1 -2
  58. package/dist/dts/features/Discovery/DiscoveryTable.d.ts.map +1 -1
  59. package/dist/dts/features/Navigation/Banner.d.ts +9 -0
  60. package/dist/dts/features/Navigation/Banner.d.ts.map +1 -0
  61. package/dist/dts/features/Navigation/Banner.js +54 -0
  62. package/dist/dts/features/Navigation/Banner.js.map +1 -0
  63. package/dist/dts/features/Navigation/Footer/Footer.d.ts +4 -0
  64. package/dist/dts/features/Navigation/Footer/Footer.d.ts.map +1 -0
  65. package/dist/dts/features/Navigation/Footer/Footer.js +26 -0
  66. package/dist/dts/features/Navigation/Footer/Footer.js.map +1 -0
  67. package/dist/dts/features/Navigation/Footer/FooterColumn.d.ts +5 -0
  68. package/dist/dts/features/Navigation/Footer/FooterColumn.d.ts.map +1 -0
  69. package/dist/dts/features/Navigation/Footer/FooterColumn.js +72 -0
  70. package/dist/dts/features/Navigation/Footer/FooterColumn.js.map +1 -0
  71. package/dist/dts/features/Navigation/Footer/types.d.ts +63 -0
  72. package/dist/dts/features/Navigation/Footer/types.d.ts.map +1 -0
  73. package/dist/dts/features/Navigation/Footer/types.js +2 -0
  74. package/dist/dts/features/Navigation/Footer/types.js.map +1 -0
  75. package/dist/dts/features/Navigation/Header.d.ts +1 -1
  76. package/dist/dts/features/Navigation/Header.d.ts.map +1 -1
  77. package/dist/dts/features/Navigation/Header.js +4 -2
  78. package/dist/dts/features/Navigation/Header.js.map +1 -1
  79. package/dist/dts/features/Navigation/NavPageLayout.d.ts +4 -3
  80. package/dist/dts/features/Navigation/NavPageLayout.d.ts.map +1 -1
  81. package/dist/dts/features/Navigation/NavPageLayout.js +1 -1
  82. package/dist/dts/features/Navigation/NavPageLayout.js.map +1 -1
  83. package/dist/dts/features/Navigation/NavigationBar.d.ts +3 -2
  84. package/dist/dts/features/Navigation/NavigationBar.d.ts.map +1 -1
  85. package/dist/dts/features/Navigation/NavigationBar.js +8 -7
  86. package/dist/dts/features/Navigation/NavigationBar.js.map +1 -1
  87. package/dist/dts/features/Navigation/NavigationBarButton.js +1 -1
  88. package/dist/dts/features/Navigation/NavigationBarButton.js.map +1 -1
  89. package/dist/dts/features/Navigation/NavigationLogo.d.ts +1 -1
  90. package/dist/dts/features/Navigation/NavigationLogo.d.ts.map +1 -1
  91. package/dist/dts/features/Navigation/NavigationLogo.js +8 -6
  92. package/dist/dts/features/Navigation/NavigationLogo.js.map +1 -1
  93. package/dist/dts/features/Navigation/TopBar.d.ts +3 -2
  94. package/dist/dts/features/Navigation/TopBar.d.ts.map +1 -1
  95. package/dist/dts/features/Navigation/TopBar.js +1 -1
  96. package/dist/dts/features/Navigation/TopBar.js.map +1 -1
  97. package/dist/dts/features/Navigation/index.d.ts +5 -3
  98. package/dist/dts/features/Navigation/index.d.ts.map +1 -1
  99. package/dist/dts/features/Navigation/index.js +1 -1
  100. package/dist/dts/features/Navigation/index.js.map +1 -1
  101. package/dist/dts/features/Navigation/types.d.ts +10 -32
  102. package/dist/dts/features/Navigation/types.d.ts.map +1 -1
  103. package/dist/dts/features/Query/GqlQueryEditor.d.ts.map +1 -1
  104. package/dist/dts/features/Query/GqlQueryEditor.js +5 -4
  105. package/dist/dts/features/Query/GqlQueryEditor.js.map +1 -1
  106. package/dist/dts/lib/common/staticProps.d.ts +1 -1
  107. package/dist/dts/lib/common/staticProps.d.ts.map +1 -1
  108. package/dist/dts/lib/common/staticProps.js +18 -4
  109. package/dist/dts/lib/common/staticProps.js.map +1 -1
  110. package/dist/dts/lib/content/ContentDatabase.js +2 -2
  111. package/dist/dts/lib/content/filesystem.js +2 -2
  112. package/dist/dts/lib/session/hooks.js +2 -2
  113. package/dist/dts/lib/session/session.js +2 -2
  114. package/dist/dts/pages/AiSearch/data.js +2 -2
  115. package/dist/dts/pages/Crosswalk/data.js +2 -2
  116. package/dist/dts/pages/DataDictionary/data.js +2 -2
  117. package/dist/dts/pages/Discovery/data.js +2 -2
  118. package/dist/dts/pages/Explorer/Explorer.d.ts.map +1 -1
  119. package/dist/dts/pages/Explorer/Explorer.js +0 -3
  120. package/dist/dts/pages/Explorer/Explorer.js.map +1 -1
  121. package/dist/dts/pages/Explorer/data.js +2 -2
  122. package/dist/dts/pages/Landing/about-us.js +2 -2
  123. package/dist/dts/pages/Landing/contact.js +2 -2
  124. package/dist/dts/pages/Landing/data.js +2 -2
  125. package/dist/dts/pages/Landing/resource.js +2 -2
  126. package/dist/dts/pages/Login/data.js +2 -2
  127. package/dist/dts/pages/Profile/data.js +2 -2
  128. package/dist/dts/pages/Query/data.js +2 -2
  129. package/dist/dts/pages/Submission/data.js +2 -2
  130. package/dist/dts/pages/Theme/data.js +2 -2
  131. package/dist/dts/pages/Workspace/data.js +2 -2
  132. package/dist/dts/pages/_document.js +2 -2
  133. package/dist/dts/pages/admin/authz/data.d.ts +2 -2
  134. package/dist/dts/pages/admin/authz/data.js +2 -2
  135. package/dist/dts/pages/api/content/content.js +2 -2
  136. package/dist/dts/pages/external/footer.js +3 -3
  137. package/dist/dts/pages/external/footer.js.map +1 -1
  138. package/dist/dts/pages/index.js +2 -2
  139. package/dist/dts/pages/utils/serverSideProps.js +2 -2
  140. package/dist/dts/types/index.d.ts +2 -0
  141. package/dist/dts/types/index.d.ts.map +1 -0
  142. package/dist/dts/types/index.js +2 -0
  143. package/dist/dts/types/index.js.map +1 -0
  144. package/dist/dts/types/styling.d.ts +4 -0
  145. package/dist/dts/types/styling.d.ts.map +1 -1
  146. package/dist/dts/utils/RendererFactory.d.ts +0 -8
  147. package/dist/dts/utils/RendererFactory.d.ts.map +1 -1
  148. package/dist/dts/utils/RendererFactory.js.map +1 -1
  149. package/dist/dts/utils/download.js +2 -2
  150. package/dist/dts/utils/index.d.ts +1 -0
  151. package/dist/dts/utils/index.d.ts.map +1 -1
  152. package/dist/dts/utils/index.js +1 -0
  153. package/dist/dts/utils/index.js.map +1 -1
  154. package/dist/dts/utils/mergeDefaultTailwindClassnames.d.ts +3 -2
  155. package/dist/dts/utils/mergeDefaultTailwindClassnames.d.ts.map +1 -1
  156. package/dist/dts/utils/mergeDefaultTailwindClassnames.js +23 -5
  157. package/dist/dts/utils/mergeDefaultTailwindClassnames.js.map +1 -1
  158. package/dist/dts/utils/tailwindConfig.js +1 -1
  159. package/dist/dts/utils/tailwindConfig.js.map +1 -1
  160. package/dist/dts/utils/tests/mergeDefaultTailwindClassnames.test.d.ts +2 -0
  161. package/dist/dts/utils/tests/mergeDefaultTailwindClassnames.test.d.ts.map +1 -0
  162. package/dist/dts/utils/tests/mergeDefaultTailwindClassnames.test.js +40 -0
  163. package/dist/dts/utils/tests/mergeDefaultTailwindClassnames.test.js.map +1 -0
  164. package/dist/dts/utils/tests/values.test.d.ts +2 -0
  165. package/dist/dts/utils/tests/values.test.d.ts.map +1 -0
  166. package/dist/dts/utils/tests/values.test.js +24 -0
  167. package/dist/dts/utils/tests/values.test.js.map +1 -0
  168. package/dist/dts/utils/values.d.ts +1 -0
  169. package/dist/dts/utils/values.d.ts.map +1 -1
  170. package/dist/dts/utils/values.js +9 -1
  171. package/dist/dts/utils/values.js.map +1 -1
  172. package/dist/esm/index.js +435 -218
  173. package/dist/esm/index.js.map +1 -1
  174. package/dist/index.d.ts +112 -57
  175. package/dist/tsconfig.tsbuildinfo +1 -1
  176. package/package.json +9 -17
  177. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/TableDetailsPanel.d.ts +0 -4
  178. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/TableDetailsPanel.d.ts.map +0 -1
  179. package/dist/dts/features/CohortBuilder/ExplorerTable/ExploreTableDetails/TableDetailsPanel.js.map +0 -1
  180. package/dist/dts/features/Navigation/Footer.d.ts +0 -4
  181. package/dist/dts/features/Navigation/Footer.d.ts.map +0 -1
  182. package/dist/dts/features/Navigation/Footer.js +0 -48
  183. package/dist/dts/features/Navigation/Footer.js.map +0 -1
package/dist/esm/index.js CHANGED
@@ -1,27 +1,28 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import React__default, { createElement, useState, useCallback, useEffect, useContext, useRef, createContext, useMemo, forwardRef, useReducer } from 'react';
3
+ import React__default, { useState, useCallback, useEffect, useContext, useRef, createElement, createContext, useMemo, forwardRef, useReducer } from 'react';
4
+ import { twMerge } from 'tailwind-merge';
4
5
  import Image from 'next/image';
6
+ import { toString, isArray, get, partial, omit, capitalize as capitalize$1 } from 'lodash';
5
7
  import Link from 'next/link';
6
- import { FaExternalLinkAlt, FaUndo, FaPlus, FaGraduationCap, FaRegQuestionCircle, FaVideo, FaCircle } from 'react-icons/fa';
7
- import { twMerge } from 'tailwind-merge';
8
+ import { FaExternalLinkAlt, FaQuestion, FaExclamation, FaExclamationTriangle, FaUndo, FaPlus, FaGraduationCap, FaRegQuestionCircle, FaVideo, FaCircle } from 'react-icons/fa';
8
9
  import { Icon, addCollection } from '@iconify/react';
9
10
  import { Tooltip, UnstyledButton, Menu, Text, Button, Box, Badge, Alert, Tabs, Accordion, Stack, Group, Drawer, CopyButton, LoadingOverlay, factory, useProps, useMantineTheme, getStyleObject, Paper, Checkbox, SegmentedControl, Loader, Autocomplete, TextInput, Title, Divider, Table, Card, Avatar, Select, Textarea, FileButton, Anchor, Modal, Grid, ThemeIcon, ActionIcon, NumberInput, RangeSlider, MultiSelect, Center, MantineProvider, createTheme, Highlight, List, Switch } from '@mantine/core';
10
11
  import { useRouter } from 'next/router';
11
12
  import { usePathname } from 'next/navigation';
12
13
  import { MdLogin, MdKeyboardDoubleArrowLeft, MdUndo, MdSearch, MdClose, MdInfo, MdAddCircle, MdRemoveCircle, MdFlip, MdOutlineArrowBack, MdOutlineArrowForward, MdOutlineArrowBackIos, MdOutlineArrowForwardIos, MdKeyboardArrowDown, MdKeyboardArrowUp, MdDownload, MdFormatQuote, MdOutlineSearch, MdOutlineBarChart, MdGroup, MdDelete } from 'react-icons/md';
13
- import { useCoreDispatch, useLazyFetchUserDetailsQuery, useCoreSelector, selectUserAuthStatus, GEN3_REDIRECT_URL, showModal, Modals, GEN3_FENCE_API, isAuthenticated, selectUserDetails, useIsUserLoggedIn, useGetMDSQuery, selectAuthzMappingData, useGetAggMDSQuery, useAskQuestionMutation, useGetIndexAggMDSQuery, useGetTagsQuery, useUserAuth, useGetAuthzMappingsQuery, useGetLoginProvidersQuery, hideModal, useGetCSRFQuery, selectCurrentModal, fieldNameToTitle, updateCohortFilter, selectIndexedFilterByName, isOperationWithField, removeCohortFilter, trimFirstFieldNameToTitle, selectCohortFilters, handleOperation, selectCurrentCohortId, clearCohortFilters, selectCurrentCohortName, useGeneralGQLQuery, selectIndexFilters, useGetRawDataAndTotalCountsQuery, Accessibility, downloadFromGuppyToBlob, downloadJSONDataFromGuppy, useGetAggsQuery, extractEnumFilterValue, useGetCountsQuery, selectHeadersWithCSRFToken, GEN3_COMMONS_NAME, CoreProvider, useGetCredentialsQuery, useRemoveCredentialMutation, useAddNewCredentialMutation, useGetExternalLoginsQuery, useGetDictionaryQuery, useGetProjectsDetailsQuery, useGetSubmissionsQuery, useLazyGetCrosswalkDataQuery } from '@gen3/core';
14
+ import { useCoreDispatch, useLazyFetchUserDetailsQuery, useCoreSelector, selectUserAuthStatus, GEN3_REDIRECT_URL, showModal, Modals, GEN3_FENCE_API, isAuthenticated, selectUserDetails, useIsUserLoggedIn, useGetMDSQuery, selectAuthzMappingData, useGetAggMDSQuery, useAskQuestionMutation, useGetIndexAggMDSQuery, useGetTagsQuery, useUserAuth, useGetAuthzMappingsQuery, useGetLoginProvidersQuery, hideModal, useGetCSRFQuery, selectCurrentModal, fieldNameToTitle, updateCohortFilter, selectIndexedFilterByName, isOperationWithField, removeCohortFilter, trimFirstFieldNameToTitle, selectCohortFilters, handleOperation, selectCurrentCohortId, clearCohortFilters, selectCurrentCohortName, useGeneralGQLQuery, selectIndexFilters, useGetRawDataAndTotalCountsQuery, Accessibility, downloadFromGuppyToBlob, downloadJSONDataFromGuppy, useGetAggsQuery, extractEnumFilterValue, useGetCountsQuery, selectHeadersWithCSRFToken, GEN3_GUPPY_API, GEN3_COMMONS_NAME, CoreProvider, useGetCredentialsQuery, useRemoveCredentialMutation, useAddNewCredentialMutation, useGetExternalLoginsQuery, useGetDictionaryQuery, useGetProjectsDetailsQuery, useGetSubmissionsQuery, useLazyGetCrosswalkDataQuery } from '@gen3/core';
14
15
  import { useDeepCompareEffect, useDeepCompareMemo, useDeepCompareCallback } from 'use-deep-compare';
15
16
  import 'swr';
16
17
  import { getCookie, deleteCookie, setCookie } from 'cookies-next';
17
18
  import { decodeJwt } from 'jose';
18
19
  import { showNotification, notifications, cleanNotifications, Notifications } from '@mantine/notifications';
20
+ import Markdown from 'react-markdown';
19
21
  import { AiOutlineLogin } from 'react-icons/ai';
20
22
  import { PiDotsThreeCircleThin, PiTrash, PiSparkleFill, PiCaretUpFill, PiCaretDownFill, PiCaretUpDownFill, PiCaretCircleDownFill } from 'react-icons/pi';
21
23
  import Head from 'next/head';
22
24
  import { useMantineReactTable, MantineReactTable } from 'mantine-react-table';
23
25
  import { JSONPath } from 'jsonpath-plus';
24
- import { toString, isArray, get, partial, omit, capitalize as capitalize$1 } from 'lodash';
25
26
  import { LuClock, LuCircleSlash, LuUnlock, LuLock, LuRefreshCw } from 'react-icons/lu';
26
27
  import tinycolor from 'tinycolor2';
27
28
  import { useDisclosure, useDidUpdate, mergeRefs, useReducedMotion, useClipboard, useElementSize, useMediaQuery, useLocalStorage, useScrollIntoView } from '@mantine/hooks';
@@ -32,7 +33,6 @@ import { useMiniSearch } from 'react-minisearch';
32
33
  import MiniSearch from 'minisearch';
33
34
  import uniq from 'lodash/uniq';
34
35
  import sum from 'lodash/sum';
35
- import Markdown from 'react-markdown';
36
36
  import remarkGfm from 'remark-gfm';
37
37
  import { useCookies } from 'react-cookie';
38
38
  import FileSaver from 'file-saver';
@@ -44,6 +44,7 @@ import tw from 'tailwind-styled-components';
44
44
  import 'universal-cookie';
45
45
  import { RiCloseCircleLine } from 'react-icons/ri';
46
46
  import { IoMdArrowDropdown, IoMdRefresh, IoMdLogIn } from 'react-icons/io';
47
+ import GraphiQL from 'graphiql';
47
48
  import fs from 'fs';
48
49
  import path from 'path';
49
50
  import { ModalsProvider } from '@mantine/modals';
@@ -54,40 +55,6 @@ import { filesize } from 'filesize';
54
55
  import plugin from 'tailwindcss/plugin';
55
56
  import cookie from 'cookie';
56
57
 
57
- const Gen3Link = ({ className, href, linkType, text, showExternalIcon = false })=>{
58
- const portalBasename = process.env.NEXT_PUBLIC_PORTAL_BASENAME && process.env.NEXT_PUBLIC_PORTAL_BASENAME !== '/' ? process.env.NEXT_PUBLIC_PORTAL_BASENAME : '';
59
- if (linkType === 'gen3ff') {
60
- return /*#__PURE__*/ jsx("span", {
61
- className: className,
62
- children: /*#__PURE__*/ jsx(Link, {
63
- href: href,
64
- children: text
65
- })
66
- });
67
- } else if (linkType === 'portal') {
68
- return /*#__PURE__*/ jsx("a", {
69
- className: className,
70
- href: `${portalBasename}${href}`,
71
- target: "_parent",
72
- children: text
73
- });
74
- }
75
- // external link
76
- return /*#__PURE__*/ jsxs("a", {
77
- className: className,
78
- href: href,
79
- target: "_blank",
80
- rel: "noreferrer",
81
- children: [
82
- showExternalIcon ? /*#__PURE__*/ jsx(FaExternalLinkAlt, {
83
- className: "pr-1",
84
- title: "External Link"
85
- }) : null,
86
- text
87
- ]
88
- });
89
- };
90
-
91
58
  const extractClassName = (key, classNames)=>{
92
59
  if (typeof classNames === 'object' && key in classNames) {
93
60
  return classNames[key];
@@ -100,119 +67,212 @@ const extractClassName = (key, classNames)=>{
100
67
  *
101
68
  * @param {RecordType} defaultValues - The default values for the classnames.
102
69
  * @param {RecordType} userValues - The user-defined values for the classnames.
103
- * @param {boolean} merge - Whether to merge the default and user values. Default is true.
70
+ * @param {StylingMergeMode} mode - Whether to merge or replace the default and user values. Default is merge.
104
71
  * @returns {RecordType} - The merged default and user values for the classnames.
105
- */ const mergeDefaultTailwindClassnames = (defaultValues, userValues, merge = true)=>{
72
+ */ const mergeDefaultTailwindClassnames = (defaultValues, { mode = 'merge', ...userValues })=>{
106
73
  const defaultKeys = Object.keys(defaultValues);
107
74
  const mergedValues = {
108
- ...defaultValues,
109
- ...userValues
75
+ ...defaultValues
110
76
  };
111
- if (merge) {
77
+ if (mode === 'merge') {
112
78
  defaultKeys.forEach((key)=>{
113
79
  if (userValues[key]) {
114
80
  mergedValues[key] = twMerge(defaultValues[key], userValues[key]);
115
81
  }
116
82
  });
117
83
  }
84
+ if (mode === 'replace') {
85
+ defaultKeys.forEach((key)=>{
86
+ if (userValues[key]) {
87
+ mergedValues[key] = userValues[key];
88
+ }
89
+ });
90
+ }
118
91
  return mergedValues;
119
92
  };
120
93
 
121
- const Footer = ({ bottomLinks, columnLinks, footerLogos, footerRightLogos, classNames = {} })=>{
94
+ const isPropertyKey = (value)=>{
95
+ return typeof value === 'string' || typeof value === 'number' || typeof value === 'symbol';
96
+ };
97
+ const hasOwnProperty = (obj, prop)=>{
98
+ if (obj === undefined) return false;
99
+ if (prop === undefined) return false;
100
+ return Object.hasOwnProperty.call(obj, prop);
101
+ };
102
+ const getParamsValueAsString = (params, key)=>{
103
+ return params && key && key !== '' && isPropertyKey(key) && hasOwnProperty(params, key) ? toString(params[key]) : undefined;
104
+ };
105
+ const extractObjectKey = (obj)=>{
106
+ const keys = Object.keys(obj);
107
+ return keys.length > 0 ? keys[0] : undefined;
108
+ };
109
+
110
+ // Component for rendering a single row in the column
111
+ // TODO: replace with a renderer factory
112
+ const FooterRowComponent = ({ item, rowClassname })=>{
113
+ const itemType = extractObjectKey(item);
114
+ if (!itemType) return null;
115
+ const className = item[itemType].className ?? rowClassname;
116
+ switch(itemType){
117
+ case 'Label':
118
+ {
119
+ const text = item[itemType];
120
+ return /*#__PURE__*/ jsxs("p", {
121
+ className: className,
122
+ children: [
123
+ " ",
124
+ text.text
125
+ ]
126
+ });
127
+ }
128
+ case 'Link':
129
+ {
130
+ const link = item[itemType];
131
+ return /*#__PURE__*/ jsx(React__default.Fragment, {
132
+ children: /*#__PURE__*/ jsx("a", {
133
+ href: link.href,
134
+ target: "_blank",
135
+ rel: "noopener noreferrer",
136
+ className: className,
137
+ children: link.text ? link.text : link.href
138
+ })
139
+ }, link.href);
140
+ }
141
+ case 'Links':
142
+ {
143
+ const links = item[itemType];
144
+ return /*#__PURE__*/ jsx("div", {
145
+ className: `flex flex-no-wrap space-x-4 ${className ?? ''}`,
146
+ children: links?.links.map((link, i)=>{
147
+ return /*#__PURE__*/ jsxs(React__default.Fragment, {
148
+ children: [
149
+ /*#__PURE__*/ jsx("a", {
150
+ href: link.href,
151
+ target: "_blank",
152
+ rel: "noopener noreferrer",
153
+ className: link?.className,
154
+ children: link.text ? link.text : link.href
155
+ }),
156
+ i !== links?.links.length - 1 && /*#__PURE__*/ jsx("span", {
157
+ className: "mx-1",
158
+ children: "|"
159
+ })
160
+ ]
161
+ }, link.href);
162
+ })
163
+ });
164
+ }
165
+ case 'Icon':
166
+ {
167
+ const logo = item[itemType];
168
+ return /*#__PURE__*/ jsx(Image, {
169
+ src: `${logo.logo}`,
170
+ width: logo.width,
171
+ height: logo.height,
172
+ alt: logo.description,
173
+ className: className
174
+ }, `icons-${logo.logo}`);
175
+ }
176
+ case 'Section':
177
+ {
178
+ const section = item[itemType];
179
+ return /*#__PURE__*/ jsx(FooterSection, {
180
+ columns: section.columns,
181
+ className: className
182
+ });
183
+ }
184
+ default:
185
+ return null;
186
+ }
187
+ };
188
+ const FooterColumnTwDefaultStyles = {
189
+ root: 'flex flex-col px-2 justify-start',
190
+ heading: 'font-bold text-xl text-white font-heading',
191
+ rowItem: ''
192
+ };
193
+ const FooterColumn = ({ heading, rows, classNames = {} })=>{
194
+ const mergedClassNames = mergeDefaultTailwindClassnames(FooterColumnTwDefaultStyles, classNames);
195
+ const rowClassname = extractClassName('rowItem', mergedClassNames);
196
+ return /*#__PURE__*/ jsxs("div", {
197
+ className: extractClassName('root', mergedClassNames),
198
+ children: [
199
+ heading && /*#__PURE__*/ jsx("h1", {
200
+ className: extractClassName('heading', mergedClassNames),
201
+ children: heading
202
+ }),
203
+ rows?.map((item, index)=>{
204
+ return /*#__PURE__*/ jsx(FooterRowComponent, {
205
+ item: item,
206
+ rowClassname: rowClassname
207
+ }, `footer-row-${index}`);
208
+ })
209
+ ]
210
+ });
211
+ };
212
+ const FooterSection = ({ columns, className = undefined })=>{
213
+ return /*#__PURE__*/ jsx("div", {
214
+ className: `${className ?? 'flex items-center justify-center'}`,
215
+ children: columns?.map((col, index)=>/*#__PURE__*/ jsx(FooterColumn, {
216
+ ...col
217
+ }, `column-${index}`))
218
+ });
219
+ };
220
+ var FooterSection$1 = /*#__PURE__*/ React__default.memo(FooterSection);
221
+
222
+ const Footer = ({ rightSection, leftSection, classNames = {} })=>{
122
223
  const classNamesDefaults = {
123
- root: 'bg-primary-lighter text-primary-contrast p-4 shadow-sm'
224
+ root: 'bg-primary-lighter text-primary-contrast p-4 shadow-sm',
225
+ layout: 'flex items-center justify-between'
124
226
  };
125
227
  const mergedClassNames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
126
- return /*#__PURE__*/ jsxs("footer", {
127
- children: [
128
- /*#__PURE__*/ jsxs("div", {
129
- className: extractClassName('root', mergedClassNames),
228
+ return /*#__PURE__*/ jsx("footer", {
229
+ children: /*#__PURE__*/ jsx("div", {
230
+ className: extractClassName('root', mergedClassNames),
231
+ children: /*#__PURE__*/ jsxs("div", {
232
+ className: extractClassName('layout', mergedClassNames),
130
233
  children: [
131
- /*#__PURE__*/ jsxs("div", {
132
- className: "flex justify-end",
133
- children: [
134
- (footerLogos || [
135
- []
136
- ]).map((col, index)=>{
137
- return /*#__PURE__*/ jsx("div", {
138
- className: `flex flex-row gap-x-3 mr-8 ${col.length > 1 ? 'justify-between' : ''}`,
139
- children: col.map((logo)=>/*#__PURE__*/ jsx(Image, {
140
- className: "object-none",
141
- src: `${logo.logo}`,
142
- width: logo.width,
143
- height: logo.height,
144
- alt: logo.description
145
- }, `icons-${logo.logo}`))
146
- }, `footer-col-${index}`);
147
- }),
148
- /*#__PURE__*/ jsx("div", {
149
- className: "flex w-[100%] pl-10 pt-3",
150
- children: (columnLinks || []).map(({ heading, items }, i)=>/*#__PURE__*/ jsxs("div", {
151
- className: "flex flex-col pl-10",
152
- children: [
153
- /*#__PURE__*/ jsx("h1", {
154
- className: "font-bold text-xl text-white font-heading",
155
- children: heading
156
- }),
157
- (items || []).map(({ text, href, linkType }, j)=>{
158
- const attrs = {
159
- className: `${href && 'heal-link-footer'} font-medium text-sm p-[2px] text-white font-content`,
160
- key: j
161
- };
162
- if (href) {
163
- return /*#__PURE__*/ createElement("div", {
164
- ...attrs,
165
- key: href
166
- }, /*#__PURE__*/ jsx(Gen3Link, {
167
- href: href,
168
- linkType: linkType,
169
- text: text
170
- }));
171
- } else {
172
- return /*#__PURE__*/ createElement("span", {
173
- ...attrs,
174
- key: href
175
- }, text);
176
- }
177
- })
178
- ]
179
- }, i))
180
- })
181
- ]
234
+ leftSection && /*#__PURE__*/ jsx(FooterSection$1, {
235
+ ...leftSection
182
236
  }),
183
- (footerRightLogos || [
184
- []
185
- ]).map((col, index)=>{
186
- return /*#__PURE__*/ jsx("div", {
187
- className: `flex gap-x-6 mr-8 ${col.length > 1 ? 'justify-end' : ''}`,
188
- children: col.map((logo)=>/*#__PURE__*/ jsx(Image, {
189
- src: `${logo.logo}`,
190
- width: logo.width,
191
- height: logo.height,
192
- alt: logo.description
193
- }, `icons-${logo.logo}`))
194
- }, `footer-col-${index}`);
237
+ rightSection && /*#__PURE__*/ jsx(FooterSection$1, {
238
+ ...rightSection
195
239
  })
196
240
  ]
197
- }),
198
- bottomLinks && bottomLinks.length > 0 ? /*#__PURE__*/ jsx("div", {
199
- className: "pt-[4px] m-1 text-right text-xs text-white font-content",
200
- children: bottomLinks.map((link, i)=>/*#__PURE__*/ jsxs(React__default.Fragment, {
201
- children: [
202
- /*#__PURE__*/ jsx("a", {
203
- href: link.href,
204
- target: "_blank",
205
- rel: "noopener noreferrer",
206
- className: "heal-link-footer",
207
- children: link.text ? link.text : link.href
208
- }),
209
- i !== bottomLinks.length - 1 && /*#__PURE__*/ jsx("span", {
210
- className: "mx-1",
211
- children: "|"
212
- })
213
- ]
214
- }, link.href))
215
- }) : null
241
+ })
242
+ })
243
+ });
244
+ };
245
+
246
+ const Gen3Link = ({ className, href, linkType, text, showExternalIcon = false })=>{
247
+ const portalBasename = process.env.NEXT_PUBLIC_PORTAL_BASENAME && process.env.NEXT_PUBLIC_PORTAL_BASENAME !== '/' ? process.env.NEXT_PUBLIC_PORTAL_BASENAME : '';
248
+ if (linkType === 'gen3ff') {
249
+ return /*#__PURE__*/ jsx("span", {
250
+ className: className,
251
+ children: /*#__PURE__*/ jsx(Link, {
252
+ href: href,
253
+ children: text
254
+ })
255
+ });
256
+ } else if (linkType === 'portal') {
257
+ return /*#__PURE__*/ jsx("a", {
258
+ className: className,
259
+ href: `${portalBasename}${href}`,
260
+ target: "_parent",
261
+ children: text
262
+ });
263
+ }
264
+ // external link
265
+ return /*#__PURE__*/ jsxs("a", {
266
+ className: className,
267
+ href: href,
268
+ target: "_blank",
269
+ rel: "noreferrer",
270
+ children: [
271
+ showExternalIcon ? /*#__PURE__*/ jsx(FaExternalLinkAlt, {
272
+ className: "pr-1",
273
+ title: "External Link"
274
+ }) : null,
275
+ text
216
276
  ]
217
277
  });
218
278
  };
@@ -466,7 +526,7 @@ var LoginButtonVisibility;
466
526
  const handleSelected = async (isAuthenticated, router, referrer, endSession)=>{
467
527
  if (!isAuthenticated) await router.push(`Login?redirect=${referrer}`);
468
528
  else {
469
- endSession && endSession();
529
+ if (endSession) endSession();
470
530
  }
471
531
  };
472
532
  const LoginButton = ({ icon = /*#__PURE__*/ jsx(MdLogin, {
@@ -526,7 +586,7 @@ const TopIconButton = ({ name, leftIcon = undefined, rightIcon = undefined, clas
526
586
  const classNamesDefaults = {
527
587
  root: `flex items-center align-middle px-2 ${drawBorder && 'border-r-2 border-accent'} my-2`,
528
588
  button: 'flex flex-nowrap items-center align-middle border-b-2 hover:border-accent border-transparent',
529
- leftSection: 'text-secondary-contrast-lighter pr-1',
589
+ leftIcon: 'text-secondary-contrast-lighter pr-1',
530
590
  label: 'font-content text-secondary-contrast-lighter block',
531
591
  rightIcon: 'text-secondary-contrast-lighter pl-1'
532
592
  };
@@ -620,12 +680,14 @@ const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, c
620
680
  });
621
681
  };
622
682
 
623
- const NavigationLogo = ({ src, title, description, basePath = '', classNames = {} })=>{
683
+ const NavigationLogo = ({ src, title, description, width, height, divider = false, basePath = '', classNames = {} })=>{
624
684
  const classNamesDefaults = {
625
- root: 'relative flex h-full py-2 justify-start items-center align-middle font-heading font-bold tracking-wide text-xl ml-[5px] mr-[20px]',
626
- link: 'relative w-96 h-full',
627
- title: 'border-solid border-base-darker border-l-1 ml-1 mr-3 h-32 w-1',
628
- titleLink: 'font-heading h3-typo pt-2 text-ink-dark hover:text-ink-darkest hover:border-accent hover:border-b-3'
685
+ root: 'relative flex py-2 justify-start items-center align-middle font-heading font-bold tracking-wide text-xl ml-[5px] mr-[20px]',
686
+ link: 'relative object-contain',
687
+ logo: 'px-3',
688
+ title: 'border-solid border-base-darker ml-1 mr-3',
689
+ divider: 'border-solid border-gen3-smoke border-l-1 ml-[2px] mr-[7px] h-[64px] w-1',
690
+ titleLink: 'font-heading text-md pt-2 text-ink-dark hover:text-ink-darkest hover:border-accent hover:border-b-3'
629
691
  };
630
692
  const mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
631
693
  return /*#__PURE__*/ jsxs("div", {
@@ -636,12 +698,17 @@ const NavigationLogo = ({ src, title, description, basePath = '', classNames = {
636
698
  className: extractClassName('link', mergedClassnames),
637
699
  href: "/",
638
700
  children: /*#__PURE__*/ jsx(Image, {
639
- className: "pr-3 object-contain",
640
- fill: true,
701
+ className: extractClassName('logo', mergedClassnames),
702
+ width: width ?? undefined,
703
+ height: height ?? undefined,
704
+ fill: !width && !height,
641
705
  src: `${basePath}${src}`,
642
706
  alt: description ?? title ?? 'link back to homepage'
643
707
  })
644
708
  }),
709
+ divider && /*#__PURE__*/ jsx("div", {
710
+ className: extractClassName('divider', mergedClassnames)
711
+ }),
645
712
  title && /*#__PURE__*/ jsx("div", {
646
713
  className: extractClassName('title', mergedClassnames),
647
714
  role: "navigation",
@@ -666,7 +733,7 @@ const NavigationLogo = ({ src, title, description, basePath = '', classNames = {
666
733
  */ const NavigationBarButton = ({ tooltip, icon, href, name, iconHeight = '27px', classNames = {} })=>{
667
734
  const classNamesDefaults = {
668
735
  root: `flex flex-col flex-nowrap px-3 py-2 pt-4 items-center align-center text-primary hover:text-accent opacity-80 hover:opacity-100`,
669
- label: 'pt-1.5 body-typo font-heading text-sm',
736
+ label: 'pt-1.5 body-typo font-heading text-sm text-nowrap',
670
737
  icon: 'mt-0.5 ml-1',
671
738
  ...TooltipStyle
672
739
  };
@@ -709,11 +776,12 @@ const NavigationLogo = ({ src, title, description, basePath = '', classNames = {
709
776
  * @param {Object} NavigationProps.logo - The logo object
710
777
  * @param {Array} NavigationProps.items - The array of navigation items
711
778
  * @param {Object} NavigationProps.classNames - The custom class names for different elements of the NavigationBar
712
- * @returns {JSX.Element} The rendered NavigationBar component
713
- */ const NavigationBar = ({ logo = undefined, items = [], classNames = {} })=>{
779
+ * @returns {ReactElement} The rendered NavigationBar component
780
+ */ const NavigationBar = ({ logo = undefined, title = undefined, items = [], classNames = {} })=>{
714
781
  const classNamesDefaults = {
715
- root: 'flex bg-base-max border-b-1 border-base-lighter',
716
- navigationPanel: 'font-heading font-bold tracking-wide text-xl',
782
+ root: 'flex bg-base-max border-b-1 border-base-dark',
783
+ navigationPanel: 'font-heading',
784
+ logoAndTitlePanel: 'flex justify-center items-center align-middle',
717
785
  login: 'pl-1 mr-6 bg-base-max text-base-contrast opacity-80 hover:opacity-100'
718
786
  };
719
787
  const mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
@@ -728,7 +796,7 @@ const NavigationLogo = ({ src, title, description, basePath = '', classNames = {
728
796
  className: extractClassName('root', mergedClassnames),
729
797
  children: [
730
798
  /*#__PURE__*/ jsx("div", {
731
- className: `flex justify-center items-center align-middle ${extractClassName('logo', mergedClassnames)}`,
799
+ className: extractClassName('logoAndTitlePanel', mergedClassnames),
732
800
  children: logo && /*#__PURE__*/ jsx(NavigationLogo, {
733
801
  ...logo
734
802
  })
@@ -741,7 +809,7 @@ const NavigationLogo = ({ src, title, description, basePath = '', classNames = {
741
809
  children: items.map((x, index)=>{
742
810
  const selectedStyle = current === x.href ? 'border-accent border-b-4 border-b-accent' : '';
743
811
  return /*#__PURE__*/ jsx("div", {
744
- className: `first:border-l-1 border-r-1 border-base-lighter ${selectedStyle}`,
812
+ className: `first:border-l-1 border-r-1 border-base-dark ${selectedStyle}`,
745
813
  children: /*#__PURE__*/ jsx(NavigationBarButton, {
746
814
  tooltip: x.tooltip,
747
815
  icon: x.icon,
@@ -756,6 +824,67 @@ const NavigationLogo = ({ src, title, description, basePath = '', classNames = {
756
824
  });
757
825
  };
758
826
 
827
+ const backgroundColor = {
828
+ INFO: 'bg-utility-info',
829
+ WARNING: 'bg-utility-warning',
830
+ ERROR: 'bg-utility-error',
831
+ MESSAGE: 'bg-utility-warning'
832
+ };
833
+ const textColor = {
834
+ INFO: 'text-utility-contrast-info',
835
+ WARNING: 'text-utility-contrast-warning',
836
+ ERROR: 'text-utility-contrast-error',
837
+ MESSAGE: 'text-utility-contrast-warning'
838
+ };
839
+ const icon = {
840
+ INFO: /*#__PURE__*/ jsx(FaQuestion, {
841
+ className: "text-utility-contrast-info",
842
+ title: "Info icon."
843
+ }),
844
+ WARNING: /*#__PURE__*/ jsx(FaExclamation, {
845
+ className: "text-utility-contrast-warning",
846
+ title: "Warning icon."
847
+ }),
848
+ ERROR: /*#__PURE__*/ jsx(FaExclamationTriangle, {
849
+ className: "text-utility-contrast-error",
850
+ title: "Error icon."
851
+ })
852
+ };
853
+ const Banner = ({ message, level, isExternalLink })=>{
854
+ const linkTarget = isExternalLink ? '_blank' : '_self';
855
+ return /*#__PURE__*/ jsx("div", {
856
+ className: `w-full p-1 flex justify-between ${backgroundColor[level]}`,
857
+ children: /*#__PURE__*/ jsxs("div", {
858
+ className: "flex items-center m-auto",
859
+ children: [
860
+ icon[level],
861
+ /*#__PURE__*/ jsx("span", {
862
+ className: `pl-4 ${textColor[level]}`,
863
+ children: /*#__PURE__*/ jsx(Markdown, {
864
+ components: {
865
+ // eslint-disable-next-line react/prop-types
866
+ a: ({ children, ...props })=>/*#__PURE__*/ jsxs("a", {
867
+ className: "underline",
868
+ ...props,
869
+ target: linkTarget,
870
+ rel: "noreferrer",
871
+ children: [
872
+ children,
873
+ isExternalLink && /*#__PURE__*/ jsx(FaExternalLinkAlt, {
874
+ className: "pl-1 inline-block",
875
+ title: "External Link"
876
+ })
877
+ ]
878
+ })
879
+ },
880
+ children: message
881
+ })
882
+ })
883
+ ]
884
+ })
885
+ });
886
+ };
887
+
759
888
  const ActionMenu = ({ items })=>{
760
889
  return /*#__PURE__*/ jsx(React__default.Fragment, {
761
890
  children: /*#__PURE__*/ jsxs(Menu, {
@@ -852,25 +981,39 @@ const HorizontalNavigationBar = ({ actions, items, logo = undefined, loginIcon =
852
981
  * @param {object} props.navigation - The navigation bar items and configuration.
853
982
  * @param {string} props.type - The type of header to render. Default value is 'original'.
854
983
  * @returns {JSX.Element} - The rendered Header component.
855
- */ const Header = ({ top, navigation, type = 'original' })=>{
856
- return type === 'horizontal' ? /*#__PURE__*/ jsx("div", {
984
+ */ const Header = ({ top, navigation, banners, type = 'original' })=>{
985
+ return type === 'horizontal' ? /*#__PURE__*/ jsxs("div", {
857
986
  className: "w-full",
858
- children: /*#__PURE__*/ jsx(HorizontalNavigationBar, {
859
- logo: navigation.logo,
860
- title: navigation.title,
861
- items: navigation.items,
862
- classNames: {
863
- ...navigation.classNames
864
- },
865
- actions: top
866
- })
867
- }) : type === 'vertical' ? /*#__PURE__*/ jsx(HorizontalNavigationBar, {
868
- logo: navigation.logo,
869
- title: navigation.title,
870
- classNames: {
871
- ...navigation.classNames
872
- },
873
- actions: top
987
+ children: [
988
+ banners?.map((banner)=>/*#__PURE__*/ createElement(Banner, {
989
+ ...banner,
990
+ key: banner.id
991
+ })),
992
+ /*#__PURE__*/ jsx(HorizontalNavigationBar, {
993
+ logo: navigation.logo,
994
+ title: navigation.title,
995
+ items: navigation.items,
996
+ classNames: {
997
+ ...navigation.classNames
998
+ },
999
+ actions: top
1000
+ })
1001
+ ]
1002
+ }) : type === 'vertical' ? /*#__PURE__*/ jsxs("div", {
1003
+ children: [
1004
+ banners?.map((banner)=>/*#__PURE__*/ createElement(Banner, {
1005
+ ...banner,
1006
+ key: banner.id
1007
+ })),
1008
+ /*#__PURE__*/ jsx(HorizontalNavigationBar, {
1009
+ logo: navigation.logo,
1010
+ title: navigation.title,
1011
+ classNames: {
1012
+ ...navigation.classNames
1013
+ },
1014
+ actions: top
1015
+ })
1016
+ ]
874
1017
  }) : /*#__PURE__*/ jsxs("div", {
875
1018
  className: "w-100",
876
1019
  children: [
@@ -881,10 +1024,15 @@ const HorizontalNavigationBar = ({ actions, items, logo = undefined, loginIcon =
881
1024
  ...top.classNames
882
1025
  }
883
1026
  }),
1027
+ banners?.map((banner)=>/*#__PURE__*/ createElement(Banner, {
1028
+ ...banner,
1029
+ key: banner.id
1030
+ })),
884
1031
  /*#__PURE__*/ jsx(NavigationBar, {
885
1032
  logo: navigation.logo,
886
1033
  title: navigation.title,
887
- items: navigation.items
1034
+ items: navigation.items,
1035
+ classNames: navigation?.classNames
888
1036
  })
889
1037
  ]
890
1038
  });
@@ -1376,18 +1524,6 @@ const TruncatedStringWithTooltip = ({ value, params })=>{
1376
1524
  });
1377
1525
  };
1378
1526
 
1379
- const isPropertyKey = (value)=>{
1380
- return typeof value === 'string' || typeof value === 'number' || typeof value === 'symbol';
1381
- };
1382
- const hasOwnProperty = (obj, prop)=>{
1383
- if (obj === undefined) return false;
1384
- if (prop === undefined) return false;
1385
- return Object.hasOwnProperty.call(obj, prop);
1386
- };
1387
- const getParamsValueAsString = (params, key)=>{
1388
- return params && key && key !== '' && isPropertyKey(key) && hasOwnProperty(params, key) ? toString(params[key]) : undefined;
1389
- };
1390
-
1391
1527
  const TruncatedStringWithTooltipCellRenderer = ({ value }, params)=>{
1392
1528
  return /*#__PURE__*/ jsx(TruncatedStringWithTooltip, {
1393
1529
  value: value,
@@ -4965,9 +5101,13 @@ const FirstTimeModal = ({ openModal, config })=>{
4965
5101
  'Gen3-first-time-use'
4966
5102
  ]);
4967
5103
  const handleAccept = ()=>{
4968
- cookie['Gen3-first-time-use'] || setCookie('Gen3-first-time-use', true, {
4969
- maxAge: 60 * 60 * 24 * (config?.expireDays ?? 365)
4970
- });
5104
+ const isFirstTimeUse = cookie['Gen3-first-time-use'];
5105
+ if (!isFirstTimeUse) {
5106
+ const maxAge = 60 * 60 * 24 * (config?.expireDays ?? 365);
5107
+ setCookie('Gen3-first-time-use', true, {
5108
+ maxAge
5109
+ });
5110
+ }
4971
5111
  };
4972
5112
  return /*#__PURE__*/ jsx(BaseModal, {
4973
5113
  title: /*#__PURE__*/ jsx(Text, {
@@ -5212,7 +5352,7 @@ const Gen3ModalsProvider = ({ config, children })=>{
5212
5352
  useDeepCompareEffect(()=>{
5213
5353
  if (!cookie['Gen3-first-time-use'] && modalsConfig.systemUseModal.enabled) {
5214
5354
  if (modalsConfig.systemUseModal.showOnlyOnLogin && !isAuthenticated) return;
5215
- dispatch && dispatch(showModal({
5355
+ if (dispatch) dispatch(showModal({
5216
5356
  modal: Modals.FirstTimeModal
5217
5357
  }));
5218
5358
  }
@@ -8000,7 +8140,7 @@ const ExtractData = (data, index)=>{
8000
8140
  if (data.data === undefined || data.data === null) return {};
8001
8141
  return Array.isArray(data.data[index]) && data.data[index].length > 0 ? data.data[index][0] : {};
8002
8142
  };
8003
- const TableDetailsPanel = ({ id, index, tableConfig })=>{
8143
+ const QueryRowDetailsPanel = ({ id, index, tableConfig })=>{
8004
8144
  //const [queryGuppy, { data, isLoading, isError }] = useLazyGeneralGQLQuery();
8005
8145
  const idField = tableConfig.detailsConfig?.idField;
8006
8146
  const { data, isLoading, isError } = useGeneralGQLQuery({
@@ -8023,7 +8163,7 @@ const TableDetailsPanel = ({ id, index, tableConfig })=>{
8023
8163
  }
8024
8164
  }
8025
8165
  });
8026
- if (!idField || idField === null) {
8166
+ if (!idField) {
8027
8167
  return /*#__PURE__*/ jsx(ErrorCard, {
8028
8168
  message: 'idField not configure in Tables Details Config'
8029
8169
  });
@@ -8055,7 +8195,7 @@ const TableDetailsPanel = ({ id, index, tableConfig })=>{
8055
8195
  visible: isLoading
8056
8196
  }),
8057
8197
  /*#__PURE__*/ jsxs(Text, {
8058
- color: "primary.4",
8198
+ c: "primary.4",
8059
8199
  children: [
8060
8200
  "Results for ",
8061
8201
  id
@@ -8086,10 +8226,53 @@ const TableDetailsPanel = ({ id, index, tableConfig })=>{
8086
8226
  });
8087
8227
  };
8088
8228
 
8229
+ const RowTableDetailsPanel = ({ row })=>{
8230
+ const rowData = row?.original ?? {};
8231
+ const rows = Object.entries(rowData).map(([field, value])=>/*#__PURE__*/ jsxs(Table.Tr, {
8232
+ children: [
8233
+ /*#__PURE__*/ jsx(Table.Td, {
8234
+ children: /*#__PURE__*/ jsx(Text, {
8235
+ fw: "bold",
8236
+ children: field
8237
+ })
8238
+ }),
8239
+ /*#__PURE__*/ jsx(Table.Td, {
8240
+ children: /*#__PURE__*/ jsx(Text, {
8241
+ children: value ? value : ''
8242
+ })
8243
+ })
8244
+ ]
8245
+ }, field));
8246
+ return /*#__PURE__*/ jsxs(Table, {
8247
+ striped: true,
8248
+ highlightOnHover: true,
8249
+ withTableBorder: true,
8250
+ withColumnBorders: true,
8251
+ children: [
8252
+ /*#__PURE__*/ jsx(Table.Thead, {
8253
+ children: /*#__PURE__*/ jsxs(Table.Tr, {
8254
+ children: [
8255
+ /*#__PURE__*/ jsx(Table.Th, {
8256
+ children: "Field"
8257
+ }),
8258
+ /*#__PURE__*/ jsx(Table.Th, {
8259
+ children: "Value"
8260
+ })
8261
+ ]
8262
+ })
8263
+ }),
8264
+ /*#__PURE__*/ jsx(Table.Tbody, {
8265
+ children: rows
8266
+ })
8267
+ ]
8268
+ });
8269
+ };
8270
+
8089
8271
  let instance;
8090
8272
  const DefaultRendererCatalog = {
8091
8273
  tableDetails: {
8092
- default: TableDetailsPanel
8274
+ default: RowTableDetailsPanel,
8275
+ queryRowDetails: QueryRowDetailsPanel
8093
8276
  }
8094
8277
  };
8095
8278
  const ExplorerTableDetailsPanelFactory = ()=>{
@@ -8108,9 +8291,9 @@ const DEFAULT_PROPS = {
8108
8291
  title: '!text-primary-contrast !font-bold',
8109
8292
  close: '!bg-base-darker'
8110
8293
  };
8111
- const DetailsModal = ({ title, id, classNames, panel, panelProps, onClose, withCloseButton = true, closeOnClickOutside = true, closeOnEscape = true, size = 'auto' })=>{
8294
+ const DetailsModal = ({ title, id, row, classNames, panel, panelProps, onClose, withCloseButton = true, closeOnClickOutside = true, closeOnEscape = true, size = 'auto' })=>{
8112
8295
  const [opened, { open, close }] = useDisclosure(id !== undefined);
8113
- const styling = useMemo(()=>mergeDefaultTailwindClassnames(DEFAULT_PROPS, classNames ?? {}, true), [
8296
+ const styling = useMemo(()=>mergeDefaultTailwindClassnames(DEFAULT_PROPS, classNames ?? {}), [
8114
8297
  classNames
8115
8298
  ]);
8116
8299
  useEffect(()=>{
@@ -8125,7 +8308,7 @@ const DetailsModal = ({ title, id, classNames, panel, panelProps, onClose, withC
8125
8308
  opened: opened,
8126
8309
  onClose: ()=>{
8127
8310
  close();
8128
- onClose && onClose(id);
8311
+ if (onClose) onClose(id);
8129
8312
  },
8130
8313
  title: title,
8131
8314
  withinPortal: true,
@@ -8137,8 +8320,9 @@ const DetailsModal = ({ title, id, classNames, panel, panelProps, onClose, withC
8137
8320
  classNames: styling,
8138
8321
  xOffset: 0,
8139
8322
  children: panel({
8140
- id: id,
8323
+ id,
8141
8324
  onClose,
8325
+ row,
8142
8326
  ...panelProps
8143
8327
  })
8144
8328
  });
@@ -8164,6 +8348,7 @@ const isRecordAny = (obj)=>{
8164
8348
  const DetailsComponent = DetailsModal;
8165
8349
  const [sorting, setSorting] = useState([]);
8166
8350
  const [rowSelection, setRowSelection] = useState({});
8351
+ const [selectedRow, setSelectedRow] = useState(undefined);
8167
8352
  const DetailsPanel = useMemo(()=>ExplorerTableDetailsPanelFactory().getRenderer('tableDetails', tableConfig?.detailsConfig?.panel ?? 'default'), []);
8168
8353
  const cols = useDeepCompareMemo(()=>{
8169
8354
  // setup table columns at the same time
@@ -8287,10 +8472,12 @@ const isRecordAny = (obj)=>{
8287
8472
  onClick: ()=>{
8288
8473
  if (Object.keys(rowSelection).includes(row.id)) {
8289
8474
  setRowSelection({});
8475
+ setSelectedRow(undefined);
8290
8476
  } else {
8291
8477
  setRowSelection({
8292
8478
  [row.id]: true
8293
8479
  });
8480
+ setSelectedRow(row); // TODO: fix this typecast
8294
8481
  }
8295
8482
  },
8296
8483
  sx: {
@@ -8303,6 +8490,7 @@ const isRecordAny = (obj)=>{
8303
8490
  Object.keys(rowSelection).length > 0 ? /*#__PURE__*/ jsx(DetailsComponent, {
8304
8491
  title: tableConfig?.detailsConfig?.title,
8305
8492
  id: Object.keys(rowSelection).length > 0 ? Object.keys(rowSelection).at(0) : undefined,
8493
+ row: selectedRow,
8306
8494
  onClose: ()=>setRowSelection({}),
8307
8495
  panel: DetailsPanel,
8308
8496
  classNames: tableConfig?.detailsConfig?.classNames,
@@ -8435,22 +8623,22 @@ const useGuppyActionButton = ({ Modal403 = Modals.NoAccessModal, Modal400 = Moda
8435
8623
  const controller = new AbortController();
8436
8624
  showDownloadNotification(controller);
8437
8625
  setActive(true);
8438
- setIsActive && setIsActive(true);
8626
+ if (setIsActive) setIsActive(true);
8439
8627
  await actionFunction(actionArgs, ()=>{
8440
8628
  setActive(false);
8441
- setIsActive && setIsActive(false);
8629
+ if (setIsActive) setIsActive(false);
8442
8630
  // Clean up notifications...
8443
8631
  cleanNotifications();
8444
8632
  }, (error)=>{
8445
8633
  handleError(error);
8446
8634
  setActive(false);
8447
- setIsActive && setIsActive(false);
8635
+ if (setIsActive) setIsActive(false);
8448
8636
  // Clean up notifications...
8449
8637
  cleanNotifications();
8450
8638
  showErrorMessage(error);
8451
8639
  }, ()=>{
8452
8640
  setActive(false);
8453
- setIsActive && setIsActive(false);
8641
+ if (setIsActive) setIsActive(false);
8454
8642
  // Clean up notifications...
8455
8643
  cleanNotifications();
8456
8644
  }, controller.signal);
@@ -8516,13 +8704,13 @@ const downloadToFileAction = async (params, done, onError, onAbort, signal)=>{
8516
8704
  parameters: params,
8517
8705
  onDone: (data)=>{
8518
8706
  handleDownload(data, params.filename);
8519
- done && done();
8707
+ if (done) done();
8520
8708
  },
8521
8709
  onError: (error)=>{
8522
- onError && onError(error);
8710
+ if (onError) onError(error);
8523
8711
  },
8524
8712
  onAbort: ()=>{
8525
- onAbort && onAbort();
8713
+ if (onAbort) onAbort();
8526
8714
  },
8527
8715
  signal
8528
8716
  });
@@ -8586,13 +8774,13 @@ const downloadToManifestAction = async (params, done, onError, onAbort, signal,
8586
8774
  type: 'application/json;charset=utf-8'
8587
8775
  });
8588
8776
  handleDownload(blob, manifestFilename);
8589
- done && done();
8777
+ if (done) done();
8590
8778
  } catch (err) {
8591
8779
  let resultErr;
8592
8780
  if (typeof err === 'string') resultErr = new Error(err);
8593
8781
  if (err instanceof Error) resultErr = err;
8594
8782
  if (!resultErr) resultErr = new Error('unknown error in download manifest');
8595
- onError && onError(resultErr);
8783
+ if (onError) onError(resultErr);
8596
8784
  }
8597
8785
  return;
8598
8786
  }
@@ -8658,16 +8846,16 @@ const downloadToManifestAction = async (params, done, onError, onAbort, signal,
8658
8846
  type: 'application/json;charset=utf-8'
8659
8847
  });
8660
8848
  handleDownload(blob, manifestFilename);
8661
- done && done();
8849
+ if (done) done();
8662
8850
  } catch (err) {
8663
- onError && onError(err);
8851
+ if (onError) onError(err);
8664
8852
  }
8665
8853
  };
8666
8854
 
8667
8855
  const registeredButtonActions = {};
8668
8856
  const NullButtonAction = (_params, done)=>{
8669
8857
  return new Promise((done)=>{
8670
- done && done();
8858
+ if (done) done();
8671
8859
  });
8672
8860
  };
8673
8861
  const registerButtonAction = (buttonName, actionItem)=>{
@@ -8725,7 +8913,7 @@ const GuppyDropdownMenuItem = ({ title, idx, disabled = false, Modal403 = Modals
8725
8913
  });
8726
8914
  return /*#__PURE__*/ jsx(Menu.Item, {
8727
8915
  onClick: ()=>{
8728
- handleClick && handleClick();
8916
+ if (handleClick) handleClick();
8729
8917
  },
8730
8918
  "data-testid": `${title}-${idx}`,
8731
8919
  leftSection: icon,
@@ -9219,18 +9407,42 @@ const CohortBuilder = ({ explorerConfig })=>{
9219
9407
  * @param graphQLEndpoint - The location of the graphql endpoint.
9220
9408
  * @returns a component containing a GraphiQl editor
9221
9409
  */ const GqlQueryEditor$1 = ({ graphQLEndpoint })=>{
9222
- useState('');
9223
- useCoreSelector(selectHeadersWithCSRFToken);
9224
- return /*#__PURE__*/ jsx("div", {
9410
+ const [query, setQuery] = useState('');
9411
+ const headers = useCoreSelector(selectHeadersWithCSRFToken);
9412
+ // Typically we would put this in core but it's only used here
9413
+ const fetcher = async (graphQLParams)=>{
9414
+ const data = await fetch(graphQLEndpoint || `${GEN3_GUPPY_API}/graphql`, {
9415
+ method: 'POST',
9416
+ headers: headers,
9417
+ body: JSON.stringify(graphQLParams)
9418
+ });
9419
+ return data.json().catch(()=>data.text());
9420
+ };
9421
+ return /*#__PURE__*/ jsxs("div", {
9225
9422
  className: "flex flex-col h-full w-full",
9226
- children: /*#__PURE__*/ jsx("div", {
9227
- className: "flex justify-between items-center m-2",
9228
- children: /*#__PURE__*/ jsx(Text, {
9229
- size: "xl",
9230
- fw: 500,
9231
- children: "Query Graph"
9423
+ children: [
9424
+ /*#__PURE__*/ jsx("div", {
9425
+ className: "flex justify-between items-center m-2",
9426
+ children: /*#__PURE__*/ jsx(Text, {
9427
+ size: "xl",
9428
+ fw: 500,
9429
+ children: "Query Graph"
9430
+ })
9431
+ }),
9432
+ /*#__PURE__*/ jsx(GraphiQL, {
9433
+ editorTheme: "light",
9434
+ fetcher: fetcher,
9435
+ query: query,
9436
+ onEditQuery: setQuery,
9437
+ children: /*#__PURE__*/ jsxs(GraphiQL.Logo, {
9438
+ children: [
9439
+ " ",
9440
+ null,
9441
+ " "
9442
+ ]
9443
+ })
9232
9444
  })
9233
- })
9445
+ ]
9234
9446
  });
9235
9447
  };
9236
9448
 
@@ -9291,10 +9503,17 @@ const ContentSource = setup();
9291
9503
  * @returns A Promise resolving to an object containing header and footer props.
9292
9504
  */ const getNavPageLayoutPropsFromConfig = async ()=>{
9293
9505
  const navigationConfigJSON = await ContentSource.get(`config/${GEN3_COMMONS_NAME}/navigation.json`);
9506
+ let bannerConfigJSON = [];
9507
+ try {
9508
+ bannerConfigJSON = await ContentSource.get(`config/${GEN3_COMMONS_NAME}/banner.json`);
9509
+ } catch (e) {
9510
+ console.log('No banner config found at: ', `config/${GEN3_COMMONS_NAME}/banner.json`);
9511
+ }
9294
9512
  const { topBar, navigation, type = 'original' } = navigationConfigJSON;
9295
9513
  const headerProps = {
9296
9514
  top: topBar,
9297
9515
  navigation: navigation,
9516
+ banners: bannerConfigJSON,
9298
9517
  type
9299
9518
  };
9300
9519
  const footerProps = await ContentSource.get(`config/${GEN3_COMMONS_NAME}/footer.json`);
@@ -9759,8 +9978,6 @@ const LandingPageGetStaticProps = async ()=>{
9759
9978
  };
9760
9979
  };
9761
9980
 
9762
- registerExplorerDefaultCellRenderers();
9763
- registerCohortBuilderDefaultPreviewRenderers();
9764
9981
  const ExplorerPage = ({ headerProps, footerProps, explorerConfig })=>{
9765
9982
  if (explorerConfig === undefined) {
9766
9983
  return /*#__PURE__*/ jsx(Center, {
@@ -13456,5 +13673,5 @@ async function credentialsLogout(req, res) {
13456
13673
  res.redirect(307, '/');
13457
13674
  }
13458
13675
 
13459
- export { AISearchPageGetServerSideProps, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AuthzPage, BaseModal, Charts, CohortBuilder, ColorThemePage, ColorThemePageGetServerSideProps, ContentSource, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom404Page, DictionaryPage, DictionaryPageGetServerSideProps, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DiscoveryRowRendererFactory, EnumFacetChart, ErrorCard, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FirstTimeModal, Footer, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor$1 as GqlQueryEditor, Header, HoverLink, LandingPage, LandingPageGetStaticProps, LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, QueryPage, QueryPageGetServerSideProps, ReactECharts, ResourcesFilters, SessionExpiredModal, StudyGroup, SubmissionPage, SubmissionPageGetServerSideProps, TagCloud, TailwindConfig, User, WorkspacesPage, WorkspacesPageGetServerSideProps, WorkspacesPanel, capitalize, computeRowSpan, create10ColorAccessibleContrast, create10ColorPallet, credentialsLogin, credentialsLogout, focusStyles, getCurrentUnixTimestamp, getNavPageLayoutPropsFromConfig, getTagInfo, isArrayOfString, isTextTransform$1 as isTextTransform, processLabel$1 as processLabel, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, removeKey$1 as removeKey, resourcePathFromProjectID, sessionLogout, sessionToken, stripTrailingSlash, truncateString, unixTimeToString, useDiscoveryContext, userHasMethodForServiceOnResource$1 as userHasMethodForServiceOnResource };
13676
+ export { AISearchPageGetServerSideProps, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AuthzPage, BaseModal, Charts, CohortBuilder, ColorThemePage, ColorThemePageGetServerSideProps, ContentSource, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom404Page, DictionaryPage, DictionaryPageGetServerSideProps, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DiscoveryRowRendererFactory, EnumFacetChart, ErrorCard, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FirstTimeModal, Footer, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor$1 as GqlQueryEditor, Header, HoverLink, LandingPage, LandingPageGetStaticProps, LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, QueryPage, QueryPageGetServerSideProps, ReactECharts, ResourcesFilters, SessionExpiredModal, StudyGroup, SubmissionPage, SubmissionPageGetServerSideProps, TagCloud, TailwindConfig, User, WorkspacesPage, WorkspacesPageGetServerSideProps, WorkspacesPanel, capitalize, computeRowSpan, create10ColorAccessibleContrast, create10ColorPallet, credentialsLogin, credentialsLogout, extractObjectKey, focusStyles, getCurrentUnixTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isPropertyKey, isTextTransform$1 as isTextTransform, processLabel$1 as processLabel, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, removeKey$1 as removeKey, resourcePathFromProjectID, sessionLogout, sessionToken, stripTrailingSlash, truncateString, unixTimeToString, useDiscoveryContext, userHasMethodForServiceOnResource$1 as userHasMethodForServiceOnResource };
13460
13677
  //# sourceMappingURL=index.js.map