@odigos/ui-kit 0.0.224 → 0.0.225

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 (90) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/DEVELOPMENT.md +27 -0
  3. package/Makefile +7 -0
  4. package/lib/chunks/index-BMJ_MZzY.js +149 -0
  5. package/lib/chunks/{index-Au62BabI.js → index-Dlnglk_e.js} +1 -1
  6. package/lib/chunks/ui-components-BqdkaDt2.js +2543 -0
  7. package/lib/components/_v2/autocomplete/index.d.ts +13 -3
  8. package/lib/components/_v2/drawer/header/index.d.ts +2 -0
  9. package/lib/components/_v2/drop-data/index.d.ts +1 -0
  10. package/lib/components/_v2/index.d.ts +1 -0
  11. package/lib/components/_v2/time-input/index.d.ts +24 -0
  12. package/lib/components/v2.js +1 -1
  13. package/lib/components.js +1 -1
  14. package/lib/constants/sampling/index.d.ts +9 -4
  15. package/lib/constants/sources/index.d.ts +1 -0
  16. package/lib/constants.js +1 -1
  17. package/lib/containers/_v2/_drawers/index.d.ts +1 -5
  18. package/lib/containers/_v2/_drawers/sampling-rule-drawer/index.d.ts +50 -0
  19. package/lib/containers/_v2/_forms/index.d.ts +1 -5
  20. package/lib/containers/_v2/_forms/sampling-rule-form/index.d.ts +2 -0
  21. package/lib/containers/_v2/sampling-rules/converters.d.ts +9 -0
  22. package/lib/containers/_v2/sampling-rules/helpers.d.ts +2 -2
  23. package/lib/containers/_v2/sampling-rules/rules-table/index.d.ts +1 -1
  24. package/lib/containers/_v2/sampling-rules/toolbar/index.d.ts +1 -1
  25. package/lib/containers/_v2/sampling-rules/types.d.ts +1 -42
  26. package/lib/containers/source-drawer/profiling/index.d.ts +1 -1
  27. package/lib/containers/v2.js +51 -188
  28. package/lib/containers.js +47 -47
  29. package/lib/contexts/index.d.ts +1 -0
  30. package/lib/contexts/sampling-rules-form-context.d.ts +90 -0
  31. package/lib/contexts.js +1 -1
  32. package/lib/functions.js +1 -1
  33. package/lib/hooks/useScrollTo.d.ts +1 -0
  34. package/lib/hooks.js +1 -1
  35. package/lib/snippets/_v2/colored-span/index.d.ts +1 -0
  36. package/lib/snippets/_v2/dynamic-field/index.d.ts +3 -1
  37. package/lib/snippets/_v2/index.d.ts +1 -0
  38. package/lib/snippets/_v2/sampling-rule-form-sections/duration-errors.d.ts +13 -0
  39. package/lib/snippets/_v2/sampling-rule-form-sections/index.d.ts +7 -0
  40. package/lib/snippets/_v2/sampling-rule-form-sections/operation.d.ts +12 -0
  41. package/lib/snippets/_v2/sampling-rule-form-sections/percentage.d.ts +12 -0
  42. package/lib/snippets/_v2/sampling-rule-form-sections/preset-with-custom-input.d.ts +29 -0
  43. package/lib/snippets/_v2/sampling-rule-form-sections/rule-info.d.ts +12 -0
  44. package/lib/snippets/_v2/sampling-rule-form-sections/sampling-preview.d.ts +12 -0
  45. package/lib/{containers/_v2/_forms/create-sampling-rule-form/sections → snippets/_v2/sampling-rule-form-sections}/source-scope.d.ts +8 -4
  46. package/lib/snippets/_v2/sampling-rule-form-sections/styled.d.ts +2 -0
  47. package/lib/snippets/v2.js +1 -53
  48. package/lib/snippets.js +1 -1
  49. package/lib/store.js +1 -1
  50. package/lib/theme.js +1 -1
  51. package/lib/types/common/index.d.ts +2 -1
  52. package/lib/types/enum/index.d.ts +1 -0
  53. package/lib/types/sampling.d.ts +77 -0
  54. package/lib/types/sources/index.d.ts +18 -6
  55. package/lib/types.js +1 -1
  56. package/lib/visuals.js +1 -1
  57. package/package.json +1 -1
  58. package/lib/chunks/ui-components-CI2PiWkX.js +0 -2516
  59. package/lib/containers/_v2/_drawers/create-sampling-rule-drawer/index.d.ts +0 -20
  60. package/lib/containers/_v2/_drawers/edit-auto-rule-drawer/index.d.ts +0 -9
  61. package/lib/containers/_v2/_drawers/edit-cost-reduction-auto-rule-drawer/index.d.ts +0 -9
  62. package/lib/containers/_v2/_drawers/edit-highly-relevant-auto-rule-drawer/index.d.ts +0 -8
  63. package/lib/containers/_v2/_drawers/view-sampling-rule-drawer/index.d.ts +0 -21
  64. package/lib/containers/_v2/_forms/create-sampling-rule-form/context.d.ts +0 -34
  65. package/lib/containers/_v2/_forms/create-sampling-rule-form/converters.d.ts +0 -5
  66. package/lib/containers/_v2/_forms/create-sampling-rule-form/form-helpers.d.ts +0 -5
  67. package/lib/containers/_v2/_forms/create-sampling-rule-form/index.d.ts +0 -3
  68. package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/duration-errors.d.ts +0 -9
  69. package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/operation.d.ts +0 -9
  70. package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/percentage.d.ts +0 -9
  71. package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/rule-info.d.ts +0 -9
  72. package/lib/containers/_v2/_forms/create-sampling-rule-form/sections/sampling-preview.d.ts +0 -9
  73. package/lib/containers/_v2/_forms/create-sampling-rule-form/styled.d.ts +0 -5
  74. package/lib/containers/_v2/_forms/create-sampling-rule-form/types.d.ts +0 -54
  75. package/lib/containers/_v2/_forms/edit-auto-rule-form/context.d.ts +0 -21
  76. package/lib/containers/_v2/_forms/edit-auto-rule-form/index.d.ts +0 -3
  77. package/lib/containers/_v2/_forms/edit-cost-reduction-auto-rule-form/context.d.ts +0 -21
  78. package/lib/containers/_v2/_forms/edit-cost-reduction-auto-rule-form/index.d.ts +0 -3
  79. package/lib/containers/_v2/_forms/edit-highly-relevant-auto-rule-form/context.d.ts +0 -14
  80. package/lib/containers/_v2/_forms/edit-highly-relevant-auto-rule-form/index.d.ts +0 -3
  81. package/lib/containers/_v2/_forms/view-sampling-rule-form/context.d.ts +0 -37
  82. package/lib/containers/_v2/_forms/view-sampling-rule-form/index.d.ts +0 -3
  83. package/lib/containers/_v2/_forms/view-sampling-rule-form/reverse-converters.d.ts +0 -3
  84. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/duration-errors.d.ts +0 -6
  85. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/operation-details.d.ts +0 -6
  86. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/percentage.d.ts +0 -6
  87. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/rule-info.d.ts +0 -6
  88. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/sampling-preview.d.ts +0 -6
  89. package/lib/containers/_v2/_forms/view-sampling-rule-form/sections/source-scopes.d.ts +0 -6
  90. /package/lib/containers/_v2/{_forms/view-sampling-rule-form/footer.d.ts → _drawers/sampling-rule-drawer/view-footer.d.ts} +0 -0
