@pedidopago/ui 1.12.19 → 1.12.21
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.
- package/dist/components/Carousel/contexts/carousel-context/index.d.ts.map +1 -1
- package/dist/components/Carousel/contexts/carousel-context/index.js +1 -1
- package/dist/components/Carousel/styles.d.ts.map +1 -1
- package/dist/components/Carousel/styles.js +1 -1
- package/dist/components/Icon/data/dash.d.ts.map +1 -1
- package/dist/components/Icon/data/dash.js +1 -1
- package/dist/components/Icon/data/filled.d.ts +9 -0
- package/dist/components/Icon/data/filled.d.ts.map +1 -0
- package/dist/components/Icon/data/filled.js +3 -0
- package/dist/components/Icon/scripts/build.d.ts.map +1 -1
- package/dist/components/Icon/scripts/build.js +2 -2
- package/dist/components/Icon/types.d.ts +1 -1
- package/dist/components/Icon/types.d.ts.map +1 -1
- package/dist/components/Icon/utils/allIcons.d.ts.map +1 -1
- package/dist/components/Icon/utils/allIcons.js +1 -1
- package/dist/utils/{array.d.ts → arrays.d.ts} +1 -1
- package/dist/utils/arrays.d.ts.map +1 -0
- package/dist/utils/{array.js → arrays.js} +1 -1
- package/package.json +1 -1
- package/dist/utils/array.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Carousel/contexts/carousel-context/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA8C,MAAM,OAAO,CAAC;AAMtF,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEtE,eAAO,MAAM,eAAe,+CAAkE,CAAC;AAE/F,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,aAAa,EACb,SAAS,EAAE,UAAkB,GAC9B,EAAE,iBAAiB,GAAG,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Carousel/contexts/carousel-context/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA8C,MAAM,OAAO,CAAC;AAMtF,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEtE,eAAO,MAAM,eAAe,+CAAkE,CAAC;AAE/F,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,aAAa,EACb,SAAS,EAAE,UAAkB,GAC9B,EAAE,iBAAiB,GAAG,qBAAqB,eAyV3C"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CarouselContext=void 0,exports.CarouselProvider=CarouselProvider;var _react=require("react"),_useDebounce=require("../../../../shared/hooks/useDebounce"),_interval=require("../../../../shared/hooks/interval"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CarouselContext=void 0,exports.CarouselProvider=CarouselProvider;var _react=require("react"),_useDebounce=require("../../../../shared/hooks/useDebounce"),_interval=require("../../../../shared/hooks/interval"),_arrays=require("../../../../utils/arrays"),_jsxRuntime=require("react/jsx-runtime");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}var CarouselContext=/*#__PURE__*/(0,_react.createContext)({});exports.CarouselContext=CarouselContext;function CarouselProvider(_ref){function getSliderInfo(){var container=sliderRef.current,arrayOfChildrens=Array.from(container.childNodes),positions=arrayOfChildrens.map(function(data,index){return{offsetPosition:data.offsetLeft,offsetPositionPercent:data.offsetLeft-.3*data.offsetLeft,position:index+1}});return{container:container,positions:positions}}function navigateToScroll(scrollPosition){var sliderInfo=getSliderInfo();sliderInfo.container&&sliderInfo.container.scrollTo({behavior:"smooth",left:scrollPosition})}function hideRightButton(hide){rightButtonRef.current&&(hide?rightButtonRef.current.classList.add("hide"):rightButtonRef.current.classList.remove("hide"))}function hideLeftButton(hide){leftButtonRef.current&&(hide?leftButtonRef.current.classList.add("hide"):leftButtonRef.current.classList.remove("hide"))}function handleHideButtons(){var sliderInfo=getSliderInfo();if(sliderInfo.container){var maxScroll=sliderInfo.container.scrollWidth-sliderInfo.container.clientWidth,isEndOfScroll=sliderInfo.container.scrollLeft>=maxScroll;isMaxScroll.current=isEndOfScroll,hideRightButton(currentActive===sliderInfo.positions.length),hideLeftButton(0===sliderInfo.container.scrollLeft)}}function beginMomentumTracking(){cancelMomentumTracking(),momentumID=requestAnimationFrame(momentumLoop),delayAutoExec&&setDelay(delayAutoExec)}function cancelMomentumTracking(){cancelAnimationFrame(momentumID)}function onMomentumEnd(){if(autoAdjust){var sliderInfo=getSliderInfo(),scrollLeft=null===sliderInfo||void 0===sliderInfo?void 0:sliderInfo.container.scrollLeft,containerWidth=null===sliderInfo||void 0===sliderInfo?void 0:sliderInfo.container.offsetWidth,maxVisibleWidth=0,activeIndex=-1;sliderInfo.positions.forEach(function(position,index){var start=position.offsetPosition,end=index<sliderInfo.positions.length-1?sliderInfo.positions[index+1].offsetPosition:sliderInfo.container.scrollWidth,visibleWidth=Math.min(end,scrollLeft+containerWidth)-Math.max(start,scrollLeft);visibleWidth>maxVisibleWidth&&(maxVisibleWidth=visibleWidth,activeIndex=index)}),-1!==activeIndex&&changeCurrent(activeIndex+1)}handleHideButtons()}function checkForScrollEnd(){var _sliderRef$current;if(sliderRef.current){var currentScrollPosition=null===(_sliderRef$current=sliderRef.current)||void 0===_sliderRef$current?void 0:_sliderRef$current.scrollLeft;currentScrollPosition===lastScrollPosition.current?onMomentumEnd():lastScrollPosition.current=currentScrollPosition}}function setScrollEndTimer(){clearTimeout(scrollEndTimer.current),scrollEndTimer.current=setTimeout(checkForScrollEnd,150)}function momentumLoop(){var sliderInfo=getSliderInfo();if(sliderInfo.container){var _sliderInfo$container;sliderInfo.container.scrollLeft+=2*velX,velX*=.95;var disableMomentum=isMaxScroll.current||0===(null===(_sliderInfo$container=sliderInfo.container)||void 0===_sliderInfo$container?void 0:_sliderInfo$container.scrollLeft);.75<Math.abs(velX)&&!disableMomentum?(hideLeftButton(!0),hideRightButton(!0),momentumID=requestAnimationFrame(momentumLoop)):onMomentumEnd()}}function scrollByIndex(index){var position=getSliderInfo().positions.find(function(data){return data.position===index});position&&navigateToScroll(position.offsetPosition)}function changeCurrent(index){var sliderInfo=getSliderInfo();0>=index||index>sliderInfo.positions.length||scrollByIndex(index)}var momentumID,children=_ref.children,delayAutoExec=_ref.delayAutoExec,_ref$autoAlign=_ref.autoAlign,autoAdjust=void 0!==_ref$autoAlign&&_ref$autoAlign,isDragging=(0,_react.useRef)(!1),startX=(0,_react.useRef)(0),initialScrollLeft=(0,_react.useRef)(0),velX=0,sliderRef=(0,_react.useRef)(null),_useState=(0,_react.useState)(1),_useState2=_slicedToArray(_useState,2),currentActive=_useState2[0],setCurrentActive=_useState2[1],_useState3=(0,_react.useState)(!1),_useState4=_slicedToArray(_useState3,2),itemsHasNoOverflow=_useState4[0],setItemsHasNoOverflow=_useState4[1],_useState5=(0,_react.useState)(delayAutoExec),_useState6=_slicedToArray(_useState5,2),delay=_useState6[0],setDelay=_useState6[1],rightButtonRef=(0,_react.useRef)(null),leftButtonRef=(0,_react.useRef)(null),isMaxScroll=(0,_react.useRef)(!1),lastScrollPosition=(0,_react.useRef)(0),scrollEndTimer=(0,_react.useRef)(),activeControlByScroll=(0,_useDebounce.useDebounce)(function(){var sliderInfo=getSliderInfo(),active=(0,_arrays.findLastIndex)(sliderInfo.positions,function(position){return position.offsetPosition<=sliderInfo.container.scrollLeft+20});// need to add a offset to scrollLeft because the scrollLeft
|
|
2
2
|
// is a little bit less than the offset position in some cases
|
|
3
3
|
setCurrentActive(active+1)},100);return(0,_interval.useInterval)(function(){var sliderInfo=getSliderInfo();return currentActive===sliderInfo.positions.length?void changeCurrent(1):void changeCurrent(currentActive+1)},delay),(0,_react.useEffect)(function(){return function(){autoAdjust&&clearTimeout(scrollEndTimer.current)}},[]),/*#__PURE__*/(0,_jsxRuntime.jsx)(CarouselContext.Provider,{value:{currentActive:currentActive,leftButtonRef:leftButtonRef,rightButtonRef:rightButtonRef,itemsHasNoOverflow:itemsHasNoOverflow,sliderRef:sliderRef,changeCurrent:changeCurrent,handleScroll:function(event){var _document$activeEleme,_document$activeEleme2;autoAdjust&&(lastScrollPosition.current=event.currentTarget.scrollLeft,setScrollEndTimer());var element=event.currentTarget,maxScroll=element.scrollWidth-element.clientWidth,isEndOfScroll=element.scrollLeft>=maxScroll;isMaxScroll.current=!1;var isActiveLeftButton=leftButtonRef.current!==(null===(_document$activeEleme=document.activeElement)||void 0===_document$activeEleme?void 0:_document$activeEleme.parentElement),isActiveRightButton=rightButtonRef.current!==(null===(_document$activeEleme2=document.activeElement)||void 0===_document$activeEleme2?void 0:_document$activeEleme2.parentElement);setItemsHasNoOverflow(!!isEndOfScroll),activeControlByScroll(),isEndOfScroll?(isMaxScroll.current=!0,setTimeout(function(){return hideRightButton(isActiveRightButton)},1e3)):setTimeout(function(){return hideRightButton(!1)},1e3),0===element.scrollLeft?hideLeftButton(isActiveLeftButton):hideLeftButton(!1)},handleMouseUp:function(event){var sliderInfo=getSliderInfo();isDragging.current=!1;var targets=event.currentTarget.childNodes;if(targets.forEach(function(item){item.style.pointerEvents="auto"}),sliderInfo.container){hideLeftButton(!1),beginMomentumTracking(),hideRightButton(isMaxScroll.current);var isStartOfScroll=0===sliderInfo.container.scrollLeft;hideLeftButton(isStartOfScroll)}},handleEnter:function(){setDelay(0)},handleMouseMove:function(e){var sliderInfo=getSliderInfo();if(isDragging.current){e.preventDefault();var targets=e.currentTarget.childNodes;if(targets.forEach(function(item){item.style.pointerEvents="none"}),sliderInfo.container){hideRightButton(!0),hideLeftButton(!0);var x=e.pageX-sliderInfo.container.offsetLeft,walk=x-startX.current,prevScrollLeft=sliderInfo.container.scrollLeft;sliderInfo.container.scrollLeft=initialScrollLeft.current-walk,velX=sliderInfo.container.scrollLeft-prevScrollLeft}}},handleWheel:function(){cancelMomentumTracking()},handleMouseDown:function(event){var sliderInfo=getSliderInfo();isDragging.current=!0,sliderInfo.container&&(startX.current=event.pageX-sliderInfo.container.offsetLeft,initialScrollLeft.current=sliderInfo.container.scrollLeft,cancelMomentumTracking())},moveCarousel:function(direction){var sliderInfo=getSliderInfo();if(sliderInfo.container){var nextPosition=currentActive+1;switch(hideRightButton(!1),hideLeftButton(!1),direction){case"left":changeCurrent(currentActive-1||1);break;case"right":changeCurrent(nextPosition),nextPosition===sliderInfo.positions.length&&hideRightButton(!0);break;default:throw new Error("Invalid direction");}}},handleMouseLeave:function(){isDragging.current=!1,setDelay(delayAutoExec),handleHideButtons()},beginMomentumTracking:beginMomentumTracking,hideLeftButton:hideLeftButton,hideRightButton:hideRightButton},children:children})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/styles.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,eAAe;;;yGAa3B,CAAC;AAEF,eAAO,MAAM,eAAe;;;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/styles.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,eAAe;;;yGAa3B,CAAC;AAEF,eAAO,MAAM,eAAe;;;yGAiE3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SliderContainer=exports.ContainerButton=void 0;var _templateObject,_templateObject2,_styled=_interopRequireDefault(require("@emotion/styled"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _taggedTemplateLiteral(strings,raw){return raw||(raw=strings.slice(0)),Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}))}var SliderContainer=_styled.default.div(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n -webkit-overflow-scrolling: touch;\n -ms-overflow-style: none;\n scrollbar-width: none;\n display: flex;\n width: 100%;\n height: 100%;\n cursor: pointer;\n overflow-x: auto;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"])));exports.SliderContainer=SliderContainer;var ContainerButton=_styled.default.div(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n width: fit-content;\n display: flex;\n align-items: center;\n position: absolute;\n top: 50%;\n transform: translate(0px, -50%);\n\n transition: all ease 0.2s;\n justify-content: center;\n transition: all cubic-bezier(0.25, 1.5, 0.25, 1) 0.5s;\n\n &::before {\n content: '';\n position: absolute;\n height: 100%;\n width: 200%;\n z-index: -1;\n top: 0;\n transition: all cubic-bezier(0.25, 1.5, 0.25, 1) 0.5s;\n }\n\n &[aria-disabled='true'].right_button {\n * {\n pointer-events: none;\n user-select: none;\n }\n }\n\n &.left_button.button_shadow::before {\n left: -100%;\n background: ",";\n }\n\n &.right_button.button_shadow::before {\n right: -100%;\n background: ",";\n }\n\n &.hide {\n > button {\n display: none;\n }\n\n filter: brightness(0.8);\n }\n\n &:not(:hover).hide.left_button {\n transform: translate(-150%, -50%);\n }\n\n &:not(:hover).hide.right_button {\n transform: translate(150%, -50%);\n }\n\n &.right_button {\n right: 1rem;\n }\n\n &.left_button {\n left: 1rem;\n }\n"])),function(_ref){var theme=_ref.theme;return"linear-gradient(90deg, ".concat(theme.colors.neutral.white,"80 0%, rgba(255, 255, 255, 0) 100%)")},function(_ref2){var theme=_ref2.theme;return"linear-gradient(270deg, ".concat(theme.colors.neutral.white,"80 0%, rgba(255, 255, 255, 0) 100%)")});exports.ContainerButton=ContainerButton;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SliderContainer=exports.ContainerButton=void 0;var _templateObject,_templateObject2,_styled=_interopRequireDefault(require("@emotion/styled"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _taggedTemplateLiteral(strings,raw){return raw||(raw=strings.slice(0)),Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}))}var SliderContainer=_styled.default.div(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n -webkit-overflow-scrolling: touch;\n -ms-overflow-style: none;\n scrollbar-width: none;\n display: flex;\n width: 100%;\n height: 100%;\n cursor: pointer;\n overflow-x: auto;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"])));exports.SliderContainer=SliderContainer;var ContainerButton=_styled.default.div(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n width: fit-content;\n display: flex;\n align-items: center;\n height: 100%;\n position: absolute;\n top: 50%;\n transform: translate(0px, -50%);\n\n transition: all ease 0.2s;\n justify-content: center;\n transition: all cubic-bezier(0.25, 1.5, 0.25, 1) 0.5s;\n\n &::before {\n content: '';\n position: absolute;\n height: 100%;\n width: 200%;\n z-index: -1;\n top: 0;\n transition: all cubic-bezier(0.25, 1.5, 0.25, 1) 0.5s;\n }\n\n &[aria-disabled='true'].right_button {\n * {\n pointer-events: none;\n user-select: none;\n }\n }\n\n &.left_button.button_shadow::before {\n left: -100%;\n background: ",";\n }\n\n &.right_button.button_shadow::before {\n right: -100%;\n background: ",";\n }\n\n &.hide {\n > button {\n display: none;\n }\n\n filter: brightness(0.8);\n }\n\n &:not(:hover).hide.left_button {\n transform: translate(-150%, -50%);\n }\n\n &:not(:hover).hide.right_button {\n transform: translate(150%, -50%);\n }\n\n &.right_button {\n right: 1rem;\n }\n\n &.left_button {\n left: 1rem;\n }\n"])),function(_ref){var theme=_ref.theme;return"linear-gradient(90deg, ".concat(theme.colors.neutral.white,"80 0%, rgba(255, 255, 255, 0) 100%)")},function(_ref2){var theme=_ref2.theme;return"linear-gradient(270deg, ".concat(theme.colors.neutral.white,"80 0%, rgba(255, 255, 255, 0) 100%)")});exports.ContainerButton=ContainerButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dash.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/data/dash.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;
|
|
1
|
+
{"version":3,"file":"dash.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/data/dash.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;GAi1GrB,CAAC"}
|