@replicated/portal-components 0.0.11 → 0.0.13

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/components/metadata/registry.json +2 -2
  2. package/components/metadata/registry.md +2 -2
  3. package/datadog/tracer.d.ts +3 -0
  4. package/datadog/tracer.js +82 -0
  5. package/datadog/tracer.ts +101 -0
  6. package/dist/actions/index.d.mts +26 -4
  7. package/dist/actions/index.d.ts +26 -4
  8. package/dist/actions/index.js +171 -124
  9. package/dist/actions/index.js.map +1 -1
  10. package/dist/airgap-instances.js.map +1 -1
  11. package/dist/esm/actions/index.js +170 -124
  12. package/dist/esm/actions/index.js.map +1 -1
  13. package/dist/esm/airgap-instances.js.map +1 -1
  14. package/dist/esm/helm-install-wizard.js +15 -9
  15. package/dist/esm/helm-install-wizard.js.map +1 -1
  16. package/dist/esm/index.js +204 -158
  17. package/dist/esm/index.js.map +1 -1
  18. package/dist/esm/install-actions.js +42 -47
  19. package/dist/esm/install-actions.js.map +1 -1
  20. package/dist/esm/install-card.js +8 -21
  21. package/dist/esm/install-card.js.map +1 -1
  22. package/dist/esm/instance-card.js.map +1 -1
  23. package/dist/esm/license-card.js +8 -12
  24. package/dist/esm/license-card.js.map +1 -1
  25. package/dist/esm/license-details.js +21 -11
  26. package/dist/esm/license-details.js.map +1 -1
  27. package/dist/esm/linux-install-wizard.js +26 -47
  28. package/dist/esm/linux-install-wizard.js.map +1 -1
  29. package/dist/esm/online-instance-list.js.map +1 -1
  30. package/dist/esm/support-card.js +22 -55
  31. package/dist/esm/support-card.js.map +1 -1
  32. package/dist/esm/team-settings-card.js +8 -13
  33. package/dist/esm/team-settings-card.js.map +1 -1
  34. package/dist/esm/top-nav.js +69 -47
  35. package/dist/esm/top-nav.js.map +1 -1
  36. package/dist/esm/update-layout.js +69 -47
  37. package/dist/esm/update-layout.js.map +1 -1
  38. package/dist/esm/updates-card.js +8 -14
  39. package/dist/esm/updates-card.js.map +1 -1
  40. package/dist/esm/utils/index.js +14 -10
  41. package/dist/esm/utils/index.js.map +1 -1
  42. package/dist/esm/utils/observability/index.js +193 -0
  43. package/dist/esm/utils/observability/index.js.map +1 -0
  44. package/dist/helm-install-wizard.js +15 -9
  45. package/dist/helm-install-wizard.js.map +1 -1
  46. package/dist/index.d.mts +1 -1
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.js +203 -156
  49. package/dist/index.js.map +1 -1
  50. package/dist/install-actions.js +43 -48
  51. package/dist/install-actions.js.map +1 -1
  52. package/dist/install-card.js +8 -21
  53. package/dist/install-card.js.map +1 -1
  54. package/dist/instance-card.js.map +1 -1
  55. package/dist/license-card.js +8 -12
  56. package/dist/license-card.js.map +1 -1
  57. package/dist/license-details.js +21 -11
  58. package/dist/license-details.js.map +1 -1
  59. package/dist/linux-install-wizard.js +26 -47
  60. package/dist/linux-install-wizard.js.map +1 -1
  61. package/dist/online-instance-list.js.map +1 -1
  62. package/dist/styles.css +2 -2
  63. package/dist/support-card.js +22 -55
  64. package/dist/support-card.js.map +1 -1
  65. package/dist/team-settings-card.js +8 -13
  66. package/dist/team-settings-card.js.map +1 -1
  67. package/dist/top-nav.js +69 -47
  68. package/dist/top-nav.js.map +1 -1
  69. package/dist/update-layout.js +69 -47
  70. package/dist/update-layout.js.map +1 -1
  71. package/dist/updates-card.js +8 -14
  72. package/dist/updates-card.js.map +1 -1
  73. package/dist/utils/index.js +14 -10
  74. package/dist/utils/index.js.map +1 -1
  75. package/dist/utils/observability/index.d.mts +13 -0
  76. package/dist/utils/observability/index.d.ts +13 -0
  77. package/dist/utils/observability/index.js +198 -0
  78. package/dist/utils/observability/index.js.map +1 -0
  79. package/instrumentation.d.ts +8 -0
  80. package/instrumentation.js +22 -0
  81. package/package.json +16 -3
