@devtron-labs/devtron-fe-common-lib 1.6.1-beta-1 → 1.6.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.
Files changed (30) hide show
  1. package/dist/{@code-editor-Bbs0NH9g.js → @code-editor-DPKpPiDK.js} +8211 -8318
  2. package/dist/{@common-rjsf-D15keJJ7.js → @common-rjsf-DVcfQ6kR.js} +1 -1
  3. package/dist/Common/CustomInput/CustomInput.d.ts +2 -0
  4. package/dist/Common/CustomInput/Types.d.ts +30 -0
  5. package/dist/Common/CustomInput/index.d.ts +2 -0
  6. package/dist/Common/Hooks/useUrlFilters/types.d.ts +1 -11
  7. package/dist/Common/Hooks/useUrlFilters/useUrlFilters.d.ts +1 -1
  8. package/dist/Common/RJSF/Form.d.ts +1 -1
  9. package/dist/Common/Tooltip/index.d.ts +0 -1
  10. package/dist/Common/index.d.ts +1 -0
  11. package/dist/Shared/Components/Button/Button.component.d.ts +2 -2
  12. package/dist/Shared/Components/Button/types.d.ts +10 -14
  13. package/dist/Shared/Components/Button/utils.d.ts +1 -3
  14. package/dist/Shared/Components/FormFieldWrapper/FormFieldLabel.d.ts +1 -1
  15. package/dist/Shared/Components/FormFieldWrapper/FormFieldWrapper.d.ts +1 -1
  16. package/dist/Shared/Components/FormFieldWrapper/types.d.ts +4 -20
  17. package/dist/Shared/Components/SelectPicker/SelectPicker.component.d.ts +1 -1
  18. package/dist/Shared/Components/Textarea/Textarea.component.d.ts +1 -1
  19. package/dist/Shared/Components/index.d.ts +0 -1
  20. package/dist/Shared/Services/ToastManager/types.d.ts +3 -3
  21. package/dist/assets/@code-editor.css +1 -1
  22. package/dist/index.js +432 -433
  23. package/package.json +3 -3
  24. package/dist/Shared/Components/CustomInput/CustomInput.d.ts +0 -3
  25. package/dist/Shared/Components/CustomInput/PasswordField.d.ts +0 -3
  26. package/dist/Shared/Components/CustomInput/constants.d.ts +0 -3
  27. package/dist/Shared/Components/CustomInput/index.d.ts +0 -3
  28. package/dist/Shared/Components/CustomInput/types.d.ts +0 -36
  29. package/dist/assets/ic-visibility-off.d91d3844.svg +0 -19
  30. package/dist/assets/ic-visibility-on.7505dd12.svg +0 -20
@@ -2,7 +2,7 @@ import { j as t, O as $ } from "./@vendor-CKSERKp7.js";
2
2
  import A, { forwardRef as E } from "react";
3
3
  import L, { getDefaultRegistry as D } from "@rjsf/core";
4
4
  import H from "@rjsf/validator-ajv8";
5
- import { T, c as U, a as k, i as J, b as y, d as S } from "./@code-editor-Bbs0NH9g.js";
5
+ import { T, c as U, a as k, i as J, b as y, d as S } from "./@code-editor-DPKpPiDK.js";
6
6
  import M, { components as B } from "react-select";
7
7
  import { ReactComponent as V } from "./assets/ic-chevron-down.fc70d7a7.svg";
8
8
  import { getUiOptions as C, getTemplate as I, getSubmitButtonOptions as W, ADDITIONAL_PROPERTY_FLAG as P, errorId as q, englishStringTranslator as K, TranslatableString as Y, titleId as z, canExpand as G, deepEquals as Q } from "@rjsf/utils";
