@linzjs/lui 12.1.1 → 12.2.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
+ # [12.2.0](https://github.com/linz/lui/compare/v12.1.4...v12.2.0) (2022-01-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * **LuiModal:** Added prop appendToElement to LuiModal to be used as parentSelector in react-modal ([#529](https://github.com/linz/lui/issues/529)) ([5a81791](https://github.com/linz/lui/commit/5a81791a68592fcb526636056a93750b6c28ceea))
7
+
8
+ ## [12.1.4](https://github.com/linz/lui/compare/v12.1.3...v12.1.4) (2022-01-20)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **LuiTextAreaInput:** Fixed Error Styling for when the component ([#528](https://github.com/linz/lui/issues/528)) ([b790b7e](https://github.com/linz/lui/commit/b790b7e60d9bde93de6000476e84f82c7a4d2e08))
14
+
15
+ ## [12.1.3](https://github.com/linz/lui/compare/v12.1.2...v12.1.3) (2022-01-18)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * LuiTextInput mandatory star style ([#526](https://github.com/linz/lui/issues/526)) ([7cabbd0](https://github.com/linz/lui/commit/7cabbd0537b194d2a8884ea601da8918a10d7111))
21
+
22
+ ## [12.1.2](https://github.com/linz/lui/compare/v12.1.1...v12.1.2) (2022-01-17)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * FileInputBox not updating on error ([#498](https://github.com/linz/lui/issues/498)) ([7efa723](https://github.com/linz/lui/commit/7efa723f42cc15ceacb5f432d3d048f4447553f2))
28
+
1
29
  ## [12.1.1](https://github.com/linz/lui/compare/v12.1.0...v12.1.1) (2022-01-17)
2
30
 
3
31
 
