@odigos/ui-kit 0.0.225 → 0.0.227

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 (71) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/lib/chunks/index-B0b5lJH3.js +3 -0
  3. package/lib/chunks/index-C-Z4QHpA.js +149 -0
  4. package/lib/chunks/ui-components-C7i9zbc-.js +2652 -0
  5. package/lib/components/_v2/cards/data-card/index.d.ts +16 -3
  6. package/lib/components/_v2/charts/gauge-chart/index.d.ts +18 -0
  7. package/lib/components/_v2/charts/index.d.ts +1 -0
  8. package/lib/components/_v2/condition/index.d.ts +13 -0
  9. package/lib/components/_v2/conditions/index.d.ts +8 -0
  10. package/lib/components/_v2/drawer/header/index.d.ts +6 -1
  11. package/lib/components/_v2/drop-data/index.d.ts +1 -0
  12. package/lib/components/_v2/icon-button/index.d.ts +1 -0
  13. package/lib/components/_v2/index.d.ts +3 -0
  14. package/lib/components/_v2/tag/index.d.ts +2 -1
  15. package/lib/components/v2.js +1 -1
  16. package/lib/components.js +1 -1
  17. package/lib/constants.js +1 -1
  18. package/lib/containers/_v2/_drawers/add-destination-drawer/index.d.ts +1 -1
  19. package/lib/containers/_v2/_drawers/add-source-drawer/index.d.ts +3 -1
  20. package/lib/containers/_v2/_drawers/edit-action-drawer/helpers.d.ts +12 -0
  21. package/lib/containers/_v2/_drawers/edit-action-drawer/index.d.ts +9 -0
  22. package/lib/containers/_v2/_drawers/edit-destination-drawer/helpers.d.ts +11 -0
  23. package/lib/containers/_v2/_drawers/edit-destination-drawer/index.d.ts +11 -0
  24. package/lib/containers/_v2/_drawers/edit-rule-drawer/helpers.d.ts +13 -0
  25. package/lib/containers/_v2/_drawers/edit-rule-drawer/index.d.ts +9 -0
  26. package/lib/containers/_v2/_drawers/index.d.ts +3 -0
  27. package/lib/containers/_v2/_forms/add-action-form/index.d.ts +0 -1
  28. package/lib/containers/_v2/_forms/add-destination-form/index.d.ts +8 -4
  29. package/lib/containers/_v2/_forms/add-rule-form/index.d.ts +0 -1
  30. package/lib/containers/_v2/_forms/index.d.ts +0 -1
  31. package/lib/containers/_v2/onboarding/summary/index.d.ts +1 -1
  32. package/lib/containers/_v2/pipeline-collectors/enum.d.ts +4 -0
  33. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-badge.d.ts +1 -1
  34. package/lib/containers/_v2/pipeline-collectors/general-info/helpers/get-general-gauge-cards.d.ts +4 -0
  35. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-status-card.d.ts +1 -1
  36. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-text-cards.d.ts +1 -1
  37. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/get-general-title.d.ts +1 -1
  38. package/lib/containers/_v2/pipeline-collectors/{helpers → general-info/helpers}/index.d.ts +2 -1
  39. package/lib/containers/_v2/pipeline-collectors/general-info/index.d.ts +7 -6
  40. package/lib/containers/_v2/pipeline-collectors/index.d.ts +5 -0
  41. package/lib/containers/_v2/pipeline-collectors/toolbar/index.d.ts +1 -11
  42. package/lib/containers/source-drawer/profiling/flamebearer.d.ts +5 -0
  43. package/lib/containers/v2.js +43 -56
  44. package/lib/containers.js +45 -45
  45. package/lib/contexts/action-form-context.d.ts +19 -0
  46. package/lib/{containers/_v2/_forms/add-destination-form/context.d.ts → contexts/destination-form-context.d.ts} +5 -4
  47. package/lib/contexts/index.d.ts +4 -0
  48. package/lib/contexts/rule-form-context.d.ts +19 -0
  49. package/lib/contexts/source-instrument-form-context.d.ts +22 -0
  50. package/lib/contexts.js +1 -1
  51. package/lib/functions/get-status-color/index.d.ts +2 -2
  52. package/lib/functions/get-status-icon/index.d.ts +2 -2
  53. package/lib/functions.js +1 -1
  54. package/lib/hooks.js +1 -1
  55. package/lib/snippets/_v2/yaml-section-card/index.d.ts +2 -0
  56. package/lib/snippets/v2.js +1 -1
  57. package/lib/snippets.js +1 -1
  58. package/lib/store.js +1 -1
  59. package/lib/theme.js +1 -1
  60. package/lib/types/common/index.d.ts +36 -0
  61. package/lib/types.js +1 -1
  62. package/lib/visuals.js +1 -1
  63. package/package.json +1 -1
  64. package/lib/chunks/index-BMJ_MZzY.js +0 -149
  65. package/lib/chunks/index-Dlnglk_e.js +0 -3
  66. package/lib/chunks/ui-components-BqdkaDt2.js +0 -2543
  67. package/lib/components/_v2/cards/section-part-card/index.d.ts +0 -11
  68. package/lib/containers/_v2/_forms/add-action-form/context.d.ts +0 -18
  69. package/lib/containers/_v2/_forms/add-rule-form/context.d.ts +0 -18
  70. package/lib/containers/_v2/_forms/add-source-form/context.d.ts +0 -21
  71. package/lib/containers/_v2/_forms/add-source-form/index.d.ts +0 -1
@@ -0,0 +1,19 @@
1
+ import { type FC, type ReactNode } from 'react';
2
+ import { type GenericFormResult } from '@/hooks/useGenericForm';
3
+ import { type Action, type ActionFormData, type ActionOption } from '@/types';
4
+ interface ActionFormContextValue {
5
+ selectedOption: ActionOption | null;
6
+ onSelectOption: (option: ActionOption | null) => void;
7
+ loadAction: (action: Action) => void;
8
+ genericForm?: GenericFormResult<ActionFormData>;
9
+ validateFormData: () => {
10
+ errorMessage?: string;
11
+ preparedFormData: ActionFormData;
12
+ };
13
+ errorMessage?: string;
14
+ }
15
+ export declare const ActionFormContextProvider: FC<{
16
+ children: ReactNode;
17
+ }>;
18
+ export declare const useActionFormContext: () => ActionFormContextValue;
19
+ export {};
@@ -1,7 +1,7 @@
1
1
  import React, { type FC, Dispatch, SetStateAction } from 'react';
2
2
  import { type GenericFormResult } from '@/hooks';
3
3
  import { DestinationCategoryTypes } from '@/constants';
