@camunda/ccma-saas-frontend 0.7.0 → 0.7.1
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.
- package/lib/esm/components/c4-billing-page/elements/value-metric.js +2 -4
- package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +24 -10
- package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +6 -2
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +2 -2
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +2 -2
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +4 -4
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +1 -2
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +2 -2
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +1 -2
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +1 -2
- package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +1 -2
- package/lib/esm/components/c4-help-center/c4-help-center.js +3 -1
- package/lib/esm/components/c4-info-tooltip/c4-info-tooltip.js +1 -1
- package/lib/esm/components/c4-management-api/c4-management-api.js +8 -3
- package/lib/esm/components/c4-sm-dashboard/health-status.js +1 -1
- package/lib/esm/components/c4-usage-history/elements/usage-history-charts.d.ts +1 -1
- package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +3 -1
- package/lib/esm/components/shared-charts/ds-line-chart.js +25 -11
- package/lib/esm/components/shared-charts/recharts-tokens.d.ts +16 -0
- package/lib/esm/components/shared-charts/recharts-tokens.js +31 -0
- package/lib/esm/i18n/en/entities/orgroles.json +2 -2
- package/lib/esm/runtime/build-cluster-swagger-url.js +2 -2
- package/lib/esm/runtime/nav/camunda-apps.js +2 -2
- package/lib/esm/ui/c4-definition-tooltip.d.ts +15 -0
- package/lib/esm/ui/c4-definition-tooltip.js +43 -0
- package/lib/esm/ui/index.d.ts +6 -0
- package/lib/esm/ui/index.js +20 -3
- package/lib/esm/utils/role-labels.js +5 -4
- package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +5 -5
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +5 -5
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +33 -16
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +2 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +3 -4
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +2 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +2 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +1 -2
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +16 -16
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +13 -15
- package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +2 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +2 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +2 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-page.js +2 -1
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +177 -17
- package/lib/esm/widgets/dashboard/c4-dashboard-app.types.d.ts +15 -2
- package/lib/esm/widgets/group-details/c4-group-details-page.js +2 -2
- package/lib/esm/widgets/management/c4-management-app.js +3 -3
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +1 -7
- package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +1 -2
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +7 -1
- package/lib/esm/widgets/user-details/c4-user-details-page.js +3 -3
- package/package.json +4 -4
|
@@ -5,10 +5,9 @@ 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 { MeterChart } from '@carbon/charts-react';
|
|
8
|
-
import { DefinitionTooltip } from '@carbon/react';
|
|
9
8
|
import { WarningAlt } from '@carbon/react/icons/index.esm.js';
|
|
10
9
|
import { useC4DesignSystem } from '../../../runtime/c4-console-runtime-context.js';
|
|
11
|
-
import {
|
|
10
|
+
import { DefinitionTooltip, Stack } from '../../../ui/index.js';
|
|
12
11
|
import { C4LinkButton } from '../../c4-link-button/c4-link-button.js';
|
|
13
12
|
import { C4TileWithTitleAndAction } from '../../c4-tile-with-title-and-action/c4-tile-with-title-and-action.js';
|
|
14
13
|
import { DsMeterChart } from '../../shared-charts/ds-meter-chart.js';
|
|
@@ -26,7 +25,6 @@ export const CHART_COLORS_DS = {
|
|
|
26
25
|
[CHART_COLORS.GREEN]: DS_STATUS_COLORS.success,
|
|
27
26
|
};
|
|
28
27
|
export const ValueMetric = ({ title, metric, loading, isEnterpriseOrg = false, }) => {
|
|
29
|
-
const designSystem = useC4DesignSystem();
|
|
30
28
|
let chartProps;
|
|
31
29
|
let simpleProps;
|
|
32
30
|
switch (metric.kind) {
|
|
@@ -56,7 +54,7 @@ export const ValueMetric = ({ title, metric, loading, isEnterpriseOrg = false, }
|
|
|
56
54
|
gap: '0.5rem',
|
|
57
55
|
}, children: [_jsx(WarningAlt, { style: {
|
|
58
56
|
color: CHART_COLORS.RED,
|
|
59
|
-
} }), _jsxs("p", { children: [
|
|
57
|
+
} }), _jsxs("p", { children: [_jsx(DefinitionTooltip, { openOnHover: true, definition: metric.overagesDescription, children: _jsx("span", { children: "Overages" }) }), ' ', "applied"] })] }))] }) }));
|
|
60
58
|
return component;
|
|
61
59
|
};
|
|
62
60
|
const SimpleText = ({ title, subTitle }) => {
|
|
@@ -8,22 +8,35 @@ import { BarChart } from '@camunda/design-system';
|
|
|
8
8
|
import { GroupedBarChart, SimpleBarChart, StackedBarChart, } from '@carbon/charts-react';
|
|
9
9
|
import { useC4DesignSystem } from '../../../runtime/c4-console-runtime-context.js';
|
|
10
10
|
import { Stack, Tile } from '../../../ui/index.js';
|
|
11
|
-
import { getDsSeriesToken } from '../../shared-charts/recharts-tokens.js';
|
|
12
|
-
/**
|
|
11
|
+
import { getDsSeriesToken, toDsSeriesKeys, } from '../../shared-charts/recharts-tokens.js';
|
|
12
|
+
/**
|
|
13
|
+
* Pivots flat {group, key, value} rows into one row per key, keyed by the
|
|
14
|
+
* group's CSS-safe series key.
|
|
15
|
+
*/
|
|
13
16
|
function pivotByKey(dataPoints) {
|
|
14
17
|
const groupSet = new Set();
|
|
15
|
-
const rowsByKey = new Map();
|
|
16
18
|
for (const point of dataPoints) {
|
|
17
19
|
groupSet.add(point.group);
|
|
18
|
-
const row = rowsByKey.get(point.key) ?? { key: point.key };
|
|
19
|
-
row[point.group] = point.value;
|
|
20
|
-
rowsByKey.set(point.key, row);
|
|
21
20
|
}
|
|
22
21
|
// Sort groups so the group→colour mapping stays stable regardless of the
|
|
23
22
|
// order the points arrive in.
|
|
23
|
+
const groups = Array.from(groupSet).sort();
|
|
24
|
+
const keyByGroup = toDsSeriesKeys(groups);
|
|
25
|
+
const rowsByKey = new Map();
|
|
26
|
+
for (const point of dataPoints) {
|
|
27
|
+
// `keyByGroup` is built from the groups of these same points, so this skips
|
|
28
|
+
// nothing. It keeps the row keys to the keys that `config` declares.
|
|
29
|
+
const seriesKey = keyByGroup.get(point.group);
|
|
30
|
+
if (!seriesKey) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const row = rowsByKey.get(point.key) ?? { key: point.key };
|
|
34
|
+
row[seriesKey] = point.value;
|
|
35
|
+
rowsByKey.set(point.key, row);
|
|
36
|
+
}
|
|
24
37
|
return {
|
|
25
38
|
rows: Array.from(rowsByKey.values()),
|
|
26
|
-
|
|
39
|
+
keyByGroup,
|
|
27
40
|
};
|
|
28
41
|
}
|
|
29
42
|
export const C4BarChart = ({ title, dataPoints, axes, stacked = false, mode, height = 400, theme, }) => {
|
|
@@ -34,9 +47,10 @@ export const C4BarChart = ({ title, dataPoints, axes, stacked = false, mode, hei
|
|
|
34
47
|
? 'stacked'
|
|
35
48
|
: 'grouped';
|
|
36
49
|
if (designSystem === 'ds') {
|
|
37
|
-
const { rows,
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
const { rows, keyByGroup } = pivotByKey(dataPoints);
|
|
51
|
+
// Iterate the map, so that every config key is a key the map produced.
|
|
52
|
+
const config = Object.fromEntries([...keyByGroup].map(([group, seriesKey], index) => [
|
|
53
|
+
seriesKey,
|
|
40
54
|
{ label: group, color: getDsSeriesToken(index) },
|
|
41
55
|
]));
|
|
42
56
|
return (_jsx(Tile, { children: _jsx(Stack, { children: _jsxs("div", { children: [title && (_jsx("div", { style: {
|
|
@@ -193,7 +193,9 @@ export const C4ClusterDetailsSecureConnectivity = ({ status, privateEndpoints, c
|
|
|
193
193
|
display: 'flex',
|
|
194
194
|
alignItems: 'center',
|
|
195
195
|
gap: 'var(--cds-spacing-05)',
|
|
196
|
-
}, children: _jsx("h4", { style: { margin: 0 }, children: text.serviceDetailsTitle ?? 'Service details' }) }), _jsx("div", { children: isNarrowLayout ? (
|
|
196
|
+
}, children: _jsx("h4", { style: { margin: 0 }, children: text.serviceDetailsTitle ?? 'Service details' }) }), _jsx("div", { children: isNarrowLayout ? (
|
|
197
|
+
// Single-column layout: each field on its own row
|
|
198
|
+
_jsx(C4StructuredListWrapper, { isCondensed: true, isFlush: true, style: { borderTop: 'none' }, children: _jsxs(C4StructuredListBody, { children: [_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, style: labelCellLeftStyle, children: text.enabledStatusLabel ?? 'Status' }), _jsx(C4StructuredListCell, { style: { borderTop: 'none' }, children: _jsxs("div", { style: {
|
|
197
199
|
display: 'flex',
|
|
198
200
|
justifyContent: 'space-between',
|
|
199
201
|
alignItems: 'center',
|
|
@@ -208,7 +210,9 @@ export const C4ClusterDetailsSecureConnectivity = ({ status, privateEndpoints, c
|
|
|
208
210
|
editLabel: 'Edit supported regions',
|
|
209
211
|
alignToSingleSnippet: true,
|
|
210
212
|
wrapItems: true,
|
|
211
|
-
}) })] })] }) })) : (
|
|
213
|
+
}) })] })] }) })) : (
|
|
214
|
+
// Two-column layout: pairs of fields side-by-side
|
|
215
|
+
_jsx(C4StructuredListWrapper, { isCondensed: true, isFlush: true, style: { borderTop: 'none', overflowX: 'auto' }, children: _jsxs(C4StructuredListBody, { children: [_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, style: labelCellLeftStyle, children: text.enabledStatusLabel ?? 'Status' }), _jsx(C4StructuredListCell, { style: { borderTop: 'none' }, children: statusElement }), _jsx(C4StructuredListCell, { noWrap: true, style: labelCellRightStyle, children: _jsx("span", { style: { opacity: 0 }, children: "\u2014" }) }), _jsx(C4StructuredListCell, { style: {
|
|
212
216
|
borderTop: 'none',
|
|
213
217
|
textAlign: 'right',
|
|
214
218
|
}, children: deactivateLinkElement })] }), _jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { noWrap: true, style: labelCellLeftStyle, children: text.serviceNameLabel ?? 'Service name' }), _jsx(C4StructuredListCell, { style: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { PasswordInput } from '@carbon/react';
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
|
-
import { Checkbox, Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
4
|
+
import { Checkbox, Form, Modal, Stack, TextInput } from '../../../ui/index.js';
|
|
5
5
|
import { C4InlineNotification } from '../../c4-inline-notification/c4-inline-notification.js';
|
|
6
6
|
// ponytail: English placeholder copy — final UX copy + lockout wording are a Product
|
|
7
7
|
// Design action item (design §1). Kept inline until it lands.
|
|
@@ -4,9 +4,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import { PasswordInput } from '@carbon/react';
|
|
8
8
|
import { forwardRef, useCallback, useImperativeHandle, useState, } from 'react';
|
|
9
|
-
import { Checkbox, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
9
|
+
import { Checkbox, Form, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
10
10
|
import { useRadioFamily } from '../../ui/families.js';
|
|
11
11
|
import { C4ActionableNotification } from '../c4-actionable-notification/c4-actionable-notification.js';
|
|
12
12
|
import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
|
|
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
7
|
import { C3ClusterTag, } from '@camunda/camunda-composite-components';
|
|
8
|
-
import { ClusterPlanTypeCategory, checkVersion, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
8
|
+
import { AUTHORIZATION_TOGGLE_MIN_VERSION, ClusterPlanTypeCategory, checkVersion, LINE_8_10_MIN_VERSION, TASKLIST_MODE_TOGGLE_MIN_VERSION, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
9
9
|
import { ChoiceCard, ChoiceCardGroup, Input, Textarea, } from '@camunda/design-system';
|
|
10
10
|
import { Column, FormLabel, Grid, InlineLoading, Stack, TextArea, TextInput, } from '@carbon/react';
|
|
11
11
|
import { ChevronDown, ChevronUp, Code, DataBase } from '@carbon/react/icons/index.esm.js';
|
|
@@ -344,7 +344,7 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
|
|
|
344
344
|
return checkVersion({
|
|
345
345
|
possiblyVersionOrDockerPath: foundGeneration.version,
|
|
346
346
|
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
347
|
-
versionToCompareTo:
|
|
347
|
+
versionToCompareTo: AUTHORIZATION_TOGGLE_MIN_VERSION,
|
|
348
348
|
trueForSnapshot: true,
|
|
349
349
|
});
|
|
350
350
|
}
|
|
@@ -364,14 +364,14 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
|
|
|
364
364
|
return (checkVersion({
|
|
365
365
|
possiblyVersionOrDockerPath: foundGeneration.version,
|
|
366
366
|
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
367
|
-
versionToCompareTo:
|
|
367
|
+
versionToCompareTo: TASKLIST_MODE_TOGGLE_MIN_VERSION,
|
|
368
368
|
trueForSnapshot: 'compare',
|
|
369
369
|
trueOnInvalidVersion: false,
|
|
370
370
|
}) &&
|
|
371
371
|
checkVersion({
|
|
372
372
|
possiblyVersionOrDockerPath: foundGeneration.version,
|
|
373
373
|
operator: VersionCheckOperator.LessThan,
|
|
374
|
-
versionToCompareTo:
|
|
374
|
+
versionToCompareTo: LINE_8_10_MIN_VERSION,
|
|
375
375
|
trueForSnapshot: 'compare',
|
|
376
376
|
trueOnInvalidVersion: false,
|
|
377
377
|
}));
|
package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js
CHANGED
|
@@ -4,9 +4,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import { Form } from '@carbon/react';
|
|
8
7
|
import { forwardRef, useCallback, useImperativeHandle, useMemo, useState, } from 'react';
|
|
9
|
-
import { Checkbox, Link, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
8
|
+
import { Checkbox, Form, Link, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
10
9
|
import { C4ClusterClientCredentialsModal } from '../c4-cluster-client-credentials/c4-cluster-client-credentials.js';
|
|
11
10
|
import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
|
|
12
11
|
function safeTranslate(t, key, defaultValue, options) {
|
package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js
CHANGED
|
@@ -5,9 +5,9 @@ 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 { SECRETS_MAX_LENGTH } from '@camunda/ccma-shared-types';
|
|
8
|
-
import {
|
|
8
|
+
import { PasswordInput } from '@carbon/react';
|
|
9
9
|
import { forwardRef, useCallback, useImperativeHandle, useMemo, useState, } from 'react';
|
|
10
|
-
import { Modal, Stack, TextInput } from '../../ui/index.js';
|
|
10
|
+
import { Form, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
11
11
|
import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
|
|
12
12
|
function safeTranslate(t, key, defaultValue, options) {
|
|
13
13
|
if (!t)
|
package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js
CHANGED
|
@@ -4,9 +4,8 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-run
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import { Form, FormGroup } from '@carbon/react';
|
|
8
7
|
import { forwardRef, useCallback, useImperativeHandle, useMemo, useState, } from 'react';
|
|
9
|
-
import { Checkbox, Link, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
8
|
+
import { Checkbox, Form, FormGroup, Link, Modal, Stack, TextInput, } from '../../ui/index.js';
|
|
10
9
|
import { C4ClusterClientCredentialsModal } from '../c4-cluster-client-credentials/c4-cluster-client-credentials.js';
|
|
11
10
|
function isApiClientNameValid(name) {
|
|
12
11
|
if (!name.trim()) {
|
|
@@ -5,9 +5,8 @@ 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 { normalizeCIDRList } from '@camunda/ccma-shared-types';
|
|
8
|
-
import { Form } from '@carbon/react';
|
|
9
8
|
import { forwardRef, useCallback, useImperativeHandle, useState, } from 'react';
|
|
10
|
-
import { Modal, Stack, TextInput } from '../../ui/index.js';
|
|
9
|
+
import { Form, Modal, Stack, TextInput } from '../../ui/index.js';
|
|
11
10
|
import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
|
|
12
11
|
// Helper function to ensure translations work
|
|
13
12
|
function safeTranslate(t, key, fallback) {
|
package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js
CHANGED
|
@@ -4,9 +4,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import { Form } from '@carbon/react';
|
|
8
7
|
import { useCallback, useRef } from 'react';
|
|
9
|
-
import { Stack, TextInput } from '../../ui/index.js';
|
|
8
|
+
import { Form, Stack, TextInput } from '../../ui/index.js';
|
|
10
9
|
import { C4AsyncModal } from '../c4-async-modal/c4-async-modal.js';
|
|
11
10
|
function safeTranslate(t, key, defaultValue, options) {
|
|
12
11
|
if (!t)
|
|
@@ -34,6 +34,8 @@ export function C4HelpCenter({ open, onOpenChange, data, isLoading, helpLinks, o
|
|
|
34
34
|
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsx(DialogContent, { className: 'c4-ui flex flex-col gap-0 overflow-hidden overflow-y-hidden p-0', style: { maxWidth: 'min(900px, calc(100% - 2rem))', height: '80vh' }, children: showFullUI ? (_jsxs(_Fragment, { children: [_jsx(DialogHeader, { className: 'flex-shrink-0 border-b px-6 py-4', children: _jsx(DialogTitle, { children: "Help Center" }) }), _jsxs(Tabs, { orientation: 'vertical', value: effectiveActiveTabId, onValueChange: (id) => setActiveTabId(id), className: 'flex min-h-0 flex-1 flex-row overflow-hidden', children: [_jsxs("div", { className: 'flex w-52 flex-shrink-0 flex-col overflow-hidden border-r', children: [_jsx("p", { className: 'px-5 pb-2 pt-4 text-xs font-semibold uppercase text-neutral-foreground-subtle', children: "Topics" }), isLoading ? (_jsx("div", { className: 'flex flex-col gap-2 px-3', children: [1, 2, 3].map((i) => (_jsx("div", { className: 'h-8 animate-pulse rounded bg-neutral-background-strong' }, i))) })) : (_jsxs(TabsList, { variant: 'line', className: 'h-auto w-full flex-col items-start gap-1 rounded-none bg-transparent px-3', children: [tabs.map((tab) => (_jsx(TabsTrigger, { value: tab.id, className: 'w-full justify-start text-sm font-normal', children: tab.label }, tab.id))), hasFeedbackTab && tabs.length > 0 && (_jsx("div", { role: 'none', className: 'my-1 w-full px-2', children: _jsx("div", { className: 'h-px bg-border' }) })), hasFeedbackTab && (_jsxs(TabsTrigger, { value: FEEDBACK_TAB_ID, className: 'w-full justify-start gap-2 text-sm font-normal', children: [_jsx(MessageSquare, { className: 'size-4', "aria-hidden": true }), "Share your feedback"] }))] })), !isLoading && data?.links && data.links.length > 0 && (_jsx("div", { className: 'border-t px-3 py-2', children: data.links.map((link) => (_jsxs("a", { href: link.link, target: '_blank', rel: 'noopener noreferrer', className: 'flex items-center gap-1 px-2 py-1 text-xs text-neutral-foreground-subtle hover:underline', children: [link.label, _jsx(ExternalLink, { className: 'size-3', "aria-hidden": true })] }, link.id))) }))] }), isLoading ? (_jsx("div", { className: 'flex-1 p-6', children: _jsx("div", { className: 'grid grid-cols-2 gap-4', children: [1, 2, 3, 4].map((i) => (_jsx("div", { className: 'h-64 animate-pulse rounded-xl bg-neutral-background-strong' }, i))) }) })) : (_jsxs(ScrollArea, { className: 'flex-1', children: [tabs.map((tab) => (_jsx(TabsContent, { value: tab.id, className: 'mt-0 p-6', children: tab.tiles.length === 0 ? (_jsx("p", { className: 'text-sm text-neutral-foreground-subtle', children: "No content available." })) : (_jsx("div", { className: 'grid grid-cols-2 gap-4', children: tab.tiles.map((tile) => (_jsxs(Card, { className: 'flex flex-col', children: [tile.image && (_jsx("img", { src: tile.image, alt: '', className: 'h-32 w-full object-cover' })), _jsxs(CardHeader, { children: [_jsx(CardTitle, { className: 'text-sm', children: tile.title }), tile.timeToComplete && (_jsx(Badge, { variant: 'neutral', className: 'self-start text-xs', children: tile.timeToComplete }))] }), _jsx(CardContent, { className: 'flex-1', children: _jsx(CardDescription, { children: _jsx(ReactMarkdown, { components: {
|
|
35
35
|
p: ({ children }) => _jsx(_Fragment, { children: children }),
|
|
36
36
|
a: ({ children, href }) => (_jsx("a", { href: href, target: '_blank', rel: 'noopener noreferrer', children: children })),
|
|
37
|
-
}, children: tile.description }) }) }), tile.link && tile.cta && (_jsx(CardFooter, { children: _jsx(Button, { variant: 'secondary', size: 'sm', asChild: true, children: _jsxs("a", { href: tile.link, target: '_blank', rel: 'noopener noreferrer', children: [tile.cta, _jsx(ArrowRight, { className: 'ml-1 size-3', "aria-hidden": true })] }) }) }))] }, tile.card_id))) })) }, tab.id))), hasFeedbackTab && onSubmitFeedback && (_jsx(TabsContent, { value: FEEDBACK_TAB_ID, className: 'mt-0 p-6', children: _jsxs("div", { className: 'max-w-xl', children: [_jsx("p", { className: 'mb-4 text-sm text-neutral-foreground-subtle', children: "We actively use this information to fix problems and improve your experience with our products." }), _jsx(C4FeedbackForm, { onSubmit: onSubmitFeedback, isEnterprise: feedbackEnterprise, resetKey: open })] }) }))] }))] })] })) : (
|
|
37
|
+
}, children: tile.description }) }) }), tile.link && tile.cta && (_jsx(CardFooter, { children: _jsx(Button, { variant: 'secondary', size: 'sm', asChild: true, children: _jsxs("a", { href: tile.link, target: '_blank', rel: 'noopener noreferrer', children: [tile.cta, _jsx(ArrowRight, { className: 'ml-1 size-3', "aria-hidden": true })] }) }) }))] }, tile.card_id))) })) }, tab.id))), hasFeedbackTab && onSubmitFeedback && (_jsx(TabsContent, { value: FEEDBACK_TAB_ID, className: 'mt-0 p-6', children: _jsxs("div", { className: 'max-w-xl', children: [_jsx("p", { className: 'mb-4 text-sm text-neutral-foreground-subtle', children: "We actively use this information to fix problems and improve your experience with our products." }), _jsx(C4FeedbackForm, { onSubmit: onSubmitFeedback, isEnterprise: feedbackEnterprise, resetKey: open })] }) }))] }))] })] })) : (
|
|
38
|
+
/* Fallback: simple link list when no CMS data and no feedback tab */
|
|
39
|
+
_jsxs(_Fragment, { children: [_jsx(DialogHeader, { className: 'p-6', children: _jsx(DialogTitle, { children: "Help & support" }) }), _jsx("div", { className: 'flex flex-col gap-1 px-4', children: helpLinks &&
|
|
38
40
|
helpLinks.map((link) => (_jsx(Button, { variant: 'ghost', className: 'w-full justify-between', asChild: true, children: _jsxs("a", { href: link.href, target: '_blank', rel: 'noopener noreferrer', children: [link.label, _jsx(ExternalLink, { className: 'size-3.5 text-neutral-foreground-subtle', "aria-hidden": true })] }) }, link.key))) })] })) }) }));
|
|
39
41
|
}
|
|
@@ -4,8 +4,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import { IconButton } from '@carbon/react';
|
|
8
7
|
import { Information } from '@carbon/react/icons/index.esm.js';
|
|
8
|
+
import { IconButton } from '../../ui/index.js';
|
|
9
9
|
export const C4InfoTooltip = ({ label, align, kind, renderIcon, }) => {
|
|
10
10
|
const config = {
|
|
11
11
|
label,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ListItem, UnorderedList } from '@carbon/react';
|
|
3
2
|
import { C4_ASSET_URLS } from '../../assetUrls.js';
|
|
4
|
-
import { CodeSnippet, Stack } from '../../ui/index.js';
|
|
3
|
+
import { CodeSnippet, ListItem, Stack, UnorderedList } from '../../ui/index.js';
|
|
5
4
|
import { C4DataTable } from '../c4-data-table/c4-data-table.js';
|
|
6
5
|
import { C4DataTableSkeleton } from '../c4-data-table/c4-data-table-skeleton.js';
|
|
7
6
|
import { C4EmptyState } from '../c4-empty-state/c4-empty-state.js';
|
|
@@ -192,7 +191,13 @@ export const C4ManagementApi = ({ clients, loading, showIpWhitelistColumn, showH
|
|
|
192
191
|
});
|
|
193
192
|
}
|
|
194
193
|
const expandedRow = () => {
|
|
195
|
-
return (
|
|
194
|
+
return (
|
|
195
|
+
// Force the primary text token: the ds DataTable's expansion region is
|
|
196
|
+
// styled by the design system, and the Carbon list text would otherwise
|
|
197
|
+
// inherit a colour that is too dark in ds dark mode. `--cds-text-primary`
|
|
198
|
+
// is the normal primary text in carbon and is remapped to the DS
|
|
199
|
+
// foreground (light in dark) under html.c4-ds.
|
|
200
|
+
_jsxs(UnorderedList, { style: { color: 'var(--cds-text-primary)' }, children: [_jsxs(ListItem, { style: { minHeight: '30px' }, children: [text.expandedClientSecret, ": ", text.expandedClientSecretNotVisible] }), _jsxs(ListItem, { style: { minHeight: '30px' }, children: [text.expandedApiUrl, ":", ' ', _jsx(CodeSnippet, { type: 'inline', feedback: text.urlCopiedFeedback, children: urls.apiUrl })] }), _jsxs(ListItem, { style: { minHeight: '30px' }, children: [text.expandedOauthUrl, ":", ' ', _jsx(CodeSnippet, { type: 'inline', feedback: text.urlCopiedFeedback, children: urls.oauthUrl })] })] }));
|
|
196
201
|
};
|
|
197
202
|
const component = (_jsxs(Stack, { gap: 3, children: [_jsx("div", { style: { display: 'flex', flexDirection: 'column', overflowX: 'auto' }, children: _jsx(C4DataTable, { headers: headerData, data: clients.map((item) => {
|
|
198
203
|
return { ...item, expansion: expandedRow() };
|
|
@@ -4,8 +4,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
4
4
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
5
|
* You may not use this file except in compliance with the commercial license.
|
|
6
6
|
*/
|
|
7
|
-
import { DefinitionTooltip } from '@carbon/react';
|
|
8
7
|
import { CheckmarkFilled, WarningFilled } from '@carbon/react/icons/index.esm.js';
|
|
8
|
+
import { DefinitionTooltip } from '../../ui/index.js';
|
|
9
9
|
import { StatusColor, } from '../c4-cluster-overview/applications.js';
|
|
10
10
|
import { C4LinkButton } from '../c4-link-button/c4-link-button.js';
|
|
11
11
|
export const HealthStatus = (props) => {
|
|
@@ -38,4 +38,4 @@ export interface UsageHistoryChartsProps {
|
|
|
38
38
|
tenants?: LineChartConfig;
|
|
39
39
|
}
|
|
40
40
|
export declare const UsageHistoryCharts: ({ pi, di, tu, tenants, }: UsageHistoryChartsProps) => JSX.Element;
|
|
41
|
-
export declare const ValueMetricsLineChart: import("react").
|
|
41
|
+
export declare const ValueMetricsLineChart: import("react").NamedExoticComponent<LineChartConfig>;
|
|
@@ -32,7 +32,9 @@ export const C4UsageMetricsPerCluster = ({ data, range, tags, texts, loading, do
|
|
|
32
32
|
license: licenseAvailable ? (item?.license ?? '-') : undefined,
|
|
33
33
|
originalIndex: index,
|
|
34
34
|
})), [data, licenseAvailable, tenantsAvailable]);
|
|
35
|
-
const compTagSelection = tagsAvailable ? (
|
|
35
|
+
const compTagSelection = tagsAvailable ? (
|
|
36
|
+
// hack to align date selection with tag selection
|
|
37
|
+
_jsx("div", { style: { marginTop: '-2px' }, children: _jsx(MultiSelect, { titleText: texts.tags, label: texts.tags, useTitleInItem: true, selectedItems: tags.values, id: 'cluster-usage-metrics-tag-selection', items: tags.allTags, onChange: (event) => {
|
|
36
38
|
tags.onChange(event.selectedItems);
|
|
37
39
|
} }) })) : null;
|
|
38
40
|
let compData = _jsx(_Fragment, {});
|
|
@@ -6,27 +6,40 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
*/
|
|
7
7
|
import { LineChart } from '@camunda/design-system';
|
|
8
8
|
import { useMemo } from 'react';
|
|
9
|
-
import { getDsSeriesToken } from './recharts-tokens.js';
|
|
9
|
+
import { getDsSeriesToken, toDsSeriesKeys } from './recharts-tokens.js';
|
|
10
10
|
function formatDate(value) {
|
|
11
11
|
const date = new Date(String(value));
|
|
12
12
|
return Number.isNaN(date.getTime())
|
|
13
13
|
? String(value)
|
|
14
14
|
: Intl.DateTimeFormat('en-US', { month: 'short', day: '2-digit' }).format(date);
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Pivots flat {group, date, value} rows into one row per date, keyed by the
|
|
18
|
+
* group's CSS-safe series key.
|
|
19
|
+
*/
|
|
17
20
|
function pivotByDate(dataPoints) {
|
|
18
21
|
const groupSet = new Set();
|
|
19
|
-
const rowsByDate = new Map();
|
|
20
22
|
for (const point of dataPoints) {
|
|
21
23
|
groupSet.add(point.group);
|
|
24
|
+
}
|
|
25
|
+
// Sort groups so the group->colour mapping stays stable regardless of the
|
|
26
|
+
// order the points arrive in.
|
|
27
|
+
const groups = Array.from(groupSet).sort();
|
|
28
|
+
const keyByGroup = toDsSeriesKeys(groups);
|
|
29
|
+
const rowsByDate = new Map();
|
|
30
|
+
for (const point of dataPoints) {
|
|
31
|
+
// `keyByGroup` is built from the groups of these same points, so this skips
|
|
32
|
+
// nothing. It keeps the row keys to the keys that `config` declares.
|
|
33
|
+
const seriesKey = keyByGroup.get(point.group);
|
|
34
|
+
if (!seriesKey) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
22
37
|
const row = rowsByDate.get(point.date) ?? { date: point.date };
|
|
23
|
-
row[
|
|
38
|
+
row[seriesKey] = point.value;
|
|
24
39
|
rowsByDate.set(point.date, row);
|
|
25
40
|
}
|
|
26
41
|
const rows = Array.from(rowsByDate.values()).sort((a, b) => String(a.date).localeCompare(String(b.date)));
|
|
27
|
-
|
|
28
|
-
// order the points arrive in.
|
|
29
|
-
return { rows, groups: Array.from(groupSet).sort() };
|
|
42
|
+
return { rows, keyByGroup };
|
|
30
43
|
}
|
|
31
44
|
/**
|
|
32
45
|
* ds-mode line chart, rendered with the `@camunda/design-system` `LineChart`.
|
|
@@ -37,11 +50,12 @@ function pivotByDate(dataPoints) {
|
|
|
37
50
|
* unchanged) but only the chart title is surfaced in ds mode.
|
|
38
51
|
*/
|
|
39
52
|
export function DsLineChart({ title, dataPoints, thresholds, height = 400, }) {
|
|
40
|
-
const { rows,
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
const { rows, keyByGroup } = useMemo(() => pivotByDate(dataPoints), [dataPoints]);
|
|
54
|
+
// Iterate the map, so that every config key is a key the map produced.
|
|
55
|
+
const config = useMemo(() => Object.fromEntries([...keyByGroup].map(([group, seriesKey], index) => [
|
|
56
|
+
seriesKey,
|
|
43
57
|
{ label: group, color: getDsSeriesToken(index) },
|
|
44
|
-
])), [
|
|
58
|
+
])), [keyByGroup]);
|
|
45
59
|
const referenceLines = thresholds?.map((threshold) => ({
|
|
46
60
|
value: threshold.value,
|
|
47
61
|
label: threshold.label,
|
|
@@ -49,3 +49,19 @@ export declare const DS_STATUS_COLORS: {
|
|
|
49
49
|
};
|
|
50
50
|
/** Spread onto a recharts `<Tooltip>` so its popover matches DS surfaces. */
|
|
51
51
|
export declare const DS_CHART_TOOLTIP_PROPS: Pick<TooltipProps<number, string>, 'contentStyle' | 'labelStyle' | 'itemStyle'>;
|
|
52
|
+
/**
|
|
53
|
+
* Maps series names to `ChartConfig` keys that are safe as CSS idents.
|
|
54
|
+
*
|
|
55
|
+
* The DS chart components expand every `ChartConfig` key into a
|
|
56
|
+
* `--color-<key>` custom property and read the series stroke/fill back from
|
|
57
|
+
* it. Our series names are user-supplied (cluster and organization names), so
|
|
58
|
+
* a name with a space — or any other character that a CSS ident cannot hold —
|
|
59
|
+
* makes that declaration invalid. The browser drops it, the series stroke
|
|
60
|
+
* resolves to nothing, and the chart renders axes and legend text but no
|
|
61
|
+
* lines or bars.
|
|
62
|
+
*
|
|
63
|
+
* Names that reduce to the same slug get a numeric suffix, so two clusters
|
|
64
|
+
* called "a b" and "a-b" keep separate colors. The human name stays on
|
|
65
|
+
* `ChartConfig.label`, which is what the legend and tooltip show.
|
|
66
|
+
*/
|
|
67
|
+
export declare function toDsSeriesKeys(groups: readonly string[]): Map<string, string>;
|
|
@@ -97,3 +97,34 @@ export const DS_CHART_TOOLTIP_PROPS = {
|
|
|
97
97
|
color: 'var(--popover-foreground)',
|
|
98
98
|
},
|
|
99
99
|
};
|
|
100
|
+
/**
|
|
101
|
+
* Maps series names to `ChartConfig` keys that are safe as CSS idents.
|
|
102
|
+
*
|
|
103
|
+
* The DS chart components expand every `ChartConfig` key into a
|
|
104
|
+
* `--color-<key>` custom property and read the series stroke/fill back from
|
|
105
|
+
* it. Our series names are user-supplied (cluster and organization names), so
|
|
106
|
+
* a name with a space — or any other character that a CSS ident cannot hold —
|
|
107
|
+
* makes that declaration invalid. The browser drops it, the series stroke
|
|
108
|
+
* resolves to nothing, and the chart renders axes and legend text but no
|
|
109
|
+
* lines or bars.
|
|
110
|
+
*
|
|
111
|
+
* Names that reduce to the same slug get a numeric suffix, so two clusters
|
|
112
|
+
* called "a b" and "a-b" keep separate colors. The human name stays on
|
|
113
|
+
* `ChartConfig.label`, which is what the legend and tooltip show.
|
|
114
|
+
*/
|
|
115
|
+
export function toDsSeriesKeys(groups) {
|
|
116
|
+
const keyByGroup = new Map();
|
|
117
|
+
const used = new Set();
|
|
118
|
+
for (const group of groups) {
|
|
119
|
+
const base = group.replace(/[^A-Za-z0-9_-]/g, '-') || 'series';
|
|
120
|
+
let key = base;
|
|
121
|
+
let suffix = 2;
|
|
122
|
+
while (used.has(key)) {
|
|
123
|
+
key = `${base}-${suffix}`;
|
|
124
|
+
suffix += 1;
|
|
125
|
+
}
|
|
126
|
+
used.add(key);
|
|
127
|
+
keyByGroup.set(group, key);
|
|
128
|
+
}
|
|
129
|
+
return keyByGroup;
|
|
130
|
+
}
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
},
|
|
44
44
|
"aligned": {
|
|
45
45
|
"owner": {
|
|
46
|
-
"label": "
|
|
46
|
+
"label": "Organization Owner",
|
|
47
47
|
"description": "All rights in the organization, including settings, billing, and ownership transfer. Formerly the Owner role."
|
|
48
48
|
},
|
|
49
49
|
"admin": {
|
|
50
|
-
"label": "
|
|
50
|
+
"label": "Organization Admin",
|
|
51
51
|
"description": "Manages the organization, its members, and workspaces, and acts as the super-user. Formerly the Admin role."
|
|
52
52
|
},
|
|
53
53
|
"member": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
4
|
* You may not use this file except in compliance with the commercial license.
|
|
5
5
|
*/
|
|
6
|
-
import { checkVersion, VersionCheckOperator } from '@camunda/ccma-shared-types';
|
|
6
|
+
import { checkVersion, SWAGGER_URL_8_9_MIN_VERSION, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
7
7
|
import { toServiceDomain } from './to-api-domain.js';
|
|
8
8
|
/**
|
|
9
9
|
* Builds the cluster-specific Swagger UI URL.
|
|
@@ -33,7 +33,7 @@ export function buildClusterSwaggerUrl(params) {
|
|
|
33
33
|
possiblyVersionOrDockerPath: zeebeVersion,
|
|
34
34
|
trueForSnapshot: true,
|
|
35
35
|
trueOnInvalidVersion: false,
|
|
36
|
-
versionToCompareTo:
|
|
36
|
+
versionToCompareTo: SWAGGER_URL_8_9_MIN_VERSION,
|
|
37
37
|
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
38
38
|
});
|
|
39
39
|
if (is89OrHigher) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
4
|
* You may not use this file except in compliance with the commercial license.
|
|
5
5
|
*/
|
|
6
|
-
import { checkVersion, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
6
|
+
import { ADMIN_APP_RENAME_MIN_VERSION, checkVersion, VersionCheckOperator, } from '@camunda/ccma-shared-types';
|
|
7
7
|
/**
|
|
8
8
|
* Pure, icon-free navigation domain rules ported from c3's `utils/camunda.ts`.
|
|
9
9
|
* These encode the Camunda-specific quirks (admin↔identity aliasing, zeebe as
|
|
@@ -34,7 +34,7 @@ export function resolveAdminAppName(cluster) {
|
|
|
34
34
|
return checkVersion({
|
|
35
35
|
possiblyVersionOrDockerPath: cluster.generation?.versions?.zeebe,
|
|
36
36
|
trueForSnapshot: true,
|
|
37
|
-
versionToCompareTo:
|
|
37
|
+
versionToCompareTo: ADMIN_APP_RENAME_MIN_VERSION,
|
|
38
38
|
operator: VersionCheckOperator.GreaterThanOrEqual,
|
|
39
39
|
})
|
|
40
40
|
? 'admin'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DefinitionTooltip as CarbonDefinitionTooltip } from '@carbon/react';
|
|
2
|
+
import type { ComponentProps, JSX } from 'react';
|
|
3
|
+
type CarbonDefinitionTooltipProps = ComponentProps<typeof CarbonDefinitionTooltip>;
|
|
4
|
+
/**
|
|
5
|
+
* Carbon `DefinitionTooltip` API → DS `DefinitionTooltip`.
|
|
6
|
+
*
|
|
7
|
+
* The ds branch of the `../ui` `DefinitionTooltip` switch. `carbon-compat` ships
|
|
8
|
+
* no adapter for this component, so the DS component is used directly. Its API
|
|
9
|
+
* already carries `definition`, `openOnHover`, and `align`.
|
|
10
|
+
*
|
|
11
|
+
* Unlike Carbon's, the DS component renders the definition through a Radix
|
|
12
|
+
* portal, so it is not clipped by an ancestor that hides overflow.
|
|
13
|
+
*/
|
|
14
|
+
export declare const C4DefinitionTooltip: ({ align, definition, children, ...rest }: CarbonDefinitionTooltipProps) => JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } 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 { DefinitionTooltip as DsDefinitionTooltip, } from '@camunda/design-system';
|
|
8
|
+
/**
|
|
9
|
+
* Carbon `align` values that the DS does not accept, and their DS equivalent.
|
|
10
|
+
*
|
|
11
|
+
* Carbon takes a deprecated set (`bottom-left`) next to the modern one
|
|
12
|
+
* (`bottom-start`). `DefinitionTooltipAlign` takes only the modern set, and
|
|
13
|
+
* Radix ignores a value it does not know rather than raising, so an unmapped
|
|
14
|
+
* value moves the definition to the default side with no error.
|
|
15
|
+
*
|
|
16
|
+
* Keying the record on `DeprecatedAlign` makes a missing entry a build error.
|
|
17
|
+
* `apps/accounts-frontend` types `align` as `string` through its own
|
|
18
|
+
* `@carbon/react` declaration (#9748), so `DeprecatedAlign` widens to `string`
|
|
19
|
+
* there and the check does not apply. The c4 build keeps it.
|
|
20
|
+
*/
|
|
21
|
+
const DEPRECATED_ALIGN = {
|
|
22
|
+
'top-left': 'top-start',
|
|
23
|
+
'top-right': 'top-end',
|
|
24
|
+
'bottom-left': 'bottom-start',
|
|
25
|
+
'bottom-right': 'bottom-end',
|
|
26
|
+
'left-top': 'left-start',
|
|
27
|
+
'left-bottom': 'left-end',
|
|
28
|
+
'right-top': 'right-start',
|
|
29
|
+
'right-bottom': 'right-end',
|
|
30
|
+
};
|
|
31
|
+
const toDsAlign = (align) => DEPRECATED_ALIGN[align] ??
|
|
32
|
+
align;
|
|
33
|
+
/**
|
|
34
|
+
* Carbon `DefinitionTooltip` API → DS `DefinitionTooltip`.
|
|
35
|
+
*
|
|
36
|
+
* The ds branch of the `../ui` `DefinitionTooltip` switch. `carbon-compat` ships
|
|
37
|
+
* no adapter for this component, so the DS component is used directly. Its API
|
|
38
|
+
* already carries `definition`, `openOnHover`, and `align`.
|
|
39
|
+
*
|
|
40
|
+
* Unlike Carbon's, the DS component renders the definition through a Radix
|
|
41
|
+
* portal, so it is not clipped by an ancestor that hides overflow.
|
|
42
|
+
*/
|
|
43
|
+
export const C4DefinitionTooltip = ({ align, definition, children, ...rest }) => (_jsx(DsDefinitionTooltip, { ...rest, align: align === undefined ? undefined : toDsAlign(align), definition: definition, children: children }));
|
package/lib/esm/ui/index.d.ts
CHANGED
|
@@ -3,10 +3,15 @@ import { type ComponentType } from 'react';
|
|
|
3
3
|
export declare const Button: ComponentType<import("@camunda/design-system/carbon-compat").ButtonProps<"button">>;
|
|
4
4
|
export declare const Checkbox: ComponentType<import("@carbon/react").CheckboxProps & import("react").RefAttributes<unknown>>;
|
|
5
5
|
export declare const CodeSnippet: ComponentType<import("@camunda/design-system/carbon-compat").CodeSnippetProps>;
|
|
6
|
+
export declare const DefinitionTooltip: ComponentType<import("@carbon/react").DefinitionTooltipProps>;
|
|
6
7
|
export declare const Dropdown: ComponentType<import("@carbon/react").DropdownProps<unknown> & {
|
|
7
8
|
ref?: import("react").Ref<HTMLButtonElement>;
|
|
8
9
|
}>;
|
|
10
|
+
export declare const Form: ComponentType<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>>;
|
|
11
|
+
export declare const FormGroup: ComponentType<import("@carbon/react").FormGroupProps>;
|
|
12
|
+
export declare const IconButton: ComponentType<import("@carbon/react").IconButtonProps & import("react").RefAttributes<unknown>>;
|
|
9
13
|
export declare const Link: ComponentType<import("@camunda/design-system/carbon-compat").LinkProps>;
|
|
14
|
+
export declare const ListItem: ComponentType<import("@carbon/react").ListItemProps>;
|
|
10
15
|
export declare const Loading: ComponentType<import("@carbon/react").LoadingProps>;
|
|
11
16
|
export declare const Modal: ComponentType<import("@carbon/react").ModalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
17
|
export declare const ComposedModal: ComponentType<import("@carbon/react").ComposedModalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -29,4 +34,5 @@ export declare const TextArea: typeof CarbonTextArea;
|
|
|
29
34
|
export declare const TextInput: ComponentType<import("@carbon/react").TextInputProps & import("react").RefAttributes<unknown>>;
|
|
30
35
|
export declare const Tile: ComponentType<import("@carbon/react").TileProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
31
36
|
export declare const Toggle: ComponentType<import("@carbon/react").ToggleProps>;
|
|
37
|
+
export declare const UnorderedList: ComponentType<import("@carbon/react").UnorderedListProps>;
|
|
32
38
|
export declare const Tooltip: typeof CarbonTooltip;
|