luna-one 3.1.438 → 3.1.441

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.
@@ -36,7 +36,8 @@ var CtaWithHeader = function CtaWithHeader(_ref) {
36
36
  content = _ref.content,
37
37
  buttons = _ref.buttons,
38
38
  textLinks = _ref.textLinks,
39
- paddingClass = _ref.paddingClass;
39
+ paddingClass = _ref.paddingClass,
40
+ Link = _ref.Link;
40
41
  var variantClass = null;
41
42
  var alignmentClass = null;
42
43
  var buttonsLight = {
@@ -102,19 +103,24 @@ var CtaWithHeader = function CtaWithHeader(_ref) {
102
103
  }, buttons.map(function (button, index) {
103
104
  var _buttonsVarians, _buttonsVarians2;
104
105
 
105
- var external = (0, _checkForExternalLink["default"])(button.url);
106
+ var external = (0, _checkForExternalLink["default"])(button === null || button === void 0 ? void 0 : button.url);
106
107
  return (button === null || button === void 0 ? void 0 : button.url) && (button === null || button === void 0 ? void 0 : button.text) && (textLinks ? /*#__PURE__*/_react["default"].createElement("div", {
107
108
  key: index,
108
109
  className: "text-link-container"
109
- }, /*#__PURE__*/_react["default"].createElement("a", {
110
- className: external ? "text-link-external" : "text-link",
111
- target: external ? "_blank" : "_self",
110
+ }, !external && /*#__PURE__*/_react["default"].createElement(Link, {
111
+ className: "text-link",
112
+ to: button.url,
113
+ rel: "noreferrer"
114
+ }, button.text), external && /*#__PURE__*/_react["default"].createElement("a", {
115
+ className: "text-link-external",
116
+ target: "_blank",
112
117
  href: button.url,
113
118
  rel: "noreferrer"
114
119
  }, button.text)) : /*#__PURE__*/_react["default"].createElement(Button, {
115
120
  key: index,
116
121
  className: (index + 1) % 2 !== 0 ? (_buttonsVarians = buttonsVarians) === null || _buttonsVarians === void 0 ? void 0 : _buttonsVarians.primary : (_buttonsVarians2 = buttonsVarians) === null || _buttonsVarians2 === void 0 ? void 0 : _buttonsVarians2.secondary,
117
- url: button.url
122
+ url: button.url,
123
+ Link: !external && Link
118
124
  }, button.text && button.text));
119
125
  })));
120
126
  };
@@ -142,7 +142,4 @@
142
142
  visibility: hidden;
143
143
  }
144
144
  }
145
- .flickity-viewport {
146
- height: 100%;
147
- }
148
145
  }
@@ -352,56 +352,64 @@ var NavBar = function NavBar(props) {
352
352
  };
353
353
 
