@zohodesk/components
Version:
In this Package, we Provide Some Basic Components to Build Web App
40 lines • 1.04 kB
JavaScript
import React from 'react';
import { defaultProps } from "./props/defaultProps";
import { propTypes } from "./props/propTypes";
import style from "../../Label/Label.module.css";
import colors from "../../Label/LabelColors.module.css";
export default function Label(props) {
const {
text,
type,
palette,
size,
clipped,
htmlFor,
title,
onClick,
dataId,
dataSelectorId,
variant,
customClass,
id,
a11y = {}
} = props;
const {
tabIndex
} = a11y;
return /*#__PURE__*/React.createElement("label", {
className: `${style.label} ${style[type]} ${style[size]} ${colors[palette]} ${style[`font_${variant}`]}
${clipped ? style.dotted : ''} ${onClick ? style.pointer : style.cursor} ${customClass} `,
htmlFor: htmlFor,
"data-title": title,
"data-id": dataId,
"data-test-id": dataId,
"data-selector-id": dataSelectorId,
onClick: onClick,
id: id,
tabIndex: tabIndex
}, text);
}
Label.defaultProps = defaultProps;
Label.propTypes = propTypes;