@devtron-labs/devtron-fe-common-lib 0.2.24-beta-5 → 0.2.24-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 (27) hide show
  1. package/dist/Shared/Components/Button/Button.component.d.ts +53 -0
  2. package/dist/Shared/Components/Button/constants.d.ts +5 -0
  3. package/dist/Shared/Components/Button/index.d.ts +2 -0
  4. package/dist/Shared/Components/Button/types.d.ts +65 -0
  5. package/dist/Shared/Components/Button/utils.d.ts +2 -0
  6. package/dist/Shared/Components/ButtonWithLoader/ButtonWithLoader.d.ts +5 -2
  7. package/dist/Shared/Components/index.d.ts +1 -0
  8. package/dist/Shared/constants.d.ts +3 -1
  9. package/dist/assets/index.css +1 -1
  10. package/dist/{cssMode-CFuBevFT.js → cssMode-BIBmbSAf.js} +1 -1
  11. package/dist/{freemarker2-DYqMf6XK.js → freemarker2-CIIP-rNU.js} +1 -1
  12. package/dist/{handlebars-CUYyqJCI.js → handlebars-iPrER-LT.js} +1 -1
  13. package/dist/{html-DM-YFZSs.js → html-1KDtGWDx.js} +1 -1
  14. package/dist/{htmlMode--IiQkOVX.js → htmlMode-acMWFCGr.js} +1 -1
  15. package/dist/{index-CzRnPfhm.js → index-DjfkADnL.js} +20433 -20342
  16. package/dist/index.js +495 -492
  17. package/dist/{javascript-C4hJF7h2.js → javascript-DplIQc2W.js} +1 -1
  18. package/dist/{jsonMode-CL5rJMy5.js → jsonMode-Bc0MEFn6.js} +1 -1
  19. package/dist/{liquid-D6xDzV83.js → liquid-hE9z6Dzg.js} +1 -1
  20. package/dist/{mdx-gacsF-PQ.js → mdx-DYW-46FN.js} +1 -1
  21. package/dist/{python-2bG5d3sT.js → python-D9mJvFi1.js} +1 -1
  22. package/dist/{razor-Dn2PRpu8.js → razor-CpsfL63A.js} +1 -1
  23. package/dist/{tsMode-C6nsJ-lK.js → tsMode-1C4PhGZh.js} +1 -1
  24. package/dist/{typescript-PHweVQcZ.js → typescript--iT16U3V.js} +1 -1
  25. package/dist/{xml-BMYrzLD0.js → xml-DKIsXASY.js} +1 -1
  26. package/dist/{yaml-yhks_snX.js → yaml-BSfo2zrR.js} +1 -1
  27. package/package.json +1 -1
