@odigos/ui-kit 0.0.16 → 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 (259) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/lib/components/data-tab/index.d.ts +0 -1
  3. package/lib/components/drawer/drawer-header/index.d.ts +2 -2
  4. package/lib/components.js +45 -14
  5. package/lib/constants.js +9 -5
  6. package/lib/containers/overview-drawer/index.d.ts +2 -2
  7. package/lib/containers/source-modal/index.d.ts +0 -2
  8. package/lib/containers/source-selection-form/index.d.ts +0 -1
  9. package/lib/containers.js +129 -206
  10. package/lib/functions.js +15 -9
  11. package/lib/hooks.js +10 -10
  12. package/lib/icons.js +15 -7
  13. package/lib/index-B72aw6tI.js +23 -0
  14. package/lib/{index-D_Qn2U89.js → index-BJxaoI0G.js} +1 -8
  15. package/lib/{index-DiEc-llU.js → index-BQW5EUgp.js} +10 -7
  16. package/lib/index-BQs4sULy.js +32 -0
  17. package/lib/index-BVVVevuY.js +100 -0
  18. package/lib/index-BWqrekK4.js +11 -0
  19. package/lib/{index-D6cZdmUs.js → index-BiNX-Cge.js} +85 -130
  20. package/lib/{index-DM8CZWtL.js → index-BsH_egEe.js} +10 -1
  21. package/lib/{index-CKtl8KxE.js → index-BxQTUOME.js} +10 -12
  22. package/lib/index-C1PCuZgw.js +18 -0
  23. package/lib/{index-CLOUNx6Z.js → index-C3nz3TIx.js} +6 -8
  24. package/lib/{index-BGlk5VhF.js → index-CIXQeSHu.js} +1 -10
  25. package/lib/index-CIgHU72d.js +52 -0
  26. package/lib/index-DbfrGXPH.js +8 -0
  27. package/lib/{index-lL1o2K_5.js → index-G4WmxXds.js} +4 -21
  28. package/lib/{index-7-KCQK-x.js → index-Hz7AAE0t.js} +1 -1
  29. package/lib/{index-DH2zLaey.js → index-KOMAv-TS.js} +1 -8
  30. package/lib/index-RBS1MqCQ.js +37 -0
  31. package/lib/react-CjImwkhV.js +44 -0
  32. package/lib/store.js +6 -3
  33. package/lib/theme.js +86 -3
  34. package/lib/types.js +6 -215
  35. package/lib/useDarkMode-DxhIuVNi.js +201 -0
  36. package/lib/useSelectedStore-93bIo1kE.js +97 -0
  37. package/lib/useSetupStore-CoYx1UQw.js +211 -0
  38. package/lib/{useTransition-hWYVBuSi.js → useTimeAgo-weEj7br6.js} +544 -113
  39. package/lib/useTransition-D0wUpPGk.js +128 -0
  40. package/package.json +2 -1
  41. package/lib/components/auto-complete-input/auto-complete-input.stories.d.ts +0 -9
  42. package/lib/components/badge/badge.stories.d.ts +0 -13
  43. package/lib/components/button/button.stories.d.ts +0 -9
  44. package/lib/components/cancel-warning/cancel-warning.stories.d.ts +0 -9
  45. package/lib/components/checkbox/checkbox.stories.d.ts +0 -9
  46. package/lib/components/code/code.stories.d.ts +0 -9
  47. package/lib/components/condition-details/condition-details.stories.d.ts +0 -14
  48. package/lib/components/data-card/data-card.stories.d.ts +0 -10
  49. package/lib/components/data-tab/data-tab.stories.d.ts +0 -15
  50. package/lib/components/delete-warning/delete-warning.stories.d.ts +0 -9
  51. package/lib/components/describe-row/describe-row.stories.d.ts +0 -9
  52. package/lib/components/divider/divider.stories.d.ts +0 -9
  53. package/lib/components/docs-button/docs-button.stories.d.ts +0 -9
  54. package/lib/components/drawer/drawer.stories.d.ts +0 -10
  55. package/lib/components/dropdown/dropdown.stories.d.ts +0 -10
  56. package/lib/components/error-boundary/error-boundary.stories.d.ts +0 -9
  57. package/lib/components/extend-arrow/extend-arrow.stories.d.ts +0 -9
  58. package/lib/components/fade-loader/fade-loader.stories.d.ts +0 -9
  59. package/lib/components/field-error/field-error.stories.d.ts +0 -9
  60. package/lib/components/field-label/field-label.stories.d.ts +0 -9
  61. package/lib/components/header/header.stories.d.ts +0 -9
  62. package/lib/components/icon-button/icon-button.stories.d.ts +0 -9
  63. package/lib/components/icon-group/icon-group.stories.d.ts +0 -14
  64. package/lib/components/icon-title-badge/icon-title-badge.stories.d.ts +0 -9
  65. package/lib/components/icon-wrapped/icon-wrapped.stories.d.ts +0 -10
  66. package/lib/components/icons-nav/icons-nav.stories.d.ts +0 -9
  67. package/lib/components/image-controlled/image-controlled.stories.d.ts +0 -9
  68. package/lib/components/input/input.stories.d.ts +0 -9
  69. package/lib/components/input-list/input-list.stories.d.ts +0 -9
  70. package/lib/components/input-table/input-table.stories.d.ts +0 -9
  71. package/lib/components/interactive-table/interactive-table.stories.d.ts +0 -12
  72. package/lib/components/key-value-input-list/key-value-input-list.stories.d.ts +0 -9
  73. package/lib/components/modal/modal.stories.d.ts +0 -9
  74. package/lib/components/monitors-checkboxes/monitors-checkboxes.stories.d.ts +0 -9
  75. package/lib/components/monitors-icons/monitors-icons.stories.d.ts +0 -9
  76. package/lib/components/navigation-buttons/navigation-buttons.stories.d.ts +0 -9
  77. package/lib/components/no-data-found/no-data-found.stories.d.ts +0 -9
  78. package/lib/components/notification-note/notification-note.stories.d.ts +0 -10
  79. package/lib/components/section-title/section-title.stories.d.ts +0 -9
  80. package/lib/components/segment/segment.stories.d.ts +0 -9
  81. package/lib/components/skeleton-loader/skeleton-loader.stories.d.ts +0 -9
  82. package/lib/components/status/status.stories.d.ts +0 -9
  83. package/lib/components/stepper/stepper.stories.d.ts +0 -9
  84. package/lib/components/text/text.stories.d.ts +0 -9
  85. package/lib/components/textarea/textarea.stories.d.ts +0 -9
  86. package/lib/components/toggle/toggle.stories.d.ts +0 -9
  87. package/lib/components/tooltip/tooltip.stories.d.ts +0 -9
  88. package/lib/components/trace-loader/trace-loader.stories.d.ts +0 -9
  89. package/lib/components/warning-modal/warning-modal.stories.d.ts +0 -9
  90. package/lib/containers/action-drawer/action-drawer.stories.d.ts +0 -9
  91. package/lib/containers/action-form/action-form.stories.d.ts +0 -9
  92. package/lib/containers/action-modal/action-modal.stories.d.ts +0 -9
  93. package/lib/containers/action-table/action-table.stories.d.ts +0 -9
  94. package/lib/containers/await-pipeline/await-pipeline.stories.d.ts +0 -9
  95. package/lib/containers/compute-platform-select/compute-platform-select.stories.d.ts +0 -9
  96. package/lib/containers/compute-platforms/compute-platforms.stories.d.ts +0 -9
  97. package/lib/containers/compute-platforms-actions-menu/compute-platforms-actions-menu.stories.d.ts +0 -9
  98. package/lib/containers/data-flow/data-flow.stories.d.ts +0 -9
  99. package/lib/containers/data-flow-actions-menu/data-flow-actions-menu.stories.d.ts +0 -11
  100. package/lib/containers/destination-drawer/destination-drawer.stories.d.ts +0 -9
  101. package/lib/containers/destination-form/destination-form.stories.d.ts +0 -9
  102. package/lib/containers/destination-modal/destination-modal.stories.d.ts +0 -9
  103. package/lib/containers/destination-selection-form/destination-selection-form.stories.d.ts +0 -9
  104. package/lib/containers/destination-table/destination-table.stories.d.ts +0 -9
  105. package/lib/containers/dropdowns/connection-status-dropdown/connection-status-dropdown.stories.d.ts +0 -9
  106. package/lib/containers/dropdowns/connection-type-dropdown/connection-type-dropdown.stories.d.ts +0 -9
  107. package/lib/containers/dropdowns/error-dropdown/error-dropdown.stories.d.ts +0 -9
  108. package/lib/containers/dropdowns/kind-dropdown/error-dropdown.stories.d.ts +0 -9
  109. package/lib/containers/dropdowns/language-dropdown/language-dropdown.stories.d.ts +0 -9
  110. package/lib/containers/dropdowns/monitor-dropdown/monitor-dropdown.stories.d.ts +0 -9
  111. package/lib/containers/dropdowns/namespace-dropdown/namespace-dropdown.stories.d.ts +0 -9
  112. package/lib/containers/instrumentation-rule-drawer/instrumentation-rule-drawer.stories.d.ts +0 -9
  113. package/lib/containers/instrumentation-rule-form/instrumentation-rule-form.stories.d.ts +0 -9
  114. package/lib/containers/instrumentation-rule-modal/instrumentation-rule-modal.stories.d.ts +0 -9
  115. package/lib/containers/instrumentation-rule-table/instrumentation-rule-table.stories.d.ts +0 -9
  116. package/lib/containers/multi-source-control/multi-source-control.stories.d.ts +0 -9
  117. package/lib/containers/notification-manager/notification-manager.stories.d.ts +0 -9
  118. package/lib/containers/overview-drawer/overview-drawer.stories.d.ts +0 -9
  119. package/lib/containers/side-nav/side-nav.stories.d.ts +0 -9
  120. package/lib/containers/slack-invite/slack-invite.stories.d.ts +0 -9
  121. package/lib/containers/source-drawer/source-drawer.stories.d.ts +0 -9
  122. package/lib/containers/source-form/source-form.stories.d.ts +0 -9
  123. package/lib/containers/source-modal/source-modal.stories.d.ts +0 -9
  124. package/lib/containers/source-selection-form/fast/index.d.ts +0 -7
  125. package/lib/containers/source-selection-form/simple/controls/index.d.ts +0 -9
  126. package/lib/containers/source-selection-form/simple/index.d.ts +0 -7
  127. package/lib/containers/source-selection-form/simple/list/index.d.ts +0 -8
  128. package/lib/containers/source-selection-form/source-selection-form.stories.d.ts +0 -9
  129. package/lib/containers/source-table/source-table.stories.d.ts +0 -9
  130. package/lib/containers/system-overview/system-overview.stories.d.ts +0 -9
  131. package/lib/containers/table-cell-conditions/table-cell-conditions.stories.d.ts +0 -9
  132. package/lib/containers/toast-list/toast-list.stories.d.ts +0 -9
  133. package/lib/containers/toggle-dark-mode/toggle-dark-mode.stories.d.ts +0 -9
  134. package/lib/icons/actions/add-cluster-info-icon/add-cluster-info-icon.stories.d.ts +0 -8
  135. package/lib/icons/actions/delete-attribute-icon/delete-attribute-icon.stories.d.ts +0 -8
  136. package/lib/icons/actions/pii-masking-icon/pii-masking-icon.stories.d.ts +0 -8
  137. package/lib/icons/actions/rename-attribute-icon/rename-attribute-icon.stories.d.ts +0 -8
  138. package/lib/icons/actions/sampler-icon/sampler-icon.stories.d.ts +0 -8
  139. package/lib/icons/brand/odigos-logo/odigos-logo.stories.d.ts +0 -8
  140. package/lib/icons/brand/odigos-logo-text/odigos-logo-text.stories.d.ts +0 -8
  141. package/lib/icons/common/arrow-icon/arrow-icon.stories.d.ts +0 -8
  142. package/lib/icons/common/code-brackets-icon/code-brackets-icon.stories.d.ts +0 -8
  143. package/lib/icons/common/code-icon/code-icon.stories.d.ts +0 -8
  144. package/lib/icons/common/command-icon/command-icon.stories.d.ts +0 -8
  145. package/lib/icons/common/copy-icon/copy-icon.stories.d.ts +0 -8
  146. package/lib/icons/common/edit-icon/edit-icon.stories.d.ts +0 -8
  147. package/lib/icons/common/extend-arrow-icon/extend-arrow-icon.stories.d.ts +0 -8
  148. package/lib/icons/common/filter-icon/filter-icon.stories.d.ts +0 -8
  149. package/lib/icons/common/folder-icon/folder-icon.stories.d.ts +0 -8
  150. package/lib/icons/common/image-error-icon/image-error-icon.stories.d.ts +0 -8
  151. package/lib/icons/common/key-icon/key-icon.stories.d.ts +0 -8
  152. package/lib/icons/common/list-icon/list-icon.stories.d.ts +0 -8
  153. package/lib/icons/common/no-data-icon/no-data-icon.stories.d.ts +0 -8
  154. package/lib/icons/common/notebook-icon/notebook-icon.stories.d.ts +0 -8
  155. package/lib/icons/common/notification-icon/notification-icon.stories.d.ts +0 -8
  156. package/lib/icons/common/search-icon/search-icon.stories.d.ts +0 -8
  157. package/lib/icons/common/sort-arrows-icon/sort-arrows-icon.stories.d.ts +0 -8
  158. package/lib/icons/common/terminal-icon/terminal-icon.stories.d.ts +0 -8
  159. package/lib/icons/common/trash-icon/trash-icon.stories.d.ts +0 -8
  160. package/lib/icons/common/x-icon/x-icon.stories.d.ts +0 -8
  161. package/lib/icons/compute-platform/k8s-logo/k8s-logo.stories.d.ts +0 -8
  162. package/lib/icons/compute-platform/vm-logo/vm-logo.stories.d.ts +0 -8
  163. package/lib/icons/destinations/app-dynamics-logo/app-dynamics-logo.stories.d.ts +0 -8
  164. package/lib/icons/destinations/aws-cloudwatch-logo/aws-cloudwatch-logo.stories.d.ts +0 -8
  165. package/lib/icons/destinations/aws-s3-logo/aws-s3-logo.stories.d.ts +0 -8
  166. package/lib/icons/destinations/aws-xray-logo/aws-xray-logo.stories.d.ts +0 -8
  167. package/lib/icons/destinations/axiom-logo/axiom-logo.stories.d.ts +0 -8
  168. package/lib/icons/destinations/better-stack-logo/better-stack-logo.stories.d.ts +0 -8
  169. package/lib/icons/destinations/blob-storage-logo/blob-storage-logo.stories.d.ts +0 -8
  170. package/lib/icons/destinations/causely-logo/causely-logo.stories.d.ts +0 -8
  171. package/lib/icons/destinations/chronosphere-logo/chronosphere-logo.stories.d.ts +0 -8
  172. package/lib/icons/destinations/clickhouse-logo/clickhouse-logo.stories.d.ts +0 -8
  173. package/lib/icons/destinations/coralogix-logo/coralogix-logo.stories.d.ts +0 -8
  174. package/lib/icons/destinations/dash0-logo/dash0-logo.stories.d.ts +0 -8
  175. package/lib/icons/destinations/datadog-logo/datadog-logo.stories.d.ts +0 -8
  176. package/lib/icons/destinations/dynatrace-logo/dynatrace-logo.stories.d.ts +0 -8
  177. package/lib/icons/destinations/elastic-apm-logo/elastic-apm-logo.stories.d.ts +0 -8
  178. package/lib/icons/destinations/elastic-search-logo/elastic-search-logo.stories.d.ts +0 -8
  179. package/lib/icons/destinations/gigapipe-logo/gigapipe-logo.stories.d.ts +0 -8
  180. package/lib/icons/destinations/google-cloud-platform-logo/google-cloud-platform-logo.stories.d.ts +0 -8
  181. package/lib/icons/destinations/google-cloud-storage-logo/google-cloud-storage-logo.stories.d.ts +0 -8
  182. package/lib/icons/destinations/grafana-logo/grafana-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/open-telemetry-logo/open-telemetry-logo.stories.d.ts +0 -8
  198. package/lib/icons/destinations/ops-verse-logo/ops-verse-logo.stories.d.ts +0 -8
  199. package/lib/icons/destinations/prometheus-logo/prometheus-logo.stories.d.ts +0 -8
  200. package/lib/icons/destinations/qryn-logo/qryn-logo.stories.d.ts +0 -8
  201. package/lib/icons/destinations/quickwit-logo/quickwit-logo.stories.d.ts +0 -8
  202. package/lib/icons/destinations/sentry-logo/sentry-logo.stories.d.ts +0 -8
  203. package/lib/icons/destinations/signoz-logo/signoz-logo.stories.d.ts +0 -8
  204. package/lib/icons/destinations/splunk-logo/splunk-logo.stories.d.ts +0 -8
  205. package/lib/icons/destinations/sumo-logic-logo/sumo-logic-logo.stories.d.ts +0 -8
  206. package/lib/icons/destinations/tempo-logo/tempo-logo.stories.d.ts +0 -8
  207. package/lib/icons/destinations/traceloop-logo/traceloop-logo.stories.d.ts +0 -8
  208. package/lib/icons/destinations/uptrace-logo/uptrace-logo.stories.d.ts +0 -8
  209. package/lib/icons/instrumentation-rules/code-attributes-icon/code-attributes-icon.stories.d.ts +0 -8
  210. package/lib/icons/instrumentation-rules/payload-collection-icon/payload-collection-icon.stories.d.ts +0 -8
  211. package/lib/icons/math/minus-icon/minus-icon.stories.d.ts +0 -8
  212. package/lib/icons/math/plus-icon/plus-icon.stories.d.ts +0 -8
  213. package/lib/icons/monitors/logs-icon/logs-icon.stories.d.ts +0 -8
  214. package/lib/icons/monitors/metrics-icon/metrics-icon.stories.d.ts +0 -8
  215. package/lib/icons/monitors/traces-icon/traces-icon.stories.d.ts +0 -8
  216. package/lib/icons/on-off/eye-closed-icon/eye-closed-icon.stories.d.ts +0 -8
  217. package/lib/icons/on-off/eye-open-icon/eye-open-icon.stories.d.ts +0 -8
  218. package/lib/icons/on-off/light-off-icon/light-off-icon.stories.d.ts +0 -8
  219. package/lib/icons/on-off/light-on-icon/light-on-icon.stories.d.ts +0 -8
  220. package/lib/icons/on-off/moon-icon/moon-icon.stories.d.ts +0 -8
  221. package/lib/icons/on-off/sun-icon/sun-icon.stories.d.ts +0 -8
  222. package/lib/icons/overview/actions-icon/actions-icon.stories.d.ts +0 -8
  223. package/lib/icons/overview/connections-icon/connections-icon.stories.d.ts +0 -8
  224. package/lib/icons/overview/destinations-icon/destinations-icon.stories.d.ts +0 -8
  225. package/lib/icons/overview/namespaces-icon/namespaces-icon.stories.d.ts +0 -8
  226. package/lib/icons/overview/overview-icon/overview-icon.stories.d.ts +0 -8
  227. package/lib/icons/overview/rules-icon/rules-icon.stories.d.ts +0 -8
  228. package/lib/icons/overview/service-map-icon/service-map-icon.stories.d.ts +0 -8
  229. package/lib/icons/overview/sources-icon/sources-icon.stories.d.ts +0 -8
  230. package/lib/icons/overview/trace-view-icon/trace-view-icon.stories.d.ts +0 -8
  231. package/lib/icons/programming-languages/c-plus-plus-logo/c-plus-plus-logo.stories.d.ts +0 -8
  232. package/lib/icons/programming-languages/c-sharp-logo/c-sharp-logo.stories.d.ts +0 -8
  233. package/lib/icons/programming-languages/dotnet-logo/dotnet-logo.stories.d.ts +0 -8
  234. package/lib/icons/programming-languages/elixir-logo/elixir-logo.stories.d.ts +0 -8
  235. package/lib/icons/programming-languages/go-logo/go-logo.stories.d.ts +0 -8
  236. package/lib/icons/programming-languages/java-logo/java-logo.stories.d.ts +0 -8
  237. package/lib/icons/programming-languages/mysql-logo/mysql-logo.stories.d.ts +0 -8
  238. package/lib/icons/programming-languages/nginx-logo/nginx-logo.stories.d.ts +0 -8
  239. package/lib/icons/programming-languages/nodejs-logo/nodejs-logo.stories.d.ts +0 -8
  240. package/lib/icons/programming-languages/php-logo/php-logo.stories.d.ts +0 -8
  241. package/lib/icons/programming-languages/postgres-logo/postgres-logo.stories.d.ts +0 -8
  242. package/lib/icons/programming-languages/python-logo/python-logo.stories.d.ts +0 -8
  243. package/lib/icons/programming-languages/redis-logo/redis-logo.stories.d.ts +0 -8
  244. package/lib/icons/programming-languages/ruby-logo/ruby-logo.stories.d.ts +0 -8
  245. package/lib/icons/programming-languages/rust-logo/rust-logo.stories.d.ts +0 -8
  246. package/lib/icons/programming-languages/swift-logo/swift-logo.stories.d.ts +0 -8
  247. package/lib/icons/social/slack-logo/slack-logo.stories.d.ts +0 -8
  248. package/lib/icons/status/check-circled-icon/check-circled-icon.stories.d.ts +0 -8
  249. package/lib/icons/status/check-icon/check-icon.stories.d.ts +0 -8
  250. package/lib/icons/status/cross-circled-icon/cross-circled-icon.stories.d.ts +0 -8
  251. package/lib/icons/status/cross-icon/cross-icon.stories.d.ts +0 -8
  252. package/lib/icons/status/error-round-icon/error-round-icon.stories.d.ts +0 -8
  253. package/lib/icons/status/error-triangle-icon/error-triangle-icon.stories.d.ts +0 -8
  254. package/lib/icons/status/info-icon/info-icon.stories.d.ts +0 -8
  255. package/lib/icons/status/warning-triangle-icon/warning-triangle-icon.stories.d.ts +0 -8
  256. package/lib/index-IvGLauAo.js +0 -683
  257. package/lib/useSourceSelectionFormData-R_uK7F7W.js +0 -563
  258. /package/lib/containers/source-selection-form/{fast/controls → controls}/index.d.ts +0 -0
  259. /package/lib/containers/source-selection-form/{fast/list → list}/index.d.ts +0 -0
