@propellerads/card 3.1.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 CHANGED
@@ -1,3 +1,6 @@
1
+ #### `3.2.0`
2
+ * added `className` prop
3
+
1
4
  #### `3.1.0`
2
5
  * added `customStyles` prop
3
6
 
@@ -18,7 +18,11 @@ function _taggedTemplateLiteralLoose(strings, raw) {
18
18
  }
19
19
 
20
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) {
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;
@@ -37,6 +41,8 @@ var Action = /*#__PURE__*/styled__default.div(_templateObject9 || (_templateObje
37
41
 
38
42
  var Card = function Card(_ref) {
39
43
  var children = _ref.children,
44
+ _ref$className = _ref.className,
45
+ className = _ref$className === void 0 ? undefined : _ref$className,
40
46
  _ref$title = _ref.title,
41
47
  title = _ref$title === void 0 ? undefined : _ref$title,
42
48
  _ref$action = _ref.action,
@@ -59,6 +65,7 @@ var Card = function Card(_ref) {
59
65
  }
60
66
  };
61
67
  return React.createElement(StyledCard, {
68
+ className: className,
62
69
  style: {
63
70
  width: width
64
71
  },
@@ -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,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))};
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
@@ -11,7 +11,11 @@ function _taggedTemplateLiteralLoose(strings, raw) {
11
11
  }
12
12
 
13
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) {
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;
@@ -30,6 +34,8 @@ var Action = /*#__PURE__*/styled.div(_templateObject9 || (_templateObject9 = /*#
30
34
 
31
35
  var Card = function Card(_ref) {
32
36
  var children = _ref.children,
37
+ _ref$className = _ref.className,
38
+ className = _ref$className === void 0 ? undefined : _ref$className,
33
39
  _ref$title = _ref.title,
34
40
  title = _ref$title === void 0 ? undefined : _ref$title,
35
41
  _ref$action = _ref.action,
@@ -52,6 +58,7 @@ var Card = function Card(_ref) {
52
58
  }
53
59
  };
54
60
  return React.createElement(StyledCard, {
61
+ className: className,
55
62
  style: {
56
63
  width: width
57
64
  },
@@ -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
@@ -6,6 +6,7 @@ interface IProps {
6
6
  isActive?: boolean;
7
7
  width?: string | number;
8
8
  elementId?: string;
9
+ className?: string;
9
10
  customStyles?: {
10
11
  padding?: number;
11
12
  borderRadius?: number;
@@ -14,5 +15,5 @@ interface IProps {
14
15
  };
15
16
  onClick?: (string: any) => string;
16
17
  }
17
- declare const Card: ({ children, title, action, label, isActive, width, elementId, customStyles, onClick, }: IProps) => JSX.Element;
18
+ declare const Card: ({ children, className, title, action, label, isActive, width, elementId, customStyles, onClick, }: IProps) => JSX.Element;
18
19
  export default Card;
package/dist/style.d.ts CHANGED
@@ -2,6 +2,7 @@ interface IProps {
2
2
  isActive: boolean;
3
3
  padding?: number;
4
4
  borderRadius?: number;
5
+ className?: string;
5
6
  customStyles?: {
6
7
  padding?: number;
7
8
  borderRadius?: number;
@@ -9,7 +10,9 @@ interface IProps {
9
10
  activeBgColor?: string;
10
11
  };
11
12
  }
12
- declare const StyledCard: import("styled-components").StyledComponent<"div", any, IProps, never>;
13
+ declare const StyledCard: import("styled-components").StyledComponent<"div", any, {
14
+ className: string | undefined;
15
+ } & IProps, "className">;
13
16
  declare const Header: import("styled-components").StyledComponent<"div", any, {}, never>;
14
17
  declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
15
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.1.0",
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": "43906fa3ebddc80b084aad7cc3ebb8c7ed37b180"
35
+ "gitHead": "64f0658eff9429b256c6a7a1b930b51126ad4857"
36
36
  }