@mmb-digital/ds-lilly 0.10.60 → 0.10.61

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.
Files changed (2) hide show
  1. package/dist/ds-lilly.js +10 -11
  2. package/package.json +1 -1
package/dist/ds-lilly.js CHANGED
@@ -105913,7 +105913,7 @@ var ModalContent = function (_a) {
105913
105913
  var ModalDialog = function (_a) {
105914
105914
  var _b;
105915
105915
  var children = _a.children, size = _a.size, testId = _a.testId, theme = _a.theme;
105916
- var _c = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useContext"])(contexts_ModalContext), disableCloseByEscape = _c.disableCloseByEscape, disableDefaultCloseBehavior = _c.disableDefaultCloseBehavior, identification = _c.identification, reference = _c.reference;
105916
+ var _c = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useContext"])(contexts_ModalContext), disableDefaultCloseBehavior = _c.disableDefaultCloseBehavior, identification = _c.identification, reference = _c.reference;
105917
105917
  var _d = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(''), scroll = _d[0], setScroll = _d[1];
105918
105918
  var updateSize = function () {
105919
105919
  var modalContent = document.getElementById(identification + "_content");
@@ -105930,13 +105930,7 @@ var ModalDialog = function (_a) {
105930
105930
  updateSize();
105931
105931
  return function () { return window.removeEventListener('resize', updateSize); };
105932
105932
  }, []);
105933
- var handleKeyDown = function (event) {
105934
- if (event.key === KEYS.Escape && disableCloseByEscape) {
105935
- event.preventDefault();
105936
- event.stopPropagation();
105937
- }
105938
- };
105939
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("aside", { ref: reference, "aria-labelledby": identification + "_title", className: classBinder_cx('c-modal'), "data-testid": testId, role: disableDefaultCloseBehavior ? 'alertdialog' : 'dialog', onKeyDown: handleKeyDown },
105933
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("aside", { ref: reference, "aria-labelledby": identification + "_title", className: classBinder_cx('c-modal'), "data-testid": testId, role: disableDefaultCloseBehavior ? 'alertdialog' : 'dialog' },
105940
105934
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-modal__content', (_b = {},
105941
105935
  _b["" + scroll] = scroll,
105942
105936
  _b["c-modal__content--" + size] = size,
@@ -105955,16 +105949,19 @@ var ModalFooter = function (_a) {
105955
105949
 
105956
105950
 
105957
105951
 
105952
+
105958
105953
  var ModalHeader = function (_a) {
105959
105954
  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;
105960
- var _f = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useContext"])(contexts_ModalContext), onHide = _f.hide, identification = _f.identification;
105955
+ var _f = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useContext"])(contexts_ModalContext), disableCloseByEscape = _f.disableCloseByEscape, onHide = _f.hide, identification = _f.identification;
105961
105956
  var handleClose = function () {
105962
105957
  onClose && onClose();
105963
105958
  onHide();
105964
105959
  };
105965
105960
  var handleEscPress = function (_a) {
105966
105961
  var key = _a.key;
105967
- return key === 'Escape' && handleClose();
105962
+ if (key === KEYS.Escape && !disableCloseByEscape) {
105963
+ handleClose();
105964
+ }
105968
105965
  };
105969
105966
  useEventListener('keydown', handleEscPress);
105970
105967
  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 },
@@ -106059,7 +106056,9 @@ var useModal = function (_a) {
106059
106056
  }
106060
106057
  };
106061
106058
  var handleEscKey = function () {
106062
- !disableCloseByEscape && handleHideWithCallbacks();
106059
+ if (!disableCloseByEscape) {
106060
+ handleHideWithCallbacks();
106061
+ }
106063
106062
  };
106064
106063
  var keyListenersMap = new Map([
106065
106064
  [KEYS.Escape, handleEscKey],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmb-digital/ds-lilly",
3
- "version": "0.10.60",
3
+ "version": "0.10.61",
4
4
  "description": "MMB LILLY design system",
5
5
  "license": "UNLICENSED",
6
6
  "sideEffects": false,