@gen3/frontend 0.10.82 → 0.10.84

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 (81) hide show
  1. package/LICENSE +201 -0
  2. package/dist/cjs/index.js +155 -99
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/dts/api/auth/credentialsLogin.js +1 -1
  5. package/dist/dts/api/auth/credentialsLogin.js.map +1 -1
  6. package/dist/dts/components/Providers/Gen3Provider.d.ts.map +1 -1
  7. package/dist/dts/components/Providers/Gen3Provider.js +0 -1
  8. package/dist/dts/components/Providers/Gen3Provider.js.map +1 -1
  9. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.d.ts +1 -0
  10. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.d.ts.map +1 -0
  11. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.js +2 -0
  12. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.js.map +1 -0
  13. package/dist/dts/features/CohortDiscovery/storage-persist.d.ts +12 -0
  14. package/dist/dts/features/CohortDiscovery/storage-persist.d.ts.map +1 -0
  15. package/dist/dts/features/CohortDiscovery/storage-persist.js +24 -0
  16. package/dist/dts/features/CohortDiscovery/storage-persist.js.map +1 -0
  17. package/dist/dts/features/DataLibrary/tables/DatalistContentsPanel.d.ts +1 -0
  18. package/dist/dts/features/DataLibrary/tables/DatalistContentsPanel.d.ts.map +1 -0
  19. package/dist/dts/features/DataLibrary/tables/DatalistContentsPanel.js +130 -0
  20. package/dist/dts/features/DataLibrary/tables/DatalistContentsPanel.js.map +1 -0
  21. package/dist/dts/features/Navigation/ActionMenu.d.ts +2 -2
  22. package/dist/dts/features/Navigation/ActionMenu.d.ts.map +1 -1
  23. package/dist/dts/features/Navigation/ActionMenu.js.map +1 -1
  24. package/dist/dts/features/Navigation/Header.d.ts.map +1 -1
  25. package/dist/dts/features/Navigation/Header.js +2 -2
  26. package/dist/dts/features/Navigation/Header.js.map +1 -1
  27. package/dist/dts/features/Navigation/HorizontalClean/HorizontalNavigationBar.d.ts +1 -1
  28. package/dist/dts/features/Navigation/HorizontalClean/HorizontalNavigationBar.d.ts.map +1 -1
  29. package/dist/dts/features/Navigation/TopBar/AccountButton.d.ts +5 -0
  30. package/dist/dts/features/Navigation/TopBar/AccountButton.d.ts.map +1 -0
  31. package/dist/dts/features/Navigation/TopBar/AccountButton.js +78 -0
  32. package/dist/dts/features/Navigation/TopBar/AccountButton.js.map +1 -0
  33. package/dist/dts/features/Navigation/TopBar/IconButton.d.ts +11 -0
  34. package/dist/dts/features/Navigation/TopBar/IconButton.d.ts.map +1 -0
  35. package/dist/dts/features/Navigation/TopBar/IconButton.js +23 -0
  36. package/dist/dts/features/Navigation/TopBar/IconButton.js.map +1 -0
  37. package/dist/dts/features/Navigation/TopBar/IconButton.stories.d.ts +35 -0
  38. package/dist/dts/features/Navigation/TopBar/IconButton.stories.d.ts.map +1 -0
  39. package/dist/dts/features/Navigation/TopBar/IconButton.stories.js +40 -0
  40. package/dist/dts/features/Navigation/TopBar/IconButton.stories.js.map +1 -0
  41. package/dist/dts/features/Navigation/TopBar/LoginButton.d.ts +10 -0
  42. package/dist/dts/features/Navigation/TopBar/LoginButton.d.ts.map +1 -0
  43. package/dist/dts/features/Navigation/TopBar/LoginButton.js +80 -0
  44. package/dist/dts/features/Navigation/TopBar/LoginButton.js.map +1 -0
  45. package/dist/dts/features/Navigation/TopBar/TopBar.d.ts +13 -0
  46. package/dist/dts/features/Navigation/TopBar/TopBar.d.ts.map +1 -0
  47. package/dist/dts/features/Navigation/TopBar/TopBar.js +39 -0
  48. package/dist/dts/features/Navigation/TopBar/TopBar.js.map +1 -0
  49. package/dist/dts/features/Navigation/TopBar/TopBar.stories.d.ts +14 -0
  50. package/dist/dts/features/Navigation/TopBar/TopBar.stories.d.ts.map +1 -0
  51. package/dist/dts/features/Navigation/TopBar/TopBar.stories.js +44 -0
  52. package/dist/dts/features/Navigation/TopBar/TopBar.stories.js.map +1 -0
  53. package/dist/dts/features/Navigation/TopBar.d.ts +4 -2
  54. package/dist/dts/features/Navigation/TopBar.d.ts.map +1 -1
  55. package/dist/dts/features/Navigation/TopBar.js +24 -6
  56. package/dist/dts/features/Navigation/TopBar.js.map +1 -1
  57. package/dist/dts/features/Navigation/TopBar.stories.d.ts +14 -0
  58. package/dist/dts/features/Navigation/TopBar.stories.d.ts.map +1 -0
  59. package/dist/dts/features/Navigation/TopBar.stories.js +30 -0
  60. package/dist/dts/features/Navigation/TopBar.stories.js.map +1 -0
  61. package/dist/dts/features/Navigation/Vertical/VerticalTopBar.d.ts +1 -1
  62. package/dist/dts/features/Navigation/Vertical/VerticalTopBar.d.ts.map +1 -1
  63. package/dist/dts/features/Navigation/index.d.ts +1 -1
  64. package/dist/dts/features/Navigation/index.d.ts.map +1 -1
  65. package/dist/dts/features/Navigation/types.d.ts +8 -1
  66. package/dist/dts/features/Navigation/types.d.ts.map +1 -1
  67. package/dist/dts/index.d.ts +2 -1
  68. package/dist/dts/index.d.ts.map +1 -1
  69. package/dist/dts/index.js +2 -1
  70. package/dist/dts/index.js.map +1 -1
  71. package/dist/dts/types/styling.d.ts +2 -2
  72. package/dist/dts/types/styling.d.ts.map +1 -1
  73. package/dist/dts/utils/mergeDefaultTailwindClassnames.d.ts +5 -7
  74. package/dist/dts/utils/mergeDefaultTailwindClassnames.d.ts.map +1 -1
  75. package/dist/dts/utils/mergeDefaultTailwindClassnames.js +3 -3
  76. package/dist/dts/utils/mergeDefaultTailwindClassnames.js.map +1 -1
  77. package/dist/esm/index.js +154 -99
  78. package/dist/esm/index.js.map +1 -1
  79. package/dist/index.d.ts +20 -13
  80. package/dist/tsconfig.tsbuildinfo +1 -1
  81. package/package.json +5 -4
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/dist/cjs/index.js CHANGED
@@ -985,10 +985,10 @@ var LoginButtonVisibility = /*#__PURE__*/ function(LoginButtonVisibility) {
985
985
  /**
986
986
  * Merges default and user values for Tailwind classnames.
987
987
  *
988
- * @param {RecordType} defaultValues - The default values for the classnames.
989
- * @param {RecordType} userValues - The user-defined values for the classnames.
988
+ * @param {StylingOverride} defaultValues - The default values for the classnames.
989
+ * @param {StylingOverride} userValues - The user-defined values for the classnames.
990
990
  * @param {StylingMergeMode} mode - Whether to merge or replace the default and user values. Default is merge.
991
- * @returns {RecordType} - The merged default and user values for the classnames.
991
+ * @returns {StylingOverride} - The merged default and user values for the classnames.
992
992
  */ const mergeDefaultTailwindClassnames = (defaultValues, { mode = 'merge', ...userValues })=>{
993
993
  const defaultKeys = Object.keys(defaultValues);
994
994
  const mergedValues = {
@@ -1012,13 +1012,13 @@ var LoginButtonVisibility = /*#__PURE__*/ function(LoginButtonVisibility) {
1012
1012
  };
1013
1013
  const mergeTailwindClassnameWithDefault = (userValues, defaultValues)=>userValues ? tailwindMerge.twMerge(defaultValues, userValues) : defaultValues;
1014
1014
 
1015
- const handleSelected = async (isAuthenticated, router, referrer, endSession, externalLoginUrl)=>{
1015
+ const handleSelected$1 = async (isAuthenticated, router, referrer, endSession, externalLoginUrl)=>{
1016
1016
  if (!isAuthenticated) await router.push(externalLoginUrl || `Login?redirect=${referrer}`);
1017
1017
  else {
1018
1018
  if (endSession) endSession();
1019
1019
  }
1020
1020
  };
1021
- const LoginButton = ({ icon = /*#__PURE__*/ jsxRuntime.jsx(md.MdLogin, {
1021
+ const LoginButton$1 = ({ icon = /*#__PURE__*/ jsxRuntime.jsx(md.MdLogin, {
1022
1022
  className: "pl-1",
1023
1023
  size: '1.55rem'
1024
1024
  }), hideText = false, className = undefined, tooltip, visibility, externalLoginUrl })=>{
@@ -1040,7 +1040,7 @@ const LoginButton = ({ icon = /*#__PURE__*/ jsxRuntime.jsx(md.MdLogin, {
1040
1040
  disabled: tooltip === undefined,
1041
1041
  classNames: TooltipStyle,
1042
1042
  children: /*#__PURE__*/ jsxRuntime.jsx(core$1.UnstyledButton, {
1043
- onClick: ()=>handleSelected(authenticated, router$1, pathname, endSession, externalLoginUrl),
1043
+ onClick: ()=>handleSelected$1(authenticated, router$1, pathname, endSession, externalLoginUrl),
1044
1044
  children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
1045
1045
  className: mergedClassname,
1046
1046
  children: [
@@ -3057,28 +3057,16 @@ const Gen3Link = ({ className, href, linkType, text, showExternalIcon = false })
3057
3057
  });
3058
3058
  };
3059
3059
 
3060
- const LoginAccountButton = ({ className = undefined })=>{
3061
- const router$1 = router.useRouter();
3062
- const handleSelected = async ()=>{
3063
- await router$1.push('Profile');
3064
- };
3065
- const userStatus = core.useCoreSelector((state)=>core.selectUserAuthStatus(state));
3066
- const userInfo = core.useCoreSelector((state)=>core.selectUserDetails(state));
3067
- const mergedClassname = mergeTailwindClassnameWithDefault(className, 'flex flex-nowrap items-center align-middle border-b-2 hover:border-accent border-transparent');
3068
- if (userStatus && core.isAuthenticated(userStatus)) {
3069
- return /*#__PURE__*/ jsxRuntime.jsx(core$1.UnstyledButton, {
3070
- className: "mx-2",
3071
- onClick: ()=>handleSelected(),
3072
- children: /*#__PURE__*/ jsxRuntime.jsx("div", {
3073
- className: mergedClassname,
3074
- children: userInfo?.username
3075
- })
3076
- });
3077
- }
3078
- return null;
3060
+ const IconSize = {
3061
+ xs: 14,
3062
+ sm: 16,
3063
+ md: 20,
3064
+ lg: 24,
3065
+ xl: 32,
3066
+ 'xl-2': 36
3079
3067
  };
3080
3068
 
3081
- const TopIconButton = ({ name, leftIcon = undefined, rightIcon = undefined, classNames = {}, drawBorder = true })=>{
3069
+ const IconButton = ({ name, leftIcon = undefined, rightIcon = undefined, iconSize = 'md', tooltip = undefined, classNames = {}, clickHandler = undefined, ariaLabel = undefined })=>{
3082
3070
  const classNamesDefaults = {
3083
3071
  root: `flex items-center align-middle px-2 my-2`,
3084
3072
  button: 'flex flex-nowrap items-center align-middle border-b-2 hover:border-accent border-transparent',
@@ -3087,68 +3075,142 @@ const TopIconButton = ({ name, leftIcon = undefined, rightIcon = undefined, clas
3087
3075
  rightIcon: 'text-secondary-contrast-lighter pl-1'
3088
3076
  };
3089
3077
  const mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
3078
+ // get the icon size otherwise use the value of iconsSize as a string value: e.g. 2em
3079
+ const iconSz = IconSize[iconSize] ?? iconSize;
3090
3080
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
3091
3081
  className: extractClassName('root', mergedClassnames),
3092
- "aria-label": name,
3093
- children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
3094
- className: extractClassName('button', mergedClassnames),
3095
- role: "button",
3096
- children: [
3097
- leftIcon ? /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
3098
- icon: leftIcon,
3099
- className: extractClassName('leftIcon', mergedClassnames)
3100
- }) : null,
3101
- /*#__PURE__*/ jsxRuntime.jsxs("p", {
3102
- className: extractClassName('label', mergedClassnames),
3103
- children: [
3104
- " ",
3105
- name,
3106
- " "
3107
- ]
3108
- }),
3109
- rightIcon ? /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
3110
- icon: rightIcon,
3111
- className: extractClassName('rightIcon', mergedClassnames)
3112
- }) : null
3113
- ]
3082
+ children: /*#__PURE__*/ jsxRuntime.jsx(core$1.Tooltip, {
3083
+ label: tooltip,
3084
+ position: "bottom",
3085
+ withArrow: true,
3086
+ multiline: true,
3087
+ color: "base",
3088
+ disabled: tooltip === undefined,
3089
+ classNames: TooltipStyle,
3090
+ children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
3091
+ className: extractClassName('button', mergedClassnames),
3092
+ role: "button",
3093
+ "aria-label": ariaLabel ?? name,
3094
+ onClick: (event)=>clickHandler && clickHandler(),
3095
+ children: [
3096
+ leftIcon ? /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
3097
+ icon: leftIcon,
3098
+ width: iconSz,
3099
+ height: iconSz,
3100
+ className: extractClassName('leftIcon', mergedClassnames)
3101
+ }) : null,
3102
+ /*#__PURE__*/ jsxRuntime.jsx("p", {
3103
+ className: extractClassName('label', mergedClassnames),
3104
+ children: name
3105
+ }),
3106
+ rightIcon && rightIcon.length > 0 ? /*#__PURE__*/ jsxRuntime.jsx(react.Icon, {
3107
+ width: iconSz,
3108
+ height: iconSz,
3109
+ icon: rightIcon,
3110
+ className: extractClassName('rightIcon', mergedClassnames)
3111
+ }) : null
3112
+ ]
3113
+ })
3114
3114
  })
3115
3115
  });
3116
3116
  };
3117
- const processTopBarItems = (items, showLogin)=>{
3117
+
3118
+ const AccountButton = ({ leftIcon = undefined, rightIcon = undefined, iconSize = 'md', classNames = {}, tooltip = 'See account profile' })=>{
3119
+ const classNamesDefaults = {
3120
+ root: `flex items-center align-middle px-2 my-2`,
3121
+ button: 'flex flex-nowrap items-center align-middle border-b-2 hover:border-accent border-transparent',
3122
+ leftIcon: 'text-secondary-contrast-lighter pr-1',
3123
+ label: 'font-content text-secondary-contrast-lighter block',
3124
+ rightIcon: 'text-secondary-contrast-lighter pl-1'
3125
+ };
3126
+ const mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
3127
+ const router$1 = router.useRouter();
3128
+ const handleSelected = async ()=>{
3129
+ await router$1.push('Profile');
3130
+ };
3131
+ const userInfo = core.useCoreSelector((state)=>core.selectUserDetails(state));
3132
+ const userStatus = core.useCoreSelector((state)=>core.selectUserAuthStatus(state));
3133
+ const authenticated = core.isAuthenticated(userStatus);
3134
+ if (!authenticated) return null;
3135
+ return /*#__PURE__*/ jsxRuntime.jsx(IconButton, {
3136
+ name: userInfo?.username ?? 'Profile',
3137
+ leftIcon: leftIcon,
3138
+ rightIcon: rightIcon,
3139
+ iconSize: iconSize,
3140
+ classNames: mergedClassnames,
3141
+ clickHandler: handleSelected,
3142
+ tooltip: tooltip
3143
+ });
3144
+ };
3145
+
3146
+ const handleSelected = async (isAuthenticated, router, referrer, endSession, externalLoginUrl)=>{
3147
+ if (!isAuthenticated) await router.push(externalLoginUrl || `Login?redirect=${referrer}`);
3148
+ else {
3149
+ if (endSession) endSession();
3150
+ }
3151
+ };
3152
+ const LoginButton = ({ name = 'login', leftIcon = undefined, rightIcon = undefined, tooltip = 'Login to your account', visibility, externalLoginUrl, iconSize = 'md', classNames = {} })=>{
3153
+ const router$1 = router.useRouter();
3154
+ const pathname = navigation.usePathname();
3155
+ const { endSession } = React.useContext(SessionContext) ?? {
3156
+ endSession: undefined
3157
+ };
3158
+ const userStatus = core.useCoreSelector((state)=>core.selectUserAuthStatus(state));
3159
+ const authenticated = core.isAuthenticated(userStatus);
3160
+ if (visibility === LoginButtonVisibility.LogoutOnly && !authenticated) return null;
3161
+ return /*#__PURE__*/ jsxRuntime.jsx(IconButton, {
3162
+ name: authenticated ? 'Logout' : 'Login',
3163
+ leftIcon: leftIcon,
3164
+ rightIcon: authenticated ? 'gen3:logout' : 'gen3:login',
3165
+ iconSize: iconSize,
3166
+ classNames: classNames,
3167
+ clickHandler: ()=>handleSelected(authenticated, router$1, pathname, endSession, externalLoginUrl)
3168
+ });
3169
+ };
3170
+
3171
+ const processTopBarItems = (items, classNames, dividerClassname)=>{
3118
3172
  return items.reduce((acc, item, index)=>{
3119
- const needsBorder = !(index === items.length - 1 && !showLogin);
3120
- acc.push(/*#__PURE__*/ jsxRuntime.jsxs("a", {
3121
- className: "flex",
3122
- href: item.href,
3173
+ const mergedClassnames = item?.classNames ? mergeDefaultTailwindClassnames(classNames, item.classNames) : classNames;
3174
+ acc.push(/*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
3123
3175
  children: [
3124
- ' ',
3125
- /*#__PURE__*/ jsxRuntime.jsx(TopIconButton, {
3126
- name: item.name,
3127
- leftIcon: item.leftIcon,
3128
- rightIcon: item.rightIcon,
3129
- classNames: item.classNames,
3130
- drawBorder: needsBorder
3131
- }),
3132
- ' ',
3176
+ /*#__PURE__*/ jsxRuntime.jsx("a", {
3177
+ className: "flex",
3178
+ href: item.href,
3179
+ children: /*#__PURE__*/ jsxRuntime.jsx(IconButton, {
3180
+ name: item.name,
3181
+ iconSize: item.iconSize,
3182
+ leftIcon: item.leftIcon,
3183
+ rightIcon: item.rightIcon,
3184
+ classNames: mergedClassnames
3185
+ })
3186
+ }, `${item.href}_${item.name}`),
3133
3187
  /*#__PURE__*/ jsxRuntime.jsx(core$1.Divider, {
3134
3188
  size: "md",
3135
- color: "accent.4",
3136
3189
  orientation: "vertical",
3137
3190
  classNames: {
3138
- root: 'my-2'
3191
+ root: dividerClassname
3139
3192
  }
3140
3193
  })
3141
3194
  ]
3142
- }, `${item.href}_${item.name}`));
3195
+ }));
3143
3196
  return acc;
3144
3197
  }, []);
3145
3198
  };
3146
- const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, externalLoginUrl, classNames = {} })=>{
3199
+ const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, externalLoginUrl, classNames = {}, itemClassnames = {} })=>{
3147
3200
  const classNamesDefaults = {
3148
3201
  root: 'flex justify-end items-center align-middle w-100 bg-secondary-lighter',
3149
- login: 'font-content hover:border-accent'
3202
+ login: 'font-content hover:border-accent',
3203
+ divider: 'border-accent my-2'
3204
+ };
3205
+ const itemClassnameDefaults = {
3206
+ root: `flex items-center align-middle px-2 my-2`,
3207
+ button: 'flex flex-nowrap items-center align-middle border-b-2 hover:border-accent border-transparent',
3208
+ leftIcon: 'text-secondary-contrast-lighter pr-1',
3209
+ label: 'font-content text-secondary-contrast-lighter block',
3210
+ rightIcon: 'text-secondary-contrast-lighter pl-1'
3150
3211
  };
3151
3212
  const mergedClassnames = mergeDefaultTailwindClassnames(classNamesDefaults, classNames);
3213
+ const mergedItemClassnames = mergeDefaultTailwindClassnames(itemClassnameDefaults, itemClassnames);
3152
3214
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
3153
3215
  children: /*#__PURE__*/ jsxRuntime.jsx("header", {
3154
3216
  className: extractClassName('root', mergedClassnames),
@@ -3157,27 +3219,30 @@ const TopBar = ({ items, loginButtonVisibility = LoginButtonVisibility.Hidden, e
3157
3219
  "aria-label": "top most navigation",
3158
3220
  className: "flex items-center align-middle",
3159
3221
  children: [
3160
- processTopBarItems(items, loginButtonVisibility === LoginButtonVisibility.Visible),
3161
- loginButtonVisibility != LoginButtonVisibility.Hidden ? /*#__PURE__*/ jsxRuntime.jsxs("div", {
3162
- className: "flex items-center",
3222
+ processTopBarItems(items, mergedItemClassnames, extractClassName('divider', mergedClassnames)),
3223
+ loginButtonVisibility != LoginButtonVisibility.Hidden ? /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
3163
3224
  children: [
3164
- /*#__PURE__*/ jsxRuntime.jsx(LoginAccountButton, {
3165
- className: extractClassName('login', mergedClassnames)
3225
+ /*#__PURE__*/ jsxRuntime.jsxs("span", {
3226
+ className: "flex items-center align-middle [&>*:only-child]:hidden",
3227
+ children: [
3228
+ /*#__PURE__*/ jsxRuntime.jsx(AccountButton, {
3229
+ classNames: mergedItemClassnames
3230
+ }),
3231
+ /*#__PURE__*/ jsxRuntime.jsx(core$1.Divider, {
3232
+ size: "md",
3233
+ classNames: {
3234
+ root: extractClassName('divider', mergedClassnames)
3235
+ },
3236
+ orientation: "vertical"
3237
+ })
3238
+ ]
3166
3239
  }),
3167
- /*#__PURE__*/ jsxRuntime.jsx(core$1.Divider, {
3168
- size: "md",
3169
- color: "accent.4",
3170
- orientation: "vertical"
3240
+ /*#__PURE__*/ jsxRuntime.jsx(LoginButton, {
3241
+ visibility: loginButtonVisibility,
3242
+ externalLoginUrl: externalLoginUrl,
3243
+ classNames: mergedItemClassnames
3171
3244
  })
3172
3245
  ]
3173
- }) : null,
3174
- loginButtonVisibility != LoginButtonVisibility.Hidden ? /*#__PURE__*/ jsxRuntime.jsx("div", {
3175
- className: "flex items-center",
3176
- children: /*#__PURE__*/ jsxRuntime.jsx(LoginButton, {
3177
- visibility: loginButtonVisibility,
3178
- externalLoginUrl: externalLoginUrl,
3179
- className: extractClassName('login', mergedClassnames)
3180
- })
3181
3246
  }) : null
3182
3247
  ]
3183
3248
  })
@@ -3511,7 +3576,7 @@ const HorizontalNavigationBar = ({ actions, items, logo = undefined, loginIcon =
3511
3576
  /*#__PURE__*/ jsxRuntime.jsxs("div", {
3512
3577
  className: "flex items-center align-middle mr-3",
3513
3578
  children: [
3514
- actions.loginButtonVisibility === LoginButtonVisibility.Visible ? /*#__PURE__*/ jsxRuntime.jsx(LoginButton, {
3579
+ actions.loginButtonVisibility === LoginButtonVisibility.Visible ? /*#__PURE__*/ jsxRuntime.jsx(LoginButton$1, {
3515
3580
  icon: loginIcon,
3516
3581
  hideText: true,
3517
3582
  className: `${extractClassName('login', mergedClassnames)}`,
@@ -3577,6 +3642,9 @@ const HorizontalNavigationBar = ({ actions, items, logo = undefined, loginIcon =
3577
3642
  externalLoginUrl: top?.externalLoginUrl,
3578
3643
  classNames: {
3579
3644
  ...top.classNames
3645
+ },
3646
+ itemClassnames: {
3647
+ ...top.itemClassnames
3580
3648
  }
3581
3649
  }),
3582
3650
  banners?.map((banner)=>/*#__PURE__*/ React.createElement(Banner, {
@@ -14904,10 +14972,6 @@ const createMantineTheme = (fonts, colors)=>{
14904
14972
  Object.values(values)
14905
14973
  ] : [])),
14906
14974
  primaryColor: 'primary',
14907
- primaryShade: {
14908
- light: 4,
14909
- dark: 7
14910
- },
14911
14975
  breakpoints: {
14912
14976
  xs: '31.25em',
14913
14977
  sm: '50em',
@@ -18569,15 +18633,6 @@ const getNumberOfSelectedItemsInList = (selections, listId)=>{
18569
18633
  };
18570
18634
  const isListInSelection = (listId, selections)=>listId in selections;
18571
18635
 
18572
- const IconSize = {
18573
- xs: 14,
18574
- sm: 16,
18575
- md: 20,
18576
- lg: 24,
18577
- xl: 32,
18578
- 'xl-2': 36
18579
- };
18580
-
18581
18636
  const SearchAndActions = ({ createList, gatherData, size = 'sm' })=>{
18582
18637
  const { selections, clearSelections } = useDataLibrarySelection();
18583
18638
  const retrieveDisabled = Object.keys(selections).length === 0;
@@ -20847,7 +20902,7 @@ exports.Header = Header;
20847
20902
  exports.HoverLink = HoverLink;
20848
20903
  exports.LandingPage = LandingPage;
20849
20904
  exports.LandingPageGetStaticProps = LandingPageGetStaticProps;
20850
- exports.LoginButton = LoginButton;
20905
+ exports.LoginButton = LoginButton$1;
20851
20906
  exports.LoginPage = LoginPage;
20852
20907
  exports.LoginPageGetServerSideProps = LoginPageGetServerSideProps;
20853
20908
  exports.LoginPanel = LoginPanel;
@@ -20874,6 +20929,7 @@ exports.SubmissionPage = SubmissionPage;
20874
20929
  exports.SubmissionPageGetServerSideProps = SubmissionPageGetServerSideProps;
20875
20930
  exports.TagCloud = TagCloud;
20876
20931
  exports.TailwindConfig = TailwindConfig;
20932
+ exports.TopBar = TopBar;
20877
20933
  exports.UploadJSONButton = UploadJSONButton;
20878
20934
  exports.User = User;
20879
20935
  exports.Workspace = Workspace;