@odigos/ui-kit 0.0.49 → 0.0.50

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 +12 -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 +2 -2
  19. package/lib/containers/system-overview/describe/index.d.ts +1 -1
  20. package/lib/containers.js +262 -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-Bw7RE2T2.js → index-BC03UmY5.js} +8 -1
  39. package/lib/{index-ZTzxu5fz.js → index-CMsBAVAn.js} +2 -2
  40. package/lib/{index-w9lkC6fb.js → index-CPMIZB66.js} +12 -4
  41. package/lib/{index-C1V7D2ey.js → index-CgdNGqvh.js} +2270 -2205
  42. package/lib/{index-CkTdd3MS.js → index-CyHOJpMl.js} +1 -1
  43. package/lib/{index-DsEoqSQn.js → index-Dbs7YARA.js} +2 -2
  44. package/lib/{index-DOU0EdZP.js → index-DnhO-nLH.js} +2 -2
  45. package/lib/{index-DxR7e2Cq.js → index-H8TwBQHm.js} +1 -1
  46. package/lib/{index-CeDmxXUE.js → index-LgzkJ05H.js} +2 -2
  47. package/lib/{index-CeBxw8J4.js → index-r72g3gV5.js} +4 -4
  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,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,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-CgdNGqvh.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 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 }) => {
@@ -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-CgdNGqvh.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();
@@ -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-CgdNGqvh.js';
2
+ export { E as EditButton, N as NoteBackToSummary } from './index-r72g3gV5.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.50",
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;