@propellerads/card 2.2.0 → 2.3.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/index.esm.js +42 -10
- package/dist/index.esm.min.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -15,9 +15,29 @@ function _taggedTemplateLiteral(strings, raw) {
|
|
|
15
15
|
}));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function
|
|
18
|
+
function _templateObject8() {
|
|
19
19
|
var data = _taggedTemplateLiteral(["\n margin-top: ", "px;\n \n button + button{\n margin-left: ", "px;\n }\n"]);
|
|
20
20
|
|
|
21
|
+
_templateObject8 = function _templateObject8() {
|
|
22
|
+
return data;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _templateObject7() {
|
|
29
|
+
var data = _taggedTemplateLiteral(["\n flex: 1;\n align-items: flex-start;\n justify-content: flex-end;\n display: flex;\n"]);
|
|
30
|
+
|
|
31
|
+
_templateObject7 = function _templateObject7() {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _templateObject6() {
|
|
39
|
+
var data = _taggedTemplateLiteral(["\n flex: 1;\n font-size: ", "px;\n font-weight: bold;\n line-height: ", "px;\n color: ", ";\n"]);
|
|
40
|
+
|
|
21
41
|
_templateObject6 = function _templateObject6() {
|
|
22
42
|
return data;
|
|
23
43
|
};
|
|
@@ -26,7 +46,7 @@ function _templateObject6() {
|
|
|
26
46
|
}
|
|
27
47
|
|
|
28
48
|
function _templateObject5() {
|
|
29
|
-
var data = _taggedTemplateLiteral(["\n
|
|
49
|
+
var data = _taggedTemplateLiteral(["\n display: flex;\n margin-bottom: ", "px; \n"]);
|
|
30
50
|
|
|
31
51
|
_templateObject5 = function _templateObject5() {
|
|
32
52
|
return data;
|
|
@@ -36,7 +56,7 @@ function _templateObject5() {
|
|
|
36
56
|
}
|
|
37
57
|
|
|
38
58
|
function _templateObject4() {
|
|
39
|
-
var data = _taggedTemplateLiteral(["\n
|
|
59
|
+
var data = _taggedTemplateLiteral(["\n border-radius: ", "px;\n "]);
|
|
40
60
|
|
|
41
61
|
_templateObject4 = function _templateObject4() {
|
|
42
62
|
return data;
|
|
@@ -46,7 +66,7 @@ function _templateObject4() {
|
|
|
46
66
|
}
|
|
47
67
|
|
|
48
68
|
function _templateObject3() {
|
|
49
|
-
var data = _taggedTemplateLiteral(["\n
|
|
69
|
+
var data = _taggedTemplateLiteral(["\n padding: ", "px;\n "]);
|
|
50
70
|
|
|
51
71
|
_templateObject3 = function _templateObject3() {
|
|
52
72
|
return data;
|
|
@@ -66,7 +86,7 @@ function _templateObject2() {
|
|
|
66
86
|
}
|
|
67
87
|
|
|
68
88
|
function _templateObject() {
|
|
69
|
-
var data = _taggedTemplateLiteral(["\n height: 100%;\n border-radius: ", "px;\n border: solid 2px ", ";\n background-color: ", ";\n padding: ", "px;\n \n ", "\n"]);
|
|
89
|
+
var data = _taggedTemplateLiteral(["\n height: 100%;\n border-radius: ", "px;\n border: solid 2px ", ";\n background-color: ", ";\n padding: ", "px;\n \n ", "\n\n ", "\n\n ", "\n"]);
|
|
70
90
|
|
|
71
91
|
_templateObject = function _templateObject() {
|
|
72
92
|
return data;
|
|
@@ -76,11 +96,15 @@ function _templateObject() {
|
|
|
76
96
|
}
|
|
77
97
|
var StyledCard = styled.div(_templateObject(), borderRadius, gray95, white, spacing * 6, function (props) {
|
|
78
98
|
return props.isActive && css(_templateObject2(), actionColor);
|
|
99
|
+
}, function (props) {
|
|
100
|
+
return props.padding && css(_templateObject3(), props.padding);
|
|
101
|
+
}, function (props) {
|
|
102
|
+
return props.borderRadius && css(_templateObject4(), props.borderRadius);
|
|
79
103
|
});
|
|
80
|
-
var Header = styled.div(
|
|
81
|
-
var Title = styled.div(
|
|
82
|
-
var Label = styled.div(
|
|
83
|
-
var Action = styled.div(
|
|
104
|
+
var Header = styled.div(_templateObject5(), spacing * 3);
|
|
105
|
+
var Title = styled.div(_templateObject6(), fontBig, lineHeight, black);
|
|
106
|
+
var Label = styled.div(_templateObject7());
|
|
107
|
+
var Action = styled.div(_templateObject8(), spacing * 4, spacing * 2);
|
|
84
108
|
|
|
85
109
|
var Card = function Card(_ref) {
|
|
86
110
|
var children = _ref.children,
|
|
@@ -89,13 +113,17 @@ var Card = function Card(_ref) {
|
|
|
89
113
|
label = _ref.label,
|
|
90
114
|
isActive = _ref.isActive,
|
|
91
115
|
width = _ref.width,
|
|
116
|
+
padding = _ref.padding,
|
|
117
|
+
borderRadius = _ref.borderRadius,
|
|
92
118
|
elementId = _ref.elementId;
|
|
93
119
|
return /*#__PURE__*/React.createElement(StyledCard, {
|
|
94
120
|
style: {
|
|
95
121
|
width: width
|
|
96
122
|
},
|
|
97
123
|
isActive: isActive,
|
|
98
|
-
id: elementId
|
|
124
|
+
id: elementId,
|
|
125
|
+
borderRadius: borderRadius,
|
|
126
|
+
padding: padding
|
|
99
127
|
}, (title || label) && /*#__PURE__*/React.createElement(Header, null, title && /*#__PURE__*/React.createElement(Title, null, title), label && /*#__PURE__*/React.createElement(Label, null, label)), /*#__PURE__*/React.createElement("div", null, children), action && /*#__PURE__*/React.createElement(Action, null, action));
|
|
100
128
|
};
|
|
101
129
|
|
|
@@ -106,6 +134,8 @@ Card.propTypes = {
|
|
|
106
134
|
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.node]).isRequired,
|
|
107
135
|
isActive: PropTypes.bool,
|
|
108
136
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
137
|
+
padding: PropTypes.oneOfType([PropTypes.number]),
|
|
138
|
+
borderRadius: PropTypes.oneOfType([PropTypes.number]),
|
|
109
139
|
elementId: PropTypes.string
|
|
110
140
|
};
|
|
111
141
|
Card.defaultProps = {
|
|
@@ -114,6 +144,8 @@ Card.defaultProps = {
|
|
|
114
144
|
action: undefined,
|
|
115
145
|
label: undefined,
|
|
116
146
|
width: undefined,
|
|
147
|
+
padding: undefined,
|
|
148
|
+
borderRadius: undefined,
|
|
117
149
|
elementId: undefined
|
|
118
150
|
};
|
|
119
151
|
|
package/dist/index.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n from"react";import e from"prop-types";import r,{css as t}from"styled-components";import{borderRadius as i,gray95 as o,white as d,spacing as u,actionColor as l,fontBig as a,lineHeight as c,black as f}from"@propellerads/stylevariables";function p(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}function s(){var n=p(["\n margin-top: ","px;\n \n button + button{\n margin-left: ","px;\n }\n"]);return s=function(){return n},n}function m(){var n=p(["\n flex: 1;\n align-items: flex-start;\n justify-content: flex-end;\n display: flex;\n"]);return m=function(){return n},n}function v(){var n=p(["\n flex: 1;\n font-size: ","px;\n font-weight: bold;\n line-height: ","px;\n color: ",";\n"]);return v=function(){return n},n}function b(){var n=p(["\n display: flex;\n margin-bottom: ","px; \n"]);return b=function(){return n},n}function g(){var n=p(["\n border-radius: ","px;\n "]);return g=function(){return n},n}function x(){var n=p(["\n padding: ","px;\n "]);return x=function(){return n},n}function y(){var n=p(["\n border-color: ",";\n "]);return y=function(){return n},n}function h(){var n=p(["\n height: 100%;\n border-radius: ","px;\n border: solid 2px ",";\n background-color: ",";\n padding: ","px;\n \n ","\n\n ","\n\n ","\n"]);return h=function(){return n},n}var O=r.div(h(),i,o,d,6*u,(function(n){return n.isActive&&t(y(),l)}),(function(n){return n.padding&&t(x(),n.padding)}),(function(n){return n.borderRadius&&t(g(),n.borderRadius)})),T=r.div(b(),3*u),R=r.div(v(),a,c,f),w=r.div(m()),E=r.div(s(),4*u,2*u),A=function(e){var r=e.children,t=e.title,i=e.action,o=e.label,d=e.isActive,u=e.width,l=e.padding,a=e.borderRadius,c=e.elementId;return n.createElement(O,{style:{width:u},isActive:d,id:c,borderRadius:a,padding:l},(t||o)&&n.createElement(T,null,t&&n.createElement(R,null,t),o&&n.createElement(w,null,o)),n.createElement("div",null,r),i&&n.createElement(E,null,i))};A.propTypes={title:e.oneOfType([e.string,e.element]),action:e.oneOfType([e.string,e.element]),label:e.oneOfType([e.string,e.element]),children:e.oneOfType([e.string,e.element,e.node]).isRequired,isActive:e.bool,width:e.oneOfType([e.number,e.string]),padding:e.oneOfType([e.number]),borderRadius:e.oneOfType([e.number]),elementId:e.string},A.defaultProps={isActive:!1,title:void 0,action:void 0,label:void 0,width:void 0,padding:void 0,borderRadius:void 0,elementId:void 0};export default A;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@propellerads/card",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"main": "dist/index.esm.js",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"files": [
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"react": "^17.0.2",
|
|
36
36
|
"styled-components": "5.1.1"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "8d780bf408f304bcce8402f0224163981495f3de"
|
|
39
39
|
}
|