@replicated/portal-components 0.0.21 → 0.0.22

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 (182) hide show
  1. package/components/metadata/registry.json +2 -2
  2. package/components/metadata/registry.md +2 -2
  3. package/dist/actions/change-team.js +39 -0
  4. package/dist/actions/change-team.js.map +1 -1
  5. package/dist/actions/index.d.mts +1 -1
  6. package/dist/actions/index.d.ts +1 -1
  7. package/dist/actions/index.js +40 -0
  8. package/dist/actions/index.js.map +1 -1
  9. package/dist/actions/install-actions.d.mts +1 -1
  10. package/dist/actions/install-actions.d.ts +1 -1
  11. package/dist/actions/install-actions.js +39 -0
  12. package/dist/actions/install-actions.js.map +1 -1
  13. package/dist/actions/service-account.d.mts +1 -1
  14. package/dist/actions/service-account.d.ts +1 -1
  15. package/dist/actions/service-account.js +39 -0
  16. package/dist/actions/service-account.js.map +1 -1
  17. package/dist/actions/support-bundles.d.mts +1 -1
  18. package/dist/actions/support-bundles.d.ts +1 -1
  19. package/dist/actions/support-bundles.js +39 -0
  20. package/dist/actions/support-bundles.js.map +1 -1
  21. package/dist/actions/team-settings.d.mts +1 -1
  22. package/dist/actions/team-settings.d.ts +1 -1
  23. package/dist/actions/team-settings.js +39 -0
  24. package/dist/actions/team-settings.js.map +1 -1
  25. package/dist/actions/trial-signup.js +39 -0
  26. package/dist/actions/trial-signup.js.map +1 -1
  27. package/dist/actions/user-settings.d.mts +1 -1
  28. package/dist/actions/user-settings.d.ts +1 -1
  29. package/dist/actions/user-settings.js +39 -0
  30. package/dist/actions/user-settings.js.map +1 -1
  31. package/dist/airgap-instances.d.mts +1 -1
  32. package/dist/airgap-instances.d.ts +1 -1
  33. package/dist/airgap-instances.js +3 -2
  34. package/dist/airgap-instances.js.map +1 -1
  35. package/dist/esm/actions/change-team.js +39 -0
  36. package/dist/esm/actions/change-team.js.map +1 -1
  37. package/dist/esm/actions/index.js +40 -1
  38. package/dist/esm/actions/index.js.map +1 -1
  39. package/dist/esm/actions/install-actions.js +39 -0
  40. package/dist/esm/actions/install-actions.js.map +1 -1
  41. package/dist/esm/actions/service-account.js +39 -0
  42. package/dist/esm/actions/service-account.js.map +1 -1
  43. package/dist/esm/actions/support-bundles.js +39 -0
  44. package/dist/esm/actions/support-bundles.js.map +1 -1
  45. package/dist/esm/actions/team-settings.js +39 -0
  46. package/dist/esm/actions/team-settings.js.map +1 -1
  47. package/dist/esm/actions/trial-signup.js +39 -0
  48. package/dist/esm/actions/trial-signup.js.map +1 -1
  49. package/dist/esm/actions/user-settings.js +39 -0
  50. package/dist/esm/actions/user-settings.js.map +1 -1
  51. package/dist/esm/airgap-instances.js +3 -2
  52. package/dist/esm/airgap-instances.js.map +1 -1
  53. package/dist/esm/helm-install-wizard.js +414 -189
  54. package/dist/esm/helm-install-wizard.js.map +1 -1
  55. package/dist/esm/index.js +89 -64
  56. package/dist/esm/index.js.map +1 -1
  57. package/dist/esm/install-actions.js +39 -0
  58. package/dist/esm/install-actions.js.map +1 -1
  59. package/dist/esm/instance-card.js +2 -1
  60. package/dist/esm/instance-card.js.map +1 -1
  61. package/dist/esm/license-details.js +39 -0
  62. package/dist/esm/license-details.js.map +1 -1
  63. package/dist/esm/linux-install-wizard.js +310 -166
  64. package/dist/esm/linux-install-wizard.js.map +1 -1
  65. package/dist/esm/logout-action.js +187 -0
  66. package/dist/esm/logout-action.js.map +1 -0
  67. package/dist/esm/logout-button.js +32 -0
  68. package/dist/esm/logout-button.js.map +1 -0
  69. package/dist/esm/markdown-renderer.js +16 -0
  70. package/dist/esm/markdown-renderer.js.map +1 -0
  71. package/dist/esm/middleware.js +3 -3
  72. package/dist/esm/middleware.js.map +1 -1
  73. package/dist/esm/online-instance-list.js +3 -2
  74. package/dist/esm/online-instance-list.js.map +1 -1
  75. package/dist/esm/saml-callback-client.js +5 -2
  76. package/dist/esm/saml-callback-client.js.map +1 -1
  77. package/dist/esm/saml-handlers.js +104 -0
  78. package/dist/esm/saml-handlers.js.map +1 -1
  79. package/dist/esm/support-bundle-collection-card.js +3 -2
  80. package/dist/esm/support-bundle-collection-card.js.map +1 -1
  81. package/dist/esm/support-bundles-card.js +2 -2
  82. package/dist/esm/support-bundles-card.js.map +1 -1
  83. package/dist/esm/support-card.js +39 -0
  84. package/dist/esm/support-card.js.map +1 -1
  85. package/dist/esm/top-nav-menu-close.js +46 -0
  86. package/dist/esm/top-nav-menu-close.js.map +1 -0
  87. package/dist/esm/top-nav.js +149 -59
  88. package/dist/esm/top-nav.js.map +1 -1
  89. package/dist/esm/trial-signup.js +6 -3
  90. package/dist/esm/trial-signup.js.map +1 -1
  91. package/dist/esm/update-layout.js +149 -59
  92. package/dist/esm/update-layout.js.map +1 -1
  93. package/dist/esm/upload-support-bundle-modal.js +2 -2
  94. package/dist/esm/upload-support-bundle-modal.js.map +1 -1
  95. package/dist/esm/user-menu-dropdown.js +52 -0
  96. package/dist/esm/user-menu-dropdown.js.map +1 -0
  97. package/dist/esm/user-settings.js +5 -5
  98. package/dist/esm/user-settings.js.map +1 -1
  99. package/dist/esm/utils/index.js +39 -0
  100. package/dist/esm/utils/index.js.map +1 -1
  101. package/dist/helm-install-wizard.d.mts +18 -7
  102. package/dist/helm-install-wizard.d.ts +18 -7
  103. package/dist/helm-install-wizard.js +418 -189
  104. package/dist/helm-install-wizard.js.map +1 -1
  105. package/dist/{index-sMbq94M7.d.ts → index-DXy7RxOX.d.ts} +18 -1
  106. package/dist/{index-DyzJ0yKD.d.mts → index-JX9-CIMA.d.mts} +18 -1
  107. package/dist/index.d.mts +1 -1
  108. package/dist/index.d.ts +1 -1
  109. package/dist/index.js +89 -64
  110. package/dist/index.js.map +1 -1
  111. package/dist/install-actions.d.mts +2 -2
  112. package/dist/install-actions.d.ts +2 -2
  113. package/dist/install-actions.js +39 -0
  114. package/dist/install-actions.js.map +1 -1
  115. package/dist/instance-card.d.mts +1 -1
  116. package/dist/instance-card.d.ts +1 -1
  117. package/dist/instance-card.js +2 -1
  118. package/dist/instance-card.js.map +1 -1
  119. package/dist/license-details.js +39 -0
  120. package/dist/license-details.js.map +1 -1
  121. package/dist/linux-install-wizard.d.mts +17 -7
  122. package/dist/linux-install-wizard.d.ts +17 -7
  123. package/dist/linux-install-wizard.js +314 -166
  124. package/dist/linux-install-wizard.js.map +1 -1
  125. package/dist/logout-action.d.mts +7 -0
  126. package/dist/logout-action.d.ts +7 -0
  127. package/dist/logout-action.js +189 -0
  128. package/dist/logout-action.js.map +1 -0
  129. package/dist/logout-button.d.mts +16 -0
  130. package/dist/logout-button.d.ts +16 -0
  131. package/dist/logout-button.js +34 -0
  132. package/dist/logout-button.js.map +1 -0
  133. package/dist/markdown-renderer.d.mts +12 -0
  134. package/dist/markdown-renderer.d.ts +12 -0
  135. package/dist/markdown-renderer.js +22 -0
  136. package/dist/markdown-renderer.js.map +1 -0
  137. package/dist/middleware.js +3 -3
  138. package/dist/middleware.js.map +1 -1
  139. package/dist/online-instance-list.d.mts +1 -1
  140. package/dist/online-instance-list.d.ts +1 -1
  141. package/dist/online-instance-list.js +3 -2
  142. package/dist/online-instance-list.js.map +1 -1
  143. package/dist/pending-installations.d.mts +1 -1
  144. package/dist/pending-installations.d.ts +1 -1
  145. package/dist/saml-callback-client.js +5 -2
  146. package/dist/saml-callback-client.js.map +1 -1
  147. package/dist/saml-handlers.js +104 -0
  148. package/dist/saml-handlers.js.map +1 -1
  149. package/dist/security-card.d.mts +1 -1
  150. package/dist/security-card.d.ts +1 -1
  151. package/dist/styles.css +39 -0
  152. package/dist/support-bundle-collection-card.js +3 -2
  153. package/dist/support-bundle-collection-card.js.map +1 -1
  154. package/dist/support-bundles-card.d.mts +2 -2
  155. package/dist/support-bundles-card.d.ts +2 -2
  156. package/dist/support-bundles-card.js +2 -2
  157. package/dist/support-bundles-card.js.map +1 -1
  158. package/dist/support-card.js +39 -0
  159. package/dist/support-card.js.map +1 -1
  160. package/dist/top-nav-menu-close.d.mts +10 -0
  161. package/dist/top-nav-menu-close.d.ts +10 -0
  162. package/dist/top-nav-menu-close.js +48 -0
  163. package/dist/top-nav-menu-close.js.map +1 -0
  164. package/dist/top-nav.js +149 -59
  165. package/dist/top-nav.js.map +1 -1
  166. package/dist/trial-signup.js +6 -3
  167. package/dist/trial-signup.js.map +1 -1
  168. package/dist/update-layout.js +149 -59
  169. package/dist/update-layout.js.map +1 -1
  170. package/dist/upload-support-bundle-modal.js +2 -2
  171. package/dist/upload-support-bundle-modal.js.map +1 -1
  172. package/dist/user-menu-dropdown.d.mts +25 -0
  173. package/dist/user-menu-dropdown.d.ts +25 -0
  174. package/dist/user-menu-dropdown.js +59 -0
  175. package/dist/user-menu-dropdown.js.map +1 -0
  176. package/dist/user-settings.js +5 -5
  177. package/dist/user-settings.js.map +1 -1
  178. package/dist/utils/index.d.mts +1 -1
  179. package/dist/utils/index.d.ts +1 -1
  180. package/dist/utils/index.js +39 -0
  181. package/dist/utils/index.js.map +1 -1
  182. package/package.json +29 -2
