@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.
Files changed (241) hide show
  1. package/lib/esm/components/c4-actionable-notification/c4-actionable-notification.d.ts +20 -3
  2. package/lib/esm/components/c4-actionable-notification/c4-actionable-notification.js +50 -17
  3. package/lib/esm/components/c4-advanced-search-filters/ArrayFieldContainer.js +2 -1
  4. package/lib/esm/components/c4-advanced-search-filters/AutosuggestInput.js +1 -6
  5. package/lib/esm/components/c4-advanced-search-filters/FieldRow.js +4 -1
  6. package/lib/esm/components/c4-advanced-search-filters/FiltersSection.js +1 -6
  7. package/lib/esm/components/c4-advanced-search-filters/OrSection.js +3 -1
  8. package/lib/esm/components/c4-advanced-search-filters/c4-advanced-search-filters.js +3 -1
  9. package/lib/esm/components/c4-ai-usage/c4-ai-usage.js +2 -7
  10. package/lib/esm/components/c4-alpha-cluster-at-checkout/c4-alpha-cluster-at-checkout.js +7 -7
  11. package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.js +1 -6
  12. package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.spec.d.ts +1 -0
  13. package/lib/esm/components/c4-app-teaser-card/c4-app-teaster-card.spec.js +43 -0
  14. package/lib/esm/components/c4-app-teaser-cards/c4-app-teaser-cards.js +1 -1
  15. package/lib/esm/components/c4-async-modal/c4-async-modal.js +3 -2
  16. package/lib/esm/components/c4-audit-log/c4-audit-log.js +4 -3
  17. package/lib/esm/components/c4-billing-page/c4-billing-page.js +8 -6
  18. package/lib/esm/components/c4-billing-page/elements/cluster-reservations.js +9 -14
  19. package/lib/esm/components/c4-billing-page/elements/current-usage-metrics.js +2 -1
  20. package/lib/esm/components/c4-billing-page/elements/usage-alerts.js +3 -8
  21. package/lib/esm/components/c4-billing-page/elements/value-metric.js +2 -1
  22. package/lib/esm/components/c4-bottom-links/c4-bottom-links.js +1 -6
  23. package/lib/esm/components/c4-breadcrumb/c4-breadcrumb.js +3 -6
  24. package/lib/esm/components/c4-charts-dashboard/c4-charts-dashboard.js +1 -1
  25. package/lib/esm/components/c4-charts-dashboard/elements/alluvial-chart.js +1 -1
  26. package/lib/esm/components/c4-charts-dashboard/elements/bar-chart.js +1 -1
  27. package/lib/esm/components/c4-charts-dashboard/elements/line-chart.js +1 -1
  28. package/lib/esm/components/c4-cluster-byom-clients/c4-cluster-byom-clients.js +6 -10
  29. package/lib/esm/components/c4-cluster-client-credentials/c4-cluster-client-credentials.js +8 -3
  30. package/lib/esm/components/c4-cluster-client-credentials-identity/c4-cluster-client-credentials-identity.js +8 -3
  31. package/lib/esm/components/c4-cluster-details-activity/c4-cluster-details-activity.js +6 -5
  32. package/lib/esm/components/c4-cluster-details-alerts/c4-cluster-details-alerts.js +12 -14
  33. package/lib/esm/components/c4-cluster-details-clients/c4-cluster-details-clients.js +6 -10
  34. package/lib/esm/components/c4-cluster-details-connector-secrets/c4-cluster-details-connector-secrets.js +8 -11
  35. package/lib/esm/components/c4-cluster-details-encryption/c4-cluster-details-encryption.js +9 -4
  36. package/lib/esm/components/c4-cluster-details-hot-backups/c4-cluster-details-hot-backups.js +12 -8
  37. package/lib/esm/components/c4-cluster-details-hot-backups-restore/c4-cluster-details-hot-backups-restore.js +3 -2
  38. package/lib/esm/components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js +7 -10
  39. package/lib/esm/components/c4-cluster-details-secure-connectivity/c4-cluster-details-secure-connectivity.js +15 -21
  40. package/lib/esm/components/c4-cluster-list/c4-cluster-list.d.ts +1 -1
  41. package/lib/esm/components/c4-cluster-list/c4-cluster-list.js +19 -5
  42. package/lib/esm/components/c4-cluster-list/c4-cluster-list.types.d.ts +4 -0
  43. package/lib/esm/components/c4-cluster-overview/applications.js +2 -1
  44. package/lib/esm/components/c4-cluster-overview/c4-cluster-overview.js +4 -3
  45. package/lib/esm/components/c4-cluster-overview/cluster-details.js +12 -10
  46. package/lib/esm/components/c4-cluster-overview/cluster-load.js +1 -1
  47. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.d.ts +1 -1
  48. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.js +6 -8
  49. package/lib/esm/components/c4-cluster-settings/c4-cluster-settings.types.d.ts +4 -0
  50. package/lib/esm/components/c4-cluster-settings/elements/danger-zone.js +1 -6
  51. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.d.ts +17 -0
  52. package/lib/esm/components/c4-cluster-settings/elements/optimize-filtering-settings.js +75 -0
  53. package/lib/esm/components/c4-cluster-settings/elements/resource-based-authorizations.js +2 -7
  54. package/lib/esm/components/c4-cluster-settings/elements/settings-tile.js +1 -6
  55. package/lib/esm/components/c4-cluster-settings/elements/tasklist-mode-toggle.js +1 -1
  56. package/lib/esm/components/c4-cluster-tag-selector/c4-cluster-tag-selector.js +4 -2
  57. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.js +18 -14
  58. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.d.ts +1 -0
  59. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.spec.js +40 -0
  60. package/lib/esm/components/c4-clusters-empty-state/c4-clusters-empty-state.types.d.ts +2 -0
  61. package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.js +4 -9
  62. package/lib/esm/components/c4-clusters-trial-notification/c4-clusters-trial-notification.types.d.ts +2 -0
  63. package/lib/esm/components/c4-console-dashboard/c4-console-dashboard.js +11 -7
  64. package/lib/esm/components/c4-console-dashboard/elements/empty-state.js +2 -2
  65. package/lib/esm/components/c4-create-cluster/c4-create-cluster.js +44 -15
  66. package/lib/esm/components/c4-create-cluster-api-client-modal/c4-create-cluster-api-client-modal.js +4 -2
  67. package/lib/esm/components/c4-create-connector-secret-modal/c4-create-connector-secret-modal.js +4 -2
  68. package/lib/esm/components/c4-create-console-api-client-modal/c4-create-console-api-client-modal.js +2 -1
  69. package/lib/esm/components/c4-create-trial-organization-modal/c4-create-trial-organization-modal.js +2 -1
  70. package/lib/esm/components/c4-dashboard-first-launch/c4-dashboard-first-launch.js +1 -6
  71. package/lib/esm/components/c4-data-table/c4-data-table-skeleton.d.ts +15 -0
  72. package/lib/esm/components/c4-data-table/c4-data-table-skeleton.js +26 -0
  73. package/lib/esm/components/c4-data-table/c4-data-table.d.ts +3 -0
  74. package/lib/esm/components/c4-data-table/c4-data-table.js +194 -0
  75. package/lib/esm/components/c4-data-table/c4-data-table.spec.d.ts +1 -0
  76. package/lib/esm/components/c4-data-table/c4-data-table.spec.js +71 -0
  77. package/lib/esm/components/c4-delete-organization-modal/c4-delete-organization-modal.js +3 -2
  78. package/lib/esm/components/c4-empty-state/c4-empty-state.d.ts +47 -0
  79. package/lib/esm/components/c4-empty-state/c4-empty-state.js +33 -0
  80. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.d.ts +3 -0
  81. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.js +51 -0
  82. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.d.ts +1 -0
  83. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.spec.js +33 -0
  84. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.d.ts +8 -0
  85. package/lib/esm/components/c4-extend-trial-modal/c4-extend-trial-modal.types.js +1 -0
  86. package/lib/esm/components/c4-external-link/c4-external-link.js +1 -6
  87. package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.d.ts +40 -0
  88. package/lib/esm/components/c4-feedback-modal/c4-feedback-modal.js +109 -0
  89. package/lib/esm/components/c4-help-center/c4-help-center.d.ts +50 -0
  90. package/lib/esm/components/c4-help-center/c4-help-center.js +39 -0
  91. package/lib/esm/components/c4-inline-notification/c4-inline-notification.d.ts +15 -0
  92. package/lib/esm/components/c4-inline-notification/c4-inline-notification.js +37 -0
  93. package/lib/esm/components/c4-invite-user-to-organization-modal/c4-invite-user-to-organization-modal.js +4 -3
  94. package/lib/esm/components/c4-job-dashboard-details-page/c4-job-dashboard-details-page.js +4 -2
  95. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-chart-heading.js +1 -1
  96. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-error-table.js +3 -8
  97. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-time-chart.js +1 -1
  98. package/lib/esm/components/c4-job-dashboard-details-page/elements/c4-job-dashboard-worker-table.js +3 -3
  99. package/lib/esm/components/c4-job-dashboard-entry-point/c4-job-dashboard-entry-point.js +2 -1
  100. package/lib/esm/components/c4-job-dashboard-overview-page/c4-job-dashboard-overview.js +43 -46
  101. package/lib/esm/components/c4-job-dashboard-shared/c4-background-fetching-indicator.js +1 -6
  102. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-error-handler.js +1 -1
  103. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-table-heading-with-tooltip.js +1 -1
  104. package/lib/esm/components/c4-job-dashboard-shared/c4-job-dashboard-time-range-dropdown.js +1 -1
  105. package/lib/esm/components/c4-leave-organization-modal/c4-leave-organization-modal.js +1 -6
  106. package/lib/esm/components/c4-link-button/c4-link-button.js +1 -6
  107. package/lib/esm/components/c4-llm-usage-meter/c4-llm-usage-meter.js +1 -1
  108. package/lib/esm/components/c4-management-activity/c4-management-activity.js +7 -9
  109. package/lib/esm/components/c4-management-api/c4-management-api.js +9 -11
  110. package/lib/esm/components/c4-management-overview/c4-management-overview.js +8 -12
  111. package/lib/esm/components/c4-management-settings/c4-management-settings.js +9 -11
  112. package/lib/esm/components/c4-management-users/c4-management-users.js +4 -9
  113. package/lib/esm/components/c4-multi-step-modal/c4-multi-step-modal.js +4 -2
  114. package/lib/esm/components/c4-multi-step-modal-ugly/c4-multi-step-modal-ugly.js +4 -2
  115. package/lib/esm/components/c4-navigation/c4-navigation.d.ts +55 -0
  116. package/lib/esm/components/c4-navigation/c4-navigation.js +175 -0
  117. package/lib/esm/components/c4-old-dashboard/c4-old-dashboard.js +2 -1
  118. package/lib/esm/components/c4-page-layout/c4-page-layout.d.ts +13 -0
  119. package/lib/esm/components/c4-page-layout/c4-page-layout.js +23 -0
  120. package/lib/esm/components/c4-page-template/c4-page-template.js +14 -3
  121. package/lib/esm/components/c4-permission-error-page/c4-permission-error-page.js +1 -1
  122. package/lib/esm/components/c4-pricing/c4-pricing.js +3 -7
  123. package/lib/esm/components/c4-pricing-card/c4-pricing-card.js +1 -1
  124. package/lib/esm/components/c4-rename-organization-modal/c4-rename-organization-modal.js +1 -1
  125. package/lib/esm/components/c4-search/c4-search-results.js +2 -1
  126. package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.d.ts +20 -0
  127. package/lib/esm/components/c4-selectable-tile/c4-selectable-tile.js +41 -0
  128. package/lib/esm/components/c4-sm-cluster-details/automation-components.js +2 -1
  129. package/lib/esm/components/c4-sm-cluster-details/c4-sm-cluster-details.js +1 -6
  130. package/lib/esm/components/c4-sm-cluster-details/custom-properties.js +4 -8
  131. package/lib/esm/components/c4-sm-cluster-details/details.js +5 -4
  132. package/lib/esm/components/c4-sm-cluster-details/zeebe-components.js +2 -1
  133. package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.js +1 -1
  134. package/lib/esm/components/c4-sm-dashboard/c4-sm-dashboard.types.d.ts +1 -1
  135. package/lib/esm/components/c4-sm-dashboard/cluster-tile.js +2 -1
  136. package/lib/esm/components/c4-sm-dashboard/component-tile.js +2 -1
  137. package/lib/esm/components/c4-sm-dashboard/explore.js +1 -6
  138. package/lib/esm/components/c4-sm-dashboard/overview.js +1 -1
  139. package/lib/esm/components/c4-sm-dashboard/usage-tile.js +2 -1
  140. package/lib/esm/components/c4-stat/c4-stat.js +1 -6
  141. package/lib/esm/components/c4-stateful-button/c4-stateful-button.js +2 -1
  142. package/lib/esm/components/c4-structured-list/c4-structured-list.d.ts +21 -0
  143. package/lib/esm/components/c4-structured-list/c4-structured-list.js +75 -0
  144. package/lib/esm/components/c4-tabs/c4-tabs.js +2 -1
  145. package/lib/esm/components/c4-telemetry-page/c4-telemetry-page.js +6 -2
  146. package/lib/esm/components/c4-telemetry-page/component-metrics.js +1 -6
  147. package/lib/esm/components/c4-telemetry-page/telemetry-for-component.js +2 -1
  148. package/lib/esm/components/c4-telemetry-teaser-page/c4-telemetry-teaser-page.js +1 -1
  149. package/lib/esm/components/c4-theme-switcher/c4-theme-switcher.js +1 -1
  150. package/lib/esm/components/c4-tile-with-title-and-action/c4-tile-with-title-and-action.js +1 -1
  151. package/lib/esm/components/c4-toast-notification/c4-toast-notification.d.ts +14 -0
  152. package/lib/esm/components/c4-toast-notification/c4-toast-notification.js +27 -0
  153. package/lib/esm/components/c4-toggle/c4-toggle.js +6 -8
  154. package/lib/esm/components/c4-tutorial-tile/c4-tutorial-tile.js +1 -1
  155. package/lib/esm/components/c4-usage-alert-update-modal/c4-usage-alert-update-modal.js +4 -2
  156. package/lib/esm/components/c4-usage-history/c4-usage-history.js +5 -3
  157. package/lib/esm/components/c4-usage-history/elements/usage-history-charts.js +1 -1
  158. package/lib/esm/components/c4-usage-metrics-per-cluster/c4-usage-metrics-per-cluster.js +8 -7
  159. package/lib/esm/components/c4-user-details/c4-user-details.js +2 -2
  160. package/lib/esm/components/c4-user-details/tabs/authorized-resources.js +1 -1
  161. package/lib/esm/components/c4-user-details/tabs/details.js +6 -10
  162. package/lib/esm/components/c4-user-details/tabs/roles.js +3 -8
  163. package/lib/esm/i18n/c4-console-i18n.js +12 -0
  164. package/lib/esm/i18n/en/modals/clusters.json +0 -8
  165. package/lib/esm/i18n/en/pages/clusterdetails.json +5 -1
  166. package/lib/esm/i18n/en/pages/clusters.json +5 -1
  167. package/lib/esm/i18n/en/pages/orgmanagement.json +3 -1
  168. package/lib/esm/index.d.ts +17 -0
  169. package/lib/esm/index.js +13 -0
  170. package/lib/esm/runtime/c4-console-authz.d.ts +1 -0
  171. package/lib/esm/runtime/c4-console-authz.js +2 -1
  172. package/lib/esm/runtime/c4-console-authz.spec.js +3 -3
  173. package/lib/esm/runtime/c4-console-runtime-context.d.ts +8 -1
  174. package/lib/esm/runtime/c4-console-runtime-context.js +50 -1
  175. package/lib/esm/runtime/c4-console-runtime.types.d.ts +8 -0
  176. package/lib/esm/ui/c4-modal-dialog.d.ts +14 -0
  177. package/lib/esm/ui/c4-modal-dialog.js +35 -0
  178. package/lib/esm/ui/families.d.ts +42 -0
  179. package/lib/esm/ui/families.js +46 -0
  180. package/lib/esm/ui/index.d.ts +31 -0
  181. package/lib/esm/ui/index.js +94 -0
  182. package/lib/esm/ui/switchable.d.ts +14 -0
  183. package/lib/esm/ui/switchable.js +27 -0
  184. package/lib/esm/ui/tabs.d.ts +21 -0
  185. package/lib/esm/ui/tabs.js +27 -0
  186. package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +7 -5
  187. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +18 -3
  188. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.js +1 -1
  189. package/lib/esm/widgets/cluster-details/c4-cluster-details-page.spec.js +2 -0
  190. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-alerts-tab.js +10 -6
  191. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +5 -3
  192. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +7 -5
  193. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +10 -6
  194. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.d.ts +7 -0
  195. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +8 -3
  196. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.spec.js +49 -1
  197. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +7 -5
  198. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +54 -21
  199. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.spec.js +96 -5
  200. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +12 -9
  201. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +58 -4
  202. package/lib/esm/widgets/clusters/c4-clusters-page.d.ts +1 -1
  203. package/lib/esm/widgets/clusters/c4-clusters-page.js +276 -40
  204. package/lib/esm/widgets/clusters/c4-clusters-page.spec.js +220 -0
  205. package/lib/esm/widgets/clusters/c4-clusters-page.types.d.ts +3 -0
  206. package/lib/esm/widgets/connector-management/c4-connector-management-executable-details-page.js +1 -1
  207. package/lib/esm/widgets/connector-management/c4-connector-management-executables-table-page.js +3 -2
  208. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.d.ts +4 -0
  209. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.js +59 -0
  210. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.d.ts +18 -0
  211. package/lib/esm/widgets/connector-management/c4-connector-management-outbound-details-page.types.js +6 -0
  212. package/lib/esm/widgets/connector-management/c4-connector-management-page.d.ts +1 -1
  213. package/lib/esm/widgets/connector-management/c4-connector-management-page.js +38 -5
  214. package/lib/esm/widgets/connector-management/c4-connector-management-page.spec.js +54 -0
  215. package/lib/esm/widgets/connector-management/c4-connector-management-page.types.d.ts +11 -0
  216. package/lib/esm/widgets/connector-management/c4-connector-management.shared.d.ts +1 -0
  217. package/lib/esm/widgets/connector-management/c4-connector-management.shared.js +10 -2
  218. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +1 -1
  219. package/lib/esm/widgets/job-worker/c4-job-worker.helpers.js +14 -2
  220. package/lib/esm/widgets/management/c4-management-app.d.ts +1 -1
  221. package/lib/esm/widgets/management/c4-management-app.js +57 -4
  222. package/lib/esm/widgets/management/c4-management-app.spec.js +141 -1
  223. package/lib/esm/widgets/management/c4-management-app.types.d.ts +5 -0
  224. package/lib/esm/widgets/management/c4-management-page.js +1 -6
  225. package/lib/esm/widgets/management/tabs/c4-management-api-tab.js +4 -2
  226. package/lib/esm/widgets/management/tabs/c4-management-billing-tab.js +1 -1
  227. package/lib/esm/widgets/management/tabs/c4-management-groups-tab.js +1 -1
  228. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.d.ts +2 -1
  229. package/lib/esm/widgets/management/tabs/c4-management-overview-tab.js +10 -3
  230. package/lib/esm/widgets/management/tabs/c4-management-pricing-tab.js +2 -1
  231. package/lib/esm/widgets/management/tabs/c4-management-settings-tab.js +1 -1
  232. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.d.ts +1 -1
  233. package/lib/esm/widgets/management/tabs/c4-management-usage-tab.js +13 -11
  234. package/lib/esm/widgets/management/tabs/c4-management-users-tab.js +47 -5
  235. package/lib/esm/widgets/management/tabs/c4-management-users-tab.spec.js +98 -0
  236. package/lib/esm/widgets/use-extend-trial.d.ts +8 -0
  237. package/lib/esm/widgets/use-extend-trial.js +36 -0
  238. package/lib/esm/widgets/use-extend-trial.spec.d.ts +1 -0
  239. package/lib/esm/widgets/use-extend-trial.spec.js +79 -0
  240. package/lib/esm/widgets/user-details/c4-user-details-page.js +5 -4
  241. package/package.json +21 -14
