@semcore/card 2.4.1 → 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 +7 -1
- package/lib/cjs/Card.js +26 -53
- package/lib/cjs/Card.js.map +1 -1
- package/lib/cjs/style/card.shadow.css +1 -16
- package/lib/es6/Card.js +25 -54
- package/lib/es6/Card.js.map +1 -1
- package/lib/es6/style/card.shadow.css +1 -16
- package/lib/types/index.d.ts +1 -3
- package/package.json +1 -1
- package/src/Card.js +4 -33
- package/src/index.d.ts +1 -3
- package/src/style/card.shadow.css +1 -16
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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
|
+
|
|
5
11
|
## [2.4.1] - 2021-02-14
|
|
6
12
|
|
|
7
13
|
### Fixed
|
|
@@ -12,7 +18,7 @@ CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangel
|
|
|
12
18
|
|
|
13
19
|
### Changed
|
|
14
20
|
|
|
15
|
-
-
|
|
21
|
+
- `Card` has been split into Header and Body and a background has been added
|
|
16
22
|
|
|
17
23
|
## [2.3.0] - 2022-01-18
|
|
18
24
|
|
package/lib/cjs/Card.js
CHANGED
|
@@ -33,8 +33,6 @@ var _tooltip = _interopRequireDefault(require("@semcore/tooltip"));
|
|
|
33
33
|
|
|
34
34
|
var _m = _interopRequireDefault(require("@semcore/icon/Info/m"));
|
|
35
35
|
|
|
36
|
-
var _findComponent = require("@semcore/utils/lib/findComponent");
|
|
37
|
-
|
|
38
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); }
|
|
39
37
|
|
|
40
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; }
|
|
@@ -52,97 +50,72 @@ var style = (
|
|
|
52
50
|
/*__reshadow_css_start__*/
|
|
53
51
|
_core.sstyled.insert(
|
|
54
52
|
/*__inner_css_start__*/
|
|
55
|
-
".
|
|
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}"
|
|
56
54
|
/*__inner_css_end__*/
|
|
57
|
-
, "
|
|
55
|
+
, "3hx1s_gg_")
|
|
58
56
|
/*__reshadow_css_end__*/
|
|
59
57
|
, {
|
|
60
|
-
"__SCard": "
|
|
61
|
-
"__STitle": "
|
|
62
|
-
"__SIcon": "
|
|
63
|
-
"__SDescription": "
|
|
64
|
-
"__SHeader": "___SHeader_81jzm_gg_",
|
|
65
|
-
"__SBody": "___SBody_81jzm_gg_"
|
|
58
|
+
"__SCard": "___SCard_bnsg2_gg_",
|
|
59
|
+
"__STitle": "___STitle_bnsg2_gg_",
|
|
60
|
+
"__SIcon": "___SIcon_bnsg2_gg_",
|
|
61
|
+
"__SDescription": "___SDescription_bnsg2_gg_"
|
|
66
62
|
});
|
|
67
63
|
|
|
68
|
-
var
|
|
69
|
-
(0, _inherits2["default"])(
|
|
64
|
+
var Card = /*#__PURE__*/function (_Component) {
|
|
65
|
+
(0, _inherits2["default"])(Card, _Component);
|
|
70
66
|
|
|
71
|
-
var _super = _createSuper(
|
|
67
|
+
var _super = _createSuper(Card);
|
|
72
68
|
|
|
73
|
-
function
|
|
74
|
-
(0, _classCallCheck2["default"])(this,
|
|
69
|
+
function Card() {
|
|
70
|
+
(0, _classCallCheck2["default"])(this, Card);
|
|
75
71
|
return _super.apply(this, arguments);
|
|
76
72
|
}
|
|
77
73
|
|
|
78
|
-
(0, _createClass2["default"])(
|
|
74
|
+
(0, _createClass2["default"])(Card, [{
|
|
79
75
|
key: "render",
|
|
80
76
|
value: function render() {
|
|
81
77
|
var _ref = this ? this.asProps : arguments[0],
|
|
82
|
-
|
|
78
|
+
_ref4;
|
|
83
79
|
|
|
84
80
|
var SCard = _flexBox.Box;
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
styles = _this$asProps.styles;
|
|
88
|
-
var advanceMode = (0, _findComponent.isAdvanceMode)(Children, [Card.Header.displayName, Card.Body.displayName]);
|
|
89
|
-
return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SCard, _ref6.cn("SCard", _objectSpread({}, (0, _core.assignProps)({}, _ref))), advanceMode ? /*#__PURE__*/_react["default"].createElement(Children, _ref6.cn("Children", {})) : /*#__PURE__*/_react["default"].createElement(Card.Body, null, /*#__PURE__*/_react["default"].createElement(Children, _ref6.cn("Children", {}))));
|
|
81
|
+
var styles = this.asProps.styles;
|
|
82
|
+
return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SCard, _ref4.cn("SCard", _objectSpread({}, (0, _core.assignProps)({}, _ref))));
|
|
90
83
|
}
|
|
91
84
|
}]);
|
|
92
|
-
return
|
|
85
|
+
return Card;
|
|
93
86
|
}(_core.Component);
|
|
94
87
|
|
|
95
|
-
(0, _defineProperty2["default"])(
|
|
96
|
-
(0, _defineProperty2["default"])(
|
|
88
|
+
(0, _defineProperty2["default"])(Card, "displayName", 'Card');
|
|
89
|
+
(0, _defineProperty2["default"])(Card, "style", style);
|
|
97
90
|
|
|
98
91
|
function Title(props) {
|
|
99
92
|
var _ref2 = this ? this.asProps : arguments[0],
|
|
100
|
-
|
|
93
|
+
_ref5;
|
|
101
94
|
|
|
102
95
|
var styles = props.styles,
|
|
103
96
|
hint = props.hint;
|
|
104
97
|
var STitle = _typography.Text;
|
|
105
98
|
var SIcon = _m["default"];
|
|
106
|
-
return
|
|
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", {
|
|
107
100
|
"title": hint
|
|
108
|
-
}), /*#__PURE__*/_react["default"].createElement(SIcon,
|
|
101
|
+
}), /*#__PURE__*/_react["default"].createElement(SIcon, _ref5.cn("SIcon", {}))));
|
|
109
102
|
}
|
|
110
103
|
|
|
111
104
|
function Description(props) {
|
|
112
105
|
var _ref3 = this ? this.asProps : arguments[0],
|
|
113
|
-
|
|
106
|
+
_ref6;
|
|
114
107
|
|
|
115
108
|
var styles = props.styles;
|
|
116
109
|
var SDescription = _typography.Text;
|
|
117
|
-
return
|
|
110
|
+
return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SDescription, _ref6.cn("SDescription", _objectSpread({}, (0, _core.assignProps)({
|
|
118
111
|
"tag": "p"
|
|
119
112
|
}, _ref3))));
|
|
120
113
|
}
|
|
121
114
|
|
|
122
|
-
|
|
123
|
-
var _ref4 = this ? this.asProps : arguments[0],
|
|
124
|
-
_ref9;
|
|
125
|
-
|
|
126
|
-
var styles = props.styles;
|
|
127
|
-
var SHeader = _flexBox.Box;
|
|
128
|
-
return _ref9 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SHeader, _ref9.cn("SHeader", _objectSpread({}, (0, _core.assignProps)(_objectSpread({}, props), _ref4))));
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function Body(props) {
|
|
132
|
-
var _ref5 = this ? this.asProps : arguments[0],
|
|
133
|
-
_ref10;
|
|
134
|
-
|
|
135
|
-
var styles = props.styles;
|
|
136
|
-
var SBody = _flexBox.Box;
|
|
137
|
-
return _ref10 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SBody, _ref10.cn("SBody", _objectSpread({}, (0, _core.assignProps)(_objectSpread({}, props), _ref5))));
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
var Card = (0, _core["default"])(CardRoot, {
|
|
115
|
+
var _default = (0, _core["default"])(Card, {
|
|
141
116
|
Title: Title,
|
|
142
|
-
Description: Description
|
|
143
|
-
Header: Header,
|
|
144
|
-
Body: Body
|
|
117
|
+
Description: Description
|
|
145
118
|
});
|
|
146
|
-
|
|
119
|
+
|
|
147
120
|
exports["default"] = _default;
|
|
148
121
|
//# sourceMappingURL=Card.js.map
|
package/lib/cjs/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Card.js"],"names":["
|
|
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"}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
SCard {
|
|
4
4
|
border: 1px solid var(--gray80);
|
|
5
5
|
border-radius: 2px;
|
|
6
|
-
|
|
7
|
-
background: var(--white);
|
|
6
|
+
padding: 20px 24px 24px;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
STitle {
|
|
@@ -23,17 +22,3 @@ SDescription {
|
|
|
23
22
|
font-size: var(--fs-200);
|
|
24
23
|
color: var(--gray60);
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
SHeader {
|
|
28
|
-
padding-bottom: 0;
|
|
29
|
-
padding-left: 24px;
|
|
30
|
-
padding-right: 24px;
|
|
31
|
-
padding-top: 20px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
SBody {
|
|
35
|
-
padding-bottom: 24px;
|
|
36
|
-
padding-left: 24px;
|
|
37
|
-
padding-right: 24px;
|
|
38
|
-
padding-top: 20px;
|
|
39
|
-
}
|
package/lib/es6/Card.js
CHANGED
|
@@ -5,8 +5,6 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
7
|
import { sstyled as _sstyled } from "@semcore/core";
|
|
8
|
-
import { assignProps as _assignProps5 } from "@semcore/core";
|
|
9
|
-
import { assignProps as _assignProps4 } from "@semcore/core";
|
|
10
8
|
import { assignProps as _assignProps3 } from "@semcore/core";
|
|
11
9
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
12
10
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
@@ -31,100 +29,73 @@ var style = (
|
|
|
31
29
|
/*__reshadow_css_start__*/
|
|
32
30
|
_sstyled.insert(
|
|
33
31
|
/*__inner_css_start__*/
|
|
34
|
-
".
|
|
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}"
|
|
35
33
|
/*__inner_css_end__*/
|
|
36
|
-
, "
|
|
34
|
+
, "3hx1s_gg_")
|
|
37
35
|
/*__reshadow_css_end__*/
|
|
38
36
|
, {
|
|
39
|
-
"__SCard": "
|
|
40
|
-
"__STitle": "
|
|
41
|
-
"__SIcon": "
|
|
42
|
-
"__SDescription": "
|
|
43
|
-
"__SHeader": "___SHeader_81jzm_gg_",
|
|
44
|
-
"__SBody": "___SBody_81jzm_gg_"
|
|
37
|
+
"__SCard": "___SCard_bnsg2_gg_",
|
|
38
|
+
"__STitle": "___STitle_bnsg2_gg_",
|
|
39
|
+
"__SIcon": "___SIcon_bnsg2_gg_",
|
|
40
|
+
"__SDescription": "___SDescription_bnsg2_gg_"
|
|
45
41
|
});
|
|
46
|
-
import { isAdvanceMode } from '@semcore/utils/lib/findComponent';
|
|
47
42
|
|
|
48
|
-
var
|
|
49
|
-
_inherits(
|
|
43
|
+
var Card = /*#__PURE__*/function (_Component) {
|
|
44
|
+
_inherits(Card, _Component);
|
|
50
45
|
|
|
51
|
-
var _super = _createSuper(
|
|
46
|
+
var _super = _createSuper(Card);
|
|
52
47
|
|
|
53
|
-
function
|
|
54
|
-
_classCallCheck(this,
|
|
48
|
+
function Card() {
|
|
49
|
+
_classCallCheck(this, Card);
|
|
55
50
|
|
|
56
51
|
return _super.apply(this, arguments);
|
|
57
52
|
}
|
|
58
53
|
|
|
59
|
-
_createClass(
|
|
54
|
+
_createClass(Card, [{
|
|
60
55
|
key: "render",
|
|
61
56
|
value: function render() {
|
|
62
57
|
var _ref = this ? this.asProps : arguments[0],
|
|
63
|
-
|
|
58
|
+
_ref4;
|
|
64
59
|
|
|
65
60
|
var SCard = Box;
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
styles = _this$asProps.styles;
|
|
69
|
-
var advanceMode = isAdvanceMode(Children, [Card.Header.displayName, Card.Body.displayName]);
|
|
70
|
-
return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SCard, _ref6.cn("SCard", _objectSpread({}, _assignProps({}, _ref))), advanceMode ? /*#__PURE__*/React.createElement(Children, _ref6.cn("Children", {})) : /*#__PURE__*/React.createElement(Card.Body, null, /*#__PURE__*/React.createElement(Children, _ref6.cn("Children", {}))));
|
|
61
|
+
var styles = this.asProps.styles;
|
|
62
|
+
return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SCard, _ref4.cn("SCard", _objectSpread({}, _assignProps({}, _ref))));
|
|
71
63
|
}
|
|
72
64
|
}]);
|
|
73
65
|
|
|
74
|
-
return
|
|
66
|
+
return Card;
|
|
75
67
|
}(Component);
|
|
76
68
|
|
|
77
|
-
_defineProperty(
|
|
69
|
+
_defineProperty(Card, "displayName", 'Card');
|
|
78
70
|
|
|
79
|
-
_defineProperty(
|
|
71
|
+
_defineProperty(Card, "style", style);
|
|
80
72
|
|
|
81
73
|
function Title(props) {
|
|
82
74
|
var _ref2 = this ? this.asProps : arguments[0],
|
|
83
|
-
|
|
75
|
+
_ref5;
|
|
84
76
|
|
|
85
77
|
var styles = props.styles,
|
|
86
78
|
hint = props.hint;
|
|
87
79
|
var STitle = Text;
|
|
88
80
|
var SIcon = Info;
|
|
89
|
-
return
|
|
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", {
|
|
90
82
|
"title": hint
|
|
91
|
-
}), /*#__PURE__*/React.createElement(SIcon,
|
|
83
|
+
}), /*#__PURE__*/React.createElement(SIcon, _ref5.cn("SIcon", {}))));
|
|
92
84
|
}
|
|
93
85
|
|
|
94
86
|
function Description(props) {
|
|
95
87
|
var _ref3 = this ? this.asProps : arguments[0],
|
|
96
|
-
|
|
88
|
+
_ref6;
|
|
97
89
|
|
|
98
90
|
var styles = props.styles;
|
|
99
91
|
var SDescription = Text;
|
|
100
|
-
return
|
|
92
|
+
return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SDescription, _ref6.cn("SDescription", _objectSpread({}, _assignProps3({
|
|
101
93
|
"tag": "p"
|
|
102
94
|
}, _ref3))));
|
|
103
95
|
}
|
|
104
96
|
|
|
105
|
-
|
|
106
|
-
var _ref4 = this ? this.asProps : arguments[0],
|
|
107
|
-
_ref9;
|
|
108
|
-
|
|
109
|
-
var styles = props.styles;
|
|
110
|
-
var SHeader = Box;
|
|
111
|
-
return _ref9 = sstyled(styles), /*#__PURE__*/React.createElement(SHeader, _ref9.cn("SHeader", _objectSpread({}, _assignProps4(_objectSpread({}, props), _ref4))));
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function Body(props) {
|
|
115
|
-
var _ref5 = this ? this.asProps : arguments[0],
|
|
116
|
-
_ref10;
|
|
117
|
-
|
|
118
|
-
var styles = props.styles;
|
|
119
|
-
var SBody = Box;
|
|
120
|
-
return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(SBody, _ref10.cn("SBody", _objectSpread({}, _assignProps5(_objectSpread({}, props), _ref5))));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
var Card = createComponent(CardRoot, {
|
|
97
|
+
export default createComponent(Card, {
|
|
124
98
|
Title: Title,
|
|
125
|
-
Description: Description
|
|
126
|
-
Header: Header,
|
|
127
|
-
Body: Body
|
|
99
|
+
Description: Description
|
|
128
100
|
});
|
|
129
|
-
export default Card;
|
|
130
101
|
//# sourceMappingURL=Card.js.map
|
package/lib/es6/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Card.js"],"names":["React","createComponent","Component","sstyled","Root","Box","Text","Tooltip","Info","
|
|
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"}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
SCard {
|
|
4
4
|
border: 1px solid var(--gray80);
|
|
5
5
|
border-radius: 2px;
|
|
6
|
-
|
|
7
|
-
background: var(--white);
|
|
6
|
+
padding: 20px 24px 24px;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
STitle {
|
|
@@ -23,17 +22,3 @@ SDescription {
|
|
|
23
22
|
font-size: var(--fs-200);
|
|
24
23
|
color: var(--gray60);
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
SHeader {
|
|
28
|
-
padding-bottom: 0;
|
|
29
|
-
padding-left: 24px;
|
|
30
|
-
padding-right: 24px;
|
|
31
|
-
padding-top: 20px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
SBody {
|
|
35
|
-
padding-bottom: 24px;
|
|
36
|
-
padding-left: 24px;
|
|
37
|
-
padding-right: 24px;
|
|
38
|
-
padding-top: 20px;
|
|
39
|
-
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CProps, ReturnEl } from '@semcore/core';
|
|
3
|
-
import {
|
|
3
|
+
import { IBoxProps } from '@semcore/flex-box';
|
|
4
4
|
import { Text, ITextProps } from '@semcore/typography';
|
|
5
5
|
|
|
6
6
|
export interface ITitleProps extends ITextProps {
|
|
@@ -13,8 +13,6 @@ export interface ITitleProps extends ITextProps {
|
|
|
13
13
|
declare const Card: (<T>(props: CProps<IBoxProps & T>) => ReturnEl) & {
|
|
14
14
|
Title: <T>(props: ITitleProps & T) => ReturnEl;
|
|
15
15
|
Description: typeof Text;
|
|
16
|
-
Header: typeof Box;
|
|
17
|
-
Body: typeof Box;
|
|
18
16
|
};
|
|
19
17
|
|
|
20
18
|
export default Card;
|
package/package.json
CHANGED
package/src/Card.js
CHANGED
|
@@ -6,30 +6,17 @@ import Tooltip from '@semcore/tooltip';
|
|
|
6
6
|
import Info from '@semcore/icon/Info/m';
|
|
7
7
|
|
|
8
8
|
import style from './style/card.shadow.css';
|
|
9
|
-
import { isAdvanceMode } from '@semcore/utils/lib/findComponent';
|
|
10
9
|
|
|
11
|
-
class
|
|
10
|
+
class Card extends Component {
|
|
12
11
|
static displayName = 'Card';
|
|
13
12
|
|
|
14
13
|
static style = style;
|
|
15
14
|
|
|
16
15
|
render() {
|
|
17
16
|
const SCard = Root;
|
|
18
|
-
const {
|
|
17
|
+
const { styles } = this.asProps;
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return sstyled(styles)(
|
|
23
|
-
<SCard render={Box}>
|
|
24
|
-
{advanceMode ? (
|
|
25
|
-
<Children />
|
|
26
|
-
) : (
|
|
27
|
-
<Card.Body>
|
|
28
|
-
<Children />
|
|
29
|
-
</Card.Body>
|
|
30
|
-
)}
|
|
31
|
-
</SCard>,
|
|
32
|
-
);
|
|
19
|
+
return sstyled(styles)(<SCard render={Box} />);
|
|
33
20
|
}
|
|
34
21
|
}
|
|
35
22
|
|
|
@@ -55,23 +42,7 @@ function Description(props) {
|
|
|
55
42
|
return sstyled(styles)(<SDescription render={Text} tag="p" />);
|
|
56
43
|
}
|
|
57
44
|
|
|
58
|
-
|
|
59
|
-
const { styles } = props;
|
|
60
|
-
const SHeader = Root;
|
|
61
|
-
return sstyled(styles)(<SHeader render={Box} {...props} />);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function Body(props) {
|
|
65
|
-
const { styles } = props;
|
|
66
|
-
const SBody = Root;
|
|
67
|
-
return sstyled(styles)(<SBody render={Box} {...props} />);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const Card = createComponent(CardRoot, {
|
|
45
|
+
export default createComponent(Card, {
|
|
71
46
|
Title,
|
|
72
47
|
Description,
|
|
73
|
-
Header,
|
|
74
|
-
Body,
|
|
75
48
|
});
|
|
76
|
-
|
|
77
|
-
export default Card;
|
package/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CProps, ReturnEl } from '@semcore/core';
|
|
3
|
-
import {
|
|
3
|
+
import { IBoxProps } from '@semcore/flex-box';
|
|
4
4
|
import { Text, ITextProps } from '@semcore/typography';
|
|
5
5
|
|
|
6
6
|
export interface ITitleProps extends ITextProps {
|
|
@@ -13,8 +13,6 @@ export interface ITitleProps extends ITextProps {
|
|
|
13
13
|
declare const Card: (<T>(props: CProps<IBoxProps & T>) => ReturnEl) & {
|
|
14
14
|
Title: <T>(props: ITitleProps & T) => ReturnEl;
|
|
15
15
|
Description: typeof Text;
|
|
16
|
-
Header: typeof Box;
|
|
17
|
-
Body: typeof Box;
|
|
18
16
|
};
|
|
19
17
|
|
|
20
18
|
export default Card;
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
SCard {
|
|
4
4
|
border: 1px solid var(--gray80);
|
|
5
5
|
border-radius: 2px;
|
|
6
|
-
|
|
7
|
-
background: var(--white);
|
|
6
|
+
padding: 20px 24px 24px;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
STitle {
|
|
@@ -23,17 +22,3 @@ SDescription {
|
|
|
23
22
|
font-size: var(--fs-200);
|
|
24
23
|
color: var(--gray60);
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
SHeader {
|
|
28
|
-
padding-bottom: 0;
|
|
29
|
-
padding-left: 24px;
|
|
30
|
-
padding-right: 24px;
|
|
31
|
-
padding-top: 20px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
SBody {
|
|
35
|
-
padding-bottom: 24px;
|
|
36
|
-
padding-left: 24px;
|
|
37
|
-
padding-right: 24px;
|
|
38
|
-
padding-top: 20px;
|
|
39
|
-
}
|