@linzjs/lui 17.30.0 → 17.32.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 +15 -0
- package/README.md +4 -3
- package/dist/components/LuiHeader/LuiHeader.d.ts +8 -0
- package/dist/components/LuiHeaderMenu/LuiHeaderMenus.d.ts +12 -0
- package/dist/components/LuiHeaderMenuV2/LuiHeaderMenusV2.d.ts +73 -0
- package/dist/components/LuiHeaderV2/LuiHeaderV2.d.ts +20 -0
- package/dist/components/LuiIcon/LuiIcon.d.ts +2 -1
- package/dist/components/LuiUpdateSplashModal/LuiUpdatesSplashModal.d.ts +8 -4
- package/dist/components/common/StorybookSupport.d.ts +1 -1
- package/dist/components/common/UseMediaQuery.d.ts +9 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +588 -145
- package/dist/index.js.map +1 -1
- package/dist/lui.css +361 -0
- package/dist/lui.css.map +1 -1
- package/dist/lui.esm.js +577 -146
- package/dist/lui.esm.js.map +1 -1
- package/dist/scss/Components/HeaderV2/header-v2.scss +242 -0
- package/dist/scss/Components/LuiUpdateSplashModal/splashModal.scss +23 -0
- package/dist/scss/Components/MenuV2/menu-v2.scss +172 -0
- package/dist/scss/base.scss +3 -0
- package/package.json +11 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# [17.32.0](https://github.com/linz/lui/compare/v17.31.1...v17.32.0) (2023-02-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* the drawer will not be closed for submenu ([#845](https://github.com/linz/lui/issues/845)) ([1fca1be](https://github.com/linz/lui/commit/1fca1be587ffc038648939c85e716c51f71871a2))
|
|
7
|
+
|
|
8
|
+
# [17.31.0](https://github.com/linz/lui/compare/v17.30.0...v17.31.0) (2023-02-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* implement a new version LuiHeader ([#838](https://github.com/linz/lui/issues/838)) ([50d2364](https://github.com/linz/lui/commit/50d23648aa92ce36d927239b034ff045a3fd280a))
|
|
14
|
+
* implement new version LuiHeader and associated componenets ([#840](https://github.com/linz/lui/issues/840)) ([c6c9de3](https://github.com/linz/lui/commit/c6c9de36e0d4108d3aaaf445809d78ebefdfce5e))
|
|
15
|
+
|
|
1
16
|
# [17.30.0](https://github.com/linz/lui/compare/v17.29.1...v17.30.0) (2023-02-07)
|
|
2
17
|
|
|
3
18
|
## [17.29.1](https://github.com/linz/lui/compare/v17.29.0...v17.29.1) (2023-02-06)
|
package/README.md
CHANGED
|
@@ -42,10 +42,11 @@ We aim to make each component generic, extendable, accessible, and amazing.
|
|
|
42
42
|
All styles are implemented in SCSS and compiled to plain CSS. This means any team can use the CSS. A ReactJS wrapper
|
|
43
43
|
over the CSS is part of this project.
|
|
44
44
|
|
|
45
|
-
There are lots of things to do in this project, often things will be left until there is demand. Please join the Slack channel
|
|
46
|
-
#cop-lui.
|
|
45
|
+
There are lots of things to do in this project, often things will be left until there is demand, e.g add new components or implement new version components. Please join the Slack channel
|
|
47
46
|
|
|
48
|
-
|
|
47
|
+
#cop-lui
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
49
50
|
|
|
50
51
|
Storybook is the main source of documentation.
|
|
51
52
|
|
|
@@ -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;
|
|
@@ -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,73 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { ILuiHeaderMenuItem, ILuiIcon } from '../LuiHeader/LuiHeader';
|
|
3
|
+
import { ILuiDrawerMenu, ILuiDrawerMenuSection } from '../LuiHeaderMenu/LuiHeaderMenus';
|
|
4
|
+
import { Size } from '../common/ResponsiveUtils';
|
|
5
|
+
import { IconSize } from '../LuiIcon/LuiIcon';
|
|
6
|
+
interface ILuiDrawerMenuOptionV2 {
|
|
7
|
+
/**
|
|
8
|
+
* The material-ui icon name (see https://material.io/resources/icons/?search=account_c&style=round)
|
|
9
|
+
*/
|
|
10
|
+
icon?: string | ReactElement;
|
|
11
|
+
/**
|
|
12
|
+
* icon color, only applied when using LuiIcon
|
|
13
|
+
*/
|
|
14
|
+
iconColor?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The size of icon, only applied when using LuiIcon, default to 'md'
|
|
17
|
+
*/
|
|
18
|
+
iconSize?: IconSize;
|
|
19
|
+
/**
|
|
20
|
+
* The label shown beside the icon which is aligned at the left of the drawer
|
|
21
|
+
*/
|
|
22
|
+
label: string | ReactElement;
|
|
23
|
+
/**
|
|
24
|
+
* The badge which is shown which is aligned at the right of the drawer
|
|
25
|
+
*/
|
|
26
|
+
badge?: ReactElement;
|
|
27
|
+
/**
|
|
28
|
+
* The function to be bound together with closing the drawer on click
|
|
29
|
+
*/
|
|
30
|
+
onClick?: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the option is a sub menu, if true, the drawer will not be closed on click
|
|
33
|
+
*/
|
|
34
|
+
subMenu?: boolean;
|
|
35
|
+
}
|
|
36
|
+
declare const LuiDrawerMenuOptionsV2: ({ children, }: ILuiIcon & {
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
}) => JSX.Element;
|
|
39
|
+
declare const LuiDrawerMenuOptionV2: ({ icon, iconColor, label, badge, iconSize, subMenu, onClick, }: ILuiDrawerMenuOptionV2) => JSX.Element;
|
|
40
|
+
declare const LuiDrawerMenuV2: ({ children, hasStickyHeader, ...menuPropsCopy }: Omit<ILuiHeaderMenuItem, "onClick"> & {
|
|
41
|
+
hasStickyHeader?: boolean | undefined;
|
|
42
|
+
} & {
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
}) => JSX.Element;
|
|
45
|
+
declare type ILuiDropdownMenuV2 = Omit<ILuiHeaderMenuItem, 'onClick'> & {
|
|
46
|
+
/**
|
|
47
|
+
* The anchor origin of dropdown, default to left
|
|
48
|
+
*/
|
|
49
|
+
anchorOrigin?: {
|
|
50
|
+
horizontal?: 'left' | 'right';
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* the width of dropdown, default to 'md'
|
|
54
|
+
*/
|
|
55
|
+
size?: Size | 'xxl';
|
|
56
|
+
};
|
|
57
|
+
declare const LuiDropdownMenuV2: ({ ...restOfProps }: Omit<ILuiHeaderMenuItem, "onClick"> & {
|
|
58
|
+
/**
|
|
59
|
+
* The anchor origin of dropdown, default to left
|
|
60
|
+
*/
|
|
61
|
+
anchorOrigin?: {
|
|
62
|
+
horizontal?: "left" | "right" | undefined;
|
|
63
|
+
} | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* the width of dropdown, default to 'md'
|
|
66
|
+
*/
|
|
67
|
+
size?: Size | "xxl" | undefined;
|
|
68
|
+
} & {
|
|
69
|
+
children: ReactNode;
|
|
70
|
+
}) => JSX.Element;
|
|
71
|
+
declare const LuiDrawerMenuSectionV2: (props: ILuiDrawerMenuSection) => JSX.Element;
|
|
72
|
+
declare const LuiDrawerMenuDividerV2: () => JSX.Element;
|
|
73
|
+
export { LuiDrawerMenuV2, LuiDrawerMenuOptionsV2, LuiDrawerMenuOptionV2, ILuiDropdownMenuV2, LuiDropdownMenuV2, LuiDrawerMenuSectionV2, LuiDrawerMenuDividerV2, ILuiDrawerMenuOptionV2, };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { HeaderSize, ILuiCloseableHeaderMenuItem, ILuiHeaderMenuItem } from '../LuiHeader/LuiHeader';
|
|
3
|
+
interface HeaderPropsV2 {
|
|
4
|
+
headingText?: string;
|
|
5
|
+
size?: HeaderSize;
|
|
6
|
+
homeLink?: string | (() => void);
|
|
7
|
+
transparent?: boolean;
|
|
8
|
+
sticky?: boolean;
|
|
9
|
+
appMenu?: ReactNode;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare const LuiHeaderV2: ({ headingText, size, homeLink, transparent, children, sticky, appMenu, }: HeaderPropsV2) => JSX.Element;
|
|
13
|
+
declare const LuiHeaderMenuItemV2: React.ForwardRefExoticComponent<ILuiHeaderMenuItem & {
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
iconColor?: string | undefined;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const LuiCloseableHeaderMenuItemV2: ({ open, setOpen, children, ...props }: ILuiCloseableHeaderMenuItem & {
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
}) => JSX.Element;
|
|
20
|
+
export { LuiHeaderV2, LuiHeaderMenuItemV2, LuiCloseableHeaderMenuItemV2 };
|
|
@@ -14,6 +14,7 @@ export interface LuiIconProps {
|
|
|
14
14
|
className?: string;
|
|
15
15
|
title?: string;
|
|
16
16
|
spanProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
17
|
+
color?: string;
|
|
17
18
|
}
|
|
18
19
|
export declare const ICON_SIZES: {
|
|
19
20
|
xs: string;
|
|
@@ -31,4 +32,4 @@ export declare const ICON_STATUS: {
|
|
|
31
32
|
interactive: string;
|
|
32
33
|
disabled: string;
|
|
33
34
|
};
|
|
34
|
-
export declare const LuiIcon: ({ name, className, size, title, alt, status, spanProps, }: LuiIconProps) => JSX.Element | null;
|
|
35
|
+
export declare const LuiIcon: ({ name, className, size, title, alt, status, spanProps, color, }: LuiIconProps) => JSX.Element | null;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface SplashModalProps {
|
|
3
3
|
bigImage: string;
|
|
4
4
|
smallImage: string;
|
|
5
5
|
header: string;
|
|
6
6
|
wrapperClass?: string;
|
|
7
|
-
onClose: () => void;
|
|
8
7
|
id: string;
|
|
9
|
-
|
|
8
|
+
releaseVersion: string;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const LuiUpdatesSplashModal: (props: SplashModalProps) => JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Open menu after render so chromatic can see it.
|
|
3
3
|
* Place in useEffect in story. e.g. useEffect(openHeaderMenu, []);
|
|
4
4
|
*/
|
|
5
|
-
export declare const openHeaderMenu: () => void;
|
|
5
|
+
export declare const openHeaderMenu: (menuIconClass?: string) => void;
|
|
6
6
|
export declare const expandCollapsedContainer: () => void;
|
|
@@ -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/LuiHeaderV2/LuiHeaderV2';
|
|
39
40
|
export * from './components/LuiHeaderMenu/LuiHeaderMenus';
|
|
41
|
+
export * from './components/LuiHeaderMenuV2/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';
|