UNPKG

rsuite

Version:

A suite of react components

46 lines (35 loc) 1.65 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); exports.__esModule = true; exports.default = void 0; var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose")); var _react = _interopRequireDefault(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _utils = require("../utils"); var ButtonToolbar = /*#__PURE__*/_react.default.forwardRef(function (props, ref) { var className = props.className, _props$classPrefix = props.classPrefix, classPrefix = _props$classPrefix === void 0 ? 'btn-toolbar' : _props$classPrefix, _props$as = props.as, Component = _props$as === void 0 ? 'div' : _props$as, _props$role = props.role, role = _props$role === void 0 ? 'toolbar' : _props$role, rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["className", "classPrefix", "as", "role"]); var _useClassNames = (0, _utils.useClassNames)(classPrefix), withClassPrefix = _useClassNames.withClassPrefix, merge = _useClassNames.merge; var classes = merge(className, withClassPrefix()); return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, rest, { role: role, ref: ref, className: classes })); }); ButtonToolbar.displayName = 'ButtonToolbar'; ButtonToolbar.propTypes = { as: _propTypes.default.elementType, classPrefix: _propTypes.default.string }; var _default = ButtonToolbar; exports.default = _default;