@odigos/ui-kit 0.0.49 → 0.0.51

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 (63) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/lib/components/data-card/data-card-fields/index.d.ts +1 -5
  3. package/lib/components/data-card/data-card.stories.d.ts +4 -4
  4. package/lib/components/data-finger/data-finger.stories.d.ts +9 -0
  5. package/lib/components/data-finger/index.d.ts +12 -0
  6. package/lib/components/icon-button/index.d.ts +2 -0
  7. package/lib/components/index.d.ts +5 -0
  8. package/lib/components/popup/index.d.ts +17 -0
  9. package/lib/components/popup/popup.stories.d.ts +9 -0
  10. package/lib/components/popup-form/index.d.ts +18 -0
  11. package/lib/components/popup-form/popup-form.stories.d.ts +10 -0
  12. package/lib/components/tag/index.d.ts +8 -0
  13. package/lib/components/tag/tag.stories.d.ts +13 -0
  14. package/lib/components.js +8 -8
  15. package/lib/constants.js +1 -1
  16. package/lib/containers/service-map/helpers/generate-dag-positions.d.ts +5 -0
  17. package/lib/containers/service-map/helpers/generate-spiral-grid-position.d.ts +2 -0
  18. package/lib/containers/service-map/index.d.ts +1 -1
  19. package/lib/containers/system-overview/describe/index.d.ts +1 -1
  20. package/lib/containers.js +277 -368
  21. package/lib/functions/has-unhealthy-instances/index.d.ts +2 -0
  22. package/lib/functions/index.d.ts +1 -0
  23. package/lib/functions.js +5 -5
  24. package/lib/hooks/index.d.ts +1 -0
  25. package/lib/hooks/usePopup.d.ts +17 -0
  26. package/lib/hooks.js +3 -3
  27. package/lib/icons/common/avatar-icon/avatar-icon.stories.d.ts +8 -0
  28. package/lib/icons/common/avatar-icon/index.d.ts +2 -0
  29. package/lib/icons/common/index.d.ts +2 -0
  30. package/lib/icons/common/user-group-icon/index.d.ts +2 -0
  31. package/lib/icons/common/user-group-icon/user-group-icon.stories.d.ts +8 -0
  32. package/lib/icons/math/index.d.ts +2 -0
  33. package/lib/icons/math/minus-circled-icon/index.d.ts +2 -0
  34. package/lib/icons/math/minus-circled-icon/minus-circled-icon.stories.d.ts +8 -0
  35. package/lib/icons/math/plus-circled-icon/index.d.ts +2 -0
  36. package/lib/icons/math/plus-circled-icon/plus-circled-icon.stories.d.ts +8 -0
  37. package/lib/icons.js +35 -7
  38. package/lib/{index-C1V7D2ey.js → index-1-F2f04H.js} +2270 -2205
  39. package/lib/{index-CeBxw8J4.js → index-4BmryHdH.js} +4 -4
  40. package/lib/{index-Bw7RE2T2.js → index-BC03UmY5.js} +8 -1
  41. package/lib/{index-ZTzxu5fz.js → index-CMsBAVAn.js} +2 -2
  42. package/lib/{index-w9lkC6fb.js → index-CPMIZB66.js} +12 -4
  43. package/lib/{index-DOU0EdZP.js → index-Coq_Nro0.js} +2 -2
  44. package/lib/{index-CkTdd3MS.js → index-CyHOJpMl.js} +1 -1
  45. package/lib/{index-DsEoqSQn.js → index-Dbs7YARA.js} +2 -2
  46. package/lib/{index-DxR7e2Cq.js → index-H8TwBQHm.js} +1 -1
  47. package/lib/{index-CeDmxXUE.js → index-LgzkJ05H.js} +2 -2
  48. package/lib/snippets/copy-text/index.d.ts +6 -0
  49. package/lib/snippets/index.d.ts +5 -2
  50. package/lib/snippets/pod-container/index.d.ts +5 -0
  51. package/lib/snippets/source-container/index.d.ts +7 -0
  52. package/lib/snippets.js +7 -7
  53. package/lib/store/index.d.ts +1 -0
  54. package/lib/store/useActiveNodeStore.d.ts +11 -0
  55. package/lib/store.js +1 -1
  56. package/lib/theme.js +1 -1
  57. package/lib/types/describe/index.d.ts +2 -2
  58. package/lib/types/sources/index.d.ts +10 -9
  59. package/lib/{useSourceSelectionFormData-C5VMfWEf.js → useSourceSelectionFormData-CwggurLH.js} +2 -2
  60. package/lib/{useTransition-mupXsbop.js → useTransition-DmHfJSEP.js} +38 -6
  61. package/package.json +1 -1
  62. package/lib/containers/data-flow-actions-menu/search/recent-searches/index.d.ts +0 -2
  63. /package/lib/{components/data-card/data-card-fields → snippets/source-container}/override-runtime.d.ts +0 -0
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- import { T as Theme, B as BUTTON_TEXTS, l as DISPLAY_TITLES } from './index-Bw7RE2T2.js';
3
- import { E as EditIcon } from './index-CkTdd3MS.js';
4
- import { d as Button, a5 as Text, Z as NotificationNote } from './index-C1V7D2ey.js';
2
+ import { T as Theme, B as BUTTON_TEXTS, m as DISPLAY_TITLES } from './index-BC03UmY5.js';
3
+ import { E as EditIcon } from './index-CyHOJpMl.js';
4
+ import { e as Button, ad as Text, a2 as NotificationNote } from './index-1-F2f04H.js';
5
5
  import { StatusType } from './types.js';