@@ -0,0 +1,53 @@
1
+ import { ButtonProps } from './types';
2
+ /**
3
+ * Generic component for Button.
4
+ * Should be used in combination of variant, size and style.
5
+ *
6
+ * @example Default button
7
+ * ```tsx
8
+ * <Button text="Hello World" />
9
+ * ```
10
+ *
11
+ * @example Custom variant
12
+ * ```tsx
13
+ * <Button text="Hello World" variant={ButtonVariantType.secondary} />
14
+ * ```
15
+ *
16
+ * @example Custom size
17
+ * ```tsx
18
+ * <Button text="Hello World" size={ComponentSizeType.medium} />
19
+ * ```
20
+ *
21
+ * @example Custom style
22
+ * ```tsx
23
+ * <Button text="Hello World" style={ButtonStyleType.positive} />
24
+ * ```
25
+ *
26
+ * @example Disabled state
27
+ * ```tsx
28
+ * <Button text="Hello World" disabled />
29
+ * ```
30
+ *
31
+ * @example Loading state
32
+ * ```tsx
33
+ * <Button text="Hello World" isLoading />
34
+ * ```
35
+ *
36
+ * @example With start icon
37
+ * ```tsx
38
+ * <Button text="Hello World" startIcon={<ICCube />} />
39
+ * ```
40
+ *
41
+ * @example With end icon
42
+ * ```tsx
43
+ * <Button text="Hello World" endIcon={<ICCube />} />
44
+ * ```
45
+ *
46
+ * @example With tippy
47
+ * ```tsx
48
+ * <Button text="Hello World" showTippy tippyContent="Tippy content" />
49
+ * ```
50
+ *
51
+ */
52
+ declare const Button: ({ variant, size, style, text, startIcon, endIcon, disabled, isLoading, showTippy, tippyContent, type, dataTestId, ...props }: ButtonProps) => JSX.Element;
53
+ export default Button;
@@ -0,0 +1,5 @@
1
+ import { ProgressingProps } from '../../../Common/Types';
2
+ import { ButtonProps } from './types';
3
+ export declare const BUTTON_SIZE_TO_CLASS_NAME_MAP: Record<ButtonProps['size'], string>;
4
+ export declare const BUTTON_SIZE_TO_ICON_CLASS_NAME_MAP: Record<ButtonProps['size'], string>;
5
+ export declare const BUTTON_SIZE_TO_LOADER_SIZE_MAP: Record<ButtonProps['size'], ProgressingProps['size']>;
@@ -0,0 +1,2 @@
1
+ export { default as Button } from './Button.component';
2
+ export * from './types';
@@ -0,0 +1,65 @@
1
+ import { TooltipProps } from '@Common/Tooltip/types';
2
+ import { ComponentSizeType } from '../../constants';
3
+ import { ButtonHTMLAttributes, ReactElement } from 'react';
4
+ export declare enum ButtonVariantType {
5
+ primary = "primary",
6
+ secondary = "secondary",
7
+ borderLess = "border-less",
8
+ text = "text"
9
+ }
10
+ export declare enum ButtonStyleType {
11
+ default = "default",
12
+ negative = "negative",
13
+ positive = "positive",
14
+ warning = "warning",
15
+ neutral = "neutral"
16
+ }
17
+ export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'styles' | 'className'> & {
18
+ /**
19
+ * Variant of the button
20
+ *
21
+ * @default 'ButtonVariantType.primary'
22
+ */
23
+ variant?: ButtonVariantType;
24
+ /**
25
+ * Size of the button
26
+ *
27
+ * @default 'ComponentSizeType.large'
28
+ */
29
+ size?: ComponentSizeType;
30
+ /**
31
+ * Style to be applied on the button
32
+ *
33
+ * @default 'ButtonStyleType.default'
34
+ */
35
+ style?: ButtonStyleType;
36
+ /**
37
+ * Text to be displayed in the button
38
+ */
39
+ text: string;
40
+ /**
41
+ * If provided, icon to be displayed at the start of the button
42
+ */
43
+ startIcon?: ReactElement;
44
+ /**
45
+ * If provided, icon to be displayed at the end of the button
46
+ */
47
+ endIcon?: ReactElement;
48
+ /**
49
+ * If true, the loading state is shown for the button with disabled
50
+ */
51
+ isLoading?: boolean;
52
+ dataTestId: string;
53
+ } & ({
54
+ /**
55
+ * If true, the tippy is shown for the button
56
+ */
57
+ showTippy: boolean;
58
+ /**
59
+ * Tippy content to be shown for use cases like disabled etc
60
+ */
61
+ tippyContent: TooltipProps['content'];
62
+ } | {
63
+ showTippy?: never;
64
+ tippyContent?: never;
65
+ });
@@ -0,0 +1,2 @@
1
+ import { ButtonProps } from './types';
2
+ export declare const getButtonDerivedClass: ({ size, variant, style, isLoading, }: Pick<ButtonProps, "variant" | "size" | "style" | "isLoading">) => string;
@@ -1,5 +1,5 @@
1
1
  import { default as React, Component } from 'react';
2
- export interface ButtonProps {
2
+ export interface ButtonWithLoaderProps {
3
3
  disabled?: boolean;
4
4
  rootClassName: string;
5
5
  isLoading: boolean;
@@ -8,7 +8,10 @@ export interface ButtonProps {
8
8
  children?: React.ReactNode;
9
9
  type?: 'submit' | 'reset' | 'button';
10
10
  }
11
- export declare class ButtonWithLoader extends Component<ButtonProps> {
11
+ /**
12
+ * @deprecated use Button instead
13
+ */
14
+ export declare class ButtonWithLoader extends Component<ButtonWithLoaderProps> {
12
15
  constructor(props: any);
13
16
  clickHandler(event: any): void;
14
17
  render(): JSX.Element;
@@ -39,3 +39,4 @@ export * from './DetectBottom';
39
39
  export * from './EditImageFormField';
40
40
  export * from './Collapse';
41
41
  export * from './FilterButton';
42
+ export * from './Button';
@@ -387,9 +387,11 @@ export declare const ANSI_UP_REGEX: RegExp;
387
387
  * Size variants for components
388
388
  */
389
389
  export declare enum ComponentSizeType {
390
+ xs = "xs",
390
391
  small = "small",
391
392
  medium = "medium",
392
- large = "large"
393
+ large = "large",
394
+ xl = "xl"
393
395
  }
394
396
  export declare const POP_UP_MENU_MODAL_ID = "popup";
395
397
  /**