@camunda/ccma-saas-frontend 0.15.1 → 0.17.0

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 (129) hide show
  1. package/lib/esm/components/c4-audit-log/c4-audit-log.js +53 -42
  2. package/lib/esm/components/c4-billing-page/c4-billing-page.js +5 -1
  3. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +8 -3
  4. package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.d.ts +10 -0
  5. package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +9 -1
  6. package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +13 -5
  7. package/lib/esm/components/c4-cluster-client-credentials/ds-credential-items.d.ts +14 -0
  8. package/lib/esm/components/c4-cluster-client-credentials/ds-credential-items.js +18 -0
  9. package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +18 -7
  10. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +2 -2
  11. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +4 -10
  12. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +1 -4
  13. package/lib/esm/components/c4-cluster-overview/applications.d.ts +16 -0
  14. package/lib/esm/components/c4-cluster-overview/applications.js +130 -17
  15. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.d.ts +34 -1
  16. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +31 -0
  17. package/lib/esm/components/c4-cluster-overview/cluster-details.js +11 -9
  18. package/lib/esm/components/c4-cluster-overview/cluster-load.d.ts +4 -3
  19. package/lib/esm/components/c4-cluster-overview/cluster-load.js +17 -13
  20. package/lib/esm/components/c4-cluster-overview/ds-section.d.ts +23 -0
  21. package/lib/esm/components/c4-cluster-overview/ds-section.js +19 -0
  22. package/lib/esm/components/c4-cluster-overview/ds-status-icon-text.d.ts +33 -0
  23. package/lib/esm/components/c4-cluster-overview/ds-status-icon-text.js +34 -0
  24. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +7 -1
  25. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.d.ts +6 -1
  26. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +5 -2
  27. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +4 -5
  28. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +40 -15
  29. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +24 -4
  30. package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +12 -0
  31. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +2 -1
  32. package/lib/esm/components/c4-create-cluster-api-client-modal/scopes-description-text.d.ts +11 -0
  33. package/lib/esm/components/c4-create-cluster-api-client-modal/scopes-description-text.js +16 -0
  34. package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +4 -1
  35. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +6 -2
  36. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.types.d.ts +6 -0
  37. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +1 -1
  38. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +1 -0
  39. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +1 -1
  40. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +13 -6
  41. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +24 -5
  42. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +4 -4
  43. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +1 -1
  44. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.d.ts +1 -1
  45. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js +3 -1
  46. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.d.ts +7 -1
  47. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +8 -4
  48. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +6 -1
  49. package/lib/esm/components/c4-management-settings/c4-management-settings.js +58 -42
  50. package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -0
  51. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +11 -10
  52. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.types.d.ts +4 -0
  53. package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +9 -1
  54. package/lib/esm/components/c4-sm-cluster-details/details.js +2 -8
  55. package/lib/esm/components/c4-tabs/c4-tabs.js +6 -1
  56. package/lib/esm/components/c4-usage-history/elements/usage-history-charts.d.ts +3 -3
  57. package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +2 -8
  58. package/lib/esm/externalUrls.const.d.ts +1 -1
  59. package/lib/esm/externalUrls.const.js +1 -2
  60. package/lib/esm/i18n/en/modals/billing.json +2 -2
  61. package/lib/esm/i18n/en/modals/clusterclients.json +6 -6
  62. package/lib/esm/i18n/en/modals/invitations.json +1 -0
  63. package/lib/esm/i18n/en/modals/users.json +1 -0
  64. package/lib/esm/i18n/en/pages/clusterdetails.json +4 -1
  65. package/lib/esm/i18n/en/pages/createcluster.json +5 -0
  66. package/lib/esm/i18n/en/pages/dashboard.json +7 -5
  67. package/lib/esm/i18n/en/pages/orgmanagement.json +4 -0
  68. package/lib/esm/index.d.ts +1 -1
  69. package/lib/esm/index.js +1 -1
  70. package/lib/esm/runtime/c4-console-events-context.d.ts +5 -1
  71. package/lib/esm/runtime/c4-console-events-context.js +16 -2
  72. package/lib/esm/runtime/c4-console-runtime-context.d.ts +7 -6
  73. package/lib/esm/runtime/c4-console-runtime-context.js +29 -12
  74. package/lib/esm/runtime/c4-console-runtime.types.d.ts +7 -7
  75. package/lib/esm/runtime/c4-user-notifications-context.js +6 -2
  76. package/lib/esm/runtime/c4-user-notifications-context.types.d.ts +5 -1
  77. package/lib/esm/runtime/use-hub-api-naming.d.ts +8 -11
  78. package/lib/esm/runtime/use-hub-api-naming.js +9 -12
  79. package/lib/esm/runtime/use-is-qa-user.d.ts +23 -0
  80. package/lib/esm/runtime/use-is-qa-user.js +64 -0
  81. package/lib/esm/ui/c4-cluster-tag.d.ts +11 -0
  82. package/lib/esm/ui/c4-cluster-tag.js +39 -0
  83. package/lib/esm/ui/ds-compact-code-block.d.ts +15 -0
  84. package/lib/esm/ui/ds-compact-code-block.js +33 -0
  85. package/lib/esm/ui/index.d.ts +13 -3
  86. package/lib/esm/ui/index.js +14 -7
  87. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +21 -6
  88. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +4 -2
  89. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.d.ts +1 -1
  90. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +31 -12
  91. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +6 -1
  92. package/lib/esm/widgets/cluster-details/cluster-region-code.d.ts +8 -0
  93. package/lib/esm/widgets/cluster-details/cluster-region-code.js +17 -0
  94. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +44 -6
  95. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +6 -4
  96. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +2 -14
  97. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +7 -0
  98. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +23 -11
  99. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +11 -15
  100. package/lib/esm/widgets/cluster-details/upgrade-gate.d.ts +23 -0
  101. package/lib/esm/widgets/cluster-details/upgrade-gate.js +36 -0
  102. package/lib/esm/widgets/cluster-details/use-upgrade-gate.d.ts +24 -0
  103. package/lib/esm/widgets/cluster-details/use-upgrade-gate.js +73 -0
  104. package/lib/esm/widgets/clusters/c4-clusters-page.js +0 -4
  105. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.d.ts +4 -1
  106. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +44 -17
  107. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.types.d.ts +0 -3
  108. package/lib/esm/widgets/dashboard/c4-dashboard-app.js +12 -11
  109. package/lib/esm/widgets/dashboard/c4-dashboard-app.types.d.ts +2 -3
  110. package/lib/esm/widgets/group-details/c4-group-details-page.d.ts +1 -1
  111. package/lib/esm/widgets/group-details/c4-group-details-page.js +10 -3
  112. package/lib/esm/widgets/group-details/c4-group-details-page.types.d.ts +5 -0
  113. package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
  114. package/lib/esm/widgets/management/c4-management-app.js +34 -36
  115. package/lib/esm/widgets/management/c4-management-app.types.d.ts +10 -9
  116. package/lib/esm/widgets/management/tabs/c4-management-billing-tab.d.ts +0 -1
  117. package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -2
  118. package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +1 -1
  119. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +2 -2
  120. package/lib/esm/widgets/management/tabs/c4-management-users-tab.d.ts +3 -1
  121. package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +2 -2
  122. package/lib/esm/widgets/user-details/c4-user-details-page.d.ts +1 -1
  123. package/lib/esm/widgets/user-details/c4-user-details-page.js +5 -2
  124. package/lib/esm/widgets/user-details/c4-user-details-page.types.d.ts +5 -0
  125. package/package.json +23 -23
  126. package/lib/esm/runtime/cluster-duplication.d.ts +0 -10
  127. package/lib/esm/runtime/cluster-duplication.js +0 -15
  128. package/lib/esm/widgets/management/tabs/c4-management-groups-tab.d.ts +0 -13
  129. package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +0 -26