6
6
  import 'styled-components';
7
- import { I as InfoIcon } from './index-DxR7e2Cq.js';
7
+ import { I as InfoIcon } from './index-H8TwBQHm.js';
8
8
 
9
9
  const EditButton = ({ label, onClick, variant = 'tertiary', ...props }) => {
10
10
  const theme = Theme.useTheme();
@@ -43,6 +43,13 @@ const createImpl = (createState) => {
43
43
  };
44
44
  const create = (createState) => createState ? createImpl(createState) : createImpl;
45
45
 
46
+ const useActiveNodeStore = create((set) => ({
47
+ activeNodeType: null,
48
+ activeNodeId: null,
49
+ setActiveNodeType: (value) => set({ activeNodeType: value }),
50
+ setActiveNodeId: (value) => set({ activeNodeId: value }),
51
+ }));
52
+
46
53
  const AddClusterInfoIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
47
54
  const theme = Theme.useTheme();
48
55
  const fill = f || theme.text.secondary;
@@ -1888,4 +1895,4 @@ var animations = /*#__PURE__*/Object.freeze({
1888
1895
 
1889
1896
  const Theme = { Provider, useTheme, opacity, animations };
1890
1897
 
1891
- export { SwiftLogo as $, ACTION_OPTIONS as A, BUTTON_TEXTS as B, CodeAttributesIcon as C, DISPLAY_LANGUAGES as D, DotnetLogo as E, FORM_ALERTS as F, ElixirLogo as G, HeadersCollectionIcon as H, INSTRUMENTATION_RULE_OPTIONS as I, GoLogo as J, K8sLogo as K, LANGUAGE_OPTIONS as L, MONITORS_OPTIONS as M, JavaLogo as N, MysqlLogo as O, PiiMaskingIcon as P, NginxLogo as Q, RenameAttributeIcon as R, STORAGE_KEYS as S, Theme as T, NodejsLogo as U, PhpLogo as V, PostgresLogo as W, PythonLogo as X, RedisLogo as Y, RubyLogo as Z, RustLogo as _, useDataStreamStore as a, styleInject as a0, useDrawerStore as b, useEntityStore as c, useFilterStore as d, useInstrumentStore as e, useModalStore as f, useNotificationStore as g, usePendingStore as h, useSelectedStore as i, useSetupStore as j, DEFAULT_DATA_STREAM_NAME as k, DISPLAY_TITLES as l, getActionIcon as m, getEntityId as n, getInstrumentationRuleIcon as o, getProgrammingLanguageIcon as p, AddClusterInfoIcon as q, DeleteAttributeIcon as r, SamplerIcon as s, ImageErrorIcon as t, useDarkMode as u, KafkaLogo as v, CustomInstrumentationIcon as w, PayloadCollectionIcon as x, CPlusPlusLogo as y, CSharpLogo as z };
1898
+ export { RustLogo as $, ACTION_OPTIONS as A, BUTTON_TEXTS as B, CodeAttributesIcon as C, DISPLAY_LANGUAGES as D, CSharpLogo as E, FORM_ALERTS as F, DotnetLogo as G, HeadersCollectionIcon as H, INSTRUMENTATION_RULE_OPTIONS as I, ElixirLogo as J, K8sLogo as K, LANGUAGE_OPTIONS as L, MONITORS_OPTIONS as M, GoLogo as N, JavaLogo as O, PiiMaskingIcon as P, MysqlLogo as Q, RenameAttributeIcon as R, STORAGE_KEYS as S, Theme as T, NginxLogo as U, NodejsLogo as V, PhpLogo as W, PostgresLogo as X, PythonLogo as Y, RedisLogo as Z, RubyLogo as _, useDarkMode as a, SwiftLogo as a0, styleInject as a1, useDataStreamStore as b, useDrawerStore as c, useEntityStore as d, useFilterStore as e, useInstrumentStore as f, useModalStore as g, useNotificationStore as h, usePendingStore as i, useSelectedStore as j, useSetupStore as k, DEFAULT_DATA_STREAM_NAME as l, DISPLAY_TITLES as m, getActionIcon as n, getEntityId as o, getInstrumentationRuleIcon as p, getProgrammingLanguageIcon as q, AddClusterInfoIcon as r, DeleteAttributeIcon as s, SamplerIcon as t, useActiveNodeStore as u, ImageErrorIcon as v, KafkaLogo as w, CustomInstrumentationIcon as x, PayloadCollectionIcon as y, CPlusPlusLogo as z };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { T as Theme } from './index-Bw7RE2T2.js';
2
+ import { T as Theme } from './index-BC03UmY5.js';
3
3
 
4
4
  const VmLogo = ({ size = 16, fill: f, rotate = 0, onClick }) => {
5
5
  const theme = Theme.useTheme();
@@ -376,7 +376,7 @@ const MiddlewareLogo = ({ size = 16, fill, rotate = 0, onClick }) => {
376
376
  return (React.createElement("svg", { width: size, height: size * (19 / 37), viewBox: '0 0 37 19', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
377
377
  React.createElement("g", null,
378
378
  React.createElement("path", { fill: fill || '#E95E5F', d: 'M27.174 10.508c.21-.322.377-.558.531-.808 1.152-1.888 2.283-3.79 3.49-5.67.22-.383.55-.686.945-.868a2.048 2.048 0 0 1 1.26-.148c.412.063.791.266 1.077.576.286.31.462.708.501 1.133a2.686 2.686 0 0 1-.307 1.48 482.459 482.459 0 0 1-5.78 9.532c-.935 1.502-2.791 1.43-3.699-.143-1.11-1.852-2.164-3.74-3.245-5.606-.147-.258-.308-.5-.524-.858l-.768 1.244c-1.033 1.723-2.094 3.447-3.127 5.177-1.033 1.73-3.001 1.76-4.055-.079-1.187-2.059-2.367-4.126-3.595-6.264-.181.28-.335.5-.468.715-1.158 1.888-2.303 3.783-3.49 5.664a2.127 2.127 0 0 1-.555.621 2.07 2.07 0 0 1-1.569.387 2.062 2.062 0 0 1-.77-.294 2.115 2.115 0 0 1-.601-.576 2.17 2.17 0 0 1-.36-1.611c.046-.28.147-.547.295-.787a661.831 661.831 0 0 1 5.675-9.217c.192-.376.483-.69.84-.905a2.179 2.179 0 0 1 2.341.055c.347.232.623.558.798.943 1.054 1.823 2.094 3.661 3.134 5.484.146.258.307.501.51.83l3.545-5.807c.154-.25.3-.514.482-.758.207-.332.495-.603.837-.786a2.163 2.163 0 0 1 2.192.087c.326.209.594.502.775.85 1.082 1.837 2.094 3.697 3.183 5.549.14.264.293.514.502.858z' }),
379
- React.createElement("path", { stroke: fill || '#E95E5F', strokeOpacity: '.2', strokeWidth: '2', d: 'm27.7 7.783-.49.806c-.422-.73-.837-1.46-1.253-2.196l-.009-.016a192.02 192.02 0 0 0-1.585-2.764 3.238 3.238 0 0 0-1.11-1.204 3.169 3.169 0 0 0-3.204-.126c-.484.26-.893.64-1.19 1.102-.161.221-.308.466-.42.654l-.088.146-.001.002-2.682 4.392-.49-.86c-.754-1.325-1.512-2.657-2.276-3.98a3.258 3.258 0 0 0-1.13-1.312 3.182 3.182 0 0 0-3.415-.08 3.25 3.25 0 0 0-1.19 1.264 662.652 662.652 0 0 0-5.66 9.193 3.177 3.177 0 0 0-.396 2.368c.09.403.258.785.494 1.123.236.338.536.627.884.848a3.064 3.064 0 0 0 2.369.389 3.07 3.07 0 0 0 1.106-.525c.326-.245.6-.55.81-.9a345.117 345.117 0 0 0 2.57-4.163l.492-.803.684 1.195c.7 1.222 1.393 2.43 2.086 3.633.663 1.155 1.711 1.869 2.894 1.879 1.179.01 2.228-.683 2.887-1.786.558-.935 1.112-1.848 1.668-2.764.45-.74.9-1.484 1.355-2.241.258.447.516.898.775 1.35a213.215 213.215 0 0 0 2.145 3.692c.602 1.038 1.582 1.675 2.663 1.717 1.09.042 2.11-.53 2.747-1.552a483.087 483.087 0 0 0 5.792-9.552l.01-.019.011-.019a3.685 3.685 0 0 0 .422-2.031l-.001-.012a2.93 2.93 0 0 0-.762-1.72 2.85 2.85 0 0 0-1.636-.882 3.048 3.048 0 0 0-1.854.225 3.111 3.111 0 0 0-1.38 1.253c-.912 1.42-1.782 2.856-2.643 4.276z' }))));
379
+ React.createElement("path", { stroke: fill || '#E95E5F', strokeOpacity: '.2', d: 'm27.7 7.783-.49.806c-.422-.73-.837-1.46-1.253-2.196l-.009-.016a192.02 192.02 0 0 0-1.585-2.764 3.238 3.238 0 0 0-1.11-1.204 3.169 3.169 0 0 0-3.204-.126c-.484.26-.893.64-1.19 1.102-.161.221-.308.466-.42.654l-.088.146-.001.002-2.682 4.392-.49-.86c-.754-1.325-1.512-2.657-2.276-3.98a3.258 3.258 0 0 0-1.13-1.312 3.182 3.182 0 0 0-3.415-.08 3.25 3.25 0 0 0-1.19 1.264 662.652 662.652 0 0 0-5.66 9.193 3.177 3.177 0 0 0-.396 2.368c.09.403.258.785.494 1.123.236.338.536.627.884.848a3.064 3.064 0 0 0 2.369.389 3.07 3.07 0 0 0 1.106-.525c.326-.245.6-.55.81-.9a345.117 345.117 0 0 0 2.57-4.163l.492-.803.684 1.195c.7 1.222 1.393 2.43 2.086 3.633.663 1.155 1.711 1.869 2.894 1.879 1.179.01 2.228-.683 2.887-1.786.558-.935 1.112-1.848 1.668-2.764.45-.74.9-1.484 1.355-2.241.258.447.516.898.775 1.35a213.215 213.215 0 0 0 2.145 3.692c.602 1.038 1.582 1.675 2.663 1.717 1.09.042 2.11-.53 2.747-1.552a483.087 483.087 0 0 0 5.792-9.552l.01-.019.011-.019a3.685 3.685 0 0 0 .422-2.031l-.001-.012a2.93 2.93 0 0 0-.762-1.72 2.85 2.85 0 0 0-1.636-.882 3.048 3.048 0 0 0-1.854.225 3.111 3.111 0 0 0-1.38 1.253c-.912 1.42-1.782 2.856-2.643 4.276z' }))));
380
380
  };
381
381
 
382
382
  const NewRelicLogo = ({ size = 16, fill, rotate = 0, onClick }) => {
@@ -1,9 +1,9 @@
1
1
  import { StatusType, DestinationTypes, EntityTypes, PlatformType } from './types.js';
2
- import { k as DEFAULT_DATA_STREAM_NAME, p as getProgrammingLanguageIcon, v as KafkaLogo, K as K8sLogo } from './index-Bw7RE2T2.js';
2
+ import { l as DEFAULT_DATA_STREAM_NAME, q as getProgrammingLanguageIcon, w as KafkaLogo, K as K8sLogo } from './index-BC03UmY5.js';
3
3
  import 'react';
4
4
  import 'styled-components';
5
- import { e as AwsXrayLogo, a2 as VictoriaMetricsLogo, a1 as UptraceLogo, a0 as TraceloopLogo, $ as TingyunLogo, _ as TempoLogo, Z as TelemetryHubLogo, Y as SumoLogicLogo, X as SplunkLogo, W as SignozLogo, U as SeqLogo, d as AwsS3Logo, T as QuickwitLogo, G as GigapipeLogo, S as QrynLogo, R as PrometheusLogo, F as OpenTelemetryLogo, Q as OracleLogo, P as OpsVerseLogo, z as OpenObserveLogo, y as OneUptimeLogo, O as ObserveLogo, N as NewRelicLogo, M as MiddlewareLogo, x as LumigoLogo, w as LokiLogo, v as LogzioLogo, u as LightstepLogo, L as Last9Logo, K as KloudmateLogo, J as JaegerLogo, I as InstanaLogo, t as HyperDxLogo, H as HoneycombLogo, s as GroundcoverLogo, r as GreptimeLogo, q as GrafanaLogo, p as GoogleCloudPlatformLogo, o as ElasticSearchLogo, E as ElasticApmLogo, n as DynatraceLogo, m as DatadogLogo, D as Dash0Logo, l as CoralogixLogo, c as AwsCloudwatchLogo, k as ClickhouseLogo, j as ChronosphereLogo, i as ChecklyLogo, C as CauselyLogo, h as BonreeLogo, B as BetterStackLogo, g as BlobStorageLogo, f as AxiomLogo, b as AppDynamicsLogo, a as AlibabaCloudLogo, A as AlaudaLogo, a6 as RulesIcon, a3 as ActionsIcon, a4 as DestinationsIcon, a7 as SourcesIcon, a5 as NamespacesIcon, V as VmLogo } from './index-ZTzxu5fz.js';
6
- import { O as OdigosLogo } from './index-DxR7e2Cq.js';
5
+ import { e as AwsXrayLogo, a2 as VictoriaMetricsLogo, a1 as UptraceLogo, a0 as TraceloopLogo, $ as TingyunLogo, _ as TempoLogo, Z as TelemetryHubLogo, Y as SumoLogicLogo, X as SplunkLogo, W as SignozLogo, U as SeqLogo, d as AwsS3Logo, T as QuickwitLogo, G as GigapipeLogo, S as QrynLogo, R as PrometheusLogo, F as OpenTelemetryLogo, Q as OracleLogo, P as OpsVerseLogo, z as OpenObserveLogo, y as OneUptimeLogo, O as ObserveLogo, N as NewRelicLogo, M as MiddlewareLogo, x as LumigoLogo, w as LokiLogo, v as LogzioLogo, u as LightstepLogo, L as Last9Logo, K as KloudmateLogo, J as JaegerLogo, I as InstanaLogo, t as HyperDxLogo, H as HoneycombLogo, s as GroundcoverLogo, r as GreptimeLogo, q as GrafanaLogo, p as GoogleCloudPlatformLogo, o as ElasticSearchLogo, E as ElasticApmLogo, n as DynatraceLogo, m as DatadogLogo, D as Dash0Logo, l as CoralogixLogo, c as AwsCloudwatchLogo, k as ClickhouseLogo, j as ChronosphereLogo, i as ChecklyLogo, C as CauselyLogo, h as BonreeLogo, B as BetterStackLogo, g as BlobStorageLogo, f as AxiomLogo, b as AppDynamicsLogo, a as AlibabaCloudLogo, A as AlaudaLogo, a6 as RulesIcon, a3 as ActionsIcon, a4 as DestinationsIcon, a7 as SourcesIcon, a5 as NamespacesIcon, V as VmLogo } from './index-CMsBAVAn.js';
6
+ import { O as OdigosLogo } from './index-H8TwBQHm.js';
7
7
  import { s as safeJsonParse } from './index-BnvrwbRB.js';
8
8
 
9
9
  const compareCondition = (renderCondition, fields) => {
@@ -291,6 +291,14 @@ const getYamlFieldsForDestination = (categories, destination) => {
291
291
  return fields;
292
292
  };
293
293
 
294
+ const hasUnhealthyInstances = (containers, instances) => {
295
+ const hasUnhealthy = (list) => list?.some(({ healthy }) => healthy.status !== StatusType.Success);
296
+ if (containers?.length) {
297
+ return containers.some(({ instrumentationInstances }) => hasUnhealthy(instrumentationInstances));
298
+ }
299
+ return hasUnhealthy(instances) ?? false;
300
+ };
301
+
294
302
  const isOverTime = (originDate, difference = 0) => {
295
303
  const now = new Date().getTime();
296
304
  const compareWith = new Date(originDate).getTime();
@@ -317,4 +325,4 @@ const mapDestinationFieldsForDisplay = (destination, yamlFields) => {
317
325
 
318
326
  const sleep = async (ms = 1000) => new Promise((resolve) => setTimeout(resolve, ms));
319
327
 
320
- export { filterDestinations as a, filterDestinationsByStream as b, compareCondition as c, deepClone as d, filterSources as e, filterActions as f, filterSourcesByStream as g, formatBytes as h, getContainersInstrumentedCount as i, getContainersIcons as j, getDestinationIcon as k, getEntityIcon as l, getEntityLabel as m, getMetricForEntity as n, getPlatformIcon as o, getPlatformLabel as p, getValueForRange as q, getWorkloadId as r, getYamlFieldsForDestination as s, isOverTime as t, mapDestinationFieldsForDisplay as u, sleep as v };
328
+ export { filterDestinations as a, filterDestinationsByStream as b, compareCondition as c, deepClone as d, filterSources as e, filterActions as f, filterSourcesByStream as g, formatBytes as h, getContainersInstrumentedCount as i, getContainersIcons as j, getDestinationIcon as k, getEntityIcon as l, getEntityLabel as m, getMetricForEntity as n, getPlatformIcon as o, getPlatformLabel as p, getValueForRange as q, getWorkloadId as r, getYamlFieldsForDestination as s, hasUnhealthyInstances as t, isOverTime as u, mapDestinationFieldsForDisplay as v, sleep as w };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { aa as WarningModal } from './index-C1V7D2ey.js';
2
+ import { ai as WarningModal } from './index-1-F2f04H.js';
3
3
  import { StatusType, EntityTypes } from './types.js';
4
- import './index-Bw7RE2T2.js';
4
+ import './index-BC03UmY5.js';
5
5
  import 'styled-components';
6
6
 
7
7
  const CancelWarning = ({ isOpen, noOverlay, name, onApprove, onDeny }) => {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { T as Theme } from './index-Bw7RE2T2.js';
2
+ import { T as Theme } from './index-BC03UmY5.js';
3
3
 
4
4
  const ArrowIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
5
5
  const theme = Theme.useTheme();
@@ -1,8 +1,8 @@
1
1
  import { StatusType, OtherStatus, SignalType } from './types.js';
2
2
  import 'react';
3
- import './index-Bw7RE2T2.js';
3
+ import './index-BC03UmY5.js';
4
4
  import 'styled-components';
5
- import { T as TracesIcon, M as MetricsIcon, L as LogsIcon, O as OdigosLogo, I as InfoIcon, W as WarningTriangleIcon, E as ErrorTriangleIcon, C as CheckCircledIcon } from './index-DxR7e2Cq.js';
5
+ import { T as TracesIcon, M as MetricsIcon, L as LogsIcon, O as OdigosLogo, I as InfoIcon, W as WarningTriangleIcon, E as ErrorTriangleIcon, C as CheckCircledIcon } from './index-H8TwBQHm.js';
6
6
 
7
7
  const capitalizeFirstLetter = (string) => {
8
8
  return string.charAt(0).toUpperCase() + string.slice(1);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { T as Theme } from './index-Bw7RE2T2.js';
2
+ import { T as Theme } from './index-BC03UmY5.js';
3
3
 
4
4
  const OdigosLogo = ({ size = 16, fill: f, rotate = 0, onClick }) => {
5
5
  const theme = Theme.useTheme();
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { T as Theme } from './index-Bw7RE2T2.js';
2
+ import { T as Theme } from './index-BC03UmY5.js';
3
3
 
4
4
  const OdigosLogoText = ({ size = 16, fill: f, rotate = 0, onClick }) => {
5
5
  const theme = Theme.useTheme();
@@ -61,7 +61,7 @@ const UserIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
61
61
  const fill = f || theme.text.secondary;
62
62
  return (React.createElement("svg", { width: size, height: size, viewBox: '0 0 24 24', xmlns: 'http://www.w3.org/2000/svg', fill: 'none', style: { transform: `rotate(${rotate}deg)` }, onClick: onClick },
63
63
  React.createElement("path", { stroke: fill, strokeWidth: '1', strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M16 7C16 9.20914 14.2091 11 12 11C9.79086 11 8 9.20914 8 7C8 4.79086 9.79086 3 12 3C14.2091 3 16 4.79086 16 7Z' }),
64
- React.createElement("path", { stroke: fill, strokeWidth: '1', strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M16 15H8C5.79086 15 4 16.7909 4 19C4 20.1046 4.89543 21 6 21H18C19.1046 21 20 20.1046 20 19C20 16.7909 18.2091 15 16 15Z' })));
64
+ React.createElement("path", { stroke: fill, strokeWidth: '1', strokeLinecap: 'round', strokeLinejoin: 'round', d: 'M7.27466 21H16.7253C18.5339 21 20 19.5339 20 17.7253C20 15.4389 17.7163 13.8564 15.5755 14.6592L13.6502 15.3812C12.5862 15.7802 11.4138 15.7802 10.3498 15.3812L8.42447 14.6592C6.28366 13.8564 4 15.4389 4 17.7253C4 19.5339 5.46612 21 7.27466 21Z' })));
65
65
  };
66
66
 
67
67
  const OverviewIcon = ({ size = 16, fill: f, rotate = 0, onClick }) => {
@@ -0,0 +1,6 @@
1
+ import { type FC } from 'react';
2
+ interface CopyTextProps {
3
+ value: string;
4
+ }
5
+ declare const CopyText: FC<CopyTextProps>;
6
+ export { CopyText, type CopyTextProps };
@@ -1,4 +1,7 @@
1
- export * from './add-button/index';
2
- export * from './edit-button/index';
1
+ export * from './add-button';
2
+ export * from './copy-text';
3
+ export * from './edit-button';
3
4
  export * from './note-back-to-summary/index';
5
+ export * from './pod-container';
4
6
  export * from './react-flow';
7
+ export * from './source-container';
@@ -0,0 +1,5 @@
1
+ import { type FC } from 'react';
2
+ import { type PodContainerAnalyze } from '@/types';
3
+ type PodContainerProps = PodContainerAnalyze;
4
+ export declare const PodContainer: FC<PodContainerProps>;
5
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type FC } from 'react';
2
+ import { SourceContainer as SourceContainerType, SourceFormData } from '@/types';
3
+ interface SourceContainerProps extends SourceContainerType {
4
+ callbackRuntimeOverride?: (payload: Pick<SourceFormData, 'containerName' | 'language' | 'version'>) => Promise<void>;
5
+ }
6
+ export declare const SourceContainer: FC<SourceContainerProps>;
7
+ export {};
package/lib/snippets.js CHANGED
@@ -1,12 +1,12 @@
1
- export { A as AddButton, a as AddNode, B as BaseNode, E as EdgedNode, F as Flow, b as FrameNode, H as HeaderNode, L as LabeledEdge, M as MapItemNode, N as NoDataNode, S as ScrollNode, c as SkeletonNode, n as nodeConfig } from './index-C1V7D2ey.js';
2
- export { E as EditButton, N as NoteBackToSummary } from './index-CeBxw8J4.js';
1
+ export { A as AddButton, a as AddNode, B as BaseNode, C as CopyText, E as EdgedNode, F as Flow, b as FrameNode, H as HeaderNode, L as LabeledEdge, M as MapItemNode, N as NoDataNode, P as PodContainer, S as ScrollNode, c as SkeletonNode, d as SourceContainer, n as nodeConfig } from './index-1-F2f04H.js';
2
+ export { E as EditButton, N as NoteBackToSummary } from './index-4BmryHdH.js';
3
3
  import 'react';
4
- import './index-Bw7RE2T2.js';
4
+ import './index-BC03UmY5.js';
5
5
  import './types.js';
6
6
  import 'styled-components';
7
- import './index-CkTdd3MS.js';
8
- import './index-DsEoqSQn.js';
9
- import './index-DxR7e2Cq.js';
7
+ import './index-CyHOJpMl.js';
8
+ import './index-Dbs7YARA.js';
9
+ import './index-H8TwBQHm.js';
10
10
  import './index-BnvrwbRB.js';
11
- import './useTransition-mupXsbop.js';
12
11
  import 'react-dom';
12
+ import './useTransition-DmHfJSEP.js';
@@ -1,3 +1,4 @@
1
+ export * from './useActiveNodeStore';
1
2
  export * from './useDarkMode';
2
3
  export * from './useDataStreamStore';
3
4
  export * from './useDrawerStore';
@@ -0,0 +1,11 @@
1
+ import { NodeTypes } from '@/types';
2
+ export interface ActiveNodeStoreState {
3
+ activeNodeType: NodeTypes | null;
4
+ activeNodeId: string | null;
5
+ }
6
+ interface ActiveNodeStoreStateSetters {
7
+ setActiveNodeType: (value: ActiveNodeStoreState['activeNodeType']) => void;
8
+ setActiveNodeId: (value: ActiveNodeStoreState['activeNodeId']) => void;
9
+ }
10
+ export declare const useActiveNodeStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ActiveNodeStoreState & ActiveNodeStoreStateSetters>>;
11
+ export {};
package/lib/store.js CHANGED
@@ -1,4 +1,4 @@
1
- export { u as useDarkMode, a as useDataStreamStore, b as useDrawerStore, c as useEntityStore, d as useFilterStore, e as useInstrumentStore, f as useModalStore, g as useNotificationStore, h as usePendingStore, i as useSelectedStore, j as useSetupStore } from './index-Bw7RE2T2.js';
1
+ export { u as useActiveNodeStore, a as useDarkMode, b as useDataStreamStore, c as useDrawerStore, d as useEntityStore, e as useFilterStore, f as useInstrumentStore, g as useModalStore, h as useNotificationStore, i as usePendingStore, j as useSelectedStore, k as useSetupStore } from './index-BC03UmY5.js';
2
2
  import 'react';
3
3
  import './types.js';
4
4
  import 'styled-components';
package/lib/theme.js CHANGED
@@ -1,4 +1,4 @@
1
- export { T as default } from './index-Bw7RE2T2.js';
1
+ export { T as default } from './index-BC03UmY5.js';
2
2
  import 'styled-components';
3
3
  import 'react';
4
4
  import './types.js';
@@ -68,12 +68,12 @@ interface OtelAgentsAnalyze {
68
68
  createTime?: EntityProperty | null;
69
69
  containers: ContainerAgentConfigAnalyze[];
70
70
  }
71
- interface InstrumentationInstanceAnalyze {
71
+ export interface InstrumentationInstanceAnalyze {
72
72
  healthy: EntityProperty;
73
73
  message?: EntityProperty | null;
74
74
  identifyingAttributes?: EntityProperty[];
75
75
  }
76
- interface PodContainerAnalyze {
76
+ export interface PodContainerAnalyze {
77
77
  containerName: EntityProperty;
78
78
  actualDevices: EntityProperty;
79
79
  started?: EntityProperty | null;
@@ -11,20 +11,21 @@ export interface WorkloadId {
11
11
  name: string;
12
12
  kind: K8sResourceKind | '';
13
13
  }
14
+ export interface SourceContainer {
15
+ containerName: string;
16
+ language: ProgrammingLanguages;
17
+ runtimeVersion: string;
18
+ overriden?: boolean;
19
+ instrumented: boolean;
20
+ instrumentationMessage: string;
21
+ otelDistroName: string | null;
22
+ }
14
23
  export interface Source extends WorkloadId {
15
24
  selected: boolean;
16
25
  otelServiceName: string;
17
26
  numberOfInstances?: number;
18
27
  dataStreamNames: string[];
19
- containers: {
20
- containerName: string;
21
- language: ProgrammingLanguages;
22
- runtimeVersion: string;
23
- overriden?: boolean;
24
- instrumented: boolean;
25
- instrumentationMessage: string;
26
- otelDistroName: string | null;
27
- }[] | null;
28
+ containers: SourceContainer[] | null;
28
29
  conditions: Condition[] | null;
29
30
  }
30
31
  export interface SourceFormData {
@@ -1,9 +1,9 @@
1
1
  import { ActionKeyTypes, ActionType, StatusType, EntityTypes, FieldTypes } from './types.js';
2
- import { g as useNotificationStore, F as FORM_ALERTS, b as useDrawerStore, c as useEntityStore, a as useDataStreamStore, j as useSetupStore } from './index-Bw7RE2T2.js';
2
+ import { h as useNotificationStore, F as FORM_ALERTS, c as useDrawerStore, d as useEntityStore, b as useDataStreamStore, k as useSetupStore } from './index-BC03UmY5.js';
3
3
  import { useState, useEffect, useMemo } from 'react';
4
4
  import 'styled-components';
5
5
  import { i as isEmpty, s as safeJsonParse } from './index-BnvrwbRB.js';
6
- import { c as useGenericForm } from './useTransition-mupXsbop.js';
6
+ import { c as useGenericForm } from './useTransition-DmHfJSEP.js';
7
7
  import { g as getIdFromSseTarget, i as isLegalK8sLabel, m as mapExportedSignals } from './index-BlZKWuxe.js';
8
8
 
9
9
  const INITIAL$2 = {
@@ -1,4 +1,4 @@
1
- import { f as useModalStore, b as useDrawerStore } from './index-Bw7RE2T2.js';
1
+ import { g as useModalStore, c as useDrawerStore, u as useActiveNodeStore } from './index-BC03UmY5.js';
2
2
  import { AddNodeTypes, EntityTypes, CustomInstrumentationsKeyTypes, CodeAttributesKeyTypes, PayloadCollectionKeyTypes } from './types.js';
3
3
  import React, { useState, useRef, useEffect, useCallback } from 'react';
4
4
  import styled from 'styled-components';
@@ -64,15 +64,18 @@ const useGenericForm = (initialFormData) => {
64
64
  const useClickNode = () => {
65
65
  const { setCurrentModal } = useModalStore();
66
66
  const { setDrawerType, setDrawerEntityId } = useDrawerStore();
67
+ const { setActiveNodeType, setActiveNodeId } = useActiveNodeStore();
67
68
  const onClickNode = (_, object) => {
68
- const { data: { id, type }, } = object;
69
- switch (type) {
69
+ const { id: nodeId, type: nodeType, data: { id: entityId, type: entityType }, } = object;
70
+ setActiveNodeType(nodeType);
71
+ setActiveNodeId(nodeId);
72
+ switch (entityType) {
70
73
  case EntityTypes.Source:
71
74
  case EntityTypes.Destination:
72
75
  case EntityTypes.Action:
73
76
  case EntityTypes.InstrumentationRule:
74
- setDrawerType(type);
75
- setDrawerEntityId(id);
77
+ setDrawerType(entityType);
78
+ setDrawerEntityId(entityId);
76
79
  break;
77
80
  case AddNodeTypes.AddSource:
78
81
  setCurrentModal(EntityTypes.Source);
@@ -273,6 +276,35 @@ const useOnClickOutside = (ref, handler) => {
273
276
  }, [ref, handler]);
274
277
  };
275
278
 
279
+ const usePopup = ({ defaultClientHeight = 0, defaultClientwidth = 0, onClickOutside } = {}) => {
280
+ const popupRef = useRef(null);
281
+ const [popupOpen, setPopupOpen] = useState(false);
282
+ const [popupPosition, setPopupPosition] = useState({ top: 0, left: 0 });
283
+ useOnClickOutside(popupRef, () => {
284
+ if (popupOpen) {
285
+ setPopupOpen(false);
286
+ onClickOutside?.();
287
+ }
288
+ });
289
+ const handlePosition = (clientX, clientY) => {
290
+ const { innerWidth, innerHeight } = window;
291
+ let top = clientY;
292
+ let left = clientX;
293
+ if (top >= innerHeight / 2)
294
+ top += -(popupRef.current?.clientHeight || defaultClientHeight);
295
+ if (left >= innerWidth / 2)
296
+ left += -(popupRef.current?.clientWidth || defaultClientwidth);
297
+ setPopupPosition({ top, left });
298
+ };
299
+ return {
300
+ popupRef,
301
+ popupOpen,
302
+ setPopupOpen,
303
+ popupPosition,
304
+ handlePosition,
305
+ };
306
+ };
307
+
276
308
  // Fallback locale.
277
309
  // (when not a single one of the supplied "preferred" locales is available)
278
310
  var defaultLocale$1 = 'en'; // For all locales added
@@ -3535,4 +3567,4 @@ const useTransition = ({ container, animateIn, animateOut, duration = 300 }) =>
3535
3567
  return Transition;
3536
3568
  };
3537
3569
 
3538
- export { useContainerSize as a, useCopy as b, useGenericForm as c, useInstrumentationRuleFormData as d, useKeyDown as e, useOnClickOutside as f, useTimeAgo as g, useTransition as h, useClickNode as u };
3570
+ export { useContainerSize as a, useCopy as b, useGenericForm as c, useInstrumentationRuleFormData as d, useKeyDown as e, useOnClickOutside as f, usePopup as g, useTimeAgo as h, useTransition as i, useClickNode as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.49",
3
+ "version": "0.0.51",
4
4
  "author": "Odigos",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const RecentSearches: () => React.JSX.Element;