@@ -5,12 +5,16 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
7
  import { C3ClusterTag } from '@camunda/camunda-composite-components';
8
- import { ActionableNotification, Button, Column, Grid, Link, Stack, StructuredListBody, StructuredListCell, StructuredListHead, StructuredListRow, StructuredListWrapper, Tile, Tooltip, } from '@carbon/react';
8
+ import { Column, Grid } from '@carbon/react';
9
9
  import * as Icons from '@carbon/react/icons/index.esm.js';
10
10
  import { Chat, Help, WarningAltFilled } from '@carbon/react/icons/index.esm.js';
11
11
  import { useCallback, useMemo, useState } from 'react';
12
+ import { Button, Link, Stack, Tile, Tooltip } from '../../ui/index.js';
13
+ import { C4ActionableNotification } from '../c4-actionable-notification/c4-actionable-notification.js';
12
14
  import { ClusterStatusElement } from '../c4-cluster-overview/applications.js';
13
15
  import { C4IconAndTextElement, getClusterLoadConfig, } from '../c4-cluster-overview/c4-cluster-overview.js';
16
+ import { C4PageLayout } from '../c4-page-layout/c4-page-layout.js';
17
+ import { C4StructuredListBody, C4StructuredListCell, C4StructuredListHead, C4StructuredListRow, C4StructuredListWrapper, } from '../c4-structured-list/c4-structured-list.js';
14
18
  import { ValueMetricsLineChart } from '../c4-usage-history/elements/usage-history-charts.js';