package/dist/esm/index.js CHANGED
@@ -3,6 +3,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { Buffer } from 'buffer';
4
4
  import { cookies } from 'next/headers';
5
5
  import Link from 'next/link';
6
+ import { User } from 'lucide-react';
6
7
 
7
8
  /**
8
9
  * Enterprise Portal Components
@@ -120,7 +121,7 @@ var init_tracer = __esm({
120
121
 
121
122
  // package.json
122
123
  var package_default = {
123
- version: "0.0.21"};
124
+ version: "0.0.22"};
124
125
 
125
126
  // src/tokens/index.ts
126
127
  var baseTokens = {
@@ -1450,6 +1451,45 @@ var updateNotifications = defineServerAction({
1450
1451
  };
1451
1452
  }
1452
1453
  });
1454
+ var fetchDocumentationImpl = async () => {
1455
+ const { cookies: cookies2 } = await import('next/headers');
1456
+ const sessionStore = await cookies2();
1457
+ const session = sessionStore.get("portal_session");
1458
+ const token = session?.value;
1459
+ if (!token) {
1460
+ throw new Error("Authentication required");
1461
+ }
1462
+ const url = `${getApiOrigin()}/enterprise-portal/documentation`;
1463
+ if (process.env.NODE_ENV !== "production") {
1464
+ console.debug(
1465
+ "[portal-components] fetching documentation via %s (Enterprise Portal API)",
1466
+ url
1467
+ );
1468
+ }
1469
+ const response = await authenticatedFetch(url, {
1470
+ method: "GET",
1471
+ token,
1472
+ headers: {
1473
+ accept: "application/json"
1474
+ }
1475
+ });
1476
+ if (!response.ok) {
1477
+ throw new Error(
1478
+ `Documentation request failed (${response.status} ${response.statusText})`
1479
+ );
1480
+ }
1481
+ const data = await response.json();
1482
+ return {
1483
+ helmPreInstall: data.helmPreInstall || "",
1484
+ helmPostInstall: data.helmPostInstall || "",
1485
+ embeddedClusterPreInstall: data.embeddedClusterPreInstall || "",
1486
+ embeddedClusterPostInstall: data.embeddedClusterPostInstall || "",
1487
+ helmInstallUrl: data.helmInstallUrl || "",
1488
+ embeddedClusterInstallUrl: data.embeddedClusterInstallUrl || "",
1489
+ valuesOverrideUrl: data.valuesOverrideUrl || ""
1490
+ };
1491
+ };
1492
+ cache(fetchDocumentationImpl);
1453
1493
  var ShieldIcon = (props) => /* @__PURE__ */ jsx(
1454
1494
  "svg",
1455
1495
  {
@@ -1707,6 +1747,45 @@ var LicenseDetails = async ({
1707
1747
  ] })
1708
1748
  ] });
