@odigos/ui-kit 0.0.51 → 0.0.52

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 (274) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/components.js +10 -10
  3. package/lib/constants.js +2 -2
  4. package/lib/containers.js +56 -32
  5. package/lib/functions.js +7 -7
  6. package/lib/hooks/useInstrumentationRuleFormData.d.ts +1 -1
  7. package/lib/hooks.js +614 -7
  8. package/lib/icons.js +6 -6
  9. package/lib/{index-BC03UmY5.js → index-118aa476.js} +4 -3
  10. package/lib/{index-CPMIZB66.js → index-159d94f2.js} +4 -4
  11. package/lib/{index-Coq_Nro0.js → index-1b057bd1.js} +2 -2
  12. package/lib/{index-Dbs7YARA.js → index-4c55824c.js} +2 -2
  13. package/lib/{index-1-F2f04H.js → index-4dd6a1ce.js} +170 -116
  14. package/lib/{index-H8TwBQHm.js → index-974c5344.js} +1 -1
  15. package/lib/{index-CMsBAVAn.js → index-b833b336.js} +1 -1
  16. package/lib/{index-CyHOJpMl.js → index-f40b593d.js} +1 -1
  17. package/lib/{index-LgzkJ05H.js → index-f64b0a7d.js} +1 -1
  18. package/lib/snippets.js +26 -10
  19. package/lib/store.js +1 -1
  20. package/lib/theme.js +1 -1
  21. package/lib/{useTransition-DmHfJSEP.js → useTransition-53e46214.js} +29 -23
  22. package/package.json +17 -17
  23. package/lib/components/auto-complete-input/auto-complete-input.stories.d.ts +0 -9
  24. package/lib/components/badge/badge.stories.d.ts +0 -13
  25. package/lib/components/button/button.stories.d.ts +0 -9
  26. package/lib/components/cancel-warning/cancel-warning.stories.d.ts +0 -9
  27. package/lib/components/checkbox/checkbox.stories.d.ts +0 -9
  28. package/lib/components/code/code.stories.d.ts +0 -9
  29. package/lib/components/condition-details/condition-details.stories.d.ts +0 -14
  30. package/lib/components/data-card/data-card.stories.d.ts +0 -11
  31. package/lib/components/data-finger/data-finger.stories.d.ts +0 -9
  32. package/lib/components/data-tab/data-tab.stories.d.ts +0 -15
  33. package/lib/components/delete-warning/delete-warning.stories.d.ts +0 -9
  34. package/lib/components/describe-row/describe-row.stories.d.ts +0 -9
  35. package/lib/components/divider/divider.stories.d.ts +0 -9
  36. package/lib/components/docs-button/docs-button.stories.d.ts +0 -9
  37. package/lib/components/drawer/drawer.stories.d.ts +0 -10
  38. package/lib/components/dropdown/dropdown.stories.d.ts +0 -10
  39. package/lib/components/error-boundary/error-boundary.stories.d.ts +0 -11
  40. package/lib/components/extend-arrow/extend-arrow.stories.d.ts +0 -9
  41. package/lib/components/fade-loader/fade-loader.stories.d.ts +0 -9
  42. package/lib/components/field-error/field-error.stories.d.ts +0 -11
  43. package/lib/components/field-label/field-label.stories.d.ts +0 -9
  44. package/lib/components/header/header.stories.d.ts +0 -9
  45. package/lib/components/icon-button/icon-button.stories.d.ts +0 -9
  46. package/lib/components/icon-group/icon-group.stories.d.ts +0 -16
  47. package/lib/components/icon-title-badge/icon-title-badge.stories.d.ts +0 -9
  48. package/lib/components/icon-wrapped/icon-wrapped.stories.d.ts +0 -10
  49. package/lib/components/icons-nav/icons-nav.stories.d.ts +0 -9
  50. package/lib/components/image-controlled/image-controlled.stories.d.ts +0 -9
  51. package/lib/components/input/input.stories.d.ts +0 -9
  52. package/lib/components/input-list/input-list.stories.d.ts +0 -9
  53. package/lib/components/input-table/input-table.stories.d.ts +0 -9
  54. package/lib/components/interactive-table/interactive-table.stories.d.ts +0 -12
  55. package/lib/components/key-value-input-list/key-value-input-list.stories.d.ts +0 -11
  56. package/lib/components/modal/modal.stories.d.ts +0 -9
  57. package/lib/components/monitors-checkboxes/monitors-checkboxes.stories.d.ts +0 -9
  58. package/lib/components/monitors-icons/monitors-icons.stories.d.ts +0 -9
  59. package/lib/components/navigation-buttons/navigation-buttons.stories.d.ts +0 -9
  60. package/lib/components/no-data-found/no-data-found.stories.d.ts +0 -9
  61. package/lib/components/notification-note/notification-note.stories.d.ts +0 -10
  62. package/lib/components/popup/popup.stories.d.ts +0 -9
  63. package/lib/components/popup-form/popup-form.stories.d.ts +0 -10
  64. package/lib/components/scroll-x/scroll-x.stories.d.ts +0 -10
  65. package/lib/components/section-title/section-title.stories.d.ts +0 -9
  66. package/lib/components/segment/segment.stories.d.ts +0 -9
  67. package/lib/components/selection-button/selection-button.stories.d.ts +0 -9
  68. package/lib/components/skeleton-loader/skeleton-loader.stories.d.ts +0 -9
  69. package/lib/components/status/status.stories.d.ts +0 -9
  70. package/lib/components/stepper/stepper.stories.d.ts +0 -9
  71. package/lib/components/tag/tag.stories.d.ts +0 -13
  72. package/lib/components/text/text.stories.d.ts +0 -9
  73. package/lib/components/textarea/textarea.stories.d.ts +0 -9
  74. package/lib/components/toggle/toggle.stories.d.ts +0 -9
  75. package/lib/components/tooltip/tooltip.stories.d.ts +0 -11
  76. package/lib/components/trace-loader/trace-loader.stories.d.ts +0 -9
  77. package/lib/components/warning-modal/warning-modal.stories.d.ts +0 -9
  78. package/lib/containers/action-drawer/action-drawer.stories.d.ts +0 -9
  79. package/lib/containers/action-form/action-form.stories.d.ts +0 -9
  80. package/lib/containers/action-modal/action-modal.stories.d.ts +0 -9
  81. package/lib/containers/action-table/action-table.stories.d.ts +0 -9
  82. package/lib/containers/await-pipeline/await-pipeline.stories.d.ts +0 -9
  83. package/lib/containers/compute-platform-select/compute-platform-select.stories.d.ts +0 -9
  84. package/lib/containers/compute-platforms/compute-platforms.stories.d.ts +0 -9
  85. package/lib/containers/compute-platforms-actions-menu/compute-platforms-actions-menu.stories.d.ts +0 -9
  86. package/lib/containers/data-flow/data-flow.stories.d.ts +0 -9
  87. package/lib/containers/data-flow-actions-menu/data-flow-actions-menu.stories.d.ts +0 -11
  88. package/lib/containers/data-stream-drawer/data-stream-drawer.stories.d.ts +0 -9
  89. package/lib/containers/data-stream-form/data-stream-form.stories.d.ts +0 -9
  90. package/lib/containers/data-stream-modal/data-stream-modal.stories.d.ts +0 -9
  91. package/lib/containers/data-stream-selection-form/data-stream-selection-form.stories.d.ts +0 -9
  92. package/lib/containers/destination-drawer/destination-drawer.stories.d.ts +0 -9
  93. package/lib/containers/destination-form/destination-form.stories.d.ts +0 -9
  94. package/lib/containers/destination-modal/destination-modal.stories.d.ts +0 -9
  95. package/lib/containers/destination-selection-form/destination-selection-form.stories.d.ts +0 -9
  96. package/lib/containers/destination-table/destination-table.stories.d.ts +0 -9
  97. package/lib/containers/dropdowns/connection-status-dropdown/connection-status-dropdown.stories.d.ts +0 -9
  98. package/lib/containers/dropdowns/connection-type-dropdown/connection-type-dropdown.stories.d.ts +0 -9
  99. package/lib/containers/dropdowns/error-dropdown/error-dropdown.stories.d.ts +0 -9
  100. package/lib/containers/dropdowns/kind-dropdown/error-dropdown.stories.d.ts +0 -9
  101. package/lib/containers/dropdowns/language-dropdown/language-dropdown.stories.d.ts +0 -9
  102. package/lib/containers/dropdowns/monitor-dropdown/monitor-dropdown.stories.d.ts +0 -9
  103. package/lib/containers/dropdowns/namespace-dropdown/namespace-dropdown.stories.d.ts +0 -9
  104. package/lib/containers/instrumentation-rule-drawer/instrumentation-rule-drawer.stories.d.ts +0 -9
  105. package/lib/containers/instrumentation-rule-form/instrumentation-rule-form.stories.d.ts +0 -9
  106. package/lib/containers/instrumentation-rule-modal/instrumentation-rule-modal.stories.d.ts +0 -9
  107. package/lib/containers/instrumentation-rule-table/instrumentation-rule-table.stories.d.ts +0 -9
  108. package/lib/containers/multi-source-control/multi-source-control.stories.d.ts +0 -9
  109. package/lib/containers/notification-manager/notification-manager.stories.d.ts +0 -9
  110. package/lib/containers/overview-drawer/overview-drawer.stories.d.ts +0 -9
  111. package/lib/containers/service-map/service-map.stories.d.ts +0 -9
  112. package/lib/containers/setup-summary/setup-summary.stories.d.ts +0 -9
  113. package/lib/containers/side-nav/side-nav.stories.d.ts +0 -9
  114. package/lib/containers/slack-invite/slack-invite.stories.d.ts +0 -9
  115. package/lib/containers/source-drawer/source-drawer.stories.d.ts +0 -9
  116. package/lib/containers/source-form/source-form.stories.d.ts +0 -9
  117. package/lib/containers/source-modal/source-modal.stories.d.ts +0 -9
  118. package/lib/containers/source-selection-form/source-selection-form.stories.d.ts +0 -9
  119. package/lib/containers/source-table/source-table.stories.d.ts +0 -9
  120. package/lib/containers/system-overview/system-overview.stories.d.ts +0 -9
  121. package/lib/containers/table-cell-conditions/table-cell-conditions.stories.d.ts +0 -9
  122. package/lib/containers/toast-list/toast-list.stories.d.ts +0 -9
  123. package/lib/containers/toggle-dark-mode/toggle-dark-mode.stories.d.ts +0 -9
  124. package/lib/icons/actions/add-cluster-info-icon/add-cluster-info-icon.stories.d.ts +0 -8
  125. package/lib/icons/actions/delete-attribute-icon/delete-attribute-icon.stories.d.ts +0 -8
  126. package/lib/icons/actions/pii-masking-icon/pii-masking-icon.stories.d.ts +0 -8
  127. package/lib/icons/actions/rename-attribute-icon/rename-attribute-icon.stories.d.ts +0 -8
  128. package/lib/icons/actions/sampler-icon/sampler-icon.stories.d.ts +0 -8
  129. package/lib/icons/brand/odigos-logo/odigos-logo.stories.d.ts +0 -8
  130. package/lib/icons/brand/odigos-logo-text/odigos-logo-text.stories.d.ts +0 -8
  131. package/lib/icons/common/arrow-icon/arrow-icon.stories.d.ts +0 -8
  132. package/lib/icons/common/avatar-icon/avatar-icon.stories.d.ts +0 -8
  133. package/lib/icons/common/code-brackets-icon/code-brackets-icon.stories.d.ts +0 -8
  134. package/lib/icons/common/code-icon/code-icon.stories.d.ts +0 -8
  135. package/lib/icons/common/command-icon/command-icon.stories.d.ts +0 -8
  136. package/lib/icons/common/copy-icon/copy-icon.stories.d.ts +0 -8
  137. package/lib/icons/common/edit-icon/edit-icon.stories.d.ts +0 -8
  138. package/lib/icons/common/edited-icon/edited-icon.stories.d.ts +0 -8
  139. package/lib/icons/common/extend-arrow-icon/extend-arrow-icon.stories.d.ts +0 -8
  140. package/lib/icons/common/filter-icon/filter-icon.stories.d.ts +0 -8
  141. package/lib/icons/common/folder-icon/folder-icon.stories.d.ts +0 -8
  142. package/lib/icons/common/image-error-icon/image-error-icon.stories.d.ts +0 -8
  143. package/lib/icons/common/key-icon/key-icon.stories.d.ts +0 -8
  144. package/lib/icons/common/list-icon/list-icon.stories.d.ts +0 -8
  145. package/lib/icons/common/no-data-icon/no-data-icon.stories.d.ts +0 -8
  146. package/lib/icons/common/notebook-icon/notebook-icon.stories.d.ts +0 -8
  147. package/lib/icons/common/notification-icon/notification-icon.stories.d.ts +0 -8
  148. package/lib/icons/common/retry-icon/retry-icon.stories.d.ts +0 -8
  149. package/lib/icons/common/search-icon/search-icon.stories.d.ts +0 -8
  150. package/lib/icons/common/sort-arrows-icon/sort-arrows-icon.stories.d.ts +0 -8
  151. package/lib/icons/common/terminal-icon/terminal-icon.stories.d.ts +0 -8
  152. package/lib/icons/common/trash-icon/trash-icon.stories.d.ts +0 -8
  153. package/lib/icons/common/user-group-icon/user-group-icon.stories.d.ts +0 -8
  154. package/lib/icons/common/user-icon/user-icon.stories.d.ts +0 -8
  155. package/lib/icons/common/x-icon/x-icon.stories.d.ts +0 -8
  156. package/lib/icons/compute-platform/k8s-logo/k8s-logo.stories.d.ts +0 -8
  157. package/lib/icons/compute-platform/vm-logo/vm-logo.stories.d.ts +0 -8
  158. package/lib/icons/destinations/alauda-logo/alauda-logo.stories.d.ts +0 -8
  159. package/lib/icons/destinations/alibaba-cloud-logo/alibaba-cloud-logo.stories.d.ts +0 -8
  160. package/lib/icons/destinations/app-dynamics-logo/app-dynamics-logo.stories.d.ts +0 -8
  161. package/lib/icons/destinations/aws-cloudwatch-logo/aws-cloudwatch-logo.stories.d.ts +0 -8
  162. package/lib/icons/destinations/aws-s3-logo/aws-s3-logo.stories.d.ts +0 -8
  163. package/lib/icons/destinations/aws-xray-logo/aws-xray-logo.stories.d.ts +0 -8
  164. package/lib/icons/destinations/axiom-logo/axiom-logo.stories.d.ts +0 -8
  165. package/lib/icons/destinations/better-stack-logo/better-stack-logo.stories.d.ts +0 -8
  166. package/lib/icons/destinations/blob-storage-logo/blob-storage-logo.stories.d.ts +0 -8
  167. package/lib/icons/destinations/bonree-logo/bonree-logo.stories.d.ts +0 -8
  168. package/lib/icons/destinations/causely-logo/causely-logo.stories.d.ts +0 -8
  169. package/lib/icons/destinations/checkly-logo/checkly-logo.stories.d.ts +0 -8
  170. package/lib/icons/destinations/chronosphere-logo/chronosphere-logo.stories.d.ts +0 -8
  171. package/lib/icons/destinations/clickhouse-logo/clickhouse-logo.stories.d.ts +0 -8
  172. package/lib/icons/destinations/coralogix-logo/coralogix-logo.stories.d.ts +0 -8
  173. package/lib/icons/destinations/dash0-logo/dash0-logo.stories.d.ts +0 -8
  174. package/lib/icons/destinations/datadog-logo/datadog-logo.stories.d.ts +0 -8
  175. package/lib/icons/destinations/dynatrace-logo/dynatrace-logo.stories.d.ts +0 -8
  176. package/lib/icons/destinations/elastic-apm-logo/elastic-apm-logo.stories.d.ts +0 -8
  177. package/lib/icons/destinations/elastic-search-logo/elastic-search-logo.stories.d.ts +0 -8
  178. package/lib/icons/destinations/gigapipe-logo/gigapipe-logo.stories.d.ts +0 -8
  179. package/lib/icons/destinations/google-cloud-platform-logo/google-cloud-platform-logo.stories.d.ts +0 -8
  180. package/lib/icons/destinations/google-cloud-storage-logo/google-cloud-storage-logo.stories.d.ts +0 -8
  181. package/lib/icons/destinations/grafana-logo/grafana-logo.stories.d.ts +0 -8
  182. package/lib/icons/destinations/greptime-logo/greptime-logo.stories.d.ts +0 -8
  183. package/lib/icons/destinations/groundcover-logo/groundcover-logo.stories.d.ts +0 -8
  184. package/lib/icons/destinations/honeycomb-logo/honeycomb-logo.stories.d.ts +0 -8
  185. package/lib/icons/destinations/hyperdx-logo/hyperdx-logo.stories.d.ts +0 -8
  186. package/lib/icons/destinations/instana-logo/instana-logo.stories.d.ts +0 -8
  187. package/lib/icons/destinations/jaeger-logo/jaeger-logo.stories.d.ts +0 -8
  188. package/lib/icons/destinations/kafka-logo/kafka-logo.stories.d.ts +0 -8
  189. package/lib/icons/destinations/kloudmate-logo/kloudmate-logo.stories.d.ts +0 -8
  190. package/lib/icons/destinations/last9-logo/last9-logo.stories.d.ts +0 -8
  191. package/lib/icons/destinations/lightstep-logo/lightstep-logo.stories.d.ts +0 -8
  192. package/lib/icons/destinations/logzio-logo/logzio-logo.stories.d.ts +0 -8
  193. package/lib/icons/destinations/loki-logo/loki-logo.stories.d.ts +0 -8
  194. package/lib/icons/destinations/lumigo-logo/lumigo-logo.stories.d.ts +0 -8
  195. package/lib/icons/destinations/middleware-logo/middleware-logo.stories.d.ts +0 -8
  196. package/lib/icons/destinations/new-relic-logo/new-relic-logo.stories.d.ts +0 -8
  197. package/lib/icons/destinations/observe-logo/observe-logo.stories.d.ts +0 -8
  198. package/lib/icons/destinations/one-uptime-logo/one-uptime-logo.stories.d.ts +0 -8
  199. package/lib/icons/destinations/open-observe-logo/open-observe-logo.stories.d.ts +0 -8
  200. package/lib/icons/destinations/open-telemetry-logo/open-telemetry-logo.stories.d.ts +0 -8
  201. package/lib/icons/destinations/ops-verse-logo/ops-verse-logo.stories.d.ts +0 -8
  202. package/lib/icons/destinations/oracle-logo/oracle-logo.stories.d.ts +0 -8
  203. package/lib/icons/destinations/prometheus-logo/prometheus-logo.stories.d.ts +0 -8
  204. package/lib/icons/destinations/qryn-logo/qryn-logo.stories.d.ts +0 -8
  205. package/lib/icons/destinations/quickwit-logo/quickwit-logo.stories.d.ts +0 -8
  206. package/lib/icons/destinations/sentry-logo/sentry-logo.stories.d.ts +0 -8
  207. package/lib/icons/destinations/seq-logo/seq-logo.stories.d.ts +0 -8
  208. package/lib/icons/destinations/signoz-logo/signoz-logo.stories.d.ts +0 -8
  209. package/lib/icons/destinations/splunk-logo/splunk-logo.stories.d.ts +0 -8
  210. package/lib/icons/destinations/sumo-logic-logo/sumo-logic-logo.stories.d.ts +0 -8
  211. package/lib/icons/destinations/telemetry-hub-logo/telemetry-hub-logo.stories.d.ts +0 -8
  212. package/lib/icons/destinations/tempo-logo/tempo-logo.stories.d.ts +0 -8
  213. package/lib/icons/destinations/tingyun-logo/tingyun-logo.stories.d.ts +0 -8
  214. package/lib/icons/destinations/traceloop-logo/traceloop-logo.stories.d.ts +0 -8
  215. package/lib/icons/destinations/uptrace-logo/uptrace-logo.stories.d.ts +0 -8
  216. package/lib/icons/destinations/victoria-metrics-logo/victoria-metrics-logo.stories.d.ts +0 -8
  217. package/lib/icons/instrumentation-rules/code-attributes-icon/code-attributes-icon.stories.d.ts +0 -8
  218. package/lib/icons/instrumentation-rules/custom-instrumentation-icon/custom-instrumentation-icon.stories.d.ts +0 -7
  219. package/lib/icons/instrumentation-rules/headers-collection-icon/headers-collection-icon.stories.d.ts +0 -8
  220. package/lib/icons/instrumentation-rules/payload-collection-icon/payload-collection-icon.stories.d.ts +0 -8
  221. package/lib/icons/math/minus-circled-icon/minus-circled-icon.stories.d.ts +0 -8
  222. package/lib/icons/math/minus-icon/minus-icon.stories.d.ts +0 -8
  223. package/lib/icons/math/plus-circled-icon/plus-circled-icon.stories.d.ts +0 -8
  224. package/lib/icons/math/plus-icon/plus-icon.stories.d.ts +0 -8
  225. package/lib/icons/monitors/logs-icon/logs-icon.stories.d.ts +0 -8
  226. package/lib/icons/monitors/metrics-icon/metrics-icon.stories.d.ts +0 -8
  227. package/lib/icons/monitors/traces-icon/traces-icon.stories.d.ts +0 -8
  228. package/lib/icons/on-off/eye-closed-icon/eye-closed-icon.stories.d.ts +0 -8
  229. package/lib/icons/on-off/eye-open-icon/eye-open-icon.stories.d.ts +0 -8
  230. package/lib/icons/on-off/light-off-icon/light-off-icon.stories.d.ts +0 -8
  231. package/lib/icons/on-off/light-on-icon/light-on-icon.stories.d.ts +0 -8
  232. package/lib/icons/on-off/moon-icon/moon-icon.stories.d.ts +0 -8
  233. package/lib/icons/on-off/sun-icon/sun-icon.stories.d.ts +0 -8
  234. package/lib/icons/overview/actions-icon/actions-icon.stories.d.ts +0 -8
  235. package/lib/icons/overview/connections-icon/connections-icon.stories.d.ts +0 -8
  236. package/lib/icons/overview/data-streams-icon/data-streams-icon.stories.d.ts +0 -8
  237. package/lib/icons/overview/destinations-icon/destinations-icon.stories.d.ts +0 -8
  238. package/lib/icons/overview/namespaces-icon/namespaces-icon.stories.d.ts +0 -8
  239. package/lib/icons/overview/overview-icon/overview-icon.stories.d.ts +0 -8
  240. package/lib/icons/overview/rules-icon/rules-icon.stories.d.ts +0 -8
  241. package/lib/icons/overview/service-map-icon/service-map-icon.stories.d.ts +0 -8
  242. package/lib/icons/overview/sources-icon/sources-icon.stories.d.ts +0 -8
  243. package/lib/icons/overview/trace-view-icon/trace-view-icon.stories.d.ts +0 -8
  244. package/lib/icons/programming-languages/c-plus-plus-logo/c-plus-plus-logo.stories.d.ts +0 -8
  245. package/lib/icons/programming-languages/c-sharp-logo/c-sharp-logo.stories.d.ts +0 -8
  246. package/lib/icons/programming-languages/dotnet-logo/dotnet-logo.stories.d.ts +0 -8
  247. package/lib/icons/programming-languages/elixir-logo/elixir-logo.stories.d.ts +0 -8
  248. package/lib/icons/programming-languages/go-logo/go-logo.stories.d.ts +0 -8
  249. package/lib/icons/programming-languages/java-logo/java-logo.stories.d.ts +0 -8
  250. package/lib/icons/programming-languages/mysql-logo/mysql-logo.stories.d.ts +0 -8
  251. package/lib/icons/programming-languages/nginx-logo/nginx-logo.stories.d.ts +0 -8
  252. package/lib/icons/programming-languages/nodejs-logo/nodejs-logo.stories.d.ts +0 -8
  253. package/lib/icons/programming-languages/php-logo/php-logo.stories.d.ts +0 -8
  254. package/lib/icons/programming-languages/postgres-logo/postgres-logo.stories.d.ts +0 -8
  255. package/lib/icons/programming-languages/python-logo/python-logo.stories.d.ts +0 -8
  256. package/lib/icons/programming-languages/redis-logo/redis-logo.stories.d.ts +0 -8
  257. package/lib/icons/programming-languages/ruby-logo/ruby-logo.stories.d.ts +0 -8
  258. package/lib/icons/programming-languages/rust-logo/rust-logo.stories.d.ts +0 -8
  259. package/lib/icons/programming-languages/swift-logo/swift-logo.stories.d.ts +0 -8
  260. package/lib/icons/social/slack-logo/slack-logo.stories.d.ts +0 -8
  261. package/lib/icons/status/check-circled-icon/check-circled-icon.stories.d.ts +0 -8
  262. package/lib/icons/status/check-icon/check-icon.stories.d.ts +0 -8
  263. package/lib/icons/status/cross-circled-icon/cross-circled-icon.stories.d.ts +0 -8
  264. package/lib/icons/status/cross-icon/cross-icon.stories.d.ts +0 -8
  265. package/lib/icons/status/error-round-icon/error-round-icon.stories.d.ts +0 -8
  266. package/lib/icons/status/error-triangle-icon/error-triangle-icon.stories.d.ts +0 -8
  267. package/lib/icons/status/info-icon/info-icon.stories.d.ts +0 -8
  268. package/lib/icons/status/warning-triangle-icon/warning-triangle-icon.stories.d.ts +0 -8
  269. package/lib/index-4BmryHdH.js +0 -23
  270. package/lib/snippets/note-back-to-summary/note-back-to-summary.stories.d.ts +0 -9
  271. package/lib/useSourceSelectionFormData-CwggurLH.js +0 -614
  272. /package/lib/{index-Dqief9td.js → index-1cb4f9e2.js} +0 -0
  273. /package/lib/{index-BlZKWuxe.js → index-6a6bea6e.js} +0 -0
  274. /package/lib/{index-BnvrwbRB.js → index-ec555530.js} +0 -0
