@propellerads/card 4.0.2 → 5.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/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  ## Installation
10
10
 
11
- - `yarn add @propellerads/card` or `npm install @propellerads/card -S`
11
+ - `bun add @propellerads/card` or `npm install @propellerads/card -S`
12
12
 
13
13
  ### How to use
14
14
 
package/dist/index.css ADDED
@@ -0,0 +1 @@
1
+ .card{height:100%;padding:var(--card-padding,var(--space-24,24px));border:solid 2px var(--color-formal,#f2f2f2);border-radius:var(--card-radius,var(--radius-8,8px));background-color:var(--color-light-inversion,#fff)}.card--active{border-color:var(--color-action,#0080ff)}.card--custom-width{width:var(--card-width)}.card--custom-bg{background-color:var(--card-bg)}.card__header{margin-bottom:var(--space-12,12px);display:flex}.card__title{color:var(--color-dark-inversion,#000);flex:1;font-size:18px;font-weight:700;line-height:36px}.card__label{flex:1;justify-content:flex-end;align-items:flex-start;display:flex}.card__action{margin-top:var(--space-16,16px)}.card__action button+button{margin-left:var(--space-8,8px)}
package/dist/index.d.ts CHANGED
@@ -1,20 +1,29 @@
1
- import React, { ReactNode } from 'react';
2
- interface IProps {
3
- title?: ReactNode;
4
- action?: ReactNode;
5
- label?: ReactNode;
6
- children: ReactNode;
7
- isActive?: boolean;
8
- width?: string | number;
9
- elementId?: string;
10
- className?: string;
11
- customStyles?: {
12
- padding?: number;
13
- borderRadius?: number;
14
- bgColor?: string;
15
- activeBgColor?: string;
16
- };
17
- onClick?: (string: any) => string;
18
- }
19
- declare const Card: ({ children, className, title, action, label, isActive, width, elementId, customStyles, onClick, }: IProps) => React.JSX.Element;
20
- export default Card;
1
+ import { ReactNode, FC } from 'react';
2
+
3
+ /** A length: a number is pixels, a string is used as is (`'50%'`, `'1rem'`). */
4
+ type CardLength = number | string;
5
+ type CardCustomStyles = {
6
+ padding?: CardLength;
7
+ borderRadius?: CardLength;
8
+ width?: CardLength;
9
+ /** The background; applied when `activeBgColor` is given too. */
10
+ bgColor?: string;
11
+ /** The background of an active card; applied when `bgColor` is given too. */
12
+ activeBgColor?: string;
13
+ };
14
+ type CardProps = {
15
+ title?: ReactNode;
16
+ action?: ReactNode;
17
+ label?: ReactNode;
18
+ children: ReactNode;
19
+ isActive?: boolean;
20
+ elementId?: string;
21
+ className?: string;
22
+ customStyles?: CardCustomStyles;
23
+ onClick?: (elementId?: string) => void;
24
+ };
25
+
26
+ declare const Card: FC<CardProps>;
27
+
28
+ export { Card as default };
29
+ export type { CardCustomStyles, CardProps };
package/dist/index.js CHANGED
@@ -1,8 +1,40 @@
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import './index.css';// src/index.tsx
3
+ var n = (e) => typeof e == "number" ? `${e}px` : e, r = ({ padding: e, borderRadius: t, width: r, bgColor: i, activeBgColor: a }, o) => {
4
+ let s = {};
5
+ return e !== void 0 && (s["--card-padding"] = n(e)), t !== void 0 && (s["--card-radius"] = n(t)), r !== void 0 && (s["--card-width"] = n(r)), i !== void 0 && a !== void 0 && (s["--card-bg"] = o ? a : i), s;
6
+ }, i = ({ children: n, className: i, title: a, action: o, label: s, isActive: c = !1, elementId: l, customStyles: u = {}, onClick: d }) => {
7
+ let f = r(u, c), p = [
8
+ "card",
9
+ c && "card--active",
10
+ f["--card-width"] !== void 0 && "card--custom-width",
11
+ f["--card-bg"] !== void 0 && "card--custom-bg",
12
+ i
13
+ ].filter(Boolean).join(" ");
14
+ return /* @__PURE__ */ t("div", {
15
+ className: p,
16
+ id: l,
17
+ style: f,
18
+ onClick: () => d?.(l),
19
+ children: [
20
+ (a || s) && /* @__PURE__ */ t("div", {
21
+ className: "card__header",
22
+ children: [a && /* @__PURE__ */ e("div", {
23
+ className: "card__title",
24
+ children: a
25
+ }), s && /* @__PURE__ */ e("div", {
26
+ className: "card__label",
27
+ children: s
28
+ })]
29
+ }),
30
+ /* @__PURE__ */ e("div", { children: n }),
31
+ o && /* @__PURE__ */ e("div", {
32
+ className: "card__action",
33
+ children: o
34
+ })
35
+ ]
36
+ });
37
+ };
38
+ export { i as default };
1
39
 
2
- 'use strict'
3
-
4
- if (process.env.NODE_ENV === 'production') {
5
- module.exports = require('./card.cjs.production.min.js')
6
- } else {
7
- module.exports = require('./card.cjs.development.js')
8
- }
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["toLength","value","getCardStyle","style","padding","borderRadius","width","bgColor","activeBgColor","isActive","Card","customStyles","classes","className","elementId","onClick","title","label","action"],"sources":["../src/index.tsx"],"sourcesContent":["import type {CSSProperties, FC} from 'react';\nimport './card.css';\nimport type {CardCustomStyles, CardProps} from './types';\n\nconst toLength = (value: number | string) => (typeof value === 'number' ? `${value}px` : value);\n\ntype CardStyle = CSSProperties & Record<`--card-${string}`, string>;\n\n/** `customStyles` as the custom properties card.css reads. */\nconst getCardStyle = ({padding, borderRadius, width, bgColor, activeBgColor}: CardCustomStyles, isActive: boolean) => {\n const style: CardStyle = {};\n\n if (padding !== undefined) {\n style['--card-padding'] = toLength(padding);\n }\n\n if (borderRadius !== undefined) {\n style['--card-radius'] = toLength(borderRadius);\n }\n\n if (width !== undefined) {\n style['--card-width'] = toLength(width);\n }\n\n // Both or neither, as before: a single colour leaves the card white\n if (bgColor !== undefined && activeBgColor !== undefined) {\n style['--card-bg'] = isActive ? activeBgColor : bgColor;\n }\n\n return style;\n};\n\nconst Card: FC<CardProps> = ({\n children,\n className,\n title,\n action,\n label,\n isActive = false,\n elementId,\n customStyles = {},\n onClick,\n}) => {\n const style = getCardStyle(customStyles, isActive);\n const classes = [\n 'card',\n isActive && 'card--active',\n style['--card-width'] !== undefined && 'card--custom-width',\n style['--card-bg'] !== undefined && 'card--custom-bg',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: a clickable card without a keyboard path is the behaviour of 5.x, out of scope of moving off styled-components\n <div className={classes} id={elementId} style={style} onClick={() => onClick?.(elementId)}>\n {(title || label) && (\n <div className=\"card__header\">\n {title && <div className=\"card__title\">{title}</div>}\n {label && <div className=\"card__label\">{label}</div>}\n </div>\n )}\n\n <div>{children}</div>\n {action && <div className=\"card__action\">{action}</div>}\n </div>\n );\n};\n\nexport default Card;\nexport type {CardCustomStyles, CardProps} from './types';\n"],"mappings":";;AAIA,IAAMA,KAAY,MAA4B,OAAOC,KAAU,WAAW,GAAGA,EAAM,MAAMA,GAKnFC,KAAgB,EAAC,YAAS,iBAAc,UAAO,YAAS,oBAAkC,MAAsB;CACpH,IAAMC,IAAmB,CAAC;CAmB1B,OAjBIC,MAAY,KAAA,MACd,EAAM,oBAAoBJ,EAASI,CAAO,IAGxCC,MAAiB,KAAA,MACnB,EAAM,mBAAmBL,EAASK,CAAY,IAG5CC,MAAU,KAAA,MACZ,EAAM,kBAAkBN,EAASM,CAAK,IAIpCC,MAAY,KAAA,KAAaC,MAAkB,KAAA,MAC7C,EAAM,eAAeC,IAAWD,IAAgBD,IAG3CJ;AACT,GAEMO,KAAuB,EAC3B,aACA,cACA,UACA,WACA,UACA,cAAW,IACX,cACA,kBAAe,CAAC,GAChB,iBACI;CACJ,IAAMP,IAAQD,EAAaS,GAAcF,CAAQ,GAC3CG,IAAU;EACd;EACAH,KAAY;EACZN,EAAM,oBAAoB,KAAA,KAAa;EACvCA,EAAM,iBAAiB,KAAA,KAAa;EACpCU;CACF,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OAEE,kBAAC,OAAD;EAAK,WAAWD;EAAS,IAAIE;EAAkB;EAAO,eAAeC,IAAUD,CAAS;EAAxF,UAAA;IACIE,KAASC,MACT,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACGD,KAAS,kBAAC,OAAD;KAAK,WAAU;KAAe,UAAAA;IAAW,CAAA,GAClDC,KAAS,kBAAC,OAAD;KAAK,WAAU;KAAe,UAAAA;IAAW,CAAA,CAChD;;GAGP,kBAAC,OAAD,EAAM,YAAc,CAAA;GACnBC,KAAU,kBAAC,OAAD;IAAK,WAAU;IAAgB,UAAAA;GAAY,CAAA;EACnD;;AAET"}
package/package.json CHANGED
@@ -1,34 +1,50 @@
1
1
  {
2
2
  "name": "@propellerads/card",
3
- "version": "4.0.2",
4
- "main": "dist/index.js",
5
- "module": "dist/card.esm.js",
6
- "typings": "dist/index.d.ts",
3
+ "version": "5.1.0",
4
+ "type": "module",
5
+ "types": "dist/index.d.ts",
6
+ "style": "dist/index.css",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ },
12
+ "./index.css": "./dist/index.css"
13
+ },
14
+ "sideEffects": [
15
+ "**/*.css"
16
+ ],
7
17
  "files": [
8
18
  "dist"
9
19
  ],
