@devtron-labs/devtron-fe-common-lib 1.4.8 → 1.4.9-beta-1
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.
- package/dist/{@code-editor-Ch3gMDzD.js → @code-editor-DYmu_kOK.js} +6292 -6171
- package/dist/{@common-rjsf-RJZ7deME.js → @common-rjsf-BUHwKStw.js} +26 -14
- package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +7 -7
- package/dist/Common/CodeEditor/types.d.ts +9 -10
- package/dist/Common/CodeEditor/utils.d.ts +3 -0
- package/dist/Common/MultiSelectCustomization.d.ts +2 -0
- package/dist/Common/RJSF/utils.d.ts +3 -0
- package/dist/Common/SegmentedControl/SegmentedControl.component.d.ts +1 -1
- package/dist/Common/SegmentedControl/constants.d.ts +2 -0
- package/dist/Common/SegmentedControl/types.d.ts +7 -1
- package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.d.ts +1 -1
- package/dist/Shared/Components/CICDHistory/constants.d.ts +2 -0
- package/dist/Shared/Components/CICDHistory/types.d.ts +0 -2
- package/dist/Shared/Components/Plugin/PluginTagSelect.d.ts +1 -1
- package/dist/Shared/Components/Plugin/types.d.ts +2 -2
- package/dist/Shared/Components/Plugin/utils.d.ts +0 -16
- package/dist/Shared/Components/ReactSelect/constants.d.ts +1 -0
- package/dist/Shared/Components/ReactSelect/utils.d.ts +6 -0
- package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +8 -8
- package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +1 -1
- package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
- package/dist/Shared/Components/ThemeSwitcher/ThemeSwitcher.component.d.ts +3 -0
- package/dist/Shared/Components/ThemeSwitcher/constants.d.ts +6 -0
- package/dist/Shared/Components/ThemeSwitcher/index.d.ts +1 -0
- package/dist/Shared/Components/ThemeSwitcher/types.d.ts +3 -0
- package/dist/Shared/Providers/ThemeProvider/ThemeProvider.d.ts +3 -0
- package/dist/Shared/Providers/ThemeProvider/constants.d.ts +2 -0
- package/dist/Shared/Providers/ThemeProvider/index.d.ts +2 -0
- package/dist/Shared/Providers/ThemeProvider/types.d.ts +33 -0
- package/dist/Shared/Providers/ThemeProvider/utils.d.ts +4 -0
- package/dist/Shared/Providers/index.d.ts +1 -0
- package/dist/assets/@code-editor.css +1 -1
- package/dist/assets/ic-laptop.485e21b4.svg +3 -0
- package/dist/assets/ic-moon.17d37c40.svg +3 -0
- package/dist/assets/{ic-nav-rocket.9e50bb61.svg → ic-nav-rocket.433c9706.svg} +1 -1
- package/dist/assets/{ic-rotate-devtron.200e165b.svg → ic-rotate-devtron.5a8363d8.svg} +87 -86
- package/dist/assets/ic-sun.33e8214b.svg +3 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +533 -532
- package/package.json +1 -1
@@ -2,9 +2,9 @@ import { j as n, J as A } from "./@vendor-CwAQS8iU.js";
|
|
2
2
|
import E, { forwardRef as $ } from "react";
|
3
3
|
import L, { getDefaultRegistry as k } from "@rjsf/core";
|
4
4
|
import D from "@rjsf/validator-ajv8";
|
5
|
-
import { T as y, c as H, a as U, i as J, d as w } from "./@code-editor-
|
5
|
+
import { T as y, c as H, a as U, i as J, d as w } from "./@code-editor-DYmu_kOK.js";
|
6
6
|
import M, { components as O } from "react-select";
|
7
|
-
import { getUiOptions as B, getTemplate as I, getSubmitButtonOptions as
|
7
|
+
import { getUiOptions as B, getTemplate as I, getSubmitButtonOptions as V, ADDITIONAL_PROPERTY_FLAG as P, errorId as W, englishStringTranslator as q, TranslatableString as K, titleId as Y, canExpand as z, deepEquals as G } from "@rjsf/utils";
|
8
8
|
import { ReactComponent as Q } from "./assets/ic-chevron-down.fc70d7a7.svg";
|
9
9
|
import { ReactComponent as X } from "./assets/ic-add.cfaa779b.svg";
|
10
10
|
import { ReactComponent as Z } from "./assets/ic-cross.01e03666.svg";
|
@@ -155,7 +155,7 @@ import './assets/@common-rjsf.css';const N = {
|
|
155
155
|
}
|
156
156
|
) });
|
157
157
|
}, ae = ({ icon: t, iconType: e, registry: s, uiSchema: o, ...r }) => /* @__PURE__ */ n.jsx("button", { ...r, type: "button", className: "dc__outline-none-imp p-0 dc__transparent flex cursor", title: "Remove", children: /* @__PURE__ */ n.jsx(Z, { className: "icon-dim-16 fcn-6" }) }), ie = ({ uiSchema: t }) => {
|
158
|
-
const { submitText: e, norender: s, props: o = {} } =
|
158
|
+
const { submitText: e, norender: s, props: o = {} } = V(t);
|
159
159
|
return s ? null : /* @__PURE__ */ n.jsx("div", { className: "flexbox flex-justify-end", children: /* @__PURE__ */ n.jsx("button", { type: "submit", ...o, className: `cta ${o.className || ""}`, children: e }) });
|
160
160
|
}, T = ({
|
161
161
|
id: t,
|
@@ -214,7 +214,7 @@ import './assets/@common-rjsf.css';const N = {
|
|
214
214
|
] })
|
215
215
|
);
|
216
216
|
}, ce = ({ errors: t = [], idSchema: e }) => {
|
217
|
-
const s =
|
217
|
+
const s = W(e);
|
218
218
|
return t.length > 0 && /* @__PURE__ */ n.jsx("span", { className: "display-grid rjsf-form-template__field--error dc__gap-12", id: s, children: t.filter((o) => !!o).map((o, r) => /* @__PURE__ */ n.jsxs(E.Fragment, { children: [
|
219
219
|
/* @__PURE__ */ n.jsx("span", {}),
|
220
220
|
/* @__PURE__ */ n.jsxs("span", { className: "form__error", children: [
|
@@ -240,14 +240,14 @@ import './assets/@common-rjsf.css';const N = {
|
|
240
240
|
...e,
|
241
241
|
minHeight: "32px",
|
242
242
|
boxShadow: "none",
|
243
|
-
backgroundColor: "var(--
|
243
|
+
backgroundColor: "var(--bg-secondary)",
|
244
244
|
border: s.isFocused ? "1px solid var(--B500)" : "1px solid var(--N200)",
|
245
245
|
cursor: "pointer"
|
246
246
|
}),
|
247
247
|
option: (e, s) => ({
|
248
248
|
...e,
|
249
249
|
color: "var(--N900)",
|
250
|
-
backgroundColor: s.isFocused ? "var(--N100)" : "
|
250
|
+
backgroundColor: s.isFocused ? "var(--N100)" : "var(--bg-primary)",
|
251
251
|
padding: "10px 12px",
|
252
252
|
cursor: "pointer"
|
253
253
|
}),
|
@@ -276,12 +276,24 @@ import './assets/@common-rjsf.css';const N = {
|
|
276
276
|
...e,
|
277
277
|
border: "1px solid var(--N200)",
|
278
278
|
borderRadius: "4px",
|
279
|
-
background: "
|
279
|
+
background: "var(--bg-primary)",
|
280
280
|
height: "28px",
|
281
281
|
marginRight: "8px",
|
282
282
|
padding: "2px",
|
283
283
|
fontSize: "12px"
|
284
284
|
}),
|
285
|
+
singleValue: (e) => ({
|
286
|
+
...e,
|
287
|
+
color: "var(--N900)"
|
288
|
+
}),
|
289
|
+
input: (e) => ({
|
290
|
+
...e,
|
291
|
+
color: "var(--N900)"
|
292
|
+
}),
|
293
|
+
menu: (e) => ({
|
294
|
+
...e,
|
295
|
+
backgroundColor: "var(--bg-menu)"
|
296
|
+
}),
|
285
297
|
...t
|
286
298
|
}), Le = (t) => {
|
287
299
|
try {
|
@@ -316,7 +328,7 @@ import './assets/@common-rjsf.css';const N = {
|
|
316
328
|
return "";
|
317
329
|
const e = t.trim();
|
318
330
|
return e.match(/^\w+(\/\w+)*$/g) ? `/${e}` : e.match(/^\w+(\.\w+)*$/g) ? `/${e.replaceAll(/\./g, "/")}` : e;
|
319
|
-
},
|
331
|
+
}, C = {
|
320
332
|
value: !1,
|
321
333
|
path: ""
|
322
334
|
}, me = (t) => {
|
@@ -326,13 +338,13 @@ import './assets/@common-rjsf.css';const N = {
|
|
326
338
|
return typeof e == "string" ? {
|
327
339
|
value: !0,
|
328
340
|
path: v(e)
|
329
|
-
} : typeof e != "object" ? structuredClone(
|
341
|
+
} : typeof e != "object" ? structuredClone(C) : Object.hasOwn(e, "condition") && "condition" in e && Object.hasOwn(e, "value") && "value" in e ? {
|
330
342
|
value: e.condition,
|
331
343
|
path: v(e.value)
|
332
344
|
} : Object.hasOwn(e, "value") && "value" in e && Object.hasOwn(e, "path") && "path" in e ? {
|
333
345
|
value: e.value,
|
334
346
|
path: v(e.path)
|
335
|
-
} : structuredClone(
|
347
|
+
} : structuredClone(C);
|
336
348
|
}, ue = ({
|
337
349
|
disabled: t,
|
338
350
|
formData: e,
|
@@ -485,7 +497,7 @@ import './assets/@common-rjsf.css';const N = {
|
|
485
497
|
),
|
486
498
|
/* @__PURE__ */ n.jsx("span", { className: "dc__capitalize ml-8", children: f.toString() })
|
487
499
|
] });
|
488
|
-
},
|
500
|
+
}, F = pe(), ge = ({ children: t, ...e }) => /* @__PURE__ */ n.jsx(O.MenuList, { ...e, children: Array.isArray(t) ? t.slice(0, 20) : t }), je = (t) => /* @__PURE__ */ n.jsx(O.DropdownIndicator, { ...t, children: /* @__PURE__ */ n.jsx(Q, { className: "icon-dim-20 icon-n5", "data-testid": "overview-project-edit-dropdown" }) }), _e = (t) => {
|
489
501
|
const {
|
490
502
|
id: e,
|
491
503
|
multiple: s = !1,
|
@@ -516,11 +528,11 @@ import './assets/@common-rjsf.css';const N = {
|
|
516
528
|
placeholder: p || N.SELECT,
|
517
529
|
isDisabled: a || i,
|
518
530
|
styles: {
|
519
|
-
...
|
531
|
+
...F,
|
520
532
|
control: (g) => ({
|
521
533
|
...g,
|
522
|
-
...
|
523
|
-
backgroundColor: "var(--
|
534
|
+
...F.control,
|
535
|
+
backgroundColor: "var(--bg-secondary)"
|
524
536
|
})
|
525
537
|
},
|
526
538
|
components: {
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import { MODES } from '../Constants';
|
2
|
-
import { Action, CodeEditorInitialValueType, CodeEditorState
|
2
|
+
import { Action, CodeEditorInitialValueType, CodeEditorState } from './types';
|
3
3
|
export declare const CodeEditorReducer: (state: CodeEditorState, action: Action) => {
|
4
4
|
mode: any;
|
5
5
|
diffMode: boolean;
|
6
|
-
theme: CodeEditorThemesKeys;
|
6
|
+
theme: import('./types').CodeEditorThemesKeys;
|
7
7
|
code: string;
|
8
8
|
defaultCode: string;
|
9
9
|
noParsing: boolean;
|
10
10
|
} | {
|
11
11
|
diffMode: any;
|
12
12
|
mode: MODES;
|
13
|
-
theme: CodeEditorThemesKeys;
|
13
|
+
theme: import('./types').CodeEditorThemesKeys;
|
14
14
|
code: string;
|
15
15
|
defaultCode: string;
|
16
16
|
noParsing: boolean;
|
@@ -25,24 +25,24 @@ export declare const CodeEditorReducer: (state: CodeEditorState, action: Action)
|
|
25
25
|
code: any;
|
26
26
|
mode: MODES;
|
27
27
|
diffMode: boolean;
|
28
|
-
theme: CodeEditorThemesKeys;
|
28
|
+
theme: import('./types').CodeEditorThemesKeys;
|
29
29
|
defaultCode: string;
|
30
30
|
noParsing: boolean;
|
31
31
|
} | {
|
32
32
|
defaultCode: any;
|
33
33
|
mode: MODES;
|
34
34
|
diffMode: boolean;
|
35
|
-
theme: CodeEditorThemesKeys;
|
35
|
+
theme: import('./types').CodeEditorThemesKeys;
|
36
36
|
code: string;
|
37
37
|
noParsing: boolean;
|
38
38
|
} | {
|
39
39
|
height: any;
|
40
40
|
mode: MODES;
|
41
41
|
diffMode: boolean;
|
42
|
-
theme: CodeEditorThemesKeys;
|
42
|
+
theme: import('./types').CodeEditorThemesKeys;
|
43
43
|
code: string;
|
44
44
|
defaultCode: string;
|
45
45
|
noParsing: boolean;
|
46
46
|
};
|
47
47
|
export declare const parseValueToCode: (value: string, mode: string, tabSize: number) => string;
|
48
|
-
export declare const initialState: ({ mode, theme, value, defaultValue, diffView, noParsing, tabSize, }: CodeEditorInitialValueType) => CodeEditorState;
|
48
|
+
export declare const initialState: ({ mode, theme, value, defaultValue, diffView, noParsing, tabSize, appTheme, }: CodeEditorInitialValueType) => CodeEditorState;
|
@@ -1,9 +1,15 @@
|
|
1
|
+
import { AppThemeType } from '../../Shared/Providers';
|
1
2
|
import { MODES } from '../Constants';
|
2
3
|
export interface InformationBarProps {
|
3
4
|
text: string;
|
4
5
|
className?: string;
|
5
6
|
children?: React.ReactNode;
|
6
7
|
}
|
8
|
+
export declare enum CodeEditorThemesKeys {
|
9
|
+
vsDarkDT = "vs-dark--dt",
|
10
|
+
vs = "vs",
|
11
|
+
networkStatusInterface = "network-status-interface"
|
12
|
+
}
|
7
13
|
interface CodeEditorBaseInterface {
|
8
14
|
value?: string;
|
9
15
|
lineDecorationsWidth?: number;
|
@@ -22,7 +28,7 @@ interface CodeEditorBaseInterface {
|
|
22
28
|
diffView?: boolean;
|
23
29
|
loading?: boolean;
|
24
30
|
customLoader?: JSX.Element;
|
25
|
-
theme?:
|
31
|
+
theme?: CodeEditorThemesKeys;
|
26
32
|
original?: string;
|
27
33
|
focus?: boolean;
|
28
34
|
validatorSchema?: any;
|
@@ -68,21 +74,14 @@ export interface Action {
|
|
68
74
|
type: ActionTypes;
|
69
75
|
value: any;
|
70
76
|
}
|
71
|
-
export
|
72
|
-
vsDarkDT = "vs-dark--dt",
|
73
|
-
deleteDraft = "delete-draft",
|
74
|
-
unpublished = "unpublished",
|
75
|
-
vs = "vs",
|
76
|
-
networkStatusInterface = "network-status-interface"
|
77
|
-
}
|
78
|
-
export interface CodeEditorInitialValueType {
|
77
|
+
export interface CodeEditorInitialValueType extends Pick<CodeEditorBaseInterface, 'theme'> {
|
79
78
|
mode: string;
|
80
79
|
diffView: boolean;
|
81
|
-
theme?: string;
|
82
80
|
value: string;
|
83
81
|
defaultValue: string;
|
84
82
|
noParsing?: boolean;
|
85
83
|
tabSize: number;
|
84
|
+
appTheme: AppThemeType;
|
86
85
|
}
|
87
86
|
export interface CodeEditorState {
|
88
87
|
mode: MODES;
|
@@ -23,6 +23,8 @@ export declare const multiSelectStyles: {
|
|
23
23
|
option: (base: any, state: any) => any;
|
24
24
|
container: (base: any, state: any) => any;
|
25
25
|
valueContainer: (base: any, state: any) => any;
|
26
|
+
singleValue: (base: any) => any;
|
27
|
+
input: (base: any) => any;
|
26
28
|
};
|
27
29
|
export interface CustomSelect {
|
28
30
|
sortSelected?: boolean;
|
@@ -13,6 +13,9 @@ export declare const getCommonSelectStyle: (styleOverrides?: {}) => {
|
|
13
13
|
loadingMessage: (base: any) => any;
|
14
14
|
noOptionsMessage: (base: any) => any;
|
15
15
|
multiValue: (base: any) => any;
|
16
|
+
singleValue: (base: any) => any;
|
17
|
+
input: (base: any) => any;
|
18
|
+
menu: (base: any) => any;
|
16
19
|
};
|
17
20
|
/**
|
18
21
|
* Returns the redirection props for a url
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { SegmentedControlProps } from './types';
|
2
|
-
declare const SegmentedControl: ({ tabs, initialTab, onChange, tooltips, disabled, rootClassName, name, variant, }: SegmentedControlProps) => JSX.Element;
|
2
|
+
declare const SegmentedControl: ({ tabs, initialTab, onChange, tooltips, disabled, rootClassName, name, variant, size, }: SegmentedControlProps) => JSX.Element;
|
3
3
|
export default SegmentedControl;
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import { OptionType } from '../Types';
|
2
|
+
import { ComponentSizeType } from '../../Shared/constants';
|
3
|
+
import { ReactNode } from 'react';
|
2
4
|
export declare enum SegmentedControlVariant {
|
3
5
|
GRAY_ON_WHITE = "gui-yaml-switch",
|
4
6
|
WHITE_ON_GRAY = "gui-yaml-switch-window-bg"
|
5
7
|
}
|
6
8
|
export interface SegmentedControlProps {
|
7
|
-
tabs: OptionType[];
|
9
|
+
tabs: OptionType<string, ReactNode>[];
|
8
10
|
initialTab: string;
|
9
11
|
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
10
12
|
name: string;
|
@@ -12,4 +14,8 @@ export interface SegmentedControlProps {
|
|
12
14
|
disabled?: boolean;
|
13
15
|
rootClassName?: string;
|
14
16
|
variant?: SegmentedControlVariant;
|
17
|
+
/**
|
18
|
+
* @default ComponentSizeType.medium
|
19
|
+
*/
|
20
|
+
size?: ComponentSizeType.medium | ComponentSizeType.large;
|
15
21
|
}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { DeploymentTemplateHistoryType } from '../types';
|
2
|
-
declare const DeploymentHistoryDiffView: ({ currentConfiguration, baseTemplateConfiguration, previousConfigAvailable,
|
2
|
+
declare const DeploymentHistoryDiffView: ({ currentConfiguration, baseTemplateConfiguration, previousConfigAvailable, rootClassName, sortingConfig, codeEditorKey, }: DeploymentTemplateHistoryType) => JSX.Element;
|
3
3
|
export default DeploymentHistoryDiffView;
|
@@ -11,6 +11,8 @@ export declare const FILTER_STYLE: {
|
|
11
11
|
option: (base: any, state: any) => any;
|
12
12
|
container: (base: any, state: any) => any;
|
13
13
|
valueContainer: (base: any, state: any) => any;
|
14
|
+
singleValue: (base: any) => any;
|
15
|
+
input: (base: any) => any;
|
14
16
|
};
|
15
17
|
export declare const GIT_BRANCH_NOT_CONFIGURED = "Not Configured";
|
16
18
|
export declare const DEFAULT_GIT_BRANCH_VALUE = "--";
|
@@ -390,8 +390,6 @@ export interface DeploymentTemplateHistoryType {
|
|
390
390
|
currentConfiguration: DeploymentHistoryDetail;
|
391
391
|
baseTemplateConfiguration: DeploymentHistoryDetail;
|
392
392
|
previousConfigAvailable: boolean;
|
393
|
-
isUnpublished?: boolean;
|
394
|
-
isDeleteDraft?: boolean;
|
395
393
|
rootClassName?: string;
|
396
394
|
codeEditorKey?: React.Key;
|
397
395
|
sortingConfig?: {
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { PluginTagSelectProps } from './types';
|
2
|
-
declare const PluginTagSelect: ({ availableTags, handleUpdateSelectedTags, selectedTags, isLoading,
|
2
|
+
declare const PluginTagSelect: ({ availableTags, handleUpdateSelectedTags, selectedTags, isLoading, tagsError, reloadTags, }: PluginTagSelectProps) => JSX.Element;
|
3
3
|
export default PluginTagSelect;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { MutableRefObject } from 'react';
|
2
|
-
import { ConsequenceType, VariableType } from '../../../Common';
|
2
|
+
import { ConsequenceType, ServerErrors, VariableType } from '../../../Common';
|
3
3
|
import { BaseFilterQueryParams } from '../../types';
|
4
4
|
import { ImageWithFallbackProps } from '../ImageWithFallback';
|
5
5
|
import { getPluginStoreData } from './service';
|
@@ -149,7 +149,7 @@ export interface PluginListParamsType {
|
|
149
149
|
export interface PluginTagSelectProps extends Pick<BasePluginListContainerProps, 'availableTags'> {
|
150
150
|
selectedTags: PluginListContainerProps['parentFilters']['selectedTags'];
|
151
151
|
isLoading: boolean;
|
152
|
-
|
152
|
+
tagsError: ServerErrors;
|
153
153
|
reloadTags: () => void;
|
154
154
|
handleUpdateSelectedTags: (tags: string[]) => void;
|
155
155
|
}
|
@@ -1,21 +1,5 @@
|
|
1
|
-
import { OptionProps } from 'react-select';
|
2
|
-
import { OptionType } from '../../../Common/Types';
|
3
1
|
import { ParentPluginDTO, PluginDataStoreType } from './types';
|
4
2
|
export declare const parsePluginDetailsDTOIntoPluginStore: (pluginData: ParentPluginDTO[]) => PluginDataStoreType;
|
5
|
-
export declare const pluginTagSelectStyles: {
|
6
|
-
option: (base: any, state: any) => any;
|
7
|
-
container: (base: any, state: any) => any;
|
8
|
-
menuList: (base: any) => any;
|
9
|
-
control: (base: any, state: any) => any;
|
10
|
-
dropdownIndicator: (base: any, state: any) => any;
|
11
|
-
valueContainer: (base: any) => any;
|
12
|
-
loadingMessage: (base: any) => any;
|
13
|
-
noOptionsMessage: (base: any) => any;
|
14
|
-
placeholder: (base: any) => any;
|
15
|
-
group: (base: any) => any;
|
16
|
-
groupHeading: (base: any) => any;
|
17
|
-
};
|
18
|
-
export declare const PluginTagOption: (props: OptionProps<OptionType, true>) => JSX.Element;
|
19
3
|
/**
|
20
4
|
* @description This method takes the initial plugin data store and updates the keys with the target parent plugin store and plugin version store
|
21
5
|
*/
|
@@ -12,6 +12,9 @@ export declare const getCommonSelectStyle: (styleOverrides?: {}) => {
|
|
12
12
|
placeholder: (base: any) => any;
|
13
13
|
group: (base: any) => any;
|
14
14
|
groupHeading: (base: any) => any;
|
15
|
+
singleValue: (base: any) => any;
|
16
|
+
input: (base: any) => any;
|
17
|
+
menu: (base: any) => any;
|
15
18
|
};
|
16
19
|
export declare const getCustomOptionSelectionStyle: (styleOverrides?: {}) => (base: any, state: any) => any;
|
17
20
|
export declare const SelectOption: (props: any) => JSX.Element;
|
@@ -29,6 +32,9 @@ export declare const commonSelectStyles: {
|
|
29
32
|
placeholder: (base: any) => any;
|
30
33
|
group: (base: any) => any;
|
31
34
|
groupHeading: (base: any) => any;
|
35
|
+
singleValue: (base: any) => any;
|
36
|
+
input: (base: any) => any;
|
37
|
+
menu: (base: any) => any;
|
32
38
|
};
|
33
39
|
export declare const MenuListWithApplyButton: ({ handleApplyFilter, ...props }: MenuListProps & {
|
34
40
|
handleApplyFilter: () => void;
|
@@ -19,35 +19,35 @@ export declare const SUB_CATEGORY_LABELS: {
|
|
19
19
|
export declare const SEVERITIES: {
|
20
20
|
readonly critical: {
|
21
21
|
readonly label: "Critical";
|
22
|
-
readonly color: "
|
22
|
+
readonly color: "var(--R700)";
|
23
23
|
};
|
24
24
|
readonly high: {
|
25
25
|
readonly label: "High";
|
26
|
-
readonly color: "
|
26
|
+
readonly color: "var(--R500)";
|
27
27
|
};
|
28
28
|
readonly medium: {
|
29
29
|
readonly label: "Medium";
|
30
|
-
readonly color: "
|
30
|
+
readonly color: "var(--O500)";
|
31
31
|
};
|
32
32
|
readonly low: {
|
33
33
|
readonly label: "Low";
|
34
|
-
readonly color: "
|
34
|
+
readonly color: "var(--Y500)";
|
35
35
|
};
|
36
36
|
readonly unknown: {
|
37
37
|
readonly label: "Unknown";
|
38
|
-
readonly color: "
|
38
|
+
readonly color: "var(--N300)";
|
39
39
|
};
|
40
40
|
readonly fail: {
|
41
41
|
readonly label: "Failures";
|
42
|
-
readonly color: "
|
42
|
+
readonly color: "var(--R500)";
|
43
43
|
};
|
44
44
|
readonly success: {
|
45
45
|
readonly label: "Successes";
|
46
|
-
readonly color: "
|
46
|
+
readonly color: "var(--G500)";
|
47
47
|
};
|
48
48
|
readonly exceptions: {
|
49
49
|
readonly label: "Exceptions";
|
50
|
-
readonly color: "
|
50
|
+
readonly color: "var(--N300)";
|
51
51
|
};
|
52
52
|
};
|
53
53
|
export declare const ORDERED_SEVERITY_KEYS: readonly [SeveritiesDTO.CRITICAL, SeveritiesDTO.HIGH, SeveritiesDTO.MEDIUM, SeveritiesDTO.LOW, SeveritiesDTO.UNKNOWN, SeveritiesDTO.FAILURES, SeveritiesDTO.EXCEPTIONS, SeveritiesDTO.SUCCESSES];
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ScanResultDTO, SeveritiesDTO, GetResourceScanDetailsResponseType, ImageScanVulnerabilityType, ImageVulnerabilityType, VulnerabilityCountType } from './types';
|
2
2
|
import { SEVERITIES } from './constants';
|
3
3
|
export declare const mapSeveritiesToSegmentedBarChartEntities: (severities: Partial<Record<keyof typeof SEVERITIES, number>>) => {
|
4
|
-
color: "
|
4
|
+
color: "var(--Y500)" | "var(--R500)" | "var(--G500)" | "var(--O500)" | "var(--N300)" | "var(--R700)";
|
5
5
|
label: "Critical" | "High" | "Medium" | "Low" | "Unknown" | "Failures" | "Successes" | "Exceptions";
|
6
6
|
value: number;
|
7
7
|
}[];
|
@@ -43,7 +43,7 @@ import { SelectPickerProps } from './type';
|
|
43
43
|
* <SelectPicker
|
44
44
|
* ...
|
45
45
|
* renderMenuListFooter={() => (
|
46
|
-
* <div className="px-8 py-6 dc__border-top
|
46
|
+
* <div className="px-8 py-6 dc__border-top bg__secondary cn-6">
|
47
47
|
* <div>Foot note</div>
|
48
48
|
* </div>
|
49
49
|
* )}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as ThemeSwitcher } from './ThemeSwitcher.component';
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
export declare enum AppThemeType {
|
3
|
+
light = "light",
|
4
|
+
dark = "dark"
|
5
|
+
}
|
6
|
+
export declare const THEME_PREFERENCE_MAP: {
|
7
|
+
readonly auto: "auto";
|
8
|
+
readonly light: AppThemeType.light;
|
9
|
+
readonly dark: AppThemeType.dark;
|
10
|
+
};
|
11
|
+
export type ThemePreferenceType = (typeof THEME_PREFERENCE_MAP)[keyof typeof THEME_PREFERENCE_MAP];
|
12
|
+
export interface ThemeConfigType {
|
13
|
+
/**
|
14
|
+
* Current application theme
|
15
|
+
*
|
16
|
+
* @default AppThemeType.light
|
17
|
+
*/
|
18
|
+
appTheme: AppThemeType;
|
19
|
+
/**
|
20
|
+
* Preferred theme for the user (if any)
|
21
|
+
*
|
22
|
+
* @default THEME_PREFERENCE_MAP.auto
|
23
|
+
*
|
24
|
+
* Note: This shouldn't be consumed other than in ThemeSwitcher component
|
25
|
+
*/
|
26
|
+
themePreference: ThemePreferenceType;
|
27
|
+
}
|
28
|
+
export interface ThemeContextType extends ThemeConfigType {
|
29
|
+
handleSelectedThemeChange: (updatedThemePreference: ThemePreferenceType) => void;
|
30
|
+
}
|
31
|
+
export interface ThemeProviderProps {
|
32
|
+
children: ReactNode;
|
33
|
+
}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { AppThemeType, ThemePreferenceType, ThemeConfigType } from './types';
|
2
|
+
export declare const getAppThemeForAutoPreference: () => AppThemeType;
|
3
|
+
export declare const getThemeConfigFromLocalStorage: () => ThemeConfigType;
|
4
|
+
export declare const setThemePreferenceInLocalStorage: (themePreference: ThemePreferenceType) => void;
|