@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.cjs.js CHANGED
@@ -14168,7 +14168,7 @@ stepsOrder.reduce((acc, key) => {
14168
14168
 
14169
14169
  var StyledAnchor = styled__default["default"].a.attrs(function (props) {
14170
14170
  return {
14171
- className: classnames(props.className, generateResponsiveStyles(props.design))
14171
+ className: generateResponsiveStyles(props.design)
14172
14172
  };
14173
14173
  })(function (_ref) {
14174
14174
  var _design$border, _design$border2, _design$border3;
@@ -14176,14 +14176,20 @@ var StyledAnchor = styled__default["default"].a.attrs(function (props) {
14176
14176
  _ref$percentage = _ref.percentage,
14177
14177
  percentage = _ref$percentage === void 0 ? 0.08 : _ref$percentage,
14178
14178
  _ref$isButton = _ref.isButton,
14179
- isButton = _ref$isButton === void 0 ? false : _ref$isButton;
14179
+ isButton = _ref$isButton === void 0 ? false : _ref$isButton,
14180
+ isHighlighted = _ref.isHighlighted;
14180
14181
  var borderColors = {
14181
14182
  borderColor: (_design$border = design.border) === null || _design$border === void 0 ? void 0 : _design$border.borderColor,
14182
14183
  borderStyle: (_design$border2 = design.border) === null || _design$border2 === void 0 ? void 0 : _design$border2.borderStyle,
14183
14184
  borderWidth: (_design$border3 = design.border) === null || _design$border3 === void 0 ? void 0 : _design$border3.borderWidth
14184
14185
  };
14185
14186
  var borderColorStyles = pickBy(identity, borderColors);
14186
- var hoverStyles = {
14187
+ var anchorStyles = {
14188
+ color: isHighlighted ? blendColors({
14189
+ color0: design.color,
14190
+ color1: "#0e19e8",
14191
+ percentage: 0.4
14192
+ }) : design.color,
14187
14193
  "&:hover": {
14188
14194
  transitionDuration: "0.3s",
14189
14195
  borderColor: isButton && blendColors({
@@ -14200,7 +14206,7 @@ var StyledAnchor = styled__default["default"].a.attrs(function (props) {
14200
14206
  })
14201
14207
  }
14202
14208
  };
14203
- return mergeAll([design, borderColorStyles, hoverStyles]);
14209
+ return mergeAll([design, borderColorStyles, anchorStyles]);
14204
14210
  });
14205
14211
 
14206
14212
  var withConditionalRender = function withConditionalRender(Component, condition) {
@@ -15469,6 +15475,8 @@ var LinkElement = function LinkElement(_ref) {
15469
15475
  _ref$draftMode = _ref.draftMode,
15470
15476
  draftMode = _ref$draftMode === void 0 ? false : _ref$draftMode,
15471
15477
  Link = _ref.link,
15478
+ _ref$isHighlighted = _ref.isHighlighted,
15479
+ isHighlighted = _ref$isHighlighted === void 0 ? false : _ref$isHighlighted,
15472
15480
  _ref$disableButtonAnd = _ref.disableButtonAndLinks,
15473
15481
  disableButtonAndLinks = _ref$disableButtonAnd === void 0 ? false : _ref$disableButtonAnd;
15474
15482
  var baseClass = classnames("inline-flex items-center transition-all duration-300 ease-in-out", {
@@ -15479,7 +15487,8 @@ var LinkElement = function LinkElement(_ref) {
15479
15487
  design: style,
15480
15488
  href: to !== null && to !== void 0 ? to : "",
15481
15489
  rel: "noreferrer",
15482
- percentage: 0.1
15490
+ percentage: 0.1,
15491
+ isHighlighted: isHighlighted
15483
15492
  };
15484
15493
  if (action === "external") {
15485
15494
  return /*#__PURE__*/React__default["default"].createElement(StyledAnchor, _extends__default["default"]({}, commonProps, {
@@ -15493,7 +15502,9 @@ var LinkElement = function LinkElement(_ref) {
15493
15502
  to: draftMode ? "".concat(baseUrl).concat(to) : to
15494
15503
  }), label, Icon && /*#__PURE__*/React__default["default"].createElement(Icon, null));
15495
15504
  }
15496
- return /*#__PURE__*/React__default["default"].createElement(StyledAnchor, commonProps, label, Icon && /*#__PURE__*/React__default["default"].createElement(Icon, null));
15505
+ return /*#__PURE__*/React__default["default"].createElement(StyledAnchor, _extends__default["default"]({
15506
+ as: !draftMode && Link
15507
+ }, commonProps), label, Icon && /*#__PURE__*/React__default["default"].createElement(Icon, null));
15497
15508
  };
15498
15509
  var Link = withConditionalRender(LinkElement, function () {
15499
15510
  return !!(prop("label") || prop("icon"));
@@ -40577,11 +40588,12 @@ var useElementVisible = function useElementVisible(ref) {
40577
40588
  return isIntersecting;
40578
40589
  };
40579
40590
 
40580
- var _excluded$7 = ["configurations", "className", "id"];
40591
+ var _excluded$7 = ["configurations", "className", "currentPath", "id"];
40581
40592
  var HeaderWithButtons = function HeaderWithButtons(_ref) {
40582
40593
  var configurations = _ref.configurations,
40583
40594
  _ref$className = _ref.className,
40584
40595
  className = _ref$className === void 0 ? "" : _ref$className,
40596
+ currentPath = _ref.currentPath,
40585
40597
  id = _ref.id,
40586
40598
  otherProps = _objectWithoutProperties__default["default"](_ref, _excluded$7);
40587
40599
  var _useState = React.useState(false),
@@ -40619,6 +40631,7 @@ var HeaderWithButtons = function HeaderWithButtons(_ref) {
40619
40631
  })
40620
40632
  }, properties.links.map(function (link, index) {
40621
40633
  return /*#__PURE__*/React__default["default"].createElement(Link, _extends__default["default"]({
40634
+ isHighlighted: currentPath === link.to,
40622
40635
  key: getUniqueKey(link.label, index),
40623
40636
  style: design.links
40624
40637
  }, link, otherProps));
@@ -40642,19 +40655,21 @@ var HeaderWithButtons = function HeaderWithButtons(_ref) {
40642
40655
  className: "fadeIn col-span-2 col-start-1 ml-2 mt-3 block space-y-2 lg:hidden"
40643
40656
  }, properties.links.map(function (button, index) {
40644
40657
  return /*#__PURE__*/React__default["default"].createElement(Link, _extends__default["default"]({
40645
- key: getUniqueKey(button.url, button.label, index),
40658
+ isHighlighted: currentPath === button.to,
40659
+ key: getUniqueKey(button.to, button.label, index),
40646
40660
  style: design.links
40647
40661
  }, button, otherProps));
40648
40662
  }))));
40649
40663
  };
40650
40664
 
40651
- var _excluded$6 = ["configurations", "className", "id"];
40665
+ var _excluded$6 = ["configurations", "className", "currentPath", "id"];
40652
40666
  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; }
40653
40667
  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__default["default"](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; }
40654
40668
  var HeaderWithIcons = function HeaderWithIcons(_ref) {
40655
40669
  var configurations = _ref.configurations,
40656
40670
  _ref$className = _ref.className,
40657
40671
  className = _ref$className === void 0 ? "" : _ref$className,
40672
+ currentPath = _ref.currentPath,
40658
40673
  id = _ref.id,
40659
40674
  otherProps = _objectWithoutProperties__default["default"](_ref, _excluded$6);
40660
40675
  var _useState = React.useState(false),
@@ -40686,6 +40701,7 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
40686
40701
  className: "col-span-4 col-start-1 hidden items-center gap-6 lg:flex"
40687
40702
  }, properties.links.map(function (link, index) {
40688
40703
  return /*#__PURE__*/React__default["default"].createElement(Link, _extends__default["default"]({
40704
+ isHighlighted: currentPath === link.to,
40689
40705
  key: getUniqueKey(link.label, index),
40690
40706
  style: design.links
40691
40707
  }, link, otherProps));
@@ -40729,6 +40745,7 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
40729
40745
  }, properties.links.map(function (icon, index) {
40730
40746
  return /*#__PURE__*/React__default["default"].createElement(Link, _extends__default["default"]({
40731
40747
  className: "w-full",
40748
+ isHighlighted: currentPath === icon.to,
40732
40749
  key: getUniqueKey(icon.url, icon.label, index),
40733
40750
  style: design.links
40734
40751
  }, icon));
@@ -40749,12 +40766,13 @@ var HeaderWithIcons = function HeaderWithIcons(_ref) {
40749
40766
  }))));
40750
40767
  };
40751
40768
 
40752
- var _excluded$5 = ["configurations", "className", "id"];
40769
+ var _excluded$5 = ["configurations", "className", "id", "currentPath"];
40753
40770
  var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
40754
40771
  var configurations = _ref.configurations,
40755
40772
  _ref$className = _ref.className,
40756
40773
  className = _ref$className === void 0 ? "" : _ref$className,
40757
40774
  id = _ref.id,
40775
+ currentPath = _ref.currentPath,
40758
40776
  otherProps = _objectWithoutProperties__default["default"](_ref, _excluded$5);
40759
40777
  var _useState = React.useState(false),
40760
40778
  _useState2 = _slicedToArray__default["default"](_useState, 2),
@@ -40798,7 +40816,8 @@ var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
40798
40816
  }, properties.links.map(function (link, index) {
40799
40817
  return /*#__PURE__*/React__default["default"].createElement(Link, _extends__default["default"]({
40800
40818
  className: "hidden lg:inline",
40801
- key: getUniqueKey(link.label, link.url, index),
40819
+ isHighlighted: currentPath === link.to,
40820
+ key: getUniqueKey(link.label, link.to, index),
40802
40821
  style: design.links
40803
40822
  }, link, otherProps));
40804
40823
  }), buttons.map(function (button, index) {
@@ -40819,14 +40838,15 @@ var HeaderWithLogoTitle = function HeaderWithLogoTitle(_ref) {
40819
40838
  className: "fadeIn col-span-2 col-start-1 space-y-2 lg:hidden"
40820
40839
  }, properties.links.map(function (_ref2, index) {
40821
40840
  var label = _ref2.label,
40822
- url = _ref2.url,
40841
+ to = _ref2.to,
40823
40842
  action = _ref2.action;
40824
40843
  return /*#__PURE__*/React__default["default"].createElement(Link, _extends__default["default"]({
40825
40844
  action: action,
40826
40845
  label: label,
40827
- key: getUniqueKey(url, label, index),
40828
- style: design.links,
40829
- to: url
40846
+ to: to,
40847
+ isHighlighted: currentPath === to,
40848
+ key: getUniqueKey(to, label, index),
40849
+ style: design.links
40830
40850
  }, otherProps));
40831
40851
  }))));
40832
40852
  };