@linzjs/lui 16.5.1-0 → 17.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/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # [17.1.0](https://github.com/linz/lui/compare/v17.0.0...v17.1.0) (2022-05-15)
2
+
3
+
4
+ ### Features
5
+
6
+ * **LuiSearchInput:** SEARCH-2785 Search box component ([#668](https://github.com/linz/lui/issues/668)) ([aaf9640](https://github.com/linz/lui/commit/aaf9640dba3e8c994cd0ff0a2e43975bb24a9b35))
7
+
8
+ # [17.0.0](https://github.com/linz/lui/compare/v16.5.1...v17.0.0) (2022-05-12)
9
+
10
+ ## [16.5.1](https://github.com/linz/lui/compare/v16.5.0...v16.5.1) (2022-05-10)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * sm drop-shadow is overridden by md ([#667](https://github.com/linz/lui/issues/667)) ([0960d21](https://github.com/linz/lui/commit/0960d2101212b3bd5d46db0660f17f71e8eff552))
16
+
1
17
  # [16.5.0](https://github.com/linz/lui/compare/v16.4.0...v16.5.0) (2022-05-02)
2
18
 
3
19
 
@@ -2,7 +2,7 @@ import React, { MouseEvent, ReactNode, Ref } from 'react';
2
2
  export interface LuiButtonProps extends PlainButtonProps {
3
3
  href?: string;
4
4
  openInNewTab?: boolean;
5
- level?: 'text' | 'plain-text' | 'primary' | 'secondary' | 'tertiary' | 'error';
5
+ level?: 'text' | 'plain-text' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'error';
6
6
  type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
7
7
  size?: 'sm' | '' | /* medium */ 'lg';
8
8
  }
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import '@szhsin/react-menu/dist/index.css';
2
3
  declare type LuiFilterMenuProps = {
3
4
  menuButton: (toggleMenu: () => void) => ReactNode;
4
5
  filteredItems: SelectMenuItem[];
@@ -0,0 +1,23 @@
1
+ import React, { ReactElement } from 'react';
2
+ import 'react-loading-skeleton/dist/skeleton.css';
3
+ export interface ISearchResult {
4
+ id: string;
5
+ description: string;
6
+ }
7
+ export interface ISearchGroupedResult {
8
+ id: string;
9
+ description: string;
10
+ label: string;
11
+ items: ISearchResult[];
12
+ }
13
+ export interface ISearchInputProps {
14
+ minCharactersForSearch: number;
15
+ placeholderText: string;
16
+ onSelectOption: (selectedOption: ISearchResult) => void;
17
+ getOptions: (inputValue: string) => Promise<ISearchResult[] | ISearchGroupedResult[]>;
18
+ renderItem: (item: ISearchResult) => ReactElement;
19
+ disclaimer?: string;
20
+ initialValue?: string;
21
+ }
22
+ export declare function isGroupedResult(result: ISearchResult[] | ISearchGroupedResult[]): result is ISearchGroupedResult[];
23
+ export declare const LuiSearchInput: React.FC<ISearchInputProps>;
@@ -0,0 +1,13 @@
1
+ import React, { ReactElement, RefObject } from 'react';
2
+ import { ISearchGroupedResult, ISearchResult } from './LuiSearchInput';
3
+ export interface IResultsProps {
4
+ selectedId: string;
5
+ isLoading: boolean;
6
+ onClick: (id: string) => void;
7
+ setSelectedId: (id: string) => void;
8
+ renderItem: (item: ISearchResult) => ReactElement;
9
+ results: ISearchResult[] | ISearchGroupedResult[];
10
+ selectedRef: RefObject<HTMLDivElement>;
11
+ }
12
+ declare const ResultsDisplay: React.FC<IResultsProps>;
13
+ export default ResultsDisplay;
@@ -0,0 +1,15 @@
1
+ import { MenuHeaderProps } from '@szhsin/react-menu';
2
+ import { ReactElement } from 'react';
3
+ export declare type MenuItemType = {
4
+ [key: string]: any;
5
+ };
6
+ export declare type MenuItemGroupType = {
7
+ [key: string]: any;
8
+ };
9
+ export interface ILuiSelectMenuProps {
10
+ items: (MenuItemType | MenuItemGroupType)[];
11
+ menuButton: ReactElement;
12
+ }
13
+ export declare const LuiSelectDataMenu: ({ ...props }: ILuiSelectMenuProps) => JSX.Element;
14
+ export declare const LuiSelectMenuDivider: () => JSX.Element;
15
+ export declare const LuiSelectMenuHeader: (props: MenuHeaderProps) => JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { MenuItemProps, MenuProps, SubMenuProps } from '@szhsin/react-menu';
2
+ import React from 'react';
3
+ export interface ILuiSelectMenuItemProps extends MenuItemProps {
4
+ children: React.ReactNode;
5
+ iconName?: string;
6
+ level?: 'primary' | 'error';
7
+ iconAlt?: string;
8
+ className?: string;
9
+ showHeader?: boolean;
10
+ noPadding?: boolean;
11
+ 'data-testid'?: string;
12
+ }
13
+ export declare const LuiSelectMenu: ({ ...props }: MenuProps) => JSX.Element;
14
+ export declare const LuiSelectMenuItem: ({ iconName, iconAlt, level, noPadding, ...rest }: ILuiSelectMenuItemProps) => JSX.Element;
15
+ export interface ILuiSelectSubMenuItemProps extends SubMenuProps {
16
+ iconName?: string;
17
+ iconAlt?: string;
18
+ label: string;
19
+ }
20
+ export declare const LuiSelectSubMenuItem: ({ label, iconName, iconAlt, ...rest }: ILuiSelectSubMenuItemProps) => JSX.Element;
package/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@ export * from './contexts/LuiMessagingContextProvider';
6
6
  export { LuiButtonGroup } from './components/LuiButton/LuiButton';
7
7
  export { LuiExpandableBanner } from './components/LuiExpandableBanner/LuiExpandableBanner';
8
8
  export { LuiMenu, LuiControlledMenu } from './components/LuiMenu/LuiMenu';
9
+ export { LuiSelectMenu, LuiSelectMenuItem, LuiSelectSubMenuItem, } from './components/LuiSelectMenu/LuiSelectMenu';
10
+ export { LuiSelectDataMenu } from './components/LuiSelectMenu/LuiSelectDataMenu';
9
11
  export { LuiFilterMenu } from './components/LuiFilterMenu/LuiFilterMenu';
10
12
  export { LuiTabs, LuiTabsContext } from './components/LuiTabs/LuiTabs';
11
13
  export { LuiTab } from './components/LuiTabs/LuiTab/LuiTab';
@@ -35,6 +37,7 @@ export * from './components/LuiHeader/LuiHeader';
35
37
  export * from './components/LuiHeaderMenu/LuiHeaderMenus';
36
38
  export { LuiUpdatesSplashModal } from './components/LuiUpdateSplashModal/LuiUpdatesSplashModal';
37
39
  export { LuiModal, LuiAlertModal, LuiAlertModalButtons, } from './components/LuiModal/LuiModal';
40
+ export { ISearchInputProps, ISearchGroupedResult, ISearchResult, LuiSearchInput, } from './components/LuiSearchInput/LuiSearchInput';
38
41
  export { LuiErrorPage } from './components/LuiErrorPage/LuiErrorPage';
39
42
  export * from './components/LuiLoadingSpinner/LuiLoadingSpinner';
40
43
  export { LOLFirmSwitcherMenu } from './components/lol/LOLFirmSwitcher';