@eduzz/houston
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -0,3 +1,3 @@ | ||
import React from 'react'; | ||
import { ButtonProps } from '@material-ui/core/Button'; | ||
import React from 'react'; | ||
declare type ButtonPropsExtends = 'id' | 'className' | 'style' | 'onClick' | 'disabled' | 'startIcon' | 'href' | 'endIcon' | 'children' | 'fullWidth'; | ||
@@ -9,5 +9,3 @@ interface IButtonProps extends Pick<ButtonProps, ButtonPropsExtends> { | ||
* `primary` button contained | ||
* | ||
* `secondary` button outlined | ||
* | ||
* `text` button text | ||
@@ -17,3 +15,3 @@ */ | ||
} | ||
declare const Button: React.ForwardRefExoticComponent<IButtonProps & React.RefAttributes<HTMLButtonElement>>; | ||
export default Button; | ||
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IButtonProps & React.RefAttributes<HTMLButtonElement>>>; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
var react_1 = require("react"); | ||
var Button_1 = require("@material-ui/core/Button"); | ||
var react_1 = require("react"); | ||
var Button = react_1.default.forwardRef(function (props, ref) { | ||
var className = props.className, children = props.children, style = props.style, onClick = props.onClick, disabled = props.disabled, startIcon = props.startIcon, type = props.type, href = props.href, endIcon = props.endIcon, fullWidth = props.fullWidth, id = props.id; | ||
var buttonProps = { className: className, style: style, onClick: onClick, disabled: disabled, startIcon: startIcon, href: href, endIcon: endIcon, fullWidth: fullWidth, id: id }; | ||
switch (type) { | ||
case 'primary': | ||
return (react_1.default.createElement(Button_1.default, tslib_1.__assign({}, buttonProps, { variant: 'contained', color: 'primary', ref: ref }), children)); | ||
case 'secondary': | ||
return (react_1.default.createElement(Button_1.default, tslib_1.__assign({}, buttonProps, { variant: 'outlined', color: 'primary', ref: ref }), children)); | ||
default: | ||
return (react_1.default.createElement(Button_1.default, tslib_1.__assign({}, buttonProps, { variant: 'text', color: 'primary', ref: ref }), children)); | ||
} | ||
var variantMap = { | ||
primary: 'contained', | ||
secondary: 'outlined' | ||
}; | ||
var variant = variantMap[type] || 'text'; | ||
return (react_1.default.createElement(Button_1.default, tslib_1.__assign({}, buttonProps, { variant: variant, color: 'primary', ref: ref }), children)); | ||
}); | ||
exports.default = Button; | ||
exports.default = react_1.default.memo(Button); |
{ | ||
"name": "@eduzz/houston", | ||
"description": "Eduzz Components UI", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"main": "./index.js", | ||
@@ -44,2 +44,3 @@ "types": "./index.d.ts", | ||
"eslint-config-prettier": "6.11.0", | ||
"eslint-plugin-import-helpers": "^1.1.0", | ||
"eslint-plugin-prettier": "3.1.4", | ||
@@ -46,0 +47,0 @@ "eslint-plugin-react": "7.20.6", |
44109
24
623
12