@devtron-labs/devtron-fe-common-lib 0.2.30-beta-2 → 0.2.30-beta-4
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.
- package/dist/Common/ToastBody.d.ts +1 -1
- package/dist/Shared/Components/Button/Button.component.d.ts +6 -1
- package/dist/Shared/Components/Button/constants.d.ts +3 -0
- package/dist/Shared/Components/Button/types.d.ts +29 -12
- package/dist/Shared/Components/Button/utils.d.ts +3 -1
- package/dist/Shared/Services/ToastManager/ToastContent.d.ts +2 -0
- package/dist/Shared/Services/ToastManager/constants.d.ts +4 -0
- package/dist/Shared/Services/ToastManager/index.d.ts +3 -0
- package/dist/Shared/Services/ToastManager/toastManager.service.d.ts +10 -0
- package/dist/Shared/Services/ToastManager/types.d.ts +16 -0
- package/dist/Shared/Services/index.d.ts +1 -0
- package/dist/assets/index.css +1 -1
- package/dist/{cssMode-CT8XZgIe.js → cssMode-ei97t4Br.js} +1 -1
- package/dist/{freemarker2-CkVeYUvg.js → freemarker2-ISeE_J7A.js} +1 -1
- package/dist/{handlebars-DtKKot27.js → handlebars-DZZ2CAEE.js} +1 -1
- package/dist/{html-B4IHiz4o.js → html-nSZrHisx.js} +1 -1
- package/dist/{htmlMode-COD1RV60.js → htmlMode-BprOyT_6.js} +1 -1
- package/dist/{index-Du9BMUIo.js → index-DFtEC2_4.js} +26527 -26887
- package/dist/index.js +256 -253
- package/dist/{javascript-D7JVvxkF.js → javascript-deqsVp_g.js} +1 -1
- package/dist/{jsonMode-TOZr71z3.js → jsonMode-SmGSqxH9.js} +1 -1
- package/dist/{liquid-Bj9Jbq-Z.js → liquid-D28-LWEX.js} +1 -1
- package/dist/{mdx-lBuhsv-m.js → mdx-BZNQ_D35.js} +1 -1
- package/dist/{python-BbNPyDvg.js → python-CXzX5QlI.js} +1 -1
- package/dist/{razor-DvE5eilG.js → razor-DSGsSFfc.js} +1 -1
- package/dist/{tsMode-CR2JZK7t.js → tsMode-CuujEaLd.js} +1 -1
- package/dist/{typescript-0fY_wIw3.js → typescript-DJe7wiNG.js} +1 -1
- package/dist/{xml-b1Q4lCAc.js → xml-DceyQAGp.js} +1 -1
- package/dist/{yaml-DqFMmxPb.js → yaml-es0Bn8Zq.js} +1 -1
- package/package.json +2 -2
|
@@ -20,4 +20,4 @@ export declare class ToastBodyWithButton extends React.Component<{
|
|
|
20
20
|
}> {
|
|
21
21
|
render(): JSX.Element;
|
|
22
22
|
}
|
|
23
|
-
export declare const toastAccessDenied: (title?: string, subtitle?: string) =>
|
|
23
|
+
export declare const toastAccessDenied: (title?: string, subtitle?: string) => import('react-toastify').Id;
|
|
@@ -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
|
|
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;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ToastOptions, ToastContainerProps } from 'react-toastify';
|
|
2
|
+
import { ToastProps, ToastVariantType } from './types';
|
|
3
|
+
export declare const TOAST_BASE_CONFIG: ToastContainerProps;
|
|
4
|
+
export declare const TOAST_VARIANT_TO_CONFIG_MAP: Record<ToastVariantType, Required<Pick<ToastProps, 'icon' | 'title'>> & Pick<ToastOptions, 'type'>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ToastOptions } from 'react-toastify';
|
|
2
|
+
import { ToastProps } from './types';
|
|
3
|
+
declare class ToastManager {
|
|
4
|
+
#private;
|
|
5
|
+
static get instance(): ToastManager;
|
|
6
|
+
showToast: ({ variant, icon: customIcon, title, description, buttonProps }: ToastProps, options?: Pick<ToastOptions, "autoClose">) => import('react-toastify').Id;
|
|
7
|
+
}
|
|
8
|
+
export declare const ToastManagerContainer: () => JSX.Element;
|
|
9
|
+
declare const _default: ToastManager;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ButtonProps } from '../../Components';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
export declare enum ToastVariantType {
|
|
4
|
+
info = "info",
|
|
5
|
+
success = "success",
|
|
6
|
+
error = "error",
|
|
7
|
+
warn = "warn",
|
|
8
|
+
notAuthorized = "notAuthorized"
|
|
9
|
+
}
|
|
10
|
+
export interface ToastProps {
|
|
11
|
+
title?: string;
|
|
12
|
+
description: string;
|
|
13
|
+
icon?: ReactElement;
|
|
14
|
+
variant?: ToastVariantType;
|
|
15
|
+
buttonProps?: ButtonProps;
|
|
16
|
+
}
|