diff --git a/.changeset/hip-jobs-change.md b/.changeset/hip-jobs-change.md new file mode 100644 index 00000000..d4bfc5ab --- /dev/null +++ b/.changeset/hip-jobs-change.md @@ -0,0 +1,5 @@ +--- +'nuka-carousel': patch +--- + +Replace div for button elements #1081 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 320c098b..35c04c0e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,13 +17,13 @@ $ pnpm run build ## Running the demos -Run the NextJS example on `localhost:3000` +Run docosaurus site on `localhost:3000` ```sh -$ pnpm run start:nextjs +$ pnpm run start:website ``` -To make changes to the Nuka Carousel library and have those changes reflect in the NextJS demo app also run +To make changes to the Nuka Carousel library and have those changes reflect in the Docosaurus demo app also run ```sh $ pnpm run build:watch diff --git a/README.md b/README.md index 30e08d6f..4fa8efc4 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,24 @@ Small, fast and accessibility-first React carousel library with easily customiza To add `nuka-carousel` to your project run the following command in your project folder. +#### Yarn + ```bash $ yarn add nuka-carousel ``` +#### NPM + +```bash +$ npm install nuka-carousel +``` + +#### PNPM + +```bash +$ pnpm add nuka-carousel +``` + Come learn more and see a live demo at our [docs site](https://commerce.nearform.com/open-source/nuka-carousel)! ## Support diff --git a/packages/nuka/src/Carousel/Carousel.css b/packages/nuka/src/Carousel/Carousel.css index 0f8cabb6..8c94a0d7 100644 --- a/packages/nuka/src/Carousel/Carousel.css +++ b/packages/nuka/src/Carousel/Carousel.css @@ -40,6 +40,10 @@ border-radius: 9999px; font-size: 1rem; user-select: none; + border: 0; + display: flex; + align-items: center; + justify-content: center; } .nuka-nav-button.nuka-nav-button-prev { left: 0; @@ -52,9 +56,6 @@ .nuka-nav-button:hover { background-color: rgba(146, 148, 151, 0.65); } -.nuka-nav-button-enabled { - display: block; -} .nuka-container-auto-hide .nuka-nav-button { display: none; } diff --git a/packages/nuka/src/Carousel/Carousel.stories.tsx b/packages/nuka/src/Carousel/Carousel.stories.tsx index aeafa2e8..a623a652 100644 --- a/packages/nuka/src/Carousel/Carousel.stories.tsx +++ b/packages/nuka/src/Carousel/Carousel.stories.tsx @@ -200,3 +200,16 @@ export const AfterSlide: Story = { ), }, }; + +export const WithArrows: Story = { + args: { + showArrows: true, + children: ( + <> + {[...Array(10)].map((_, index) => ( + + ))} + + ), + }, +}; diff --git a/packages/nuka/src/Carousel/NavButtons.tsx b/packages/nuka/src/Carousel/NavButtons.tsx index 8bd942f9..42a20f39 100644 --- a/packages/nuka/src/Carousel/NavButtons.tsx +++ b/packages/nuka/src/Carousel/NavButtons.tsx @@ -24,7 +24,12 @@ export function NavButtons() { return ( <> -
+
-
+ +
+ ); } diff --git a/packages/nuka/src/Carousel/PageIndicators.tsx b/packages/nuka/src/Carousel/PageIndicators.tsx index 5746aa7a..5c500600 100644 --- a/packages/nuka/src/Carousel/PageIndicators.tsx +++ b/packages/nuka/src/Carousel/PageIndicators.tsx @@ -18,7 +18,7 @@ export const PageIndicators = () => { onClick={() => goToPage(index)} className={className(index)} > - {index + 1} + Slide {index + 1} ))}