@@ -3,12 +3,22 @@ export interface AutocompleteOption {
3
3
  id: string;
4
4
  label: string;
5
5
  }
6
- export interface AutocompleteProps {
6
+ interface BaseAutocompleteProps {
7
7
  'data-id'?: string;
8
8
  options: AutocompleteOption[];
9
- value: string;
10
- onSelect: (option: AutocompleteOption | null) => void;
11
9
  placeholder?: string;
12
10
  isLoading?: boolean;
13
11
  }
12
+ interface SingleAutocompleteProps extends BaseAutocompleteProps {
13
+ multiple?: false;
14
+ value: string;
15
+ onSelect: (option: AutocompleteOption | null) => void;
16
+ }
17
+ interface MultiAutocompleteProps extends BaseAutocompleteProps {
18
+ multiple: true;
19
+ value: string[];
20
+ onSelect: (selectedIds: string[]) => void;
21
+ }
22
+ export type AutocompleteProps = SingleAutocompleteProps | MultiAutocompleteProps;
14
23
  export declare const Autocomplete: FC<AutocompleteProps>;
24
+ export {};
@@ -1,9 +1,11 @@
1
1
  import { type FC } from 'react';
2
2
  import type { SVG } from '@/types';
3
+ import { type ToggleProps } from '../../toggle';
3
4
  export interface HeaderProps {
4
5
  icon?: SVG;
5
6
  title?: string;
6
7
  subTitle?: string;
8
+ toggleProps?: ToggleProps;
7
9
  actions?: [];
8
10
  onClose?: () => void;
9
11
  onCloseDisabled?: boolean;
@@ -25,6 +25,7 @@ export interface DropDataProps {
25
25
  items: (DropDataOption | null)[];
26
26
  selectedIds: DropDataOption['id'][];
27
27
  setSelectedIds: (ids: DropDataOption['id'][]) => void;
28
+ label?: string;
28
29
  withMultiSelect?: boolean;
29
30
  withSearch?: boolean;
30
31
  fullWidth?: boolean;
@@ -29,6 +29,7 @@ export * from './stepper';
29
29
  export * from './table';
30
30
  export * from './tag';
31
31
  export * from './textarea';
32
+ export * from './time-input';
32
33
  export * from './toggle';
33
34
  export * from './typography';
34
35
  export * from './warning-modal';
@@ -0,0 +1,24 @@
1
+ import { type FC, type CSSProperties } from 'react';
2
+ import { type FieldMessageProps } from '../field-message';
3
+ import type { BadgeProps } from '../badge';
4
+ export interface TimeUnit {
5
+ id: string;
6
+ label: string;
7
+ }
8
+ export declare const DEFAULT_TIME_UNITS: TimeUnit[];
9
+ export interface TimeInputProps extends FieldMessageProps {
10
+ name: string;
11
+ label?: string;
12
+ tooltip?: string;
13
+ badge?: BadgeProps;
14
+ placeholder?: string;
15
+ required?: boolean;
16
+ disabled?: boolean;
17
+ value: string | null | undefined;
18
+ setValue: (value: string) => void;
19
+ units?: TimeUnit[];
20
+ defaultUnit?: string;
21
+ hasError?: boolean;
22
+ width?: CSSProperties['width'];
23
+ }
24
+ export declare const TimeInput: FC<TimeInputProps>;
@@ -1 +1 @@
1
- export{aE as Autocomplete,a0 as Badge,q as Button,B as ButtonSize,fu as ButtonTab,fv as ButtonTabList,a as ButtonVariants,d as Checkbox,fw as CheckboxList,aG as CheckboxSize,bY as CliCommand,bK as DataCard,br as Drawer,as as DropData,bJ as DropDataAlignX,bI as DropDataAlignY,bj as DropDown,j as FieldMessage,i as FieldTitle,fx as Header,e7 as HoverActions,be as IconButton,bf as IconButtonSize,I as Input,p as InputList,m as InputTable,bU as Island,bg as Loader,fy as Modal,fz as Navbar,N as NoData,P as Note,am as Radio,fA as RadioGroup,fB as RadioSize,e1 as Search,S as SectionCard,fC as SectionCardSize,x as Segment,ae as SegmentSize,cc as SegmentVariant,c0 as StatusCard,bV as Stepper,bS as Table,bT as TableVariant,fD as Tag,y as TextArea,c1 as TextCard,n as Toggle,o as ToggleLabelAlign,fE as ToggleList,aP as ToggleSize,fF as ToggleVariant,T as Typography,e as TypographySize,bn as TypographyVariants,cd as WarningModal}from"../chunks/ui-components-CI2PiWkX.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{eR as Autocomplete,a0 as Badge,q as Button,B as ButtonSize,g3 as ButtonTab,g4 as ButtonTabList,a as ButtonVariants,d as Checkbox,g5 as CheckboxList,eT as CheckboxSize,bg as CliCommand,g6 as DEFAULT_TIME_UNITS,b6 as DataCard,aW as Drawer,b3 as DropData,b5 as DropDataAlignX,b4 as DropDataAlignY,av as DropDown,j as FieldMessage,i as FieldTitle,g7 as Header,dL as HoverActions,aq as IconButton,ar as IconButtonSize,I as Input,p as InputList,m as InputTable,bc as Island,as as Loader,g8 as Modal,g9 as Navbar,N as NoData,P as Note,eb as Radio,ga as RadioGroup,gb as RadioSize,dF as Search,S as SectionCard,gc as SectionCardSize,x as Segment,aw as SegmentSize,bN as SegmentVariant,bk as StatusCard,bd as Stepper,ba as Table,bb as TableVariant,gd as Tag,y as TextArea,bl as TextCard,d$ as TimeInput,n as Toggle,o as ToggleLabelAlign,ge as ToggleList,aA as ToggleSize,a$ as ToggleVariant,T as Typography,e as TypographySize,aB as TypographyVariants,bQ as WarningModal}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";
package/lib/components.js CHANGED
@@ -1 +1 @@
1
- export{cQ as AutocompleteInput,d8 as Badge,da as Button,cD as CancelWarning,b as CenterThis,cl as Checkbox,C as Code,cH as ConditionDetails,cI as DataCard,cj as DataCardFieldTypes,dO as DataCardFields,ff as DataFinger,dc as DataTab,cC as DeleteWarning,e5 as DescribeRow,D as Divider,cw as DocsButton,cB as Drawer,fg as DrawerFooter,fh as DrawerHeader,dy as Dropdown,fi as ErrorBoundary,dF as ExtendArrow,bX as FadeLoader,cm as FieldError,ck as FieldLabel,F as FlexColumn,c as FlexRow,fj as Header,cs as IconButton,ef as IconGroup,d2 as IconTitleBadge,cZ as IconWrapped,e0 as IconsNav,fk as ImageControlled,cn as Input,cr as InputList,co as InputTable,d5 as InteractiveTable,cq as KeyValueInputsList,fl as LoadingText,cN as Modal,cO as ModalBody,cx as MonitorsCheckboxes,c$ as MonitorsIcons,cR as NavigationButtons,d6 as NoDataFound,cP as NotificationNote,fm as Overlay,bx as Padding,bR as PageContent,dt as Popup,eh as PopupForm,em as ScrollX,dg as ScrollY,cv as SectionTitle,cu as Segment,dv as SelectionButton,dk as SkeletonLoader,cT as Status,dN as Stepper,fn as TabList,d0 as TableContainer,d1 as TableTitleWrap,d4 as TableWrap,dQ as Tag,cz as Text,cy as TextArea,cp as Toggle,ek as ToggleCodeComponent,V as Tooltip,d7 as TraceLoader,c3 as UpgradeRequiredWrapper,du as VerticalScroll,dT as WarningModal,fo as getLinksFromText,fp as getStrongsFromText,fq as renderText}from"./chunks/ui-components-CI2PiWkX.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{cr as AutocompleteInput,cL as Badge,cN as Button,ce as CancelWarning,b as CenterThis,bY as Checkbox,C as Code,ci as ConditionDetails,cj as DataCard,bW as DataCardFieldTypes,dp as DataCardFields,fQ as DataFinger,cP as DataTab,cd as DeleteWarning,dJ as DescribeRow,D as Divider,c7 as DocsButton,cc as Drawer,fR as DrawerFooter,fS as DrawerHeader,d8 as Dropdown,fT as ErrorBoundary,df as ExtendArrow,bf as FadeLoader,bZ as FieldError,bX as FieldLabel,F as FlexColumn,c as FlexRow,fU as Header,c3 as IconButton,dT as IconGroup,cF as IconTitleBadge,cA as IconWrapped,dD as IconsNav,fV as ImageControlled,b_ as Input,c2 as InputList,b$ as InputTable,cI as InteractiveTable,c1 as KeyValueInputsList,fW as LoadingText,co as Modal,cp as ModalBody,c8 as MonitorsCheckboxes,cC as MonitorsIcons,cs as NavigationButtons,cJ as NoDataFound,cq as NotificationNote,fX as Overlay,aY as Padding,b9 as PageContent,d3 as Popup,dV as PopupForm,d_ as ScrollX,cT as ScrollY,c6 as SectionTitle,c5 as Segment,d5 as SelectionButton,cX as SkeletonLoader,cu as Status,dn as Stepper,fY as TabList,cD as TableContainer,cE as TableTitleWrap,cH as TableWrap,dr as Tag,ca as Text,c9 as TextArea,c0 as Toggle,dY as ToggleCodeComponent,V as Tooltip,cK as TraceLoader,bn as UpgradeRequiredWrapper,d4 as VerticalScroll,du as WarningModal,fZ as getLinksFromText,f_ as getStrongsFromText,f$ as renderText}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,4 +1,4 @@
1
- import type { SamplingRuleCategory } from '@/containers/_v2/sampling-rules/types';
1
+ import type { SamplingRuleCategory } from '@/types';
2
2
  export declare const BTN_CANCEL = "Cancel";
3
3
  export declare const BTN_SAVE = "Save";
4
4
  export declare const BTN_EDIT_RULE = "Edit rule";
@@ -9,6 +9,7 @@ export declare const BTN_SAVE_RULE = "Save";
9
9
  export declare const LABEL_RULE_NAME = "Rule name";
10
10
  export declare const LABEL_RULE_TYPE = "Rule type";
11
11
  export declare const LABEL_RULE_ENABLED = "Rule Enabled";
12
+ export declare const LABEL_RULE_DISABLED = "Rule Disabled";
12
13
  export declare const LABEL_NOTE = "Note";
13
14
  export declare const LABEL_HTTP_ROUTE = "HTTP route";
14
15
  export declare const LABEL_METHOD = "Method";
@@ -53,6 +54,7 @@ export declare const PLACEHOLDER_SEARCH_SOURCE = "Search source name";
53
54
  export declare const PLACEHOLDER_SERVER_ADDRESS = "e.g. collector.my.vendor.com";
54
55
  export declare const TOOLTIP_NOTE = "Optional notes (not used by the system). Add any context or details for this sampling rule.";
55
56
  export declare const NOTE_ENTIRE_CLUSTER = "Rule will apply to all sources in the cluster";
57
+ export declare const NOTE_SOURCE_SCOPE_LOGIC = "If multiple source scopes are set, they must all match simultaneously.";
56
58
  export declare const ALL_SOURCES = "All sources";
57
59
  export declare const EMPTY_VALUE = "-";
58
60
  export declare const FILTER_TYPE_ALL = "All";
@@ -75,11 +77,14 @@ export declare const SAMPLING_AUTO_RULE_TITLE = "Kubernetes Health Probes";
75
77
  export declare const SAMPLING_HIGHLY_RELEVANT_AUTO_RULE_TITLE = "Keep All Error Traces";
76
78
  export declare const SAMPLING_COST_REDUCTION_AUTO_RULE_TITLE = "Drop Traces Cluster-Wide";
77
79
  export declare const SAMPLING_DUPLICATE_RULE_WARNING = "A rule with the same matching conditions already exists.";
78
- export declare const EDIT_NOISY_AUTO_RULE_DRAWER_TITLE = "Edit 'Noisy Operation' auto rule";
80
+ export declare const CREATE_NOISY_AUTO_RULE_DRAWER_TITLE = "Create 'Noisy Operation Kubernetes Health Probes' rule";
81
+ export declare const EDIT_NOISY_AUTO_RULE_DRAWER_TITLE = "Edit 'Noisy Operation Kubernetes Health Probes' rule";
79
82
  export declare const EDIT_NOISY_AUTO_RULE_DRAWER_SUBTITLE = "Automatically detect and sample health probe traces across the cluster.";
80
- export declare const EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE = "Edit 'Highly Relevant' auto rule";
83
+ export declare const CREATE_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE = "Create 'Highly Relevant Operations' rule";
84
+ export declare const EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE = "Edit 'Highly Relevant Operations' rule";
81
85
  export declare const EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_SUBTITLE = "Automatically keep all error traces across the entire cluster.";
82
- export declare const EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE = "Edit 'Cost Reduction' auto rule";
86
+ export declare const CREATE_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE = "Create 'Cost Reduction' rule";
87
+ export declare const EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE = "Edit 'Cost Reduction' rule";
83
88
  export declare const EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_SUBTITLE = "Automatically drop a percentage of traces across the entire cluster.";
84
89
  export declare const CATEGORY_DESCRIPTIONS: Record<SamplingRuleCategory, string>;
85
90
  export declare const CATEGORY_TITLES: Record<SamplingRuleCategory, string>;
@@ -2,6 +2,7 @@ import type { DropdownOption } from '@/components';
2
2
  import { OtelDistroName, ProgrammingLanguages } from '@/types';
3
3
  export declare const DISPLAY_LANGUAGES: Record<ProgrammingLanguages, string>;
4
4
  export declare const LANGUAGE_OPTIONS: DropdownOption<ProgrammingLanguages>[];
5
+ export declare const OPENTELEMETRY_EBPF_DISTRO_OPTION: DropdownOption<OtelDistroName>;
5
6
  export declare const OTEL_DISTRO_NAME_OPTIONS: Record<ProgrammingLanguages, {
6
7
  community: DropdownOption<OtelDistroName>[];
7
8
  enterprise: DropdownOption<OtelDistroName>[];
package/lib/constants.js CHANGED
@@ -1 +1 @@
1
- export{bb as ACTION_ATTRIBUTE_OPTIONS,cG as ACTION_OPTIONS,bc as ACTION_SAMPLER_OPTIONS,f1 as ALL_SOURCES,bs as BTN_CANCEL,bt as BTN_CREATE_RULE,bN as BTN_DELETE_RULE,aQ as BTN_EDIT_AUTO_RULE,bM as BTN_EDIT_RULE,by as BTN_SAVE,bL as BTN_SAVE_RULE,bQ as BUTTON_TEXTS,bu as CATEGORY_DESCRIPTIONS,aV as CATEGORY_LABELS,bv as CATEGORY_TITLES,a5 as DEFAULT_CLUSTER_ID,a4 as DEFAULT_CLUSTER_NAME,dE as DEFAULT_DATA_STREAM_NAME,av as DESC_DROP_PERCENTAGE,aI as DESC_DURATION,aM as DESC_ERRORS,au as DESC_KEEP_PERCENTAGE,ai as DESC_OPERATION,aB as DESC_SOURCE_SCOPE,bh as DESTINATION_CATEGORIES,a1 as DISPLAY_LANGUAGES,bd as DISPLAY_TITLES,w as DOCS_BASE_URL,G as DestinationCategoryTypes,bD as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_SUBTITLE,bE as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,bB as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_SUBTITLE,bC as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,bz as EDIT_NOISY_AUTO_RULE_DRAWER_SUBTITLE,bA as EDIT_NOISY_AUTO_RULE_DRAWER_TITLE,bO as EDIT_TITLES,aU as EMPTY_VALUE,c5 as FILTER_TYPE_ALL,O as FORM_ALERTS,bl as INSTRUMENTATION_RULE_OPTIONS,aL as LABEL_CUSTOM_DURATION,aA as LABEL_CUSTOM_PERCENTAGE,c4 as LABEL_DISABLED_RULE,aY as LABEL_DROP_ALL,ba as LABEL_DROP_AT_MOST,ax as LABEL_DROP_PERCENTAGE,ap as LABEL_HTTP_ROUTE,ar as LABEL_HTTP_ROUTE_PREFIX,at as LABEL_KAFKA_TOPIC,aZ as LABEL_KEEP_ALL,ay as LABEL_KEEP_AT_LEAST,az as LABEL_KEEP_AT_MOST,aw as LABEL_KEEP_PERCENTAGE,aK as LABEL_KEEP_TRACES_DURATION,aO as LABEL_KEEP_TRACES_ERRORS,aW as LABEL_METHOD,ah as LABEL_NOTE,aR as LABEL_NO_PREVIEW,a$ as LABEL_OPERATION_TYPE,b5 as LABEL_RULE_ENABLED,ac as LABEL_RULE_NAME,ad as LABEL_RULE_TYPE,aX as LABEL_SAMPLE,al as LABEL_SERVER_ADDRESS,ao as LABEL_TEMPLATED_PATH,aq as LABEL_TEMPLATED_PATH_PREFIX,f2 as LANGUAGE_OPTIONS,dz as MONITORS_OPTIONS,aD as NOTE_ENTIRE_CLUSTER,b1 as OPERATION_ALL,b0 as OPERATION_HTTP_CLIENT,a_ as OPERATION_HTTP_SERVER,b2 as OPERATION_KAFKA_CONSUMER,b3 as OPERATION_KAFKA_PRODUCER,f3 as OTEL_DISTRO_NAME_OPTIONS,af as PLACEHOLDER_NOTE,an as PLACEHOLDER_ROUTE,ab as PLACEHOLDER_RULE_NAME,aF as PLACEHOLDER_SEARCH_SOURCE,ak as PLACEHOLDER_SERVER_ADDRESS,b4 as SAMPLING_AUTO_RULE_TITLE,c9 as SAMPLING_BTN_CREATE_RULE,c7 as SAMPLING_BTN_DOCS,c8 as SAMPLING_BTN_REFRESH,b8 as SAMPLING_COST_REDUCTION_AUTO_RULE_TITLE,cf as SAMPLING_DELETE_MODAL_APPROVE,ce as SAMPLING_DELETE_MODAL_CANCEL,cg as SAMPLING_DELETE_MODAL_DESCRIPTION,ch as SAMPLING_DELETE_MODAL_TITLE,bw as SAMPLING_DRAWER_WIDTH,c6 as SAMPLING_DUPLICATE_RULE_WARNING,b7 as SAMPLING_HIGHLY_RELEVANT_AUTO_RULE_TITLE,ca as SAMPLING_PAGE_DESCRIPTION,cb as SAMPLING_PAGE_TITLE,b9 as SECTION_DROP_PERCENTAGE,aJ as SECTION_DURATION,aN as SECTION_ERRORS,b6 as SECTION_KEEP_PERCENTAGE,aj as SECTION_OPERATION,aS as SECTION_SAMPLING_PREVIEW,aC as SECTION_SOURCE_SCOPE,dA as STORAGE_KEYS,f4 as TOKEN_ABOUT_TO_EXPIRE,ag as TOOLTIP_NOTE,aT as UNNAMED_RULE}from"./chunks/ui-components-CI2PiWkX.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{an as ACTION_ATTRIBUTE_OPTIONS,ch as ACTION_OPTIONS,ao as ACTION_SAMPLER_OPTIONS,fy as ALL_SOURCES,aF as BTN_CANCEL,aN as BTN_CREATE_RULE,aI as BTN_DELETE_RULE,eE as BTN_EDIT_AUTO_RULE,aH as BTN_EDIT_RULE,aV as BTN_SAVE,aG as BTN_SAVE_RULE,b8 as BUTTON_TEXTS,aK as CATEGORY_DESCRIPTIONS,eC as CATEGORY_LABELS,aO as CATEGORY_TITLES,fz as CREATE_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,fA as CREATE_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,fB as CREATE_NOISY_AUTO_RULE_DRAWER_TITLE,a5 as DEFAULT_CLUSTER_ID,a4 as DEFAULT_CLUSTER_NAME,de as DEFAULT_DATA_STREAM_NAME,af as DESC_DROP_PERCENTAGE,e5 as DESC_DURATION,e4 as DESC_ERRORS,aj as DESC_KEEP_PERCENTAGE,e8 as DESC_OPERATION,eP as DESC_SOURCE_SCOPE,at as DESTINATION_CATEGORIES,a1 as DISPLAY_LANGUAGES,ap as DISPLAY_TITLES,w as DOCS_BASE_URL,G as DestinationCategoryTypes,aR as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_SUBTITLE,aS as EDIT_COST_REDUCTION_AUTO_RULE_DRAWER_TITLE,aP as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_SUBTITLE,aQ as EDIT_HIGHLY_RELEVANT_AUTO_RULE_DRAWER_TITLE,aT as EDIT_NOISY_AUTO_RULE_DRAWER_SUBTITLE,aU as EDIT_NOISY_AUTO_RULE_DRAWER_TITLE,aL as EDIT_TITLES,el as EMPTY_VALUE,bq as FILTER_TYPE_ALL,O as FORM_ALERTS,ay as INSTRUMENTATION_RULE_OPTIONS,e6 as LABEL_CUSTOM_DURATION,am as LABEL_CUSTOM_PERCENTAGE,bp as LABEL_DISABLED_RULE,eu as LABEL_DROP_ALL,ae as LABEL_DROP_AT_MOST,er as LABEL_DROP_PERCENTAGE,ee as LABEL_HTTP_ROUTE,eg as LABEL_HTTP_ROUTE_PREFIX,ei as LABEL_KAFKA_TOPIC,ev as LABEL_KEEP_ALL,ai as LABEL_KEEP_AT_LEAST,es as LABEL_KEEP_AT_MOST,eq as LABEL_KEEP_PERCENTAGE,e3 as LABEL_KEEP_TRACES_DURATION,e1 as LABEL_KEEP_TRACES_ERRORS,eh as LABEL_METHOD,ey as LABEL_NOTE,eM as LABEL_NO_PREVIEW,ek as LABEL_OPERATION_TYPE,a_ as LABEL_RULE_DISABLED,aZ as LABEL_RULE_ENABLED,ew as LABEL_RULE_NAME,ex as LABEL_RULE_TYPE,et as LABEL_SAMPLE,ea as LABEL_SERVER_ADDRESS,ed as LABEL_TEMPLATED_PATH,ef as LABEL_TEMPLATED_PATH_PREFIX,fC as LANGUAGE_OPTIONS,d9 as MONITORS_OPTIONS,eO as NOTE_ENTIRE_CLUSTER,eQ as NOTE_SOURCE_SCOPE_LOGIC,fD as OPENTELEMETRY_EBPF_DISTRO_OPTION,en as OPERATION_ALL,em as OPERATION_HTTP_CLIENT,ej as OPERATION_HTTP_SERVER,eo as OPERATION_KAFKA_CONSUMER,ep as OPERATION_KAFKA_PRODUCER,fE as OTEL_DISTRO_NAME_OPTIONS,eA as PLACEHOLDER_NOTE,ec as PLACEHOLDER_ROUTE,ez as PLACEHOLDER_RULE_NAME,eS as PLACEHOLDER_SEARCH_SOURCE,e9 as PLACEHOLDER_SERVER_ADDRESS,al as SAMPLING_AUTO_RULE_TITLE,bJ as SAMPLING_BTN_CREATE_RULE,bH as SAMPLING_BTN_DOCS,bI as SAMPLING_BTN_REFRESH,ah as SAMPLING_COST_REDUCTION_AUTO_RULE_TITLE,bS as SAMPLING_DELETE_MODAL_APPROVE,bR as SAMPLING_DELETE_MODAL_CANCEL,bT as SAMPLING_DELETE_MODAL_DESCRIPTION,bU as SAMPLING_DELETE_MODAL_TITLE,aX as SAMPLING_DRAWER_WIDTH,bG as SAMPLING_DUPLICATE_RULE_WARNING,ad as SAMPLING_HIGHLY_RELEVANT_AUTO_RULE_TITLE,bK as SAMPLING_PAGE_DESCRIPTION,bL as SAMPLING_PAGE_TITLE,ag as SECTION_DROP_PERCENTAGE,e2 as SECTION_DURATION,e0 as SECTION_ERRORS,ak as SECTION_KEEP_PERCENTAGE,e7 as SECTION_OPERATION,eL as SECTION_SAMPLING_PREVIEW,eN as SECTION_SOURCE_SCOPE,da as STORAGE_KEYS,fF as TOKEN_ABOUT_TO_EXPIRE,eB as TOOLTIP_NOTE,aM as UNNAMED_RULE}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";
@@ -2,10 +2,6 @@ export * from './add-action-drawer';
2
2
  export * from './add-destination-drawer';
3
3
  export * from './add-rule-drawer';
4
4
  export * from './add-source-drawer';
5
- export * from './create-sampling-rule-drawer';
6
- export * from './edit-auto-rule-drawer';
7
- export * from './edit-highly-relevant-auto-rule-drawer';
8
- export * from './edit-cost-reduction-auto-rule-drawer';
9
5
  export * from './edit-config-drawer';
6
+ export * from './sampling-rule-drawer';
10
7
  export * from './system-drawer';
11
- export * from './view-sampling-rule-drawer';
@@ -0,0 +1,50 @@
1
+ import { type FC } from 'react';
2
+ import { SamplingRuleFormType } from '@/contexts';
3
+ import type { SamplingRuleCategory, SamplingRuleFormState, DuplicateValidationResult, ViewRuleData, SamplingRulesSelectOption } from '@/types';
4
+ interface DrawerCommonProps {
5
+ onClose: () => void;
6
+ }
7
+ interface DuplicateValidationProps {
8
+ validateForm?: (formState: SamplingRuleFormState) => DuplicateValidationResult | null;
9
+ onNavigateToDuplicate?: (ruleId: string) => void;
10
+ }
11
+ interface ManualFormOptionsProps {
12
+ sourceOptions?: SamplingRulesSelectOption[];
13
+ namespaceOptions?: SamplingRulesSelectOption[];
14
+ }
15
+ export interface CreateSamplingRuleDrawerProps extends DrawerCommonProps, DuplicateValidationProps, ManualFormOptionsProps {
16
+ formType: SamplingRuleFormType.Create;
17
+ isOpen: boolean;
18
+ category: SamplingRuleCategory;
19
+ onSubmit: (state: SamplingRuleFormState) => void;
20
+ }
21
+ export interface ViewSamplingRuleDrawerProps extends DrawerCommonProps, DuplicateValidationProps, ManualFormOptionsProps {
22
+ formType: SamplingRuleFormType.View;
23
+ data: ViewRuleData | null;
24
+ defaultEditMode?: boolean;
25
+ onDelete: (ruleId: string, samplingId: string) => void;
26
+ onSaveEdit: (formState: SamplingRuleFormState, ruleId: string, samplingId: string) => void;
27
+ }
28
+ export interface EditAutoNoisyDrawerProps extends DrawerCommonProps {
29
+ formType: SamplingRuleFormType.EditAutoNoisy;
30
+ isOpen: boolean;
31
+ enabled: boolean;
32
+ keepPercentage: number;
33
+ onSave: (enabled: boolean, keepPercentage: number) => void;
34
+ }
35
+ export interface EditAutoCostReductionDrawerProps extends DrawerCommonProps {
36
+ formType: SamplingRuleFormType.EditAutoCostReduction;
37
+ isOpen: boolean;
38
+ enabled: boolean;
39
+ dropPercentage: number;
40
+ onSave: (enabled: boolean, dropPercentage: number) => void;
41
+ }
42
+ export interface EditAutoHighlyRelevantDrawerProps extends DrawerCommonProps {
43
+ formType: SamplingRuleFormType.EditAutoHighlyRelevant;
44
+ isOpen: boolean;
45
+ enabled: boolean;
46
+ onSave: (enabled: boolean) => void;
47
+ }
48
+ export type SamplingRuleDrawerProps = CreateSamplingRuleDrawerProps | ViewSamplingRuleDrawerProps | EditAutoNoisyDrawerProps | EditAutoCostReductionDrawerProps | EditAutoHighlyRelevantDrawerProps;
49
+ export declare const SamplingRuleDrawer: FC<SamplingRuleDrawerProps>;
50
+ export {};
@@ -2,8 +2,4 @@ export * from './add-action-form';
2
2
  export * from './add-destination-form';
3
3
  export * from './add-rule-form';
4
4
  export * from './add-source-form';
5
- export * from './create-sampling-rule-form';
6
- export * from './view-sampling-rule-form';
7
- export * from './edit-auto-rule-form';
8
- export * from './edit-highly-relevant-auto-rule-form';
9
- export * from './edit-cost-reduction-auto-rule-form';
5
+ export * from './sampling-rule-form';
@@ -0,0 +1,2 @@
1
+ import { type FC } from 'react';
2
+ export declare const SamplingRuleForm: FC;
@@ -0,0 +1,9 @@
1
+ import type { NoisyOperationRule, HighlyRelevantOperationRule, CostReductionRule, NoisyOperationRuleInput, HighlyRelevantOperationRuleInput, CostReductionRuleInput, SamplingRuleCategory, SamplingRuleFormState, ViewRuleData } from '@/types';
2
+ export declare function getDefaultFormState(category?: SamplingRuleCategory): SamplingRuleFormState;
3
+ export declare function formStateToPartialNoisy(state: SamplingRuleFormState): NoisyOperationRule;
4
+ export declare function formStateToPartialHighlyRelevant(state: SamplingRuleFormState): HighlyRelevantOperationRule;
5
+ export declare function formStateToPartialCostReduction(state: SamplingRuleFormState): CostReductionRule;
6
+ export declare function formStateToNoisyInput(state: SamplingRuleFormState): NoisyOperationRuleInput;
7
+ export declare function formStateToHighlyRelevantInput(state: SamplingRuleFormState): HighlyRelevantOperationRuleInput;
8
+ export declare function formStateToCostReductionInput(state: SamplingRuleFormState): CostReductionRuleInput;
9
+ export declare function viewRuleDataToFormState(data: ViewRuleData): SamplingRuleFormState;
@@ -1,6 +1,6 @@
1
- import type { NoisyOperationRule, HighlyRelevantOperationRule, CostReductionRule, SourcesScopeInput, HeadSamplingOperationMatcher, TailSamplingOperationMatcher, SamplingRules } from '@/types';
2
1
  import { type ColoredSpanPart } from '@/snippets/_v2/colored-span';
3
- import type { SamplingRuleItem, SamplingRuleCategory, HighlyRelevantBadgeType, ViewRuleData } from './types';
2
+ import type { SamplingRuleItem, SamplingRuleCategory, HighlyRelevantBadgeType, ViewRuleData } from '@/types';
3
+ import type { NoisyOperationRule, HighlyRelevantOperationRule, CostReductionRule, SourcesScopeInput, HeadSamplingOperationMatcher, TailSamplingOperationMatcher, SamplingRules } from '@/types';
4
4
  export declare enum SamplingCategory {
5
5
  Noisy = "noisy",
6
6
  HighlyRelevant = "highly-relevant",
@@ -1,5 +1,5 @@
1
1
  import { type FC, type CSSProperties } from 'react';
2
- import type { SamplingRuleItem } from '../types';
2
+ import type { SamplingRuleItem } from '@/types';
3
3
  export interface RulesTableProps {
4
4
  title: string;
5
5
  items: SamplingRuleItem[];
@@ -1,5 +1,5 @@
1
1
  import { type FC } from 'react';
2
- import type { TypeFilter } from '../types';
2
+ import type { TypeFilter } from '@/types';
3
3
  export interface ListToolbarProps {
4
4
  title: string;
5
5
  titleTooltip?: string;
@@ -1,19 +1,5 @@
1
1
  import type { CSSProperties } from 'react';
2
- import type { ColoredSpanPart } from '@/snippets/_v2';
3
- import type { CostReductionRuleInput, HighlyRelevantOperationRuleInput, NoisyOperationRule, HighlyRelevantOperationRule, CostReductionRule, NoisyOperationRuleInput, SamplingRules, WorkloadId } from '@/types';
4
- export type SamplingRuleCategory = 'noisy' | 'highlyRelevant' | 'costReduction';
5
- export type HighlyRelevantBadgeType = 'Relevance' | 'Duration' | 'Error';
6
- export interface SamplingRuleItem {
7
- ruleId: string;
8
- samplingId: string;
9
- name: string | null;
10
- disabled: boolean;
11
- notes: string | null;
12
- summary: ColoredSpanPart[];
13
- category: SamplingRuleCategory;
14
- typeBadge?: HighlyRelevantBadgeType;
15
- }
16
- export type TypeFilter = 'all' | HighlyRelevantBadgeType;
2
+ import type { CostReductionRuleInput, HighlyRelevantOperationRuleInput, NoisyOperationRuleInput, SamplingRules, WorkloadId, SamplingRuleCategory, SamplingRuleItem, SamplingRulesK8sHealthConfig } from '@/types';
17
3
  export interface SamplingRulesListProps {
18
4
  title: string;
19
5
  titleTooltip?: string;
@@ -24,32 +10,6 @@ export interface SamplingRulesListProps {
24
10
  onEditRule: (ruleId: string, samplingId: string) => void;
25
11
  onDeleteRule: (ruleId: string, samplingId: string) => void;
26
12
  }
27
- interface BaseViewRule {
28
- samplingId: string;
29
- summary: ColoredSpanPart[];
30
- }
31
- interface ViewNoisyRule extends BaseViewRule {
32
- category: Extract<SamplingRuleCategory, 'noisy'>;
33
- rule: NoisyOperationRule;
34
- }
35
- interface ViewHighlyRelevantRule extends BaseViewRule {
36
- category: Extract<SamplingRuleCategory, 'highlyRelevant'>;
37
- rule: HighlyRelevantOperationRule;
38
- }
39
- interface ViewCostReductionRule extends BaseViewRule {
40
- category: Extract<SamplingRuleCategory, 'costReduction'>;
41
- rule: CostReductionRule;
42
- }
43
- export type ViewRuleData = ViewNoisyRule | ViewHighlyRelevantRule | ViewCostReductionRule;
44
- export interface SamplingRulesSelectOption {
45
- id: string;
46
- label: string;
47
- }
48
- /** Matches effective k8s health-probes sampling config from the API. */
49
- export interface SamplingRulesK8sHealthConfig {
50
- enabled: boolean | null;
51
- keepPercentage: number | null;
52
- }
53
13
  export interface SamplingRulesProps {
54
14
  workloads: {
55
15
  id: WorkloadId;
@@ -69,4 +29,3 @@ export interface SamplingRulesProps {
69
29
  updateK8sHealthProbesConfig: (enabled: boolean, keepPercentage: number) => void;
70
30
  docsUrl?: string;
71
31
  }
72
- export {};
@@ -1,5 +1,5 @@
1
1
  import { type FC } from 'react';
2
- import type { Source } from '@/types';
2
+ import { type Source } from '@/types';
3
3
  interface SourceIdentifier {
4
4
  namespace: string;
5
5
  kind: string;