@devtron-labs/devtron-fe-common-lib 1.4.0-beta-6 → 1.4.0-beta-7

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 (54) hide show
  1. package/dist/{@code-editor-Bc1CgRDS.js → @code-editor-r8mIxPmX.js} +5471 -5404
  2. package/dist/{@common-rjsf-B3tCdEBt.js → @common-rjsf-Pzf33XFr.js} +27 -15
  3. package/dist/{@framer-motion-CdgdF0KV.js → @framer-motion-BxQTtYmm.js} +1 -1
  4. package/dist/{@react-dates-CtQV2TLr.js → @react-dates-M_eJUVeH.js} +1 -1
  5. package/dist/{@react-select-Cn3OpC9h.js → @react-select-CywptBlV.js} +1 -1
  6. package/dist/{@vendor-CwAQS8iU.js → @vendor-QI4m26H1.js} +5491 -5894
  7. package/dist/Common/CodeEditor/CodeEditor.reducer.d.ts +6 -18
  8. package/dist/Common/CodeEditor/types.d.ts +11 -14
  9. package/dist/Common/CodeEditor/utils.d.ts +3 -0
  10. package/dist/Common/Constants.d.ts +0 -1
  11. package/dist/Common/MultiSelectCustomization.d.ts +2 -0
  12. package/dist/Common/RJSF/utils.d.ts +3 -0
  13. package/dist/Common/SegmentedControl/SegmentedControl.component.d.ts +1 -1
  14. package/dist/Common/SegmentedControl/constants.d.ts +2 -0
  15. package/dist/Common/SegmentedControl/types.d.ts +7 -1
  16. package/dist/Pages/ResourceBrowser/service.d.ts +0 -2
  17. package/dist/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryDiffView.d.ts +1 -1
  18. package/dist/Shared/Components/CICDHistory/constants.d.ts +2 -0
  19. package/dist/Shared/Components/CICDHistory/types.d.ts +0 -2
  20. package/dist/Shared/Components/Plugin/PluginTagSelect.d.ts +1 -1
  21. package/dist/Shared/Components/Plugin/types.d.ts +2 -2
  22. package/dist/Shared/Components/Plugin/utils.d.ts +0 -16
  23. package/dist/Shared/Components/ReactSelect/constants.d.ts +1 -0
  24. package/dist/Shared/Components/ReactSelect/utils.d.ts +6 -0
  25. package/dist/Shared/Components/Security/SecurityModal/constants.d.ts +8 -8
  26. package/dist/Shared/Components/Security/SecurityModal/utils.d.ts +1 -1
  27. package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
  28. package/dist/Shared/Components/ThemeSwitcher/ThemeSwitcher.component.d.ts +3 -0
  29. package/dist/Shared/Components/ThemeSwitcher/constants.d.ts +6 -0
  30. package/dist/Shared/Components/ThemeSwitcher/index.d.ts +1 -0
  31. package/dist/Shared/Components/ThemeSwitcher/types.d.ts +3 -0
  32. package/dist/Shared/Components/index.d.ts +0 -1
  33. package/dist/Shared/Hooks/useGetResourceKindsOptions/types.d.ts +0 -1
  34. package/dist/Shared/Providers/ThemeProvider/ThemeProvider.d.ts +3 -0
  35. package/dist/Shared/Providers/ThemeProvider/constants.d.ts +2 -0
  36. package/dist/Shared/Providers/ThemeProvider/index.d.ts +2 -0
  37. package/dist/Shared/Providers/ThemeProvider/types.d.ts +33 -0
  38. package/dist/Shared/Providers/ThemeProvider/utils.d.ts +4 -0
  39. package/dist/Shared/Providers/index.d.ts +1 -0
  40. package/dist/Shared/Services/types.d.ts +0 -4
  41. package/dist/assets/@code-editor.css +1 -1
  42. package/dist/assets/ic-laptop.485e21b4.svg +3 -0
  43. package/dist/assets/ic-moon.17d37c40.svg +3 -0
  44. package/dist/assets/{ic-nav-rocket.9e50bb61.svg → ic-nav-rocket.433c9706.svg} +1 -1
  45. package/dist/assets/{ic-rotate-devtron.200e165b.svg → ic-rotate-devtron.5a8363d8.svg} +87 -86
  46. package/dist/assets/ic-sun.33e8214b.svg +3 -0
  47. package/dist/index.d.ts +6 -0
  48. package/dist/index.js +513 -514
  49. package/package.json +1 -6
  50. package/dist/@react-virtualized-sticky-tree-CVJYfMx0.js +0 -452
  51. package/dist/Shared/Components/VirtualizedList/VirtualizedList.component.d.ts +0 -2
  52. package/dist/Shared/Components/VirtualizedList/VirtualizedList.constants.d.ts +0 -2
  53. package/dist/Shared/Components/VirtualizedList/VirtualizedList.types.d.ts +0 -36
  54. package/dist/Shared/Components/VirtualizedList/index.d.ts +0 -2
