@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.js
CHANGED
|
@@ -40922,24 +40922,28 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
40922
40922
|
var baseClasses = "grid grid-cols-12 items-center gap-y-4 sm:gap-x-4 grid-flow-row-dense";
|
|
40923
40923
|
var contentBaseClasses = function contentBaseClasses(_ref2) {
|
|
40924
40924
|
var src = _ref2.src,
|
|
40925
|
-
position = _ref2.position
|
|
40925
|
+
position = _ref2.position,
|
|
40926
|
+
isEmptyContent = _ref2.isEmptyContent;
|
|
40926
40927
|
return classnames("sm:col-span-6 col-span-12", {
|
|
40927
40928
|
"sm:col-start-1": src && position === POSITIONS.RIGHT.label,
|
|
40928
40929
|
"sm:col-span-8 sm:col-start-3": src && position === POSITIONS.BOTTOM.label,
|
|
40929
40930
|
"sm:col-span-12 sm:col-start-1 flex flex-col justify-center order-2": src && position === POSITIONS.TOP.label,
|
|
40930
40931
|
"sm:col-start-7": src && position === POSITIONS.LEFT.label,
|
|
40931
|
-
"flex flex-col justify-center sm:col-span-12": !src
|
|
40932
|
+
"flex flex-col justify-center sm:col-span-12": !src,
|
|
40933
|
+
hidden: isEmptyContent
|
|
40932
40934
|
});
|
|
40933
40935
|
};
|
|
40934
40936
|
var mediaBaseClasses = function mediaBaseClasses(_ref3) {
|
|
40935
40937
|
var src = _ref3.src,
|
|
40936
|
-
position = _ref3.position
|
|
40937
|
-
|
|
40938
|
-
|
|
40939
|
-
"sm:col-start-
|
|
40940
|
-
"sm:col-span-
|
|
40941
|
-
"sm:col-span-8 sm:col-start-3
|
|
40942
|
-
|
|
40938
|
+
position = _ref3.position,
|
|
40939
|
+
isEmptyContent = _ref3.isEmptyContent;
|
|
40940
|
+
return classnames("col-span-12 flex justify-center", {
|
|
40941
|
+
"sm:col-span-5 sm:col-start-1": src && position === POSITIONS.LEFT.label && !isEmptyContent,
|
|
40942
|
+
"sm:col-span-5 sm:col-start-8": src && position === POSITIONS.RIGHT.label && !isEmptyContent,
|
|
40943
|
+
"sm:col-span-5 sm:col-span-8 sm:col-start-3": src && position === POSITIONS.BOTTOM.label && !isEmptyContent,
|
|
40944
|
+
"sm:col-span-5 sm:col-span-8 sm:col-start-3 flex justify-center order-1": src && position === POSITIONS.TOP.label && !isEmptyContent,
|
|
40945
|
+
hidden: !src,
|
|
40946
|
+
"flex justify-center": isEmptyContent
|
|
40943
40947
|
});
|
|
40944
40948
|
};
|
|
40945
40949
|
var buttonBaseClasses = function buttonBaseClasses(_ref4) {
|
|
@@ -40956,50 +40960,21 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
40956
40960
|
"text-center": !src || position === POSITIONS.BOTTOM.label || position === POSITIONS.TOP.label
|
|
40957
40961
|
});
|
|
40958
40962
|
};
|
|
40959
|
-
|
|
40960
|
-
enableAnimation: enableAnimation,
|
|
40961
|
-
id: id,
|
|
40962
|
-
backgroundImage: mergeLeft({
|
|
40963
|
-
src: src
|
|
40964
|
-
}, design.backgroundImage),
|
|
40965
|
-
className: "flex items-center justify-between gap-x-2",
|
|
40966
|
-
design: mergeDesign(design.body, 24)
|
|
40967
|
-
}, /*#__PURE__*/React__default.createElement(ArrowButton, {
|
|
40968
|
-
isStart: true,
|
|
40969
|
-
Icon: ArrowLeftS$1,
|
|
40970
|
-
design: design.navigationButtons,
|
|
40971
|
-
isActive: activeIndex > 0,
|
|
40972
|
-
onClick: function onClick() {
|
|
40973
|
-
var _swiperRef$current;
|
|
40974
|
-
return (_swiperRef$current = swiperRef.current) === null || _swiperRef$current === void 0 ? void 0 : _swiperRef$current.slidePrev();
|
|
40975
|
-
}
|
|
40976
|
-
}), /*#__PURE__*/React__default.createElement(Swiper, {
|
|
40977
|
-
className: "ns-hero-with-slider",
|
|
40978
|
-
modules: [Pagination],
|
|
40979
|
-
pagination: {
|
|
40980
|
-
clickable: true
|
|
40981
|
-
},
|
|
40982
|
-
onSlideChange: function onSlideChange(swiper) {
|
|
40983
|
-
return setActiveIndex(swiper.activeIndex);
|
|
40984
|
-
},
|
|
40985
|
-
onSwiper: function onSwiper(swiper) {
|
|
40986
|
-
swiperRef.current = swiper;
|
|
40987
|
-
}
|
|
40988
|
-
}, slides.map(function (_ref6, index) {
|
|
40963
|
+
var renderHeroWithMedia = function renderHeroWithMedia(_ref6) {
|
|
40989
40964
|
var content = _ref6.content,
|
|
40990
40965
|
buttons = _ref6.buttons,
|
|
40991
40966
|
media = _ref6.media;
|
|
40992
|
-
|
|
40993
|
-
|
|
40994
|
-
key: getUniqueKey(content.title, index)
|
|
40995
|
-
}, /*#__PURE__*/React__default.createElement(StyledWrapper, {
|
|
40967
|
+
var isEmptyContent = !content.prefixTitle && !content.title && !content.description;
|
|
40968
|
+
return /*#__PURE__*/React__default.createElement(StyledWrapper, {
|
|
40996
40969
|
isRootWrapper: true,
|
|
40997
40970
|
className: classnames("neeto-site-block-wrapper", baseClasses),
|
|
40998
40971
|
design: {
|
|
40999
40972
|
paddingHorizontal: design.body.paddingHorizontal
|
|
41000
40973
|
}
|
|
41001
40974
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
41002
|
-
className: contentBaseClasses(_objectSpread({
|
|
40975
|
+
className: contentBaseClasses(_objectSpread({
|
|
40976
|
+
isEmptyContent: isEmptyContent
|
|
40977
|
+
}, media))
|
|
41003
40978
|
}, /*#__PURE__*/React__default.createElement(Typography$1, {
|
|
41004
40979
|
isTitle: true,
|
|
41005
40980
|
component: "h3",
|
|
@@ -41022,7 +40997,9 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
41022
40997
|
style: button.type === "primary" ? design.primaryButtons : design.secondaryButtons
|
|
41023
40998
|
}, button, otherProps));
|
|
41024
40999
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
41025
|
-
className: mediaBaseClasses(_objectSpread({}, media)
|
|
41000
|
+
className: mediaBaseClasses(_objectSpread(_objectSpread({}, media), {}, {
|
|
41001
|
+
isEmptyContent: isEmptyContent
|
|
41002
|
+
}))
|
|
41026
41003
|
}, /*#__PURE__*/React__default.createElement(Media, {
|
|
41027
41004
|
design: design.media,
|
|
41028
41005
|
isEmbedded: media.isEmbedded,
|
|
@@ -41031,7 +41008,49 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
41031
41008
|
className: classnames({
|
|
41032
41009
|
"slider-image": media.position !== POSITIONS.BOTTOM.label || media.position !== POSITIONS.TOP.label
|
|
41033
41010
|
})
|
|
41034
|
-
})))
|
|
41011
|
+
})));
|
|
41012
|
+
};
|
|
41013
|
+
return /*#__PURE__*/React__default.createElement(MotionWrapper, {
|
|
41014
|
+
enableAnimation: enableAnimation,
|
|
41015
|
+
id: id,
|
|
41016
|
+
backgroundImage: mergeLeft({
|
|
41017
|
+
src: src
|
|
41018
|
+
}, design.backgroundImage),
|
|
41019
|
+
className: "flex items-center justify-between gap-x-2",
|
|
41020
|
+
design: mergeDesign(design.body, 24)
|
|
41021
|
+
}, slides.length > 1 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ArrowButton, {
|
|
41022
|
+
isStart: true,
|
|
41023
|
+
Icon: ArrowLeftS$1,
|
|
41024
|
+
design: design.navigationButtons,
|
|
41025
|
+
isActive: activeIndex > 0,
|
|
41026
|
+
onClick: function onClick() {
|
|
41027
|
+
var _swiperRef$current;
|
|
41028
|
+
return (_swiperRef$current = swiperRef.current) === null || _swiperRef$current === void 0 ? void 0 : _swiperRef$current.slidePrev();
|
|
41029
|
+
}
|
|
41030
|
+
}), /*#__PURE__*/React__default.createElement(Swiper, {
|
|
41031
|
+
className: "ns-hero-with-slider",
|
|
41032
|
+
modules: [Pagination],
|
|
41033
|
+
pagination: {
|
|
41034
|
+
clickable: true
|
|
41035
|
+
},
|
|
41036
|
+
onSlideChange: function onSlideChange(swiper) {
|
|
41037
|
+
return setActiveIndex(swiper.activeIndex);
|
|
41038
|
+
},
|
|
41039
|
+
onSwiper: function onSwiper(swiper) {
|
|
41040
|
+
swiperRef.current = swiper;
|
|
41041
|
+
}
|
|
41042
|
+
}, slides.map(function (_ref7, index) {
|
|
41043
|
+
var content = _ref7.content,
|
|
41044
|
+
buttons = _ref7.buttons,
|
|
41045
|
+
media = _ref7.media;
|
|
41046
|
+
return /*#__PURE__*/React__default.createElement(SwiperSlide, {
|
|
41047
|
+
className: classnames("my-auto", className),
|
|
41048
|
+
key: getUniqueKey(content.title, index)
|
|
41049
|
+
}, renderHeroWithMedia({
|
|
41050
|
+
content: content,
|
|
41051
|
+
buttons: buttons,
|
|
41052
|
+
media: media
|
|
41053
|
+
}));
|
|
41035
41054
|
})), /*#__PURE__*/React__default.createElement(ArrowButton, {
|
|
41036
41055
|
Icon: ArrowRightS$1,
|
|
41037
41056
|
design: design.navigationButtons,
|
|
@@ -41040,6 +41059,10 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
41040
41059
|
var _swiperRef$current2;
|
|
41041
41060
|
return (_swiperRef$current2 = swiperRef.current) === null || _swiperRef$current2 === void 0 ? void 0 : _swiperRef$current2.slideNext();
|
|
41042
41061
|
}
|
|
41062
|
+
})) : renderHeroWithMedia(slides[0] || {
|
|
41063
|
+
content: {},
|
|
41064
|
+
buttons: [],
|
|
41065
|
+
media: {}
|
|
41043
41066
|
}));
|
|
41044
41067
|
};
|
|
41045
41068
|
|