@camunda/ccma-saas-frontend 0.16.0 → 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 (99) 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-overview/applications.d.ts +16 -0
  12. package/lib/esm/components/c4-cluster-overview/applications.js +39 -1
  13. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.d.ts +5 -2
  14. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +8 -5
  15. package/lib/esm/components/c4-cluster-overview/cluster-details.js +10 -2
  16. package/lib/esm/components/c4-cluster-overview/cluster-load.d.ts +4 -3
  17. package/lib/esm/components/c4-cluster-overview/cluster-load.js +16 -13
  18. package/lib/esm/components/c4-cluster-overview/ds-section.d.ts +23 -0
  19. package/lib/esm/components/c4-cluster-overview/ds-section.js +19 -0
  20. package/lib/esm/components/c4-cluster-overview/ds-status-icon-text.js +1 -1
  21. package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +7 -1
  22. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.d.ts +6 -1
  23. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +5 -2
  24. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +1 -3
  25. package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +40 -15
  26. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +24 -4
  27. package/lib/esm/components/c4-create-cluster/c4-create-cluster.types.d.ts +12 -0
  28. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +2 -1
  29. package/lib/esm/components/c4-create-cluster-api-client-modal/scopes-description-text.d.ts +11 -0
  30. package/lib/esm/components/c4-create-cluster-api-client-modal/scopes-description-text.js +16 -0
  31. package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +4 -1
  32. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +6 -2
  33. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.types.d.ts +6 -0
  34. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +1 -1
  35. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +1 -0
  36. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-piechart.js +1 -1
  37. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +13 -6
  38. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +24 -5
  39. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.types.d.ts +4 -4
  40. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +1 -1
  41. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.d.ts +1 -1
  42. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js +3 -1
  43. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.d.ts +7 -1
  44. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +8 -4
  45. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +6 -1
  46. package/lib/esm/components/c4-management-settings/c4-management-settings.js +58 -42
  47. package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -0
  48. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +11 -10
  49. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.types.d.ts +4 -0
  50. package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +9 -1
  51. package/lib/esm/components/c4-tabs/c4-tabs.js +6 -1
  52. package/lib/esm/externalUrls.const.d.ts +1 -1
  53. package/lib/esm/externalUrls.const.js +1 -2
  54. package/lib/esm/i18n/en/modals/billing.json +2 -2
  55. package/lib/esm/i18n/en/modals/clusterclients.json +6 -6
  56. package/lib/esm/i18n/en/modals/invitations.json +1 -0
  57. package/lib/esm/i18n/en/modals/users.json +1 -0
  58. package/lib/esm/i18n/en/pages/clusterdetails.json +4 -1
  59. package/lib/esm/i18n/en/pages/createcluster.json +5 -0
  60. package/lib/esm/i18n/en/pages/dashboard.json +7 -5
  61. package/lib/esm/i18n/en/pages/orgmanagement.json +4 -0
  62. package/lib/esm/ui/ds-compact-code-block.d.ts +15 -0
  63. package/lib/esm/ui/ds-compact-code-block.js +33 -0
  64. package/lib/esm/ui/index.d.ts +13 -3
  65. package/lib/esm/ui/index.js +6 -0
  66. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +21 -3
  67. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +4 -2
  68. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.d.ts +1 -1
  69. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +29 -9
  70. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.types.d.ts +5 -0
  71. package/lib/esm/widgets/cluster-details/cluster-region-code.d.ts +8 -0
  72. package/lib/esm/widgets/cluster-details/cluster-region-code.js +17 -0
  73. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +44 -6
  74. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +6 -4
  75. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.d.ts +7 -0
  76. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +20 -8
  77. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +11 -10
  78. package/lib/esm/widgets/cluster-details/upgrade-gate.d.ts +23 -0
  79. package/lib/esm/widgets/cluster-details/upgrade-gate.js +36 -0
  80. package/lib/esm/widgets/cluster-details/use-upgrade-gate.d.ts +24 -0
  81. package/lib/esm/widgets/cluster-details/use-upgrade-gate.js +73 -0
  82. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.d.ts +3 -0
  83. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +38 -1
  84. package/lib/esm/widgets/dashboard/c4-dashboard-app.js +7 -5
  85. package/lib/esm/widgets/group-details/c4-group-details-page.d.ts +1 -1
  86. package/lib/esm/widgets/group-details/c4-group-details-page.js +10 -3
  87. package/lib/esm/widgets/group-details/c4-group-details-page.types.d.ts +5 -0
  88. package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
  89. package/lib/esm/widgets/management/c4-management-app.js +16 -4
  90. package/lib/esm/widgets/management/c4-management-app.types.d.ts +6 -0
  91. package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +1 -1
  92. package/lib/esm/widgets/management/tabs/c4-management-users-tab.d.ts +3 -1
  93. package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +2 -2
  94. package/lib/esm/widgets/user-details/c4-user-details-page.d.ts +1 -1
  95. package/lib/esm/widgets/user-details/c4-user-details-page.js +5 -2
  96. package/lib/esm/widgets/user-details/c4-user-details-page.types.d.ts +5 -0
  97. package/package.json +9 -9
  98. package/lib/esm/widgets/management/tabs/c4-management-groups-tab.d.ts +0 -13
  99. package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +0 -26
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  /*
3
3
  * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
4
4
  * under one or more contributor license agreements. Licensed under a commercial license.
@@ -8,8 +8,11 @@ import { InlineLoading } from '@carbon/react';
8
8
  import { Checkmark, Launch } from '@carbon/react/icons/index.esm.js';
9
9
  import { useCallback, useEffect, useRef, useState } from 'react';
10
10
  import { C4_ASSET_URLS } from '../../assetUrls.js';
11
+ import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
11
12
  import { Button, Checkbox, Link, Modal, Stack } from '../../ui/index.js';
13
+ import { SettingsTile } from '../c4-cluster-settings/elements/settings-tile.js';
12
14
  import { C4EmptyState } from '../c4-empty-state/c4-empty-state.js';
15
+ const AUDIT_LOG_DESCRIPTION = 'The audit log records user and client operations across administration, deployed resources, and user tasks. It helps your team trace events, when they occurred, what was affected, and whether they were successful.';
13
16
  const ALL_CATEGORIES = [
14
17
  'ADMIN',
15
18
  'DEPLOYED_RESOURCES',
@@ -28,6 +31,7 @@ function arraysEqual(a, b) {
28
31
  return sortedA.every((item, index) => item === sortedB[index]);
29
32
  }
30
33
  export const C4AuditLog = ({ enabled, userCategories, clientCategories, onUpdate, onEnable, onDisable, learnMoreUrl, permissions, }) => {
34
+ const isDs = useC4DesignSystem() === 'ds';
31
35
  const [localUserCategories, setLocalUserCategories] = useState(userCategories);
32
36
  const [localClientCategories, setLocalClientCategories] = useState(clientCategories);
33
37
  const [isDirty, setIsDirty] = useState(false);
@@ -98,52 +102,59 @@ export const C4AuditLog = ({ enabled, userCategories, clientCategories, onUpdate
98
102
  label: 'Learn more about audit log',
99
103
  } }));
100
104
  }
101
- return (_jsxs(Stack, { gap: 6, children: [_jsx("div", { style: {
105
+ const settingsBody = (_jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx("p", { style: {
106
+ fontWeight: 'bold',
107
+ marginBottom: '0.5rem',
108
+ color: 'var(--cds-text-primary)',
109
+ }, children: "User operations to log" }), _jsx("p", { style: {
110
+ fontSize: 'var(--cds-body-compact-01-font-size)',
111
+ color: 'var(--cds-text-secondary)',
112
+ marginBottom: '0.5rem',
113
+ }, children: "Operation categories" }), _jsx("div", { style: {
114
+ display: 'flex',
115
+ gap: isDs ? '1.5rem' : 'var(--cds-spacing-06)',
116
+ flexWrap: 'wrap',
117
+ }, children: ALL_CATEGORIES.map((category) => (_jsx("div", { children: _jsx(Checkbox, { id: `user-category-${category}`, labelText: CATEGORY_LABELS[category], checked: localUserCategories.includes(category), disabled: !permissions.mayChange || isSaving, onChange: (_, { checked }) => handleUserCategoryChange(category, checked) }) }, `user-${category}`))) })] }), _jsxs("div", { children: [_jsx("p", { style: {
118
+ fontWeight: 'bold',
119
+ marginBottom: '0.5rem',
120
+ color: 'var(--cds-text-primary)',
121
+ }, children: "Client operations to log" }), _jsx("p", { style: {
122
+ fontSize: 'var(--cds-body-compact-01-font-size)',
123
+ color: 'var(--cds-text-secondary)',
124
+ marginBottom: '0.5rem',
125
+ }, children: "Operation categories" }), _jsx("div", { style: {
126
+ display: 'flex',
127
+ gap: isDs ? '1.5rem' : 'var(--cds-spacing-06)',
128
+ flexWrap: 'wrap',
129
+ }, children: ALL_CATEGORIES.map((category) => (_jsx("div", { children: _jsx(Checkbox, { id: `client-category-${category}`, labelText: CATEGORY_LABELS[category], checked: localClientCategories.includes(category), disabled: !permissions.mayChange || isSaving, onChange: (_, { checked }) => handleClientCategoryChange(category, checked) }) }, `client-${category}`))) })] }), permissions.mayChange && (_jsxs("div", { style: {
130
+ display: 'flex',
131
+ flexDirection: 'column',
132
+ gap: 'var(--cds-spacing-05)',
133
+ }, children: [_jsx("div", { style: {
134
+ display: 'flex',
135
+ alignItems: 'center',
136
+ gap: '1rem',
137
+ flexWrap: 'wrap',
138
+ }, children: saveConfirmed ? (_jsxs("div", { style: {
139
+ display: 'flex',
140
+ alignItems: 'center',
141
+ gap: 'var(--cds-spacing-03)',
142
+ paddingLeft: 'var(--cds-spacing-05)',
143
+ height: '2.5rem',
144
+ fontSize: 'var(--cds-body-compact-01-font-size)',
145
+ }, children: [_jsx(Checkmark, { size: 16, style: { color: 'var(--cds-support-success)' } }), _jsx("span", { style: { color: 'var(--cds-text-secondary)' }, children: "Updated" })] })) : isSaving ? (_jsx(InlineLoading, { description: 'Saving...' })) : (_jsx(Button, { kind: 'tertiary', size: 'md', disabled: !isDirty, onClick: handleUpdate, children: "Update" })) }), _jsx("div", { children: _jsx(Button, { kind: 'ghost', size: 'md', style: { color: 'var(--cds-support-error)' }, onClick: () => setShowDisableModal(true), children: "Disable audit log" }) })] }))] }));
146
+ // ds mode: the same card, heading and separator line as the "Cluster
147
+ // settings" block of the Settings tab.
148
+ const settingsPanel = isDs ? (_jsx(SettingsTile, { headingLevel: 'h2', title: 'Audit log of operations', description: AUDIT_LOG_DESCRIPTION, children: _jsx(Stack, { gap: 6, children: settingsBody }) })) : null;
149
+ return (_jsxs(Stack, { gap: 6, children: [settingsPanel ?? (_jsx("div", { style: {
102
150
  backgroundColor: 'var(--cds-layer-01)',
103
151
  padding: '2rem',
104
152
  }, children: _jsxs(Stack, { gap: 6, children: [_jsxs("div", { children: [_jsx("h2", { style: {
105
153
  fontSize: 'var(--cds-heading-04-font-size)',
106
154
  fontWeight: 'var(--cds-heading-04-font-weight)',
107
155
  marginBottom: '0.75rem',
108
- }, children: "Audit log of operations" }), _jsx("p", { style: { color: 'var(--cds-text-secondary)', maxWidth: '40rem' }, children: "The audit log records user and client operations across administration, deployed resources, and user tasks. It helps your team trace events, when they occurred, what was affected, and whether they were successful." })] }), _jsxs("div", { children: [_jsx("p", { style: {
109
- fontWeight: 'bold',
110
- marginBottom: '0.5rem',
111
- color: 'var(--cds-text-primary)',
112
- }, children: "User operations to log" }), _jsx("p", { style: {
113
- fontSize: 'var(--cds-body-compact-01-font-size)',
114
- color: 'var(--cds-text-secondary)',
115
- marginBottom: '0.5rem',
116
- }, children: "Operation categories" }), _jsx("div", { style: {
117
- display: 'flex',
118
- gap: 'var(--cds-spacing-06)',
119
- flexWrap: 'wrap',
120
- }, children: ALL_CATEGORIES.map((category) => (_jsx("div", { children: _jsx(Checkbox, { id: `user-category-${category}`, labelText: CATEGORY_LABELS[category], checked: localUserCategories.includes(category), disabled: !permissions.mayChange || isSaving, onChange: (_, { checked }) => handleUserCategoryChange(category, checked) }) }, `user-${category}`))) })] }), _jsxs("div", { children: [_jsx("p", { style: {
121
- fontWeight: 'bold',
122
- marginBottom: '0.5rem',
123
- color: 'var(--cds-text-primary)',
124
- }, children: "Client operations to log" }), _jsx("p", { style: {
125
- fontSize: 'var(--cds-body-compact-01-font-size)',
156
+ }, children: "Audit log of operations" }), _jsx("p", { style: {
126
157
  color: 'var(--cds-text-secondary)',
127
- marginBottom: '0.5rem',
128
- }, children: "Operation categories" }), _jsx("div", { style: {
129
- display: 'flex',
130
- gap: 'var(--cds-spacing-06)',
131
- flexWrap: 'wrap',
132
- }, children: ALL_CATEGORIES.map((category) => (_jsx("div", { children: _jsx(Checkbox, { id: `client-category-${category}`, labelText: CATEGORY_LABELS[category], checked: localClientCategories.includes(category), disabled: !permissions.mayChange || isSaving, onChange: (_, { checked }) => handleClientCategoryChange(category, checked) }) }, `client-${category}`))) })] }), permissions.mayChange && (_jsxs("div", { style: {
133
- display: 'flex',
134
- flexDirection: 'column',
135
- gap: 'var(--cds-spacing-05)',
136
- }, children: [_jsx("div", { style: {
137
- display: 'flex',
138
- alignItems: 'center',
139
- gap: '1rem',
140
- flexWrap: 'wrap',
141
- }, children: saveConfirmed ? (_jsxs("div", { style: {
142
- display: 'flex',
143
- alignItems: 'center',
144
- gap: 'var(--cds-spacing-03)',
145
- paddingLeft: 'var(--cds-spacing-05)',
146
- height: '2.5rem',
147
- fontSize: 'var(--cds-body-compact-01-font-size)',
148
- }, children: [_jsx(Checkmark, { size: 16, style: { color: 'var(--cds-support-success)' } }), _jsx("span", { style: { color: 'var(--cds-text-secondary)' }, children: "Updated" })] })) : isSaving ? (_jsx(InlineLoading, { description: 'Saving...' })) : (_jsx(Button, { kind: 'tertiary', size: 'md', disabled: !isDirty, onClick: handleUpdate, children: "Update" })) }), _jsx("div", { children: _jsx(Button, { kind: 'ghost', size: 'md', style: { color: 'var(--cds-support-error)' }, onClick: () => setShowDisableModal(true), children: "Disable audit log" }) })] }))] }) }), _jsx(Link, { href: learnMoreUrl, target: '_blank', rel: 'noopener noreferrer', renderIcon: Launch, children: "Learn more about audit log" }), _jsx(Modal, { open: showDisableModal, modalHeading: 'Disable the audit log', primaryButtonText: 'Disable', secondaryButtonText: 'Cancel', danger: true, onRequestClose: () => setShowDisableModal(false), onRequestSubmit: handleDisableConfirm, onSecondarySubmit: () => setShowDisableModal(false), children: _jsxs("p", { children: ["Are you sure you want to disable the audit log for the cluster?", _jsx("br", {}), "User and client operations will no longer be logged."] }) })] }));
158
+ maxWidth: '40rem',
159
+ }, children: AUDIT_LOG_DESCRIPTION })] }), settingsBody] }) })), _jsx(Link, { href: learnMoreUrl, target: '_blank', rel: 'noopener noreferrer', renderIcon: Launch, children: "Learn more about audit log" }), _jsx(Modal, { open: showDisableModal, modalHeading: 'Disable the audit log', primaryButtonText: 'Disable', secondaryButtonText: 'Cancel', danger: true, onRequestClose: () => setShowDisableModal(false), onRequestSubmit: handleDisableConfirm, onSecondarySubmit: () => setShowDisableModal(false), children: _jsxs("p", { children: ["Are you sure you want to disable the audit log for the cluster?", _jsx("br", {}), "User and client operations will no longer be logged."] }) })] }));
149
160
  };
@@ -6,6 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  */
7
7
  import { Column, Grid } from '@carbon/react';
