luna-one 3.1.565 → 3.1.566
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@import "../../../global-styles/terra.scss";
|
|
2
2
|
|
|
3
|
-
.ter-bounded-cards
|
|
3
|
+
.ter-bounded-cards,
|
|
4
|
+
.ter-ecommerce-cards {
|
|
4
5
|
padding: 0px calc((100% - 1280px) / 2);
|
|
5
6
|
margin: 0 auto;
|
|
6
7
|
display: grid;
|
|
@@ -15,7 +16,8 @@
|
|
|
15
16
|
grid-template-columns: repeat(1, 1fr);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
.ter-bounded-card
|
|
19
|
+
.ter-bounded-card,
|
|
20
|
+
.ter-ecommerce-cards {
|
|
19
21
|
width: 100%;
|
|
20
22
|
max-width: 252px;
|
|
21
23
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.19);
|
|
@@ -46,7 +48,8 @@
|
|
|
46
48
|
&--centered {
|
|
47
49
|
@media screen and (min-width: $breakpoint-sm){
|
|
48
50
|
justify-items: center;
|
|
49
|
-
.ter-bounded-cards
|
|
51
|
+
.ter-bounded-cards,
|
|
52
|
+
.ter-ecommerce-cards {
|
|
50
53
|
justify-content: center;
|
|
51
54
|
display: flex;
|
|
52
55
|
flex-wrap: wrap;
|
|
@@ -57,9 +60,9 @@
|
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
|
-
.ter-bounded-card
|
|
63
|
+
.ter-bounded-card,
|
|
64
|
+
.ter-ecommerce-card {
|
|
61
65
|
max-width: 350px;
|
|
62
|
-
// margin-bottom: 36px;
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
68
|
}
|
|
@@ -21,6 +21,8 @@ var _IconMiniBlocks = _interopRequireDefault(require("./IconMiniBlocks"));
|
|
|
21
21
|
|
|
22
22
|
var _UnboundedCards = _interopRequireDefault(require("./UnboundedCards"));
|
|
23
23
|
|
|
24
|
+
var _EcommerceCards = _interopRequireDefault(require("./EcommerceCards"));
|
|
25
|
+
|
|
24
26
|
var _Video = _interopRequireDefault(require("../Video/Video"));
|
|
25
27
|
|
|
26
28
|
var renderBlockListItems = function renderBlockListItems(content, motion, type) {
|
|
@@ -45,6 +47,12 @@ var renderBlockListItems = function renderBlockListItems(content, motion, type)
|
|
|
45
47
|
VideoComponent: _Video["default"]
|
|
46
48
|
});
|
|
47
49
|
|
|
50
|
+
case "ecommerce_cards":
|
|
51
|
+
return /*#__PURE__*/_react["default"].createElement(_EcommerceCards["default"], {
|
|
52
|
+
content: content,
|
|
53
|
+
motion: motion
|
|
54
|
+
});
|
|
55
|
+
|
|
48
56
|
case "icon_mini_blocks":
|
|
49
57
|
return /*#__PURE__*/_react["default"].createElement(_IconMiniBlocks["default"], {
|
|
50
58
|
content: content,
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
require("./BlockListItems.scss");
|
|
13
|
+
|
|
14
|
+
var _checkForExternalLink = _interopRequireDefault(require("../../utils/checkForExternalLink"));
|
|
15
|
+
|
|
16
|
+
var _terraOne = require("terra-one");
|
|
17
|
+
|
|
18
|
+
// Images Sizes here are the same when used in Carousel to preserve the 3:2 image ratio
|
|
19
|
+
var EcommerceCards = function EcommerceCards(_ref) {
|
|
20
|
+
var _content$cards, _content$cards2;
|
|
21
|
+
|
|
22
|
+
var content = _ref.content,
|
|
23
|
+
motion = _ref.motion;
|
|
24
|
+
var GatsbyImage = content === null || content === void 0 ? void 0 : content.GatsbyImage;
|
|
25
|
+
var nestedInTab = content === null || content === void 0 ? void 0 : content.tab;
|
|
26
|
+
|
|
27
|
+
var _ref2 = (content === null || content === void 0 ? void 0 : content.theme) || {},
|
|
28
|
+
backgroundColor = _ref2.backgroundColor,
|
|
29
|
+
color = _ref2.color; //if one or more cards has a productLabel, apply top margin to cards to correctly offset this label
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
var productLabelPresent = (content === null || content === void 0 ? void 0 : (_content$cards = content.cards) === null || _content$cards === void 0 ? void 0 : _content$cards.filter(function (card) {
|
|
33
|
+
return card === null || card === void 0 ? void 0 : card.cardLabel;
|
|
34
|
+
}).length) > 0 ? true : false;
|
|
35
|
+
|
|
36
|
+
var renderEcommerceCards = function renderEcommerceCards() {
|
|
37
|
+
if (content.cards && content.cards.length) {
|
|
38
|
+
return content.cards.map(function (card, index) {
|
|
39
|
+
var productPrice = card.productPrice,
|
|
40
|
+
cardLabel = card.cardLabel,
|
|
41
|
+
productPageLink = card.productPageLink,
|
|
42
|
+
trialLink = card.trialLink;
|
|
43
|
+
var cardContent = {
|
|
44
|
+
eyebrow: card === null || card === void 0 ? void 0 : card.eyebrow,
|
|
45
|
+
header: card === null || card === void 0 ? void 0 : card.header,
|
|
46
|
+
image: card === null || card === void 0 ? void 0 : card.image,
|
|
47
|
+
cardLink: card === null || card === void 0 ? void 0 : card.cardLink,
|
|
48
|
+
bgColor: !(card !== null && card !== void 0 && card.image) ? "grey" : "",
|
|
49
|
+
text: card === null || card === void 0 ? void 0 : card.text,
|
|
50
|
+
GatsbyImage: GatsbyImage,
|
|
51
|
+
Link: content === null || content === void 0 ? void 0 : content.Link,
|
|
52
|
+
cardLabel: cardLabel,
|
|
53
|
+
productPrice: productPrice,
|
|
54
|
+
productPageLink: productPageLink,
|
|
55
|
+
trialLink: trialLink,
|
|
56
|
+
hasTopMargin: productLabelPresent
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
if (cardContent !== null && cardContent !== void 0 && cardContent.cardLink) {
|
|
60
|
+
var _cardContent$cardLink;
|
|
61
|
+
|
|
62
|
+
cardContent.cardLink.external = (0, _checkForExternalLink["default"])(cardContent === null || cardContent === void 0 ? void 0 : (_cardContent$cardLink = cardContent.cardLink) === null || _cardContent$cardLink === void 0 ? void 0 : _cardContent$cardLink.url);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return /*#__PURE__*/_react["default"].createElement(_terraOne.EcommerceCard, {
|
|
66
|
+
key: index,
|
|
67
|
+
content: cardContent,
|
|
68
|
+
motion: motion ? motion : null
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return /*#__PURE__*/_react["default"].createElement("section", {
|
|
75
|
+
className: "ter-ecommerce-cards ter-ecommerce-cards--".concat(content === null || content === void 0 ? void 0 : (_content$cards2 = content.cards) === null || _content$cards2 === void 0 ? void 0 : _content$cards2.length, "-cards"),
|
|
76
|
+
style: {
|
|
77
|
+
background: nestedInTab ? "#fff" : backgroundColor,
|
|
78
|
+
color: color
|
|
79
|
+
}
|
|
80
|
+
}, renderEcommerceCards());
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
var _default = EcommerceCards;
|
|
84
|
+
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "luna-one",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.566",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "^17.0.2",
|
|
6
6
|
"react-dom": "^17.0.2",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react-scroll": "^1.8.7",
|
|
52
52
|
"react-slidedown": "^2.4.7",
|
|
53
53
|
"smoothscroll-polyfill": "^0.4.4",
|
|
54
|
-
"terra-one": "^3.0.
|
|
54
|
+
"terra-one": "^3.0.181"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"start": "start-storybook -p 9009 -s public",
|