@popsure/dirty-swan 0.28.9 → 0.28.10

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.
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
- declare const useOnClose: (onClose: () => void, isOpen: boolean, dismissable: boolean) => {
2
+ interface OnCloseReturn {
3
3
  isClosing: boolean;
4
- handleContainerClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
4
+ handleContainerClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
5
5
  handleOnClose: () => void;
6
- };
6
+ handleOnOverlayClick: () => void;
7
+ }
8
+ declare const useOnClose: (onClose: () => void, isOpen: boolean, dismissable: boolean) => OnCloseReturn;
7
9
  export default useOnClose;
@@ -2,7 +2,7 @@ import { _ as __assign } from '../../../tslib.es6-5bc94358.js';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
3
  import { useState, useCallback } from 'react';
4
4
  import { s as styleInject } from '../../../style-inject.es-1f59c1d0.js';
5
- import { u as useOnClose } from '../../../useOnClose-54f9e6b9.js';
5
+ import { u as useOnClose } from '../../../useOnClose-d818a54f.js';
6
6
 
7
7
  var css_248z = "@keyframes style-module_fade-in__1GZgs {\n 0% {\n background-color: rgba(0, 0, 0, 0);\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.3);\n }\n}\n@keyframes style-module_fade-out__30Bns {\n from {\n background-color: rgba(0, 0, 0, 0.3);\n }\n to {\n background-color: rgba(0, 0, 0, 0);\n }\n}\n@keyframes style-module_appear-in__3U2lu {\n 0% {\n transform: translateY(100%);\n }\n 80% {\n transform: translateY(-2%);\n }\n 100% {\n transform: translateY(0);\n }\n}\n@keyframes style-module_disappear-out__6pOVr {\n 0% {\n transform: translateY(0);\n }\n 100% {\n transform: translateY(100%);\n }\n}\n.style-module_close__1GERU {\n border: none;\n background-color: transparent;\n cursor: pointer;\n}\n\n.style-module_overlay__AlX2J, .style-module_overlay--close__3E9GY {\n position: fixed;\n z-index: 100;\n overflow: auto;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n animation: style-module_fade-in__1GZgs 0.3s both;\n}\n.style-module_overlay--close__3E9GY {\n animation-delay: 0.1s;\n animation: style-module_fade-out__30Bns 0.3s both;\n}\n\n.style-module_container__aOENo, .style-module_container--close__K506c {\n position: relative;\n background-color: white;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n width: 100%;\n animation-name: style-module_appear-in__3U2lu;\n animation-duration: 0.4s;\n animation-fill-mode: both;\n animation-timing-function: ease-out;\n top: 0;\n}\n.style-module_container--close__K506c {\n animation-name: style-module_disappear-out__6pOVr;\n animation-duration: 0.4s;\n animation-delay: 0s;\n animation-fill-mode: both;\n animation-timing-function: ease-out;\n}\n\n.style-module_header__10iiH {\n height: 60px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 0 16px;\n}";
8
8
  var styles = {"close":"style-module_close__1GERU","overlay":"style-module_overlay__AlX2J","overlay--close":"style-module_overlay--close__3E9GY","fade-in":"style-module_fade-in__1GZgs","fade-out":"style-module_fade-out__30Bns","container":"style-module_container__aOENo","container--close":"style-module_container--close__K506c","appear-in":"style-module_appear-in__3U2lu","disappear-out":"style-module_disappear-out__6pOVr","header":"style-module_header__10iiH"};
