@semcore/card 16.0.0-prerelease.4 → 16.0.0-prerelease.7
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/lib/esm/Card.mjs +76 -63
- package/lib/esm/index.mjs +2 -2
- package/package.json +7 -7
package/lib/esm/Card.mjs
CHANGED
|
@@ -1,83 +1,96 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { sstyled
|
|
8
|
-
import
|
|
9
|
-
import { Box
|
|
10
|
-
import { Text
|
|
11
|
-
import { ButtonLink
|
|
12
|
-
import { DescriptionTooltip
|
|
13
|
-
import
|
|
14
|
-
import { isAdvanceMode
|
|
15
|
-
var
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
+
import { sstyled, createComponent, assignProps, Component } from "@semcore/core";
|
|
8
|
+
import React from "react";
|
|
9
|
+
import { Box } from "@semcore/flex-box";
|
|
10
|
+
import { Text } from "@semcore/typography";
|
|
11
|
+
import { ButtonLink } from "@semcore/button";
|
|
12
|
+
import { DescriptionTooltip } from "@semcore/tooltip";
|
|
13
|
+
import InfoM from "@semcore/icon/Info/m";
|
|
14
|
+
import { isAdvanceMode } from "@semcore/core/lib/utils/findComponent";
|
|
15
|
+
var style = (
|
|
16
16
|
/*__reshadow_css_start__*/
|
|
17
|
-
(
|
|
17
|
+
(sstyled.insert(
|
|
18
18
|
/*__inner_css_start__*/
|
|
19
|
-
|
|
20
|
-
0px 0px 1px 0px rgba(25, 27, 35, 0.16), 0px 1px 2px 0px rgba(25, 27, 35, 0.12)
|
|
21
|
-
)}.___SCard_g5vnw_gg_ .___STitle_g5vnw_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);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SCard_g5vnw_gg_ [data-ui-name="DescriptionTooltip.Trigger"]{margin-right:var(--intergalactic-spacing-1x, 4px);line-height:normal;vertical-align:top;margin-top:calc(var(--intergalactic-spacing-1x, 4px)/2)}.___SDescription_g5vnw_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_g5vnw_gg_,.___SHeader_g5vnw_gg_{padding-left:var(--intergalactic-spacing-5x, 20px);padding-right:var(--intergalactic-spacing-5x, 20px)}.___SHeader_g5vnw_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_g5vnw_gg_{color:var(--intergalactic-text-primary, #191b23);padding-bottom:var(--intergalactic-spacing-5x, 20px);padding-top:var(--intergalactic-spacing-5x, 20px)}`,
|
|
19
|
+
'.___SCard_g5vnw_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 )}.___SCard_g5vnw_gg_ .___STitle_g5vnw_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);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SCard_g5vnw_gg_ [data-ui-name="DescriptionTooltip.Trigger"]{margin-right:var(--intergalactic-spacing-1x, 4px);line-height:normal;vertical-align:top;margin-top:calc(var(--intergalactic-spacing-1x, 4px)/2)}.___SDescription_g5vnw_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_g5vnw_gg_,.___SHeader_g5vnw_gg_{padding-left:var(--intergalactic-spacing-5x, 20px);padding-right:var(--intergalactic-spacing-5x, 20px)}.___SHeader_g5vnw_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_g5vnw_gg_{color:var(--intergalactic-text-primary, #191b23);padding-bottom:var(--intergalactic-spacing-5x, 20px);padding-top:var(--intergalactic-spacing-5x, 20px)}',
|
|
22
20
|
"g5vnw_gg_"
|
|
23
21
|
), {
|
|
24
|
-
__SDescription: "___SDescription_g5vnw_gg_",
|
|
25
|
-
__SHeader: "___SHeader_g5vnw_gg_",
|
|
26
|
-
__SBody: "___SBody_g5vnw_gg_",
|
|
27
|
-
__SCard: "___SCard_g5vnw_gg_",
|
|
28
|
-
__STitle: "___STitle_g5vnw_gg_"
|
|
22
|
+
"__SDescription": "___SDescription_g5vnw_gg_",
|
|
23
|
+
"__SHeader": "___SHeader_g5vnw_gg_",
|
|
24
|
+
"__SBody": "___SBody_g5vnw_gg_",
|
|
25
|
+
"__SCard": "___SCard_g5vnw_gg_",
|
|
26
|
+
"__STitle": "___STitle_g5vnw_gg_"
|
|
29
27
|
})
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
);
|
|
29
|
+
var CardRoot = /* @__PURE__ */ function(_Component) {
|
|
30
|
+
_inherits(CardRoot2, _Component);
|
|
31
|
+
var _super = _createSuper(CardRoot2);
|
|
32
|
+
function CardRoot2() {
|
|
33
|
+
_classCallCheck(this, CardRoot2);
|
|
34
|
+
return _super.apply(this, arguments);
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
_createClass(CardRoot2, [{
|
|
37
37
|
key: "render",
|
|
38
|
-
value: function() {
|
|
39
|
-
var
|
|
40
|
-
|
|
38
|
+
value: function render() {
|
|
39
|
+
var _ref = this.asProps, _ref6;
|
|
40
|
+
var SCard = Box;
|
|
41
|
+
var _this$asProps = this.asProps, Children = _this$asProps.Children, styles = _this$asProps.styles, forcedAdvancedMode = _this$asProps.forcedAdvancedMode;
|
|
42
|
+
var advancedMode = forcedAdvancedMode || isAdvanceMode(Children, [Card.Header.displayName, Card.Body.displayName]);
|
|
43
|
+
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SCard, _ref6.cn("SCard", _objectSpread({}, assignProps({}, _ref))), advancedMode ? /* @__PURE__ */ React.createElement(Children, _ref6.cn("Children", {})) : /* @__PURE__ */ React.createElement(Card.Body, null, /* @__PURE__ */ React.createElement(Children, _ref6.cn("Children", {}))));
|
|
41
44
|
}
|
|
42
|
-
}])
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
}]);
|
|
46
|
+
return CardRoot2;
|
|
47
|
+
}(Component);
|
|
48
|
+
_defineProperty(CardRoot, "displayName", "Card");
|
|
49
|
+
_defineProperty(CardRoot, "style", style);
|
|
50
|
+
function Title(props) {
|
|
51
|
+
var _ref2 = arguments[0], _ref7;
|
|
52
|
+
var styles = props.styles, innerHint = props.innerHint, Children = props.Children, innerHintAriaLabel = props.innerHintAriaLabel, hintAfterAriaLabel = props.hintAfterAriaLabel;
|
|
53
|
+
var hintAfter = props.hintAfter || props.hint;
|
|
54
|
+
var STitle = Text;
|
|
55
|
+
return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(STitle, _ref7.cn("STitle", _objectSpread({}, assignProps({}, _ref2))), /* @__PURE__ */ React.createElement(Children, _ref7.cn("Children", {})), innerHint && /* @__PURE__ */ React.createElement(DescriptionTooltip, _ref7.cn("DescriptionTooltip", {}), /* @__PURE__ */ React.createElement(DescriptionTooltip.Trigger, {
|
|
56
|
+
tag: ButtonLink,
|
|
50
57
|
ml: 1,
|
|
51
58
|
use: "secondary",
|
|
52
|
-
"aria-label":
|
|
59
|
+
"aria-label": innerHintAriaLabel,
|
|
53
60
|
color: "--intergalactic-icon-secondary-neutral"
|
|
54
|
-
}, /* @__PURE__ */
|
|
55
|
-
tag:
|
|
61
|
+
}, /* @__PURE__ */ React.createElement(ButtonLink.Addon, null, /* @__PURE__ */ React.createElement(InfoM, _ref7.cn("InfoM", {})))), /* @__PURE__ */ React.createElement(DescriptionTooltip.Popper, null, innerHint))), hintAfter && /* @__PURE__ */ React.createElement(DescriptionTooltip, _ref7.cn("DescriptionTooltip", {}), /* @__PURE__ */ React.createElement(DescriptionTooltip.Trigger, {
|
|
62
|
+
tag: ButtonLink,
|
|
56
63
|
use: "secondary",
|
|
57
|
-
"aria-label":
|
|
64
|
+
"aria-label": hintAfterAriaLabel,
|
|
58
65
|
color: "--intergalactic-icon-secondary-neutral"
|
|
59
|
-
}, /* @__PURE__ */
|
|
66
|
+
}, /* @__PURE__ */ React.createElement(ButtonLink.Addon, null, /* @__PURE__ */ React.createElement(InfoM, _ref7.cn("InfoM", {})))), /* @__PURE__ */ React.createElement(DescriptionTooltip.Popper, null, hintAfter)));
|
|
60
67
|
}
|
|
61
|
-
function
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
},
|
|
68
|
+
function Description(props) {
|
|
69
|
+
var _ref3 = arguments[0], _ref8;
|
|
70
|
+
var styles = props.styles;
|
|
71
|
+
var SDescription = Text;
|
|
72
|
+
return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(SDescription, _ref8.cn("SDescription", _objectSpread({}, assignProps({
|
|
73
|
+
"tag": "p"
|
|
74
|
+
}, _ref3))));
|
|
66
75
|
}
|
|
67
|
-
function
|
|
68
|
-
var
|
|
69
|
-
|
|
76
|
+
function Header(props) {
|
|
77
|
+
var _ref4 = arguments[0], _ref9;
|
|
78
|
+
var styles = props.styles;
|
|
79
|
+
var SHeader = Box;
|
|
80
|
+
return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SHeader, _ref9.cn("SHeader", _objectSpread({}, assignProps(_objectSpread({}, props), _ref4))));
|
|
70
81
|
}
|
|
71
|
-
function
|
|
72
|
-
var
|
|
73
|
-
|
|
82
|
+
function Body(props) {
|
|
83
|
+
var _ref5 = arguments[0], _ref10;
|
|
84
|
+
var styles = props.styles;
|
|
85
|
+
var SBody = Box;
|
|
86
|
+
return _ref10 = sstyled(styles), /* @__PURE__ */ React.createElement(SBody, _ref10.cn("SBody", _objectSpread({}, assignProps(_objectSpread({}, props), _ref5))));
|
|
74
87
|
}
|
|
75
|
-
var
|
|
76
|
-
Title
|
|
77
|
-
Description
|
|
78
|
-
Header
|
|
79
|
-
Body
|
|
88
|
+
var Card = createComponent(CardRoot, {
|
|
89
|
+
Title,
|
|
90
|
+
Description,
|
|
91
|
+
Header,
|
|
92
|
+
Body
|
|
80
93
|
});
|
|
81
94
|
export {
|
|
82
|
-
|
|
95
|
+
Card as default
|
|
83
96
|
};
|
package/lib/esm/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/card",
|
|
3
3
|
"description": "Semrush Card Component",
|
|
4
|
-
"version": "16.0.0-prerelease.
|
|
4
|
+
"version": "16.0.0-prerelease.7",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/typography": "16.0.0-prerelease.
|
|
18
|
-
"@semcore/tooltip": "16.0.0-prerelease.
|
|
19
|
-
"@semcore/button": "16.0.0-prerelease.
|
|
20
|
-
"@semcore/icon": "16.0.0-prerelease.
|
|
21
|
-
"@semcore/flex-box": "16.0.0-prerelease.
|
|
17
|
+
"@semcore/typography": "16.0.0-prerelease.7",
|
|
18
|
+
"@semcore/tooltip": "16.0.0-prerelease.7",
|
|
19
|
+
"@semcore/button": "16.0.0-prerelease.7",
|
|
20
|
+
"@semcore/icon": "16.0.0-prerelease.7",
|
|
21
|
+
"@semcore/flex-box": "16.0.0-prerelease.7"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@semcore/base-components": "^16.0.0-prerelease.
|
|
24
|
+
"@semcore/base-components": "^16.0.0-prerelease.7"
|
|
25
25
|
},
|
|
26
26
|
"repository": {
|
|
27
27
|
"type": "git",
|