@odigos/ui-kit 0.0.15 → 0.0.17

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 (278) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/lib/components/data-tab/index.d.ts +17 -6
  3. package/lib/components/drawer/drawer-header/index.d.ts +2 -2
  4. package/lib/components/icon-group/index.d.ts +1 -0
  5. package/lib/components.js +45 -14
  6. package/lib/constants.js +9 -5
  7. package/lib/containers/data-flow-actions-menu/filters/index.d.ts +0 -3
  8. package/lib/containers/data-flow-actions-menu/index.d.ts +0 -3
  9. package/lib/containers/dropdowns/namespace-dropdown/index.d.ts +0 -3
  10. package/lib/containers/overview-drawer/index.d.ts +2 -2
  11. package/lib/containers/source-modal/index.d.ts +1 -5
  12. package/lib/containers/source-selection-form/index.d.ts +1 -4
  13. package/lib/containers/source-selection-form/{fast/list → list}/index.d.ts +0 -1
  14. package/lib/containers/table-cell-conditions/index.d.ts +1 -0
  15. package/lib/containers.js +214 -230
  16. package/lib/data/destinations/index.d.ts +1 -1
  17. package/lib/functions/get-destination-icon/index.d.ts +5 -1
  18. package/lib/functions.js +17 -21
  19. package/lib/hooks/useSourceSelectionFormData.d.ts +1 -2
  20. package/lib/hooks.js +10 -10
  21. package/lib/icons/destinations/app-dynamics-logo/index.d.ts +2 -0
  22. package/lib/icons/destinations/aws-cloudwatch-logo/index.d.ts +2 -0
  23. package/lib/icons/destinations/aws-s3-logo/index.d.ts +2 -0
  24. package/lib/icons/destinations/aws-xray-logo/index.d.ts +2 -0
  25. package/lib/icons/destinations/axiom-logo/index.d.ts +2 -0
  26. package/lib/icons/destinations/better-stack-logo/index.d.ts +2 -0
  27. package/lib/icons/destinations/blob-storage-logo/index.d.ts +2 -0
  28. package/lib/icons/destinations/causely-logo/index.d.ts +2 -0
  29. package/lib/icons/destinations/chronosphere-logo/index.d.ts +2 -0
  30. package/lib/icons/destinations/clickhouse-logo/index.d.ts +2 -0
  31. package/lib/icons/destinations/coralogix-logo/index.d.ts +2 -0
  32. package/lib/icons/destinations/dash0-logo/index.d.ts +2 -0
  33. package/lib/icons/destinations/datadog-logo/index.d.ts +2 -0
  34. package/lib/icons/destinations/dynatrace-logo/index.d.ts +2 -0
  35. package/lib/icons/destinations/elastic-apm-logo/index.d.ts +2 -0
  36. package/lib/icons/destinations/elastic-search-logo/index.d.ts +2 -0
  37. package/lib/icons/destinations/gigapipe-logo/index.d.ts +2 -0
  38. package/lib/icons/destinations/google-cloud-platform-logo/index.d.ts +2 -0
  39. package/lib/icons/destinations/google-cloud-storage-logo/index.d.ts +2 -0
  40. package/lib/icons/destinations/grafana-logo/index.d.ts +2 -0
  41. package/lib/icons/destinations/groundcover-logo/index.d.ts +2 -0
  42. package/lib/icons/destinations/honeycomb-logo/index.d.ts +2 -0
  43. package/lib/icons/destinations/hyperdx-logo/index.d.ts +2 -0
  44. package/lib/icons/destinations/index.d.ts +46 -0
  45. package/lib/icons/destinations/instana-logo/index.d.ts +2 -0
  46. package/lib/icons/destinations/jaeger-logo/index.d.ts +2 -0
  47. package/lib/icons/destinations/kloudmate-logo/index.d.ts +2 -0
  48. package/lib/icons/destinations/last9-logo/index.d.ts +2 -0
  49. package/lib/icons/destinations/lightstep-logo/index.d.ts +2 -0
  50. package/lib/icons/destinations/logzio-logo/index.d.ts +2 -0
  51. package/lib/icons/destinations/loki-logo/index.d.ts +2 -0
  52. package/lib/icons/destinations/lumigo-logo/index.d.ts +2 -0
  53. package/lib/icons/destinations/middleware-logo/index.d.ts +2 -0
  54. package/lib/icons/destinations/new-relic-logo/index.d.ts +2 -0
  55. package/lib/icons/destinations/open-telemetry-logo/index.d.ts +2 -0
  56. package/lib/icons/destinations/ops-verse-logo/index.d.ts +2 -0
  57. package/lib/icons/destinations/prometheus-logo/index.d.ts +2 -0
  58. package/lib/icons/destinations/qryn-logo/index.d.ts +2 -0
  59. package/lib/icons/destinations/quickwit-logo/index.d.ts +2 -0
  60. package/lib/icons/destinations/sentry-logo/index.d.ts +2 -0
  61. package/lib/icons/destinations/signoz-logo/index.d.ts +2 -0
  62. package/lib/icons/destinations/splunk-logo/index.d.ts +2 -0
  63. package/lib/icons/destinations/sumo-logic-logo/index.d.ts +2 -0
  64. package/lib/icons/destinations/tempo-logo/index.d.ts +2 -0
  65. package/lib/icons/destinations/traceloop-logo/index.d.ts +2 -0
  66. package/lib/icons/destinations/uptrace-logo/index.d.ts +2 -0
  67. package/lib/icons/index.d.ts +1 -0
  68. package/lib/icons/overview/index.d.ts +1 -0
  69. package/lib/icons/overview/namespaces-icon/index.d.ts +2 -0
  70. package/lib/icons/programming-languages/index.d.ts +0 -1
  71. package/lib/icons.js +40 -8
  72. package/lib/index-B72aw6tI.js +23 -0
  73. package/lib/{index-D_Qn2U89.js → index-BJxaoI0G.js} +1 -8
  74. package/lib/{index-BtuW12KL.js → index-BQW5EUgp.js} +74 -8
  75. package/lib/index-BQs4sULy.js +32 -0
  76. package/lib/index-BVVVevuY.js +100 -0
  77. package/lib/index-BWqrekK4.js +11 -0
  78. package/lib/{index-zMKRaKMY.js → index-BiNX-Cge.js} +119 -156
  79. package/lib/{index-9ObpINp4.js → index-BsH_egEe.js} +15 -6
  80. package/lib/{index-CYn62h8x.js → index-BxQTUOME.js} +10 -12
  81. package/lib/index-C1PCuZgw.js +18 -0
  82. package/lib/{index-Db_ZDrEr.js → index-C3nz3TIx.js} +6 -8
  83. package/lib/{index-BGlk5VhF.js → index-CIXQeSHu.js} +1 -10
  84. package/lib/index-CIgHU72d.js +52 -0
  85. package/lib/index-DB8Djrsy.js +487 -0
  86. package/lib/index-DbfrGXPH.js +8 -0
  87. package/lib/{index-CJKFedQi.js → index-G4WmxXds.js} +4 -21
  88. package/lib/{index-7-KCQK-x.js → index-Hz7AAE0t.js} +1 -1
  89. package/lib/{index-3KUV6Vlt.js → index-KOMAv-TS.js} +6 -10
  90. package/lib/index-RBS1MqCQ.js +37 -0
  91. package/lib/react-CjImwkhV.js +44 -0
  92. package/lib/store/useEntityStore.d.ts +4 -2
  93. package/lib/store/useSetupStore.d.ts +2 -3
  94. package/lib/store.js +6 -3
  95. package/lib/theme.js +86 -3
  96. package/lib/types/common/index.d.ts +1 -0
  97. package/lib/types/destinations/index.d.ts +50 -3
  98. package/lib/types.js +6 -163
  99. package/lib/useDarkMode-DxhIuVNi.js +201 -0
  100. package/lib/useSelectedStore-93bIo1kE.js +97 -0
  101. package/lib/useSetupStore-CoYx1UQw.js +211 -0
  102. package/lib/{useTransition-CFmm4scp.js → useTimeAgo-weEj7br6.js} +544 -113
  103. package/lib/useTransition-D0wUpPGk.js +128 -0
  104. package/package.json +13 -12
  105. package/lib/components/auto-complete-input/auto-complete-input.stories.d.ts +0 -9
  106. package/lib/components/badge/badge.stories.d.ts +0 -13
  107. package/lib/components/button/button.stories.d.ts +0 -9
  108. package/lib/components/cancel-warning/cancel-warning.stories.d.ts +0 -9
  109. package/lib/components/checkbox/checkbox.stories.d.ts +0 -9
  110. package/lib/components/code/code.stories.d.ts +0 -9
  111. package/lib/components/condition-details/condition-details.stories.d.ts +0 -14
  112. package/lib/components/data-card/data-card.stories.d.ts +0 -10
  113. package/lib/components/data-tab/data-tab.stories.d.ts +0 -15
  114. package/lib/components/delete-warning/delete-warning.stories.d.ts +0 -9
  115. package/lib/components/describe-row/describe-row.stories.d.ts +0 -9
  116. package/lib/components/divider/divider.stories.d.ts +0 -9
  117. package/lib/components/docs-button/docs-button.stories.d.ts +0 -9
  118. package/lib/components/drawer/drawer.stories.d.ts +0 -10
  119. package/lib/components/dropdown/dropdown.stories.d.ts +0 -10
  120. package/lib/components/error-boundary/error-boundary.stories.d.ts +0 -9
  121. package/lib/components/extend-arrow/extend-arrow.stories.d.ts +0 -9
  122. package/lib/components/fade-loader/fade-loader.stories.d.ts +0 -9
  123. package/lib/components/field-error/field-error.stories.d.ts +0 -9
  124. package/lib/components/field-label/field-label.stories.d.ts +0 -9
  125. package/lib/components/header/header.stories.d.ts +0 -9
  126. package/lib/components/icon-button/icon-button.stories.d.ts +0 -9
  127. package/lib/components/icon-group/icon-group.stories.d.ts +0 -14
  128. package/lib/components/icon-title-badge/icon-title-badge.stories.d.ts +0 -9
  129. package/lib/components/icon-wrapped/icon-wrapped.stories.d.ts +0 -10
  130. package/lib/components/icons-nav/icons-nav.stories.d.ts +0 -9
  131. package/lib/components/image-controlled/image-controlled.stories.d.ts +0 -9
  132. package/lib/components/input/input.stories.d.ts +0 -9
  133. package/lib/components/input-list/input-list.stories.d.ts +0 -9
  134. package/lib/components/input-table/input-table.stories.d.ts +0 -9
  135. package/lib/components/interactive-table/interactive-table.stories.d.ts +0 -12
  136. package/lib/components/key-value-input-list/key-value-input-list.stories.d.ts +0 -9
  137. package/lib/components/modal/modal.stories.d.ts +0 -9
  138. package/lib/components/monitors-checkboxes/monitors-checkboxes.stories.d.ts +0 -9
  139. package/lib/components/monitors-icons/monitors-icons.stories.d.ts +0 -9
  140. package/lib/components/navigation-buttons/navigation-buttons.stories.d.ts +0 -9
  141. package/lib/components/no-data-found/no-data-found.stories.d.ts +0 -9
  142. package/lib/components/notification-note/notification-note.stories.d.ts +0 -10
  143. package/lib/components/section-title/section-title.stories.d.ts +0 -9
  144. package/lib/components/segment/segment.stories.d.ts +0 -9
  145. package/lib/components/skeleton-loader/skeleton-loader.stories.d.ts +0 -9
  146. package/lib/components/status/status.stories.d.ts +0 -9
  147. package/lib/components/stepper/stepper.stories.d.ts +0 -9
  148. package/lib/components/text/text.stories.d.ts +0 -9
  149. package/lib/components/textarea/textarea.stories.d.ts +0 -9
  150. package/lib/components/toggle/toggle.stories.d.ts +0 -9
  151. package/lib/components/tooltip/tooltip.stories.d.ts +0 -9
  152. package/lib/components/trace-loader/trace-loader.stories.d.ts +0 -9
  153. package/lib/components/warning-modal/warning-modal.stories.d.ts +0 -9
  154. package/lib/containers/action-drawer/action-drawer.stories.d.ts +0 -9
  155. package/lib/containers/action-form/action-form.stories.d.ts +0 -9
  156. package/lib/containers/action-modal/action-modal.stories.d.ts +0 -9
  157. package/lib/containers/action-table/action-table.stories.d.ts +0 -9
  158. package/lib/containers/await-pipeline/await-pipeline.stories.d.ts +0 -9
  159. package/lib/containers/compute-platform-select/compute-platform-select.stories.d.ts +0 -9
  160. package/lib/containers/compute-platforms/compute-platforms.stories.d.ts +0 -9
  161. package/lib/containers/compute-platforms-actions-menu/compute-platforms-actions-menu.stories.d.ts +0 -9
  162. package/lib/containers/data-flow/data-flow.stories.d.ts +0 -9
  163. package/lib/containers/data-flow-actions-menu/data-flow.stories.d.ts +0 -11
  164. package/lib/containers/destination-drawer/destination-drawer.stories.d.ts +0 -9
  165. package/lib/containers/destination-form/destination-form.stories.d.ts +0 -9
  166. package/lib/containers/destination-modal/destination-modal.stories.d.ts +0 -9
  167. package/lib/containers/destination-selection-form/destination-selection-form.stories.d.ts +0 -9
  168. package/lib/containers/destination-table/destination-table.stories.d.ts +0 -9
  169. package/lib/containers/dropdowns/connection-status-dropdown/connection-status-dropdown.stories.d.ts +0 -9
  170. package/lib/containers/dropdowns/connection-type-dropdown/connection-type-dropdown.stories.d.ts +0 -9
  171. package/lib/containers/dropdowns/error-dropdown/error-dropdown.stories.d.ts +0 -9
  172. package/lib/containers/dropdowns/kind-dropdown/error-dropdown.stories.d.ts +0 -9
  173. package/lib/containers/dropdowns/language-dropdown/language-dropdown.stories.d.ts +0 -9
  174. package/lib/containers/dropdowns/monitor-dropdown/monitor-dropdown.stories.d.ts +0 -9
  175. package/lib/containers/dropdowns/namespace-dropdown/namespace-dropdown.stories.d.ts +0 -9
  176. package/lib/containers/instrumentation-rule-drawer/instrumentation-rule-drawer.stories.d.ts +0 -9
  177. package/lib/containers/instrumentation-rule-form/instrumentation-rule-form.stories.d.ts +0 -9
  178. package/lib/containers/instrumentation-rule-modal/instrumentation-rule-modal.stories.d.ts +0 -9
  179. package/lib/containers/instrumentation-rule-table/instrumentation-rule-table.stories.d.ts +0 -9
  180. package/lib/containers/multi-source-control/multi-source-control.stories.d.ts +0 -9
  181. package/lib/containers/notification-manager/notification-manager.stories.d.ts +0 -9
  182. package/lib/containers/overview-drawer/overview-drawer.stories.d.ts +0 -9
  183. package/lib/containers/side-nav/side-nav.stories.d.ts +0 -9
  184. package/lib/containers/slack-invite/slack-invite.stories.d.ts +0 -9
  185. package/lib/containers/source-drawer/source-drawer.stories.d.ts +0 -9
  186. package/lib/containers/source-form/source-form.stories.d.ts +0 -9
  187. package/lib/containers/source-modal/source-modal.stories.d.ts +0 -9
  188. package/lib/containers/source-selection-form/fast/index.d.ts +0 -7
  189. package/lib/containers/source-selection-form/simple/controls/index.d.ts +0 -11
  190. package/lib/containers/source-selection-form/simple/index.d.ts +0 -7
  191. package/lib/containers/source-selection-form/simple/list/index.d.ts +0 -9
  192. package/lib/containers/source-selection-form/source-selection-form.stories.d.ts +0 -9
  193. package/lib/containers/source-table/source-table.stories.d.ts +0 -9
  194. package/lib/containers/system-overview/system-overview.stories.d.ts +0 -9
  195. package/lib/containers/table-cell-conditions/table-cell-conditions.stories.d.ts +0 -9
  196. package/lib/containers/toast-list/toast-list.stories.d.ts +0 -9
  197. package/lib/containers/toggle-dark-mode/toggle-dark-mode.stories.d.ts +0 -9
  198. package/lib/icons/actions/add-cluster-info-icon/add-cluster-info-icon.stories.d.ts +0 -8
  199. package/lib/icons/actions/delete-attribute-icon/delete-attribute-icon.stories.d.ts +0 -8
  200. package/lib/icons/actions/pii-masking-icon/pii-masking-icon.stories.d.ts +0 -8
  201. package/lib/icons/actions/rename-attribute-icon/rename-attribute-icon.stories.d.ts +0 -8
  202. package/lib/icons/actions/sampler-icon/sampler-icon.stories.d.ts +0 -8
  203. package/lib/icons/brand/odigos-logo/odigos-logo.stories.d.ts +0 -8
  204. package/lib/icons/brand/odigos-logo-text/odigos-logo-text.stories.d.ts +0 -8
  205. package/lib/icons/common/arrow-icon/arrow-icon.stories.d.ts +0 -8
  206. package/lib/icons/common/code-brackets-icon/code-brackets-icon.stories.d.ts +0 -8
  207. package/lib/icons/common/code-icon/code-icon.stories.d.ts +0 -8
  208. package/lib/icons/common/command-icon/command-icon.stories.d.ts +0 -8
  209. package/lib/icons/common/copy-icon/copy-icon.stories.d.ts +0 -8
  210. package/lib/icons/common/edit-icon/edit-icon.stories.d.ts +0 -8
  211. package/lib/icons/common/extend-arrow-icon/extend-arrow-icon.stories.d.ts +0 -8
  212. package/lib/icons/common/filter-icon/filter-icon.stories.d.ts +0 -8
  213. package/lib/icons/common/folder-icon/folder-icon.stories.d.ts +0 -8
  214. package/lib/icons/common/image-error-icon/image-error-icon.stories.d.ts +0 -8
  215. package/lib/icons/common/key-icon/key-icon.stories.d.ts +0 -8
  216. package/lib/icons/common/list-icon/list-icon.stories.d.ts +0 -8
  217. package/lib/icons/common/no-data-icon/no-data-icon.stories.d.ts +0 -8
  218. package/lib/icons/common/notebook-icon/notebook-icon.stories.d.ts +0 -8
  219. package/lib/icons/common/notification-icon/notification-icon.stories.d.ts +0 -8
  220. package/lib/icons/common/search-icon/search-icon.stories.d.ts +0 -8
  221. package/lib/icons/common/sort-arrows-icon/sort-arrows-icon.stories.d.ts +0 -8
  222. package/lib/icons/common/terminal-icon/terminal-icon.stories.d.ts +0 -8
  223. package/lib/icons/common/trash-icon/trash-icon.stories.d.ts +0 -8
  224. package/lib/icons/common/x-icon/x-icon.stories.d.ts +0 -8
  225. package/lib/icons/compute-platform/k8s-logo/k8s-logo.stories.d.ts +0 -8
  226. package/lib/icons/compute-platform/vm-logo/vm-logo.stories.d.ts +0 -8
  227. package/lib/icons/instrumentation-rules/code-attributes-icon/code-attributes-icon.stories.d.ts +0 -8
  228. package/lib/icons/instrumentation-rules/payload-collection-icon/payload-collection-icon.stories.d.ts +0 -8
  229. package/lib/icons/math/minus-icon/minus-icon.stories.d.ts +0 -8
  230. package/lib/icons/math/plus-icon/plus-icon.stories.d.ts +0 -8
  231. package/lib/icons/monitors/logs-icon/logs-icon.stories.d.ts +0 -8
  232. package/lib/icons/monitors/metrics-icon/metrics-icon.stories.d.ts +0 -8
  233. package/lib/icons/monitors/traces-icon/traces-icon.stories.d.ts +0 -8
  234. package/lib/icons/on-off/eye-closed-icon/eye-closed-icon.stories.d.ts +0 -8
  235. package/lib/icons/on-off/eye-open-icon/eye-open-icon.stories.d.ts +0 -8
  236. package/lib/icons/on-off/light-off-icon/light-off-icon.stories.d.ts +0 -8
  237. package/lib/icons/on-off/light-on-icon/light-on-icon.stories.d.ts +0 -8
  238. package/lib/icons/on-off/moon-icon/moon-icon.stories.d.ts +0 -8
  239. package/lib/icons/on-off/sun-icon/sun-icon.stories.d.ts +0 -8
  240. package/lib/icons/overview/actions-icon/actions-icon.stories.d.ts +0 -8
  241. package/lib/icons/overview/connections-icon/connections-icon.stories.d.ts +0 -8
  242. package/lib/icons/overview/destinations-icon/destinations-icon.stories.d.ts +0 -8
  243. package/lib/icons/overview/overview-icon/overview-icon.stories.d.ts +0 -8
  244. package/lib/icons/overview/rules-icon/rules-icon.stories.d.ts +0 -8
  245. package/lib/icons/overview/service-map-icon/service-map-icon.stories.d.ts +0 -8
  246. package/lib/icons/overview/sources-icon/sources-icon.stories.d.ts +0 -8
  247. package/lib/icons/overview/trace-view-icon/trace-view-icon.stories.d.ts +0 -8
  248. package/lib/icons/programming-languages/c-plus-plus-logo/c-plus-plus-logo.stories.d.ts +0 -8
  249. package/lib/icons/programming-languages/c-sharp-logo/c-sharp-logo.stories.d.ts +0 -8
  250. package/lib/icons/programming-languages/dotnet-logo/dotnet-logo.stories.d.ts +0 -8
  251. package/lib/icons/programming-languages/elixir-logo/elixir-logo.stories.d.ts +0 -8
  252. package/lib/icons/programming-languages/go-logo/go-logo.stories.d.ts +0 -8
  253. package/lib/icons/programming-languages/java-logo/java-logo.stories.d.ts +0 -8
  254. package/lib/icons/programming-languages/kafka-logo/kafka-logo.stories.d.ts +0 -8
  255. package/lib/icons/programming-languages/mysql-logo/mysql-logo.stories.d.ts +0 -8
  256. package/lib/icons/programming-languages/nginx-logo/nginx-logo.stories.d.ts +0 -8
  257. package/lib/icons/programming-languages/nodejs-logo/nodejs-logo.stories.d.ts +0 -8
  258. package/lib/icons/programming-languages/php-logo/php-logo.stories.d.ts +0 -8
  259. package/lib/icons/programming-languages/postgres-logo/postgres-logo.stories.d.ts +0 -8
  260. package/lib/icons/programming-languages/python-logo/python-logo.stories.d.ts +0 -8
  261. package/lib/icons/programming-languages/redis-logo/redis-logo.stories.d.ts +0 -8
  262. package/lib/icons/programming-languages/ruby-logo/ruby-logo.stories.d.ts +0 -8
  263. package/lib/icons/programming-languages/rust-logo/rust-logo.stories.d.ts +0 -8
  264. package/lib/icons/programming-languages/swift-logo/swift-logo.stories.d.ts +0 -8
  265. package/lib/icons/social/slack-logo/slack-logo.stories.d.ts +0 -8
  266. package/lib/icons/status/check-circled-icon/check-circled-icon.stories.d.ts +0 -8
  267. package/lib/icons/status/check-icon/check-icon.stories.d.ts +0 -8
  268. package/lib/icons/status/cross-circled-icon/cross-circled-icon.stories.d.ts +0 -8
  269. package/lib/icons/status/cross-icon/cross-icon.stories.d.ts +0 -8
  270. package/lib/icons/status/error-round-icon/error-round-icon.stories.d.ts +0 -8
  271. package/lib/icons/status/error-triangle-icon/error-triangle-icon.stories.d.ts +0 -8
  272. package/lib/icons/status/info-icon/info-icon.stories.d.ts +0 -8
  273. package/lib/icons/status/warning-triangle-icon/warning-triangle-icon.stories.d.ts +0 -8
  274. package/lib/index-BjJpYtF1.js +0 -42
  275. package/lib/index-DYEcdkUF.js +0 -671
  276. package/lib/useSourceSelectionFormData-BnlRp8m3.js +0 -561
  277. /package/lib/containers/source-selection-form/{fast/controls → controls}/index.d.ts +0 -0
  278. /package/lib/icons/{programming-languages → destinations}/kafka-logo/index.d.ts +0 -0