@@ -6,10 +6,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  */
7
7
  import { preview__IconIndicator as IconIndicator, Layer } from '@carbon/react';
8
8
  import { ArrowRight, CheckmarkFilled, Information, PauseOutlineFilled, PendingFilled, WarningFilled, } from '@carbon/react/icons/index.esm.js';
9
+ import { CircleAlert, CircleCheck, CirclePause, CircleX, Info, RefreshCw, Wrench, } from 'lucide-react';
9
10
  import { useEffect, useState } from 'react';
11
+ import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
10
12
  import { Link, Loading, Stack, Tile, Tooltip } from '../../ui/index.js';
11
13
  import { mediaSizeByWidth } from '../c4-billing-page/elements/current-usage-metrics.js';
12
14
  import { C4TileWithTitleAndAction } from '../c4-tile-with-title-and-action/c4-tile-with-title-and-action.js';
15
+ import { DsSection } from './ds-section.js';
16
+ import { DS_STATUS_ICON_COLORS, DsStatusIconText, SpinningLoader, } from './ds-status-icon-text.js';
13
17
  const MAINTENANCE_STATUS_TEXT = 'Maintenance';
14
18
  const MAINTENANCE_INDICATOR_KIND = 'undefined';
15
19
  export var StatusColor;
@@ -48,6 +52,88 @@ export const normalizeClusterStatus = (status) => {
48
52
  return undefined;
49
53
  }
50
54
  };
