@cleartrip/ct-platform-drawer 2.7.0-beta.2 → 2.7.0

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 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../packages/components/Drawer/src/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAOjD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAoB7C,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAoIjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../packages/components/Drawer/src/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAO9D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAoB7C,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAyHjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react"),r=require("react-dom"),t=require("classnames"),d=require("@cleartrip/ct-design-icons"),i=require("@cleartrip/ct-platform-utils");function l(e){return e&&e.__esModule?e:{default:e}}var _=l(r),a=l(t);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(e&&"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(r){var t,l=r.isOpen,s=r.handleClose,c=r.onClose,m=r.children,x=r.direction,f=void 0===x?"left":x,v=r.showClose,p=void 0!==v&&v,h=r.overlay,y=void 0===h||h,w=r.closeOnOutsideClick,g=void 0!==w&&w,b=o.useRef(null),j=o.useRef(null),A=o.useRef(null),N=o.useRef(null);if(!i.isServer()&&window&&document&&(b.current=document.querySelector("body"),j.current=document.querySelector("#root, #__next")),!i.isServer()&&window&&document){var k=document.getElementById("drawer-parent");A.current=k||function(){if(!i.isServer()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}()}o.useEffect((function(){var e;null===(e=null==b?void 0:b.current)||void 0===e||e.appendChild(null==A?void 0:A.current);var n=null==A?void 0:A.current,o=null==b?void 0:b.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),o.useEffect((function(){b&&b.current&&(l?(b.current.style.overflow="hidden",(null==j?void 0:j.current)&&(j.current.style.overflow="hidden",j.current.style.height=window.innerHeight+"px")):(b.current.style.overflow="unset",(null==j?void 0:j.current)&&(j.current.style.overflow="unset",j.current.style.height="unset")))}),[l]);var C=function(e,n){var r=o.useState(!1),t=r[0],d=r[1];return o.useEffect((function(){var o;return e&&!t?d(!0):!e&&t&&(o=setTimeout((function(){return d(!1)}),n)),function(){clearTimeout(o)}}),[n,e,t]),t}(l,500);return C||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"]]=C,t)),onClick:function(e){var n;g&&N.current&&(null===(n=N.current)||void 0===n?void 0:n.contains(e.target))&&s()}},{children:[n.jsxs("div",e.__assign({className:a.default(u.modal,u[f]),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]})),y&&n.jsx("div",{"aria-hidden":l?"false":"true",className:"".concat(u.overlay),ref:N})]})),null==A?void 0:A.current)}):null};
1
+ "use strict";var e=require("tslib"),n=require("react/jsx-runtime"),o=require("react"),d=require("react-dom"),i=require("classnames"),r=require("@cleartrip/ct-design-icons"),t=require("@cleartrip/ct-platform-utils");function _(e){return e&&e.__esModule?e:{default:e}}var l=_(d),a=_(i);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(e&&"undefined"!=typeof document){var d=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&d.firstChild?d.insertBefore(i,d.firstChild):d.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.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(d){var i,_=d.isOpen,s=d.handleClose,c=d.onClose,m=d.children,x=d.direction,f=void 0===x?"left":x,p=d.showClose,v=void 0!==p&&p,h=d.overlay,y=void 0===h||h,w=d.closeOnOutsideClick,b=void 0!==w&&w,g=o.useRef(null),j=o.useRef(null),A=o.useRef(null);if(!t.isServer()&&window&&document&&(g.current=document.querySelector("body")),!t.isServer()&&window&&document){var N=document.getElementById("drawer-parent");j.current=N||function(){if(!t.isServer()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}()}o.useEffect((function(){var e;null===(e=null==g?void 0:g.current)||void 0===e||e.appendChild(null==j?void 0:j.current);var n=null==j?void 0:j.current,o=null==g?void 0:g.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),o.useEffect((function(){g&&g.current&&(g.current.style.overflow=_?"hidden":"unset")}),[_]);var k=function(e,n){var d=o.useState(!1),i=d[0],r=d[1];return o.useEffect((function(){var o;return e&&!i?r(!0):!e&&i&&(o=setTimeout((function(){return r(!1)}),n)),function(){clearTimeout(o)}}),[n,e,i]),i}(_,500);return k||_?n.jsx(n.Fragment,{children:l.default.createPortal(n.jsxs("div",e.__assign({"aria-hidden":_?"false":"true",className:a.default(u.modal__container,(i={},i[u.open]=_,i[u["transition-end"]]=k,i)),onClick:function(e){var n;b&&A.current&&(null===(n=A.current)||void 0===n?void 0:n.contains(e.target))&&s()}},{children:[n.jsxs("div",e.__assign({className:a.default(u.modal,u[f]),role:"dialog"},{children:[v&&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",{"aria-hidden":_?"false":"true",className:"".concat(u.overlay),ref:A})]})),null==j?void 0:j.current)}):null};
2
2
  //# sourceMappingURL=ct-platform-drawer.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-platform-drawer.cjs.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/Drawer/src/Drawer.tsx","../packages/components/Drawer/src/useMountTransition.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","_a","isOpen","handleClose","onClose","children","_c","direction","_d","showClose","_e","overlay","_f","closeOnOutsideClick","bodyRef","useRef","innerDiv","portalParentRef","modalRef","isServer","window","current","querySelector","parentElement","getElementById","drawerParent","setAttribute","createPortalParent","useEffect","portal","bodyEl","remove","overflow","height","innerHeight","isTransitioning","isMounted","unmountDelay","useState","setIsTransitioning","timeoutId","setTimeout","clearTimeout","useMountTransition","_jsx","jsx","_Fragment","Fragment","ReactDOM","default","createPortal","_jsxs","__assign","className","classnames","Styles","_b","onClick","event","contains","target","role","evt","Cross","crossColor","concat"],"mappings":"izBAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,k2ECEsC,SAACe,SACnCC,WACAC,EAAWF,EAAAE,YACXC,EAAOH,EAAAG,QACPC,EAAQJ,EAAAI,SACRC,EAAkBL,EAAAM,UAAlBA,OAAS,IAAAD,EAAG,OAAMA,EAClBE,EAAiBP,EAAAQ,UAAjBA,OAAY,IAAAD,GAAKA,EACjBE,YAAAC,OAAU,IAAAD,KACVE,EAA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"version":3,"file":"ct-platform-drawer.cjs.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/Drawer/src/Drawer.tsx","../packages/components/Drawer/src/useMountTransition.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","_a","isOpen","handleClose","onClose","children","_c","direction","_d","showClose","_e","overlay","_f","closeOnOutsideClick","bodyRef","useRef","portalParentRef","modalRef","isServer","window","current","querySelector","parentElement","getElementById","drawerParent","setAttribute","createPortalParent","useEffect","portal","bodyEl","remove","overflow","isTransitioning","isMounted","unmountDelay","useState","setIsTransitioning","timeoutId","setTimeout","clearTimeout","useMountTransition","_jsx","jsx","_Fragment","Fragment","ReactDOM","default","createPortal","_jsxs","__assign","className","classnames","Styles","_b","onClick","event","contains","target","role","evt","Cross","crossColor","concat"],"mappings":"izBAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO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,IA6Df","x_google_ignoreList":[0]}
@@ -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{useState as d,useEffect as r,useRef as i}from"react";import l from"react-dom";import _ from"classnames";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(e&&"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.direction,y=void 0===v?"left":v,w=c.showClose,b=void 0!==w&&w,g=c.overlay,A=void 0===g||g,N=c.closeOnOutsideClick,k=void 0!==N&&N,j=i(null),C=i(null),I=i(null),L=i(null);if(!u()&&window&&document&&(j.current=document.querySelector("body"),C.current=document.querySelector("#root, #__next")),!u()&&window&&document){var E=document.getElementById("drawer-parent");I.current=E||function(){if(!u()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}()}r((function(){var e;null===(e=null==j?void 0:j.current)||void 0===e||e.appendChild(null==I?void 0:I.current);var n=null==I?void 0:I.current,o=null==j?void 0:j.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),r((function(){j&&j.current&&(x?(j.current.style.overflow="hidden",(null==C?void 0:C.current)&&(C.current.style.overflow="hidden",C.current.style.height=window.innerHeight+"px")):(j.current.style.overflow="unset",(null==C?void 0:C.current)&&(C.current.style.overflow="unset",C.current.style.height="unset")))}),[x]);var G=function(e,n){var o=d(!1),t=o[0],i=o[1];return r((function(){var o;return e&&!t?i(!0):!e&&t&&(o=setTimeout((function(){return i(!1)}),n)),function(){clearTimeout(o)}}),[n,e,t]),t}(x,500);return G||x?n(o,{children:l.createPortal(t("div",e({"aria-hidden":x?"false":"true",className:_(m.modal__container,(s={},s[m.open]=x,s[m["transition-end"]]=G,s)),onClick:function(e){var n;k&&L.current&&(null===(n=L.current)||void 0===n?void 0:n.contains(e.target))&&f()}},{children:[t("div",e({className:_(m.modal,m[y]),role:"dialog"},{children:[b&&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]})),A&&n("div",{"aria-hidden":x?"false":"true",className:"".concat(m.overlay),ref:L})]})),null==I?void 0:I.current)}):null};export{c as Drawer};
1
+ import{__assign as e}from"tslib";import{jsx as n,Fragment as o,jsxs as d}from"react/jsx-runtime";import{useState as i,useEffect as t,useRef as r}from"react";import _ from"react-dom";import l from"classnames";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(e&&"undefined"!=typeof document){var d=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&d.firstChild?d.insertBefore(i,d.firstChild):d.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.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,v=c.children,h=c.direction,y=void 0===h?"left":h,b=c.showClose,w=void 0!==b&&b,g=c.overlay,A=void 0===g||g,N=c.closeOnOutsideClick,k=void 0!==N&&N,j=r(null),C=r(null),I=r(null);if(!u()&&window&&document&&(j.current=document.querySelector("body")),!u()&&window&&document){var L=document.getElementById("drawer-parent");C.current=L||function(){if(!u()&&window&&document){var e=document.createElement("div");return e.setAttribute("id","drawer-parent"),e}return null}()}t((function(){var e;null===(e=null==j?void 0:j.current)||void 0===e||e.appendChild(null==C?void 0:C.current);var n=null==C?void 0:C.current,o=null==j?void 0:j.current;return function(){null==n||n.remove(),o&&(o.style.overflow="")}}),[]),t((function(){j&&j.current&&(j.current.style.overflow=x?"hidden":"unset")}),[x]);var E=function(e,n){var o=i(!1),d=o[0],r=o[1];return t((function(){var o;return e&&!d?r(!0):!e&&d&&(o=setTimeout((function(){return r(!1)}),n)),function(){clearTimeout(o)}}),[n,e,d]),d}(x,500);return E||x?n(o,{children:_.createPortal(d("div",e({"aria-hidden":x?"false":"true",className:l(m.modal__container,(s={},s[m.open]=x,s[m["transition-end"]]=E,s)),onClick:function(e){var n;k&&I.current&&(null===(n=I.current)||void 0===n?void 0:n.contains(e.target))&&f()}},{children:[d("div",e({className:l(m.modal,m[y]),role:"dialog"},{children:[w&&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"})}))})),v]})),A&&n("div",{"aria-hidden":x?"false":"true",className:"".concat(m.overlay),ref:I})]})),null==C?void 0:C.current)}):null};export{c as Drawer};
2
2
  //# sourceMappingURL=ct-platform-drawer.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-platform-drawer.esm.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/Drawer/src/useMountTransition.tsx","../packages/components/Drawer/src/Drawer.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","Drawer","_a","isOpen","handleClose","onClose","children","_c","direction","_d","showClose","_e","overlay","_f","closeOnOutsideClick","bodyRef","useRef","innerDiv","portalParentRef","modalRef","isServer","window","current","querySelector","parentElement","getElementById","drawerParent","setAttribute","createPortalParent","useEffect","portal","bodyEl","remove","overflow","height","innerHeight","isTransitioning","isMounted","unmountDelay","useState","setIsTransitioning","timeoutId","setTimeout","clearTimeout","useMountTransition","_jsx","_Fragment","ReactDOM","createPortal","_jsxs","__assign","className","classnames","Styles","_b","onClick","event","contains","target","role","evt","Cross","crossColor","concat"],"mappings":"g1BAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,Y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AAO,cAClBS,WAAW,kBAK1BxD,MAEJM,GACGiC,EAAA,MAAA,CAAA,cACiB1C,EAAS,QAAU,OAChCgD,UAAW,GAAAY,OAAGV,EAAgB,SAC9BlE,IAAKgC,QAIjBD,aAAA,EAAAA,EAAiBI,WAzDlB,IA6Df","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ct-platform-drawer.esm.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/Drawer/src/useMountTransition.tsx","../packages/components/Drawer/src/Drawer.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","Drawer","_a","isOpen","handleClose","onClose","children","_c","direction","_d","showClose","_e","overlay","_f","closeOnOutsideClick","bodyRef","useRef","portalParentRef","modalRef","isServer","window","current","querySelector","parentElement","getElementById","drawerParent","setAttribute","createPortalParent","useEffect","portal","bodyEl","remove","overflow","isTransitioning","isMounted","unmountDelay","useState","setIsTransitioning","timeoutId","setTimeout","clearTimeout","useMountTransition","_jsx","_Fragment","ReactDOM","createPortal","_jsxs","__assign","className","classnames","Styles","_b","onClick","event","contains","target","role","evt","Cross","crossColor","concat"],"mappings":"g1BAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA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AAAY,OAAGV,EAAgB,SAC9B/D,IAAK+B,QAIjBD,aAAA,EAAAA,EAAiBI,WAzDlB,IA6Df","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-platform-drawer",
3
- "version": "2.7.0-beta.2",
3
+ "version": "2.7.0",
4
4
  "description": "Drawer Component",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/ct-platform-drawer.cjs.js",
@@ -13,7 +13,7 @@
13
13
  "@cleartrip/ct-design-icons": "7.0.0",
14
14
  "classnames": "^2.5.1",
15
15
  "styled-components": "^5.3.11",
16
- "@cleartrip/ct-platform-utils": "2.4.0"
16
+ "@cleartrip/ct-platform-utils": "2.4.1"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": ">=16.8.0",