@mmb-digital/ds-lilly 0.10.0 → 0.10.1
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/ds-lilly.js
CHANGED
|
@@ -98559,17 +98559,21 @@ var ModalFooter = function (_a) {
|
|
|
98559
98559
|
|
|
98560
98560
|
|
|
98561
98561
|
var ModalHeader = function (_a) {
|
|
98562
|
-
var closeText = _a.closeText, _b = _a.isCloseHidden, isCloseHidden = _b === void 0 ? false : _b, _c = _a.isTitleHidden, isTitleHidden = _c === void 0 ? false : _c, subtitle = _a.subtitle, testId = _a.testId, theme = _a.theme, title = _a.title, _d = _a.titleSize, titleSize = _d === void 0 ? 'h2' : _d, _e = _a.titleVisual, titleVisual = _e === void 0 ? 'h3' : _e;
|
|
98562
|
+
var closeText = _a.closeText, _b = _a.isCloseHidden, isCloseHidden = _b === void 0 ? false : _b, _c = _a.isTitleHidden, isTitleHidden = _c === void 0 ? false : _c, onClose = _a.onClose, subtitle = _a.subtitle, testId = _a.testId, theme = _a.theme, title = _a.title, _d = _a.titleSize, titleSize = _d === void 0 ? 'h2' : _d, _e = _a.titleVisual, titleVisual = _e === void 0 ? 'h3' : _e;
|
|
98563
98563
|
var _f = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useContext"])(contexts_ModalContext), onHide = _f.hide, identification = _f.identification;
|
|
98564
|
+
var handleClose = function () {
|
|
98565
|
+
onClose && onClose();
|
|
98566
|
+
onHide();
|
|
98567
|
+
};
|
|
98564
98568
|
var handleEscPress = function (_a) {
|
|
98565
98569
|
var key = _a.key;
|
|
98566
|
-
return key === 'Escape' &&
|
|
98570
|
+
return key === 'Escape' && handleClose();
|
|
98567
98571
|
};
|
|
98568
98572
|
useEventListener('keydown', handleEscPress);
|
|
98569
98573
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("header", { className: classBinder_cx('c-modal__header', theme), "data-testid": testId },
|
|
98570
98574
|
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Title, { id: identification + "_title", size: titleSize, theme: classBinder_cx('c-modal__title', { 'u-vHide': isTitleHidden }), visual: titleVisual }, title),
|
|
98571
98575
|
subtitle && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Text, { component: "div", size: "small" }, subtitle)),
|
|
98572
|
-
!isCloseHidden && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Button, { isSmall: true, ariaLabel: closeText, onlyIconName: "close", theme: classBinder_cx('c-modal__close'), type: "transparent", onClick:
|
|
98576
|
+
!isCloseHidden && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Button, { isSmall: true, ariaLabel: closeText, onlyIconName: "close", theme: classBinder_cx('c-modal__close'), type: "transparent", onClick: handleClose }))));
|
|
98573
98577
|
};
|
|
98574
98578
|
|
|
98575
98579
|
// EXTERNAL MODULE: external {"root":"ReactDOM","commonjs2":"react-dom","commonjs":"react-dom","amd":"react-dom","umd":"react-dom"}
|
|
@@ -15,6 +15,8 @@ export interface ModalHeaderPropsType extends ComponentPropsType {
|
|
|
15
15
|
titleSize?: TitleSize;
|
|
16
16
|
/** Title visual size. Use this for matching title visual with desired design. */
|
|
17
17
|
titleVisual?: TitleSize;
|
|
18
|
+
/** Close button click event handler. */
|
|
19
|
+
onClose?: () => void;
|
|
18
20
|
}
|
|
19
|
-
export declare const ModalHeader: ({ closeText, isCloseHidden, isTitleHidden, subtitle, testId, theme, title, titleSize, titleVisual }: ModalHeaderPropsType) => JSX.Element;
|
|
21
|
+
export declare const ModalHeader: ({ closeText, isCloseHidden, isTitleHidden, onClose, subtitle, testId, theme, title, titleSize, titleVisual }: ModalHeaderPropsType) => JSX.Element;
|
|
20
22
|
//# sourceMappingURL=ModalHeader.d.ts.map
|