@devtron-labs/devtron-fe-common-lib 1.20.6-pre-38 → 1.20.6-pre-39

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 (26) hide show
  1. package/dist/{@code-editor-L8xbBPsz.js → @code-editor-DBuop1Nw.js} +7145 -7097
  2. package/dist/{@common-rjsf-CW-p2vUB.js → @common-rjsf-Mldh3D5a.js} +1 -1
  3. package/dist/Common/Constants.d.ts +3 -0
  4. package/dist/Pages-Devtron-2.0/InfrastructureManagement/index.d.ts +0 -1
  5. package/dist/Pages-Devtron-2.0/SecurityCenter/Shared/SecurityCenterIcon/SecurityCenterIcon.d.ts +1 -0
  6. package/dist/Pages-Devtron-2.0/SecurityCenter/Shared/SecurityCenterIcon/index.d.ts +1 -0
  7. package/dist/Pages-Devtron-2.0/SecurityCenter/Shared/SecurityCenterIcon/utils.d.ts +6 -0
  8. package/dist/Pages-Devtron-2.0/SecurityCenter/Shared/index.d.ts +1 -0
  9. package/dist/Pages-Devtron-2.0/SecurityCenter/index.d.ts +1 -1
  10. package/dist/Pages-Devtron-2.0/index.d.ts +1 -0
  11. package/dist/Shared/Components/Charts/Chart.component.d.ts +25 -6
  12. package/dist/Shared/Components/Charts/index.d.ts +1 -1
  13. package/dist/Shared/Components/Charts/plugins.d.ts +2 -1
  14. package/dist/Shared/Components/Charts/types.d.ts +18 -6
  15. package/dist/Shared/Components/Icon/Icon.d.ts +3 -0
  16. package/dist/Shared/Components/Security/constants.d.ts +2 -0
  17. package/dist/Shared/Components/Security/index.d.ts +1 -0
  18. package/dist/assets/ic-security-fixable.168b5bf8.svg +12 -0
  19. package/dist/assets/ic-security-not-fixable.be099f65.svg +12 -0
  20. package/dist/assets/ic-security-vulnerability.c954b87a.svg +4 -0
  21. package/dist/index.js +1016 -993
  22. package/package.json +1 -1
  23. package/dist/Pages-Devtron-2.0/InfrastructureManagement/Overview/Overview.d.ts +0 -1
  24. package/dist/Pages-Devtron-2.0/InfrastructureManagement/Overview/index.d.ts +0 -1
  25. package/dist/Pages-Devtron-2.0/SecurityCenter/Overview/Overview.d.ts +0 -1
  26. package/dist/Pages-Devtron-2.0/SecurityCenter/Overview/index.d.ts +0 -1
@@ -1,7 +1,7 @@
1
1
  import { j as n, aK as v, aM as J, aL as K } from "./@vendor-DEAetXNs.js";
2
2
  import V, { useState as q, useEffect as Y, forwardRef as G, useMemo as E } from "react";
3
3
  import z, { getDefaultRegistry as Q } from "@rjsf/core";
4
- import { T as O, j as F, c as S, b as N, S as X, i as Z, g as ee, a as te, d as R, e as ne } from "./@code-editor-L8xbBPsz.js";
4
+ import { T as O, j as F, c as S, b as N, S as X, i as Z, g as ee, a as te, d as R, e as ne } from "./@code-editor-DBuop1Nw.js";
5
5
  import { getUiOptions as B, getTemplate as $, getSubmitButtonOptions as re, ADDITIONAL_PROPERTY_FLAG as L, errorId as se, englishStringTranslator as ae, TranslatableString as oe, titleId as le, canExpand as ie, deepEquals as ce } from "@rjsf/utils";
6
6
  import { ReactComponent as de } from "./assets/ic-add.cfaa779b.svg";
7
7
  import { ReactComponent as ue } from "./assets/ic-warning.ecf7ff97.svg";