8
8
  import styled from 'styled-components';
9
+ import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
9
10
  import { Stack } from '../../ui/index.js';
10
11
  import { C4PageLayout } from '../c4-page-layout/c4-page-layout.js';
11
12
  import { ClusterReservations } from './elements/cluster-reservations.js';
@@ -32,7 +33,10 @@ const Wrapper = styled.div `
32
33
  }
33
34
  `;
34
35
  export const C4BillingPage = ({ title, subheading, planDetails, usageAlerts, clusterReservations, currentUsageMetrics, isEnterpriseOrg = false, }) => {
35
- const component = (_jsx(C4PageLayout, { children: _jsx(Wrapper, { children: _jsxs(Stack, { gap: 6, children: [_jsx(Grid, { style: { ...STYLES.grid }, children: _jsx(Column, { span: 16, style: { ...STYLES.grid }, children: _jsxs(Stack, { gap: 6, children: [title && _jsx("h1", { children: title }), subheading && (_jsx("span", { style: { color: 'var(--cds-text-secondary)' }, children: subheading }))] }) }) }), _jsxs(Stack, { gap: 5, children: [_jsxs(TopRowWrapper, { style: { ...STYLES.grid }, children: [_jsx("div", { children: _jsx(PlanDetails, { ...planDetails }) }), _jsx("div", { children: usageAlerts && _jsx(UsageAlerts, { ...usageAlerts }) })] }), _jsx(Grid, { style: { ...STYLES.grid }, children: _jsx(Column, { span: 16, style: { ...STYLES.grid }, children: _jsx(CurrentUsageMetrics, { ...currentUsageMetrics, isEnterpriseOrg: isEnterpriseOrg }) }) }), _jsx(Grid, { style: { ...STYLES.grid }, children: _jsx(Column, { span: 16, style: { ...STYLES.grid }, children: _jsx("div", { style: {
36
+ // ds mode: the page sits in a tab under the `h1` page title of the page
37
+ // template, so its own title is an `h2`. Carbon keeps its `h1`.
38
+ const TitleHeading = useC4DesignSystem() === 'ds' ? 'h2' : 'h1';
39
+ const component = (_jsx(C4PageLayout, { children: _jsx(Wrapper, { children: _jsxs(Stack, { gap: 6, children: [_jsx(Grid, { style: { ...STYLES.grid }, children: _jsx(Column, { span: 16, style: { ...STYLES.grid }, children: _jsxs(Stack, { gap: 6, children: [title && _jsx(TitleHeading, { children: title }), subheading && (_jsx("span", { style: { color: 'var(--cds-text-secondary)' }, children: subheading }))] }) }) }), _jsxs(Stack, { gap: 5, children: [_jsxs(TopRowWrapper, { style: { ...STYLES.grid }, children: [_jsx("div", { children: _jsx(PlanDetails, { ...planDetails }) }), _jsx("div", { children: usageAlerts && _jsx(UsageAlerts, { ...usageAlerts }) })] }), _jsx(Grid, { style: { ...STYLES.grid }, children: _jsx(Column, { span: 16, style: { ...STYLES.grid }, children: _jsx(CurrentUsageMetrics, { ...currentUsageMetrics, isEnterpriseOrg: isEnterpriseOrg }) }) }), _jsx(Grid, { style: { ...STYLES.grid }, children: _jsx(Column, { span: 16, style: { ...STYLES.grid }, children: _jsx("div", { style: {
36
40
  display: 'flex',
37
41
  flexDirection: 'column',
38
42
  overflowX: 'auto',
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { BreadcrumbSkeleton, CodeSnippet, Link, OverflowMenu, OverflowMenuItem, Stack, Tag, } from '../../ui/index.js';
2
+ import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
3
+ import { BreadcrumbSkeleton, CodeSnippet, DsHeading, Link, OverflowMenu, OverflowMenuItem, Stack, Tag, } from '../../ui/index.js';
3
4
  import { useBreadcrumbFamily } from '../../ui/families.js';
4
5
  const breadCrumbWrapperStyles = {
5
6
  minHeight: '40px',
@@ -16,6 +17,8 @@ const headerRowStyles = {
16
17
  };
17
18
  export const C4Breadcrumb = ({ loading, noTrailingSlash, elements, title, menu, tag, indicator, subtitleBadges, codeSnippet, }) => {
18
19
  const { Breadcrumb, BreadcrumbItem } = useBreadcrumbFamily();
20
+ const designSystem = useC4DesignSystem();
21
+ const isDs = designSystem === 'ds';
19
22
  let breadcrumb = null;
20
23
  if (loading) {
21
24
  // Same "no elements, no breadcrumb" rule as the loaded branch that
@@ -32,9 +35,11 @@ export const C4Breadcrumb = ({ loading, noTrailingSlash, elements, title, menu,
32
35
  element.onClick();
33
36
  }
34
37
  }, style: { cursor: 'pointer' }, children: element.label }) }, element.key));
35
- }) })), (menu || title || tag || indicator || codeSnippet) && (_jsxs("div", { style: headerRowStyles, children: [_jsxs(Stack, { orientation: 'horizontal', gap: 4, children: [title && _jsx("h2", { style: { marginTop: '2px' }, children: title }), tag && _jsx(Tag, { type: 'blue', children: tag }), codeSnippet?.text && (_jsx(CodeSnippet, { feedback: codeSnippet?.copyFeedback, type: 'inline', children: codeSnippet.text }))] }), menu && (_jsx(OverflowMenu, { "aria-label": 'cluster operations', children: menu.map((item) => {
38
+ }) })), (menu || title || tag || indicator || codeSnippet) && (_jsxs("div", { style: headerRowStyles, children: [_jsxs(Stack, { orientation: 'horizontal', gap: 4, ...(isDs ? { className: 'items-center' } : {}), children: [title &&
39
+ (isDs ? (_jsx(DsHeading, { as: 'h1', variant: 'heading-lg', className: 'm-0', children: title })) : (_jsx("h2", { style: { marginTop: '2px' }, children: title }))), tag && _jsx(Tag, { type: 'blue', children: tag }), codeSnippet?.text && (_jsx(CodeSnippet, { feedback: codeSnippet?.copyFeedback, type: 'inline', children: codeSnippet.text }))] }), menu && (_jsx(OverflowMenu, { "aria-label": 'cluster operations', children: menu.map((item) => {
36
40
  return (_jsx(OverflowMenuItem, { id: item.key, onClick: () => item.onClick(), itemText: item.label, isDelete: item.isDelete }, item.key));
37
- }) })), indicator && _jsx("div", { style: { marginLeft: 'auto' }, children: indicator })] })), subtitleBadges && (_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '0.5rem' }, children: subtitleBadges }))] }));
41
+ }) })), indicator && _jsx("div", { style: { marginLeft: 'auto' }, children: indicator })] })), subtitleBadges &&
42
+ (isDs ? (_jsx("div", { className: 'flex flex-wrap items-center gap-1.5', children: subtitleBadges })) : (_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '0.5rem' }, children: subtitleBadges })))] }));
38
43
  }
39
44
  return _jsx("div", { style: breadCrumbWrapperStyles, children: breadcrumb });
40
45
  };
@@ -1,3 +1,13 @@
1
1
  import type { JSX } from 'react';
2
2
  import type { C4ClusterByomClientsProps } from './c4-cluster-byom-clients.types.js';
3
+ /**
4
+ * True when `C4ClusterByomClients` renders an empty-state card of its own
5
+ * (an error, or no clients after loading) instead of its table. A host that
6
+ * adds a card around the component uses this to avoid a second card.
7
+ */
8
+ export declare function byomClientsShowsOwnCard(props: {
9
+ hasError: boolean;
10
+ isLoading: boolean;
11
+ clients: readonly unknown[];
12
+ }): boolean;
3
13
  export declare const C4ClusterByomClients: ({ clients, isLoading, hasError, text, urls, permissions, onActivateEndpoint, onCreateClient, onRotatePassword, onDeleteClient, onRefresh, onOpenDocs, }: C4ClusterByomClientsProps) => JSX.Element;
@@ -5,6 +5,14 @@ import { CodeSnippet, Stack } from '../../ui/index.js';
5
5
  import { C4DataTable } from '../c4-data-table/c4-data-table.js';
6
6
  import { C4EmptyState } from '../c4-empty-state/c4-empty-state.js';
7
7
  import { C4LinkButton } from '../c4-link-button/c4-link-button.js';
8
+ /**
9
+ * True when `C4ClusterByomClients` renders an empty-state card of its own
10
+ * (an error, or no clients after loading) instead of its table. A host that
11
+ * adds a card around the component uses this to avoid a second card.
12
+ */
13
+ export function byomClientsShowsOwnCard(props) {
14
+ return props.hasError || (!props.isLoading && props.clients.length === 0);
15
+ }
8
16
  export const C4ClusterByomClients = ({ clients, isLoading, hasError, text, urls, permissions, onActivateEndpoint, onCreateClient, onRotatePassword, onDeleteClient, onRefresh, onOpenDocs, }) => {
9
17
  const tableData = clients.map((client, index) => ({
10
18
  ...client,
@@ -105,7 +113,7 @@ export const C4ClusterByomClients = ({ clients, isLoading, hasError, text, urls,
105
113
  icon: Renew,
106
114
  } }));
107
115
  }
108
- if (!isLoading && clients.length === 0) {
116
+ if (byomClientsShowsOwnCard({ hasError, isLoading, clients })) {
109
117
  return (_jsx(C4EmptyState, { card: true, icon: {
110
118
  path: C4_ASSET_URLS.monitoringIcon,
111
119
  altText: 'monitoringIcon',
@@ -5,12 +5,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
7
  import { InlineLoading, Layer } from '@carbon/react';
8
- import { Download, Save } from '@carbon/react/icons/index.esm.js';
8
+ import { Download as CarbonDownload, Save as CarbonSave, } from '@carbon/react/icons/index.esm.js';
9
+ import { Download as LucideDownload, Save as LucideSave } from 'lucide-react';
9
10
  import { useState } from 'react';
11
+ import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
10
12
  import { Button, CodeSnippet, Modal, Stack } from '../../ui/index.js';
11
13
  import { useTabsFamily } from '../../ui/tabs.js';
12
14
  import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
13
15
  import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListWrapper, } from '../c4-structured-list/c4-structured-list.js';
16
+ import { DsCredentialItems } from './ds-credential-items.js';
14
17
  export const C4ClusterClientCredentialsModal = (props) => {
15
18
  const { Tabs, Tab, TabList, TabPanel, TabPanels } = useTabsFamily();
16
19
  return (_jsx(Modal, { passiveModal: true, onRequestClose: props.onRequestClose, open: props.isOpen, modalHeading: props.heading, size: 'lg', children: _jsxs(Stack, { gap: 6, children: [_jsx("div", { children: props.description }), _jsx(C4InlineNotification, { lowContrast: true, kind: 'warning', title: props.notificationText, hideCloseButton: true }), _jsxs(Tabs, { children: [_jsx(TabList, { "aria-label": 'download', children: props.variants.map((variant) => (_jsx(Tab, { children: variant.tabTitle }, variant.key))) }), _jsx(TabPanels, { children: props.variants.map((variant) => {
@@ -18,8 +21,12 @@ export const C4ClusterClientCredentialsModal = (props) => {
18
21
  return (_jsxs(TabPanel, { children: [variant.type === 'codesnippet' && (_jsx(C4ClusterClientCredentialsVariantCodeSnippet, { ...variantProps })), variant.type === 'items' && (_jsx(C4ClusterClientCredentialsVariantItems, { ...variantProps }))] }, key));
19
22
  }) })] })] }) }));
20
23
  };
21
- const C4ClusterClientCredentialsVariantDownload = (props) => (_jsx(Button, { kind: 'tertiary', size: 'md', renderIcon: Download, onClick: props.onClick, children: props.label }));
24
+ const C4ClusterClientCredentialsVariantDownload = (props) => {
25
+ const isDs = useC4DesignSystem() === 'ds';
26
+ return (_jsx(Button, { kind: 'tertiary', size: 'md', renderIcon: isDs ? LucideDownload : CarbonDownload, onClick: props.onClick, children: props.label }));
27
+ };
22
28
  const C4ClusterClientCredentialsVariantAdditionalAction = (props) => {
29
+ const isDs = useC4DesignSystem() === 'ds';
23
30
  const [isLoading, setIsLoading] = useState(false);
24
31
  const handleClick = async () => {
25
32
  setIsLoading(true);
@@ -39,7 +46,7 @@ const C4ClusterClientCredentialsVariantAdditionalAction = (props) => {
39
46
  if (isLoading) {
40
47
  return _jsx(InlineLoading, { description: 'Saving...' });
41
48
  }
42
- return (_jsx(Button, { kind: 'tertiary', size: 'md', renderIcon: Save, onClick: handleClick, children: props.label }));
49
+ return (_jsx(Button, { kind: 'tertiary', size: 'md', renderIcon: isDs ? LucideSave : CarbonSave, onClick: handleClick, children: props.label }));
43
50
  };
44
51
  export const C4ClusterClientCredentialsVariantCodeSnippet = (props) => {
45
52
  const variant = props;
@@ -52,12 +59,13 @@ export const C4ClusterClientCredentialsVariantCodeSnippet = (props) => {
52
59
  };
53
60
  export const C4ClusterClientCredentialsVariantItems = (props) => {
54
61
  const variant = props;
55
- const content = (_jsxs(Stack, { gap: 5, children: [_jsx("div", { children: variant.description }), _jsx(C4StructuredListWrapper, { isCondensed: true, isFlush: true, style: { minWidth: '0' }, children: _jsx(C4StructuredListBody, { children: variant.items.map((item, index) => (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, style: { width: '200px' }, children: item.label }), _jsx(C4StructuredListCell, { children: _jsx(Layer, { children: _jsx(CodeSnippet, { type: 'single', wrapText: true, copyText: item.value, style: {
62
+ const isDs = useC4DesignSystem() === 'ds';
63
+ const content = (_jsxs(Stack, { gap: 5, children: [_jsx("div", { children: variant.description }), isDs ? (_jsx(DsCredentialItems, { items: variant.items })) : (_jsx(C4StructuredListWrapper, { isCondensed: true, isFlush: true, style: { minWidth: '0' }, children: _jsx(C4StructuredListBody, { children: variant.items.map((item, index) => (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, style: { width: '200px' }, children: item.label }), _jsx(C4StructuredListCell, { children: _jsx(Layer, { children: _jsx(CodeSnippet, { type: 'single', wrapText: true, copyText: item.value, style: {
56
64
  zIndex: `${(variant.items.length - index) * 100}`,
57
65
  }, onClick: () => {
58
66
  if (item.onClick) {
59
67
  item.onClick();
60
68
  }
61
- }, children: item.value }) }) })] }, item.key))) }) }), (variant.download || variant.additionalAction) && (_jsxs("div", { style: { display: 'flex', gap: '8px' }, children: [variant.download && (_jsx(C4ClusterClientCredentialsVariantDownload, { ...variant.download })), variant.additionalAction && (_jsx(C4ClusterClientCredentialsVariantAdditionalAction, { label: variant.additionalAction.label, onClick: variant.additionalAction.onClick }))] })), variant.content && (_jsx("div", { style: { borderTop: '1px solid black' }, children: variant.content }))] }));
69
+ }, children: item.value }) }) })] }, item.key))) }) })), (variant.download || variant.additionalAction) && (_jsxs("div", { style: { display: 'flex', gap: '8px' }, children: [variant.download && (_jsx(C4ClusterClientCredentialsVariantDownload, { ...variant.download })), variant.additionalAction && (_jsx(C4ClusterClientCredentialsVariantAdditionalAction, { label: variant.additionalAction.label, onClick: variant.additionalAction.onClick }))] })), variant.content && (_jsx("div", { style: { borderTop: '1px solid black' }, children: variant.content }))] }));
62
70
  return content;
63
71
  };
@@ -0,0 +1,14 @@
1
+ import type { JSX } from 'react';
2
+ /**
3
+ * ds-mode only. The credential values of a client credentials dialog: per row,
4
+ * a label and a compact copyable value. The Carbon structured list stretched
5
+ * each value to the full row height.
6
+ */
7
+ export declare function DsCredentialItems(props: {
8
+ items: Array<{
9
+ key: string;
10
+ label: string;
11
+ value: string;
12
+ onClick?: () => void;
13
+ }>;
14
+ }): JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DsCompactCodeBlock, DsText } from '../../ui/index.js';
3
+ /**
4
+ * ds-mode only. The credential values of a client credentials dialog: per row,
5
+ * a label and a compact copyable value. The Carbon structured list stretched
6
+ * each value to the full row height.
7
+ */
8
+ export function DsCredentialItems(props) {
9
+ return (_jsx("dl", { className: 'm-0 flex flex-col gap-3', children: props.items.map((item) => (_jsxs("div", { className: 'grid items-center gap-4', style: { gridTemplateColumns: '10rem minmax(0, 1fr)' }, children: [_jsx("dt", { className: 'm-0', children: _jsx(DsText, { variant: 'label-md', children: item.label }) }), _jsx("dd", { className: 'm-0 min-w-0', children: _jsx(DsCompactCodeBlock
10
+ // Report only a copy that worked, not a failed or empty one.
11
+ , {
12
+ // Report only a copy that worked, not a failed or empty one.
13
+ onCopy: (_text, success) => {
14
+ if (success) {
15
+ item.onClick?.();
16
+ }
17
+ }, children: item.value }) })] }, item.key))) }));
18
+ }
@@ -5,24 +5,34 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
7
  import { InlineLoading, Layer } from '@carbon/react';
8
- import { Download, Save } from '@carbon/react/icons/index.esm.js';
8
+ import { Download as CarbonDownload, Save as CarbonSave, } from '@carbon/react/icons/index.esm.js';
9
+ import { Download as LucideDownload, Save as LucideSave } from 'lucide-react';
9
10
  import { useState } from 'react';
10
- import { Button, CodeSnippet, Modal, Stack } from '../../ui/index.js';
11
+ import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
12
+ import { Button, CodeSnippet, DsCompactCodeBlock, DsText, Modal, Stack, } from '../../ui/index.js';
11
13
  import { useTabsFamily } from '../../ui/tabs.js';
14
+ import { DsCredentialItems } from '../c4-cluster-client-credentials/ds-credential-items.js';
12
15
  import { C4Divider } from '../c4-divider/c4-divider.js';
13
16
  import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
14
17
  import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListWrapper, } from '../c4-structured-list/c4-structured-list.js';
15
18
  export const C4ClusterClientCredentialsIdentityModal = (props) => {
16
19
  const { Tabs, Tab, TabList, TabPanel, TabPanels } = useTabsFamily();
20
+ const isDs = useC4DesignSystem() === 'ds';
17
21
  return (_jsx(Modal, { passiveModal: true, onRequestClose: props.onRequestClose, open: props.isOpen, modalHeading: props.heading, preventCloseOnClickOutside: true, selectorPrimaryFocus: '.cds--btn--tertiary', size: 'lg', children: _jsxs(Stack, { gap: 4, children: [_jsx("strong", { children: props.step1Header }), _jsxs(Tabs, { children: [_jsx(TabList, { "aria-label": 'download', contained: true, children: props.variants.map((variant) => (_jsx(Tab, { children: variant.tabTitle }, variant.key))) }), _jsx(TabPanels, { children: props.variants.map((variant) => {
18
22
  const { key, ...variantProps } = variant;
19
23
  return (_jsxs(TabPanel, { style: { marginTop: '-12px', padding: '1rem' }, children: [variant.type === 'codesnippet' && (_jsx(C4ClusterClientCredentialsIdentitysVariantCodeSnippet, { ...variantProps })), variant.type === 'items' && (_jsx(C4ClusterClientCredentialsIdentitysVariantItems, { ...variantProps }))] }, key));
20
- }) })] }), _jsx(C4Divider, {}), _jsx("strong", { children: props.step2Header }), _jsx("div", { children: props.step2Description }), _jsxs(Stack, { gap: 2, children: [_jsx("p", { style: { color: 'var(--cds-text-helper)', alignSelf: 'end' }, children: "Client ID" }), _jsx(CodeSnippet, { type: 'single', style: { maxWidth: '22rem' }, children: props.clientId })] }), _jsx(Button, { kind: 'primary', size: 'md', onClick: () => {
24
+ }) })] }), _jsx(C4Divider, {}), _jsx("strong", { children: props.step2Header }), _jsx("div", { children: props.step2Description }), _jsxs(Stack, { gap: 2, children: [isDs ? (_jsx(DsText, { as: 'p', variant: 'label-md', className: 'm-0', children: "Client ID" })) : (_jsx("p", { style: { color: 'var(--cds-text-helper)', alignSelf: 'end' }, children: "Client ID" })), isDs ? (
25
+ // Full width, like the credential values of step 1.
26
+ _jsx(DsCompactCodeBlock, { children: props.clientId })) : (_jsx(CodeSnippet, { type: 'single', style: { maxWidth: '22rem' }, children: props.clientId }))] }), _jsx(Button, { kind: 'primary', size: 'md', onClick: () => {
21
27
  window.open(props.identityLink, '_blank');
22
28
  }, children: props.identityButtonText })] }) }));
23
29
  };
24
- const C4ClusterClientCredentialsIdentitysVariantDownload = (props) => (_jsx(Button, { id: 'credentials-download-button', kind: 'tertiary', size: 'md', renderIcon: Download, onClick: props.onClick, children: props.label }));
30
+ const C4ClusterClientCredentialsIdentitysVariantDownload = (props) => {
31
+ const isDs = useC4DesignSystem() === 'ds';
32
+ return (_jsx(Button, { id: 'credentials-download-button', kind: 'tertiary', size: 'md', renderIcon: isDs ? LucideDownload : CarbonDownload, onClick: props.onClick, children: props.label }));
33
+ };
25
34
  const C4ClusterClientCredentialsIdentitysVariantAdditionalAction = (props) => {
35
+ const isDs = useC4DesignSystem() === 'ds';
26
36
  const [isLoading, setIsLoading] = useState(false);
27
37
  const handleClick = async () => {
28
38
  setIsLoading(true);
@@ -42,7 +52,7 @@ const C4ClusterClientCredentialsIdentitysVariantAdditionalAction = (props) => {
42
52
  if (isLoading) {
43
53
  return _jsx(InlineLoading, { description: 'Saving...' });
44
54
  }
45
- return (_jsx(Button, { kind: 'tertiary', size: 'md', renderIcon: Save, onClick: handleClick, children: props.label }));
55
+ return (_jsx(Button, { kind: 'tertiary', size: 'md', renderIcon: isDs ? LucideSave : CarbonSave, onClick: handleClick, children: props.label }));
46
56
  };
47
57
  export const C4ClusterClientCredentialsIdentitysVariantCodeSnippet = (props) => {
48
58
  const variant = props;
@@ -57,13 +67,14 @@ export const C4ClusterClientCredentialsIdentitysVariantCodeSnippet = (props) =>
57
67
  };
58
68
  export const C4ClusterClientCredentialsIdentitysVariantItems = (props) => {
59
69
  const variant = props;
60
- const content = (_jsxs(Stack, { gap: 5, children: [_jsx("div", { children: variant.description }), _jsx(C4InlineNotification, { lowContrast: true, kind: 'warning', title: props.notificationText, hideCloseButton: true, style: { maxInlineSize: '100%' } }), _jsx(C4StructuredListWrapper, { isCondensed: true, isFlush: true, style: { minWidth: '0' }, children: _jsx(C4StructuredListBody, { children: variant.items.map((item, index) => (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, style: { width: '200px' }, children: item.label }), _jsx(C4StructuredListCell, { style: { paddingRight: '0px' }, children: _jsx(Layer, { children: _jsx(CodeSnippet, { type: 'single', wrapText: true, copyText: item.value, style: {
70
+ const isDs = useC4DesignSystem() === 'ds';
71
+ const content = (_jsxs(Stack, { gap: 5, children: [_jsx("div", { children: variant.description }), _jsx(C4InlineNotification, { lowContrast: true, kind: 'warning', title: props.notificationText, hideCloseButton: true, style: { maxInlineSize: '100%' } }), isDs ? (_jsx(DsCredentialItems, { items: variant.items })) : (_jsx(C4StructuredListWrapper, { isCondensed: true, isFlush: true, style: { minWidth: '0' }, children: _jsx(C4StructuredListBody, { children: variant.items.map((item, index) => (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, style: { width: '200px' }, children: item.label }), _jsx(C4StructuredListCell, { style: { paddingRight: '0px' }, children: _jsx(Layer, { children: _jsx(CodeSnippet, { type: 'single', wrapText: true, copyText: item.value, style: {
61
72
  zIndex: `${(variant.items.length - index) * 100}`,
62
73
  maxInlineSize: '100%',
63
74
  }, onClick: () => {
64
75
  if (item.onClick) {
65
76
  item.onClick();
66
77
  }
67
- }, children: item.value }) }) })] }, item.key))) }) }), (variant.download || variant.additionalAction) && (_jsxs("div", { style: { display: 'flex', gap: '8px' }, children: [variant.download && (_jsx(C4ClusterClientCredentialsIdentitysVariantDownload, { ...variant.download })), variant.additionalAction && (_jsx(C4ClusterClientCredentialsIdentitysVariantAdditionalAction, { label: variant.additionalAction.label, onClick: variant.additionalAction.onClick }))] }))] }));
78
+ }, children: item.value }) }) })] }, item.key))) }) })), (variant.download || variant.additionalAction) && (_jsxs("div", { style: { display: 'flex', gap: '8px' }, children: [variant.download && (_jsx(C4ClusterClientCredentialsIdentitysVariantDownload, { ...variant.download })), variant.additionalAction && (_jsx(C4ClusterClientCredentialsIdentitysVariantAdditionalAction, { label: variant.additionalAction.label, onClick: variant.additionalAction.onClick }))] }))] }));
68
79
  return content;