1709
1749
  };
1750
+ function UserMenuDropdown({
1751
+ displayLabel,
1752
+ children,
1753
+ className = ""
1754
+ }) {
1755
+ return /* @__PURE__ */ jsxs("details", { className: `group relative ${className}`, children: [
1756
+ /* @__PURE__ */ jsxs("summary", { className: "flex cursor-pointer items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 transition-colors list-none border border-transparent hover:border-gray-200", children: [
1757
+ /* @__PURE__ */ jsx(User, { className: "h-4 w-4" }),
1758
+ /* @__PURE__ */ jsx("span", { children: displayLabel }),
1759
+ /* @__PURE__ */ jsx(
1760
+ "svg",
1761
+ {
1762
+ xmlns: "http://www.w3.org/2000/svg",
1763
+ width: "16",
1764
+ height: "16",
1765
+ viewBox: "0 0 24 24",
1766
+ fill: "none",
1767
+ stroke: "currentColor",
1768
+ strokeWidth: "2",
1769
+ strokeLinecap: "round",
1770
+ strokeLinejoin: "round",
1771
+ className: "h-4 w-4 text-gray-500 transition-transform group-open:rotate-180",
1772
+ children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" })
1773
+ }
1774
+ )
1775
+ ] }),
1776
+ /* @__PURE__ */ jsx("div", { className: "absolute right-0 mt-2 w-52 rounded-lg border border-gray-200 bg-white py-1.5 shadow-xl z-50", children })
1777
+ ] });
1778
+ }
1779
+ function UserMenuItem({ href, children }) {
1780
+ return /* @__PURE__ */ jsx(
1781
+ Link,
1782
+ {
1783
+ href,
1784
+ className: "block w-full px-4 py-2.5 text-sm text-gray-700 hover:bg-gray-50 transition-colors",
1785
+ children
1786
+ }
1787
+ );
1788
+ }
1710
1789
  var defaultTopNavLinks = [
1711
1790
  {
1712
1791
  label: "Dashboard",
@@ -2003,65 +2082,11 @@ var TopNav = async ({
2003
2082
  ),
2004
2083
  /* @__PURE__ */ jsx("span", { className: "text-xl font-bold text-gray-900", children: brandTitle || "Enterprise Portal" })
2005
2084
  ] }),