10
20
  "repository": "https://github.com/propellerads/ui-components.git",
11
21
  "author": "i.pasyuk@propellerads.net",
12
22
  "license": "MIT",
13
- "private": false,
14
23
  "bugs": {
15
24
  "url": "https://github.com/propellerads/ui-components/issues"
16
25
  },
17
- "homepage": "https://github.com/propellerads/ui-components#readme",
18
26
  "scripts": {
19
- "start": "tsdx watch",
20
- "build": "tsdx build"
27
+ "build": "tsc && vite build && rollup -c rollup.dts.config.mjs"
28
+ },
29
+ "homepage": "https://github.com/propellerads/ui-components#readme",
30
+ "private": false,
31
+ "peerDependencies": {
32
+ "@propellerads/tokens": ">=0.4.0",
33
+ "react": "^18.0.0 || ^19.0.0"
21
34
  },
22
- "dependencies": {
23
- "@propellerads/stylevariables": "^2.0.1"
35
+ "peerDependenciesMeta": {
36
+ "@propellerads/tokens": {
37
+ "optional": true
38
+ }
24
39
  },
25
40
  "devDependencies": {
26
- "tsdx": "0.14.1",
27
- "tslib": "2.6.2",
28
- "typescript": "4.9.5"
29
- },
30
- "peerDependencies": {
31
- "react": ">=18 <19",
32
- "styled-components": "5.1.1"
41
+ "@propellerads/tokens": "workspace:^",
42
+ "@types/react": "^19.2.14",
43
+ "@vitejs/plugin-react": "^6.0.1",
44
+ "rollup": "^4.60.3",
45
+ "rollup-plugin-dts": "^6.4.1",
46
+ "typescript": "^6.0.3",
47
+ "vite": "^8.0.11",
48
+ "vite-plugin-lib-inject-css": "^2.2.2"
33
49
  }
34
50
  }