354
354
  var generateNavOptions = function generateNavOptions() {
355
- return navOptions === null || navOptions === void 0 ? void 0 : navOptions.map(function (option) {
355
+ return navOptions === null || navOptions === void 0 ? void 0 : navOptions.map(function (option, i) {
356
+ var _getUrl;
357
+
358
+ if (!option) {
359
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null);
360
+ }
361
+
356
362
  var isCollapsed = !isExpanded;
357
- var url = getUrl(option).split("/")[2];
363
+ var url = getUrl(option) ? (_getUrl = getUrl(option)) === null || _getUrl === void 0 ? void 0 : _getUrl.split("/")[2] : null;
358
364
  var path = pathname && pathname.split("/")[2]; // to determine if active, check if nav url is in the first breadcrumb after the local of the pathname
359
365
 
360
366
  var active = path && (path === null || path === void 0 ? void 0 : path.includes(url));
361
- return /*#__PURE__*/_react["default"].createElement(NavOption, {
362
- key: option.text,
363
- displayIcons: displayIcons,
364
- option: option,
365
- menuBarTheme: menuBarTheme,
366
- navigate: navigate
367
- }, option.type === "category" ? /*#__PURE__*/_react["default"].createElement(MegaMenu, {
368
- key: option.text,
369
- isOpen: currentOpenMenu === option.text,
370
- content: option,
371
- Link: Link,
372
- collapsed: isCollapsed,
373
- currentOpenMenu: currentOpenMenu,
374
- displayIcons: displayIcons,
375
- icon: option.icon,
376
- theme: menuBarTheme,
377
- active: active
378
- }) : option.type === "links" ? /*#__PURE__*/_react["default"].createElement(NavMiniMenu, {
379
- navText: option.text,
380
- links: option.links,
381
- key: option.text,
382
- isOpen: currentOpenMenu === option.text,
383
- Link: Link,
384
- displayIcons: displayIcons,
385
- icon: option.icon,
386
- theme: menuBarTheme,
387
- currentOpenMenu: currentOpenMenu,
388
- active: active
389
- }) : /*#__PURE__*/_react["default"].createElement(LunaLink, {
390
- to: option.url,
391
- depth: 1,
392
- tabIndex: mouse ? "" : "0",
393
- href: option.url,
394
- key: option.text,
395
- className: "".concat(mouse ? "ter-navbar__nav-link" : "ter-navbar__nav-link tabFocus", " \n ").concat(active ? "active" : "", "\n ").concat(menuBarTheme ? "ter-navbar__nav-link--".concat(menuBarTheme) : "", "\n ").concat(displayIcons ? "ter-navbar__nav-link--with-icon" : "", "\n ").concat(displayIcons && menuBarTheme ? "ter-navbar__nav-link--with-icon--".concat(menuBarTheme) : ""),
396
- id: (0, _formatID["default"])("".concat(option.text, "-navbar-nav-link")),
397
- Link: Link,
398
- onClick: closeAllDropDowns,
399
- displayIcons: displayIcons,
400
- icon: option.icon,
401
- navigate: navigate,
402
- internalLink: option === null || option === void 0 ? void 0 : option.internalLink,
403
- target: typeof (option === null || option === void 0 ? void 0 : option.external) === 'boolean' ? option !== null && option !== void 0 && option.external ? "_blank" : "_self" : null
404
- }, /*#__PURE__*/_react["default"].createElement("p", null, option.text)));
367
+
368
+ if (option.text) {
369
+ return /*#__PURE__*/_react["default"].createElement(NavOption, {
370
+ key: "".concat(option === null || option === void 0 ? void 0 : option.text, "-").concat(i),
371
+ displayIcons: displayIcons,
372
+ option: option,
373
+ menuBarTheme: menuBarTheme,
374
+ navigate: navigate
375
+ }, option.type === "category" ? /*#__PURE__*/_react["default"].createElement(MegaMenu, {
376
+ isOpen: currentOpenMenu === (option === null || option === void 0 ? void 0 : option.text),
377
+ content: option,
378
+ Link: Link,
379
+ collapsed: isCollapsed,
380
+ currentOpenMenu: currentOpenMenu,
381
+ displayIcons: displayIcons,
382
+ icon: option.icon,
383
+ theme: menuBarTheme,
384
+ active: active
385
+ }) : option.type === "links" ? /*#__PURE__*/_react["default"].createElement(NavMiniMenu, {
386
+ navText: option === null || option === void 0 ? void 0 : option.text,
387
+ links: option === null || option === void 0 ? void 0 : option.links,
388
+ isOpen: currentOpenMenu === (option === null || option === void 0 ? void 0 : option.text),
389
+ Link: Link,
390
+ displayIcons: displayIcons,
391
+ icon: option.icon,
392
+ theme: menuBarTheme,
393
+ currentOpenMenu: currentOpenMenu,
394
+ active: active
395
+ }) : /*#__PURE__*/_react["default"].createElement(LunaLink, {
396
+ to: option.url,
397
+ depth: 1,
398
+ tabIndex: mouse ? "" : "0",
399
+ href: option === null || option === void 0 ? void 0 : option.url,
400
+ className: "".concat(mouse ? "ter-navbar__nav-link" : "ter-navbar__nav-link tabFocus", " \n ").concat(active ? "active" : "", "\n ").concat(menuBarTheme ? "ter-navbar__nav-link--".concat(menuBarTheme) : "", "\n ").concat(displayIcons ? "ter-navbar__nav-link--with-icon" : "", "\n ").concat(displayIcons && menuBarTheme ? "ter-navbar__nav-link--with-icon--".concat(menuBarTheme) : ""),
401
+ id: (0, _formatID["default"])("".concat(option.text, "-navbar-nav-link")),
402
+ Link: Link,
403
+ onClick: closeAllDropDowns,
404
+ displayIcons: displayIcons,
405
+ icon: option === null || option === void 0 ? void 0 : option.icon,
406
+ navigate: navigate,
407
+ internalLink: option === null || option === void 0 ? void 0 : option.internalLink,
408
+ target: typeof (option === null || option === void 0 ? void 0 : option.external) === "boolean" ? option !== null && option !== void 0 && option.external ? "_blank" : "_self" : null
409
+ }, /*#__PURE__*/_react["default"].createElement("p", null, option.text)));
410
+ } else {
411
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null);
412
+ }
405
413
  });
406
414
  };
407
415
 
@@ -502,7 +510,6 @@ var NavBar = function NavBar(props) {
502
510
  }, !disableMenus && /*#__PURE__*/_react["default"].createElement("div", {
503
511
  className: "ter-navbar__wrapper \n ".concat(menuBarTheme ? "ter-navbar__wrapper--".concat(menuBarTheme) : "", "\n ").concat(displayIcons ? "ter-navbar__wrapper--with-icons" : "", "\n ").concat(displayIcons && menuBarTheme ? "ter-navbar__wrapper--with-icons--".concat(menuBarTheme) : "", "\n ")
504
512
  }, /*#__PURE__*/_react["default"].createElement("div", {
505
- id: _lodash["default"].uniqueId("id-"),
506
513
  className: "ter-navbar__menus-wrapper ".concat(displayIcons ? "ter-navbar__menus-wrapper--with-icons" : "")
507
514
  }, generateNavOptions(), featuredLink && generateFeaturedLink()))), /*#__PURE__*/_react["default"].createElement(MobileNav, {
508
515
  rightLinks: rightLinks,
@@ -545,7 +552,6 @@ var NavBar = function NavBar(props) {
545
552
  })), /*#__PURE__*/_react["default"].createElement("div", {
546
553
  className: "ter-navbar__flyout-logo"
547
554
  }, /*#__PURE__*/_react["default"].createElement("img", {
548
- id: _lodash["default"].uniqueId("id-"),
549
555
  src: _logoIcon["default"],
550
556
  alt: "open flyout"
551
557
  }))))), sectorFlyoutData && sectorFlyoutDeployed && /*#__PURE__*/_react["default"].createElement(Flyout, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "luna-one",
3
- "version": "3.1.438",
3
+ "version": "3.1.441",
4
4
  "peerDependencies": {
5
5
  "react": "^17.0.2",
6
6
  "react-dom": "^17.0.2",