@pedidopago/ui 1.9.5 → 1.10.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/dist/components/Carousel/Examples/index.d.ts +6 -0
  3. package/dist/components/Carousel/Examples/index.d.ts.map +1 -0
  4. package/dist/components/Carousel/Examples/index.js +1 -0
  5. package/dist/components/Carousel/Examples/styles.d.ts +6 -0
  6. package/dist/components/Carousel/Examples/styles.d.ts.map +1 -0
  7. package/dist/components/Carousel/Examples/styles.js +1 -0
  8. package/dist/components/Carousel/index.d.ts +4 -0
  9. package/dist/components/Carousel/index.d.ts.map +1 -0
  10. package/dist/components/Carousel/index.js +1 -0
  11. package/dist/components/Carousel/styles.d.ts +14 -0
  12. package/dist/components/Carousel/styles.d.ts.map +1 -0
  13. package/dist/components/Carousel/styles.js +1 -0
  14. package/dist/components/Carousel/types.d.ts +14 -0
  15. package/dist/components/Carousel/types.d.ts.map +1 -0
  16. package/dist/components/Carousel/types.js +1 -0
  17. package/dist/components/Icon/data/illustrations.d.ts.map +1 -1
  18. package/dist/components/Icon/data/illustrations.js +1 -1
  19. package/dist/components/Icon/types.d.ts +1 -1
  20. package/dist/components/Icon/types.d.ts.map +1 -1
  21. package/dist/components/Switch/index.d.ts.map +1 -1
  22. package/dist/components/Switch/index.js +1 -1
  23. package/dist/components/Switch/types.d.ts +1 -0
  24. package/dist/components/Switch/types.d.ts.map +1 -1
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/utils/formatters/number.d.ts +4 -0
  29. package/dist/utils/formatters/number.d.ts.map +1 -1
  30. package/dist/utils/formatters/number.js +4 -2
  31. package/package.json +1 -1