@@ -1,76 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
-
7
- var React = _interopDefault(require('react'));
8
- var styled = require('styled-components');
9
- var styled__default = _interopDefault(styled);
10
- var stylevariables = require('@propellerads/stylevariables');
11
-
12
- function _taggedTemplateLiteralLoose(e, t) {
13
- return t || (t = e.slice(0)), e.raw = t, e;
14
- }
15
-
16
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
17
- var StyledCard = /*#__PURE__*/styled__default.div.attrs(function (props) {
18
- return {
19
- className: props.className
20
- };
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);
23
- }, function (props) {
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);
26
- }, function (props) {
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);
32
- });
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);
37
-
38
- var Card = function Card(_ref) {
39
- var children = _ref.children,
40
- _ref$className = _ref.className,
41
- className = _ref$className === void 0 ? undefined : _ref$className,
42
- _ref$title = _ref.title,
43
- title = _ref$title === void 0 ? undefined : _ref$title,
44
- _ref$action = _ref.action,
45
- action = _ref$action === void 0 ? undefined : _ref$action,
46
- _ref$label = _ref.label,
47
- label = _ref$label === void 0 ? undefined : _ref$label,
48
- _ref$isActive = _ref.isActive,
49
- isActive = _ref$isActive === void 0 ? false : _ref$isActive,
50
- _ref$width = _ref.width,
51
- width = _ref$width === void 0 ? undefined : _ref$width,
52
- _ref$elementId = _ref.elementId,
53
- elementId = _ref$elementId === void 0 ? undefined : _ref$elementId,
54
- _ref$customStyles = _ref.customStyles,
55
- customStyles = _ref$customStyles === void 0 ? {} : _ref$customStyles,
56
- _ref$onClick = _ref.onClick,
57
- onClick = _ref$onClick === void 0 ? undefined : _ref$onClick;
58
- var handleClick = function handleClick() {
59
- if (onClick) {
60
- onClick(elementId);
61
- }
62
- };
63
- return React.createElement(StyledCard, {
64
- className: className,
65
- style: {
66
- width: width
67
- },
68
- isActive: isActive,
69
- id: elementId,
70
- customStyles: customStyles,
71
- onClick: handleClick
72
- }, (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));
73
- };
74
-
75
- exports.default = Card;
76
- //# sourceMappingURL=card.cjs.development.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"card.cjs.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +0,0 @@
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
- //# sourceMappingURL=card.cjs.production.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"card.cjs.production.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/card.esm.js DELETED
@@ -1,69 +0,0 @@
1
- import React from 'react';
2
- import styled, { css } from 'styled-components';
3
- import { borderRadius, gray95, white, spacing, actionColor, fontBig, lineHeight, black } from '@propellerads/stylevariables';
4
-
5
- function _taggedTemplateLiteralLoose(e, t) {
6
- return t || (t = e.slice(0)), e.raw = t, e;
7
- }
8
-
9
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
10
- var StyledCard = /*#__PURE__*/styled.div.attrs(function (props) {
11
- return {
12
- className: props.className
13
- };
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);
16
- }, function (props) {
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);
19
- }, function (props) {
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);
25
- });
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);
30
-
31
- var Card = function Card(_ref) {
32
- var children = _ref.children,
33
- _ref$className = _ref.className,
34
- className = _ref$className === void 0 ? undefined : _ref$className,
35
- _ref$title = _ref.title,
36
- title = _ref$title === void 0 ? undefined : _ref$title,
37
- _ref$action = _ref.action,
38
- action = _ref$action === void 0 ? undefined : _ref$action,
39
- _ref$label = _ref.label,
40
- label = _ref$label === void 0 ? undefined : _ref$label,
41
- _ref$isActive = _ref.isActive,
42
- isActive = _ref$isActive === void 0 ? false : _ref$isActive,
43
- _ref$width = _ref.width,
44
- width = _ref$width === void 0 ? undefined : _ref$width,
45
- _ref$elementId = _ref.elementId,
46
- elementId = _ref$elementId === void 0 ? undefined : _ref$elementId,
47
- _ref$customStyles = _ref.customStyles,
48
- customStyles = _ref$customStyles === void 0 ? {} : _ref$customStyles,
49
- _ref$onClick = _ref.onClick,
50
- onClick = _ref$onClick === void 0 ? undefined : _ref$onClick;
51
- var handleClick = function handleClick() {
52
- if (onClick) {
53
- onClick(elementId);
54
- }
55
- };
56
- return React.createElement(StyledCard, {
57
- className: className,
58
- style: {
59
- width: width
60
- },
61
- isActive: isActive,
62
- id: elementId,
63
- customStyles: customStyles,
64
- onClick: handleClick
65
- }, (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));
66
- };
67
-
68
- export default Card;
69
- //# sourceMappingURL=card.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"card.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/style.d.ts DELETED
@@ -1,20 +0,0 @@
1
- interface IProps {
2
- isActive: boolean;
3
- padding?: number;
4
- borderRadius?: number;
5
- className?: string;
6
- customStyles?: {
7
- padding?: number;
8
- borderRadius?: number;
9
- bgColor?: string;
10
- activeBgColor?: string;
11
- };
12
- }
13
- declare const StyledCard: import("styled-components").StyledComponent<"div", any, {
14
- className: string | undefined;
15
- } & IProps, "className">;
16
- declare const Header: import("styled-components").StyledComponent<"div", any, {}, never>;
17
- declare const Title: import("styled-components").StyledComponent<"div", any, {}, never>;
18
- declare const Label: import("styled-components").StyledComponent<"div", any, {}, never>;
19
- declare const Action: import("styled-components").StyledComponent<"div", any, {}, never>;
20
- export { StyledCard, Header, Title, Label, Action };