@@ -1,671 +0,0 @@
1
- import { EntityTypes } from './types.js';
2
- import React from 'react';
3
- import { keyframes } from 'styled-components';
4
-
5
- const createStoreImpl = (createState) => {
6
- let state;
7
- const listeners = /* @__PURE__ */ new Set();
8
- const setState = (partial, replace) => {
9
- const nextState = typeof partial === "function" ? partial(state) : partial;
10
- if (!Object.is(nextState, state)) {
11
- const previousState = state;
12
- state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
13
- listeners.forEach((listener) => listener(state, previousState));
14
- }
15
- };
16
- const getState = () => state;
17
- const getInitialState = () => initialState;
18
- const subscribe = (listener) => {
19
- listeners.add(listener);
20
- return () => listeners.delete(listener);
21
- };
22
- const api = { setState, getState, getInitialState, subscribe };
23
- const initialState = state = createState(setState, getState, api);
24
- return api;
25
- };
26
- const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
27
-
28
- const identity = (arg) => arg;
29
- function useStore(api, selector = identity) {
30
- const slice = React.useSyncExternalStore(
31
- api.subscribe,
32
- () => selector(api.getState()),
33
- () => selector(api.getInitialState())
34
- );
35
- React.useDebugValue(slice);
36
- return slice;
37
- }
38
- const createImpl = (createState) => {
39
- const api = createStore(createState);
40
- const useBoundStore = (selector) => useStore(api, selector);
41
- Object.assign(useBoundStore, api);
42
- return useBoundStore;
43
- };
44
- const create = (createState) => createState ? createImpl(createState) : createImpl;
45
-
46
- function createJSONStorage(getStorage, options) {
47
- let storage;
48
- try {
49
- storage = getStorage();
50
- } catch (e) {
51
- return;
52
- }
53
- const persistStorage = {
54
- getItem: (name) => {
55
- var _a;
56
- const parse = (str2) => {
57
- if (str2 === null) {
58
- return null;
59
- }
60
- return JSON.parse(str2, undefined );
61
- };
62
- const str = (_a = storage.getItem(name)) != null ? _a : null;
63
- if (str instanceof Promise) {
64
- return str.then(parse);
65
- }
66
- return parse(str);
67
- },
68
- setItem: (name, newValue) => storage.setItem(
69
- name,
70
- JSON.stringify(newValue, undefined )
71
- ),
72
- removeItem: (name) => storage.removeItem(name)
73
- };
74
- return persistStorage;
75
- }
76
- const toThenable = (fn) => (input) => {
77
- try {
78
- const result = fn(input);
79
- if (result instanceof Promise) {
80
- return result;
81
- }
82
- return {
83
- then(onFulfilled) {
84
- return toThenable(onFulfilled)(result);
85
- },
86
- catch(_onRejected) {
87
- return this;
88
- }
89
- };
90
- } catch (e) {
91
- return {
92
- then(_onFulfilled) {
93
- return this;
94
- },
95
- catch(onRejected) {
96
- return toThenable(onRejected)(e);
97
- }
98
- };
99
- }
100
- };
101
- const persistImpl = (config, baseOptions) => (set, get, api) => {
102
- let options = {
103
- storage: createJSONStorage(() => localStorage),
104
- partialize: (state) => state,
105
- version: 0,
106
- merge: (persistedState, currentState) => ({
107
- ...currentState,
108
- ...persistedState
109
- }),
110
- ...baseOptions
111
- };
112
- let hasHydrated = false;
113
- const hydrationListeners = /* @__PURE__ */ new Set();
114
- const finishHydrationListeners = /* @__PURE__ */ new Set();
115
- let storage = options.storage;
116
- if (!storage) {
117
- return config(
118
- (...args) => {
119
- console.warn(
120
- `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`
121
- );
122
- set(...args);
123
- },
124
- get,
125
- api
126
- );
127
- }
128
- const setItem = () => {
129
- const state = options.partialize({ ...get() });
130
- return storage.setItem(options.name, {
131
- state,
132
- version: options.version
133
- });
134
- };
135
- const savedSetState = api.setState;
136
- api.setState = (state, replace) => {
137
- savedSetState(state, replace);
138
- void setItem();
139
- };
140
- const configResult = config(
141
- (...args) => {
142
- set(...args);
143
- void setItem();
144
- },
145
- get,
146
- api
147
- );
148
- api.getInitialState = () => configResult;
149
- let stateFromStorage;
150
- const hydrate = () => {
151
- var _a, _b;
152
- if (!storage) return;
153
- hasHydrated = false;
154
- hydrationListeners.forEach((cb) => {
155
- var _a2;
156
- return cb((_a2 = get()) != null ? _a2 : configResult);
157
- });
158
- const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? undefined : _b.call(options, (_a = get()) != null ? _a : configResult)) || undefined;
159
- return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
160
- if (deserializedStorageValue) {
161
- if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
162
- if (options.migrate) {
163
- const migration = options.migrate(
164
- deserializedStorageValue.state,
165
- deserializedStorageValue.version
166
- );
167
- if (migration instanceof Promise) {
168
- return migration.then((result) => [true, result]);
169
- }
170
- return [true, migration];
171
- }
172
- console.error(
173
- `State loaded from storage couldn't be migrated since no migrate function was provided`
174
- );
175
- } else {
176
- return [false, deserializedStorageValue.state];
177
- }
178
- }
179
- return [false, undefined];
180
- }).then((migrationResult) => {
181
- var _a2;
182
- const [migrated, migratedState] = migrationResult;
183
- stateFromStorage = options.merge(
184
- migratedState,
185
- (_a2 = get()) != null ? _a2 : configResult
186
- );
187
- set(stateFromStorage, true);
188
- if (migrated) {
189
- return setItem();
190
- }
191
- }).then(() => {
192
- postRehydrationCallback == null ? undefined : postRehydrationCallback(stateFromStorage, undefined);
193
- stateFromStorage = get();
194
- hasHydrated = true;
195
- finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
196
- }).catch((e) => {
197
- postRehydrationCallback == null ? undefined : postRehydrationCallback(undefined, e);
198
- });
199
- };
200
- api.persist = {
201
- setOptions: (newOptions) => {
202
- options = {
203
- ...options,
204
- ...newOptions
205
- };
206
- if (newOptions.storage) {
207
- storage = newOptions.storage;
208
- }
209
- },
210
- clearStorage: () => {
211
- storage == null ? undefined : storage.removeItem(options.name);
212
- },
213
- getOptions: () => options,
214
- rehydrate: () => hydrate(),
215
- hasHydrated: () => hasHydrated,
216
- onHydrate: (cb) => {
217
- hydrationListeners.add(cb);
218
- return () => {
219
- hydrationListeners.delete(cb);
220
- };
221
- },
222
- onFinishHydration: (cb) => {
223
- finishHydrationListeners.add(cb);
224
- return () => {
225
- finishHydrationListeners.delete(cb);
226
- };
227
- }
228
- };
229
- if (!options.skipHydration) {
230
- hydrate();
231
- }
232
- return stateFromStorage || configResult;
233
- };
234
- const persist = persistImpl;
235
-
236
- const useDarkMode = create()(persist((set) => ({
237
- darkMode: true,
238
- setDarkMode: (bool) => set({ darkMode: bool }),
239
- }), {
240
- name: 'odigos-dark-mode',
241
- storage: typeof window !== 'undefined' ? createJSONStorage(() => localStorage) : undefined,
242
- }));
243
-
244
- const useDrawerStore = create((set) => ({
245
- drawerType: null,
246
- drawerEntityId: null,
247
- setDrawerType: (value) => set({ drawerType: value }),
248
- setDrawerEntityId: (value) => set({ drawerEntityId: value }),
249
- }));
250
-
251
- const getEntityId = (item) => {
252
- if ('ruleId' in item && !!item.ruleId) {
253
- // Instrumentation Rule
254
- return item.ruleId;
255
- }
256
- else if ('id' in item && !!item.id) {
257
- // Destination or Action
258
- return item.id;
259
- }
260
- else if ('namespace' in item && !!item.namespace && 'kind' in item && !!item.kind && 'name' in item && !!item.name) {
261
- // Source
262
- return {
263
- namespace: item.namespace,
264
- name: item.name,
265
- kind: item.kind,
266
- };
267
- }
268
- console.warn('getEntityId() - cannot get ID of entity:', item);
269
- return undefined;
270
- };
271
-
272
- const isTimeElapsed = (originDate, difference = 0) => {
273
- const now = new Date().getTime();
274
- const compareWith = new Date(originDate).getTime();
275
- return now - compareWith >= difference;
276
- };
277
-
278
- const useEntityStore = create((set) => ({
279
- sourcesLoading: false,
280
- sources: [],
281
- destinationsLoading: false,
282
- destinations: [],
283
- actionsLoading: false,
284
- actions: [],
285
- instrumentationRulesLoading: false,
286
- instrumentationRules: [],
287
- setEntitiesLoading: (entityType, bool) => {
288
- const KEY = entityType === EntityTypes.Source
289
- ? 'sourcesLoading'
290
- : entityType === EntityTypes.Destination
291
- ? 'destinationsLoading'
292
- : entityType === EntityTypes.Action
293
- ? 'actionsLoading'
294
- : entityType === EntityTypes.InstrumentationRule
295
- ? 'instrumentationRulesLoading'
296
- : 'NONE';
297
- if (KEY === 'NONE')
298
- return;
299
- set({ [KEY]: bool });
300
- },
301
- setEntities: (entityType, payload) => {
302
- const KEY = entityType === EntityTypes.Source
303
- ? 'sources'
304
- : entityType === EntityTypes.Destination
305
- ? 'destinations'
306
- : entityType === EntityTypes.Action
307
- ? 'actions'
308
- : entityType === EntityTypes.InstrumentationRule
309
- ? 'instrumentationRules'
310
- : 'NONE';
311
- if (KEY === 'NONE')
312
- return;
313
- set({ [KEY]: payload });
314
- },
315
- addEntities: (entityType, entities) => {
316
- const KEY = entityType === EntityTypes.Source
317
- ? 'sources'
318
- : entityType === EntityTypes.Destination
319
- ? 'destinations'
320
- : entityType === EntityTypes.Action
321
- ? 'actions'
322
- : entityType === EntityTypes.InstrumentationRule
323
- ? 'instrumentationRules'
324
- : 'NONE';
325
- if (KEY === 'NONE')
326
- return;
327
- set((state) => {
328
- const prev = [...state[KEY]];
329
- entities.forEach((newItem) => {
330
- const foundIdx = prev.findIndex((oldItem) => JSON.stringify(getEntityId(oldItem)) === JSON.stringify(getEntityId(newItem)));
331
- if (foundIdx !== -1) {
332
- prev[foundIdx] = { ...prev[foundIdx], ...newItem };
333
- }
334
- else {
335
- prev.push(newItem);
336
- }
337
- });
338
- return { [KEY]: prev };
339
- });
340
- },
341
- removeEntities: (entityType, entityIds) => {
342
- const KEY = entityType === EntityTypes.Source
343
- ? 'sources'
344
- : entityType === EntityTypes.Destination
345
- ? 'destinations'
346
- : entityType === EntityTypes.Action
347
- ? 'actions'
348
- : entityType === EntityTypes.InstrumentationRule
349
- ? 'instrumentationRules'
350
- : 'NONE';
351
- if (KEY === 'NONE')
352
- return;
353
- set((state) => {
354
- const prev = [...state[KEY]];
355
- entityIds.forEach((id) => {
356
- const foundIdx = prev.findIndex((entity) => entityType === EntityTypes.Source ? JSON.stringify(getEntityId(entity)) === JSON.stringify(getEntityId(id)) : getEntityId(entity) === id);
357
- if (foundIdx !== -1) {
358
- prev.splice(foundIdx, 1);
359
- }
360
- });
361
- return { [KEY]: prev };
362
- });
363
- },
364
- resetEntityStore: () => {
365
- set({
366
- sourcesLoading: false,
367
- sources: [],
368
- destinationsLoading: false,
369
- destinations: [],
370
- actionsLoading: false,
371
- actions: [],
372
- instrumentationRulesLoading: false,
373
- instrumentationRules: [],
374
- });
375
- },
376
- }));
377
-
378
- const getEmptyState = () => ({
379
- searchText: '',
380
- statuses: [],
381
- platformTypes: [],
382
- namespaces: [],
383
- kinds: [],
384
- monitors: [],
385
- languages: [],
386
- errors: [],
387
- onlyErrors: false,
388
- });
389
- const useFilterStore = create((set) => ({
390
- searchText: '',
391
- setSearchText: (searchText) => set({ searchText }),
392
- statuses: [],
393
- setStatuses: (statuses) => set({ statuses }),
394
- platformTypes: [],
395
- setPlatformTypes: (platformTypes) => set({ platformTypes }),
396
- namespaces: [],
397
- setNamespaces: (namespaces) => set({ namespaces }),
398
- kinds: [],
399
- setKinds: (kinds) => set({ kinds }),
400
- monitors: [],
401
- setMonitors: (monitors) => set({ monitors }),
402
- languages: [],
403
- setLanguages: (languages) => set({ languages }),
404
- errors: [],
405
- setErrors: (errors) => set({ errors }),
406
- onlyErrors: false,
407
- setOnlyErrors: (onlyErrors) => set({ onlyErrors }),
408
- setAll: (params) => set(params),
409
- clearAll: () => set(getEmptyState()),
410
- getEmptyState,
411
- }));
412
-
413
- const useInstrumentStore = create((set) => ({
414
- isAwaitingInstrumentation: false,
415
- sourcesToCreate: 0,
416
- sourcesCreated: 0,
417
- sourcesToDelete: 0,
418
- sourcesDeleted: 0,
419
- setInstrumentAwait: (v) => set({ isAwaitingInstrumentation: v }),
420
- setInstrumentCount: (k, v) => set({ [k]: v }),
421
- }));
422
-
423
- const useModalStore = create((set) => ({
424
- currentModal: '',
425
- setCurrentModal: (str) => set({ currentModal: str }),
426
- }));
427
-
428
- const useNotificationStore = create((set, get) => ({
429
- notifications: [],
430
- addNotification: (notif) => {
431
- const date = new Date();
432
- const id = `${date.getTime().toString()}${!!notif.target ? `#${notif.target}` : ''}`;
433
- // This is to prevent duplicate notifications within a 10 second time-frame.
434
- // This is useful for notifications that are triggered multiple times in a short period, like failed API queries...
435
- const foundThisNotif = !!get().notifications.find((n) => n.type === notif.type && n.title === notif.title && n.message === notif.message && !isTimeElapsed(n.time, 3000)); // 3 seconds
436
- if (!foundThisNotif) {
437
- set((state) => ({
438
- notifications: [
439
- {
440
- ...notif,
441
- id,
442
- time: date.toISOString(),
443
- dismissed: false,
444
- seen: false,
445
- },
446
- ...state.notifications,
447
- ],
448
- }));
449
- }
450
- },
451
- markAsDismissed: (id) => {
452
- set((state) => {
453
- const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
454
- if (foundIdx !== -1) {
455
- state.notifications[foundIdx].dismissed = true;
456
- }
457
- return {
458
- notifications: state.notifications,
459
- };
460
- });
461
- },
462
- markAsSeen: (id) => {
463
- set((state) => {
464
- const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
465
- if (foundIdx !== -1) {
466
- state.notifications[foundIdx].seen = true;
467
- }
468
- return {
469
- notifications: state.notifications,
470
- };
471
- });
472
- },
473
- removeNotification: (id) => {
474
- set((state) => {
475
- const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
476
- if (foundIdx !== -1) {
477
- state.notifications.splice(foundIdx, 1);
478
- }
479
- return {
480
- notifications: state.notifications,
481
- };
482
- });
483
- },
484
- removeNotifications: (target) => {
485
- if (!target)
486
- return;
487
- set((state) => {
488
- const filtered = state.notifications.filter((notif) => notif.id.split('#')[1] !== target);
489
- return {
490
- notifications: filtered,
491
- };
492
- });
493
- },
494
- }));
495
-
496
- const itemsAreEqual = (item1, item2) => {
497
- const entityTypesEqual = item1.entityType === item2.entityType;
498
- const idsEqual = typeof item1.entityId === 'string' && typeof item2.entityId === 'string'
499
- ? item1.entityId === item2.entityId
500
- : typeof item1.entityId === 'object' && typeof item2.entityId === 'object'
501
- ? item1.entityId.namespace === item2.entityId.namespace && item1.entityId.name === item2.entityId.name && item1.entityId.kind === item2.entityId.kind
502
- : !item1.entityId && !item2.entityId;
503
- return entityTypesEqual && idsEqual;
504
- };
505
- const usePendingStore = create((set, get) => ({
506
- pendingItems: [],
507
- setPendingItems: (arr) => set({ pendingItems: arr }),
508
- addPendingItems: (arr) => set((state) => ({
509
- pendingItems: state.pendingItems.concat(arr.filter((addItem) => !state.pendingItems.some((existingItem) => itemsAreEqual(existingItem, addItem)))),
510
- })),
511
- removePendingItems: (arr) => set((state) => ({
512
- pendingItems: state.pendingItems.filter((existingItem) => !arr.find((removeItem) => itemsAreEqual(existingItem, removeItem))),
513
- })),
514
- // Pass an item to check if it's in the pending items array.
515
- // This is used to show loading spinners, toasts etc.
516
- isThisPending: (item) => {
517
- const { pendingItems } = get();
518
- let bool = false;
519
- for (let i = 0; i < pendingItems.length; i++) {
520
- const pendingItem = pendingItems[i];
521
- if (pendingItem.entityType === item.entityType &&
522
- (!item.entityId ||
523
- (pendingItem.entityType === EntityTypes.Source
524
- ? !!pendingItem.entityId &&
525
- !!item.entityId &&
526
- pendingItem.entityId.namespace === item.entityId.namespace &&
527
- pendingItem.entityId.name === item.entityId.name &&
528
- pendingItem.entityId.kind === item.entityId.kind
529
- : pendingItem.entityId === item.entityId))) {
530
- bool = true;
531
- break;
532
- }
533
- }
534
- return bool;
535
- },
536
- }));
537
-
538
- const useSelectedStore = create((set) => ({
539
- selectedSources: {},
540
- setSelectedSources: (payload) => set({ selectedSources: payload }),
541
- resetSelectedState: () => set(() => ({ selectedSources: {} })),
542
- }));
543
-
544
- const useSetupStore = create((set) => ({
545
- availableSources: {},
546
- configuredSources: {},
547
- configuredFutureApps: {},
548
- configuredDestinations: [],
549
- setAvailableSources: (payload) => set({ availableSources: payload }),
550
- setConfiguredSources: (payload) => set({ configuredSources: payload }),
551
- setConfiguredFutureApps: (payload) => set({ configuredFutureApps: payload }),
552
- setConfiguredDestinations: (payload) => set({ configuredDestinations: payload }),
553
- addConfiguredDestination: (payload) => set((state) => ({ configuredDestinations: [...state.configuredDestinations, payload] })),
554
- removeConfiguredDestination: (payload) => set((state) => ({ configuredDestinations: state.configuredDestinations.filter(({ stored }) => stored.type !== payload.type) })),
555
- resetState: () => set(() => ({ availableSources: {}, configuredSources: {}, configuredFutureApps: {}, configuredDestinations: [] })),
556
- }));
557
-
558
- function styleInject(css, ref) {
559
- if ( ref === void 0 ) ref = {};
560
- var insertAt = ref.insertAt;
561
-
562
- if (!css || typeof document === 'undefined') { return; }
563
-
564
- var head = document.head || document.getElementsByTagName('head')[0];
565
- var style = document.createElement('style');
566
- style.type = 'text/css';
567
-
568
- if (insertAt === 'top') {
569
- if (head.firstChild) {
570
- head.insertBefore(style, head.firstChild);
571
- } else {
572
- head.appendChild(style);
573
- }
574
- } else {
575
- head.appendChild(style);
576
- }
577
-
578
- if (style.styleSheet) {
579
- style.styleSheet.cssText = css;
580
- } else {
581
- style.appendChild(document.createTextNode(css));
582
- }
583
- }
584
-
585
- var css_248z = "/* Preload key fonts in your global CSS */\n@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Kode+Mono:wght@100;200;300;400;500;600;700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');\n\n* {\n scrollbar-color: black transparent;\n scrollbar-width: thin;\n}\n\nsvg {\n transition: all 0.3s;\n}\n\n/*\n The input styles below are to override the browser \":-webkit-autofill\" default style declarations.\n The issue is when someone autocompletes an input field, the browser will apply its own styles (and the browser applies \"!important\" preventing direct overrides).\n With the following, we're able to delay the browser styles to be applied for 50000s (13.8 hours), so the user will not see the browser styles applied.\n*/\n\ninput {\n all: unset;\n}\n\ninput:-webkit-autofill,\ninput:-webkit-autofill:hover,\ninput:-webkit-autofill:focus,\ninput:-webkit-autofill:active {\n -webkit-transition: all 50000s ease-in-out 0s;\n transition: all 50000s ease-in-out 0s;\n}\n";
586
- styleInject(css_248z);
587
-
588
- const slide = {
589
- in: {
590
- left: keyframes `
591
- from { transform: translateX(-100%); }
592
- to { transform: translateX(0); }
593
- `,
594
- right: keyframes `
595
- from { transform: translateX(100%); }
596
- to { transform: translateX(0); }
597
- `,
598
- top: keyframes `
599
- from { transform: translateY(-100%); }
600
- to { transform: translateY(0); }
601
- `,
602
- bottom: keyframes `
603
- from { transform: translateY(100%); }
604
- to { transform: translateY(0); }
605
- `,
606
- center: keyframes `
607
- from { transform: translate(-50%, 100%); }
608
- to { transform: translate(-50%, -50%); }
609
- `,
610
- },
611
- out: {
612
- left: keyframes `
613
- from { transform: translateX(0); }
614
- to { transform: translateX(-100%); }
615
- `,
616
- right: keyframes `
617
- from { transform: translateX(0); }
618
- to { transform: translateX(100%); }
619
- `,
620
- top: keyframes `
621
- from { transform: translateY(0); }
622
- to { transform: translateY(-100%); }
623
- `,
624
- bottom: keyframes `
625
- from { transform: translateY(0); }
626
- to { transform: translateY(100%); }
627
- `,
628
- center: keyframes `
629
- from { transform: translate(-50%, -50%); }
630
- to { transform: translate(-50%, 100%); }
631
- `,
632
- },
633
- };
634
- const progress = {
635
- in: keyframes `
636
- from { width: 0%; }
637
- to { width: 100%; }
638
- `,
639
- out: keyframes `
640
- from { width: 100%; }
641
- to { width: 0%; }
642
- `,
643
- };
644
- const ping = keyframes `
645
- 0% {
646
- transform: scale(1);
647
- opacity: 1;
648
- }
649
- 75%, 100% {
650
- transform: scale(2);
651
- opacity: 0;
652
- }
653
- `;
654
- const shimmer = keyframes `
655
- 0% {
656
- background-position: -500px 0;
657
- }
658
- 100% {
659
- background-position: 500px 0;
660
- }
661
- `;
662
-
663
- var animations = /*#__PURE__*/Object.freeze({
664
- __proto__: null,
665
- ping: ping,
666
- progress: progress,
667
- shimmer: shimmer,
668
- slide: slide
669
- });
670
-
671
- export { useDrawerStore as a, useEntityStore as b, useFilterStore as c, useInstrumentStore as d, useModalStore as e, useNotificationStore as f, usePendingStore as g, useSelectedStore as h, useSetupStore as i, animations as j, getEntityId as k, isTimeElapsed as l, styleInject as s, useDarkMode as u };