Full UIAA implement (#93), #32, #146, #64, #102

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura
2021-11-06 15:15:35 +05:30
parent 3d885ec262
commit a83aecaa69
13 changed files with 850 additions and 708 deletions

View File

@@ -6,13 +6,14 @@ import Text from '../text/Text';
import RawIcon from '../system-icons/RawIcon';
import { blurOnBubbling } from './script';
function Button({
const Button = React.forwardRef(({
id, className, variant, iconSrc,
type, onClick, children, disabled,
}) {
}, ref) => {
const iconClass = (iconSrc === null) ? '' : `btn-${variant}--icon`;
return (
<button
ref={ref}
id={id === '' ? undefined : id}
className={`${className ? `${className} ` : ''}btn-${variant} ${iconClass} noselect`}
onMouseUp={(e) => blurOnBubbling(e, `.btn-${variant}`)}
@@ -26,7 +27,7 @@ function Button({
{typeof children !== 'string' && children }
</button>
);
}
});
Button.defaultProps = {
id: '',