@@ -0,0 +1,2 @@
1
+ import { CustomInputProps } from './Types';
2
+ export declare const CustomInput: ({ name, value, error, onChange, onFocus, label, type, disabled, labelClassName, placeholder, tabIndex, dataTestid, isRequiredField, autoFocus, rootClassName, autoComplete, helperText, onBlur, readOnly, noTrim, onKeyPress, defaultValue, onKeyDown, required, additionalErrorInfo, inputWrapClassName, inputProps, }: CustomInputProps) => JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { default as React, HTMLInputTypeAttribute, InputHTMLAttributes, ReactNode } from 'react';
2
+ export interface CustomInputProps {
3
+ name: string;
4
+ value: string | number;
5
+ onChange: (e: any) => void;
6
+ onFocus?: (e: any) => void;
7
+ autoComplete?: string;
8
+ label?: string | React.ReactNode;
9
+ labelClassName?: string;
10
+ type?: HTMLInputTypeAttribute;
11
+ disabled?: boolean;
12
+ placeholder?: string;
13
+ tabIndex?: number;
14
+ dataTestid?: string;
15
+ isRequiredField?: boolean;
16
+ autoFocus?: boolean;
17
+ rootClassName?: string;
18
+ error?: string[] | string;
19
+ helperText?: ReactNode;
20
+ onBlur?: (e: any) => void;
21
+ readOnly?: boolean;
22
+ noTrim?: boolean;
23
+ onKeyPress?: (e: any) => void;
24
+ defaultValue?: string | number | ReadonlyArray<string> | undefined;
25
+ onKeyDown?: (e: any) => void;
26
+ required?: boolean;
27
+ additionalErrorInfo?: React.ReactNode;
28
+ inputWrapClassName?: string;
29
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
30
+ }
@@ -0,0 +1,2 @@
1
+ export * from './CustomInput';
2
+ export * from './Types';
@@ -8,18 +8,8 @@ export interface UseUrlFiltersProps<T, K> {
8
8
  * Callback function for parsing the search params
9
9
  */
10
10
  parseSearchParams?: (searchParams: URLSearchParams) => K;
11
- /**
12
- * Local storage key to store the filters
13
- */
14
11
  localStorageKey?: `${string}__${string}`;
15
- /**
16
- * Method to be used for redirection in case of filter update
17
- *
18
- * @default 'replace'
19
- */
20
- redirectionMethod?: 'replace' | 'push';
21
12
  }
22
- export type UpdateSearchParamsOptionsType<T, K = unknown> = Partial<Pick<UseUrlFiltersProps<T, K>, 'redirectionMethod'>>;
23
13
  export type UseUrlFiltersReturnType<T, K = unknown> = K & {
24
14
  /**
25
15
  * Currently applied page size
@@ -66,5 +56,5 @@ export type UseUrlFiltersReturnType<T, K = unknown> = K & {
66
56
  /**
67
57
  * Update the search params with the passed object
68
58
  */
69
- updateSearchParams: (paramsToSerialize: Partial<K>, options?: UpdateSearchParamsOptionsType<T, K>) => void;
59
+ updateSearchParams: (paramsToSerialize: Partial<K>) => void;
70
60
  };
@@ -16,5 +16,5 @@ import { UseUrlFiltersProps, UseUrlFiltersReturnType } from './types';
16
16
  * ```
17
17
  *
18
18
  */
19
- declare const useUrlFilters: <T = string, K = unknown>({ initialSortKey, parseSearchParams, localStorageKey, redirectionMethod, }?: UseUrlFiltersProps<T, K>) => UseUrlFiltersReturnType<T, K>;
19
+ declare const useUrlFilters: <T = string, K = unknown>({ initialSortKey, parseSearchParams, localStorageKey, }?: UseUrlFiltersProps<T, K>) => UseUrlFiltersReturnType<T, K>;
20
20
  export default useUrlFilters;
@@ -1,3 +1,3 @@
1
1
  import { default as RJSF } from '@rjsf/core';
2
2
  import { FormProps } from './types';
3
- export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "id" | "children" | "className" | "disabled" | "target" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "action" | "autoComplete" | "tagName" | "method" | "noValidate" | "readonly" | "schema" | "uiSchema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<unknown, import('json-schema').JSONSchema7, import('@rjsf/utils').GenericObjectType>>>;
3
+ export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "id" | "children" | "className" | "disabled" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "target" | "action" | "autoComplete" | "tagName" | "method" | "noValidate" | "readonly" | "schema" | "uiSchema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<unknown, import('json-schema').JSONSchema7, import('@rjsf/utils').GenericObjectType>>>;
@@ -1,3 +1,2 @@
1
1
  export { default as Tooltip } from './Tooltip';
2
2
  export { TOOLTIP_CONTENTS } from './constants';
3
- export type { TooltipProps } from './types';
@@ -43,6 +43,7 @@ export * from './RJSF';
43
43
  export * from './DevtronProgressing';
44
44
  export { default as ChartVersionAndTypeSelector } from './ChartVersionAndTypeSelector';
45
45
  export * from './AddCDButton';
46
+ export * from './CustomInput';
46
47
  export * from './DraggableWrapper';
47
48
  export * from './Pagination';
48
49
  export * from './Markdown';
@@ -1,4 +1,4 @@
1
- import { ButtonComponentType, ButtonProps } from './types';
1
+ import { ButtonProps } from './types';
2
2
  /**
3
3
  * Generic component for Button.
4
4
  * Should be used in combination of variant, size and style.
@@ -63,5 +63,5 @@ import { ButtonComponentType, ButtonProps } from './types';
63
63
  * <Button icon={<ICCube />} ariaLabel="Label" />
64
64
  * ```