@@ -1,48 +1,36 @@
1
1
  import { MODES } from '../Constants';
2
- import { Action, CodeEditorInitialValueType, CodeEditorState, CodeEditorThemesKeys } from './types';
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
- defaultCode: string;
9
8
  noParsing: boolean;
10
9
  } | {
11
10
  diffMode: any;
12
11
  mode: MODES;
13
- theme: CodeEditorThemesKeys;
12
+ theme: import('./types').CodeEditorThemesKeys;
14
13
  code: string;
15
- defaultCode: string;
16
14
  noParsing: boolean;
17
15
  } | {
18
16
  theme: any;
19
17
  mode: MODES;
20
18
  diffMode: boolean;
21
19
  code: string;
22
- defaultCode: string;
23
20
  noParsing: boolean;
24
21
  } | {
25
22
  code: any;
26
23
  mode: MODES;
27
24
  diffMode: boolean;
28
- theme: CodeEditorThemesKeys;
29
- defaultCode: string;
30
- noParsing: boolean;
31
- } | {
32
- defaultCode: any;
33
- mode: MODES;
34
- diffMode: boolean;
35
- theme: CodeEditorThemesKeys;
36
- code: string;
25
+ theme: import('./types').CodeEditorThemesKeys;
37
26
  noParsing: boolean;
38
27
  } | {
39
28
  height: any;
40
29
  mode: MODES;
41
30
  diffMode: boolean;
42
- theme: CodeEditorThemesKeys;
31
+ theme: import('./types').CodeEditorThemesKeys;
43
32
  code: string;
44
- defaultCode: string;
45
33
  noParsing: boolean;
46
34
  };
47
35
  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;
36
+ export declare const initialState: ({ mode, theme, value, diffView, noParsing, tabSize, appTheme, }: CodeEditorInitialValueType) => CodeEditorState;
@@ -1,14 +1,20 @@
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;
10
16
  responseType?: string;
11
- onChange?: (value: string, defaultValue: string) => void;
17
+ onChange?: (string: any) => void;
12
18
  onBlur?: () => void;
13
19
  onFocus?: () => void;
14
20
  children?: any;
