@televet/kibble-ui 1.17.12 → 1.17.13
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/build/components/Feedback/Alert/alert.argTypes.d.ts +112 -0
- package/build/components/Feedback/Alert/alert.component.d.ts +11 -13
- package/build/components/Feedback/Alert/components/alertBody.component.d.ts +7 -0
- package/build/components/Feedback/Alert/components/alertButton.component.d.ts +7 -0
- package/build/components/Feedback/Alert/components/alertCloseButton.component.d.ts +5 -0
- package/build/components/Feedback/Alert/components/alertDescription.component.d.ts +7 -0
- package/build/components/Feedback/Alert/components/alertHeader.component.d.ts +5 -0
- package/build/components/Feedback/Alert/components/alertIcon.component.d.ts +8 -0
- package/build/components/Feedback/Alert/components/alertTitle.component.d.ts +7 -0
- package/build/components/Feedback/Toast/useToast.d.ts +2 -36
- package/build/index.js +205 -155
- package/build/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { AlertVariant } from './alert.types';
|
|
2
|
+
export declare const alertArgTypes: {
|
|
3
|
+
buttonProps: {
|
|
4
|
+
type: string;
|
|
5
|
+
table: {
|
|
6
|
+
type: {
|
|
7
|
+
summary: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
description: {
|
|
13
|
+
type: string;
|
|
14
|
+
table: {
|
|
15
|
+
type: {
|
|
16
|
+
summary: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
descriptionProps: {
|
|
22
|
+
type: string;
|
|
23
|
+
table: {
|
|
24
|
+
type: {
|
|
25
|
+
summary: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
iconProps: {
|
|
31
|
+
type: string;
|
|
32
|
+
table: {
|
|
33
|
+
type: {
|
|
34
|
+
summary: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
onClose: {
|
|
40
|
+
type: string;
|
|
41
|
+
table: {
|
|
42
|
+
type: {
|
|
43
|
+
summary: string;
|
|
44
|
+
};
|
|
45
|
+
defaultValue: {
|
|
46
|
+
summary: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
hideIcon: {
|
|
52
|
+
type: string;
|
|
53
|
+
table: {
|
|
54
|
+
type: {
|
|
55
|
+
summary: string;
|
|
56
|
+
};
|
|
57
|
+
defaultValue: {
|
|
58
|
+
summary: boolean;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
defaultValue: boolean;
|
|
62
|
+
description: string;
|
|
63
|
+
};
|
|
64
|
+
hideCloseButton: {
|
|
65
|
+
type: string;
|
|
66
|
+
table: {
|
|
67
|
+
type: {
|
|
68
|
+
summary: string;
|
|
69
|
+
};
|
|
70
|
+
defaultValue: {
|
|
71
|
+
summary: boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
defaultValue: boolean;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
status: {
|
|
78
|
+
control: string;
|
|
79
|
+
options: AlertVariant[];
|
|
80
|
+
table: {
|
|
81
|
+
type: {
|
|
82
|
+
summary: string;
|
|
83
|
+
};
|
|
84
|
+
defaultValue: {
|
|
85
|
+
summary: AlertVariant;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
defaultValue: AlertVariant;
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
alertTitle: {
|
|
92
|
+
name: string;
|
|
93
|
+
type: {
|
|
94
|
+
name: string;
|
|
95
|
+
};
|
|
96
|
+
table: {
|
|
97
|
+
type: {
|
|
98
|
+
summary: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
description: string;
|
|
102
|
+
};
|
|
103
|
+
titleProps: {
|
|
104
|
+
type: string;
|
|
105
|
+
table: {
|
|
106
|
+
type: {
|
|
107
|
+
summary: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
description: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
@@ -2,23 +2,21 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { AlertProps as CAlertProps } from '@chakra-ui/react';
|
|
3
3
|
import { IconProps } from 'components/MediaAndIcons';
|
|
4
4
|
import { AlertVariant } from './alert.types';
|
|
5
|
-
import { ButtonProps } from 'components/Forms/Button';
|
|
6
5
|
import { TextProps } from 'components/Typography/Text';
|
|
7
6
|
import { Status } from '../feedback.types';
|
|
8
7
|
import { HeadingProps } from '../../Typography';
|
|
9
|
-
|
|
8
|
+
import { AlertButtonProps } from './components/alertButton.component';
|
|
9
|
+
export interface AlertProps extends Omit<CAlertProps, 'title'> {
|
|
10
|
+
buttonProps?: AlertButtonProps;
|
|
10
11
|
children?: ReactNode;
|
|
11
|
-
|
|
12
|
-
showIcon?: boolean;
|
|
13
|
-
iconProps?: IconProps;
|
|
14
|
-
showButton?: boolean;
|
|
15
|
-
buttonProps?: ButtonProps;
|
|
16
|
-
buttonTitle?: string;
|
|
17
|
-
alertTitle?: string;
|
|
18
|
-
titleProps?: HeadingProps;
|
|
19
|
-
description?: string;
|
|
12
|
+
description?: string | ReactNode;
|
|
20
13
|
descriptionProps?: TextProps;
|
|
21
|
-
|
|
14
|
+
iconProps?: IconProps;
|
|
22
15
|
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
|
16
|
+
hideCloseButton?: boolean;
|
|
17
|
+
hideIcon?: boolean;
|
|
18
|
+
status?: AlertVariant | Status;
|
|
19
|
+
title?: string | ReactNode;
|
|
20
|
+
titleProps?: HeadingProps;
|
|
23
21
|
}
|
|
24
|
-
export declare const Alert: ({ children,
|
|
22
|
+
export declare const Alert: ({ buttonProps, children, description, descriptionProps, iconProps, onClose, hideCloseButton, hideIcon, status, title, titleProps, ...rest }: AlertProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ButtonProps } from '../../../../components/Forms/Button';
|
|
2
|
+
export interface AlertButtonProps extends ButtonProps {
|
|
3
|
+
buttonPosition?: 'topRight' | 'bottomLeft';
|
|
4
|
+
buttonText: string;
|
|
5
|
+
hasDescription?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const AlertButton: (buttonProps: AlertButtonProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TextProps } from '../../../../components/Typography/Text';
|
|
3
|
+
export interface AlertDescriptionProps {
|
|
4
|
+
description?: string | ReactNode;
|
|
5
|
+
descriptionProps?: TextProps;
|
|
6
|
+
}
|
|
7
|
+
export declare const AlertDescription: (props: AlertDescriptionProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IconProps } from '../../../../components/MediaAndIcons';
|
|
2
|
+
import { AlertVariant } from '../alert.types';
|
|
3
|
+
import { Status } from '../../feedback.types';
|
|
4
|
+
export interface AlertIconProps {
|
|
5
|
+
iconProps?: IconProps;
|
|
6
|
+
status: AlertVariant | Status;
|
|
7
|
+
}
|
|
8
|
+
export declare const AlertIcon: (props: AlertIconProps) => JSX.Element;
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ColorMode, useChakra } from '@chakra-ui/system';
|
|
3
3
|
import { CloseAllToastsOptions, ToastOptions, ToastPositionWithLogical } from '@chakra-ui/react';
|
|
4
4
|
import { ToastId } from '@chakra-ui/toast/dist/declarations/src/toast.types';
|
|
5
|
-
import {
|
|
5
|
+
import { AlertProps } from '../Alert';
|
|
6
6
|
interface Toaster {
|
|
7
7
|
(options?: UseToastOptions | undefined): string | number | undefined;
|
|
8
8
|
close: (id: React.ReactText) => void;
|
|
@@ -10,7 +10,7 @@ interface Toaster {
|
|
|
10
10
|
update(id: ToastId, options: Omit<UseToastOptions, 'id'>): void;
|
|
11
11
|
isActive: (id: React.ReactText) => boolean | undefined;
|
|
12
12
|
}
|
|
13
|
-
export interface UseToastOptions {
|
|
13
|
+
export interface UseToastOptions extends Omit<AlertProps, 'id' | 'position'> {
|
|
14
14
|
/**
|
|
15
15
|
* The placement of the toast
|
|
16
16
|
*
|
|
@@ -24,26 +24,6 @@ export interface UseToastOptions {
|
|
|
24
24
|
* @default 5000 ( = 5000ms )
|
|
25
25
|
*/
|
|
26
26
|
duration?: ToastOptions['duration'];
|
|
27
|
-
/**
|
|
28
|
-
* The title of the toast
|
|
29
|
-
*/
|
|
30
|
-
title: string;
|
|
31
|
-
/**
|
|
32
|
-
* The description of the toast
|
|
33
|
-
*/
|
|
34
|
-
description?: string;
|
|
35
|
-
/**
|
|
36
|
-
* If `false`, the toast icon will be hidden.
|
|
37
|
-
*/
|
|
38
|
-
hideIcon?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* If `true`, the close button will be hidden.
|
|
41
|
-
*/
|
|
42
|
-
isClosable?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* The status of the toast.
|
|
45
|
-
*/
|
|
46
|
-
status?: Status;
|
|
47
27
|
/**
|
|
48
28
|
* The `id` of the toast.
|
|
49
29
|
*
|
|
@@ -59,20 +39,6 @@ export interface UseToastOptions {
|
|
|
59
39
|
* Optional style overrides for the container wrapping the toast component.
|
|
60
40
|
*/
|
|
61
41
|
containerStyle?: React.CSSProperties;
|
|
62
|
-
/**
|
|
63
|
-
* Used to manually close the toast.
|
|
64
|
-
*/
|
|
65
|
-
onClose?: () => void;
|
|
66
|
-
/**
|
|
67
|
-
* The text to display for the optional button.
|
|
68
|
-
*
|
|
69
|
-
* Both the `buttonTitle` and `onButtonClick` are required for the button to display.
|
|
70
|
-
*/
|
|
71
|
-
buttonTitle?: string;
|
|
72
|
-
/**
|
|
73
|
-
* The callback for the optional button.
|
|
74
|
-
*/
|
|
75
|
-
onButtonClick?: () => void;
|
|
76
42
|
}
|
|
77
43
|
export declare type CreateStandAloneToastParam = Partial<ReturnType<typeof useChakra> & {
|
|
78
44
|
setColorMode: (value: ColorMode) => void;
|