venice-ui 1.1.2 → 1.1.3
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/cjs/Theme/Theme.js +4 -0
- package/dist/cjs/components/Icons/Icon.js +7 -2
- package/dist/cjs/components/Icons/Icon.styles.js +23 -16
- package/dist/esm/Theme/Theme.js +4 -0
- package/dist/esm/components/Icons/Icon.js +8 -3
- package/dist/esm/components/Icons/Icon.styles.js +23 -16
- package/dist/types/Theme/Theme.d.ts +3 -0
- package/dist/types/components/Icons/Icon.d.ts +1 -0
- package/dist/types/components/Icons/Icon.styles.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/Theme/Theme.js
CHANGED
|
@@ -70,6 +70,10 @@ exports.mainTheme = {
|
|
|
70
70
|
buttonInverseHover: (0, polished_1.lighten)(0.3, exports.Theme.colors.primary),
|
|
71
71
|
disabledBackground: exports.Theme.colors.gray_4,
|
|
72
72
|
disabledText: exports.Theme.colors.gray_1,
|
|
73
|
+
//icon
|
|
74
|
+
iconColor: exports.Theme.colors.text,
|
|
75
|
+
iconDisabledColor: exports.Theme.colors.gray_4,
|
|
76
|
+
iconHoverColor: exports.Theme.colors.primary_10,
|
|
73
77
|
//text
|
|
74
78
|
textColor: exports.Theme.colors.text,
|
|
75
79
|
// input
|
|
@@ -8,8 +8,13 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const Theme_1 = require("../../Theme/Theme");
|
|
9
9
|
const Icon_styles_1 = require("./Icon.styles");
|
|
10
10
|
const IconsPath_1 = require("./IconsPath");
|
|
11
|
-
const Icon = ({ size = 24, name, right = false, left = false,
|
|
12
|
-
|
|
11
|
+
const Icon = ({ size = 24, name, right = false, left = false, hoverColor = Theme_1.mainTheme.iconHoverColor, active = false, inverseMode = false, onClick, isDisabled = false, color = isDisabled ? Theme_1.mainTheme.iconDisabledColor : Theme_1.mainTheme.iconColor, }) => {
|
|
12
|
+
const handleClick = () => {
|
|
13
|
+
if (!isDisabled && !!onClick) {
|
|
14
|
+
onClick();
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return (react_1.default.createElement(Icon_styles_1.IconElement, { onClick: handleClick, right: right, left: left, active: active, hoverColor: hoverColor, inverseMode: inverseMode, isDisabled: isDisabled },
|
|
13
18
|
react_1.default.createElement("svg", { width: size, height: size, viewBox: '0 0 24 24', preserveAspectRatio: "xMidYMid meet", x: "0", y: "0", name: name },
|
|
14
19
|
react_1.default.createElement("path", { d: IconsPath_1.iconsPath[name], fill: color }))));
|
|
15
20
|
};
|
|
@@ -15,28 +15,35 @@ exports.IconElement = styled_components_1.default.div `
|
|
|
15
15
|
margin-left: ${(p) => (p.right ? Theme_1.Theme.padding.m : '0')};
|
|
16
16
|
margin-right: ${(p) => (p.left ? Theme_1.Theme.padding.m : '0')};
|
|
17
17
|
padding: 4px;
|
|
18
|
+
|
|
18
19
|
${(p) => p.onClick !== undefined &&
|
|
19
20
|
`
|
|
20
|
-
cursor:pointer;
|
|
21
|
+
cursor: ${(p) => (!p.isDisabled ? 'pointer' : 'not-allowed')};
|
|
21
22
|
path {
|
|
22
|
-
fill
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
fill: ${(p) => (p.color ? p.color : Theme_1.Theme.colors.primary)};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
${!p.isDisabled &&
|
|
27
|
+
`
|
|
28
|
+
&:hover {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
${!p.inverseMode
|
|
31
|
+
? `
|
|
32
|
+
background-color: ${p.hoverColor};
|
|
33
|
+
`
|
|
34
|
+
: `
|
|
35
|
+
path {
|
|
36
|
+
fill: ${p.hoverColor};
|
|
37
|
+
}
|
|
38
|
+
`}
|
|
35
39
|
}
|
|
40
|
+
`}
|
|
36
41
|
`}
|
|
37
42
|
|
|
38
43
|
${(p) => p.active &&
|
|
39
44
|
`
|
|
40
|
-
background-color
|
|
41
|
-
|
|
45
|
+
background-color: ${p.hoverColor};
|
|
46
|
+
path {
|
|
47
|
+
}
|
|
48
|
+
`}
|
|
42
49
|
`;
|
package/dist/esm/Theme/Theme.js
CHANGED
|
@@ -67,6 +67,10 @@ export const mainTheme = {
|
|
|
67
67
|
buttonInverseHover: lighten(0.3, Theme.colors.primary),
|
|
68
68
|
disabledBackground: Theme.colors.gray_4,
|
|
69
69
|
disabledText: Theme.colors.gray_1,
|
|
70
|
+
//icon
|
|
71
|
+
iconColor: Theme.colors.text,
|
|
72
|
+
iconDisabledColor: Theme.colors.gray_4,
|
|
73
|
+
iconHoverColor: Theme.colors.primary_10,
|
|
70
74
|
//text
|
|
71
75
|
textColor: Theme.colors.text,
|
|
72
76
|
// input
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { mainTheme } from '../../Theme/Theme';
|
|
3
3
|
import { IconElement } from './Icon.styles';
|
|
4
4
|
import { iconsPath } from './IconsPath';
|
|
5
|
-
export const Icon = ({ size = 24, name, right = false, left = false,
|
|
6
|
-
|
|
5
|
+
export const Icon = ({ size = 24, name, right = false, left = false, hoverColor = mainTheme.iconHoverColor, active = false, inverseMode = false, onClick, isDisabled = false, color = isDisabled ? mainTheme.iconDisabledColor : mainTheme.iconColor, }) => {
|
|
6
|
+
const handleClick = () => {
|
|
7
|
+
if (!isDisabled && !!onClick) {
|
|
8
|
+
onClick();
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
return (React.createElement(IconElement, { onClick: handleClick, right: right, left: left, active: active, hoverColor: hoverColor, inverseMode: inverseMode, isDisabled: isDisabled },
|
|
7
12
|
React.createElement("svg", { width: size, height: size, viewBox: '0 0 24 24', preserveAspectRatio: "xMidYMid meet", x: "0", y: "0", name: name },
|
|
8
13
|
React.createElement("path", { d: iconsPath[name], fill: color }))));
|
|
9
14
|
};
|
|
@@ -9,28 +9,35 @@ export const IconElement = styled.div `
|
|
|
9
9
|
margin-left: ${(p) => (p.right ? Theme.padding.m : '0')};
|
|
10
10
|
margin-right: ${(p) => (p.left ? Theme.padding.m : '0')};
|
|
11
11
|
padding: 4px;
|
|
12
|
+
|
|
12
13
|
${(p) => p.onClick !== undefined &&
|
|
13
14
|
`
|
|
14
|
-
cursor:pointer;
|
|
15
|
+
cursor: ${(p) => (!p.isDisabled ? 'pointer' : 'not-allowed')};
|
|
15
16
|
path {
|
|
16
|
-
fill
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
fill: ${(p) => (p.color ? p.color : Theme.colors.primary)};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
${!p.isDisabled &&
|
|
21
|
+
`
|
|
22
|
+
&:hover {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
${!p.inverseMode
|
|
25
|
+
? `
|
|
26
|
+
background-color: ${p.hoverColor};
|
|
27
|
+
`
|
|
28
|
+
: `
|
|
29
|
+
path {
|
|
30
|
+
fill: ${p.hoverColor};
|
|
31
|
+
}
|
|
32
|
+
`}
|
|
29
33
|
}
|
|
34
|
+
`}
|
|
30
35
|
`}
|
|
31
36
|
|
|
32
37
|
${(p) => p.active &&
|
|
33
38
|
`
|
|
34
|
-
background-color
|
|
35
|
-
|
|
39
|
+
background-color: ${p.hoverColor};
|
|
40
|
+
path {
|
|
41
|
+
}
|
|
42
|
+
`}
|
|
36
43
|
`;
|
|
@@ -65,6 +65,9 @@ export declare const mainTheme: {
|
|
|
65
65
|
buttonInverseHover: string;
|
|
66
66
|
disabledBackground: string;
|
|
67
67
|
disabledText: string;
|
|
68
|
+
iconColor: string;
|
|
69
|
+
iconDisabledColor: string;
|
|
70
|
+
iconHoverColor: string;
|
|
68
71
|
textColor: string;
|
|
69
72
|
inputDefaultBackground: string;
|
|
70
73
|
inputDefaultBorder: string;
|