@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
@@ -0,0 +1,201 @@
1
+ import { c as create } from './react-CjImwkhV.js';
2
+
3
+ function createJSONStorage(getStorage, options) {
4
+ let storage;
5
+ try {
6
+ storage = getStorage();
7
+ } catch (e) {
8
+ return;
9
+ }
10
+ const persistStorage = {
11
+ getItem: (name) => {
12
+ var _a;
13
+ const parse = (str2) => {
14
+ if (str2 === null) {
15
+ return null;
16
+ }
17
+ return JSON.parse(str2, undefined );
18
+ };
19
+ const str = (_a = storage.getItem(name)) != null ? _a : null;
20
+ if (str instanceof Promise) {
21
+ return str.then(parse);
22
+ }
23
+ return parse(str);
24
+ },
25
+ setItem: (name, newValue) => storage.setItem(
26
+ name,
27
+ JSON.stringify(newValue, undefined )
28
+ ),
29
+ removeItem: (name) => storage.removeItem(name)
30
+ };
31
+ return persistStorage;
32
+ }
33
+ const toThenable = (fn) => (input) => {
34
+ try {
35
+ const result = fn(input);
36
+ if (result instanceof Promise) {
37
+ return result;
38
+ }
39
+ return {
40
+ then(onFulfilled) {
41
+ return toThenable(onFulfilled)(result);
42
+ },
43
+ catch(_onRejected) {
44
+ return this;
45
+ }
46
+ };
47
+ } catch (e) {
48
+ return {
49
+ then(_onFulfilled) {
50
+ return this;
51
+ },
52
+ catch(onRejected) {
53
+ return toThenable(onRejected)(e);
54
+ }
55
+ };
56
+ }
57
+ };
58
+ const persistImpl = (config, baseOptions) => (set, get, api) => {
59
+ let options = {
60
+ storage: createJSONStorage(() => localStorage),
61
+ partialize: (state) => state,
62
+ version: 0,
63
+ merge: (persistedState, currentState) => ({
64
+ ...currentState,
65
+ ...persistedState
66
+ }),
67
+ ...baseOptions
68
+ };
69
+ let hasHydrated = false;
70
+ const hydrationListeners = /* @__PURE__ */ new Set();
71
+ const finishHydrationListeners = /* @__PURE__ */ new Set();
72
+ let storage = options.storage;
73
+ if (!storage) {
74
+ return config(
75
+ (...args) => {
76
+ console.warn(
77
+ `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`
78
+ );
79
+ set(...args);
80
+ },
81
+ get,
82
+ api
83
+ );
84
+ }
85
+ const setItem = () => {
86
+ const state = options.partialize({ ...get() });
87
+ return storage.setItem(options.name, {
88
+ state,
89
+ version: options.version
90
+ });
91
+ };
92
+ const savedSetState = api.setState;
93
+ api.setState = (state, replace) => {
94
+ savedSetState(state, replace);
95
+ void setItem();
96
+ };
97
+ const configResult = config(
98
+ (...args) => {
99
+ set(...args);
100
+ void setItem();
101
+ },
102
+ get,
103
+ api
104
+ );
105
+ api.getInitialState = () => configResult;
106
+ let stateFromStorage;
107
+ const hydrate = () => {
108
+ var _a, _b;
109
+ if (!storage) return;
110
+ hasHydrated = false;
111
+ hydrationListeners.forEach((cb) => {
112
+ var _a2;
113
+ return cb((_a2 = get()) != null ? _a2 : configResult);
114
+ });
115
+ const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? undefined : _b.call(options, (_a = get()) != null ? _a : configResult)) || undefined;
116
+ return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
117
+ if (deserializedStorageValue) {
118
+ if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
119
+ if (options.migrate) {
120
+ const migration = options.migrate(
121
+ deserializedStorageValue.state,
122
+ deserializedStorageValue.version
123
+ );
124
+ if (migration instanceof Promise) {
125
+ return migration.then((result) => [true, result]);
126
+ }
127
+ return [true, migration];
128
+ }
129
+ console.error(
130
+ `State loaded from storage couldn't be migrated since no migrate function was provided`
131
+ );
132
+ } else {
133
+ return [false, deserializedStorageValue.state];
134
+ }
135
+ }
136
+ return [false, undefined];
137
+ }).then((migrationResult) => {
138
+ var _a2;
139
+ const [migrated, migratedState] = migrationResult;
140
+ stateFromStorage = options.merge(
141
+ migratedState,
142
+ (_a2 = get()) != null ? _a2 : configResult
143
+ );
144
+ set(stateFromStorage, true);
145
+ if (migrated) {
146
+ return setItem();
147
+ }
148
+ }).then(() => {
149
+ postRehydrationCallback == null ? undefined : postRehydrationCallback(stateFromStorage, undefined);
150
+ stateFromStorage = get();
151
+ hasHydrated = true;
152
+ finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
153
+ }).catch((e) => {
154
+ postRehydrationCallback == null ? undefined : postRehydrationCallback(undefined, e);
155
+ });
156
+ };
157
+ api.persist = {
158
+ setOptions: (newOptions) => {
159
+ options = {
160
+ ...options,
161
+ ...newOptions
162
+ };
163
+ if (newOptions.storage) {
164
+ storage = newOptions.storage;
165
+ }
166
+ },
167
+ clearStorage: () => {
168
+ storage == null ? undefined : storage.removeItem(options.name);
169
+ },
170
+ getOptions: () => options,
171
+ rehydrate: () => hydrate(),
172
+ hasHydrated: () => hasHydrated,
173
+ onHydrate: (cb) => {
174
+ hydrationListeners.add(cb);
175
+ return () => {
176
+ hydrationListeners.delete(cb);
177
+ };
178
+ },
179
+ onFinishHydration: (cb) => {
180
+ finishHydrationListeners.add(cb);
181
+ return () => {
182
+ finishHydrationListeners.delete(cb);
183
+ };
184
+ }
185
+ };
186
+ if (!options.skipHydration) {
187
+ hydrate();
188
+ }
189
+ return stateFromStorage || configResult;
190
+ };
191
+ const persist = persistImpl;
192
+
193
+ const useDarkMode = create()(persist((set) => ({
194
+ darkMode: true,
195
+ setDarkMode: (bool) => set({ darkMode: bool }),
196
+ }), {
197
+ name: 'odigos-dark-mode',
198
+ storage: typeof window !== 'undefined' ? createJSONStorage(() => localStorage) : undefined,
199
+ }));
200
+
201
+ export { useDarkMode as u };
@@ -0,0 +1,97 @@
1
+ import { c as create } from './react-CjImwkhV.js';
2
+ import { E as EntityTypes } from './index-BVVVevuY.js';
3
+
4
+ const getEmptyState = () => ({
5
+ searchText: '',
6
+ statuses: [],
7
+ platformTypes: [],
8
+ namespaces: [],
9
+ kinds: [],
10
+ monitors: [],
11
+ languages: [],
12
+ errors: [],
13
+ onlyErrors: false,
14
+ });
15
+ const useFilterStore = create((set) => ({
16
+ searchText: '',
17
+ setSearchText: (searchText) => set({ searchText }),
18
+ statuses: [],
19
+ setStatuses: (statuses) => set({ statuses }),
20
+ platformTypes: [],
21
+ setPlatformTypes: (platformTypes) => set({ platformTypes }),
22
+ namespaces: [],
23
+ setNamespaces: (namespaces) => set({ namespaces }),
24
+ kinds: [],
25
+ setKinds: (kinds) => set({ kinds }),
26
+ monitors: [],
27
+ setMonitors: (monitors) => set({ monitors }),
28
+ languages: [],
29
+ setLanguages: (languages) => set({ languages }),
30
+ errors: [],
31
+ setErrors: (errors) => set({ errors }),
32
+ onlyErrors: false,
33
+ setOnlyErrors: (onlyErrors) => set({ onlyErrors }),
34
+ setAll: (params) => set(params),
35
+ clearAll: () => set(getEmptyState()),
36
+ getEmptyState,
37
+ }));
38
+
39
+ const useInstrumentStore = create((set) => ({
40
+ isAwaitingInstrumentation: false,
41
+ sourcesToCreate: 0,
42
+ sourcesCreated: 0,
43
+ sourcesToDelete: 0,
44
+ sourcesDeleted: 0,
45
+ setInstrumentAwait: (v) => set({ isAwaitingInstrumentation: v }),
46
+ setInstrumentCount: (k, v) => set({ [k]: v }),
47
+ }));
48
+
49
+ const itemsAreEqual = (item1, item2) => {
50
+ const entityTypesEqual = item1.entityType === item2.entityType;
51
+ const idsEqual = typeof item1.entityId === 'string' && typeof item2.entityId === 'string'
52
+ ? item1.entityId === item2.entityId
53
+ : typeof item1.entityId === 'object' && typeof item2.entityId === 'object'
54
+ ? item1.entityId.namespace === item2.entityId.namespace && item1.entityId.name === item2.entityId.name && item1.entityId.kind === item2.entityId.kind
55
+ : !item1.entityId && !item2.entityId;
56
+ return entityTypesEqual && idsEqual;
57
+ };
58
+ const usePendingStore = create((set, get) => ({
59
+ pendingItems: [],
60
+ setPendingItems: (arr) => set({ pendingItems: arr }),
61
+ addPendingItems: (arr) => set((state) => ({
62
+ pendingItems: state.pendingItems.concat(arr.filter((addItem) => !state.pendingItems.some((existingItem) => itemsAreEqual(existingItem, addItem)))),
63
+ })),
64
+ removePendingItems: (arr) => set((state) => ({
65
+ pendingItems: state.pendingItems.filter((existingItem) => !arr.find((removeItem) => itemsAreEqual(existingItem, removeItem))),
66
+ })),
67
+ // Pass an item to check if it's in the pending items array.
68
+ // This is used to show loading spinners, toasts etc.
69
+ isThisPending: (item) => {
70
+ const { pendingItems } = get();
71
+ let bool = false;
72
+ for (let i = 0; i < pendingItems.length; i++) {
73
+ const pendingItem = pendingItems[i];
74
+ if (pendingItem.entityType === item.entityType &&
75
+ (!item.entityId ||
76
+ (pendingItem.entityType === EntityTypes.Source
77
+ ? !!pendingItem.entityId &&
78
+ !!item.entityId &&
79
+ pendingItem.entityId.namespace === item.entityId.namespace &&
80
+ pendingItem.entityId.name === item.entityId.name &&
81
+ pendingItem.entityId.kind === item.entityId.kind
82
+ : pendingItem.entityId === item.entityId))) {
83
+ bool = true;
84
+ break;
85
+ }
86
+ }
87
+ return bool;
88
+ },
89
+ }));
90
+
91
+ const useSelectedStore = create((set) => ({
92
+ selectedSources: {},
93
+ setSelectedSources: (payload) => set({ selectedSources: payload }),
94
+ resetSelectedState: () => set(() => ({ selectedSources: {} })),
95
+ }));
96
+
97
+ export { useInstrumentStore as a, usePendingStore as b, useSelectedStore as c, useFilterStore as u };
@@ -0,0 +1,211 @@
1
+ import { c as create } from './react-CjImwkhV.js';
2
+ import { g as getEntityId, i as isTimeElapsed } from './index-BQs4sULy.js';
3
+ import { E as EntityTypes } from './index-BVVVevuY.js';
4
+
5
+ const useDrawerStore = create((set) => ({
6
+ drawerType: null,
7
+ drawerEntityId: null,
8
+ setDrawerType: (value) => set({ drawerType: value }),
9
+ setDrawerEntityId: (value) => set({ drawerEntityId: value }),
10
+ }));
11
+
12
+ const useEntityStore = create((set) => ({
13
+ namespacesLoading: false,
14
+ namespaces: [],
15
+ sourcesLoading: false,
16
+ sources: [],
17
+ destinationsLoading: false,
18
+ destinations: [],
19
+ actionsLoading: false,
20
+ actions: [],
21
+ instrumentationRulesLoading: false,
22
+ instrumentationRules: [],
23
+ setEntitiesLoading: (entityType, bool) => {
24
+ const KEY = entityType === EntityTypes.Namespace
25
+ ? 'namespacesLoading'
26
+ : entityType === EntityTypes.Source
27
+ ? 'sourcesLoading'
28
+ : entityType === EntityTypes.Destination
29
+ ? 'destinationsLoading'
30
+ : entityType === EntityTypes.Action
31
+ ? 'actionsLoading'
32
+ : entityType === EntityTypes.InstrumentationRule
33
+ ? 'instrumentationRulesLoading'
34
+ : 'NONE';
35
+ if (KEY === 'NONE')
36
+ return;
37
+ set({ [KEY]: bool });
38
+ },
39
+ setEntities: (entityType, payload) => {
40
+ const KEY = entityType === EntityTypes.Namespace
41
+ ? 'namespaces'
42
+ : entityType === EntityTypes.Source
43
+ ? 'sources'
44
+ : entityType === EntityTypes.Destination
45
+ ? 'destinations'
46
+ : entityType === EntityTypes.Action
47
+ ? 'actions'
48
+ : entityType === EntityTypes.InstrumentationRule
49
+ ? 'instrumentationRules'
50
+ : 'NONE';
51
+ if (KEY === 'NONE')
52
+ return;
53
+ set({ [KEY]: payload });
54
+ },
55
+ addEntities: (entityType, entities) => {
56
+ const KEY = entityType === EntityTypes.Namespace
57
+ ? 'namespaces'
58
+ : entityType === EntityTypes.Source
59
+ ? 'sources'
60
+ : entityType === EntityTypes.Destination
61
+ ? 'destinations'
62
+ : entityType === EntityTypes.Action
63
+ ? 'actions'
64
+ : entityType === EntityTypes.InstrumentationRule
65
+ ? 'instrumentationRules'
66
+ : 'NONE';
67
+ if (KEY === 'NONE')
68
+ return;
69
+ set((state) => {
70
+ const prev = [...state[KEY]];
71
+ entities.forEach((newItem) => {
72
+ const foundIdx = prev.findIndex((oldItem) => JSON.stringify(getEntityId(oldItem)) === JSON.stringify(getEntityId(newItem)));
73
+ if (foundIdx !== -1) {
74
+ prev[foundIdx] = { ...prev[foundIdx], ...newItem };
75
+ }
76
+ else {
77
+ prev.push(newItem);
78
+ }
79
+ });
80
+ return { [KEY]: prev };
81
+ });
82
+ },
83
+ removeEntities: (entityType, entityIds) => {
84
+ const KEY = entityType === EntityTypes.Namespace
85
+ ? 'namespaces'
86
+ : entityType === EntityTypes.Source
87
+ ? 'sources'
88
+ : entityType === EntityTypes.Destination
89
+ ? 'destinations'
90
+ : entityType === EntityTypes.Action
91
+ ? 'actions'
92
+ : entityType === EntityTypes.InstrumentationRule
93
+ ? 'instrumentationRules'
94
+ : 'NONE';
95
+ if (KEY === 'NONE')
96
+ return;
97
+ set((state) => {
98
+ const prev = [...state[KEY]];
99
+ entityIds.forEach((id) => {
100
+ const foundIdx = prev.findIndex((entity) => entityType === EntityTypes.Source ? JSON.stringify(getEntityId(entity)) === JSON.stringify(getEntityId(id)) : getEntityId(entity) === id);
101
+ if (foundIdx !== -1) {
102
+ prev.splice(foundIdx, 1);
103
+ }
104
+ });
105
+ return { [KEY]: prev };
106
+ });
107
+ },
108
+ resetEntityStore: () => {
109
+ set({
110
+ namespacesLoading: false,
111
+ namespaces: [],
112
+ sourcesLoading: false,
113
+ sources: [],
114
+ destinationsLoading: false,
115
+ destinations: [],
116
+ actionsLoading: false,
117
+ actions: [],
118
+ instrumentationRulesLoading: false,
119
+ instrumentationRules: [],
120
+ });
121
+ },
122
+ }));
123
+
124
+ const useModalStore = create((set) => ({
125
+ currentModal: '',
126
+ setCurrentModal: (str) => set({ currentModal: str }),
127
+ }));
128
+
129
+ const useNotificationStore = create((set, get) => ({
130
+ notifications: [],
131
+ addNotification: (notif) => {
132
+ const date = new Date();
133
+ const id = `${date.getTime().toString()}${!!notif.target ? `#${notif.target}` : ''}`;
134
+ // This is to prevent duplicate notifications within a 10 second time-frame.
135
+ // This is useful for notifications that are triggered multiple times in a short period, like failed API queries...
136
+ const foundThisNotif = !!get().notifications.find((n) => n.type === notif.type && n.title === notif.title && n.message === notif.message && !isTimeElapsed(n.time, 3000)); // 3 seconds
137
+ if (!foundThisNotif) {
138
+ set((state) => ({
139
+ notifications: [
140
+ {
141
+ ...notif,
142
+ id,
143
+ time: date.toISOString(),
144
+ dismissed: false,
145
+ seen: false,
146
+ },
147
+ ...state.notifications,
148
+ ],
149
+ }));
150
+ }
151
+ },
152
+ markAsDismissed: (id) => {
153
+ set((state) => {
154
+ const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
155
+ if (foundIdx !== -1) {
156
+ state.notifications[foundIdx].dismissed = true;
157
+ }
158
+ return {
159
+ notifications: state.notifications,
160
+ };
161
+ });
162
+ },
163
+ markAsSeen: (id) => {
164
+ set((state) => {
165
+ const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
166
+ if (foundIdx !== -1) {
167
+ state.notifications[foundIdx].seen = true;
168
+ }
169
+ return {
170
+ notifications: state.notifications,
171
+ };
172
+ });
173
+ },
174
+ removeNotification: (id) => {
175
+ set((state) => {
176
+ const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
177
+ if (foundIdx !== -1) {
178
+ state.notifications.splice(foundIdx, 1);
179
+ }
180
+ return {
181
+ notifications: state.notifications,
182
+ };
183
+ });
184
+ },
185
+ removeNotifications: (target) => {
186
+ if (!target)
187
+ return;
188
+ set((state) => {
189
+ const filtered = state.notifications.filter((notif) => notif.id.split('#')[1] !== target);
190
+ return {
191
+ notifications: filtered,
192
+ };
193
+ });
194
+ },
195
+ }));
196
+
197
+ const useSetupStore = create((set) => ({
198
+ availableSources: {},
199
+ configuredSources: {},
200
+ configuredFutureApps: {},
201
+ configuredDestinations: [],
202
+ setAvailableSources: (payload) => set({ availableSources: payload }),
203
+ setConfiguredSources: (payload) => set({ configuredSources: payload }),
204
+ setConfiguredFutureApps: (payload) => set({ configuredFutureApps: payload }),
205
+ setConfiguredDestinations: (payload) => set({ configuredDestinations: payload }),
206
+ addConfiguredDestination: (payload) => set((state) => ({ configuredDestinations: [...state.configuredDestinations, payload] })),
207
+ removeConfiguredDestination: (payload) => set((state) => ({ configuredDestinations: state.configuredDestinations.filter(({ stored }) => stored.type !== payload.type) })),
208
+ resetState: () => set(() => ({ availableSources: {}, configuredSources: {}, configuredFutureApps: {}, configuredDestinations: [] })),
209
+ }));
210
+
211
+ export { useEntityStore as a, useModalStore as b, useNotificationStore as c, useSetupStore as d, useDrawerStore as u };