@@ -18,12 +18,12 @@ var fetchCustomBrandingImpl = async () => {
18
18
  if (!appSlug) {
19
19
  throw new Error("PORTAL_APP_SLUG is not configured");
20
20
  }
21
- const url = `${getApiOrigin()}/v3/custom-branding?app_slug=${encodeURIComponent(
21
+ const url = `${getApiOrigin()}/enterprise-portal/public/branding?app_slug=${encodeURIComponent(
22
22
  appSlug
23
23
  )}`;
24
24
  if (process.env.NODE_ENV !== "production") {
25
25
  console.debug(
26
- "[portal-components] fetching custom branding via %s",
26
+ "[portal-components] fetching custom branding via %s (Enterprise Portal API)",
27
27
  url
28
28
  );
29
29
  }
@@ -38,17 +38,21 @@ var fetchCustomBrandingImpl = async () => {
38
38
  );
39
39
  }
40
40
  const payload = await response.json();
41
- const brandingData = payload?.branding_data;
42
- if (typeof brandingData !== "string") {
43
- throw new Error("Custom branding response missing branding_data string");
44
- }
41
+ const brandingObject = {
42
+ logo: payload.logoUrl,
43
+ title: payload.appName,
44
+ customColor1: payload.primaryColor,
45
+ customColor2: payload.secondaryColor,
46
+ favicon: payload.faviconUrl
47
+ };
48
+ const brandingData = Buffer.from(JSON.stringify(brandingObject)).toString("base64");
45
49
  return {
46
50
  brandingData,
47
- documentation: payload?.documentation ?? null
51
+ documentation: null
52
+ // Documentation not included in new API's public endpoint
48
53
  };
49
54
  };
50
55
  var fetchCustomBranding = cache(fetchCustomBrandingImpl);
51
- var defaultHiddenLabels = ["Download"];
52
56
  var defaultTopNavLinks = [
53
57
  {
54
58
  label: "Dashboard",
@@ -61,16 +65,21 @@ var defaultTopNavLinks = [
61
65
  className: "h-4 w-4",
62
66
  fill: "none",
63
67
  stroke: "currentColor",
64
- strokeWidth: "1.5",
68
+ strokeWidth: "2",
69
+ strokeLinecap: "round",
70
+ strokeLinejoin: "round",
65
71
  children: [
66
- /* @__PURE__ */ jsx("path", { d: "M4 13h6V3H4z" }),
67
- /* @__PURE__ */ jsx("path", { d: "M14 21h6V3h-6z" })
72
+ /* @__PURE__ */ jsx("rect", { width: "7", height: "9", x: "3", y: "3", rx: "1" }),
73
+ /* @__PURE__ */ jsx("rect", { width: "7", height: "5", x: "14", y: "3", rx: "1" }),
74
+ /* @__PURE__ */ jsx("rect", { width: "7", height: "9", x: "14", y: "12", rx: "1" }),
75
+ /* @__PURE__ */ jsx("rect", { width: "7", height: "5", x: "3", y: "16", rx: "1" })
68
76
  ]
69
77
  }
70
78
  )
71
79
  },
72
80
  {
73
- label: "Download",
81
+ label: "Install",
82
+ href: "/install",
74
83
  icon: /* @__PURE__ */ jsxs(
75
84
  "svg",
76
85
  {
@@ -79,18 +88,20 @@ var defaultTopNavLinks = [
79
88
  className: "h-4 w-4",
80
89
  fill: "none",
81
90
  stroke: "currentColor",
82
- strokeWidth: "1.5",
91
+ strokeWidth: "2",
92
+ strokeLinecap: "round",
93
+ strokeLinejoin: "round",
83
94
  children: [
84
- /* @__PURE__ */ jsx("path", { d: "M12 3v12" }),
85
- /* @__PURE__ */ jsx("path", { d: "m7 11 5 5 5-5" }),
86
- /* @__PURE__ */ jsx("path", { d: "M5 21h14" })
95
+ /* @__PURE__ */ jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
96
+ /* @__PURE__ */ jsx("polyline", { points: "7 10 12 15 17 10" }),
97
+ /* @__PURE__ */ jsx("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
87
98
  ]
88
99
  }
89
100
  )
90
101
  },
91
102
  {
92
- label: "Install",
93
- href: "/install",
103
+ label: "Update",
104
+ href: "/update",
94
105
  icon: /* @__PURE__ */ jsxs(
95
106
  "svg",
96
107
  {
@@ -99,18 +110,20 @@ var defaultTopNavLinks = [
99
110
  className: "h-4 w-4",
100
111
  fill: "none",
101
112
  stroke: "currentColor",
102
- strokeWidth: "1.5",
113
+ strokeWidth: "2",
114
+ strokeLinecap: "round",
115
+ strokeLinejoin: "round",
103
116
  children: [
104
- /* @__PURE__ */ jsx("path", { d: "M12 5v14" }),
105
- /* @__PURE__ */ jsx("path", { d: "M5 12h14" })
117
+ /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8" }),
118
+ /* @__PURE__ */ jsx("path", { d: "M21 3v5h-5" })
106
119
  ]
107
120
  }
108
121
  )
109
122
  },
110
123
  {
111
- label: "Update",
112
- href: "/update",
113
- icon: /* @__PURE__ */ jsxs(
124
+ label: "Security",
125
+ href: "/security",
126
+ icon: /* @__PURE__ */ jsx(
114
127
  "svg",
115
128
  {
116
129
  xmlns: "http://www.w3.org/2000/svg",
@@ -118,12 +131,10 @@ var defaultTopNavLinks = [
118
131
  className: "h-4 w-4",
119
132
  fill: "none",
120
133
  stroke: "currentColor",
121
- strokeWidth: "1.5",
122
- children: [
123
- /* @__PURE__ */ jsx("path", { d: "M4 4v6h6" }),
124
- /* @__PURE__ */ jsx("path", { d: "M20 20v-6h-6" }),
125
- /* @__PURE__ */ jsx("path", { d: "M4 10c1.5-4 6-6 10-4m6 4c-1.5 4-6 6-10 4" })
126
- ]
134
+ strokeWidth: "2",
135
+ strokeLinecap: "round",
136
+ strokeLinejoin: "round",
137
+ children: /* @__PURE__ */ jsx("path", { d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" })
127
138
  }
128
139
  )
129
140
  },
@@ -138,10 +149,15 @@ var defaultTopNavLinks = [
138
149
  className: "h-4 w-4",
139
150
  fill: "none",
140
151
  stroke: "currentColor",
141
- strokeWidth: "1.5",
152
+ strokeWidth: "2",
153
+ strokeLinecap: "round",
154
+ strokeLinejoin: "round",
142
155
  children: [
143
- /* @__PURE__ */ jsx("path", { d: "M12 8v4l3 2" }),
144
- /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9" })
156
+ /* @__PURE__ */ jsx("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
157
+ /* @__PURE__ */ jsx("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
158
+ /* @__PURE__ */ jsx("path", { d: "M10 9H8" }),
159
+ /* @__PURE__ */ jsx("path", { d: "M16 13H8" }),
160
+ /* @__PURE__ */ jsx("path", { d: "M16 17H8" })
145
161
  ]
146
162
  }
147
163
  )
@@ -157,12 +173,13 @@ var defaultTopNavLinks = [
157
173
  className: "h-4 w-4",
158
174
  fill: "none",
159
175
  stroke: "currentColor",
160
- strokeWidth: "1.5",
176
+ strokeWidth: "2",
177
+ strokeLinecap: "round",
178
+ strokeLinejoin: "round",
161
179
  children: [
162
- /* @__PURE__ */ jsx("rect", { width: "14", height: "18", x: "5", y: "3", rx: "2" }),
163
- /* @__PURE__ */ jsx("path", { d: "M9 7h6" }),
164
- /* @__PURE__ */ jsx("path", { d: "M9 11h6" }),
165
- /* @__PURE__ */ jsx("path", { d: "M9 15h6" })
180
+ /* @__PURE__ */ jsx("path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4" }),
181
+ /* @__PURE__ */ jsx("path", { d: "m21 2-9.6 9.6" }),
182
+ /* @__PURE__ */ jsx("circle", { cx: "7.5", cy: "15.5", r: "5.5" })
166
183
  ]
167
184
  }
168
185
  )
@@ -178,10 +195,16 @@ var defaultTopNavLinks = [
178
195
  className: "h-4 w-4",
179
196
  fill: "none",
180
197
  stroke: "currentColor",
181
- strokeWidth: "1.5",
198
+ strokeWidth: "2",
199
+ strokeLinecap: "round",
200
+ strokeLinejoin: "round",
182
201
  children: [
183
- /* @__PURE__ */ jsx("path", { d: "M18 16a6 6 0 1 0-12 0v2h12Z" }),
184
- /* @__PURE__ */ jsx("circle", { cx: "12", cy: "7", r: "4" })
202
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
203
+ /* @__PURE__ */ jsx("path", { d: "m4.93 4.93 4.24 4.24" }),
204
+ /* @__PURE__ */ jsx("path", { d: "m14.83 9.17 4.24-4.24" }),
205
+ /* @__PURE__ */ jsx("path", { d: "m14.83 14.83 4.24 4.24" }),
206
+ /* @__PURE__ */ jsx("path", { d: "m9.17 14.83-4.24 4.24" }),
207
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "4" })
185
208
  ]
186
209
  }
187
210
  )
@@ -267,8 +290,7 @@ var TopNav = async ({
267
290
  console.debug("[portal-components] branding fetch failed", error);
268
291
  }
269
292
  const baseLinks = links ?? defaultTopNavLinks;
270
- const computedHiddenLabels = hiddenLabels ? hiddenLabels : links ? void 0 : defaultHiddenLabels;
271
- const hiddenSet = computedHiddenLabels ? new Set(computedHiddenLabels) : null;
293
+ const hiddenSet = hiddenLabels ? new Set(hiddenLabels) : null;
272
294
  let resolvedLinks = baseLinks.filter(
273
295
  (link) => !hiddenSet?.has(link.label)
274
296
  );
@@ -281,7 +303,7 @@ var TopNav = async ({
281
303
  return /* @__PURE__ */ jsx(
282
304
  "div",
283
305
  {
284
- className: "relative flex h-[165px] w-full items-start justify-center",
306
+ className: "relative flex h-[280px] w-full items-start justify-center",
285
307
  style: {
286
308
  backgroundImage: `linear-gradient(to top, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0) 33%), linear-gradient(${gradientStart}, ${gradientEnd})`,
287
309
  backgroundRepeat: "no-repeat",
@@ -308,7 +330,7 @@ var TopNav = async ({
308
330
  brandTitle ? /* @__PURE__ */ jsx("span", { className: "text-lg font-semibold text-gray-900", children: brandTitle }) : null
309
331
  ] }) : /* @__PURE__ */ jsx("div", {}),
310
332
  /* @__PURE__ */ jsxs("details", { className: "group relative", children: [
311
- /* @__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: [
333
+ /* @__PURE__ */ jsxs("summary", { className: "flex cursor-pointer items-center gap-2 text-sm font-medium text-gray-600 hover:text-gray-900 list-none", children: [
312
334
  /* @__PURE__ */ jsxs(
313
335
  "svg",
314
336
  {
@@ -380,12 +402,12 @@ var TopNav = async ({
380
402
  const className = `flex items-center gap-2 px-4 py-1 transition text-gray-500 ${isActive ? "underline underline-offset-8 decoration-2" : ""}`;
381
403
  if (href) {
382
404
  return /* @__PURE__ */ jsxs(Link, { href, className, children: [
383
- /* @__PURE__ */ jsx("span", { className: isActive ? "text-rose-600" : "text-gray-500", children: icon }),
405
+ /* @__PURE__ */ jsx("span", { className: isActive ? "text-gray-900" : "text-gray-500", children: icon }),
384
406
  /* @__PURE__ */ jsx("span", { children: label })
385
407
  ] }, label);
386
408
  }
387
409
  return /* @__PURE__ */ jsxs("button", { className, type: "button", children: [
388
- /* @__PURE__ */ jsx("span", { className: isActive ? "text-rose-600" : "text-gray-500", children: icon }),
410
+ /* @__PURE__ */ jsx("span", { className: isActive ? "text-gray-900" : "text-gray-500", children: icon }),
389
411
  /* @__PURE__ */ jsx("span", { children: label })
390
412
  ] }, label);
391
413
  }) })