@semcore/card 2.2.2 → 2.5.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 +25 -0
- package/lib/cjs/Card.js +15 -11
- package/lib/cjs/Card.js.map +1 -1
- package/lib/cjs/index.js +5 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/es6/Card.js +10 -11
- package/lib/es6/Card.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/types/index.d.ts +18 -2
- package/package.json +5 -5
- package/src/{Card.tsx → Card.js} +6 -20
- package/src/index.d.ts +18 -0
- package/src/{index.tsx → index.js} +0 -0
- package/lib/types/Card.d.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [2.5.0] - 2021-02-18
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Reverted `Card` to a previous state with styles in the card itself and without `Header` and `Body`
|
|
10
|
+
|
|
11
|
+
## [2.4.1] - 2021-02-14
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Up version of `Utils`
|
|
16
|
+
|
|
17
|
+
## [2.4.0] - 2022-02-03
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- `Card` has been split into Header and Body and a background has been added
|
|
22
|
+
|
|
23
|
+
## [2.3.0] - 2022-01-18
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Up version icons and use new icon.
|
|
28
|
+
- Rewrite code from TS to JS 🧑💻
|
|
29
|
+
|
|
5
30
|
## [2.2.2] - 2021-9-20
|
|
6
31
|
|
|
7
32
|
### Fixed
|
package/lib/cjs/Card.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -31,11 +31,15 @@ var _typography = require("@semcore/typography");
|
|
|
31
31
|
|
|
32
32
|
var _tooltip = _interopRequireDefault(require("@semcore/tooltip"));
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _m = _interopRequireDefault(require("@semcore/icon/Info/m"));
|
|
35
|
+
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
+
|
|
38
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
39
|
|
|
36
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
40
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
41
|
|
|
38
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
42
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
43
|
|
|
40
44
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
41
45
|
|
|
@@ -46,15 +50,15 @@ var style = (
|
|
|
46
50
|
/*__reshadow_css_start__*/
|
|
47
51
|
_core.sstyled.insert(
|
|
48
52
|
/*__inner_css_start__*/
|
|
49
|
-
".
|
|
53
|
+
".___SCard_bnsg2_gg_{border:1px solid #cccccc;border-radius:2px;padding:20px 24px 24px}.___STitle_bnsg2_gg_{font-size:19px;font-weight:500}.___SIcon_bnsg2_gg_{margin-left:4px;color:#a6b0b3;cursor:help}.___SDescription_bnsg2_gg_{margin-bottom:12px;font-size:14px;color:#757575}"
|
|
50
54
|
/*__inner_css_end__*/
|
|
51
55
|
, "3hx1s_gg_")
|
|
52
56
|
/*__reshadow_css_end__*/
|
|
53
57
|
, {
|
|
54
|
-
"__SCard": "
|
|
55
|
-
"__STitle": "
|
|
56
|
-
"__SIcon": "
|
|
57
|
-
"__SDescription": "
|
|
58
|
+
"__SCard": "___SCard_bnsg2_gg_",
|
|
59
|
+
"__STitle": "___STitle_bnsg2_gg_",
|
|
60
|
+
"__SIcon": "___SIcon_bnsg2_gg_",
|
|
61
|
+
"__SDescription": "___SDescription_bnsg2_gg_"
|
|
58
62
|
});
|
|
59
63
|
|
|
60
64
|
var Card = /*#__PURE__*/function (_Component) {
|
|
@@ -91,7 +95,7 @@ function Title(props) {
|
|
|
91
95
|
var styles = props.styles,
|
|
92
96
|
hint = props.hint;
|
|
93
97
|
var STitle = _typography.Text;
|
|
94
|
-
var SIcon =
|
|
98
|
+
var SIcon = _m["default"];
|
|
95
99
|
return _ref5 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(STitle, _ref5.cn("STitle", _objectSpread({}, (0, _core.assignProps)({}, _ref2)))), hint && /*#__PURE__*/_react["default"].createElement(_tooltip["default"], _ref5.cn("Tooltip", {
|
|
96
100
|
"title": hint
|
|
97
101
|
}), /*#__PURE__*/_react["default"].createElement(SIcon, _ref5.cn("SIcon", {}))));
|
package/lib/cjs/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Card.
|
|
1
|
+
{"version":3,"sources":["../../src/Card.js"],"names":["Card","SCard","Box","styles","asProps","Component","style","Title","props","hint","STitle","Text","SIcon","Info","Description","SDescription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIMA,I;;;;;;;;;;;;WAKJ,kBAAS;AAAA;AAAA;;AACP,UAAMC,KAAK,GAG2BC,YAHtC;AACA,UAAQC,MAAR,GAAmB,KAAKC,OAAxB,CAAQD,MAAR;AAEA,qBAAO,mBAAQA,MAAR,CAAP,eAAuB,gCAAC,KAAD,yEAAvB;AACD;;;EAVgBE,e;;iCAAbL,I,iBACiB,M;iCADjBA,I,WAGWM,K;;AAUjB,SAASC,KAAT,CAAeC,KAAf,EAAsB;AAAA;AAAA;;AACpB,MAAQL,MAAR,GAAyBK,KAAzB,CAAQL,MAAR;AAAA,MAAgBM,IAAhB,GAAyBD,KAAzB,CAAgBC,IAAhB;AACA,MAAMC,MAAM,GAIQC,gBAJpB;AACA,MAAMC,KAAK,GAAGC,aAAd;AACA,iBAAO,mBAAQV,MAAR,CAAP,eACE,+EACE,gCAAC,MAAD,2EADF,EAEGM,IAAI,iBACH,gCAAC,mBAAD;AAAA,aAAgBA;AAAhB,mBACE,gCAAC,KAAD,wBADF,CAHJ,CADF;AAUD;;AAED,SAASK,WAAT,CAAqBN,KAArB,EAA4B;AAAA;AAAA;;AAC1B,MAAQL,MAAR,GAAmBK,KAAnB,CAAQL,MAAR;AACA,MAAMY,YAAY,GAC2BJ,gBAD7C;AACA,iBAAO,mBAAQR,MAAR,CAAP,eAAuB,gCAAC,YAAD;AAAA,WAAgC;AAAhC,cAAvB;AACD;;eAEc,sBAAgBH,IAAhB,EAAsB;AACnCO,EAAAA,KAAK,EAALA,KADmC;AAEnCO,EAAAA,WAAW,EAAXA;AAFmC,CAAtB,C","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { Text } from '@semcore/typography';\nimport Tooltip from '@semcore/tooltip';\nimport Info from '@semcore/icon/Info/m';\n\nimport style from './style/card.shadow.css';\n\nclass Card extends Component {\n static displayName = 'Card';\n\n static style = style;\n\n render() {\n const SCard = Root;\n const { styles } = this.asProps;\n\n return sstyled(styles)(<SCard render={Box} />);\n }\n}\n\nfunction Title(props) {\n const { styles, hint } = props;\n const STitle = Root;\n const SIcon = Info;\n return sstyled(styles)(\n <>\n <STitle render={Text} />\n {hint && (\n <Tooltip title={hint}>\n <SIcon />\n </Tooltip>\n )}\n </>,\n );\n}\n\nfunction Description(props) {\n const { styles } = props;\n const SDescription = Root;\n return sstyled(styles)(<SDescription render={Text} tag=\"p\" />);\n}\n\nexport default createComponent(Card, {\n Title,\n Description,\n});\n"],"file":"Card.js"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -26,4 +26,8 @@ Object.keys(_Card).forEach(function (key) {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
|
+
|
|
30
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
|
+
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
33
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.
|
|
1
|
+
{"version":3,"sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export { default } from './Card';\nexport * from './Card';\n"],"file":"index.js"}
|
package/lib/es6/Card.js
CHANGED
|
@@ -9,9 +9,9 @@ import { assignProps as _assignProps3 } from "@semcore/core";
|
|
|
9
9
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
10
10
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
11
11
|
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
12
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
13
|
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
15
|
|
|
16
16
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
17
|
|
|
@@ -20,25 +20,24 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
20
20
|
import React from 'react';
|
|
21
21
|
import createComponent, { Component, sstyled, Root } from '@semcore/core';
|
|
22
22
|
import { Box } from '@semcore/flex-box';
|
|
23
|
-
import { Text } from '@semcore/typography';
|
|
24
|
-
|
|
23
|
+
import { Text } from '@semcore/typography';
|
|
25
24
|
import Tooltip from '@semcore/tooltip';
|
|
26
|
-
import
|
|
25
|
+
import Info from '@semcore/icon/Info/m';
|
|
27
26
|
|
|
28
27
|
/*__reshadow-styles__:"./style/card.shadow.css"*/
|
|
29
28
|
var style = (
|
|
30
29
|
/*__reshadow_css_start__*/
|
|
31
30
|
_sstyled.insert(
|
|
32
31
|
/*__inner_css_start__*/
|
|
33
|
-
".
|
|
32
|
+
".___SCard_bnsg2_gg_{border:1px solid #cccccc;border-radius:2px;padding:20px 24px 24px}.___STitle_bnsg2_gg_{font-size:19px;font-weight:500}.___SIcon_bnsg2_gg_{margin-left:4px;color:#a6b0b3;cursor:help}.___SDescription_bnsg2_gg_{margin-bottom:12px;font-size:14px;color:#757575}"
|
|
34
33
|
/*__inner_css_end__*/
|
|
35
34
|
, "3hx1s_gg_")
|
|
36
35
|
/*__reshadow_css_end__*/
|
|
37
36
|
, {
|
|
38
|
-
"__SCard": "
|
|
39
|
-
"__STitle": "
|
|
40
|
-
"__SIcon": "
|
|
41
|
-
"__SDescription": "
|
|
37
|
+
"__SCard": "___SCard_bnsg2_gg_",
|
|
38
|
+
"__STitle": "___STitle_bnsg2_gg_",
|
|
39
|
+
"__SIcon": "___SIcon_bnsg2_gg_",
|
|
40
|
+
"__SDescription": "___SDescription_bnsg2_gg_"
|
|
42
41
|
});
|
|
43
42
|
|
|
44
43
|
var Card = /*#__PURE__*/function (_Component) {
|
|
@@ -78,7 +77,7 @@ function Title(props) {
|
|
|
78
77
|
var styles = props.styles,
|
|
79
78
|
hint = props.hint;
|
|
80
79
|
var STitle = Text;
|
|
81
|
-
var SIcon =
|
|
80
|
+
var SIcon = Info;
|
|
82
81
|
return _ref5 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(STitle, _ref5.cn("STitle", _objectSpread({}, _assignProps2({}, _ref2)))), hint && /*#__PURE__*/React.createElement(Tooltip, _ref5.cn("Tooltip", {
|
|
83
82
|
"title": hint
|
|
84
83
|
}), /*#__PURE__*/React.createElement(SIcon, _ref5.cn("SIcon", {}))));
|
package/lib/es6/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Card.
|
|
1
|
+
{"version":3,"sources":["../../src/Card.js"],"names":["React","createComponent","Component","sstyled","Root","Box","Text","Tooltip","Info","Card","SCard","styles","asProps","style","Title","props","hint","STitle","SIcon","Description","SDescription"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,SAASC,IAAT,QAAqB,qBAArB;AACA,OAAOC,OAAP,MAAoB,kBAApB;AACA,OAAOC,IAAP,MAAiB,sBAAjB;;;;;;;;;;;;;;;;;;IAIMC,I;;;;;;;;;;;;;WAKJ,kBAAS;AAAA;AAAA;;AACP,UAAMC,KAAK,GAG2BL,GAHtC;AACA,UAAQM,MAAR,GAAmB,KAAKC,OAAxB,CAAQD,MAAR;AAEA,qBAAOR,OAAO,CAACQ,MAAD,CAAd,eAAuB,oBAAC,KAAD,+DAAvB;AACD;;;;EAVgBT,S;;gBAAbO,I,iBACiB,M;;gBADjBA,I,WAGWI,K;;AAUjB,SAASC,KAAT,CAAeC,KAAf,EAAsB;AAAA;AAAA;;AACpB,MAAQJ,MAAR,GAAyBI,KAAzB,CAAQJ,MAAR;AAAA,MAAgBK,IAAhB,GAAyBD,KAAzB,CAAgBC,IAAhB;AACA,MAAMC,MAAM,GAIQX,IAJpB;AACA,MAAMY,KAAK,GAAGV,IAAd;AACA,iBAAOL,OAAO,CAACQ,MAAD,CAAd,eACE,uDACE,oBAAC,MAAD,kEADF,EAEGK,IAAI,iBACH,oBAAC,OAAD;AAAA,aAAgBA;AAAhB,mBACE,oBAAC,KAAD,wBADF,CAHJ,CADF;AAUD;;AAED,SAASG,WAAT,CAAqBJ,KAArB,EAA4B;AAAA;AAAA;;AAC1B,MAAQJ,MAAR,GAAmBI,KAAnB,CAAQJ,MAAR;AACA,MAAMS,YAAY,GAC2Bd,IAD7C;AACA,iBAAOH,OAAO,CAACQ,MAAD,CAAd,eAAuB,oBAAC,YAAD;AAAA,WAAgC;AAAhC,cAAvB;AACD;;AAED,eAAeV,eAAe,CAACQ,IAAD,EAAO;AACnCK,EAAAA,KAAK,EAALA,KADmC;AAEnCK,EAAAA,WAAW,EAAXA;AAFmC,CAAP,CAA9B","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { Text } from '@semcore/typography';\nimport Tooltip from '@semcore/tooltip';\nimport Info from '@semcore/icon/Info/m';\n\nimport style from './style/card.shadow.css';\n\nclass Card extends Component {\n static displayName = 'Card';\n\n static style = style;\n\n render() {\n const SCard = Root;\n const { styles } = this.asProps;\n\n return sstyled(styles)(<SCard render={Box} />);\n }\n}\n\nfunction Title(props) {\n const { styles, hint } = props;\n const STitle = Root;\n const SIcon = Info;\n return sstyled(styles)(\n <>\n <STitle render={Text} />\n {hint && (\n <Tooltip title={hint}>\n <SIcon />\n </Tooltip>\n )}\n </>,\n );\n}\n\nfunction Description(props) {\n const { styles } = props;\n const SDescription = Root;\n return sstyled(styles)(<SDescription render={Text} tag=\"p\" />);\n}\n\nexport default createComponent(Card, {\n Title,\n Description,\n});\n"],"file":"Card.js"}
|
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.
|
|
1
|
+
{"version":3,"sources":["../../src/index.js"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,QAAxB;AACA,cAAc,QAAd","sourcesContent":["export { default } from './Card';\nexport * from './Card';\n"],"file":"index.js"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
3
|
+
import { IBoxProps } from '@semcore/flex-box';
|
|
4
|
+
import { Text, ITextProps } from '@semcore/typography';
|
|
5
|
+
|
|
6
|
+
export interface ITitleProps extends ITextProps {
|
|
7
|
+
/**
|
|
8
|
+
* Tooltip text
|
|
9
|
+
*/
|
|
10
|
+
hint?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare const Card: (<T>(props: CProps<IBoxProps & T>) => ReturnEl) & {
|
|
14
|
+
Title: <T>(props: ITitleProps & T) => ReturnEl;
|
|
15
|
+
Description: typeof Text;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default Card;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/card",
|
|
3
3
|
"description": "SEMRush Card Component",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
"author": "Roman Lysov <r.lysov@semrush.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "build",
|
|
12
|
+
"build": "build --source=js",
|
|
13
13
|
"test": "jest"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@semcore/utils": "^3.
|
|
16
|
+
"@semcore/utils": "^3.31",
|
|
17
17
|
"@semcore/flex-box": "^4",
|
|
18
18
|
"@semcore/typography": "^3",
|
|
19
19
|
"@semcore/tooltip": "^4",
|
|
20
|
-
"@semcore/icon": "^2"
|
|
20
|
+
"@semcore/icon": "^2.16"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@semcore/core": "^1.11",
|
|
24
24
|
"react": "16.8 - 17"
|
|
25
25
|
},
|
|
26
26
|
"jest": {
|
|
27
|
-
"preset": "jest-preset-ui"
|
|
27
|
+
"preset": "@semcore/jest-preset-ui"
|
|
28
28
|
}
|
|
29
29
|
}
|
package/src/{Card.tsx → Card.js}
RENAMED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import createComponent, { Component,
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import createComponent, { Component, sstyled, Root } from '@semcore/core';
|
|
3
3
|
import { Box } from '@semcore/flex-box';
|
|
4
|
-
import {
|
|
5
|
-
// eslint-disable-next-line import/no-named-as-default
|
|
4
|
+
import { Text } from '@semcore/typography';
|
|
6
5
|
import Tooltip from '@semcore/tooltip';
|
|
7
|
-
import
|
|
6
|
+
import Info from '@semcore/icon/Info/m';
|
|
8
7
|
|
|
9
8
|
import style from './style/card.shadow.css';
|
|
10
9
|
|
|
11
|
-
export interface ITitleProps extends ITextProps {
|
|
12
|
-
/**
|
|
13
|
-
* Tooltip text
|
|
14
|
-
*/
|
|
15
|
-
hint?: React.ReactNode;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
10
|
class Card extends Component {
|
|
19
11
|
static displayName = 'Card';
|
|
20
12
|
|
|
@@ -31,7 +23,7 @@ class Card extends Component {
|
|
|
31
23
|
function Title(props) {
|
|
32
24
|
const { styles, hint } = props;
|
|
33
25
|
const STitle = Root;
|
|
34
|
-
const SIcon =
|
|
26
|
+
const SIcon = Info;
|
|
35
27
|
return sstyled(styles)(
|
|
36
28
|
<>
|
|
37
29
|
<STitle render={Text} />
|
|
@@ -50,13 +42,7 @@ function Description(props) {
|
|
|
50
42
|
return sstyled(styles)(<SDescription render={Text} tag="p" />);
|
|
51
43
|
}
|
|
52
44
|
|
|
53
|
-
export default createComponent
|
|
54
|
-
ComponentProps<typeof Box>,
|
|
55
|
-
{
|
|
56
|
-
Title: Merge<ITitleProps, HTMLAttributes<HTMLSpanElement>>;
|
|
57
|
-
Description: ComponentProps<typeof Text>;
|
|
58
|
-
}
|
|
59
|
-
>(Card, {
|
|
45
|
+
export default createComponent(Card, {
|
|
60
46
|
Title,
|
|
61
47
|
Description,
|
|
62
48
|
});
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
3
|
+
import { IBoxProps } from '@semcore/flex-box';
|
|
4
|
+
import { Text, ITextProps } from '@semcore/typography';
|
|
5
|
+
|
|
6
|
+
export interface ITitleProps extends ITextProps {
|
|
7
|
+
/**
|
|
8
|
+
* Tooltip text
|
|
9
|
+
*/
|
|
10
|
+
hint?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare const Card: (<T>(props: CProps<IBoxProps & T>) => ReturnEl) & {
|
|
14
|
+
Title: <T>(props: ITitleProps & T) => ReturnEl;
|
|
15
|
+
Description: typeof Text;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default Card;
|
|
File without changes
|
package/lib/types/Card.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React, { ComponentProps, HTMLAttributes } from 'react';
|
|
2
|
-
import { Merge } from '@semcore/core';
|
|
3
|
-
import { ITextProps, Text } from '@semcore/typography';
|
|
4
|
-
export interface ITitleProps extends ITextProps {
|
|
5
|
-
/**
|
|
6
|
-
* Tooltip text
|
|
7
|
-
*/
|
|
8
|
-
hint?: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
declare const _default: import("@semcore/core").ComponentType<import("@semcore/core").PropsAndRef<Merge<import("@semcore/flex-box").IBoxProps, React.HTMLAttributes<HTMLDivElement>>, {}, {}>, {
|
|
11
|
-
Title: Merge<ITitleProps, HTMLAttributes<HTMLSpanElement>>;
|
|
12
|
-
Description: ComponentProps<typeof Text>;
|
|
13
|
-
}, {}, {
|
|
14
|
-
[key: string]: (arg: unknown) => void;
|
|
15
|
-
}, null>;
|
|
16
|
-
export default _default;
|