@linzjs/lui 17.29.1-2 → 17.29.1-4

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.
@@ -1,6 +1,6 @@
1
- import React, { ReactElement } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { ILuiHeaderMenuItem, ILuiIcon } from '../LuiHeader/LuiHeader';
3
- import { ILuiDrawerMenu, ILuiDrawerMenuSection } from './LuiHeaderMenus';
3
+ import { ILuiDrawerMenu, ILuiDrawerMenuSection } from '../LuiHeaderMenu/LuiHeaderMenus';
4
4
  import { Size } from '../common/ResponsiveUtils';
5
5
  interface ILuiDrawerMenuOptionV2 {
6
6
  /**
@@ -20,12 +20,15 @@ interface ILuiDrawerMenuOptionV2 {
20
20
  */
21
21
  onClick?: () => void;
22
22
  }
23
- declare const LuiDrawerMenuOptionsV2: React.FC<React.PropsWithChildren<ILuiIcon>>;
24
- /**
25
- * display badge on the left
26
- */
27
- declare const LuiDrawerMenuOptionV2: React.FC<React.PropsWithChildren<ILuiDrawerMenuOptionV2>>;
28
- declare const LuiDrawerMenuV2: React.FC<React.PropsWithChildren<ILuiDrawerMenu>>;
23
+ declare const LuiDrawerMenuOptionsV2: ({ children, }: ILuiIcon & {
24
+ children: ReactNode;
25
+ }) => JSX.Element;
26
+ declare const LuiDrawerMenuOptionV2: ({ icon, label, badge, onClick, }: ILuiDrawerMenuOptionV2) => JSX.Element;
27
+ declare const LuiDrawerMenuV2: ({ children, hasStickyHeader, ...menuPropsCopy }: Omit<ILuiHeaderMenuItem, "onClick"> & {
28
+ hasStickyHeader?: boolean | undefined;
29
+ } & {
30
+ children: ReactNode;
31
+ }) => JSX.Element;
29
32
  declare type ILuiDropdownMenuV2 = Omit<ILuiHeaderMenuItem, 'onClick'> & {
30
33
  /**
31
34
  * The anchor origin of dropdown, default to left
@@ -38,7 +41,20 @@ declare type ILuiDropdownMenuV2 = Omit<ILuiHeaderMenuItem, 'onClick'> & {
38
41
  */
39
42
  size?: Size | 'xxl';
40
43
  };
41
- declare const LuiDropdownMenuV2: React.FC<React.PropsWithChildren<ILuiDropdownMenuV2>>;
44
+ declare const LuiDropdownMenuV2: ({ ...restOfProps }: Omit<ILuiHeaderMenuItem, "onClick"> & {
45
+ /**
46
+ * The anchor origin of dropdown, default to left
47
+ */
48
+ anchorOrigin?: {
49
+ horizontal?: "left" | "right" | undefined;
50
+ } | undefined;
51
+ /**
52
+ * the width of dropdown, default to 'md'
53
+ */
54
+ size?: Size | "xxl" | undefined;
55
+ } & {
56
+ children: ReactNode;
57
+ }) => JSX.Element;
42
58
  declare const LuiDrawerMenuSectionV2: (props: ILuiDrawerMenuSection) => JSX.Element;
43
59
  declare const LuiDrawerMenuDividerV2: () => JSX.Element;
44
60
  export { LuiDrawerMenuV2, LuiDrawerMenuOptionsV2, LuiDrawerMenuOptionV2, ILuiDropdownMenuV2, LuiDropdownMenuV2, LuiDrawerMenuSectionV2, LuiDrawerMenuDividerV2, ILuiDrawerMenuOptionV2, };
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { HeaderSize, ILuiCloseableHeaderMenuItem, ILuiHeaderMenuItem } from './LuiHeader';
2
+ import { HeaderSize, ILuiCloseableHeaderMenuItem, ILuiHeaderMenuItem } from '../LuiHeader/LuiHeader';
3
3
  interface HeaderPropsV2 {
4
4
  headingText?: string;
5
5
  size?: HeaderSize;
@@ -7,10 +7,14 @@ interface HeaderPropsV2 {
7
7
  transparent?: boolean;
8
8
  sticky?: boolean;
9
9
  appMenu?: ReactNode;
10
+ children: ReactNode;
10
11
  }
11
- declare const LuiHeaderV2: React.FC<React.PropsWithChildren<HeaderPropsV2>>;
12
+ declare const LuiHeaderV2: ({ headingText, size, homeLink, transparent, children, sticky, appMenu, }: HeaderPropsV2) => JSX.Element;
12
13
  declare const LuiHeaderMenuItemV2: React.ForwardRefExoticComponent<ILuiHeaderMenuItem & {
13
14
  children?: React.ReactNode;
14
15
  } & React.RefAttributes<HTMLDivElement>>;
15
- declare const LuiCloseableHeaderMenuItemV2: React.FC<React.PropsWithChildren<ILuiCloseableHeaderMenuItem>>;
16
- export { LuiHeaderV2, LuiHeaderMenuItemV2, LuiCloseableHeaderMenuItemV2 };
16
+ interface ILuiCloseableHeaderMenuItemV2 extends ILuiCloseableHeaderMenuItem {
17
+ children: ReactNode;
18
+ }
19
+ declare const LuiCloseableHeaderMenuItemV2: ({ open, setOpen, children, ...props }: ILuiCloseableHeaderMenuItemV2) => JSX.Element;
20
+ export { LuiHeaderV2, LuiHeaderMenuItemV2, LuiCloseableHeaderMenuItemV2, ILuiCloseableHeaderMenuItemV2, };
package/dist/index.d.ts CHANGED
@@ -36,9 +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
+ export * from './components/LuiHeaderV2/LuiHeaderV2';
40
40
  export * from './components/LuiHeaderMenu/LuiHeaderMenus';
41
- export * from './components/LuiHeaderMenu/LuiHeaderMenusV2';
41
+ export * from './components/LuiHeaderMenuV2/LuiHeaderMenusV2';
42
42
  export { LuiUpdatesSplashModal } from './components/LuiUpdateSplashModal/LuiUpdatesSplashModal';
43
43
  export { LuiModal, LuiAlertModal, LuiAlertModalButtons, } from './components/LuiModal/LuiModal';
44
44
  export { ISearchInputProps, ISearchGroupedResult, ISearchResult, LuiSearchInput, } from './components/LuiSearchInput/LuiSearchInput';
package/dist/index.js CHANGED
@@ -40239,7 +40239,7 @@ var LuiHeaderMenuItemV2 = React$1.forwardRef(function (_a, ref) {
40239
40239
  children));
40240
40240
  });
