@linzjs/lui 17.29.0 → 17.29.1-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/dist/components/LuiHeader/LuiHeader.d.ts +8 -0
- package/dist/components/LuiHeader/LuiHeaderV2.d.ts +16 -0
- package/dist/components/LuiHeaderMenu/LuiHeaderMenus.d.ts +12 -0
- package/dist/components/LuiHeaderMenu/LuiHeaderMenusV2.d.ts +26 -0
- package/dist/components/common/UseMediaQuery.d.ts +9 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +198 -0
- package/dist/index.js.map +1 -1
- package/dist/lui.css +324 -0
- package/dist/lui.css.map +1 -1
- package/dist/lui.esm.js +187 -1
- package/dist/lui.esm.js.map +1 -1
- package/dist/scss/Components/Header/header-v2.scss +204 -0
- package/dist/scss/Components/Menu/menu-v2.scss +165 -0
- package/dist/scss/base.scss +2 -0
- package/package.json +4 -3
|
@@ -9,6 +9,9 @@ interface HeaderProps {
|
|
|
9
9
|
transparent?: boolean;
|
|
10
10
|
sticky?: boolean;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated: this is replaced by LuiHeaderV2
|
|
14
|
+
*/
|
|
12
15
|
declare const LuiHeader: React.FC<React.PropsWithChildren<HeaderProps>>;
|
|
13
16
|
interface ILuiIcon {
|
|
14
17
|
/**
|
|
@@ -39,6 +42,8 @@ interface ILuiHeaderMenuItem extends ILuiIcon {
|
|
|
39
42
|
'data-testid'?: string;
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
45
|
+
* @deprecated: this is replaced by LuiHeaderMenuItemV2
|
|
46
|
+
*
|
|
42
47
|
* The \`LuiHeaderMenuItem\` is the base component for all menu items that are to be shown in the header.
|
|
43
48
|
* Note that it depends on it being rendered inside a LuiHeader for its styles to apply properly.
|
|
44
49
|
* To configure the item for responsiveness, ensure to set any of the hideOn* properties.
|
|
@@ -56,6 +61,9 @@ interface ILuiCloseableHeaderMenuItem extends Omit<ILuiHeaderMenuItem, 'onClick'
|
|
|
56
61
|
open: boolean;
|
|
57
62
|
setOpen: (value: boolean) => void;
|
|
58
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated replaced by LuiCloseableHeaderMenuItemV2
|
|
66
|
+
*/
|
|
59
67
|
declare const LuiCloseableHeaderMenuItem: React.FC<React.PropsWithChildren<ILuiCloseableHeaderMenuItem>>;
|
|
60
68
|
interface ILuiMenuCloseButton extends ILuiIcon {
|
|
61
69
|
'data-testid'?: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { HeaderSize, ILuiCloseableHeaderMenuItem, ILuiHeaderMenuItem } from './LuiHeader';
|
|
3
|
+
interface HeaderPropsV2 {
|
|
4
|
+
headingText?: string;
|
|
5
|
+
size?: HeaderSize;
|
|
6
|
+
homeLink?: string | (() => void);
|
|
7
|
+
transparent?: boolean;
|
|
8
|
+
sticky?: boolean;
|
|
9
|
+
appMenu?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const LuiHeaderV2: React.FC<React.PropsWithChildren<HeaderPropsV2>>;
|
|
12
|
+
declare const LuiHeaderMenuItemV2: React.ForwardRefExoticComponent<ILuiHeaderMenuItem & {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const LuiCloseableHeaderMenuItemV2: React.FC<React.PropsWithChildren<ILuiCloseableHeaderMenuItem>>;
|
|
16
|
+
export { LuiHeaderV2, LuiHeaderMenuItemV2, LuiCloseableHeaderMenuItemV2 };
|
|
@@ -18,13 +18,25 @@ interface ILuiDrawerMenuOption {
|
|
|
18
18
|
*/
|
|
19
19
|
onClick?: () => void;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated replaced by LuiDrawerMenuOptionsV2
|
|
23
|
+
*/
|
|
21
24
|
declare const LuiDrawerMenuOptions: React.FC<React.PropsWithChildren<ILuiIcon>>;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated replaced by LuiDrawerMenuOptionV2
|
|
27
|
+
*/
|
|
22
28
|
declare const LuiDrawerMenuOption: React.FC<React.PropsWithChildren<ILuiDrawerMenuOption>>;
|
|
23
29
|
declare type ILuiDrawerMenu = Omit<ILuiHeaderMenuItem, 'onClick'> & {
|
|
24
30
|
hasStickyHeader?: boolean;
|
|
25
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated replaced by LuiDrawerMenuV2
|
|
34
|
+
*/
|
|
26
35
|
declare const LuiDrawerMenu: React.FC<React.PropsWithChildren<ILuiDrawerMenu>>;
|
|
27
36
|
declare type ILuiDropdownMenu = Omit<ILuiHeaderMenuItem, 'onClick'>;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated replaced by LuiDropdownMenuV2
|
|
39
|
+
*/
|
|
28
40
|
declare const LuiDropdownMenu: React.FC<React.PropsWithChildren<ILuiDropdownMenu>>;
|
|
29
41
|
interface ILuiDrawerMenuSection {
|
|
30
42
|
/**
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ILuiHeaderMenuItem, ILuiIcon } from '../LuiHeader/LuiHeader';
|
|
3
|
+
import { ILuiDrawerMenu, ILuiDrawerMenuOption, ILuiDrawerMenuSection } from './LuiHeaderMenus';
|
|
4
|
+
import { Size } from '../common/ResponsiveUtils';
|
|
5
|
+
declare const LuiDrawerMenuOptionsV2: React.FC<React.PropsWithChildren<ILuiIcon>>;
|
|
6
|
+
/**
|
|
7
|
+
* display badge on the left
|
|
8
|
+
*/
|
|
9
|
+
declare const LuiDrawerMenuOptionV2: React.FC<React.PropsWithChildren<ILuiDrawerMenuOption>>;
|
|
10
|
+
declare const LuiDrawerMenuV2: React.FC<React.PropsWithChildren<ILuiDrawerMenu>>;
|
|
11
|
+
declare type ILuiDropdownMenuV2 = Omit<ILuiHeaderMenuItem, 'onClick'> & {
|
|
12
|
+
/**
|
|
13
|
+
* The anchor origin of dropdown, default to left
|
|
14
|
+
*/
|
|
15
|
+
anchorOrigin?: {
|
|
16
|
+
horizontal?: 'left' | 'right';
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* the width of dropdown, default to 'md'
|
|
20
|
+
*/
|
|
21
|
+
size?: Size | 'xxl';
|
|
22
|
+
};
|
|
23
|
+
declare const LuiDropdownMenuV2: React.FC<React.PropsWithChildren<ILuiDropdownMenuV2>>;
|
|
24
|
+
declare const LuiDrawerMenuSectionV2: (props: ILuiDrawerMenuSection) => JSX.Element;
|
|
25
|
+
declare const LuiDrawerMenuDividerV2: () => JSX.Element;
|
|
26
|
+
export { LuiDrawerMenuV2, LuiDrawerMenuOptionsV2, LuiDrawerMenuOptionV2, ILuiDropdownMenuV2, LuiDropdownMenuV2, LuiDrawerMenuSectionV2, LuiDrawerMenuDividerV2, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Size } from './ResponsiveUtils';
|
|
2
|
+
export declare type Breakpoint = Exclude<Size | 'xxl', 'xs'>;
|
|
3
|
+
export declare const breakpoints: Record<Breakpoint, number>;
|
|
4
|
+
export declare const breakpointQuery: {
|
|
5
|
+
up: (bp: Breakpoint) => string;
|
|
6
|
+
down: (bp: Breakpoint) => string;
|
|
7
|
+
between: (bp1: Breakpoint, bp2: Breakpoint) => string;
|
|
8
|
+
};
|
|
9
|
+
export declare const useMediaQuery: (query: string) => boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,9 @@ export { LuiFooter } from './components/LuiFooter/LuiFooter';
|
|
|
36
36
|
export { LuiComboSelect, LuiComboSelectProps, LuiComboSelectOption, } from './components/LuiForms/LuiComboSelect/LuiComboSelect';
|
|
37
37
|
export { LuiFormSectionHeader, IFormSectionHeaderProps, } from './components/LuiForms/LuiFormSection/LuiFormSectionHeader';
|
|
38
38
|
export * from './components/LuiHeader/LuiHeader';
|
|
39
|
+
export * from './components/LuiHeader/LuiHeaderV2';
|
|
39
40
|
export * from './components/LuiHeaderMenu/LuiHeaderMenus';
|
|
41
|
+
export * from './components/LuiHeaderMenu/LuiHeaderMenusV2';
|
|
40
42
|
export { LuiUpdatesSplashModal } from './components/LuiUpdateSplashModal/LuiUpdatesSplashModal';
|
|
41
43
|
export { LuiModal, LuiAlertModal, LuiAlertModalButtons, } from './components/LuiModal/LuiModal';
|
|
42
44
|
export { ISearchInputProps, ISearchGroupedResult, ISearchResult, LuiSearchInput, } from './components/LuiSearchInput/LuiSearchInput';
|
|
@@ -67,3 +69,4 @@ export { RadioItemRenderer } from './components/LuiListBox/Renderers/RadioItemRe
|
|
|
67
69
|
export { CheckboxItemRenderer } from './components/LuiListBox/Renderers/CheckboxItemRenderer';
|
|
68
70
|
export { LuiSideMenu, ILuiSideMenuProps, } from './components/LuiSideMenu/LuiSideMenu';
|
|
69
71
|
export { LuiSideMenuItem, ILuiSideMenuItemProps, LuiMenuItemClickHandler, } from './components/LuiSideMenu/LuiSideMenuItem';
|
|
72
|
+
export { Breakpoint, breakpoints, breakpointQuery, useMediaQuery, } from './components/common/UseMediaQuery';
|
package/dist/index.js
CHANGED
|
@@ -40119,8 +40119,12 @@ var buildHideClassDict = function (_a) {
|
|
|
40119
40119
|
};
|
|
40120
40120
|
};
|
|
40121
40121
|
|
|
40122
|
+
/**
|
|
40123
|
+
* @deprecated: this is replaced by LuiHeaderV2
|
|
40124
|
+
*/
|
|
40122
40125
|
var LuiHeader = function (_a) {
|
|
40123
40126
|
var headingText = _a.headingText, _b = _a.size, size = _b === void 0 ? 'small' : _b, homeLink = _a.homeLink, transparent = _a.transparent, children = _a.children, _c = _a.sticky, sticky = _c === void 0 ? true : _c;
|
|
40127
|
+
useDeprecatedWarning('LuiHeader');
|
|
40124
40128
|
var logoElement = size === 'normal' ? (React__default["default"].createElement("img", { className: "linz-logo", alt: "LINZ Logo", src: logo })) : (React__default["default"].createElement("img", { className: "linz-motif", alt: "LINZ Logo", src: motif }));
|
|
40125
40129
|
var logoContainer = logoElement;
|
|
40126
40130
|
if (typeof homeLink === 'string') {
|
|
@@ -40145,12 +40149,15 @@ var LuiHeader = function (_a) {
|
|
|
40145
40149
|
React__default["default"].createElement("div", { className: "lui-header-col" }, children))));
|
|
40146
40150
|
};
|
|
40147
40151
|
/**
|
|
40152
|
+
* @deprecated: this is replaced by LuiHeaderMenuItemV2
|
|
40153
|
+
*
|
|
40148
40154
|
* The \`LuiHeaderMenuItem\` is the base component for all menu items that are to be shown in the header.
|
|
40149
40155
|
* Note that it depends on it being rendered inside a LuiHeader for its styles to apply properly.
|
|
40150
40156
|
* To configure the item for responsiveness, ensure to set any of the hideOn* properties.
|
|
40151
40157
|
*/
|
|
40152
40158
|
var LuiHeaderMenuItem = React$1.forwardRef(function (_a, ref) {
|
|
40153
40159
|
var icon = _a.icon, label = _a.label, badge = _a.badge, hide = _a.hide, onClick = _a.onClick, _b = _a["data-testid"], dataTestId = _b === void 0 ? 'menu-item' : _b, children = _a.children;
|
|
40160
|
+
useDeprecatedWarning('LuiHeaderMenuItem');
|
|
40154
40161
|
var menuItemClasses = clsx$1('lui-header-menu-item', hide && buildHideClassDict(hide));
|
|
40155
40162
|
var resolvedIcon = !icon && !label ? 'menu' : icon;
|
|
40156
40163
|
return (React__default["default"].createElement("div", { className: menuItemClasses, ref: ref },
|
|
@@ -40165,8 +40172,12 @@ var LuiCloseableHeaderMenuContext = React$1.createContext({
|
|
|
40165
40172
|
open: function () { },
|
|
40166
40173
|
close: function () { }
|
|
40167
40174
|
});
|
|
40175
|
+
/**
|
|
40176
|
+
* @deprecated replaced by LuiCloseableHeaderMenuItemV2
|
|
40177
|
+
*/
|
|
40168
40178
|
var LuiCloseableHeaderMenuItem = function (_a) {
|
|
40169
40179
|
var open = _a.open, setOpen = _a.setOpen, props = __rest$1(_a, ["open", "setOpen"]);
|
|
40180
|
+
useDeprecatedWarning('LuiCloseableHeaderMenuItem');
|
|
40170
40181
|
useEscapeFunction(function () { return setOpen(false); });
|
|
40171
40182
|
var menuDiv = usePageClickFunction(function (event) { return open || event.stopPropagation(); }, function (event) {
|
|
40172
40183
|
if (!open) {
|
|
@@ -40190,12 +40201,76 @@ var LuiMenuCloseButton = function (_a) {
|
|
|
40190
40201
|
return (React__default["default"].createElement("i", { className: classes, onClick: menu.close, "data-testid": dataTestId }, icon));
|
|
40191
40202
|
};
|
|
40192
40203
|
|
|
40204
|
+
var LuiHeaderV2 = function (_a) {
|
|
40205
|
+
var headingText = _a.headingText, _b = _a.size, size = _b === void 0 ? 'small' : _b, homeLink = _a.homeLink, transparent = _a.transparent, children = _a.children, _c = _a.sticky, sticky = _c === void 0 ? true : _c, appMenu = _a.appMenu;
|
|
40206
|
+
var logoElement = size === 'normal' ? (React__default["default"].createElement("img", { className: "linz-logo-v2", alt: "LINZ Logo", src: logo })) : (React__default["default"].createElement("img", { className: "linz-motif-v2", alt: "LINZ Logo", src: motif }));
|
|
40207
|
+
var logoContainer = logoElement;
|
|
40208
|
+
if (typeof homeLink === 'string') {
|
|
40209
|
+
logoContainer = React__default["default"].createElement("a", { href: homeLink }, logoElement);
|
|
40210
|
+
}
|
|
40211
|
+
else if (typeof homeLink === 'function') {
|
|
40212
|
+
logoContainer = (React__default["default"].createElement("div", { className: "clickable", onClick: function () {
|
|
40213
|
+
homeLink();
|
|
40214
|
+
} }, logoElement));
|
|
40215
|
+
}
|
|
40216
|
+
return (React__default["default"].createElement("header", { className: clsx$1({
|
|
40217
|
+
'lui-header-v2': true,
|
|
40218
|
+
'lui-header-transparent': transparent,
|
|
40219
|
+
'lui-header-small-v2': size === 'small',
|
|
40220
|
+
'lui-header-sticky-v2': sticky
|
|
40221
|
+
}) },
|
|
40222
|
+
React__default["default"].createElement("div", { className: "lui-header-row-v2" },
|
|
40223
|
+
React__default["default"].createElement("div", { className: "lui-header-col-v2" },
|
|
40224
|
+
!!appMenu && appMenu,
|
|
40225
|
+
React__default["default"].createElement("div", { className: "lui-header-logo-v2" }, logoContainer),
|
|
40226
|
+
headingText && (React__default["default"].createElement("div", { className: "lui-header-title-v2" },
|
|
40227
|
+
React__default["default"].createElement("h1", null, headingText)))),
|
|
40228
|
+
React__default["default"].createElement("div", { className: "lui-header-col-v2" }, children))));
|
|
40229
|
+
};
|
|
40230
|
+
var LuiHeaderMenuItemV2 = React$1.forwardRef(function (_a, ref) {
|
|
40231
|
+
var icon = _a.icon, label = _a.label, badge = _a.badge, hide = _a.hide, onClick = _a.onClick, _b = _a["data-testid"], dataTestId = _b === void 0 ? 'menu-item' : _b, children = _a.children;
|
|
40232
|
+
var menuItemClasses = clsx$1('lui-header-menu-item-v2', hide && buildHideClassDict(hide));
|
|
40233
|
+
var resolvedIcon = !icon && !label ? 'menu' : icon;
|
|
40234
|
+
return (React__default["default"].createElement("div", { className: menuItemClasses, ref: ref },
|
|
40235
|
+
React__default["default"].createElement("div", { className: "lui-header-menu-button" },
|
|
40236
|
+
React__default["default"].createElement("div", { className: clsx$1('lui-header-menu-icon', onClick && 'clickable'), onClick: onClick, "data-testid": dataTestId }, resolvedIcon && (React__default["default"].createElement("i", { title: "Main menu", className: "material-icons-round lui-icon-md" }, resolvedIcon))),
|
|
40237
|
+
label && React__default["default"].createElement("div", { className: "lui-menu-label-v2" }, label),
|
|
40238
|
+
badge && React__default["default"].createElement("div", { className: "badge-v2" }, badge)),
|
|
40239
|
+
children));
|
|
40240
|
+
});
|
|
40241
|
+
var LuiCloseableHeaderMenuItemV2 = function (_a) {
|
|
40242
|
+
var open = _a.open, setOpen = _a.setOpen, props = __rest$1(_a, ["open", "setOpen"]);
|
|
40243
|
+
useEscapeFunction(function () { return setOpen(false); });
|
|
40244
|
+
var menuDiv = usePageClickFunction(function (event) { return open || event.stopPropagation(); }, function (event) {
|
|
40245
|
+
if (!open) {
|
|
40246
|
+
event.stopPropagation();
|
|
40247
|
+
setOpen(false);
|
|
40248
|
+
}
|
|
40249
|
+
});
|
|
40250
|
+
var menuControls = {
|
|
40251
|
+
isOpen: function () { return open; },
|
|
40252
|
+
open: function () { return setOpen(!open); },
|
|
40253
|
+
close: function () { return setOpen(false); }
|
|
40254
|
+
};
|
|
40255
|
+
var menuItemProps = __assign$3({ onClick: function () { return menuControls.open(); } }, props);
|
|
40256
|
+
return (React__default["default"].createElement(LuiCloseableHeaderMenuContext.Provider, { value: menuControls },
|
|
40257
|
+
React__default["default"].createElement(LuiHeaderMenuItemV2, __assign$3({ ref: menuDiv }, menuItemProps), props.children)));
|
|
40258
|
+
};
|
|
40259
|
+
|
|
40260
|
+
/**
|
|
40261
|
+
* @deprecated replaced by LuiDrawerMenuOptionsV2
|
|
40262
|
+
*/
|
|
40193
40263
|
var LuiDrawerMenuOptions = function (_a) {
|
|
40194
40264
|
var children = _a.children;
|
|
40265
|
+
useDeprecatedWarning('LuiDrawerMenuOptions');
|
|
40195
40266
|
return React__default["default"].createElement("div", { className: "lui-menu-drawer-options" }, children);
|
|
40196
40267
|
};
|
|
40268
|
+
/**
|
|
40269
|
+
* @deprecated replaced by LuiDrawerMenuOptionV2
|
|
40270
|
+
*/
|
|
40197
40271
|
var LuiDrawerMenuOption = function (_a) {
|
|
40198
40272
|
var icon = _a.icon, label = _a.label, badge = _a.badge, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b;
|
|
40273
|
+
useDeprecatedWarning('LuiDrawerMenuOption');
|
|
40199
40274
|
var menu = React$1.useContext(LuiCloseableHeaderMenuContext);
|
|
40200
40275
|
return (React__default["default"].createElement("div", { className: "lui-menu-drawer-option", onClick: function () {
|
|
40201
40276
|
menu.close();
|
|
@@ -40206,8 +40281,12 @@ var LuiDrawerMenuOption = function (_a) {
|
|
|
40206
40281
|
label),
|
|
40207
40282
|
badge));
|
|
40208
40283
|
};
|
|
40284
|
+
/**
|
|
40285
|
+
* @deprecated replaced by LuiDrawerMenuV2
|
|
40286
|
+
*/
|
|
40209
40287
|
var LuiDrawerMenu = function (_a) {
|
|
40210
40288
|
var restOfProps = __rest$1(_a, []);
|
|
40289
|
+
useDeprecatedWarning('LuiDrawerMenu');
|
|
40211
40290
|
var children = restOfProps.children, _b = restOfProps.hasStickyHeader, hasStickyHeader = _b === void 0 ? true : _b, menuPropsCopy = __rest$1(restOfProps, ["children", "hasStickyHeader"]);
|
|
40212
40291
|
var _c = React$1.useState(false), open = _c[0], setOpen = _c[1];
|
|
40213
40292
|
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open, setOpen: setOpen, icon: open ? 'close' : 'menu', onClick: function () { return setOpen(!open); } });
|
|
@@ -40230,8 +40309,12 @@ var LuiDrawerMenu = function (_a) {
|
|
|
40230
40309
|
'lui-menu-drawer-closed': !open
|
|
40231
40310
|
}), "data-testid": 'drawer', "aria-hidden": !open }, children)));
|
|
40232
40311
|
};
|
|
40312
|
+
/**
|
|
40313
|
+
* @deprecated replaced by LuiDropdownMenuV2
|
|
40314
|
+
*/
|
|
40233
40315
|
var LuiDropdownMenu = function (_a) {
|
|
40234
40316
|
var restOfProps = __rest$1(_a, []);
|
|
40317
|
+
useDeprecatedWarning('LuiDropdownMenu');
|
|
40235
40318
|
var children = restOfProps.children, menuPropsCopy = __rest$1(restOfProps, ["children"]);
|
|
40236
40319
|
var _b = React$1.useState(false), open = _b[0], setOpen = _b[1];
|
|
40237
40320
|
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open, setOpen: setOpen });
|
|
@@ -40257,6 +40340,81 @@ var LuiDrawerMenuDivider = function () {
|
|
|
40257
40340
|
return React__default["default"].createElement("hr", { className: "LuiDrawerMenuDivider" });
|
|
40258
40341
|
};
|
|
40259
40342
|
|
|
40343
|
+
var LuiDrawerMenuOptionsV2 = function (_a) {
|
|
40344
|
+
var children = _a.children;
|
|
40345
|
+
return React__default["default"].createElement("div", { className: "lui-menu-drawer-v2-options" }, children);
|
|
40346
|
+
};
|
|
40347
|
+
/**
|
|
40348
|
+
* display badge on the left
|
|
40349
|
+
*/
|
|
40350
|
+
var LuiDrawerMenuOptionV2 = function (_a) {
|
|
40351
|
+
var icon = _a.icon, label = _a.label, badge = _a.badge, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b;
|
|
40352
|
+
var menu = React$1.useContext(LuiCloseableHeaderMenuContext);
|
|
40353
|
+
return (React__default["default"].createElement("div", { className: "lui-menu-drawer-v2-option", onClick: function () {
|
|
40354
|
+
menu.close();
|
|
40355
|
+
onClick();
|
|
40356
|
+
}, "data-testid": 'drawer-option' },
|
|
40357
|
+
React__default["default"].createElement("div", { className: "lui-menu-drawer-v2-option-label" },
|
|
40358
|
+
badge,
|
|
40359
|
+
typeof icon === 'string' ? (React__default["default"].createElement("i", { className: "material-icons-round", "data-testid": 'drawer-option-icon' }, icon)) : (icon),
|
|
40360
|
+
label)));
|
|
40361
|
+
};
|
|
40362
|
+
var LuiDrawerMenuV2 = function (_a) {
|
|
40363
|
+
var restOfProps = __rest$1(_a, []);
|
|
40364
|
+
var children = restOfProps.children, _b = restOfProps.hasStickyHeader, hasStickyHeader = _b === void 0 ? true : _b, menuPropsCopy = __rest$1(restOfProps, ["children", "hasStickyHeader"]);
|
|
40365
|
+
var _c = React$1.useState(false), open = _c[0], setOpen = _c[1];
|
|
40366
|
+
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open, setOpen: setOpen, icon: open ? 'close' : 'menu', onClick: function () { return setOpen(!open); } });
|
|
40367
|
+
React$1.useEffect(function () {
|
|
40368
|
+
// Support for non-sticky headers. Scroll back to top when menu is opened
|
|
40369
|
+
if (open && !hasStickyHeader) {
|
|
40370
|
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
40371
|
+
}
|
|
40372
|
+
// Disable page scrolling while menu is open
|
|
40373
|
+
if (open) {
|
|
40374
|
+
document.body.classList.add('lui-menu-drawer-v2-open');
|
|
40375
|
+
}
|
|
40376
|
+
else {
|
|
40377
|
+
document.body.classList.remove('lui-menu-drawer-v2-open');
|
|
40378
|
+
}
|
|
40379
|
+
}, [open, hasStickyHeader]);
|
|
40380
|
+
return (React__default["default"].createElement(LuiCloseableHeaderMenuItemV2, __assign$3({}, closeableMenuProps),
|
|
40381
|
+
React__default["default"].createElement("div", { className: clsx$1({
|
|
40382
|
+
'lui-menu-drawer-v2': true,
|
|
40383
|
+
'lui-menu-drawer-v2-closed': !open
|
|
40384
|
+
}), "data-testid": 'drawer', "aria-hidden": !open }, children)));
|
|
40385
|
+
};
|
|
40386
|
+
var LuiDropdownMenuV2 = function (_a) {
|
|
40387
|
+
var restOfProps = __rest$1(_a, []);
|
|
40388
|
+
var children = restOfProps.children, _b = restOfProps.anchorOrigin, _c = _b === void 0 ? {
|
|
40389
|
+
horizontal: 'left'
|
|
40390
|
+
} : _b, _d = _c.horizontal, horizontal = _d === void 0 ? 'left' : _d, _e = restOfProps.size, size = _e === void 0 ? 'md' : _e, menuPropsCopy = __rest$1(restOfProps, ["children", "anchorOrigin", "size"]);
|
|
40391
|
+
var _f = React$1.useState(false), open = _f[0], setOpen = _f[1];
|
|
40392
|
+
var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open, setOpen: setOpen });
|
|
40393
|
+
return (React__default["default"].createElement(LuiCloseableHeaderMenuItemV2, __assign$3({}, closeableMenuProps),
|
|
40394
|
+
React__default["default"].createElement("div", { className: "lui-menu-dropdown-container" },
|
|
40395
|
+
React__default["default"].createElement("div", { className: clsx$1({
|
|
40396
|
+
'lui-menu-dropdown-v2': true,
|
|
40397
|
+
'dropdown-horizontal-right': horizontal === 'right',
|
|
40398
|
+
'dropdown-horizontal-left': horizontal === 'left',
|
|
40399
|
+
'dropdown-xxl': size === 'xxl',
|
|
40400
|
+
'dropdown-xl': size === 'xl',
|
|
40401
|
+
'dropdown-lg': size === 'lg',
|
|
40402
|
+
'dropdown-md': size === 'md',
|
|
40403
|
+
'dropdown-sm': size === 'sm',
|
|
40404
|
+
'dropdown-xs': size === 'xs',
|
|
40405
|
+
'lui-box-shadow': true,
|
|
40406
|
+
'lui-menu-dropdown-v2-closed': !open
|
|
40407
|
+
}), "data-testid": 'dropdown', "aria-hidden": !open },
|
|
40408
|
+
children,
|
|
40409
|
+
' '))));
|
|
40410
|
+
};
|
|
40411
|
+
var LuiDrawerMenuSectionV2 = function (props) {
|
|
40412
|
+
return React__default["default"].createElement(LuiDrawerMenuSection, __assign$3({}, props));
|
|
40413
|
+
};
|
|
40414
|
+
var LuiDrawerMenuDividerV2 = function () {
|
|
40415
|
+
return React__default["default"].createElement(LuiDrawerMenuDivider, null);
|
|
40416
|
+
};
|
|
40417
|
+
|
|
40260
40418
|
var lib = {exports: {}};
|
|
40261
40419
|
|
|
40262
40420
|
var Modal$2 = {};
|
|
@@ -57989,6 +58147,34 @@ function LuiSideMenuItem(_a) {
|
|
|
57989
58147
|
React__default["default"].createElement("span", { className: "navText" }, label))));
|
|
57990
58148
|
}
|
|
57991
58149
|
|
|
58150
|
+
var breakpoints = {
|
|
58151
|
+
sm: 480,
|
|
58152
|
+
md: 768,
|
|
58153
|
+
lg: 1024,
|
|
58154
|
+
xl: 1280,
|
|
58155
|
+
xxl: 1600
|
|
58156
|
+
};
|
|
58157
|
+
var breakpointQuery = {
|
|
58158
|
+
up: function (bp) { return "(min-width: ".concat(breakpoints[bp], "px)"); },
|
|
58159
|
+
down: function (bp) { return "(max-width: ".concat(breakpoints[bp], "px)"); },
|
|
58160
|
+
between: function (bp1, bp2) {
|
|
58161
|
+
return "(min-width: ".concat(breakpoints[bp1], "px) and (max-width: ").concat(breakpoints[bp2], "px)");
|
|
58162
|
+
}
|
|
58163
|
+
};
|
|
58164
|
+
var useMediaQuery = function (query) {
|
|
58165
|
+
var _a = React$1.useState(false), matches = _a[0], setMatches = _a[1];
|
|
58166
|
+
React$1.useEffect(function () {
|
|
58167
|
+
var media = window.matchMedia(query);
|
|
58168
|
+
if (media.matches !== matches) {
|
|
58169
|
+
setMatches(media.matches);
|
|
58170
|
+
}
|
|
58171
|
+
var listener = function () { return setMatches(media.matches); };
|
|
58172
|
+
window.addEventListener('resize', listener);
|
|
58173
|
+
return function () { return window.removeEventListener('resize', listener); };
|
|
58174
|
+
}, [matches, query]);
|
|
58175
|
+
return matches;
|
|
58176
|
+
};
|
|
58177
|
+
|
|
57992
58178
|
exports.CheckboxItemRenderer = CheckboxItemRenderer;
|
|
57993
58179
|
exports.FIRM_KEY = FIRM_KEY;
|
|
57994
58180
|
exports.FIRM_NAME_KEY = FIRM_NAME_KEY;
|
|
@@ -58021,14 +58207,21 @@ exports.LuiButtonGroup = LuiButtonGroup;
|
|
|
58021
58207
|
exports.LuiCheckboxInput = LuiCheckboxInput;
|
|
58022
58208
|
exports.LuiCloseableHeaderMenuContext = LuiCloseableHeaderMenuContext;
|
|
58023
58209
|
exports.LuiCloseableHeaderMenuItem = LuiCloseableHeaderMenuItem;
|
|
58210
|
+
exports.LuiCloseableHeaderMenuItemV2 = LuiCloseableHeaderMenuItemV2;
|
|
58024
58211
|
exports.LuiComboSelect = LuiComboSelect;
|
|
58025
58212
|
exports.LuiControlledMenu = LuiControlledMenu;
|
|
58026
58213
|
exports.LuiDrawerMenu = LuiDrawerMenu;
|
|
58027
58214
|
exports.LuiDrawerMenuDivider = LuiDrawerMenuDivider;
|
|
58215
|
+
exports.LuiDrawerMenuDividerV2 = LuiDrawerMenuDividerV2;
|
|
58028
58216
|
exports.LuiDrawerMenuOption = LuiDrawerMenuOption;
|
|
58217
|
+
exports.LuiDrawerMenuOptionV2 = LuiDrawerMenuOptionV2;
|
|
58029
58218
|
exports.LuiDrawerMenuOptions = LuiDrawerMenuOptions;
|
|
58219
|
+
exports.LuiDrawerMenuOptionsV2 = LuiDrawerMenuOptionsV2;
|
|
58030
58220
|
exports.LuiDrawerMenuSection = LuiDrawerMenuSection;
|
|
58221
|
+
exports.LuiDrawerMenuSectionV2 = LuiDrawerMenuSectionV2;
|
|
58222
|
+
exports.LuiDrawerMenuV2 = LuiDrawerMenuV2;
|
|
58031
58223
|
exports.LuiDropdownMenu = LuiDropdownMenu;
|
|
58224
|
+
exports.LuiDropdownMenuV2 = LuiDropdownMenuV2;
|
|
58032
58225
|
exports.LuiErrorPage = LuiErrorPage;
|
|
58033
58226
|
exports.LuiExpandableBanner = LuiExpandableBanner;
|
|
58034
58227
|
exports.LuiFileInputBox = LuiFileInputBox;
|
|
@@ -58048,6 +58241,8 @@ exports.LuiFormikSelect = LuiFormikSelect;
|
|
|
58048
58241
|
exports.LuiFormikTextInput = LuiFormikTextInput;
|
|
58049
58242
|
exports.LuiHeader = LuiHeader;
|
|
58050
58243
|
exports.LuiHeaderMenuItem = LuiHeaderMenuItem;
|
|
58244
|
+
exports.LuiHeaderMenuItemV2 = LuiHeaderMenuItemV2;
|
|
58245
|
+
exports.LuiHeaderV2 = LuiHeaderV2;
|
|
58051
58246
|
exports.LuiIcon = LuiIcon;
|
|
58052
58247
|
exports.LuiListBox = LuiListBox;
|
|
58053
58248
|
exports.LuiLoadingSpinner = LuiLoadingSpinner;
|
|
@@ -58087,11 +58282,14 @@ exports.LuiToastMessage = LuiToastMessage;
|
|
|
58087
58282
|
exports.LuiTooltip = LuiTooltip;
|
|
58088
58283
|
exports.LuiUpdatesSplashModal = LuiUpdatesSplashModal;
|
|
58089
58284
|
exports.RadioItemRenderer = RadioItemRenderer;
|
|
58285
|
+
exports.breakpointQuery = breakpointQuery;
|
|
58286
|
+
exports.breakpoints = breakpoints;
|
|
58090
58287
|
exports.getDefaultSearchMenuOptions = getDefaultSearchMenuOptions;
|
|
58091
58288
|
exports.isChromatic = isChromatic;
|
|
58092
58289
|
exports.useClickedOutsideElement = useClickedOutsideElement;
|
|
58093
58290
|
exports.useLOLGlobalClientRefContext = useLOLGlobalClientRefContext;
|
|
58094
58291
|
exports.useLOLUserContext = useLOLUserContext;
|
|
58095
58292
|
exports.useLuiFloatingWindow = useFloatingWindow;
|
|
58293
|
+
exports.useMediaQuery = useMediaQuery;
|
|
58096
58294
|
exports.useShowLUIMessage = useShowLUIMessage;
|
|
58097
58295
|
//# sourceMappingURL=index.js.map
|