@bigbinary/neeto-site-blocks 1.2.6 → 1.2.7

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),
@@ -40573,6 +40585,7 @@ var HeaderWithButtons = function HeaderWithButtons(_ref) {
40573
40585
  })
40574
40586
  }, properties.links.map(function (link, index) {
40575
40587
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40588
+ isHighlighted: currentPath === link.to,
40576
40589
  key: getUniqueKey(link.label, index),
40577
40590
  style: design.links
40578
40591
  }, link, otherProps));
@@ -40596,19 +40609,21 @@ var HeaderWithButtons = function HeaderWithButtons(_ref) {
40596
40609
  className: "fadeIn col-span-2 col-start-1 ml-2 mt-3 block space-y-2 lg:hidden"
40597
40610
  }, properties.links.map(function (button, index) {
40598
40611
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40599
- key: getUniqueKey(button.url, button.label, index),
40612
+ isHighlighted: currentPath === button.to,
40613
+ key: getUniqueKey(button.to, button.label, index),
40600
40614
  style: design.links
40601
40615
  }, button, otherProps));
40602
40616
  }))));
40603
40617
  };
40604
40618
 
40605
- var _excluded$6 = ["configurations", "className", "id"];
40619
+ var _excluded$6 = ["configurations", "className", "currentPath", "id"];
40606
40620
  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
40621
  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
40622
  var HeaderWithIcons = function HeaderWithIcons(_ref) {
40609
40623
  var configurations = _ref.configurations,
40610
40624
  _ref$className = _ref.className,
40611
40625
  className = _ref$className === void 0 ? "" : _ref$className,
40626
+ currentPath = _ref.currentPath,
40612
40627
  id = _ref.id,
40613
40628
  otherProps = _objectWithoutProperties(_ref, _excluded$6);
40614
40629
  var _useState = useState(false),
@@ -40640,6 +40655,7 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
40640
40655
  className: "col-span-4 col-start-1 hidden items-center gap-6 lg:flex"
40641
40656
  }, properties.links.map(function (link, index) {
40642
40657
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40658
+ isHighlighted: currentPath === link.to,
40643
40659
  key: getUniqueKey(link.label, index),
40644
40660
  style: design.links
40645
40661
  }, link, otherProps));
@@ -40683,6 +40699,7 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
40683
40699
  }, properties.links.map(function (icon, index) {
40684
40700
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40685
40701
  className: "w-full",
40702
+ isHighlighted: currentPath === icon.to,
40686
40703
  key: getUniqueKey(icon.url, icon.label, index),
40687
40704
  style: design.links
40688
40705
  }, icon));
@@ -40703,12 +40720,13 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
40703
40720
  }))));
40704
40721
  };
40705
40722
 
40706
- var _excluded$5 = ["configurations", "className", "id"];
40723
+ var _excluded$5 = ["configurations", "className", "id", "currentPath"];
40707
40724
  var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
40708
40725
  var configurations = _ref.configurations,
40709
40726
  _ref$className = _ref.className,
40710
40727
  className = _ref$className === void 0 ? "" : _ref$className,
40711
40728
  id = _ref.id,
40729
+ currentPath = _ref.currentPath,
40712
40730
  otherProps = _objectWithoutProperties(_ref, _excluded$5);
40713
40731
  var _useState = useState(false),
40714
40732
  _useState2 = _slicedToArray(_useState, 2),
@@ -40752,7 +40770,8 @@ var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
40752
40770
  }, properties.links.map(function (link, index) {
40753
40771
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40754
40772
  className: "hidden lg:inline",
40755
- key: getUniqueKey(link.label, link.url, index),
40773
+ isHighlighted: currentPath === link.to,
40774
+ key: getUniqueKey(link.label, link.to, index),
40756
40775
  style: design.links
40757
40776
  }, link, otherProps));
40758
40777
  }), buttons.map(function (button, index) {
@@ -40773,14 +40792,15 @@ var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
40773
40792
  className: "fadeIn col-span-2 col-start-1 space-y-2 lg:hidden"
40774
40793
  }, properties.links.map(function (_ref2, index) {
40775
40794
  var label = _ref2.label,
40776
- url = _ref2.url,
40795
+ to = _ref2.to,
40777
40796
  action = _ref2.action;
40778
40797
  return /*#__PURE__*/React__default.createElement(Link, _extends$2({
40779
40798
  action: action,
40780
40799
  label: label,
40781
- key: getUniqueKey(url, label, index),
40782
- style: design.links,
40783
- to: url
40800
+ to: to,
40801
+ isHighlighted: currentPath === to,
40802
+ key: getUniqueKey(to, label, index),
40803
+ style: design.links
40784
40804
  }, otherProps));
40785
40805
  }))));
40786
40806
  };