@cimpress/react-components
Version:
React components to support the MCP styleguide
18 lines • 789 B
JavaScript
import { cx, css } from '@emotion/css';
import React from 'react';
import { BlockButton } from '../internal';
import cvar from '../theme/cvar';
const activeCss = css `
border: 1px solid ${cvar('color-interactive')};
`;
const inactiveCss = css `
border: 1px solid ${cvar('color-border-light')};
`;
const CarouselIndicator = ({ active, children, goToSlide, slideNumber, offset }) => {
const onSlideClick = () => {
goToSlide(slideNumber);
};
return (React.createElement(BlockButton, { as: "li", style: Object.assign(Object.assign({}, offset), { textIndent: '0', overflow: 'hidden' }), className: cx({ [activeCss]: active, [inactiveCss]: !active }), onClick: onSlideClick }, children));
};
export default CarouselIndicator;
//# sourceMappingURL=CarouselIndicator.js.map