65
65
  */
66
- declare const Button: <ComponentType extends ButtonComponentType>({ dataTestId, text, variant, size, style, startIcon, endIcon, disabled, isLoading, showTooltip, tooltipProps, icon, ariaLabel, showAriaLabelInTippy, fullWidth, isOpacityHoverChild, triggerAutoClickTimestamp, ...props }: ButtonProps<ComponentType>) => JSX.Element;
66
+ declare const Button: ({ dataTestId, text, variant, size, style, startIcon, endIcon, disabled, isLoading, showTooltip, tooltipProps, icon, ariaLabel, showAriaLabelInTippy, fullWidth, isOpacityHoverChild, ...props }: ButtonProps) => JSX.Element;
67
67
  export default Button;
@@ -20,27 +20,27 @@ export declare enum ButtonComponentType {
20
20
  button = "button",
21
21
  link = "link"
22
22
  }
23
- export type ButtonProps<ComponentType extends ButtonComponentType = ButtonComponentType.button> = (ComponentType extends ButtonComponentType.link ? {
24
- component: ButtonComponentType.link;
25
- /**
26
- * Props for the link component
27
- */
28
- linkProps: Omit<LinkProps, 'children' | 'styles' | 'className' | 'onClick'>;
29
- buttonProps?: never;
30
- onClick?: LinkProps['onClick'];
31
- } : {
23
+ export type ButtonProps = ({
32
24
  /**
33
25
  * Component to be rendered from the available options
34
26
  *
35
27
  * @default ButtonComponentType.button
36
28
  */
37
- component?: ComponentType | never;
29
+ component?: ButtonComponentType.button | never;
38
30
  /**
39
31
  * Props for the button component
40
32
  */
41
33
  buttonProps?: Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'styles' | 'className' | 'disabled' | 'onClick'>;
42
34
  linkProps?: never;
43
35
  onClick?: ButtonHTMLAttributes<HTMLButtonElement>['onClick'];
36
+ } | {
37
+ component: ButtonComponentType.link;
38
+ /**
39
+ * Props for the link component
40
+ */
41
+ linkProps: Omit<LinkProps, 'children' | 'styles' | 'className' | 'onClick'>;
42
+ buttonProps?: never;
43
+ onClick?: LinkProps['onClick'];
44
44
  }) & {
45
45
  /**
46
46
  * Variant of the button
@@ -86,10 +86,6 @@ export type ButtonProps<ComponentType extends ButtonComponentType = ButtonCompon
86
86
  * @default false
87
87
  */
88
88
  isOpacityHoverChild?: boolean;
89
- /**
90
- * If provided, the button is clicked automatically after the pre-defined time
91
- */
92
- triggerAutoClickTimestamp?: number | null;
93
89
  } & ({
94
90
  /**
95
91
  * If true, the tooltip is shown for the button
@@ -1,6 +1,4 @@
1
1
  import { ButtonProps } from './types';
2
2
  export declare const getButtonIconClassName: ({ size, icon }: Pick<ButtonProps, "size" | "icon">) => string;
3
3
  export declare const getButtonLoaderSize: ({ size, icon }: Pick<ButtonProps, "size" | "icon">) => number;
4
- export declare const getButtonDerivedClass: ({ size, variant, style, isLoading, icon, isAutoTriggerActive, }: Required<Pick<ButtonProps, "variant" | "size" | "style" | "isLoading" | "icon"> & {
5
- isAutoTriggerActive: boolean;
6
- }>) => string;
4
+ export declare const getButtonDerivedClass: ({ size, variant, style, isLoading, icon, }: Pick<ButtonProps, "variant" | "size" | "style" | "isLoading" | "icon">) => string;
@@ -1,3 +1,3 @@
1
1
  import { FormFieldLabelProps } from './types';
2
- declare const FormFieldLabel: ({ label, inputId, required, layout, labelTooltipConfig, labelTippyCustomizedConfig, }: FormFieldLabelProps) => JSX.Element;
2
+ declare const FormFieldLabel: ({ label, inputId, required, layout }: FormFieldLabelProps) => JSX.Element;
3
3
  export default FormFieldLabel;
@@ -1,3 +1,3 @@
1
1
  import { FormFieldWrapperProps } from './types';
2
- declare const FormFieldWrapper: ({ layout, fullWidth, label, inputId, error, helperText, warningText, required, children, labelTippyCustomizedConfig, labelTooltipConfig, }: Required<FormFieldWrapperProps>) => JSX.Element;
2
+ declare const FormFieldWrapper: ({ layout, fullWidth, label, inputId, error, helperText, warningText, required, children, }: Required<FormFieldWrapperProps>) => JSX.Element;
3
3
  export default FormFieldWrapper;
@@ -1,5 +1,3 @@
1
- import { TooltipProps } from '../../../Common/Tooltip';
2
- import { TippyCustomizedProps } from '../../../Common/Types';
3
1
  import { ReactElement, ReactNode } from 'react';
4
2
  export type LabelOrAriaLabelType = {
5
3
  label: ReactNode;
@@ -8,8 +6,7 @@ export type LabelOrAriaLabelType = {
8
6
  label?: never;
9
7
  ariaLabel: string;
10
8
  };
11
- type LayoutType = 'row' | 'column';
12
- export type FormFieldLabelProps<Layout extends LayoutType = LayoutType> = LabelOrAriaLabelType & {
9
+ export type FormFieldLabelProps = LabelOrAriaLabelType & {
13
10
  /**
14
11
  * If true, the field is required and * is shown with the label
15
12
  */
@@ -21,20 +18,8 @@ export type FormFieldLabelProps<Layout extends LayoutType = LayoutType> = LabelO
21
18
  /**
22
19
  * Layout of the field
23
20
  */
24
- layout?: Layout;
25
- } & (Layout extends 'row' ? {
26
- /**
27
- * Tooltip configuration for the label in row layout
28
- */
29
- labelTooltipConfig?: Omit<TooltipProps, 'alwaysShowTippyOnHover' | 'showOnTruncate' | 'shortcutKeyCombo'>;
30
- labelTippyCustomizedConfig?: never;
31
- } : {
32
- labelTooltipConfig?: never;
33
- /**
34
- * Tippy configuration for the label in column layout
35
- */
36
- labelTippyCustomizedConfig?: Pick<TippyCustomizedProps, 'heading' | 'infoText' | 'documentationLink' | 'documentationLinkText'>;
37
- });
21
+ layout?: 'row' | 'column';
22
+ };
38
23
  export interface FormFieldInfoProps extends Pick<FormFieldLabelProps, 'inputId'> {
39
24
  /**
40
25
  * Error message for the field
@@ -55,7 +40,7 @@ export interface FormInfoItemProps {
55
40
  textClass: string;
56
41
  icon: ReactElement;
57
42
  }
58
- export interface FormFieldWrapperProps extends Pick<FormFieldLabelProps, 'label' | 'required' | 'ariaLabel' | 'layout' | 'labelTippyCustomizedConfig' | 'labelTooltipConfig'>, FormFieldInfoProps {
43
+ export interface FormFieldWrapperProps extends Pick<FormFieldLabelProps, 'label' | 'required' | 'ariaLabel' | 'layout'>, FormFieldInfoProps {
59
44
  /**
60
45
  * If true, the field takes the full width of the parent
61
46
  */
@@ -88,4 +73,3 @@ export interface FormFieldWrapperProps extends Pick<FormFieldLabelProps, 'label'
88
73
  left?: boolean;
89
74
  };
90
75
  }
91
- export {};
@@ -134,5 +134,5 @@ import { SelectPickerProps } from './type';
134
134
  * />
135
135
  * ```
136
136
  */
137
- declare const SelectPicker: <OptionValue, IsMulti extends boolean>({ error, icon, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, optionListError, reloadOptionList, menuPosition, variant, disableDescriptionEllipsis, multiSelectProps, isMulti, name, classNamePrefix, shouldRenderCustomOptions, isSearchable, selectRef, shouldMenuAlignRight, fullWidth, customSelectedOptionsCount, renderMenuListFooter, isCreatable, onCreateOption, closeMenuOnSelect, shouldShowNoOptionsMessage, shouldRenderTextArea, onKeyDown, shouldHideMenu, warningText, layout, ariaLabel, borderRadiusConfig, labelTippyCustomizedConfig, labelTooltipConfig, ...props }: SelectPickerProps<OptionValue, IsMulti>) => JSX.Element;
137
+ declare const SelectPicker: <OptionValue, IsMulti extends boolean>({ error, icon, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, optionListError, reloadOptionList, menuPosition, variant, disableDescriptionEllipsis, multiSelectProps, isMulti, name, classNamePrefix, shouldRenderCustomOptions, isSearchable, selectRef, shouldMenuAlignRight, fullWidth, customSelectedOptionsCount, renderMenuListFooter, isCreatable, onCreateOption, closeMenuOnSelect, shouldShowNoOptionsMessage, shouldRenderTextArea, onKeyDown, shouldHideMenu, warningText, layout, ariaLabel, borderRadiusConfig, ...props }: SelectPickerProps<OptionValue, IsMulti>) => JSX.Element;
138
138
  export default SelectPicker;
@@ -1,3 +1,3 @@
1
1
  import { TextareaProps } from './types';
2
- declare const Textarea: ({ name, label, fullWidth, error, helperText, warningText, layout, required, onBlur, shouldTrim, size, ariaLabel, borderRadiusConfig, labelTooltipConfig, labelTippyCustomizedConfig, ...props }: TextareaProps) => JSX.Element;
2
+ declare const Textarea: ({ name, label, fullWidth, error, helperText, warningText, layout, required, onBlur, shouldTrim, size, ariaLabel, borderRadiusConfig, ...props }: TextareaProps) => JSX.Element;
3
3
  export default Textarea;
@@ -60,4 +60,3 @@ export * from './ThemeSwitcher';
60
60
  export * from './TargetPlatforms';
61
61
  export * from './UnsavedChanges';
62
62
  export * from './UnsavedChangesDialog';
63
- export * from './CustomInput';
@@ -1,4 +1,4 @@
1
- import { ButtonComponentType, ButtonProps } from '../../Components';
1
+ import { ButtonProps } from '../../Components';
2
2
  import { ReactElement } from 'react';
3
3
  export declare enum ToastVariantType {
4
4
  info = "info",
@@ -30,9 +30,9 @@ export interface ToastProps {
30
30
  /**
31
31
  * Props for the action button to be displayed in the toast
32
32
  *
33
- * Note: Size, variant and style are hard-coded and cannot be overridden
33
+ * Note: Size, variant and style are hard-coded and cannot be overriden
34
34
  */
35
- buttonProps?: ButtonProps<ButtonComponentType>;
35
+ buttonProps?: ButtonProps;
36
36
  /**
37
37
  * Custom progress bar color
38
38
  */