sapo-components-ui-rn 1.0.48 → 1.0.49
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/index.d.ts +1 -1
- package/dist/icons/IconError.d.ts +4 -0
- package/dist/icons/IconInfo.d.ts +4 -0
- package/dist/icons/IconSuccess.d.ts +4 -0
- package/dist/icons/IconWarning.d.ts +4 -0
- package/dist/index.esm.js +33 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +32 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Icon/index.tsx +17 -1
- package/src/components/Toast/index.tsx +7 -6
- package/src/icons/IconError.tsx +21 -0
- package/src/icons/IconInfo.tsx +27 -0
- package/src/icons/IconSuccess.tsx +21 -0
- package/src/icons/IconWarning.tsx +27 -0
package/package.json
CHANGED
|
@@ -15,6 +15,10 @@ import IconArrowDown from "../../icons/IconArrowDown";
|
|
|
15
15
|
import IconClearText from "../../icons/IconClearText";
|
|
16
16
|
import IconSearch from "@/icons/IconSearch";
|
|
17
17
|
import IconClose from "@/icons/IconClose";
|
|
18
|
+
import IconSuccess from "@/icons/IconSuccess";
|
|
19
|
+
import IconError from "@/icons/IconError";
|
|
20
|
+
import IconInfo from "@/icons/IconInfo";
|
|
21
|
+
import IconWarning from "@/icons/IconWarning";
|
|
18
22
|
|
|
19
23
|
export type IconType =
|
|
20
24
|
| "FontAwesome"
|
|
@@ -34,7 +38,11 @@ export interface IconProps {
|
|
|
34
38
|
| "IconArrowDown"
|
|
35
39
|
| "IconClearText"
|
|
36
40
|
| "IconSearch"
|
|
37
|
-
| "IconClose"
|
|
41
|
+
| "IconClose"
|
|
42
|
+
| "IconSuccess"
|
|
43
|
+
| "IconError"
|
|
44
|
+
| "IconInfo"
|
|
45
|
+
| "IconWarning";
|
|
38
46
|
backgroundColor?: string;
|
|
39
47
|
size?: number;
|
|
40
48
|
color?: string;
|
|
@@ -95,6 +103,14 @@ const Icon: React.FC<IconProps> = ({
|
|
|
95
103
|
return IconSearch;
|
|
96
104
|
case "IconClose":
|
|
97
105
|
return IconClose;
|
|
106
|
+
case "IconSuccess":
|
|
107
|
+
return IconSuccess;
|
|
108
|
+
case "IconError":
|
|
109
|
+
return IconError;
|
|
110
|
+
case "IconInfo":
|
|
111
|
+
return IconInfo;
|
|
112
|
+
case "IconWarning":
|
|
113
|
+
return IconWarning;
|
|
98
114
|
default:
|
|
99
115
|
return IconCheckbox;
|
|
100
116
|
}
|
|
@@ -10,6 +10,7 @@ import View from "../View";
|
|
|
10
10
|
import { memoWithRef } from "@/utils/function-utils";
|
|
11
11
|
import ViewVisibleAnimated from "../ViewVisibleAnimated";
|
|
12
12
|
import { useInternalTheme } from "../../core/theming";
|
|
13
|
+
import Icon from "../Icon";
|
|
13
14
|
|
|
14
15
|
const POSITION = {
|
|
15
16
|
TOP: "top",
|
|
@@ -165,15 +166,15 @@ const Toast = memoWithRef(
|
|
|
165
166
|
const getSourceIcon = () => {
|
|
166
167
|
switch (options.type) {
|
|
167
168
|
case "success":
|
|
168
|
-
return
|
|
169
|
+
return "IconSuccess";
|
|
169
170
|
case "error":
|
|
170
|
-
return
|
|
171
|
+
return "IconError";
|
|
171
172
|
case "info":
|
|
172
|
-
return
|
|
173
|
+
return "IconInfo";
|
|
173
174
|
case "warning":
|
|
174
|
-
return
|
|
175
|
+
return "IconWarning";
|
|
175
176
|
default:
|
|
176
|
-
return
|
|
177
|
+
return "IconSuccess";
|
|
177
178
|
}
|
|
178
179
|
};
|
|
179
180
|
|
|
@@ -234,7 +235,7 @@ const Toast = memoWithRef(
|
|
|
234
235
|
>
|
|
235
236
|
<View row style={{ alignItems: "flex-start" }}>
|
|
236
237
|
<View>
|
|
237
|
-
<
|
|
238
|
+
<Icon name={getSourceIcon()} type="Svg" size={20} />
|
|
238
239
|
</View>
|
|
239
240
|
<View full paddingLeft={CONSTANTS.SPACE_8}>
|
|
240
241
|
<Text bold color={colors.textOnFillDefault}>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Svg, { Path } from "react-native-svg";
|
|
3
|
+
import { SvgProps } from "react-native-svg";
|
|
4
|
+
const IconError = (props: SvgProps) => (
|
|
5
|
+
<Svg width="20" height="20" viewBox="0 0 20 20" fill="none" {...props}>
|
|
6
|
+
<Path
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5ZM3.86364 10C3.86364 6.61098 6.61098 3.86364 10 3.86364C13.389 3.86364 16.1364 6.61098 16.1364 10C16.1364 13.389 13.389 16.1364 10 16.1364C6.61098 16.1364 3.86364 13.389 3.86364 10Z"
|
|
10
|
+
fill="white"
|
|
11
|
+
/>
|
|
12
|
+
<Path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
clipRule="evenodd"
|
|
15
|
+
d="M13.3333 6.66667L10 10L6.66667 6.66667L5.83333 7.5L9.16667 10.8333L5.83333 14.1667L6.66667 15L10 11.6667L13.3333 15L14.1667 14.1667L10.8333 10.8333L14.1667 7.5L13.3333 6.66667Z"
|
|
16
|
+
fill="white"
|
|
17
|
+
/>
|
|
18
|
+
</Svg>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export default IconError;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Svg, { Path, SvgProps } from "react-native-svg";
|
|
3
|
+
|
|
4
|
+
const IconInfo = (props: SvgProps) => (
|
|
5
|
+
<Svg width="20" height="20" viewBox="0 0 20 20" fill="none" {...props}>
|
|
6
|
+
<Path
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5ZM3.86364 10C3.86364 6.61098 6.61098 3.86364 10 3.86364C13.389 3.86364 16.1364 6.61098 16.1364 10C16.1364 13.389 13.389 16.1364 10 16.1364C6.61098 16.1364 3.86364 13.389 3.86364 10Z"
|
|
10
|
+
fill="white"
|
|
11
|
+
/>
|
|
12
|
+
<Path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
clipRule="evenodd"
|
|
15
|
+
d="M10 6.66667C10.4602 6.66667 10.8333 7.03976 10.8333 7.5V10.8333C10.8333 11.2936 10.4602 11.6667 10 11.6667C9.53976 11.6667 9.16667 11.2936 9.16667 10.8333V7.5C9.16667 7.03976 9.53976 6.66667 10 6.66667Z"
|
|
16
|
+
fill="white"
|
|
17
|
+
/>
|
|
18
|
+
<Path
|
|
19
|
+
fillRule="evenodd"
|
|
20
|
+
clipRule="evenodd"
|
|
21
|
+
d="M10 12.5C10.4602 12.5 10.8333 12.8731 10.8333 13.3333C10.8333 13.7936 10.4602 14.1667 10 14.1667C9.53976 14.1667 9.16667 13.7936 9.16667 13.3333C9.16667 12.8731 9.53976 12.5 10 12.5Z"
|
|
22
|
+
fill="white"
|
|
23
|
+
/>
|
|
24
|
+
</Svg>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export default IconInfo;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Svg, { Path, SvgProps } from "react-native-svg";
|
|
3
|
+
|
|
4
|
+
const IconSuccess = (props: SvgProps) => (
|
|
5
|
+
<Svg width="20" height="20" viewBox="0 0 20 20" fill="none" {...props}>
|
|
6
|
+
<Path
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5ZM3.86364 10C3.86364 6.61098 6.61098 3.86364 10 3.86364C13.389 3.86364 16.1364 6.61098 16.1364 10C16.1364 13.389 13.389 16.1364 10 16.1364C6.61098 16.1364 3.86364 13.389 3.86364 10Z"
|
|
10
|
+
fill="white"
|
|
11
|
+
/>
|
|
12
|
+
<Path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
clipRule="evenodd"
|
|
15
|
+
d="M8.875 10.9242L12.8447 6.9545L13.9053 8.01516L8.875 13.0455L6.09467 10.2652L7.15533 9.2045L8.875 10.9242Z"
|
|
16
|
+
fill="white"
|
|
17
|
+
/>
|
|
18
|
+
</Svg>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export default IconSuccess;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Svg, { Path, SvgProps } from "react-native-svg";
|
|
3
|
+
|
|
4
|
+
const IconWarning = (props: SvgProps) => (
|
|
5
|
+
<Svg width="20" height="20" viewBox="0 0 20 20" fill="none" {...props}>
|
|
6
|
+
<Path
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M10 2.5L17.5 17.5H2.5L10 2.5ZM10 5.83333L4.16667 15.8333H15.8333L10 5.83333Z"
|
|
10
|
+
fill="white"
|
|
11
|
+
/>
|
|
12
|
+
<Path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
clipRule="evenodd"
|
|
15
|
+
d="M10 7.5C10.4602 7.5 10.8333 7.8731 10.8333 8.33333V11.6667C10.8333 12.1269 10.4602 12.5 10 12.5C9.53976 12.5 9.16667 12.1269 9.16667 11.6667V8.33333C9.16667 7.8731 9.53976 7.5 10 7.5Z"
|
|
16
|
+
fill="white"
|
|
17
|
+
/>
|
|
18
|
+
<Path
|
|
19
|
+
fillRule="evenodd"
|
|
20
|
+
clipRule="evenodd"
|
|
21
|
+
d="M10 13.3333C10.4602 13.3333 10.8333 13.7064 10.8333 14.1667C10.8333 14.6269 10.4602 15 10 15C9.53976 15 9.16667 14.6269 9.16667 14.1667C9.16667 13.7064 9.53976 13.3333 10 13.3333Z"
|
|
22
|
+
fill="white"
|
|
23
|
+
/>
|
|
24
|
+
</Svg>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export default IconWarning;
|