@semcore/card 2.2.2 → 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 CHANGED
@@ -2,6 +2,13 @@
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
+
5
12
  ## [2.2.2] - 2021-9-20
6
13
 
7
14
  ### Fixed
package/lib/cjs/Card.js CHANGED
@@ -31,7 +31,7 @@ var _typography = require("@semcore/typography");
31
31
 
32
32
  var _tooltip = _interopRequireDefault(require("@semcore/tooltip"));
33
33
 
34
- var _xs = _interopRequireDefault(require("@semcore/icon/lib/Info/xs"));
34
+ var _m = _interopRequireDefault(require("@semcore/icon/Info/m"));
35
35
 
36
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
37
 
@@ -46,15 +46,15 @@ var style = (
46
46
  /*__reshadow_css_start__*/
47
47
  _core.sstyled.insert(
48
48
  /*__inner_css_start__*/
49
- ".___SCard_30o7x_gg_{border:1px solid #ccc;border-radius:2px;padding:20px 24px 24px}.___STitle_30o7x_gg_{font-size:19px;font-weight:500}.___SIcon_30o7x_gg_{margin-left:4px;color:#a6b0b3;cursor:help}.___SDescription_30o7x_gg_{margin-bottom:12px;font-size:14px;color:#757575}"
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}"
50
50
  /*__inner_css_end__*/
51
51
  , "3hx1s_gg_")
52
52
  /*__reshadow_css_end__*/
53
53
  , {
54
- "__SCard": "___SCard_30o7x_gg_",
55
- "__STitle": "___STitle_30o7x_gg_",
56
- "__SIcon": "___SIcon_30o7x_gg_",
57
- "__SDescription": "___SDescription_30o7x_gg_"
54
+ "__SCard": "___SCard_19clt_gg_",
55
+ "__STitle": "___STitle_19clt_gg_",
56
+ "__SIcon": "___SIcon_19clt_gg_",
57
+ "__SDescription": "___SDescription_19clt_gg_"
58
58
  });
59
59
 
60
60
  var Card = /*#__PURE__*/function (_Component) {
@@ -91,7 +91,7 @@ function Title(props) {
91
91
  var styles = props.styles,
92
92
  hint = props.hint;
93
93
  var STitle = _typography.Text;
94
- var SIcon = _xs["default"];
94
+ var SIcon = _m["default"];
95
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
96
  "title": hint
97
97
  }), /*#__PURE__*/_react["default"].createElement(SIcon, _ref5.cn("SIcon", {}))));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Card.tsx"],"names":["Card","SCard","Box","styles","asProps","Component","style","Title","props","hint","STitle","Text","SIcon","InfoXS","Description","SDescription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AAEA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;IAWMA,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,cAAd;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,sBAMbH,IANa,EAMP;AACNO,EAAAA,KAAK,EAALA,KADM;AAENO,EAAAA,WAAW,EAAXA;AAFM,CANO,C","sourcesContent":["import React, { ComponentProps, HTMLAttributes } from 'react';\nimport createComponent, { Component, Merge, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { ITextProps, Text } from '@semcore/typography';\n// eslint-disable-next-line import/no-named-as-default\nimport Tooltip from '@semcore/tooltip';\nimport InfoXS from '@semcore/icon/lib/Info/xs';\n\nimport style from './style/card.shadow.css';\n\nexport interface ITitleProps extends ITextProps {\n /**\n * Tooltip text\n */\n hint?: React.ReactNode;\n}\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 = InfoXS;\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<\n ComponentProps<typeof Box>,\n {\n Title: Merge<ITitleProps, HTMLAttributes<HTMLSpanElement>>;\n Description: ComponentProps<typeof Text>;\n }\n>(Card, {\n Title,\n Description,\n});\n"],"file":"Card.js"}
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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx"],"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"}
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
@@ -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'; // eslint-disable-next-line import/no-named-as-default
24
-
23
+ import { Text } from '@semcore/typography';
25
24
  import Tooltip from '@semcore/tooltip';
26
- import InfoXS from '@semcore/icon/lib/Info/xs';
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
- ".___SCard_30o7x_gg_{border:1px solid #ccc;border-radius:2px;padding:20px 24px 24px}.___STitle_30o7x_gg_{font-size:19px;font-weight:500}.___SIcon_30o7x_gg_{margin-left:4px;color:#a6b0b3;cursor:help}.___SDescription_30o7x_gg_{margin-bottom:12px;font-size:14px;color:#757575}"
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}"
34
33
  /*__inner_css_end__*/
