@yourdash/uikit 1.0.10 → 1.0.12
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/components/buttonWithIcon/buttonWithIcon.module.scss +1 -1
- package/components/buttonWithIcon/buttonWithIcon.tsx +2 -2
- package/components/icon/icon.tsx +16 -4
- package/components/icon/iconDictionary.ts +285 -566
- package/components/iconButton/iconButton.tsx +1 -1
- package/components/image/image.tsx +83 -83
- package/components/textInput/textInput.tsx +2 -2
- package/components/toast/toastAction.ts +12 -12
- package/package.json +1 -1
- package/views/dialog/dialog.tsx +23 -23
- package/views/onBoarding/onBoarding.tsx +143 -138
- package/views/onBoarding/onBoarding.tsx~ +0 -138
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
import clippy from "@yourdash/shared/web/helpers/clippy.ts";
|
7
7
|
import Icon from "../icon/icon.tsx";
|
8
|
-
import { UKIcon } from "../icon/iconDictionary.ts";
|
8
|
+
import { UKIcon, UKIconType } from "../icon/iconDictionary.ts";
|
9
9
|
import styles from "./buttonWithIcon.module.scss";
|
10
10
|
import { FC } from "react";
|
11
11
|
|
12
12
|
const ButtonWithIcon: FC<{
|
13
|
-
icon:
|
13
|
+
icon: UKIconType;
|
14
14
|
onClick: () => void;
|
15
15
|
text: string;
|
16
16
|
className?: string;
|
package/components/icon/icon.tsx
CHANGED
@@ -3,22 +3,34 @@
|
|
3
3
|
* YourDash is licensed under the MIT License. (https://ewsgit.mit-license.org)
|
4
4
|
*/
|
5
5
|
|
6
|
-
import { UKIcon } from "./iconDictionary.ts";
|
6
|
+
import { UKIcon, UKIconType } from "./iconDictionary.ts";
|
7
7
|
import styles from "./icon.module.scss";
|
8
|
-
import { FC } from "react";
|
8
|
+
import { FC, useEffect, useState } from "react";
|
9
|
+
import ServerErrorIcon from "./icons/server-error.svg";
|
9
10
|
|
10
11
|
const Icon: FC<{
|
11
|
-
|
12
|
+
// noinspection TypeScriptDuplicateUnionOrIntersectionType
|
13
|
+
icon: UKIconType;
|
12
14
|
size?: string;
|
13
15
|
color?: string;
|
14
16
|
preserveColor?: boolean;
|
15
17
|
className?: string;
|
16
18
|
}> = (props) => {
|
19
|
+
const [icon, setIcon] = useState(ServerErrorIcon);
|
20
|
+
|
21
|
+
useEffect(() => {
|
22
|
+
if (typeof props.icon === "function") {
|
23
|
+
props.icon().then((val) => {
|
24
|
+
setIcon(val.default);
|
25
|
+
});
|
26
|
+
}
|
27
|
+
}, [props.icon]);
|
28
|
+
|
17
29
|
return (
|
18
30
|
<div
|
19
31
|
className={`${styles.component} ${props.className} ${props.preserveColor ? styles.preserveColor : ""}`}
|
20
32
|
style={{
|
21
|
-
"--icon": `url(${
|
33
|
+
"--icon": `url(${icon})`,
|
22
34
|
...(!props.preserveColor ? { "--color": props.color } : {}),
|
23
35
|
// @ts-ignore
|
24
36
|
"--size": props.size,
|