@bigbinary/neeto-site-blocks 1.2.7 → 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.js CHANGED
@@ -40572,14 +40572,20 @@ var HeaderWithButtons = function HeaderWithButtons(_ref) {
40572
40572
  "neeto-site-sticky-header": position === "sticky",
40573
40573
  "neeto-site-sticky-header--scroll": !isHeadingWrapperVisible
40574
40574
  }, className)
40575
- }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
40576
- design: design.logo,
40577
- src: properties.logo.src,
40575
+ }, /*#__PURE__*/React__default.createElement(Link, _extends$2({
40576
+ action: properties.logo.action,
40577
+ to: properties.logo.to,
40578
40578
  className: classnames("col-start-2 ml-3 flex max-h-8 justify-start sm:ml-0 sm:max-h-10 lg:col-span-3 lg:col-start-1 lg:max-h-14", {
40579
40579
  "col-span-10": isEmpty(buttons),
40580
40580
  "col-span-3 sm:col-span-4 sm:col-start-2": isNotEmpty(buttons)
40581
- })
40582
- }), /*#__PURE__*/React__default.createElement("div", {
40581
+ }),
40582
+ icon: function icon() {
40583
+ return /*#__PURE__*/React__default.createElement(StyledImage$1, {
40584
+ design: design.logo,
40585
+ src: properties.logo.src
40586
+ });
40587
+ }
40588
+ }, otherProps)), /*#__PURE__*/React__default.createElement("div", {
40583
40589
  className: classnames("col-span-5 col-start-4 hidden items-center justify-center gap-x-6 lg:flex", {
40584
40590
  "col-span-9 sm:justify-end": isEmpty(buttons)
40585
40591
  })
@@ -40659,11 +40665,17 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
40659
40665
  key: getUniqueKey(link.label, index),
40660
40666
  style: design.links
40661
40667
  }, link, otherProps));
