GoScrobble/web/node_modules/react-bootstrap/cjs/CloseButton.js

49 lines
1.6 KiB
JavaScript

"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 _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _excluded = ["label", "onClick", "className"];
var propTypes = {
label: _propTypes.default.string.isRequired,
onClick: _propTypes.default.func
};
var defaultProps = {
label: 'Close'
};
var CloseButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
var label = _ref.label,
onClick = _ref.onClick,
className = _ref.className,
props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
return /*#__PURE__*/_react.default.createElement("button", (0, _extends2.default)({
ref: ref,
type: "button",
className: (0, _classnames.default)('close', className),
onClick: onClick
}, props), /*#__PURE__*/_react.default.createElement("span", {
"aria-hidden": "true"
}, "\xD7"), /*#__PURE__*/_react.default.createElement("span", {
className: "sr-only"
}, label));
});
CloseButton.displayName = 'CloseButton';
CloseButton.propTypes = propTypes;
CloseButton.defaultProps = defaultProps;
var _default = CloseButton;
exports.default = _default;
module.exports = exports["default"];