{"_id":"@codelytv/react-carousel","_rev":"5-df7fd7fd7c6d26d91c3153e7ca254505","name":"@codelytv/react-carousel","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@codelytv/react-carousel","author":{"name":"codelytv"},"license":"MIT","version":"1.0.0","type":"module","main":"./dist/react-carousel.umd.cjs","module":"./dist/react-carousel.js","types":"./dist/index.d.ts","peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"scripts":{"build":"vite build","lint":"eslint --ignore-path .gitignore . && stylelint **/*.scss","lint:fix":"eslint --fix --ignore-path .gitignore . && stylelint --fix **/*.scss","docs":"storybook dev -p 6006","build:docs":"storybook build","cy:open":"cypress open","cy:run":"cypress run --component"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"devDependencies":{"@storybook/addon-essentials":"^7.0.17","@storybook/addon-interactions":"^7.0.17","@storybook/addon-links":"^7.0.17","@storybook/blocks":"^7.0.17","@storybook/react":"^7.0.17","@storybook/react-vite":"^7.0.17","@storybook/testing-library":"^0.1.0","@swc/core":"^1.3.42","@testing-library/cypress":"^9.0.0","@types/node":"^16.18.21","@types/react":"^18.0.30","@types/react-dom":"^18.0.11","@vitejs/plugin-react":"^3.1.0","cypress":"^12.9.0","eslint":"^8.36.0","eslint-config-codely":"^2.1.3","eslint-config-react-app":"^7.0.1","eslint-plugin-storybook":"^0.6.12","identity-obj-proxy":"^3.0.0","prop-types":"^15.8.1","react":"^18.2.0","react-dom":"^18.2.0","sass":"^1.60.0","storybook":"^7.0.17","stylelint":"^14.16.1","stylelint-config-rational-order":"^0.0.4","stylelint-config-standard-scss":"^3.0.0","stylelint-order":"^5.0.0","typescript":"^4.9.5","vite":"^4.3.8","vite-plugin-css-injected-by-js":"^3.1.1","vite-plugin-dts":"^2.3.0"},"gitHead":"170e8ab278b76f3c289ecadf2e23db398936ef23","description":"<p align=\"center\">   <a href=\"https://codely.com\">     <img src=\"https://user-images.githubusercontent.com/10558907/170513882-a09eee57-7765-4ca4-b2dd-3c2e061fdad0.png\" width=\"300px\" height=\"92px\" alt=\"Codely logo\"/>   </a> </p>","_id":"@codelytv/react-carousel@1.0.0","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-xB8eBY5UVAV//PLbUou0u3/YJwIkl5lxu2Ae1yIw9T+91o3bzZje/imO9JjnDVMyJ6trNpaThqC0Yo77wy4R0Q==","shasum":"0ce4b78d517aa01aa3b5df9281ca7379dfd77150","tarball":"https://registry.npmjs.org/@codelytv/react-carousel/-/react-carousel-1.0.0.tgz","fileCount":11,"unpackedSize":54080,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHaKaSITtG2S/6fQTkoj98RCUmg4OSe0DFHJjFlKOXskAiEAik4ELXDClvsz8wD3IrS5jEAMk76Zk7oRtgkLsQPHXfI="}]},"_npmUser":{"name":"nuria","email":"nuria.soriano@codely.tv"},"directories":{},"maintainers":[{"name":"nuria","email":"nuria.soriano@codely.tv"},{"name":"rgomezcasas","email":"rafa.gomez@codely.tv"},{"name":"ismanapa","email":"ismanapa@gmail.com"},{"name":"javiercane","email":"javier.mailserio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-carousel_1.0.0_1686584682086_0.3998390420973179"},"_hasShrinkwrap":false},"1.0.1":{"name":"@codelytv/react-carousel","author":{"name":"codelytv"},"license":"MIT","version":"1.0.1","type":"module","main":"./dist/react-carousel.umd.cjs","module":"./dist/react-carousel.js","types":"./dist/index.d.ts","peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"scripts":{"build":"vite build","lint":"eslint --ignore-path .gitignore . && stylelint **/*.scss","lint:fix":"eslint --fix --ignore-path .gitignore . && stylelint --fix **/*.scss","docs":"storybook dev -p 6006","build:docs":"storybook build","cy:open":"cypress open","cy:run":"cypress run --component"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"devDependencies":{"@storybook/addon-essentials":"^7.0.17","@storybook/addon-interactions":"^7.0.17","@storybook/addon-links":"^7.0.17","@storybook/blocks":"^7.0.17","@storybook/react":"^7.0.17","@storybook/react-vite":"^7.0.17","@storybook/testing-library":"^0.1.0","@swc/core":"^1.3.42","@testing-library/cypress":"^9.0.0","@types/node":"^16.18.21","@types/react":"^18.0.30","@types/react-dom":"^18.0.11","@vitejs/plugin-react":"^3.1.0","cypress":"^12.9.0","eslint":"^8.36.0","eslint-config-codely":"^2.1.3","eslint-config-react-app":"^7.0.1","eslint-plugin-storybook":"^0.6.12","identity-obj-proxy":"^3.0.0","prop-types":"^15.8.1","react":"^18.2.0","react-dom":"^18.2.0","sass":"^1.60.0","storybook":"^7.0.17","stylelint":"^14.16.1","stylelint-config-rational-order":"^0.0.4","stylelint-config-standard-scss":"^3.0.0","stylelint-order":"^5.0.0","typescript":"^4.9.5","vite":"^4.3.8","vite-plugin-css-injected-by-js":"^3.1.1","vite-plugin-dts":"^2.3.0"},"gitHead":"94a99879bfb3cdddd4cb5f3867316c4a83bde097","description":"<p align=\"center\">   <a href=\"https://codely.com\">     <img src=\"https://user-images.githubusercontent.com/10558907/170513882-a09eee57-7765-4ca4-b2dd-3c2e061fdad0.png\" width=\"300px\" height=\"92px\" alt=\"Codely logo\"/>   </a> </p>","_id":"@codelytv/react-carousel@1.0.1","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-WlZO+8/uJwLTY/1byqgHkWdRCuTPUnPtiyWYWSNWiMnfiRZb7QdpaooWCt7PTzdbXNIs2BuKWpX1IBOjW/4eWA==","shasum":"8462a0d974a978975616ede8b7449641d04747e0","tarball":"https://registry.npmjs.org/@codelytv/react-carousel/-/react-carousel-1.0.1.tgz","fileCount":11,"unpackedSize":54080,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDKKkeaX6ysoSTYi4SJWaepQLLDorF3zphG5+TpiqrqzAiEAsQAJxR5UJiGofVFzEV3jrVRKXMPkhjVBRSwHNz8kPA0="}]},"_npmUser":{"name":"nuria","email":"nuria.soriano@codely.tv"},"directories":{},"maintainers":[{"name":"nuria","email":"nuria.soriano@codely.tv"},{"name":"rgomezcasas","email":"rafa.gomez@codely.tv"},{"name":"ismanapa","email":"ismanapa@gmail.com"},{"name":"javiercane","email":"javier.mailserio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-carousel_1.0.1_1686585238809_0.534628149899095"},"_hasShrinkwrap":false},"1.0.2":{"name":"@codelytv/react-carousel","author":{"name":"codelytv"},"license":"MIT","version":"1.0.2","type":"module","main":"./dist/react-carousel.umd.cjs","module":"./dist/react-carousel.js","types":"./dist/index.d.ts","peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"scripts":{"build":"vite build","lint":"eslint --ignore-path .gitignore . && stylelint **/*.scss","lint:fix":"eslint --fix --ignore-path .gitignore . && stylelint --fix **/*.scss","docs":"storybook dev -p 6006","build:docs":"storybook build","cy:open":"cypress open","cy:run":"cypress run --component"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"devDependencies":{"@storybook/addon-essentials":"^7.0.17","@storybook/addon-interactions":"^7.0.17","@storybook/addon-links":"^7.0.17","@storybook/blocks":"^7.0.17","@storybook/react":"^7.0.17","@storybook/react-vite":"^7.0.17","@storybook/testing-library":"^0.1.0","@swc/core":"^1.3.42","@testing-library/cypress":"^9.0.0","@types/node":"^16.18.21","@types/react":"^18.0.30","@types/react-dom":"^18.0.11","@vitejs/plugin-react":"^3.1.0","cypress":"^12.9.0","eslint":"^8.36.0","eslint-config-codely":"^2.1.3","eslint-config-react-app":"^7.0.1","eslint-plugin-storybook":"^0.6.12","identity-obj-proxy":"^3.0.0","prop-types":"^15.8.1","react":"^18.2.0","react-dom":"^18.2.0","sass":"^1.60.0","storybook":"^7.0.17","stylelint":"^14.16.1","stylelint-config-rational-order":"^0.0.4","stylelint-config-standard-scss":"^3.0.0","stylelint-order":"^5.0.0","typescript":"^4.9.5","vite":"^4.3.8","vite-plugin-css-injected-by-js":"^3.1.1","vite-plugin-dts":"^2.3.0"},"gitHead":"f1b3c6ed5f3a96d6f00561db9058a6e27cbdf66d","description":"<p align=\"center\">   <a href=\"https://codely.com\">     <img src=\"https://user-images.githubusercontent.com/10558907/170513882-a09eee57-7765-4ca4-b2dd-3c2e061fdad0.png\" width=\"300px\" height=\"92px\" alt=\"Codely logo\"/>   </a> </p>","_id":"@codelytv/react-carousel@1.0.2","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-pXY//gQ0rYraTAeieJlSAJmRAJ0WHXJ8GCZMNzZ0pUswbRwo0YM840OTromTU3QRxMdSCGAuLZuk2v9flEkWrQ==","shasum":"b9a29b9e511983682d862a8a87d55b173c2810ae","tarball":"https://registry.npmjs.org/@codelytv/react-carousel/-/react-carousel-1.0.2.tgz","fileCount":11,"unpackedSize":54755,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCiwYJCtd2pnBVmxc2uJxAz33+hPJIQqgArR68mmm41dgIgT5pvrMAmmReNbVCqsIv8DvEsHTUewGPwJO6ypxrtUWM="}]},"_npmUser":{"name":"nuria","email":"nuria.soriano@codely.tv"},"directories":{},"maintainers":[{"name":"nuria","email":"nuria.soriano@codely.tv"},{"name":"rgomezcasas","email":"rafa.gomez@codely.tv"},{"name":"ismanapa","email":"ismanapa@gmail.com"},{"name":"javiercane","email":"javier.mailserio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-carousel_1.0.2_1686637011412_0.958325262220594"},"_hasShrinkwrap":false},"1.0.3":{"name":"@codelytv/react-carousel","author":{"name":"codelytv"},"license":"MIT","version":"1.0.3","type":"module","main":"./dist/react-carousel.umd.cjs","module":"./dist/react-carousel.js","types":"./dist/index.d.ts","peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"scripts":{"build":"vite build","lint":"eslint --ignore-path .gitignore . && stylelint **/*.scss","lint:fix":"eslint --fix --ignore-path .gitignore . && stylelint --fix **/*.scss","docs":"storybook dev -p 6006","build:docs":"storybook build","cy:open":"cypress open","cy:run":"cypress run --component"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"devDependencies":{"@storybook/addon-essentials":"^7.0.17","@storybook/addon-interactions":"^7.0.17","@storybook/addon-links":"^7.0.17","@storybook/blocks":"^7.0.17","@storybook/react":"^7.0.17","@storybook/react-vite":"^7.0.17","@storybook/testing-library":"^0.1.0","@swc/core":"^1.3.42","@testing-library/cypress":"^9.0.0","@types/node":"^16.18.21","@types/react":"^18.0.30","@types/react-dom":"^18.0.11","@vitejs/plugin-react":"^3.1.0","cypress":"^12.9.0","eslint":"^8.36.0","eslint-config-codely":"^2.1.3","eslint-config-react-app":"^7.0.1","eslint-plugin-storybook":"^0.6.12","identity-obj-proxy":"^3.0.0","prop-types":"^15.8.1","react":"^18.2.0","react-dom":"^18.2.0","sass":"^1.60.0","storybook":"^7.0.17","stylelint":"^14.16.1","stylelint-config-rational-order":"^0.0.4","stylelint-config-standard-scss":"^3.0.0","stylelint-order":"^5.0.0","typescript":"^4.9.5","vite":"^4.3.8","vite-plugin-css-injected-by-js":"^3.1.1","vite-plugin-dts":"^2.3.0"},"gitHead":"da2057442b62e0a24f0f659055ff6a5be2b09bbd","description":"<p align=\"center\">   <a href=\"https://codely.com\">     <img src=\"https://user-images.githubusercontent.com/10558907/170513882-a09eee57-7765-4ca4-b2dd-3c2e061fdad0.png\" width=\"300px\" height=\"92px\" alt=\"Codely logo\"/>   </a> </p>","_id":"@codelytv/react-carousel@1.0.3","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-R5K43NQ8U2LF0jY8prtJ5CYrVxBTqog1ffd2gd1aAhrgKU4fHhtutCRorwhlBuBEOJbwJVBHMoyUFFPF4YPR1w==","shasum":"6ba015dfa918504eefd4e0d865631d796c166b13","tarball":"https://registry.npmjs.org/@codelytv/react-carousel/-/react-carousel-1.0.3.tgz","fileCount":11,"unpackedSize":54762,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnvEOKT/gIKTUyRUIc5MbYTevLhvsBzsohmVn+koYfOgIhANbiEMt0PDuoDmsK+RPcY1apYX0fsME52tG0SRRtk7k3"}]},"_npmUser":{"name":"nuria","email":"nuria.soriano@codely.tv"},"directories":{},"maintainers":[{"name":"nuria","email":"nuria.soriano@codely.tv"},{"name":"rgomezcasas","email":"rafa.gomez@codely.tv"},{"name":"ismanapa","email":"ismanapa@gmail.com"},{"name":"javiercane","email":"javier.mailserio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-carousel_1.0.3_1687859018969_0.059700481739944466"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-12T15:44:42.021Z","1.0.0":"2023-06-12T15:44:42.241Z","modified":"2023-09-20T16:01:50.458Z","1.0.1":"2023-06-12T15:53:58.966Z","1.0.2":"2023-06-13T06:16:51.558Z","1.0.3":"2023-06-27T09:43:39.177Z"},"maintainers":[{"email":"rafa.gomez@codely.tv","name":"rgomezcasas"},{"email":"javier.mailserio@gmail.com","name":"javiercane"}],"description":"<p align=\"center\">   <a href=\"https://codely.com\">     <img src=\"https://user-images.githubusercontent.com/10558907/170513882-a09eee57-7765-4ca4-b2dd-3c2e061fdad0.png\" width=\"300px\" height=\"92px\" alt=\"Codely logo\"/>   </a> </p>","author":{"name":"codelytv"},"license":"MIT","readme":"<p align=\"center\">\n  <a href=\"https://codely.com\">\n    <img src=\"https://user-images.githubusercontent.com/10558907/170513882-a09eee57-7765-4ca4-b2dd-3c2e061fdad0.png\" width=\"300px\" height=\"92px\" alt=\"Codely logo\"/>\n  </a>\n</p>\n\n<h1 align=\"center\">\n  🎠 Codely Carousel\n</h1>\n\n<p align=\"center\">\n    <a href=\"https://github.com/CodelyTV/react-carousel/actions/workflows/publish.yml\"><img src=\"https://github.com/CodelyTV/react-carousel/actions/workflows/publish.yml/badge.svg\" alt=\"Build status\"/></a>\n    <a href=\"https://www.npmjs.com/package/@codelytv/react-carousel\"><img src=\"https://img.shields.io/npm/v/@codelytv/react-carousel\" alt=\"NPM version\"/></a>\n    <a href=\"https://github.com/CodelyTV\"><img src=\"https://img.shields.io/badge/CodelyTV-OS-green.svg?style=flat-square\" alt=\"Codely Open Source\"/></a>\n    <a href=\"https://pro.codely.com\"><img src=\"https://img.shields.io/badge/CodelyTV-PRO-black.svg?style=flat-square\" alt=\"CodelyTV Courses\"/></a>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/CodelyTV/react-carousel/stargazers\">Stars are welcome 😊</a>\n</p>\n\n## ✨ Features\n\n- Automagically responsive:\n  - Any size: no need to set a specific size via props\n  - Multiple items: no need to set the number of items per \"page\"\n- Supports images, videos, everything: each direct child is a slide\n- Scroll based: works on mobile or trackpad\n- Control buttons\n- Custom styling\n- Accessible by default\n- Show next/previous items partially\n- Works with server-side rendering\n\n## 👀 Demos\n\nView the full [Storybook documentation](https://react-carousel.codely.com/).\n\n- [Standard Carousel](https://react-carousel.codely.com/?path=/story/carousel--default)\n- [Variable Slides](https://react-carousel.codely.com/?path=/story/carousel--variable-slides)\n- [With Gap](https://react-carousel.codely.com/?path=/story/carousel--with-gap)\n- [With Custom Button Content](https://react-carousel.codely.com/?path=/story/carousel--with-custom-button-content)\n- [With Custom Aria Labels](https://react-carousel.codely.com/?path=/story/carousel--with-custom-aria-labels)\n- [Button Styling](https://react-carousel.codely.com/?path=/story/carousel--button-styling)\n\n\n## ⚙️ How to use\n\n1. Install the dependency\n    ```\n    npm install @codelytv/react-carousel\n    ```\n    or\n    ```\n    yarn @codelytv/react-carousel\n    ```\n2. Import and use:\n    ```\n      import { Carousel } from \"@codelytv/react-carousel\"\n    ```\n    ```jsx\n    <Carousel>\n      <div>A simple slide</div>\n      <div><img src=\"https://placekitten.com/500/500\" alt=\"a slide can contain anything\" /></div>\n      <article>\n        <h2>It can be any tag</h2>\n        <p>and contain any number of items</p>\n      </article>\n    </Carousel>\n    ```\n    The carousel automatically detects the size of each slide and when navigating via buttons, it will scroll smoothly until the first not visible slide is in view.\n\n### 🎛️ Props\n\n| Name                             | Value               | Default                     | Description                 |\n| -------------------------------- | ------------------- | --------------------------- | --------------------------- |\n| prevButtonContent                | `React.ReactNode`   | [`<ArrowLeft />`](https://github.com/CodelyTV/react-carousel/tree/main/src/components/ArrowLeft.tsx)   | The HTML content of the previous navigation button |\n| nextButtonContent                | `React.ReactNode`   | [`<ArrowRight />`](https://github.com/CodelyTV/react-carousel/tree/main/src/components/ArrowRight.tsx) | The HTML content of the next navigation button     |\n| prevAriaLabel                    | `string`            | \"Previous\"                  | Defines the previous navigation button `aria-label` attribute. Useful when the button content is an element without accessible text. |\n| nextAriaLabel                    | `string`            | \"Next\"                      | Defines the previous navigation button `aria-label` attribute. Useful when the button content is an element without accessible text. |\n\n### 🎨 Styling\nThere are some CSS Variables that will help you style the carousel:\n\n| Name                             | Default             | Description                                   |\n| -------------------------------- | ------------------- | --------------------------------------------- |\n| --slider-gap                     | 0                   | Sets the gap between slides                   |\n| --slider-nav-margin-top          | 0.5rem              | Sets the top margin of the navigation buttons |\n| --slider-button-width            | 2.5rem              | Sets the navigation buttons width             |\n| --slider-button-height           | 2.5rem              | Sets the navigation buttons height            |\n| --slider-button-padding          | 0.2rem              | Sets the padding of the navigation buttons    |\n\nIf this is not enough, you can always style via CSS classes. They all have low specificity so they are easy to overwrite, but be careful, changing this elements could cause the carousel to break. Try to limit the changes to colors, background, etc. to prevent unexpected results.\n\n| Class                 | Description                            |\n| --------------------- | -------------------------------------- |\n| .carousel             | The main carousel wrapper              |\n| .carousel__slider     | The carousel scroller                  |\n| .carousel__slide      | The wrapper for each slide             |\n| .carousel__nav        | The wrapper for the navigation buttons |\n| .carousel__button     | The navigation buttons                 |\n\n\n## 🤝 Contributing\n\n### 📚 Run\n\n- `npm run build`: Compiles the Carousel package\n- `npm run storybook`: Opens Storybook documentation with all of the Carousel demos\n\n### ✅ Testing\n\n`npm run test`: Run unit tests with Jest and React Testing Library\n\n### 🔦 Linting\n\n- `npm run lint`: Run linter\n- `npm run lint:fix`: Fix lint issues\n\n## 👌 Codely Code Quality Standards\n\nPublishing this package we are committing ourselves to the following code quality standards:\n\n- 🤝 Respect **Semantic Versioning**: No breaking changes in patch or minor versions\n- 🤏 No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose\n- 🎯 **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities\n- ✅ **Tests** as documentation and usage examples\n- 📖 **Well documented ReadMe** showing how to install and use\n- ⚖️ **License favoring Open Source** and collaboration\n","readmeFilename":"README.md"}