From 4184caf5d4327d641eff35a4e15e0abb0de5d124 Mon Sep 17 00:00:00 2001 From: Charlie Brown Date: Mon, 8 Apr 2024 16:25:28 -0500 Subject: [PATCH] Remove random page story to prevent chromatic problems --- .../nuka/src/Carousel/Carousel.stories.tsx | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/packages/nuka/src/Carousel/Carousel.stories.tsx b/packages/nuka/src/Carousel/Carousel.stories.tsx index 7d9a1ad3..6178e914 100644 --- a/packages/nuka/src/Carousel/Carousel.stories.tsx +++ b/packages/nuka/src/Carousel/Carousel.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { useRef, useState } from 'react'; +import { useRef } from 'react'; -import { Carousel, CarouselProps, SlideHandle } from './Carousel'; +import { Carousel } from './Carousel'; import { ExampleSlide, FocusableLinkSlide, @@ -9,6 +9,7 @@ import { } from './ExampleSlide'; import './CarouselStories.css'; +import { CarouselProps, SlideHandle } from '../types'; const StorybookComponent = (props: CarouselProps) => { const ref = useRef(null); @@ -115,11 +116,6 @@ export const PageIndicators: Story = { args: { scrollDistance: 'screen', showDots: true, - pageIndicatorProps: { - currentPageIndicatorClassName: 'indicator__current', - pageIndicatorClassName: 'indicator', - containerClassName: 'indicator-container', - }, children: ( <> {[...Array(10)].map((_, index) => ( @@ -142,30 +138,26 @@ export const FocusableCards: Story = { }, }; -const CustomGoToIndexRenderComponent = (props: CarouselProps) => { +const CustomGoToPageRenderComponent = (props: CarouselProps) => { const ref = useRef(null); - const [randomInRangeIndex, setRandomInRangeIndex] = useState( - Math.floor(Math.random() * 7), - ); return (
); }; -export const GoToIndex: Story = { - render: CustomGoToIndexRenderComponent, +export const GoToPage: Story = { + render: CustomGoToPageRenderComponent, args: { children: ( <>