69
80
  };
@@ -2,10 +2,10 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  export const defaultText = {
3
3
  title: 'Client credentials',
4
4
  subtitle: 'Open a set of credentials to see the base URLs, connection information, and more.',
5
- subtitleIdentityPrefix: "To set up permissions, copy the client ID over to the cluster's Identity and configure the required access and roles. Learn more about",
5
+ subtitleIdentityPrefix: "To set up permissions, copy the client ID over to the cluster's Admin and configure the required access and roles. Learn more about",
6
6
  subtitleIdentityLinkLabel: 'client credentials',
7
7
  subtitleIdentitySuffix: '.',
8
- identityButton: 'Configure authorizations in Identity',
8
+ identityButton: 'Configure authorizations',
9
9
  createButton: 'Create new client',
10
10
  createFirstClient: 'Create your first client',
11
11
  searchLabel: 'Search',
@@ -1,4 +1,5 @@
1
1
  import { type JSX } from 'react';
2
+ import { type DsStatusIcon } from './ds-status-icon-text.js';
2
3
  export declare enum StatusColor {
3
4
  HEALTHY = "var(--cds-support-success)",
4
5
  UNHEALTHY = "var(--cds-support-error)",
@@ -9,6 +10,20 @@ export declare enum StatusColor {
9
10
  }
10
11
  export type ClusterStatus = 'healthy' | 'unhealthy' | 'creating' | 'updating' | 'waitingForInput' | 'suspended' | 'resuming' | 'maintenance' | 'restoring';
11
12
  export declare const normalizeClusterStatus: (status: string | undefined | null) => ClusterStatus | undefined;
13
+ /**
14
+ * The DS badge variant of each status, as the cluster and environment headers
15
+ * in Hub use it.
16
+ */
17
+ declare const DS_CLUSTER_STATUS_BADGE_VARIANT: Record<ClusterStatus, 'success' | 'danger' | 'info' | 'warning' | 'neutral'>;
18
+ /**
19
+ * The icon, label and badge variant of a status for a DS `Badge` (ds mode
20
+ * only). It gives `undefined` for a value that `normalizeClusterStatus` does
21
+ * not know.
22
+ */
23
+ export declare function getDsClusterStatusBadge(status: string | undefined): (DsStatusIcon & {
24
+ label: string;
25
+ variant: (typeof DS_CLUSTER_STATUS_BADGE_VARIANT)[ClusterStatus];
26
+ }) | undefined;
12
27
  export interface ApplicationTileProps {
13
28
  name: string;
14
29
  status?: ClusterStatus;
@@ -69,3 +84,4 @@ export interface ApplicationsProps {
69
84
  variant?: 'tile' | 'plain';
70
85
  }
71
86
  export declare const Applications: (props: ApplicationsProps) => JSX.Element;
87
+ export {};
@@ -12,6 +12,7 @@ import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
12
12
  import { Link, Loading, Stack, Tile, Tooltip } from '../../ui/index.js';
13
13
  import { mediaSizeByWidth } from '../c4-billing-page/elements/current-usage-metrics.js';
14
14
  import { C4TileWithTitleAndAction } from '../c4-tile-with-title-and-action/c4-tile-with-title-and-action.js';
15
+ import { DsSection } from './ds-section.js';
15
16
  import { DS_STATUS_ICON_COLORS, DsStatusIconText, SpinningLoader, } from './ds-status-icon-text.js';
16
17
  const MAINTENANCE_STATUS_TEXT = 'Maintenance';
17
18
  const MAINTENANCE_INDICATOR_KIND = 'undefined';
@@ -103,6 +104,36 @@ const DS_CLUSTER_STATUS_PRESENTATION = {
103
104
  color: DS_STATUS_ICON_COLORS.neutral,
104
105
  },
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
+ }
106
137
  export const ClusterStatusElement = (props) => {
107
138
  const isMaintenanceStatus = props.status === 'maintenance';
108
139
  // Which states get the info affordance next to the status text. A healthy
@@ -218,6 +249,7 @@ export const ApplicationTile = (props) => {
218
249
  const borderColor = 'var(--cds-border-subtle)';
219
250
  const borderWidth = '1px';
220
251
  const borderStyle = 'solid';
252
+ const isDs = useC4DesignSystem() === 'ds';
221
253
  const normalizedLink = props.link ??
222
254
  (props.url && props.linkLabel
223
255
  ? {
@@ -226,7 +258,9 @@ export const ApplicationTile = (props) => {
226
258
  visible: props.linkVisible !== false,
227
259
  }
228
260
  : undefined);
229
- 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: {
230
264
  display: 'flex',
231
265
  justifyContent: 'space-between',
232
266
  alignItems: 'flex-start',
@@ -276,6 +310,7 @@ const templateColumnsBySize = {
276
310
  xxl: '1fr 1fr 1fr',
277
311
  };
278
312
  export const Applications = (props) => {
313
+ const designSystem = useC4DesignSystem();
279
314
  const [mediaSize, setMediaSize] = useState(mediaSizeByWidth(window.innerWidth));
280
315
  useEffect(() => {
281
316
  let frame = 0;
@@ -310,6 +345,9 @@ export const Applications = (props) => {
310
345
  }
311
346
  return (_jsx("div", { children: _jsx(ApplicationTile, { ...props }) }, props.name));
312
347
  }) }));
348
+ if (props.variant === 'plain' && designSystem === 'ds') {
349
+ return _jsx(DsSection, { title: props.title, children: grid });
350
+ }
313
351
  if (props.variant === 'plain') {
314
352
  return (_jsxs("div", { children: [_jsx("h6", { style: { fontSize: '16px', marginBottom: '16px' }, children: props.title }), grid] }));
315
353
  }
@@ -18,10 +18,13 @@ export declare const C4IconAndTextElement: (props: {
18
18
  */
19
19
  dsIcon?: DsStatusIcon;
20
20
  }) => JSX.Element;
21
+ export type ClusterLoadType = 'green' | 'warning' | 'red' | 'unknown';
21
22
  /**
22
- * The lucide icon and color for a cluster load in ds mode. It uses the same
23
- * ranges as `getClusterLoadConfig`.
23
+ * The load range of a cluster load in ds mode. It uses the same ranges as
24
+ * `getClusterLoadConfig`.
24
25
  */
26
+ export declare function getDsClusterLoadType(currentValue: number): ClusterLoadType;
27
+ /** The lucide icon and color for a cluster load in ds mode. */
25
28
  export declare function getDsClusterLoadPresentation(currentValue: number): DsStatusIcon;
26
29
  export declare function getClusterLoadConfig(currentValue: number): {
27
30
  type: "green";
@@ -80,18 +80,21 @@ const DS_CLUSTER_LOAD_PRESENTATION = {
80
80
  unknown: { icon: TriangleAlert, color: DS_STATUS_ICON_COLORS.warning },
81
81
  };
82
82
  /**
83
- * The lucide icon and color for a cluster load in ds mode. It uses the same
84
- * ranges as `getClusterLoadConfig`.
83
+ * The load range of a cluster load in ds mode. It uses the same ranges as
84
+ * `getClusterLoadConfig`.
85
85
  */
86
- export function getDsClusterLoadPresentation(currentValue) {
86
+ export function getDsClusterLoadType(currentValue) {
87
87
  const { type } = getClusterLoadConfig(currentValue);
88
88
  // The carbon ranges end below 1000 %, so a higher load is 'unknown' there.
89
89
  // In ds mode, every load from the start of the red range up is critical.
90
90
  const redMin = CLUSTER_LOAD_RANGES.find((range) => range.type === 'red')?.min;
91
- const dsType = type === 'unknown' && redMin !== undefined && currentValue >= redMin
91
+ return type === 'unknown' && redMin !== undefined && currentValue >= redMin
92
92
  ? 'red'
93
93
  : type;
94
- return DS_CLUSTER_LOAD_PRESENTATION[dsType];
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)];
95
98
  }
96
99
  export function getClusterLoadConfig(currentValue) {
97
100
  const found = CLUSTER_LOAD_RANGES.find((entry) => {