@linzjs/lui 12.1.4 → 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,10 @@
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
+
1
8
  ## [12.1.4](https://github.com/linz/lui/compare/v12.1.3...v12.1.4) (2022-01-20)
2
9
 
3
10
 
@@ -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;
@@ -18719,7 +18719,7 @@ var LuiModal = function LuiModal(props) {
18719
18719
  }
18720
18720
  }
18721
18721
 
18722
- return React__default.createElement(Modal, {
18722
+ return React__default.createElement(Modal, Object.assign({
18723
18723
  key: props.key,
18724
18724
  isOpen: true,
18725
18725
  shouldCloseOnOverlayClick: props.shouldCloseOnOverlayClick,
@@ -18727,7 +18727,9 @@ var LuiModal = function LuiModal(props) {
18727
18727
  overlayClassName: "modal",
18728
18728
  className: props.lowContrast ? 'lui-scrim-low-contrast' : 'lui-scrim',
18729
18729
  ariaHideApp: !isTest
18730
- }, React__default.createElement("div", {
18730
+ }, props.appendToElement && {
18731
+ parentSelector: props.appendToElement
18732
+ }), React__default.createElement("div", {
18731
18733
  ref: node,
18732
18734
  className: clsx('lui-modal lui-box-shadow', props.maxWidth && 'lui-max-width', props.headingText && 'lui-modal-no-padding', props.className)
18733
18735
  }, props.headingText && React__default.createElement(LuiModalHeader, {
@@ -18743,7 +18745,8 @@ var LuiAlertModal = function LuiAlertModal(props) {
18743
18745
  key: props.key,
18744
18746
  shouldCloseOnOverlayClick: props.shouldCloseOnOverlayClick,
18745
18747
  onClose: props.onClose,
18746
- className: clsx("lui-modal-" + props.level, props.className)
18748
+ className: clsx("lui-modal-" + props.level, props.className),
18749
+ appendToElement: props.appendToElement
18747
18750
  }, React__default.createElement("i", {
18748
18751
  className: "lui-msg-status-icon material-icons-round"
18749
18752
  }, materialIcon), props.children);