@propellerads/card 3.0.0 → 3.2.0
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/CHANGELOG.md +6 -0
- package/dist/card.cjs.development.js +23 -14
- package/dist/card.cjs.development.js.map +1 -1
- package/dist/card.cjs.production.min.js +1 -1
- package/dist/card.esm.js +23 -14
- package/dist/card.esm.js.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/style.d.ts +9 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -17,21 +17,32 @@ function _taggedTemplateLiteralLoose(strings, raw) {
|
|
|
17
17
|
return strings;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
21
|
-
var StyledCard = /*#__PURE__*/styled__default.div(
|
|
20
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
21
|
+
var StyledCard = /*#__PURE__*/styled__default.div.attrs(function (props) {
|
|
22
|
+
return {
|
|
23
|
+
className: props.className
|
|
24
|
+
};
|
|
25
|
+
})(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: 100%;\n border-radius: ", "px;\n border: solid 2px ", ";\n background-color: ", ";\n padding: ", "px;\n \n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), stylevariables.borderRadius, stylevariables.gray95, stylevariables.white, stylevariables.spacing * 6, function (props) {
|
|
22
26
|
return props.isActive && styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n border-color: ", ";\n "])), stylevariables.actionColor);
|
|
23
27
|
}, function (props) {
|
|
24
|
-
|
|
28
|
+
var _props$customStyles;
|
|
29
|
+
return ((_props$customStyles = props.customStyles) == null ? void 0 : _props$customStyles.padding) && styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n padding: ", "px;\n "])), props.customStyles.padding);
|
|
30
|
+
}, function (props) {
|
|
31
|
+
var _props$customStyles2;
|
|
32
|
+
return ((_props$customStyles2 = props.customStyles) == null ? void 0 : _props$customStyles2.borderRadius) && styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n border-radius: ", "px;\n "])), props.customStyles.borderRadius);
|
|
25
33
|
}, function (props) {
|
|
26
|
-
|
|
34
|
+
var _props$customStyles3, _props$customStyles4;
|
|
35
|
+
return ((_props$customStyles3 = props.customStyles) == null ? void 0 : _props$customStyles3.activeBgColor) && ((_props$customStyles4 = props.customStyles) == null ? void 0 : _props$customStyles4.bgColor) && styled.css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n "])), props.isActive ? props.customStyles.activeBgColor : props.customStyles.bgColor);
|
|
27
36
|
});
|
|
28
|
-
var Header = /*#__PURE__*/styled__default.div(
|
|
29
|
-
var Title = /*#__PURE__*/styled__default.div(
|
|
30
|
-
var Label = /*#__PURE__*/styled__default.div(
|
|
31
|
-
var Action = /*#__PURE__*/styled__default.div(
|
|
37
|
+
var Header = /*#__PURE__*/styled__default.div(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n margin-bottom: ", "px; \n"])), stylevariables.spacing * 3);
|
|
38
|
+
var Title = /*#__PURE__*/styled__default.div(_templateObject7 || (_templateObject7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n font-size: ", "px;\n font-weight: bold;\n line-height: ", "px;\n color: ", ";\n"])), stylevariables.fontBig, stylevariables.lineHeight, stylevariables.black);
|
|
39
|
+
var Label = /*#__PURE__*/styled__default.div(_templateObject8 || (_templateObject8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n align-items: flex-start;\n justify-content: flex-end;\n display: flex;\n"])));
|
|
40
|
+
var Action = /*#__PURE__*/styled__default.div(_templateObject9 || (_templateObject9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-top: ", "px;\n \n button + button{\n margin-left: ", "px;\n }\n"])), stylevariables.spacing * 4, stylevariables.spacing * 2);
|
|
32
41
|
|
|
33
42
|
var Card = function Card(_ref) {
|
|
34
43
|
var children = _ref.children,
|
|
44
|
+
_ref$className = _ref.className,
|
|
45
|
+
className = _ref$className === void 0 ? undefined : _ref$className,
|
|
35
46
|
_ref$title = _ref.title,
|
|
36
47
|
title = _ref$title === void 0 ? undefined : _ref$title,
|
|
37
48
|
_ref$action = _ref.action,
|
|
@@ -42,12 +53,10 @@ var Card = function Card(_ref) {
|
|
|
42
53
|
isActive = _ref$isActive === void 0 ? false : _ref$isActive,
|
|
43
54
|
_ref$width = _ref.width,
|
|
44
55
|
width = _ref$width === void 0 ? undefined : _ref$width,
|
|
45
|
-
_ref$padding = _ref.padding,
|
|
46
|
-
padding = _ref$padding === void 0 ? undefined : _ref$padding,
|
|
47
|
-
_ref$borderRadius = _ref.borderRadius,
|
|
48
|
-
borderRadius = _ref$borderRadius === void 0 ? undefined : _ref$borderRadius,
|
|
49
56
|
_ref$elementId = _ref.elementId,
|
|
50
57
|
elementId = _ref$elementId === void 0 ? undefined : _ref$elementId,
|
|
58
|
+
_ref$customStyles = _ref.customStyles,
|
|
59
|
+
customStyles = _ref$customStyles === void 0 ? {} : _ref$customStyles,
|
|
51
60
|
_ref$onClick = _ref.onClick,
|
|
52
61
|
onClick = _ref$onClick === void 0 ? undefined : _ref$onClick;
|
|
53
62
|
var handleClick = function handleClick() {
|
|
@@ -56,13 +65,13 @@ var Card = function Card(_ref) {
|
|
|
56
65
|
}
|
|
57
66
|
};
|
|
58
67
|
return React.createElement(StyledCard, {
|
|
68
|
+
className: className,
|
|
59
69
|
style: {
|
|
60
70
|
width: width
|
|
61
71
|
},
|
|
62
72
|
isActive: isActive,
|
|
63
73
|
id: elementId,
|
|
64
|
-
|
|
65
|
-
padding: padding,
|
|
74
|
+
customStyles: customStyles,
|
|
66
75
|
onClick: handleClick
|
|
67
76
|
}, (title || label) && React.createElement(Header, null, title && React.createElement(Title, null, title), label && React.createElement(Label, null, label)), React.createElement("div", null, children), action && React.createElement(Action, null, action));
|
|
68
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.cjs.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"card.cjs.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function n(n){return n&&"object"==typeof n&&"default"in n?n.default:n}Object.defineProperty(exports,"__esModule",{value:!0});var e,i,
|
|
1
|
+
"use strict";function n(n){return n&&"object"==typeof n&&"default"in n?n.default:n}Object.defineProperty(exports,"__esModule",{value:!0});var e,t,i,o,l,r,s,d,c,a=n(require("react")),u=require("styled-components"),v=n(u),p=require("@propellerads/stylevariables");function m(n,e){return e||(e=n.slice(0)),n.raw=e,n}var f=v.div.attrs((function(n){return{className:n.className}}))(e||(e=m(["\n height: 100%;\n border-radius: ","px;\n border: solid 2px ",";\n background-color: ",";\n padding: ","px;\n \n ","\n\n ","\n\n ","\n\n ","\n"])),p.borderRadius,p.gray95,p.white,6*p.spacing,(function(n){return n.isActive&&u.css(t||(t=m(["\n border-color: ",";\n "])),p.actionColor)}),(function(n){var e;return(null==(e=n.customStyles)?void 0:e.padding)&&u.css(i||(i=m(["\n padding: ","px;\n "])),n.customStyles.padding)}),(function(n){var e;return(null==(e=n.customStyles)?void 0:e.borderRadius)&&u.css(o||(o=m(["\n border-radius: ","px;\n "])),n.customStyles.borderRadius)}),(function(n){var e,t;return(null==(e=n.customStyles)?void 0:e.activeBgColor)&&(null==(t=n.customStyles)?void 0:t.bgColor)&&u.css(l||(l=m(["\n background-color: ",";\n "])),n.isActive?n.customStyles.activeBgColor:n.customStyles.bgColor)})),g=v.div(r||(r=m(["\n display: flex;\n margin-bottom: ","px; \n"])),3*p.spacing),b=v.div(s||(s=m(["\n flex: 1;\n font-size: ","px;\n font-weight: bold;\n line-height: ","px;\n color: ",";\n"])),p.fontBig,p.lineHeight,p.black),y=v.div(d||(d=m(["\n flex: 1;\n align-items: flex-start;\n justify-content: flex-end;\n display: flex;\n"]))),x=v.div(c||(c=m(["\n margin-top: ","px;\n \n button + button{\n margin-left: ","px;\n }\n"])),4*p.spacing,2*p.spacing);exports.default=function(n){var e=n.children,t=n.className,i=n.title,o=void 0===i?void 0:i,l=n.action,r=void 0===l?void 0:l,s=n.label,d=void 0===s?void 0:s,c=n.isActive,u=n.width,v=n.elementId,p=void 0===v?void 0:v,m=n.customStyles,h=n.onClick,S=void 0===h?void 0:h;return a.createElement(f,{className:void 0===t?void 0:t,style:{width:void 0===u?void 0:u},isActive:void 0!==c&&c,id:p,customStyles:void 0===m?{}:m,onClick:function(){S&&S(p)}},(o||d)&&a.createElement(g,null,o&&a.createElement(b,null,o),d&&a.createElement(y,null,d)),a.createElement("div",null,e),r&&a.createElement(x,null,r))};
|
|
2
2
|
//# sourceMappingURL=card.cjs.production.min.js.map
|
package/dist/card.esm.js
CHANGED
|
@@ -10,21 +10,32 @@ function _taggedTemplateLiteralLoose(strings, raw) {
|
|
|
10
10
|
return strings;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
14
|
-
var StyledCard = /*#__PURE__*/styled.div(
|
|
13
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
14
|
+
var StyledCard = /*#__PURE__*/styled.div.attrs(function (props) {
|
|
15
|
+
return {
|
|
16
|
+
className: props.className
|
|
17
|
+
};
|
|
18
|
+
})(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: 100%;\n border-radius: ", "px;\n border: solid 2px ", ";\n background-color: ", ";\n padding: ", "px;\n \n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), borderRadius, gray95, white, spacing * 6, function (props) {
|
|
15
19
|
return props.isActive && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n border-color: ", ";\n "])), actionColor);
|
|
16
20
|
}, function (props) {
|
|
17
|
-
|
|
21
|
+
var _props$customStyles;
|
|
22
|
+
return ((_props$customStyles = props.customStyles) == null ? void 0 : _props$customStyles.padding) && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n padding: ", "px;\n "])), props.customStyles.padding);
|
|
23
|
+
}, function (props) {
|
|
24
|
+
var _props$customStyles2;
|
|
25
|
+
return ((_props$customStyles2 = props.customStyles) == null ? void 0 : _props$customStyles2.borderRadius) && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteralLoose(["\n border-radius: ", "px;\n "])), props.customStyles.borderRadius);
|
|
18
26
|
}, function (props) {
|
|
19
|
-
|
|
27
|
+
var _props$customStyles3, _props$customStyles4;
|
|
28
|
+
return ((_props$customStyles3 = props.customStyles) == null ? void 0 : _props$customStyles3.activeBgColor) && ((_props$customStyles4 = props.customStyles) == null ? void 0 : _props$customStyles4.bgColor) && css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteralLoose(["\n background-color: ", ";\n "])), props.isActive ? props.customStyles.activeBgColor : props.customStyles.bgColor);
|
|
20
29
|
});
|
|
21
|
-
var Header = /*#__PURE__*/styled.div(
|
|
22
|
-
var Title = /*#__PURE__*/styled.div(
|
|
23
|
-
var Label = /*#__PURE__*/styled.div(
|
|
24
|
-
var Action = /*#__PURE__*/styled.div(
|
|
30
|
+
var Header = /*#__PURE__*/styled.div(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n margin-bottom: ", "px; \n"])), spacing * 3);
|
|
31
|
+
var Title = /*#__PURE__*/styled.div(_templateObject7 || (_templateObject7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n font-size: ", "px;\n font-weight: bold;\n line-height: ", "px;\n color: ", ";\n"])), fontBig, lineHeight, black);
|
|
32
|
+
var Label = /*#__PURE__*/styled.div(_templateObject8 || (_templateObject8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n align-items: flex-start;\n justify-content: flex-end;\n display: flex;\n"])));
|
|
33
|
+
var Action = /*#__PURE__*/styled.div(_templateObject9 || (_templateObject9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-top: ", "px;\n \n button + button{\n margin-left: ", "px;\n }\n"])), spacing * 4, spacing * 2);
|
|
25
34
|
|
|
26
35
|
var Card = function Card(_ref) {
|
|
27
36
|
var children = _ref.children,
|
|
37
|
+
_ref$className = _ref.className,
|
|
38
|
+
className = _ref$className === void 0 ? undefined : _ref$className,
|
|
28
39
|
_ref$title = _ref.title,
|
|
29
40
|
title = _ref$title === void 0 ? undefined : _ref$title,
|
|
30
41
|
_ref$action = _ref.action,
|
|
@@ -35,12 +46,10 @@ var Card = function Card(_ref) {
|
|
|
35
46
|
isActive = _ref$isActive === void 0 ? false : _ref$isActive,
|
|
36
47
|
_ref$width = _ref.width,
|
|
37
48
|
width = _ref$width === void 0 ? undefined : _ref$width,
|
|
38
|
-
_ref$padding = _ref.padding,
|
|
39
|
-
padding = _ref$padding === void 0 ? undefined : _ref$padding,
|
|
40
|
-
_ref$borderRadius = _ref.borderRadius,
|
|
41
|
-
borderRadius = _ref$borderRadius === void 0 ? undefined : _ref$borderRadius,
|
|
42
49
|
_ref$elementId = _ref.elementId,
|
|
43
50
|
elementId = _ref$elementId === void 0 ? undefined : _ref$elementId,
|
|
51
|
+
_ref$customStyles = _ref.customStyles,
|
|
52
|
+
customStyles = _ref$customStyles === void 0 ? {} : _ref$customStyles,
|
|
44
53
|
_ref$onClick = _ref.onClick,
|
|
45
54
|
onClick = _ref$onClick === void 0 ? undefined : _ref$onClick;
|
|
46
55
|
var handleClick = function handleClick() {
|
|
@@ -49,13 +58,13 @@ var Card = function Card(_ref) {
|
|
|
49
58
|
}
|
|
50
59
|
};
|
|
51
60
|
return React.createElement(StyledCard, {
|
|
61
|
+
className: className,
|
|
52
62
|
style: {
|
|
53
63
|
width: width
|
|
54
64
|
},
|
|
55
65
|
isActive: isActive,
|
|
56
66
|
id: elementId,
|
|
57
|
-
|
|
58
|
-
padding: padding,
|
|
67
|
+
customStyles: customStyles,
|
|
59
68
|
onClick: handleClick
|
|
60
69
|
}, (title || label) && React.createElement(Header, null, title && React.createElement(Title, null, title), label && React.createElement(Label, null, label)), React.createElement("div", null, children), action && React.createElement(Action, null, action));
|
|
61
70
|
};
|
package/dist/card.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"card.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,10 +5,15 @@ interface IProps {
|
|
|
5
5
|
children: string | Node;
|
|
6
6
|
isActive?: boolean;
|
|
7
7
|
width?: string | number;
|
|
8
|
-
padding?: number;
|
|
9
|
-
borderRadius?: number;
|
|
10
8
|
elementId?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
customStyles?: {
|
|
11
|
+
padding?: number;
|
|
12
|
+
borderRadius?: number;
|
|
13
|
+
bgColor?: string;
|
|
14
|
+
activeBgColor?: string;
|
|
15
|
+
};
|
|
11
16
|
onClick?: (string: any) => string;
|
|
12
17
|
}
|
|
13
|
-
declare const Card: ({ children, title, action, label, isActive, width,
|
|
18
|
+
declare const Card: ({ children, className, title, action, label, isActive, width, elementId, customStyles, onClick, }: IProps) => JSX.Element;
|
|
14
19
|
export default Card;
|
package/dist/style.d.ts
CHANGED
|
@@ -2,11 +2,17 @@ interface IProps {
|
|
|
2
2
|
isActive: boolean;
|
|
3
3
|
padding?: number;
|
|
4
4
|
borderRadius?: number;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
className?: string;
|
|
6
|
+
customStyles?: {
|
|
7
|
+
padding?: number;
|
|
8
|
+
borderRadius?: number;
|
|
9
|
+
bgColor?: string;
|
|
10
|
+
activeBgColor?: string;
|
|
7
11
|
};
|
|
8
12
|
}
|
|
9
|
-
declare const StyledCard: import("styled-components").StyledComponent<"div", any,
|
|
13
|
+
declare const StyledCard: import("styled-components").StyledComponent<"div", any, {
|
|
14
|
+
className: string | undefined;
|
|
15
|
+
} & IProps, "className">;
|
|
10
16
|
declare const Header: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
17
|
declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
18
|
declare const Label: import("styled-components").StyledComponent<"div", any, {}, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@propellerads/card",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/card.esm.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"react": "^17.0.2",
|
|
33
33
|
"styled-components": "5.1.1"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "64f0658eff9429b256c6a7a1b930b51126ad4857"
|
|
36
36
|
}
|