40662
- })), /*#__PURE__*/React__default.createElement(StyledImage$1, {
40668
+ })), /*#__PURE__*/React__default.createElement(Link, _extends$2({
40669
+ action: properties.logo.action,
40663
40670
  className: "col-span-6 col-start-4 m-auto flex max-h-8 justify-center sm:col-span-4 sm:col-start-5 sm:max-h-10 lg:col-span-3 lg:col-start-6 lg:max-h-14",
40664
- design: design.logo,
40665
- src: properties.logo.src
40666
- }), /*#__PURE__*/React__default.createElement("div", {
40671
+ to: properties.logo.to,
40672
+ icon: function icon() {
40673
+ return /*#__PURE__*/React__default.createElement(StyledImage$1, {
40674
+ design: design.logo,
40675
+ src: properties.logo.src
40676
+ });
40677
+ }
40678
+ }, otherProps)), /*#__PURE__*/React__default.createElement("div", {
40667
40679
  className: "col-span-5 col-start-8 hidden justify-end sm:col-span-3 sm:col-start-10 sm:flex"
40668
40680
  }, properties.icons.map(function (_icon, index) {
40669
40681
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
@@ -40755,17 +40767,24 @@ var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
40755
40767
  "col-span-10": isEmpty(buttons),
40756
40768
  "col-span-4": isNotEmpty(buttons)
40757
40769
  })
40758
- }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
40759
- className: "max-h-8 sm:max-h-10 lg:max-h-14",
40760
- design: design.logo,
40761
- src: properties.logo.src
40762
- }), /*#__PURE__*/React__default.createElement(Typography$1, {
40763
- component: "p",
40764
- style: design.logoTitle,
40765
- className: classnames({
40766
- "hidden sm:flex": properties.logo.src
40767
- })
40768
- }, properties.logo.title)), /*#__PURE__*/React__default.createElement("div", {
40770
+ }, /*#__PURE__*/React__default.createElement(Link, _extends$2({
40771
+ action: properties.logo.action,
40772
+ className: "flex w-full gap-x-2",
40773
+ to: properties.logo.to,
40774
+ icon: function icon() {
40775
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StyledImage$1, {
40776
+ className: "max-h-8 sm:max-h-10 lg:max-h-14",
40777
+ design: design.logo,
40778
+ src: properties.logo.src
40779
+ }), /*#__PURE__*/React__default.createElement(Typography$1, {
40780
+ component: "p",
40781
+ style: design.logoTitle,
40782
+ className: classnames({
40783
+ "hidden sm:flex": properties.logo.src
40784
+ })
40785
+ }, properties.logo.title));
40786
+ }
40787
+ }, otherProps))), /*#__PURE__*/React__default.createElement("div", {
40769
40788
  className: "col-span-6 col-start-7 flex items-center justify-end gap-x-6 sm:col-span-5 sm:col-start-8 lg:col-span-7 lg:col-start-6"
40770
40789
  }, properties.links.map(function (link, index) {
40771
40790
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
@@ -40903,24 +40922,28 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
40903
40922
  var baseClasses = "grid grid-cols-12 items-center gap-y-4 sm:gap-x-4 grid-flow-row-dense";
40904
40923
  var contentBaseClasses = function contentBaseClasses(_ref2) {
40905
40924
  var src = _ref2.src,
40906
- position = _ref2.position;
40925
+ position = _ref2.position,
40926
+ isEmptyContent = _ref2.isEmptyContent;
40907
40927
  return classnames("sm:col-span-6 col-span-12", {
40908
40928
  "sm:col-start-1": src && position === POSITIONS.RIGHT.label,
40909
40929
  "sm:col-span-8 sm:col-start-3": src && position === POSITIONS.BOTTOM.label,
40910
40930
  "sm:col-span-12 sm:col-start-1 flex flex-col justify-center order-2": src && position === POSITIONS.TOP.label,
40911
40931
  "sm:col-start-7": src && position === POSITIONS.LEFT.label,
40912
- "flex flex-col justify-center sm:col-span-12": !src
40932
+ "flex flex-col justify-center sm:col-span-12": !src,
40933
+ hidden: isEmptyContent
40913
40934
  });
40914
40935
  };
40915
40936
  var mediaBaseClasses = function mediaBaseClasses(_ref3) {
40916
40937
  var src = _ref3.src,
40917
- position = _ref3.position;
40918
- return classnames("sm:col-span-5 col-span-12 flex justify-center", {
40919
- "sm:col-start-1": src && position === POSITIONS.LEFT.label,
40920
- "sm:col-start-8": src && position === POSITIONS.RIGHT.label,
40921
- "sm:col-span-8 sm:col-start-3": src && position === POSITIONS.BOTTOM.label,
40922
- "sm:col-span-8 sm:col-start-3 flex justify-center order-1": src && position === POSITIONS.TOP.label,
40923
- hidden: !src
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
40924
40947
  });
40925
40948
  };
40926
40949
  var buttonBaseClasses = function buttonBaseClasses(_ref4) {
@@ -40937,50 +40960,21 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
40937
40960
  "text-center": !src || position === POSITIONS.BOTTOM.label || position === POSITIONS.TOP.label
40938
40961
  });
40939
40962
  };
40940
- return /*#__PURE__*/React__default.createElement(MotionWrapper, {
40941
- enableAnimation: enableAnimation,
40942
- id: id,
40943
- backgroundImage: mergeLeft({
40944
- src: src
40945
- }, design.backgroundImage),
40946
- className: "flex items-center justify-between gap-x-2",
40947
- design: mergeDesign(design.body, 24)
40948
- }, /*#__PURE__*/React__default.createElement(ArrowButton, {
40949
- isStart: true,
40950
- Icon: ArrowLeftS$1,
40951
- design: design.navigationButtons,
40952
- isActive: activeIndex > 0,
40953
- onClick: function onClick() {
40954
- var _swiperRef$current;
40955
- return (_swiperRef$current = swiperRef.current) === null || _swiperRef$current === void 0 ? void 0 : _swiperRef$current.slidePrev();
40956
- }
40957
- }), /*#__PURE__*/React__default.createElement(Swiper, {
40958
- className: "ns-hero-with-slider",
40959
- modules: [Pagination],
40960
- pagination: {
40961
- clickable: true
40962
- },
40963
- onSlideChange: function onSlideChange(swiper) {
40964
- return setActiveIndex(swiper.activeIndex);
40965
- },
40966
- onSwiper: function onSwiper(swiper) {
40967
- swiperRef.current = swiper;
40968
- }
40969
- }, slides.map(function (_ref6, index) {
40963
+ var renderHeroWithMedia = function renderHeroWithMedia(_ref6) {
40970
40964
  var content = _ref6.content,
40971
40965
  buttons = _ref6.buttons,
40972
40966
  media = _ref6.media;
40973
- return /*#__PURE__*/React__default.createElement(SwiperSlide, {
40974
- className: classnames("my-auto", className),
40975
- key: getUniqueKey(content.title, index)
40976
- }, /*#__PURE__*/React__default.createElement(StyledWrapper, {
40967
+ var isEmptyContent = !content.prefixTitle && !content.title && !content.description;
40968
+ return /*#__PURE__*/React__default.createElement(StyledWrapper, {
40977
40969
  isRootWrapper: true,
40978
40970
  className: classnames("neeto-site-block-wrapper", baseClasses),
40979
40971
  design: {
40980
40972
  paddingHorizontal: design.body.paddingHorizontal
40981
40973
  }
40982
40974
  }, /*#__PURE__*/React__default.createElement("div", {
40983
- className: contentBaseClasses(_objectSpread({}, media))
40975
+ className: contentBaseClasses(_objectSpread({
40976
+ isEmptyContent: isEmptyContent
40977
+ }, media))
40984
40978
  }, /*#__PURE__*/React__default.createElement(Typography$1, {
40985
40979
  isTitle: true,
40986
40980
  component: "h3",
@@ -41003,7 +40997,9 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
41003
40997
  style: button.type === "primary" ? design.primaryButtons : design.secondaryButtons
41004
40998
  }, button, otherProps));
41005
40999
  }))), /*#__PURE__*/React__default.createElement("div", {
41006
- className: mediaBaseClasses(_objectSpread({}, media))
41000
+ className: mediaBaseClasses(_objectSpread(_objectSpread({}, media), {}, {
41001
+ isEmptyContent: isEmptyContent
41002
+ }))
41007
41003
  }, /*#__PURE__*/React__default.createElement(Media, {
41008
41004
  design: design.media,
41009
41005
  isEmbedded: media.isEmbedded,
@@ -41012,7 +41008,49 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
41012
41008
  className: classnames({
41013
41009
  "slider-image": media.position !== POSITIONS.BOTTOM.label || media.position !== POSITIONS.TOP.label
41014
41010
  })
41015
- }))));
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
+ }));
41016
41054
  })), /*#__PURE__*/React__default.createElement(ArrowButton, {
41017
41055
  Icon: ArrowRightS$1,
41018
41056
  design: design.navigationButtons,
@@ -41021,6 +41059,10 @@ var HeroWithMultipleLayouts = function HeroWithMultipleLayouts(_ref) {
41021
41059
  var _swiperRef$current2;
41022
41060
  return (_swiperRef$current2 = swiperRef.current) === null || _swiperRef$current2 === void 0 ? void 0 : _swiperRef$current2.slideNext();
41023
41061
  }
41062
+ })) : renderHeroWithMedia(slides[0] || {
41063
+ content: {},
41064
+ buttons: [],
41065
+ media: {}
41024
41066
  }));
41025
41067
  };
41026
41068