@camunda/ccma-saas-frontend 0.0.46 → 0.3.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/c4-billing-page.mocks.d.ts +3 -0
- package/lib/esm/components/c4-billing-page/c4-billing-page.mocks.js +154 -0
- 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.d.ts +2 -0
- package/lib/esm/components/c4-billing-page/elements/value-metric.js +15 -3
- package/lib/esm/components/c4-billing-page/elements/value-metric.spec.js +18 -0
- 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 +59 -2
- package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +41 -7
- package/lib/esm/components/c4-charts-dashboard/elements/line-chart.js +7 -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-alerts/c4-cluster-details-alerts.mocks.d.ts +5 -0
- package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.mocks.js +83 -0
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +6 -10
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.d.ts +6 -0
- package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.mocks.js +79 -0
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +8 -11
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.d.ts +3 -0
- package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.mocks.js +65 -0
- 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/c4-cluster-details-hot-backups.mocks.d.ts +60 -0
- package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.mocks.js +143 -0
- 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-ip-whitelist/c4-cluster-details-ip-whitelist.mocks.d.ts +6 -0
- package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.mocks.js +51 -0
- 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 +69 -6
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.mocks.d.ts +4 -0
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.mocks.js +132 -0
- package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +7 -0
- package/lib/esm/components/c4-cluster-overview/applications.js +19 -4
- package/lib/esm/components/c4-cluster-overview/applications.spec.js +27 -1
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +4 -3
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.d.ts +8 -0
- package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.mocks.js +203 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.d.ts +2 -0
- package/lib/esm/components/c4-cluster-overview/cluster-details.js +68 -16
- package/lib/esm/components/c4-cluster-overview/cluster-load.js +39 -4
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +1 -6
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.d.ts +16 -0
- package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.mocks.js +104 -0
- package/lib/esm/components/c4-cluster-settings/elements/app-integrations-toggle.d.ts +14 -0
- package/lib/esm/components/c4-cluster-settings/elements/app-integrations-toggle.js +12 -0
- package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.d.ts +5 -1
- package/lib/esm/components/c4-cluster-settings/elements/cluster-settings.js +10 -3
- package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +1 -6
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.d.ts +20 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.js +85 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider-modal.spec.js +93 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.d.ts +20 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.js +15 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-settings/elements/external-identity-provider.spec.js +50 -0
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.d.ts +10 -4
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.js +117 -25
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.spec.d.ts +1 -0
- package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.spec.js +120 -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 +23 -3
- 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/c4-console-dashboard.mocks.d.ts +2 -0
- package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.mocks.js +186 -0
- package/lib/esm/components/c4-console-dashboard/elements/empty-state.js +2 -2
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.d.ts +2 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.js +132 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.d.ts +2 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.mocks.js +20 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.d.ts +22 -0
- package/lib/esm/components/c4-create-alert-modal/c4-create-alert-modal.types.js +6 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.d.ts +32 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.js +71 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.spec.d.ts +1 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster-tile-grid.spec.js +83 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +56 -54
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.d.ts +64 -0
- package/lib/esm/components/c4-create-cluster/c4-create-cluster.mocks.js +298 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +51 -31
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.mocks.d.ts +2 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.mocks.js +23 -0
- package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.types.d.ts +2 -0
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +4 -2
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.mocks.d.ts +2 -0
- package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.mocks.js +15 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +6 -5
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.mocks.d.ts +2 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.mocks.js +13 -0
- package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.types.d.ts +1 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.d.ts +2 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js +77 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.mocks.d.ts +2 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.mocks.js +11 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types.d.ts +14 -0
- package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types.js +6 -0
- 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 +277 -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-data-table/c4-data-table.stability.spec.d.ts +1 -0
- package/lib/esm/components/c4-data-table/c4-data-table.stability.spec.js +151 -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/c4-job-dashboard-details-page.mocks.d.ts +2 -0
- package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.mocks.js +231 -0
- 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-piechart.js +56 -2
- package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +37 -2
- 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-overview-page/c4-job-dashboard-overview.mocks.d.ts +2 -0
- package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.mocks.js +102 -0
- 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-ds-colors.d.ts +10 -0
- package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-ds-colors.js +16 -0
- 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.d.ts +1 -1
- package/lib/esm/components/c4-management-activity/c4-management-activity.js +109 -9
- package/lib/esm/components/c4-management-activity/c4-management-activity.mocks.d.ts +4 -0
- package/lib/esm/components/c4-management-activity/c4-management-activity.mocks.js +63 -0
- package/lib/esm/components/c4-management-activity/c4-management-activity.types.d.ts +11 -0
- package/lib/esm/components/c4-management-api/c4-management-api.js +9 -11
- package/lib/esm/components/c4-management-api/c4-management-api.mocks.d.ts +43 -0
- package/lib/esm/components/c4-management-api/c4-management-api.mocks.js +118 -0
- package/lib/esm/components/c4-management-overview/c4-management-overview.js +12 -14
- 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 +3 -2
- package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.types.d.ts +1 -0
- 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 +44 -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 +60 -37
- 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 +7 -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 +4 -2
- 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/components/shared-charts/ds-charts.smoke.spec.d.ts +1 -0
- package/lib/esm/components/shared-charts/ds-charts.smoke.spec.js +47 -0
- package/lib/esm/components/shared-charts/ds-line-chart.d.ts +33 -0
- package/lib/esm/components/shared-charts/ds-line-chart.js +55 -0
- package/lib/esm/components/shared-charts/ds-meter-chart.d.ts +22 -0
- package/lib/esm/components/shared-charts/ds-meter-chart.js +48 -0
- package/lib/esm/components/shared-charts/recharts-tokens.d.ts +24 -0
- package/lib/esm/components/shared-charts/recharts-tokens.js +51 -0
- package/lib/esm/externalUrls.const.d.ts +2 -0
- package/lib/esm/externalUrls.const.js +7 -0
- package/lib/esm/externalUrls.const.spec.js +2 -0
- package/lib/esm/i18n/c4-console-i18n.js +8 -0
- package/lib/esm/i18n/en/entities/orgroles.json +0 -16
- package/lib/esm/i18n/en/modals/clusters.json +0 -8
- package/lib/esm/i18n/en/pages/clusterdetails.json +14 -2
- package/lib/esm/i18n/en/pages/orgmanagement.json +12 -3
- package/lib/esm/index.d.ts +33 -1
- package/lib/esm/index.js +23 -1
- package/lib/esm/runtime/c4-console-authz.d.ts +26 -0
- package/lib/esm/runtime/c4-console-authz.js +59 -29
- package/lib/esm/runtime/c4-console-authz.spec.js +87 -20
- package/lib/esm/runtime/c4-console-data-context.js +40 -0
- package/lib/esm/runtime/c4-console-data-context.types.d.ts +19 -1
- package/lib/esm/runtime/c4-console-data-store.d.ts +25 -1
- package/lib/esm/runtime/c4-console-data-store.js +145 -31
- package/lib/esm/runtime/c4-console-data-store.nav.spec.d.ts +1 -0
- package/lib/esm/runtime/c4-console-data-store.nav.spec.js +121 -0
- package/lib/esm/runtime/c4-console-data-store.spec.js +35 -6
- package/lib/esm/runtime/c4-console-events-context.d.ts +18 -0
- package/lib/esm/runtime/c4-console-events-context.js +62 -0
- 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 +20 -0
- package/lib/esm/runtime/c4-user-notifications-context.d.ts +19 -0
- package/lib/esm/runtime/c4-user-notifications-context.js +201 -0
- package/lib/esm/runtime/c4-user-notifications-context.spec.d.ts +1 -0
- package/lib/esm/runtime/c4-user-notifications-context.spec.js +80 -0
- package/lib/esm/runtime/c4-user-notifications-context.types.d.ts +31 -0
- package/lib/esm/runtime/c4-user-notifications-context.types.js +6 -0
- package/lib/esm/runtime/c4-user-theme.d.ts +27 -0
- package/lib/esm/runtime/c4-user-theme.js +106 -0
- package/lib/esm/runtime/decode-access-token.d.ts +12 -0
- package/lib/esm/runtime/decode-access-token.js +39 -0
- package/lib/esm/runtime/nav/camunda-apps.d.ts +45 -0
- package/lib/esm/runtime/nav/camunda-apps.js +100 -0
- package/lib/esm/runtime/nav/camunda-apps.spec.d.ts +1 -0
- package/lib/esm/runtime/nav/camunda-apps.spec.js +90 -0
- package/lib/esm/runtime/nav/use-webapp-nav-data.d.ts +75 -0
- package/lib/esm/runtime/nav/use-webapp-nav-data.js +211 -0
- package/lib/esm/runtime/nav/use-webapp-nav-data.spec.d.ts +1 -0
- package/lib/esm/runtime/nav/use-webapp-nav-data.spec.js +91 -0
- package/lib/esm/runtime/to-api-config.js +4 -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 +32 -0
- package/lib/esm/ui/index.js +95 -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.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +39 -15
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.merge.spec.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.merge.spec.js +49 -0
- package/lib/esm/widgets/cluster-details/c4-cluster-details-app.types.d.ts +8 -0
- 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/cluster-details-tabs.d.ts +23 -0
- package/lib/esm/widgets/cluster-details/cluster-details-tabs.js +83 -0
- package/lib/esm/widgets/cluster-details/cluster-details-tabs.spec.d.ts +1 -0
- package/lib/esm/widgets/cluster-details/cluster-details-tabs.spec.js +33 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +25 -88
- 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.js +3 -1
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +25 -39
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +88 -35
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +134 -19
- 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.d.ts +2 -0
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +194 -6
- package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.spec.js +60 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
- package/lib/esm/widgets/clusters/c4-clusters-page.js +173 -81
- package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +146 -13
- 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 +86 -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 +14 -5
- package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
- package/lib/esm/widgets/dashboard/c4-dashboard-app.js +21 -2
- package/lib/esm/widgets/group-details/c4-group-details-page.js +3 -2
- package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
- package/lib/esm/widgets/management/c4-management-app.js +132 -23
- package/lib/esm/widgets/management/c4-management-app.spec.js +163 -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/management-tabs.d.ts +22 -0
- package/lib/esm/widgets/management/management-tabs.js +76 -0
- package/lib/esm/widgets/management/management-tabs.spec.d.ts +1 -0
- package/lib/esm/widgets/management/management-tabs.spec.js +28 -0
- 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 +3 -1
- package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +19 -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 +37 -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 -14
- package/package.json +16 -7
|
@@ -0,0 +1,77 @@
|
|
|
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 { Form } from '@carbon/react';
|
|
8
|
+
import { forwardRef, useCallback, useImperativeHandle, useState, } from 'react';
|
|
9
|
+
import { Modal, Stack, TextInput } from '../../ui/index.js';
|
|
10
|
+
import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
|
|
11
|
+
// Helper function to ensure translations work
|
|
12
|
+
function safeTranslate(t, key, fallback) {
|
|
13
|
+
if (!t)
|
|
14
|
+
return fallback;
|
|
15
|
+
const result = t(key);
|
|
16
|
+
if (!result || result === key) {
|
|
17
|
+
return fallback;
|
|
18
|
+
}
|
|
19
|
+
// i18next can return the key *without* the namespace when the namespace is missing.
|
|
20
|
+
// Example: `ipwhitelist:data.title` -> `data.title`
|
|
21
|
+
if (key.includes(':')) {
|
|
22
|
+
const withoutNamespace = key.split(':').slice(1).join(':');
|
|
23
|
+
if (result === withoutNamespace) {
|
|
24
|
+
return fallback;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
export const C4CreateIpWhitelistModal = forwardRef(({ t, onCreateIpWhitelist, onCancel, onSubmitStart, onSubmitError }, ref) => {
|
|
30
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
31
|
+
const [busy, setBusy] = useState(false);
|
|
32
|
+
const [error, setError] = useState('');
|
|
33
|
+
const [ipValue, setIpValue] = useState('');
|
|
34
|
+
const [ipDescription, setIpDescription] = useState('');
|
|
35
|
+
const close = useCallback(() => {
|
|
36
|
+
setBusy(false);
|
|
37
|
+
setIsOpen(false);
|
|
38
|
+
}, []);
|
|
39
|
+
const open = useCallback(() => {
|
|
40
|
+
setIpValue('');
|
|
41
|
+
setIpDescription('');
|
|
42
|
+
setError('');
|
|
43
|
+
setBusy(false);
|
|
44
|
+
setIsOpen(true);
|
|
45
|
+
}, []);
|
|
46
|
+
useImperativeHandle(ref, () => ({
|
|
47
|
+
open,
|
|
48
|
+
close,
|
|
49
|
+
}), [open, close]);
|
|
50
|
+
return (_jsx(Modal, { open: isOpen, modalHeading: safeTranslate(t, 'ipwhitelist:create.heading', 'Add new IP(s)'), primaryButtonText: safeTranslate(t, 'ipwhitelist:create.buttons.primary', 'Add'), secondaryButtonText: safeTranslate(t, 'ipwhitelist:create.buttons.secondary', 'Cancel'), primaryButtonDisabled: busy || ipValue.length === 0, onRequestClose: () => {
|
|
51
|
+
onCancel?.();
|
|
52
|
+
close();
|
|
53
|
+
}, onRequestSubmit: () => {
|
|
54
|
+
void (async () => {
|
|
55
|
+
onSubmitStart?.();
|
|
56
|
+
setBusy(true);
|
|
57
|
+
setError('');
|
|
58
|
+
try {
|
|
59
|
+
await onCreateIpWhitelist({
|
|
60
|
+
ip: ipValue,
|
|
61
|
+
description: ipDescription,
|
|
62
|
+
});
|
|
63
|
+
close();
|
|
64
|
+
}
|
|
65
|
+
catch (submitError) {
|
|
66
|
+
setError(submitError instanceof Error ? submitError.message : 'Failed');
|
|
67
|
+
onSubmitError?.(submitError);
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
setBusy(false);
|
|
71
|
+
}
|
|
72
|
+
})();
|
|
73
|
+
}, children: _jsx(Form, { onSubmit: (e) => {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
}, children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(C4InlineNotification, { kind: 'error', title: safeTranslate(t, 'ipwhitelist:create.error.generic', "We're having trouble adding the IP(s)"), subtitle: error, lowContrast: true, hideCloseButton: true })), _jsx(TextInput, { id: 'ip-input-whitelist-create', labelText: safeTranslate(t, 'ipwhitelist:create.fields.ips', 'IP(s)'), helperText: safeTranslate(t, 'ipwhitelist:create.fields.ipsHelper', 'Comma separated list of CIDRs, e.g. 10.0.0.0/24,172.10.0.1'), value: ipValue, maxLength: 50, onChange: (event) => setIpValue(event.target.value) }), _jsx(TextInput, { id: 'name-input-whitelist-create', labelText: safeTranslate(t, 'ipwhitelist:create.fields.description', 'Description (optional)'), value: ipDescription, maxLength: 1024, onChange: (event) => setIpDescription(event.target.value) })] }) }) }));
|
|
76
|
+
});
|
|
77
|
+
C4CreateIpWhitelistModal.displayName = 'C4CreateIpWhitelistModal';
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export const basicCreateIpWhitelistModalProps = {
|
|
7
|
+
t: (key) => key,
|
|
8
|
+
onCreateIpWhitelist: async ({ ip, description }) => {
|
|
9
|
+
console.log('Create IP whitelist requested', { ip, description });
|
|
10
|
+
},
|
|
11
|
+
};
|
package/lib/esm/components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.types.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface C4CreateIpWhitelistModalHandle {
|
|
2
|
+
open: () => void;
|
|
3
|
+
close: () => void;
|
|
4
|
+
}
|
|
5
|
+
export interface C4CreateIpWhitelistModalProps {
|
|
6
|
+
t?: (key: string, options?: Record<string, unknown>) => string;
|
|
7
|
+
onCreateIpWhitelist: (params: {
|
|
8
|
+
ip: string;
|
|
9
|
+
description: string;
|
|
10
|
+
}) => Promise<void>;
|
|
11
|
+
onCancel?: () => void;
|
|
12
|
+
onSubmitStart?: () => void;
|
|
13
|
+
onSubmitError?: (error: unknown) => void;
|
|
14
|
+
}
|
package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js
CHANGED
|
@@ -4,8 +4,9 @@ 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
|
|
7
|
+
import { Form } from '@carbon/react';
|
|
8
8
|
import { useCallback, useRef } from 'react';
|
|
9
|
+
import { Stack, TextInput } from '../../ui/index.js';
|
|
9
10
|
import { C4AsyncModal } from '../c4-async-modal/c4-async-modal.js';
|
|
10
11
|
function safeTranslate(t, key, defaultValue, options) {
|
|
11
12
|
if (!t)
|
|
@@ -1,9 +1,4 @@
|
|
|
1
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 { Stack, Tile } from '@carbon/react';
|
|
2
|
+
import { Stack, Tile } from '../../ui/index.js';
|
|
8
3
|
import { C4TutorialTile } from '../c4-tutorial-tile/c4-tutorial-tile.js';
|
|
9
4
|
export const C4DashboardFirstLaunch = ({ title, subtitle, tutorials, }) => (_jsx(Tile, { children: _jsxs(Stack, { orientation: 'vertical', gap: 5, children: [_jsxs(Stack, { gap: 1, children: [_jsx("h1", { children: title }), typeof subtitle === 'string' ? _jsx("p", { children: subtitle }) : subtitle] }), _jsx(Stack, { orientation: 'horizontal', gap: 5, style: { display: 'grid' }, children: tutorials.map((tutorial) => (_jsx(C4TutorialTile, { ...tutorial }, tutorial.id))) })] }) }));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DataTableSkeleton } from '@carbon/react';
|
|
2
|
+
import type { ComponentProps, JSX } from 'react';
|
|
3
|
+
type C4DataTableSkeletonProps = ComponentProps<typeof DataTableSkeleton>;
|
|
4
|
+
/**
|
|
5
|
+
* Design-system-switchable table loading skeleton.
|
|
6
|
+
*
|
|
7
|
+
* Carbon mode renders Carbon's `DataTableSkeleton` unchanged. ds mode renders a
|
|
8
|
+
* DS-styled skeleton matching the DS DataTable's own loading rows
|
|
9
|
+
* (`animate-pulse rounded bg-neutral-background-strong` inside a rounded,
|
|
10
|
+
* bordered container) — so a consumer's early-return loading state looks like
|
|
11
|
+
* the rest of the DS tables instead of a Carbon skeleton. The Carbon-shaped
|
|
12
|
+
* props (rowCount, etc.) are accepted so call sites stay unchanged.
|
|
13
|
+
*/
|
|
14
|
+
export declare function C4DataTableSkeleton(props: C4DataTableSkeletonProps): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
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 { DataTableSkeleton } from '@carbon/react';
|
|
8
|
+
import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
|
|
9
|
+
/**
|
|
10
|
+
* Design-system-switchable table loading skeleton.
|
|
11
|
+
*
|
|
12
|
+
* Carbon mode renders Carbon's `DataTableSkeleton` unchanged. ds mode renders a
|
|
13
|
+
* DS-styled skeleton matching the DS DataTable's own loading rows
|
|
14
|
+
* (`animate-pulse rounded bg-neutral-background-strong` inside a rounded,
|
|
15
|
+
* bordered container) — so a consumer's early-return loading state looks like
|
|
16
|
+
* the rest of the DS tables instead of a Carbon skeleton. The Carbon-shaped
|
|
17
|
+
* props (rowCount, etc.) are accepted so call sites stay unchanged.
|
|
18
|
+
*/
|
|
19
|
+
export function C4DataTableSkeleton(props) {
|
|
20
|
+
const designSystem = useC4DesignSystem();
|
|
21
|
+
if (designSystem !== 'ds') {
|
|
22
|
+
return _jsx(DataTableSkeleton, { ...props });
|
|
23
|
+
}
|
|
24
|
+
const rowCount = props.rowCount ?? 5;
|
|
25
|
+
return (_jsx("div", { className: 'overflow-hidden rounded-xl border bg-neutral-background-subtle', children: Array.from({ length: rowCount }).map((_, index) => (_jsx("div", { className: 'border-b px-4 py-3 last:border-0', children: _jsx("div", { className: 'h-4 w-3/4 animate-pulse rounded bg-neutral-background-strong' }) }, index))) }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
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 { C3DataTable, } from '@camunda/camunda-composite-components';
|
|
8
|
+
import { Button, DataTable, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Input, MultiSelect, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@camunda/design-system';
|
|
9
|
+
import { useCallback, useMemo, useRef, useState, } from 'react';
|
|
10
|
+
import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
|
|
11
|
+
/**
|
|
12
|
+
* Design-system-switchable data table.
|
|
13
|
+
*
|
|
14
|
+
* Keeps the stable C3DataTable interface ('carbon' renders unchanged c3; 'ds'
|
|
15
|
+
* transforms onto the DS DataTable; c3 untouched). See docs/superpowers/specs/
|
|
16
|
+
* 2026-06-24-c4-datatable-ds-transformation-design.md.
|
|
17
|
+
*
|
|
18
|
+
* Stage 1: core mapping (headers→columns, actions→rowActions, options, expansion,
|
|
19
|
+
* row-click, loading, title/description). Stage 2 (this file): the toolbar shell
|
|
20
|
+
* — search / singleSelect / multiSelect (client-side filtering via the
|
|
21
|
+
* consumer's predicates) + button / menuButton. No bulk-row machinery
|
|
22
|
+
* (unused in app).
|
|
23
|
+
*
|
|
24
|
+
* Deviation from c3: filter state is local React state, not URL-synced via the
|
|
25
|
+
* c3 `queryName` (c4 has no router here). The filtering result is identical;
|
|
26
|
+
* only persistence across reload/links differs.
|
|
27
|
+
*/
|
|
28
|
+
// Carbon button `kind` → DS Button variant.
|
|
29
|
+
function kindToButtonVariant(kind) {
|
|
30
|
+
if (typeof kind !== 'string')
|
|
31
|
+
return 'default';
|
|
32
|
+
if (kind.includes('danger'))
|
|
33
|
+
return 'destructive';
|
|
34
|
+
if (kind.includes('tertiary'))
|
|
35
|
+
return 'secondary';
|
|
36
|
+
if (kind.includes('ghost'))
|
|
37
|
+
return 'ghost';
|
|
38
|
+
if (kind === 'secondary')
|
|
39
|
+
return 'secondary';
|
|
40
|
+
return 'default';
|
|
41
|
+
}
|
|
42
|
+
// Map one C3 header's cell content to a DS column cell node.
|
|
43
|
+
function renderCell(header, row) {
|
|
44
|
+
const content = header.type;
|
|
45
|
+
const value = row[header.key];
|
|
46
|
+
if (!content || content.type === 'text') {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
switch (content.type) {
|
|
50
|
+
case 'wrapper':
|
|
51
|
+
return content.options?.wrapperOptions?.wrapper(row);
|
|
52
|
+
case 'link': {
|
|
53
|
+
const link = content.options?.linkOptions;
|
|
54
|
+
return link ? (_jsx("a", { href: link.href(row), target: link.target, rel: 'noopener noreferrer', children: value })) : (value);
|
|
55
|
+
}
|
|
56
|
+
case 'link-button': {
|
|
57
|
+
const link = content.options?.linkButtonOptions;
|
|
58
|
+
return (_jsx(Button, { variant: 'link', className: 'h-auto p-0', onClick: () => link?.onClick(row), disabled: link?.disabled?.(row), children: value }));
|
|
59
|
+
}
|
|
60
|
+
case 'code':
|
|
61
|
+
return _jsx("code", { children: value });
|
|
62
|
+
default:
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// Build column defs from a ref to the latest headers. The returned array is
|
|
67
|
+
// meant to be memoised (stable identity) so the DS `DataTable` — backed by
|
|
68
|
+
// TanStack Table — does not rebuild its column model and remount every cell
|
|
69
|
+
// (which would close any open row action menu). Each column resolves its
|
|
70
|
+
// current header on access, so a stable column still renders with the latest
|
|
71
|
+
// render's cell wrapper / sort comparator.
|
|
72
|
+
function toColumns(headersRef) {
|
|
73
|
+
return headersRef.current.map((header) => {
|
|
74
|
+
const resolveHeader = () => headersRef.current.find((candidate) => candidate.key === header.key) ??
|
|
75
|
+
header;
|
|
76
|
+
return {
|
|
77
|
+
id: header.key,
|
|
78
|
+
accessorFn: (row) => row[header.key],
|
|
79
|
+
header: header.label,
|
|
80
|
+
enableSorting: !!header.sorting,
|
|
81
|
+
...(header.sorting && {
|
|
82
|
+
sortingFn: (a, b) => resolveHeader().sorting?.(a.original, b.original) ?? 0,
|
|
83
|
+
}),
|
|
84
|
+
cell: ({ row }) => renderCell(resolveHeader(), row.original),
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
// Build row-action descriptors from a ref to the latest actions. Like
|
|
89
|
+
// toColumns, the result is meant to be memoised so the DS `DataTable` keeps a
|
|
90
|
+
// stable actions column and does not remount the row action menu on every
|
|
91
|
+
// re-render. Each descriptor delegates to the current action on access: the DS
|
|
92
|
+
// table calls `visible` / `disabled` / `label` during its own render, so a
|
|
93
|
+
// stale closure (e.g. captured before a row's status changed) would render the
|
|
94
|
+
// wrong actions.
|
|
95
|
+
function toRowActions(actionsRef) {
|
|
96
|
+
const actions = actionsRef.current;
|
|
97
|
+
if (!actions) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
return actions.map((action) => {
|
|
101
|
+
const resolveAction = () => actionsRef.current?.find((candidate) => candidate.id === action.id) ??
|
|
102
|
+
action;
|
|
103
|
+
return {
|
|
104
|
+
id: action.id,
|
|
105
|
+
label: (row) => {
|
|
106
|
+
const label = resolveAction().label;
|
|
107
|
+
return typeof label === 'function' ? label(row) : label;
|
|
108
|
+
},
|
|
109
|
+
onClick: (row) => resolveAction().onClick(row),
|
|
110
|
+
disabled: (row) => resolveAction().disabled?.(row) ?? false,
|
|
111
|
+
visible: (row) => resolveAction().visible?.(row) ?? true,
|
|
112
|
+
hasDivider: action.hasDivider,
|
|
113
|
+
variant: typeof action.kind === 'string' && action.kind.includes('danger')
|
|
114
|
+
? 'destructive'
|
|
115
|
+
: 'default',
|
|
116
|
+
icon: action.icon
|
|
117
|
+
? (row) => {
|
|
118
|
+
const icon = resolveAction().icon;
|
|
119
|
+
const Icon = typeof icon === 'function' ? icon(row) : icon;
|
|
120
|
+
return Icon ? _jsx(Icon, {}) : undefined;
|
|
121
|
+
}
|
|
122
|
+
: undefined,
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
// Items that filter rows (search/singleSelect/multiSelect); button/menuButton
|
|
127
|
+
// do not.
|
|
128
|
+
function keepRow(row, items, state) {
|
|
129
|
+
return items.every((item) => {
|
|
130
|
+
if (item.type === 'search') {
|
|
131
|
+
const term = state[item.id];
|
|
132
|
+
const searchTerm = typeof term === 'string' ? term : '';
|
|
133
|
+
return !searchTerm || !item.filter
|
|
134
|
+
? true
|
|
135
|
+
: item.filter({ row, searchTerm });
|
|
136
|
+
}
|
|
137
|
+
if (item.type === 'singleSelect') {
|
|
138
|
+
const selectedItem = state[item.id];
|
|
139
|
+
const value = typeof selectedItem === 'string' ? selectedItem : '';
|
|
140
|
+
return !value || !item.filter
|
|
141
|
+
? true
|
|
142
|
+
: item.filter({ row, selectedItem: value });
|
|
143
|
+
}
|
|
144
|
+
if (item.type === 'multiSelect') {
|
|
145
|
+
const raw = state[item.id];
|
|
146
|
+
const selectedItems = Array.isArray(raw) ? raw : [];
|
|
147
|
+
return selectedItems.length === 0 || !item.filter
|
|
148
|
+
? true
|
|
149
|
+
: item.filter({ row, selectedItems });
|
|
150
|
+
}
|
|
151
|
+
return true;
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function C4DataTableDs(props) {
|
|
155
|
+
const { headers, data, actions, options, isLoading, title, description, id } = props;
|
|
156
|
+
// Mirror the latest headers/actions into refs so the memoised (referentially
|
|
157
|
+
// stable) `columns` / `rowActions` below can delegate to the current
|
|
158
|
+
// render's cell wrappers and action callbacks. These are written during
|
|
159
|
+
// render on purpose: the DS `DataTable` invokes the column cells and action
|
|
160
|
+
// `visible`/`disabled` predicates synchronously while rendering its own
|
|
161
|
+
// subtree (which happens after this component's render in the same pass), so
|
|
162
|
+
// an effect-based update would be a render too late and show stale actions.
|
|
163
|
+
const headersRef = useRef(headers);
|
|
164
|
+
headersRef.current = headers;
|
|
165
|
+
const actionsRef = useRef(actions);
|
|
166
|
+
actionsRef.current = actions;
|
|
167
|
+
// Structural signatures: the only changes that require *new* column /
|
|
168
|
+
// action descriptors (vs. the ref-delegated ones staying live). Rebuilding
|
|
169
|
+
// `columns` / `rowActions` on every render would hand the DS `DataTable` new
|
|
170
|
+
// cell/action functions, forcing TanStack to rebuild its column model and
|
|
171
|
+
// React to remount every cell — which closes any open row action menu.
|
|
172
|
+
const headerSignature = headers
|
|
173
|
+
.map((header) => `${header.key}${header.label}${header.sorting ? 1 : 0}`)
|
|
174
|
+
.join('');
|
|
175
|
+
const actionSignature = (actions ?? [])
|
|
176
|
+
.map((action) => `${action.id}${String(action.kind)}${action.hasDivider ? 1 : 0}${action.icon ? 1 : 0}`)
|
|
177
|
+
.join('');
|
|
178
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: headersRef is stable; the reactive input is headerSignature, which subsumes the every-render `headers` array (see comment above)
|
|
179
|
+
const columns = useMemo(() => toColumns(headersRef), [headerSignature]);
|
|
180
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: actionsRef is stable; the reactive input is actionSignature, which subsumes the every-render `actions` array (see comment above)
|
|
181
|
+
const rowActions = useMemo(() => toRowActions(actionsRef), [actionSignature]);
|
|
182
|
+
// Normalise `toolbar` (single row) / `toolbars` (multiple rows) into rows.
|
|
183
|
+
const toolbarRows = props.toolbars ?? (props.toolbar ? [props.toolbar] : []);
|
|
184
|
+
const allToolbarItems = toolbarRows.flat();
|
|
185
|
+
const [filterState, setFilterState] = useState(() => {
|
|
186
|
+
const initial = {};
|
|
187
|
+
for (const item of allToolbarItems) {
|
|
188
|
+
if (item.type === 'singleSelect' && item.defaultValue != null) {
|
|
189
|
+
initial[item.id] = String(item.defaultValue);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return initial;
|
|
193
|
+
});
|
|
194
|
+
const setValue = (key, value) => setFilterState((prev) => ({ ...prev, [key]: value }));
|
|
195
|
+
// Stable signature of the filtering toolbar items (their `type` + `id`).
|
|
196
|
+
// It only changes when the toolbar's filtering shape changes — not on every
|
|
197
|
+
// render — and captures every input that can alter `keepRow`'s result other
|
|
198
|
+
// than the row data and the filter state (a filter's predicate is a pure
|
|
199
|
+
// function of the row and the current selection, so its closure identity is
|
|
200
|
+
// irrelevant). It is what gates the memo below against stale results.
|
|
201
|
+
const filterSignature = allToolbarItems
|
|
202
|
+
.filter((item) => item.type === 'search' ||
|
|
203
|
+
item.type === 'singleSelect' ||
|
|
204
|
+
item.type === 'multiSelect')
|
|
205
|
+
.map((item) => `${item.type}:${item.id}`)
|
|
206
|
+
.join('|');
|
|
207
|
+
// Keep the array reference stable across renders when neither the source
|
|
208
|
+
// `data` reference, the filter state, nor the filtering toolbar shape
|
|
209
|
+
// changed. The underlying DS `DataTable` is backed by TanStack Table, whose
|
|
210
|
+
// default `autoResetPageIndex` resets to the first page whenever the `data`
|
|
211
|
+
// reference changes; an unconditional `.filter()` would hand it a brand-new
|
|
212
|
+
// array on every parent re-render (e.g. when a per-row API call resolves),
|
|
213
|
+
// snapping the table back to page 1 and unmounting any open row action
|
|
214
|
+
// menu. Consumers that mutate row contents in place (see c4-cluster-list)
|
|
215
|
+
// rely on this stability. `allToolbarItems` itself is rebuilt on every
|
|
216
|
+
// render, so it is intentionally not a dependency — `filterSignature`
|
|
217
|
+
// subsumes it; depending on the array directly would defeat the memo and
|
|
218
|
+
// reintroduce the reset.
|
|
219
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: allToolbarItems is rebuilt every render and is subsumed by filterSignature (see comment above)
|
|
220
|
+
const filteredData = useMemo(() => allToolbarItems.length
|
|
221
|
+
? data.filter((row) => keepRow(row, allToolbarItems, filterState))
|
|
222
|
+
: data, [data, filterState, filterSignature]);
|
|
223
|
+
const renderToolbarItem = (item) => {
|
|
224
|
+
switch (item.type) {
|
|
225
|
+
case 'search': {
|
|
226
|
+
const raw = filterState[item.id];
|
|
227
|
+
const searchValue = typeof raw === 'string' ? raw : '';
|
|
228
|
+
return (_jsx(Input, { type: 'search', className: 'max-w-xs', placeholder: item.label ?? 'Search', "aria-label": item.label ?? 'Search', value: searchValue, onChange: (event) => setValue(item.id, event.target.value) }, item.id));
|
|
229
|
+
}
|
|
230
|
+
case 'singleSelect': {
|
|
231
|
+
const raw = filterState[item.id];
|
|
232
|
+
const value = typeof raw === 'string' ? raw : undefined;
|
|
233
|
+
return (_jsxs(Select, { value: value, onValueChange: (next) => setValue(item.id, next), disabled: item.disabled, children: [_jsx(SelectTrigger, { "aria-label": item.label, className: 'w-44', children: _jsx(SelectValue, { placeholder: item.label }) }), _jsx(SelectContent, { children: item.items?.map((option) => (_jsx(SelectItem, { value: option.id, children: option.label }, option.id))) })] }, item.id));
|
|
234
|
+
}
|
|
235
|
+
case 'multiSelect': {
|
|
236
|
+
const raw = filterState[item.id];
|
|
237
|
+
const value = Array.isArray(raw) ? raw : [];
|
|
238
|
+
return (_jsx(MultiSelect, { id: item.id, "aria-label": item.label ?? 'Filter', placeholder: item.label ?? 'Filter', className: 'w-64', options: (item.items ?? []).map((option) => ({
|
|
239
|
+
value: option.id,
|
|
240
|
+
label: option.label,
|
|
241
|
+
})), value: value, onValueChange: (next) => setValue(item.id, next) }, item.id));
|
|
242
|
+
}
|
|
243
|
+
case 'button': {
|
|
244
|
+
const Icon = item.icon;
|
|
245
|
+
return (_jsxs(Button, { variant: kindToButtonVariant(item.kind), onClick: item.onClick, disabled: item.disabled, children: [Icon ? _jsx(Icon, {}) : undefined, item.label] }, item.id));
|
|
246
|
+
}
|
|
247
|
+
case 'menuButton':
|
|
248
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: 'secondary', disabled: item.disabled, children: item.label }) }), _jsx(DropdownMenuContent, { align: 'end', children: item.items.map((menuItem, index) => (_jsx(DropdownMenuItem
|
|
249
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: c3 menu items have no stable id
|
|
250
|
+
, { onClick: menuItem.onClick, disabled: menuItem.disabled, children: menuItem.label }, index))) })] }, item.id));
|
|
251
|
+
default:
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
const renderToolbarRow = (items, rowIndex) => {
|
|
256
|
+
const filters = items.filter((item) => item.type === 'search' ||
|
|
257
|
+
item.type === 'singleSelect' ||
|
|
258
|
+
item.type === 'multiSelect');
|
|
259
|
+
const buttons = items.filter((item) => item.type === 'button' || item.type === 'menuButton');
|
|
260
|
+
return (_jsxs("div", { className: 'flex flex-wrap items-center gap-2', children: [filters.map(renderToolbarItem), buttons.length > 0 && (_jsx("div", { className: 'ml-auto flex items-center gap-2', children: buttons.map(renderToolbarItem) }))] }, rowIndex));
|
|
261
|
+
};
|
|
262
|
+
const hasHeading = title !== undefined || description !== undefined;
|
|
263
|
+
const hasExpansion = data.some((row) => row.expansion !== undefined);
|
|
264
|
+
// Stable identity so TanStack Table keeps its row identities (and open row
|
|
265
|
+
// action menus) across re-renders.
|
|
266
|
+
const getRowId = useCallback((row, index) => row.id ?? String(index), []);
|
|
267
|
+
return (_jsxs("div", { className: 'flex flex-col gap-3', id: id, children: [hasHeading && (_jsxs("div", { className: 'flex flex-col gap-1', children: [title !== undefined && (_jsx("div", { className: 'text-base font-semibold', children: title })), description !== undefined && (_jsx("div", { className: 'text-sm text-neutral-foreground-subtle', children: description }))] })), toolbarRows.map(renderToolbarRow), _jsx(DataTable, { columns: columns, data: filteredData, getRowId: getRowId, sorting: headers.some((header) => !!header.sorting), pagination: options?.pageSize || options?.pageSizes
|
|
268
|
+
? {
|
|
269
|
+
defaultPageSize: options.pageSize,
|
|
270
|
+
pageSizes: options.pageSizes,
|
|
271
|
+
}
|
|
272
|
+
: true, size: options?.tableSize, zebra: options?.useZebraStyles, inlineActionsThreshold: options?.actionsUseOverflowMenuMinItems, rowActions: rowActions, loading: isLoading, onRowClick: (row) => row.onClick?.(), expansion: hasExpansion ? (row) => row.expansion ?? null : undefined })] }));
|
|
273
|
+
}
|
|
274
|
+
export function C4DataTable(props) {
|
|
275
|
+
const designSystem = useC4DesignSystem();
|
|
276
|
+
return designSystem === 'ds' ? (_jsx(C4DataTableDs, { ...props })) : (_jsx(C3DataTable, { ...props }));
|
|
277
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import userEvent from '@testing-library/user-event';
|
|
4
|
+
import { C4ConsoleRuntimeProvider } from '../../runtime/c4-console-runtime-context.js';
|
|
5
|
+
import { C4DataTable } from './c4-data-table.js';
|
|
6
|
+
const ROWS = [
|
|
7
|
+
{ id: 'r1', originalIndex: 0, name: 'Alice', rolesArray: ['admin'] },
|
|
8
|
+
{ id: 'r2', originalIndex: 1, name: 'Bob', rolesArray: ['developer'] },
|
|
9
|
+
{
|
|
10
|
+
id: 'r3',
|
|
11
|
+
originalIndex: 2,
|
|
12
|
+
name: 'Carol',
|
|
13
|
+
rolesArray: ['analyst', 'developer'],
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
function renderTable() {
|
|
17
|
+
const wrapper = ({ children }) => (_jsx(C4ConsoleRuntimeProvider, { config: {
|
|
18
|
+
stage: 'dev',
|
|
19
|
+
designSystem: 'ds',
|
|
20
|
+
auth: { getAccessToken: async () => '' },
|
|
21
|
+
backendUrls: {},
|
|
22
|
+
}, children: children }));
|
|
23
|
+
return render(_jsx(C4DataTable, { headers: [
|
|
24
|
+
{ key: 'name', label: 'Name' },
|
|
25
|
+
{ key: 'rolesArray', label: 'Roles' },
|
|
26
|
+
], data: ROWS, toolbar: [
|
|
27
|
+
{
|
|
28
|
+
id: 'role-filter',
|
|
29
|
+
type: 'multiSelect',
|
|
30
|
+
label: 'Filter by role',
|
|
31
|
+
items: [
|
|
32
|
+
{ id: 'admin', label: 'Admin' },
|
|
33
|
+
{ id: 'developer', label: 'Developer' },
|
|
34
|
+
{ id: 'analyst', label: 'Analyst' },
|
|
35
|
+
],
|
|
36
|
+
filter: ({ row, selectedItems }) => !selectedItems?.length ||
|
|
37
|
+
selectedItems.some((id) => row.rolesArray.includes(id)),
|
|
38
|
+
},
|
|
39
|
+
] }), { wrapper });
|
|
40
|
+
}
|
|
41
|
+
// jsdom does not implement Element.scrollIntoView; the DS MultiSelect uses
|
|
42
|
+
// cmdk under the hood, which calls it when items mount.
|
|
43
|
+
beforeAll(() => {
|
|
44
|
+
if (typeof window !== 'undefined' &&
|
|
45
|
+
!window.Element.prototype.scrollIntoView) {
|
|
46
|
+
window.Element.prototype.scrollIntoView = () => undefined;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
describe('C4DataTableDs multiSelect toolbar item', () => {
|
|
50
|
+
it('renders the multi-select trigger and all rows by default', () => {
|
|
51
|
+
renderTable();
|
|
52
|
+
expect(screen.getByRole('combobox', { name: 'Filter by role' })).toBeInTheDocument();
|
|
53
|
+
expect(screen.getByText('Alice')).toBeInTheDocument();
|
|
54
|
+
expect(screen.getByText('Bob')).toBeInTheDocument();
|
|
55
|
+
expect(screen.getByText('Carol')).toBeInTheDocument();
|
|
56
|
+
});
|
|
57
|
+
it('narrows rows to those whose rolesArray includes a selected role', async () => {
|
|
58
|
+
const user = userEvent.setup();
|
|
59
|
+
renderTable();
|
|
60
|
+
// Open the dropdown.
|
|
61
|
+
await user.click(screen.getByRole('combobox', { name: 'Filter by role' }));
|
|
62
|
+
// Pick "Developer" from the popover. The DS MultiSelect renders options
|
|
63
|
+
// as command items inside a Radix Popover portal.
|
|
64
|
+
const developerOption = await screen.findByText('Developer');
|
|
65
|
+
await user.click(developerOption);
|
|
66
|
+
// After filtering: only Bob and Carol (both carry 'developer').
|
|
67
|
+
expect(screen.queryByText('Alice')).not.toBeInTheDocument();
|
|
68
|
+
expect(screen.getByText('Bob')).toBeInTheDocument();
|
|
69
|
+
expect(screen.getByText('Carol')).toBeInTheDocument();
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|