// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import React from 'react'; import styled from 'styled-components'; import { Direction } from '../../../../types'; import Svg, { SvgProps } from '../Svg'; const dirTransform = { up: '0', right: '90', down: '180', left: '270', }; interface CaretProps extends SvgProps { /** Defines the direction of the caret. */ direction?: Direction; className?: string; } const StyledCaret = styled(Svg)` transform: ${({ direction }) => `rotate(${dirTransform[direction || 'up']}deg)`}; `; export const Caret: React.FC> = ({ direction = 'up', ...rest }) => { return ( ); }; Caret.displayName = 'Caret'; export default Caret;