@@ -1,4 +1,4 @@
1
- export interface Props {
1
+ export interface LuiFileInputBoxProps {
2
2
  fileDescription: string;
3
3
  acceptedExtensions: string[];
4
4
  fileFormatText?: string;
@@ -8,7 +8,7 @@ export interface Props {
8
8
  width?: number;
9
9
  height?: number;
10
10
  }
11
- export declare const LuiFileInputBox: (props: Props) => JSX.Element;
11
+ export declare const LuiFileInputBox: (props: LuiFileInputBoxProps) => JSX.Element;
12
12
  export interface FileUploadInfoProps {
13
13
  fileName: string | undefined;
14
14
  fileDescription: string;
@@ -18,8 +18,8 @@ export declare const FileUploadInfo: (props: FileUploadInfoProps) => JSX.Element
18
18
  /**
19
19
  * Get the extension from a filename in upper-case.
20
20
  *
21
- * @param fileName File-name to get extension from.
22
- * @return fileName extension in upper-case if found else empty string.
21
+ * @param fileName File-name to get extension from
22
+ * @return fileName extension in upper-case if found else empty string
23
23
  */
24
24
  export declare const getFileNameExtension: (fileName: string) => string;
25
25
  /**
@@ -1,6 +1,6 @@
1
1
  import { ComponentStory } from '@storybook/react';
2
2
  import { FileUploadInfo, LuiFileInputBox } from './LuiFileInputBox';
3
- declare const _default: import("@storybook/react").Meta<import("./LuiFileInputBox").Props>;
3
+ declare const _default: import("@storybook/react").Meta<import("./LuiFileInputBox").LuiFileInputBoxProps>;
4
4
  export default _default;
5
5
  export declare const LuiFileInputWithExtensionFilterDefaultSize: ComponentStory<typeof LuiFileInputBox>;
6
6
  export declare const LuiFileInputWithExtensionFilterLargeWithExistingError: ComponentStory<typeof LuiFileInputBox>;
@@ -28,3 +28,7 @@ export declare const Mandatory: {
28
28
  (): JSX.Element;
29
29
  storyName: string;
30
30
  };
31
+ export declare const ErrorWithNonTransparentBackground: {
32
+ (): JSX.Element;
33
+ storyName: string;
34
+ };
@@ -7,6 +7,7 @@ interface ILuiModal {
7
7
  maxWidth?: boolean;
8
8
  headingText?: string;
9
9
  lowContrast?: boolean;
10
+ appendToElement?: () => HTMLElement;
10
11
  }
11
12
  export declare const LuiModal: React.FC<ILuiModal>;
12
13
  export declare const LuiAlertModal: React.FC<{
@@ -10,3 +10,4 @@ export declare const ModalMaxWidth: () => JSX.Element;
10
10
  export declare const ModalLowContrast: () => JSX.Element;
11
11
  export declare const ModalWithHeader: () => JSX.Element;
12
12
  export declare const WarningAlertWithButtons: () => JSX.Element;
13
+ export declare const WarningAlertWithButtonsAttachedToElement: () => JSX.Element;
@@ -8,4 +8,3 @@ declare const _default: {
8
8
  };
9
9
  export default _default;
10
10
  export declare const TooltipTopBottom: Story<{}>;
11
- export declare const TooltipLeftRight: Story<{}>;
@@ -1066,20 +1066,6 @@ var LuiFileInputBox = function LuiFileInputBox(props) {
1066
1066
  }
1067
1067
  };
1068
1068
 
1069
- var FileFormatErrorDetails = function FileFormatErrorDetails() {
1070
- return React__default.createElement("div", {
1071
- className: "LuiFileInputBox-upload-container"
1072
- }, React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
1073
- className: 'LuiFileInputBox-upload-icon-error'
1074
- }, React__default.createElement(LuiIcon, {
1075
- name: "ic_error_outline",
1076
- size: 'ns',
1077
- alt: "Error"
1078
- })), props.customFileErrorMessage ? React__default.createElement("p", null, props.customFileErrorMessage) : React__default.createElement("p", {
1079
- className: "LuiFileInputBox-upload-text"
1080
- }, "You must select a file with extension of", ' ', extensionsAsHumanReadableList(props.acceptedExtensions), ".")));
1081
- };
1082
-
1083
1069
  var hasError = hasFileFormatError || props.showMustSelectFileError === true;
1084
1070
  return React__default.createElement("div", {
1085
1071
  className: clsx('LuiFileInputBox-upload', hasError && 'LuiFileInputBox-upload-error'),
@@ -1096,7 +1082,17 @@ var LuiFileInputBox = function LuiFileInputBox(props) {
1096
1082
  return "." + extension;
1097
1083
  }).join(','),
1098
1084
  onChange: onChange
1099
- }), React__default.createElement(React__default.Fragment, null, hasError ? React__default.createElement(FileFormatErrorDetails, null) : React__default.createElement(FileUploadInfo, {
1085
+ }), React__default.createElement(React__default.Fragment, null, hasError ? React__default.createElement("div", {
1086
+ className: "LuiFileInputBox-upload-container"
1087
+ }, React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
1088
+ className: 'LuiFileInputBox-upload-icon-error'
1089
+ }, React__default.createElement(LuiIcon, {
1090
+ name: "ic_error_outline",
1091
+ size: 'ns',
1092
+ alt: "Error"
1093
+ })), props.customFileErrorMessage ? React__default.createElement("p", null, props.customFileErrorMessage) : React__default.createElement("p", {
1094
+ className: "LuiFileInputBox-upload-text"
1095
+ }, "You must select a file with extension of", ' ', extensionsAsHumanReadableList(props.acceptedExtensions), "."))) : React__default.createElement(FileUploadInfo, {
1100
1096
  fileName: file == null ? void 0 : file.name,
1101
1097
  fileFormatText: props.fileFormatText,
1102
1098
  fileDescription: props.fileDescription
@@ -1141,8 +1137,8 @@ var FileUploadInfo = function FileUploadInfo(props) {
1141
1137
  /**
1142
1138
  * Get the extension from a filename in upper-case.
1143
1139
  *
1144
- * @param fileName File-name to get extension from.
1145
- * @return fileName extension in upper-case if found else empty string.
1140
+ * @param fileName File-name to get extension from
1141
+ * @return fileName extension in upper-case if found else empty string
1146
1142
  */
1147
1143
 
1148
1144
  var getFileNameExtension = function getFileNameExtension(fileName) {
@@ -18723,7 +18719,7 @@ var LuiModal = function LuiModal(props) {
18723
18719
  }
18724
18720
  }
18725
18721
 
18726
- return React__default.createElement(Modal, {
18722
+ return React__default.createElement(Modal, Object.assign({
18727
18723
  key: props.key,
18728
18724
  isOpen: true,
18729
18725
  shouldCloseOnOverlayClick: props.shouldCloseOnOverlayClick,
@@ -18731,7 +18727,9 @@ var LuiModal = function LuiModal(props) {
18731
18727
  overlayClassName: "modal",
18732
18728
  className: props.lowContrast ? 'lui-scrim-low-contrast' : 'lui-scrim',
18733
18729
  ariaHideApp: !isTest
18734
- }, React__default.createElement("div", {
18730
+ }, props.appendToElement && {
18731
+ parentSelector: props.appendToElement
18732
+ }), React__default.createElement("div", {
18735
18733
  ref: node,
18736
18734
  className: clsx('lui-modal lui-box-shadow', props.maxWidth && 'lui-max-width', props.headingText && 'lui-modal-no-padding', props.className)
18737
18735
  }, props.headingText && React__default.createElement(LuiModalHeader, {
@@ -18747,7 +18745,8 @@ var LuiAlertModal = function LuiAlertModal(props) {
18747
18745
  key: props.key,
18748
18746
  shouldCloseOnOverlayClick: props.shouldCloseOnOverlayClick,
18749
18747
  onClose: props.onClose,
18750
- className: clsx("lui-modal-" + props.level, props.className)
18748
+ className: clsx("lui-modal-" + props.level, props.className),
18749
+ appendToElement: props.appendToElement
18751
18750
  }, React__default.createElement("i", {
18752
18751
  className: "lui-msg-status-icon material-icons-round"
18753
18752
  }, materialIcon), props.children);