@linzjs/lui 17.42.0 → 17.43.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [17.43.1](https://github.com/linz/lui/compare/v17.43.0...v17.43.1) (2023-03-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **header-menu:** update shadow style ([#897](https://github.com/linz/lui/issues/897)) ([7864ca8](https://github.com/linz/lui/commit/7864ca86dec1309c74c1503523fc111292b7e70d))
7
+
8
+ # [17.43.0](https://github.com/linz/lui/compare/v17.42.0...v17.43.0) (2023-03-19)
9
+
10
+
11
+ ### Features
12
+
13
+ * **headerV2:** Support href inside menu item ([#893](https://github.com/linz/lui/issues/893)) ([83cf363](https://github.com/linz/lui/commit/83cf36305de370229e8157e62ac71a0c46259657))
14
+
1
15
  # [17.42.0](https://github.com/linz/lui/compare/v17.41.10...v17.42.0) (2023-03-19)
2
16
 
3
17
 
@@ -33,11 +33,15 @@ interface LuiDrawerMenuOptionV2Props {
33
33
  * false - remains open on clicking
34
34
  */
35
35
  closeMenuOnClick?: boolean;
36
+ /**
37
+ * Open link in a new tab
38
+ */
39
+ url?: string;
36
40
  }
37
41
  declare const LuiDrawerMenuOptionsV2: ({ children, }: {
38
42
  children: ReactNode;
39
43
  }) => JSX.Element;
40
- declare const LuiDrawerMenuOptionV2: ({ icon, iconColor, label, badge, iconSize, closeMenuOnClick, onClick, }: LuiDrawerMenuOptionV2Props) => JSX.Element;
44
+ declare const LuiDrawerMenuOptionV2: ({ icon, iconColor, label, badge, iconSize, closeMenuOnClick, onClick, url, }: LuiDrawerMenuOptionV2Props) => JSX.Element;
41
45
  declare type LuiDrawerMenuV2Props = Omit<LuiHeaderMenuItemV2Props, 'onClick' | 'isSelected'> & {
42
46
  hasStickyHeader?: boolean;
43
47
  size?: Exclude<Size, 'xs'>;
package/dist/index.js CHANGED
@@ -40517,17 +40517,18 @@ var LuiDrawerMenuOptionsV2 = function (_a) {
40517
40517
  return (React__default["default"].createElement("div", { className: "LuiHeaderMenuV2-drawer-options" }, children));
40518
40518
  };
40519
40519
  var LuiDrawerMenuOptionV2 = function (_a) {
40520
- var icon = _a.icon, iconColor = _a.iconColor, label = _a.label, badge = _a.badge, _b = _a.iconSize, iconSize = _b === void 0 ? 'md' : _b, _c = _a.closeMenuOnClick, closeMenuOnClick = _c === void 0 ? true : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d;
40520
+ var icon = _a.icon, iconColor = _a.iconColor, label = _a.label, badge = _a.badge, _b = _a.iconSize, iconSize = _b === void 0 ? 'md' : _b, _c = _a.closeMenuOnClick, closeMenuOnClick = _c === void 0 ? true : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, url = _a.url;
40521
40521
  var menu = useLuiCloseableHeaderMenuContextV2();
40522
+ var optionLabel = (React__default["default"].createElement("div", { className: "LuiHeaderMenuV2-drawer-option-label" },
40523
+ typeof icon === 'string' ? (React__default["default"].createElement(LuiIcon, { size: iconSize, name: icon, alt: '', color: iconColor, "data-testid": 'drawer-option-icon' })) : (icon),
40524
+ label));
40522
40525
  return (React__default["default"].createElement("div", { className: "LuiHeaderMenuV2-drawer-option", onClick: function () {
40523
40526
  if (closeMenuOnClick) {
40524
40527
  menu.close();
40525
40528
  }
40526
40529
  onClick();
40527
40530
  }, "data-testid": 'drawer-option' },
40528
- React__default["default"].createElement("div", { className: "LuiHeaderMenuV2-drawer-option-label" },
40529
- typeof icon === 'string' ? (React__default["default"].createElement(LuiIcon, { size: iconSize, name: icon, alt: '', color: iconColor, "data-testid": 'drawer-option-icon' })) : (icon),
40530
- label),
40531
+ url ? (React__default["default"].createElement("a", { target: "_blank", href: url, rel: "noreferrer" }, optionLabel)) : (optionLabel),
40531
40532
  badge && (React__default["default"].createElement("div", { className: "LuiHeaderMenuV2-drawer-option-badge" }, badge))));
40532
40533
  };
40533
40534
  /**