@linzjs/lui 21.34.1-0 → 21.34.1-2
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/dist/components/LuiModal/LuiModalV2.d.ts +6 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -9
- package/dist/index.js.map +1 -1
- package/dist/lui.css +19 -7
- package/dist/lui.css.map +1 -1
- package/dist/lui.esm.js +18 -10
- package/dist/lui.esm.js.map +1 -1
- package/dist/scss/Components/Modal/modal-v2.scss +26 -9
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
|
1
|
+
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import { LuiIconProps } from '../LuiIcon/LuiIcon';
|
|
3
3
|
export declare type LuiModalV2Props = {
|
|
4
4
|
key?: string;
|
|
@@ -11,7 +11,7 @@ export declare type LuiModalV2Props = {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
/** If set to true, the modal will take the full screen width. Default `false` */
|
|
13
13
|
maxWidth?: boolean;
|
|
14
|
-
headingText?:
|
|
14
|
+
headingText?: ReactNode;
|
|
15
15
|
headingIcon?: LuiIconProps;
|
|
16
16
|
helpLink?: string | (() => void | Promise<void>);
|
|
17
17
|
isLoading?: boolean;
|
|
@@ -24,3 +24,7 @@ export declare type LuiModalV2Props = {
|
|
|
24
24
|
};
|
|
25
25
|
export declare const LuiModalV2: FC<PropsWithChildren<LuiModalV2Props>>;
|
|
26
26
|
export declare const LuiModalV2Buttons: FC<PropsWithChildren<unknown>>;
|
|
27
|
+
/** Allows injecting the modal header text */
|
|
28
|
+
export declare const LuiModalV2HeadingText: FC<{
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export * from './components/LuiHeaderMenu/LuiHeaderMenus';
|
|
|
37
37
|
export * from './components/LuiHeaderMenuV2/LuiHeaderMenusV2';
|
|
38
38
|
export { LuiUpdatesSplashModal } from './components/LuiUpdateSplashModal/LuiUpdatesSplashModal';
|
|
39
39
|
export { LuiModal, LuiAlertModal, LuiAlertModalButtons, } from './components/LuiModal/LuiModal';
|
|
40
|
-
export { LuiModalV2, LuiModalV2Buttons, type LuiModalV2Props, } from './components/LuiModal/LuiModalV2';
|
|
40
|
+
export { LuiModalV2, LuiModalV2Buttons, LuiModalV2HeadingText, type LuiModalV2Props, } from './components/LuiModal/LuiModalV2';
|
|
41
41
|
export { LuiAlertModalV2, type LuiAlertModalLevel, type LuiAlertModalV2Props, } from './components/LuiModal/LuiAlertModalV2';
|
|
42
42
|
export { type ISearchInputProps, LuiSearchInput, } from './components/LuiSearchInput/LuiSearchInput';
|
|
43
43
|
export { type ISearchGroupedResult, type ISearchResult, } from './components/LuiSearchInput/ResultsDisplay';
|
package/dist/index.js
CHANGED
|
@@ -39926,13 +39926,10 @@ var useEscapeFunction = function (onEscape) {
|
|
|
39926
39926
|
};
|
|
39927
39927
|
var useEscapeFunction2 = function (onEscape, trigger) {
|
|
39928
39928
|
if (trigger === void 0) { trigger = 'keydown'; }
|
|
39929
|
-
var escFunction = React.useCallback(function (event) {
|
|
39930
|
-
console.log(event.key, event, onEscape);
|
|
39931
|
-
event.key === 'Escape' && onEscape(event);
|
|
39932
|
-
}, [onEscape]);
|
|
39929
|
+
var escFunction = React.useCallback(function (event) { return event.key === 'Escape' && onEscape(event); }, [onEscape]);
|
|
39933
39930
|
React.useEffect(function () {
|
|
39934
|
-
document.addEventListener(trigger, escFunction
|
|
39935
|
-
return function () { return document.removeEventListener(trigger, escFunction
|
|
39931
|
+
document.addEventListener(trigger, escFunction);
|
|
39932
|
+
return function () { return document.removeEventListener(trigger, escFunction); };
|
|
39936
39933
|
}, [escFunction]);
|
|
39937
39934
|
};
|
|
39938
39935
|
/**
|
|
@@ -42348,7 +42345,6 @@ var LuiModalV2 = function (props) {
|
|
|
42348
42345
|
firstFocusableElement === null || firstFocusableElement === void 0 ? void 0 : firstFocusableElement.focus();
|
|
42349
42346
|
}
|
|
42350
42347
|
};
|
|
42351
|
-
console.log({ props: props }, props.shouldCloseOnEsc && props.shouldCloseOnEsc !== 'use-keyup');
|
|
42352
42348
|
var showCloseButton = Boolean(props.showCloseButton && props.onClose);
|
|
42353
42349
|
var showHelpButton = Boolean(props.helpLink);
|
|
42354
42350
|
var showButtons = showCloseButton || showHelpButton;
|
|
@@ -42362,7 +42358,7 @@ var LuiModalV2 = function (props) {
|
|
|
42362
42358
|
modalRef.current = el;
|
|
42363
42359
|
handleAutoFocus(el);
|
|
42364
42360
|
}, className: clsx('lui-modal-v2 lui-box-shadow', props.maxWidth && 'lui-max-width', props.className) },
|
|
42365
|
-
React__default["default"].createElement("div", { className: "lui-modal-v2-header" },
|
|
42361
|
+
React__default["default"].createElement("div", { className: "lui-modal-v2-header", id: "lui-modal-v2-header" },
|
|
42366
42362
|
props.isLoading && (React__default["default"].createElement(LuiMiniSpinner, { size: 20, divProps: { className: 'lui-modal-v2-header-spinner' } })),
|
|
42367
42363
|
showHeadingIcon && (React__default["default"].createElement("div", { className: "lui-modal-v2-header-icon" },
|
|
42368
42364
|
React__default["default"].createElement(LuiIcon, __assign({ size: "md", name: "", alt: "Help" }, props.headingIcon, { className: clsx('', (_a = props.headingIcon) === null || _a === void 0 ? void 0 : _a.className) })))),
|
|
@@ -42378,7 +42374,19 @@ var HelpButton = function (props) { return (React__default["default"].createElem
|
|
|
42378
42374
|
: props.helpLink },
|
|
42379
42375
|
React__default["default"].createElement(LuiIcon, { name: "ic_help_outline", alt: "Help", size: "md" }))); };
|
|
42380
42376
|
var CloseButton = function (props) { return (React__default["default"].createElement("button", { "aria-label": "Modal Close", title: "Close", className: "lui-modal-v2-header-close-btn", onClick: props.onClose },
|
|
42381
|
-
React__default["default"].createElement(LuiIcon, { name: "ic_clear", alt: "Help", size: "md" }))); };
|
|
42377
|
+
React__default["default"].createElement(LuiIcon, { name: "ic_clear", alt: "Help", size: "md" }))); };
|
|
42378
|
+
/** Allows injecting the modal header text */
|
|
42379
|
+
var LuiModalV2HeadingText = function (_a) {
|
|
42380
|
+
var children = _a.children;
|
|
42381
|
+
var _b = React.useState(), target = _b[0], setTarget = _b[1];
|
|
42382
|
+
React.useEffect(function () {
|
|
42383
|
+
var modalHeader = document.querySelector('#lui-modal-v2-header');
|
|
42384
|
+
modalHeader && setTarget(modalHeader);
|
|
42385
|
+
}, []);
|
|
42386
|
+
if (!target)
|
|
42387
|
+
return null;
|
|
42388
|
+
return require$$1.createPortal(React__default["default"].createElement("h2", { className: "lui-modal-v2-header-title lui-modal-v2-header-title-portal" }, children), target);
|
|
42389
|
+
};
|
|
42382
42390
|
|
|
42383
42391
|
var LuiAlertModalV2 = function (props) {
|
|
42384
42392
|
var level = props.level, className = props.className, children = props.children, rest = __rest(props, ["level", "className", "children"]);
|
|
@@ -59460,6 +59468,7 @@ exports.LuiMiniSpinner = LuiMiniSpinner;
|
|
|
59460
59468
|
exports.LuiModal = LuiModal;
|
|
59461
59469
|
exports.LuiModalV2 = LuiModalV2;
|
|
59462
59470
|
exports.LuiModalV2Buttons = LuiModalV2Buttons;
|
|
59471
|
+
exports.LuiModalV2HeadingText = LuiModalV2HeadingText;
|
|
59463
59472
|
exports.LuiMoneyInput = LuiMoneyInput;
|
|
59464
59473
|
exports.LuiMultiSwitch = LuiMultiSwitch;
|
|
59465
59474
|
exports.LuiMultiSwitchYesNo = LuiMultiSwitchYesNo;
|