@linzjs/lui 17.42.0 → 17.43.0
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 +7 -0
- package/dist/components/LuiHeaderMenuV2/LuiHeaderMenusV2.d.ts +5 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/lui.css +5 -0
- package/dist/lui.css.map +1 -1
- package/dist/lui.esm.js +5 -4
- package/dist/lui.esm.js.map +1 -1
- package/dist/scss/Components/MenuV2/menu-v2.scss +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [17.43.0](https://github.com/linz/lui/compare/v17.42.0...v17.43.0) (2023-03-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **headerV2:** Support href inside menu item ([#893](https://github.com/linz/lui/issues/893)) ([83cf363](https://github.com/linz/lui/commit/83cf36305de370229e8157e62ac71a0c46259657))
|
|
7
|
+
|
|
1
8
|
# [17.42.0](https://github.com/linz/lui/compare/v17.41.10...v17.42.0) (2023-03-19)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -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("
|
|
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
|
/**
|