@@ -13,7 +13,7 @@ var imageClose = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%
13
13
  var BottomModal = (function (_a) {
14
14
  var title = _a.title, isOpen = _a.isOpen, children = _a.children, onClose = _a.onClose, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.dismissible, dismissible = _c === void 0 ? true : _c;
15
15
  var _d = useState(0), containerXOffset = _d[0], setContainerXOffset = _d[1];
16
- var _e = useOnClose(onClose, isOpen, dismissible), isClosing = _e.isClosing, handleContainerClick = _e.handleContainerClick, handleOnClose = _e.handleOnClose;
16
+ var _e = useOnClose(onClose, isOpen, dismissible), isClosing = _e.isClosing, handleContainerClick = _e.handleContainerClick, handleOnClose = _e.handleOnClose, handleOnOverlayClick = _e.handleOnOverlayClick;
17
17
  var containerRef = useCallback(function (node) {
18
18
  if (node !== null) {
19
19
  setContainerXOffset(Math.max(window.innerHeight * 0.1, window.innerHeight - node.getBoundingClientRect().height));
@@ -22,7 +22,7 @@ var BottomModal = (function (_a) {
22
22
  if (!isOpen) {
23
23
  return jsx(Fragment, {}, void 0);
24
24
  }
25
- return (jsx("div", __assign({ className: isClosing ? styles['overlay--close'] : styles.overlay, onClick: handleOnClose }, { children: jsxs("div", __assign({ className: (isClosing ? styles['container--close'] : styles.container) + " " + className, ref: containerRef, style: { top: containerXOffset + "px" }, onClick: handleContainerClick }, { children: [jsxs("div", __assign({ className: styles.header }, { children: [jsx("div", __assign({ className: "p-h4 " + styles.title }, { children: title }), void 0),
25
+ return (jsx("div", __assign({ className: isClosing ? styles['overlay--close'] : styles.overlay, onClick: handleOnOverlayClick }, { children: jsxs("div", __assign({ className: (isClosing ? styles['container--close'] : styles.container) + " " + className, ref: containerRef, style: { top: containerXOffset + "px" }, onClick: handleContainerClick }, { children: [jsxs("div", __assign({ className: styles.header }, { children: [jsx("div", __assign({ className: "p-h4 " + styles.title }, { children: title }), void 0),
26
26
  dismissible && (jsx("button", __assign({ type: "button", className: styles.close, onClick: handleOnClose }, { children: jsx("img", { src: imageClose, alt: "Close" }, void 0) }), void 0))] }), void 0),
27
27
  jsx("div", __assign({ className: styles.content }, { children: children }), void 0)] }), void 0) }), void 0));
28
28
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/lib/components/modal/bottomModal/img/close.svg","../../../../../../src/lib/components/modal/bottomModal/index.tsx"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M18%206L6%2018%22%20stroke%3D%22%2326262E%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M6%206L18%2018%22%20stroke%3D%22%2326262E%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\"","import React, { useState, useCallback } from 'react';\n\nimport { Props } from '..';\nimport styles from './style.module.scss';\n\nimport imageClose from './img/close.svg';\nimport useOnClose from '../hooks/useOnClose';\n\nexport default ({\n title,\n isOpen,\n children,\n onClose,\n className = '',\n dismissible = true,\n}: Props) => {\n const [containerXOffset, setContainerXOffset] = useState(0);\n const { isClosing, handleContainerClick, handleOnClose } = useOnClose(\n onClose,\n isOpen,\n dismissible\n );\n\n const containerRef = useCallback((node: HTMLDivElement) => {\n if (node !== null) {\n setContainerXOffset(\n Math.max(\n window.innerHeight * 0.1,\n window.innerHeight - node.getBoundingClientRect().height\n )\n );\n }\n }, []);\n\n if (!isOpen) {\n return <></>;\n }\n\n return (\n <div\n className={isClosing ? styles['overlay--close'] : styles.overlay}\n onClick={handleOnClose}\n >\n <div\n className={`${\n isClosing ? styles['container--close'] : styles.container\n } ${className}`}\n ref={containerRef}\n style={{ top: `${containerXOffset}px` }}\n onClick={handleContainerClick}\n >\n <div className={styles.header}>\n <div className={`p-h4 ${styles.title}`}>{title}</div>\n {dismissible && (\n <button\n type=\"button\"\n className={styles.close}\n onClick={handleOnClose}\n >\n <img src={imageClose} alt=\"Close\" />\n </button>\n )}\n </div>\n <div className={styles.content}>{children}</div>\n </div>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;AAAA,iBAAe;;ACQf,mBAAe,UAAC,EAOR;QANN,KAAK,WAAA,EACL,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EACd,mBAAkB,EAAlB,WAAW,mBAAG,IAAI,KAAA;IAEZ,IAAA,KAA0C,QAAQ,CAAC,CAAC,CAAC,EAApD,gBAAgB,QAAA,EAAE,mBAAmB,QAAe,CAAC;IACtD,IAAA,KAAqD,UAAU,CACnE,OAAO,EACP,MAAM,EACN,WAAW,CACZ,EAJO,SAAS,eAAA,EAAE,oBAAoB,0BAAA,EAAE,aAAa,mBAIrD,CAAC;IAEF,IAAM,YAAY,GAAG,WAAW,CAAC,UAAC,IAAoB;QACpD,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,mBAAmB,CACjB,IAAI,CAAC,GAAG,CACN,MAAM,CAAC,WAAW,GAAG,GAAG,EACxB,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,MAAM,CACzD,CACF,CAAC;SACH;KACF,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,CAAC,MAAM,EAAE;QACX,OAAOA,yBAAK,CAAC;KACd;IAED,QACEA,sBACE,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,OAAO,EAChE,OAAO,EAAE,aAAa,gBAEtBC,uBACE,SAAS,EAAE,CACT,SAAS,GAAG,MAAM,CAAC,kBAAkB,CAAC,GAAG,MAAM,CAAC,SAAS,UACvD,SAAW,EACf,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,EAAE,GAAG,EAAK,gBAAgB,OAAI,EAAE,EACvC,OAAO,EAAE,oBAAoB,iBAE7BA,uBAAK,SAAS,EAAE,MAAM,CAAC,MAAM,iBAC3BD,sBAAK,SAAS,EAAE,UAAQ,MAAM,CAAC,KAAO,gBAAG,KAAK,YAAO;wBACpD,WAAW,KACVA,yBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,MAAM,CAAC,KAAK,EACvB,OAAO,EAAE,aAAa,gBAEtBA,aAAK,GAAG,EAAE,UAAU,EAAE,GAAG,EAAC,OAAO,WAAG,YAC7B,CACV,aACG;gBACNA,sBAAK,SAAS,EAAE,MAAM,CAAC,OAAO,gBAAG,QAAQ,YAAO,aAC5C,YACF,EACN;AACJ,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/lib/components/modal/bottomModal/img/close.svg","../../../../../../src/lib/components/modal/bottomModal/index.tsx"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M18%206L6%2018%22%20stroke%3D%22%2326262E%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M6%206L18%2018%22%20stroke%3D%22%2326262E%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\"","import React, { useState, useCallback } from 'react';\n\nimport { Props } from '..';\nimport styles from './style.module.scss';\n\nimport imageClose from './img/close.svg';\nimport useOnClose from '../hooks/useOnClose';\n\nexport default ({\n title,\n isOpen,\n children,\n onClose,\n className = '',\n dismissible = true,\n}: Props) => {\n const [containerXOffset, setContainerXOffset] = useState(0);\n const {\n isClosing,\n handleContainerClick,\n handleOnClose,\n handleOnOverlayClick\n } = useOnClose(\n onClose,\n isOpen,\n dismissible\n );\n\n const containerRef = useCallback((node: HTMLDivElement) => {\n if (node !== null) {\n setContainerXOffset(\n Math.max(\n window.innerHeight * 0.1,\n window.innerHeight - node.getBoundingClientRect().height\n )\n );\n }\n }, []);\n\n if (!isOpen) {\n return <></>;\n }\n\n return (\n <div\n className={isClosing ? styles['overlay--close'] : styles.overlay}\n onClick={handleOnOverlayClick}\n >\n <div\n className={`${\n isClosing ? styles['container--close'] : styles.container\n } ${className}`}\n ref={containerRef}\n style={{ top: `${containerXOffset}px` }}\n onClick={handleContainerClick}\n >\n <div className={styles.header}>\n <div className={`p-h4 ${styles.title}`}>{title}</div>\n {dismissible && (\n <button\n type=\"button\"\n className={styles.close}\n onClick={handleOnClose}\n >\n <img src={imageClose} alt=\"Close\" />\n </button>\n )}\n </div>\n <div className={styles.content}>{children}</div>\n </div>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;AAAA,iBAAe;;ACQf,mBAAe,UAAC,EAOR;QANN,KAAK,WAAA,EACL,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EACd,mBAAkB,EAAlB,WAAW,mBAAG,IAAI,KAAA;IAEZ,IAAA,KAA0C,QAAQ,CAAC,CAAC,CAAC,EAApD,gBAAgB,QAAA,EAAE,mBAAmB,QAAe,CAAC;IACtD,IAAA,KAKD,UAAU,CACb,OAAO,EACP,MAAM,EACN,WAAW,CACZ,EARC,SAAS,eAAA,EACT,oBAAoB,0BAAA,EACpB,aAAa,mBAAA,EACb,oBAAoB,0BAKrB,CAAC;IAEF,IAAM,YAAY,GAAG,WAAW,CAAC,UAAC,IAAoB;QACpD,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,mBAAmB,CACjB,IAAI,CAAC,GAAG,CACN,MAAM,CAAC,WAAW,GAAG,GAAG,EACxB,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC,MAAM,CACzD,CACF,CAAC;SACH;KACF,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,CAAC,MAAM,EAAE;QACX,OAAOA,yBAAK,CAAC;KACd;IAED,QACEA,sBACE,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,OAAO,EAChE,OAAO,EAAE,oBAAoB,gBAE7BC,uBACE,SAAS,EAAE,CACT,SAAS,GAAG,MAAM,CAAC,kBAAkB,CAAC,GAAG,MAAM,CAAC,SAAS,UACvD,SAAW,EACf,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,EAAE,GAAG,EAAK,gBAAgB,OAAI,EAAE,EACvC,OAAO,EAAE,oBAAoB,iBAE7BA,uBAAK,SAAS,EAAE,MAAM,CAAC,MAAM,iBAC3BD,sBAAK,SAAS,EAAE,UAAQ,MAAM,CAAC,KAAO,gBAAG,KAAK,YAAO;wBACpD,WAAW,KACVA,yBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,MAAM,CAAC,KAAK,EACvB,OAAO,EAAE,aAAa,gBAEtBA,aAAK,GAAG,EAAE,UAAU,EAAE,GAAG,EAAC,OAAO,WAAG,YAC7B,CACV,aACG;gBACNA,sBAAK,SAAS,EAAE,MAAM,CAAC,OAAO,gBAAG,QAAQ,YAAO,aAC5C,YACF,EACN;AACJ,CAAC;;;;"}
@@ -4,7 +4,7 @@ import { useRef, useState, useEffect } from 'react';
4
4
  import BottomModal from '../bottomModal/index.js';
5
5
  import RegularModal from '../regularModal/index.js';
6
6
  import { s as styleInject } from '../../../style-inject.es-1f59c1d0.js';
7
- import '../../../useOnClose-54f9e6b9.js';
7
+ import '../../../useOnClose-d818a54f.js';
8
8
 
9
9
  var css_248z = "@media (min-width: 34rem) {\n .style-module_mobile__3k175 {\n display: none;\n }\n}\n@media (max-width: 34rem) {\n .style-module_mobile__3k175 {\n display: block !important;\n }\n}\n\n@media (max-width: 34rem) {\n .style-module_desktop__2lclr {\n display: none;\n }\n}";
10
10
  var styles = {"mobile":"style-module_mobile__3k175","desktop":"style-module_desktop__2lclr"};
@@ -1,10 +1,10 @@
1
1
  import { _ as __assign } from '../../../tslib.es6-5bc94358.js';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
- import { u as useOnClose } from '../../../useOnClose-54f9e6b9.js';
3
+ import { u as useOnClose } from '../../../useOnClose-d818a54f.js';
4
4
  import { s as styleInject } from '../../../style-inject.es-1f59c1d0.js';
5
5
  import 'react';
6
6
 
7
- var css_248z = "@keyframes style-module_fade-in__nLzzO {\n 0% {\n background-color: rgba(0, 0, 0, 0);\n visibility: hidden;\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.3);\n visibility: visible;\n }\n}\n@keyframes style-module_fade-out__IuSV7 {\n from {\n background-color: rgba(0, 0, 0, 0.3);\n visibility: visible;\n }\n to {\n background-color: rgba(0, 0, 0, 0);\n visibility: hidden;\n }\n}\n@keyframes style-module_appear-in__2ZMqz {\n 0% {\n transform: translateY(24px);\n opacity: 0;\n visibility: hidden;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n visibility: visible;\n }\n}\n@keyframes style-module_disappear-out__38TSV {\n 0% {\n transform: translateY(0);\n opacity: 1;\n visibility: visible;\n }\n 100% {\n transform: translateY(24px);\n opacity: 0;\n visibility: hidden;\n }\n}\n.style-module_overlay__1Zbce, .style-module_overlay--close__2dytn {\n position: fixed;\n z-index: 100;\n overflow: auto;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n animation: style-module_fade-in__nLzzO 0.3s both;\n}\n.style-module_overlay--close__2dytn {\n animation-delay: 0.1s;\n animation: style-module_fade-out__IuSV7 0.3s both;\n}\n\n.style-module_container__1XZj_, .style-module_container--close__3UYsJ {\n position: relative;\n display: flex;\n align-items: center;\n max-width: 592px;\n width: 100%;\n min-height: 100%;\n margin: 0 auto;\n animation-name: style-module_appear-in__2ZMqz;\n animation-duration: 0.4s;\n animation-fill-mode: both;\n animation-timing-function: ease-out;\n}\n.style-module_container--close__3UYsJ {\n animation-name: style-module_disappear-out__38TSV;\n animation-duration: 0.4s;\n animation-delay: 0s;\n animation-fill-mode: both;\n animation-timing-function: ease-out;\n}\n\n.style-module_body__lbUih {\n background-color: white;\n border-radius: 8px;\n margin: 32px auto;\n}\n\n.style-module_header__2oEKp {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 24px 24px 0 24px;\n}\n\n.style-module_close__p3Axi {\n border: none;\n background-color: transparent;\n cursor: pointer;\n}";
7
+ var css_248z = "@keyframes style-module_fade-in__nLzzO {\n 0% {\n background-color: rgba(0, 0, 0, 0);\n visibility: hidden;\n }\n 100% {\n background-color: rgba(0, 0, 0, 0.3);\n visibility: visible;\n }\n}\n@keyframes style-module_fade-out__IuSV7 {\n from {\n background-color: rgba(0, 0, 0, 0.3);\n visibility: visible;\n }\n to {\n background-color: rgba(0, 0, 0, 0);\n visibility: hidden;\n }\n}\n@keyframes style-module_appear-in__2ZMqz {\n 0% {\n transform: translateY(24px);\n opacity: 0;\n visibility: hidden;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n visibility: visible;\n }\n}\n@keyframes style-module_disappear-out__38TSV {\n 0% {\n transform: translateY(0);\n opacity: 1;\n visibility: visible;\n }\n 100% {\n transform: translateY(24px);\n opacity: 0;\n visibility: hidden;\n }\n}\n.style-module_overlay__1Zbce, .style-module_overlay--close__2dytn {\n position: fixed;\n z-index: 100;\n overflow: auto;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n animation: style-module_fade-in__nLzzO 0.3s both;\n}\n.style-module_overlay--close__2dytn {\n animation-delay: 0.1s;\n animation: style-module_fade-out__IuSV7 0.3s both;\n}\n\n.style-module_container__1XZj_, .style-module_container--close__3UYsJ {\n position: relative;\n display: flex;\n align-items: center;\n max-width: 592px;\n width: 100%;\n min-height: 100%;\n margin: 0 auto;\n animation-name: style-module_appear-in__2ZMqz;\n animation-duration: 0.4s;\n animation-fill-mode: both;\n animation-timing-function: ease-out;\n}\n.style-module_container--close__3UYsJ {\n animation-name: style-module_disappear-out__38TSV;\n animation-duration: 0.4s;\n animation-delay: 0s;\n animation-fill-mode: both;\n animation-timing-function: ease-out;\n}\n\n.style-module_body__lbUih {\n background-color: white;\n border-radius: 8px;\n margin: 80px auto;\n}\n\n.style-module_header__2oEKp {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 24px 24px 0 24px;\n}\n\n.style-module_close__p3Axi {\n border: none;\n background-color: transparent;\n cursor: pointer;\n}";
8
8
  var styles = {"overlay":"style-module_overlay__1Zbce","overlay--close":"style-module_overlay--close__2dytn","fade-in":"style-module_fade-in__nLzzO","fade-out":"style-module_fade-out__IuSV7","container":"style-module_container__1XZj_","container--close":"style-module_container--close__3UYsJ","appear-in":"style-module_appear-in__2ZMqz","disappear-out":"style-module_disappear-out__38TSV","body":"style-module_body__lbUih","header":"style-module_header__2oEKp","close":"style-module_close__p3Axi"};
9
9
  styleInject(css_248z);
10
10
 
@@ -12,11 +12,11 @@ var imageClose = "data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%
12
12
 
13
13
  var RegularModal = (function (_a) {
14
14
  var title = _a.title, isOpen = _a.isOpen, children = _a.children, onClose = _a.onClose, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.dismissible, dismissible = _c === void 0 ? true : _c;
15
- var _d = useOnClose(onClose, isOpen, dismissible), isClosing = _d.isClosing, handleContainerClick = _d.handleContainerClick, handleOnClose = _d.handleOnClose;
15
+ var _d = useOnClose(onClose, isOpen, dismissible), isClosing = _d.isClosing, handleContainerClick = _d.handleContainerClick, handleOnClose = _d.handleOnClose, handleOnOverlayClick = _d.handleOnOverlayClick;
16
16
  if (!isOpen) {
17
17
  return jsx(Fragment, {}, void 0);
18
18
  }
19
- return (jsx("div", __assign({ className: isClosing ? styles['overlay--close'] : styles.overlay, onClick: handleOnClose }, { children: jsx("div", __assign({ className: (isClosing ? styles['container--close'] : styles.container) + " " + className, onClick: handleContainerClick }, { children: jsxs("div", __assign({ className: styles.body }, { children: [jsxs("div", __assign({ className: styles.header }, { children: [jsx("div", __assign({ className: "p-h2 " + styles.title }, { children: title }), void 0),
19
+ return (jsx("div", __assign({ className: isClosing ? styles['overlay--close'] : styles.overlay, onClick: handleOnOverlayClick }, { children: jsx("div", __assign({ className: (isClosing ? styles['container--close'] : styles.container) + " " + className }, { children: jsxs("div", __assign({ className: styles.body, onClick: handleContainerClick }, { children: [jsxs("div", __assign({ className: styles.header }, { children: [jsx("div", __assign({ className: "p-h2 " + styles.title }, { children: title }), void 0),
20
20
  dismissible && (jsx("button", __assign({ type: "button", className: styles.close, onClick: handleOnClose }, { children: jsx("img", { src: imageClose, alt: "Close" }, void 0) }), void 0))] }), void 0), children] }), void 0) }), void 0) }), void 0));
21
21
  });
22
22
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/lib/components/modal/regularModal/img/close.svg","../../../../../../src/lib/components/modal/regularModal/index.tsx"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M18%206L6%2018%22%20stroke%3D%22%2326262E%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M6%206L18%2018%22%20stroke%3D%22%2326262E%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\"","import React from 'react';\n\nimport { Props } from '..';\nimport useOnClose from '../hooks/useOnClose';\n\nimport styles from './style.module.scss';\n\nimport imageClose from './img/close.svg';\n\nexport default ({\n title,\n isOpen,\n children,\n onClose,\n className = '',\n dismissible = true,\n}: Props) => {\n const { isClosing, handleContainerClick, handleOnClose } = useOnClose(\n onClose,\n isOpen,\n dismissible\n );\n\n if (!isOpen) {\n return <></>;\n }\n\n return (\n <div\n className={isClosing ? styles['overlay--close'] : styles.overlay}\n onClick={handleOnClose}\n >\n <div\n className={`${\n isClosing ? styles['container--close'] : styles.container\n } ${className}`}\n onClick={handleContainerClick}\n >\n <div className={styles.body}>\n <div className={styles.header}>\n <div className={`p-h2 ${styles.title}`}>{title}</div>\n {dismissible && (\n <button\n type=\"button\"\n className={styles.close}\n onClick={handleOnClose}\n >\n <img src={imageClose} alt=\"Close\" />\n </button>\n )}\n </div>\n {children}\n </div>\n </div>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;AAAA,iBAAe;;ACSf,oBAAe,UAAC,EAOR;QANN,KAAK,WAAA,EACL,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EACd,mBAAkB,EAAlB,WAAW,mBAAG,IAAI,KAAA;IAEZ,IAAA,KAAqD,UAAU,CACnE,OAAO,EACP,MAAM,EACN,WAAW,CACZ,EAJO,SAAS,eAAA,EAAE,oBAAoB,0BAAA,EAAE,aAAa,mBAIrD,CAAC;IAEF,IAAI,CAAC,MAAM,EAAE;QACX,OAAOA,yBAAK,CAAC;KACd;IAED,QACEA,sBACE,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,OAAO,EAChE,OAAO,EAAE,aAAa,gBAEtBA,sBACE,SAAS,EAAE,CACT,SAAS,GAAG,MAAM,CAAC,kBAAkB,CAAC,GAAG,MAAM,CAAC,SAAS,UACvD,SAAW,EACf,OAAO,EAAE,oBAAoB,gBAE7BC,uBAAK,SAAS,EAAE,MAAM,CAAC,IAAI,iBACzBA,uBAAK,SAAS,EAAE,MAAM,CAAC,MAAM,iBAC3BD,sBAAK,SAAS,EAAE,UAAQ,MAAM,CAAC,KAAO,gBAAG,KAAK,YAAO;4BACpD,WAAW,KACVA,yBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,MAAM,CAAC,KAAK,EACvB,OAAO,EAAE,aAAa,gBAEtBA,aAAK,GAAG,EAAE,UAAU,EAAE,GAAG,EAAC,OAAO,WAAG,YAC7B,CACV,aACG,EACL,QAAQ,aACL,YACF,YACF,EACN;AACJ,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/lib/components/modal/regularModal/img/close.svg","../../../../../../src/lib/components/modal/regularModal/index.tsx"],"sourcesContent":["export default \"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M18%206L6%2018%22%20stroke%3D%22%2326262E%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M6%206L18%2018%22%20stroke%3D%22%2326262E%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\"","import React from 'react';\n\nimport { Props } from '..';\nimport useOnClose from '../hooks/useOnClose';\n\nimport styles from './style.module.scss';\n\nimport imageClose from './img/close.svg';\n\nexport default ({\n title,\n isOpen,\n children,\n onClose,\n className = '',\n dismissible = true,\n}: Props) => {\n const {\n isClosing,\n handleContainerClick,\n handleOnClose,\n handleOnOverlayClick\n } = useOnClose(\n onClose,\n isOpen,\n dismissible\n );\n\n if (!isOpen) {\n return <></>;\n }\n\n return (\n <div\n className={isClosing ? styles['overlay--close'] : styles.overlay}\n onClick={handleOnOverlayClick}\n >\n <div\n className={`${\n isClosing ? styles['container--close'] : styles.container\n } ${className}`}\n >\n <div\n className={styles.body}\n onClick={handleContainerClick}\n >\n <div className={styles.header}>\n <div className={`p-h2 ${styles.title}`}>{title}</div>\n {dismissible && (\n <button\n type=\"button\"\n className={styles.close}\n onClick={handleOnClose}\n >\n <img src={imageClose} alt=\"Close\" />\n </button>\n )}\n </div>\n {children}\n </div>\n </div>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;AAAA,iBAAe;;ACSf,oBAAe,UAAC,EAOR;QANN,KAAK,WAAA,EACL,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EACd,mBAAkB,EAAlB,WAAW,mBAAG,IAAI,KAAA;IAEZ,IAAA,KAKF,UAAU,CACZ,OAAO,EACP,MAAM,EACN,WAAW,CACZ,EARC,SAAS,eAAA,EACT,oBAAoB,0BAAA,EACpB,aAAa,mBAAA,EACb,oBAAoB,0BAKrB,CAAC;IAEF,IAAI,CAAC,MAAM,EAAE;QACX,OAAOA,yBAAK,CAAC;KACd;IAED,QACEA,sBACE,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,OAAO,EAChE,OAAO,EAAE,oBAAoB,gBAE7BA,sBACE,SAAS,EAAE,CACT,SAAS,GAAG,MAAM,CAAC,kBAAkB,CAAC,GAAG,MAAM,CAAC,SAAS,UACvD,SAAW,gBAEfC,uBACE,SAAS,EAAE,MAAM,CAAC,IAAI,EACtB,OAAO,EAAE,oBAAoB,iBAE7BA,uBAAK,SAAS,EAAE,MAAM,CAAC,MAAM,iBAC3BD,sBAAK,SAAS,EAAE,UAAQ,MAAM,CAAC,KAAO,gBAAG,KAAK,YAAO;4BACpD,WAAW,KACVA,yBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,MAAM,CAAC,KAAK,EACvB,OAAO,EAAE,aAAa,gBAEtBA,aAAK,GAAG,EAAE,UAAU,EAAE,GAAG,EAAC,OAAO,WAAG,YAC7B,CACV,aACG,EACL,QAAQ,aACL,YACF,YACF,EACN;AACJ,CAAC;;;;"}
package/dist/esm/index.js CHANGED
@@ -34,7 +34,7 @@ import './index-fb46adf9.js';
34
34
  import './index-dd80248b.js';
35
35
  import './index-21239ab0.js';
36
36
  import './index-be398f1d.js';
37
- import './useOnClose-54f9e6b9.js';
37
+ import './useOnClose-d818a54f.js';
38
38
  import './index-171a0108.js';
39
39
  import 'react-dom';
40
40
  import './components/comparisonTable/components/Chevron.js';
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
- declare const useOnClose: (onClose: () => void, isOpen: boolean, dismissable: boolean) => {
2
+ interface OnCloseReturn {
3
3
  isClosing: boolean;
4
- handleContainerClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
4
+ handleContainerClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
5
5
  handleOnClose: () => void;
6
- };
6
+ handleOnOverlayClick: () => void;
7
+ }
8
+ declare const useOnClose: (onClose: () => void, isOpen: boolean, dismissable: boolean) => OnCloseReturn;
7
9
  export default useOnClose;
@@ -9,6 +9,12 @@ var useOnClose = function (onClose, isOpen, dismissable) {
9
9
  setIsClosing(false);
10
10
  }, 300);
11
11
  }, [setIsClosing, onClose]);
12
+ var handleOnOverlayClick = useCallback(function () {
13
+ if (!dismissable) {
14
+ return;
15
+ }
16
+ handleOnClose();
17
+ }, [dismissable, handleOnClose]);
12
18
  var handleEscKey = useCallback(function (e) {
13
19
  if (e.code !== 'Escape')
14
20
  return;
@@ -33,8 +39,8 @@ var useOnClose = function (onClose, isOpen, dismissable) {
33
39
  var handleContainerClick = function (e) {
34
40
  e.stopPropagation();
35
41
  };
36
- return { isClosing: isClosing, handleContainerClick: handleContainerClick, handleOnClose: handleOnClose };
42
+ return { isClosing: isClosing, handleContainerClick: handleContainerClick, handleOnClose: handleOnClose, handleOnOverlayClick: handleOnOverlayClick };
37
43
  };
38
44
 
39
45
  export { useOnClose as u };
40
- //# sourceMappingURL=useOnClose-54f9e6b9.js.map
46
+ //# sourceMappingURL=useOnClose-d818a54f.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnClose-d818a54f.js","sources":["../../../src/lib/components/modal/hooks/useOnClose.ts"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\n\ninterface OnCloseReturn {\n isClosing: boolean;\n handleContainerClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n handleOnClose: () => void;\n handleOnOverlayClick: () => void;\n}\n\nconst useOnClose = (\n onClose: () => void,\n isOpen: boolean,\n dismissable: boolean\n): OnCloseReturn => {\n const [isClosing, setIsClosing] = useState(false);\n\n const handleOnClose = useCallback(() => {\n setIsClosing(true);\n setTimeout(() => {\n onClose();\n setIsClosing(false);\n }, 300);\n }, [setIsClosing, onClose]);\n\n const handleOnOverlayClick = useCallback(() => {\n if (!dismissable) {\n return;\n }\n\n handleOnClose();\n }, [dismissable, handleOnClose]);\n\n const handleEscKey = useCallback(\n (e: KeyboardEvent) => {\n if (e.code !== 'Escape') return;\n if (!dismissable) return null;\n if (!isOpen) return null;\n\n handleOnClose();\n },\n [isOpen, dismissable, handleOnClose]\n );\n\n useEffect(() => {\n window.addEventListener('keydown', handleEscKey);\n\n return () => {\n window.removeEventListener('keydown', handleEscKey);\n };\n }, [handleEscKey]);\n\n useEffect(() => {\n document.body.style.overflow = isOpen ? 'hidden' : 'auto';\n\n return () => {\n document.body.style.overflow = 'auto';\n };\n }, [isOpen]);\n\n const handleContainerClick = (\n e: React.MouseEvent<HTMLDivElement, MouseEvent>\n ) => {\n e.stopPropagation();\n };\n\n return { isClosing, handleContainerClick, handleOnClose, handleOnOverlayClick };\n};\n\nexport default useOnClose;\n"],"names":[],"mappings":";;IASM,UAAU,GAAG,UACjB,OAAmB,EACnB,MAAe,EACf,WAAoB;IAEd,IAAA,KAA4B,QAAQ,CAAC,KAAK,CAAC,EAA1C,SAAS,QAAA,EAAE,YAAY,QAAmB,CAAC;IAElD,IAAM,aAAa,GAAG,WAAW,CAAC;QAChC,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,UAAU,CAAC;YACT,OAAO,EAAE,CAAC;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;SACrB,EAAE,GAAG,CAAC,CAAC;KACT,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IAE5B,IAAM,oBAAoB,GAAG,WAAW,CAAC;QACvC,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO;SACR;QAED,aAAa,EAAE,CAAC;KACjB,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;IAEjC,IAAM,YAAY,GAAG,WAAW,CAC9B,UAAC,CAAgB;QACf,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO;QAChC,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC;QAC9B,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAEzB,aAAa,EAAE,CAAC;KACjB,EACD,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,CAAC,CACrC,CAAC;IAEF,SAAS,CAAC;QACR,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAEjD,OAAO;YACL,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;SACrD,CAAC;KACH,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,SAAS,CAAC;QACR,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;QAE1D,OAAO;YACL,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;SACvC,CAAC;KACH,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,IAAM,oBAAoB,GAAG,UAC3B,CAA+C;QAE/C,CAAC,CAAC,eAAe,EAAE,CAAC;KACrB,CAAC;IAEF,OAAO,EAAE,SAAS,WAAA,EAAE,oBAAoB,sBAAA,EAAE,aAAa,eAAA,EAAE,oBAAoB,sBAAA,EAAE,CAAC;AAClF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popsure/dirty-swan",
3
- "version": "0.28.9",
3
+ "version": "0.28.10",
4
4
  "author": "Vincent Audoire <vincent@getpopsure.com>",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -15,7 +15,12 @@ export default ({
15
15
  dismissible = true,
16
16
  }: Props) => {
17
17
  const [containerXOffset, setContainerXOffset] = useState(0);
18
- const { isClosing, handleContainerClick, handleOnClose } = useOnClose(
18
+ const {
19
+ isClosing,
20
+ handleContainerClick,
21
+ handleOnClose,
22
+ handleOnOverlayClick
23
+ } = useOnClose(
19
24
  onClose,
20
25
  isOpen,
21
26
  dismissible
@@ -39,7 +44,7 @@ export default ({
39
44
  return (
40
45
  <div
41
46
  className={isClosing ? styles['overlay--close'] : styles.overlay}
42
- onClick={handleOnClose}
47
+ onClick={handleOnOverlayClick}
43
48
  >
44
49
  <div
45
50
  className={`${
@@ -1,10 +1,17 @@
1
1
  import React, { useCallback, useEffect, useState } from 'react';
2
2
 
3
+ interface OnCloseReturn {
4
+ isClosing: boolean;
5
+ handleContainerClick: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
6
+ handleOnClose: () => void;
7
+ handleOnOverlayClick: () => void;
8
+ }
9
+
3
10
  const useOnClose = (
4
11
  onClose: () => void,
5
12
  isOpen: boolean,
6
13
  dismissable: boolean
7
- ) => {
14
+ ): OnCloseReturn => {
8
15
  const [isClosing, setIsClosing] = useState(false);
9
16
 
10
17
  const handleOnClose = useCallback(() => {
@@ -15,6 +22,14 @@ const useOnClose = (
15
22
  }, 300);
16
23
  }, [setIsClosing, onClose]);
17
24
 
25
+ const handleOnOverlayClick = useCallback(() => {
26
+ if (!dismissable) {
27
+ return;
28
+ }
29
+
30
+ handleOnClose();
31
+ }, [dismissable, handleOnClose]);
32
+
18
33
  const handleEscKey = useCallback(
19
34
  (e: KeyboardEvent) => {
20
35
  if (e.code !== 'Escape') return;
@@ -48,7 +63,7 @@ const useOnClose = (
48
63
  e.stopPropagation();
49
64
  };
50
65
 
51
- return { isClosing, handleContainerClick, handleOnClose };
66
+ return { isClosing, handleContainerClick, handleOnClose, handleOnOverlayClick };
52
67
  };
53
68
 
54
69
  export default useOnClose;
@@ -15,7 +15,12 @@ export default ({
15
15
  className = '',
16
16
  dismissible = true,
17
17
  }: Props) => {
18
- const { isClosing, handleContainerClick, handleOnClose } = useOnClose(
18
+ const {
19
+ isClosing,
20
+ handleContainerClick,
21
+ handleOnClose,
22
+ handleOnOverlayClick
23
+ } = useOnClose(
19
24
  onClose,
20
25
  isOpen,
21
26
  dismissible
@@ -28,15 +33,17 @@ export default ({
28
33
  return (
29
34
  <div
30
35
  className={isClosing ? styles['overlay--close'] : styles.overlay}
31
- onClick={handleOnClose}
36
+ onClick={handleOnOverlayClick}
32
37
  >
33
38
  <div
34
39
  className={`${
35
40
  isClosing ? styles['container--close'] : styles.container
36
41
  } ${className}`}
37
- onClick={handleContainerClick}
38
42
  >
39
- <div className={styles.body}>
43
+ <div
44
+ className={styles.body}
45
+ onClick={handleContainerClick}
46
+ >
40
47
  <div className={styles.header}>
41
48
  <div className={`p-h2 ${styles.title}`}>{title}</div>
42
49
  {dismissible && (
@@ -97,7 +97,7 @@
97
97
  .body {
98
98
  background-color: white;
99
99
  border-radius: 8px;
100
- margin: 32px auto;
100
+ margin: 80px auto;
101
101
  }
102
102
 
103
103
  .header {
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOnClose-54f9e6b9.js","sources":["../../../src/lib/components/modal/hooks/useOnClose.ts"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\n\nconst useOnClose = (\n onClose: () => void,\n isOpen: boolean,\n dismissable: boolean\n) => {\n const [isClosing, setIsClosing] = useState(false);\n\n const handleOnClose = useCallback(() => {\n setIsClosing(true);\n setTimeout(() => {\n onClose();\n setIsClosing(false);\n }, 300);\n }, [setIsClosing, onClose]);\n\n const handleEscKey = useCallback(\n (e: KeyboardEvent) => {\n if (e.code !== 'Escape') return;\n if (!dismissable) return null;\n if (!isOpen) return null;\n\n handleOnClose();\n },\n [isOpen, dismissable, handleOnClose]\n );\n\n useEffect(() => {\n window.addEventListener('keydown', handleEscKey);\n\n return () => {\n window.removeEventListener('keydown', handleEscKey);\n };\n }, [handleEscKey]);\n\n useEffect(() => {\n document.body.style.overflow = isOpen ? 'hidden' : 'auto';\n\n return () => {\n document.body.style.overflow = 'auto';\n };\n }, [isOpen]);\n\n const handleContainerClick = (\n e: React.MouseEvent<HTMLDivElement, MouseEvent>\n ) => {\n e.stopPropagation();\n };\n\n return { isClosing, handleContainerClick, handleOnClose };\n};\n\nexport default useOnClose;\n"],"names":[],"mappings":";;IAEM,UAAU,GAAG,UACjB,OAAmB,EACnB,MAAe,EACf,WAAoB;IAEd,IAAA,KAA4B,QAAQ,CAAC,KAAK,CAAC,EAA1C,SAAS,QAAA,EAAE,YAAY,QAAmB,CAAC;IAElD,IAAM,aAAa,GAAG,WAAW,CAAC;QAChC,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,UAAU,CAAC;YACT,OAAO,EAAE,CAAC;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;SACrB,EAAE,GAAG,CAAC,CAAC;KACT,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IAE5B,IAAM,YAAY,GAAG,WAAW,CAC9B,UAAC,CAAgB;QACf,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO;QAChC,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC;QAC9B,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAEzB,aAAa,EAAE,CAAC;KACjB,EACD,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,CAAC,CACrC,CAAC;IAEF,SAAS,CAAC;QACR,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAEjD,OAAO;YACL,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;SACrD,CAAC;KACH,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,SAAS,CAAC;QACR,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;QAE1D,OAAO;YACL,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;SACvC,CAAC;KACH,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,IAAM,oBAAoB,GAAG,UAC3B,CAA+C;QAE/C,CAAC,CAAC,eAAe,EAAE,CAAC;KACrB,CAAC;IAEF,OAAO,EAAE,SAAS,WAAA,EAAE,oBAAoB,sBAAA,EAAE,aAAa,eAAA,EAAE,CAAC;AAC5D;;;;"}