2006
- /* @__PURE__ */ jsxs("details", { className: "group relative", children: [
2007
- /* @__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: [
2008
- /* @__PURE__ */ jsxs(
2009
- "svg",
2010
- {
2011
- xmlns: "http://www.w3.org/2000/svg",
2012
- width: "16",
2013
- height: "16",
2014
- viewBox: "0 0 24 24",
2015
- fill: "none",
2016
- stroke: "currentColor",
2017
- strokeWidth: "2",
2018
- strokeLinecap: "round",
2019
- strokeLinejoin: "round",
2020
- className: "text-gray-500",
2021
- children: [
2022
- /* @__PURE__ */ jsx("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
2023
- /* @__PURE__ */ jsx("circle", { cx: "12", cy: "7", r: "4" })
2024
- ]
2025
- }
2026
- ),
2027
- /* @__PURE__ */ jsx("span", { children: displayLabel }),
2028
- /* @__PURE__ */ jsx(
2029
- "svg",
2030
- {
2031
- xmlns: "http://www.w3.org/2000/svg",
2032
- width: "16",
2033
- height: "16",
2034
- viewBox: "0 0 24 24",
2035
- fill: "none",
2036
- stroke: "currentColor",
2037
- strokeWidth: "2",
2038
- strokeLinecap: "round",
2039
- strokeLinejoin: "round",
2040
- className: "text-gray-500",
2041
- children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" })
2042
- }
2043
- )
2044
- ] }),
2045
- /* @__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: [
2046
- /* @__PURE__ */ jsx(
2047
- Link,
2048
- {
2049
- href: "/user-settings",
2050
- className: "block w-full px-4 py-2 text-left hover:bg-gray-100",
2051
- children: "User settings"
2052
- }
2053
- ),
2054
- /* @__PURE__ */ jsx(
2055
- Link,
2056
- {
2057
- href: "/team-settings",
2058
- className: "block w-full px-4 py-2 text-left hover:bg-gray-100",
2059
- children: "Team settings"
2060
- }
2061
- ),
2062
- userMenuChildren,
2063
- logoutButton
2064
- ] })
2085
+ /* @__PURE__ */ jsxs(UserMenuDropdown, { displayLabel, children: [
2086
+ /* @__PURE__ */ jsx(UserMenuItem, { href: "/user-settings", children: "User settings" }),
2087
+ /* @__PURE__ */ jsx(UserMenuItem, { href: "/team-settings", children: "Team settings" }),
2088
+ userMenuChildren,
2089
+ logoutButton
2065
2090
  ] })
