@propellerads/card 3.2.0 → 4.0.1
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/README.md +5 -3
- package/dist/card.cjs.development.js +8 -12
- package/dist/card.cjs.development.js.map +1 -1
- package/dist/card.cjs.production.min.js +1 -1
- package/dist/card.esm.js +8 -12
- package/dist/card.esm.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/style.d.ts +1 -1
- package/package.json +7 -8
- package/CHANGELOG.md +0 -31
package/README.md
CHANGED
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
[Github](https://github.com/propellerads/ui-components/tree/master/Components/Card)
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
- `yarn add @propellerads/card` or `npm install @propellerads/card -S`
|
|
11
12
|
|
|
12
13
|
### How to use
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
- `import Card from '@propellerads/card';`
|
|
16
|
+
- And render `<Card>Your content</Card>`
|
|
@@ -9,12 +9,8 @@ var styled = require('styled-components');
|
|
|
9
9
|
var styled__default = _interopDefault(styled);
|
|
10
10
|
var stylevariables = require('@propellerads/stylevariables');
|
|
11
11
|
|
|
12
|
-
function _taggedTemplateLiteralLoose(
|
|
13
|
-
|
|
14
|
-
raw = strings.slice(0);
|
|
15
|
-
}
|
|
16
|
-
strings.raw = raw;
|
|
17
|
-
return strings;
|
|
12
|
+
function _taggedTemplateLiteralLoose(e, t) {
|
|
13
|
+
return t || (t = e.slice(0)), e.raw = t, e;
|
|
18
14
|
}
|
|
19
15
|
|
|
20
16
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
@@ -22,8 +18,8 @@ var StyledCard = /*#__PURE__*/styled__default.div.attrs(function (props) {
|
|
|
22
18
|
return {
|
|
23
19
|
className: props.className
|
|
24
20
|
};
|
|
25
|
-
})(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n
|
|
26
|
-
return props.isActive && styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n
|
|
21
|
+
})(_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
|
+
return props.isActive && styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n border-color: ", ";\n "])), stylevariables.actionColor);
|
|
27
23
|
}, function (props) {
|
|
28
24
|
var _props$customStyles;
|
|
29
25
|
return ((_props$customStyles = props.customStyles) == null ? void 0 : _props$customStyles.padding) && styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n padding: ", "px;\n "])), props.customStyles.padding);
|
|
@@ -34,10 +30,10 @@ var StyledCard = /*#__PURE__*/styled__default.div.attrs(function (props) {
|
|
|
34
30
|
var _props$customStyles3, _props$customStyles4;
|
|
35
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);
|
|
36
32
|
});
|
|
37
|
-
var Header = /*#__PURE__*/styled__default.div(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n
|
|
38
|
-
var Title = /*#__PURE__*/styled__default.div(_templateObject7 || (_templateObject7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n
|
|
39
|
-
var Label = /*#__PURE__*/styled__default.div(_templateObject8 || (_templateObject8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n
|
|
40
|
-
var Action = /*#__PURE__*/styled__default.div(_templateObject9 || (_templateObject9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n
|
|
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);
|
|
41
37
|
|
|
42
38
|
var Card = function Card(_ref) {
|
|
43
39
|
var children = _ref.children,
|
|
@@ -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,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
|
|
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
|
@@ -2,12 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { borderRadius, gray95, white, spacing, actionColor, fontBig, lineHeight, black } from '@propellerads/stylevariables';
|
|
4
4
|
|
|
5
|
-
function _taggedTemplateLiteralLoose(
|
|
6
|
-
|
|
7
|
-
raw = strings.slice(0);
|
|
8
|
-
}
|
|
9
|
-
strings.raw = raw;
|
|
10
|
-
return strings;
|
|
5
|
+
function _taggedTemplateLiteralLoose(e, t) {
|
|
6
|
+
return t || (t = e.slice(0)), e.raw = t, e;
|
|
11
7
|
}
|
|
12
8
|
|
|
13
9
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
@@ -15,8 +11,8 @@ var StyledCard = /*#__PURE__*/styled.div.attrs(function (props) {
|
|
|
15
11
|
return {
|
|
16
12
|
className: props.className
|
|
17
13
|
};
|
|
18
|
-
})(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n
|
|
19
|
-
return props.isActive && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n
|
|
14
|
+
})(_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
|
+
return props.isActive && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["\n border-color: ", ";\n "])), actionColor);
|
|
20
16
|
}, function (props) {
|
|
21
17
|
var _props$customStyles;
|
|
22
18
|
return ((_props$customStyles = props.customStyles) == null ? void 0 : _props$customStyles.padding) && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteralLoose(["\n padding: ", "px;\n "])), props.customStyles.padding);
|
|
@@ -27,10 +23,10 @@ var StyledCard = /*#__PURE__*/styled.div.attrs(function (props) {
|
|
|
27
23
|
var _props$customStyles3, _props$customStyles4;
|
|
28
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);
|
|
29
25
|
});
|
|
30
|
-
var Header = /*#__PURE__*/styled.div(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n
|
|
31
|
-
var Title = /*#__PURE__*/styled.div(_templateObject7 || (_templateObject7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n
|
|
32
|
-
var Label = /*#__PURE__*/styled.div(_templateObject8 || (_templateObject8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n
|
|
33
|
-
var Action = /*#__PURE__*/styled.div(_templateObject9 || (_templateObject9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n
|
|
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);
|
|
34
30
|
|
|
35
31
|
var Card = function Card(_ref) {
|
|
36
32
|
var children = _ref.children,
|
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
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
1
2
|
interface IProps {
|
|
2
|
-
title?:
|
|
3
|
-
action?:
|
|
4
|
-
label?:
|
|
5
|
-
children:
|
|
3
|
+
title?: ReactNode;
|
|
4
|
+
action?: ReactNode;
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
6
7
|
isActive?: boolean;
|
|
7
8
|
width?: string | number;
|
|
8
9
|
elementId?: string;
|
|
@@ -15,5 +16,5 @@ interface IProps {
|
|
|
15
16
|
};
|
|
16
17
|
onClick?: (string: any) => string;
|
|
17
18
|
}
|
|
18
|
-
declare const Card: ({ children, className, title, action, label, isActive, width, elementId, customStyles, onClick, }: IProps) => JSX.Element;
|
|
19
|
+
declare const Card: ({ children, className, title, action, label, isActive, width, elementId, customStyles, onClick, }: IProps) => React.JSX.Element;
|
|
19
20
|
export default Card;
|
package/dist/style.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ declare const Header: import("styled-components").StyledComponent<"div", any, {}
|
|
|
17
17
|
declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
18
18
|
declare const Label: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
19
19
|
declare const Action: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
|
-
export { StyledCard, Header, Title, Label, Action
|
|
20
|
+
export { StyledCard, Header, Title, Label, Action };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@propellerads/card",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/card.esm.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -21,16 +21,15 @@
|
|
|
21
21
|
"build": "tsdx build"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@propellerads/stylevariables": "^
|
|
24
|
+
"@propellerads/stylevariables": "^2.0.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"tsdx": "
|
|
28
|
-
"tslib": "
|
|
29
|
-
"typescript": "
|
|
27
|
+
"tsdx": "0.14.1",
|
|
28
|
+
"tslib": "2.6.2",
|
|
29
|
+
"typescript": "4.9.5"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"react": "
|
|
32
|
+
"react": ">=18 <19",
|
|
33
33
|
"styled-components": "5.1.1"
|
|
34
|
-
}
|
|
35
|
-
"gitHead": "64f0658eff9429b256c6a7a1b930b51126ad4857"
|
|
34
|
+
}
|
|
36
35
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#### `3.2.0`
|
|
2
|
-
* added `className` prop
|
|
3
|
-
|
|
4
|
-
#### `3.1.0`
|
|
5
|
-
* added `customStyles` prop
|
|
6
|
-
|
|
7
|
-
#### `3.0.0`
|
|
8
|
-
* added onClick prop
|
|
9
|
-
* migrated to TypeScript
|
|
10
|
-
|
|
11
|
-
#### `2.3.0`
|
|
12
|
-
* it's possible to overwrite default padding and border-radius
|
|
13
|
-
|
|
14
|
-
#### `2.2.0`
|
|
15
|
-
* updated `width` type - now it could be a number or a string
|
|
16
|
-
* marked unused dependencies to `peerDependencies`
|
|
17
|
-
|
|
18
|
-
#### `2.1.0`
|
|
19
|
-
* update style-variables
|
|
20
|
-
|
|
21
|
-
#### `2.0.1`
|
|
22
|
-
|
|
23
|
-
* Styles changes: borders
|
|
24
|
-
|
|
25
|
-
#### `2.0.0`
|
|
26
|
-
|
|
27
|
-
* update deps
|
|
28
|
-
|
|
29
|
-
#### `1.0.4`
|
|
30
|
-
|
|
31
|
-
* Set card height to 100%
|