package/lib/hooks.js CHANGED
@@ -1,8 +1,615 @@
1
- export { u as useActionFormData, a as useClickNotification, b as useDataStreamFormData, c as useDestinationFormData, d as useSessionStorage, e as useSourceFormData, f as useSourceSelectionFormData } from './useSourceSelectionFormData-CwggurLH.js';
2
- export { u as useClickNode, a as useContainerSize, b as useCopy, c as useGenericForm, d as useInstrumentationRuleFormData, e as useKeyDown, f as useOnClickOutside, g as usePopup, h as useTimeAgo, i as useTransition } from './useTransition-DmHfJSEP.js';
3
- import './types.js';
4
- import './index-BC03UmY5.js';
5
- import 'react';
1
+ import { ActionKeyTypes, ActionType, StatusType, EntityTypes, FieldTypes } from './types.js';
2
+ import { V as useNotificationStore, F as FORM_ALERTS, O as useDrawerStore, W as useEntityStore, Y as useDataStreamStore, _ as useSetupStore } from './index-118aa476.js';
3
+ import { useState, useEffect, useMemo } from 'react';
6
4
  import 'styled-components';
7
- import './index-BnvrwbRB.js';
8
- import './index-BlZKWuxe.js';
5
+ import { i as isEmpty, s as safeJsonParse } from './index-ec555530.js';
6
+ import { i as useGenericForm } from './useTransition-53e46214.js';
7
+ export { c as useClickNode, b as useContainerSize, h as useCopy, e as useInstrumentationRuleFormData, u as useKeyDown, a as useOnClickOutside, d as usePopup, g as useTimeAgo, f as useTransition } from './useTransition-53e46214.js';
8
+ import { g as getIdFromSseTarget, i as isLegalK8sLabel, m as mapExportedSignals } from './index-6a6bea6e.js';
9
+
10
+ const INITIAL$2 = {
11
+ // @ts-expect-error - we know that the field name is in the parsedFields
12
+ type: '',
13
+ name: '',
14
+ notes: '',
15
+ signals: [],
16
+ disabled: false,
17
+ clusterAttributes: null,
18
+ renames: null,
19
+ attributeNamesToDelete: null,
20
+ piiCategories: null,
21
+ fallbackSamplingRatio: null,
22
+ samplingPercentage: null,
23
+ endpointsFilters: null,
24
+ servicesNameFilters: null,
25
+ attributeFilters: null,
26
+ };
27
+ const useActionFormData = () => {
28
+ const { addNotification } = useNotificationStore();
29
+ const { formData, formErrors, handleFormChange, handleErrorChange, resetFormData } = useGenericForm(INITIAL$2);
30
+ const validateForm = (params) => {
31
+ const errors = {};
32
+ let ok = true;
33
+ Object.entries(formData).forEach(([k, v]) => {
34
+ switch (k) {
35
+ case 'type':
36
+ case 'signals':
37
+ if (isEmpty(v))
38
+ errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
39
+ break;
40
+ case ActionKeyTypes.ClusterAttributes:
41
+ if (formData.type === ActionType.AddClusterInfo && isEmpty(v))
42
+ errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
43
+ break;
44
+ case ActionKeyTypes.Renames:
45
+ if (formData.type === ActionType.RenameAttributes && isEmpty(v))
46
+ errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
47
+ break;
48
+ case ActionKeyTypes.AttributeNamesToDelete:
49
+ if (formData.type === ActionType.DeleteAttributes && isEmpty(v))
50
+ errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
51
+ break;
52
+ case ActionKeyTypes.PiiCategories:
53
+ if (formData.type === ActionType.PiiMasking && isEmpty(v))
54
+ errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
55
+ break;
56
+ case ActionKeyTypes.FallbackSamplingRatio:
57
+ if (formData.type === ActionType.ErrorSampler && isEmpty(v))
58
+ errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
59
+ break;
60
+ case ActionKeyTypes.SamplingPercentage:
61
+ if (formData.type === ActionType.ProbabilisticSampler && isEmpty(v))
62
+ errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
63
+ break;
64
+ case ActionKeyTypes.EndpointsFilters:
65
+ if (formData.type === ActionType.LatencySampler) {
66
+ if (isEmpty(v))
67
+ errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
68
+ v?.forEach((endpoint) => {
69
+ if (endpoint.httpRoute.charAt(0) !== '/')
70
+ errors[k] = FORM_ALERTS.LATENCY_HTTP_ROUTE;
71
+ });
72
+ }
73
+ break;
74
+ case ActionKeyTypes.ServicesNameFilters:
75
+ if (formData.type === ActionType.ServiceNameSampler) {
76
+ if (isEmpty(v))
77
+ errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
78
+ v?.forEach((objV) => {
79
+ if (isEmpty(objV))
80
+ errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
81
+ });
82
+ }
83
+ break;
84
+ case ActionKeyTypes.AttributeFilters:
85
+ if (formData.type === ActionType.SpanAttributeSampler && isEmpty(v))
86
+ errors[k] = FORM_ALERTS.FIELD_IS_REQUIRED;
87
+ break;
88
+ }
89
+ });
90
+ ok = !Object.values(errors).length;
91
+ if (!ok && params?.withAlert) {
92
+ addNotification({
93
+ type: StatusType.Warning,
94
+ title: params.alertTitle,
95
+ message: FORM_ALERTS.REQUIRED_FIELDS,
96
+ hideFromHistory: true,
97
+ });
98
+ }
99
+ handleErrorChange(undefined, undefined, errors);
100
+ return ok;
101
+ };
102
+ const loadFormWithDrawerItem = ({ type, spec }) => {
103
+ const updatedData = {
104
+ ...INITIAL$2,
105
+ type,
106
+ };
107
+ Object.entries(spec).forEach(([k, v]) => {
108
+ if (!!v) {
109
+ switch (k) {
110
+ case 'actionName': {
111
+ updatedData['name'] = v;
112
+ break;
113
+ }
114
+ case 'type':
115
+ case 'notes':
116
+ case 'signals':
117
+ case 'disabled':
118
+ case ActionKeyTypes.CollectContainerAttributes:
119
+ case ActionKeyTypes.CollectReplicaSetAttributes:
120
+ case ActionKeyTypes.CollectWorkloadId:
121
+ case ActionKeyTypes.CollectClusterId:
122
+ case ActionKeyTypes.LabelsAttributes:
123
+ case ActionKeyTypes.AnnotationsAttributes:
124
+ case ActionKeyTypes.ClusterAttributes:
125
+ case ActionKeyTypes.AttributeNamesToDelete:
126
+ case ActionKeyTypes.Renames:
127
+ case ActionKeyTypes.PiiCategories:
128
+ case ActionKeyTypes.FallbackSamplingRatio:
129
+ case ActionKeyTypes.SamplingPercentage:
130
+ case ActionKeyTypes.EndpointsFilters:
131
+ case ActionKeyTypes.ServicesNameFilters:
132
+ case ActionKeyTypes.AttributeFilters: {
133
+ // @ts-expect-error - we know that the field name is in the parsedFields
134
+ updatedData[k] = v;
135
+ break;
136
+ }
137
+ }
138
+ }
139
+ });
140
+ handleFormChange(undefined, undefined, updatedData);
141
+ };
142
+ return {
143
+ formData,
144
+ formErrors,
145
+ handleFormChange,
146
+ resetFormData,
147
+ validateForm,
148
+ loadFormWithDrawerItem,
149
+ };
150
+ };
151
+
152
+ const useClickNotification = () => {
153
+ const { setDrawerType, setDrawerEntityId } = useDrawerStore();
154
+ const { markAsDismissed, markAsSeen } = useNotificationStore();
155
+ const onClickNotification = (notif, options) => {
156
+ const { id, crdType, target } = notif;
157
+ const { dismissToast } = options || {};
158
+ if (crdType && target) {
159
+ switch (crdType) {
160
+ case EntityTypes.InstrumentationRule:
161
+ setDrawerType(EntityTypes.InstrumentationRule);
162
+ setDrawerEntityId(getIdFromSseTarget(target, EntityTypes.InstrumentationRule));
163
+ break;
164
+ case EntityTypes.Source:
165
+ case 'InstrumentationConfig':
166
+ case 'InstrumentationInstance':
167
+ setDrawerType(EntityTypes.Source);
168
+ setDrawerEntityId(getIdFromSseTarget(target, EntityTypes.Source));
169
+ break;
170
+ case EntityTypes.Action:
171
+ setDrawerType(EntityTypes.Action);
172
+ setDrawerEntityId(getIdFromSseTarget(target, EntityTypes.Action));
173
+ break;
174
+ case EntityTypes.Destination:
175
+ case 'Destination':
176
+ setDrawerType(EntityTypes.Destination);
177
+ setDrawerEntityId(getIdFromSseTarget(target, EntityTypes.Destination));
178
+ break;
179
+ default:
180
+ console.warn('notif click not handled for:', { crdType, target });
181
+ break;
182
+ }
183
+ }
184
+ markAsSeen(id);
185
+ if (dismissToast)
186
+ markAsDismissed(id);
187
+ };
188
+ return { onClickNotification };
189
+ };
190
+
191
+ const useDataStreamFormData = (initialFormData) => {
192
+ const { addNotification } = useNotificationStore();
193
+ const { formData, handleFormChange, formErrors, handleErrorChange, resetFormData } = useGenericForm(initialFormData);
194
+ const validateForm = (params) => {
195
+ const errors = {};
196
+ let isValid = true;
197
+ if (!formData['name']) {
198
+ isValid = false;
199
+ errors['name'] = FORM_ALERTS.FIELD_IS_REQUIRED;
200
+ }
201
+ else if (!isLegalK8sLabel(formData['name'])) {
202
+ isValid = false;
203
+ errors['name'] = FORM_ALERTS.ILLEGAL_K8S_LABEL;
204
+ }
205
+ else {
206
+ errors['name'] = undefined;
207
+ }
208
+ if (!isValid && params?.withAlert) {
209
+ addNotification({
210
+ type: StatusType.Warning,
211
+ title: params.alertTitle,
212
+ message: FORM_ALERTS.REQUIRED_FIELDS,
213
+ hideFromHistory: true,
214
+ });
215
+ }
216
+ handleErrorChange(undefined, undefined, errors);
217
+ return isValid;
218
+ };
219
+ const loadFormWithDrawerItem = ({ name }) => {
220
+ const updatedData = {
221
+ ...initialFormData,
222
+ name,
223
+ };
224
+ handleFormChange(undefined, undefined, updatedData);
225
+ };
226
+ return {
227
+ formData,
228
+ formErrors,
229
+ handleFormChange,
230
+ resetFormData,
231
+ validateForm,
232
+ loadFormWithDrawerItem,
233
+ };
234
+ };
235
+
236
+ const INITIAL$1 = {
237
+ // @ts-expect-error - form should be initialized with empty values
238
+ type: '',
239
+ name: '',
240
+ exportedSignals: {
241
+ logs: false,
242
+ metrics: false,
243
+ traces: false,
244
+ },
245
+ fields: [],
246
+ };
247
+ const buildFormDynamicFields = (fields) => {
248
+ return fields
249
+ .filter((f) => !!f)
250
+ .map((f) => {
251
+ const { name, componentType, componentProperties, displayName, initialValue, renderCondition } = f;
252
+ switch (componentType) {
253
+ case FieldTypes.Dropdown: {
254
+ const componentPropertiesJson = safeJsonParse(componentProperties, {});
255
+ const options = Array.isArray(componentPropertiesJson.values)
256
+ ? componentPropertiesJson.values.map((value) => ({
257
+ id: value,
258
+ value,
259
+ }))
260
+ : Object.entries(componentPropertiesJson.values).map(([key, value]) => ({
261
+ id: key,
262
+ value,
263
+ }));
264
+ return {
265
+ name,
266
+ componentType: componentType,
267
+ title: displayName,
268
+ value: initialValue,
269
+ placeholder: componentPropertiesJson.placeholder || 'Select an option',
270
+ options,
271
+ renderCondition,
272
+ ...componentPropertiesJson,
273
+ };
274
+ }
275
+ default: {
276
+ const componentPropertiesJson = safeJsonParse(componentProperties, {});
277
+ return {
278
+ name,
279
+ componentType,
280
+ title: displayName,
281
+ value: initialValue,
282
+ renderCondition,
283
+ ...componentPropertiesJson,
284
+ };
285
+ }
286
+ }
287
+ });
288
+ };
289
+ const useDestinationFormData = (params) => {
290
+ const { supportedSignals, preLoadedFields } = params || {};
291
+ const { addNotification } = useNotificationStore();
292
+ const { formData, formErrors, handleFormChange, handleErrorChange, resetFormData } = useGenericForm(INITIAL$1);
293
+ const [yamlFields, setYamlFields] = useState([]);
294
+ const [dynamicFields, setDynamicFields] = useState([]);
295
+ useEffect(() => {
296
+ if (yamlFields) {
297
+ setDynamicFields(buildFormDynamicFields(yamlFields).map((field) => {
298
+ // if we have preloaded fields, we need to set the value of the field
299
+ // (this can be from an odigos-detected-destination during create, or from an existing destination during edit/update)
300
+ if (!!preLoadedFields) {
301
+ const parsedFields = typeof preLoadedFields === 'string' ? safeJsonParse(preLoadedFields, {}) : preLoadedFields;
302
+ if (field.name in parsedFields) {
303
+ return {
304
+ ...field,
305
+ // @ts-expect-error - we know that the field name is in the parsedFields
306
+ value: parsedFields[field.name],
307
+ };
308
+ }
309
+ }
310
+ return field;
311
+ }));
312
+ }
313
+ else {
314
+ setDynamicFields([]);
315
+ }
316
+ }, [yamlFields, preLoadedFields]);
317
+ useEffect(() => {
318
+ if (dynamicFields) {
319
+ const mapped = dynamicFields.map((field) => ({
320
+ key: field.name,
321
+ value: field.value,
322
+ }));
323
+ handleFormChange('fields', mapped);
324
+ }
325
+ }, [dynamicFields]);
326
+ useEffect(() => {
327
+ if (supportedSignals && mapExportedSignals(formData.exportedSignals).length === 0) {
328
+ const { logs, metrics, traces } = supportedSignals;
329
+ handleFormChange('exportedSignals', {
330
+ logs: logs.supported,
331
+ metrics: metrics.supported,
332
+ traces: traces.supported,
333
+ });
334
+ }
335
+ }, [supportedSignals, formData]);
336
+ const validateForm = (params) => {
337
+ const errors = {};
338
+ let ok = true;
339
+ dynamicFields.forEach(({ name, value, required }) => {
340
+ if (required && !value) {
341
+ ok = false;
342
+ errors[name] = FORM_ALERTS.FIELD_IS_REQUIRED;
343
+ }
344
+ });
345
+ if (!ok && params?.withAlert) {
346
+ addNotification({
347
+ type: StatusType.Warning,
348
+ title: params.alertTitle,
349
+ message: FORM_ALERTS.REQUIRED_FIELDS,
350
+ hideFromHistory: true,
351
+ });
352
+ }
353
+ handleErrorChange(undefined, undefined, errors);
354
+ return ok;
355
+ };
356
+ const loadFormWithDrawerItem = ({ destinationType: { type }, name, exportedSignals, fields }) => {
357
+ const updatedData = {
358
+ ...INITIAL$1,
359
+ type,
360
+ name,
361
+ exportedSignals,
362
+ fields: Object.entries(safeJsonParse(fields, {})).map(([key, value]) => ({ key, value })),
363
+ };
364
+ handleFormChange(undefined, undefined, updatedData);
365
+ return updatedData;
366
+ };
367
+ return {
368
+ formData,
369
+ formErrors,
370
+ handleFormChange,
371
+ resetFormData,
372
+ validateForm,
373
+ loadFormWithDrawerItem,
374
+ yamlFields,
375
+ setYamlFields,
376
+ dynamicFields,
377
+ setDynamicFields,
378
+ };
379
+ };
380
+
381
+ const useSessionStorage = () => {
382
+ const getItemSS = (key, defaultValue) => {
383
+ const item = sessionStorage.getItem(key);
384
+ return item ? safeJsonParse(item, defaultValue) : defaultValue;
385
+ };
386
+ const setItemSS = (key, value) => {
387
+ sessionStorage.setItem(key, JSON.stringify(value));
388
+ };
389
+ const removeItemSS = (key) => {
390
+ sessionStorage.removeItem(key);
391
+ };
392
+ return { getItemSS, setItemSS, removeItemSS };
393
+ };
394
+
395
+ const INITIAL = {
396
+ otelServiceName: '',
397
+ currentStreamName: '',
398
+ };
399
+ const useSourceFormData = () => {
400
+ const { formData, formErrors, handleFormChange, handleErrorChange, resetFormData } = useGenericForm(INITIAL);
401
+ const validateForm = () => {
402
+ // We don't have any specific validations for this form yet
403
+ handleErrorChange(undefined, undefined, {});
404
+ return true;
405
+ };
406
+ const loadFormWithDrawerItem = ({ otelServiceName, name }) => {
407
+ const updatedData = {
408
+ ...INITIAL,
409
+ otelServiceName: otelServiceName || name || '',
410
+ };
411
+ handleFormChange(undefined, undefined, updatedData);
412
+ };
413
+ return {
414
+ formData,
415
+ formErrors,
416
+ handleFormChange,
417
+ resetFormData,
418
+ validateForm,
419
+ loadFormWithDrawerItem,
420
+ };
421
+ };
422
+
423
+ const mapToAvailableSource = (source, selectedStreamName, selectAll) => {
424
+ const isBooleanOverride = typeof selectAll === 'boolean';
425
+ const isInCurrentStream = source.dataStreamNames?.includes(selectedStreamName) || source.currentStreamName === selectedStreamName;
426
+ const selected = (isBooleanOverride ? selectAll : source.selected) || false;
427
+ return {
428
+ namespace: source.namespace,
429
+ name: source.name,
430
+ kind: source.kind,
431
+ selected: isInCurrentStream || isBooleanOverride ? selected : false,
432
+ numberOfInstances: source.numberOfInstances,
433
+ };
434
+ };
435
+ const mapToSelectedSource = (source, selectedStreamName, selectAll) => {
436
+ return {
437
+ ...mapToAvailableSource(source, selectedStreamName, selectAll),
438
+ currentStreamName: selectedStreamName,
439
+ };
440
+ };
441
+ const mapToSelectedNamespace = (ns, selectedStreamName, selectAll) => {
442
+ const isBooleanOverride = typeof selectAll === 'boolean';
443
+ const isInCurrentStream = ns.dataStreamNames?.includes(selectedStreamName);
444
+ const selected = (isBooleanOverride ? selectAll : ns.selected) || false;
445
+ return {
446
+ namespace: ns.name,
447
+ selected: isInCurrentStream || isBooleanOverride ? selected : false,
448
+ currentStreamName: selectedStreamName,
449
+ };
450
+ };
451
+ const mergeAvailableAndSelectedSources = (available, selected, currentStreamName) => {
452
+ const payload = {};
453
+ Object.entries(available).forEach(([namespace, sources]) => {
454
+ payload[namespace] = sources.map((s) => mapToSelectedSource(s, currentStreamName));
455
+ });
456
+ Object.entries(selected).forEach(([namespace, sources]) => {
457
+ sources.forEach((s) => {
458
+ const foundIdx = payload[namespace].findIndex((src) => src.name === s.name && src.kind === s.kind);
459
+ const mapped = mapToSelectedSource(s, currentStreamName);
460
+ if (foundIdx !== -1) {
461
+ payload[namespace][foundIdx] = mapped;
462
+ }
463
+ else {
464
+ payload[namespace].push(mapped);
465
+ }
466
+ });
467
+ });
468
+ return payload;
469
+ };
470
+ const useSourceSelectionFormData = (params) => {
471
+ const { fetchSingleNamespace } = params || {};
472
+ const { namespaces } = useEntityStore();
473
+ const { selectedStreamName } = useDataStreamStore();
474
+ // only for "onboarding" - get unsaved values and set to state
475
+ // (this is to persist the values when user navigates back to this page)
476
+ const { configuredSources, configuredFutureApps, availableSources: availableSourcesFromStore } = useSetupStore();
477
+ // Keeps intial values fetched from API, so we can later filter the user-specific-selections, therebey minimizing the amount of data sent to the API on "persist sources".
478
+ const [availableSources, setRecordedInitialSources] = useState(availableSourcesFromStore);
479
+ const [selectedNamespace, setSelectedNamespace] = useState('');
480
+ const [selectedFutureApps, setSelectedFutureApps] = useState(configuredFutureApps);
481
+ const [selectedSources, setSelectedSources] = useState(mergeAvailableAndSelectedSources(availableSourcesFromStore, configuredSources, selectedStreamName));
482
+ const fetchAndSetThisNamespace = async (ns, selectAll) => {
483
+ if (fetchSingleNamespace) {
484
+ const { data } = await fetchSingleNamespace({ variables: { namespaceName: ns.name } });
485
+ const { name, sources = [] } = data?.computePlatform?.k8sActualNamespace || {};
486
+ if (!name)
487
+ return;
488
+ setRecordedInitialSources((prev) => ({
489
+ ...prev,
490
+ [name]: sources.map((s) => mapToAvailableSource(s, selectedStreamName)),
491
+ }));
492
+ setSelectedSources((prev) => ({
493
+ ...prev,
494
+ [name]: typeof selectAll !== 'boolean' && prev[name]?.length ? prev[name] : sources.map((s) => mapToSelectedSource(s, selectedStreamName, selectAll)),
495
+ }));
496
+ }
497
+ };
498
+ useEffect(() => {
499
+ if (!!namespaces?.length) {
500
+ // initialize empty states to avoid undefined errors
501
+ setRecordedInitialSources((prev) => {
502
+ const payload = { ...prev };
503
+ namespaces.forEach(({ name }) => (payload[name] = payload[name] || []));
504
+ return payload;
505
+ });
506
+ setSelectedSources((prev) => {
507
+ const payload = { ...prev };
508
+ namespaces.forEach(({ name }) => (payload[name] = payload[name] || []));
509
+ return payload;
510
+ });
511
+ setSelectedFutureApps((prev) => {
512
+ const payload = { ...prev };
513
+ namespaces.forEach((ns) => (payload[ns.name] = payload[ns.name] || mapToSelectedNamespace(ns, selectedStreamName)));
514
+ return payload;
515
+ });
516
+ (async () => {
517
+ for await (const ns of namespaces)
518
+ await fetchAndSetThisNamespace(ns);
519
+ })();
520
+ }
521
+ }, [namespaces, selectedStreamName]);
522
+ // form filters
523
+ const [searchText, setSearchText] = useState('');
524
+ const [searchBy, setSearchBy] = useState(EntityTypes.Source);
525
+ const [showSelectedOnly, setShowSelectedOnly] = useState(false);
526
+ const onSelectNamespace = (nsName, selectAll) => {
527
+ const ns = namespaces.find((namespace) => namespace.name === nsName);
528
+ if (ns) {
529
+ setSelectedNamespace((prev) => (prev === nsName && typeof selectAll !== 'boolean' ? '' : nsName));
530
+ fetchAndSetThisNamespace(ns, selectAll);
531
+ }
532
+ };
533
+ const onSelectSource = (source, nsName) => {
534
+ const id = nsName || selectedNamespace;
535
+ if (!id)
536
+ return;
537
+ const arr = [...(selectedSources[id] || [])];
538
+ const foundIdx = arr.findIndex(({ name, kind }) => name === source.name && kind === source.kind);
539
+ if (foundIdx !== -1) {
540
+ // Replace the item with a new object to avoid mutating a possibly read-only object
541
+ const updatedItem = { ...arr[foundIdx], selected: !arr[foundIdx].selected, currentStreamName: selectedStreamName };
542
+ arr[foundIdx] = updatedItem;
543
+ }
544
+ else {
545
+ arr.push({ ...source, selected: true, currentStreamName: selectedStreamName });
546
+ }
547
+ setSelectedSources((prev) => ({ ...prev, [id]: arr }));
548
+ };
549
+ const onSelectFutureApps = (bool, nsName) => {
550
+ const id = nsName || selectedNamespace;
551
+ if (!id)
552
+ return;
553
+ const ns = namespaces.find((namespace) => namespace.name === nsName);
554
+ if (ns)
555
+ setSelectedFutureApps((prev) => ({ ...prev, [id]: mapToSelectedNamespace(ns, selectedStreamName, bool) }));
556
+ };
557
+ const filteredNamespacesAndSources = useMemo(() => {
558
+ const isSearchOk = (targetText, entityType) => !searchText || searchBy !== entityType || (searchBy === entityType && targetText.toLowerCase().includes(searchText));
559
+ const isOnlySelectedOk = (source) => !showSelectedOnly || source.selected;
560
+ const payload = {};
561
+ const filteredNamespacesMatrix = Object.entries(selectedSources).filter(([ns]) => {
562
+ return isSearchOk(ns, EntityTypes.Namespace);
563
+ });
564
+ filteredNamespacesMatrix.forEach(([ns, srcs]) => {
565
+ payload[ns] = srcs.filter((src) => isSearchOk(src.name, EntityTypes.Source) && isOnlySelectedOk(src));
566
+ });
567
+ return payload;
568
+ }, [selectedSources, searchText, searchBy, showSelectedOnly]);
569
+ // This is to filter the user-specific-selections, therebey minimizing the amount of data sent to the API on "persist sources".
570
+ const getApiSourcesPayload = () => {
571
+ const payload = {};
572
+ Object.entries(selectedSources).forEach(([namespace, sources]) => {
573
+ sources.forEach((source) => {
574
+ const foundInitial = availableSources[namespace]?.find((src) => src.name === source.name && src.kind === source.kind);
575
+ if (foundInitial?.selected !== source.selected) {
576
+ if (!payload[namespace])
577
+ payload[namespace] = [];
578
+ payload[namespace].push(source);
579
+ }
580
+ });
581
+ });
582
+ return payload;
583
+ };
584
+ // This is to filter the user-specific-selections, therebey minimizing the amount of data sent to the API on "persist namespaces".
585
+ const getApiFutureAppsPayload = () => {
586
+ const payload = {};
587
+ Object.entries(selectedFutureApps).forEach(([namespace, obj]) => {
588
+ const foundInitial = namespaces?.find((ns) => ns.name === namespace);
589
+ if ((obj.selected && !foundInitial?.dataStreamNames?.includes(selectedStreamName)) || (!obj.selected && foundInitial?.dataStreamNames?.includes(selectedStreamName))) {
590
+ payload[namespace] = obj;
591
+ }
592
+ });
593
+ return payload;
594
+ };
595
+ return {
596
+ availableSources,
597
+ filteredNamespacesAndSources,
598
+ getApiSourcesPayload,
599
+ getApiFutureAppsPayload,
600
+ selectedNamespace,
601
+ onSelectNamespace,
602
+ selectedSources,
603
+ onSelectSource,
604
+ selectedFutureApps,
605
+ onSelectFutureApps,
606
+ searchText,
607
+ setSearchText,
608
+ searchBy,
609
+ setSearchBy,
610
+ showSelectedOnly,
611
+ setShowSelectedOnly,
612
+ };
613
+ };
614
+
615
+ export { useActionFormData, useClickNotification, useDataStreamFormData, useDestinationFormData, useGenericForm, useSessionStorage, useSourceFormData, useSourceSelectionFormData };
package/lib/icons.js CHANGED
@@ -1,10 +1,10 @@
1
- import { T as Theme } from './index-BC03UmY5.js';
2
- export { r as AddClusterInfoIcon, z as CPlusPlusLogo, E as CSharpLogo, C as CodeAttributesIcon, x as CustomInstrumentationIcon, s as DeleteAttributeIcon, G as DotnetLogo, J as ElixirLogo, N as GoLogo, H as HeadersCollectionIcon, v as ImageErrorIcon, O as JavaLogo, K as K8sLogo, w as KafkaLogo, Q as MysqlLogo, U as NginxLogo, V as NodejsLogo, y as PayloadCollectionIcon, W as PhpLogo, P as PiiMaskingIcon, X as PostgresLogo, Y as PythonLogo, Z as RedisLogo, R as RenameAttributeIcon, _ as RubyLogo, $ as RustLogo, t as SamplerIcon, a0 as SwiftLogo } from './index-BC03UmY5.js';
3
- export { C as CheckCircledIcon, E as ErrorTriangleIcon, I as InfoIcon, L as LogsIcon, M as MetricsIcon, O as OdigosLogo, T as TracesIcon, W as WarningTriangleIcon } from './index-H8TwBQHm.js';
4
- export { C as CrossCircledIcon, D as DataStreamsIcon, F as FilterIcon, K as KeyIcon, N as NotificationIcon, O as OdigosLogoText, a as OverviewIcon, R as RetryIcon, S as SlackLogo, T as TerminalIcon, U as UserIcon } from './index-LgzkJ05H.js';
5
- export { A as ArrowIcon, h as CheckIcon, C as CodeIcon, a as CopyIcon, i as CrossIcon, E as EditIcon, b as EditedIcon, c as ExtendArrowIcon, f as EyeClosedIcon, g as EyeOpenIcon, L as ListIcon, M as MinusIcon, N as NoDataIcon, d as NotebookIcon, P as PlusIcon, S as SearchIcon, e as SortArrowsIcon, T as TrashIcon, X as XIcon } from './index-CyHOJpMl.js';
1
+ import { T as Theme } from './index-118aa476.js';
2
+ export { f as AddClusterInfoIcon, n as CPlusPlusLogo, o as CSharpLogo, C as CodeAttributesIcon, l as CustomInstrumentationIcon, h as DeleteAttributeIcon, p as DotnetLogo, E as ElixirLogo, G as GoLogo, H as HeadersCollectionIcon, j as ImageErrorIcon, J as JavaLogo, K as K8sLogo, k as KafkaLogo, q as MysqlLogo, N as NginxLogo, r as NodejsLogo, m as PayloadCollectionIcon, s as PhpLogo, P as PiiMaskingIcon, t as PostgresLogo, u as PythonLogo, v as RedisLogo, R as RenameAttributeIcon, w as RubyLogo, x as RustLogo, i as SamplerIcon, y as SwiftLogo } from './index-118aa476.js';
3
+ export { C as CheckCircledIcon, E as ErrorTriangleIcon, I as InfoIcon, L as LogsIcon, M as MetricsIcon, O as OdigosLogo, T as TracesIcon, W as WarningTriangleIcon } from './index-974c5344.js';
4
+ export { C as CrossCircledIcon, D as DataStreamsIcon, F as FilterIcon, K as KeyIcon, N as NotificationIcon, O as OdigosLogoText, a as OverviewIcon, R as RetryIcon, S as SlackLogo, T as TerminalIcon, U as UserIcon } from './index-f64b0a7d.js';
5
+ export { A as ArrowIcon, h as CheckIcon, C as CodeIcon, a as CopyIcon, i as CrossIcon, E as EditIcon, b as EditedIcon, c as ExtendArrowIcon, f as EyeClosedIcon, g as EyeOpenIcon, L as ListIcon, M as MinusIcon, N as NoDataIcon, d as NotebookIcon, P as PlusIcon, S as SearchIcon, e as SortArrowsIcon, T as TrashIcon, X as XIcon } from './index-f40b593d.js';
6
6
  import React from 'react';
