@gen3/frontend 0.10.55 → 0.10.57
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.
- package/dist/cjs/index.js +118 -70
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/components/Content/TextContent.d.ts +6 -2
- package/dist/dts/components/Content/TextContent.d.ts.map +1 -1
- package/dist/dts/components/Content/TextContent.js +25 -4
- package/dist/dts/components/Content/TextContent.js.map +1 -1
- package/dist/dts/components/Login/LoginAccountButton.d.ts +4 -1
- package/dist/dts/components/Login/LoginAccountButton.d.ts.map +1 -1
- package/dist/dts/components/Login/LoginAccountButton.js +5 -2
- package/dist/dts/components/Login/LoginAccountButton.js.map +1 -1
- package/dist/dts/components/Login/LoginButton.d.ts.map +1 -1
- package/dist/dts/components/Login/LoginButton.js +4 -2
- package/dist/dts/components/Login/LoginButton.js.map +1 -1
- package/dist/dts/components/Login/LoginPanel.d.ts.map +1 -1
- package/dist/dts/components/Login/LoginPanel.js +1 -4
- package/dist/dts/components/Login/LoginPanel.js.map +1 -1
- package/dist/dts/features/Navigation/Footer/FooterColumn.d.ts.map +1 -1
- package/dist/dts/features/Navigation/Footer/FooterColumn.js +3 -2
- package/dist/dts/features/Navigation/Footer/FooterColumn.js.map +1 -1
- package/dist/dts/features/Navigation/NavigationBar.d.ts.map +1 -1
- package/dist/dts/features/Navigation/NavigationBar.js +1 -1
- package/dist/dts/features/Navigation/NavigationBar.js.map +1 -1
- package/dist/dts/features/Navigation/NavigationBarButton.d.ts +2 -1
- package/dist/dts/features/Navigation/NavigationBarButton.d.ts.map +1 -1
- package/dist/dts/features/Navigation/NavigationBarButton.js +5 -4
- package/dist/dts/features/Navigation/NavigationBarButton.js.map +1 -1
- package/dist/dts/features/Navigation/NavigationLogo.js +1 -1
- package/dist/dts/features/Navigation/TopBar.d.ts.map +1 -1
- package/dist/dts/features/Navigation/TopBar.js +2 -1
- package/dist/dts/features/Navigation/TopBar.js.map +1 -1
- package/dist/dts/features/Navigation/types.d.ts +7 -6
- package/dist/dts/features/Navigation/types.d.ts.map +1 -1
- package/dist/dts/utils/mergeDefaultTailwindClassnames.d.ts +1 -0
- package/dist/dts/utils/mergeDefaultTailwindClassnames.d.ts.map +1 -1
- package/dist/dts/utils/mergeDefaultTailwindClassnames.js +1 -0
- package/dist/dts/utils/mergeDefaultTailwindClassnames.js.map +1 -1
- package/dist/esm/index.js +118 -70
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +12 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/dts/components/jobs/JobMonitor.d.ts +0 -2
- package/dist/dts/components/jobs/JobMonitor.d.ts.map +0 -1
- package/dist/dts/components/jobs/JobMonitor.js +0 -40
- package/dist/dts/components/jobs/JobMonitor.js.map +0 -1
- package/dist/dts/components/jobs/JobsList.d.ts +0 -6
- package/dist/dts/components/jobs/JobsList.d.ts.map +0 -1
- package/dist/dts/components/jobs/JobsList.js +0 -30
- package/dist/dts/components/jobs/JobsList.js.map +0 -1
- package/dist/dts/components/jobs/JobsModal.d.ts +0 -6
- package/dist/dts/components/jobs/JobsModal.d.ts.map +0 -1
- package/dist/dts/components/jobs/JobsModal.js +0 -10
- package/dist/dts/components/jobs/JobsModal.js.map +0 -1
- package/dist/dts/components/jobs/index.d.ts +0 -5
- package/dist/dts/components/jobs/index.d.ts.map +0 -1
- package/dist/dts/components/jobs/index.js +0 -5
- package/dist/dts/components/jobs/index.js.map +0 -1
- package/dist/dts/features/CohortBuilder/downloads/CohortDispatchActionButton.d.ts +0 -46
- package/dist/dts/features/CohortBuilder/downloads/CohortDispatchActionButton.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/downloads/CohortDispatchActionButton.js +0 -44
- package/dist/dts/features/CohortBuilder/downloads/CohortDispatchActionButton.js.map +0 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/TwoStepActionButton.d.ts +0 -42
- package/dist/dts/features/CohortBuilder/downloads/actions/TwoStepActionButton.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/TwoStepActionButton.js +0 -218
- package/dist/dts/features/CohortBuilder/downloads/actions/TwoStepActionButton.js.map +0 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/sowerActions.d.ts +0 -2
- package/dist/dts/features/CohortBuilder/downloads/actions/sowerActions.d.ts.map +0 -1
- package/dist/dts/features/CohortBuilder/downloads/actions/sowerActions.js +0 -12
- package/dist/dts/features/CohortBuilder/downloads/actions/sowerActions.js.map +0 -1
- package/dist/dts/services/SowerJobsMonitor.d.ts +0 -30
- package/dist/dts/services/SowerJobsMonitor.d.ts.map +0 -1
- package/dist/dts/services/SowerJobsMonitor.js +0 -236
- package/dist/dts/services/SowerJobsMonitor.js.map +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -11,10 +11,10 @@ import 'swr';
|
|
|
11
11
|
import { getCookie, deleteCookie, setCookie } from 'cookies-next';
|
|
12
12
|
import { decodeJwt } from 'jose';
|
|
13
13
|
import { notifications, showNotification, cleanNotifications, Notifications } from '@mantine/notifications';
|
|
14
|
+
import { twMerge } from 'tailwind-merge';
|
|
14
15
|
import { IconAlertTriangle } from '@tabler/icons-react';
|
|
15
16
|
import Markdown from 'react-markdown';
|
|
16
17
|
import remarkGfm from 'remark-gfm';
|
|
17
|
-
import { twMerge } from 'tailwind-merge';
|
|
18
18
|
import { isArray, toString, capitalize as capitalize$1, get, partial, omit } from 'lodash';
|
|
19
19
|
import { useCookies } from 'react-cookie';
|
|
20
20
|
import FileSaver from 'file-saver';
|
|
@@ -586,6 +586,36 @@ var LoginButtonVisibility;
|
|
|
586
586
|
LoginButtonVisibility["LogoutOnly"] = "logoutOnly";
|
|
587
587
|
})(LoginButtonVisibility || (LoginButtonVisibility = {}));
|
|
588
588
|
|
|
589
|
+
/**
|
|
590
|
+
* Merges default and user values for Tailwind classnames.
|
|
591
|
+
*
|
|
592
|
+
* @param {RecordType} defaultValues - The default values for the classnames.
|
|
593
|
+
* @param {RecordType} userValues - The user-defined values for the classnames.
|
|
594
|
+
* @param {StylingMergeMode} mode - Whether to merge or replace the default and user values. Default is merge.
|
|
595
|
+
* @returns {RecordType} - The merged default and user values for the classnames.
|
|
596
|
+
*/ const mergeDefaultTailwindClassnames = (defaultValues, { mode = 'merge', ...userValues })=>{
|
|
597
|
+
const defaultKeys = Object.keys(defaultValues);
|
|
598
|
+
const mergedValues = {
|
|
599
|
+
...defaultValues
|
|
600
|
+
};
|
|
601
|
+
if (mode === 'merge') {
|
|
602
|
+
defaultKeys.forEach((key)=>{
|
|
603
|
+
if (userValues[key]) {
|
|
604
|
+
mergedValues[key] = twMerge(defaultValues[key], userValues[key]);
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
if (mode === 'replace') {
|
|
609
|
+
defaultKeys.forEach((key)=>{
|
|
610
|
+
if (userValues[key]) {
|
|
611
|
+
mergedValues[key] = userValues[key];
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
return mergedValues;
|
|
616
|
+
};
|
|
617
|
+
const mergeTailwindClassnameWithDefault = (userValues, defaultValues)=>userValues ? twMerge(defaultValues, userValues) : defaultValues;
|
|
618
|
+
|
|
589
619
|
const handleSelected = async (isAuthenticated, router, referrer, endSession)=>{
|
|
590
620
|
if (!isAuthenticated) await router.push(`Login?redirect=${referrer}`);
|
|
591
621
|
else {
|
|
@@ -595,7 +625,7 @@ const handleSelected = async (isAuthenticated, router, referrer, endSession)=>{
|
|
|
595
625
|
const LoginButton = ({ icon = /*#__PURE__*/ jsx(MdLogin, {
|
|
596
626
|
className: "pl-1",
|
|
597
627
|
size: '1.55rem'
|
|
598
|
-
}), hideText = false, className =
|
|
628
|
+
}), hideText = false, className = undefined, tooltip, visibility })=>{
|
|
599
629
|
const router = useRouter();
|
|
600
630
|
const pathname = usePathname();
|
|
601
631
|
const { endSession } = useContext(SessionContext) ?? {
|
|
@@ -604,6 +634,7 @@ const LoginButton = ({ icon = /*#__PURE__*/ jsx(MdLogin, {
|
|
|
604
634
|
const userStatus = useCoreSelector((state)=>selectUserAuthStatus(state));
|
|
605
635
|
const authenticated = isAuthenticated(userStatus);
|
|
606
636
|
if (visibility === LoginButtonVisibility.LogoutOnly && !authenticated) return null;
|
|
637
|
+
const mergedClassname = mergeTailwindClassnameWithDefault(className, 'flex flex-nowrap items-center font-content text-secondary-contrast-lighter align-middle border-b-2 hover:border-accent border-transparent mx-2');
|
|
607
638
|
return /*#__PURE__*/ jsx(Tooltip, {
|
|
608
639
|
label: tooltip,
|
|
609
640
|
position: "bottom",
|
|
@@ -615,7 +646,7 @@ const LoginButton = ({ icon = /*#__PURE__*/ jsx(MdLogin, {
|
|
|
615
646
|
children: /*#__PURE__*/ jsx(UnstyledButton, {
|
|
616
647
|
onClick: ()=>handleSelected(authenticated, router, pathname, endSession),
|
|
617
648
|
children: /*#__PURE__*/ jsxs("div", {
|
|
618
|
-
className:
|
|
649
|
+
className: mergedClassname,
|
|
619
650
|
children: [
|
|
620
651
|
!hideText ? authenticated ? 'Logout' : 'Login' : null,
|
|
621
652
|
icon
|
|
@@ -879,8 +910,11 @@ var ContentType;
|
|
|
879
910
|
ContentType["TextArray"] = "textArray";
|
|
880
911
|
ContentType["Html"] = "html";
|
|
881
912
|
ContentType["Markdown"] = "markdown";
|
|
913
|
+
ContentType["TextWithEmail"] = "textWithEmail";
|
|
914
|
+
ContentType["TextWithLink"] = "textWithLink";
|
|
915
|
+
ContentType["Link"] = "link";
|
|
882
916
|
})(ContentType || (ContentType = {}));
|
|
883
|
-
const TextContent = ({ text, className = 'inline text-base-contrast color-red-500 font-medium margin-block-start-1 margin-block-end-1', type = "text" })=>{
|
|
917
|
+
const TextContent = ({ text, className = 'inline text-base-contrast color-red-500 font-medium margin-block-start-1 margin-block-end-1', type = "text", email = undefined, link = undefined })=>{
|
|
884
918
|
switch(type){
|
|
885
919
|
case "html":
|
|
886
920
|
{
|
|
@@ -948,6 +982,48 @@ const TextContent = ({ text, className = 'inline text-base-contrast color-red-50
|
|
|
948
982
|
})
|
|
949
983
|
});
|
|
950
984
|
}
|
|
985
|
+
case "textWithEmail":
|
|
986
|
+
{
|
|
987
|
+
const DEFAULT_STYLE = 'inline color-ink font-medium margin-block-start-1 margin-block-end-1';
|
|
988
|
+
const mergedClassname = className ? twMerge(DEFAULT_STYLE, className) : DEFAULT_STYLE;
|
|
989
|
+
const textString = Array.isArray(text) ? text.join('') : text;
|
|
990
|
+
return /*#__PURE__*/ jsx("div", {
|
|
991
|
+
className: mergedClassname,
|
|
992
|
+
children: /*#__PURE__*/ jsxs("span", {
|
|
993
|
+
children: [
|
|
994
|
+
textString,
|
|
995
|
+
email && /*#__PURE__*/ jsx(Anchor, {
|
|
996
|
+
classNames: {
|
|
997
|
+
root: mergedClassname
|
|
998
|
+
},
|
|
999
|
+
href: `mailto:${email}`,
|
|
1000
|
+
children: ` ${email}.`
|
|
1001
|
+
})
|
|
1002
|
+
]
|
|
1003
|
+
})
|
|
1004
|
+
});
|
|
1005
|
+
}
|
|
1006
|
+
case "textWithLink":
|
|
1007
|
+
{
|
|
1008
|
+
const DEFAULT_STYLE = 'inline color-ink font-medium margin-block-start-1 margin-block-end-1';
|
|
1009
|
+
const mergedClassname = className ? twMerge(DEFAULT_STYLE, className) : DEFAULT_STYLE;
|
|
1010
|
+
const textString = Array.isArray(text) ? text.join('') : text;
|
|
1011
|
+
return /*#__PURE__*/ jsx("div", {
|
|
1012
|
+
className: mergedClassname,
|
|
1013
|
+
children: /*#__PURE__*/ jsxs("span", {
|
|
1014
|
+
children: [
|
|
1015
|
+
textString,
|
|
1016
|
+
link && /*#__PURE__*/ jsx(Anchor, {
|
|
1017
|
+
classNames: {
|
|
1018
|
+
root: mergedClassname
|
|
1019
|
+
},
|
|
1020
|
+
href: link,
|
|
1021
|
+
children: ` ${email}.`
|
|
1022
|
+
})
|
|
1023
|
+
]
|
|
1024
|
+
})
|
|
1025
|
+
});
|
|
1026
|
+
}
|
|
951
1027
|
case "text":
|
|
952
1028
|
default:
|
|
953
1029
|
return /*#__PURE__*/ jsx("div", {
|
|
@@ -959,28 +1035,6 @@ const TextContent = ({ text, className = 'inline text-base-contrast color-red-50
|
|
|
959
1035
|
}
|
|
960
1036
|
};
|
|
961
1037
|
|
|
962
|
-
const DEFAULT_STYLE = 'inline color-ink font-medium margin-block-start-1 margin-block-end-1';
|
|
963
|
-
const ContactWithEmailContent = ({ text, email, className })=>{
|
|
964
|
-
const mergedClassname = className ? twMerge(DEFAULT_STYLE, className) : DEFAULT_STYLE;
|
|
965
|
-
const textString = Array.isArray(text) ? text.join(' ') : text;
|
|
966
|
-
// TODO: add better support for classnames
|
|
967
|
-
return /*#__PURE__*/ jsx("div", {
|
|
968
|
-
className: mergedClassname,
|
|
969
|
-
children: /*#__PURE__*/ jsxs("span", {
|
|
970
|
-
children: [
|
|
971
|
-
textString,
|
|
972
|
-
email && /*#__PURE__*/ jsx(Anchor, {
|
|
973
|
-
classNames: {
|
|
974
|
-
root: mergedClassname
|
|
975
|
-
},
|
|
976
|
-
href: `mailto:${email}`,
|
|
977
|
-
children: ` ${email}.`
|
|
978
|
-
})
|
|
979
|
-
]
|
|
980
|
-
})
|
|
981
|
-
});
|
|
982
|
-
};
|
|
983
|
-
|
|
984
1038
|
const filterRedirect = (redirect)=>{
|
|
985
1039
|
let redirectPath = '';
|
|
986
1040
|
if (Array.isArray(redirect)) {
|
|
@@ -1036,10 +1090,7 @@ const LoginPanel = (loginConfig)=>{
|
|
|
1036
1090
|
loginConfig?.showCredentialsLogin && process.env.NODE_ENV === 'development' && /*#__PURE__*/ jsx(CredentialsLogin, {
|
|
1037
1091
|
handleLogin: handleCredentialsLogin
|
|
1038
1092
|
}),
|
|
1039
|
-
bottomContent?.map((content, index)
|
|
1040
|
-
...content,
|
|
1041
|
-
key: `bottomContent-${index}`
|
|
1042
|
-
}) : /*#__PURE__*/ createElement(TextContent, {
|
|
1093
|
+
bottomContent?.map((content, index)=>/*#__PURE__*/ createElement(TextContent, {
|
|
1043
1094
|
...content,
|
|
1044
1095
|
key: `bottomContent-${index}`
|
|
1045
1096
|
}))
|
|
@@ -2376,35 +2427,6 @@ const extractClassName = (key, classNames)=>{
|
|
|
2376
2427
|
return '';
|
|
2377
2428
|
};
|
|
2378
2429
|
|
|
2379
|
-
/**
|
|
2380
|
-
* Merges default and user values for Tailwind classnames.
|
|
2381
|
-
*
|
|
2382
|
-
* @param {RecordType} defaultValues - The default values for the classnames.
|
|
2383
|
-
* @param {RecordType} userValues - The user-defined values for the classnames.
|
|
2384
|
-
* @param {StylingMergeMode} mode - Whether to merge or replace the default and user values. Default is merge.
|
|
2385
|
-
* @returns {RecordType} - The merged default and user values for the classnames.
|
|
2386
|
-
*/ const mergeDefaultTailwindClassnames = (defaultValues, { mode = 'merge', ...userValues })=>{
|
|
2387
|
-
const defaultKeys = Object.keys(defaultValues);
|
|
2388
|
-
const mergedValues = {
|
|
2389
|
-
...defaultValues
|
|
2390
|
-
};
|
|
2391
|
-
if (mode === 'merge') {
|
|
2392
|
-
defaultKeys.forEach((key)=>{
|
|
2393
|
-
if (userValues[key]) {
|
|
2394
|
-
mergedValues[key] = twMerge(defaultValues[key], userValues[key]);
|
|
2395
|
-
}
|
|
2396
|
-
});
|
|
2397
|
-
}
|
|
2398
|
-
if (mode === 'replace') {
|
|
2399
|
-
defaultKeys.forEach((key)=>{
|
|
2400
|
-
if (userValues[key]) {
|
|
2401
|
-
mergedValues[key] = userValues[key];
|
|
2402
|
-
}
|
|
2403
|
-
});
|
|
2404
|
-
}
|
|
2405
|
-
return mergedValues;
|
|
2406
|
-
};
|
|
2407
|
-
|
|
2408
2430
|
const isPropertyKey = (value)=>{
|
|
2409
2431
|
return typeof value === 'string' || typeof value === 'number' || typeof value === 'symbol';
|
|
2410
2432
|
};
|
|
@@ -2455,8 +2477,9 @@ const FooterRowComponent = ({ item, rowClassname })=>{
|
|
|
2455
2477
|
case 'Links':
|
|
2456
2478
|
{
|
|
2457
2479
|
const links = item[itemType];
|
|
2480
|
+
const mergedClassname = mergeTailwindClassnameWithDefault(className, 'flex space-x-1');
|
|
2458
2481
|
return /*#__PURE__*/ jsx("div", {
|
|
2459
|
-
className:
|
|
2482
|
+
className: mergedClassname,
|
|
2460
2483
|
children: links?.links.map((link, i)=>{
|
|
2461
2484
|
return /*#__PURE__*/ jsxs(React__default.Fragment, {
|
|
2462
2485
|
children: [
|
|
@@ -2591,19 +2614,20 @@ const Gen3Link = ({ className, href, linkType, text, showExternalIcon = false })
|
|
|
2591
2614
|
});
|
|
2592
2615
|
};
|
|
2593
2616
|
|
|
2594
|
-
const LoginAccountButton = ()=>{
|
|
2617
|
+
const LoginAccountButton = ({ className = undefined })=>{
|
|
2595
2618
|
const router = useRouter();
|
|
2596
2619
|
const handleSelected = async ()=>{
|
|
2597
2620
|
await router.push('Profile');
|
|
2598
2621
|
};
|
|
2599
2622
|
const userStatus = useCoreSelector((state)=>selectUserAuthStatus(state));
|
|
2600
2623
|
const userInfo = useCoreSelector((state)=>selectUserDetails(state));
|
|
2624
|
+
const mergedClassname = mergeTailwindClassnameWithDefault(className, 'flex flex-nowrap items-center align-middle border-b-2 hover:border-accent border-transparent');
|
|
2601
2625
|
if (userStatus && isAuthenticated(userStatus)) {
|
|
2602
2626
|
return /*#__PURE__*/ jsx(UnstyledButton, {
|
|
2603
2627
|
className: "mx-2",
|
|
2604
2628
|
onClick: ()=>handleSelected(),
|
|
2605
2629
|
children: /*#__PURE__*/ jsx("div", {
|
|
2606
|
-
className:
|
|
2630
|
+
className: mergedClassname,
|
|
2607
2631
|
children: userInfo?.username
|
|
2608
2632
|
})
|
|
2609
2633
|
});
|
|
@@ -2670,7 +2694,8 @@ const processTopBarItems = (items, showLogin)=>{
|
|
|
2670
2694
|
};
|
|
2671
2695
|
const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, classNames = {} })=>{
|
|
2672
2696
|
const classNamesDefaults = {
|
|
2673
|
-
root: 'flex justify-end items-center align-middle w-100 bg-secondary-lighter'
|
|
2697
|
+
root: 'flex justify-end items-center align-middle w-100 bg-secondary-lighter',
|
|
2698
|
+
login: 'font-content hover:border-accent'
|
|
2674
2699
|
};
|
|
2675
2700
|
const mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
|
|
2676
2701
|
return /*#__PURE__*/ jsx("div", {
|
|
@@ -2682,9 +2707,12 @@ const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, c
|
|
|
2682
2707
|
className: "flex items-center align-middle",
|
|
2683
2708
|
children: [
|
|
2684
2709
|
processTopBarItems(items, loginButtonVisibility === LoginButtonVisibility.Visible),
|
|
2685
|
-
loginButtonVisibility != LoginButtonVisibility.Hidden ? /*#__PURE__*/ jsx(LoginAccountButton, {
|
|
2710
|
+
loginButtonVisibility != LoginButtonVisibility.Hidden ? /*#__PURE__*/ jsx(LoginAccountButton, {
|
|
2711
|
+
className: extractClassName('login', mergedClassnames)
|
|
2712
|
+
}) : null,
|
|
2686
2713
|
loginButtonVisibility != LoginButtonVisibility.Hidden ? /*#__PURE__*/ jsx(LoginButton, {
|
|
2687
|
-
visibility: loginButtonVisibility
|
|
2714
|
+
visibility: loginButtonVisibility,
|
|
2715
|
+
className: extractClassName('login', mergedClassnames)
|
|
2688
2716
|
}) : null
|
|
2689
2717
|
]
|
|
2690
2718
|
})
|
|
@@ -2713,7 +2741,7 @@ const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, c
|
|
|
2713
2741
|
|
|
2714
2742
|
const NavigationLogo = ({ src, title, description, width, height, divider = false, basePath = '', classNames = {} })=>{
|
|
2715
2743
|
const classNamesDefaults = {
|
|
2716
|
-
root: 'relative flex py-
|
|
2744
|
+
root: 'relative flex py-0 justify-start items-center align-middle font-heading font-bold tracking-wide text-xl ml-[5px] mr-[20px]',
|
|
2717
2745
|
link: 'relative object-contain',
|
|
2718
2746
|
logo: 'px-3',
|
|
2719
2747
|
title: 'border-solid border-base-darker ml-1 mr-3',
|
|
@@ -2761,9 +2789,10 @@ const NavigationLogo = ({ src, title, description, width, height, divider = fals
|
|
|
2761
2789
|
* @param name - the name of the button
|
|
2762
2790
|
* @param iconHeight - the height of the icon
|
|
2763
2791
|
* @param classNames - the class names to use for root, label, icon/tooltip and arrow'
|
|
2764
|
-
|
|
2792
|
+
* @param noBasePath - set to true to avoid prepending a basePath to the link
|
|
2793
|
+
*/ const NavigationBarButton = ({ tooltip, icon, href, name, iconHeight = '27px', classNames = {}, noBasePath = false })=>{
|
|
2765
2794
|
const classNamesDefaults = {
|
|
2766
|
-
root:
|
|
2795
|
+
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',
|
|
2767
2796
|
label: 'pt-1.5 body-typo font-heading text-sm text-nowrap',
|
|
2768
2797
|
icon: 'mt-0.5 ml-1',
|
|
2769
2798
|
...TooltipStyle
|
|
@@ -2772,13 +2801,31 @@ const NavigationLogo = ({ src, title, description, width, height, divider = fals
|
|
|
2772
2801
|
return /*#__PURE__*/ jsx(React__default.Fragment, {
|
|
2773
2802
|
children: /*#__PURE__*/ jsx(Tooltip, {
|
|
2774
2803
|
label: tooltip,
|
|
2804
|
+
disabled: !tooltip,
|
|
2775
2805
|
multiline: true,
|
|
2776
2806
|
position: "bottom",
|
|
2777
2807
|
arrowSize: 8,
|
|
2778
2808
|
withArrow: true,
|
|
2779
2809
|
zIndex: 1000,
|
|
2780
2810
|
w: 220,
|
|
2781
|
-
children: /*#__PURE__*/ jsx(
|
|
2811
|
+
children: noBasePath ? /*#__PURE__*/ jsx("a", {
|
|
2812
|
+
href: `${href}`,
|
|
2813
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
2814
|
+
className: extractClassName('root', mergedClassnames),
|
|
2815
|
+
role: "navigation",
|
|
2816
|
+
children: [
|
|
2817
|
+
/*#__PURE__*/ jsx(Icon, {
|
|
2818
|
+
height: iconHeight,
|
|
2819
|
+
icon: icon,
|
|
2820
|
+
className: extractClassName('icon', mergedClassnames)
|
|
2821
|
+
}),
|
|
2822
|
+
/*#__PURE__*/ jsx("p", {
|
|
2823
|
+
className: extractClassName('label', mergedClassnames),
|
|
2824
|
+
children: name
|
|
2825
|
+
})
|
|
2826
|
+
]
|
|
2827
|
+
})
|
|
2828
|
+
}) : /*#__PURE__*/ jsx(Link, {
|
|
2782
2829
|
href: `${// need this to preserve running in hybrid mode
|
|
2783
2830
|
process.env.NEXT_PUBLIC_PORTAL_BASENAME && process.env.NEXT_PUBLIC_PORTAL_BASENAME !== '/' ? process.env.NEXT_PUBLIC_PORTAL_BASENAME : ''}${href}`,
|
|
2784
2831
|
children: /*#__PURE__*/ jsxs("div", {
|
|
@@ -2848,7 +2895,8 @@ const NavigationLogo = ({ src, title, description, width, height, divider = fals
|
|
|
2848
2895
|
icon: x.icon,
|
|
2849
2896
|
href: x.href,
|
|
2850
2897
|
name: x.name,
|
|
2851
|
-
classNames: x.classNames
|
|
2898
|
+
classNames: x.classNames,
|
|
2899
|
+
noBasePath: x?.noBasePath
|
|
2852
2900
|
})
|
|
2853
2901
|
}, `${x.name}-${index}`);
|
|
2854
2902
|
})
|