@cleartrip/ct-platform-drawer 3.7.0-beta.21 → 3.7.0-beta.22

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,2 +1,2 @@
1
- "use strict";var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react-dom"),r=require("classnames"),t=require("react"),d=require("@cleartrip/ct-design-icons"),i=require("@cleartrip/ct-platform-utils");function l(e){return e&&e.__esModule?e:{default:e}}var _=l(o),a=l(r);var u={modal__container:"index-module_modal__container__srA-N",modal:"index-module_modal__3imuM",left:"index-module_left__jAupb",right:"index-module_right__n7i2S",top:"index-module_top__3q-P0",bottom:"index-module_bottom__I5s6E",overlay:"index-module_overlay__-8Le1","transition-end":"index-module_transition-end__ydkLj",open:"index-module_open__30JoF","drawer-header":"index-module_drawer-header__IGV4R","drawer-close-btn__container":"index-module_drawer-close-btn__container__a0chH","close-icon":"index-module_close-icon__G49OX"};!function(e,n){void 0===n&&(n={});var o=n.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css","top"===o&&r.firstChild?r.insertBefore(t,r.firstChild):r.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}}(".index-module_modal__container__srA-N .index-module_modal__3imuM{-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;justify-content:flex-end;overflow:auto;position:fixed;transition:transform .3s ease;width:auto;z-index:1000}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_left__jAupb{left:0;top:0;transform:translateX(-105%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_right__n7i2S{right:0;top:0;transform:translateX(100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_top__3q-P0{left:0;right:0;top:0;transform:translateY(-100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_bottom__I5s6E{bottom:0;left:0;right:0;transform:translateY(100%)}.index-module_modal__container__srA-N .index-module_overlay__-8Le1{background:rgba(0,0,0,.5);height:100%;left:0;opacity:0;pointer-events:none;position:fixed;top:0;transition:opacity .3s ease,visibility .3s ease;visibility:hidden;width:100%;z-index:999}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_left__jAupb,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_right__n7i2S{transform:translateX(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_bottom__I5s6E,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_top__3q-P0{transform:translateY(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_overlay__-8Le1{opacity:1;pointer-events:auto;visibility:visible;z-index:999}.index-module_drawer-header__IGV4R{align-items:center;background-color:transparent;display:flex;justify-content:flex-end;padding:12px 16px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH{align-items:center;background:#fff;border:none;border-radius:40px;cursor:pointer;display:flex;justify-content:center;outline:none;padding:4px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH:hover{background:#fff}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH .index-module_close-icon__G49OX{height:24px;width:24px}");exports.Drawer=function(o){var r,l=o.isOpen,s=o.handleClose,c=o.onClose,m=o.children,x=o.childrenInsideOverlay,f=o.direction,v=void 0===f?"left":f,h=o.showClose,p=void 0!==h&&h,y=o.overlay,w=void 0===y||y,g=o.closeOnOutsideClick,b=void 0!==g&&g,j=t.useRef(null),A=t.useRef(null),N=t.useRef(null),k=t.useRef(null);if(!i.isServer()&&window&&document&&(A.current=document.querySelector("body"),N.current=document.querySelector("#root, #__next")),!i.isServer()&&window&&document){var C=document.getElementById("drawer-parent");k.current=C||function(){if(!i.isServer()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}()}t.useEffect((function(){var e;null===(e=null==A?void 0:A.current)||void 0===e||e.appendChild(null==k?void 0:k.current);var n=null==k?void 0:k.current,o=null==A?void 0:A.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),t.useEffect((function(){A&&A.current&&(l?(A.current.style.overflow="hidden",(null==N?void 0:N.current)&&(N.current.style.overflow="hidden",N.current.style.height=window.innerHeight+"px")):(A.current.style.overflow="unset",(null==N?void 0:N.current)&&(N.current.style.overflow="unset",N.current.style.height="unset")))}),[l]);var q=function(e,n){var o=t.useState(!1),r=o[0],d=o[1];return t.useEffect((function(){var o;return e&&!r?d(!0):!e&&r&&(o=setTimeout((function(){return d(!1)}),n)),function(){clearTimeout(o)}}),[n,e,r]),r}(l,500);return q||l?n.jsx(n.Fragment,{children:_.default.createPortal(n.jsxs("div",e.__assign({"aria-hidden":l?"false":"true",className:a.default(u.modal__container,(r={},r[u.open]=l,r[u["transition-end"]]=q,r)),onClick:function(e){var n;b&&j.current&&(null===(n=j.current)||void 0===n?void 0:n.contains(e.target))&&s()}},{children:[n.jsxs("div",e.__assign({className:a.default(u.modal,u[v]),role:"dialog"},{children:[p&&n.jsx("div",e.__assign({className:u["drawer-header"]},{children:n.jsx("button",e.__assign({className:u["drawer-close-btn__container"],onClick:function(e){s(e),c()}},{children:n.jsx(d.Cross,{className:u["close-icon"],crossColor:"#1A1A1A"})}))})),m]})),w&&n.jsx("div",e.__assign({"aria-hidden":l?"false":"true",className:"".concat(u.overlay),ref:j},{children:x}))]})),null==k?void 0:k.current)}):null};
1
+ "use strict";var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react-dom"),t=require("classnames"),d=require("react"),r=require("@cleartrip/ct-design-icons"),i=require("@cleartrip/ct-platform-utils");function l(e){return e&&e.__esModule?e:{default:e}}var _=l(o),a=l(t);var u={modal__container:"index-module_modal__container__Ko7cH",modal:"index-module_modal__snYTt",left:"index-module_left__u09rj",right:"index-module_right__TIn-v",top:"index-module_top__Kd1uL",bottom:"index-module_bottom__dCRf4",overlay:"index-module_overlay__Ja-Es","transition-end":"index-module_transition-end__sG4Uc",open:"index-module_open__qC-dm","drawer-header":"index-module_drawer-header__m87OY","drawer-close-btn__container":"index-module_drawer-close-btn__container__s0TDe","close-icon":"index-module_close-icon__E3q1h"};!function(e,n){void 0===n&&(n={});var o=n.insertAt;if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css","top"===o&&t.firstChild?t.insertBefore(d,t.firstChild):t.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e))}}(".index-module_modal__container__Ko7cH .index-module_modal__snYTt{-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;justify-content:flex-end;overflow:auto;position:fixed;transition:transform .3s ease;width:auto;z-index:1000}.index-module_modal__container__Ko7cH .index-module_modal__snYTt.index-module_left__u09rj{left:0;top:0;transform:translateX(-105%)}.index-module_modal__container__Ko7cH .index-module_modal__snYTt.index-module_right__TIn-v{right:0;top:0;transform:translateX(100%)}.index-module_modal__container__Ko7cH .index-module_modal__snYTt.index-module_top__Kd1uL{left:0;right:0;top:0;transform:translateY(-100%)}.index-module_modal__container__Ko7cH .index-module_modal__snYTt.index-module_bottom__dCRf4{bottom:0;left:0;right:0;transform:translateY(100%)}.index-module_modal__container__Ko7cH .index-module_overlay__Ja-Es{background:rgba(0,0,0,.5);height:100%;left:0;opacity:0;pointer-events:none;position:fixed;top:0;transition:opacity .3s ease,visibility .3s ease;visibility:hidden;width:100%;z-index:999}.index-module_modal__container__Ko7cH.index-module_transition-end__sG4Uc.index-module_open__qC-dm .index-module_left__u09rj,.index-module_modal__container__Ko7cH.index-module_transition-end__sG4Uc.index-module_open__qC-dm .index-module_right__TIn-v{transform:translateX(0)}.index-module_modal__container__Ko7cH.index-module_transition-end__sG4Uc.index-module_open__qC-dm .index-module_bottom__dCRf4,.index-module_modal__container__Ko7cH.index-module_transition-end__sG4Uc.index-module_open__qC-dm .index-module_top__Kd1uL{transform:translateY(0)}.index-module_modal__container__Ko7cH.index-module_transition-end__sG4Uc.index-module_open__qC-dm .index-module_overlay__Ja-Es{opacity:1;pointer-events:auto;visibility:visible;z-index:999}.index-module_drawer-header__m87OY{align-items:center;background-color:transparent;display:flex;justify-content:flex-end;padding:12px 16px}.index-module_drawer-header__m87OY .index-module_drawer-close-btn__container__s0TDe{align-items:center;background:#fff;border:none;border-radius:40px;cursor:pointer;display:flex;justify-content:center;outline:none;padding:4px}.index-module_drawer-header__m87OY .index-module_drawer-close-btn__container__s0TDe:hover{background:#fff}.index-module_drawer-header__m87OY .index-module_drawer-close-btn__container__s0TDe .index-module_close-icon__E3q1h{height:24px;width:24px}");exports.Drawer=function(o){var t,l=o.isOpen,s=o.handleClose,c=o.onClose,m=o.children,x=o.childrenInsideOverlay,f=o.direction,v=void 0===f?"left":f,h=o.showClose,p=void 0!==h&&h,w=o.overlay,y=void 0===w||w,g=o.closeOnOutsideClick,b=void 0!==g&&g,C=d.useRef(null),T=d.useRef(null),q=d.useRef(null),K=d.useRef(null);if(!i.isServer()&&window&&document&&(T.current=document.querySelector("body"),q.current=document.querySelector("#root, #__next")),!i.isServer()&&window&&document){var j=document.getElementById("drawer-parent");K.current=j||function(){if(!i.isServer()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}()}d.useEffect((function(){var e;null===(e=null==T?void 0:T.current)||void 0===e||e.appendChild(null==K?void 0:K.current);var n=null==K?void 0:K.current,o=null==T?void 0:T.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),d.useEffect((function(){T&&T.current&&(l?(T.current.style.overflow="hidden",(null==q?void 0:q.current)&&(q.current.style.overflow="hidden",q.current.style.height=window.innerHeight+"px")):(T.current.style.overflow="unset",(null==q?void 0:q.current)&&(q.current.style.overflow="unset",q.current.style.height="unset")))}),[l]);var Y=function(e,n){var o=d.useState(!1),t=o[0],r=o[1];return d.useEffect((function(){var o;return e&&!t?r(!0):!e&&t&&(o=setTimeout((function(){return r(!1)}),n)),function(){clearTimeout(o)}}),[n,e,t]),t}(l,500);return Y||l?n.jsx(n.Fragment,{children:_.default.createPortal(n.jsxs("div",e.__assign({"aria-hidden":l?"false":"true",className:a.default(u.modal__container,(t={},t[u.open]=l,t[u["transition-end"]]=Y,t)),onClick:function(e){var n;b&&C.current&&(null===(n=C.current)||void 0===n?void 0:n.contains(e.target))&&s()}},{children:[n.jsxs("div",e.__assign({className:a.default(u.modal,u[v]),role:"dialog"},{children:[p&&n.jsx("div",e.__assign({className:u["drawer-header"]},{children:n.jsx("button",e.__assign({className:u["drawer-close-btn__container"],onClick:function(e){s(e),c()}},{children:n.jsx(r.Cross,{className:u["close-icon"],crossColor:"#1A1A1A"})}))})),m]})),y&&n.jsx("div",e.__assign({"aria-hidden":l?"false":"true",className:"".concat(u.overlay),ref:C},{children:x}))]})),null==K?void 0:K.current)}):null};
2
2
  //# sourceMappingURL=ct-platform-drawer.cjs.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as n,Fragment as o,jsxs as t}from"react/jsx-runtime";import d from"react-dom";import r from"classnames";import{useState as i,useEffect as l,useRef as _}from"react";import{Cross as a}from"@cleartrip/ct-design-icons";import{isServer as u}from"@cleartrip/ct-platform-utils";var m={modal__container:"index-module_modal__container__srA-N",modal:"index-module_modal__3imuM",left:"index-module_left__jAupb",right:"index-module_right__n7i2S",top:"index-module_top__3q-P0",bottom:"index-module_bottom__I5s6E",overlay:"index-module_overlay__-8Le1","transition-end":"index-module_transition-end__ydkLj",open:"index-module_open__30JoF","drawer-header":"index-module_drawer-header__IGV4R","drawer-close-btn__container":"index-module_drawer-close-btn__container__a0chH","close-icon":"index-module_close-icon__G49OX"};!function(e,n){void 0===n&&(n={});var o=n.insertAt;if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css","top"===o&&t.firstChild?t.insertBefore(d,t.firstChild):t.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e))}}(".index-module_modal__container__srA-N .index-module_modal__3imuM{-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;justify-content:flex-end;overflow:auto;position:fixed;transition:transform .3s ease;width:auto;z-index:1000}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_left__jAupb{left:0;top:0;transform:translateX(-105%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_right__n7i2S{right:0;top:0;transform:translateX(100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_top__3q-P0{left:0;right:0;top:0;transform:translateY(-100%)}.index-module_modal__container__srA-N .index-module_modal__3imuM.index-module_bottom__I5s6E{bottom:0;left:0;right:0;transform:translateY(100%)}.index-module_modal__container__srA-N .index-module_overlay__-8Le1{background:rgba(0,0,0,.5);height:100%;left:0;opacity:0;pointer-events:none;position:fixed;top:0;transition:opacity .3s ease,visibility .3s ease;visibility:hidden;width:100%;z-index:999}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_left__jAupb,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_right__n7i2S{transform:translateX(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_bottom__I5s6E,.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_top__3q-P0{transform:translateY(0)}.index-module_modal__container__srA-N.index-module_transition-end__ydkLj.index-module_open__30JoF .index-module_overlay__-8Le1{opacity:1;pointer-events:auto;visibility:visible;z-index:999}.index-module_drawer-header__IGV4R{align-items:center;background-color:transparent;display:flex;justify-content:flex-end;padding:12px 16px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH{align-items:center;background:#fff;border:none;border-radius:40px;cursor:pointer;display:flex;justify-content:center;outline:none;padding:4px}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH:hover{background:#fff}.index-module_drawer-header__IGV4R .index-module_drawer-close-btn__container__a0chH .index-module_close-icon__G49OX{height:24px;width:24px}");var c=function(c){var s,x=c.isOpen,f=c.handleClose,p=c.onClose,h=c.children,v=c.childrenInsideOverlay,y=c.direction,w=void 0===y?"left":y,b=c.showClose,g=void 0!==b&&b,A=c.overlay,N=void 0===A||A,k=c.closeOnOutsideClick,j=void 0!==k&&k,C=_(null),I=_(null),L=_(null),E=_(null);if(!u()&&window&&document&&(I.current=document.querySelector("body"),L.current=document.querySelector("#root, #__next")),!u()&&window&&document){var G=document.getElementById("drawer-parent");E.current=G||function(){if(!u()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}()}l((function(){var e;null===(e=null==I?void 0:I.current)||void 0===e||e.appendChild(null==E?void 0:E.current);var n=null==E?void 0:E.current,o=null==I?void 0:I.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),l((function(){I&&I.current&&(x?(I.current.style.overflow="hidden",(null==L?void 0:L.current)&&(L.current.style.overflow="hidden",L.current.style.height=window.innerHeight+"px")):(I.current.style.overflow="unset",(null==L?void 0:L.current)&&(L.current.style.overflow="unset",L.current.style.height="unset")))}),[x]);var S=function(e,n){var o=i(!1),t=o[0],d=o[1];return l((function(){var o;return e&&!t?d(!0):!e&&t&&(o=setTimeout((function(){return d(!1)}),n)),function(){clearTimeout(o)}}),[n,e,t]),t}(x,500);return S||x?n(o,{children:d.createPortal(t("div",e({"aria-hidden":x?"false":"true",className:r(m.modal__container,(s={},s[m.open]=x,s[m["transition-end"]]=S,s)),onClick:function(e){var n;j&&C.current&&(null===(n=C.current)||void 0===n?void 0:n.contains(e.target))&&f()}},{children:[t("div",e({className:r(m.modal,m[w]),role:"dialog"},{children:[g&&n("div",e({className:m["drawer-header"]},{children:n("button",e({className:m["drawer-close-btn__container"],onClick:function(e){f(e),p()}},{children:n(a,{className:m["close-icon"],crossColor:"#1A1A1A"})}))})),h]})),N&&n("div",e({"aria-hidden":x?"false":"true",className:"".concat(m.overlay),ref:C},{children:v}))]})),null==E?void 0:E.current)}):null};export{c as Drawer};
1
+ import{__assign as e}from"tslib";import{jsx as n,Fragment as o,jsxs as t}from"react/jsx-runtime";import d from"react-dom";import r from"classnames";import{useState as i,useEffect as l,useRef as _}from"react";import{Cross as a}from"@cleartrip/ct-design-icons";import{isServer as u}from"@cleartrip/ct-platform-utils";var c={modal__container:"index-module_modal__container__Ko7cH",modal:"index-module_modal__snYTt",left:"index-module_left__u09rj",right:"index-module_right__TIn-v",top:"index-module_top__Kd1uL",bottom:"index-module_bottom__dCRf4",overlay:"index-module_overlay__Ja-Es","transition-end":"index-module_transition-end__sG4Uc",open:"index-module_open__qC-dm","drawer-header":"index-module_drawer-header__m87OY","drawer-close-btn__container":"index-module_drawer-close-btn__container__s0TDe","close-icon":"index-module_close-icon__E3q1h"};!function(e,n){void 0===n&&(n={});var o=n.insertAt;if("undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css","top"===o&&t.firstChild?t.insertBefore(d,t.firstChild):t.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e))}}(".index-module_modal__container__Ko7cH .index-module_modal__snYTt{-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;justify-content:flex-end;overflow:auto;position:fixed;transition:transform .3s ease;width:auto;z-index:1000}.index-module_modal__container__Ko7cH .index-module_modal__snYTt.index-module_left__u09rj{left:0;top:0;transform:translateX(-105%)}.index-module_modal__container__Ko7cH .index-module_modal__snYTt.index-module_right__TIn-v{right:0;top:0;transform:translateX(100%)}.index-module_modal__container__Ko7cH .index-module_modal__snYTt.index-module_top__Kd1uL{left:0;right:0;top:0;transform:translateY(-100%)}.index-module_modal__container__Ko7cH .index-module_modal__snYTt.index-module_bottom__dCRf4{bottom:0;left:0;right:0;transform:translateY(100%)}.index-module_modal__container__Ko7cH .index-module_overlay__Ja-Es{background:rgba(0,0,0,.5);height:100%;left:0;opacity:0;pointer-events:none;position:fixed;top:0;transition:opacity .3s ease,visibility .3s ease;visibility:hidden;width:100%;z-index:999}.index-module_modal__container__Ko7cH.index-module_transition-end__sG4Uc.index-module_open__qC-dm .index-module_left__u09rj,.index-module_modal__container__Ko7cH.index-module_transition-end__sG4Uc.index-module_open__qC-dm .index-module_right__TIn-v{transform:translateX(0)}.index-module_modal__container__Ko7cH.index-module_transition-end__sG4Uc.index-module_open__qC-dm .index-module_bottom__dCRf4,.index-module_modal__container__Ko7cH.index-module_transition-end__sG4Uc.index-module_open__qC-dm .index-module_top__Kd1uL{transform:translateY(0)}.index-module_modal__container__Ko7cH.index-module_transition-end__sG4Uc.index-module_open__qC-dm .index-module_overlay__Ja-Es{opacity:1;pointer-events:auto;visibility:visible;z-index:999}.index-module_drawer-header__m87OY{align-items:center;background-color:transparent;display:flex;justify-content:flex-end;padding:12px 16px}.index-module_drawer-header__m87OY .index-module_drawer-close-btn__container__s0TDe{align-items:center;background:#fff;border:none;border-radius:40px;cursor:pointer;display:flex;justify-content:center;outline:none;padding:4px}.index-module_drawer-header__m87OY .index-module_drawer-close-btn__container__s0TDe:hover{background:#fff}.index-module_drawer-header__m87OY .index-module_drawer-close-btn__container__s0TDe .index-module_close-icon__E3q1h{height:24px;width:24px}");var m=function(m){var s,x=m.isOpen,f=m.handleClose,p=m.onClose,v=m.children,h=m.childrenInsideOverlay,y=m.direction,w=void 0===y?"left":y,g=m.showClose,b=void 0!==g&&g,C=m.overlay,T=void 0===C||C,K=m.closeOnOutsideClick,Y=void 0!==K&&K,H=_(null),q=_(null),E=_(null),O=_(null);if(!u()&&window&&document&&(q.current=document.querySelector("body"),E.current=document.querySelector("#root, #__next")),!u()&&window&&document){var k=document.getElementById("drawer-parent");O.current=k||function(){if(!u()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}()}l((function(){var e;null===(e=null==q?void 0:q.current)||void 0===e||e.appendChild(null==O?void 0:O.current);var n=null==O?void 0:O.current,o=null==q?void 0:q.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),l((function(){q&&q.current&&(x?(q.current.style.overflow="hidden",(null==E?void 0:E.current)&&(E.current.style.overflow="hidden",E.current.style.height=window.innerHeight+"px")):(q.current.style.overflow="unset",(null==E?void 0:E.current)&&(E.current.style.overflow="unset",E.current.style.height="unset")))}),[x]);var N=function(e,n){var o=i(!1),t=o[0],d=o[1];return l((function(){var o;return e&&!t?d(!0):!e&&t&&(o=setTimeout((function(){return d(!1)}),n)),function(){clearTimeout(o)}}),[n,e,t]),t}(x,500);return N||x?n(o,{children:d.createPortal(t("div",e({"aria-hidden":x?"false":"true",className:r(c.modal__container,(s={},s[c.open]=x,s[c["transition-end"]]=N,s)),onClick:function(e){var n;Y&&H.current&&(null===(n=H.current)||void 0===n?void 0:n.contains(e.target))&&f()}},{children:[t("div",e({className:r(c.modal,c[w]),role:"dialog"},{children:[b&&n("div",e({className:c["drawer-header"]},{children:n("button",e({className:c["drawer-close-btn__container"],onClick:function(e){f(e),p()}},{children:n(a,{className:c["close-icon"],crossColor:"#1A1A1A"})}))})),v]})),T&&n("div",e({"aria-hidden":x?"false":"true",className:"".concat(c.overlay),ref:H},{children:h}))]})),null==O?void 0:O.current)}):null};export{m as Drawer};
2
2
  //# sourceMappingURL=ct-platform-drawer.esm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-platform-drawer",
3
- "version": "3.7.0-beta.21",
3
+ "version": "3.7.0-beta.22",
4
4
  "description": "Drawer Component",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/ct-platform-drawer.cjs.js",
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "@cleartrip/ct-design-icons": "7.0.0",
14
14
  "classnames": "^2.5.1",
15
- "@cleartrip/ct-platform-utils": "3.12.0-beta.21"
15
+ "@cleartrip/ct-platform-utils": "3.12.0-beta.22"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "react": ">=16.8.0",