@semcore/card 5.34.1 → 5.35.0-prerelease.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 +6 -0
- package/lib/cjs/Card.js +17 -13
- package/lib/cjs/Card.js.map +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/es6/Card.js +17 -13
- package/lib/es6/Card.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/types/index.d.ts +5 -1
- package/package.json +2 -2
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
|
+
## [5.35.0] - 2024-06-06
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- `Tooltip` to `DescriptionTooltip` for hints in card title.
|
|
10
|
+
|
|
5
11
|
## [5.34.1] - 2024-05-28
|
|
6
12
|
|
|
7
13
|
### Changed
|
package/lib/cjs/Card.js
CHANGED
|
@@ -17,18 +17,18 @@ var _core = _interopRequireWildcard(require("@semcore/core"));
|
|
|
17
17
|
var _react = _interopRequireDefault(require("react"));
|
|
18
18
|
var _flexBox = require("@semcore/flex-box");
|
|
19
19
|
var _typography = require("@semcore/typography");
|
|
20
|
-
var _tooltip =
|
|
20
|
+
var _tooltip = require("@semcore/tooltip");
|
|
21
21
|
var _m = _interopRequireDefault(require("@semcore/icon/Info/m"));
|
|
22
22
|
var _findComponent = require("@semcore/utils/lib/findComponent");
|
|
23
23
|
/*__reshadow-styles__:"./style/card.shadow.css"*/
|
|
24
|
-
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".
|
|
25
|
-
"__SCard": "
|
|
26
|
-
"__STitle": "
|
|
27
|
-
"__SIcon": "
|
|
28
|
-
"__STooltip": "
|
|
29
|
-
"__SDescription": "
|
|
30
|
-
"__SHeader": "
|
|
31
|
-
"__SBody": "
|
|
24
|
+
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SCard_11l8s_gg_{box-sizing:border-box;background:var(--intergalactic-bg-primary-neutral, #ffffff);padding:0;border:0;border-radius:var(--intergalactic-surface-rounded, 6px);box-shadow:var(--intergalactic-box-shadow-card,\n 0px 0px 1px 0px rgba(25, 27, 35, 0.16), 0px 1px 2px 0px rgba(25, 27, 35, 0.12)\n )}.___SIcon_11l8s_gg_,.___STitle_11l8s_gg_{margin-right:var(--intergalactic-spacing-1x, 4px)}.___STitle_11l8s_gg_{color:var(--intergalactic-text-primary, #191b23);font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%);font-weight:var(--intergalactic-bold, 700)}.___SIcon_11l8s_gg_{color:var(--intergalactic-icon-secondary-neutral, #a9abb6);cursor:help}.___STooltip_11l8s_gg_{vertical-align:middle}.___SDescription_11l8s_gg_{margin-bottom:0;margin-top:var(--intergalactic-spacing-2x, 8px);font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-secondary, #6c6e79)}.___SBody_11l8s_gg_,.___SHeader_11l8s_gg_{padding-left:var(--intergalactic-spacing-5x, 20px);padding-right:var(--intergalactic-spacing-5x, 20px)}.___SHeader_11l8s_gg_{padding-top:var(--intergalactic-spacing-2x, 8px);padding-bottom:var(--intergalactic-spacing-2x, 8px);box-shadow:inset 0-1px 0 var(--intergalactic-border-secondary, #e0e1e9)}.___SBody_11l8s_gg_{color:var(--intergalactic-text-primary, #191b23);padding-bottom:var(--intergalactic-spacing-5x, 20px);padding-top:var(--intergalactic-spacing-5x, 20px)}" /*__inner_css_end__*/, "11l8s_gg_") /*__reshadow_css_end__*/, {
|
|
25
|
+
"__SCard": "___SCard_11l8s_gg_",
|
|
26
|
+
"__STitle": "___STitle_11l8s_gg_",
|
|
27
|
+
"__SIcon": "___SIcon_11l8s_gg_",
|
|
28
|
+
"__STooltip": "___STooltip_11l8s_gg_",
|
|
29
|
+
"__SDescription": "___SDescription_11l8s_gg_",
|
|
30
|
+
"__SHeader": "___SHeader_11l8s_gg_",
|
|
31
|
+
"__SBody": "___SBody_11l8s_gg_"
|
|
32
32
|
});
|
|
33
33
|
var CardRoot = /*#__PURE__*/function (_Component) {
|
|
34
34
|
(0, _inherits2["default"])(CardRoot, _Component);
|
|
@@ -60,18 +60,22 @@ function Title(props) {
|
|
|
60
60
|
_ref7;
|
|
61
61
|
var styles = props.styles,
|
|
62
62
|
innerHint = props.innerHint,
|
|
63
|
-
Children = props.Children
|
|
63
|
+
Children = props.Children,
|
|
64
|
+
innerHintAriaLabel = props.innerHintAriaLabel,
|
|
65
|
+
hintAfterAriaLabel = props.hintAfterAriaLabel;
|
|
64
66
|
var hintAfter = props.hintAfter || props.hint;
|
|
65
67
|
var STitle = _typography.Text;
|
|
66
68
|
var SIcon = _m["default"];
|
|
67
|
-
var STooltip = _tooltip
|
|
69
|
+
var STooltip = _tooltip.DescriptionTooltip;
|
|
68
70
|
return _ref7 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(STitle, _ref7.cn("STitle", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({}, _ref2))), /*#__PURE__*/_react["default"].createElement(Children, _ref7.cn("Children", {})), innerHint && /*#__PURE__*/_react["default"].createElement(STooltip, _ref7.cn("STooltip", {
|
|
69
71
|
"ml": 1,
|
|
70
|
-
"title": innerHint
|
|
72
|
+
"title": innerHint,
|
|
73
|
+
"aria-label": innerHintAriaLabel
|
|
71
74
|
}), /*#__PURE__*/_react["default"].createElement(SIcon, _ref7.cn("SIcon", {
|
|
72
75
|
"interactive": true
|
|
73
76
|
})))), hintAfter && /*#__PURE__*/_react["default"].createElement(STooltip, _ref7.cn("STooltip", {
|
|
74
|
-
"title": hintAfter
|
|
77
|
+
"title": hintAfter,
|
|
78
|
+
"aria-label": hintAfterAriaLabel
|
|
75
79
|
}), /*#__PURE__*/_react["default"].createElement(SIcon, _ref7.cn("SIcon", {
|
|
76
80
|
"interactive": true
|
|
77
81
|
}))));
|
package/lib/cjs/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_typography","_tooltip","_m","_findComponent","style","_index","sstyled","insert","CardRoot","_Component","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","render","_ref","asProps","_ref6","SCard","Box","_this$asProps","Children","styles","forcedAdvancedMode","advancedMode","isAdvanceMode","Card","Header","displayName","Body","createElement","cn","_objectSpread2","assignProps","Component","_defineProperty2","Title","props","_ref2","arguments[0]","_ref7","innerHint","hintAfter","hint","STitle","Text","SIcon","InfoM","STooltip","
|
|
1
|
+
{"version":3,"file":"Card.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_typography","_tooltip","_m","_findComponent","style","_index","sstyled","insert","CardRoot","_Component","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","render","_ref","asProps","_ref6","SCard","Box","_this$asProps","Children","styles","forcedAdvancedMode","advancedMode","isAdvanceMode","Card","Header","displayName","Body","createElement","cn","_objectSpread2","assignProps","Component","_defineProperty2","Title","props","_ref2","arguments[0]","_ref7","innerHint","innerHintAriaLabel","hintAfterAriaLabel","hintAfter","hint","STitle","Text","SIcon","InfoM","STooltip","DescriptionTooltip","Fragment","Description","_ref3","_ref8","SDescription","_ref4","_ref9","SHeader","_ref5","_ref10","SBody","createComponent","_default","exports"],"sources":["../../src/Card.jsx"],"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 { DescriptionTooltip } from '@semcore/tooltip';\nimport InfoM from '@semcore/icon/Info/m';\n\nimport style from './style/card.shadow.css';\nimport { isAdvanceMode } from '@semcore/utils/lib/findComponent';\n\nclass CardRoot extends Component {\n static displayName = 'Card';\n\n static style = style;\n\n render() {\n const SCard = Root;\n const { Children, styles, forcedAdvancedMode } = this.asProps;\n\n const advancedMode =\n forcedAdvancedMode ||\n isAdvanceMode(Children, [Card.Header.displayName, Card.Body.displayName]);\n\n return sstyled(styles)(\n <SCard render={Box}>\n {advancedMode ? (\n <Children />\n ) : (\n <Card.Body>\n <Children />\n </Card.Body>\n )}\n </SCard>,\n );\n }\n}\n\nfunction Title(props) {\n const { styles, innerHint, Children, innerHintAriaLabel, hintAfterAriaLabel } = props;\n const hintAfter = props.hintAfter || props.hint;\n const STitle = Root;\n const SIcon = InfoM;\n const STooltip = DescriptionTooltip;\n return sstyled(styles)(\n <>\n <STitle render={Text}>\n <Children />\n {innerHint && (\n <STooltip ml={1} title={innerHint} aria-label={innerHintAriaLabel}>\n <SIcon interactive />\n </STooltip>\n )}\n </STitle>\n {hintAfter && (\n <STooltip title={hintAfter} aria-label={hintAfterAriaLabel}>\n <SIcon interactive />\n </STooltip>\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\nfunction Header(props) {\n const { styles } = props;\n const SHeader = Root;\n return sstyled(styles)(<SHeader render={Box} {...props} />);\n}\n\nfunction Body(props) {\n const { styles } = props;\n const SBody = Root;\n return sstyled(styles)(<SBody render={Box} {...props} />);\n}\n\nconst Card = createComponent(CardRoot, {\n Title,\n Description,\n Header,\n Body,\n});\n\nexport default Card;\n"],"mappings":";;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,EAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAG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C2B3C,YAAG;EAAzC,OAAA0C,MAAA,GAAO,IAAA5D,aAAO,EAACqB,MAAM,CAAC,eAAC9B,MAAA,YAAAsC,aAAA,CAACgC,KAAK,EAAAD,MAAA,CAAA9B,EAAA,cAAAC,cAAA,qBAAA3C,KAAA,CAAA4C,WAAA,MAAAD,cAAA,iBAAkBK,KAAK,GAAAuB,KAAA,IAAI;AAC1D;AAEA,IAAMlC,IAAI,GAAG,IAAAqC,gBAAe,EAAC5D,QAAQ,EAAE;EACrCiC,KAAK,EAALA,KAAK;EACLiB,WAAW,EAAXA,WAAW;EACX1B,MAAM,EAANA,MAAM;EACNE,IAAI,EAAJA;AACF,CAAC,CAAC;AAAC,IAAAmC,QAAA,GAEYtC,IAAI;AAAAuC,OAAA,cAAAD,QAAA"}
|
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { Text, TextProps } from '@semcore/typography';\n\n/** @deprecated */\nexport interface ITitleProps extends TitleProps, UnknownProperties {}\nexport type TitleProps = TextProps & {\n /**\n * Content of the tooltip that is displayed when hovering over the info icon in the end of title.\n */\n innerHint?: React.ReactNode;\n /**\n * Content of the tooltip that is displayed when hovering over the info icon right after the title. Useful in case of using Title with Ellipsis.\n */\n hintAfter?: React.ReactNode;\n /**\n * Renamed to `hintAfter`\n * @deprecated\n */\n hint?: React.ReactNode;\n};\n\ndeclare const Card: Intergalactic.Component<'div', BoxProps> & {\n Title: Intergalactic.Component<'div', TitleProps>;\n Description: typeof Text;\n Header: typeof Box;\n Body: typeof Box;\n};\n\nexport default Card;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { Text, TextProps } from '@semcore/typography';\n\n/** @deprecated */\nexport interface ITitleProps extends TitleProps, UnknownProperties {}\nexport type TitleProps = TextProps & {\n /**\n * Content of the tooltip that is displayed when hovering over the info icon in the end of title. Use it if you don't need Title with Ellipsis.\n */\n innerHint?: React.ReactNode;\n /**\n * Content of the tooltip that is displayed when hovering over the info icon right after the title. Useful in case of using Title with Ellipsis.\n */\n hintAfter?: React.ReactNode;\n /**\n * Renamed to `hintAfter`\n * @deprecated\n */\n hint?: React.ReactNode;\n /** Aria-label for the InnerHint icon */\n innerHintAriaLabel?: string;\n /** Aria-label for the HintAfter icon */\n hintAfterAriaLabel?: string;\n};\n\ndeclare const Card: Intergalactic.Component<'div', BoxProps> & {\n Title: Intergalactic.Component<'div', TitleProps>;\n Description: typeof Text;\n Header: typeof Box;\n Body: typeof Box;\n};\n\nexport default Card;\n"],"mappings":""}
|
package/lib/es6/Card.js
CHANGED
|
@@ -14,17 +14,17 @@ import React from 'react';
|
|
|
14
14
|
import createComponent, { Component, sstyled, Root } from '@semcore/core';
|
|
15
15
|
import { Box } from '@semcore/flex-box';
|
|
16
16
|
import { Text } from '@semcore/typography';
|
|
17
|
-
import
|
|
17
|
+
import { DescriptionTooltip } from '@semcore/tooltip';
|
|
18
18
|
import InfoM from '@semcore/icon/Info/m';
|
|
19
19
|
/*__reshadow-styles__:"./style/card.shadow.css"*/
|
|
20
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
21
|
-
"__SCard": "
|
|
22
|
-
"__STitle": "
|
|
23
|
-
"__SIcon": "
|
|
24
|
-
"__STooltip": "
|
|
25
|
-
"__SDescription": "
|
|
26
|
-
"__SHeader": "
|
|
27
|
-
"__SBody": "
|
|
20
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SCard_11l8s_gg_{box-sizing:border-box;background:var(--intergalactic-bg-primary-neutral, #ffffff);padding:0;border:0;border-radius:var(--intergalactic-surface-rounded, 6px);box-shadow:var(--intergalactic-box-shadow-card,\n 0px 0px 1px 0px rgba(25, 27, 35, 0.16), 0px 1px 2px 0px rgba(25, 27, 35, 0.12)\n )}.___SIcon_11l8s_gg_,.___STitle_11l8s_gg_{margin-right:var(--intergalactic-spacing-1x, 4px)}.___STitle_11l8s_gg_{color:var(--intergalactic-text-primary, #191b23);font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%);font-weight:var(--intergalactic-bold, 700)}.___SIcon_11l8s_gg_{color:var(--intergalactic-icon-secondary-neutral, #a9abb6);cursor:help}.___STooltip_11l8s_gg_{vertical-align:middle}.___SDescription_11l8s_gg_{margin-bottom:0;margin-top:var(--intergalactic-spacing-2x, 8px);font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-secondary, #6c6e79)}.___SBody_11l8s_gg_,.___SHeader_11l8s_gg_{padding-left:var(--intergalactic-spacing-5x, 20px);padding-right:var(--intergalactic-spacing-5x, 20px)}.___SHeader_11l8s_gg_{padding-top:var(--intergalactic-spacing-2x, 8px);padding-bottom:var(--intergalactic-spacing-2x, 8px);box-shadow:inset 0-1px 0 var(--intergalactic-border-secondary, #e0e1e9)}.___SBody_11l8s_gg_{color:var(--intergalactic-text-primary, #191b23);padding-bottom:var(--intergalactic-spacing-5x, 20px);padding-top:var(--intergalactic-spacing-5x, 20px)}" /*__inner_css_end__*/, "11l8s_gg_") /*__reshadow_css_end__*/, {
|
|
21
|
+
"__SCard": "___SCard_11l8s_gg_",
|
|
22
|
+
"__STitle": "___STitle_11l8s_gg_",
|
|
23
|
+
"__SIcon": "___SIcon_11l8s_gg_",
|
|
24
|
+
"__STooltip": "___STooltip_11l8s_gg_",
|
|
25
|
+
"__SDescription": "___SDescription_11l8s_gg_",
|
|
26
|
+
"__SHeader": "___SHeader_11l8s_gg_",
|
|
27
|
+
"__SBody": "___SBody_11l8s_gg_"
|
|
28
28
|
});
|
|
29
29
|
import { isAdvanceMode } from '@semcore/utils/lib/findComponent';
|
|
30
30
|
var CardRoot = /*#__PURE__*/function (_Component) {
|
|
@@ -57,18 +57,22 @@ function Title(props) {
|
|
|
57
57
|
_ref7;
|
|
58
58
|
var styles = props.styles,
|
|
59
59
|
innerHint = props.innerHint,
|
|
60
|
-
Children = props.Children
|
|
60
|
+
Children = props.Children,
|
|
61
|
+
innerHintAriaLabel = props.innerHintAriaLabel,
|
|
62
|
+
hintAfterAriaLabel = props.hintAfterAriaLabel;
|
|
61
63
|
var hintAfter = props.hintAfter || props.hint;
|
|
62
64
|
var STitle = Text;
|
|
63
65
|
var SIcon = InfoM;
|
|
64
|
-
var STooltip =
|
|
66
|
+
var STooltip = DescriptionTooltip;
|
|
65
67
|
return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(STitle, _ref7.cn("STitle", _objectSpread({}, _assignProps2({}, _ref2))), /*#__PURE__*/React.createElement(Children, _ref7.cn("Children", {})), innerHint && /*#__PURE__*/React.createElement(STooltip, _ref7.cn("STooltip", {
|
|
66
68
|
"ml": 1,
|
|
67
|
-
"title": innerHint
|
|
69
|
+
"title": innerHint,
|
|
70
|
+
"aria-label": innerHintAriaLabel
|
|
68
71
|
}), /*#__PURE__*/React.createElement(SIcon, _ref7.cn("SIcon", {
|
|
69
72
|
"interactive": true
|
|
70
73
|
})))), hintAfter && /*#__PURE__*/React.createElement(STooltip, _ref7.cn("STooltip", {
|
|
71
|
-
"title": hintAfter
|
|
74
|
+
"title": hintAfter,
|
|
75
|
+
"aria-label": hintAfterAriaLabel
|
|
72
76
|
}), /*#__PURE__*/React.createElement(SIcon, _ref7.cn("SIcon", {
|
|
73
77
|
"interactive": true
|
|
74
78
|
}))));
|
package/lib/es6/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","names":["React","createComponent","Component","sstyled","Root","Box","Text","
|
|
1
|
+
{"version":3,"file":"Card.js","names":["React","createComponent","Component","sstyled","Root","Box","Text","DescriptionTooltip","InfoM","style","_sstyled","insert","isAdvanceMode","CardRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","render","_ref","asProps","_ref6","SCard","_this$asProps","Children","styles","forcedAdvancedMode","advancedMode","Card","Header","displayName","Body","createElement","cn","_objectSpread","_assignProps","_defineProperty","Title","props","_ref2","arguments[0]","_ref7","innerHint","innerHintAriaLabel","hintAfterAriaLabel","hintAfter","hint","STitle","SIcon","STooltip","Fragment","_assignProps2","Description","_ref3","_ref8","SDescription","_assignProps3","_ref4","_ref9","SHeader","_assignProps4","_ref5","_ref10","SBody","_assignProps5"],"sources":["../../src/Card.jsx"],"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 { DescriptionTooltip } from '@semcore/tooltip';\nimport InfoM from '@semcore/icon/Info/m';\n\nimport style from './style/card.shadow.css';\nimport { isAdvanceMode } from '@semcore/utils/lib/findComponent';\n\nclass CardRoot extends Component {\n static displayName = 'Card';\n\n static style = style;\n\n render() {\n const SCard = Root;\n const { Children, styles, forcedAdvancedMode } = this.asProps;\n\n const advancedMode =\n forcedAdvancedMode ||\n isAdvanceMode(Children, [Card.Header.displayName, Card.Body.displayName]);\n\n return sstyled(styles)(\n <SCard render={Box}>\n {advancedMode ? (\n <Children />\n ) : (\n <Card.Body>\n <Children />\n </Card.Body>\n )}\n </SCard>,\n );\n }\n}\n\nfunction Title(props) {\n const { styles, innerHint, Children, innerHintAriaLabel, hintAfterAriaLabel } = props;\n const hintAfter = props.hintAfter || props.hint;\n const STitle = Root;\n const SIcon = InfoM;\n const STooltip = DescriptionTooltip;\n return sstyled(styles)(\n <>\n <STitle render={Text}>\n <Children />\n {innerHint && (\n <STooltip ml={1} title={innerHint} aria-label={innerHintAriaLabel}>\n <SIcon interactive />\n </STooltip>\n )}\n </STitle>\n {hintAfter && (\n <STooltip title={hintAfter} aria-label={hintAfterAriaLabel}>\n <SIcon interactive />\n </STooltip>\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\nfunction Header(props) {\n const { styles } = props;\n const SHeader = Root;\n return sstyled(styles)(<SHeader render={Box} {...props} />);\n}\n\nfunction Body(props) {\n const { styles } = props;\n const SBody = Root;\n return sstyled(styles)(<SBody render={Box} {...props} />);\n}\n\nconst Card = createComponent(CardRoot, {\n Title,\n Description,\n Header,\n Body,\n});\n\nexport default Card;\n"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,GAAG,QAAQ,mBAAmB;AACvC,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,OAAOC,KAAK,MAAM,sBAAsB;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAGzC,SAASC,aAAa,QAAQ,kCAAkC;AAAC,IAE3DC,QAAQ,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,QAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,QAAA;EAAA,SAAAA,SAAA;IAAAK,eAAA,OAAAL,QAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,QAAA;IAAAS,GAAA;IAAAC,KAAA,EAKZ,SAAAC,OAAA,EAAS;MAAA,IAAAC,IAAA,QAAAC,OAAA;QAAAC,KAAA;MACP,IAAMC,KAAK,GAQMvB,GAAG;MAPpB,IAAAwB,aAAA,GAAiD,IAAI,CAACH,OAAO;QAArDI,QAAQ,GA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,KAAK,EAAE;EAAA,IAAAmB,KAAA,GAAAjB,YAAA;IAAAkB,KAAA;EACrB,IAAQjC,MAAM,GAAKa,KAAK,CAAhBb,MAAM;EACd,IAAMkC,OAAO,GAC2B5D,GAAG;EAA3C,OAAA2D,KAAA,GAAO7D,OAAO,CAAC4B,MAAM,CAAC,eAAC/B,KAAA,CAAAsC,aAAA,CAAC2B,OAAO,EAAAD,KAAA,CAAAzB,EAAA,YAAAC,aAAA,KAAA0B,aAAA,CAAA1B,aAAA,KAAkBI,KAAK,GAAAmB,KAAA,IAAI;AAC5D;AAEA,SAAS1B,IAAIA,CAACO,KAAK,EAAE;EAAA,IAAAuB,KAAA,GAAArB,YAAA;IAAAsB,MAAA;EACnB,IAAQrC,MAAM,GAAKa,KAAK,CAAhBb,MAAM;EACd,IAAMsC,KAAK,GAC2BhE,GAAG;EAAzC,OAAA+D,MAAA,GAAOjE,OAAO,CAAC4B,MAAM,CAAC,eAAC/B,KAAA,CAAAsC,aAAA,CAAC+B,KAAK,EAAAD,MAAA,CAAA7B,EAAA,UAAAC,aAAA,KAAA8B,aAAA,CAAA9B,aAAA,KAAkBI,KAAK,GAAAuB,KAAA,IAAI;AAC1D;AAEA,IAAMjC,IAAI,GAAGjC,eAAe,CAACY,QAAQ,EAAE;EACrC8B,KAAK,EAALA,KAAK;EACLe,WAAW,EAAXA,WAAW;EACXvB,MAAM,EAANA,MAAM;EACNE,IAAI,EAAJA;AACF,CAAC,CAAC;AAEF,eAAeH,IAAI"}
|
package/lib/es6/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { Text, TextProps } from '@semcore/typography';\n\n/** @deprecated */\nexport interface ITitleProps extends TitleProps, UnknownProperties {}\nexport type TitleProps = TextProps & {\n /**\n * Content of the tooltip that is displayed when hovering over the info icon in the end of title.\n */\n innerHint?: React.ReactNode;\n /**\n * Content of the tooltip that is displayed when hovering over the info icon right after the title. Useful in case of using Title with Ellipsis.\n */\n hintAfter?: React.ReactNode;\n /**\n * Renamed to `hintAfter`\n * @deprecated\n */\n hint?: React.ReactNode;\n};\n\ndeclare const Card: Intergalactic.Component<'div', BoxProps> & {\n Title: Intergalactic.Component<'div', TitleProps>;\n Description: typeof Text;\n Header: typeof Box;\n Body: typeof Box;\n};\n\nexport default Card;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { UnknownProperties, Intergalactic } from '@semcore/core';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { Text, TextProps } from '@semcore/typography';\n\n/** @deprecated */\nexport interface ITitleProps extends TitleProps, UnknownProperties {}\nexport type TitleProps = TextProps & {\n /**\n * Content of the tooltip that is displayed when hovering over the info icon in the end of title. Use it if you don't need Title with Ellipsis.\n */\n innerHint?: React.ReactNode;\n /**\n * Content of the tooltip that is displayed when hovering over the info icon right after the title. Useful in case of using Title with Ellipsis.\n */\n hintAfter?: React.ReactNode;\n /**\n * Renamed to `hintAfter`\n * @deprecated\n */\n hint?: React.ReactNode;\n /** Aria-label for the InnerHint icon */\n innerHintAriaLabel?: string;\n /** Aria-label for the HintAfter icon */\n hintAfterAriaLabel?: string;\n};\n\ndeclare const Card: Intergalactic.Component<'div', BoxProps> & {\n Title: Intergalactic.Component<'div', TitleProps>;\n Description: typeof Text;\n Header: typeof Box;\n Body: typeof Box;\n};\n\nexport default Card;\n"],"mappings":""}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { Text, TextProps } from '@semcore/typography';
|
|
|
7
7
|
export interface ITitleProps extends TitleProps, UnknownProperties {}
|
|
8
8
|
export type TitleProps = TextProps & {
|
|
9
9
|
/**
|
|
10
|
-
* Content of the tooltip that is displayed when hovering over the info icon in the end of title.
|
|
10
|
+
* Content of the tooltip that is displayed when hovering over the info icon in the end of title. Use it if you don't need Title with Ellipsis.
|
|
11
11
|
*/
|
|
12
12
|
innerHint?: React.ReactNode;
|
|
13
13
|
/**
|
|
@@ -19,6 +19,10 @@ export type TitleProps = TextProps & {
|
|
|
19
19
|
* @deprecated
|
|
20
20
|
*/
|
|
21
21
|
hint?: React.ReactNode;
|
|
22
|
+
/** Aria-label for the InnerHint icon */
|
|
23
|
+
innerHintAriaLabel?: string;
|
|
24
|
+
/** Aria-label for the HintAfter icon */
|
|
25
|
+
hintAfterAriaLabel?: string;
|
|
22
26
|
};
|
|
23
27
|
|
|
24
28
|
declare const Card: Intergalactic.Component<'div', BoxProps> & {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/card",
|
|
3
3
|
"description": "Semrush Card Component",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.35.0-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@semcore/utils": "4.28.1",
|
|
13
13
|
"@semcore/flex-box": "5.27.1",
|
|
14
14
|
"@semcore/typography": "5.35.1",
|
|
15
|
-
"@semcore/tooltip": "6.34.0",
|
|
15
|
+
"@semcore/tooltip": "6.34.3-prerelease.0",
|
|
16
16
|
"@semcore/icon": "4.36.1"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|