react-responsive-carousel
Advanced tools
+29
-1
@@ -10,4 +10,32 @@ # Changelog | ||
| ## [Unreleased](https://github.com/leandrowd/react-responsive-carousel/compare/v3.1.57...HEAD) | ||
| ## [Unreleased](https://github.com/leandrowd/react-responsive-carousel/compare/v3.2.3...HEAD) | ||
| ## [v3.2.3](https://github.com/leandrowd/react-responsive-carousel/compare/v3.2.1...v3.2.3) - 2020-04-12 | ||
| ### Commits | ||
| - gh-427: Remove and git ignore lib folder [`2973bd5`](https://github.com/leandrowd/react-responsive-carousel/commit/2973bd586cb9f9f043f91f76123a5e7d954129d1) | ||
| - gh-427: Get rid of gulp files [`97fe6f1`](https://github.com/leandrowd/react-responsive-carousel/commit/97fe6f1ce8837f9fa22a9d3ee6673c8072934e87) | ||
| - gh-427: Replace gh-pages task [`5ace1b9`](https://github.com/leandrowd/react-responsive-carousel/commit/5ace1b97883c22d0d73366034a1fa762a04c48c2) | ||
| ## [v3.2.1](https://github.com/leandrowd/react-responsive-carousel/compare/v3.1.58-next.1...v3.2.1) - 2020-04-12 | ||
| ### Commits | ||
| - Remove rc version [`25d5407`](https://github.com/leandrowd/react-responsive-carousel/commit/25d54072848781237faf61c739561db458192dca) | ||
| ## [v3.1.58-next.1](https://github.com/leandrowd/react-responsive-carousel/compare/v3.1.58-next.0...v3.1.58-next.1) - 2020-04-12 | ||
| ### Commits | ||
| - gh-422: Include codesandbox in the repo to allow auto update [`15c24dc`](https://github.com/leandrowd/react-responsive-carousel/commit/15c24dca3b6bc2076b0398533ab0c52aa49ccb60) | ||
| ## [v3.1.58-next.0](https://github.com/leandrowd/react-responsive-carousel/compare/v3.1.57...v3.1.58-next.0) - 2020-04-12 | ||
| ### Commits | ||
| - gh-422: Upgrade storybook and reorganize stories [`3e712c1`](https://github.com/leandrowd/react-responsive-carousel/commit/3e712c195fb87a9b0fb74402827bd10e1539f6d2) | ||
| - gh-422: Publish cjs and es modules to npm [`b67f32b`](https://github.com/leandrowd/react-responsive-carousel/commit/b67f32b0ca81cb2a5f3bcb2a4bf8c25cd58825b3) | ||
| - gh-422: Update react + babel and get tests to pass [`56eaefc`](https://github.com/leandrowd/react-responsive-carousel/commit/56eaefcaaaecbbd00d1c42ca8df9f1df8e515270) | ||
| ## [v3.1.57](https://github.com/leandrowd/react-responsive-carousel/compare/v3.1.56...v3.1.57) - 2020-04-07 | ||
@@ -14,0 +42,0 @@ |
+66
-47
@@ -7,55 +7,74 @@ "use strict"; | ||
| var _Carousel = _interopRequireDefault(require("./components/Carousel")); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _onChange() { | ||
| console.log('onChange', arguments); | ||
| } | ||
| function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } | ||
| function _onClickItem() { | ||
| console.log('onClickItem', arguments); | ||
| } | ||
| function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
| function _onClickThumb() { | ||
| console.log('onClickThumb', arguments); | ||
| } // Begin DemoSliderControls | ||
| Promise.resolve().then(function () { | ||
| return _interopRequireWildcard(require('./components/Carousel')); | ||
| }).then(function (_ref) { | ||
| var Carousel = _ref.default; | ||
| var DemoCarousel = function DemoCarousel() { | ||
| return /*#__PURE__*/_react.default.createElement(Carousel, { | ||
| showArrows: true, | ||
| infiniteLoop: true, | ||
| autoPlay: true, | ||
| emulateTouch: true, | ||
| onClickItem: function onClickItem() { | ||
| var _console; | ||
| var DemoCarousel = function DemoCarousel() { | ||
| return /*#__PURE__*/_react.default.createElement(_Carousel.default, { | ||
| showArrows: true, | ||
| infiniteLoop: true, | ||
| autoPlay: true, | ||
| emulateTouch: true, | ||
| onClickItem: _onClickItem, | ||
| onChange: _onChange, | ||
| onClickThumb: _onClickThumb | ||
| }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/1.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 1")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/2.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 2")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/3.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 3")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/4.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 4")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/5.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 5")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/6.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 6"))); | ||
| }; | ||
| for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
| args[_key] = arguments[_key]; | ||
| } | ||
| _reactDom.default.render( /*#__PURE__*/_react.default.createElement(DemoCarousel, null), document.querySelector('.demo-carousel')); | ||
| return (_console = console).log.apply(_console, ['onClickItem'].concat(args)); | ||
| }, | ||
| onChange: function onChange() { | ||
| var _console2; | ||
| for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
| args[_key2] = arguments[_key2]; | ||
| } | ||
| return (_console2 = console).log.apply(_console2, ['onChange'].concat(args)); | ||
| }, | ||
| onClickThumb: function onClickThumb() { | ||
| var _console3; | ||
| for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
| args[_key3] = arguments[_key3]; | ||
| } | ||
| return (_console3 = console).log.apply(_console3, ['onClickThumb'].concat(args)); | ||
| } | ||
| }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/1.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 1")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/2.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 2")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/3.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 3")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/4.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 4")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/5.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 5")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", { | ||
| src: "assets/6.jpeg" | ||
| }), /*#__PURE__*/_react.default.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 6"))); | ||
| }; | ||
| _reactDom.default.render( /*#__PURE__*/_react.default.createElement(DemoCarousel, null), document.querySelector('.demo-carousel')); | ||
| }); |
+61
-46
| import React from 'react'; | ||
| import ReactDOM from 'react-dom'; | ||
| import Carousel from './components/Carousel'; | ||
| import( | ||
| /* webpackChunkName: "carousel-component" */ | ||
| './components/Carousel').then(function (_ref) { | ||
| var Carousel = _ref.default; | ||
| function _onChange() { | ||
| console.log('onChange', arguments); | ||
| } | ||
| var DemoCarousel = function DemoCarousel() { | ||
| return /*#__PURE__*/React.createElement(Carousel, { | ||
| showArrows: true, | ||
| infiniteLoop: true, | ||
| autoPlay: true, | ||
| emulateTouch: true, | ||
| onClickItem: function onClickItem() { | ||
| var _console; | ||
| function _onClickItem() { | ||
| console.log('onClickItem', arguments); | ||
| } | ||
| for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
| args[_key] = arguments[_key]; | ||
| } | ||
| function _onClickThumb() { | ||
| console.log('onClickThumb', arguments); | ||
| } // Begin DemoSliderControls | ||
| return (_console = console).log.apply(_console, ['onClickItem'].concat(args)); | ||
| }, | ||
| onChange: function onChange() { | ||
| var _console2; | ||
| for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
| args[_key2] = arguments[_key2]; | ||
| } | ||
| var DemoCarousel = function DemoCarousel() { | ||
| return /*#__PURE__*/React.createElement(Carousel, { | ||
| showArrows: true, | ||
| infiniteLoop: true, | ||
| autoPlay: true, | ||
| emulateTouch: true, | ||
| onClickItem: _onClickItem, | ||
| onChange: _onChange, | ||
| onClickThumb: _onClickThumb | ||
| }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/1.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 1")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/2.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 2")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/3.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 3")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/4.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 4")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/5.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 5")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/6.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 6"))); | ||
| }; | ||
| return (_console2 = console).log.apply(_console2, ['onChange'].concat(args)); | ||
| }, | ||
| onClickThumb: function onClickThumb() { | ||
| var _console3; | ||
| ReactDOM.render( /*#__PURE__*/React.createElement(DemoCarousel, null), document.querySelector('.demo-carousel')); | ||
| for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
| args[_key3] = arguments[_key3]; | ||
| } | ||
| return (_console3 = console).log.apply(_console3, ['onClickThumb'].concat(args)); | ||
| } | ||
| }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/1.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 1")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/2.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 2")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/3.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 3")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/4.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 4")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/5.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 5")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { | ||
| src: "assets/6.jpeg" | ||
| }), /*#__PURE__*/React.createElement("p", { | ||
| className: "legend" | ||
| }, "Legend 6"))); | ||
| }; | ||
| ReactDOM.render( /*#__PURE__*/React.createElement(DemoCarousel, null), document.querySelector('.demo-carousel')); | ||
| }); |
@@ -1,1 +0,1 @@ | ||
| .carousel .control-arrow,.carousel.carousel-slider .control-arrow{-webkit-transition:all .25s ease-in;-moz-transition:all .25s ease-in;-ms-transition:all .25s ease-in;-o-transition:all .25s ease-in;transition:all .25s ease-in;opacity:.4;position:absolute;z-index:2;top:20px;background:0 0;border:0;font-size:32px;cursor:pointer}.carousel .control-arrow:hover{opacity:1}.carousel .control-arrow:before,.carousel.carousel-slider .control-arrow:before{margin:0 5px;display:inline-block;border-top:8px solid transparent;border-bottom:8px solid transparent;content:''}.carousel .control-disabled.control-arrow{opacity:0;cursor:inherit;display:none}.carousel .control-prev.control-arrow{left:0}.carousel .control-prev.control-arrow:before{border-right:8px solid #fff}.carousel .control-next.control-arrow{right:0}.carousel .control-next.control-arrow:before{border-left:8px solid #fff}.carousel-root{outline:0}.carousel{position:relative;width:100%}.carousel *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.carousel img{width:100%;display:inline-block;pointer-events:none}.carousel .carousel{position:relative}.carousel .control-arrow{outline:0;border:0;background:0 0;top:50%;margin-top:-13px;font-size:18px}.carousel .thumbs-wrapper{margin:20px;overflow:hidden}.carousel .thumbs{-webkit-transition:all .15s ease-in;-moz-transition:all .15s ease-in;-ms-transition:all .15s ease-in;-o-transition:all .15s ease-in;transition:all .15s ease-in;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);position:relative;list-style:none;white-space:nowrap}.carousel .thumb{-webkit-transition:border .15s ease-in;-moz-transition:border .15s ease-in;-ms-transition:border .15s ease-in;-o-transition:border .15s ease-in;transition:border .15s ease-in;display:inline-block;margin-right:6px;white-space:nowrap;overflow:hidden;border:3px solid #fff;padding:2px}.carousel .thumb:focus{border:3px solid #ccc;outline:0}.carousel .thumb.selected,.carousel .thumb:hover{border:3px solid #333}.carousel .thumb img{vertical-align:top}.carousel.carousel-slider{position:relative;margin:0;overflow:hidden}.carousel.carousel-slider .control-arrow{top:0;color:#fff;font-size:26px;bottom:0;margin-top:0;padding:5px}.carousel.carousel-slider .control-arrow:hover{background:rgba(0,0,0,.2)}.carousel .slider-wrapper{overflow:hidden;margin:auto;width:100%;-webkit-transition:height .15s ease-in;-moz-transition:height .15s ease-in;-ms-transition:height .15s ease-in;-o-transition:height .15s ease-in;transition:height .15s ease-in}.carousel .slider-wrapper.axis-horizontal .slider{-ms-box-orient:horizontal;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-moz-flex;display:-webkit-flex;display:flex}.carousel .slider-wrapper.axis-horizontal .slider .slide{flex-direction:column;flex-flow:column}.carousel .slider-wrapper.axis-vertical{-ms-box-orient:horizontal;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-moz-flex;display:-webkit-flex;display:flex}.carousel .slider-wrapper.axis-vertical .slider{-webkit-flex-direction:column;flex-direction:column}.carousel .slider{margin:0;padding:0;position:relative;list-style:none;width:100%}.carousel .slider.animated{-webkit-transition:all .35s ease-in-out;-moz-transition:all .35s ease-in-out;-ms-transition:all .35s ease-in-out;-o-transition:all .35s ease-in-out;transition:all .35s ease-in-out}.carousel .slide{min-width:100%;margin:0;position:relative;text-align:center;background:#000}.carousel .slide img{width:100%;vertical-align:top;border:0}.carousel .slide iframe{display:inline-block;width:calc(100% - 80px);margin:0 40px 40px;border:0}.carousel .slide .legend{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-ms-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out;position:absolute;bottom:40px;left:50%;margin-left:-45%;width:90%;border-radius:10px;background:#000;color:#fff;padding:10px;font-size:12px;text-align:center;opacity:.25;-webkit-transition:opacity .35s ease-in-out;-moz-transition:opacity .35s ease-in-out;-ms-transition:opacity .35s ease-in-out;-o-transition:opacity .35s ease-in-out;transition:opacity .35s ease-in-out}.carousel .control-dots{position:absolute;bottom:0;margin:10px 0;text-align:center;width:100%}@media (min-width:960px){.carousel .control-dots{bottom:0}}.carousel .control-dots .dot{-webkit-transition:opacity .25s ease-in;-moz-transition:opacity .25s ease-in;-ms-transition:opacity .25s ease-in;-o-transition:opacity .25s ease-in;transition:opacity .25s ease-in;opacity:.3;box-shadow:1px 1px 2px rgba(0,0,0,.9);background:#fff;border-radius:50%;width:8px;height:8px;cursor:pointer;display:inline-block;margin:0 8px}.carousel .control-dots .dot.selected,.carousel .control-dots .dot:hover{opacity:1}.carousel .carousel-status{position:absolute;top:0;right:0;padding:5px;font-size:10px;text-shadow:1px 1px 1px rgba(0,0,0,.9);color:#fff}.carousel:hover .slide .legend{opacity:1} | ||
| .carousel .control-arrow,.carousel.carousel-slider .control-arrow{-webkit-transition:all .25s ease-in;-moz-transition:all .25s ease-in;-ms-transition:all .25s ease-in;-o-transition:all .25s ease-in;transition:all .25s ease-in;opacity:.4;filter:alpha(opacity=40);position:absolute;z-index:2;top:20px;background:none;border:0;font-size:32px;cursor:pointer}.carousel .control-arrow:hover{opacity:1;filter:alpha(opacity=100)}.carousel .control-arrow:before,.carousel.carousel-slider .control-arrow:before{margin:0 5px;display:inline-block;border-top:8px solid transparent;border-bottom:8px solid transparent;content:''}.carousel .control-disabled.control-arrow{opacity:0;filter:alpha(opacity=0);cursor:inherit;display:none}.carousel .control-prev.control-arrow{left:0}.carousel .control-prev.control-arrow:before{border-right:8px solid #fff}.carousel .control-next.control-arrow{right:0}.carousel .control-next.control-arrow:before{border-left:8px solid #fff}.carousel-root{outline:none}.carousel{position:relative;width:100%}.carousel *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.carousel img{width:100%;display:inline-block;pointer-events:none}.carousel .carousel{position:relative}.carousel .control-arrow{outline:0;border:0;background:none;top:50%;margin-top:-13px;font-size:18px}.carousel .thumbs-wrapper{margin:20px;overflow:hidden}.carousel .thumbs{-webkit-transition:all .15s ease-in;-moz-transition:all .15s ease-in;-ms-transition:all .15s ease-in;-o-transition:all .15s ease-in;transition:all .15s ease-in;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);position:relative;list-style:none;white-space:nowrap}.carousel .thumb{-webkit-transition:border .15s ease-in;-moz-transition:border .15s ease-in;-ms-transition:border .15s ease-in;-o-transition:border .15s ease-in;transition:border .15s ease-in;display:inline-block;margin-right:6px;white-space:nowrap;overflow:hidden;border:3px solid #fff;padding:2px}.carousel .thumb:focus{border:3px solid #ccc;outline:none}.carousel .thumb.selected,.carousel .thumb:hover{border:3px solid #333}.carousel .thumb img{vertical-align:top}.carousel.carousel-slider{position:relative;margin:0;overflow:hidden}.carousel.carousel-slider .control-arrow{top:0;color:#fff;font-size:26px;bottom:0;margin-top:0;padding:5px}.carousel.carousel-slider .control-arrow:hover{background:rgba(0,0,0,0.2)}.carousel .slider-wrapper{overflow:hidden;margin:auto;width:100%;-webkit-transition:height .15s ease-in;-moz-transition:height .15s ease-in;-ms-transition:height .15s ease-in;-o-transition:height .15s ease-in;transition:height .15s ease-in}.carousel .slider-wrapper.axis-horizontal .slider{-ms-box-orient:horizontal;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-moz-flex;display:-webkit-flex;display:flex}.carousel .slider-wrapper.axis-horizontal .slider .slide{flex-direction:column;flex-flow:column}.carousel .slider-wrapper.axis-vertical{-ms-box-orient:horizontal;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-moz-flex;display:-webkit-flex;display:flex}.carousel .slider-wrapper.axis-vertical .slider{-webkit-flex-direction:column;flex-direction:column}.carousel .slider{margin:0;padding:0;position:relative;list-style:none;width:100%}.carousel .slider.animated{-webkit-transition:all .35s ease-in-out;-moz-transition:all .35s ease-in-out;-ms-transition:all .35s ease-in-out;-o-transition:all .35s ease-in-out;transition:all .35s ease-in-out}.carousel .slide{min-width:100%;margin:0;position:relative;text-align:center;background:#000}.carousel .slide img{width:100%;vertical-align:top;border:0}.carousel .slide iframe{display:inline-block;width:calc(100% - 80px);margin:0 40px 40px;border:0}.carousel .slide .legend{-webkit-transition:all .5s ease-in-out;-moz-transition:all .5s ease-in-out;-ms-transition:all .5s ease-in-out;-o-transition:all .5s ease-in-out;transition:all .5s ease-in-out;position:absolute;bottom:40px;left:50%;margin-left:-45%;width:90%;border-radius:10px;background:#000;color:#fff;padding:10px;font-size:12px;text-align:center;opacity:0.25;-webkit-transition:opacity .35s ease-in-out;-moz-transition:opacity .35s ease-in-out;-ms-transition:opacity .35s ease-in-out;-o-transition:opacity .35s ease-in-out;transition:opacity .35s ease-in-out}.carousel .control-dots{position:absolute;bottom:0;margin:10px 0;text-align:center;width:100%}@media (min-width: 960px){.carousel .control-dots{bottom:0}}.carousel .control-dots .dot{-webkit-transition:opacity .25s ease-in;-moz-transition:opacity .25s ease-in;-ms-transition:opacity .25s ease-in;-o-transition:opacity .25s ease-in;transition:opacity .25s ease-in;opacity:.3;filter:alpha(opacity=30);box-shadow:1px 1px 2px rgba(0,0,0,0.9);background:#fff;border-radius:50%;width:8px;height:8px;cursor:pointer;display:inline-block;margin:0 8px}.carousel .control-dots .dot.selected,.carousel .control-dots .dot:hover{opacity:1;filter:alpha(opacity=100)}.carousel .carousel-status{position:absolute;top:0;right:0;padding:5px;font-size:10px;text-shadow:1px 1px 1px rgba(0,0,0,0.9);color:#fff}.carousel:hover .slide .legend{opacity:1} |
+18
-22
| { | ||
| "name": "react-responsive-carousel", | ||
| "version": "3.2.1", | ||
| "version": "3.2.3", | ||
| "description": "React Responsive Carousel", | ||
@@ -26,3 +26,3 @@ "author": { | ||
| "scripts": { | ||
| "start": "parcel ./src/index.html", | ||
| "start": "parcel src/index.html src/assets/**/*", | ||
| "storybook": "start-storybook -p 9001 -s ./src -c .storybook", | ||
@@ -37,9 +37,15 @@ "changelog": "auto-changelog --ignore-commit-pattern=\"(Merge pull request|Merge branch|Updating changelog|Prepare for publishing)\"", | ||
| "update-snapshots": "jest --updateSnapshot", | ||
| "prebuild": "yarn test", | ||
| "build": "yarn build-cjs && yarn build-es && yarn build-styles", | ||
| "build-cjs": "babel ./src -d lib/cjs --ignore './src/__tests__'", | ||
| "build-es": "MODULE=true babel ./src -d lib/es --ignore './src/__tests__'", | ||
| "build-website": "yarn jest && parcel build ./src/index.html --out-dir temp/website && cp -r ./src/assets temp/website/assets && cp -r ./CNAME temp/website/CNAME", | ||
| "build-storybook": "build-storybook -s ./src -o ./temp/website/storybook", | ||
| "build-styles": "node --harmony ./node_modules/gulp/bin/gulp build-styles", | ||
| "build": "yarn lib:build", | ||
| "lib:build": "yarn lib:build-cjs && yarn lib:build-es && yarn lib:build-styles", | ||
| "lib:build-cjs": "babel ./src -d lib/cjs --ignore './src/__tests__'", | ||
| "lib:build-es": "MODULE=true babel ./src -d lib/es --ignore './src/__tests__'", | ||
| "lib:build-styles": "mkdir -p lib/styles && node-sass src/carousel.scss > lib/styles/carousel.css && node-sass --output-style compressed src/carousel.scss > lib/styles/carousel.min.css", | ||
| "lib:pre-publish": "npm version patch && git push origin master && yarn changelog", | ||
| "lib:publish": "npm publish && git push --tags", | ||
| "lib:build-and-publish": "yarn lib:build && yarn lib:pre-publish && yarn lib:publish", | ||
| "website:build": "parcel build ./src/index.html --out-dir temp/website", | ||
| "website:copy-assets": "cp -r ./src/assets temp/website/assets && cp -r ./CNAME temp/website/CNAME", | ||
| "website:storybook": "build-storybook -s ./src -o ./temp/website/storybook", | ||
| "website:deploy": "gh-pages -d temp/website", | ||
| "website:create-and-publish": "yarn website:build && yarn website:copy-assets && yarn website:storybook && yarn website:deploy", | ||
| "prepublish-to-npm": "git pull && yarn build && git add . && git commit -m 'Prepare for publishing'", | ||
@@ -49,4 +55,3 @@ "publish-to-npm": "(git pull origin master && npm version patch && git push origin master && npm publish && git push --tags)", | ||
| "prepublish-prerelease-to-npm": "git pull && yarn build && git add . && git commit -m 'Prepare for publishing prerelease'", | ||
| "publish-prerelease-to-npm": "(git pull && npm version prerelease --preid=next && npm publish)", | ||
| "publish-to-gh-pages": "node --harmony ./node_modules/gulp/bin/gulp publish-gh-pages" | ||
| "publish-prerelease-to-npm": "(git pull && npm version prerelease --preid=next && npm publish)" | ||
| }, | ||
@@ -80,15 +85,6 @@ "repository": { | ||
| "enzyme-adapter-react-16": "^1.15.2", | ||
| "gh-pages": "^0.11.0", | ||
| "gulp": "^3.8.9", | ||
| "gulp-clean-css": "^2.0.12", | ||
| "gulp-concat": "^2.3.4", | ||
| "gulp-connect": "^5.0.0", | ||
| "gulp-copy": "0.0.2", | ||
| "gulp-notify": "^2.2.0", | ||
| "gulp-rename": "^1.2.0", | ||
| "gulp-sass": "^4.0.2", | ||
| "gulp-streamify": "1.0.2", | ||
| "gulp-util": "^3.0.0", | ||
| "gh-pages": "^2.2.0", | ||
| "husky": "^3.0.9", | ||
| "jest-cli": "^25.3.0", | ||
| "node-sass": "^4.13.1", | ||
| "parcel-bundler": "^1.12.4", | ||
@@ -95,0 +91,0 @@ "prettier": "^1.18.2", |
+64
-71
| # React Responsive Carousel | ||
| # Help wanted | ||
| # Help wanted | ||
| Things here are running very slowly as I have a lot of other stuff to take care at the moment so please don't be upset if I don't answer your question or if a PR sits unreviewed for a few days or weeks. Anyone interested in helping it move faster can help by submitting or reviewing PR's and answering each other's questions. (https://github.com/leandrowd/react-responsive-carousel/issues/160) | ||
@@ -15,26 +15,27 @@ | ||
| - Responsive | ||
| - Mobile friendly | ||
| - Swipe to slide | ||
| - Mouse emulating touch | ||
| - Server side rendering | ||
| - Keyboard navigation | ||
| - Custom animation duration | ||
| - Auto play | ||
| - Custom auto play interval | ||
| - Infinite loop | ||
| - Horizontal or Vertical directions | ||
| - Supports images, videos, text content or anything you want. Each direct child represents one slide! | ||
| - Supports any flux library (use `selectedItem` prop to set from the app state, and `onChange` callback to get the new position) | ||
| - Show/hide anything (thumbs, indicators, arrows, status) | ||
| - Responsive | ||
| - Mobile friendly | ||
| - Swipe to slide | ||
| - Mouse emulating touch | ||
| - Server side rendering | ||
| - Keyboard navigation | ||
| - Custom animation duration | ||
| - Auto play | ||
| - Custom auto play interval | ||
| - Infinite loop | ||
| - Horizontal or Vertical directions | ||
| - Supports images, videos, text content or anything you want. Each direct child represents one slide! | ||
| - Supports any flux library (use `selectedItem` prop to set from the app state, and `onChange` callback to get the new position) | ||
| - Show/hide anything (thumbs, indicators, arrows, status) | ||
| ### Important links: | ||
| - [Before contributing](https://github.com/leandrowd/react-responsive-carousel/blob/master/CONTRIBUTING.md) | ||
| - [Customizable example](https://codesandbox.io/s/lp602ljjj7) | ||
| - [Demos](http://react-responsive-carousel.js.org/storybook/) | ||
| - [Changelog](https://github.com/leandrowd/react-responsive-carousel/blob/master/CHANGELOG.md) | ||
| - [Troubleshooting](https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md) | ||
| - [Codesandbox playground](https://codesandbox.io/s/github/leandrowd/react-responsive-carousel/tree/master/codesandbox/default) | ||
| - [Storybook](http://react-responsive-carousel.js.org/storybook/) | ||
| - [Changelog](https://github.com/leandrowd/react-responsive-carousel/blob/master/CHANGELOG.md) | ||
| - [Before contributing](https://github.com/leandrowd/react-responsive-carousel/blob/master/CONTRIBUTING.md) | ||
| - [Troubleshooting](https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md) | ||
| ### Demo | ||
| <http://leandrowd.github.io/react-responsive-carousel/> | ||
@@ -45,5 +46,7 @@ | ||
| Customize it yourself: | ||
| - Codesandbox: <https://codesandbox.io/s/lp602ljjj7> | ||
| - Codesandbox: <https://codesandbox.io/s/lp602ljjj7> | ||
| ### Installing as a package | ||
| `yarn add react-responsive-carousel` | ||
@@ -92,43 +95,43 @@ | ||
| | Attributes | Type | Default | Description | | ||
| | :--------- | :--: | :-----: | :----------- | | ||
| | showArrows | `boolean` | `true` | show prev and next arrows | | ||
| | showStatus | `boolean` | `true` | show index of the current item. i.e: (1/8) | | ||
| | showIndicators | `boolean` | `true` | show little dots at the bottom with links for changing the item | | ||
| | showThumbs | `boolean` | `true` | show thumbnails of the images | | ||
| | thumbWidth | `number` | `undefined` | optionally specify pixel width (as an integer) of a thumbnail (including any padding) to avoid calculating values (helps with server-side renders or page cache issues) | | ||
| | infiniteLoop | `boolean` | `false` | infinite loop sliding | | ||
| | selectedItem | `number` | `0` | selects an item though props / defines the initial selected item | | ||
| | axis | `string` | `horizontal` | changes orientation - accepts `horizontal` and `vertical` | | ||
| | verticalSwipe | `string` | `standard` | changes vertical swipe scroll direction - accepts `standard` and `natural` | | ||
| | onChange | `function` | - | Fired when changing positions | | ||
| | onClickItem | `function` | - | Fired when an item is clicked | | ||
| | onClickThumb | `function` | - | Fired when a thumb it clicked | | ||
| | width | `string` | - | Allows to set a fixed width | | ||
| | useKeyboardArrows | `boolean` | `false` | Adds support to next and prev through keyboard arrows | | ||
| | autoPlay | `boolean` | `false` | Auto play | | ||
| | stopOnHover | `boolean` | `true` | Stop auto play while mouse is over the carousel | | ||
| | interval | `number` | `3000` | Interval of auto play | | ||
| | transitionTime | `number` | `350` | Duration of slide transitions (in miliseconds) | | ||
| | swipeScrollTolerance | `number` | `5` | Allows scroll when the swipe movement occurs in a different direction than the carousel axis and within the tolerance - Increase for loose - Decrease for strict | | ||
| | swipeable | `boolean` | `true` | Enables swiping gestures | | ||
| | dynamicHeight | `boolean` | `false` | Adjusts the carousel height if required. -- Do not work with vertical axis -- | | ||
| | emulateTouch | `boolean` | `false` | Allows mouse to simulate swipe | | ||
| | statusFormatter | `func` | (current, total) => `${current} of ${total}` | Allows custom formatting of the status indicator | | ||
| | centerMode | `boolean` | `false` | Enables centered view with partial prev/next slides. Only works with horizontal axis. | | ||
| | centerSlidePercentage | `number` | `80` | optionally specify percentage width (as an integer) of the slides in `centerMode` | | ||
| | labels | `object [key: string]: string` | `{ leftArrow, rightArrow, item }` | optionally specify labels to be applied to controls | | ||
| | onSwipeStart | `function` | - | Fired when a swiping gesture has started | | ||
| | onSwipeEnd | `function` | - | Fired when a swiping gesture has ended | | ||
| | onSwipeMove | `function` | - | Fired when a swiping gesture is happening | | ||
| | renderArrowPrev | `(onClickHandler: () => void, hasPrev: boolean, label: string): React.ReactNode` | `default arrow` | Allows replacement of arrow button previous. | | ||
| | renderArrowNext | `(onClickHandler: () => void, hasNext: boolean, label: string): React.ReactNode` | `default arrow` | Allows replacement of arrow button next. | | ||
| | renderIndicator | `(onClickHandler: () => void, isSelected: boolean, index: number, label: string): React.ReactNode` | `default indicator` | Allows replacement of default indicators | | ||
| | renderItem | `(item: React.ReactNode, props: {isSelected: boolean}): React.ReactNode` | `item` | Allows consumers to intercept the item before rendering for manipulating as needed | | ||
| | renderThumbs | `(children: React.ReactChildren): React.ReactChildren` | `children` | Allows consumers to intercept the children before they are rendered as thumbs, giving the chance to handle them. Useful for finding thumbnails for videos for instance | | ||
| | Attributes | Type | Default | Description | | ||
| | :-------------------- | :------------------------------------------------------------------------------------------------: | :------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | showArrows | `boolean` | `true` | show prev and next arrows | | ||
| | showStatus | `boolean` | `true` | show index of the current item. i.e: (1/8) | | ||
| | showIndicators | `boolean` | `true` | show little dots at the bottom with links for changing the item | | ||
| | showThumbs | `boolean` | `true` | show thumbnails of the images | | ||
| | thumbWidth | `number` | `undefined` | optionally specify pixel width (as an integer) of a thumbnail (including any padding) to avoid calculating values (helps with server-side renders or page cache issues) | | ||
| | infiniteLoop | `boolean` | `false` | infinite loop sliding | | ||
| | selectedItem | `number` | `0` | selects an item though props / defines the initial selected item | | ||
| | axis | `string` | `horizontal` | changes orientation - accepts `horizontal` and `vertical` | | ||
| | verticalSwipe | `string` | `standard` | changes vertical swipe scroll direction - accepts `standard` and `natural` | | ||
| | onChange | `function` | - | Fired when changing positions | | ||
| | onClickItem | `function` | - | Fired when an item is clicked | | ||
| | onClickThumb | `function` | - | Fired when a thumb it clicked | | ||
| | width | `string` | - | Allows to set a fixed width | | ||
| | useKeyboardArrows | `boolean` | `false` | Adds support to next and prev through keyboard arrows | | ||
| | autoPlay | `boolean` | `false` | Auto play | | ||
| | stopOnHover | `boolean` | `true` | Stop auto play while mouse is over the carousel | | ||
| | interval | `number` | `3000` | Interval of auto play | | ||
| | transitionTime | `number` | `350` | Duration of slide transitions (in miliseconds) | | ||
| | swipeScrollTolerance | `number` | `5` | Allows scroll when the swipe movement occurs in a different direction than the carousel axis and within the tolerance - Increase for loose - Decrease for strict | | ||
| | swipeable | `boolean` | `true` | Enables swiping gestures | | ||
| | dynamicHeight | `boolean` | `false` | Adjusts the carousel height if required. -- Do not work with vertical axis -- | | ||
| | emulateTouch | `boolean` | `false` | Allows mouse to simulate swipe | | ||
| | statusFormatter | `func` | (current, total) => `${current} of ${total}` | Allows custom formatting of the status indicator | | ||
| | centerMode | `boolean` | `false` | Enables centered view with partial prev/next slides. Only works with horizontal axis. | | ||
| | centerSlidePercentage | `number` | `80` | optionally specify percentage width (as an integer) of the slides in `centerMode` | | ||
| | labels | `object [key: string]: string` | `{ leftArrow, rightArrow, item }` | optionally specify labels to be applied to controls | | ||
| | onSwipeStart | `function` | - | Fired when a swiping gesture has started | | ||
| | onSwipeEnd | `function` | - | Fired when a swiping gesture has ended | | ||
| | onSwipeMove | `function` | - | Fired when a swiping gesture is happening | | ||
| | renderArrowPrev | `(onClickHandler: () => void, hasPrev: boolean, label: string): React.ReactNode` | `default arrow` | Allows replacement of arrow button previous. | | ||
| | renderArrowNext | `(onClickHandler: () => void, hasNext: boolean, label: string): React.ReactNode` | `default arrow` | Allows replacement of arrow button next. | | ||
| | renderIndicator | `(onClickHandler: () => void, isSelected: boolean, index: number, label: string): React.ReactNode` | `default indicator` | Allows replacement of default indicators | | ||
| | renderItem | `(item: React.ReactNode, props: {isSelected: boolean}): React.ReactNode` | `item` | Allows consumers to intercept the item before rendering for manipulating as needed | | ||
| | renderThumbs | `(children: React.ReactChildren): React.ReactChildren` | `children` | Allows consumers to intercept the children before they are rendered as thumbs, giving the chance to handle them. Useful for finding thumbnails for videos for instance | | ||
| ======================= | ||
| ### Contributing | ||
| The [contributing guide](https://github.com/leandrowd/react-responsive-carousel/blob/master/CONTRIBUTING.md) contains details on how to create pull requests and setup your dev environment. Please read it before contributing! | ||
@@ -139,21 +142,11 @@ | ||
| ### Raising issues | ||
| When raising an issue, please add as much details as possible. Screenshots, video recordings, or anything else that can make it easier to reproduce the bug you are reporting. | ||
| * A new option is to create an example with the code that causes the bug. Fork this [example from codesandbox](https://codesandbox.io/s/lp602ljjj7) and add your code there. Don't forget to fork, save and add the link for the example to the issue. | ||
| - A new option is to create an example with the code that causes the bug. Fork this [example from codesandbox](https://codesandbox.io/s/github/leandrowd/react-responsive-carousel/tree/master/codesandbox/default) and add your code there. Don't forget to fork, save and add the link for the example to the issue. | ||
| ======================= | ||
| ### Examples | ||
| #### webpack + es6 setup | ||
| <https://github.com/leandrowd/demo-react-responsive-carousel-es6> | ||
| ## License | ||
| #### Storybook | ||
| <http://react-responsive-carousel.js.org/storybook/> | ||
| #### Codesandbox | ||
| <https://codesandbox.io/s/lp602ljjj7> | ||
| ======================= | ||
| ## License | ||
| [](https://app.fossa.io/projects/git%2Bgithub.com%2Fleandrowd%2Freact-responsive-carousel?ref=badge_large) |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
193206
7.07%31
-22.5%2761
1.84%149
-4.49%