UNPKG

@zohodesk/components

Version:

Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development

51 lines (48 loc) 1.77 kB
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } import React from 'react'; import { Container } from "../../Layout"; import Icon from '@zohodesk/icons/es/Icon'; import { renderNode, isRenderable } from '@zohodesk/utils'; import defaultProps from "./props/defaultProps"; import propTypes from "./props/propTypes"; import style from "./ArrowIcon.module.css"; const ArrowIcon = props => { const { dataId, isRotated, isActive, customClass, customProps, tagAttributes, a11yAttributes, iconSize, isDisabled, isReadOnly, renderCustomToggleIndicator } = props; const { iconClass = '', containerClass = '' } = customClass; return isRenderable(renderCustomToggleIndicator) ? renderNode(renderCustomToggleIndicator, { isRotated, isActive, isReadOnly, isDisabled }) : /*#__PURE__*/React.createElement(Container, _extends({ isInline: true, isCover: false, align: "both", "aria-hidden": true }, tagAttributes, a11yAttributes, customProps, { dataId: `${dataId}_downIcon`, className: `${style.arrowIcon} ${isRotated ? style.rotated : ''} ${isActive ? style.active : ''} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readonly : ''} ${containerClass}` }), /*#__PURE__*/React.createElement(Icon, { name: "ZD-down", size: iconSize, iconClass: iconClass })); }; ArrowIcon.defaultProps = defaultProps; ArrowIcon.propTypes = propTypes; export default ArrowIcon;