ingred-ui 9.3.0 → 9.4.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.
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/internal/BidStrapIcon/index.d.ts +4 -0
- package/dist/components/Icon/internal/DataStrapIcon/index.d.ts +4 -0
- package/dist/components/Icon/internal/FluctIcon/index.d.ts +4 -0
- package/dist/components/Toast/DefaultToast/DefaultToast.d.ts +1 -1
- package/dist/components/Toast/Toast.d.ts +9 -3
- package/dist/components/Toast/ToastProvider/ToastProvider.d.ts +1 -1
- package/dist/components/Toast/ToastProvider/internal/ToastContainer/ToastContainer.d.ts +1 -1
- package/dist/components/Toast/ToastProvider/internal/ToastContainer/styled.d.ts +1 -2
- package/dist/index.es.js +2460 -5076
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2457 -5073
- package/dist/index.js.map +1 -1
- package/dist/lib/react-toast-notification/src/ToastContainer.d.ts +8 -0
- package/dist/lib/react-toast-notification/src/ToastController.d.ts +31 -0
- package/dist/lib/react-toast-notification/src/ToastElement.d.ts +54 -0
- package/dist/lib/react-toast-notification/src/ToastProvider.d.ts +63 -0
- package/dist/lib/react-toast-notification/src/colors.d.ts +81 -0
- package/dist/lib/react-toast-notification/src/icons.d.ts +5 -0
- package/dist/lib/react-toast-notification/src/index.d.ts +6 -0
- package/dist/lib/react-toast-notification/src/styled.d.ts +34 -0
- package/dist/lib/react-toast-notification/src/types.d.ts +22 -0
- package/dist/lib/react-toast-notification/src/utils.d.ts +2 -0
- package/package.json +19 -20
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import type { Placement } from "./types";
|
|
3
|
+
export declare type ToastContainerProps = {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
hasToasts: boolean;
|
|
6
|
+
placement: Placement;
|
|
7
|
+
};
|
|
8
|
+
export declare const ToastContainer: ({ hasToasts, placement, ...props }: ToastContainerProps) => JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component, ComponentType } from "react";
|
|
2
|
+
import type { ToastProps } from "./ToastElement";
|
|
3
|
+
declare type Props = ToastProps & {
|
|
4
|
+
component: ComponentType<ToastProps>;
|
|
5
|
+
};
|
|
6
|
+
declare type State = {
|
|
7
|
+
isRunning: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const TimerType: {
|
|
10
|
+
clear: () => void;
|
|
11
|
+
pause: () => void;
|
|
12
|
+
resume: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare class ToastController extends Component<Props, State> {
|
|
15
|
+
timeout: typeof TimerType;
|
|
16
|
+
state: {
|
|
17
|
+
isRunning: boolean;
|
|
18
|
+
};
|
|
19
|
+
static defaultProps: {
|
|
20
|
+
autoDismiss: boolean;
|
|
21
|
+
};
|
|
22
|
+
componentDidMount(): void;
|
|
23
|
+
componentDidUpdate(prevProps: Props): void;
|
|
24
|
+
componentWillUnmount(): void;
|
|
25
|
+
render(): JSX.Element;
|
|
26
|
+
startTimer: () => void;
|
|
27
|
+
clearTimer: () => void;
|
|
28
|
+
onMouseEnter: () => void;
|
|
29
|
+
onMouseLeave: () => void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import type { HoverFn, Placement } from "./types";
|
|
3
|
+
import { NOOP } from "./utils";
|
|
4
|
+
import { TransitionStatus } from "react-transition-group";
|
|
5
|
+
export declare const borderRadius = 4;
|
|
6
|
+
export declare const gutter = 8;
|
|
7
|
+
export declare const toastWidth = 360;
|
|
8
|
+
declare const appearances: {
|
|
9
|
+
success: {
|
|
10
|
+
icon: (props: any) => JSX.Element;
|
|
11
|
+
text: string;
|
|
12
|
+
fg: string;
|
|
13
|
+
bg: string;
|
|
14
|
+
};
|
|
15
|
+
error: {
|
|
16
|
+
icon: (props: any) => JSX.Element;
|
|
17
|
+
text: string;
|
|
18
|
+
fg: string;
|
|
19
|
+
bg: string;
|
|
20
|
+
};
|
|
21
|
+
warning: {
|
|
22
|
+
icon: (props: any) => JSX.Element;
|
|
23
|
+
text: string;
|
|
24
|
+
fg: string;
|
|
25
|
+
bg: string;
|
|
26
|
+
};
|
|
27
|
+
info: {
|
|
28
|
+
icon: (props: any) => JSX.Element;
|
|
29
|
+
text: string;
|
|
30
|
+
fg: string;
|
|
31
|
+
bg: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export declare type AppearanceTypes = keyof typeof appearances;
|
|
35
|
+
export declare type ToastProps = {
|
|
36
|
+
appearance: AppearanceTypes;
|
|
37
|
+
autoDismiss: boolean;
|
|
38
|
+
autoDismissTimeout: number;
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
isRunning: boolean;
|
|
41
|
+
onDismiss: typeof NOOP;
|
|
42
|
+
onMouseEnter: HoverFn;
|
|
43
|
+
onMouseLeave: HoverFn;
|
|
44
|
+
placement: Placement;
|
|
45
|
+
transitionDuration: number;
|
|
46
|
+
transitionState: TransitionStatus;
|
|
47
|
+
};
|
|
48
|
+
export declare const DefaultToast: {
|
|
49
|
+
({ appearance, autoDismiss, autoDismissTimeout, children, isRunning, onDismiss, placement, transitionDuration, transitionState, onMouseEnter, onMouseLeave, ...otherProps }: ToastProps): JSX.Element;
|
|
50
|
+
defaultProps: {
|
|
51
|
+
onDismiss: () => void;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { Component, ComponentType, ReactNode } from "react";
|
|
2
|
+
import { ToastContainerProps } from "./ToastContainer";
|
|
3
|
+
import { ToastProps } from "./ToastElement";
|
|
4
|
+
import type { AddFn, UpdateFn, RemoveFn, Callback, ToastsType, Options, Placement, Id, ToastType } from "./types";
|
|
5
|
+
declare type Components = {
|
|
6
|
+
Toast: ComponentType<ToastProps>;
|
|
7
|
+
ToastContainer: ComponentType<ToastContainerProps>;
|
|
8
|
+
};
|
|
9
|
+
export declare type ToastProviderProps = {
|
|
10
|
+
autoDismissTimeout?: number;
|
|
11
|
+
autoDismiss?: boolean;
|
|
12
|
+
components?: Components;
|
|
13
|
+
newestOnTop?: boolean;
|
|
14
|
+
placement: Placement;
|
|
15
|
+
portalTargetSelector?: string;
|
|
16
|
+
transitionDuration?: number;
|
|
17
|
+
};
|
|
18
|
+
declare type State = {
|
|
19
|
+
toasts: ToastsType;
|
|
20
|
+
};
|
|
21
|
+
export declare class ToastProvider extends Component<ToastProviderProps, State> {
|
|
22
|
+
nodeRef: React.RefObject<HTMLDivElement>;
|
|
23
|
+
static defaultProps: {
|
|
24
|
+
autoDismiss: boolean;
|
|
25
|
+
autoDismissTimeout: number;
|
|
26
|
+
components: {
|
|
27
|
+
Toast: {
|
|
28
|
+
({ appearance, autoDismiss, autoDismissTimeout, children, isRunning, onDismiss, placement, transitionDuration, transitionState, onMouseEnter, onMouseLeave, ...otherProps }: ToastProps): JSX.Element;
|
|
29
|
+
defaultProps: {
|
|
30
|
+
onDismiss: () => void;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
ToastContainer: ({ hasToasts, placement, ...props }: ToastContainerProps) => JSX.Element;
|
|
34
|
+
};
|
|
35
|
+
newestOnTop: boolean;
|
|
36
|
+
placement: string;
|
|
37
|
+
transitionDuration: number;
|
|
38
|
+
nodeRef: null;
|
|
39
|
+
};
|
|
40
|
+
constructor(props: ToastProviderProps | Readonly<ToastProviderProps>);
|
|
41
|
+
state: {
|
|
42
|
+
toasts: ToastsType;
|
|
43
|
+
};
|
|
44
|
+
render(): JSX.Element;
|
|
45
|
+
has: (id: string) => boolean;
|
|
46
|
+
onDismiss: (id: Id, cb?: Callback) => () => void;
|
|
47
|
+
add: (content: Node, options?: Options | undefined, cb?: Callback) => string | undefined;
|
|
48
|
+
remove: (id: Id, cb?: Callback) => void;
|
|
49
|
+
removeAll: () => void;
|
|
50
|
+
update: (id: Id, options?: Options | undefined, cb?: Callback) => void;
|
|
51
|
+
}
|
|
52
|
+
export declare const ToastConsumer: ({ children, }: {
|
|
53
|
+
children: (Context: any) => ReactNode;
|
|
54
|
+
}) => JSX.Element;
|
|
55
|
+
export declare const withToastManager: (Comp: ComponentType<any>) => React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<any>>;
|
|
56
|
+
export declare const useToasts: () => {
|
|
57
|
+
addToast: AddFn;
|
|
58
|
+
removeToast: RemoveFn;
|
|
59
|
+
removeAllToasts: () => void;
|
|
60
|
+
updateToast: UpdateFn;
|
|
61
|
+
toastStack: ToastType[];
|
|
62
|
+
};
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
declare const colors: {
|
|
2
|
+
R50: string;
|
|
3
|
+
R75: string;
|
|
4
|
+
R100: string;
|
|
5
|
+
R200: string;
|
|
6
|
+
R300: string;
|
|
7
|
+
R400: string;
|
|
8
|
+
R500: string;
|
|
9
|
+
Y50: string;
|
|
10
|
+
Y75: string;
|
|
11
|
+
Y100: string;
|
|
12
|
+
Y200: string;
|
|
13
|
+
Y300: string;
|
|
14
|
+
Y400: string;
|
|
15
|
+
Y500: string;
|
|
16
|
+
G50: string;
|
|
17
|
+
G75: string;
|
|
18
|
+
G100: string;
|
|
19
|
+
G200: string;
|
|
20
|
+
G300: string;
|
|
21
|
+
G400: string;
|
|
22
|
+
G500: string;
|
|
23
|
+
B50: string;
|
|
24
|
+
B75: string;
|
|
25
|
+
B100: string;
|
|
26
|
+
B200: string;
|
|
27
|
+
B300: string;
|
|
28
|
+
B400: string;
|
|
29
|
+
B500: string;
|
|
30
|
+
P50: string;
|
|
31
|
+
P75: string;
|
|
32
|
+
P100: string;
|
|
33
|
+
P200: string;
|
|
34
|
+
P300: string;
|
|
35
|
+
P400: string;
|
|
36
|
+
P500: string;
|
|
37
|
+
T50: string;
|
|
38
|
+
T75: string;
|
|
39
|
+
T100: string;
|
|
40
|
+
T200: string;
|
|
41
|
+
T300: string;
|
|
42
|
+
T400: string;
|
|
43
|
+
T500: string;
|
|
44
|
+
N0: string;
|
|
45
|
+
N10: string;
|
|
46
|
+
N20: string;
|
|
47
|
+
N30: string;
|
|
48
|
+
N40: string;
|
|
49
|
+
N50: string;
|
|
50
|
+
N60: string;
|
|
51
|
+
N70: string;
|
|
52
|
+
N80: string;
|
|
53
|
+
N90: string;
|
|
54
|
+
N100: string;
|
|
55
|
+
N200: string;
|
|
56
|
+
N300: string;
|
|
57
|
+
N400: string;
|
|
58
|
+
N500: string;
|
|
59
|
+
N600: string;
|
|
60
|
+
N700: string;
|
|
61
|
+
N800: string;
|
|
62
|
+
N900: string;
|
|
63
|
+
N10A: string;
|
|
64
|
+
N20A: string;
|
|
65
|
+
N30A: string;
|
|
66
|
+
N40A: string;
|
|
67
|
+
N50A: string;
|
|
68
|
+
N60A: string;
|
|
69
|
+
N70A: string;
|
|
70
|
+
N80A: string;
|
|
71
|
+
N90A: string;
|
|
72
|
+
N100A: string;
|
|
73
|
+
N200A: string;
|
|
74
|
+
N300A: string;
|
|
75
|
+
N400A: string;
|
|
76
|
+
N500A: string;
|
|
77
|
+
N600A: string;
|
|
78
|
+
N700A: string;
|
|
79
|
+
N800A: string;
|
|
80
|
+
};
|
|
81
|
+
export default colors;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const AlertIcon: (props: any) => JSX.Element;
|
|
2
|
+
export declare const CheckIcon: (props: any) => JSX.Element;
|
|
3
|
+
export declare const FlameIcon: (props: any) => JSX.Element;
|
|
4
|
+
export declare const InfoIcon: (props: any) => JSX.Element;
|
|
5
|
+
export declare const CloseIcon: (props: any) => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ToastContainer as DefaultToastContainer } from "./ToastContainer";
|
|
2
|
+
export type { ToastContainerProps } from "./ToastContainer";
|
|
3
|
+
export { DefaultToast } from "./ToastElement";
|
|
4
|
+
export type { ToastProps } from "./ToastElement";
|
|
5
|
+
export { ToastConsumer, ToastProvider, withToastManager, useToasts, } from "./ToastProvider";
|
|
6
|
+
export type { ToastProviderProps } from "./ToastProvider";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TransitionStatus } from "react-transition-group";
|
|
2
|
+
import { Placement } from "./types";
|
|
3
|
+
export declare const Tag: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const Button: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
5
|
+
gutter: number;
|
|
6
|
+
}, never>;
|
|
7
|
+
export declare const Content: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
8
|
+
gutter: number;
|
|
9
|
+
}, never>;
|
|
10
|
+
export declare const Countdown: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
11
|
+
autoDismissTimeout: number;
|
|
12
|
+
isRunning: boolean;
|
|
13
|
+
opacity: number;
|
|
14
|
+
}, never>;
|
|
15
|
+
export declare const Icon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
16
|
+
color: string;
|
|
17
|
+
backgroundColor: string;
|
|
18
|
+
borderRadius: number;
|
|
19
|
+
gutter: number;
|
|
20
|
+
}, never>;
|
|
21
|
+
export declare const ToastElement: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
22
|
+
height: string | number;
|
|
23
|
+
transitionDuration: number;
|
|
24
|
+
}, never>;
|
|
25
|
+
export declare const ToastElementInner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
26
|
+
backgroundColor: string;
|
|
27
|
+
color: string;
|
|
28
|
+
borderRadius: number;
|
|
29
|
+
transitionDuration: number;
|
|
30
|
+
gutter: number;
|
|
31
|
+
width: number;
|
|
32
|
+
placement: Placement;
|
|
33
|
+
transitionState: TransitionStatus;
|
|
34
|
+
}, never>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export declare type AppearanceTypes = "error" | "info" | "success" | "warning";
|
|
3
|
+
export declare type Id = string;
|
|
4
|
+
export declare type Callback = (id: Id) => void;
|
|
5
|
+
export declare type Options = {
|
|
6
|
+
appearance?: AppearanceTypes;
|
|
7
|
+
autoDismiss?: boolean;
|
|
8
|
+
id?: string;
|
|
9
|
+
onDismiss?: (id: string) => void;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
export declare type AddFn = (content: ReactNode, options?: Options, callback?: (id: string) => void) => void;
|
|
13
|
+
export declare type UpdateFn = (id: Id, options: Options) => void;
|
|
14
|
+
export declare type RemoveFn = (id: Id) => void;
|
|
15
|
+
export declare type HoverFn = () => void;
|
|
16
|
+
export declare type Placement = "bottom-left" | "bottom-center" | "bottom-right" | "top-left" | "top-center" | "top-right";
|
|
17
|
+
export declare type ToastType = Options & {
|
|
18
|
+
appearance: AppearanceTypes;
|
|
19
|
+
content: Node;
|
|
20
|
+
id: Id;
|
|
21
|
+
};
|
|
22
|
+
export declare type ToastsType = Array<ToastType>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ingred-ui",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "voyagegroup",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"react-dates": "^21.8.0",
|
|
31
31
|
"react-popper": "^2.2.3",
|
|
32
32
|
"react-select": "^5.1.0",
|
|
33
|
-
"react-toast-notifications": "^2.4.0",
|
|
34
33
|
"react-transition-group": "^4.4.1"
|
|
35
34
|
},
|
|
36
35
|
"peerDependencies": {
|
|
@@ -40,7 +39,7 @@
|
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"@rollup/plugin-commonjs": "21.0.1",
|
|
43
|
-
"@rollup/plugin-node-resolve": "13.
|
|
42
|
+
"@rollup/plugin-node-resolve": "13.1.3",
|
|
44
43
|
"@rollup/plugin-typescript": "8.3.0",
|
|
45
44
|
"@rollup/plugin-url": "6.1.0",
|
|
46
45
|
"@storybook/addon-console": "1.2.3",
|
|
@@ -48,45 +47,45 @@
|
|
|
48
47
|
"@storybook/addon-links": "6.3.12",
|
|
49
48
|
"@storybook/addon-storysource": "6.3.12",
|
|
50
49
|
"@storybook/react": "6.3.12",
|
|
51
|
-
"@svgr/rollup": "6.
|
|
50
|
+
"@svgr/rollup": "6.2.0",
|
|
52
51
|
"@testing-library/jest-dom": "5.16.1",
|
|
53
52
|
"@testing-library/react": "12.1.2",
|
|
54
|
-
"@types/jest": "27.0
|
|
53
|
+
"@types/jest": "27.4.0",
|
|
55
54
|
"@types/moment": "2.13.0",
|
|
56
|
-
"@types/react": "17.0.
|
|
55
|
+
"@types/react": "17.0.38",
|
|
57
56
|
"@types/react-dates": "21.8.3",
|
|
58
57
|
"@types/react-dom": "17.0.11",
|
|
59
|
-
"@types/react-toast-notifications": "2.4.0",
|
|
60
58
|
"@types/react-transition-group": "4.4.4",
|
|
61
|
-
"@types/styled-components": "5.1.
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
63
|
-
"@typescript-eslint/parser": "5.
|
|
59
|
+
"@types/styled-components": "5.1.21",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "5.10.1",
|
|
61
|
+
"@typescript-eslint/parser": "5.10.1",
|
|
64
62
|
"cross-env": "7.0.3",
|
|
65
|
-
"eslint": "8.
|
|
63
|
+
"eslint": "8.7.0",
|
|
66
64
|
"eslint-config-prettier": "8.3.0",
|
|
67
|
-
"eslint-plugin-import": "2.25.
|
|
68
|
-
"eslint-plugin-jest": "25.
|
|
65
|
+
"eslint-plugin-import": "2.25.4",
|
|
66
|
+
"eslint-plugin-jest": "25.7.0",
|
|
69
67
|
"eslint-plugin-mdx": "1.16.0",
|
|
70
68
|
"eslint-plugin-prettier": "4.0.0",
|
|
71
|
-
"eslint-plugin-react": "7.
|
|
69
|
+
"eslint-plugin-react": "7.28.0",
|
|
72
70
|
"eslint-plugin-react-hooks": "4.3.0",
|
|
73
|
-
"jest": "27.4.
|
|
71
|
+
"jest": "27.4.7",
|
|
74
72
|
"prettier": "2.5.1",
|
|
75
73
|
"react": "17.0.2",
|
|
76
74
|
"react-dom": "17.0.2",
|
|
77
|
-
"rollup": "2.
|
|
78
|
-
"rollup-plugin-imagemin": "0.
|
|
75
|
+
"rollup": "2.66.0",
|
|
76
|
+
"rollup-plugin-imagemin": "0.5.0",
|
|
79
77
|
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
80
78
|
"rollup-plugin-postcss": "4.0.2",
|
|
81
|
-
"scaffdog": "1.0
|
|
79
|
+
"scaffdog": "1.1.0",
|
|
82
80
|
"styled-components": "5.3.3",
|
|
83
|
-
"ts-jest": "27.1.
|
|
84
|
-
"typescript": "4.
|
|
81
|
+
"ts-jest": "27.1.3",
|
|
82
|
+
"typescript": "4.5.5"
|
|
85
83
|
},
|
|
86
84
|
"files": [
|
|
87
85
|
"dist"
|
|
88
86
|
],
|
|
89
87
|
"resolutions": {
|
|
88
|
+
"colors": "1.4.0",
|
|
90
89
|
"react": "17.0.2",
|
|
91
90
|
"react-dom": "17.0.2"
|
|
92
91
|
}
|