15
19
  import { EmptyState } from './elements/empty-state.js';
16
20
  const DAY_MS = 24 * 60 * 60 * 1000;
@@ -60,7 +64,7 @@ export const C4ConsoleDashboard = ({ orgId, usersAmount, taskUsersAmount, cluste
60
64
  }
61
65
  }
62
66
  }, []);
63
- const component = (_jsx(_Fragment, { children: _jsxs(Grid, { style: { gap: '16px' }, children: [_jsx(Column, { lg: 16, md: 8, sm: 4, children: _jsx("div", { style: {
67
+ const component = (_jsx(C4PageLayout, { children: _jsxs(Grid, { style: { gap: '16px' }, children: [_jsx(Column, { lg: 16, md: 8, sm: 4, children: _jsx("div", { style: {
64
68
  display: 'flex',
65
69
  justifyContent: 'flex-end',
66
70
  }, children: _jsx(Button, { onClick: actions.onFeedbackClick, kind: 'ghost', renderIcon: Chat, style: {
@@ -91,7 +95,7 @@ export const C4ConsoleDashboard = ({ orgId, usersAmount, taskUsersAmount, cluste
91
95
  }, children: [_jsx("h3", { children: texts.clusters.title }), _jsx("div", { children: _jsx(Link, { href: urls.clusters, onClick: (e) => {
92
96
  e.preventDefault();
93
97
  actions.onNavigateToClusters();
94
- }, children: texts.clusters.viewClusters }) })] }), _jsx("div", { style: { overflowX: 'scroll' }, children: _jsx(Stack, { gap: 6, children: clusters.length > 0 ? (_jsxs(StructuredListWrapper, { isCondensed: true, children: [_jsx(StructuredListHead, { children: _jsxs(StructuredListRow, { head: true, children: [_jsx(StructuredListCell, { head: true, children: texts.clusters.table.name }), _jsx(StructuredListCell, { head: true, children: texts.clusters.table.tags }), _jsx(StructuredListCell, { head: true, children: texts.clusters.table.status }), _jsx(StructuredListCell, { head: true, children: texts.clusters.table.version }), permissions.showClusterLoad && (_jsx(StructuredListCell, { head: true, children: texts.clusters.table.load }))] }) }), _jsx(StructuredListBody, { children: clusters.slice(0, 6).map((item, index) => {
98
+ }, children: texts.clusters.viewClusters }) })] }), _jsx("div", { style: { overflowX: 'auto' }, children: _jsx(Stack, { gap: 6, children: clusters.length > 0 ? (_jsxs(C4StructuredListWrapper, { isCondensed: true, children: [_jsx(C4StructuredListHead, { children: _jsxs(C4StructuredListRow, { head: true, children: [_jsx(C4StructuredListCell, { head: true, children: texts.clusters.table.name }), _jsx(C4StructuredListCell, { head: true, children: texts.clusters.table.tags }), _jsx(C4StructuredListCell, { head: true, children: texts.clusters.table.status }), _jsx(C4StructuredListCell, { head: true, children: texts.clusters.table.version }), permissions.showClusterLoad && (_jsx(C4StructuredListCell, { head: true, children: texts.clusters.table.load }))] }) }), _jsx(C4StructuredListBody, { children: clusters.slice(0, 6).map((item, index) => {
95
99
  const currentClusterLoad = getClusterLoad?.(item.id);
96
100
  const hasClusterLoad = typeof currentClusterLoad === 'number' &&
97
101
  Number.isFinite(currentClusterLoad);
@@ -101,10 +105,10 @@ export const C4ConsoleDashboard = ({ orgId, usersAmount, taskUsersAmount, cluste
101
105
  ? getClusterLoadConfig(currentClusterLoad)
102
106
  : undefined;
103
107
  const hasWarning = item.version.includes('update available');
104
- return (_jsxs(StructuredListRow, { children: [_jsx(StructuredListCell, { children: _jsx(Link, { href: urls.clusterDetails(item.id), onClick: (e) => {
108
+ return (_jsxs(C4StructuredListRow, { children: [_jsx(C4StructuredListCell, { children: _jsx(Link, { href: urls.clusterDetails(item.id), onClick: (e) => {
105
109
  e.preventDefault();
106
110
  actions.onNavigateToClusterDetails(item.id);
107
- }, children: item.name }) }), _jsx(StructuredListCell, { children: item.tags && (_jsx(C3ClusterTag, { stage: item.tags })) }), _jsx(StructuredListCell, { children: _jsx(ClusterStatusElement, { status: item.status.toLowerCase() }) }), _jsx(StructuredListCell, { children: _jsx("div", { style: { position: 'relative' }, children: hasWarning ? (_jsxs(_Fragment, { children: [_jsx("div", { style: {
111
+ }, children: item.name }) }), _jsx(C4StructuredListCell, { children: item.tags && (_jsx(C3ClusterTag, { stage: item.tags })) }), _jsx(C4StructuredListCell, { children: _jsx(ClusterStatusElement, { status: item.status.toLowerCase() }) }), _jsx(C4StructuredListCell, { children: _jsx("div", { style: { position: 'relative' }, children: hasWarning ? (_jsxs(_Fragment, { children: [_jsx("div", { style: {
108
112
  position: 'absolute',
109
113
  top: '50%',
110
114
  transform: 'translateY(-50%)',
@@ -112,7 +116,7 @@ export const C4ConsoleDashboard = ({ orgId, usersAmount, taskUsersAmount, cluste
112
116
  color: 'var(--cds-support-warning)',
113
117
  }, children: _jsx(WarningAltFilled, {}) }), _jsx("span", { style: {
114
118
  paddingInlineStart: '1.1rem',
115
- }, children: item.version })] })) : (item.version) }) }), permissions.showClusterLoad && (_jsxs(StructuredListCell, { children: [hasClusterLoad &&
119
+ }, children: item.version })] })) : (item.version) }) }), permissions.showClusterLoad && (_jsxs(C4StructuredListCell, { children: [hasClusterLoad &&
116
120
  currentClusterLoadConfig &&
117
121
  item.status !== 'Suspended' && (_jsx(C4IconAndTextElement, { text: `${currentClusterLoad.toFixed(2)}%`, color: currentClusterLoadConfig.color, icon: currentClusterLoadConfig.icon, tooltip: {
118
122
  label: clusterLoadTooltip || '',
@@ -160,7 +164,7 @@ export const C4ConsoleDashboard = ({ orgId, usersAmount, taskUsersAmount, cluste
160
164
  e.preventDefault();
161
165
  actions.onNavigateToUsage();
162
166
  }, children: texts.charts.viewUsage }) })] }), processInstancesChartLast14Days.dataPoints.length > 0 ? (_jsx("div", { ref: piCallbackRef, style: { maxHeight: '424px', overflowY: 'auto' }, children: _jsx(ValueMetricsLineChart, { ...processInstancesChartLast14Days, height: totalPiHeight }, `${orgId}-pi`) })) : (_jsx(EmptyState, { iconName: 'ChartLine', text: texts.charts.noUsage }))] }) }) })] }) })] }) }), _jsx(Column, { lg: 5, md: 8, sm: 4, children: _jsx(Grid, { condensed: true, children: _jsx(Column, { lg: 5, md: 8, sm: 4, children: _jsxs(Stack, { gap: 5, children: [_jsx(Tile, { children: _jsxs(Stack, { gap: 6, children: [_jsx("h3", { children: texts.alerts.title }), _jsx(Stack, { gap: 4, children: alerts.length > 0 ? (alerts.map((alert) => {
163
- return (_jsx(ActionableNotification, { role: 'banner', title: alert.text, kind: alert.kind, actionButtonLabel: texts.alerts.inspectButton, lowContrast: true, onActionButtonClick: actions.onNavigateToClusters, inline: true, style: { marginBottom: '.5rem' }, onCloseButtonClick: () => {
167
+ return (_jsx(C4ActionableNotification, { role: 'banner', title: alert.text, kind: alert.kind, actionButtonLabel: texts.alerts.inspectButton, lowContrast: true, onActionButtonClick: actions.onNavigateToClusters, inline: true, style: { marginBottom: '.5rem' }, onCloseButtonClick: () => {
164
168
  actions.onCloseAlert(alert);
165
169
  } }, alert.text));
166
170
  })) : (_jsx(EmptyState, { iconName: 'CheckmarkOutline', text: texts.alerts.noAlertsFound })) })] }) }), _jsx(Tile, { children: _jsxs(Stack, { gap: 6, children: [_jsxs("div", { style: {
@@ -4,8 +4,8 @@ import { jsx as _jsx, jsxs as _jsxs } 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 { Button } from '@carbon/react';
8
7
  import * as Icons from '@carbon/react/icons/index.esm.js';
8
+ import { Button } from '../../../ui/index.js';
9
9
  export const EmptyState = ({ iconName, text, action }) => {
10
10
  const Icon = Icons[iconName];
11
11
  return (_jsx("div", { style: { flex: 1, height: '100%' }, children: _jsxs("div", { style: {
@@ -17,5 +17,5 @@ export const EmptyState = ({ iconName, text, action }) => {
17
17
  alignItems: 'center',
18
18
  gap: '8px',
19
19
  color: 'var(--cds-text-secondary)',
20
- }, children: [_jsx("div", { children: _jsx(Icon, { height: '24px', width: '24px', fill: 'var(--cds-text-secondary)' }) }), _jsx("p", { children: text }), action?.text && (_jsx(Button, { size: 'sm', onClick: action.onClick, disabled: action?.disabled ?? false, children: action.text }))] }) }));
20
+ }, children: [_jsx("div", { children: _jsx(Icon, { height: '24px', width: '24px', fill: 'currentColor' }) }), _jsx("p", { children: text }), action?.text && (_jsx(Button, { size: 'sm', onClick: action.onClick, disabled: action?.disabled ?? false, children: action.text }))] }) }));
21
21
  };
@@ -6,14 +6,20 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
6
6
  */
7
7
  import { C3ClusterTag, } from '@camunda/camunda-composite-components';
8
8
  import { ClusterPlanTypeCategory, checkVersion, VersionCheckOperator, } from '@camunda/ccma-shared-types';
9
- import { Button, Checkbox, Column, ContentSwitcher, FormLabel, Grid, InlineLoading, InlineNotification, Link, RadioButton, RadioButtonGroup, RadioTile, SkeletonText, Stack, Switch, Tag, TextArea, TextInput, Tile, } from '@carbon/react';
9
+ import { Input, Textarea } from '@camunda/design-system';
10
+ import { Column, FormLabel, Grid, InlineLoading, Stack, TextArea, TextInput, } from '@carbon/react';
10
11
  import { ChevronDown, ChevronUp, Code, DataBase } from '@carbon/react/icons/index.esm.js';
11
12
  import { useRef, useState } from 'react';
12
13
  import styled from 'styled-components';
14
+ import { useC4DesignSystem } from '../../runtime/c4-console-runtime-context.js';
15
+ import { Button, Checkbox, Link, SkeletonText, Tag, Tile } from '../../ui/index.js';
16
+ import { useContentSwitcherFamily, useRadioFamily } from '../../ui/families.js';
13
17
  import { C4ClusterTagSelector } from '../c4-cluster-tag-selector/c4-cluster-tag-selector.js';
14
18
  import { C4Divider } from '../c4-divider/c4-divider.js';
15
19
  import { C4ExternalLink } from '../c4-external-link/c4-external-link.js';
20
+ import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
16
21
  import { C4LinkButton } from '../c4-link-button/c4-link-button.js';
22
+ import { C4SelectableTile } from '../c4-selectable-tile/c4-selectable-tile.js';
17
23
  var TasklistMode;
18
24
  (function (TasklistMode) {
19
25
  TasklistMode["V1"] = "v1";
@@ -48,7 +54,17 @@ const FormElementTitle = (props) => _jsx("h3", { children: props.title });
48
54
  const ClusterPlanTypeTile = (props) => {
49
55
  return (_jsxs(Stack, { gap: 4, children: [props.type === 'dev' ? _jsx(Code, {}) : _jsx(DataBase, {}), _jsx("h6", { children: props.title }), _jsx("p", { children: props.description })] }));
50
56
  };
57
+ // In ds mode the family RadioButton renders a DS RadioGroupItem (Radix), which
58
+ // must live inside a RadioGroup and is driven by the group's value/onChange
59
+ // (the per-item checked/onChange are dropped). So ds wraps the grid in the
60
+ // family RadioButtonGroup and lifts selection to the group; carbon keeps the
61
+ // plain Grid with self-managed RadioButtons (unchanged).
51
62
  const RadioButtonGroupWithGrid = (props) => {
63
+ const designSystem = useC4DesignSystem();
64
+ const { RadioButtonGroup } = useRadioFamily();
65
+ if (designSystem === 'ds') {
66
+ return (_jsx(RadioButtonGroup, { name: props.name ?? '', valueSelected: props.valueSelected ?? '', onChange: (value) => props.onChange?.(value), children: _jsx(Grid, { children: props.children }) }));
67
+ }
52
68
  return _jsx(Grid, { children: props.children });
53
69
  };
54
70
  const enableMap = {
@@ -58,6 +74,9 @@ const enableMap = {
58
74
  dev: ['dev', 'test'],
59
75
  };
60
76
  export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, tasklistModeToggle, authorizationToggle, banner: { noSlotsLeft }, }) => {
77
+ const designSystem = useC4DesignSystem();
78
+ const { RadioButton, RadioButtonGroup } = useRadioFamily();
79
+ const { ContentSwitcher, Switch } = useContentSwitcherFamily();
61
80
  const preConditions = formElements.clusterPlanType.options.length > 0 &&
62
81
  formElements.region.options.length > 0 &&
63
82
  formElements.generation.channels.length > 0 &&
@@ -376,6 +395,10 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
376
395
  : submitState === 'success'
377
396
  ? cta.states.success
378
397
  : cta.states.error;
398
+ // ds-only: FormLabel's default `--cds-text-secondary` is remapped too dark
399
+ // for the summary panel in ds dark mode; force the primary text token there.
400
+ // Carbon keeps FormLabel's own default (unchanged) by leaving style undefined.
401
+ const summaryLabelStyle = designSystem === 'ds' ? { color: 'var(--cds-text-primary)' } : undefined;
379
402
  return (_jsxs("div", { style: {
380
403
  display: 'grid',
381
404
  gridAutoFlow: 'row',
@@ -383,7 +406,7 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
383
406
  overflow: 'hidden',
384
407
  zIndex: 1,
385
408
  minHeight: '572px',
386
- }, children: [_jsxs("div", { children: [_jsx("h6", { children: "Summary" }), _jsx(C4Divider, {}), _jsxs(Stack, { gap: 4, children: [loading ? (_jsx(SkeletonText, {})) : (_jsxs("h6", { children: [summary.clusterPlanType, " - ", numberOfAllocatedHwPackages, "x"] })), _jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { children: "Provider and region" }), loading ? (_jsx(SkeletonText, {})) : summary.provider ? (`${summary.provider} - ${summary.region}`) : (summary.region)] }), formElements.region.dualRegionBackups && (_jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { children: "Backup region" }), loading ? _jsx(SkeletonText, {}) : summary.backup] })), summary.encryption && (_jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { children: encryptions?.title ?? 'Encryption at rest' }), loading ? _jsx(SkeletonText, {}) : summary.encryption] })), _jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { children: "Channel" }), loading ? _jsx(SkeletonText, {}) : summary.channel] }), _jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { children: "Generation" }), loading ? _jsx(SkeletonText, {}) : summary.generation] }), _jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { children: "Cluster tag" }), loading ? (_jsx(SkeletonText, {})) : (_jsx("span", { children: _jsx(C3ClusterTag, { stage: summary.stageTag }) }))] })] })] }), !loading && (_jsx("div", { style: { alignSelf: 'end' }, children: _jsx("div", { children: _jsxs(Stack, { gap: 3, children: [['submitting', 'success', 'error'].includes(submitState) ? (_jsx(InlineLoading, { description: submitStateDescription, status: getInlineStatusByState(submitState), style: { marginLeft: '1rem' } })) : (_jsx(Button, { disabled: !clusterCreationAllowed(), style: { width: '100%' }, onClick: handleSubmit, children: cta.label })), cta.cancel && (_jsx(Button, { onClick: () => {
409
+ }, children: [_jsxs("div", { children: [_jsx("h6", { children: "Summary" }), _jsx(C4Divider, {}), _jsxs(Stack, { gap: 4, children: [loading ? (_jsx(SkeletonText, {})) : (_jsxs("h6", { children: [summary.clusterPlanType, " - ", numberOfAllocatedHwPackages, "x"] })), _jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { style: summaryLabelStyle, children: "Provider and region" }), loading ? (_jsx(SkeletonText, {})) : summary.provider ? (`${summary.provider} - ${summary.region}`) : (summary.region)] }), formElements.region.dualRegionBackups && (_jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { style: summaryLabelStyle, children: "Backup region" }), loading ? _jsx(SkeletonText, {}) : summary.backup] })), summary.encryption && (_jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { style: summaryLabelStyle, children: encryptions?.title ?? 'Encryption at rest' }), loading ? _jsx(SkeletonText, {}) : summary.encryption] })), _jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { style: summaryLabelStyle, children: "Channel" }), loading ? _jsx(SkeletonText, {}) : summary.channel] }), _jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { style: summaryLabelStyle, children: "Generation" }), loading ? _jsx(SkeletonText, {}) : summary.generation] }), _jsxs(Stack, { gap: 1, children: [_jsx(FormLabel, { style: summaryLabelStyle, children: "Cluster tag" }), loading ? (_jsx(SkeletonText, {})) : (_jsx("span", { children: _jsx(C3ClusterTag, { stage: summary.stageTag }) }))] })] })] }), !loading && (_jsx("div", { style: { alignSelf: 'end' }, children: _jsx("div", { children: _jsxs(Stack, { gap: 3, children: [['submitting', 'success', 'error'].includes(submitState) ? (_jsx(InlineLoading, { description: submitStateDescription, status: getInlineStatusByState(submitState), style: { marginLeft: '1rem' } })) : (_jsx(Button, { disabled: !clusterCreationAllowed(), style: { width: '100%' }, onClick: handleSubmit, children: cta.label })), cta.cancel && (_jsx(Button, { onClick: () => {
387
410
  if (cta.cancel) {
388
411
  cta.cancel.onClick();
389
412
  }
@@ -403,10 +426,10 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
403
426
  }
404
427
  return (_jsxs(Stack, { gap: 2, children: [_jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(FormElementTitle, { title: authorizationToggle?.title ?? '' }) }) }), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '1rem' }, children: [_jsxs(RadioButtonGroup, { valueSelected: authorizationEnabled ? 'true' : 'false', invalidText: 'Invalid selection', legendText: _jsx("div", {}), name: 'authorization-mode', warnText: 'Please select an option', required: true, orientation: 'horizontal', onChange: (selection) => {
405
428
  setAuthorizationEnabled(selection === 'true');
406
- }, children: [_jsx(RadioButton, { id: 'authorization-enabled', labelText: 'Enabled', value: 'true' }), _jsx(RadioButton, { id: 'authorization-disabled', labelText: 'Disabled', value: 'false' })] }, authorizationEnabled ? 'true' : 'false'), _jsxs("div", { children: [_jsx("p", { children: "When enabled, authorization-based access control is enforced." }), _jsxs("p", { children: ["When disabled, all users and clients will have full access to the cluster.", ' ', _jsx("a", { href: authorizationToggle.authorizationDocs, target: '_blank', rel: 'noopener', children: "Learn more" })] })] }), !authorizationEnabled && (_jsx(InlineNotification, { lowContrast: true, kind: ['stage', 'prod'].includes(selectedTag) ? 'warning' : 'info', hideCloseButton: true, title: 'Authorizations disabled', children: _jsx("p", { children: "All authenticated users & clients will have full access to the cluster." }) }))] }) }) })] }));
429
+ }, children: [_jsx(RadioButton, { id: 'authorization-enabled', labelText: 'Enabled', value: 'true' }), _jsx(RadioButton, { id: 'authorization-disabled', labelText: 'Disabled', value: 'false' })] }, authorizationEnabled ? 'true' : 'false'), _jsxs("div", { children: [_jsx("p", { children: "When enabled, authorization-based access control is enforced." }), _jsxs("p", { children: ["When disabled, all users and clients will have full access to the cluster.", ' ', _jsx("a", { href: authorizationToggle.authorizationDocs, target: '_blank', rel: 'noopener', children: "Learn more" })] })] }), !authorizationEnabled && (_jsx(C4InlineNotification, { lowContrast: true, kind: ['stage', 'prod'].includes(selectedTag) ? 'warning' : 'info', hideCloseButton: true, title: 'Authorizations disabled', children: _jsx("p", { children: "All authenticated users & clients will have full access to the cluster." }) }))] }) }) })] }));
407
430
  };
408
431
  const renderGenerationRadioButtons = (generations) => {
409
- return (_jsx(RadioButtonGroupWithGrid, { children: generations.map((generation) => (_jsx(Column, { sm: 4, md: 4, lg: 3, style: {
432
+ return (_jsx(RadioButtonGroupWithGrid, { valueSelected: selectedGeneration, onChange: (value) => updateSelectedGeneration(value), children: generations.map((generation) => (_jsx(Column, { sm: 4, md: 4, lg: 3, style: {
410
433
  justifySelf: 'start',
411
434
  marginBottom: '0.5rem',
412
435
  }, children: _jsx(RadioButton, { id: generation.uuid, value: generation.uuid, labelText: generation.title, checked: selectedGeneration === generation.uuid, onChange: (value) => {
@@ -457,27 +480,33 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
457
480
  if (!preConditions) {
458
481
  return (_jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx("p", { children: "Something went wrong. Please try again later." }) }) }));
459
482
  }
460
- return (_jsxs(Stack, { gap: 6, children: [noAvailableSlots && (_jsx(InlineNotification, { kind: 'warning', hideCloseButton: true, style: { minWidth: '0' }, title: noSlotsLeft.title, subtitle: noSlotsLeft.description })), _jsxs(Stack, { gap: 2, children: [_jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(FormElementTitle, { title: formElements.name.title }) }) }), _jsx(Grid, { children: _jsx(Column, { span: 8, children: _jsx(TextInput, { ref: clusterNameInputFieldRef, invalidText: clusterNameValidation.message, invalid: !clusterNameValidation.isValid, type: 'text', id: 'cluster-name', placeholder: formElements.name.placeholder, onChange: (event) => updateClusterName(event.target.value), labelText: '', disabled: isSubmitting() || noAvailableSlots }) }) })] }), formElements.description && (_jsxs(Stack, { gap: 2, children: [_jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(FormElementTitle, { title: formElements.description.title }) }) }), _jsx(Grid, { children: _jsx(Column, { span: 8, children: _jsx(TextArea, { ref: clusterDescriptionInputFieldRef, id: 'cluster-description', placeholder: formElements.description.placeholder, onChange: (event) => {
461
- setClusterDescriptionValidation({
462
- isValid: true,
463
- message: '',
464
- });
465
- setClusterDescription(event.target.value);
466
- }, labelText: '', disabled: isSubmitting() || noAvailableSlots, rows: 3, invalid: !clusterDescriptionValidation.isValid, invalidText: clusterDescriptionValidation.message }) }) })] })), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(C4Divider, {}) }) }), _jsxs(Stack, { gap: 2, ref: regionSectionRef, children: [_jsx(Grid, { children: _jsxs(Column, { span: 12, children: [_jsx(FormElementTitle, { title: formElements.region.title }), !regionValidation.isValid && (_jsx("p", { style: {
483
+ return (_jsxs(Stack, { gap: 6, children: [noAvailableSlots && (_jsx(C4InlineNotification, { kind: 'warning', hideCloseButton: true, style: { minWidth: '0' }, title: noSlotsLeft.title, subtitle: noSlotsLeft.description })), _jsxs(Stack, { gap: 2, children: [_jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(FormElementTitle, { title: formElements.name.title }) }) }), _jsx(Grid, { children: _jsx(Column, { span: 8, children: _jsx("div", { ref: clusterNameInputFieldRef, children: designSystem === 'ds' ? (_jsxs(_Fragment, { children: [_jsx(Input, { type: 'text', id: 'cluster-name', placeholder: formElements.name.placeholder, "aria-invalid": !clusterNameValidation.isValid || undefined, disabled: isSubmitting() || noAvailableSlots, onChange: (event) => updateClusterName(event.target.value) }), !clusterNameValidation.isValid && (_jsx("span", { className: 'mt-1 block text-xs text-danger-action-default', children: clusterNameValidation.message }))] })) : (_jsx(TextInput, { invalidText: clusterNameValidation.message, invalid: !clusterNameValidation.isValid, type: 'text', id: 'cluster-name', placeholder: formElements.name.placeholder, onChange: (event) => updateClusterName(event.target.value), labelText: '', disabled: isSubmitting() || noAvailableSlots })) }) }) })] }), formElements.description && (_jsxs(Stack, { gap: 2, children: [_jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(FormElementTitle, { title: formElements.description.title }) }) }), _jsx(Grid, { children: _jsx(Column, { span: 8, children: _jsx("div", { ref: clusterDescriptionInputFieldRef, children: designSystem === 'ds' ? (_jsxs(_Fragment, { children: [_jsx(Textarea, { id: 'cluster-description', placeholder: formElements.description.placeholder, rows: 3, "aria-invalid": !clusterDescriptionValidation.isValid || undefined, disabled: isSubmitting() || noAvailableSlots, onChange: (event) => {
484
+ setClusterDescriptionValidation({
485
+ isValid: true,
486
+ message: '',
487
+ });
488
+ setClusterDescription(event.target.value);
489
+ } }), !clusterDescriptionValidation.isValid && (_jsx("span", { className: 'mt-1 block text-xs text-danger-action-default', children: clusterDescriptionValidation.message }))] })) : (_jsx(TextArea, { id: 'cluster-description', placeholder: formElements.description.placeholder, onChange: (event) => {
490
+ setClusterDescriptionValidation({
491
+ isValid: true,
492
+ message: '',
493
+ });
494
+ setClusterDescription(event.target.value);
495
+ }, labelText: '', disabled: isSubmitting() || noAvailableSlots, rows: 3, invalid: !clusterDescriptionValidation.isValid, invalidText: clusterDescriptionValidation.message })) }) }) })] })), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(C4Divider, {}) }) }), _jsxs(Stack, { gap: 2, ref: regionSectionRef, children: [_jsx(Grid, { children: _jsxs(Column, { span: 12, children: [_jsx(FormElementTitle, { title: formElements.region.title }), !regionValidation.isValid && (_jsx("p", { style: {
467
496
  color: 'var(--cds-text-error)',
468
497
  marginTop: '0.25rem',
469
498
  marginBottom: '0.5rem',
470
499
  }, children: regionValidation.message })), getUniqueProviders().length > 1 && (_jsx(ContentSwitcher, { size: 'md', style: {
471
500
  width: `${7 * getUniqueProviders().length}rem`,
472
501
  marginBottom: '0.5rem',
473
- }, onChange: (data) => updateProvider(String(data.name ?? '')), selectedIndex: getUniqueProviders().indexOf(provider), children: getUniqueProviders().map((provider) => (_jsx(Switch, { name: provider, children: provider }, provider))) }))] }) }), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(RadioButtonGroupWithGrid, { children: formElements.region.options
502
+ }, onChange: (data) => updateProvider(String(data.name ?? '')), selectedIndex: getUniqueProviders().indexOf(provider), children: getUniqueProviders().map((provider) => (_jsx(Switch, { name: provider, children: provider }, provider))) }))] }) }), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(RadioButtonGroupWithGrid, { valueSelected: region, onChange: (value) => updateRegion(value), children: formElements.region.options
474
503
  .filter((option) => option.provider === provider)
475
504
  .map((option) => (_jsx(Column, { sm: 4, md: 6, lg: 4, style: { justifySelf: 'start', marginBottom: '0.5rem' }, children: _jsx(RadioButton, { id: option.uuid, value: option.uuid, labelText: option.title, checked: option.uuid === region, disabled: isSubmitting() || noAvailableSlots, onChange: (value) => {
476
505
  updateRegion(value);
477
506
  } }, option.uuid) }, option.uuid))) }) }) }), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx("p", { children: formElements.region.description }) }) })] }), (() => {
478
507
  if (formElements.region.dualRegionBackups) {
479
508
  const selectedRegion = formElements.region.options.find((reg) => reg.uuid === region);
480
- return (_jsxs(Stack, { gap: 2, children: [_jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(FormElementTitle, { title: formElements.region.backupRegionTitle }) }) }), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(RadioButtonGroupWithGrid, { children: selectedRegion?.backups.map((option) => (_jsx(Column, { sm: 4, md: 6, lg: 4, style: {
509
+ return (_jsxs(Stack, { gap: 2, children: [_jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(FormElementTitle, { title: formElements.region.backupRegionTitle }) }) }), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(RadioButtonGroupWithGrid, { valueSelected: backupRegion, onChange: (value) => updateBackupRegion(value), children: selectedRegion?.backups.map((option) => (_jsx(Column, { sm: 4, md: 6, lg: 4, style: {
481
510
  justifySelf: 'start',
482
511
  marginBottom: '0.5rem',
483
512
  }, children: _jsx(RadioButton, { id: option.uuid, value: option.uuid, labelText: `${option.regions.length > 1
@@ -499,7 +528,7 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
499
528
  }, children: formElements.clusterPlanType.options.map((option) => (_jsx("div", { style: { marginBottom: '2.0rem' }, children: _jsx("div", { style: {
500
529
  height: '100%',
501
530
  display: 'grid',
502
- }, children: _jsx(RadioTile, { value: option.uuid, checked: option.uuid === currentClusterPlanType, onChange: () => setClusterPlanTypeWithEffects(option.uuid), disabled: option.disabled || isSubmitting() || noAvailableSlots, style: { height: '100%' }, children: _jsx(ClusterPlanTypeTile, { type: option.type, title: option.title, description: option.description }) }, option.uuid) }) }, option.uuid))) })] }), formElements.allocatedHardwarePackages &&
531
+ }, children: _jsx(C4SelectableTile, { value: option.uuid, checked: option.uuid === currentClusterPlanType, onChange: () => setClusterPlanTypeWithEffects(option.uuid), disabled: option.disabled || isSubmitting() || noAvailableSlots, style: { height: '100%' }, children: _jsx(ClusterPlanTypeTile, { type: option.type, title: option.title, description: option.description }) }, option.uuid) }) }, option.uuid))) })] }), formElements.allocatedHardwarePackages &&
503
532
  formElements.clusterPlanType.options.find((option) => option.uuid === currentClusterPlanType &&
504
533
  option.category === ClusterPlanTypeCategory.ADVANCED_OFFERING &&
505
534
  option.availabilityClass !== 'unset' &&
@@ -535,7 +564,7 @@ export const C4CreateCluster = ({ loading, cta, formElements, autoUpdate, taskli
535
564
  ? formElements.autoUpdate?.description
536
565
  : formElements.autoUpdate?.descriptionIfDisabled }) }) })] })] })), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(C4Divider, {}) }) }), encryptions && providerSupportsEncryption() && (_jsxs(_Fragment, { children: [_jsxs(Stack, { gap: 2, children: [_jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(FormElementTitle, { title: encryptions.title }) }) }), _jsxs(Stack, { gap: 6, children: [_jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsxs("p", { children: [encryptions.description.text, ' ', _jsx("strong", { children: encryptions.description.bold }), ' ', _jsx(C4LinkButton, { label: encryptions.link.text, onClick: () => {
537
566
  window.open(encryptions?.link.url ?? '', '_blank');
538
- } })] }) }) }), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(RadioButtonGroupWithGrid, { children: encryptions.options.map((option) => (_jsxs(Column, { sm: 4, md: 6, lg: 4, style: {
567
+ } })] }) }) }), _jsx(Grid, { children: _jsx(Column, { span: 12, children: _jsx(RadioButtonGroupWithGrid, { valueSelected: encryption, onChange: (value) => updateEncryption(value), children: encryptions.options.map((option) => (_jsxs(Column, { sm: 4, md: 6, lg: 4, style: {
539
568
  justifySelf: 'start',
540
569
  marginBottom: '0.5rem',
541
570
  }, children: [_jsx(RadioButton, { id: option.value, value: option.value, labelText: option.title, checked: option.value === encryption, onChange: (value) => {
@@ -4,9 +4,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
4
4
  * under one or more contributor license agreements. Licensed under a commercial license.
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
- import { Checkbox, Form, InlineNotification, Modal, Stack, TextInput, } from '@carbon/react';
7
+ import { Form } from '@carbon/react';
8
8
  import { forwardRef, useCallback, useImperativeHandle, useMemo, useState, } from 'react';
9
+ import { Checkbox, Modal, Stack, TextInput } from '../../ui/index.js';
9
10
  import { C4ClusterClientCredentialsModal } from '../c4-cluster-client-credentials/c4-cluster-client-credentials.js';
11
+ import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
10
12
  function safeTranslate(t, key, defaultValue, options) {
11
13
  if (!t)
12
14
  return defaultValue;
@@ -122,7 +124,7 @@ export const C4CreateClusterApiClientModal = forwardRef(({ t, onCreateClusterApi
122
124
  label: safeTranslate(t, 'clusterclients:create.fields.scopes.secrets', 'Secrets'),
123
125
  },
124
126
  ], [t]);
125
- return (_jsxs(_Fragment, { children: [_jsx(Modal, { open: isOpen, modalHeading: modalHeading, primaryButtonText: safeTranslate(t, 'clusterclients:create.buttons.primary', 'Create'), secondaryButtonText: safeTranslate(t, 'clusterclients:create.buttons.secondary', 'Cancel'), primaryButtonDisabled: saving || scopes.length === 0, onRequestClose: close, onRequestSubmit: onSubmit, size: 'md', id: 'c4-create-cluster-api-client-modal', children: _jsx(Form, { noValidate: true, children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(InlineNotification, { kind: 'error', title: 'Error', subtitle: error, hideCloseButton: true, lowContrast: true })), _jsx(TextInput, { id: 'c4-cluster-api-client-name', name: 'name', "data-modal-primary-focus": true, labelText: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), maxLength: 50, value: name, placeholder: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), helperText: safeTranslate(t, 'clusterclients:create.fields.name.helperText', 'can contain letters, dashes, underscores, and digits'), invalid: Boolean(nameInvalid), invalidText: nameInvalid
127
+ return (_jsxs(_Fragment, { children: [_jsx(Modal, { open: isOpen, modalHeading: modalHeading, primaryButtonText: safeTranslate(t, 'clusterclients:create.buttons.primary', 'Create'), secondaryButtonText: safeTranslate(t, 'clusterclients:create.buttons.secondary', 'Cancel'), primaryButtonDisabled: saving || scopes.length === 0, onRequestClose: close, onRequestSubmit: onSubmit, size: 'md', id: 'c4-create-cluster-api-client-modal', children: _jsx(Form, { noValidate: true, children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: error, hideCloseButton: true, lowContrast: true })), _jsx(TextInput, { id: 'c4-cluster-api-client-name', name: 'name', "data-modal-primary-focus": true, labelText: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), maxLength: 50, value: name, placeholder: safeTranslate(t, 'clusterclients:create.fields.name.label', 'Client Name'), helperText: safeTranslate(t, 'clusterclients:create.fields.name.helperText', 'can contain letters, dashes, underscores, and digits'), invalid: Boolean(nameInvalid), invalidText: nameInvalid
126
128
  ? safeTranslate(t, 'clusterclients:create.error.doublette', 'Name is invalid')
127
129
  : '', onChange: (event) => setName(event.target.value), onBlur: () => setNameTouched(true), disabled: saving }), _jsxs(Stack, { gap: 2, children: [_jsx("h3", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.label', 'Scopes') }), _jsx("p", { children: safeTranslate(t, 'clusterclients:create.fields.scopes.helperText', 'Scopes define the access for client credentials.') })] }), _jsx("div", { children: scopeOptions.map((scope) => (_jsx(Checkbox, { labelText: scope.label, id: `c4-cluster-scope-${scope.value}`, value: scope.value, checked: scopes.includes(scope.value), onChange: () => {
128
130
  setScopes((current) => {
@@ -5,8 +5,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
7
  import { SECRETS_MAX_LENGTH } from '@camunda/ccma-shared-types';
8
- import { Form, InlineNotification, Modal, PasswordInput, Stack, TextInput, } from '@carbon/react';
8
+ import { Form, PasswordInput } from '@carbon/react';
9
9
  import { forwardRef, useCallback, useImperativeHandle, useMemo, useState, } from 'react';
10
+ import { Modal, Stack, TextInput } from '../../ui/index.js';
11
+ import { C4InlineNotification } from '../c4-inline-notification/c4-inline-notification.js';
10
12
  function safeTranslate(t, key, defaultValue, options) {
11
13
  if (!t)
12
14
  return defaultValue;
@@ -79,7 +81,7 @@ export const C4CreateConnectorSecretModal = forwardRef(({ t, onCreateSecret }, r
79
81
  }
80
82
  })();
81
83
  }, [close, clusterId, onCreateSecret, orgId, secretKey, secretValue]);
82
- return (_jsx(Modal, { open: isOpen, modalHeading: modalHeading, primaryButtonText: safeTranslate(t, 'connectorsecrets:create.buttons.primary', 'Create'), secondaryButtonText: safeTranslate(t, 'connectorsecrets:create.buttons.secondary', 'Cancel'), primaryButtonDisabled: saving, onRequestClose: close, onRequestSubmit: onSubmit, id: 'c4-create-connector-secret-modal', size: 'sm', children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(InlineNotification, { kind: 'error', title: 'Error', subtitle: error, hideCloseButton: true, lowContrast: true })), _jsxs(Form, { noValidate: true, children: [_jsx(TextInput, { id: 'c4-secret-create-key', labelText: safeTranslate(t, 'connectorsecrets:create.fields.key', 'Key'), helperText: safeTranslate(t, 'connectorsecrets:create.fields.keyHelperText', 'Unique identifier for the secret'), maxLength: 50, value: secretKey, invalid: secretKeyInvalid, invalidText: 'Key is required', disabled: saving, onChange: (event) => {
84
+ return (_jsx(Modal, { open: isOpen, modalHeading: modalHeading, primaryButtonText: safeTranslate(t, 'connectorsecrets:create.buttons.primary', 'Create'), secondaryButtonText: safeTranslate(t, 'connectorsecrets:create.buttons.secondary', 'Cancel'), primaryButtonDisabled: saving, onRequestClose: close, onRequestSubmit: onSubmit, id: 'c4-create-connector-secret-modal', size: 'sm', children: _jsxs(Stack, { gap: 6, children: [error && (_jsx(C4InlineNotification, { kind: 'error', title: 'Error', subtitle: error, hideCloseButton: true, lowContrast: true })), _jsxs(Form, { noValidate: true, children: [_jsx(TextInput, { id: 'c4-secret-create-key', labelText: safeTranslate(t, 'connectorsecrets:create.fields.key', 'Key'), helperText: safeTranslate(t, 'connectorsecrets:create.fields.keyHelperText', 'Unique identifier for the secret'), maxLength: 50, value: secretKey, invalid: secretKeyInvalid, invalidText: 'Key is required', disabled: saving, onChange: (event) => {
83
85
  const next = event.target.value;
84
86
  setSecretKey(next);
85
87
  if (secretKeyInvalid && next.trim().length > 0) {
@@ -4,8 +4,9 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-run
4
4
  * under one or more contributor license agreements. Licensed under a commercial license.
5
5
  * You may not use this file except in compliance with the commercial license.
6
6
  */
7
- import { Checkbox, Form, FormGroup, Modal, Stack, TextInput, } from '@carbon/react';
7
+ import { Form, FormGroup } from '@carbon/react';
8
8
  import { forwardRef, useCallback, useImperativeHandle, useMemo, useState, } from 'react';
9
+ import { Checkbox, Modal, Stack, TextInput } from '../../ui/index.js';
9
10
  import { C4ClusterClientCredentialsModal } from '../c4-cluster-client-credentials/c4-cluster-client-credentials.js';
10
11
  function isApiClientNameValid(name) {
11
12
  if (!name.trim()) {
@@ -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, Stack, TextInput } from '@carbon/react';
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,3 @@
1
+ import { type C3DataTableProps, type RowBaseProps } from '@camunda/camunda-composite-components';
2
+ import { type JSX } from 'react';
3
+ export declare function C4DataTable<T extends RowBaseProps>(props: C3DataTableProps<T>): JSX.Element;
@@ -0,0 +1,194 @@
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 { 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
+ function toColumns(headers) {
67
+ return headers.map((header) => ({
68
+ id: header.key,
69
+ accessorFn: (row) => row[header.key],
70
+ header: header.label,
71
+ enableSorting: !!header.sorting,
72
+ ...(header.sorting && {
73
+ sortingFn: (a, b) => header.sorting(a.original, b.original),
74
+ }),
75
+ cell: ({ row }) => renderCell(header, row.original),
76
+ }));
77
+ }
78
+ function toRowActions(actions) {
79
+ return actions?.map((action) => ({
80
+ id: action.id,
81
+ label: action.label,
82
+ onClick: (row) => action.onClick(row),
83
+ disabled: action.disabled,
84
+ visible: action.visible,
85
+ hasDivider: action.hasDivider,
86
+ variant: typeof action.kind === 'string' && action.kind.includes('danger')
87
+ ? 'destructive'
88
+ : 'default',
89
+ icon: action.icon
90
+ ? (row) => {
91
+ const Icon = typeof action.icon === 'function' ? action.icon(row) : action.icon;
92
+ return Icon ? _jsx(Icon, {}) : undefined;
93
+ }
94
+ : undefined,
95
+ }));
96
+ }
97
+ // Items that filter rows (search/singleSelect/multiSelect); button/menuButton
98
+ // do not.
99
+ function keepRow(row, items, state) {
100
+ return items.every((item) => {
101
+ if (item.type === 'search') {
102
+ const term = state[item.id];
103
+ const searchTerm = typeof term === 'string' ? term : '';
104
+ return !searchTerm || !item.filter
105
+ ? true
106
+ : item.filter({ row, searchTerm });
107
+ }
108
+ if (item.type === 'singleSelect') {
109
+ const selectedItem = state[item.id];
110
+ const value = typeof selectedItem === 'string' ? selectedItem : '';
111
+ return !value || !item.filter
112
+ ? true
113
+ : item.filter({ row, selectedItem: value });
114
+ }
115
+ if (item.type === 'multiSelect') {
116
+ const raw = state[item.id];
117
+ const selectedItems = Array.isArray(raw) ? raw : [];
118
+ return selectedItems.length === 0 || !item.filter
119
+ ? true
120
+ : item.filter({ row, selectedItems });
121
+ }
122
+ return true;
123
+ });
124
+ }
125
+ function C4DataTableDs(props) {
126
+ const { headers, data, actions, options, isLoading, title, description, id } = props;
127
+ // Normalise `toolbar` (single row) / `toolbars` (multiple rows) into rows.
128
+ const toolbarRows = props.toolbars ?? (props.toolbar ? [props.toolbar] : []);
129
+ const allToolbarItems = toolbarRows.flat();
130
+ const [filterState, setFilterState] = useState(() => {
131
+ const initial = {};
132
+ for (const item of allToolbarItems) {
133
+ if (item.type === 'singleSelect' && item.defaultValue != null) {
134
+ initial[item.id] = String(item.defaultValue);
135
+ }
136
+ }
137
+ return initial;
138
+ });
139
+ const setValue = (key, value) => setFilterState((prev) => ({ ...prev, [key]: value }));
140
+ const filteredData = allToolbarItems.length
141
+ ? data.filter((row) => keepRow(row, allToolbarItems, filterState))
142
+ : data;
143
+ const renderToolbarItem = (item) => {
144
+ switch (item.type) {
145
+ case 'search': {
146
+ const raw = filterState[item.id];
147
+ const searchValue = typeof raw === 'string' ? raw : '';
148
+ 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));
149
+ }
150
+ case 'singleSelect': {
151
+ const raw = filterState[item.id];
152
+ const value = typeof raw === 'string' ? raw : undefined;
153
+ 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));
154
+ }
155
+ case 'multiSelect': {
156
+ const raw = filterState[item.id];
157
+ const value = Array.isArray(raw) ? raw : [];
158
+ return (_jsx(MultiSelect, { id: item.id, "aria-label": item.label ?? 'Filter', placeholder: item.label ?? 'Filter', className: 'w-64', options: (item.items ?? []).map((option) => ({
159
+ value: option.id,
160
+ label: option.label,
161
+ })), value: value, onValueChange: (next) => setValue(item.id, next) }, item.id));
162
+ }
163
+ case 'button': {
164
+ const Icon = item.icon;
165
+ return (_jsxs(Button, { variant: kindToButtonVariant(item.kind), onClick: item.onClick, disabled: item.disabled, children: [Icon ? _jsx(Icon, {}) : undefined, item.label] }, item.id));
166
+ }
167
+ case 'menuButton':
168
+ 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
169
+ // biome-ignore lint/suspicious/noArrayIndexKey: c3 menu items have no stable id
170
+ , { onClick: menuItem.onClick, disabled: menuItem.disabled, children: menuItem.label }, index))) })] }, item.id));
171
+ default:
172
+ return null;
173
+ }
174
+ };
175
+ const renderToolbarRow = (items, rowIndex) => {
176
+ const filters = items.filter((item) => item.type === 'search' ||
177
+ item.type === 'singleSelect' ||
178
+ item.type === 'multiSelect');
179
+ const buttons = items.filter((item) => item.type === 'button' || item.type === 'menuButton');
180
+ 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));
181
+ };
182
+ const hasHeading = title !== undefined || description !== undefined;
183
+ const hasExpansion = data.some((row) => row.expansion !== undefined);
184
+ 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: toColumns(headers), data: filteredData, getRowId: (row, index) => row.id ?? String(index), sorting: headers.some((header) => !!header.sorting), pagination: options?.pageSize || options?.pageSizes
185
+ ? {
186
+ defaultPageSize: options.pageSize,
187
+ pageSizes: options.pageSizes,
188
+ }
189
+ : true, size: options?.tableSize, zebra: options?.useZebraStyles, inlineActionsThreshold: options?.actionsUseOverflowMenuMinItems, rowActions: toRowActions(actions), loading: isLoading, onRowClick: (row) => row.onClick?.(), expansion: hasExpansion ? (row) => row.expansion ?? null : undefined })] }));
190
+ }
191
+ export function C4DataTable(props) {
192
+ const designSystem = useC4DesignSystem();
193
+ return designSystem === 'ds' ? (_jsx(C4DataTableDs, { ...props })) : (_jsx(C3DataTable, { ...props }));
194
+ }