@devtron-labs/devtron-fe-common-lib 1.18.1-pre-1 → 1.18.1-pre-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.
@@ -1,7 +1,7 @@
1
1
  import { j as n, au as y, aw as k, av as M } from "./@vendor-3ORIJA0h.js";
2
2
  import W, { forwardRef as J, useMemo as P } from "react";
3
3
  import V, { getDefaultRegistry as K } from "@rjsf/core";
4
- import { T as N, j as w, c as v, b as F, S as q, i as Y, a as G, d as C, e as z } from "./@code-editor-C03TzOhp.js";
4
+ import { T as N, j as w, c as v, b as F, S as q, i as Y, a as G, d as C, e as z } from "./@code-editor-Bb96VwXB.js";
5
5
  import { getUiOptions as I, getTemplate as D, getSubmitButtonOptions as Q, ADDITIONAL_PROPERTY_FLAG as B, errorId as X, englishStringTranslator as Z, TranslatableString as ee, titleId as te, canExpand as ne, deepEquals as re } from "@rjsf/utils";
6
6
  import { ReactComponent as se } from "./assets/ic-add.cfaa779b.svg";
7
7
  import { ReactComponent as ae } from "./assets/ic-warning.ecf7ff97.svg";
@@ -2,6 +2,7 @@ import { ClusterStatusType } from '../types';
2
2
  export interface ClusterStatusAndType {
3
3
  isProd: boolean;
4
4
  status: ClusterStatusType;
5
+ isVirtualCluster?: boolean;
5
6
  }