55
+ /**
56
+ * Icon, color and label of each status in ds mode. They follow the
57
+ * environment status in Hub. 'restoring', 'waitingForInput' and 'maintenance'
58
+ * have no Hub counterpart and get their own icons.
59
+ */
60
+ const DS_CLUSTER_STATUS_PRESENTATION = {
61
+ healthy: {
62
+ label: 'Healthy',
63
+ icon: CircleCheck,
64
+ color: DS_STATUS_ICON_COLORS.success,
65
+ },
66
+ unhealthy: {
67
+ label: 'Unhealthy',
68
+ icon: CircleX,
69
+ color: DS_STATUS_ICON_COLORS.danger,
70
+ },
71
+ creating: {
72
+ label: 'Creating…',
73
+ icon: SpinningLoader,
74
+ color: DS_STATUS_ICON_COLORS.info,
75
+ },
76
+ updating: {
77
+ label: 'Updating…',
78
+ icon: SpinningLoader,
79
+ color: DS_STATUS_ICON_COLORS.info,
80
+ },
81
+ restoring: {
82
+ label: 'Restoring…',
83
+ icon: SpinningLoader,
84
+ color: DS_STATUS_ICON_COLORS.info,
85
+ },
86
+ resuming: {
87
+ label: 'Resuming',
88
+ icon: RefreshCw,
89
+ color: DS_STATUS_ICON_COLORS.info,
90
+ },
91
+ suspended: {
92
+ label: 'Paused',
93
+ icon: CirclePause,
94
+ color: DS_STATUS_ICON_COLORS.neutral,
95
+ },
96
+ waitingForInput: {
97
+ label: 'Waiting',
98
+ icon: CircleAlert,
99
+ color: DS_STATUS_ICON_COLORS.warning,
100
+ },
101
+ maintenance: {
102
+ label: MAINTENANCE_STATUS_TEXT,
103
+ icon: Wrench,
104
+ color: DS_STATUS_ICON_COLORS.neutral,
105
+ },
106
+ };
107
+ /**
108
+ * The DS badge variant of each status, as the cluster and environment headers
109
+ * in Hub use it.
110
+ */
111
+ const DS_CLUSTER_STATUS_BADGE_VARIANT = {
112
+ healthy: 'success',
113
+ unhealthy: 'danger',
114
+ creating: 'info',
115
+ updating: 'info',
116
+ restoring: 'info',
117
+ resuming: 'info',
118
+ suspended: 'neutral',
119
+ waitingForInput: 'warning',
120
+ maintenance: 'neutral',
121
+ };
122
+ /**
123
+ * The icon, label and badge variant of a status for a DS `Badge` (ds mode
124
+ * only). It gives `undefined` for a value that `normalizeClusterStatus` does
125
+ * not know.
126
+ */
127
+ export function getDsClusterStatusBadge(status) {
128
+ const normalized = normalizeClusterStatus(status);
129
+ if (!normalized) {
130
+ return undefined;
131
+ }
132
+ return {
133
+ ...DS_CLUSTER_STATUS_PRESENTATION[normalized],
134
+ variant: DS_CLUSTER_STATUS_BADGE_VARIANT[normalized],
135
+ };
136
+ }
51
137
  export const ClusterStatusElement = (props) => {
52
138
  const isMaintenanceStatus = props.status === 'maintenance';
53
139
  // Which states get the info affordance next to the status text. A healthy
@@ -57,6 +143,39 @@ export const ClusterStatusElement = (props) => {
57
143
  const supportsInfoTooltip = props.status === 'waitingForInput' ||
58
144
  props.status === 'updating' ||
59
145
  props.status === 'unhealthy';
146
+ const designSystem = useC4DesignSystem();
147
+ const renderInfoTooltip = (infoIcon, iconColor) => (_jsx(Tooltip, { align: 'bottom', description: _jsx("span", { style: {
148
+ display: 'block',
149
+ whiteSpace: 'normal',
150
+ maxWidth: '16rem',
151
+ }, children: props.infoTooltip }), children: _jsx("button", { type: 'button', "aria-label": props.infoTooltip, onClick: () => props.onInfoClick?.(), style: {
152
+ display: 'inline-flex',
153
+ alignItems: 'center',
154
+ justifyContent: 'center',
155
+ minBlockSize: '1.5rem',
156
+ minInlineSize: '1.5rem',
157
+ padding: 0,
158
+ border: 0,
159
+ background: 'transparent',
160
+ color: iconColor,
161
+ cursor: 'pointer',
162
+ }, children: infoIcon }) }));
163
+ if (designSystem === 'ds') {
164
+ // Some callers pass a raw API value that is only lowercased, for example
165
+ // 'waitingforinput' or 'unknown'. Normalize it first, and show an empty
166
+ // cell for a value we do not know, like the carbon path does.
167
+ const dsStatus = normalizeClusterStatus(props.status);
168
+ if (!dsStatus) {
169
+ return _jsx("div", { style: props.style });
170
+ }
171
+ const presentation = DS_CLUSTER_STATUS_PRESENTATION[dsStatus];
172
+ const dsSupportsInfoTooltip = dsStatus === 'waitingForInput' ||
173
+ dsStatus === 'updating' ||
174
+ dsStatus === 'unhealthy';
175
+ return (_jsxs(DsStatusIconText, { status: presentation, style: props.style, children: [_jsx("span", { children: presentation.label }), dsSupportsInfoTooltip &&
176
+ props.infoTooltip &&
177
+ renderInfoTooltip(_jsx(Info, { className: 'size-4', "aria-hidden": true }), DS_STATUS_ICON_COLORS.neutral)] }));
178
+ }
60
179
  let icon = null;
61
180
  let text = '';
62
181
  let color;
@@ -120,22 +239,9 @@ export const ClusterStatusElement = (props) => {
120
239
  display: 'inline-flex',
121
240
  alignItems: 'center',
122
241
  gap: '0.125rem',
123
- }, children: [_jsx("span", { children: text }), supportsInfoTooltip && props.infoTooltip && (_jsx(Tooltip, { align: 'bottom', description: _jsx("span", { style: {
124
- display: 'block',
125
- whiteSpace: 'normal',
126
- maxWidth: '16rem',
127
- }, children: props.infoTooltip }), children: _jsx("button", { type: 'button', "aria-label": props.infoTooltip, onClick: () => props.onInfoClick?.(), style: {
128
- display: 'inline-flex',
129
- alignItems: 'center',
130
- justifyContent: 'center',
131
- minBlockSize: '1.5rem',
132
- minInlineSize: '1.5rem',
133
- padding: 0,
134
- border: 0,
135
- background: 'transparent',
136
- color: 'var(--cds-icon-primary)',
137
- cursor: 'pointer',
138
- }, children: _jsx(Information, {}) }) }))] }))] }) }));
242
+ }, children: [_jsx("span", { children: text }), supportsInfoTooltip &&
243
+ props.infoTooltip &&
244
+ renderInfoTooltip(_jsx(Information, {}), 'var(--cds-icon-primary)')] }))] }) }));
139
245
  return component;
140
246
  };