2066
2091
  ] }),
2067
2092
  /* @__PURE__ */ jsx("div", { className: "mt-3 flex flex-wrap gap-3 pb-2 text-sm font-medium text-gray-500", children: resolvedLinks.map(({ label, icon, href }) => {
@@ -2328,7 +2353,7 @@ var TeamsSection = ({
2328
2353
  "svg",
2329
2354
  {
2330
2355
  className: "h-4 w-4",
2331
- style: { color: primaryColor || DEFAULT_SECONDARY_COLOR },
2356
+ style: { color: primaryColor || DEFAULT_PRIMARY_COLOR },
2332
2357
  fill: "none",
2333
2358
  viewBox: "0 0 24 24",
2334
2359
  stroke: "currentColor",
@@ -2352,7 +2377,7 @@ var TeamsSection = ({
2352
2377
  "svg",
2353
2378
  {
2354
2379
  className: "h-4 w-4",
2355
- style: { color: primaryColor || DEFAULT_SECONDARY_COLOR },
2380
+ style: { color: primaryColor || DEFAULT_PRIMARY_COLOR },
2356
2381
  fill: "none",
2357
2382
  viewBox: "0 0 24 24",
2358
2383
  stroke: "currentColor",
@@ -2418,8 +2443,8 @@ var ProfileSection = ({
2418
2443
  setIsEditing(true);
2419
2444
  };
2420
2445
  const buttonStyle = {
2421
- backgroundColor: primaryColor || DEFAULT_SECONDARY_COLOR,
2422
- borderColor: primaryColor || DEFAULT_SECONDARY_COLOR
2446
+ backgroundColor: primaryColor || DEFAULT_PRIMARY_COLOR,
2447
+ borderColor: primaryColor || DEFAULT_PRIMARY_COLOR
2423
2448
  };
2424
2449
  return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-gray-200 bg-white p-6 shadow-sm", children: [
2425
2450
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [