@linzjs/lui 11.10.1 → 11.12.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,31 @@
1
+ # [11.12.0](https://github.com/linz/lui/compare/v11.11.0...v11.12.0) (2022-01-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * **LuiSelectInput:** Update dropdown icon ([#515](https://github.com/linz/lui/issues/515)) ([322bc0f](https://github.com/linz/lui/commit/322bc0faf839e4f36ed24551bf069a6c6863f3cd))
7
+
8
+ # [11.11.0](https://github.com/linz/lui/compare/v11.10.3...v11.11.0) (2022-01-12)
9
+
10
+
11
+ ### Features
12
+
13
+ * **LuiTextInput:** Add option for padlock icon ([#514](https://github.com/linz/lui/issues/514)) ([654f913](https://github.com/linz/lui/commit/654f9132b5f43b93cb9f57ef7b81fd0f01a0e18c))
14
+
15
+ ## [11.10.3](https://github.com/linz/lui/compare/v11.10.2...v11.10.3) (2022-01-12)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * add missing dependency to useEffect hook. ([#513](https://github.com/linz/lui/issues/513)) ([4e4998c](https://github.com/linz/lui/commit/4e4998c299f7cc1f8b215f70047874e1bc2ef13d))
21
+
22
+ ## [11.10.2](https://github.com/linz/lui/compare/v11.10.1...v11.10.2) (2022-01-12)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * Allow LuiTooltip animation to be disabled. ([#512](https://github.com/linz/lui/issues/512)) ([686b752](https://github.com/linz/lui/commit/686b75217f883c3ab5d288273e51e3e741d06ee5))
28
+
1
29
  ## [11.10.1](https://github.com/linz/lui/compare/v11.10.0...v11.10.1) (2022-01-11)
2
30
 
3
31
 
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 22"><path d="M14 7.5H13V5.5C13 2.74 10.76 0.5 8 0.5C5.24 0.5 3 2.74 3 5.5V7.5H2C0.9 7.5 0 8.4 0 9.5V19.5C0 20.6 0.9 21.5 2 21.5H14C15.1 21.5 16 20.6 16 19.5V9.5C16 8.4 15.1 7.5 14 7.5ZM8 16.5C6.9 16.5 6 15.6 6 14.5C6 13.4 6.9 12.5 8 12.5C9.1 12.5 10 13.4 10 14.5C10 15.6 9.1 16.5 8 16.5ZM11.1 7.5H4.9V5.5C4.9 3.79 6.29 2.4 8 2.4C9.71 2.4 11.1 3.79 11.1 5.5V7.5Z" fill="#6B6966" /></svg>
@@ -9,6 +9,10 @@ export interface LuiTextInputProps {
9
9
  * A red star will be shown next to the label, no validation will be performed based on this prop.
10
10
  */
11
11
  mandatory?: boolean;
12
+ /**
13
+ * A padlock will be displayed on right side of input
14
+ */
15
+ showPadlockIcon?: boolean;
12
16
  value: string;
13
17
  }
14
18
  export declare function useGenerateOrDefaultId(idFromProps?: string): string;
@@ -33,3 +33,7 @@ export declare const Mandatory: {
33
33
  (): JSX.Element;
34
34
  storyName: string;
35
35
  };
36
+ export declare const PadlockIcon: {
37
+ (): JSX.Element;
38
+ storyName: string;
39
+ };
@@ -14,4 +14,11 @@ export declare const disabledSelected: import("@storybook/react").Story<Partial<
14
14
  export declare const disabledWhileLoading: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
15
15
  export declare const groupedOptions: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
16
16
  export declare const isMulti: import("@storybook/react").Story<Partial<import("react-select").Props<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>> & React.RefAttributes<import("react-select").SelectInstance<import("./LuiComboSelect").LuiComboSelectOption, boolean, import("react-select").GroupBase<any>>>>;
17
- export declare const compareToInput: () => JSX.Element;
17
+ export declare const compareToInput: {
18
+ (): JSX.Element;
19
+ storyName: string;
20
+ };
21
+ export declare const CompareToLuiSelectInput: {
22
+ (): JSX.Element;
23
+ storyName: string;
24
+ };
@@ -7,5 +7,6 @@ export interface ILuiTooltipProperties {
7
7
  placement?: Placement;
8
8
  trigger?: string;
9
9
  children: ReactNode;
10
+ animation?: boolean;
10
11
  }
11
12
  export declare const LuiTooltip: (props: ILuiTooltipProperties) => JSX.Element;
@@ -9,6 +9,7 @@ export declare type ILOLCommonDrawerMenuProps = Omit<ILOLAppLauncherMenuProps, '
9
9
  appSpecificLinks?: ReactNode;
10
10
  path: string;
11
11
  hasStickyHeader?: boolean;
12
+ showRequestsLink?: boolean;
12
13
  };
13
14
  export declare const LOLCommonDrawerMenu: (props: ILOLCommonDrawerMenuProps) => JSX.Element;
14
15
  export declare const LOLCommonDrawerMenuAfterLinks: (props: {
@@ -0,0 +1,43 @@
1
+ /// <reference types="jest" />
2
+ import { IFirm } from './contexts/LOLUserContext';
3
+ export declare const mockGetUserInfo: (firms: IFirm[]) => jest.Mock<import("msw/lib/types").AsyncResponseResolverReturnType<import("msw/lib/types").MockedResponse<{
4
+ user: {
5
+ id: string;
6
+ idHash: string;
7
+ email: string;
8
+ givenNames: string;
9
+ surname: string;
10
+ loginType: string;
11
+ preferredName: string;
12
+ firms: IFirm[];
13
+ passwordChangeRequired: boolean;
14
+ roles: never[];
15
+ lastLogin: string;
16
+ };
17
+ }>>, [import("msw/lib/types").MockedRequest<import("msw/lib/types/utils/handlers/requestHandler").DefaultRequestBodyType, import("msw/lib/types").RequestParams>, import("msw/lib/types").ResponseComposition<{
18
+ user: {
19
+ id: string;
20
+ idHash: string;
21
+ email: string;
22
+ givenNames: string;
23
+ surname: string;
24
+ loginType: string;
25
+ preferredName: string;
26
+ firms: IFirm[];
27
+ passwordChangeRequired: boolean;
28
+ roles: never[];
29
+ lastLogin: string;
30
+ };
31
+ }>, {
32
+ set: typeof import("msw/lib/types/context").set;
33
+ status: (statusCode: number, statusText?: string | undefined) => import("msw/lib/types").ResponseTransformer<any>;
34
+ cookie: (name: string, value: string, options?: import("cookie").CookieSerializeOptions | undefined) => import("msw/lib/types").ResponseTransformer<any>;
35
+ body: <BodyType extends string | Blob | ArrayBufferView | ArrayBuffer | ReadableStream<any> | FormData>(value: BodyType) => import("msw/lib/types").ResponseTransformer<BodyType>;
36
+ text: <BodyType_1 extends string>(body: BodyType_1) => import("msw/lib/types").ResponseTransformer<BodyType_1>;
37
+ json: <BodyTypeJSON>(body: BodyTypeJSON, { merge }?: {
38
+ merge?: boolean | undefined;
39
+ } | undefined) => import("msw/lib/types").ResponseTransformer<BodyTypeJSON>;
40
+ xml: <BodyType_2 extends string>(body: BodyType_2) => import("msw/lib/types").ResponseTransformer<BodyType_2>;
41
+ delay: (durationMs?: number | undefined) => import("msw/lib/types").ResponseTransformer<any>;
42
+ fetch: (input: string | import("msw/lib/types").MockedRequest<import("msw/lib/types/utils/handlers/requestHandler").DefaultRequestBodyType, import("msw/lib/types").RequestParams>, requestInit?: RequestInit | undefined) => any;
43
+ }]>;
@@ -46,6 +46,7 @@ interface CommonDrawerMenuTemplateProps {
46
46
  smallHeader: boolean;
47
47
  loginType: string;
48
48
  stickyHeader: boolean;
49
+ showRequestsLink: boolean;
49
50
  }
50
51
  export declare const CommonDrawerMenu: Story<CommonDrawerMenuTemplateProps>;
51
52
  interface DrawerMenuTemplateProps {
@@ -989,7 +989,7 @@ var LuiTextInput = function LuiTextInput(props) {
989
989
  className: "LuiTextInput-inputWrapper"
990
990
  }, React__default.createElement("input", Object.assign({
991
991
  type: 'text',
992
- className: clsx('LuiTextInput-input'),
992
+ className: (props.showPadlockIcon ? 'LuiTextInput-padlock-icon ' : '') + clsx('LuiTextInput-input'),
993
993
  min: "0",
994
994
  value: props.value,
995
995
  onChange: props.onChange
@@ -1195,9 +1195,9 @@ var LuiSelectInput = function LuiSelectInput(props) {
1195
1195
  }, selection.label);
1196
1196
  })), React__default.createElement(LuiIcon, {
1197
1197
  alt: 'Error',
1198
- name: "ic_arrow_drop_down",
1198
+ name: "ic_keyboard_arrow_down",
1199
1199
  className: "LuiSelect-chevron-icon",
1200
- size: "sm"
1200
+ size: "md"
1201
1201
  })), props.error && React__default.createElement("span", {
1202
1202
  className: "LuiSelect-error"
1203
1203
  }, React__default.createElement(LuiIcon, {
@@ -20274,7 +20274,7 @@ var LOLDrawerMenuFirmSwitcher = function LOLDrawerMenuFirmSwitcher(props) {
20274
20274
  });
20275
20275
  };
20276
20276
 
20277
- var _excluded$5 = ["appSpecificLinks", "appSpecificSections", "path", "hasStickyHeader"];
20277
+ var _excluded$5 = ["appSpecificLinks", "appSpecificSections", "path", "hasStickyHeader", "showRequestsLink"];
20278
20278
  var LOLDrawerMenu = function LOLDrawerMenu(props) {
20279
20279
  return React__default.createElement(LuiDrawerMenu, {
20280
20280
  hasStickyHeader: props.hasStickyHeader
@@ -20291,6 +20291,7 @@ var LOLCommonDrawerMenu = function LOLCommonDrawerMenu(props) {
20291
20291
  appSpecificSections = props.appSpecificSections,
20292
20292
  path = props.path,
20293
20293
  hasStickyHeader = props.hasStickyHeader,
20294
+ showRequestsLink = props.showRequestsLink,
20294
20295
  restOfProps = _objectWithoutPropertiesLoose(props, _excluded$5);
20295
20296
 
20296
20297
  return React__default.createElement(LOLDrawerMenu, {
@@ -20299,7 +20300,7 @@ var LOLCommonDrawerMenu = function LOLCommonDrawerMenu(props) {
20299
20300
  pathname: path
20300
20301
  }, restOfProps)), React__default.createElement(LOLDrawerMenuFirmSwitcher, {
20301
20302
  minimumFilterCount: 5
20302
- }), appSpecificLinks && React__default.createElement(React__default.Fragment, null, React__default.createElement(LuiDrawerMenuDivider, null), appSpecificLinks), React__default.createElement(LuiDrawerMenuDivider, null), React__default.createElement(LOLCommonDrawerMenuAfterLinks, {
20303
+ }), showRequestsLink && React__default.createElement(React__default.Fragment, null, React__default.createElement(LuiDrawerMenuDivider, null), React__default.createElement(LOLCommonMenuRequestsLink, null)), appSpecificLinks && React__default.createElement(React__default.Fragment, null, React__default.createElement(LuiDrawerMenuDivider, null), appSpecificLinks), React__default.createElement(LuiDrawerMenuDivider, null), React__default.createElement(LOLCommonDrawerMenuAfterLinks, {
20303
20304
  path: path
20304
20305
  }));
20305
20306
  };
@@ -20326,6 +20327,28 @@ var LOLCommonDrawerMenuAfterLinks = function LOLCommonDrawerMenuAfterLinks(props
20326
20327
  }));
20327
20328
  };
20328
20329
 
20330
+ var LOLCommonMenuRequestsLink = function LOLCommonMenuRequestsLink() {
20331
+ var openRequestsApp = function openRequestsApp() {
20332
+ window.open('/requests', '_blank');
20333
+ };
20334
+
20335
+ return React__default.createElement(LuiDrawerMenuOption, {
20336
+ label: 'Create request',
20337
+ onClick: function onClick() {
20338
+ openRequestsApp();
20339
+ },
20340
+ badge: React__default.createElement("img", {
20341
+ src: ExternalIcon,
20342
+ alt: "Link opens in a new tab",
20343
+ style: {
20344
+ width: '16px',
20345
+ height: '16px',
20346
+ marginTop: '4px'
20347
+ }
20348
+ })
20349
+ });
20350
+ };
20351
+
20329
20352
  var id = 0;
20330
20353
 
20331
20354
  var getKey = function getKey() {
@@ -20336,7 +20359,9 @@ var LuiTooltip = function LuiTooltip(props) {
20336
20359
  var children = props.children,
20337
20360
  message = props.message,
20338
20361
  placement = props.placement,
20339
- trigger = props.trigger;
20362
+ trigger = props.trigger,
20363
+ _props$animation = props.animation,
20364
+ animation = _props$animation === void 0 ? true : _props$animation;
20340
20365
  var id = "LuiToolTip_" + React.useMemo(getKey, []);
20341
20366
 
20342
20367
  if (typeof message !== 'string') {
@@ -20350,14 +20375,15 @@ var LuiTooltip = function LuiTooltip(props) {
20350
20375
  trigger: trigger,
20351
20376
  theme: 'LUI',
20352
20377
  placement: placement,
20353
- offset: [0, 24]
20378
+ offset: [0, 24],
20379
+ animation: animation
20354
20380
  });
20355
20381
  return function () {
20356
20382
  var _document$getElementB, _document$getElementB2;
20357
20383
 
20358
20384
  (_document$getElementB = document.getElementById(id)) == null ? void 0 : (_document$getElementB2 = _document$getElementB._tippy) == null ? void 0 : _document$getElementB2.destroy();
20359
20385
  };
20360
- }, [id, message, placement, trigger]);
20386
+ }, [id, message, placement, trigger, animation]);
20361
20387
  return React__default.createElement("span", {
20362
20388
  id: id
20363
20389
  }, children);