@@ -85,6 +85,9 @@ export declare const URLS: {
85
85
  readonly COST_BREAKDOWN_DETAIL: ":itemName/:view/:detail?";
86
86
  readonly COST_CONFIGURATIONS: "/cost-visibility/configurations";
87
87
  readonly SECURITY_CENTER: "/security-center";
88
+ readonly SECURITY_CENTER_OVERVIEW: "/security-center/overview";
89
+ readonly SECURITY_CENTER_SCANS: "/security-center/scans";
90
+ readonly SECURITY_CENTER_POLICIES: "/security-center/policies";
88
91
  readonly AUTOMATION_AND_ENABLEMENT: "/automation-and-enablement";
89
92
  readonly AUTOMATION_AND_ENABLEMENT_JOB: "/automation-and-enablement/job";
90
93
  readonly DATA_PROTECTION: "/data-protection-management";
@@ -1,2 +1 @@
1
- export * from './Overview';
2
1
  export * from './Shared';
@@ -0,0 +1 @@
1
+ export declare const SecurityCenterIcon: () => JSX.Element;
@@ -0,0 +1 @@
1
+ export { getSecurityCenterBreadcrumb } from './utils';
@@ -0,0 +1,6 @@
1
+ export declare const getSecurityCenterBreadcrumb: () => {
2
+ 'security-center': {
3
+ component: JSX.Element;
4
+ linked: boolean;
5
+ };
6
+ };
@@ -0,0 +1 @@
1
+ export * from './SecurityCenterIcon';
@@ -1 +1 @@
1
- export * from './Overview';
1
+ export * from './Shared';
@@ -2,3 +2,4 @@ export * from './ApplicationManagement';
2
2
  export * from './CostVisibility';
3
3
  export * from './DataProtectionManagement';
4
4
  export * from './InfrastructureManagement';
5
+ export * from './SecurityCenter';
@@ -1,7 +1,7 @@
1
1
  import { ChartProps } from './types';
2
2
  /**
3
3
  * A versatile Chart component that renders different types of charts using Chart.js.
4
- * Supports area charts, pie charts, stacked bar charts (vertical/horizontal), and line charts.
4
+ * Supports area charts, pie charts, semi-pie charts, stacked bar charts (vertical/horizontal), and line charts.
5
5
  *
6
6
  * The component automatically adapts to theme changes and provides consistent styling
7
7
  * across all chart types. Colors are provided by the user through the CHART_COLORS constant
@@ -29,7 +29,24 @@ import { ChartProps } from './types';
29
29
  * datasets={{
30
30
  * datasetName: 'Adoption Rate (%)',
31
31
  * yAxisValues: [45.2, 28.7, 35.4],
32
- * backgroundColor: ['SkyBlue300', 'AquaTeal400', 'LavenderPurple300']
32
+ * colors: ['SkyBlue300', 'AquaTeal400', 'LavenderPurple300']
33
+ * }}
34
+ * />
35
+ *
36
+ * [Semi-Pie Chart Example with Center Text]
37
+ * <Chart
38
+ * id="performance-metrics"
39
+ * type="semiPie"
40
+ * xAxisLabels={['Good', 'Average', 'Poor']}
41
+ * datasets={{
42
+ * datasetName: 'Performance Score (%)',
43
+ * yAxisValues: [65, 25, 10],
44
+ * colors: ['LimeGreen500', 'GoldenYellow400', 'CoralRed400']
45
+ * }}
46
+ * centerText={{
47
+ * text: '85%',
48
+ * fontSize: 24,
49
+ * fontWeight: '600'
33
50
  * }}
34
51
  * />
35
52
  *
@@ -66,9 +83,9 @@ import { ChartProps } from './types';
66
83
  * ```
67
84
  *
68
85
  * @param id - Unique identifier for the chart canvas element
69
- * @param type - Chart type: 'area', 'pie', 'stackedBar', 'stackedBarHorizontal', or 'line'
70
- * @param xAxisLabels - Array of labels for the x-axis (or categories for pie charts)
71
- * @param datasets - Chart data: array of datasets for most charts, single dataset object for pie charts
86
+ * @param type - Chart type: 'area', 'pie', 'semiPie', 'stackedBar', 'stackedBarHorizontal', or 'line'
87
+ * @param xAxisLabels - Array of labels for the x-axis (or categories for pie/semi-pie charts)
88
+ * @param datasets - Chart data: array of datasets for most charts, single dataset object for pie/semi-pie charts
72
89
  *
73
90
  * @performance
74
91
  * **Memoization Recommendations:**
@@ -94,7 +111,9 @@ import { ChartProps } from './types';
94
111
  * @notes
95
112
  * - Chart automatically re-renders when theme changes (light/dark mode)
96
113
  * - Line charts are rendered as non-stacked and non-filled by default
97
- * - Pie charts expect a single dataset object instead of an array
114
+ * - Pie and semi-pie charts expect a single dataset object instead of an array
115
+ * - Semi-pie charts render as half-circles, ideal for gauges or progress indicators
116
+ * - Center text can be added to pie and semi-pie charts using the centerText prop
98
117
  * - Colors should reference CHART_COLORS tokens for consistency
99
118
  * - Component destroys and recreates Chart.js instance on prop changes for optimal performance
100
119
  */
@@ -1,4 +1,4 @@
1
1
  export { default as Chart } from './Chart.component';
2
2
  export { CHART_COLORS } from './constants';
3
- export type { ChartColorKey, ChartProps, ChartType, ReferenceLineConfigType, SimpleDataset, SimpleDatasetForPie, } from './types';
3
+ export type { CenterTextConfig, ChartColorKey, ChartProps, ChartType, ReferenceLineConfigType, SimpleDataset, SimpleDatasetForPie, } from './types';
4
4
  export { chartColorGenerator } from './utils';
@@ -1,6 +1,7 @@
1
1
  import { RefObject } from 'react';
2
2
  import { Plugin } from 'chart.js';
3
3
  import { AppThemeType } from '../../Providers';
4
- import { ChartType, ReferenceLineConfigType } from './types';
4
+ import { CenterTextConfig, ChartType, ReferenceLineConfigType } from './types';
5
5
  export declare const drawReferenceLine: (config: ReferenceLineConfigType, id: string, appTheme: AppThemeType) => Plugin;
6
6
  export declare const htmlLegendPlugin: (id: string, ref: RefObject<HTMLDivElement>, type: ChartType) => Plugin;
7
+ export declare const drawCenterText: (config: CenterTextConfig, appTheme: AppThemeType) => Plugin;
@@ -3,11 +3,11 @@ import { TooltipOptions, TooltipPositionerFunction } from 'chart.js';
3
3
  import { TooltipProps } from '../../../Common/Tooltip';
4
4
  import { AppThemeType } from '../../Providers';
5
5
  import { Never } from '../../types';
6
- export type ChartType = 'area' | 'pie' | 'stackedBar' | 'stackedBarHorizontal' | 'line';
6
+ export type ChartType = 'area' | 'pie' | 'semiPie' | 'stackedBar' | 'stackedBarHorizontal' | 'line';
7
7
  export type ColorTokensType = 'DeepPlum' | 'Magenta' | 'Slate' | 'Lavender' | 'SkyBlue' | 'AquaTeal' | 'LimeGreen' | 'CoralRed' | 'GoldenYellow' | 'CharcoalGray' | 'Gray' | 'SunsetOrange';
8
8
  export type VariantsType = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950;
9
9
  export type ChartColorKey = `${ColorTokensType}${VariantsType}`;
10
- export type ChartTypeWithoutPie = Exclude<ChartType, 'pie'>;
10
+ export type ChartTypeWithoutPie = Exclude<ChartType, 'pie' | 'semiPie'>;
11
11
  interface BaseSimpleDataset {
12
12
  datasetName: string;
13
13
  yAxisValues: number[];
@@ -28,6 +28,13 @@ export interface ReferenceLineConfigType {
28
28
  color?: ChartColorKey;
29
29
  value: number;
30
30
  }
31
+ export interface CenterTextConfig {
32
+ text: string;
33
+ fontSize?: number;
34
+ fontWeight?: string | number;
35
+ color?: string;
36
+ fontFamily?: string;
37
+ }
31
38
  type XYAxisMax = {
32
39
  xAxisMax?: number;
33
40
  yAxisMax?: number;
@@ -42,24 +49,29 @@ type ScaleTickFormatCallbacks = Partial<{
42
49
  yScaleTickFormat: (value: number, index: number) => string | string[] | number | number[];
43
50
  }>;
44
51
  export type TypeAndDatasetsType = ({
45
- type: 'pie';
52
+ type: 'pie' | 'semiPie';
46
53
  /**
47
54
  * Needs to be memoized
48
55
  */
49
56
  datasets: SimpleDatasetForPie;
50
57
  onChartClick?: OnChartClickHandler;
58
+ /** Configuration for center text (only for doughnut/pie charts) */
59
+ centerText?: CenterTextConfig;
51
60
  } & Never<XYAxisMax> & Never<ScaleTickFormatCallbacks>) | ({
52
61
  type: 'line';
53
62
  datasets: SimpleDatasetForLineAndArea[];
54
63
  onChartClick?: never;
64
+ centerText?: never;
55
65
  } & XYAxisMax & ScaleTickFormatCallbacks) | ({
56
66
  type: 'area';
57
67
  datasets: SimpleDatasetForLineAndArea;
58
68
  onChartClick?: never;
69
+ centerText?: never;
59
70
  } & XYAxisMax & ScaleTickFormatCallbacks) | ({
60
- type: Exclude<ChartType, 'pie' | 'line' | 'area'>;
71
+ type: Exclude<ChartType, 'pie' | 'semiPie' | 'line' | 'area'>;
61
72
  datasets: SimpleDataset[];
62
73
  onChartClick?: OnChartClickHandler;
74
+ centerText?: never;
63
75
  } & XYAxisMax & ScaleTickFormatCallbacks);
64
76
  export type ChartProps = {
65
77
  id: string;
@@ -89,13 +101,13 @@ export type ChartProps = {
89
101
  export type TransformDatasetProps = {
90
102
  appTheme: AppThemeType;
91
103
  } & ({
92
- type: 'pie';
104
+ type: 'pie' | 'semiPie';
93
105
  dataset: SimpleDatasetForPie;
94
106
  } | {
95
107
  type: 'line' | 'area';
96
108
  dataset: SimpleDatasetForLineAndArea;
97
109
  } | {
98
- type: Exclude<ChartType, 'pie' | 'line' | 'area'>;
110
+ type: Exclude<ChartType, 'pie' | 'semiPie' | 'line' | 'area'>;
99
111
  dataset: SimpleDataset;
100
112
  });
101
113
  export type GetBackgroundAndBorderColorProps = TransformDatasetProps;
@@ -235,8 +235,11 @@ export declare const iconMap: {
235
235
  'ic-right-panel-collapse': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
236
236
  'ic-rocket-gear': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
237
237
  'ic-rocket-launch': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
238
+ 'ic-security-fixable': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
239
+ 'ic-security-not-fixable': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
238
240
  'ic-security-policy': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
239
241
  'ic-security-scan': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
242
+ 'ic-security-vulnerability': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
240
243
  'ic-selected': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
241
244
  'ic-shapes': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
242
245
  'ic-shield-check': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -1,2 +1,4 @@
1
+ import { Severity } from '../../types';
1
2
  import { SecurityConfigType } from './types';
2
3
  export declare const SECURITY_CONFIG: SecurityConfigType;
4
+ export declare const SEVERITY_LABEL_MAP: Record<Severity, string>;
@@ -1,3 +1,4 @@
1
+ export { SEVERITY_LABEL_MAP } from './constants';
1
2
  export * from './SecurityDetailsCards';
2
3
  export * from './SecurityModal';
3
4
  export * from './utils';
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="none" viewBox="0 0 36 36">
2
+ <g clip-path="url(#a)">
3
+ <path fill="#FFF5E5" d="M0 6a6 6 0 0 1 6-6h24a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6H6a6 6 0 0 1-6-6V6Z"/>
4
+ <path fill="#C58D36" d="M24.304 18.584A5.703 5.703 0 0 1 30 24.292 5.703 5.703 0 0 1 24.304 30a5.703 5.703 0 0 1-5.698-5.708 5.703 5.703 0 0 1 5.698-5.708Zm2.656 3.702a.75.75 0 0 0-1.06.05l-2.282 2.509-.276-.23-.83-.691a.75.75 0 0 0-.96 1.151l.83.692.829.691a.75.75 0 0 0 1.035-.071l2.765-3.041a.75.75 0 0 0-.051-1.06Z"/>
5
+ <path fill="#C58D36" fill-rule="evenodd" d="M15.752 6.29a.75.75 0 0 1 .486 0l8.25 2.829a1.87 1.87 0 0 1 1.253 1.773v4.238c0 .546-.028 1.07-.078 1.575a7.726 7.726 0 0 0-1.36-.122l-.136.002c.048-.465.074-.95.074-1.455v-4.238a.37.37 0 0 0-.239-.354L15.995 7.79 7.99 10.538a.37.37 0 0 0-.239.354v4.238c0 7.79 6.007 10.702 7.913 11.429l.323.117.01.003.009-.003c.197-.067.499-.182.875-.347.133.488.314.956.535 1.4-.396.173-.713.293-.919.363l-.008.004a1.5 1.5 0 0 1-.986 0c-1.51-.515-9.252-3.61-9.252-12.966v-4.238A1.87 1.87 0 0 1 7.502 9.12l8.25-2.829Zm.245 14.26a.75.75 0 0 1 .75.75v.511a.75.75 0 0 1-1.5 0v-.51a.75.75 0 0 1 .75-.75Zm0-8.172a.75.75 0 0 1 .75.75v5.108a.75.75 0 0 1-1.5 0v-5.108a.75.75 0 0 1 .75-.75Z" clip-rule="evenodd"/>
6
+ </g>
7
+ <defs>
8
+ <clipPath id="a">
9
+ <path fill="#fff" d="M0 0h36v36H0z"/>
10
+ </clipPath>
11
+ </defs>
12
+ </svg>
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" fill="none" viewBox="0 0 36 36">
2
+ <g clip-path="url(#a)">
3
+ <path fill="#FCF3F0" d="M0 6a6 6 0 0 1 6-6h24a6 6 0 0 1 6 6v24a6 6 0 0 1-6 6H6a6 6 0 0 1-6-6V6Z"/>
4
+ <path fill="#FF7E5B" d="M24.243 18.465a5.764 5.764 0 0 1 5.76 5.768 5.765 5.765 0 0 1-5.76 5.77 5.765 5.765 0 0 1-5.76-5.77 5.764 5.764 0 0 1 5.76-5.768Zm2.065 3.776a.75.75 0 0 0-1.06 0l-1.004 1.003-1.003-1.003a.75.75 0 0 0-1.06 1.06l1.003 1.004-1.003 1.003a.75.75 0 0 0 1.06 1.06l1.003-1.003 1.003 1.003a.75.75 0 0 0 1.06-1.06l-1.002-1.003 1.003-1.003a.75.75 0 0 0 0-1.06Z"/>
5
+ <path fill="#FF7E5B" d="M15.722 6.01a.753.753 0 0 1 .366.03l8.34 2.86a1.88 1.88 0 0 1 1.261 1.784v4.284c0 .559-.029 1.096-.08 1.611a7.792 7.792 0 0 0-1.365-.122l-.132.003a14.4 14.4 0 0 0 .078-1.492v-4.284a.382.382 0 0 0-.248-.366l-8.097-2.775-8.098 2.775a.381.381 0 0 0-.247.366v4.284l.005.39c.196 7.585 6.103 10.444 8 11.167l.328.12.008.003h.008l.007-.003c.203-.07.516-.188.906-.36.133.487.312.957.534 1.401-.414.182-.744.306-.955.378h-.001a1.51 1.51 0 0 1-.991 0c-1.5-.512-9.106-3.549-9.343-12.658L6 14.968v-4.284a1.88 1.88 0 0 1 1.26-1.785l8.342-2.859.12-.03Zm.124 14.443a.75.75 0 0 1 .75.75v.517a.75.75 0 0 1-1.5 0v-.517a.75.75 0 0 1 .75-.75Zm0-8.259a.75.75 0 0 1 .75.75v5.162a.75.75 0 0 1-1.5 0v-5.162a.75.75 0 0 1 .75-.75Z"/>
6
+ </g>
7
+ <defs>
8
+ <clipPath id="a">
9
+ <path fill="#fff" d="M0 0h36v36H0z"/>
10
+ </clipPath>
11
+ </defs>
12
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
2
+ <rect width="24" height="24" fill="#FDE7E7" rx="6"/>
3
+ <path fill="#F33E3E" d="m18.25 5.125-6.25-2-6.25 2a1.25 1.25 0 0 0-1.25 1.25v4.375c0 4.119 1.994 6.615 3.666 7.984 1.802 1.473 3.594 1.974 3.672 1.994.108.03.221.03.328 0 .079-.02 1.868-.521 3.672-1.994 1.668-1.37 3.662-3.865 3.662-7.984V6.375a1.25 1.25 0 0 0-1.25-1.25ZM11.375 8.5a.625.625 0 1 1 1.25 0v4.125a.624.624 0 1 1-1.25 0V8.5ZM12 16.375a.937.937 0 1 1 0-1.875.937.937 0 0 1 0 1.875Z"/>
4
+ </svg>