UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

35 lines (34 loc) 1.32 kB
import _ from 'lodash'; import React from 'react'; import PropTypes from 'react-peek/prop-types'; import Icon, { propTypes as iconPropTypes } from '../Icon'; import { lucidClassNames } from '../../../util/style-helpers'; import { omitProps } from '../../../util/component-types'; const cx = lucidClassNames.bind('&-ArrowIcon'); const { oneOf } = PropTypes; export const ArrowIcon = ({ className, direction = 'left', ...passThroughs }) => { return (React.createElement(Icon, Object.assign({}, omitProps(passThroughs, undefined, _.keys(ArrowIcon.propTypes), false), _.pick(passThroughs, _.keys(iconPropTypes)), { className: cx('&', { '&-is-down': direction === 'down', '&-is-up': direction === 'up', '&-is-left': direction === 'left', '&-is-right': direction === 'right', }, className) }), React.createElement("path", { d: 'M0 8h15.5m-6-6l6 6-6 6' }))); }; ArrowIcon.displayName = 'ArrowIcon'; ArrowIcon.peek = { description: ` An arrow icon. `, categories: ['visual design', 'icons'], extend: 'Icon', madeFrom: ['Icon'], }; ArrowIcon.propTypes = { ...iconPropTypes, direction: oneOf(['up', 'down', 'left', 'right']) ` direction variations of the icon `, }; ArrowIcon.defaultProps = Icon.defaultProps; export default ArrowIcon;