@camunda/ccma-saas-frontend 0.0.45 → 0.1.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.
- package/lib/esm/components/c4-actionable-notification/c4-actionable-notification.d.ts +20 -3
- package/lib/esm/components/c4-actionable-notification/c4-actionable-notification.js +50 -17
- package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.js +2 -1
- package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.js +1 -6
- package/lib/esm/components/c4-advanced-search-filters/FieldRow.js +4 -1
- package/lib/esm/components/c4-advanced-search-filters/FiltersSection.js +1 -6
- package/lib/esm/components/c4-advanced-search-filters/OrSection.js +3 -1
- package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.js +3 -1
- package/lib/esm/components/c4-ai-usage/c4-ai-usage.js +2 -7
- package/lib/esm/components/c4-alpha-cluster-at-checkout/c4-alpha-cluster-at-checkout.js +7 -7
- package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.js +1 -6
- package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.spec.d.ts +1 -0
- package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.spec.js +43 -0
- package/lib/esm/components/c4-app-teaser-cards/c4-app-teaser-cards.js +1 -1
- package/lib/esm/components/c4-async-modal/c4-async-modal.js +3 -2
- package/lib/esm/components/c4-audit-log/c4-audit-log.js +4 -3
- package/lib/esm/components/c4-billing-page/c4-billing-page.js +8 -6
- package/lib/esm/components/c4-billing-page/elements/cluster-reservations.js +9 -14
- package/lib/esm/components/c4-billing-page/elements/current-usage-metrics.js +2 -1
- package/lib/esm/components/c4-billing-page/elements/usage-alerts.js +3 -8
- package/lib/esm/components/c4-billing-page/elements/value-metric.js +2 -1
- package/lib/esm/components/c4-bottom-links/c4-bottom-links.js +1 -6
- package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +3 -6
- package/lib/esm/components/c4-charts-dashboard/c4-charts-dashboard.js +1 -1
- package/lib/esm/components/c4-charts-dashboard/elements/alluvial-chart.js +1 -1
- package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +1 -1
- package/lib/esm/components/c4-charts-dashboard/elements/line-chart.js +1 -1
- package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +6 -10
- package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +8 -3
- package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +8 -3
- package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +6 -5
- package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.js +12 -14
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +6 -10
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +8 -11
- package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +9 -4
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +12 -8
- package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.js +3 -2
- package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js +7 -10
- package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +15 -21
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +19 -5
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +4 -0
- package/lib/esm/components/c4-cluster-overview/applications.js +2 -1
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +4 -3
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +12 -10
- package/lib/esm/components/c4-cluster-overview/cluster-load.js +1 -1
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.d.ts +1 -1
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +6 -8
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +4 -0
- package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +1 -6
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.d.ts +17 -0
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.js +75 -0
- package/lib/esm/components/c4-cluster-settings/elements/resource-based-authorizations.js +2 -7
- package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +1 -6
- package/lib/esm/components/c4-cluster-settings/elements/tasklist-mode-toggle.js +1 -1
- package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +4 -2
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +18 -14
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.d.ts +1 -0
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.js +40 -0
- package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.types.d.ts +2 -0
- package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.js +4 -9
- package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.types.d.ts +2 -0
- package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +11 -7
- package/lib/esm/components/c4-console-dashboard/elements/empty-state.js +2 -2
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +44 -15
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +4 -2
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +4 -2
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +2 -1
- package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +2 -1
- package/lib/esm/components/c4-dashboard-first-launch/c4-dashboard-first-launch.js +1 -6
- package/lib/esm/components/c4-data-table/c4-data-table-skeleton.d.ts +15 -0
- package/lib/esm/components/c4-data-table/c4-data-table-skeleton.js +26 -0
- package/lib/esm/components/c4-data-table/c4-data-table.d.ts +3 -0
- package/lib/esm/components/c4-data-table/c4-data-table.js +194 -0
- package/lib/esm/components/c4-data-table/c4-data-table.spec.d.ts +1 -0
- package/lib/esm/components/c4-data-table/c4-data-table.spec.js +71 -0
- package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +3 -2
- package/lib/esm/components/c4-empty-state/c4-empty-state.d.ts +47 -0
- package/lib/esm/components/c4-empty-state/c4-empty-state.js +33 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.d.ts +3 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.js +51 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.d.ts +1 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.js +33 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.d.ts +8 -0
- package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.js +1 -0
- package/lib/esm/components/c4-external-link/c4-external-link.js +1 -6
- package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.d.ts +40 -0
- package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.js +109 -0
- package/lib/esm/components/c4-help-center/c4-help-center.d.ts +50 -0
- package/lib/esm/components/c4-help-center/c4-help-center.js +39 -0
- package/lib/esm/components/c4-inline-notification/c4-inline-notification.d.ts +15 -0
- package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +37 -0
- package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +4 -3
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +4 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-chart-heading.js +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +3 -8
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +1 -1
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +3 -3
- package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +2 -1
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +43 -46
- package/lib/esm/components/c4-job-dashboard-shared/c4-background-fetching-indicator.js +1 -6
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +1 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-table-heading-with-tooltip.js +1 -1
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +1 -1
- package/lib/esm/components/c4-leave-organization-modal/c4-leave-organization-modal.js +1 -6
- package/lib/esm/components/c4-link-button/c4-link-button.js +1 -6
- package/lib/esm/components/c4-llm-usage-meter/c4-llm-usage-meter.js +1 -1
- package/lib/esm/components/c4-management-activity/c4-management-activity.js +7 -9
- package/lib/esm/components/c4-management-api/c4-management-api.js +9 -11
- package/lib/esm/components/c4-management-overview/c4-management-overview.js +8 -12
- package/lib/esm/components/c4-management-settings/c4-management-settings.js +9 -11
- package/lib/esm/components/c4-management-users/c4-management-users.js +4 -9
- package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -2
- package/lib/esm/components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js +4 -2
- package/lib/esm/components/c4-navigation/c4-navigation.d.ts +55 -0
- package/lib/esm/components/c4-navigation/c4-navigation.js +175 -0
- package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +2 -1
- package/lib/esm/components/c4-page-layout/c4-page-layout.d.ts +13 -0
- package/lib/esm/components/c4-page-layout/c4-page-layout.js +23 -0
- package/lib/esm/components/c4-page-template/c4-page-template.js +14 -3
- package/lib/esm/components/c4-permission-error-page/c4-permission-error-page.js +1 -1
- package/lib/esm/components/c4-pricing/c4-pricing.js +3 -7
- package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +1 -1
- package/lib/esm/components/c4-rename-organization-modal/c4-rename-organization-modal.js +1 -1
- package/lib/esm/components/c4-search/c4-search-results.js +2 -1
- package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.d.ts +20 -0
- package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.js +41 -0
- package/lib/esm/components/c4-sm-cluster-details/automation-components.js +2 -1
- package/lib/esm/components/c4-sm-cluster-details/c4-sm-cluster-details.js +1 -6
- package/lib/esm/components/c4-sm-cluster-details/custom-properties.js +4 -8
- package/lib/esm/components/c4-sm-cluster-details/details.js +5 -4
- package/lib/esm/components/c4-sm-cluster-details/zeebe-components.js +2 -1
- package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.js +1 -1
- package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.types.d.ts +1 -1
- package/lib/esm/components/c4-sm-dashboard/cluster-tile.js +2 -1
- package/lib/esm/components/c4-sm-dashboard/component-tile.js +2 -1
- package/lib/esm/components/c4-sm-dashboard/explore.js +1 -6
- package/lib/esm/components/c4-sm-dashboard/overview.js +1 -1
- package/lib/esm/components/c4-sm-dashboard/usage-tile.js +2 -1
- package/lib/esm/components/c4-stat/c4-stat.js +1 -6
- package/lib/esm/components/c4-stateful-button/c4-stateful-button.js +2 -1
- package/lib/esm/components/c4-structured-list/c4-structured-list.d.ts +21 -0
- package/lib/esm/components/c4-structured-list/c4-structured-list.js +75 -0
- package/lib/esm/components/c4-tabs/c4-tabs.js +2 -1
- package/lib/esm/components/c4-telemetry-page/c4-telemetry-page.js +6 -2
- package/lib/esm/components/c4-telemetry-page/component-metrics.js +1 -6
- package/lib/esm/components/c4-telemetry-page/telemetry-for-component.js +2 -1
- package/lib/esm/components/c4-telemetry-teaser-page/c4-telemetry-teaser-page.js +1 -1
- package/lib/esm/components/c4-theme-switcher/c4-theme-switcher.js +1 -1
- package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js +1 -1
- package/lib/esm/components/c4-toast-notification/c4-toast-notification.d.ts +14 -0
- package/lib/esm/components/c4-toast-notification/c4-toast-notification.js +27 -0
- package/lib/esm/components/c4-toggle/c4-toggle.js +6 -8
- package/lib/esm/components/c4-tutorial-tile/c4-tutorial-tile.js +1 -1
- package/lib/esm/components/c4-usage-alert-update-modal/c4-usage-alert-update-modal.js +4 -2
- package/lib/esm/components/c4-usage-history/c4-usage-history.js +5 -3
- package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +1 -1
- package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +8 -7
- package/lib/esm/components/c4-user-details/c4-user-details.js +2 -2
- package/lib/esm/components/c4-user-details/tabs/authorized-resources.js +1 -1
- package/lib/esm/components/c4-user-details/tabs/details.js +6 -10
- package/lib/esm/components/c4-user-details/tabs/roles.js +3 -8
- package/lib/esm/i18n/c4-console-i18n.js +12 -0
- package/lib/esm/i18n/en/modals/clusters.json +0 -8
- package/lib/esm/i18n/en/pages/clusterdetails.json +5 -1
- package/lib/esm/i18n/en/pages/clusters.json +5 -1
- package/lib/esm/i18n/en/pages/orgmanagement.json +3 -1
- package/lib/esm/index.d.ts +17 -0
- package/lib/esm/index.js +13 -0
- package/lib/esm/runtime/c4-console-authz.d.ts +1 -0
- package/lib/esm/runtime/c4-console-authz.js +2 -1
- package/lib/esm/runtime/c4-console-authz.spec.js +3 -3
- package/lib/esm/runtime/c4-console-runtime-context.d.ts +8 -1
- package/lib/esm/runtime/c4-console-runtime-context.js +50 -1
- package/lib/esm/runtime/c4-console-runtime.types.d.ts +8 -0
- package/lib/esm/ui/c4-modal-dialog.d.ts +14 -0
- package/lib/esm/ui/c4-modal-dialog.js +35 -0
- package/lib/esm/ui/families.d.ts +42 -0
- package/lib/esm/ui/families.js +46 -0
- package/lib/esm/ui/index.d.ts +31 -0
- package/lib/esm/ui/index.js +94 -0
- package/lib/esm/ui/switchable.d.ts +14 -0
- package/lib/esm/ui/switchable.js +27 -0
- package/lib/esm/ui/tabs.d.ts +21 -0
- package/lib/esm/ui/tabs.js +27 -0
- package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +7 -5
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +18 -3
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +1 -1
- package/lib/esm/widgets/cluster-details/c4-cluster-details-page.spec.js +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +10 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +5 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +7 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +10 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.d.ts +7 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +8 -3
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.spec.js +49 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +7 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +54 -21
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +96 -5
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +12 -9
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +58 -4
- package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.js +276 -40
- package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +220 -0
- package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +3 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +1 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +3 -2
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts +4 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +59 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.d.ts +18 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.js +6 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-page.d.ts +1 -1
- package/lib/esm/widgets/connector-management/c4-connector-management-page.js +38 -5
- package/lib/esm/widgets/connector-management/c4-connector-management-page.spec.js +54 -0
- package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +11 -0
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.d.ts +1 -0
- package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +10 -2
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
- package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +14 -2
- package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +57 -4
- package/lib/esm/widgets/management/c4-management-app.spec.js +141 -1
- package/lib/esm/widgets/management/c4-management-app.types.d.ts +5 -0
- package/lib/esm/widgets/management/c4-management-page.js +1 -6
- package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +4 -2
- package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-overview-tab.d.ts +2 -1
- package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +10 -3
- package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +2 -1
- package/lib/esm/widgets/management/tabs/c4-management-settings-tab.js +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +1 -1
- package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +13 -11
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +47 -5
- package/lib/esm/widgets/management/tabs/c4-management-users-tab.spec.js +98 -0
- package/lib/esm/widgets/use-extend-trial.d.ts +8 -0
- package/lib/esm/widgets/use-extend-trial.js +36 -0
- package/lib/esm/widgets/use-extend-trial.spec.d.ts +1 -0
- package/lib/esm/widgets/use-extend-trial.spec.js +79 -0
- package/lib/esm/widgets/user-details/c4-user-details-page.js +5 -4
- package/package.json +21 -14
package/lib/esm/index.d.ts
CHANGED
|
@@ -83,14 +83,24 @@ export { C4CreateTrialOrganizationModal } from './components/c4-create-trial-org
|
|
|
83
83
|
export type { C4CreateTrialOrganizationModalProps, C4LegacyModalError, } from './components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.types';
|
|
84
84
|
export { C4DashboardFirstLaunch } from './components/c4-dashboard-first-launch/c4-dashboard-first-launch';
|
|
85
85
|
export type { C4DashboardFirstLaunchProps } from './components/c4-dashboard-first-launch/c4-dashboard-first-launch.types';
|
|
86
|
+
export { C4DataTable } from './components/c4-data-table/c4-data-table';
|
|
87
|
+
export { C4DataTableSkeleton } from './components/c4-data-table/c4-data-table-skeleton';
|
|
86
88
|
export { C4DeleteOrganizationModal } from './components/c4-delete-organization-modal/c4-delete-organization-modal';
|
|
87
89
|
export type { C4DeleteOrganizationModalProps } from './components/c4-delete-organization-modal/c4-delete-organization-modal.types';
|
|
88
90
|
export { C4Divider } from './components/c4-divider/c4-divider';
|
|
89
91
|
export type { C4DividerProps } from './components/c4-divider/c4-divider.types';
|
|
92
|
+
export { C4EmptyState, type C4EmptyStateProps, } from './components/c4-empty-state/c4-empty-state';
|
|
93
|
+
export { C4ExtendTrialModal } from './components/c4-extend-trial-modal/c4-extend-trial-modal';
|
|
94
|
+
export type { C4ExtendTrialModalProps } from './components/c4-extend-trial-modal/c4-extend-trial-modal.types';
|
|
90
95
|
export { C4ExternalLink } from './components/c4-external-link/c4-external-link';
|
|
91
96
|
export type { C4ExternalLinkProps } from './components/c4-external-link/c4-external-link.types';
|
|
97
|
+
export type { C4FeedbackFormProps, C4FeedbackModalProps, C4FeedbackPayload, C4FeedbackReportType, } from './components/c4-feedback-modal/c4-feedback-modal';
|
|
98
|
+
export { C4FeedbackForm, C4FeedbackModal, } from './components/c4-feedback-modal/c4-feedback-modal';
|
|
99
|
+
export type { C4HelpCenterData, C4HelpCenterLink, C4HelpCenterProps, C4HelpCenterTabData, C4HelpCenterTile, } from './components/c4-help-center/c4-help-center';
|
|
100
|
+
export { C4HelpCenter, FEEDBACK_TAB_ID, } from './components/c4-help-center/c4-help-center';
|
|
92
101
|
export { C4InfoTooltip } from './components/c4-info-tooltip/c4-info-tooltip';
|
|
93
102
|
export type { C4InfoTooltipProps } from './components/c4-info-tooltip/c4-info-tooltip.types';
|
|
103
|
+
export { C4InlineNotification } from './components/c4-inline-notification/c4-inline-notification';
|
|
94
104
|
export { C4InviteUserToOrganizationModal } from './components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal';
|
|
95
105
|
export type { C4InviteUserToOrganizationModalHandle, C4InviteUserToOrganizationModalOpenParams, C4InviteUserToOrganizationModalProps, C4InviteUserToOrganizationRole, } from './components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.types';
|
|
96
106
|
export { C4JobDashboardDetailsPage } from './components/c4-job-dashboard-details-page/c4-job-dashboard-details-page';
|
|
@@ -119,12 +129,14 @@ export { C4MultiStepModal } from './components/c4-multi-step-modal/c4-multi-step
|
|
|
119
129
|
export type { C4MultiStepModalProps } from './components/c4-multi-step-modal/c4-multi-step-modal.types';
|
|
120
130
|
export { C4MultiStepUglyModal } from './components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly';
|
|
121
131
|
export type { C4MultiStepUglyModalProps } from './components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.types';
|
|
132
|
+
export { C4Navigation, type C4NavigationProps, } from './components/c4-navigation/c4-navigation';
|
|
122
133
|
export { C4NumberInput } from './components/c4-number-input/c4-number-input';
|
|
123
134
|
export type { C4NumberInputProps } from './components/c4-number-input/c4-number-input.types';
|
|
124
135
|
export { C4OldDashboard } from './components/c4-old-dashboard/c4-old-dashboard';
|
|
125
136
|
export type { C4OldDashboardProps } from './components/c4-old-dashboard/c4-old-dashboard.types';
|
|
126
137
|
export { C4OptimizeActivationModal } from './components/c4-optimize-activation-modal/c4-optimize-activation-modal';
|
|
127
138
|
export type { C4OptimizeActivationModalProps } from './components/c4-optimize-activation-modal/c4-optimize-activation-modal.types';
|
|
139
|
+
export { C4PageLayout } from './components/c4-page-layout/c4-page-layout';
|
|
128
140
|
export { C4PageTemplate } from './components/c4-page-template/c4-page-template';
|
|
129
141
|
export { C4PermissionErrorPage } from './components/c4-permission-error-page/c4-permission-error-page';
|
|
130
142
|
export type { C4PermissionErrorPageProps } from './components/c4-permission-error-page/c4-permission-error-page.types';
|
|
@@ -148,6 +160,7 @@ export { C4Stat } from './components/c4-stat/c4-stat';
|
|
|
148
160
|
export type { C4StatProps } from './components/c4-stat/c4-stat.types';
|
|
149
161
|
export { C4StatefulButton } from './components/c4-stateful-button/c4-stateful-button';
|
|
150
162
|
export type { C4StatefulButtonProps } from './components/c4-stateful-button/c4-stateful-button.types';
|
|
163
|
+
export { C4StructuredListBody, C4StructuredListCell, C4StructuredListHead, C4StructuredListRow, C4StructuredListSkeleton, C4StructuredListWrapper, } from './components/c4-structured-list/c4-structured-list';
|
|
151
164
|
export { C4Tabs } from './components/c4-tabs/c4-tabs';
|
|
152
165
|
export type { C4TabProps, C4TabsProps, } from './components/c4-tabs/c4-tabs.types';
|
|
153
166
|
export { C4TelemetryPage } from './components/c4-telemetry-page/c4-telemetry-page';
|
|
@@ -158,6 +171,7 @@ export { C4ThemeSwitcher } from './components/c4-theme-switcher/c4-theme-switche
|
|
|
158
171
|
export type { C4ThemeSwitcherProps, ThemeMode, } from './components/c4-theme-switcher/c4-theme-switcher.types';
|
|
159
172
|
export { C4TileWithTitleAndAction } from './components/c4-tile-with-title-and-action/c4-tile-with-title-and-action';
|
|
160
173
|
export type { C4TileWithTitleAndActionProps } from './components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.types';
|
|
174
|
+
export { C4ToastNotification } from './components/c4-toast-notification/c4-toast-notification';
|
|
161
175
|
export { C4Toggle } from './components/c4-toggle/c4-toggle';
|
|
162
176
|
export type { C4ToggleProps } from './components/c4-toggle/c4-toggle.types';
|
|
163
177
|
export { C4TutorialTile } from './components/c4-tutorial-tile/c4-tutorial-tile';
|
|
@@ -202,6 +216,8 @@ export { C4ConnectorManagementExecutableDetailsPage } from './widgets/connector-
|
|
|
202
216
|
export type { C4ConnectorManagementExecutableDetailsNavigateEvent, C4ConnectorManagementExecutableDetailsPageProps, } from './widgets/connector-management/c4-connector-management-executable-details-page.types';
|
|
203
217
|
export { C4ConnectorManagementExecutablesTablePage } from './widgets/connector-management/c4-connector-management-executables-table-page';
|
|
204
218
|
export type { C4ConnectorManagementExecutablesTableNavigateEvent, C4ConnectorManagementExecutablesTablePageProps, } from './widgets/connector-management/c4-connector-management-executables-table-page.types';
|
|
219
|
+
export { C4ConnectorManagementOutboundDetailsPage } from './widgets/connector-management/c4-connector-management-outbound-details-page';
|
|
220
|
+
export type { C4ConnectorManagementOutboundDetailsNavigateEvent, C4ConnectorManagementOutboundDetailsPageProps, } from './widgets/connector-management/c4-connector-management-outbound-details-page.types';
|
|
205
221
|
export { C4ConnectorManagementPage } from './widgets/connector-management/c4-connector-management-page';
|
|
206
222
|
export type { C4ConnectorManagementNavigateEvent, C4ConnectorManagementPageProps, } from './widgets/connector-management/c4-connector-management-page.types';
|
|
207
223
|
export { C4CreateClusterPage } from './widgets/create-cluster/c4-create-cluster-page';
|
|
@@ -217,5 +233,6 @@ export { C4ManagementApp } from './widgets/management/c4-management-app';
|
|
|
217
233
|
export type { C4ManagementAppProps, C4ManagementNavigateEvent, } from './widgets/management/c4-management-app.types';
|
|
218
234
|
export { C4ManagementPage } from './widgets/management/c4-management-page';
|
|
219
235
|
export type { C4ManagementPageProps, C4ManagementTab, } from './widgets/management/c4-management-page.types';
|
|
236
|
+
export { useExtendTrial } from './widgets/use-extend-trial';
|
|
220
237
|
export { C4UserDetailsPage } from './widgets/user-details/c4-user-details-page';
|
|
221
238
|
export type { C4UserDetailsExternalLinks, C4UserDetailsNavigateEvent, C4UserDetailsPageProps, } from './widgets/user-details/c4-user-details-page.types';
|
package/lib/esm/index.js
CHANGED
|
@@ -45,10 +45,17 @@ export { C4CreateConnectorSecretModal } from './components/c4-create-connector-s
|
|
|
45
45
|
export { C4CreateConsoleApiClientModal } from './components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js';
|
|
46
46
|
export { C4CreateTrialOrganizationModal } from './components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js';
|
|
47
47
|
export { C4DashboardFirstLaunch } from './components/c4-dashboard-first-launch/c4-dashboard-first-launch.js';
|
|
48
|
+
export { C4DataTable } from './components/c4-data-table/c4-data-table.js';
|
|
49
|
+
export { C4DataTableSkeleton } from './components/c4-data-table/c4-data-table-skeleton.js';
|
|
48
50
|
export { C4DeleteOrganizationModal } from './components/c4-delete-organization-modal/c4-delete-organization-modal.js';
|
|
49
51
|
export { C4Divider } from './components/c4-divider/c4-divider.js';
|
|
52
|
+
export { C4EmptyState, } from './components/c4-empty-state/c4-empty-state.js';
|
|
53
|
+
export { C4ExtendTrialModal } from './components/c4-extend-trial-modal/c4-extend-trial-modal.js';
|
|
50
54
|
export { C4ExternalLink } from './components/c4-external-link/c4-external-link.js';
|
|
55
|
+
export { C4FeedbackForm, C4FeedbackModal, } from './components/c4-feedback-modal/c4-feedback-modal.js';
|
|
56
|
+
export { C4HelpCenter, FEEDBACK_TAB_ID, } from './components/c4-help-center/c4-help-center.js';
|
|
51
57
|
export { C4InfoTooltip } from './components/c4-info-tooltip/c4-info-tooltip.js';
|
|
58
|
+
export { C4InlineNotification } from './components/c4-inline-notification/c4-inline-notification.js';
|
|
52
59
|
export { C4InviteUserToOrganizationModal } from './components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js';
|
|
53
60
|
export { C4JobDashboardDetailsPage } from './components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js';
|
|
54
61
|
export { C4JobDashboardOverviewPage } from './components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js';
|
|
@@ -63,9 +70,11 @@ export { C4ManagementSettings } from './components/c4-management-settings/c4-man
|
|
|
63
70
|
export { C4ManagementUsers } from './components/c4-management-users/c4-management-users.js';
|
|
64
71
|
export { C4MultiStepModal } from './components/c4-multi-step-modal/c4-multi-step-modal.js';
|
|
65
72
|
export { C4MultiStepUglyModal } from './components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js';
|
|
73
|
+
export { C4Navigation, } from './components/c4-navigation/c4-navigation.js';
|
|
66
74
|
export { C4NumberInput } from './components/c4-number-input/c4-number-input.js';
|
|
67
75
|
export { C4OldDashboard } from './components/c4-old-dashboard/c4-old-dashboard.js';
|
|
68
76
|
export { C4OptimizeActivationModal } from './components/c4-optimize-activation-modal/c4-optimize-activation-modal.js';
|
|
77
|
+
export { C4PageLayout } from './components/c4-page-layout/c4-page-layout.js';
|
|
69
78
|
export { C4PageTemplate } from './components/c4-page-template/c4-page-template.js';
|
|
70
79
|
export { C4PermissionErrorPage } from './components/c4-permission-error-page/c4-permission-error-page.js';
|
|
71
80
|
export { C4Pricing } from './components/c4-pricing/c4-pricing.js';
|
|
@@ -78,11 +87,13 @@ export { C4SmDashboard } from './components/c4-sm-dashboard/c4-sm-dashboard.js';
|
|
|
78
87
|
export { C4StackDriverLinks } from './components/c4-stackdriver-links/c4-stackdriver-links.js';
|
|
79
88
|
export { C4Stat } from './components/c4-stat/c4-stat.js';
|
|
80
89
|
export { C4StatefulButton } from './components/c4-stateful-button/c4-stateful-button.js';
|
|
90
|
+
export { C4StructuredListBody, C4StructuredListCell, C4StructuredListHead, C4StructuredListRow, C4StructuredListSkeleton, C4StructuredListWrapper, } from './components/c4-structured-list/c4-structured-list.js';
|
|
81
91
|
export { C4Tabs } from './components/c4-tabs/c4-tabs.js';
|
|
82
92
|
export { C4TelemetryPage } from './components/c4-telemetry-page/c4-telemetry-page.js';
|
|
83
93
|
export { C4TelemetryTeaserPage } from './components/c4-telemetry-teaser-page/c4-telemetry-teaser-page.js';
|
|
84
94
|
export { C4ThemeSwitcher } from './components/c4-theme-switcher/c4-theme-switcher.js';
|
|
85
95
|
export { C4TileWithTitleAndAction } from './components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js';
|
|
96
|
+
export { C4ToastNotification } from './components/c4-toast-notification/c4-toast-notification.js';
|
|
86
97
|
export { C4Toggle } from './components/c4-toggle/c4-toggle.js';
|
|
87
98
|
export { C4TutorialTile } from './components/c4-tutorial-tile/c4-tutorial-tile.js';
|
|
88
99
|
export { C4UsageAlertUpdateModal } from './components/c4-usage-alert-update-modal/c4-usage-alert-update-modal.js';
|
|
@@ -108,6 +119,7 @@ export { C4ClusterDetailsPage } from './widgets/cluster-details/c4-cluster-detai
|
|
|
108
119
|
export { C4ClustersPage } from './widgets/clusters/c4-clusters-page.js';
|
|
109
120
|
export { C4ConnectorManagementExecutableDetailsPage } from './widgets/connector-management/c4-connector-management-executable-details-page.js';
|
|
110
121
|
export { C4ConnectorManagementExecutablesTablePage } from './widgets/connector-management/c4-connector-management-executables-table-page.js';
|
|
122
|
+
export { C4ConnectorManagementOutboundDetailsPage } from './widgets/connector-management/c4-connector-management-outbound-details-page.js';
|
|
111
123
|
export { C4ConnectorManagementPage } from './widgets/connector-management/c4-connector-management-page.js';
|
|
112
124
|
export { C4CreateClusterPage } from './widgets/create-cluster/c4-create-cluster-page.js';
|
|
113
125
|
export { C4DashboardApp } from './widgets/dashboard/c4-dashboard-app.js';
|
|
@@ -116,4 +128,5 @@ export { C4JobWorkerDetailsPage } from './widgets/job-worker/c4-job-worker-detai
|
|
|
116
128
|
export { C4JobWorkerOverviewPage } from './widgets/job-worker/c4-job-worker-overview-page.js';
|
|
117
129
|
export { C4ManagementApp } from './widgets/management/c4-management-app.js';
|
|
118
130
|
export { C4ManagementPage } from './widgets/management/c4-management-page.js';
|
|
131
|
+
export { useExtendTrial } from './widgets/use-extend-trial.js';
|
|
119
132
|
export { C4UserDetailsPage } from './widgets/user-details/c4-user-details-page.js';
|
|
@@ -122,7 +122,7 @@ export function deriveConsoleAuthzFromAccessToken(params) {
|
|
|
122
122
|
canDelete: canDeleteFromOrgPermissions ?? clusters.canDeleteAllClusters,
|
|
123
123
|
// Users must be able to resume auto-suspended clusters via org access.
|
|
124
124
|
// Internal manual sleep stays token-scoped via canSleep.
|
|
125
|
-
canWake: Boolean(canWakeFromOrgPermissions
|
|
125
|
+
canWake: Boolean(canWakeFromOrgPermissions),
|
|
126
126
|
canSleep: clusters.canSendToSleep,
|
|
127
127
|
canEdit: canEditFromOrgPermissions ??
|
|
128
128
|
(clusters.canOverrideEnvVars ||
|
|
@@ -134,6 +134,7 @@ export function deriveConsoleAuthzFromAccessToken(params) {
|
|
|
134
134
|
// Backport behavior exposed cluster load to org members with cluster
|
|
135
135
|
// read access, while still allowing token-scoped internal access.
|
|
136
136
|
canSeeClusterLoad: canSeeClusterLoadFromOrgPermissions ?? clusters.canReadAllClusterInfo,
|
|
137
|
+
canFailover: canCreateFromOrgPermissions ?? clusters.createOnBehalf,
|
|
137
138
|
},
|
|
138
139
|
};
|
|
139
140
|
return {
|
|
@@ -99,11 +99,11 @@ describe('deriveConsoleAuthzFromAccessToken', () => {
|
|
|
99
99
|
expect(result.visibilities.clusters?.canDelete).toBe(false);
|
|
100
100
|
expect(result.visibilities.clusters?.canEdit).toBe(false);
|
|
101
101
|
expect(result.visibilities.clusters?.canUpdateTag).toBe(false);
|
|
102
|
-
expect(result.visibilities.clusters?.canWake).toBe(
|
|
102
|
+
expect(result.visibilities.clusters?.canWake).toBe(false);
|
|
103
103
|
expect(result.visibilities.clusters?.canSleep).toBe(true);
|
|
104
104
|
expect(result.visibilities.clusters?.canSeeClusterLoad).toBe(true);
|
|
105
105
|
});
|
|
106
|
-
it('falls back to global token permissions when org permissions are unavailable', () => {
|
|
106
|
+
it('falls back to global token permissions for non-wake actions when org permissions are unavailable', () => {
|
|
107
107
|
const token = makeFakeJwt({
|
|
108
108
|
permissions: [
|
|
109
109
|
ConsolePermissions.CLUSTERS_DELETE_CLUSTER,
|
|
@@ -120,7 +120,7 @@ describe('deriveConsoleAuthzFromAccessToken', () => {
|
|
|
120
120
|
expect(result.visibilities.clusters?.canDelete).toBe(true);
|
|
121
121
|
expect(result.visibilities.clusters?.canEdit).toBe(true);
|
|
122
122
|
expect(result.visibilities.clusters?.canUpdateTag).toBe(true);
|
|
123
|
-
expect(result.visibilities.clusters?.canWake).toBe(
|
|
123
|
+
expect(result.visibilities.clusters?.canWake).toBe(false);
|
|
124
124
|
expect(result.visibilities.clusters?.canSleep).toBe(true);
|
|
125
125
|
});
|
|
126
126
|
it('is safe on invalid tokens', () => {
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { C4ConsoleRuntimeConfig } from './c4-console-runtime.types';
|
|
2
|
+
import type { C4ConsoleRuntimeConfig, C4DesignSystem } from './c4-console-runtime.types';
|
|
3
3
|
export interface C4ConsoleRuntimeProviderProps {
|
|
4
4
|
config: C4ConsoleRuntimeConfig;
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
}
|
|
7
7
|
export declare const C4ConsoleRuntimeProvider: ({ config, children, }: C4ConsoleRuntimeProviderProps) => React.JSX.Element;
|
|
8
8
|
export declare const useC4ConsoleRuntime: () => C4ConsoleRuntimeConfig;
|
|
9
|
+
/**
|
|
10
|
+
* Which UI library c4 components should render through. Non-throwing and
|
|
11
|
+
* provider-optional: defaults to 'carbon' when no runtime provider is present
|
|
12
|
+
* (tests, Storybook) or when the consumer hasn't opted in. Consumers opt into
|
|
13
|
+
* the Design System by setting `designSystem: 'ds'` on the runtime config.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useC4DesignSystem: () => C4DesignSystem;
|
|
@@ -1,7 +1,47 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext } from 'react';
|
|
2
|
+
import { createContext, useContext, useEffect } from 'react';
|
|
3
3
|
const RuntimeContext = createContext(undefined);
|
|
4
|
+
// Carbon dark theme names (set by c3 on <html data-carbon-theme>).
|
|
5
|
+
const CARBON_DARK_THEMES = new Set(['g90', 'g100']);
|
|
6
|
+
/**
|
|
7
|
+
* Bridges the host's Carbon color mode to the Design System.
|
|
8
|
+
*
|
|
9
|
+
* c3 sets `data-carbon-theme` on `<html>`; the DS reads dark mode from a
|
|
10
|
+
* `.dark` class on `<html>` (the `.dark .c4-ui` token block). Without this,
|
|
11
|
+
* toggling the theme re-themes Carbon but leaves DS components light. While
|
|
12
|
+
* the consumer is in `designSystem: 'ds'`, mirror the Carbon theme onto the
|
|
13
|
+
* `.dark` class so DS tokens follow the toggle. No-op in 'carbon' mode.
|
|
14
|
+
*/
|
|
15
|
+
function useSyncCarbonThemeToDesignSystem(designSystem) {
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (designSystem !== 'ds' || typeof document === 'undefined') {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const html = document.documentElement;
|
|
21
|
+
// Marks the document as design-system mode so the consumer's coexistence
|
|
22
|
+
// CSS can remap Carbon `--cds-*` tokens to DS values (see c4-ui.css). Lives
|
|
23
|
+
// on <html> — the same element carrying `data-carbon-theme` — so the remap
|
|
24
|
+
// wins the cascade without `!important`.
|
|
25
|
+
html.classList.add('c4-ds');
|
|
26
|
+
const sync = () => {
|
|
27
|
+
const carbonTheme = html.getAttribute('data-carbon-theme');
|
|
28
|
+
html.classList.toggle('dark', carbonTheme != null && CARBON_DARK_THEMES.has(carbonTheme));
|
|
29
|
+
};
|
|
30
|
+
sync();
|
|
31
|
+
const observer = new MutationObserver(sync);
|
|
32
|
+
observer.observe(html, {
|
|
33
|
+
attributes: true,
|
|
34
|
+
attributeFilter: ['data-carbon-theme'],
|
|
35
|
+
});
|
|
36
|
+
return () => {
|
|
37
|
+
observer.disconnect();
|
|
38
|
+
html.classList.remove('dark');
|
|
39
|
+
html.classList.remove('c4-ds');
|
|
40
|
+
};
|
|
41
|
+
}, [designSystem]);
|
|
42
|
+
}
|
|
4
43
|
export const C4ConsoleRuntimeProvider = ({ config, children, }) => {
|
|
44
|
+
useSyncCarbonThemeToDesignSystem(config.designSystem ?? 'carbon');
|
|
5
45
|
return (_jsx(RuntimeContext.Provider, { value: config, children: children }));
|
|
6
46
|
};
|
|
7
47
|
export const useC4ConsoleRuntime = () => {
|
|
@@ -11,3 +51,12 @@ export const useC4ConsoleRuntime = () => {
|
|
|
11
51
|
}
|
|
12
52
|
return runtime;
|
|
13
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Which UI library c4 components should render through. Non-throwing and
|
|
56
|
+
* provider-optional: defaults to 'carbon' when no runtime provider is present
|
|
57
|
+
* (tests, Storybook) or when the consumer hasn't opted in. Consumers opt into
|
|
58
|
+
* the Design System by setting `designSystem: 'ds'` on the runtime config.
|
|
59
|
+
*/
|
|
60
|
+
export const useC4DesignSystem = () => {
|
|
61
|
+
return useContext(RuntimeContext)?.designSystem ?? 'carbon';
|
|
62
|
+
};
|
|
@@ -28,8 +28,16 @@ export interface ConsoleClickwrapConfig {
|
|
|
28
28
|
accessId: string;
|
|
29
29
|
betaGroupKey?: string;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Selects which UI library c4 components render through.
|
|
33
|
+
* - 'carbon' (default): existing Carbon components, unchanged.
|
|
34
|
+
* - 'ds': Camunda Design System via carbon-compat adapters.
|
|
35
|
+
* Lets each c4 consumer decide when to switch; see packages/c4/src/ui.
|
|
36
|
+
*/
|
|
37
|
+
export type C4DesignSystem = 'carbon' | 'ds';
|
|
31
38
|
export interface C4ConsoleRuntimeConfig {
|
|
32
39
|
stage: ConsoleStage;
|
|
40
|
+
designSystem?: C4DesignSystem;
|
|
33
41
|
auth: ConsoleAuth;
|
|
34
42
|
backendUrls: ConsoleBackendUrls;
|
|
35
43
|
publicUrls?: ConsolePublicUrls;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Modal as CarbonModal } from '@carbon/react';
|
|
2
|
+
import type { ComponentProps, JSX } from 'react';
|
|
3
|
+
type CarbonModalProps = ComponentProps<typeof CarbonModal>;
|
|
4
|
+
/**
|
|
5
|
+
* Carbon `Modal` API → DS `Dialog`.
|
|
6
|
+
*
|
|
7
|
+
* The ds branch of the `../ui` `Modal` switch: call sites keep the Carbon Modal
|
|
8
|
+
* prop API (modalHeading / primary+secondaryButtonText / onRequestClose /
|
|
9
|
+
* onRequestSubmit / danger / size / preventCloseOnClickOutside / passiveModal),
|
|
10
|
+
* and this renders the DS Dialog composition. Carbon mode renders Carbon Modal
|
|
11
|
+
* unchanged (see ui/index.ts).
|
|
12
|
+
*/
|
|
13
|
+
export declare function C4ModalDialog(props: CarbonModalProps): JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
4
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
5
|
+
* You may not use this file except in compliance with the commercial license.
|
|
6
|
+
*/
|
|
7
|
+
import { Button, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@camunda/design-system';
|
|
8
|
+
// Carbon Modal `size` → DS DialogContent max-width.
|
|
9
|
+
const SIZE_CLASS = {
|
|
10
|
+
xs: 'sm:max-w-sm',
|
|
11
|
+
sm: 'sm:max-w-md',
|
|
12
|
+
md: 'sm:max-w-lg',
|
|
13
|
+
lg: 'sm:max-w-3xl',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Carbon `Modal` API → DS `Dialog`.
|
|
17
|
+
*
|
|
18
|
+
* The ds branch of the `../ui` `Modal` switch: call sites keep the Carbon Modal
|
|
19
|
+
* prop API (modalHeading / primary+secondaryButtonText / onRequestClose /
|
|
20
|
+
* onRequestSubmit / danger / size / preventCloseOnClickOutside / passiveModal),
|
|
21
|
+
* and this renders the DS Dialog composition. Carbon mode renders Carbon Modal
|
|
22
|
+
* unchanged (see ui/index.ts).
|
|
23
|
+
*/
|
|
24
|
+
export function C4ModalDialog(props) {
|
|
25
|
+
const { open, modalHeading, modalLabel, primaryButtonText, secondaryButtonText, primaryButtonDisabled, onRequestClose, onRequestSubmit, danger, size, preventCloseOnClickOutside, passiveModal, loadingStatus, id, children, } = props;
|
|
26
|
+
const close = (event) => onRequestClose?.(event);
|
|
27
|
+
const showFooter = !passiveModal &&
|
|
28
|
+
(Boolean(primaryButtonText) || Boolean(secondaryButtonText));
|
|
29
|
+
return (_jsx(Dialog, { open: open ?? true, onOpenChange: (next) => {
|
|
30
|
+
if (!next)
|
|
31
|
+
close();
|
|
32
|
+
}, children: _jsxs(DialogContent, { id: id, className: SIZE_CLASS[size ?? 'md'] ?? SIZE_CLASS.md, onInteractOutside: preventCloseOnClickOutside
|
|
33
|
+
? (event) => event.preventDefault()
|
|
34
|
+
: undefined, children: [(modalHeading || modalLabel) && (_jsxs(DialogHeader, { children: [modalLabel ? (_jsx(DialogDescription, { children: modalLabel })) : undefined, modalHeading ? (_jsx(DialogTitle, { children: modalHeading })) : undefined] })), children, showFooter && (_jsxs(DialogFooter, { children: [secondaryButtonText ? (_jsx(Button, { variant: 'secondary', onClick: () => close(), children: secondaryButtonText })) : undefined, primaryButtonText ? (_jsx(Button, { variant: danger ? 'destructive' : 'default', disabled: primaryButtonDisabled || loadingStatus === 'active', onClick: (event) => onRequestSubmit?.(event), children: primaryButtonText })) : undefined] }))] }) }));
|
|
35
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const useRadioFamily: () => {
|
|
2
|
+
RadioButton: import("react").ForwardRefExoticComponent<import("@carbon/react").RadioButtonProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
3
|
+
RadioButtonGroup: import("react").ForwardRefExoticComponent<import("@carbon/react").RadioButtonGroupProps & import("react").RefAttributes<unknown>>;
|
|
4
|
+
};
|
|
5
|
+
export declare const useSelectFamily: () => {
|
|
6
|
+
Select: import("react").ForwardRefExoticComponent<Omit<import("@carbon/react").SelectProps, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
7
|
+
SelectItem: {
|
|
8
|
+
({ className, value, disabled, hidden, text, ...other }: import("@carbon/react").SelectItemProps): import("react").JSX.Element;
|
|
9
|
+
propTypes: {
|
|
10
|
+
className: import("prop-types").Requireable<string>;
|
|
11
|
+
disabled: import("prop-types").Requireable<boolean>;
|
|
12
|
+
hidden: import("prop-types").Requireable<boolean>;
|
|
13
|
+
text: import("prop-types").Validator<string>;
|
|
14
|
+
value: import("prop-types").Validator<any>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const useContentSwitcherFamily: () => {
|
|
19
|
+
ContentSwitcher: {
|
|
20
|
+
({ children, className, light, lowContrast, selectedIndex: selectedIndexProp, selectionMode, size, onChange, ...other }: import("@carbon/react").ContentSwitcherProps): import("react").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
propTypes: {
|
|
23
|
+
children: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
24
|
+
className: import("prop-types").Requireable<string>;
|
|
25
|
+
light: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
|
|
26
|
+
lowContrast: import("prop-types").Requireable<boolean>;
|
|
27
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
28
|
+
selectedIndex: import("prop-types").Requireable<number>;
|
|
29
|
+
selectionMode: import("prop-types").Requireable<string>;
|
|
30
|
+
size: import("prop-types").Requireable<string>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
Switch: import("react").ForwardRefExoticComponent<import("@carbon/react").SwitchProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
34
|
+
};
|
|
35
|
+
export declare const useMenuButtonFamily: () => {
|
|
36
|
+
MenuButton: import("react").ForwardRefExoticComponent<Omit<import("@carbon/react").MenuButtonProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
37
|
+
MenuItem: import("react").ForwardRefExoticComponent<import("@carbon/react").MenuItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
38
|
+
};
|
|
39
|
+
export declare const useBreadcrumbFamily: () => {
|
|
40
|
+
Breadcrumb: import("react").ForwardRefExoticComponent<import("@carbon/react").BreadcrumbProps & import("react").RefAttributes<HTMLElement>>;
|
|
41
|
+
BreadcrumbItem: import("react").ForwardRefExoticComponent<import("@carbon/react").BreadcrumbItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
42
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
+
* You may not use this file except in compliance with the commercial license.
|
|
5
|
+
*/
|
|
6
|
+
import { Breadcrumb as DsBreadcrumb, BreadcrumbItem as DsBreadcrumbItem, ContentSwitcher as DsContentSwitcher, MenuButton as DsMenuButton, MenuItem as DsMenuItem, RadioButton as DsRadioButton, RadioButtonGroup as DsRadioButtonGroup, Select as DsSelect, SelectItem as DsSelectItem, Switch as DsSwitch, } from '@camunda/design-system/carbon-compat';
|
|
7
|
+
import { Breadcrumb as CarbonBreadcrumb, BreadcrumbItem as CarbonBreadcrumbItem, ContentSwitcher as CarbonContentSwitcher, MenuButton as CarbonMenuButton, MenuItem as CarbonMenuItem, RadioButton as CarbonRadioButton, RadioButtonGroup as CarbonRadioButtonGroup, Select as CarbonSelect, SelectItem as CarbonSelectItem, Switch as CarbonSwitch, } from '@carbon/react';
|
|
8
|
+
import { useC4DesignSystem } from '../runtime/c4-console-runtime-context.js';
|
|
9
|
+
/**
|
|
10
|
+
* Compound-family switching for c4.
|
|
11
|
+
*
|
|
12
|
+
* A compound family (parent + children the parent coordinates by
|
|
13
|
+
* identity/context) can't be switched symbol-by-symbol — mixing a Carbon parent
|
|
14
|
+
* with DS children (or vice versa) breaks selection. Each `useXFamily()` hook
|
|
15
|
+
* returns the WHOLE family from one library, chosen by the consumer's
|
|
16
|
+
* `designSystem` flag; callers destructure it and render the same JSX so every
|
|
17
|
+
* member is cohesive within a render. Carbon prop types are exposed so call
|
|
18
|
+
* sites stay unchanged; `as unknown as` bridges the structurally-distinct
|
|
19
|
+
* carbon-compat adapter types (unsupported props degrade in 'ds' mode, never
|
|
20
|
+
* error at the call site).
|
|
21
|
+
*/
|
|
22
|
+
function makeFamily(carbon, ds) {
|
|
23
|
+
return function useFamily() {
|
|
24
|
+
return useC4DesignSystem() === 'ds' ? ds : carbon;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export const useRadioFamily = makeFamily({ RadioButton: CarbonRadioButton, RadioButtonGroup: CarbonRadioButtonGroup }, {
|
|
28
|
+
RadioButton: DsRadioButton,
|
|
29
|
+
RadioButtonGroup: DsRadioButtonGroup,
|
|
30
|
+
});
|
|
31
|
+
export const useSelectFamily = makeFamily({ Select: CarbonSelect, SelectItem: CarbonSelectItem }, {
|
|
32
|
+
Select: DsSelect,
|
|
33
|
+
SelectItem: DsSelectItem,
|
|
34
|
+
});
|
|
35
|
+
export const useContentSwitcherFamily = makeFamily({ ContentSwitcher: CarbonContentSwitcher, Switch: CarbonSwitch }, {
|
|
36
|
+
ContentSwitcher: DsContentSwitcher,
|
|
37
|
+
Switch: DsSwitch,
|
|
38
|
+
});
|
|
39
|
+
export const useMenuButtonFamily = makeFamily({ MenuButton: CarbonMenuButton, MenuItem: CarbonMenuItem }, {
|
|
40
|
+
MenuButton: DsMenuButton,
|
|
41
|
+
MenuItem: DsMenuItem,
|
|
42
|
+
});
|
|
43
|
+
export const useBreadcrumbFamily = makeFamily({ Breadcrumb: CarbonBreadcrumb, BreadcrumbItem: CarbonBreadcrumbItem }, {
|
|
44
|
+
Breadcrumb: DsBreadcrumb,
|
|
45
|
+
BreadcrumbItem: DsBreadcrumbItem,
|
|
46
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FilterableMultiSelect as CarbonFilterableMultiSelect, MultiSelect as CarbonMultiSelect, Tooltip as CarbonTooltip } from '@carbon/react';
|
|
2
|
+
import { type ComponentType } from 'react';
|
|
3
|
+
export declare const Button: ComponentType<import("@camunda/design-system/carbon-compat").ButtonProps<"button">>;
|
|
4
|
+
export declare const Checkbox: ComponentType<import("@carbon/react").CheckboxProps & import("react").RefAttributes<unknown>>;
|
|
5
|
+
export declare const CodeSnippet: ComponentType<import("@camunda/design-system/carbon-compat").CodeSnippetProps>;
|
|
6
|
+
export declare const Dropdown: ComponentType<import("@carbon/react").DropdownProps<unknown> & {
|
|
7
|
+
ref?: import("react").Ref<HTMLButtonElement>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const Link: ComponentType<import("@camunda/design-system/carbon-compat").LinkProps>;
|
|
10
|
+
export declare const Loading: ComponentType<import("@carbon/react").LoadingProps>;
|
|
11
|
+
export declare const Modal: ComponentType<import("@carbon/react").ModalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare const ComposedModal: ComponentType<import("@carbon/react").ComposedModalProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const ModalHeader: ComponentType<import("@carbon/react").ModalHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare const ModalBody: ComponentType<import("@carbon/react").ModalBodyProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const ModalFooter: ComponentType<import("@carbon/react").ModalFooterProps & import("react").RefAttributes<HTMLElement>>;
|
|
16
|
+
export declare const MultiSelect: typeof CarbonMultiSelect;
|
|
17
|
+
export declare const FilterableMultiSelect: typeof CarbonFilterableMultiSelect;
|
|
18
|
+
export declare const ProgressBar: ComponentType<import("@carbon/react").ProgressBarProps>;
|
|
19
|
+
export declare const SkeletonText: ComponentType<import("@carbon/react").SkeletonTextProps>;
|
|
20
|
+
export declare const SkeletonPlaceholder: ComponentType<import("@carbon/react").SkeletonPlaceholderProps>;
|
|
21
|
+
export declare const BreadcrumbSkeleton: ComponentType<import("@carbon/react").BreadcrumbSkeletonProps>;
|
|
22
|
+
export declare const TabsSkeleton: ComponentType<import("@carbon/react/lib/components/Tabs/Tabs.Skeleton").TabsSkeletonProps>;
|
|
23
|
+
export declare const OverflowMenu: ComponentType<import("@carbon/react").OverflowMenuProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export declare const OverflowMenuItem: ComponentType<Omit<import("@carbon/react").OverflowMenuItemProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
25
|
+
export declare const Stack: ComponentType<import("@carbon/react").StackProps & import("react").RefAttributes<HTMLElement>>;
|
|
26
|
+
export declare const Tag: ComponentType<import("@camunda/design-system/carbon-compat").TagProps<"div">>;
|
|
27
|
+
export declare const TextArea: ComponentType<import("@carbon/react").TextAreaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
28
|
+
export declare const TextInput: ComponentType<import("@carbon/react").TextInputProps & import("react").RefAttributes<unknown>>;
|
|
29
|
+
export declare const Tile: ComponentType<import("@carbon/react").TileProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
30
|
+
export declare const Toggle: ComponentType<import("@carbon/react").ToggleProps>;
|
|
31
|
+
export declare const Tooltip: typeof CarbonTooltip;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
+
* You may not use this file except in compliance with the commercial license.
|
|
5
|
+
*/
|
|
6
|
+
/*
|
|
7
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
8
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
9
|
+
*
|
|
10
|
+
* c4 design-system-switchable UI layer.
|
|
11
|
+
*
|
|
12
|
+
* Each component here renders either the Carbon component (`@carbon/react`) or
|
|
13
|
+
* its Camunda Design System adapter (`@camunda/design-system/carbon-compat`),
|
|
14
|
+
* chosen at runtime by the consumer via `designSystem: 'carbon' | 'ds'` on the
|
|
15
|
+
* c4 runtime config (default 'carbon'). This lets each c4 consumer decide when
|
|
16
|
+
* to switch, without duplicating component logic.
|
|
17
|
+
*
|
|
18
|
+
* ONLY standalone *leaf* components belong here. Compound-family members
|
|
19
|
+
* (RadioButton/RadioButtonGroup, Tabs/Tab/TabList/TabPanel, Select/SelectItem,
|
|
20
|
+
* Switch (a ContentSwitcher child), MenuButton/MenuItem, Breadcrumb children,
|
|
21
|
+
* Dropdown) must NOT be routed: Carbon parents detect/clone their children by
|
|
22
|
+
* component identity, and the `switchable` wrapper changes that identity, which
|
|
23
|
+
* breaks state injection (checked/selected). Migrate such families as a whole
|
|
24
|
+
* composite, not symbol-by-symbol.
|
|
25
|
+
*
|
|
26
|
+
* Also excluded: SHIM symbols (render identically in both modes) and prop-gap
|
|
27
|
+
* symbols (Tooltip `autoAlign`, ref-forwarding TextInput/TextArea/Stack,
|
|
28
|
+
* OverflowMenuItem `id`, FilterableMultiSelect item typing).
|
|
29
|
+
*
|
|
30
|
+
* To add a leaf: import the Carbon + carbon-compat versions and wrap with
|
|
31
|
+
* `switchable(...)`, then point the consuming component's import at this module.
|
|
32
|
+
*/
|
|
33
|
+
import { BreadcrumbSkeleton as DsBreadcrumbSkeleton, Button as DsButton, Checkbox as DsCheckbox, CodeSnippet as DsCodeSnippet, ComposedModal as DsComposedModal, Dropdown as DsDropdown, FilterableMultiSelect as DsFilterableMultiSelect, Link as DsLink, Loading as DsLoading, ModalBody as DsModalBody, ModalFooter as DsModalFooter, ModalHeader as DsModalHeader, MultiSelect as DsMultiSelect, OverflowMenu as DsOverflowMenu, OverflowMenuItem as DsOverflowMenuItem, ProgressBar as DsProgressBar, SkeletonPlaceholder as DsSkeletonPlaceholder, SkeletonText as DsSkeletonText, Stack as DsStack, TabsSkeleton as DsTabsSkeleton, Tag as DsTag, TextArea as DsTextArea, TextInput as DsTextInput, Tile as DsTile, Toggle as DsToggle, Tooltip as DsTooltip, } from '@camunda/design-system/carbon-compat';
|
|
34
|
+
import { BreadcrumbSkeleton as CarbonBreadcrumbSkeleton, Button as CarbonButton, Checkbox as CarbonCheckbox, CodeSnippet as CarbonCodeSnippet, ComposedModal as CarbonComposedModal, Dropdown as CarbonDropdown, FilterableMultiSelect as CarbonFilterableMultiSelect, Link as CarbonLink, Loading as CarbonLoading, Modal as CarbonModal, ModalBody as CarbonModalBody, ModalFooter as CarbonModalFooter, ModalHeader as CarbonModalHeader, MultiSelect as CarbonMultiSelect, OverflowMenu as CarbonOverflowMenu, OverflowMenuItem as CarbonOverflowMenuItem, ProgressBar as CarbonProgressBar, SkeletonPlaceholder as CarbonSkeletonPlaceholder, SkeletonText as CarbonSkeletonText, Stack as CarbonStack, TabsSkeleton as CarbonTabsSkeleton, Tag as CarbonTag, TextArea as CarbonTextArea, TextInput as CarbonTextInput, Tile as CarbonTile, Toggle as CarbonToggle, Tooltip as CarbonTooltip, } from '@carbon/react';
|
|
35
|
+
import { createElement } from 'react';
|
|
36
|
+
import { useC4DesignSystem } from '../runtime/c4-console-runtime-context.js';
|
|
37
|
+
import { C4ModalDialog } from './c4-modal-dialog.js';
|
|
38
|
+
import { switchable } from './switchable.js';
|
|
39
|
+
export const Button = switchable(CarbonButton, DsButton);
|
|
40
|
+
export const Checkbox = switchable(CarbonCheckbox, DsCheckbox);
|
|
41
|
+
export const CodeSnippet = switchable(CarbonCodeSnippet, DsCodeSnippet);
|
|
42
|
+
export const Dropdown = switchable(CarbonDropdown, DsDropdown);
|
|
43
|
+
export const Link = switchable(CarbonLink, DsLink);
|
|
44
|
+
export const Loading = switchable(CarbonLoading, DsLoading);
|
|
45
|
+
export const Modal = switchable(CarbonModal, C4ModalDialog);
|
|
46
|
+
export const ComposedModal = switchable(CarbonComposedModal, DsComposedModal);
|
|
47
|
+
export const ModalHeader = switchable(CarbonModalHeader, DsModalHeader);
|
|
48
|
+
export const ModalBody = switchable(CarbonModalBody, DsModalBody);
|
|
49
|
+
export const ModalFooter = switchable(CarbonModalFooter, DsModalFooter);
|
|
50
|
+
// MultiSelect / FilterableMultiSelect are generic over their item type, which
|
|
51
|
+
// the non-generic `switchable` can't carry. Erase to a plain ComponentType for
|
|
52
|
+
// the switch, then restore the Carbon type on the export so call sites keep
|
|
53
|
+
// item-type inference (carbon-compat REMAPs both onto the DS MultiSelect).
|
|
54
|
+
export const MultiSelect = switchable(CarbonMultiSelect, DsMultiSelect);
|
|
55
|
+
export const FilterableMultiSelect = switchable(CarbonFilterableMultiSelect, DsFilterableMultiSelect);
|
|
56
|
+
export const ProgressBar = switchable(CarbonProgressBar, DsProgressBar);
|
|
57
|
+
export const SkeletonText = switchable(CarbonSkeletonText, DsSkeletonText);
|
|
58
|
+
export const SkeletonPlaceholder = switchable(CarbonSkeletonPlaceholder, DsSkeletonPlaceholder);
|
|
59
|
+
export const BreadcrumbSkeleton = switchable(CarbonBreadcrumbSkeleton, DsBreadcrumbSkeleton);
|
|
60
|
+
export const TabsSkeleton = switchable(CarbonTabsSkeleton, DsTabsSkeleton);
|
|
61
|
+
export const OverflowMenu = switchable(CarbonOverflowMenu, DsOverflowMenu);
|
|
62
|
+
// ds drops OverflowMenuItem `id` (carbon-compat maps to DropdownMenuItem which
|
|
63
|
+
// has no id slot) — a test/a11y-hook delta, not a functional break.
|
|
64
|
+
export const OverflowMenuItem = switchable(CarbonOverflowMenuItem, DsOverflowMenuItem);
|
|
65
|
+
export const Stack = switchable(CarbonStack, DsStack);
|
|
66
|
+
export const Tag = switchable(CarbonTag, DsTag);
|
|
67
|
+
export const TextArea = switchable(CarbonTextArea, DsTextArea);
|
|
68
|
+
export const TextInput = switchable(CarbonTextInput, DsTextInput);
|
|
69
|
+
export const Tile = switchable(CarbonTile, DsTile);
|
|
70
|
+
export const Toggle = switchable(CarbonToggle, DsToggle);
|
|
71
|
+
// Carbon Tooltip is generic over its trigger element; erase for the switch then
|
|
72
|
+
// restore the Carbon type so call sites keep props like `align`/`autoAlign`.
|
|
73
|
+
// Carbon mode uses them for positioning; the carbon-compat adapter has no
|
|
74
|
+
// shadcn equivalent and `console.warn`s once per render for each (no dedup), so
|
|
75
|
+
// in ds mode we drop them up front — same render result, no console spam.
|
|
76
|
+
const TOOLTIP_CARBON_ONLY_PROPS = [
|
|
77
|
+
'align',
|
|
78
|
+
'autoAlign',
|
|
79
|
+
'leaveDelayMs',
|
|
80
|
+
'dropShadow',
|
|
81
|
+
'caret',
|
|
82
|
+
];
|
|
83
|
+
function C4Tooltip(props) {
|
|
84
|
+
const designSystem = useC4DesignSystem();
|
|
85
|
+
if (designSystem !== 'ds') {
|
|
86
|
+
return createElement(CarbonTooltip, props);
|
|
87
|
+
}
|
|
88
|
+
const dsProps = { ...props };
|
|
89
|
+
for (const key of TOOLTIP_CARBON_ONLY_PROPS) {
|
|
90
|
+
delete dsProps[key];
|
|
91
|
+
}
|
|
92
|
+
return createElement(DsTooltip, dsProps);
|
|
93
|
+
}
|
|
94
|
+
export const Tooltip = C4Tooltip;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps a Carbon component and its Camunda Design System (carbon-compat)
|
|
4
|
+
* counterpart into one component that renders whichever the consumer selected
|
|
5
|
+
* via the `designSystem` runtime flag (default 'carbon').
|
|
6
|
+
*
|
|
7
|
+
* Callers keep the Carbon prop type, so behaviour in Carbon mode is unchanged
|
|
8
|
+
* and no JSX edits are needed when routing a component through this layer.
|
|
9
|
+
* carbon-compat is Carbon-API-shaped; where its adapter accepts a narrower set
|
|
10
|
+
* of props, the unsupported ones are simply ignored in 'ds' mode (a visual
|
|
11
|
+
* delta, never a type error at the call site). Only route symbols where that
|
|
12
|
+
* degradation is safe — keep ref-dependent or prop-gap symbols on Carbon.
|
|
13
|
+
*/
|
|
14
|
+
export declare function switchable<P extends object>(Carbon: ComponentType<P>, Ds: ComponentType<P> | ComponentType<Record<string, unknown>>): ComponentType<P>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
|
|
3
|
+
* under one or more contributor license agreements. Licensed under a commercial license.
|
|
4
|
+
* You may not use this file except in compliance with the commercial license.
|
|
5
|
+
*/
|
|
6
|
+
import { createElement } from 'react';
|
|
7
|
+
import { useC4DesignSystem } from '../runtime/c4-console-runtime-context.js';
|
|
8
|
+
/**
|
|
9
|
+
* Wraps a Carbon component and its Camunda Design System (carbon-compat)
|
|
10
|
+
* counterpart into one component that renders whichever the consumer selected
|
|
11
|
+
* via the `designSystem` runtime flag (default 'carbon').
|
|
12
|
+
*
|
|
13
|
+
* Callers keep the Carbon prop type, so behaviour in Carbon mode is unchanged
|
|
14
|
+
* and no JSX edits are needed when routing a component through this layer.
|
|
15
|
+
* carbon-compat is Carbon-API-shaped; where its adapter accepts a narrower set
|
|
16
|
+
* of props, the unsupported ones are simply ignored in 'ds' mode (a visual
|
|
17
|
+
* delta, never a type error at the call site). Only route symbols where that
|
|
18
|
+
* degradation is safe — keep ref-dependent or prop-gap symbols on Carbon.
|
|
19
|
+
*/
|
|
20
|
+
export function switchable(Carbon, Ds) {
|
|
21
|
+
function Switchable(props) {
|
|
22
|
+
const designSystem = useC4DesignSystem();
|
|
23
|
+
return createElement((designSystem === 'ds' ? Ds : Carbon), props);
|
|
24
|
+
}
|
|
25
|
+
Switchable.displayName = `Switchable(${Carbon.displayName ?? Carbon.name ?? 'Component'})`;
|
|
26
|
+
return Switchable;
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Tab as CarbonTab, TabList as CarbonTabList, TabPanel as CarbonTabPanel, TabPanels as CarbonTabPanels, Tabs as CarbonTabs, TabsSkeleton as CarbonTabsSkeleton } from '@carbon/react';
|
|
2
|
+
/**
|
|
3
|
+
* Tabs is a compound family: the parent (`Tabs`/`TabList`) coordinates its
|
|
4
|
+
* children by identity/context, so it cannot be switched symbol-by-symbol like
|
|
5
|
+
* a leaf (mixing Carbon parent + DS child, or vice versa, breaks selection).
|
|
6
|
+
*
|
|
7
|
+
* Instead this hook returns the *whole* family from a single library, chosen by
|
|
8
|
+
* the consumer's `designSystem` flag. Callers destructure it inside their
|
|
9
|
+
* component and render the same JSX — every member is cohesive within a render,
|
|
10
|
+
* so selection works in both modes. Carbon prop types are exposed so call sites
|
|
11
|
+
* stay unchanged; carbon-compat is Carbon-API-shaped.
|
|
12
|
+
*/
|
|
13
|
+
export interface TabsFamily {
|
|
14
|
+
Tabs: typeof CarbonTabs;
|
|
15
|
+
Tab: typeof CarbonTab;
|
|
16
|
+
TabList: typeof CarbonTabList;
|
|
17
|
+
TabPanel: typeof CarbonTabPanel;
|
|
18
|
+
TabPanels: typeof CarbonTabPanels;
|
|
19
|
+
TabsSkeleton: typeof CarbonTabsSkeleton;
|
|
20
|
+
}
|
|
21
|
+
export declare function useTabsFamily(): TabsFamily;
|