UNPKG

chayns-components

Version:

A set of beautiful React components for developing chayns® applications.

54 lines (52 loc) 1.48 kB
import _extends from "@babel/runtime/helpers/extends"; import PropTypes from 'prop-types'; import React from 'react'; import Button from './Button'; /** * Similar to the `Button` component, but the `chooseButton`-prop is enabled by * default. */ const ChooseButton = _ref => { let { children, ...props } = _ref; return /*#__PURE__*/React.createElement(Button, _extends({ chooseButton: true }, props), children); }; ChooseButton.propTypes = { /** * String or components that are rendered inside of the ChooseButton. */ children: PropTypes.node.isRequired, /** * Renders the ChooseButton as disabled and disables click events. */ disabled: PropTypes.bool, /** * Will be called after the ChooseButton has been clicked with the event as * the first parameter. */ onClick: PropTypes.func, /** * String of classnames that should be added to the button. */ className: PropTypes.string, /** * An optional icon that is displayed on the left of the button. Supply a * FontAwesome icon like this: "fa fa-plane". */ icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), /** * Stop the event propagation on click. */ stopPropagation: PropTypes.bool, /** * Set the type for the native button HTML element. */ type: PropTypes.oneOf(['button', 'submit', 'reset']) }; ChooseButton.displayName = 'ChooseButton'; export default ChooseButton; //# sourceMappingURL=ChooseButton.js.map