@atlaskit/modal-dialog
Version:
A modal dialog displays content that requires user interaction, in a layer above the page.
36 lines (35 loc) • 1.34 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CloseButton = void 0;
var _react = _interopRequireDefault(require("react"));
var _new = require("@atlaskit/button/new");
var _cross = _interopRequireDefault(require("@atlaskit/icon/core/cross"));
/**
* __Close button__
*
* The close button is to be used for customized modal headers to ensure that
* all users have an accessible and obvious way to close the modal dialog.
*
* When using this in a custom header, ensure that the close button renders
* first in the DOM to make sure that users will encounter all elements of the
* modal dialog, including everything within the modal header. This can be done
* using a `Flex` primitive as the custom header's container with a flex
* direction of `row-reverse`.
*/
var CloseButton = exports.CloseButton = function CloseButton(_ref) {
var label = _ref.label,
onBlur = _ref.onBlur,
onClick = _ref.onClick,
testId = _ref.testId;
return /*#__PURE__*/_react.default.createElement(_new.IconButton, {
testId: testId && "".concat(testId, "--close-button"),
appearance: "subtle",
icon: _cross.default,
label: label || 'Close Modal',
onBlur: onBlur,
onClick: onClick
});
};