@bigbinary/neeto-site-blocks 1.2.8 → 1.2.10
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 +98 -60
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +98 -60
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -92,7 +92,9 @@ var ArrowButton = function ArrowButton(_ref) {
|
|
|
92
92
|
isStart = _ref.isStart,
|
|
93
93
|
onClick = _ref.onClick,
|
|
94
94
|
isActive = _ref.isActive,
|
|
95
|
-
design = _ref.design
|
|
95
|
+
design = _ref.design,
|
|
96
|
+
_ref$className = _ref.className,
|
|
97
|
+
className = _ref$className === void 0 ? "" : _ref$className;
|
|
96
98
|
var borderColor = isActive ? (design === null || design === void 0 ? void 0 : design.navigationActiveColor) || "#1F2433" : (design === null || design === void 0 ? void 0 : design.navigationInactiveColor) || "#ccc";
|
|
97
99
|
var StyledIcon = styled(Icon)(function () {
|
|
98
100
|
return {
|
|
@@ -100,12 +102,12 @@ var ArrowButton = function ArrowButton(_ref) {
|
|
|
100
102
|
};
|
|
101
103
|
});
|
|
102
104
|
return /*#__PURE__*/React__default.createElement("button", {
|
|
105
|
+
onClick: onClick,
|
|
103
106
|
className: classnames("col-span-1", {
|
|
104
107
|
"col-start-1": isStart,
|
|
105
108
|
"col-start-12 flex justify-end": !isStart,
|
|
106
109
|
"cursor-default": !isActive
|
|
107
|
-
})
|
|
108
|
-
onClick: onClick
|
|
110
|
+
}, className)
|
|
109
111
|
}, /*#__PURE__*/React__default.createElement(StyledIcon, {
|
|
110
112
|
className: "rounded-full border p-1",
|
|
111
113
|
size: 27,
|
|
@@ -20500,7 +20502,8 @@ var CardsInGridView = function CardsInGridView(_ref) {
|
|
|
20500
20502
|
var title = _ref2.title,
|
|
20501
20503
|
description = _ref2.description,
|
|
20502
20504
|
imageUrl = _ref2.imageUrl,
|
|
20503
|
-
href = _ref2.href
|
|
20505
|
+
href = _ref2.href,
|
|
20506
|
+
style = _ref2.style;
|
|
20504
20507
|
return /*#__PURE__*/React__default.createElement(MotionWrapper, {
|
|
20505
20508
|
enableAnimation: enableAnimation,
|
|
20506
20509
|
design: design.card,
|
|
@@ -20513,7 +20516,7 @@ var CardsInGridView = function CardsInGridView(_ref) {
|
|
|
20513
20516
|
return href && window.open(href, "_blank");
|
|
20514
20517
|
}
|
|
20515
20518
|
}, /*#__PURE__*/React__default.createElement(StyledImage$1, {
|
|
20516
|
-
design: design.cardImage,
|
|
20519
|
+
design: mergeRight(design.cardImage, style),
|
|
20517
20520
|
src: imageUrl,
|
|
20518
20521
|
className: classnames("mx-auto", {
|
|
20519
20522
|
"max-h-40": mode === "landscape",
|
|
@@ -40350,13 +40353,13 @@ var GalleryClassic = function GalleryClassic(_ref) {
|
|
|
40350
40353
|
src = properties.backgroundImage.src;
|
|
40351
40354
|
var baseClasses = "grid grid-cols-12 items-center gap-y-8";
|
|
40352
40355
|
return /*#__PURE__*/React__default.createElement(BlockWrapper, {
|
|
40356
|
+
className: className,
|
|
40357
|
+
enableAnimation: enableAnimation,
|
|
40358
|
+
id: id,
|
|
40353
40359
|
backgroundImage: mergeLeft({
|
|
40354
40360
|
src: src
|
|
40355
40361
|
}, design.backgroundImage),
|
|
40356
|
-
className: className,
|
|
40357
40362
|
design: design.body,
|
|
40358
|
-
enableAnimation: enableAnimation,
|
|
40359
|
-
id: id,
|
|
40360
40363
|
nestedClassName: baseClasses
|
|
40361
40364
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
40362
40365
|
className: "col-span-12 col-start-1 sm:col-span-6 sm:col-start-4"
|
|
@@ -40370,6 +40373,7 @@ var GalleryClassic = function GalleryClassic(_ref) {
|
|
|
40370
40373
|
}, description)), /*#__PURE__*/React__default.createElement(ArrowButton, {
|
|
40371
40374
|
isStart: true,
|
|
40372
40375
|
Icon: ArrowLeft$1,
|
|
40376
|
+
className: "hidden sm:flex",
|
|
40373
40377
|
design: design.navigationButtons,
|
|
40374
40378
|
isActive: activeIndex > 0,
|
|
40375
40379
|
onClick: function onClick() {
|
|
@@ -40379,8 +40383,13 @@ var GalleryClassic = function GalleryClassic(_ref) {
|
|
|
40379
40383
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
40380
40384
|
className: "ns-gallery-with-multiple-images col-span-10 col-start-2"
|
|
40381
40385
|
}, /*#__PURE__*/React__default.createElement(Swiper, {
|
|
40386
|
+
freeMode: true,
|
|
40387
|
+
grabCursor: true,
|
|
40382
40388
|
breakpointsBase: "container",
|
|
40383
|
-
modules: [Pagination],
|
|
40389
|
+
modules: [Pagination, Mousewheel, freeMode],
|
|
40390
|
+
mousewheel: {
|
|
40391
|
+
sensitivity: 0.5
|
|
40392
|
+
},
|
|
40384
40393
|
pagination: {
|
|
40385
40394
|
clickable: true
|
|
40386
40395
|
},
|
|
@@ -40400,17 +40409,21 @@ var GalleryClassic = function GalleryClassic(_ref) {
|
|
|
40400
40409
|
}, images.map(function (_ref2, index) {
|
|
40401
40410
|
var src = _ref2.src,
|
|
40402
40411
|
alt = _ref2.alt,
|
|
40403
|
-
title = _ref2.title
|
|
40412
|
+
title = _ref2.title,
|
|
40413
|
+
style = _ref2.style;
|
|
40404
40414
|
return /*#__PURE__*/React__default.createElement(SwiperSlide, {
|
|
40415
|
+
className: "swiper__wrapper",
|
|
40405
40416
|
key: getUniqueKey(src, title, index)
|
|
40406
40417
|
}, /*#__PURE__*/React__default.createElement(StyledImage$1, {
|
|
40407
40418
|
alt: alt,
|
|
40408
|
-
className: "sliding-image",
|
|
40409
40419
|
src: src,
|
|
40410
|
-
title: title
|
|
40420
|
+
title: title,
|
|
40421
|
+
className: "sliding-image",
|
|
40422
|
+
design: style
|
|
40411
40423
|
}));
|
|
40412
40424
|
}))), /*#__PURE__*/React__default.createElement(ArrowButton, {
|
|
40413
40425
|
Icon: ArrowRight$1,
|
|
40426
|
+
className: "hidden sm:flex",
|
|
40414
40427
|
design: design.navigationButtons,
|
|
40415
40428
|
isActive: activeIndex < images.length - 2,
|
|
40416
40429
|
onClick: function onClick() {
|
|
@@ -40480,7 +40493,8 @@ var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
|
|
|
40480
40493
|
}, images.map(function (_ref2, index) {
|
|
40481
40494
|
var src = _ref2.src,
|
|
40482
40495
|
alt = _ref2.alt,
|
|
40483
|
-
title = _ref2.title
|
|
40496
|
+
title = _ref2.title,
|
|
40497
|
+
style = _ref2.style;
|
|
40484
40498
|
return /*#__PURE__*/React__default.createElement(SwiperSlide, {
|
|
40485
40499
|
className: "swiper__wrapper",
|
|
40486
40500
|
key: getUniqueKey(src, title, index)
|
|
@@ -40488,7 +40502,8 @@ var GalleryWithAutoplay = function GalleryWithAutoplay(_ref) {
|
|
|
40488
40502
|
alt: alt,
|
|
40489
40503
|
src: src,
|
|
40490
40504
|
title: title,
|
|
40491
|
-
className: "sliding-image"
|
|
40505
|
+
className: "sliding-image",
|
|
40506
|
+
design: style
|
|
40492
40507
|
}));
|
|
40493
40508
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
40494
40509
|
className: "ns-gallery-with-sliding-images sm:col-span-6 sm:col-start-4"
|
|
@@ -40922,24 +40937,28 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
40922
40937
|
var baseClasses = "grid grid-cols-12 items-center gap-y-4 sm:gap-x-4 grid-flow-row-dense";
|
|
40923
40938
|
var contentBaseClasses = function contentBaseClasses(_ref2) {
|
|
40924
40939
|
var src = _ref2.src,
|
|
40925
|
-
position = _ref2.position
|
|
40940
|
+
position = _ref2.position,
|
|
40941
|
+
isEmptyContent = _ref2.isEmptyContent;
|
|
40926
40942
|
return classnames("sm:col-span-6 col-span-12", {
|
|
40927
40943
|
"sm:col-start-1": src && position === POSITIONS.RIGHT.label,
|
|
40928
40944
|
"sm:col-span-8 sm:col-start-3": src && position === POSITIONS.BOTTOM.label,
|
|
40929
40945
|
"sm:col-span-12 sm:col-start-1 flex flex-col justify-center order-2": src && position === POSITIONS.TOP.label,
|
|
40930
40946
|
"sm:col-start-7": src && position === POSITIONS.LEFT.label,
|
|
40931
|
-
"flex flex-col justify-center sm:col-span-12": !src
|
|
40947
|
+
"flex flex-col justify-center sm:col-span-12": !src,
|
|
40948
|
+
hidden: isEmptyContent
|
|
40932
40949
|
});
|
|
40933
40950
|
};
|
|
40934
40951
|
var mediaBaseClasses = function mediaBaseClasses(_ref3) {
|
|
40935
40952
|
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
|
-
|
|
40953
|
+
position = _ref3.position,
|
|
40954
|
+
isEmptyContent = _ref3.isEmptyContent;
|
|
40955
|
+
return classnames("col-span-12 flex justify-center", {
|
|
40956
|
+
"sm:col-span-5 sm:col-start-1": src && position === POSITIONS.LEFT.label && !isEmptyContent,
|
|
40957
|
+
"sm:col-span-5 sm:col-start-8": src && position === POSITIONS.RIGHT.label && !isEmptyContent,
|
|
40958
|
+
"sm:col-span-5 sm:col-span-8 sm:col-start-3": src && position === POSITIONS.BOTTOM.label && !isEmptyContent,
|
|
40959
|
+
"sm:col-span-5 sm:col-span-8 sm:col-start-3 flex justify-center order-1": src && position === POSITIONS.TOP.label && !isEmptyContent,
|
|
40960
|
+
hidden: !src,
|
|
40961
|
+
"flex justify-center": isEmptyContent
|
|
40943
40962
|
});
|
|
40944
40963
|
};
|
|
40945
40964
|
var buttonBaseClasses = function buttonBaseClasses(_ref4) {
|
|
@@ -40956,50 +40975,21 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
40956
40975
|
"text-center": !src || position === POSITIONS.BOTTOM.label || position === POSITIONS.TOP.label
|
|
40957
40976
|
});
|
|
40958
40977
|
};
|
|
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) {
|
|
40978
|
+
var renderHeroWithMedia = function renderHeroWithMedia(_ref6) {
|
|
40989
40979
|
var content = _ref6.content,
|
|
40990
40980
|
buttons = _ref6.buttons,
|
|
40991
40981
|
media = _ref6.media;
|
|
40992
|
-
|
|
40993
|
-
|
|
40994
|
-
key: getUniqueKey(content.title, index)
|
|
40995
|
-
}, /*#__PURE__*/React__default.createElement(StyledWrapper, {
|
|
40982
|
+
var isEmptyContent = !content.prefixTitle && !content.title && !content.description;
|
|
40983
|
+
return /*#__PURE__*/React__default.createElement(StyledWrapper, {
|
|
40996
40984
|
isRootWrapper: true,
|
|
40997
40985
|
className: classnames("neeto-site-block-wrapper", baseClasses),
|
|
40998
40986
|
design: {
|
|
40999
40987
|
paddingHorizontal: design.body.paddingHorizontal
|
|
41000
40988
|
}
|
|
41001
40989
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
41002
|
-
className: contentBaseClasses(_objectSpread({
|
|
40990
|
+
className: contentBaseClasses(_objectSpread({
|
|
40991
|
+
isEmptyContent: isEmptyContent
|
|
40992
|
+
}, media))
|
|
41003
40993
|
}, /*#__PURE__*/React__default.createElement(Typography$1, {
|
|
41004
40994
|
isTitle: true,
|
|
41005
40995
|
component: "h3",
|
|
@@ -41022,7 +41012,9 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
41022
41012
|
style: button.type === "primary" ? design.primaryButtons : design.secondaryButtons
|
|
41023
41013
|
}, button, otherProps));
|
|
41024
41014
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
41025
|
-
className: mediaBaseClasses(_objectSpread({}, media)
|
|
41015
|
+
className: mediaBaseClasses(_objectSpread(_objectSpread({}, media), {}, {
|
|
41016
|
+
isEmptyContent: isEmptyContent
|
|
41017
|
+
}))
|
|
41026
41018
|
}, /*#__PURE__*/React__default.createElement(Media, {
|
|
41027
41019
|
design: design.media,
|
|
41028
41020
|
isEmbedded: media.isEmbedded,
|
|
@@ -41031,7 +41023,49 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
41031
41023
|
className: classnames({
|
|
41032
41024
|
"slider-image": media.position !== POSITIONS.BOTTOM.label || media.position !== POSITIONS.TOP.label
|
|
41033
41025
|
})
|
|
41034
|
-
})))
|
|
41026
|
+
})));
|
|
41027
|
+
};
|
|
41028
|
+
return /*#__PURE__*/React__default.createElement(MotionWrapper, {
|
|
41029
|
+
enableAnimation: enableAnimation,
|
|
41030
|
+
id: id,
|
|
41031
|
+
backgroundImage: mergeLeft({
|
|
41032
|
+
src: src
|
|
41033
|
+
}, design.backgroundImage),
|
|
41034
|
+
className: "flex items-center justify-between gap-x-2",
|
|
41035
|
+
design: mergeDesign(design.body, 24)
|
|
41036
|
+
}, slides.length > 1 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ArrowButton, {
|
|
41037
|
+
isStart: true,
|
|
41038
|
+
Icon: ArrowLeftS$1,
|
|
41039
|
+
design: design.navigationButtons,
|
|
41040
|
+
isActive: activeIndex > 0,
|
|
41041
|
+
onClick: function onClick() {
|
|
41042
|
+
var _swiperRef$current;
|
|
41043
|
+
return (_swiperRef$current = swiperRef.current) === null || _swiperRef$current === void 0 ? void 0 : _swiperRef$current.slidePrev();
|
|
41044
|
+
}
|
|
41045
|
+
}), /*#__PURE__*/React__default.createElement(Swiper, {
|
|
41046
|
+
className: "ns-hero-with-slider",
|
|
41047
|
+
modules: [Pagination],
|
|
41048
|
+
pagination: {
|
|
41049
|
+
clickable: true
|
|
41050
|
+
},
|
|
41051
|
+
onSlideChange: function onSlideChange(swiper) {
|
|
41052
|
+
return setActiveIndex(swiper.activeIndex);
|
|
41053
|
+
},
|
|
41054
|
+
onSwiper: function onSwiper(swiper) {
|
|
41055
|
+
swiperRef.current = swiper;
|
|
41056
|
+
}
|
|
41057
|
+
}, slides.map(function (_ref7, index) {
|
|
41058
|
+
var content = _ref7.content,
|
|
41059
|
+
buttons = _ref7.buttons,
|
|
41060
|
+
media = _ref7.media;
|
|
41061
|
+
return /*#__PURE__*/React__default.createElement(SwiperSlide, {
|
|
41062
|
+
className: classnames("my-auto", className),
|
|
41063
|
+
key: getUniqueKey(content.title, index)
|
|
41064
|
+
}, renderHeroWithMedia({
|
|
41065
|
+
content: content,
|
|
41066
|
+
buttons: buttons,
|
|
41067
|
+
media: media
|
|
41068
|
+
}));
|
|
41035
41069
|
})), /*#__PURE__*/React__default.createElement(ArrowButton, {
|
|
41036
41070
|
Icon: ArrowRightS$1,
|
|
41037
41071
|
design: design.navigationButtons,
|
|
@@ -41040,6 +41074,10 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
|
|
|
41040
41074
|
var _swiperRef$current2;
|
|
41041
41075
|
return (_swiperRef$current2 = swiperRef.current) === null || _swiperRef$current2 === void 0 ? void 0 : _swiperRef$current2.slideNext();
|
|
41042
41076
|
}
|
|
41077
|
+
})) : renderHeroWithMedia(slides[0] || {
|
|
41078
|
+
content: {},
|
|
41079
|
+
buttons: [],
|
|
41080
|
+
media: {}
|
|
41043
41081
|
}));
|
|
41044
41082
|
};
|
|
41045
41083
|
|