package/CHANGELOG.md ADDED
File without changes
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { CarouselProps } from '../types';
3
+ export declare function CarouselExample(props: CarouselProps): JSX.Element;
4
+ export declare function CarouselExampleDynamicChids(props: CarouselProps): JSX.Element;
5
+ export declare function CarouselExampleCustomButtons(props: CarouselProps): JSX.Element;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Carousel/Examples/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,eAkDnD;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,aAAa,eAe/D;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,aAAa,eAoChE"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CarouselExample=CarouselExample,exports.CarouselExampleCustomButtons=CarouselExampleCustomButtons,exports.CarouselExampleDynamicChids=CarouselExampleDynamicChids;var _=require(".."),_Button=_interopRequireDefault(require("../../../components/Button")),_Flex=_interopRequireDefault(require("../../../components/Flex")),_styles=require("./styles"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}var arrayTeste=["1","2","3","4","5","6","7","8","9","10","11","12"];function CarouselExample(props){return/*#__PURE__*/(0,_jsxRuntime.jsxs)(_Flex.default,{direction:"column",spacing:"1rem",alignItems:"flex-start",style:{maxWidth:"100%",height:"80vh"},children:[/*#__PURE__*/(0,_jsxRuntime.jsxs)(_.Carousel,_objectSpread(_objectSpread({},props),{},{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"250px"},children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"150px"},children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"50px"},children:"3"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"350px"},children:"4"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"350px"},children:"5"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"250px"},children:"6"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"150px"},children:"7"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"450px"},children:"8"})]})),/*#__PURE__*/(0,_jsxRuntime.jsx)(_.Carousel,_objectSpread(_objectSpread({},props),{},{children:arrayTeste.map(function(item,index){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"800px"},children:item},"".concat(index,"-item-big"))})})),/*#__PURE__*/(0,_jsxRuntime.jsx)(_.Carousel,_objectSpread(_objectSpread({},props),{},{children:arrayTeste.map(function(item,index){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"300px"},children:item},"".concat(index,"-item-large"))})})),/*#__PURE__*/(0,_jsxRuntime.jsx)(_.Carousel,_objectSpread(_objectSpread({},props),{},{children:arrayTeste.map(function(item,index){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"150px"},children:item},"".concat(index,"-item-middle"))})})),/*#__PURE__*/(0,_jsxRuntime.jsx)(_.Carousel,_objectSpread(_objectSpread({},props),{},{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"150px"},children:"S\xF3 um"})}))]})}function CarouselExampleDynamicChids(props){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_Flex.default,{style:{height:"500px"},children:/*#__PURE__*/(0,_jsxRuntime.jsxs)(_.Carousel,_objectSpread(_objectSpread({},props),{},{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"250px"},children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"150px"},children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"50px"},children:"3"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"350px"},children:"4"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"350px"},children:"5"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"250px"},children:"6"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"150px"},children:"7"}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"450px"},children:"8"})]}))})}function CarouselExampleCustomButtons(props){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_Flex.default,{style:{height:"500px"},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_.Carousel,_objectSpread(_objectSpread({},props),{},{leftButton:function leftButton(moveLeft){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_Button.default,{onClick:function onClick(){moveLeft()},children:"Voltar"})},rightButton:function rightButton(moveRight){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_Button.default,{style:{whiteSpace:"nowrap"},onClick:function onClick(){moveRight()},children:"Avan\xE7ar"})},children:arrayTeste.map(function(item,index){return/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.CarouselItemExample,{style:{height:"100%",width:"800px"},children:item},"".concat(index,"-item-custom-button"))})}))})}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare const CarouselItemExample: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Carousel/Examples/styles.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,mBAAmB;;;yGAO/B,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CarouselItemExample=void 0;var _templateObject,_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 CarouselItemExample=_styled.default.div(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n border-radius: 0.5rem;\n display: grid;\n place-items: center;\n color: ",";\n background: rgb(69, 63, 168);\n background: linear-gradient(180deg, rgba(69, 63, 168, 1) 0%, rgba(0, 212, 255, 1) 100%);\n"])),function(_ref){var theme=_ref.theme;return theme.lightColors.neutral.white});exports.CarouselItemExample=CarouselItemExample;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { CarouselProps } from './types';
3
+ export declare function Carousel({ gap, hideArrowButtons, children, buttonShadow, leftButton, rightButton, ...divProps }: CarouselProps): JSX.Element;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,wBAAgB,QAAQ,CAAC,EACvB,GAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,WAAW,EACX,GAAG,QAAQ,EACZ,EAAE,aAAa,eAoTf"}
@@ -0,0 +1 @@
1
+ "use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Carousel=Carousel;var _react=require("react"),_classnames=_interopRequireDefault(require("classnames")),_Icon=_interopRequireDefault(require("../Icon")),_styles=require("./styles"),_formatters=require("../../utils/formatters"),_jsxRuntime=require("react/jsx-runtime"),_excluded=["gap","hideArrowButtons","children","buttonShadow","leftButton","rightButton"];function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}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 Carousel(_ref){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 beginMomentumTracking(){cancelMomentumTracking(),momentumID=requestAnimationFrame(momentumLoop)}function cancelMomentumTracking(){cancelAnimationFrame(momentumID)}function onMomentumEnd(){if(sliderRef.current){var maxScroll=sliderRef.current.scrollWidth-sliderRef.current.clientWidth,isEndOfScroll=sliderRef.current.scrollLeft>=maxScroll;isMaxScroll.current=isEndOfScroll,hideRightButton(isEndOfScroll),hideLeftButton(0===sliderRef.current.scrollLeft)}}function momentumLoop(){if(sliderRef.current){var _sliderRef$current;sliderRef.current.scrollLeft+=2*velX,velX*=.95;var disableMomentum=isMaxScroll.current||0===(null===(_sliderRef$current=sliderRef.current)||void 0===_sliderRef$current?void 0:_sliderRef$current.scrollLeft);.75<Math.abs(velX)&&!disableMomentum?(hideLeftButton(!0),hideRightButton(!0),momentumID=requestAnimationFrame(momentumLoop)):onMomentumEnd()}}function changeScrollLeft(scrollLeft){sliderRef.current&&sliderRef.current.scrollTo({behavior:"smooth",left:scrollLeft})}function moveLeftItem(){if(sliderRef.current)for(var childs=sliderRef.current.childNodes,sliderWidth=sliderRef.current.offsetWidth,i=0;i<childs.length;i++){var child=childs[i],itemTotalOffset=child.offsetLeft+child.offsetWidth,isPrevVisibleItem=itemTotalOffset>sliderRef.current.scrollLeft;if(isPrevVisibleItem){var prevChild=childs[i-1];if(!prevChild)return void changeScrollLeft(0);var isLargeItem=prevChild.offsetWidth>(0,_formatters.halfDivisor)(sliderWidth);isLargeItem?changeScrollLeft(prevChild.offsetLeft):changeScrollLeft(prevChild.offsetLeft+(0,_formatters.halfDivisor)(prevChild.offsetWidth));break}}}function moveRightItem(){if(sliderRef.current)for(var childs=sliderRef.current.childNodes,sliderWidth=sliderRef.current.offsetWidth,i=1;i<childs.length;i++){var child=childs[i],itemTotalOffset=child.offsetLeft+child.offsetWidth,isNextVisibleItem=itemTotalOffset>sliderRef.current.scrollLeft+sliderWidth;if(isNextVisibleItem){var nextSibling=child.nextSibling||child,nextSiblingWidth=nextSibling.offsetWidth||0,isLargeItem=nextSiblingWidth>(0,_formatters.halfDivisor)(sliderWidth),nextSiblingLeft=(null===nextSibling||void 0===nextSibling?void 0:nextSibling.offsetLeft)||0;if(isLargeItem)return void changeScrollLeft(child.offsetLeft);if(!child.nextSibling)return void changeScrollLeft(nextSiblingLeft+nextSiblingWidth-sliderWidth);changeScrollLeft(nextSiblingLeft+(0,_formatters.halfDivisor)(nextSiblingWidth)-sliderWidth);break}}}var startX,initialScrollLeft,momentumID,_ref$gap=_ref.gap,gap=void 0===_ref$gap?16:_ref$gap,hideArrowButtons=_ref.hideArrowButtons,children=_ref.children,buttonShadow=_ref.buttonShadow,leftButton=_ref.leftButton,rightButton=_ref.rightButton,divProps=_objectWithoutProperties(_ref,_excluded),rightButtonRef=(0,_react.useRef)(null),leftButtonRef=(0,_react.useRef)(null),sliderRef=(0,_react.useRef)(null),isMaxScroll=(0,_react.useRef)(!1),_useState=(0,_react.useState)(!1),_useState2=_slicedToArray(_useState,2),itemsHasNoOverflow=_useState2[0],setItemsHasNoOverflow=_useState2[1],isDragging=!1,velX=0,moveCarousel=function moveCarousel(direction){sliderRef.current&&(hideRightButton(!1),hideLeftButton(!1),"left"===direction?moveLeftItem():moveRightItem())};(0,_react.useEffect)(function(){if(sliderRef.current){var _sliderRef$current2,lastChild=null===(_sliderRef$current2=sliderRef.current)||void 0===_sliderRef$current2?void 0:_sliderRef$current2.querySelector(".item-".concat(_react.Children.count(children))),lastChildOffsetLeft=(null===lastChild||void 0===lastChild?void 0:lastChild.offsetLeft)||0,lastChildWidth=(null===lastChild||void 0===lastChild?void 0:lastChild.offsetWidth)||0,hasNoOverflow=lastChildOffsetLeft+lastChildWidth<sliderRef.current.offsetWidth;setItemsHasNoOverflow(hasNoOverflow)}},[sliderRef.current]),(0,_react.useEffect)(function(){sliderRef.current&&hideRightButton(!1)},[sliderRef]);var customLeftButton=null===leftButton||void 0===leftButton?void 0:leftButton(function(){return moveCarousel("left")}),customRightButton=null===rightButton||void 0===rightButton?void 0:rightButton(function(){return moveCarousel("right")});return/*#__PURE__*/(0,_jsxRuntime.jsxs)("div",_objectSpread(_objectSpread({style:{position:"relative",overflow:"hidden",width:"100%",height:"100%"}},divProps),{},{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.SliderContainer,{onTouchMove:function onTouchMove(){hideLeftButton(!0),hideRightButton(!0)},onTouchEnd:beginMomentumTracking,className:"slider_container",style:{gap:gap+"px"},ref:sliderRef,onMouseDown:function handleMouseDown(event){isDragging=!0,sliderRef.current&&(startX=event.pageX-sliderRef.current.offsetLeft,initialScrollLeft=sliderRef.current.scrollLeft,cancelMomentumTracking())},onMouseUp:function handleMouseUp(){if(isDragging=!1,sliderRef.current){hideLeftButton(!1),beginMomentumTracking(),hideRightButton(isMaxScroll.current);var isStartOfScroll=0===sliderRef.current.scrollLeft;hideLeftButton(isStartOfScroll)}},onMouseMove:function handleMouseMove(e){if(isDragging&&(e.preventDefault(),sliderRef.current)){hideRightButton(!0),hideLeftButton(!0);var x=e.pageX-sliderRef.current.offsetLeft,walk=x-startX,prevScrollLeft=sliderRef.current.scrollLeft;sliderRef.current.scrollLeft=initialScrollLeft-walk,velX=sliderRef.current.scrollLeft-prevScrollLeft}},onWheel:function handleWheel(){cancelMomentumTracking()},onScroll:function handleScroll(event){var element=event.currentTarget,maxScroll=element.scrollWidth-element.clientWidth,isEndOfScroll=element.scrollLeft>=maxScroll;isMaxScroll.current=!1,isEndOfScroll?(isMaxScroll.current=!0,hideRightButton(!0)):0===element.scrollLeft&&hideLeftButton(!0)},onMouseLeave:function handleMouseLeave(){isDragging=!1},children:_react.Children.map(children,function(child,index){var childElement=child;return/*#__PURE__*/(0,_react.cloneElement)(childElement,_objectSpread(_objectSpread({},child.props),{},{className:"item-".concat(index+1," carousel_item ").concat(child.props.className||"")}))})}),!hideArrowButtons&&/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.ContainerButton,{className:(0,_classnames.default)("left_button hide",{button_shadow:buttonShadow,hide:itemsHasNoOverflow}),ref:leftButtonRef,children:customLeftButton||/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.DefaultButton,{onClick:function onClick(){return moveCarousel("left")},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"chevron-left",color:"neutral.neutral6",size:"18px"})})}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.ContainerButton,{className:(0,_classnames.default)("right_button",{button_shadow:buttonShadow,hide:itemsHasNoOverflow}),ref:rightButtonRef,children:customRightButton||/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.DefaultButton,{onClick:function onClick(){return moveCarousel("right")},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Icon.default,{name:"chevron-right",color:"neutral.neutral6",size:"18px"})})})]})]}))}
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ export declare const SliderContainer: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const ContainerButton: import("@emotion/styled").StyledComponent<{
7
+ theme?: import("@emotion/react").Theme | undefined;
8
+ as?: import("react").ElementType<any> | undefined;
9
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const DefaultButton: import("@emotion/styled").StyledComponent<{
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
14
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/styles.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,eAAe;;;yGAmB3B,CAAC;AAEF,eAAO,MAAM,eAAe;;;yGAsD3B,CAAC;AAEF,eAAO,MAAM,aAAa;;;qHAWzB,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SliderContainer=exports.DefaultButton=exports.ContainerButton=void 0;var _templateObject,_templateObject2,_templateObject3,_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 display: flex;\n\n &::-webkit-scrollbar {\n display: none;\n }\n\n .carousel_item {\n margin: auto;\n flex-shrink: 0;\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 &.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.left_button {\n transform: translate(-150%, -50%);\n }\n\n &.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\n @media (max-width: 750px) {\n display: none;\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;var DefaultButton=_styled.default.button(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n background: ",";\n border: none;\n padding: 0.75rem;\n border-radius: 50%;\n cursor: pointer;\n transition: all cubic-bezier(0.25, 1.5, 0.2, 1) 0.4s;\n\n &:hover {\n transform: scale(0.85);\n }\n"])),function(_ref3){var theme=_ref3.theme;return theme.colors.neutral.white});exports.DefaultButton=DefaultButton;
@@ -0,0 +1,14 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export type CarouselProps = HTMLAttributes<HTMLDivElement> & {
3
+ /**
4
+ * @property {number} gap - The `gap` property is an optional number that represents the spacing in `PIXEL`
5
+ * between each item in the carousel. If not provided, it will default to a value of 16.
6
+ */
7
+ gap?: number;
8
+ hideArrowButtons?: boolean;
9
+ children: ReactNode;
10
+ buttonShadow?: boolean;
11
+ leftButton: (moveLeft: () => void) => ReactNode;
12
+ rightButton: (moveRight: () => void) => ReactNode;
13
+ };
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC3D;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC;IAChD,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC;CACnD,CAAC"}
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1 +1 @@
1
- {"version":3,"file":"illustrations.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/data/illustrations.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;;;;;;GAiW9B,CAAC"}
1
+ {"version":3,"file":"illustrations.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/data/illustrations.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;;;;;;GAyW9B,CAAC"}