141
247
  export const ApplicationTile = (props) => {
@@ -143,6 +249,7 @@ export const ApplicationTile = (props) => {
143
249
  const borderColor = 'var(--cds-border-subtle)';
144
250
  const borderWidth = '1px';
145
251
  const borderStyle = 'solid';
252
+ const isDs = useC4DesignSystem() === 'ds';
146
253
  const normalizedLink = props.link ??
147
254
  (props.url && props.linkLabel
148
255
  ? {
@@ -151,7 +258,9 @@ export const ApplicationTile = (props) => {
151
258
  visible: props.linkVisible !== false,
152
259
  }
153
260
  : undefined);
154
- const component = (_jsx(Layer, { children: _jsx(Tile, { style: { height: '100%', borderColor, borderWidth, borderStyle }, children: _jsxs(Stack, { gap: 3, children: [_jsxs(Stack, { gap: 1, children: [_jsxs("div", { style: {
261
+ const component = (_jsx(Layer, { children: _jsx(Tile, { style: isDs
262
+ ? { height: '100%', padding: '1.25rem' }
263
+ : { height: '100%', borderColor, borderWidth, borderStyle }, children: _jsxs(Stack, { gap: 3, children: [_jsxs(Stack, { gap: 1, children: [_jsxs("div", { style: {
155
264
  display: 'flex',
156
265
  justifyContent: 'space-between',
157
266
  alignItems: 'flex-start',
@@ -201,6 +310,7 @@ const templateColumnsBySize = {
201
310
  xxl: '1fr 1fr 1fr',
202
311
  };
203
312
  export const Applications = (props) => {
313
+ const designSystem = useC4DesignSystem();
204
314
  const [mediaSize, setMediaSize] = useState(mediaSizeByWidth(window.innerWidth));
205
315
  useEffect(() => {
206
316
  let frame = 0;
@@ -235,6 +345,9 @@ export const Applications = (props) => {
235
345
  }
236
346
  return (_jsx("div", { children: _jsx(ApplicationTile, { ...props }) }, props.name));
237
347
  }) }));
348
+ if (props.variant === 'plain' && designSystem === 'ds') {
349
+ return _jsx(DsSection, { title: props.title, children: grid });
350
+ }
238
351
  if (props.variant === 'plain') {
239
352
  return (_jsxs("div", { children: [_jsx("h6", { style: { fontSize: '16px', marginBottom: '16px' }, children: props.title }), grid] }));
240
353
  }
@@ -1,5 +1,6 @@
1
1
  import type { CSSProperties, JSX } from 'react';
2
2
  import type { C4ClusterOverviewProps } from './c4-cluster-overview.types.js';
3
+ import { type DsStatusIcon } from './ds-status-icon-text.js';
3
4
  export declare const C4ClusterOverview: ({ applications, details, clusterLoad, rbaNotification, jobDashboard, overviewSection, }: C4ClusterOverviewProps) => JSX.Element;
4
5
  export declare const C4IconAndTextElement: (props: {
5
6
  icon: any;
@@ -10,9 +11,41 @@ export declare const C4IconAndTextElement: (props: {
10
11
  label: string;
11
12
  align?: "top" | "bottom" | "left" | "right";
12
13
  };
14
+ /**
15
+ * ds-mode only. The lucide icon and color to show in ds mode, for example
16
+ * from `getDsClusterLoadPresentation`. Without it, ds mode shows `icon`
17
+ * and `color` in the carbon layout.
18
+ */
19
+ dsIcon?: DsStatusIcon;
13
20
  }) => JSX.Element;
21
+ export type ClusterLoadType = 'green' | 'warning' | 'red' | 'unknown';
22
+ /**
23
+ * The load range of a cluster load in ds mode. It uses the same ranges as
24
+ * `getClusterLoadConfig`.
25
+ */
26
+ export declare function getDsClusterLoadType(currentValue: number): ClusterLoadType;
27
+ /** The lucide icon and color for a cluster load in ds mode. */
28
+ export declare function getDsClusterLoadPresentation(currentValue: number): DsStatusIcon;
14
29
  export declare function getClusterLoadConfig(currentValue: number): {
15
- type: string;
30
+ type: "green";
31
+ color: string;
32
+ icon: JSX.Element;
33
+ min: number;
34
+ max: number;
35
+ } | {
36
+ type: "warning";
37
+ color: string;
38
+ icon: JSX.Element;
39
+ min: number;
40
+ max: number;
41
+ } | {
42
+ type: "red";
43
+ color: string;
44
+ icon: JSX.Element;
45
+ min: number;
46
+ max: number;
47
+ } | {
48
+ type: "unknown";
16
49
  color: string;
17
50
  icon: JSX.Element;
18
51
  min: number;
@@ -5,7 +5,9 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
7
  import { Caution, CheckmarkFilled } from '@carbon/react/icons/index.esm.js';
8
+ import { Check, TriangleAlert } from 'lucide-react';
8
9
  import styled from 'styled-components';
10
+ import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
9
11
  import { Stack, Tooltip } from '../../ui/index.js';
10
12
  import { C4ActionableNotification } from '../c4-actionable-notification/c4-actionable-notification.js';
11
13
  import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
@@ -13,6 +15,7 @@ import C4JobDashboardEntryPoint from '../c4-job-dashboard-entry-point/c4-job-das
13
15
  import { Applications } from './applications.js';
14
16
  import { ClusterDetails } from './cluster-details.js';
15
17
  import { ClusterLoad } from './cluster-load.js';
18
+ import { DS_STATUS_ICON_COLORS, DsStatusIconText, } from './ds-status-icon-text.js';
16
19
  const ResponsiveOverviewGrid = styled.div `
17
20
  display: flex;
18
21
  flex-direction: column;
@@ -56,6 +59,10 @@ export const C4ClusterOverview = ({ applications, details, clusterLoad, rbaNotif
56
59
  return component;
57
60
  };
58
61
  export const C4IconAndTextElement = (props) => {
62
+ const designSystem = useC4DesignSystem();
63
+ if (designSystem === 'ds' && props.dsIcon) {
64
+ return (_jsx(DsStatusIconText, { status: props.dsIcon, style: props.style, children: props.tooltip ? (_jsx(Tooltip, { align: props.tooltip.align ?? 'bottom', autoAlign: true, label: props.tooltip.label, children: _jsx("span", { children: props.text }) })) : (props.text) }));
65
+ }
59
66
  const component = (_jsx("div", { style: { ...props.style }, children: _jsxs("div", { style: { position: 'relative' }, children: [props.icon && (_jsx("div", { style: {
60
67
  position: 'absolute',
61
68
  top: '50%',
@@ -65,6 +72,30 @@ export const C4IconAndTextElement = (props) => {
65
72
  }, children: props.icon })), _jsxs("span", { style: { paddingInlineStart: props.icon ? '1.2rem' : '0rem' }, children: [props.tooltip && (_jsx("span", { style: { zIndex: 999 }, children: _jsx(Tooltip, { align: props.tooltip.align ?? 'bottom', autoAlign: true, label: props.tooltip.label, children: _jsx("span", { children: props.text }) }) })), !props.tooltip && props.text] })] }) }));
66
73
  return component;
67
74
  };
75
+ /** Icon and color of each cluster load range in ds mode. */
76
+ const DS_CLUSTER_LOAD_PRESENTATION = {
77
+ green: { icon: Check, color: DS_STATUS_ICON_COLORS.success },
78
+ warning: { icon: TriangleAlert, color: DS_STATUS_ICON_COLORS.warning },
79
+ red: { icon: TriangleAlert, color: DS_STATUS_ICON_COLORS.danger },
80
+ unknown: { icon: TriangleAlert, color: DS_STATUS_ICON_COLORS.warning },
81
+ };
82
+ /**
83
+ * The load range of a cluster load in ds mode. It uses the same ranges as
84
+ * `getClusterLoadConfig`.
85
+ */
86
+ export function getDsClusterLoadType(currentValue) {
87
+ const { type } = getClusterLoadConfig(currentValue);
88
+ // The carbon ranges end below 1000 %, so a higher load is 'unknown' there.
89
+ // In ds mode, every load from the start of the red range up is critical.
90
+ const redMin = CLUSTER_LOAD_RANGES.find((range) => range.type === 'red')?.min;
91
+ return type === 'unknown' && redMin !== undefined && currentValue >= redMin
92
+ ? 'red'
93
+ : type;
94
+ }
95
+ /** The lucide icon and color for a cluster load in ds mode. */
96
+ export function getDsClusterLoadPresentation(currentValue) {
97
+ return DS_CLUSTER_LOAD_PRESENTATION[getDsClusterLoadType(currentValue)];
98
+ }
68
99
  export function getClusterLoadConfig(currentValue) {
69
100
  const found = CLUSTER_LOAD_RANGES.find((entry) => {
70
101
  return currentValue >= entry.min && currentValue < entry.max;
@@ -1,22 +1,18 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- /*
3
- * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
- * under one or more contributor license agreements. Licensed under a commercial license.
5
- * You may not use this file except in compliance with the commercial license.
6
- */
7
- import { C3ClusterTag, } from '@camunda/camunda-composite-components';
8
2
  import { Layer } from '@carbon/react';
9
3
  import { Add, Information, Launch, Pause, Play, UpdateNow, WarningAltFilled, } from '@carbon/react/icons/index.esm.js';
10
4
  import { useEffect, useRef, useState } from 'react';
11
5
  import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
12
- import { Button, CodeSnippet, Link, TextArea, Tooltip } from '../../ui/index.js';
6
+ import { Button, ClusterTag, CodeSnippet, DsCompactCodeBlock, Link, TextArea, Tooltip, } from '../../ui/index.js';
13
7
  import { C4ActionableNotification } from '../c4-actionable-notification/c4-actionable-notification.js';
14
8
  import { C4LinkButton } from '../c4-link-button/c4-link-button.js';
15
9
  import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListWrapper, } from '../c4-structured-list/c4-structured-list.js';
16
10
  import { C4TileWithTitleAndAction } from '../c4-tile-with-title-and-action/c4-tile-with-title-and-action.js';
17
11
  import { ClusterStatusElement, normalizeClusterStatus, } from './applications.js';
12
+ import { DsSection } from './ds-section.js';
18
13
  // The `height: 0` `Layer` wrapper is a Carbon-only trick to keep the snippet
19
14
  // from growing the fixed-height row. It does not apply in DS mode.
15
+ // In DS mode, `DsCompactCodeBlock` keeps the ID row as short as the others.
20
16
  const ClusterDetailsIdValue = (props) => {
21
17
  const designSystem = useC4DesignSystem();
22
18
  if (designSystem !== 'ds') {
@@ -27,7 +23,7 @@ const ClusterDetailsIdValue = (props) => {
27
23
  if (props.value === '' || props.value === '-') {
28
24
  return _jsx("span", { children: "-" });
29
25
  }
30
- return (_jsx("div", { style: { maxWidth: '22rem' }, children: _jsx(CodeSnippet, { type: 'single', copyButtonDescription: props.copyLabel, feedback: props.copiedLabel, children: props.value }) }));
26
+ return (_jsx(DsCompactCodeBlock, { maxWidth: '22rem', copyLabel: props.copyLabel, copiedLabel: props.copiedLabel, children: props.value }));
31
27
  };
32
28
  export const ClusterDetails = (props) => {
33
29
  const isDsMode = useC4DesignSystem() === 'ds';
@@ -111,6 +107,9 @@ export const ClusterDetails = (props) => {
111
107
  display: 'flex',
112
108
  flexDirection: 'column',
113
109
  gap: '0.5rem',
110
+ // ds mode: room under the buttons, so they do not sit
111
+ // on the row border.
112
+ ...(isDsMode ? { paddingBottom: '1rem' } : {}),
114
113
  }, children: [_jsx(TextArea, { id: 'cluster-description', labelText: '', value: descriptionValue, onChange: (event) => {
115
114
  setDescriptionValue(event.target.value);
116
115
  setDescriptionError('');
@@ -144,7 +143,7 @@ export const ClusterDetails = (props) => {
144
143
  display: 'grid',
145
144
  gridTemplateColumns: 'auto 1fr',
146
145
  gap: '0.5rem',
147
- }, children: props.tags.value?.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { children: props.tags.value.map((tag) => (_jsx(C3ClusterTag, { stage: tag }, `cluster-tag-${tag}`))) }), props.tags.updateVisible && (_jsx(C4LinkButton, { label: props.tags.updateTagLabel, onClick: () => props.tags?.updateAction(), style: { alignSelf: 'center' }, disabled: props.tags.updateDisabled }))] })) : (props.tags.updateVisible && (_jsx(C4LinkButton, { label: props.tags.addTagLabel, onClick: () => props.tags?.updateAction(), style: { alignSelf: 'center' }, icon: _jsx(Add, {}), disabled: props.tags.updateDisabled }))) }) })] })), props.regionId && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.regionId.label }), _jsx(C4StructuredListCell, { children: _jsx(ClusterDetailsIdValue, { value: props.regionId.value, copyLabel: props.copyValueLabel ?? 'Copy', copiedLabel: props.copyValueCopiedLabel ?? 'Copied!' }) })] })), props.backupRegionId && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.backupRegionId.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsx(ClusterDetailsIdValue, { value: props.backupRegionId.value, copyLabel: props.copyValueLabel ?? 'Copy', copiedLabel: props.copyValueCopiedLabel ?? 'Copied!' }) })] })), _jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.id.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsx(ClusterDetailsIdValue, { value: props.id.value, copyLabel: props.copyValueLabel ?? 'Copy', copiedLabel: props.copyValueCopiedLabel ?? 'Copied!' }) })] }), props.swaggerUrl && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.swaggerUrl.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsxs("span", { style: {
146
+ }, children: props.tags.value?.length > 0 ? (_jsxs(_Fragment, { children: [_jsx("div", { children: props.tags.value.map((tag) => (_jsx(ClusterTag, { stage: tag }, `cluster-tag-${tag}`))) }), props.tags.updateVisible && (_jsx(C4LinkButton, { label: props.tags.updateTagLabel, onClick: () => props.tags?.updateAction(), style: { alignSelf: 'center' }, disabled: props.tags.updateDisabled }))] })) : (props.tags.updateVisible && (_jsx(C4LinkButton, { label: props.tags.addTagLabel, onClick: () => props.tags?.updateAction(), style: { alignSelf: 'center' }, icon: _jsx(Add, {}), disabled: props.tags.updateDisabled }))) }) })] })), props.regionId && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.regionId.label }), _jsx(C4StructuredListCell, { children: _jsx(ClusterDetailsIdValue, { value: props.regionId.value, copyLabel: props.copyValueLabel ?? 'Copy', copiedLabel: props.copyValueCopiedLabel ?? 'Copied!' }) })] })), props.backupRegionId && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.backupRegionId.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsx(ClusterDetailsIdValue, { value: props.backupRegionId.value, copyLabel: props.copyValueLabel ?? 'Copy', copiedLabel: props.copyValueCopiedLabel ?? 'Copied!' }) })] })), _jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.id.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsx(ClusterDetailsIdValue, { value: props.id.value, copyLabel: props.copyValueLabel ?? 'Copy', copiedLabel: props.copyValueCopiedLabel ?? 'Copied!' }) })] }), props.swaggerUrl && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.swaggerUrl.label }), _jsx(C4StructuredListCell, { noWrap: true, children: _jsxs("span", { style: {
148
147
  display: 'inline-flex',
149
148
  alignItems: 'center',
150
149
  gap: 'var(--cds-spacing-02)',
@@ -164,6 +163,9 @@ export const ClusterDetails = (props) => {
164
163
  marginLeft: 'var(--cds-spacing-02)',
165
164
  verticalAlign: 'middle',
166
165
  } })] })] }) })] })), props.created && (_jsxs(C4StructuredListRow, { style: rowStyle, children: [_jsx(C4StructuredListCell, { noWrap: true, children: props.created.label }), _jsx(C4StructuredListCell, { noWrap: true, children: props.created.value })] }))] }) })] }));
166
+ if (props.variant === 'plain' && isDsMode) {
167
+ return _jsx(DsSection, { title: props.title, children: inner });
168
+ }
167
169
  if (props.variant === 'plain') {
168
170
  return (_jsxs("div", { children: [_jsx("h6", { style: { fontSize: '16px', marginBottom: '16px' }, children: props.title }), inner] }));
169
171
  }
@@ -32,9 +32,10 @@ export interface ClusterLoadProps {
32
32
  loading?: boolean;
33
33
  /**
34
34
  * `'tile'` (default) renders this section inside `C4TileWithTitleAndAction`'s
35
- * bordered, padded card — Console's own look. `'plain'` drops that card in
36
- * favor of a bare heading, for a host that renders this section inline
37
- * alongside its own similarly bare sections.
35
+ * bordered, padded card — Console's own look. `'plain'` is for a host that
36
+ * renders this section inline with its own sections: in carbon mode it is a
37
+ * bare heading and the content; in ds mode it is the shared section heading
38
+ * with the content in a DS card.
38
39
  */
39
40
  variant?: 'tile' | 'plain';
40
41
  }
@@ -9,19 +9,25 @@ import { Renew } from '@carbon/react/icons/index.esm.js';
9
9
  import { useState } from 'react';
10
10
  import { Area, CartesianGrid, AreaChart as DsAreaChart, Legend, Tooltip as RechartsTooltip, ResponsiveContainer, XAxis, YAxis, } from 'recharts';
11
11
  import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
12
- import { Loading, Stack, Tag, Tooltip } from '../../ui/index.js';
12
+ import { DsProgress, Loading, Stack, Tag, Tooltip } from '../../ui/index.js';
13
13
  import { CHART_COLORS } from '../c4-billing-page/elements/value-metric.js';
14
14
  import { C4Divider } from '../c4-divider/c4-divider.js';
15
15
  import { C4ExternalLink } from '../c4-external-link/c4-external-link.js';
16
16
  import { C4LinkButton } from '../c4-link-button/c4-link-button.js';
17
17
  import { C4TileWithTitleAndAction } from '../c4-tile-with-title-and-action/c4-tile-with-title-and-action.js';
18
- import { DsMeterChart } from '../shared-charts/ds-meter-chart.js';
19
- import { DS_CHART_AXIS_COLOR, DS_CHART_GRID_COLOR, DS_CHART_TOOLTIP_PROPS, DS_STATUS_COLORS, getDsSeriesColor, } from '../shared-charts/recharts-tokens.js';
20
- import { getClusterLoadConfig } from './c4-cluster-overview.js';
18
+ import { DS_CHART_AXIS_COLOR, DS_CHART_GRID_COLOR, DS_CHART_TOOLTIP_PROPS, getDsSeriesColor, } from '../shared-charts/recharts-tokens.js';
19
+ import { getClusterLoadConfig, getDsClusterLoadPresentation, } from './c4-cluster-overview.js';
20
+ import { DsSection } from './ds-section.js';
21
21
  export const ClusterLoad = (props) => {
22
+ const designSystem = useC4DesignSystem();
22
23
  const body = props.loading ? (_jsxs(_Fragment, { children: [_jsx(Loading, {}), _jsx("div", { style: { minHeight: '465px' } })] })) : (_jsxs(Stack, { gap: 3, children: [_jsx(LatestChart, { ...props }), _jsx("span", { style: { marginTop: '0.5rem' }, children: _jsx(C4Divider, {}) }), _jsx(HistoricChart, { ...props }), _jsx("span", { style: { marginTop: '0.75rem' }, children: _jsx(C4ExternalLink, { id: 'cluster-load-documentation', label: props.texts.docs, href: props.docs.url, onClick: () => {
23
24
  props.docs.onClick();
24
25
  }, target: '_blank', hideIcon: true }) })] }));
26
+ if (props.variant === 'plain' && designSystem === 'ds') {
27
+ // Embedded in ds mode: the heading on top and the content in a card, the
28
+ // same as the Cluster Details section.
29
+ return (_jsx("div", { style: { position: 'relative' }, className: 'cluster-load', children: _jsx(DsSection, { title: props.texts.title, card: true, action: props.loading ? undefined : (_jsx(C4LinkButton, { label: '', ariaLabel: props.texts.reload, onClick: () => props.reload(), icon: _jsx(Renew, {}) })), children: body }) }));
30
+ }
25
31
  if (props.variant === 'plain') {
26
32
  return (_jsxs("div", { style: { position: 'relative' }, className: 'cluster-load', children: [_jsxs(Stack, { orientation: 'horizontal', style: { marginBottom: '16px' }, children: [_jsx("h6", { style: { margin: 0, fontSize: '16px' }, children: props.texts.title }), !props.loading && (_jsx(C4LinkButton, { label: '', ariaLabel: props.texts.reload, onClick: () => props.reload(), style: { justifySelf: 'end', alignSelf: 'start' }, icon: _jsx(Renew, {}) }))] }), body] }));
27
33
  }
@@ -302,12 +308,6 @@ const HistoricChart = (props) => {
302
308
  const LatestChart = (props) => {
303
309
  return _jsx(MeterVisualization, { ...props });
304
310
  };
305
- const DS_CLUSTER_LOAD_ZONE_COLOR = {
306
- green: DS_STATUS_COLORS.success,
307
- warning: DS_STATUS_COLORS.warning,
308
- red: DS_STATUS_COLORS.danger,
309
- unknown: DS_STATUS_COLORS.warning,
310
- };
311
311
  export const MeterVisualization = (props) => {
312
312
  const designSystem = useC4DesignSystem();
313
313
  const suspended = props.suspended;
@@ -323,6 +323,7 @@ export const MeterVisualization = (props) => {
323
323
  color: currentValue > max ? CHART_COLORS.RED : CHART_COLORS.BLUE,
324
324
  };
325
325
  const currentClusterLoadConfig = getClusterLoadConfig(currentValue);
326
+ const DsLoadIcon = getDsClusterLoadPresentation(currentValue);
326
327
  if (suspended) {
327
328
  data.current = `${currentPrefix} n/a`;
328
329
  }
@@ -357,6 +358,10 @@ export const MeterVisualization = (props) => {
357
358
  },
358
359
  theme,
359
360
  };
361
+ if (designSystem === 'ds') {
362
+ // The DS `Progress` bar. The icon next to the value carries the load range.
363
+ return (_jsx(Tooltip, { align: 'bottom', label: props.texts.clusterLoadTooltip, children: _jsxs("div", { className: 'flex flex-col gap-2', children: [_jsxs("div", { className: 'flex items-center justify-between gap-2', children: [_jsx("p", { className: 'm-0', children: data.current }), !suspended && (_jsx(DsLoadIcon.icon, { className: 'size-4 shrink-0', style: { color: DsLoadIcon.color }, "aria-hidden": true }))] }), _jsx(DsProgress, { value: currentValue, max: max, "aria-label": props.texts.title, getValueLabel: () => data.current })] }) }));
364
+ }
360
365
  const component = (_jsx(Stack, { gap: 1, children: _jsx(Tooltip, { align: 'bottom', label: props.texts.clusterLoadTooltip, children: _jsxs("div", { style: { height: '32px' }, children: [_jsxs("div", { style: {
361
366
  display: 'grid',
362
367
  gridTemplateColumns: '1fr auto',
@@ -364,13 +369,12 @@ export const MeterVisualization = (props) => {
364
369
  }, children: [_jsx("p", { children: data.current }), !suspended && (_jsx("p", { style: {
365
370
  color: currentClusterLoadConfig.color,
366
371
  alignSelf: 'end',
367
- }, children: currentClusterLoadConfig.icon }))] }), designSystem === 'ds' ? (_jsx(DsMeterChart, { value: currentValue, max: max, color: DS_CLUSTER_LOAD_ZONE_COLOR[currentClusterLoadConfig.type] ??
368
- DS_STATUS_COLORS.info })) : (_jsx(MeterChart, { data: [
372
+ }, children: currentClusterLoadConfig.icon }))] }), _jsx(MeterChart, { data: [
369
373
  {
370
374
  group,
371
375
  value: currentValue,
372
376
  },
373
- ], options: chartOptions }, theme))] }) }) }));
377
+ ], options: chartOptions }, theme)] }) }) }));
374
378
  return component;
375
379
  };
376
380
  function formatNumber(number) {
@@ -0,0 +1,23 @@
1
+ import type { JSX, ReactNode } from 'react';
2
+ /**
3
+ * The heading of a section on the cluster details page, in ds mode. It is the
4
+ * section heading of the cluster and environment detail pages in Hub: an
5
+ * 18px semibold `h2`. The DS `Heading` scale has no 18px step, thus Hub uses a
6
+ * plain `h2` too.
7
+ */
8
+ export declare function DsSectionHeading(props: {
9
+ children: ReactNode;
10
+ /** An optional control next to the heading, for example a reload button. */
11
+ action?: ReactNode;
12
+ }): JSX.Element;
13
+ /**
14
+ * A section of the cluster details page in ds mode: the heading on top and the
15
+ * content under it, 12px apart, as in Hub. With `card`, the content sits in a
16
+ * DS `Card`.
17
+ */
18
+ export declare function DsSection(props: {
19
+ title: ReactNode;
20
+ action?: ReactNode;
21
+ card?: boolean;
22
+ children: ReactNode;
23
+ }): JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DsCard } from '../../ui/index.js';
3
+ /**
4
+ * The heading of a section on the cluster details page, in ds mode. It is the
5
+ * section heading of the cluster and environment detail pages in Hub: an
6
+ * 18px semibold `h2`. The DS `Heading` scale has no 18px step, thus Hub uses a
7
+ * plain `h2` too.
8
+ */
9
+ export function DsSectionHeading(props) {
10
+ return (_jsxs("div", { className: 'flex items-center gap-2', children: [_jsx("h2", { className: 'm-0 text-lg font-semibold', children: props.children }), props.action] }));
11
+ }
12
+ /**
13
+ * A section of the cluster details page in ds mode: the heading on top and the
14
+ * content under it, 12px apart, as in Hub. With `card`, the content sits in a
15
+ * DS `Card`.
16
+ */
17
+ export function DsSection(props) {
18
+ return (_jsxs("section", { className: 'flex flex-col gap-3', children: [_jsx(DsSectionHeading, { action: props.action, children: props.title }), props.card ? (_jsx(DsCard, { className: 'gap-4 p-5', children: props.children })) : (props.children)] }));
19
+ }
@@ -0,0 +1,33 @@
1
+ import { type LucideProps } from 'lucide-react';
2
+ import type { ComponentType, CSSProperties, JSX, ReactNode } from 'react';
3
+ /**
4
+ * Icon colors for status indicators in ds mode. They are the
5
+ * `*-foreground-subtle` tokens that the DS `StatusIcon` uses. We do not use
6
+ * `StatusIcon` itself: it has four fixed glyphs, and a cluster status also
7
+ * needs a spinner, a pause and other icons. Do not use `DS_STATUS_COLORS` of
8
+ * the charts here: its `danger` (`--danger-action-default`) is a light tint in
9
+ * the light theme, and an icon in that color is almost invisible.
10
+ */
11
+ export declare const DS_STATUS_ICON_COLORS: {
12
+ readonly success: "var(--success-foreground-subtle)";
13
+ readonly danger: "var(--danger-foreground-subtle)";
14
+ readonly info: "var(--info-foreground-subtle)";
15
+ readonly warning: "var(--warning-foreground-subtle)";
16
+ readonly neutral: "var(--neutral-foreground-subtle)";
17
+ };
18
+ /** A lucide icon and its color, for a status indicator in ds mode. */
19
+ export interface DsStatusIcon {
20
+ icon: ComponentType<LucideProps>;
21
+ color: string;
22
+ }
23
+ /** Spins wherever it renders, so no caller has to special-case it. */
24
+ export declare function SpinningLoader({ className, ...props }: LucideProps): JSX.Element;
25
+ /**
26
+ * The icon + text layout of the environment status in Hub, for ds mode only.
27
+ * Only the icon has the status color. The text stays neutral.
28
+ */
29
+ export declare function DsStatusIconText(props: {
30
+ status: DsStatusIcon;
31
+ children: ReactNode;
32
+ style?: CSSProperties;
33
+ }): JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /*
3
+ * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
+ * under one or more contributor license agreements. Licensed under a commercial license.
5
+ * You may not use this file except in compliance with the commercial license.
6
+ */
7
+ import { LoaderCircle } from 'lucide-react';
8
+ /**
9
+ * Icon colors for status indicators in ds mode. They are the
10
+ * `*-foreground-subtle` tokens that the DS `StatusIcon` uses. We do not use
11
+ * `StatusIcon` itself: it has four fixed glyphs, and a cluster status also
12
+ * needs a spinner, a pause and other icons. Do not use `DS_STATUS_COLORS` of
13
+ * the charts here: its `danger` (`--danger-action-default`) is a light tint in
14
+ * the light theme, and an icon in that color is almost invisible.
15
+ */
16
+ export const DS_STATUS_ICON_COLORS = {
17
+ success: 'var(--success-foreground-subtle)',
18
+ danger: 'var(--danger-foreground-subtle)',
19
+ info: 'var(--info-foreground-subtle)',
20
+ warning: 'var(--warning-foreground-subtle)',
21
+ neutral: 'var(--neutral-foreground-subtle)',
22
+ };
23
+ /** Spins wherever it renders, so no caller has to special-case it. */
24
+ export function SpinningLoader({ className, ...props }) {
25
+ return (_jsx(LoaderCircle, { className: `animate-spin motion-reduce:animate-none ${className ?? ''}`, ...props }));
26
+ }
27
+ /**
28
+ * The icon + text layout of the environment status in Hub, for ds mode only.
29
+ * Only the icon has the status color. The text stays neutral.
30
+ */
31
+ export function DsStatusIconText(props) {
32
+ const { icon: Icon, color } = props.status;
33
+ return (_jsx("div", { style: props.style, children: _jsxs("span", { className: 'inline-flex items-center gap-1', children: [_jsx(Icon, { className: 'size-4 shrink-0', style: { color }, "aria-hidden": true }), _jsx("span", { className: 'inline-flex items-center gap-1 text-neutral-foreground-strong', children: props.children })] }) }));
34
+ }