@devtron-labs/devtron-fe-common-lib 0.2.28-beta-1 → 0.2.28-beta-2

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 (31) hide show
  1. package/dist/Shared/Components/Button/Button.component.d.ts +6 -1
  2. package/dist/Shared/Components/Button/constants.d.ts +3 -0
  3. package/dist/Shared/Components/Button/types.d.ts +29 -12
  4. package/dist/Shared/Components/Button/utils.d.ts +3 -1
  5. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.d.ts +2 -2
  6. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.d.ts +8 -9
  7. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffAccordion.d.ts +1 -1
  8. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.d.ts +2 -2
  9. package/dist/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.d.ts +2 -2
  10. package/dist/Shared/Components/DeploymentConfigDiff/index.d.ts +1 -1
  11. package/dist/Shared/Components/DeploymentConfigDiff/{DeploymentConfigDiff.types.d.ts → types.d.ts} +3 -27
  12. package/dist/Shared/Services/app.types.d.ts +1 -7
  13. package/dist/assets/index.css +1 -1
  14. package/dist/{cssMode-x8378mRl.js → cssMode-MB8v0uTL.js} +1 -1
  15. package/dist/{freemarker2-BWsQwmW-.js → freemarker2-DrdweWp7.js} +1 -1
  16. package/dist/{handlebars-BDhqy8Pp.js → handlebars-BGEOfj8k.js} +1 -1
  17. package/dist/{html-_nNQZvac.js → html-BTcZSQT_.js} +1 -1
  18. package/dist/{htmlMode-oL0lUZeW.js → htmlMode-DP3WIb8i.js} +1 -1
  19. package/dist/{index-BNnOSqx-.js → index-C2Hutn-O.js} +13405 -13431
  20. package/dist/index.js +1 -1
  21. package/dist/{javascript-BNxvYyZY.js → javascript-C-ICy_0j.js} +1 -1
  22. package/dist/{jsonMode-CQuBEu2q.js → jsonMode-DYQspZyv.js} +1 -1
  23. package/dist/{liquid-C_-ar4Ha.js → liquid-kKxJKiz0.js} +1 -1
  24. package/dist/{mdx-BPqZssj9.js → mdx-DP56SVnr.js} +1 -1
  25. package/dist/{python-CQlGPf4O.js → python-C1eDGU0a.js} +1 -1
  26. package/dist/{razor-V1NLlDSz.js → razor-CxaKOHbe.js} +1 -1
  27. package/dist/{tsMode-B8ealB6l.js → tsMode-C6t8gJqn.js} +1 -1
  28. package/dist/{typescript-B67H0-4r.js → typescript-CXR057QG.js} +1 -1
  29. package/dist/{xml-BBa31qjI.js → xml-CQfuL8pN.js} +1 -1
  30. package/dist/{yaml-H2jvWEXT.js → yaml-B59wpmh_.js} +1 -1
  31. package/package.json +1 -1
@@ -57,6 +57,11 @@ import { ButtonProps } from './types';
57
57
  * ```tsx
58
58
  * <Button component={ButtonComponentType.link} linkProps={{ to: '#' }} />
59
59
  * ```
60
+ *
61
+ * @example Icon button
62
+ * ```tsx
63
+ * <Button icon={<ICCube />} ariaLabel="Label" />
64
+ * ```
60
65
  */
61
- declare const Button: ({ dataTestId, text, variant, size, style, startIcon, endIcon, disabled, isLoading, showTooltip, tooltipProps, ...props }: ButtonProps) => JSX.Element;
66
+ declare const Button: ({ dataTestId, text, variant, size, style, startIcon, endIcon, disabled, isLoading, showTooltip, tooltipProps, icon, ariaLabel, ...props }: ButtonProps) => JSX.Element;
62
67
  export default Button;
@@ -1,5 +1,8 @@
1
1
  import { ProgressingProps } from '../../../Common/Types';
2
2
  import { ButtonProps } from './types';
3
3
  export declare const BUTTON_SIZE_TO_CLASS_NAME_MAP: Record<ButtonProps['size'], string>;
4
+ export declare const ICON_BUTTON_SIZE_TO_CLASS_NAME_MAP: Record<ButtonProps['size'], string>;
4
5
  export declare const BUTTON_SIZE_TO_ICON_CLASS_NAME_MAP: Record<ButtonProps['size'], string>;
