@replicated/portal-components 0.0.2 → 0.0.3

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 (216) hide show
  1. package/components/metadata/registry.json +83 -2
  2. package/components/metadata/registry.md +27 -2
  3. package/dist/actions/index.d.mts +566 -3
  4. package/dist/actions/index.d.ts +566 -3
  5. package/dist/actions/index.js +1853 -12
  6. package/dist/actions/index.js.map +1 -1
  7. package/dist/airgap-instances.d.mts +26 -0
  8. package/dist/airgap-instances.d.ts +26 -0
  9. package/dist/airgap-instances.js +354 -0
  10. package/dist/airgap-instances.js.map +1 -0
  11. package/dist/error-page.d.mts +14 -0
  12. package/dist/error-page.d.ts +14 -0
  13. package/dist/error-page.js +153 -0
  14. package/dist/error-page.js.map +1 -0
  15. package/dist/error.d.mts +15 -0
  16. package/dist/error.d.ts +15 -0
  17. package/dist/error.js +144 -0
  18. package/dist/error.js.map +1 -0
  19. package/dist/esm/actions/index.js +1816 -13
  20. package/dist/esm/actions/index.js.map +1 -1
  21. package/dist/esm/airgap-instances.js +352 -0
  22. package/dist/esm/airgap-instances.js.map +1 -0
  23. package/dist/esm/error-page.js +151 -0
  24. package/dist/esm/error-page.js.map +1 -0
  25. package/dist/esm/error.js +142 -0
  26. package/dist/esm/error.js.map +1 -0
  27. package/dist/esm/helm-install-wizard.js +1007 -0
  28. package/dist/esm/helm-install-wizard.js.map +1 -0
  29. package/dist/esm/index.js +2232 -155
  30. package/dist/esm/index.js.map +1 -1
  31. package/dist/esm/install-actions.js +746 -0
  32. package/dist/esm/install-actions.js.map +1 -0
  33. package/dist/esm/install-card.js +115 -0
  34. package/dist/esm/install-card.js.map +1 -0
  35. package/dist/esm/install-targets.js +48 -0
  36. package/dist/esm/install-targets.js.map +1 -0
  37. package/dist/esm/instance-card.js +197 -0
  38. package/dist/esm/instance-card.js.map +1 -0
  39. package/dist/esm/join-team.js +218 -0
  40. package/dist/esm/join-team.js.map +1 -0
  41. package/dist/esm/license-card.js +131 -0
  42. package/dist/esm/license-card.js.map +1 -0
  43. package/dist/esm/license-details.js +667 -0
  44. package/dist/esm/license-details.js.map +1 -0
  45. package/dist/esm/linux-install-wizard.js +1083 -0
  46. package/dist/esm/linux-install-wizard.js.map +1 -0
  47. package/dist/esm/login.js +261 -0
  48. package/dist/esm/login.js.map +1 -0
  49. package/dist/esm/online-instance-list.js +287 -0
  50. package/dist/esm/online-instance-list.js.map +1 -0
  51. package/dist/esm/pending-installations.js +235 -0
  52. package/dist/esm/pending-installations.js.map +1 -0
  53. package/dist/esm/release-history-panel.js +100 -0
  54. package/dist/esm/release-history-panel.js.map +1 -0
  55. package/dist/esm/release-notes-card.js +23 -0
  56. package/dist/esm/release-notes-card.js.map +1 -0
  57. package/dist/esm/security-card.js +700 -0
  58. package/dist/esm/security-card.js.map +1 -0
  59. package/dist/esm/support-bundle-collection-card.js +170 -0
  60. package/dist/esm/support-bundle-collection-card.js.map +1 -0
  61. package/dist/esm/support-bundles-card.js +306 -0
  62. package/dist/esm/support-bundles-card.js.map +1 -0
  63. package/dist/esm/support-card.js +305 -0
  64. package/dist/esm/support-card.js.map +1 -0
  65. package/dist/esm/team-selection.js +117 -0
  66. package/dist/esm/team-selection.js.map +1 -0
  67. package/dist/esm/team-settings-card.js +78 -0
  68. package/dist/esm/team-settings-card.js.map +1 -0
  69. package/dist/esm/team-settings.js +136 -0
  70. package/dist/esm/team-settings.js.map +1 -0
  71. package/dist/esm/top-nav-user-menu.js +173 -0
  72. package/dist/esm/top-nav-user-menu.js.map +1 -0
  73. package/dist/esm/top-nav.js +398 -0
  74. package/dist/esm/top-nav.js.map +1 -0
  75. package/dist/esm/update-layout.js +405 -0
  76. package/dist/esm/update-layout.js.map +1 -0
  77. package/dist/esm/updates-card.js +85 -0
  78. package/dist/esm/updates-card.js.map +1 -0
  79. package/dist/esm/upload-support-bundle-modal.js +143 -0
  80. package/dist/esm/upload-support-bundle-modal.js.map +1 -0
  81. package/dist/esm/user-settings-card.js +21 -0
  82. package/dist/esm/user-settings-card.js.map +1 -0
  83. package/dist/esm/user-settings.js +368 -0
  84. package/dist/esm/user-settings.js.map +1 -0
  85. package/dist/esm/utils/index.js +170 -0
  86. package/dist/esm/utils/index.js.map +1 -0
  87. package/dist/helm-install-wizard.d.mts +38 -0
  88. package/dist/helm-install-wizard.d.ts +38 -0
  89. package/dist/helm-install-wizard.js +1011 -0
  90. package/dist/helm-install-wizard.js.map +1 -0
  91. package/dist/index.d.mts +11 -27
  92. package/dist/index.d.ts +11 -27
  93. package/dist/index.js +2258 -154
  94. package/dist/index.js.map +1 -1
  95. package/dist/install-B19AaKF_.d.mts +233 -0
  96. package/dist/install-Bi1qJ8Bu.d.ts +233 -0
  97. package/dist/install-actions.d.mts +141 -0
  98. package/dist/install-actions.d.ts +141 -0
  99. package/dist/install-actions.js +765 -0
  100. package/dist/install-actions.js.map +1 -0
  101. package/dist/install-card.d.mts +15 -0
  102. package/dist/install-card.d.ts +15 -0
  103. package/dist/install-card.js +117 -0
  104. package/dist/install-card.js.map +1 -0
  105. package/dist/install-targets.d.mts +19 -0
  106. package/dist/install-targets.d.ts +19 -0
  107. package/dist/install-targets.js +50 -0
  108. package/dist/install-targets.js.map +1 -0
  109. package/dist/instance-card.d.mts +22 -0
  110. package/dist/instance-card.d.ts +22 -0
  111. package/dist/instance-card.js +199 -0
  112. package/dist/instance-card.js.map +1 -0
  113. package/dist/join-team.d.mts +30 -0
  114. package/dist/join-team.d.ts +30 -0
  115. package/dist/join-team.js +220 -0
  116. package/dist/join-team.js.map +1 -0
  117. package/dist/license-card.d.mts +15 -0
  118. package/dist/license-card.d.ts +15 -0
  119. package/dist/license-card.js +133 -0
  120. package/dist/license-card.js.map +1 -0
  121. package/dist/license-details.d.mts +10 -0
  122. package/dist/license-details.d.ts +10 -0
  123. package/dist/license-details.js +669 -0
  124. package/dist/license-details.js.map +1 -0
  125. package/dist/linux-install-wizard.d.mts +66 -0
  126. package/dist/linux-install-wizard.d.ts +66 -0
  127. package/dist/linux-install-wizard.js +1093 -0
  128. package/dist/linux-install-wizard.js.map +1 -0
  129. package/dist/login.d.mts +37 -0
  130. package/dist/login.d.ts +37 -0
  131. package/dist/login.js +263 -0
  132. package/dist/login.js.map +1 -0
  133. package/dist/online-instance-list.d.mts +22 -0
  134. package/dist/online-instance-list.d.ts +22 -0
  135. package/dist/online-instance-list.js +289 -0
  136. package/dist/online-instance-list.js.map +1 -0
  137. package/dist/pending-installations.d.mts +15 -0
  138. package/dist/pending-installations.d.ts +15 -0
  139. package/dist/pending-installations.js +237 -0
  140. package/dist/pending-installations.js.map +1 -0
  141. package/dist/release-history-panel.d.mts +22 -0
  142. package/dist/release-history-panel.d.ts +22 -0
  143. package/dist/release-history-panel.js +102 -0
  144. package/dist/release-history-panel.js.map +1 -0
  145. package/dist/release-notes-card.d.mts +13 -0
  146. package/dist/release-notes-card.d.ts +13 -0
  147. package/dist/release-notes-card.js +25 -0
  148. package/dist/release-notes-card.js.map +1 -0
  149. package/dist/security-card.d.mts +73 -0
  150. package/dist/security-card.d.ts +73 -0
  151. package/dist/security-card.js +702 -0
  152. package/dist/security-card.js.map +1 -0
  153. package/dist/styles.css +1877 -194
  154. package/dist/support-bundle-collection-card.d.mts +20 -0
  155. package/dist/support-bundle-collection-card.d.ts +20 -0
  156. package/dist/support-bundle-collection-card.js +172 -0
  157. package/dist/support-bundle-collection-card.js.map +1 -0
  158. package/dist/support-bundles-card.d.mts +19 -0
  159. package/dist/support-bundles-card.d.ts +19 -0
  160. package/dist/support-bundles-card.js +308 -0
  161. package/dist/support-bundles-card.js.map +1 -0
  162. package/dist/support-card.d.mts +8 -0
  163. package/dist/support-card.d.ts +8 -0
  164. package/dist/support-card.js +307 -0
  165. package/dist/support-card.js.map +1 -0
  166. package/dist/team-selection.d.mts +23 -0
  167. package/dist/team-selection.d.ts +23 -0
  168. package/dist/team-selection.js +119 -0
  169. package/dist/team-selection.js.map +1 -0
  170. package/dist/team-settings-card-Dq1d9b5c.d.mts +14 -0
  171. package/dist/team-settings-card-Dq1d9b5c.d.ts +14 -0
  172. package/dist/team-settings-card.d.mts +2 -0
  173. package/dist/team-settings-card.d.ts +2 -0
  174. package/dist/team-settings-card.js +80 -0
  175. package/dist/team-settings-card.js.map +1 -0
  176. package/dist/team-settings.d.mts +25 -0
  177. package/dist/team-settings.d.ts +25 -0
  178. package/dist/team-settings.js +138 -0
  179. package/dist/team-settings.js.map +1 -0
  180. package/dist/top-nav-0mb1K_H0.d.mts +32 -0
  181. package/dist/top-nav-0mb1K_H0.d.ts +32 -0
  182. package/dist/top-nav-user-menu.d.mts +18 -0
  183. package/dist/top-nav-user-menu.d.ts +18 -0
  184. package/dist/top-nav-user-menu.js +175 -0
  185. package/dist/top-nav-user-menu.js.map +1 -0
  186. package/dist/top-nav.d.mts +3 -0
  187. package/dist/top-nav.d.ts +3 -0
  188. package/dist/top-nav.js +400 -0
  189. package/dist/top-nav.js.map +1 -0
  190. package/dist/update-layout.d.mts +12 -0
  191. package/dist/update-layout.d.ts +12 -0
  192. package/dist/update-layout.js +407 -0
  193. package/dist/update-layout.js.map +1 -0
  194. package/dist/updates-card-BbubBrVR.d.mts +18 -0
  195. package/dist/updates-card-BbubBrVR.d.ts +18 -0
  196. package/dist/updates-card.d.mts +2 -0
  197. package/dist/updates-card.d.ts +2 -0
  198. package/dist/updates-card.js +87 -0
  199. package/dist/updates-card.js.map +1 -0
  200. package/dist/upload-support-bundle-modal.d.mts +19 -0
  201. package/dist/upload-support-bundle-modal.d.ts +19 -0
  202. package/dist/upload-support-bundle-modal.js +145 -0
  203. package/dist/upload-support-bundle-modal.js.map +1 -0
  204. package/dist/user-settings-card.d.mts +8 -0
  205. package/dist/user-settings-card.d.ts +8 -0
  206. package/dist/user-settings-card.js +23 -0
  207. package/dist/user-settings-card.js.map +1 -0
  208. package/dist/user-settings.d.mts +47 -0
  209. package/dist/user-settings.d.ts +47 -0
  210. package/dist/user-settings.js +370 -0
  211. package/dist/user-settings.js.map +1 -0
  212. package/dist/utils/index.d.mts +70 -0
  213. package/dist/utils/index.d.ts +70 -0
  214. package/dist/utils/index.js +177 -0
  215. package/dist/utils/index.js.map +1 -0
  216. package/package.json +163 -3
