@bigbinary/neeto-site-blocks 1.2.6 → 1.2.8

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
@@ -14122,7 +14122,7 @@ stepsOrder.reduce((acc, key) => {
14122
14122
 
14123
14123
  var StyledAnchor = styled.a.attrs(function (props) {
14124
14124
  return {
14125
- className: classnames(props.className, generateResponsiveStyles(props.design))
14125
+ className: generateResponsiveStyles(props.design)
14126
14126
  };
14127
14127
  })(function (_ref) {
14128
14128
  var _design$border, _design$border2, _design$border3;
@@ -14130,14 +14130,20 @@ var StyledAnchor = styled.a.attrs(function (props) {
14130
14130
  _ref$percentage = _ref.percentage,
14131
14131
  percentage = _ref$percentage === void 0 ? 0.08 : _ref$percentage,
14132
14132
  _ref$isButton = _ref.isButton,
14133
- isButton = _ref$isButton === void 0 ? false : _ref$isButton;
14133
+ isButton = _ref$isButton === void 0 ? false : _ref$isButton,
14134
+ isHighlighted = _ref.isHighlighted;
14134
14135
  var borderColors = {
14135
14136
  borderColor: (_design$border = design.border) === null || _design$border === void 0 ? void 0 : _design$border.borderColor,
14136
14137
  borderStyle: (_design$border2 = design.border) === null || _design$border2 === void 0 ? void 0 : _design$border2.borderStyle,
14137
14138
  borderWidth: (_design$border3 = design.border) === null || _design$border3 === void 0 ? void 0 : _design$border3.borderWidth
14138
14139
  };
14139
14140
  var borderColorStyles = pickBy(identity, borderColors);
14140
- var hoverStyles = {
14141
+ var anchorStyles = {
14142
+ color: isHighlighted ? blendColors({
14143
+ color0: design.color,
14144
+ color1: "#0e19e8",
14145
+ percentage: 0.4
14146
+ }) : design.color,
14141
14147
  "&:hover": {
14142
14148
  transitionDuration: "0.3s",
14143
14149
  borderColor: isButton && blendColors({
@@ -14154,7 +14160,7 @@ var StyledAnchor = styled.a.attrs(function (props) {
14154
14160
  })
14155
14161
  }
14156
14162
  };
14157
- return mergeAll([design, borderColorStyles, hoverStyles]);
14163
+ return mergeAll([design, borderColorStyles, anchorStyles]);
14158
14164
  });
14159
14165
 
14160
14166
  var withConditionalRender = function withConditionalRender(Component, condition) {
@@ -15423,6 +15429,8 @@ var LinkElement = function LinkElement(_ref) {
15423
15429
  _ref$draftMode = _ref.draftMode,
15424
15430
  draftMode = _ref$draftMode === void 0 ? false : _ref$draftMode,
15425
15431
  Link = _ref.link,
15432
+ _ref$isHighlighted = _ref.isHighlighted,
15433
+ isHighlighted = _ref$isHighlighted === void 0 ? false : _ref$isHighlighted,
15426
15434
  _ref$disableButtonAnd = _ref.disableButtonAndLinks,
15427
15435
  disableButtonAndLinks = _ref$disableButtonAnd === void 0 ? false : _ref$disableButtonAnd;
15428
15436
  var baseClass = classnames("inline-flex items-center transition-all duration-300 ease-in-out", {
@@ -15433,7 +15441,8 @@ var LinkElement = function LinkElement(_ref) {
15433
15441
  design: style,
15434
15442
  href: to !== null && to !== void 0 ? to : "",
15435
15443
  rel: "noreferrer",
15436
- percentage: 0.1
15444
+ percentage: 0.1,
15445
+ isHighlighted: isHighlighted
15437
15446
  };
15438
15447
  if (action === "external") {
15439
15448
  return /*#__PURE__*/React__default.createElement(StyledAnchor, _extends$2({}, commonProps, {
@@ -15447,7 +15456,9 @@ var LinkElement = function LinkElement(_ref) {
15447
15456
  to: draftMode ? "".concat(baseUrl).concat(to) : to
15448
15457
  }), label, Icon && /*#__PURE__*/React__default.createElement(Icon, null));
15449
15458
  }
15450
- return /*#__PURE__*/React__default.createElement(StyledAnchor, commonProps, label, Icon && /*#__PURE__*/React__default.createElement(Icon, null));
15459
+ return /*#__PURE__*/React__default.createElement(StyledAnchor, _extends$2({
15460
+ as: !draftMode && Link
15461
+ }, commonProps), label, Icon && /*#__PURE__*/React__default.createElement(Icon, null));
15451
15462
  };
15452
15463
  var Link = withConditionalRender(LinkElement, function () {
15453
15464
  return !!(prop("label") || prop("icon"));
@@ -40531,11 +40542,12 @@ var useElementVisible = function useElementVisible(ref) {
40531
40542
  return isIntersecting;
40532
40543
  };
40533
40544
 
40534
- var _excluded$7 = ["configurations", "className", "id"];
40545
+ var _excluded$7 = ["configurations", "className", "currentPath", "id"];
40535
40546
  var HeaderWithButtons = function HeaderWithButtons(_ref) {
40536
40547
  var configurations = _ref.configurations,
40537
40548
  _ref$className = _ref.className,
40538
40549
  className = _ref$className === void 0 ? "" : _ref$className,
40550
+ currentPath = _ref.currentPath,
40539
40551
  id = _ref.id,
40540
40552
  otherProps = _objectWithoutProperties(_ref, _excluded$7);
40541
40553
  var _useState = useState(false),
@@ -40560,19 +40572,26 @@ var HeaderWithButtons = function HeaderWithButtons(_ref) {
40560
40572
  "neeto-site-sticky-header": position === "sticky",
40561
40573
  "neeto-site-sticky-header--scroll": !isHeadingWrapperVisible
40562
40574
  }, className)
40563
- }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
40564
- design: design.logo,
40565
- src: properties.logo.src,
40575
+ }, /*#__PURE__*/React__default.createElement(Link, _extends$2({
40576
+ action: properties.logo.action,
40577
+ to: properties.logo.to,
40566
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", {
40567
40579
  "col-span-10": isEmpty(buttons),
40568
40580
  "col-span-3 sm:col-span-4 sm:col-start-2": isNotEmpty(buttons)
40569
- })
40570
- }), /*#__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", {
40571
40589
  className: classnames("col-span-5 col-start-4 hidden items-center justify-center gap-x-6 lg:flex", {
40572
40590
  "col-span-9 sm:justify-end": isEmpty(buttons)
40573
40591
  })
40574
40592
  }, properties.links.map(function (link, index) {
40575
40593
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40594
+ isHighlighted: currentPath === link.to,
40576
40595
  key: getUniqueKey(link.label, index),
40577
40596
  style: design.links
40578
40597
  }, link, otherProps));
@@ -40596,19 +40615,21 @@ var HeaderWithButtons = function HeaderWithButtons(_ref) {
40596
40615
  className: "fadeIn col-span-2 col-start-1 ml-2 mt-3 block space-y-2 lg:hidden"
40597
40616
  }, properties.links.map(function (button, index) {
40598
40617
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40599
- key: getUniqueKey(button.url, button.label, index),
40618
+ isHighlighted: currentPath === button.to,
40619
+ key: getUniqueKey(button.to, button.label, index),
40600
40620
  style: design.links
40601
40621
  }, button, otherProps));
40602
40622
  }))));
40603
40623
  };
40604
40624
 
40605
- var _excluded$6 = ["configurations", "className", "id"];
40625
+ var _excluded$6 = ["configurations", "className", "currentPath", "id"];
40606
40626
  function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
40607
40627
  function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
40608
40628
  var HeaderWithIcons = function HeaderWithIcons(_ref) {
40609
40629
  var configurations = _ref.configurations,
40610
40630
  _ref$className = _ref.className,
40611
40631
  className = _ref$className === void 0 ? "" : _ref$className,
40632
+ currentPath = _ref.currentPath,
40612
40633
  id = _ref.id,
40613
40634
  otherProps = _objectWithoutProperties(_ref, _excluded$6);
40614
40635
  var _useState = useState(false),
@@ -40640,14 +40661,21 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
40640
40661
  className: "col-span-4 col-start-1 hidden items-center gap-6 lg:flex"
40641
40662
  }, properties.links.map(function (link, index) {
40642
40663
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40664
+ isHighlighted: currentPath === link.to,
40643
40665
  key: getUniqueKey(link.label, index),
40644
40666
  style: design.links
40645
40667
  }, link, otherProps));
40646
- })), /*#__PURE__*/React__default.createElement(StyledImage$1, {
40668
+ })), /*#__PURE__*/React__default.createElement(Link, _extends$2({
40669
+ action: properties.logo.action,
40647
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",
40648
- design: design.logo,
40649
- src: properties.logo.src
40650
- }), /*#__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", {
40651
40679
  className: "col-span-5 col-start-8 hidden justify-end sm:col-span-3 sm:col-start-10 sm:flex"
40652
40680
  }, properties.icons.map(function (_icon, index) {
40653
40681
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
@@ -40683,6 +40711,7 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
40683
40711
  }, properties.links.map(function (icon, index) {
40684
40712
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40685
40713
  className: "w-full",
40714
+ isHighlighted: currentPath === icon.to,
40686
40715
  key: getUniqueKey(icon.url, icon.label, index),
40687
40716
  style: design.links
40688
40717
  }, icon));
@@ -40703,12 +40732,13 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
40703
40732
  }))));
40704
40733
  };
40705
40734
 
40706
- var _excluded$5 = ["configurations", "className", "id"];
40735
+ var _excluded$5 = ["configurations", "className", "id", "currentPath"];
40707
40736
  var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
40708
40737
  var configurations = _ref.configurations,
40709
40738
  _ref$className = _ref.className,
40710
40739
  className = _ref$className === void 0 ? "" : _ref$className,
40711
40740
  id = _ref.id,
40741
+ currentPath = _ref.currentPath,
40712
40742
  otherProps = _objectWithoutProperties(_ref, _excluded$5);
40713
40743
  var _useState = useState(false),
40714
40744
  _useState2 = _slicedToArray(_useState, 2),
@@ -40737,22 +40767,30 @@ var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
40737
40767
  "col-span-10": isEmpty(buttons),
40738
40768
  "col-span-4": isNotEmpty(buttons)
40739
40769
  })
40740
- }, /*#__PURE__*/React__default.createElement(StyledImage$1, {
40741
- className: "max-h-8 sm:max-h-10 lg:max-h-14",
40742
- design: design.logo,
40743
- src: properties.logo.src
40744
- }), /*#__PURE__*/React__default.createElement(Typography$1, {
40745
- component: "p",
40746
- style: design.logoTitle,
40747
- className: classnames({
40748
- "hidden sm:flex": properties.logo.src
40749
- })
40750
- }, 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", {
40751
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"
40752
40789
  }, properties.links.map(function (link, index) {
40753
40790
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40754
40791
  className: "hidden lg:inline",
40755
- key: getUniqueKey(link.label, link.url, index),
40792
+ isHighlighted: currentPath === link.to,
40793
+ key: getUniqueKey(link.label, link.to, index),
40756
40794
  style: design.links
40757
40795
  }, link, otherProps));
40758
40796
  }), buttons.map(function (button, index) {
@@ -40773,14 +40811,15 @@ var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
40773
40811
  className: "fadeIn col-span-2 col-start-1 space-y-2 lg:hidden"
40774
40812
  }, properties.links.map(function (_ref2, index) {
40775
40813
  var label = _ref2.label,
40776
- url = _ref2.url,
40814
+ to = _ref2.to,
40777
40815
  action = _ref2.action;
40778
40816
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40779
40817
  action: action,
40780
40818
  label: label,
40781
- key: getUniqueKey(url, label, index),
40782
- style: design.links,
40783
- to: url
40819
+ to: to,
40820
+ isHighlighted: currentPath === to,
40821
+ key: getUniqueKey(to, label, index),
40822
+ style: design.links
40784
40823
  }, otherProps));
40785
40824
  }))));
40786
40825
  };