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