@@ -0,0 +1,398 @@
1
+ import { Buffer } from 'buffer';
2
+ import { cache } from 'react';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
+
5
+ /**
6
+ * Enterprise Portal Components
7
+ * This file is generated by tsup. Do not edit manually.
8
+ */
9
+
10
+
11
+ // src/actions/index.ts
12
+ var getApiOrigin = () => {
13
+ return (process.env.REPLICATED_APP_ORIGIN || "https://replicated.app").replace(/\/+$/, "");
14
+ };
15
+ var fetchCustomBrandingImpl = async () => {
16
+ const appSlug = process.env.PORTAL_APP_SLUG;
17
+ if (!appSlug) {
18
+ throw new Error("PORTAL_APP_SLUG is not configured");
19
+ }
20
+ const url = `${getApiOrigin()}/v3/custom-branding?app_slug=${encodeURIComponent(
21
+ appSlug
22
+ )}`;
23
+ if (process.env.NODE_ENV !== "production") {
24
+ console.debug(
25
+ "[portal-components] fetching custom branding via %s",
26
+ url
27
+ );
28
+ }
29
+ const response = await fetch(url, {
30
+ headers: {
31
+ accept: "application/json"
32
+ }
33
+ });
34
+ if (!response.ok) {
35
+ throw new Error(
36
+ `Custom branding request failed (${response.status} ${response.statusText})`
37
+ );
38
+ }
39
+ const payload = await response.json();
40
+ const brandingData = payload?.branding_data;
41
+ if (typeof brandingData !== "string") {
42
+ throw new Error("Custom branding response missing branding_data string");
43
+ }
44
+ return {
45
+ brandingData,
46
+ documentation: payload?.documentation ?? null
47
+ };
48
+ };
49
+ var fetchCustomBranding = cache(fetchCustomBrandingImpl);
50
+ var defaultHiddenLabels = ["Download"];
51
+ var defaultTopNavLinks = [
52
+ {
53
+ label: "Dashboard",
54
+ href: "/",
55
+ icon: /* @__PURE__ */ jsxs(
56
+ "svg",
57
+ {
58
+ xmlns: "http://www.w3.org/2000/svg",
59
+ viewBox: "0 0 24 24",
60
+ className: "h-4 w-4",
61
+ fill: "none",
62
+ stroke: "currentColor",
63
+ strokeWidth: "1.5",
64
+ children: [
65
+ /* @__PURE__ */ jsx("path", { d: "M4 13h6V3H4z" }),
66
+ /* @__PURE__ */ jsx("path", { d: "M14 21h6V3h-6z" })
67
+ ]
68
+ }
69
+ )
70
+ },
71
+ {
72
+ label: "Download",
73
+ icon: /* @__PURE__ */ jsxs(
74
+ "svg",
75
+ {
76
+ xmlns: "http://www.w3.org/2000/svg",
77
+ viewBox: "0 0 24 24",
78
+ className: "h-4 w-4",
79
+ fill: "none",
80
+ stroke: "currentColor",
81
+ strokeWidth: "1.5",
82
+ children: [
83
+ /* @__PURE__ */ jsx("path", { d: "M12 3v12" }),
84
+ /* @__PURE__ */ jsx("path", { d: "m7 11 5 5 5-5" }),
85
+ /* @__PURE__ */ jsx("path", { d: "M5 21h14" })
86
+ ]
87
+ }
88
+ )
89
+ },
90
+ {
91
+ label: "Install",
92
+ href: "/install",
93
+ icon: /* @__PURE__ */ jsxs(
94
+ "svg",
95
+ {
96
+ xmlns: "http://www.w3.org/2000/svg",
97
+ viewBox: "0 0 24 24",
98
+ className: "h-4 w-4",
99
+ fill: "none",
100
+ stroke: "currentColor",
101
+ strokeWidth: "1.5",
102
+ children: [
103
+ /* @__PURE__ */ jsx("path", { d: "M12 5v14" }),
104
+ /* @__PURE__ */ jsx("path", { d: "M5 12h14" })
105
+ ]
106
+ }
107
+ )
108
+ },
109
+ {
110
+ label: "Update",
111
+ href: "/update",
112
+ icon: /* @__PURE__ */ jsxs(
113
+ "svg",
114
+ {
115
+ xmlns: "http://www.w3.org/2000/svg",
116
+ viewBox: "0 0 24 24",
117
+ className: "h-4 w-4",
118
+ fill: "none",
119
+ stroke: "currentColor",
120
+ strokeWidth: "1.5",
121
+ children: [
122
+ /* @__PURE__ */ jsx("path", { d: "M4 4v6h6" }),
123
+ /* @__PURE__ */ jsx("path", { d: "M20 20v-6h-6" }),
124
+ /* @__PURE__ */ jsx("path", { d: "M4 10c1.5-4 6-6 10-4m6 4c-1.5 4-6 6-10 4" })
125
+ ]
126
+ }
127
+ )
128
+ },
129
+ {
130
+ label: "Release History",
131
+ href: "/release-history",
132
+ icon: /* @__PURE__ */ jsxs(
133
+ "svg",
134
+ {
135
+ xmlns: "http://www.w3.org/2000/svg",
136
+ viewBox: "0 0 24 24",
137
+ className: "h-4 w-4",
138
+ fill: "none",
139
+ stroke: "currentColor",
140
+ strokeWidth: "1.5",
141
+ children: [
142
+ /* @__PURE__ */ jsx("path", { d: "M12 8v4l3 2" }),
143
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9" })
144
+ ]
145
+ }
146
+ )
147
+ },
148
+ {
149
+ label: "License",
150
+ href: "/license",
151
+ icon: /* @__PURE__ */ jsxs(
152
+ "svg",
153
+ {
154
+ xmlns: "http://www.w3.org/2000/svg",
155
+ viewBox: "0 0 24 24",
156
+ className: "h-4 w-4",
157
+ fill: "none",
158
+ stroke: "currentColor",
159
+ strokeWidth: "1.5",
160
+ children: [
161
+ /* @__PURE__ */ jsx("rect", { width: "14", height: "18", x: "5", y: "3", rx: "2" }),
162
+ /* @__PURE__ */ jsx("path", { d: "M9 7h6" }),
163
+ /* @__PURE__ */ jsx("path", { d: "M9 11h6" }),
164
+ /* @__PURE__ */ jsx("path", { d: "M9 15h6" })
165
+ ]
166
+ }
167
+ )
168
+ },
169
+ {
170
+ label: "Support",
171
+ href: "/support",
172
+ icon: /* @__PURE__ */ jsxs(
173
+ "svg",
174
+ {
175
+ xmlns: "http://www.w3.org/2000/svg",
176
+ viewBox: "0 0 24 24",
177
+ className: "h-4 w-4",
178
+ fill: "none",
179
+ stroke: "currentColor",
180
+ strokeWidth: "1.5",
181
+ children: [
182
+ /* @__PURE__ */ jsx("path", { d: "M18 16a6 6 0 1 0-12 0v2h12Z" }),
183
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "7", r: "4" })
184
+ ]
185
+ }
186
+ )
187
+ }
188
+ ];
189
+ var orderLinks = (links, order) => {
190
+ if (!order || order.length === 0) {
191
+ return links;
192
+ }
193
+ const orderMap = new Map(order.map((label, index) => [label, index]));
194
+ return links.map((link, index) => ({
195
+ link,
196
+ originalIndex: index,
197
+ orderIndex: orderMap.has(link.label) ? orderMap.get(link.label) : order.length + index
198
+ })).sort((a, b) => {
199
+ if (a.orderIndex === b.orderIndex) {
200
+ return a.originalIndex - b.originalIndex;
201
+ }
202
+ return a.orderIndex - b.orderIndex;
203
+ }).map((item) => item.link);
204
+ };
205
+ var TopNav = async ({
206
+ links,
207
+ hiddenLabels,
208
+ additionalLinks,
209
+ order,
210
+ userMenuLabel,
211
+ activeLabel,
212
+ customerName,
213
+ customers,
214
+ currentCustomerId,
215
+ onChangeTeam,
216
+ userMenuChildren
217
+ }) => {
218
+ const displayLabel = userMenuLabel || (customerName ? `Team: ${customerName}` : "Team: Example");
219
+ let logo;
220
+ let brandTitle;
221
+ let customColor1;
222
+ let customColor2;
223
+ const normalizeColor = (color) => {
224
+ if (!color || typeof color !== "string") {
225
+ return void 0;
226
+ }
227
+ const trimmed = color.trim();
228
+ if (/^#?[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/.test(trimmed)) {
229
+ return trimmed.startsWith("#") ? trimmed : `#${trimmed}`;
230
+ }
231
+ return trimmed;
232
+ };
233
+ try {
234
+ const branding = await fetchCustomBranding();
235
+ if (branding.brandingData) {
236
+ const decoded = Buffer.from(branding.brandingData, "base64").toString(
237
+ "utf-8"
238
+ );
239
+ try {
240
+ const parsed = JSON.parse(decoded);
241
+ if (parsed?.logo && typeof parsed.logo === "string") {
242
+ logo = parsed.logo;
243
+ }
244
+ if (parsed?.title && typeof parsed.title === "string") {
245
+ const normalizedTitle = parsed.title.trim();
246
+ if (normalizedTitle) {
247
+ brandTitle = normalizedTitle;
248
+ }
249
+ }
250
+ if (parsed?.customColor1 && typeof parsed.customColor1 === "string") {
251
+ customColor1 = normalizeColor(parsed.customColor1);
252
+ }
253
+ if (parsed?.customColor2 && typeof parsed.customColor2 === "string") {
254
+ customColor2 = normalizeColor(parsed.customColor2);
255
+ }
256
+ } catch (error) {
257
+ console.debug(
258
+ "[portal-components] unable to parse branding JSON",
259
+ error
260
+ );
261
+ }
262
+ } else {
263
+ console.debug("[portal-components] branding", branding);
264
+ }
265
+ } catch (error) {
266
+ console.debug("[portal-components] branding fetch failed", error);
267
+ }
268
+ const baseLinks = links ?? defaultTopNavLinks;
269
+ const computedHiddenLabels = hiddenLabels ? hiddenLabels : links ? void 0 : defaultHiddenLabels;
270
+ const hiddenSet = computedHiddenLabels ? new Set(computedHiddenLabels) : null;
271
+ let resolvedLinks = baseLinks.filter(
272
+ (link) => !hiddenSet?.has(link.label)
273
+ );
274
+ if (additionalLinks?.length) {
275
+ resolvedLinks = [...resolvedLinks, ...additionalLinks];
276
+ }
277
+ resolvedLinks = orderLinks(resolvedLinks, order);
278
+ const gradientStart = customColor1 ?? "rgb(235, 102, 88)";
279
+ const gradientEnd = customColor2 ?? customColor1 ?? "rgb(184, 83, 71)";
280
+ return /* @__PURE__ */ jsx(
281
+ "div",
282
+ {
283
+ className: "relative flex h-[165px] w-full items-start justify-center",
284
+ style: {
285
+ backgroundImage: `linear-gradient(to top, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0) 33%), linear-gradient(${gradientStart}, ${gradientEnd})`,
286
+ backgroundRepeat: "no-repeat",
287
+ backgroundSize: "100% 100%"
288
+ },
289
+ children: /* @__PURE__ */ jsx("div", { className: "mx-auto mt-[30px] w-full max-w-[1248px] px-6", children: /* @__PURE__ */ jsxs("div", { className: "flex h-[135px] flex-col justify-between space-y-4 rounded bg-[#ffffffe6] px-6 pt-6 pb-4 shadow-[0_10px_60px_rgba(16,16,16,0.35)]", children: [
290
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
291
+ logo || brandTitle ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
292
+ logo ? (
293
+ // eslint-disable-next-line @next/next/no-img-element
294
+ /* @__PURE__ */ jsx(
295
+ "img",
296
+ {
297
+ src: logo,
298
+ alt: "Portal logo",
299
+ className: "object-contain",
300
+ style: {
301
+ maxWidth: "240px",
302
+ maxHeight: "48px"
303
+ }
304
+ }
305
+ )
306
+ ) : null,
307
+ brandTitle ? /* @__PURE__ */ jsx("span", { className: "text-lg font-semibold text-gray-900", children: brandTitle }) : null
308
+ ] }) : /* @__PURE__ */ jsx("div", {}),
309
+ /* @__PURE__ */ jsxs("details", { className: "group relative", children: [
310
+ /* @__PURE__ */ jsxs("summary", { className: "flex cursor-pointer items-center gap-2 rounded-lg bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 list-none", children: [
311
+ /* @__PURE__ */ jsxs(
312
+ "svg",
313
+ {
314
+ xmlns: "http://www.w3.org/2000/svg",
315
+ width: "16",
316
+ height: "16",
317
+ viewBox: "0 0 24 24",
318
+ fill: "none",
319
+ stroke: "currentColor",
320
+ strokeWidth: "2",
321
+ strokeLinecap: "round",
322
+ strokeLinejoin: "round",
323
+ className: "text-gray-500",
324
+ children: [
325
+ /* @__PURE__ */ jsx("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
326
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "7", r: "4" })
327
+ ]
328
+ }
329
+ ),
330
+ /* @__PURE__ */ jsx("span", { children: displayLabel }),
331
+ /* @__PURE__ */ jsx(
332
+ "svg",
333
+ {
334
+ xmlns: "http://www.w3.org/2000/svg",
335
+ width: "16",
336
+ height: "16",
337
+ viewBox: "0 0 24 24",
338
+ fill: "none",
339
+ stroke: "currentColor",
340
+ strokeWidth: "2",
341
+ strokeLinecap: "round",
342
+ strokeLinejoin: "round",
343
+ className: "text-gray-500",
344
+ children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" })
345
+ }
346
+ )
347
+ ] }),
348
+ /* @__PURE__ */ jsxs("div", { className: "absolute right-0 mt-2 w-48 rounded-md border border-gray-200 bg-white py-2 text-sm text-gray-700 shadow-lg z-50", children: [
349
+ /* @__PURE__ */ jsx(
350
+ "a",
351
+ {
352
+ href: "/user-settings",
353
+ className: "block w-full px-4 py-2 text-left hover:bg-gray-100",
354
+ children: "User settings"
355
+ }
356
+ ),
357
+ /* @__PURE__ */ jsx(
358
+ "a",
359
+ {
360
+ href: "/team-settings",
361
+ className: "block w-full px-4 py-2 text-left hover:bg-gray-100",
362
+ children: "Team settings"
363
+ }
364
+ ),
365
+ userMenuChildren,
366
+ /* @__PURE__ */ jsx(
367
+ "a",
368
+ {
369
+ href: "/?expired=1",
370
+ className: "block w-full px-4 py-2 text-left hover:bg-gray-100",
371
+ children: "Logout"
372
+ }
373
+ )
374
+ ] })
375
+ ] })
376
+ ] }),
377
+ /* @__PURE__ */ jsx("div", { className: "mt-3 flex flex-wrap gap-3 border-b border-gray-200 pb-2 text-sm font-medium text-gray-500", children: resolvedLinks.map(({ label, icon, href }) => {
378
+ const isActive = activeLabel === label;
379
+ const className = `flex items-center gap-2 px-4 py-1 transition text-gray-500 ${isActive ? "underline underline-offset-8 decoration-2" : ""}`;
380
+ if (href) {
381
+ return /* @__PURE__ */ jsxs("a", { href, className, children: [
382
+ /* @__PURE__ */ jsx("span", { className: isActive ? "text-rose-600" : "text-gray-500", children: icon }),
383
+ /* @__PURE__ */ jsx("span", { children: label })
384
+ ] }, label);
385
+ }
386
+ return /* @__PURE__ */ jsxs("button", { className, type: "button", children: [
387
+ /* @__PURE__ */ jsx("span", { className: isActive ? "text-rose-600" : "text-gray-500", children: icon }),
388
+ /* @__PURE__ */ jsx("span", { children: label })
389
+ ] }, label);
390
+ }) })
391
+ ] }) })
392
+ }
393
+ );
394
+ };
395
+
396
+ export { TopNav };
397
+ //# sourceMappingURL=top-nav.js.map
398
+ //# sourceMappingURL=top-nav.js.map