@semcore/card 2.1.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 +29 -1
- package/lib/cjs/Card.js +38 -52
- package/lib/cjs/Card.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/card.shadow.css +1 -0
- package/lib/es6/Card.js +43 -54
- package/lib/es6/Card.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/card.shadow.css +1 -0
- package/lib/types/index.d.ts +18 -2
- package/package.json +5 -4
- package/src/Card.js +48 -0
- package/src/index.d.ts +18 -0
- package/src/{index.tsx → index.js} +0 -0
- package/src/style/card.shadow.css +1 -0
- package/lib/types/Card.d.ts +0 -16
- package/src/Card.tsx +0 -60
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [2.3.0] - 2022-01-18
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Up version icons and use new icon.
|
|
10
|
+
- Rewrite code from TS to JS 🧑💻
|
|
11
|
+
|
|
12
|
+
## [2.2.2] - 2021-9-20
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Fixed padding
|
|
17
|
+
|
|
18
|
+
## [2.2.1] - 2021-8-26
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Add 'sideEffect=false' for more optimal build via webpack
|
|
23
|
+
|
|
24
|
+
## [2.2.0] - 2021-04-26
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- Version of dependence `@semcore/core` has been changed to `1.11`.
|
|
29
|
+
- Improved performance. Removed one component wrapper.
|
|
30
|
+
- The style processing system has been changed.
|
|
31
|
+
- Removed the ability to apply media styles via a plugin `babel-plugin-react-semcore`.
|
|
32
|
+
|
|
5
33
|
## [2.1.0] - 2020-12-17
|
|
6
34
|
|
|
7
35
|
### Added
|
|
@@ -42,7 +70,7 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
|
|
|
42
70
|
|
|
43
71
|
### Fixed
|
|
44
72
|
|
|
45
|
-
- Исправлена проблема в установке произвольного className в `Description` и `Title`.
|
|
73
|
+
- Исправлена проблема в установке произвольного className в `Description` и `Title`.
|
|
46
74
|
|
|
47
75
|
## [1.2.1] - 2020-03-06
|
|
48
76
|
|
package/lib/cjs/Card.js
CHANGED
|
@@ -21,53 +21,41 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
21
21
|
|
|
22
22
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _core = _interopRequireWildcard(require("@semcore/core"));
|
|
25
25
|
|
|
26
26
|
var _react = _interopRequireDefault(require("react"));
|
|
27
27
|
|
|
28
|
-
var _core = _interopRequireWildcard(require("@semcore/core"));
|
|
29
|
-
|
|
30
28
|
var _flexBox = require("@semcore/flex-box");
|
|
31
29
|
|
|
32
30
|
var _typography = require("@semcore/typography");
|
|
33
31
|
|
|
34
32
|
var _tooltip = _interopRequireDefault(require("@semcore/tooltip"));
|
|
35
33
|
|
|
36
|
-
var
|
|
34
|
+
var _m = _interopRequireDefault(require("@semcore/icon/Info/m"));
|
|
35
|
+
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
+
|
|
38
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
37
39
|
|
|
38
40
|
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); }; }
|
|
39
41
|
|
|
40
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
42
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
43
|
|
|
42
44
|
/*__reshadow-styles__:"./style/card.shadow.css"*/
|
|
43
|
-
var
|
|
45
|
+
var style = (
|
|
44
46
|
/*__reshadow_css_start__*/
|
|
45
|
-
|
|
47
|
+
_core.sstyled.insert(
|
|
46
48
|
/*__inner_css_start__*/
|
|
47
|
-
".
|
|
49
|
+
".___SCard_19clt_gg_{border:1px solid #ccc;border-radius:2px;padding:20px 24px 24px}.___STitle_19clt_gg_{font-size:19px;font-weight:500}.___SIcon_19clt_gg_{margin-left:4px;color:#a6b0b3;cursor:help}.___SDescription_19clt_gg_{margin-bottom:12px;font-size:14px;color:#757575}"
|
|
48
50
|
/*__inner_css_end__*/
|
|
49
|
-
, "
|
|
51
|
+
, "3hx1s_gg_")
|
|
50
52
|
/*__reshadow_css_end__*/
|
|
51
53
|
, {
|
|
52
|
-
"__SCard": "
|
|
53
|
-
"__STitle": "
|
|
54
|
-
"__SIcon": "
|
|
55
|
-
"__SDescription": "
|
|
56
|
-
})
|
|
57
|
-
style = (0, _extends2["default"])({}, _ref);
|
|
58
|
-
|
|
59
|
-
if (false) {
|
|
60
|
-
/*__reshadow_css_start__*/
|
|
61
|
-
(0, _core.__css__)(
|
|
62
|
-
/*__inner_css_start__*/
|
|
63
|
-
"@media (max-width: 768px) {\n\n.___STitle_679n2_gg_ {\n font-size: 24.7px;\n}\n\n.___SDescription_679n2_gg_ {\n font-size: 18.2px;\n}}"
|
|
64
|
-
/*__inner_css_end__*/
|
|
65
|
-
, "12w8vvi_gg_")
|
|
66
|
-
/*__reshadow_css_end__*/
|
|
67
|
-
;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
var styled_c8 = (0, _core.create)([]);
|
|
54
|
+
"__SCard": "___SCard_19clt_gg_",
|
|
55
|
+
"__STitle": "___STitle_19clt_gg_",
|
|
56
|
+
"__SIcon": "___SIcon_19clt_gg_",
|
|
57
|
+
"__SDescription": "___SDescription_19clt_gg_"
|
|
58
|
+
});
|
|
71
59
|
|
|
72
60
|
var Card = /*#__PURE__*/function (_Component) {
|
|
73
61
|
(0, _inherits2["default"])(Card, _Component);
|
|
@@ -82,12 +70,12 @@ var Card = /*#__PURE__*/function (_Component) {
|
|
|
82
70
|
(0, _createClass2["default"])(Card, [{
|
|
83
71
|
key: "render",
|
|
84
72
|
value: function render() {
|
|
85
|
-
var
|
|
73
|
+
var _ref = this ? this.asProps : arguments[0],
|
|
74
|
+
_ref4;
|
|
75
|
+
|
|
76
|
+
var SCard = _flexBox.Box;
|
|
86
77
|
var styles = this.asProps.styles;
|
|
87
|
-
return
|
|
88
|
-
render: _flexBox.Box,
|
|
89
|
-
p: 6
|
|
90
|
-
}))));
|
|
78
|
+
return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SCard, _ref4.cn("SCard", _objectSpread({}, (0, _core.assignProps)({}, _ref))));
|
|
91
79
|
}
|
|
92
80
|
}]);
|
|
93
81
|
return Card;
|
|
@@ -95,31 +83,29 @@ var Card = /*#__PURE__*/function (_Component) {
|
|
|
95
83
|
|
|
96
84
|
(0, _defineProperty2["default"])(Card, "displayName", 'Card');
|
|
97
85
|
(0, _defineProperty2["default"])(Card, "style", style);
|
|
98
|
-
var styled_12c = (0, _core.create)([]);
|
|
99
86
|
|
|
100
87
|
function Title(props) {
|
|
101
|
-
var
|
|
102
|
-
|
|
88
|
+
var _ref2 = this ? this.asProps : arguments[0],
|
|
89
|
+
_ref5;
|
|
90
|
+
|
|
91
|
+
var styles = props.styles,
|
|
103
92
|
hint = props.hint;
|
|
104
|
-
var
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}), /*#__PURE__*/_react["default"].createElement(SIcon, {
|
|
110
|
-
className: _core.styled.styles["__SIcon"]
|
|
111
|
-
})))));
|
|
93
|
+
var STitle = _typography.Text;
|
|
94
|
+
var SIcon = _m["default"];
|
|
95
|
+
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
|
+
"title": hint
|
|
97
|
+
}), /*#__PURE__*/_react["default"].createElement(SIcon, _ref5.cn("SIcon", {}))));
|
|
112
98
|
}
|
|
113
99
|
|
|
114
|
-
var styled_190 = (0, _core.create)([]);
|
|
115
|
-
|
|
116
100
|
function Description(props) {
|
|
117
|
-
var
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
101
|
+
var _ref3 = this ? this.asProps : arguments[0],
|
|
102
|
+
_ref6;
|
|
103
|
+
|
|
104
|
+
var styles = props.styles;
|
|
105
|
+
var SDescription = _typography.Text;
|
|
106
|
+
return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SDescription, _ref6.cn("SDescription", _objectSpread({}, (0, _core.assignProps)({
|
|
107
|
+
"tag": "p"
|
|
108
|
+
}, _ref3))));
|
|
123
109
|
}
|
|
124
110
|
|
|
125
111
|
var _default = (0, _core["default"])(Card, {
|
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;AADO,UAECC,MAFD,GAEY,KAAKC,OAFjB,CAECD,MAFD;AAIP,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;;AAAA,MACZL,MADY,GACKK,KADL,CACZL,MADY;AAAA,MACJM,IADI,GACKD,KADL,CACJC,IADI;AAEpB,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;;AAAA,MAClBL,MADkB,GACPK,KADO,CAClBL,MADkB;AAE1B,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
|
@@ -18,6 +18,7 @@ var _Card = _interopRequireWildcard(require("./Card"));
|
|
|
18
18
|
Object.keys(_Card).forEach(function (key) {
|
|
19
19
|
if (key === "default" || key === "__esModule") return;
|
|
20
20
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
21
|
+
if (key in exports && exports[key] === _Card[key]) return;
|
|
21
22
|
Object.defineProperty(exports, key, {
|
|
22
23
|
enumerable: true,
|
|
23
24
|
get: function get() {
|
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
|
@@ -4,49 +4,41 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
-
import
|
|
7
|
+
import { sstyled as _sstyled } from "@semcore/core";
|
|
8
|
+
import { assignProps as _assignProps3 } from "@semcore/core";
|
|
9
|
+
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
10
|
+
import { assignProps as _assignProps } from "@semcore/core";
|
|
11
|
+
|
|
12
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
+
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
15
|
|
|
9
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); }; }
|
|
10
17
|
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
18
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
19
|
|
|
13
20
|
import React from 'react';
|
|
14
|
-
import createComponent, { Component,
|
|
21
|
+
import createComponent, { Component, sstyled, Root } from '@semcore/core';
|
|
15
22
|
import { Box } from '@semcore/flex-box';
|
|
16
|
-
import { Text } from '@semcore/typography';
|
|
17
|
-
|
|
23
|
+
import { Text } from '@semcore/typography';
|
|
18
24
|
import Tooltip from '@semcore/tooltip';
|
|
19
|
-
import
|
|
25
|
+
import Info from '@semcore/icon/Info/m';
|
|
20
26
|
|
|
21
27
|
/*__reshadow-styles__:"./style/card.shadow.css"*/
|
|
22
|
-
var
|
|
28
|
+
var style = (
|
|
23
29
|
/*__reshadow_css_start__*/
|
|
24
|
-
|
|
30
|
+
_sstyled.insert(
|
|
25
31
|
/*__inner_css_start__*/
|
|
26
|
-
".
|
|
32
|
+
".___SCard_19clt_gg_{border:1px solid #ccc;border-radius:2px;padding:20px 24px 24px}.___STitle_19clt_gg_{font-size:19px;font-weight:500}.___SIcon_19clt_gg_{margin-left:4px;color:#a6b0b3;cursor:help}.___SDescription_19clt_gg_{margin-bottom:12px;font-size:14px;color:#757575}"
|
|
27
33
|
/*__inner_css_end__*/
|
|
28
|
-
, "
|
|
34
|
+
, "3hx1s_gg_")
|
|
29
35
|
/*__reshadow_css_end__*/
|
|
30
36
|
, {
|
|
31
|
-
"__SCard": "
|
|
32
|
-
"__STitle": "
|
|
33
|
-
"__SIcon": "
|
|
34
|
-
"__SDescription": "
|
|
35
|
-
})
|
|
36
|
-
style = _extends({}, _ref);
|
|
37
|
-
|
|
38
|
-
if (false) {
|
|
39
|
-
/*__reshadow_css_start__*/
|
|
40
|
-
__css__(
|
|
41
|
-
/*__inner_css_start__*/
|
|
42
|
-
"@media (max-width: 768px) {\n\n.___STitle_679n2_gg_ {\n font-size: 24.7px;\n}\n\n.___SDescription_679n2_gg_ {\n font-size: 18.2px;\n}}"
|
|
43
|
-
/*__inner_css_end__*/
|
|
44
|
-
, "12w8vvi_gg_")
|
|
45
|
-
/*__reshadow_css_end__*/
|
|
46
|
-
;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
var styled_c8 = create([]);
|
|
37
|
+
"__SCard": "___SCard_19clt_gg_",
|
|
38
|
+
"__STitle": "___STitle_19clt_gg_",
|
|
39
|
+
"__SIcon": "___SIcon_19clt_gg_",
|
|
40
|
+
"__SDescription": "___SDescription_19clt_gg_"
|
|
41
|
+
});
|
|
50
42
|
|
|
51
43
|
var Card = /*#__PURE__*/function (_Component) {
|
|
52
44
|
_inherits(Card, _Component);
|
|
@@ -62,12 +54,12 @@ var Card = /*#__PURE__*/function (_Component) {
|
|
|
62
54
|
_createClass(Card, [{
|
|
63
55
|
key: "render",
|
|
64
56
|
value: function render() {
|
|
65
|
-
var
|
|
57
|
+
var _ref = this ? this.asProps : arguments[0],
|
|
58
|
+
_ref4;
|
|
59
|
+
|
|
60
|
+
var SCard = Box;
|
|
66
61
|
var styles = this.asProps.styles;
|
|
67
|
-
return
|
|
68
|
-
render: Box,
|
|
69
|
-
p: 6
|
|
70
|
-
}))));
|
|
62
|
+
return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SCard, _ref4.cn("SCard", _objectSpread({}, _assignProps({}, _ref))));
|
|
71
63
|
}
|
|
72
64
|
}]);
|
|
73
65
|
|
|
@@ -78,31 +70,28 @@ _defineProperty(Card, "displayName", 'Card');
|
|
|
78
70
|
|
|
79
71
|
_defineProperty(Card, "style", style);
|
|
80
72
|
|
|
81
|
-
var styled_12c = create([]);
|
|
82
|
-
|
|
83
73
|
function Title(props) {
|
|
84
|
-
var
|
|
85
|
-
|
|
74
|
+
var _ref2 = this ? this.asProps : arguments[0],
|
|
75
|
+
_ref5;
|
|
76
|
+
|
|
77
|
+
var styles = props.styles,
|
|
86
78
|
hint = props.hint;
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}), /*#__PURE__*/React.createElement(SIcon, {
|
|
93
|
-
className: styled.styles["__SIcon"]
|
|
94
|
-
})))));
|
|
79
|
+
var STitle = Text;
|
|
80
|
+
var SIcon = Info;
|
|
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", {
|
|
82
|
+
"title": hint
|
|
83
|
+
}), /*#__PURE__*/React.createElement(SIcon, _ref5.cn("SIcon", {}))));
|
|
95
84
|
}
|
|
96
85
|
|
|
97
|
-
var styled_190 = create([]);
|
|
98
|
-
|
|
99
86
|
function Description(props) {
|
|
100
|
-
var
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
87
|
+
var _ref3 = this ? this.asProps : arguments[0],
|
|
88
|
+
_ref6;
|
|
89
|
+
|
|
90
|
+
var styles = props.styles;
|
|
91
|
+
var SDescription = Text;
|
|
92
|
+
return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SDescription, _ref6.cn("SDescription", _objectSpread({}, _assignProps3({
|
|
93
|
+
"tag": "p"
|
|
94
|
+
}, _ref3))));
|
|
106
95
|
}
|
|
107
96
|
|
|
108
97
|
export default createComponent(Card, {
|
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;AADO,UAECM,MAFD,GAEY,KAAKC,OAFjB,CAECD,MAFD;AAIP,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;;AAAA,MACZJ,MADY,GACKI,KADL,CACZJ,MADY;AAAA,MACJK,IADI,GACKD,KADL,CACJC,IADI;AAEpB,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;;AAAA,MAClBJ,MADkB,GACPI,KADO,CAClBJ,MADkB;AAE1B,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,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/card",
|
|
3
3
|
"description": "SEMRush Card Component",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
8
9
|
"author": "Roman Lysov <r.lysov@semrush.com>",
|
|
9
10
|
"license": "MIT",
|
|
10
11
|
"scripts": {
|
|
11
|
-
"build": "build",
|
|
12
|
+
"build": "build --source=js",
|
|
12
13
|
"test": "jest"
|
|
13
14
|
},
|
|
14
15
|
"dependencies": {
|
|
@@ -16,10 +17,10 @@
|
|
|
16
17
|
"@semcore/flex-box": "^4",
|
|
17
18
|
"@semcore/typography": "^3",
|
|
18
19
|
"@semcore/tooltip": "^4",
|
|
19
|
-
"@semcore/icon": "^2"
|
|
20
|
+
"@semcore/icon": "^2.16"
|
|
20
21
|
},
|
|
21
22
|
"peerDependencies": {
|
|
22
|
-
"@semcore/core": "^1.
|
|
23
|
+
"@semcore/core": "^1.11",
|
|
23
24
|
"react": "16.8 - 17"
|
|
24
25
|
},
|
|
25
26
|
"jest": {
|
package/src/Card.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import createComponent, { Component, sstyled, Root } from '@semcore/core';
|
|
3
|
+
import { Box } from '@semcore/flex-box';
|
|
4
|
+
import { Text } from '@semcore/typography';
|
|
5
|
+
import Tooltip from '@semcore/tooltip';
|
|
6
|
+
import Info from '@semcore/icon/Info/m';
|
|
7
|
+
|
|
8
|
+
import style from './style/card.shadow.css';
|
|
9
|
+
|
|
10
|
+
class Card extends Component {
|
|
11
|
+
static displayName = 'Card';
|
|
12
|
+
|
|
13
|
+
static style = style;
|
|
14
|
+
|
|
15
|
+
render() {
|
|
16
|
+
const SCard = Root;
|
|
17
|
+
const { styles } = this.asProps;
|
|
18
|
+
|
|
19
|
+
return sstyled(styles)(<SCard render={Box} />);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function Title(props) {
|
|
24
|
+
const { styles, hint } = props;
|
|
25
|
+
const STitle = Root;
|
|
26
|
+
const SIcon = Info;
|
|
27
|
+
return sstyled(styles)(
|
|
28
|
+
<>
|
|
29
|
+
<STitle render={Text} />
|
|
30
|
+
{hint && (
|
|
31
|
+
<Tooltip title={hint}>
|
|
32
|
+
<SIcon />
|
|
33
|
+
</Tooltip>
|
|
34
|
+
)}
|
|
35
|
+
</>,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function Description(props) {
|
|
40
|
+
const { styles } = props;
|
|
41
|
+
const SDescription = Root;
|
|
42
|
+
return sstyled(styles)(<SDescription render={Text} tag="p" />);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default createComponent(Card, {
|
|
46
|
+
Title,
|
|
47
|
+
Description,
|
|
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;
|
package/src/Card.tsx
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React, { ComponentProps, HTMLAttributes } from 'react';
|
|
2
|
-
import createComponent, { Component, Merge, styled } from '@semcore/core';
|
|
3
|
-
import { Box } from '@semcore/flex-box';
|
|
4
|
-
import { ITextProps, Text } from '@semcore/typography';
|
|
5
|
-
// eslint-disable-next-line import/no-named-as-default
|
|
6
|
-
import Tooltip from '@semcore/tooltip';
|
|
7
|
-
import InfoXS from '@semcore/icon/lib/Info/xs';
|
|
8
|
-
|
|
9
|
-
import style from './style/card.shadow.css';
|
|
10
|
-
|
|
11
|
-
export interface ITitleProps extends ITextProps {
|
|
12
|
-
/**
|
|
13
|
-
* Tooltip text
|
|
14
|
-
*/
|
|
15
|
-
hint?: React.ReactNode;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
class Card extends Component {
|
|
19
|
-
static displayName = 'Card';
|
|
20
|
-
|
|
21
|
-
static style = style;
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
const SCard = this.Root;
|
|
25
|
-
const { styles } = this.asProps;
|
|
26
|
-
|
|
27
|
-
return styled(styles)(<SCard render={Box} p={6} />);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function Title(props) {
|
|
32
|
-
const { Root: STitle, styles, hint } = props;
|
|
33
|
-
const SIcon = InfoXS;
|
|
34
|
-
return styled(styles)(
|
|
35
|
-
<>
|
|
36
|
-
<STitle render={Text} />
|
|
37
|
-
{hint && (
|
|
38
|
-
<Tooltip title={hint}>
|
|
39
|
-
<SIcon />
|
|
40
|
-
</Tooltip>
|
|
41
|
-
)}
|
|
42
|
-
</>,
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function Description(props) {
|
|
47
|
-
const { Root: SDescription, styles } = props;
|
|
48
|
-
return styled(styles)(<SDescription render={Text} tag="p" />);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export default createComponent<
|
|
52
|
-
ComponentProps<typeof Box>,
|
|
53
|
-
{
|
|
54
|
-
Title: Merge<ITitleProps, HTMLAttributes<HTMLSpanElement>>;
|
|
55
|
-
Description: ComponentProps<typeof Text>;
|
|
56
|
-
}
|
|
57
|
-
>(Card, {
|
|
58
|
-
Title,
|
|
59
|
-
Description,
|
|
60
|
-
});
|