@bigbinary/neeto-site-blocks 1.2.8 → 1.2.9
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/dist/index.cjs.js +69 -46
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +69 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -40968,24 +40968,28 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
40968
40968
|
var baseClasses = "grid grid-cols-12 items-center gap-y-4 sm:gap-x-4 grid-flow-row-dense";
|
|
40969
40969
|
var contentBaseClasses = function contentBaseClasses(_ref2) {
|
|
40970
40970
|
var src = _ref2.src,
|
|
40971
|
-
position = _ref2.position
|
|
40971
|
+
position = _ref2.position,
|
|
40972
|
+
isEmptyContent = _ref2.isEmptyContent;
|
|
40972
40973
|
return classnames("sm:col-span-6 col-span-12", {
|
|
40973
40974
|
"sm:col-start-1": src && position === POSITIONS.RIGHT.label,
|
|
40974
40975
|
"sm:col-span-8 sm:col-start-3": src && position === POSITIONS.BOTTOM.label,
|
|
40975
40976
|
"sm:col-span-12 sm:col-start-1 flex flex-col justify-center order-2": src && position === POSITIONS.TOP.label,
|
|
40976
40977
|
"sm:col-start-7": src && position === POSITIONS.LEFT.label,
|
|
40977
|
-
"flex flex-col justify-center sm:col-span-12": !src
|
|
40978
|
+
"flex flex-col justify-center sm:col-span-12": !src,
|
|
40979
|
+
hidden: isEmptyContent
|
|
40978
40980
|
});
|
|
40979
40981
|
};
|
|
40980
40982
|
var mediaBaseClasses = function mediaBaseClasses(_ref3) {
|
|
40981
40983
|
var src = _ref3.src,
|
|
40982
|
-
position = _ref3.position
|
|
40983
|
-
|
|
40984
|
-
|
|
40985
|
-
"sm:col-start-
|
|
40986
|
-
"sm:col-span-
|
|
40987
|
-
"sm:col-span-8 sm:col-start-3
|
|
40988
|
-
|
|
40984
|
+
position = _ref3.position,
|
|
40985
|
+
isEmptyContent = _ref3.isEmptyContent;
|
|
40986
|
+
return classnames("col-span-12 flex justify-center", {
|
|
40987
|
+
"sm:col-span-5 sm:col-start-1": src && position === POSITIONS.LEFT.label && !isEmptyContent,
|
|
40988
|
+
"sm:col-span-5 sm:col-start-8": src && position === POSITIONS.RIGHT.label && !isEmptyContent,
|
|
40989
|
+
"sm:col-span-5 sm:col-span-8 sm:col-start-3": src && position === POSITIONS.BOTTOM.label && !isEmptyContent,
|
|
40990
|
+
"sm:col-span-5 sm:col-span-8 sm:col-start-3 flex justify-center order-1": src && position === POSITIONS.TOP.label && !isEmptyContent,
|
|
40991
|
+
hidden: !src,
|
|
40992
|
+
"flex justify-center": isEmptyContent
|
|
40989
40993
|
});
|
|
40990
40994
|
};
|
|
40991
40995
|
var buttonBaseClasses = function buttonBaseClasses(_ref4) {
|
|
@@ -41002,50 +41006,21 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
41002
41006
|
"text-center": !src || position === POSITIONS.BOTTOM.label || position === POSITIONS.TOP.label
|
|
41003
41007
|
});
|
|
41004
41008
|
};
|
|
41005
|
-
|
|
41006
|
-
enableAnimation: enableAnimation,
|
|
41007
|
-
id: id,
|
|
41008
|
-
backgroundImage: mergeLeft({
|
|
41009
|
-
src: src
|
|
41010
|
-
}, design.backgroundImage),
|
|
41011
|
-
className: "flex items-center justify-between gap-x-2",
|
|
41012
|
-
design: mergeDesign(design.body, 24)
|
|
41013
|
-
}, /*#__PURE__*/React__default["default"].createElement(ArrowButton, {
|
|
41014
|
-
isStart: true,
|
|
41015
|
-
Icon: ArrowLeftS$1,
|
|
41016
|
-
design: design.navigationButtons,
|
|
41017
|
-
isActive: activeIndex > 0,
|
|
41018
|
-
onClick: function onClick() {
|
|
41019
|
-
var _swiperRef$current;
|
|
41020
|
-
return (_swiperRef$current = swiperRef.current) === null || _swiperRef$current === void 0 ? void 0 : _swiperRef$current.slidePrev();
|
|
41021
|
-
}
|
|
41022
|
-
}), /*#__PURE__*/React__default["default"].createElement(Swiper, {
|
|
41023
|
-
className: "ns-hero-with-slider",
|
|
41024
|
-
modules: [Pagination],
|
|
41025
|
-
pagination: {
|
|
41026
|
-
clickable: true
|
|
41027
|
-
},
|
|
41028
|
-
onSlideChange: function onSlideChange(swiper) {
|
|
41029
|
-
return setActiveIndex(swiper.activeIndex);
|
|
41030
|
-
},
|
|
41031
|
-
onSwiper: function onSwiper(swiper) {
|
|
41032
|
-
swiperRef.current = swiper;
|
|
41033
|
-
}
|
|
41034
|
-
}, slides.map(function (_ref6, index) {
|
|
41009
|
+
var renderHeroWithMedia = function renderHeroWithMedia(_ref6) {
|
|
41035
41010
|
var content = _ref6.content,
|
|
41036
41011
|
buttons = _ref6.buttons,
|
|
41037
41012
|
media = _ref6.media;
|
|
41038
|
-
|
|
41039
|
-
|
|
41040
|
-
key: getUniqueKey(content.title, index)
|
|
41041
|
-
}, /*#__PURE__*/React__default["default"].createElement(StyledWrapper, {
|
|
41013
|
+
var isEmptyContent = !content.prefixTitle && !content.title && !content.description;
|
|
41014
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledWrapper, {
|
|
41042
41015
|
isRootWrapper: true,
|
|
41043
41016
|
className: classnames("neeto-site-block-wrapper", baseClasses),
|
|
41044
41017
|
design: {
|
|
41045
41018
|
paddingHorizontal: design.body.paddingHorizontal
|
|
41046
41019
|
}
|
|
41047
41020
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
41048
|
-
className: contentBaseClasses(_objectSpread({
|
|
41021
|
+
className: contentBaseClasses(_objectSpread({
|
|
41022
|
+
isEmptyContent: isEmptyContent
|
|
41023
|
+
}, media))
|
|
41049
41024
|
}, /*#__PURE__*/React__default["default"].createElement(Typography$1, {
|
|
41050
41025
|
isTitle: true,
|
|
41051
41026
|
component: "h3",
|
|
@@ -41068,7 +41043,9 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
41068
41043
|
style: button.type === "primary" ? design.primaryButtons : design.secondaryButtons
|
|
41069
41044
|
}, button, otherProps));
|
|
41070
41045
|
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
41071
|
-
className: mediaBaseClasses(_objectSpread({}, media)
|
|
41046
|
+
className: mediaBaseClasses(_objectSpread(_objectSpread({}, media), {}, {
|
|
41047
|
+
isEmptyContent: isEmptyContent
|
|
41048
|
+
}))
|
|
41072
41049
|
}, /*#__PURE__*/React__default["default"].createElement(Media, {
|
|
41073
41050
|
design: design.media,
|
|
41074
41051
|
isEmbedded: media.isEmbedded,
|
|
@@ -41077,7 +41054,49 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
41077
41054
|
className: classnames({
|
|
41078
41055
|
"slider-image": media.position !== POSITIONS.BOTTOM.label || media.position !== POSITIONS.TOP.label
|
|
41079
41056
|
})
|
|
41080
|
-
})))
|
|
41057
|
+
})));
|
|
41058
|
+
};
|
|
41059
|
+
return /*#__PURE__*/React__default["default"].createElement(MotionWrapper, {
|
|
41060
|
+
enableAnimation: enableAnimation,
|
|
41061
|
+
id: id,
|
|
41062
|
+
backgroundImage: mergeLeft({
|
|
41063
|
+
src: src
|
|
41064
|
+
}, design.backgroundImage),
|
|
41065
|
+
className: "flex items-center justify-between gap-x-2",
|
|
41066
|
+
design: mergeDesign(design.body, 24)
|
|
41067
|
+
}, slides.length > 1 ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(ArrowButton, {
|
|
41068
|
+
isStart: true,
|
|
41069
|
+
Icon: ArrowLeftS$1,
|
|
41070
|
+
design: design.navigationButtons,
|
|
41071
|
+
isActive: activeIndex > 0,
|
|
41072
|
+
onClick: function onClick() {
|
|
41073
|
+
var _swiperRef$current;
|
|
41074
|
+
return (_swiperRef$current = swiperRef.current) === null || _swiperRef$current === void 0 ? void 0 : _swiperRef$current.slidePrev();
|
|
41075
|
+
}
|
|
41076
|
+
}), /*#__PURE__*/React__default["default"].createElement(Swiper, {
|
|
41077
|
+
className: "ns-hero-with-slider",
|
|
41078
|
+
modules: [Pagination],
|
|
41079
|
+
pagination: {
|
|
41080
|
+
clickable: true
|
|
41081
|
+
},
|
|
41082
|
+
onSlideChange: function onSlideChange(swiper) {
|
|
41083
|
+
return setActiveIndex(swiper.activeIndex);
|
|
41084
|
+
},
|
|
41085
|
+
onSwiper: function onSwiper(swiper) {
|
|
41086
|
+
swiperRef.current = swiper;
|
|
41087
|
+
}
|
|
41088
|
+
}, slides.map(function (_ref7, index) {
|
|
41089
|
+
var content = _ref7.content,
|
|
41090
|
+
buttons = _ref7.buttons,
|
|
41091
|
+
media = _ref7.media;
|
|
41092
|
+
return /*#__PURE__*/React__default["default"].createElement(SwiperSlide, {
|
|
41093
|
+
className: classnames("my-auto", className),
|
|
41094
|
+
key: getUniqueKey(content.title, index)
|
|
41095
|
+
}, renderHeroWithMedia({
|
|
41096
|
+
content: content,
|
|
41097
|
+
buttons: buttons,
|
|
41098
|
+
media: media
|
|
41099
|
+
}));
|
|
41081
41100
|
})), /*#__PURE__*/React__default["default"].createElement(ArrowButton, {
|
|
41082
41101
|
Icon: ArrowRightS$1,
|
|
41083
41102
|
design: design.navigationButtons,
|
|
@@ -41086,6 +41105,10 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
41086
41105
|
var _swiperRef$current2;
|
|
41087
41106
|
return (_swiperRef$current2 = swiperRef.current) === null || _swiperRef$current2 === void 0 ? void 0 : _swiperRef$current2.slideNext();
|
|
41088
41107
|
}
|
|
41108
|
+
})) : renderHeroWithMedia(slides[0] || {
|
|
41109
|
+
content: {},
|
|
41110
|
+
buttons: [],
|
|
41111
|
+
media: {}
|
|
41089
41112
|
}));
|
|
41090
41113
|
};
|
|
41091
41114
|
|