UNPKG

@zohodesk/dot

Version:

In this Library, we Provide Some Basic Components to Build Your Application

39 lines 1.19 kB
import React from 'react'; import { defaultProps } from "./props/defaultProps"; import { propTypes } from "./props/propTypes"; import { Container, Box } from '@zohodesk/components/es/v1/Layout'; import Icon from '@zohodesk/icons/es/Icon'; import style from "../../TagWithIcon/TagWithIcon.module.css"; export default function TagWithIcon(props) { const { text, iconName, iconSize, palette, iconClass, isBold, size, dataId, className, title } = props; return /*#__PURE__*/React.createElement(Container, { isInline: true, alignBox: "row", align: "vertical", isCover: false, className: `${style.wrapper} ${style[palette]} ${style[size]} ${className}`, dataId: dataId, title: title }, iconName ? /*#__PURE__*/React.createElement(Icon, { name: iconName, size: iconSize, iconClass: `${text ? style.iconSpace : ''} ${iconClass} ` }) : null, text ? /*#__PURE__*/React.createElement(Box, { shrink: true, "data-title": text, className: `${style.text} ${style[size]}_text ${isBold ? style.bold : ''}` }, text) : null); } TagWithIcon.propTypes = propTypes; TagWithIcon.defaultProps = defaultProps;