6
7
  export interface ClusterMapProps {
7
8
  isLoading?: boolean;
@@ -12,6 +13,7 @@ export interface StatusCountEnum {
12
13
  unhealthyCount: number;
13
14
  connectionFailedCount: number;
14
15
  prodCount: number;
16
+ virtualCount: number;
15
17
  }
16
18
  export interface StatusEntity {
17
19
  value: number;
@@ -2,7 +2,7 @@ import { ClusterEntitiesTypes, ClusterStatusAndType, StatusCountEnum } from './t
2
2
  /**
3
3
  *
4
4
  * @param filteredList
5
- * @returns healthyCount, unhealthyCount, connectionFailedCount, prodCount
5
+ * @returns healthyCount, unhealthyCount, connectionFailedCount, prodCount, virtualCount
6
6
  */
7
7
  export declare const getStatusCount: (filteredList: ClusterStatusAndType[]) => StatusCountEnum;
8
8
  /**
@@ -13,7 +13,7 @@ export declare const getPipelineDeploymentsOptions: ({ pipelineDeployments, wfrI
13
13
  wfrId: number;
14
14
  }) => {
15
15
  currentDeployment: string;
16
- pipelineDeploymentsOptions: SelectPickerOptionType<number>[];
16
+ pipelineDeploymentsOptions: SelectPickerOptionType<number, import('react').ReactNode>[];
17
17
  };
18
18
  export declare const parseDeploymentHistoryDiffSearchParams: (compareWfrId: number) => (searchParams: URLSearchParams) => {
19
19
  compareWfrId: number;
@@ -0,0 +1,3 @@
1
+ import { ChipProps } from './types';
2
+ declare const Chip: ({ label, startIconProps, size: userSize, value, onRemove, style, type, onClick, capitalizeLabel, href, }: ChipProps) => JSX.Element;
3
+ export default Chip;
@@ -0,0 +1,2 @@
1
+ export { default as Chip } from './Chip.component';
2
+ export type { ChipProps } from './types';
@@ -0,0 +1,58 @@
1
+ import { MouseEvent, PropsWithChildren } from 'react';
2
+ import { ComponentSizeType } from '../../constants';
3
+ import { IconsProps } from '../Icon';
4
+ export type ChipProps = {
5
+ /**
6
+ * The label to be displayed on the chip.
7
+ * This is a required field and should be a string.
8
+ */
9
+ label: string;
10
+ /**
11
+ * The size of the chip, which determines its padding and icon size.
12
+ * @default ComponentSizeType.xs
13
+ */
14
+ size?: Extract<ComponentSizeType, ComponentSizeType.xs | ComponentSizeType.xxs>;
15
+ /**
16
+ * If style is 'error', an error icon will be displayed.
17
+ * If style is 'neutral', a start icon can be provided.
18
+ * @default 'neutral'
19
+ */
20
+ style?: 'neutral' | 'error';
21
+ startIconProps?: Pick<IconsProps, 'name' | 'color'>;
22
+ capitalizeLabel?: boolean;
23
+ } & ({
24
+ type: 'button';
25
+ href?: never;
26
+ onClick: (event: MouseEvent<HTMLButtonElement>) => void;
27
+ value?: never;
28
+ onRemove?: () => void;
29
+ } | {
30
+ type: 'link';
31
+ href: string;
32
+ onClick?: never;
33
+ value?: never;
34
+ onRemove?: never;
35
+ } | {
36
+ /**
37
+ * The type of the chip, which can be 'button', 'link', or 'non-interactive'.
38
+ * This determines the behavior of the chip when clicked.
39
+ * @default 'non-interactive'
40
+ */
41
+ type?: 'non-interactive';
42
+ href?: never;
43
+ onClick?: never;
44
+ /**
45
+ * The value to be displayed in the chip, if any.
46
+ * This is optional and can be used to show additional information.
47
+ * @default undefined
48
+ */
49
+ value?: string | number;
50
+ /**
51
+ * A function that will be called when the remove button is clicked.
52
+ * This is optional and can be used to handle the removal of the chip.
53
+ */
54
+ onRemove?: (event: MouseEvent<HTMLButtonElement>) => void;
55
+ });
56
+ export interface GetIconPropsType extends Pick<ChipProps, 'style' | 'startIconProps' | 'size'> {
57
+ }
58
+ export type ChipWrapperProps = PropsWithChildren<Required<Pick<ChipProps, 'type' | 'style' | 'onClick' | 'href' | 'size'>>>;
@@ -0,0 +1,6 @@
1
+ import { ComponentSizeType } from '../../constants';
2
+ import { ChipProps } from './types';
3
+ export declare const getIconSize: (size: ChipProps["size"]) => 14 | 16;
4
+ export declare const getPadding: (size: ChipProps["size"]) => "px-4 py-2" | "px-6 py-2";
5
+ export declare const getFontSize: (size: ChipProps["size"]) => "fs-12 lh-16" | "fs-12 lh-20";
6
+ export declare const getSupportedChipSizes: (size: ComponentSizeType) => ComponentSizeType.xxs | ComponentSizeType.xs;
@@ -1,4 +1,3 @@
1
- import { ReactNode } from 'react';
2
1
  export interface FilterChipProps {
3
2
  /**
4
3
  * Filter label
@@ -15,11 +14,11 @@ export interface FilterChipProps {
15
14
  /**
16
15
  * If passed, the label will be formatted accordingly
17
16
  */
18
- getFormattedLabel?: (filterKey: string) => ReactNode;
17
+ getFormattedLabel?: (filterKey: string) => string;
19
18
  /**
20
19
  * If passed, the label will be formatted accordingly
21
20
  */
22
- getFormattedValue?: (filterKey: string, filterValue: unknown) => ReactNode;
21
+ getFormattedValue?: (filterKey: string, filterValue: unknown) => string;
23
22
  showRemoveIcon: boolean;
24
23
  /**
25
24
  * If true, would hide the label
@@ -1,4 +1,4 @@
1
- import { ClearIndicatorProps, ControlProps, DropdownIndicatorProps, InputProps, MenuListProps, MultiValueProps, MultiValueRemoveProps, OptionProps, ValueContainerProps } from 'react-select';
1
+ import { ClearIndicatorProps, ControlProps, DropdownIndicatorProps, InputProps, MenuListProps, MultiValueProps, OptionProps, ValueContainerProps } from 'react-select';
2
2
  import { TooltipProps } from '../../../Common/Tooltip';
3
3
  import { SelectPickerGroupHeadingProps, SelectPickerOptionType, SelectPickerProps } from './type';
4
4
  export declare const getTooltipProps: (tooltipProps?: SelectPickerOptionType["tooltipProps"]) => TooltipProps;
@@ -10,8 +10,7 @@ export declare const SelectPickerValueContainer: <OptionValue, IsMulti extends b
10
10
  export declare const SelectPickerOption: <OptionValue, IsMulti extends boolean>({ disableDescriptionEllipsis, ...props }: OptionProps<SelectPickerOptionType<OptionValue>> & Pick<SelectPickerProps<OptionValue, IsMulti>, "disableDescriptionEllipsis">) => JSX.Element;
11
11
  export declare const SelectPickerMenuListFooter: ({ menuListFooterConfig, }: Required<Pick<SelectPickerProps, "menuListFooterConfig">>) => JSX.Element;
12
12
  export declare const SelectPickerMenuList: <OptionValue>(props: MenuListProps<SelectPickerOptionType<OptionValue>>) => JSX.Element;
13
- export declare const SelectPickerMultiValueLabel: <OptionValue, IsMulti extends boolean>({ getIsOptionValid, ...props }: MultiValueProps<SelectPickerOptionType<OptionValue>, true> & Pick<SelectPickerProps<OptionValue, IsMulti>["multiSelectProps"], "getIsOptionValid">) => JSX.Element;
14
- export declare const SelectPickerMultiValueRemove: (props: MultiValueRemoveProps) => JSX.Element;
13
+ export declare const SelectPickerMultiValue: <OptionValue, IsMulti extends boolean>({ getIsOptionValid, ...props }: MultiValueProps<SelectPickerOptionType<OptionValue>, true> & Pick<SelectPickerProps<OptionValue, IsMulti>["multiSelectProps"], "getIsOptionValid">) => JSX.Element;
15
14
  export declare const SelectPickerGroupHeading: <OptionValue>({ isGroupHeadingSelectable, ...props }: SelectPickerGroupHeadingProps<OptionValue>) => JSX.Element;
16
15
  export declare const renderLoadingMessage: () => JSX.Element;
17
16
  export declare const ValueContainerWithLoadingShimmer: (props: ValueContainerProps) => JSX.Element;
@@ -9,7 +9,8 @@ import { ComponentSizeType } from '../../constants';
9
9
  import { ActionMenuProps } from '../ActionMenu';
10
10
  import { ButtonComponentType, ButtonProps, ButtonVariantType } from '../Button';
11
11
  import { FormFieldWrapperProps } from '../FormFieldWrapper/types';
12
- export interface SelectPickerOptionType<OptionValue = string | number> extends OptionType<OptionValue, ReactNode> {
12
+ import { IconsProps } from '../Icon';
13
+ export interface SelectPickerOptionType<OptionValue = string | number, OptionLabel = ReactNode> extends OptionType<OptionValue, OptionLabel> {
13
14
  /**
14
15
  * Description to be displayed for the option
15
16
  */
@@ -17,11 +18,11 @@ export interface SelectPickerOptionType<OptionValue = string | number> extends O
17
18
  /**
18
19
  * Icon at the start of the option
19
20
  */
20
- startIcon?: ReactElement;
21
+ startIcon?: ReactElement<IconsProps>;
21
22
  /**
22
23
  * Icon at the end of the option
23
24
  */
24
- endIcon?: ReactElement;
25
+ endIcon?: ReactElement<IconsProps>;
25
26
  /**
26
27
  * Props passed to show the tippy on option
27
28
  */
@@ -13,6 +13,7 @@ export * from './BulkSelection';
13
13
  export * from './Button';
14
14
  export * from './ButtonWithLoader';
15
15
  export * from './ButtonWithSelector';
16
+ export * from './Chip';
16
17
  export * from './CICDHistory';
17
18
  export * from './CMCS';
18
19
  export * from './CodeEditor';