35
34
  , "3hx1s_gg_")
36
35
  /*__reshadow_css_end__*/
37
36
  , {
38
- "__SCard": "___SCard_30o7x_gg_",
39
- "__STitle": "___STitle_30o7x_gg_",
40
- "__SIcon": "___SIcon_30o7x_gg_",
41
- "__SDescription": "___SDescription_30o7x_gg_"
37
+ "__SCard": "___SCard_19clt_gg_",
38
+ "__STitle": "___STitle_19clt_gg_",
39
+ "__SIcon": "___SIcon_19clt_gg_",
40
+ "__SDescription": "___SDescription_19clt_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 = InfoXS;
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", {}))));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Card.tsx"],"names":["React","createComponent","Component","sstyled","Root","Box","Text","Tooltip","InfoXS","Card","SCard","styles","asProps","style","Title","props","hint","STitle","SIcon","Description","SDescription"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAsD,OAAtD;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAA4CC,OAA5C,EAAqDC,IAArD,QAAiE,eAAjE;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,SAAqBC,IAArB,QAAiC,qBAAjC,C,CACA;;AACA,OAAOC,OAAP,MAAoB,kBAApB;AACA,OAAOC,MAAP,MAAmB,2BAAnB;;;;;;;;;;;;;;;;;;IAWMC,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,MAAd;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,CAM5BQ,IAN4B,EAMtB;AACNK,EAAAA,KAAK,EAALA,KADM;AAENK,EAAAA,WAAW,EAAXA;AAFM,CANsB,CAA9B","sourcesContent":["import React, { ComponentProps, HTMLAttributes } from 'react';\nimport createComponent, { Component, Merge, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { ITextProps, Text } from '@semcore/typography';\n// eslint-disable-next-line import/no-named-as-default\nimport Tooltip from '@semcore/tooltip';\nimport InfoXS from '@semcore/icon/lib/Info/xs';\n\nimport style from './style/card.shadow.css';\n\nexport interface ITitleProps extends ITextProps {\n /**\n * Tooltip text\n */\n hint?: React.ReactNode;\n}\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 = InfoXS;\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<\n ComponentProps<typeof Box>,\n {\n Title: Merge<ITitleProps, HTMLAttributes<HTMLSpanElement>>;\n Description: ComponentProps<typeof Text>;\n }\n>(Card, {\n Title,\n Description,\n});\n"],"file":"Card.js"}
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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,QAAwB,QAAxB;AACA,cAAc,QAAd","sourcesContent":["export { default } from './Card';\nexport * from './Card';\n"],"file":"index.js"}
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"}
@@ -1,2 +1,18 @@
1
- export { default } from './Card';
2
- export * from './Card';
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.2.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",
@@ -9,7 +9,7 @@
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": {
@@ -17,7 +17,7 @@
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",
@@ -1,20 +1,12 @@
1
- import React, { ComponentProps, HTMLAttributes } from 'react';
2
- import createComponent, { Component, Merge, sstyled, Root } from '@semcore/core';
1
+ import React from 'react';
2
+ import createComponent, { Component, sstyled, Root } from '@semcore/core';
3
3
  import { Box } from '@semcore/flex-box';
4
- import { ITextProps, Text } from '@semcore/typography';
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 InfoXS from '@semcore/icon/lib/Info/xs';
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 = InfoXS;
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
@@ -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;