@pedidopago/ui 1.16.71 → 1.16.73

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":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,IAAa,EACb,GAAY,EACZ,OAAkB,EAClB,OAAkB,EAClB,OAAe,EACf,OAAe,EACf,aAAqB,EACrB,mBAA0B,EAC1B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,WAAW,EACX,WAAW,EACX,YAA4B,EAC5B,GAAG,IAAI,EACR,EAAE,UAAU,2CAmGZ"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,IAAa,EACb,GAAY,EACZ,OAAkB,EAClB,OAAkB,EAClB,OAAe,EACf,OAAe,EACf,aAAqB,EACrB,mBAA0B,EAC1B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,WAAW,EACX,WAAW,EACX,YAA4B,EAC5B,GAAG,IAAI,EACR,EAAE,UAAU,2CAqGZ"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Modal=Modal;var _framerMotion=require("framer-motion"),_react=require("react"),_useDisableBodyScroll=require("../../shared/hooks/useDisableBodyScroll"),_useKeyPress=require("../../shared/hooks/useKeyPress"),_ReactPortal=require("../ReactPortal"),_styles=require("./styles"),_jsxRuntime=require("react/jsx-runtime"),_excluded=["open","left","top","anchorX","anchorY","offsetX","offsetY","hideScrollBar","disableScrollOnOpen","maxWidth","maxHeight","onClose","hideOverlay","blurOverlay","portalNameId"];function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=_objectWithoutPropertiesLoose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],0<=excluded.indexOf(key)||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],0<=excluded.indexOf(key)||(target[key]=source[key]);return target}function Modal(_ref){function getPercentage(type,value){if("number"==typeof value)return value;var anchor="x"===type?anchorX:anchorY;if("number"==typeof anchor)return anchor;switch(anchor){case"left":case"top":return 0;case"center":return-50;case"right":case"bottom":return-100;default:throw new Error("Invalid ".concat(type," anchor: ").concat(anchor));}}var open=_ref.open,_ref$left=_ref.left,left=void 0===_ref$left?"50vw":_ref$left,_ref$top=_ref.top,top=void 0===_ref$top?"50vh":_ref$top,_ref$anchorX=_ref.anchorX,anchorX=void 0===_ref$anchorX?"center":_ref$anchorX,_ref$anchorY=_ref.anchorY,anchorY=void 0===_ref$anchorY?"center":_ref$anchorY,_ref$offsetX=_ref.offsetX,offsetX=void 0===_ref$offsetX?"0px":_ref$offsetX,_ref$offsetY=_ref.offsetY,offsetY=void 0===_ref$offsetY?"0px":_ref$offsetY,_ref$hideScrollBar=_ref.hideScrollBar,_ref$disableScrollOnO=_ref.disableScrollOnOpen,maxWidth=_ref.maxWidth,maxHeight=_ref.maxHeight,onClose=_ref.onClose,hideOverlay=_ref.hideOverlay,blurOverlay=_ref.blurOverlay,_ref$portalNameId=_ref.portalNameId,portalNameId=void 0===_ref$portalNameId?"portal-root":_ref$portalNameId,rest=_objectWithoutProperties(_ref,_excluded),containerRef=(0,_react.useRef)(null),prevWindowWidth=(0,_react.useRef)(window.innerWidth),_useState=(0,_react.useState)(open),_useState2=_slicedToArray(_useState,2),isOpen=_useState2[0],setIsOpen=_useState2[1],modalID=(0,_react.useId)();(0,_react.useEffect)(function(){return setIsOpen(open)},[open]);var handleCloseOnResize=(0,_react.useCallback)(function(){var isResizingX=prevWindowWidth.current!==window.innerWidth;isResizingX&&isOpen&&(null===onClose||void 0===onClose?void 0:onClose()),prevWindowWidth.current=window.innerWidth},[isOpen,onClose]);return(0,_useKeyPress.useKeyPress)("Escape",onClose),(0,_useDisableBodyScroll.useDisableBodyScroll)(isOpen&&(void 0===_ref$disableScrollOnO||_ref$disableScrollOnO),"modal"),(0,_react.useEffect)(function(){return window.addEventListener("resize",handleCloseOnResize),function(){return window.removeEventListener("resize",handleCloseOnResize)}},[handleCloseOnResize]),/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.AnimatePresence,{mode:"wait",children:isOpen&&/*#__PURE__*/(0,_jsxRuntime.jsxs)(_ReactPortal.ReactPortal,{wrapperId:portalNameId,children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.Overlay,{initial:{opacity:0},exit:{opacity:0},animate:{opacity:blurOverlay?1:.5},transition:{duration:.2},isOpen:isOpen,blur:blurOverlay,onClick:onClose,hidden:hideOverlay},"modal-overlay-".concat(modalID)),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.ModalContainer,{ref:containerRef,style:{left:"calc(".concat(left," + ").concat(offsetX,")"),top:"calc(".concat(top," + ").concat(offsetY,")"),maxWidth:"number"==typeof maxWidth?"".concat(maxWidth,"px"):maxWidth,maxHeight:"number"==typeof maxHeight?"".concat(maxHeight,"px"):maxHeight,transform:function(){return"translate(\n ".concat(getPercentage("x",anchorX),"%, \n ").concat(getPercentage("y",anchorY),"%\n )")}()},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.ModalElement,{"data-scroll":"dispatch-scroll",hideScrollBar:void 0!==_ref$hideScrollBar&&_ref$hideScrollBar,initial:{scale:.8,opacity:0},exit:{scale:.8,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.1},style:{maxHeight:"number"==typeof maxHeight?"".concat(maxHeight,"px"):maxHeight},children:rest.children},"modal-element-".concat(modalID))})]})})}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Modal=Modal;var _framerMotion=require("framer-motion"),_react=require("react"),_useDisableBodyScroll=require("../../shared/hooks/useDisableBodyScroll"),_ReactPortal=require("../ReactPortal"),_styles=require("./styles"),_jsxRuntime=require("react/jsx-runtime"),_excluded=["open","left","top","anchorX","anchorY","offsetX","offsetY","hideScrollBar","disableScrollOnOpen","maxWidth","maxHeight","onClose","hideOverlay","blurOverlay","portalNameId"];function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=_objectWithoutPropertiesLoose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],0<=excluded.indexOf(key)||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],0<=excluded.indexOf(key)||(target[key]=source[key]);return target}function Modal(_ref){function getPercentage(type,value){if("number"==typeof value)return value;var anchor="x"===type?anchorX:anchorY;if("number"==typeof anchor)return anchor;switch(anchor){case"left":case"top":return 0;case"center":return-50;case"right":case"bottom":return-100;default:throw new Error("Invalid ".concat(type," anchor: ").concat(anchor));}}var open=_ref.open,_ref$left=_ref.left,left=void 0===_ref$left?"50vw":_ref$left,_ref$top=_ref.top,top=void 0===_ref$top?"50vh":_ref$top,_ref$anchorX=_ref.anchorX,anchorX=void 0===_ref$anchorX?"center":_ref$anchorX,_ref$anchorY=_ref.anchorY,anchorY=void 0===_ref$anchorY?"center":_ref$anchorY,_ref$offsetX=_ref.offsetX,offsetX=void 0===_ref$offsetX?"0px":_ref$offsetX,_ref$offsetY=_ref.offsetY,offsetY=void 0===_ref$offsetY?"0px":_ref$offsetY,_ref$hideScrollBar=_ref.hideScrollBar,_ref$disableScrollOnO=_ref.disableScrollOnOpen,maxWidth=_ref.maxWidth,maxHeight=_ref.maxHeight,onClose=_ref.onClose,hideOverlay=_ref.hideOverlay,blurOverlay=_ref.blurOverlay,_ref$portalNameId=_ref.portalNameId,portalNameId=void 0===_ref$portalNameId?"portal-root":_ref$portalNameId,rest=_objectWithoutProperties(_ref,_excluded),containerRef=(0,_react.useRef)(null),prevWindowWidth=(0,_react.useRef)(0),_useState=(0,_react.useState)(open),_useState2=_slicedToArray(_useState,2),isOpen=_useState2[0],setIsOpen=_useState2[1],modalID=(0,_react.useId)();(0,_react.useEffect)(function(){setIsOpen(open)},[open]);var handleCloseOnResize=(0,_react.useCallback)(function(){var isResizingX=prevWindowWidth.current!==window.innerWidth;isResizingX&&isOpen&&(null===onClose||void 0===onClose?void 0:onClose()),prevWindowWidth.current=window.innerWidth},[isOpen,onClose]);return(0,_useDisableBodyScroll.useDisableBodyScroll)(isOpen&&(void 0===_ref$disableScrollOnO||_ref$disableScrollOnO),"modal"),(0,_react.useEffect)(function(){return prevWindowWidth.current=window.innerWidth,window.addEventListener("resize",handleCloseOnResize),function(){return window.removeEventListener("resize",handleCloseOnResize)}},[handleCloseOnResize]),/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.AnimatePresence,{mode:"wait",children:isOpen&&/*#__PURE__*/(0,_jsxRuntime.jsxs)(_ReactPortal.ReactPortal,{wrapperId:portalNameId,children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.Overlay,{initial:{opacity:0},exit:{opacity:0},animate:{opacity:blurOverlay?1:.5},transition:{duration:.2},isOpen:isOpen,blur:blurOverlay,onClick:onClose,hidden:hideOverlay},"modal-overlay-".concat(modalID)),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.ModalContainer,{ref:containerRef,style:{left:"calc(".concat(left," + ").concat(offsetX,")"),top:"calc(".concat(top," + ").concat(offsetY,")"),maxWidth:"number"==typeof maxWidth?"".concat(maxWidth,"px"):maxWidth,maxHeight:"number"==typeof maxHeight?"".concat(maxHeight,"px"):maxHeight,transform:function(){return"translate(\n ".concat(getPercentage("x",anchorX),"%, \n ").concat(getPercentage("y",anchorY),"%\n )")}()},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.ModalElement,{"data-scroll":"dispatch-scroll",hideScrollBar:void 0!==_ref$hideScrollBar&&_ref$hideScrollBar,initial:{scale:.8,opacity:0},exit:{scale:.8,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.1},style:{maxHeight:"number"==typeof maxHeight?"".concat(maxHeight,"px"):maxHeight},children:rest.children},"modal-element-".concat(modalID))})]})})}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pedidopago/ui",
3
- "version": "1.16.71",
3
+ "version": "1.16.73",
4
4
  "description": "Quick build beautiful Pedido Pago apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",