6
+ export declare const ICON_BUTTON_SIZE_TO_ICON_CLASS_NAME_MAP: Record<ButtonProps['size'], string>;
5
7
  export declare const BUTTON_SIZE_TO_LOADER_SIZE_MAP: Record<ButtonProps['size'], ProgressingProps['size']>;
8
+ export declare const ICON_BUTTON_SIZE_TO_LOADER_SIZE_MAP: Record<ButtonProps['size'], ProgressingProps['size']>;
@@ -11,6 +11,7 @@ export declare enum ButtonVariantType {
11
11
  export declare enum ButtonStyleType {
12
12
  default = "default",
13
13
  negative = "negative",
14
+ negativeGrey = "negative-grey",
14
15
  positive = "positive",
15
16
  warning = "warning",
16
17
  neutral = "neutral"
@@ -59,18 +60,6 @@ export type ButtonProps = ({
59
60
  * @default ButtonStyleType.default
60
61
  */
61
62
  style?: ButtonStyleType;
62
- /**
63
- * Text to be displayed in the button
64
- */
65
- text: string;
66
- /**
67
- * If provided, icon to be displayed at the start of the button
68
- */
69
- startIcon?: ReactElement;
70
- /**
71
- * If provided, icon to be displayed at the end of the button
72
- */
73
- endIcon?: ReactElement;
74
63
  /**
75
64
  * If true, the loading state is shown for the button with disabled
76
65
  */
@@ -97,4 +86,32 @@ export type ButtonProps = ({
97
86
  } | {
98
87
  showTooltip?: never;
99
88
  tooltipProps?: never;
89
+ }) & ({
90
+ icon?: never;
91
+ ariaLabel?: never;
92
+ /**
93
+ * Text to be displayed in the button
94
+ */
95
+ text: string;
96
+ /**
97
+ * If provided, icon to be displayed at the start of the button
98
+ */
99
+ startIcon?: ReactElement;
100
+ /**
101
+ * If provided, icon to be displayed at the end of the button
102
+ */
103
+ endIcon?: ReactElement;
104
+ } | {
105
+ /**
106
+ * If provided, icon button is rendered
107
+ */
108
+ icon: ReactElement;
109
+ /**
110
+ * Label for the icon button for accessibility.
111
+ * Shown on hover in tooltip if tippy is not provided explicitly
112
+ */
113
+ ariaLabel: string;
114
+ text?: never;
115
+ startIcon?: never;
116
+ endIcon?: never;
100
117
  });
@@ -1,2 +1,4 @@
1
1
  import { ButtonProps } from './types';
2
- export declare const getButtonDerivedClass: ({ size, variant, style, isLoading, }: Pick<ButtonProps, "variant" | "size" | "style" | "isLoading">) => string;
2
+ export declare const getButtonIconClassName: ({ size, icon }: Pick<ButtonProps, "size" | "icon">) => string;
3
+ export declare const getButtonLoaderSize: ({ size, icon }: Pick<ButtonProps, "size" | "icon">) => number;
4
+ export declare const getButtonDerivedClass: ({ size, variant, style, isLoading, icon, }: Pick<ButtonProps, "variant" | "size" | "style" | "isLoading" | "icon">) => string;
@@ -1,2 +1,2 @@
1
- import { DeploymentConfigDiffProps } from './DeploymentConfigDiff.types';
2
- export declare const DeploymentConfigDiff: ({ isLoading, configList, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, tabConfig, ...resProps }: DeploymentConfigDiffProps) => JSX.Element;
1
+ import { DeploymentConfigDiffProps } from './types';
2
+ export declare const DeploymentConfigDiff: ({ isLoading, configList, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, ...resProps }: DeploymentConfigDiffProps) => JSX.Element;
@@ -1,5 +1,6 @@
1
- import { AppEnvDeploymentConfigListParams, DeploymentConfigDiffProps } from '..';
2
- import { ConfigMapSecretDataConfigDatumDTO, TemplateListDTO } from '../../Services/app.types';
1
+ import { SortingOrder } from '../../../Common/Constants';
2
+ import { DeploymentConfigDiffProps } from '..';
3
+ import { AppEnvDeploymentConfigDTO, ConfigMapSecretDataConfigDatumDTO, EnvResourceType, TemplateListDTO } from '../../Services/app.types';
3
4
  /**
4
5
  * Retrieves the draft data from the given configuration data object.
5
6
  *
@@ -18,16 +19,14 @@ export declare const mergeConfigDataArraysByName: (primaryArray: ConfigMapSecret
18
19
  /**
19
20
  * Generates a list of deployment configurations for application environments and identifies changes between the current and compare lists.
20
21
  *
21
- * @param params - An object containing the following properties:
22
- * @param params.currentList - The current deployment configuration list.
23
- * @param params.compareList - The deployment configuration list to compare against.
24
- * @param params.getNavItemHref - A function to generate navigation item URLs based on the resource type and resource name.
25
- * @param params.isManifestView - A boolean that, when true, modifies the output for a manifest view.
26
- * @param params.sortOrder - (Optional) The order in which to sort the deployment templates.
22
+ * @param currentList - The current deployment configuration list.
23
+ * @param compareList - The deployment configuration list to compare against.
24
+ * @param getNavItemHref - A function to generate navigation item URLs based on the resource type and resource name.
25
+ * @param sortOrder - (Optional) The order in which to sort the deployment templates.
27
26
  *
28
27
  * @returns An object containing the combined deployment configuration list, a collapsible navigation list, and a navigation list.
29
28
  */
30
- export declare const getAppEnvDeploymentConfigList: <ManifestView extends boolean = false>({ currentList, compareList, getNavItemHref, isManifestView, sortOrder, }: AppEnvDeploymentConfigListParams<ManifestView>) => {
29
+ export declare const getAppEnvDeploymentConfigList: (currentList: AppEnvDeploymentConfigDTO, compareList: AppEnvDeploymentConfigDTO, getNavItemHref: (resourceType: EnvResourceType, resourceName: string) => string, sortOrder?: SortingOrder) => {
31
30
  configList: DeploymentConfigDiffProps["configList"];
32
31
  navList: DeploymentConfigDiffProps["navList"];
33
32
  collapsibleNavList: DeploymentConfigDiffProps["collapsibleNavList"];
@@ -1,2 +1,2 @@
1
- import { DeploymentConfigDiffAccordionProps } from './DeploymentConfigDiff.types';
1
+ import { DeploymentConfigDiffAccordionProps } from './types';
2
2
  export declare const DeploymentConfigDiffAccordion: import('react').ForwardRefExoticComponent<DeploymentConfigDiffAccordionProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,2 +1,2 @@
1
- import { DeploymentConfigDiffMainProps } from './DeploymentConfigDiff.types';
2
- export declare const DeploymentConfigDiffMain: ({ isLoading, errorConfig, headerText, configList, selectorsConfig, sortingConfig, scrollIntoViewId, }: DeploymentConfigDiffMainProps) => JSX.Element;
1
+ import { DeploymentConfigDiffMainProps } from './types';
2
+ export declare const DeploymentConfigDiffMain: ({ isLoading, headerText, configList, selectorsConfig, sortingConfig, scrollIntoViewId, }: DeploymentConfigDiffMainProps) => JSX.Element;
@@ -1,2 +1,2 @@
1
- import { DeploymentConfigDiffNavigationProps } from './DeploymentConfigDiff.types';
2
- export declare const DeploymentConfigDiffNavigation: ({ isLoading, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, tabConfig, }: DeploymentConfigDiffNavigationProps) => JSX.Element;
1
+ import { DeploymentConfigDiffNavigationProps } from './types';
2
+ export declare const DeploymentConfigDiffNavigation: ({ isLoading, collapsibleNavList, navList, goBackURL, navHeading, navHelpText, }: DeploymentConfigDiffNavigationProps) => JSX.Element;
@@ -1,3 +1,3 @@
1
1
  export * from './DeploymentConfigDiff.component';
2
- export * from './DeploymentConfigDiff.types';
2
+ export * from './types';
3
3
  export * from './DeploymentConfigDiff.utils';
@@ -1,5 +1,5 @@
1
1
  import { SortingOrder } from '../../../Common/Constants';
2
- import { AppEnvDeploymentConfigDTO, ConfigMapSecretDataConfigDatumDTO, DeploymentTemplateDTO, EnvResourceType, ManifestTemplateDTO } from '../../Services';
2
+ import { ConfigMapSecretDataConfigDatumDTO, DeploymentTemplateDTO } from '../../Services';
3
3
  import { DeploymentHistoryDetail } from '../CICDHistory';
4
4
  import { CollapsibleListConfig, CollapsibleListItem } from '../CollapsibleList';
5
5
  import { SelectPickerProps } from '../SelectPicker';
@@ -35,11 +35,6 @@ export interface DeploymentConfigDiffNavigationCollapsibleItem extends Pick<Coll
35
35
  }
36
36
  export interface DeploymentConfigDiffProps {
37
37
  isLoading?: boolean;
38
- errorConfig?: {
39
- error: boolean;
40
- code: number;
41
- reload: () => void;
42
- };
43
38
  configList: DeploymentConfigListItem[];
44
39
  headerText?: string;
45
40
  scrollIntoViewId?: string;
@@ -57,17 +52,10 @@ export interface DeploymentConfigDiffProps {
57
52
  goBackURL?: string;
58
53
  navHeading: string;
59
54
  navHelpText?: string;
60
- tabConfig?: {
61
- tabs: {
62
- value: string;
63
- href: string;
64
- }[];
65
- onClick: (tab: string) => void;
66
- };
67
55
  }
68
- export interface DeploymentConfigDiffNavigationProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'navList' | 'collapsibleNavList' | 'goBackURL' | 'navHeading' | 'navHelpText' | 'tabConfig'> {
56
+ export interface DeploymentConfigDiffNavigationProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'navList' | 'collapsibleNavList' | 'goBackURL' | 'navHeading' | 'navHelpText'> {
69
57
  }
70
- export interface DeploymentConfigDiffMainProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'errorConfig' | 'headerText' | 'configList' | 'scrollIntoViewId' | 'selectorsConfig' | 'sortingConfig'> {
58
+ export interface DeploymentConfigDiffMainProps extends Pick<DeploymentConfigDiffProps, 'isLoading' | 'headerText' | 'configList' | 'scrollIntoViewId' | 'selectorsConfig' | 'sortingConfig'> {
71
59
  }
72
60
  export interface DeploymentConfigDiffAccordionProps extends Pick<CollapseProps, 'onTransitionEnd'> {
73
61
  id: string;
@@ -78,15 +66,3 @@ export interface DeploymentConfigDiffAccordionProps extends Pick<CollapseProps,
78
66
  onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
79
67
  }
80
68
  export type DiffHeadingDataType<DeploymentTemplate> = DeploymentTemplate extends true ? DeploymentTemplateDTO : ConfigMapSecretDataConfigDatumDTO;
81
- export type AppEnvDeploymentConfigListParams<IsManifestView> = (IsManifestView extends true ? {
82
- currentList: ManifestTemplateDTO;
83
- compareList: ManifestTemplateDTO;
84
- sortOrder?: never;
85
- } : {
86
- currentList: AppEnvDeploymentConfigDTO;
87
- compareList: AppEnvDeploymentConfigDTO;
88
- sortOrder?: SortingOrder;
89
- }) & {
90
- getNavItemHref: (resourceType: EnvResourceType, resourceName: string) => string;
91
- isManifestView?: IsManifestView;
92
- };
@@ -197,11 +197,6 @@ export interface TemplateListDTO {
197
197
  status?: string;
198
198
  pipelineId?: number;
199
199
  }
200
- export interface ManifestTemplateDTO {
201
- data: string;
202
- resolvedData: string;
203
- variableSnapshot: null;
204
- }
205
200
  export declare enum DraftState {
206
201
  Init = 1,
207
202
  Discarded = 2,
@@ -211,7 +206,6 @@ export declare enum DraftState {
211
206
  export declare enum EnvResourceType {
212
207
  ConfigMap = "configmap",
213
208
  Secret = "secrets",
214
- DeploymentTemplate = "deployment-template",
215
- Manifest = "manifest"
209
+ DeploymentTemplate = "deployment-template"
216
210
  }
217
211
  export {};