7
- export { a3 as ActionsIcon, A as AlaudaLogo, a as AlibabaCloudLogo, b as AppDynamicsLogo, c as AwsCloudwatchLogo, d as AwsS3Logo, e as AwsXrayLogo, f as AxiomLogo, B as BetterStackLogo, g as BlobStorageLogo, h as BonreeLogo, C as CauselyLogo, i as ChecklyLogo, j as ChronosphereLogo, k as ClickhouseLogo, l as CoralogixLogo, D as Dash0Logo, m as DatadogLogo, a4 as DestinationsIcon, n as DynatraceLogo, E as ElasticApmLogo, o as ElasticSearchLogo, G as GigapipeLogo, p as GoogleCloudPlatformLogo, q as GrafanaLogo, r as GreptimeLogo, s as GroundcoverLogo, H as HoneycombLogo, t as HyperDxLogo, I as InstanaLogo, J as JaegerLogo, K as KloudmateLogo, L as Last9Logo, u as LightstepLogo, v as LogzioLogo, w as LokiLogo, x as LumigoLogo, M as MiddlewareLogo, a5 as NamespacesIcon, N as NewRelicLogo, O as ObserveLogo, y as OneUptimeLogo, z as OpenObserveLogo, F as OpenTelemetryLogo, P as OpsVerseLogo, Q as OracleLogo, R as PrometheusLogo, S as QrynLogo, T as QuickwitLogo, a6 as RulesIcon, U as SeqLogo, W as SignozLogo, a7 as SourcesIcon, X as SplunkLogo, Y as SumoLogicLogo, Z as TelemetryHubLogo, _ as TempoLogo, $ as TingyunLogo, a0 as TraceloopLogo, a1 as UptraceLogo, a2 as VictoriaMetricsLogo, V as VmLogo } from './index-CMsBAVAn.js';
7
+ export { a3 as ActionsIcon, A as AlaudaLogo, a as AlibabaCloudLogo, b as AppDynamicsLogo, c as AwsCloudwatchLogo, d as AwsS3Logo, e as AwsXrayLogo, f as AxiomLogo, B as BetterStackLogo, g as BlobStorageLogo, h as BonreeLogo, C as CauselyLogo, i as ChecklyLogo, j as ChronosphereLogo, k as ClickhouseLogo, l as CoralogixLogo, D as Dash0Logo, m as DatadogLogo, a4 as DestinationsIcon, n as DynatraceLogo, E as ElasticApmLogo, o as ElasticSearchLogo, G as GigapipeLogo, p as GoogleCloudPlatformLogo, q as GrafanaLogo, r as GreptimeLogo, s as GroundcoverLogo, H as HoneycombLogo, t as HyperDxLogo, I as InstanaLogo, J as JaegerLogo, K as KloudmateLogo, L as Last9Logo, u as LightstepLogo, v as LogzioLogo, w as LokiLogo, x as LumigoLogo, M as MiddlewareLogo, a5 as NamespacesIcon, N as NewRelicLogo, O as ObserveLogo, y as OneUptimeLogo, z as OpenObserveLogo, F as OpenTelemetryLogo, P as OpsVerseLogo, Q as OracleLogo, R as PrometheusLogo, S as QrynLogo, T as QuickwitLogo, a6 as RulesIcon, U as SeqLogo, W as SignozLogo, a7 as SourcesIcon, X as SplunkLogo, Y as SumoLogicLogo, Z as TelemetryHubLogo, _ as TempoLogo, $ as TingyunLogo, a0 as TraceloopLogo, a1 as UptraceLogo, a2 as VictoriaMetricsLogo, V as VmLogo } from './index-b833b336.js';
8
8
  import './types.js';