@@ -22,7 +28,7 @@ interface CodeEditorBaseInterface {
22
28
  diffView?: boolean;
23
29
  loading?: boolean;
24
30
  customLoader?: JSX.Element;
25
- theme?: string;
31
+ theme?: CodeEditorThemesKeys;
26
32
  original?: string;
27
33
  focus?: boolean;
28
34
  validatorSchema?: any;
@@ -63,33 +69,24 @@ export interface CodeEditorHeaderComposition {
63
69
  ValidationError?: React.FC<any>;
64
70
  Clipboard?: React.FC<any>;
65
71
  }
66
- export type ActionTypes = 'changeLanguage' | 'setDiff' | 'setTheme' | 'setCode' | 'setDefaultCode' | 'setHeight';
72
+ export type ActionTypes = 'changeLanguage' | 'setDiff' | 'setTheme' | 'setCode' | 'setHeight';
67
73
  export interface Action {
68
74
  type: ActionTypes;
69
75
  value: any;
70
76
  }
71
- export declare enum CodeEditorThemesKeys {
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
- defaultValue: string;
84
81
  noParsing?: boolean;
85
82
  tabSize: number;
83
+ appTheme: AppThemeType;
86
84
  }
87
85
  export interface CodeEditorState {
88
86
  mode: MODES;
89
87
  diffMode: boolean;
90
88
  theme: CodeEditorThemesKeys;
91
89
  code: string;
92
- defaultCode: string;
93
90
  noParsing: boolean;
94
91
  }
95
92
  export declare enum CodeEditorActionTypes {
@@ -0,0 +1,3 @@
1
+ import { AppThemeType } from '../../Shared/Providers';
2
+ import { CodeEditorInterface } from './types';
3
+ export declare const getCodeEditorThemeFromAppTheme: (editorTheme: CodeEditorInterface["theme"], appTheme: AppThemeType) => CodeEditorInterface["theme"];
@@ -95,7 +95,6 @@ export declare const ROUTES: {
95
95
  ATTRIBUTES_UPDATE: string;
96
96
  APP_LIST_MIN: string;
97
97
  CLUSTER_LIST_MIN: string;
98
- CLUSTER_LIST_RAW: string;
99
98
  PLUGIN_GLOBAL_LIST_DETAIL_V2: string;
100
99
  PLUGIN_GLOBAL_LIST_V2: string;
101
100
  PLUGIN_GLOBAL_LIST_TAGS: string;
@@ -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;
@@ -0,0 +1,2 @@
1
+ import { SegmentedControlProps } from './types';
2
+ export declare const SEGMENTED_CONTROL_SIZE_TO_CLASS_MAP: Record<SegmentedControlProps['size'], string>;
@@ -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,6 +1,4 @@
1
1
  import { ResponseType } from '../../Common/Types';
2
2
  import { CreateResourceDTO, CreateResourcePayload, K8sResourceDetailType, K8sResourceListPayloadType } from './ResourceBrowser.Types';
3
- import { ClusterDetail } from './types';
4
3
  export declare const getK8sResourceList: (resourceListPayload: K8sResourceListPayloadType, signal?: AbortSignal) => Promise<ResponseType<K8sResourceDetailType>>;
5
4
  export declare const createNewResource: (resourceListPayload: CreateResourcePayload) => Promise<ResponseType<CreateResourceDTO[]>>;
6
- export declare const getClusterListRaw: () => Promise<ResponseType<ClusterDetail[]>>;
@@ -1,3 +1,3 @@
1
1
  import { DeploymentTemplateHistoryType } from '../types';
2
- declare const DeploymentHistoryDiffView: ({ currentConfiguration, baseTemplateConfiguration, previousConfigAvailable, isUnpublished, isDeleteDraft, rootClassName, sortingConfig, codeEditorKey, }: DeploymentTemplateHistoryType) => JSX.Element;
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, hasError, reloadTags, }: PluginTagSelectProps) => JSX.Element;
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
- hasError: boolean;
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
  */
@@ -11,4 +11,5 @@ export declare const CommonGroupedDropdownStyles: {
11
11
  multiValue: (base: any) => any;
12
12
  multiValueLabel: (base: any) => any;
13
13
  placeholder: (base: any) => any;
14
+ menu: (base: any) => any;
14
15
  };
@@ -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;
@@ -14,35 +14,35 @@ export declare const SUB_CATEGORY_LABELS: {
14
14
  export declare const SEVERITIES: {
15
15
  readonly critical: {
16
16
  readonly label: "Critical";
17
- readonly color: "#B21212";
17
+ readonly color: "var(--R700)";
18
18
  };
19
19
  readonly high: {
20
20
  readonly label: "High";
21
- readonly color: "#F33E3E";
21
+ readonly color: "var(--R500)";
22
22
  };
23
23
  readonly medium: {
24
24
  readonly label: "Medium";
25
- readonly color: "#FF7E5B";
25
+ readonly color: "var(--O500)";
26
26
  };
27
27
  readonly low: {
28
28
  readonly label: "Low";
29
- readonly color: "#FFB549";
29
+ readonly color: "var(--Y500)";
30
30
  };
31
31
  readonly unknown: {
32
32
  readonly label: "Unknown";
33
- readonly color: "#B1B7BC";
33
+ readonly color: "var(--N300)";
34
34
  };
35
35
  readonly fail: {
36
36
  readonly label: "Failures";
37
- readonly color: "#F33E3E";
37
+ readonly color: "var(--R500)";
38
38
  };
39
39
  readonly success: {
40
40
  readonly label: "Successes";
41
- readonly color: "#1DAD70";
41
+ readonly color: "var(--G500)";
42
42
  };
43
43
  readonly exceptions: {
44
44
  readonly label: "Exceptions";
45
- readonly color: "#B1B7BC";
45
+ readonly color: "var(--N300)";
46
46
  };
47
47
  };
48
48
  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: "#B1B7BC" | "#B21212" | "#F33E3E" | "#FF7E5B" | "#FFB549" | "#1DAD70";
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 bcn-50 cn-6">
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,3 @@
1
+ import { ThemeSwitcherProps } from './types';
2
+ declare const ThemeSwitcher: ({ onChange }: ThemeSwitcherProps) => JSX.Element;
3
+ export default ThemeSwitcher;
@@ -0,0 +1,6 @@
1
+ import { ReactElement } from 'react';
2
+ import { ThemePreferenceType } from '@Shared/Providers/ThemeProvider/types';
3
+ export declare const THEME_PREFERENCE_TO_ICON_MAP: Record<ThemePreferenceType, {
4
+ tippyContent: string;
5
+ icon: ReactElement;
6
+ }>;
@@ -0,0 +1 @@
1
+ export { default as ThemeSwitcher } from './ThemeSwitcher.component';
@@ -0,0 +1,3 @@
1
+ export interface ThemeSwitcherProps {
2
+ onChange: () => void;
3
+ }
@@ -49,4 +49,3 @@ export * from './DynamicDataTable';
49
49
  export * from './TagsKeyValueTable';
50
50
  export * from './FileUpload';
51
51
  export * from './AnimatedDeployButton';
52
- export * from './VirtualizedList';
@@ -17,7 +17,6 @@ export interface ClusterDTO {
17
17
  id: number;
18
18
  cluster_name: string;
19
19
  isVirtualCluster: boolean;
20
- isProd: boolean;
21
20
  }
22
21
  export interface UseGetResourceKindsOptionsProps {
23
22
  resourcesToFetch: Extract<ResourceKindType, ResourceKindType.devtronApplication | ResourceKindType.project | ResourceKindType.cluster | ResourceKindType.environment>[];
@@ -0,0 +1,3 @@
1
+ import { ThemeContextType, ThemeProviderProps } from './types';
2
+ export declare const ThemeProvider: ({ children }: ThemeProviderProps) => JSX.Element;
3
+ export declare const useTheme: () => ThemeContextType;
@@ -0,0 +1,2 @@
1
+ export declare const THEME_PREFERENCE_STORAGE_KEY = "selected-theme";
2
+ export declare const DARK_COLOR_SCHEME_MATCH_QUERY = "(prefers-color-scheme: dark)";
@@ -0,0 +1,2 @@
1
+ export * from './ThemeProvider';
2
+ export { AppThemeType } from './types';
@@ -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;
@@ -1,4 +1,5 @@
1
1
  export * from './MainContextProvider';
2
2
  export * from './ImageSelectionUtility';
3
+ export * from './ThemeProvider';
3
4
  export * from './UserEmailProvider';
4
5
  export type { MainContext } from './types';
@@ -7,10 +7,6 @@ export interface ClusterType {
7
7
  * If true, denotes virtual cluster
8
8
  */
9
9
  isVirtual: boolean;
10
- /**
11
- * If true, denotes prod labelled cluster
12
- */
13
- isProd: boolean;
14
10
  }
15
11
  /**
16
12
  * T => Type of query params