@trilogy-ds/react 0.0.1-beta.34 → 0.0.1-beta.41
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/lib/components/alert/Alert.d.ts +10 -2
- package/lib/components/alert/Alert.js +84 -3
- package/lib/components/alert/Alert.js.map +1 -1
- package/lib/components/alert/Alert.native.d.ts +22 -2
- package/lib/components/alert/Alert.native.js +82 -1
- package/lib/components/alert/Alert.native.js.map +1 -1
- package/lib/components/alert/AlertProps.d.ts +23 -1
- package/lib/components/alert/AlertProps.js +5 -1
- package/lib/components/alert/AlertProps.js.map +1 -1
- package/lib/components/alert/context/ToasterContext.d.ts +7 -0
- package/lib/components/alert/context/ToasterContext.js +5 -0
- package/lib/components/alert/context/ToasterContext.js.map +1 -0
- package/lib/components/alert/context/ToasterContextProps.d.ts +27 -0
- package/lib/components/alert/context/ToasterContextProps.js +2 -0
- package/lib/components/alert/context/ToasterContextProps.js.map +1 -0
- package/lib/components/alert/context/index.d.ts +2 -0
- package/lib/components/alert/context/index.js +3 -0
- package/lib/components/alert/context/index.js.map +1 -0
- package/lib/components/alert/index.d.ts +3 -2
- package/lib/components/alert/index.js +3 -2
- package/lib/components/alert/index.js.map +1 -1
- package/lib/components/autocomplete/AutoComplete.d.ts +1 -1
- package/lib/components/autocomplete/AutoComplete.js +2 -2
- package/lib/components/autocomplete/AutoComplete.js.map +1 -1
- package/lib/components/index.d.ts +0 -1
- package/lib/components/index.js +0 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/Input.js +2 -0
- package/lib/components/input/Input.js.map +1 -1
- package/lib/components/input/Input.native.js +1 -1
- package/lib/components/input/Input.native.js.map +1 -1
- package/lib/components/input/InputProps.d.ts +1 -0
- package/lib/components/modal/Modal.native.js +4 -1
- package/lib/components/modal/Modal.native.js.map +1 -1
- package/lib/components/range/Range.js +6 -0
- package/lib/components/range/Range.js.map +1 -1
- package/lib/components/select/Select.d.ts +2 -2
- package/lib/components/select/Select.js +6 -18
- package/lib/components/select/Select.js.map +1 -1
- package/lib/components/select/Select.native.d.ts +3 -3
- package/lib/components/select/Select.native.js +116 -79
- package/lib/components/select/Select.native.js.map +1 -1
- package/lib/components/select/SelectProps.d.ts +10 -21
- package/lib/components/select/option/SelectOption.d.ts +2 -3
- package/lib/components/select/option/SelectOption.js +10 -12
- package/lib/components/select/option/SelectOption.js.map +1 -1
- package/lib/components/select/option/SelectOption.native.d.ts +3 -3
- package/lib/components/select/option/SelectOption.native.js +41 -5
- package/lib/components/select/option/SelectOption.native.js.map +1 -1
- package/lib/components/select/web/SelectDynamic.d.ts +3 -3
- package/lib/components/select/web/SelectDynamic.js +192 -49
- package/lib/components/select/web/SelectDynamic.js.map +1 -1
- package/lib/components/select/web/SelectNative.d.ts +2 -2
- package/lib/components/select/web/SelectNative.js +57 -22
- package/lib/components/select/web/SelectNative.js.map +1 -1
- package/package.json +1 -1
- package/lib/components/select/hooks/accessibility.d.ts +0 -11
- package/lib/components/select/hooks/accessibility.js +0 -111
- package/lib/components/select/hooks/accessibility.js.map +0 -1
- package/lib/components/select/hooks/utils.d.ts +0 -30
- package/lib/components/select/hooks/utils.js +0 -94
- package/lib/components/select/hooks/utils.js.map +0 -1
- package/lib/components/select/option/SelectNativeOption.d.ts +0 -4
- package/lib/components/select/option/SelectNativeOption.js +0 -8
- package/lib/components/select/option/SelectNativeOption.js.map +0 -1
- package/lib/components/select/option/SelectNativeOption.native.d.ts +0 -2
- package/lib/components/select/option/SelectNativeOption.native.js +0 -5
- package/lib/components/select/option/SelectNativeOption.native.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AlertProps } from "./AlertProps";
|
|
2
|
+
import { AlertProps, ToasterAlertProps } from "./AlertProps";
|
|
3
3
|
/**
|
|
4
4
|
* Alert Component
|
|
5
5
|
* @param iconName {IconName} Custom icon
|
|
@@ -12,5 +12,13 @@ import { AlertProps } from "./AlertProps";
|
|
|
12
12
|
* @param display
|
|
13
13
|
* @param others
|
|
14
14
|
*/
|
|
15
|
-
declare const Alert: ({ alert, className, iconClassname, iconName, title, description, onClick, display, testId, ...others }: AlertProps) => JSX.Element;
|
|
15
|
+
declare const Alert: ({ alert, className, iconClassname, iconName, title, description, onClick, display, testId, toaster, ...others }: AlertProps) => JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* Toaster Alert Provider
|
|
18
|
+
* @param children {React.ReactNode} Custom Toast Content
|
|
19
|
+
* @param duration {number} Duration in MS (Default: 5000)
|
|
20
|
+
* @param offset {number} Offset position margin (Default: 10 dp)
|
|
21
|
+
* @param others
|
|
22
|
+
*/
|
|
23
|
+
export declare const ToasterAlertProvider: ({ children }: ToasterAlertProps) => JSX.Element;
|
|
16
24
|
export default Alert;
|
|
@@ -2,11 +2,56 @@ import clsx from "clsx";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { getAlertClassName, getAlertIconName } from "../../objects";
|
|
4
4
|
import { has, is } from "../../services/classify";
|
|
5
|
-
import { Icon, IconName } from "../icon";
|
|
5
|
+
import { Icon, IconName, IconSize } from "../icon";
|
|
6
6
|
import { Text } from "../text";
|
|
7
7
|
import { Title, TitleLevels } from "../title";
|
|
8
|
+
import { ToasterAlertPosition } from "./AlertProps";
|
|
8
9
|
import { hashClass } from "../../helpers";
|
|
9
10
|
import { useTrilogyContext } from "../../context";
|
|
11
|
+
import ToasterContext from './context';
|
|
12
|
+
import { useEffect, useRef, useState } from "react";
|
|
13
|
+
/**
|
|
14
|
+
* Toaster Component
|
|
15
|
+
* @param children {React.ReactNode} Custom Toast Content
|
|
16
|
+
*/
|
|
17
|
+
const ToasterAlert = ({ props, ...others }) => {
|
|
18
|
+
const { styled } = useTrilogyContext();
|
|
19
|
+
const { title, position, description, iconName, alert, closable, onClick, className, offset, children } = props;
|
|
20
|
+
const displayed = Boolean(title);
|
|
21
|
+
const positionTop = {
|
|
22
|
+
top: offset || 0,
|
|
23
|
+
position: 'fixed',
|
|
24
|
+
};
|
|
25
|
+
const positionBottom = {
|
|
26
|
+
bottom: offset || 0,
|
|
27
|
+
position: 'fixed',
|
|
28
|
+
};
|
|
29
|
+
const classes = hashClass(styled, clsx('toaster', alert && is(getAlertClassName(alert)), !alert && is('info'), className));
|
|
30
|
+
if (!displayed) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
if (children) {
|
|
34
|
+
return (React.createElement("div", { "data-testid": props.testId, style: (position === ToasterAlertPosition.TOP && positionTop) ||
|
|
35
|
+
(position === ToasterAlertPosition.BOTTOM && positionBottom) ||
|
|
36
|
+
positionTop, onClick: (e) => {
|
|
37
|
+
// eslint-disable-next-line no-unused-expressions
|
|
38
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
39
|
+
e.stopPropagation();
|
|
40
|
+
}, className: classes, ...others }, children));
|
|
41
|
+
}
|
|
42
|
+
return title ? (React.createElement("div", { "data-testid": props.testId, style: (position === ToasterAlertPosition.TOP && positionTop) ||
|
|
43
|
+
(position === ToasterAlertPosition.BOTTOM && positionBottom) ||
|
|
44
|
+
positionTop, onClick: (e) => {
|
|
45
|
+
// eslint-disable-next-line no-unused-expressions
|
|
46
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
}, className: classes, ...others },
|
|
49
|
+
iconName && React.createElement(Icon, { name: iconName, size: IconSize.SMALL }),
|
|
50
|
+
React.createElement("div", { className: hashClass(styled, clsx('body')) },
|
|
51
|
+
title && React.createElement(Title, { level: TitleLevels.SIX }, title),
|
|
52
|
+
description && React.createElement(Text, null, description)),
|
|
53
|
+
closable && React.createElement(Icon, { onClick: closable, className: 'toaster-close', name: IconName.TIMES, size: IconSize.SMALL }))) : null;
|
|
54
|
+
};
|
|
10
55
|
/**
|
|
11
56
|
* Alert Component
|
|
12
57
|
* @param iconName {IconName} Custom icon
|
|
@@ -19,7 +64,7 @@ import { useTrilogyContext } from "../../context";
|
|
|
19
64
|
* @param display
|
|
20
65
|
* @param others
|
|
21
66
|
*/
|
|
22
|
-
const Alert = ({ alert, className, iconClassname, iconName, title, description, onClick, display, testId, ...others }) => {
|
|
67
|
+
const Alert = ({ alert, className, iconClassname, iconName, title, description, onClick, display, testId, toaster, ...others }) => {
|
|
23
68
|
const { styled } = useTrilogyContext();
|
|
24
69
|
const classes = hashClass(styled, clsx("alert", has("body"), alert && is(getAlertClassName(alert)), className));
|
|
25
70
|
const iconAlert = React.useMemo(() => {
|
|
@@ -39,10 +84,46 @@ const Alert = ({ alert, className, iconClassname, iconName, title, description,
|
|
|
39
84
|
}, className: classes, ...others },
|
|
40
85
|
React.createElement(Icon, { className: iconClassname, name: iconAlert }),
|
|
41
86
|
React.createElement("div", { className: hashClass(styled, clsx("body")) },
|
|
42
|
-
title && typeof title.valueOf() === "string" ? (React.createElement(Title, { level: TitleLevels.
|
|
87
|
+
title && typeof title.valueOf() === "string" ? (React.createElement(Title, { level: TitleLevels.SIX }, title)) : (title),
|
|
43
88
|
description && typeof description.valueOf() === "string" ? (React.createElement(Text, null, description)) : (description))));
|
|
44
89
|
}
|
|
45
90
|
return React.createElement("div", null);
|
|
46
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* Toaster Alert Provider
|
|
94
|
+
* @param children {React.ReactNode} Custom Toast Content
|
|
95
|
+
* @param duration {number} Duration in MS (Default: 5000)
|
|
96
|
+
* @param offset {number} Offset position margin (Default: 10 dp)
|
|
97
|
+
* @param others
|
|
98
|
+
*/
|
|
99
|
+
export const ToasterAlertProvider = ({ children }) => {
|
|
100
|
+
const [toasterState, setToasterState] = useState(null);
|
|
101
|
+
const [duration, setDuration] = useState(5000);
|
|
102
|
+
const timeRef = useRef(null);
|
|
103
|
+
const showToast = (params) => {
|
|
104
|
+
setToasterState(params);
|
|
105
|
+
params.duration && params.duration > 0 && setDuration(params.duration);
|
|
106
|
+
timeRef.current && clearTimeout(timeRef.current);
|
|
107
|
+
};
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
timeRef.current = setTimeout(() => {
|
|
110
|
+
setToasterState(null);
|
|
111
|
+
}, duration);
|
|
112
|
+
}, [toasterState, toasterState === null || toasterState === void 0 ? void 0 : toasterState.title]);
|
|
113
|
+
return (React.createElement(ToasterContext.Provider, { value: { show: showToast, hide: () => null } },
|
|
114
|
+
children,
|
|
115
|
+
React.createElement(ToasterAlert, { props: {
|
|
116
|
+
title: toasterState === null || toasterState === void 0 ? void 0 : toasterState.title,
|
|
117
|
+
description: toasterState === null || toasterState === void 0 ? void 0 : toasterState.description,
|
|
118
|
+
position: toasterState === null || toasterState === void 0 ? void 0 : toasterState.position,
|
|
119
|
+
iconName: toasterState === null || toasterState === void 0 ? void 0 : toasterState.iconName,
|
|
120
|
+
alert: toasterState === null || toasterState === void 0 ? void 0 : toasterState.alert,
|
|
121
|
+
onClick: toasterState === null || toasterState === void 0 ? void 0 : toasterState.onClick,
|
|
122
|
+
onHide: toasterState === null || toasterState === void 0 ? void 0 : toasterState.onHide,
|
|
123
|
+
closable: toasterState === null || toasterState === void 0 ? void 0 : toasterState.closable,
|
|
124
|
+
offset: toasterState === null || toasterState === void 0 ? void 0 : toasterState.offset,
|
|
125
|
+
testId: toasterState === null || toasterState === void 0 ? void 0 : toasterState.testId,
|
|
126
|
+
} })));
|
|
127
|
+
};
|
|
47
128
|
export default Alert;
|
|
48
129
|
//# sourceMappingURL=Alert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../components/alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"Alert.js","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gBAC5B,MAAM,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,MAAM;aAC7B,GACD,CACsB,CAC3B,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { AlertProps } from "./AlertProps";
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { AlertProps, ToasterAlertProps } from "./AlertProps";
|
|
3
3
|
import { ComponentName } from "../enumsComponentsName";
|
|
4
4
|
/**
|
|
5
5
|
* Alert Component
|
|
@@ -14,4 +14,24 @@ declare const Alert: {
|
|
|
14
14
|
({ alert, iconName, title, description, onClick, display, ...others }: AlertProps): JSX.Element;
|
|
15
15
|
displayName: ComponentName;
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Ui of the toast
|
|
19
|
+
* @param title {string} Notification title content
|
|
20
|
+
* @param description {string|ReactNode} Notification description content
|
|
21
|
+
* @param iconName {IconName} Custom icon
|
|
22
|
+
* @param alert {AlertState} Alert Variant (INFO|SUCCESS|WARNING|ERROR)
|
|
23
|
+
* @param onClick {Function} onClick Event for all notification
|
|
24
|
+
* @param closable {Function} onClick Event on cross icon
|
|
25
|
+
*/
|
|
26
|
+
export declare const ToasterAlert: React.FC<{
|
|
27
|
+
props: ToasterAlertProps;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Toaster provider
|
|
31
|
+
* @param children {React.ReactNode} Custom Toast Content
|
|
32
|
+
* @param duration {number} Duration in MS (Default: 5000)
|
|
33
|
+
* @param offset {number} Offset position margin (Default: 10 dp)
|
|
34
|
+
* @param others
|
|
35
|
+
*/
|
|
36
|
+
export declare const ToasterAlertProvider: ({ children }: ToasterAlertProps) => JSX.Element;
|
|
17
37
|
export default Alert;
|
|
@@ -4,11 +4,31 @@ import { Columns, ColumnsItem } from "../columns";
|
|
|
4
4
|
import { Spacer, SpacerSize } from "../spacer";
|
|
5
5
|
import { View } from "../view";
|
|
6
6
|
import { Text, TextLevels } from "../text";
|
|
7
|
+
import { Title, TitleLevels } from "../title";
|
|
7
8
|
import { getAlertIconName, getAlertStyle } from "../../objects/facets/Alert";
|
|
8
9
|
import { getColorStyle, TrilogyColor } from "../../objects/facets/Color";
|
|
9
|
-
import {
|
|
10
|
+
import { ToasterAlertPosition } from "./AlertProps";
|
|
11
|
+
import { Icon, IconName, IconSize } from "../icon";
|
|
10
12
|
import { TypographyBold } from "../../objects";
|
|
11
13
|
import { ComponentName } from "../enumsComponentsName";
|
|
14
|
+
import ToasterContext from "./context";
|
|
15
|
+
import LibToast from "react-native-toast-message";
|
|
16
|
+
/**
|
|
17
|
+
* Function call by context for showing toast
|
|
18
|
+
* @param params {ToasterShowContext}
|
|
19
|
+
*/
|
|
20
|
+
const showToast = (params) => {
|
|
21
|
+
const { position, duration, offset, title, description, onClick, closable, onHide, iconName, alert, } = params;
|
|
22
|
+
LibToast.show({
|
|
23
|
+
type: "tomatoToast",
|
|
24
|
+
position: position || ToasterAlertPosition.BOTTOM,
|
|
25
|
+
bottomOffset: offset || 10,
|
|
26
|
+
topOffset: offset || 10,
|
|
27
|
+
visibilityTime: duration || 5000,
|
|
28
|
+
onHide,
|
|
29
|
+
props: { title, description, closable, iconName, alert, onClick },
|
|
30
|
+
});
|
|
31
|
+
};
|
|
12
32
|
/**
|
|
13
33
|
* Alert Component
|
|
14
34
|
* @param iconName {IconName} Custom icon
|
|
@@ -72,6 +92,67 @@ const Alert = ({ alert, iconName, title, description, onClick, display, ...other
|
|
|
72
92
|
return alertView;
|
|
73
93
|
return React.createElement(View, null);
|
|
74
94
|
};
|
|
95
|
+
/**
|
|
96
|
+
* Ui of the toast
|
|
97
|
+
* @param title {string} Notification title content
|
|
98
|
+
* @param description {string|ReactNode} Notification description content
|
|
99
|
+
* @param iconName {IconName} Custom icon
|
|
100
|
+
* @param alert {AlertState} Alert Variant (INFO|SUCCESS|WARNING|ERROR)
|
|
101
|
+
* @param onClick {Function} onClick Event for all notification
|
|
102
|
+
* @param closable {Function} onClick Event on cross icon
|
|
103
|
+
*/
|
|
104
|
+
export const ToasterAlert = ({ props }) => {
|
|
105
|
+
const { title, description, iconName, alert, closable, onClick } = props;
|
|
106
|
+
const color = getAlertStyle(alert) || getColorStyle(TrilogyColor.MAIN);
|
|
107
|
+
const backgroundColor = getColorStyle(alert, 1);
|
|
108
|
+
const styles = StyleSheet.create({
|
|
109
|
+
toaster: {
|
|
110
|
+
padding: 24,
|
|
111
|
+
},
|
|
112
|
+
toasterContainer: {
|
|
113
|
+
borderWidth: 1,
|
|
114
|
+
borderColor: color,
|
|
115
|
+
backgroundColor: backgroundColor,
|
|
116
|
+
padding: 14,
|
|
117
|
+
borderRadius: 6,
|
|
118
|
+
},
|
|
119
|
+
icon: {
|
|
120
|
+
fontSize: 16,
|
|
121
|
+
color: color,
|
|
122
|
+
marginTop: 1.5,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
return (React.createElement(View, { style: styles.toaster },
|
|
126
|
+
React.createElement(TouchableOpacity, { style: styles.toasterContainer, onPress: onClick },
|
|
127
|
+
React.createElement(Columns, null,
|
|
128
|
+
React.createElement(ColumnsItem, { size: 1 }, iconName && React.createElement(Icon, { style: styles.icon, name: iconName })),
|
|
129
|
+
React.createElement(ColumnsItem, null,
|
|
130
|
+
title && React.createElement(Title, { level: TitleLevels.SIX }, title),
|
|
131
|
+
description && (React.createElement(React.Fragment, null,
|
|
132
|
+
React.createElement(Spacer, { size: SpacerSize.SMALL }),
|
|
133
|
+
React.createElement(Text, { level: TextLevels.THREE }, description)))),
|
|
134
|
+
closable && (React.createElement(ColumnsItem, { size: 1 },
|
|
135
|
+
React.createElement(TouchableOpacity, { onPress: (e) => {
|
|
136
|
+
LibToast.hide();
|
|
137
|
+
closable(e);
|
|
138
|
+
} },
|
|
139
|
+
React.createElement(Icon, { name: IconName.TIMES, size: IconSize.SMALL }))))))));
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Toaster provider
|
|
143
|
+
* @param children {React.ReactNode} Custom Toast Content
|
|
144
|
+
* @param duration {number} Duration in MS (Default: 5000)
|
|
145
|
+
* @param offset {number} Offset position margin (Default: 10 dp)
|
|
146
|
+
* @param others
|
|
147
|
+
*/
|
|
148
|
+
export const ToasterAlertProvider = ({ children }) => {
|
|
149
|
+
const toastConfig = {
|
|
150
|
+
tomatoToast: ToasterAlert,
|
|
151
|
+
};
|
|
152
|
+
return (React.createElement(ToasterContext.Provider, { value: { show: showToast, hide: LibToast.hide } },
|
|
153
|
+
children,
|
|
154
|
+
React.createElement(LibToast, { config: toastConfig })));
|
|
155
|
+
};
|
|
75
156
|
Alert.displayName = ComponentName.Alert;
|
|
76
157
|
export default Alert;
|
|
77
158
|
//# sourceMappingURL=Alert.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.native.js","sourceRoot":"","sources":["../../../components/alert/Alert.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"Alert.native.js","sourceRoot":"","sources":["../../../components/alert/Alert.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAA;AACzD,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAC,IAAI,EAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAC,IAAI,EAAE,UAAU,EAAC,MAAM,SAAS,CAAA;AACxC,OAAO,EAAC,KAAK,EAAE,WAAW,EAAC,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAC,aAA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,EAAE,QAAQ,CAAC,KAAK,GAAI,CACnC,CACP,CACf,CACO,CACO,CACd,CACR,CAAA;AACH,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAe,EAAE;IACnF,MAAM,WAAW,GAAG;QAClB,WAAW,EAAE,YAAY;KAC1B,CAAA;IAED,OAAO,CACL,oBAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE;QACrE,QAAQ;QACT,oBAAC,QAAQ,IAAC,MAAM,EAAE,WAAW,GAAI,CACT,CAC3B,CAAA;AACH,CAAC,CAAA;AAED,KAAK,CAAC,WAAW,GAAG,aAAa,CAAC,KAAK,CAAA;AAEvC,eAAe,KAAK,CAAA"}
|
|
@@ -2,8 +2,29 @@
|
|
|
2
2
|
import { Clickable } from './../../objects/facets/Clickable';
|
|
3
3
|
import { Accessibility, AlertProps as PropsAlert } from '../../objects/facets';
|
|
4
4
|
import { IconName, IconNameValues } from '../icon/IconNameEnum';
|
|
5
|
+
import { ClickEvent } from "../../events/OnClickEvent";
|
|
6
|
+
export declare enum ToasterAlertPosition {
|
|
7
|
+
TOP = "top",
|
|
8
|
+
BOTTOM = "bottom"
|
|
9
|
+
}
|
|
10
|
+
export interface ToasterAlertProps extends AlertProps, Clickable, Accessibility {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
toasterChildren?: React.ReactNode;
|
|
14
|
+
iconName?: IconName | IconNameValues;
|
|
15
|
+
title?: string | React.ReactNode;
|
|
16
|
+
description?: string | React.ReactNode;
|
|
17
|
+
deletable?: ClickEvent | boolean;
|
|
18
|
+
closable?: ClickEvent;
|
|
19
|
+
position?: ToasterAlertPosition;
|
|
20
|
+
duration?: number;
|
|
21
|
+
offset?: number;
|
|
22
|
+
display?: boolean;
|
|
23
|
+
onShow?: () => void;
|
|
24
|
+
onHide?: () => void;
|
|
25
|
+
}
|
|
5
26
|
/**
|
|
6
|
-
*
|
|
27
|
+
* Alert Interface
|
|
7
28
|
*/
|
|
8
29
|
export interface AlertProps extends PropsAlert, Clickable, Accessibility {
|
|
9
30
|
iconName?: IconName | IconNameValues;
|
|
@@ -12,4 +33,5 @@ export interface AlertProps extends PropsAlert, Clickable, Accessibility {
|
|
|
12
33
|
className?: string;
|
|
13
34
|
iconClassname?: string;
|
|
14
35
|
display?: boolean;
|
|
36
|
+
toaster?: boolean;
|
|
15
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertProps.js","sourceRoot":"","sources":["../../../components/alert/AlertProps.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"AlertProps.js","sourceRoot":"","sources":["../../../components/alert/AlertProps.ts"],"names":[],"mappings":"AAKA,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,yCAAiB,CAAA;AACnB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToasterContext.js","sourceRoot":"","sources":["../../../../components/alert/context/ToasterContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,CAAC,CAAA;AAEtB,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAgD,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;AAE3H,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Accessibility, AlertProps } from '../../../objects';
|
|
2
|
+
import { IconName, IconNameValues } from '../../icon';
|
|
3
|
+
import { ToasterAlertPosition } from '../AlertProps';
|
|
4
|
+
/**
|
|
5
|
+
* @param title {string} Notification title content
|
|
6
|
+
* @param description {string|ReactNode} Notification description content
|
|
7
|
+
* @param iconName {IconName} Custom icon
|
|
8
|
+
* @param alert {AlertState} Alert Variant (INFO|SUCCESS|WARNING|ERROR)
|
|
9
|
+
* @param onClick {Function} onClick Event for all notification
|
|
10
|
+
* @param closable {Function} onClick Event on cross icon
|
|
11
|
+
* @param onHide {Function} onClick Event on hide
|
|
12
|
+
*/
|
|
13
|
+
export interface ToastProps extends AlertProps, Accessibility {
|
|
14
|
+
title: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
iconName?: IconName | IconNameValues;
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
closable?: () => void;
|
|
19
|
+
onHide?: () => void;
|
|
20
|
+
}
|
|
21
|
+
interface ToastConfig {
|
|
22
|
+
position?: ToasterAlertPosition;
|
|
23
|
+
duration?: number;
|
|
24
|
+
offset?: number;
|
|
25
|
+
}
|
|
26
|
+
export type ToasterShowContext = (params: ToastConfig & ToastProps) => void;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToasterContextProps.js","sourceRoot":"","sources":["../../../../components/alert/context/ToasterContextProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../components/alert/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAE7C,eAAe,cAAc,CAAA"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import Alert from './Alert';
|
|
2
|
-
|
|
1
|
+
import Alert, { ToasterAlertProvider } from './Alert';
|
|
2
|
+
import ToasterContext from './context';
|
|
3
|
+
export { Alert, ToasterContext, ToasterAlertProvider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../components/alert/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../components/alert/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,cAAc,MAAM,WAAW,CAAA;AAEtC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -21,5 +21,5 @@ import { AutoCompleteProps, Item } from './AutoCompleteProps';
|
|
|
21
21
|
* @param customIcon {string} Additional icon classes
|
|
22
22
|
* @param debounceSuggestionsTimeout {number} Timeout for getSuggestions debounce
|
|
23
23
|
*/
|
|
24
|
-
declare const AutoComplete: <T extends string | Item<unknown> = string>({ defaultValue, value, classNameMenu, absoluteMenu, fullwidthMenu, placeholder, data, status, onBlur, testId, onChange, name, matching, displayMenu, onItemSelected, customIcon, reference, inputValue, disabled, children, accessibilityLabel, onIconClick, getSuggestions, debounceSuggestionsTimeout, onFocus, }: AutoCompleteProps<T>) => JSX.Element;
|
|
24
|
+
declare const AutoComplete: <T extends string | Item<unknown> = string>({ defaultValue, value, classNameMenu, absoluteMenu, fullwidthMenu, placeholder, data, status, onBlur, testId, onChange, name, matching, displayMenu, onItemSelected, customIcon, reference, inputValue, disabled, children, accessibilityLabel, onIconClick, getSuggestions, debounceSuggestionsTimeout, onFocus, loading }: AutoCompleteProps<T>) => JSX.Element;
|
|
25
25
|
export default AutoComplete;
|
|
@@ -29,7 +29,7 @@ import { debounce } from './utils';
|
|
|
29
29
|
* @param customIcon {string} Additional icon classes
|
|
30
30
|
* @param debounceSuggestionsTimeout {number} Timeout for getSuggestions debounce
|
|
31
31
|
*/
|
|
32
|
-
const AutoComplete = ({ defaultValue, value, classNameMenu, absoluteMenu, fullwidthMenu, placeholder, data, status, onBlur, testId, onChange, name, matching = defaultMatching, displayMenu = true, onItemSelected, customIcon, reference, inputValue, disabled, children, accessibilityLabel, onIconClick, getSuggestions, debounceSuggestionsTimeout, onFocus, }) => {
|
|
32
|
+
const AutoComplete = ({ defaultValue, value, classNameMenu, absoluteMenu, fullwidthMenu, placeholder, data, status, onBlur, testId, onChange, name, matching = defaultMatching, displayMenu = true, onItemSelected, customIcon, reference, inputValue, disabled, children, accessibilityLabel, onIconClick, getSuggestions, debounceSuggestionsTimeout, onFocus, loading }) => {
|
|
33
33
|
var _a;
|
|
34
34
|
const { styled } = useTrilogyContext();
|
|
35
35
|
const [itemSelected, setItemSelected] = useState(null);
|
|
@@ -141,7 +141,7 @@ const AutoComplete = ({ defaultValue, value, classNameMenu, absoluteMenu, fullwi
|
|
|
141
141
|
onBlur(e);
|
|
142
142
|
}, onFocus: handleFocus, onKeyUp: handleKeyPress, value: _inputValue, onChange: (event) => {
|
|
143
143
|
onInputChange(event);
|
|
144
|
-
}, onIconClick: onIconClick }),
|
|
144
|
+
}, onIconClick: onIconClick, loading: loading }),
|
|
145
145
|
isAutocompleteMenuVisible && (React.createElement("div", { className: autocompleteClasses }, search.length > 0 && (React.createElement(AutoCompleteMenu, { testId: testId, absolute: absoluteMenu, fullwidth: fullwidthMenu, className: classNameMenu }, search.map((item, i) => (React.createElement(AutoCompleteItem, { active: activeItem === i, key: i, testId: testId, item: item, suggestionSelected: (v) => suggestionSelected(v, data, search) }, children ? children(item) : getLabel(item)))))))),
|
|
146
146
|
React.createElement("div", null)));
|
|
147
147
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoComplete.js","sourceRoot":"","sources":["../../../components/autocomplete/AutoComplete.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAA;AAChD,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AACvC,OAAO,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAA;AACjC,OAAO,EAAC,KAAK,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,CACH,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
package/lib/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,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;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
|
|
@@ -232,6 +232,7 @@ const Input = ({ forceControl, className, disabled, onChange, onKeyPress, onKeyU
|
|
|
232
232
|
inputName: target.name,
|
|
233
233
|
inputValue: target.value,
|
|
234
234
|
inputKeyCode: e.keyCode,
|
|
235
|
+
preventDefault: () => e.preventDefault()
|
|
235
236
|
});
|
|
236
237
|
}
|
|
237
238
|
}, onKeyPress: (e) => {
|
|
@@ -241,6 +242,7 @@ const Input = ({ forceControl, className, disabled, onChange, onKeyPress, onKeyU
|
|
|
241
242
|
inputName: target.name,
|
|
242
243
|
inputValue: target.value,
|
|
243
244
|
inputKeyCode: e.keyCode,
|
|
245
|
+
preventDefault: () => e.preventDefault()
|
|
244
246
|
});
|
|
245
247
|
}
|
|
246
248
|
}, onChange: (e) => {
|