diff --git a/src/__tests__/__snapshots__/Carousel.tsx.snap b/src/__tests__/__snapshots__/Carousel.tsx.snap
index c8bfb893..a5c7b685 100644
--- a/src/__tests__/__snapshots__/Carousel.tsx.snap
+++ b/src/__tests__/__snapshots__/Carousel.tsx.snap
@@ -1,32 +1,29 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Slider Basics Default Props methods renderArrowNext should return a button 1`] = `
-
`;
exports[`Slider Basics Default Props methods renderArrowPrev should return a button 1`] = `
-
`;
exports[`Slider Basics Default Props methods renderIndicator should return a list item 1`] = `
-
`;
diff --git a/src/components/Carousel/Arrow.tsx b/src/components/Carousel/Arrow.tsx
new file mode 100644
index 00000000..ccf4ba8f
--- /dev/null
+++ b/src/components/Carousel/Arrow.tsx
@@ -0,0 +1,18 @@
+import React from 'react';
+import klass from '../../cssClasses'; // Assuming cssClasses.ts is in src/
+
+interface ArrowProps {
+ direction: 'prev' | 'next';
+ onClickHandler: () => void;
+ enabled: boolean;
+ label: string;
+}
+
+const Arrow: React.FC = ({ direction, onClickHandler, enabled, label }) => {
+ const isPrev = direction === 'prev';
+ const arrowClassName = isPrev ? klass.ARROW_PREV(!enabled) : klass.ARROW_NEXT(!enabled);
+
+ return ;
+};
+
+export default Arrow;
diff --git a/src/components/Carousel/Indicator.tsx b/src/components/Carousel/Indicator.tsx
new file mode 100644
index 00000000..2aa9d660
--- /dev/null
+++ b/src/components/Carousel/Indicator.tsx
@@ -0,0 +1,26 @@
+import React from 'react';
+import klass from '../../cssClasses'; // Assuming cssClasses.ts is in src/
+
+interface IndicatorProps {
+ onClickHandler: (e: React.MouseEvent | React.KeyboardEvent) => void;
+ isSelected: boolean;
+ index: number;
+ label: string;
+}
+
+const Indicator: React.FC = ({ onClickHandler, isSelected, index, label }) => {
+ return (
+
+ );
+};
+
+export default Indicator;
diff --git a/src/components/Carousel/index.tsx b/src/components/Carousel/index.tsx
index b76eb3ed..4fbd2a53 100644
--- a/src/components/Carousel/index.tsx
+++ b/src/components/Carousel/index.tsx
@@ -7,6 +7,8 @@ import getDocument from '../../shims/document';
import getWindow from '../../shims/window';
import { noop, defaultStatusFormatter, isKeyboardEvent } from './utils';
import { AnimationHandler, CarouselProps, CarouselState } from './types';
+import Arrow from './Arrow';
+import Indicator from './Indicator';
import {
slideAnimationHandler,
slideSwipeAnimationHandler,
@@ -43,10 +45,10 @@ export default class Carousel extends React.Component false,
preventMovementUntilSwipeScrollTolerance: false,
renderArrowPrev: (onClickHandler: () => void, hasPrev: boolean, label: string) => (
-
+
),
renderArrowNext: (onClickHandler: () => void, hasNext: boolean, label: string) => (
-
+
),
renderIndicator: (
onClickHandler: (e: React.MouseEvent | React.KeyboardEvent) => void,
@@ -54,18 +56,7 @@ export default class Carousel extends React.Component {
- return (
-
- );
+ return ;
},
renderItem: (item: React.ReactNode) => {
return item;