9
9
  import 'styled-components';
10
10
 
@@ -1040,7 +1040,7 @@ function createJSONStorage(getStorage, options) {
1040
1040
  if (str2 === null) {
1041
1041
  return null;
1042
1042
  }
1043
- return JSON.parse(str2, void 0 );
1043
+ return JSON.parse(str2, options == null ? void 0 : options.reviver);
1044
1044
  };
1045
1045
  const str = (_a = storage.getItem(name)) != null ? _a : null;
1046
1046
  if (str instanceof Promise) {
@@ -1048,7 +1048,7 @@ function createJSONStorage(getStorage, options) {
1048
1048
  }
1049
1049
  return parse(str);
1050
1050
  },
1051
- setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, void 0 )),
1051
+ setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, options == null ? void 0 : options.replacer)),
1052
1052
  removeItem: (name) => storage.removeItem(name)
1053
1053
  };
1054
1054
  return persistStorage;
@@ -1572,6 +1572,7 @@ const baseTheme = {
1572
1572
  darkest_red_hover: '#351515',
1573
1573
  dark_green: '#2D4323',
1574
1574
  },
1575
+ text: {},
1575
1576
  font_family: {
1576
1577
  primary: 'Inter, sans-serif',
1577
1578
  secondary: 'Kode Mono, sans-serif',
@@ -1895,4 +1896,4 @@ var animations = /*#__PURE__*/Object.freeze({
1895
1896
 
1896
1897
  const Theme = { Provider, useTheme, opacity, animations };
1897
1898
 
1898
- export { RustLogo as $, ACTION_OPTIONS as A, BUTTON_TEXTS as B, CodeAttributesIcon as C, DISPLAY_LANGUAGES as D, CSharpLogo as E, FORM_ALERTS as F, DotnetLogo as G, HeadersCollectionIcon as H, INSTRUMENTATION_RULE_OPTIONS as I, ElixirLogo as J, K8sLogo as K, LANGUAGE_OPTIONS as L, MONITORS_OPTIONS as M, GoLogo as N, JavaLogo as O, PiiMaskingIcon as P, MysqlLogo as Q, RenameAttributeIcon as R, STORAGE_KEYS as S, Theme as T, NginxLogo as U, NodejsLogo as V, PhpLogo as W, PostgresLogo as X, PythonLogo as Y, RedisLogo as Z, RubyLogo as _, useDarkMode as a, SwiftLogo as a0, styleInject as a1, useDataStreamStore as b, useDrawerStore as c, useEntityStore as d, useFilterStore as e, useInstrumentStore as f, useModalStore as g, useNotificationStore as h, usePendingStore as i, useSelectedStore as j, useSetupStore as k, DEFAULT_DATA_STREAM_NAME as l, DISPLAY_TITLES as m, getActionIcon as n, getEntityId as o, getInstrumentationRuleIcon as p, getProgrammingLanguageIcon as q, AddClusterInfoIcon as r, DeleteAttributeIcon as s, SamplerIcon as t, useActiveNodeStore as u, ImageErrorIcon as v, KafkaLogo as w, CustomInstrumentationIcon as x, PayloadCollectionIcon as y, CPlusPlusLogo as z };
1899
+ export { useSelectedStore as $, ACTION_OPTIONS as A, BUTTON_TEXTS as B, CodeAttributesIcon as C, DISPLAY_LANGUAGES as D, ElixirLogo as E, FORM_ALERTS as F, GoLogo as G, HeadersCollectionIcon as H, INSTRUMENTATION_RULE_OPTIONS as I, JavaLogo as J, K8sLogo as K, LANGUAGE_OPTIONS as L, MONITORS_OPTIONS as M, NginxLogo as N, useDrawerStore as O, PiiMaskingIcon as P, useActiveNodeStore as Q, RenameAttributeIcon as R, STORAGE_KEYS as S, Theme as T, usePendingStore as U, useNotificationStore as V, useEntityStore as W, useFilterStore as X, useDataStreamStore as Y, useInstrumentStore as Z, useSetupStore as _, DEFAULT_DATA_STREAM_NAME as a, useDarkMode as a0, styleInject as a1, DISPLAY_TITLES as b, getEntityId as c, getInstrumentationRuleIcon as d, getProgrammingLanguageIcon as e, AddClusterInfoIcon as f, getActionIcon as g, DeleteAttributeIcon as h, SamplerIcon as i, ImageErrorIcon as j, KafkaLogo as k, CustomInstrumentationIcon as l, PayloadCollectionIcon as m, CPlusPlusLogo as n, CSharpLogo as o, DotnetLogo as p, MysqlLogo as q, NodejsLogo as r, PhpLogo as s, PostgresLogo as t, PythonLogo as u, RedisLogo as v, RubyLogo as w, RustLogo as x, SwiftLogo as y, useModalStore as z };