UNPKG

bbm-component-library-test

Version:

React based component library for all BBM web applications

73 lines (61 loc) 1.66 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require("react"); var _react2 = _interopRequireDefault(_react); var _propTypes = require("prop-types"); var _objects = require("../Common/styles/objects"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function Button(_ref) { var children = _ref.children, onClick = _ref.onClick, isCallToAction = _ref.isCallToAction, isWarning = _ref.isWarning, type = _ref.type, disabled = _ref.disabled, width = _ref.width, className = _ref.className, small = _ref.small, dataTest = _ref.dataTest, opacity = _ref.opacity; return _react2.default.createElement( _objects.ButtonTag, { className: className, width: width, type: type, disabled: disabled, isCallToAction: isCallToAction, isWarning: isWarning, "data-test": dataTest ? dataTest : Button.displayName, onClick: onClick, small: small, opacity: opacity }, children ); } Button.displayName = "Button"; Button.defaultProps = { isCallToAction: null, isWarning: null, type: "button", disabled: false, width: null, onClick: null, className: null, small: false }; Button.propTypes = { children: _propTypes.node.isRequired, // eslint-disable-line isCallToAction: _propTypes.bool, isWarning: _propTypes.bool, disabled: _propTypes.bool, type: _propTypes.string, width: _propTypes.string, onClick: _propTypes.func, className: _propTypes.string, small: _propTypes.bool }; exports.default = Button;