@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
60 lines (58 loc) • 1.39 kB
JavaScript
import React from 'react';
import { defaultProps } from "./props/defaultProps";
import { propTypes } from "./props/propTypes";
import style from "./semanticButton.module.css";
export default class Button extends React.Component {
constructor(props) {
super(props);
}
render() {
const {
value,
type,
text,
title,
name,
autoFocus,
disabled,
ref,
dataId,
onClick,
children,
customClass,
a11y
} = this.props;
let {
ariaLabel,
ariaHaspopup,
ariaExpanded,
ariaControls,
ariaLabelledby
} = a11y;
return /*#__PURE__*/React.createElement("button", {
className: `${style.buttonReset} ${customClass}`,
"aria-label": ariaLabel,
"aria-haspopup": ariaHaspopup,
"aria-expanded": ariaExpanded,
"aria-controls": ariaControls,
"aria-labelledby": ariaLabelledby,
type: type,
value: value,
name: name,
autoFocus: autoFocus,
disabled: disabled,
ref: ref,
"data-id": dataId,
"data-test-id": dataId,
onClick: onClick,
"data-title": title
}, children ? children : text);
}
}
Button.defaultProps = defaultProps;
Button.propTypes = propTypes; // if (__DOCS__) {
// Button.docs = {
// componentGroup: 'semantic',
// folderName: 'DefaultComponents'
// };
// }