40241
40241
  var LuiCloseableHeaderMenuItemV2 = function (_a) {
40242
- var open = _a.open, setOpen = _a.setOpen, props = __rest$1(_a, ["open", "setOpen"]);
40242
+ var open = _a.open, setOpen = _a.setOpen, children = _a.children, props = __rest$1(_a, ["open", "setOpen", "children"]);
40243
40243
  useEscapeFunction(function () { return setOpen(false); });
40244
40244
  var menuDiv = usePageClickFunction(function (event) { return open || event.stopPropagation(); }, function (event) {
40245
40245
  if (!open) {
@@ -40254,7 +40254,7 @@ var LuiCloseableHeaderMenuItemV2 = function (_a) {
40254
40254
  };
40255
40255
  var menuItemProps = __assign$3({ onClick: function () { return menuControls.open(); } }, props);
40256
40256
  return (React__default["default"].createElement(LuiCloseableHeaderMenuContext.Provider, { value: menuControls },
40257
- React__default["default"].createElement(LuiHeaderMenuItemV2, __assign$3({ ref: menuDiv }, menuItemProps), props.children)));
40257
+ React__default["default"].createElement(LuiHeaderMenuItemV2, __assign$3({ ref: menuDiv }, menuItemProps), children)));
40258
40258
  };
40259
40259
 
40260
40260
  /**
@@ -40342,11 +40342,8 @@ var LuiDrawerMenuDivider = function () {
40342
40342
 
40343
40343
  var LuiDrawerMenuOptionsV2 = function (_a) {
40344
40344
  var children = _a.children;
40345
- return React__default["default"].createElement("div", { className: "lui-menu-drawer-v2-options" }, children);
40345
+ return (React__default["default"].createElement("div", { className: "lui-menu-drawer-v2-options" }, children));
40346
40346
  };
40347
- /**
40348
- * display badge on the left
40349
- */
40350
40347
  var LuiDrawerMenuOptionV2 = function (_a) {
40351
40348
  var icon = _a.icon, label = _a.label, badge = _a.badge, _b = _a.onClick, onClick = _b === void 0 ? function () { } : _b;
40352
40349
  var menu = React$1.useContext(LuiCloseableHeaderMenuContext);
@@ -40355,13 +40352,12 @@ var LuiDrawerMenuOptionV2 = function (_a) {
40355
40352
  onClick();
40356
40353
  }, "data-testid": 'drawer-option' },
40357
40354
  React__default["default"].createElement("div", { className: "lui-menu-drawer-v2-option-label" },
40358
- badge,
40359
40355
  typeof icon === 'string' ? (React__default["default"].createElement("i", { className: "material-icons-round", "data-testid": 'drawer-option-icon' }, icon)) : (icon),
40360
- label)));
40356
+ label),
40357
+ badge));
40361
40358
  };
40362
40359
  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"]);
40360
+ var children = _a.children, _b = _a.hasStickyHeader, hasStickyHeader = _b === void 0 ? true : _b, menuPropsCopy = __rest$1(_a, ["children", "hasStickyHeader"]);
40365
40361
  var _c = React$1.useState(false), open = _c[0], setOpen = _c[1];
40366
40362
  var closeableMenuProps = __assign$3(__assign$3({}, menuPropsCopy), { open: open, setOpen: setOpen, icon: open ? 'close' : 'menu', onClick: function () { return setOpen(!open); } });
40367
40363
  React$1.useEffect(function () {