@@ -1,683 +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
- namespacesLoading: false,
280
- namespaces: [],
281
- sourcesLoading: false,
282
- sources: [],
283
- destinationsLoading: false,
284
- destinations: [],
285
- actionsLoading: false,
286
- actions: [],
287
- instrumentationRulesLoading: false,
288
- instrumentationRules: [],
289
- setEntitiesLoading: (entityType, bool) => {
290
- const KEY = entityType === EntityTypes.Namespace
291
- ? 'namespacesLoading'
292
- : entityType === EntityTypes.Source
293
- ? 'sourcesLoading'
294
- : entityType === EntityTypes.Destination
295
- ? 'destinationsLoading'
296
- : entityType === EntityTypes.Action
297
- ? 'actionsLoading'
298
- : entityType === EntityTypes.InstrumentationRule
299
- ? 'instrumentationRulesLoading'
300
- : 'NONE';
301
- if (KEY === 'NONE')
302
- return;
303
- set({ [KEY]: bool });
304
- },
305
- setEntities: (entityType, payload) => {
306
- const KEY = entityType === EntityTypes.Namespace
307
- ? 'namespaces'
308
- : entityType === EntityTypes.Source
309
- ? 'sources'
310
- : entityType === EntityTypes.Destination
311
- ? 'destinations'
312
- : entityType === EntityTypes.Action
313
- ? 'actions'
314
- : entityType === EntityTypes.InstrumentationRule
315
- ? 'instrumentationRules'
316
- : 'NONE';
317
- if (KEY === 'NONE')
318
- return;
319
- set({ [KEY]: payload });
320
- },
321
- addEntities: (entityType, entities) => {
322
- const KEY = entityType === EntityTypes.Namespace
323
- ? 'namespaces'
324
- : entityType === EntityTypes.Source
325
- ? 'sources'
326
- : entityType === EntityTypes.Destination
327
- ? 'destinations'
328
- : entityType === EntityTypes.Action
329
- ? 'actions'
330
- : entityType === EntityTypes.InstrumentationRule
331
- ? 'instrumentationRules'
332
- : 'NONE';
333
- if (KEY === 'NONE')
334
- return;
335
- set((state) => {
336
- const prev = [...state[KEY]];
337
- entities.forEach((newItem) => {
338
- const foundIdx = prev.findIndex((oldItem) => JSON.stringify(getEntityId(oldItem)) === JSON.stringify(getEntityId(newItem)));
339
- if (foundIdx !== -1) {
340
- prev[foundIdx] = { ...prev[foundIdx], ...newItem };
341
- }
342
- else {
343
- prev.push(newItem);
344
- }
345
- });
346
- return { [KEY]: prev };
347
- });
348
- },
349
- removeEntities: (entityType, entityIds) => {
350
- const KEY = entityType === EntityTypes.Namespace
351
- ? 'namespaces'
352
- : entityType === EntityTypes.Source
353
- ? 'sources'
354
- : entityType === EntityTypes.Destination
355
- ? 'destinations'
356
- : entityType === EntityTypes.Action
357
- ? 'actions'
358
- : entityType === EntityTypes.InstrumentationRule
359
- ? 'instrumentationRules'
360
- : 'NONE';
361
- if (KEY === 'NONE')
362
- return;
363
- set((state) => {
364
- const prev = [...state[KEY]];
365
- entityIds.forEach((id) => {
366
- const foundIdx = prev.findIndex((entity) => entityType === EntityTypes.Source ? JSON.stringify(getEntityId(entity)) === JSON.stringify(getEntityId(id)) : getEntityId(entity) === id);
367
- if (foundIdx !== -1) {
368
- prev.splice(foundIdx, 1);
369
- }
370
- });
371
- return { [KEY]: prev };
372
- });
373
- },
374
- resetEntityStore: () => {
375
- set({
376
- namespacesLoading: false,
377
- namespaces: [],
378
- sourcesLoading: false,
379
- sources: [],
380
- destinationsLoading: false,
381
- destinations: [],
382
- actionsLoading: false,
383
- actions: [],
384
- instrumentationRulesLoading: false,
385
- instrumentationRules: [],
386
- });
387
- },
388
- }));
389
-
390
- const getEmptyState = () => ({
391
- searchText: '',
392
- statuses: [],
393
- platformTypes: [],
394
- namespaces: [],
395
- kinds: [],
396
- monitors: [],
397
- languages: [],
398
- errors: [],
399
- onlyErrors: false,
400
- });
401
- const useFilterStore = create((set) => ({
402
- searchText: '',
403
- setSearchText: (searchText) => set({ searchText }),
404
- statuses: [],
405
- setStatuses: (statuses) => set({ statuses }),
406
- platformTypes: [],
407
- setPlatformTypes: (platformTypes) => set({ platformTypes }),
408
- namespaces: [],
409
- setNamespaces: (namespaces) => set({ namespaces }),
410
- kinds: [],
411
- setKinds: (kinds) => set({ kinds }),
412
- monitors: [],
413
- setMonitors: (monitors) => set({ monitors }),
414
- languages: [],
415
- setLanguages: (languages) => set({ languages }),
416
- errors: [],
417
- setErrors: (errors) => set({ errors }),
418
- onlyErrors: false,
419
- setOnlyErrors: (onlyErrors) => set({ onlyErrors }),
420
- setAll: (params) => set(params),
421
- clearAll: () => set(getEmptyState()),
422
- getEmptyState,
423
- }));
424
-
425
- const useInstrumentStore = create((set) => ({
426
- isAwaitingInstrumentation: false,
427
- sourcesToCreate: 0,
428
- sourcesCreated: 0,
429
- sourcesToDelete: 0,
430
- sourcesDeleted: 0,
431
- setInstrumentAwait: (v) => set({ isAwaitingInstrumentation: v }),
432
- setInstrumentCount: (k, v) => set({ [k]: v }),
433
- }));
434
-
435
- const useModalStore = create((set) => ({
436
- currentModal: '',
437
- setCurrentModal: (str) => set({ currentModal: str }),
438
- }));
439
-
440
- const useNotificationStore = create((set, get) => ({
441
- notifications: [],
442
- addNotification: (notif) => {
443
- const date = new Date();
444
- const id = `${date.getTime().toString()}${!!notif.target ? `#${notif.target}` : ''}`;
445
- // This is to prevent duplicate notifications within a 10 second time-frame.
446
- // This is useful for notifications that are triggered multiple times in a short period, like failed API queries...
447
- const foundThisNotif = !!get().notifications.find((n) => n.type === notif.type && n.title === notif.title && n.message === notif.message && !isTimeElapsed(n.time, 3000)); // 3 seconds
448
- if (!foundThisNotif) {
449
- set((state) => ({
450
- notifications: [
451
- {
452
- ...notif,
453
- id,
454
- time: date.toISOString(),
455
- dismissed: false,
456
- seen: false,
457
- },
458
- ...state.notifications,
459
- ],
460
- }));
461
- }
462
- },
463
- markAsDismissed: (id) => {
464
- set((state) => {
465
- const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
466
- if (foundIdx !== -1) {
467
- state.notifications[foundIdx].dismissed = true;
468
- }
469
- return {
470
- notifications: state.notifications,
471
- };
472
- });
473
- },
474
- markAsSeen: (id) => {
475
- set((state) => {
476
- const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
477
- if (foundIdx !== -1) {
478
- state.notifications[foundIdx].seen = true;
479
- }
480
- return {
481
- notifications: state.notifications,
482
- };
483
- });
484
- },
485
- removeNotification: (id) => {
486
- set((state) => {
487
- const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
488
- if (foundIdx !== -1) {
489
- state.notifications.splice(foundIdx, 1);
490
- }
491
- return {
492
- notifications: state.notifications,
493
- };
494
- });
495
- },
496
- removeNotifications: (target) => {
497
- if (!target)
498
- return;
499
- set((state) => {
500
- const filtered = state.notifications.filter((notif) => notif.id.split('#')[1] !== target);
501
- return {
502
- notifications: filtered,
503
- };
504
- });
505
- },
506
- }));
507
-
508
- const itemsAreEqual = (item1, item2) => {
509
- const entityTypesEqual = item1.entityType === item2.entityType;
510
- const idsEqual = typeof item1.entityId === 'string' && typeof item2.entityId === 'string'
511
- ? item1.entityId === item2.entityId
512
- : typeof item1.entityId === 'object' && typeof item2.entityId === 'object'
513
- ? item1.entityId.namespace === item2.entityId.namespace && item1.entityId.name === item2.entityId.name && item1.entityId.kind === item2.entityId.kind
514
- : !item1.entityId && !item2.entityId;
515
- return entityTypesEqual && idsEqual;
516
- };
517
- const usePendingStore = create((set, get) => ({
518
- pendingItems: [],
519
- setPendingItems: (arr) => set({ pendingItems: arr }),
520
- addPendingItems: (arr) => set((state) => ({
521
- pendingItems: state.pendingItems.concat(arr.filter((addItem) => !state.pendingItems.some((existingItem) => itemsAreEqual(existingItem, addItem)))),
522
- })),
523
- removePendingItems: (arr) => set((state) => ({
524
- pendingItems: state.pendingItems.filter((existingItem) => !arr.find((removeItem) => itemsAreEqual(existingItem, removeItem))),
525
- })),
526
- // Pass an item to check if it's in the pending items array.
527
- // This is used to show loading spinners, toasts etc.
528
- isThisPending: (item) => {
529
- const { pendingItems } = get();
530
- let bool = false;
531
- for (let i = 0; i < pendingItems.length; i++) {
532
- const pendingItem = pendingItems[i];
533
- if (pendingItem.entityType === item.entityType &&
534
- (!item.entityId ||
535
- (pendingItem.entityType === EntityTypes.Source
536
- ? !!pendingItem.entityId &&
537
- !!item.entityId &&
538
- pendingItem.entityId.namespace === item.entityId.namespace &&
539
- pendingItem.entityId.name === item.entityId.name &&
540
- pendingItem.entityId.kind === item.entityId.kind
541
- : pendingItem.entityId === item.entityId))) {
542
- bool = true;
543
- break;
544
- }
545
- }
546
- return bool;
547
- },
548
- }));
549
-
550
- const useSelectedStore = create((set) => ({
551
- selectedSources: {},
552
- setSelectedSources: (payload) => set({ selectedSources: payload }),
553
- resetSelectedState: () => set(() => ({ selectedSources: {} })),
554
- }));
555
-
556
- const useSetupStore = create((set) => ({
557
- availableSources: {},
558
- configuredSources: {},
559
- configuredFutureApps: {},
560
- configuredDestinations: [],
561
- setAvailableSources: (payload) => set({ availableSources: payload }),
562
- setConfiguredSources: (payload) => set({ configuredSources: payload }),
563
- setConfiguredFutureApps: (payload) => set({ configuredFutureApps: payload }),
564
- setConfiguredDestinations: (payload) => set({ configuredDestinations: payload }),
565
- addConfiguredDestination: (payload) => set((state) => ({ configuredDestinations: [...state.configuredDestinations, payload] })),
566
- removeConfiguredDestination: (payload) => set((state) => ({ configuredDestinations: state.configuredDestinations.filter(({ stored }) => stored.type !== payload.type) })),
567
- resetState: () => set(() => ({ availableSources: {}, configuredSources: {}, configuredFutureApps: {}, configuredDestinations: [] })),
568
- }));
569
-
570
- function styleInject(css, ref) {
571
- if ( ref === void 0 ) ref = {};
572
- var insertAt = ref.insertAt;
573
-
574
- if (!css || typeof document === 'undefined') { return; }
575
-
576
- var head = document.head || document.getElementsByTagName('head')[0];
577
- var style = document.createElement('style');
578
- style.type = 'text/css';
579
-
580
- if (insertAt === 'top') {
581
- if (head.firstChild) {
582
- head.insertBefore(style, head.firstChild);
583
- } else {
584
- head.appendChild(style);
585
- }
586
- } else {
587
- head.appendChild(style);
588
- }
589
-
590
- if (style.styleSheet) {
591
- style.styleSheet.cssText = css;
592
- } else {
593
- style.appendChild(document.createTextNode(css));
594
- }
595
- }
596
-
597
- 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";
598
- styleInject(css_248z);
599
-
600
- const slide = {
601
- in: {
602
- left: keyframes `
603
- from { transform: translateX(-100%); }
604
- to { transform: translateX(0); }
605
- `,
606
- right: keyframes `
607
- from { transform: translateX(100%); }
608
- to { transform: translateX(0); }
609
- `,
610
- top: keyframes `
611
- from { transform: translateY(-100%); }
612
- to { transform: translateY(0); }
613
- `,
614
- bottom: keyframes `
615
- from { transform: translateY(100%); }
616
- to { transform: translateY(0); }
617
- `,
618
- center: keyframes `
619
- from { transform: translate(-50%, 100%); }
620
- to { transform: translate(-50%, -50%); }
621
- `,
622
- },
623
- out: {
624
- left: keyframes `
625
- from { transform: translateX(0); }
626
- to { transform: translateX(-100%); }
627
- `,
628
- right: keyframes `
629
- from { transform: translateX(0); }
630
- to { transform: translateX(100%); }
631
- `,
632
- top: keyframes `
633
- from { transform: translateY(0); }
634
- to { transform: translateY(-100%); }
635
- `,
636
- bottom: keyframes `
637
- from { transform: translateY(0); }
638
- to { transform: translateY(100%); }
639
- `,
640
- center: keyframes `
641
- from { transform: translate(-50%, -50%); }
642
- to { transform: translate(-50%, 100%); }
643
- `,
644
- },
645
- };
646
- const progress = {
647
- in: keyframes `
648
- from { width: 0%; }
649
- to { width: 100%; }
650
- `,
651
- out: keyframes `
652
- from { width: 100%; }
653
- to { width: 0%; }
654
- `,
655
- };
656
- const ping = keyframes `
657
- 0% {
658
- transform: scale(1);
659
- opacity: 1;
660
- }
661
- 75%, 100% {
662
- transform: scale(2);
663
- opacity: 0;
664
- }
665
- `;
666
- const shimmer = keyframes `
667
- 0% {
668
- background-position: -500px 0;
669
- }
670
- 100% {
671
- background-position: 500px 0;
672
- }
673
- `;
674
-
675
- var animations = /*#__PURE__*/Object.freeze({
676
- __proto__: null,
677
- ping: ping,
678
- progress: progress,
679
- shimmer: shimmer,
680
- slide: slide
681
- });
682
-
683
- 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, getEntityId as j, isTimeElapsed as k, animations as l, styleInject as s, useDarkMode as u };