4
- import { type DestinationDynamicField, type DestinationFormData, type DestinationOption, type TestConnectionResponse } from '@/types';
4
+ import { type Destination, type DestinationCategories, type DestinationDynamicField, type DestinationFormData, type DestinationOption, type TestConnectionResponse } from '@/types';
5
5
  interface ActiveForm {
6
6
  listType: DestinationCategoryTypes;
7
7
  option: DestinationOption;
@@ -13,9 +13,10 @@ export interface UnsavedDestination {
13
13
  formData: DestinationFormData;
14
14
  testResult?: TestConnectionResponse;
15
15
  }
16
- interface AddDestinationFormContextType {
16
+ interface DestinationFormContextType {
17
17
  activeForm: ActiveForm | null;
18
18
  onChangeActiveForm: (payload: Omit<ActiveForm, 'dynamicFields'> | null) => void;
19
+ loadDestination: (destination: Destination, categories: DestinationCategories) => void;
19
20
  genericForm?: GenericFormResult<DestinationFormData>;
20
21
  formErrorMessage?: string;
21
22
  validateFormData: () => {
@@ -29,8 +30,8 @@ interface AddDestinationFormContextType {
29
30
  updateUnsavedDestination: (idx: number, payload: Omit<UnsavedDestination, 'option'>, keepActiveForm?: boolean) => void;
30
31
  deleteUnsavedDestination: (idx: number) => void;
31
32
  }
32
- export declare const AddDestinationFormContextProvider: FC<{
33
+ export declare const DestinationFormContextProvider: FC<{
33
34
  children: React.ReactNode;
34
35
  }>;
35
- export declare const useAddDestinationFormContext: () => AddDestinationFormContextType;
36
+ export declare const useDestinationFormContext: () => DestinationFormContextType;
36
37
  export {};
@@ -1,3 +1,7 @@
1
+ export * from './action-form-context';
2
+ export * from './destination-form-context';
1
3
  export * from './odigos-context';
4
+ export * from './rule-form-context';
2
5
  export * from './sampling-rules-form-context';
6
+ export * from './source-instrument-form-context';
3
7
  export * from './storybook-context';
@@ -0,0 +1,19 @@
1
+ import { type FC, type ReactNode } from 'react';
2
+ import { type GenericFormResult } from '@/hooks/useGenericForm';
3
+ import { type InstrumentationRule, type InstrumentationRuleFormData, type InstrumentationRuleOption } from '@/types';
4
+ interface RuleFormContextValue {
5
+ selectedOption: InstrumentationRuleOption | null;
6
+ onSelectOption: (option: InstrumentationRuleOption | null) => void;
7
+ loadRule: (rule: InstrumentationRule) => void;
8
+ genericForm?: GenericFormResult<InstrumentationRuleFormData>;
9
+ validateFormData: () => {
10
+ errorMessage?: string;
11
+ preparedFormData: InstrumentationRuleFormData;
12
+ };
13
+ errorMessage?: string;
14
+ }
15
+ export declare const RuleFormContextProvider: FC<{
16
+ children: ReactNode;
17
+ }>;
18
+ export declare const useRuleFormContext: () => RuleFormContextValue;
19
+ export {};
@@ -0,0 +1,22 @@
1
+ import React, { type FC, type Dispatch, type SetStateAction } from 'react';
2
+ import type { FormData, HandleSelectAllFunc, HandleSourceChangeFunc } from '@/containers/_v2/_drawers/add-source-drawer/types';
3
+ import { type AllClusterSnapshots, type PersistSourceInput } from '@/types';
4
+ interface SourceInstrumentFormContextType {
5
+ snapshots: AllClusterSnapshots | null;
6
+ setSnapshots: Dispatch<SetStateAction<AllClusterSnapshots | null>>;
7
+ isFetching: boolean;
8
+ setIsFetching: Dispatch<SetStateAction<boolean>>;
9
+ formData: FormData;
10
+ handleSourceChange: HandleSourceChangeFunc;
11
+ handleSelectAll: HandleSelectAllFunc;
12
+ formDiff: PersistSourceInput;
13
+ isFormDirty: boolean;
14
+ }
15
+ export interface SourceInstrumentFormContextProviderProps {
16
+ children: React.ReactNode;
17
+ selectedConnectionIds?: string[];
18
+ initialInputs?: PersistSourceInput | null;
19
+ }
20
+ export declare const SourceInstrumentFormContextProvider: FC<SourceInstrumentFormContextProviderProps>;
21
+ export declare const useSourceInstrumentFormContext: () => SourceInstrumentFormContextType;
22
+ export {};
package/lib/contexts.js CHANGED
@@ -1 +1 @@
1
- export{fL as OdigosProvider,ac as SamplingRuleFormType,aJ as SamplingRulesFormProvider,fM as StorybookProvider,b7 as checkVersionSupport,a3 as useOdigos,ab as useSamplingRulesFormContext,fN as useStorybook}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{bs as ActionFormContextProvider,br as DestinationFormContextProvider,fY as OdigosProvider,bt as RuleFormContextProvider,a0 as SamplingRuleFormType,a$ as SamplingRulesFormProvider,bq as SourceInstrumentFormContextProvider,fZ as StorybookProvider,bm as checkVersionSupport,r as useActionFormContext,y as useDestinationFormContext,as as useOdigos,X as useRuleFormContext,$ as useSamplingRulesFormContext,aC as useSourceInstrumentFormContext,f_ as useStorybook}from"./chunks/ui-components-C7i9zbc-.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
@@ -1,3 +1,3 @@
1
1
  import { DefaultTheme } from 'styled-components';
2
- import { OtherStatusType, StatusType } from '@/types';
3
- export declare const getStatusColor: (theme: DefaultTheme, status: StatusType | OtherStatusType, weight: keyof typeof theme.v2.colors.purple | keyof typeof theme.v2.colors.red | keyof typeof theme.v2.colors.yellow | keyof typeof theme.v2.colors.green | keyof typeof theme.v2.colors.silver) => string;
2
+ import { OtherStatus, OtherStatusType, StatusType } from '@/types';
3
+ export declare const getStatusColor: (theme: DefaultTheme, status: StatusType | OtherStatus | OtherStatusType, weight: keyof typeof theme.v2.colors.purple | keyof typeof theme.v2.colors.red | keyof typeof theme.v2.colors.yellow | keyof typeof theme.v2.colors.green | keyof typeof theme.v2.colors.silver) => string;
@@ -1,3 +1,3 @@
1
1
  import type { DefaultTheme } from 'styled-components';
2
- import { OtherStatusType, StatusType, type SVG } from '@/types';
3
- export declare const getStatusIcon: (status: StatusType | OtherStatusType, theme: DefaultTheme) => SVG;
2
+ import { OtherStatus, OtherStatusType, StatusType, type SVG } from '@/types';
3
+ export declare const getStatusIcon: (status: StatusType | OtherStatus | OtherStatusType, theme: DefaultTheme) => SVG;
package/lib/functions.js CHANGED
@@ -1 +1 @@
1
- export{dl as capitalizeFirstLetter,fd as cleanObjectEmptyStringsValues,z as compareCondition,v as deepClone,cS as entityIdKey,cz as filterActions,d0 as filterDestinations,c_ as filterDestinationsByStream,c$ as filterSources,cZ as filterSourcesByStream,fe as flattenObjectKeys,cU as formatBytes,dX as formatDuration,g as generateId,ck as getActionIcon,ct as getConditionsBooleans,dR as getContainersIcons,dU as getContainersInstrumentedCount,ff as getDeepValue,au as getDestinationIcon,fg as getDetectedLanguageIcons,cG as getEntityIcon,cg as getEntityId,cR as getEntityIdKey,cB as getEntityLabel,fh as getIdFromSseTarget,cV as getInstrumentationRuleIcon,fi as getMainContainerLanguage,dq as getMetricForEntity,fj as getMonitorIcon,fk as getPlatformIcon,fl as getPlatformLabel,a2 as getProgrammingLanguageIcon,dZ as getRecursiveValues,cW as getSourceLanguageIcons,fm as getSseTargetFromId,fn as getStatusColor,be as getStatusFromPodStatus,cx as getStatusIcon,dG as getStatusTypeFromOdigosHealth,fo as getValueForRange,dz as getVirtualServiceIcon,dw as getWorkloadId,dk as getYamlFieldsForDestination,dH as hasUnhealthyInstances,l as isEmpty,fp as isLegalK8sLabel,b2 as isOverTime,dM as isStringABoolean,fq as isTimeElapsed,fr as isValidVersion,cw as mapConditions,di as mapDestinationFieldsForDisplay,L as mapExportedSignals,H as mapSupportedSignals,fs as numbersOnly,dN as parseBooleanFromString,ft as parseJsonStringToPrettyString,R as prepareDestinationFormData,fu as removeEmptyValuesFromObject,M as safeJsonParse,fv as safeJsonStringify,fw as setDeepValue,cM as sleep,d7 as splitCamelString,fx as stringifyNonStringValues,cn as trimVersion}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{dx as capitalizeFirstLetter,fq as cleanObjectEmptyStringsValues,x as compareCondition,ao as deepClone,d6 as entityIdKey,cO as filterActions,de as filterDestinations,aQ as filterDestinationsByStream,dd as filterSources,dc as filterSourcesByStream,fr as flattenObjectKeys,d8 as formatBytes,e5 as formatDuration,g as generateId,aM as getActionIcon,cI as getConditionsBooleans,d$ as getContainersIcons,e2 as getContainersInstrumentedCount,fs as getDeepValue,al as getDestinationIcon,ft as getDetectedLanguageIcons,cV as getEntityIcon,aH as getEntityId,d5 as getEntityIdKey,cQ as getEntityLabel,fu as getIdFromSseTarget,aW as getInstrumentationRuleIcon,fv as getMainContainerLanguage,dB as getMetricForEntity,fw as getMonitorIcon,fx as getPlatformIcon,fy as getPlatformLabel,_ as getProgrammingLanguageIcon,e7 as getRecursiveValues,d9 as getSourceLanguageIcons,fz as getSseTargetFromId,fA as getStatusColor,by as getStatusFromPodStatus,cM as getStatusIcon,dQ as getStatusTypeFromOdigosHealth,fB as getValueForRange,dJ as getVirtualServiceIcon,dG as getWorkloadId,aR as getYamlFieldsForDestination,dR as hasUnhealthyInstances,i as isEmpty,fC as isLegalK8sLabel,bi as isOverTime,dW as isStringABoolean,fD as isTimeElapsed,fE as isValidVersion,cL as mapConditions,aO as mapDestinationFieldsForDisplay,H as mapExportedSignals,J as mapSupportedSignals,fF as numbersOnly,dX as parseBooleanFromString,fG as parseJsonStringToPrettyString,L as prepareDestinationFormData,fH as removeEmptyValuesFromObject,ap as safeJsonParse,fI as safeJsonStringify,fJ as setDeepValue,c$ as sleep,aS as splitCamelString,fK as stringifyNonStringValues,cC as trimVersion}from"./chunks/ui-components-C7i9zbc-.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/hooks.js CHANGED
@@ -1 +1 @@
1
- export{cf as useActionFormData,fK as useBodyScroll,d1 as useClickNode,dx as useClickNotification,cY as useContainerSize,u as useCopy,dc as useDataStreamFormData,dj as useDestinationFormData,t as useGenericForm,dt as useInstrumentationRuleFormData,b0 as useKeyDown,d6 as useOnClickOutside,d2 as usePopup,bV as useScrollTo,db as useSessionStorage,dO as useSourceFormData,dS as useSourceSelectionFormData,b1 as useTimeAgo}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{cw as useActionFormData,fX as useBodyScroll,df as useClickNode,dH as useClickNotification,db as useContainerSize,u as useCopy,dq as useDataStreamFormData,dw as useDestinationFormData,aN as useGenericForm,dD as useInstrumentationRuleFormData,bg as useKeyDown,dk as useOnClickOutside,dg as usePopup,ca as useScrollTo,dp as useSessionStorage,dY as useSourceFormData,e0 as useSourceSelectionFormData,bh as useTimeAgo}from"./chunks/ui-components-C7i9zbc-.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
@@ -1,8 +1,10 @@
1
1
  import { type FC } from 'react';
2
+ import { type DataCardProps } from '@/components/_v2';
2
3
  export interface YamlSectionCardProps {
3
4
  title?: string;
4
5
  yaml?: string | null;
5
6
  defaultOpen?: boolean;
6
7
  fullHeight?: boolean;
8
+ bgTint?: DataCardProps['bgTint'];
7
9
  }
8
10
  export declare const YamlSectionCard: FC<YamlSectionCardProps>;
@@ -1 +1 @@
1
- export{A as ActionType,bj as Actions,bo as ColoredSpan,eD as ColoredSpanVariant,bi as RichTitle}from"../chunks/ui-components-BqdkaDt2.js";export{C as CancelModal,i as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,a as PERCENTAGE_OPTIONS,d as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,b as SamplingPreviewSection,S as SignalsCheckboxList,c as SourceScopeSection,U as UpgradeModal,f as WIDE_DRAWER_WIDTH,W as WideDrawer}from"../chunks/index-BMJ_MZzY.js";export{Y as YamlSectionCard}from"../chunks/index-Dlnglk_e.js";import"../icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{A as ActionType,bx as Actions,bG as ColoredSpan,eN as ColoredSpanVariant,bw as RichTitle}from"../chunks/ui-components-C7i9zbc-.js";export{C as CancelModal,i as DURATION_OPTIONS,f as DeleteModal,e as DurationErrorsSection,D as DynamicField,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,a as PERCENTAGE_OPTIONS,d as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,b as SamplingPreviewSection,S as SignalsCheckboxList,c as SourceScopeSection,U as UpgradeModal,g as WIDE_DRAWER_WIDTH,W as WideDrawer}from"../chunks/index-C-Z4QHpA.js";export{Y as YamlSectionCard}from"../chunks/index-B0b5lJH3.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"../chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/snippets.js CHANGED
@@ -1 +1 @@
1
- export{c4 as AddButton,dI as CopyText,dC as EditButton,dB as Flow,fO as MapItemNode,fP as NoDataNode,dg as NoteBackToSummary,dK as PodContainer,dQ as SourceContainer}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{cl as AddButton,dS as CopyText,dM as EditButton,dL as Flow,f$ as MapItemNode,g0 as NoDataNode,du as NoteBackToSummary,dU as PodContainer,d_ as SourceContainer}from"./chunks/ui-components-C7i9zbc-.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/store.js CHANGED
@@ -1 +1 @@
1
- export{aE as ProgressKeys,dA as useActiveNodeStore,dW as useDarkMode,E as useDataStreamStore,cb as useDrawerStore,ax as useEntityStore,cy as useFilterStore,cm as useModalStore,ds as useNotificationStore,aD as useProgressStore,cO as useSelectedStore,dd as useSetupStore}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{aE as ProgressKeys,dK as useActiveNodeStore,e4 as useDarkMode,aP as useDataStreamStore,cs as useDrawerStore,aq as useEntityStore,cN as useFilterStore,cB as useModalStore,aT as useNotificationStore,aB as useProgressStore,d2 as useSelectedStore,dr as useSetupStore}from"./chunks/ui-components-C7i9zbc-.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/theme.js CHANGED
@@ -1 +1 @@
1
- export{fG as Provider,fH as animations,fI as opacity,fJ as palettes}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{fT as Provider,fU as animations,fV as opacity,fW as palettes}from"./chunks/ui-components-C7i9zbc-.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
@@ -232,6 +232,7 @@ export interface EffectiveConfig {
232
232
  } | null;
233
233
  rollout?: {
234
234
  automaticRolloutDisabled?: boolean | null;
235
+ maxConcurrentRollouts?: number | null;
235
236
  } | null;
236
237
  autoRollback?: {
237
238
  disabled?: boolean | null;
@@ -311,6 +312,23 @@ export interface EffectiveConfig {
311
312
  ui?: string | null;
312
313
  collector?: string | null;
313
314
  } | null;
315
+ sampling?: {
316
+ dryRun?: boolean | null;
317
+ spanSamplingAttributes?: {
318
+ disabled?: boolean | null;
319
+ samplingCategoryDisabled?: boolean | null;
320
+ traceDecidingRuleDisabled?: boolean | null;
321
+ spanDecisionAttributesDisabled?: boolean | null;
322
+ } | null;
323
+ tailSampling?: {
324
+ disabled?: boolean | null;
325
+ traceAggregationWaitDuration?: string | null;
326
+ } | null;
327
+ k8sHealthProbesSampling?: {
328
+ enabled?: boolean | null;
329
+ keepPercentage?: number | null;
330
+ } | null;
331
+ } | null;
314
332
  provenance?: ProvenanceEntry[] | null;
315
333
  manifestYAML?: string | null;
316
334
  }
@@ -385,6 +403,7 @@ export interface EffectiveConfigInput {
385
403
  } | null;
386
404
  rollout?: {
387
405
  automaticRolloutDisabled?: boolean | null;
406
+ maxConcurrentRollouts?: number | null;
388
407
  } | null;
389
408
  autoRollback?: {
390
409
  disabled?: boolean | null;
@@ -464,6 +483,23 @@ export interface EffectiveConfigInput {
464
483
  ui?: string | null;
465
484
  collector?: string | null;
466
485
  } | null;
486
+ sampling?: {
487
+ dryRun?: boolean | null;
488
+ spanSamplingAttributes?: {
489
+ disabled?: boolean | null;
490
+ samplingCategoryDisabled?: boolean | null;
491
+ traceDecidingRuleDisabled?: boolean | null;
492
+ spanDecisionAttributesDisabled?: boolean | null;
493
+ } | null;
494
+ tailSampling?: {
495
+ disabled?: boolean | null;
496
+ traceAggregationWaitDuration?: string | null;
497
+ } | null;
498
+ k8sHealthProbesSampling?: {
499
+ enabled?: boolean | null;
500
+ keepPercentage?: number | null;
501
+ } | null;
502
+ } | null;
467
503
  manifestYAML?: string | null;
468
504
  }
469
505
  export type GetEffectiveConfigFunc = (id: string) => Promise<EffectiveConfig | undefined>;
package/lib/types.js CHANGED
@@ -1 +1 @@
1
- export{eV as ActionCategory,f as ActionKeyTypes,s as ActionType,eW as AddNodeTypes,eX as BooleanOperation,U as CodeAttributesKeyTypes,cl as Crud,_ as CustomInstrumentationsKeyTypes,cQ as DesiredStateProgress,eY as DestinationTypes,eZ as EdgeTypes,aa as EntityTypes,r as FieldTypes,Y as GolangCustomProbe,W as HeadersCollectionKeyTypes,k as InputTypes,e_ as InstallationMethod,$ as InstrumentationRuleType,e$ as IntrumentationStatus,Z as JavaCustomProbe,f0 as JsonOperation,K as K8sAttributesFrom,dP as K8sResourceKind,f1 as ListDirection,dy as NodeTypes,f2 as NumberOperation,f3 as OtelDistroName,dh as OtherEntityTypes,cv as OtherStatus,az as OtherStatusType,X as PayloadCollectionKeyTypes,f4 as PlatformType,f5 as PodContainerLifecycleStatus,f6 as PodContainerStatus,f7 as PodPhase,f8 as Profile,dE as ProgrammingLanguages,f9 as SIGNAL_KEY_TO_TYPE,dm as SIGNAL_TYPE_TO_KEY,fa as SignalKey,J as SignalType,fb as SortDirection,Q as StatusType,fc as StringOperation,a9 as Tier,bm as WorkloadRolloutStatus}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{f3 as ActionCategory,c as ActionKeyTypes,q as ActionType,f4 as AddNodeTypes,f5 as BooleanOperation,M as CodeAttributesKeyTypes,cA as Crud,V as CustomInstrumentationsKeyTypes,d4 as DesiredStateProgress,f6 as DestinationTypes,f7 as EdgeTypes,aD as EntityTypes,p as FieldTypes,R as GolangCustomProbe,P as HeadersCollectionKeyTypes,h as InputTypes,f8 as InstallationMethod,W as InstrumentationRuleType,f9 as IntrumentationStatus,U as JavaCustomProbe,fa as JsonOperation,K as K8sAttributesFrom,dZ as K8sResourceKind,fb as ListDirection,dI as NodeTypes,fc as NumberOperation,fd as OtelDistroName,dv as OtherEntityTypes,cK as OtherStatus,av as OtherStatusType,Q as PayloadCollectionKeyTypes,fe as PlatformType,ff as PodContainerLifecycleStatus,fg as PodContainerStatus,fh as PodPhase,fi as Profile,dO as ProgrammingLanguages,fj as SIGNAL_KEY_TO_TYPE,dy as SIGNAL_TYPE_TO_KEY,fk as SignalKey,G as SignalType,fl as SortDirection,E as StatusType,fm as StringOperation,aw as Tier,bA as WorkloadRolloutStatus}from"./chunks/ui-components-C7i9zbc-.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/lib/visuals.js CHANGED
@@ -1 +1 @@
1
- export{g0 as VISUAL_ODIGOS_LOGO_HEIGHT,g1 as VISUAL_ODIGOS_LOGO_WIDTH,eU as VisualGreenRings,g2 as VisualOdigosLogo}from"./chunks/ui-components-BqdkaDt2.js";import"./icons.js";import"react/jsx-runtime";import"styled-components";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
1
+ export{fn as VISUAL_ODIGOS_LOGO_HEIGHT,fo as VISUAL_ODIGOS_LOGO_WIDTH,f2 as VisualGreenRings,fp as VisualOdigosLogo}from"./chunks/ui-components-C7i9zbc-.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"./chunks/vendor-C150cdxb.js";import"@xyflow/react";import"react-dom";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";import"virtua";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.225",
3
+ "version": "0.0.227",
4
4
  "author": "Odigos",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,149 +0,0 @@
1
- import{bQ as e,r as a,n as l,o as t,d$ as r,d as s,av as o,y as i,m as n,M as d,p as c,I as p,k as u,a3 as h,a9 as g,c as m,F as v,i as f,x as b,aw as y,S as x,e0 as S,e1 as w,aA as C,e2 as k,T,e3 as $,e as L,e4 as P,e5 as M,e6 as A,e7 as O,e8 as N,e9 as z,ea as D,eb as R,ec as X,ed as I,ee as E,ef as H,eg as K,b3 as V,a as j,B as q,eh as U,ei as G,ej as J,ek as B,el as F,em as W,en as Q,eo as Z,ep as Y,aj as _,af as ee,eq as ae,er as le,am as te,ai as re,es as se,et as oe,eu as ie,ev as ne,aM as de,ew as ce,ex as pe,ey as ue,ez as he,eA as ge,eB as me,eC as ve,eD as fe,bo as be,q as ye,eE as xe,eF as Se,eG as we,eH as Ce,eI as ke,eJ as Te,eK as $e,eL as Le,eM as Pe,eN as Me,P as Ae,eO as Oe,Q as Ne,eP as ze,eQ as De,eR as Re,eS as Xe,eT as Ie,dE as Ee,a2 as He,v as Ke,d9 as Ve,j as je,eU as qe,cT as Ue,b as Ge,N as Je,aW as Be,as as Fe,bi as We,dF as Qe}from"./ui-components-BqdkaDt2.js";import{jsx as Ze,jsxs as Ye,Fragment as _e}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as ea,OdigosLogoTextCommunity as aa,EditIcon as la,ArrowLeftIcon as ta,ArrowRightIcon as ra,VSquareIcon as sa}from"../icons.js";import{useCallback as oa,useMemo as ia,useState as na,useRef as da,useEffect as ca,forwardRef as pa,useImperativeHandle as ua}from"react";import ha,{useTheme as ga}from"styled-components";import"./index-Dlnglk_e.js";const ma=({isOpen:a,onClose:l,onDeny:t,onApprove:r})=>Ze(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:a,onClose:l,onDeny:t,denyLabel:"Keep editing",onApprove:r,approveLabel:"Discard changes"}),va=({isOpen:a,onClose:l,onDeny:t,onApprove:r,action:s="delete",target:o})=>{const i=s.charAt(0).toUpperCase()+s.substring(1),n=o?.endsWith("s")?"these":"this";return Ze(e,{title:`${i}${o?` ${o}`:""}?`,description:`Are you sure you want to ${s}${o?` ${n} ${o}`:""}?`,isOpen:a,onClose:l,onDeny:t,denyLabel:"Go back",onApprove:r,approveLabel:i})},fa=({componentType:e,inputType:h,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S,setValue:w,errorMessage:C,warnMessage:k,helpMessage:T,dropdownOptions:$,dropdownNoSearch:L,dropdownNoCheckbox:P,timeUnits:M,timeDefaultUnit:A})=>{switch(e){case a.Input:return Ze(p,{name:g,type:h,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",onChange:e=>{const a=e.target.value;w(h===u.Number?""===a?null:Number(a):a)},errorMessage:C,warnMessage:k,helpMessage:T},g);case a.MultiInput:return Ze(c,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,values:Array.isArray(S)?S:d(S,[]),setValues:e=>w(e),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.KeyValuePair:return Ze(n,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(S)?S:d(S,[]),setValues:e=>w(e),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.TextArea:return Ze(i,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,placeholder:b,value:S??"",onChange:e=>w(e.target.value),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Dropdown:return Ze(o,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,withSearch:!L,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!P}))||[],values:S?[String(S)]:[],setValues:e=>w(e[0]),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Checkbox:return Ze(s,{name:g,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>w(e),disabled:x,errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Time:return Ze(r,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",setValue:e=>w(e),units:M,defaultUnit:A,errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Toggle:return Ze(l,{name:g,labelAlign:t.Right,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>w(e),disabled:x,errorMessage:C,warnMessage:k,helpMessage:T},g);default:return null}},ba=({size:e=200})=>{const{tier:a}=h();return a===g.Onprem?Ze(ea,{size:e}):Ze(aa,{size:e})},ya=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0",label:"0%"},{value:"custom",label:"Custom"}],xa=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"0",label:"0%"},{value:"custom",label:"Custom"}],Sa=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],wa=({description:e,options:a,selected:l,onSelect:t,customName:r,customLabel:s,customPlaceholder:o,customValue:i,onCustomChange:n})=>Ye(m,{$gap:16,$alignItems:"flex-end",children:[Ye(v,{$gap:6,children:[Ze(f,{label:e}),Ze(b,{size:y.S,options:a,selected:l,setSelected:t})]}),"custom"===l&&Ze(p,{name:r,label:s,placeholder:o,type:u.Number,value:i,onChange:n,width:160})]}),Ca=()=>{},ka=e=>e.readOnly?Ze(Ta,{rule:e.rule}):Ze($a,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),Ta=({rule:e})=>{const a=ga(),r=null!=e.durationAtLeastMs;return e.error?Ze(x,{richTitle:{title:S},children:Ze(l,{name:"sampling-view-toggle-keep-errors",onChange:Ca,value:!0,size:C.S,label:w,labelAlign:t.Right})}):r?Ze(x,{richTitle:{title:k},children:Ye("div",{children:[Ze(T,{size:L.XXXS,color:a.v2.colors.silver[200],children:$}),Ze(T,{size:L.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},$a=({ruleType:e,formState:a,onChange:r})=>{const s=oa(e=>r({durationPreset:e}),[r]),o=oa(e=>r({customDurationMs:e.target.value}),[r]);return"Error"===e?Ze(x,{richTitle:{title:S,subTitle:P},children:Ze(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:Ca,size:C.S,label:w,labelAlign:t.Right})}):"Duration"===e?Ze(x,{richTitle:{title:k,subTitle:M},children:Ze(wa,{description:$,options:Sa,selected:a.durationPreset,onSelect:s,customName:"sampling-input-custom-duration",customLabel:A,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:o})}):null},La=ha.div`
2
- display: flex;
3
- gap: 32px;
4
- `,Pa=ha.div`
5
- display: flex;
6
- flex-direction: column;
7
- gap: 4px;
8
- `,Ma=ha.div`
9
- display: flex;
10
- flex-wrap: wrap;
11
- align-items: flex-end;
12
- gap: 16px;
13
- `,Aa=ha.div`
14
- display: flex;
15
- align-items: flex-end;
16
- gap: 16px;
17
- padding: 12px 16px;
18
- border-radius: 8px;
19
- background-color: ${({theme:e})=>e.v2.colors.black[500]};
20
- `,Oa=ha.div`
21
- display: flex;
22
- align-items: flex-end;
23
- gap: 10px;
24
- flex: 1;
25
- `,Na=ha.div`
26
- display: flex;
27
- align-items: center;
28
- height: 32px;
29
- `,za=ha.div`
30
- display: flex;
31
- align-items: flex-end;
32
- gap: 16px;
33
- margin-bottom: 12px;
34
- `,Da="Any",Ra="Kafka topic",Xa=()=>Ze("div",{style:{marginBottom:"8px"},children:Ze(T,{size:L.XS,weight:500,children:"And"})}),Ia=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Ea=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Ha=[{id:"",label:Da},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const Ka=e=>e.readOnly?Ze(Va,{data:e.data}):Ze(ja,{category:e.category,formState:e.formState,onChange:e.onChange}),Va=({data:e})=>{const a=ga(),l=ia(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:B,value:J},{id:"route",title:E,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:U,value:a.httpServer.method||Da}];if(a?.httpClient){const e=[{id:"type",title:B,value:W}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:E,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||F}),e.push({id:"method",title:U,value:a.httpClient.method||Da}),e}return[{id:"type",title:B,value:Q}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:B,value:J},{id:"route",title:E,value:a.httpServer.route||a.httpServer.routePrefix||F},{id:"method",title:U,value:a.httpServer.method||Da}]:a?.kafkaConsumer?[{id:"type",title:B,value:Z},{id:"topic",title:Ra,value:a.kafkaConsumer.kafkaTopic||F}]:a?.kafkaProducer?[{id:"type",title:B,value:Y},{id:"topic",title:Ra,value:a.kafkaProducer.kafkaTopic||F}]:[{id:"type",title:B,value:Q}]}(e),[e]);return Ze(x,{richTitle:{title:O},children:Ze(La,{children:l.map(({id:e,title:l,value:t})=>Ye(Pa,{children:[Ze(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:l}),Ze(T,{size:L.XS,nowrap:!0,children:t})]},e))})})},ja=({category:e,formState:a,onChange:l})=>{const t=ia(()=>"noisy"===e?Ia:Ea,[e]),r=oa(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),s=oa(e=>a=>{a&&l({routeType:e,route:""})},[l]),o=oa(e=>l({route:e.target.value}),[l]),i=oa(e=>l({serverAddress:e.target.value}),[l]),n=oa(e=>l({method:e[0]||""}),[l]),d=oa(e=>l({kafkaTopic:e.target.value}),[l]),c="httpServer"===a.operationType||"httpClient"===a.operationType,u="kafkaConsumer"===a.operationType||"kafkaProducer"===a.operationType,h="httpClient"===a.operationType?I:E,g="httpClient"===a.operationType?H:K;return Ye(x,{richTitle:{title:`2. ${O}`,subTitle:N},children:[Ze(v,{$alignItems:"flex-start",children:Ze(b,{size:y.S,options:t,selected:a.operationType,setSelected:r})}),c&&Ye(Ma,{children:["httpClient"===a.operationType&&Ye(za,{children:[Ze(p,{name:"sampling-input-server-address",label:D,placeholder:z,value:a.serverAddress,onChange:i}),Ze(Xa,{})]}),Ye(Aa,{children:[Ye(Oa,{children:[Ze(Na,{children:Ze(R,{"data-id":"sampling-radio-route",value:"route"===a.routeType,onChange:s("route")})}),Ze(p,{name:"sampling-input-route",label:h,placeholder:X,value:"route"===a.routeType?a.route:"",onChange:o,disabled:"route"!==a.routeType})]}),Ye(Oa,{children:[Ze(Na,{children:Ze(R,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===a.routeType,onChange:s("routePrefix")})}),Ze(p,{name:"sampling-input-route-prefix",label:g,placeholder:X,value:"routePrefix"===a.routeType?a.route:"",onChange:o,disabled:"routePrefix"!==a.routeType})]})]}),Ye(za,{children:[Ze(Xa,{}),Ze(V,{label:U,items:Ha,selectedIds:[a.method||""],setSelectedIds:e=>n(e),buttonProps:{"data-id":"sampling-btn-method",label:Ha.find(e=>e.id===a.method)?.label||Da,size:q.S,variant:j.Secondary}})]})]}),u&&Ze(p,{name:"sampling-input-kafka-topic",label:G,placeholder:"Type kafka topic",value:a.kafkaTopic,onChange:d,width:"320px"})]})},qa=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ua=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Ga=e=>e.readOnly?Ze(Ja,{data:e.data}):Ze(Ba,{category:e.category,formState:e.formState,onChange:e.onChange}),Ja=({data:e})=>{const a=ga(),l=ia(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:ae,method:oe,description:re,value:`${e.rule.percentageAtLeast}%`}:{title:ae,method:ne,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:le,method:oe,description:se,value:`${e.rule.percentageAtMost}%`}:{title:le,method:ie,description:null,value:null};case"costReduction":return{title:le,method:oe,description:se,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:U,value:l.method},...null!=l.description?[{id:"value",title:l.description,value:l.value}]:[]];return Ze(x,{richTitle:{title:l.title},children:Ze(La,{children:t.map(({id:e,title:l,value:t})=>Ye(Pa,{children:[Ze(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:l}),Ze(T,{size:L.XS,nowrap:!0,children:t})]},e))})})},Ba=({category:e,formState:a,onChange:l})=>{const t="highlyRelevant"===e,r=t?Ua:qa,s=`3. ${t?ae:le}`,o=t?_:ee,i=t?re:se,n="noisy"===e?xa:ya,d=oa(e=>l({percentageMode:e}),[l]),c=oa(e=>l({percentagePreset:e}),[l]),p=oa(e=>l({customPercentage:e.target.value}),[l]);return Ye(x,{richTitle:{title:s,subTitle:o},children:["costReduction"!==e&&Ze(v,{$alignItems:"flex-start",children:Ze(b,{size:y.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&Ze(wa,{description:i,options:n,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:te,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:p})]})},Fa=ha.div`
35
- display: flex;
36
- align-items: flex-end;
37
- gap: 16px;
38
- `,Wa=ha.div`
39
- width: 280px;
40
- flex-shrink: 0;
41
- `,Qa=ha.div`
42
- display: flex;
43
- flex-direction: column;
44
- gap: 4px;
45
- `,Za=ha.div`
46
- flex: 1;
47
- min-width: 0;
48
- `,Ya=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}];function _a(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":ve[e.category]}const el=e=>e.readOnly?Ze(al,{data:e.data}):Ze(ll,{category:e.category,formState:e.formState,onChange:e.onChange}),al=({data:e})=>{const a=ga(),l=ia(()=>[{id:"name",title:ce,value:e.rule.name||de},{id:"type",title:pe,value:_a(e)}],[e]),t=e.rule.notes||F;return Ye(x,{children:[Ze(La,{children:l.map(({id:e,title:l,value:t})=>Ye(Pa,{children:[Ze(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:l}),Ze(T,{size:L.XS,nowrap:!0,children:t})]},e))}),Ye(Pa,{children:[Ze(T,{size:L.XXXS,color:a.v2.colors.silver[200],children:ue}),Ze(T,{size:L.XS,children:t})]})]})},ll=({category:e,formState:a,onChange:l})=>{const t=oa(e=>l({name:e.target.value}),[l]),r=oa(e=>l({notes:e.target.value}),[l]),s=oa(e=>{l({ruleType:e,keepErrors:"Error"===e})},[l]);return Ze(x,{children:Ye(Fa,{children:[Ze(Wa,{children:Ze(p,{name:"sampling-input-rule-name",label:ce,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:he,value:a.name,onChange:t})}),"highlyRelevant"===e&&Ye(Qa,{children:[Ze(f,{label:pe}),Ze(b,{size:y.S,options:Ya,selected:a.ruleType,setSelected:s})]}),Ze(Za,{children:Ze(p,{name:"sampling-input-note",label:ue,tooltip:me,placeholder:ge,value:a.notes,onChange:r})})]})})},tl=ha.div`
49
- display: flex;
50
- align-items: center;
51
- gap: 24px;
52
- padding: 8px 16px;
53
- border-radius: 12px;
54
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
55
- `,rl=ha.div`
56
- flex: 1;
57
- min-width: 0;
58
- white-space: pre;
59
- overflow-x: auto;
60
- `,sl=({title:e,summary:a,onEdit:l,renderAction:t})=>{const r=ia(()=>{const l=[];return e&&(l.push({text:e,variant:fe.Default}),l.push({text:" - ",variant:fe.Default})),l.push(...a),l},[e,a]);return Ye(tl,{children:[Ze(rl,{children:Ze(be,{parts:r})}),t&&t(),l&&Ze(ye,{"data-id":"sampling-btn-edit-auto-rule",label:xe,rightIcon:la,variant:j.Text,size:q.S,onClick:l})]})},ol=e=>{const a=ia(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return Te($e(e.formState));case"highlyRelevant":return Ce(ke(e.formState));case"costReduction":return Se(we(e.formState))}},[e]);if(e.readOnly)return Ze(sl,{title:Le,summary:a});const l=1===a.length&&"default"===a[0].variant;return Ze(sl,{title:l?Pe:Le,summary:l?[]:a})},il=ha.div`
61
- display: flex;
62
- flex-wrap: wrap;
63
- gap: 8px;
64
- `,nl=ha.div`
65
- display: flex;
66
- align-items: center;
67
- gap: 8px;
68
- padding: 8px 12px;
69
- border-radius: 8px;
70
- cursor: pointer;
71
- background: ${({theme:e,$selected:a})=>a?e.v2.colors.silver[700]:e.v2.colors.silver[900]};
72
- border: 1px solid ${({theme:e,$selected:a})=>a?e.v2.colors.silver[500]:e.v2.colors.silver[800]};
73
-
74
- &:hover {
75
- background: ${({theme:e})=>e.v2.colors.silver[700]};
76
- }
77
- `,dl=ha.div`
78
- display: flex;
79
- width: 32px;
80
- height: 32px;
81
- justify-content: center;
82
- align-items: center;
83
- flex-shrink: 0;
84
- `,cl=ha.div`
85
- display: flex;
86
- flex-direction: column;
87
- gap: 4px;
88
- `,pl=ha.div`
89
- display: flex;
90
- align-items: center;
91
- gap: 8px;
92
- padding: 8px;
93
- border-radius: 8px;
94
- background-color: ${({theme:e})=>e.v2.colors.silver[900]};
95
- `,ul=ha.div`
96
- display: flex;
97
- width: 24px;
98
- height: 24px;
99
- justify-content: center;
100
- align-items: center;
101
- flex-shrink: 0;
102
- `,hl={[Ee.JavaScript]:"Node.js",[Ee.DotNet]:".NET",[Ee.Php]:"PHP",[Ee.Java]:"Java",[Ee.Go]:"Go",[Ee.Python]:"Python",[Ee.Ruby]:"Ruby",[Ee.Rust]:"Rust"},gl=[Ee.Python,Ee.Java,Ee.JavaScript,Ee.DotNet,Ee.Php,Ee.Ruby,Ee.Go].map(e=>({id:e,label:hl[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:He(e)})),ml=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function vl(e){const a=hl[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const fl=e=>e.readOnly?Ze(bl,{scopes:e.scopes}):Ze(yl,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),bl=({scopes:e})=>{const a=ga();return Ze(x,{richTitle:{title:Me},children:e.length?Ze(cl,{children:e.map((e,l)=>((e,l)=>{if(e.workloadLanguage){const t=He(e.workloadLanguage);return Ye(pl,{children:[t&&Ze(ul,{children:Ze(t,{size:18})}),Ze(T,{size:L.XS,color:a.v2.colors.white[500],children:vl(e.workloadLanguage)})]},l)}const t=[e.workloadNamespace,e.workloadKind,e.workloadName].filter(Boolean),r=t.length?t.join(" / "):"Unknown scope";return Ze(pl,{children:Ze(T,{size:L.XS,color:a.v2.colors.white[500],children:r})},l)})(e,l))}):Ze(Ae,{status:Ne.Default,message:Oe,fullWidth:!0})})},yl=({formState:e,onChange:a,sourceOptions:l=[],namespaceOptions:t=[]})=>{const[r,o]=na("all"),i=e.sourceScopes.length>0,n=ia(()=>ml.map(e=>({...e,disabled:"all"===e.value&&i})),[i]),d=ia(()=>e.sourceScopes.filter(e=>"source"===e.scopeType).map(e=>{return a=e.workloadNamespace,l=e.workloadKind,t=e.workloadName,`${a}/${l}/${t}`;var a,l,t}),[e.sourceScopes]),c=ia(()=>e.sourceScopes.filter(e=>"namespace"===e.scopeType).map(e=>e.workloadNamespace),[e.sourceScopes]),p=ia(()=>new Set(e.sourceScopes.filter(e=>"language"===e.scopeType).map(e=>e.workloadLanguage)),[e.sourceScopes]),u=oa(e=>{o(e)},[]),h=oa(l=>{const t=e.sourceScopes.filter(e=>"source"!==e.scopeType),r=l.map(e=>function(e){const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}}(e)).filter(e=>null!==e).map(e=>({scopeType:"source",workloadName:e.name,workloadKind:e.kind,workloadNamespace:e.namespace,workloadLanguage:""}));a({sourceScopes:[...t,...r]})},[e.sourceScopes,a]),g=oa(l=>{const t=e.sourceScopes.filter(e=>"namespace"!==e.scopeType),r=l.map(e=>({scopeType:"namespace",workloadName:"",workloadKind:"",workloadNamespace:e,workloadLanguage:""}));a({sourceScopes:[...t,...r]})},[e.sourceScopes,a]),m=oa(l=>{if(e.sourceScopes.some(e=>"language"===e.scopeType&&e.workloadLanguage===l))a({sourceScopes:e.sourceScopes.filter(e=>!("language"===e.scopeType&&e.workloadLanguage===l))});else{const t={scopeType:"language",workloadName:"",workloadKind:"",workloadNamespace:"",workloadLanguage:l};a({sourceScopes:[...e.sourceScopes,t]})}},[e.sourceScopes,a]);return Ye(x,{richTitle:{title:`1. ${Me}`,subTitle:ze},children:[Ze(Ae,!i&&"all"===r?{status:Ne.Default,message:Oe,fullWidth:!0,smallIcon:!0}:{status:Ne.Info,message:De,fullWidth:!0,smallIcon:!0}),Ze(v,{$alignItems:"flex-start",children:Ze(b,{size:y.S,options:n,selected:r,setSelected:u})}),"source"===r&&Ze(Re,{multiple:!0,"data-id":"sampling-autocomplete-source",options:l,value:d,onSelect:h,placeholder:Xe}),"namespace"===r&&Ze(Re,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:t,value:c,onSelect:g,placeholder:"Search namespace"}),"language"===r&&Ze(il,{children:gl.map(({id:e,label:a,Icon:l})=>{const t=p.has(e);return Ye(nl,{$selected:t,onClick:()=>m(e),children:[Ze(s,{name:`sampling-scope-lang-${e}`,size:Ie.S,value:t,onChange:()=>m(e)}),Ze(dl,{children:Ze(l,{size:20})}),Ze(T,{size:L.XS,nowrap:!0,children:a})]},e)})})]})},xl=(e,a)=>!a?.length||!!a?.find(a=>a===e),Sl=({title:e="Signals",required:a,errorMessage:l,allowedSignals:t,selectedSignals:r,setSelectedSignals:o,disabled:i})=>{const[n,d]=na(1===r.length),c=da(JSON.stringify(r));ca(()=>{const e=Ke(r);e.length||Ve.forEach(({id:a})=>{xl(a,t)&&e.push(a)});const a=JSON.stringify(e);c.current!==a&&(c.current=a,o(e),d(1===e.length))},[t,r]);return Ye(v,{$gap:12,children:[Ze(f,{label:e,required:a}),Ze(m,{$gap:12,children:Ve.map(e=>{const a=xl(e.id,t),l=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?Ze(s,{label:e.value,disabled:i||!a||n&&l,value:l,onChange:a=>((e,a)=>{const l=e,t=a?[...r,l]:r.filter(e=>e!==l);o(t),d(1===t.length)})(e.id,a)},e.id):null})}),Ze(je,{errorMessage:l})]})},wl=({minSupportedVersion:a,currentVersion:l})=>Ze(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>Ze(qe,{scale:2.4,icon:()=>Ze("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:Ze("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${l}.`}),Cl=ha.div`
103
- display: flex;
104
- flex-direction: column;
105
- justify-content: flex-end;
106
- width: ${({$width:e})=>e};
107
- gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
108
- `,kl=ha.div`
109
- display: flex;
110
- align-items: center;
111
- min-height: 24px;
112
- padding: 12px;
113
- border-radius: 16px 16px 0 0;
114
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
115
- `,Tl=ha.div`
116
- display: flex;
117
- flex-direction: column;
118
- gap: ${({$gap:e})=>e}px;
119
- padding: 12px 12px 0 12px;
120
- width: calc(100% - 24px);
121
- height: ${({$heightOffset:e,$columnHasHeader:a})=>`calc(100vh - 180px - ${e}px ${a?"- 48px":""})`};
122
- border-radius: ${({$columnHasHeader:e,$isLeft:a,$isRight:l})=>e?a?"0 0 0 16px":l?"0 16px 0 0":"0":a?"16px 0 0 16px":l?"0 16px 16px 0":"16px"};
123
- background-color: ${({theme:e})=>e.v2.colors.silver[900]};
124
- overflow-y: auto;
125
- overflow-x: hidden;
126
- `,$l=({isLeft:e,isRight:a,heightOffset:l=0,width:t,header:r,list:s})=>Ye(Cl,{$width:t,$columnHasHeader:!!r,children:[r&&Ze(kl,{children:r}),Ze(Tl,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:l,$columnHasHeader:!!r,children:s.length?s.length>1?Ze(Ue,{gap:8,elements:s}):Ze(_e,{children:s[0]}):Ze(Ge,{$height:"100%",children:Ze(Je,{})})})]}),Ll="75vw",Pl=ha.div`
127
- display: flex;
128
- flex-direction: column;
129
- border-radius: 16px;
130
- background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
131
- overflow: hidden;
132
- `,Ml=ha.div`
133
- display: flex;
134
- gap: 12px;
135
- padding: 16px 16px 0 16px;
136
- background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
137
- position: sticky;
138
- top: 0;
139
- `,Al=ha.div`
140
- padding: 12px 12px 0 12px;
141
- `,Ol=ha.div`
142
- display: flex;
143
- gap: 12px;
144
- padding: 16px;
145
- `,Nl=ha.div`
146
- padding: 5vh 10vw;
147
- border-radius: 12px;
148
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
149
- `,zl=pa(({isOpen:e,withOverlay:a,disableAnimation:l,onClose:t,onBack:r,onNext:s,nextIsSkip:o,onSave:i,disableSave:n,connectionIds:d,header:c,subHeader:p,leftColumn:u,rightColumn:h,search:g,filters:m,errorMessage:v,isFormDirty:f,hideDirtyNote:b,isFetching:y,progress:x},S)=>{const[w,C]=na(!1),[k,T]=na(!1),[$,P]=na(void 0);ua(S,()=>({clearErrors:()=>P(void 0)}));const M=k,A=oa(()=>{f&&!w?C(!0):(C(!1),t?.())},[f,w,t]),O=n||k||"boolean"==typeof f&&!f,N=oa(async()=>{T(!0);const e=await i();T(!1),e?.error?P(e.error):(d?.setValue([]),t?.())},[i,d,t]),z=!!g||!!d||!!m,D=!!p,R=(z?48:0)+(D?50:0),X=ia(()=>y?{status:Ne.Info,message:"Fetching Data..."}:k&&!x?{status:Ne.Info,message:"Saving Changes..."}:$||v?{status:Ne.Error,message:$||v}:"boolean"==typeof f&&f&&!b?{status:Ne.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof f||f||b?void 0:{status:Ne.Success,message:"The values reflect the current configuration of the selected cluster."},[y,k,x,$,v,f,b]),I=ia(()=>r?{label:"Back",leftIcon:ta,variant:j.Secondary,onClick:r}:{label:"Cancel",variant:j.Secondary,onClick:A,disabled:M},[r,A,M]),E=ia(()=>s?o?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:ra,variant:j.Secondary,onClick:s}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:ra,variant:j.Primary,onClick:s}:{"data-id":"wide-drawer-save",label:"Save",variant:j.Primary,onClick:N,disabled:O},[s,o,N,O]);return Ye(Be,{width:Ll,isOpen:e,disableAnimation:l,hideOverlay:!k&&!a,header:{...c,onClose:t?A:void 0,onCloseDisabled:M},footer:{note:X,actions:[I,E]},children:[k?Ze(Ge,{$height:"calc(100vh - 136px)",children:Ze(Nl,{children:Ze(Fe,{titleSize:L.S,subTitleSize:L.XXXS,withGradient:!0,withSpinner:!0,...x})})}):Ye(Pl,{children:[z&&Ye(Ml,{children:[d&&Ze(We,{icon:sa,title:"Selected Clusters",badge:{label:d.value.length}}),g&&Ze(Qe,{width:"100%",...g}),m]}),D&&Ze(Al,{children:Ze(We,{icon:p.icon,title:p.title,subTitle:p.description,badge:p.badge})}),Ye(Ol,{children:[Ze($l,{isLeft:!0,heightOffset:R,...u}),Ze($l,{isRight:!0,heightOffset:R,...h})]})]}),Ze(ma,{isOpen:w,onClose:()=>C(!1),onApprove:A})]})});zl.displayName=zl.name;export{sl as A,ma as C,fa as D,xa as N,Ka as O,wa as P,el as R,Sl as S,wl as U,zl as W,ya as a,ol as b,fl as c,Ga as d,ka as e,Ll as f,va as g,ba as h,Sa as i};
@@ -1,3 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useState as o,useMemo as e}from"react";import i from"styled-components";import{u as n,B as a,a as r,A as s,g as l,S as c,C as d,b as p,N as m}from"./ui-components-BqdkaDt2.js";import{VIcon as u,CopyIcon as f,ChevronUpIcon as h,ChevronDownIcon as y,YamlIcon as b}from"../icons.js";const g=i.div`
2
- padding: 0 12px;
3
- `,C=({title:i="YAML",yaml:C,defaultOpen:S,fullHeight:k})=>{const{clickCopy:v,isCopied:A}=n(),[Y,j]=o(S??!1),x=e(()=>C?[{id:l(),type:s.Button,buttonProps:{variant:r.Secondary,size:a.S,leftIcon:A?u:f,onClick:()=>v(C||""),disabled:A}},{id:l(),type:s.Button,buttonProps:{variant:r.Secondary,size:a.S,leftIcon:Y?h:y,onClick:()=>j(t=>!t)}}]:[],[C,A,Y]);return t(c,{richTitle:{icon:b,title:i},actions:x,fullHeight:k,children:Y&&t(g,{children:C?t(d,{code:C,language:"yaml",theme:"duotoneDark"}):t(p,{children:t(m,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{C as Y};