UNPKG

1.84 kBJavaScriptView Raw
1import { __assign, __extends } from "tslib";
2import * as React from 'react';
3import { warn } from '../../Utilities';
4import { ButtonType } from './Button.types';
5import { DefaultButton } from './DefaultButton/DefaultButton';
6import { ActionButton } from './ActionButton/ActionButton';
7import { CompoundButton } from './CompoundButton/CompoundButton';
8import { IconButton } from './IconButton/IconButton';
9import { PrimaryButton } from './PrimaryButton/PrimaryButton';
10/**
11 * This class is deprecated. Use the individual *Button components instead.
12 * @deprecated Use the individual *Button components instead.
13 * {@docCategory Button}
14 */
15var Button = /** @class */ (function (_super) {
16 __extends(Button, _super);
17 function Button(props) {
18 var _this = _super.call(this, props) || this;
19 warn("The Button component has been deprecated. Use specific variants instead. " +
20 "(PrimaryButton, DefaultButton, IconButton, ActionButton, etc.)");
21 return _this;
22 }
23 Button.prototype.render = function () {
24 var props = this.props;
25 // eslint-disable-next-line deprecation/deprecation
26 switch (props.buttonType) {
27 case ButtonType.command:
28 return React.createElement(ActionButton, __assign({}, props));
29 case ButtonType.compound:
30 return React.createElement(CompoundButton, __assign({}, props));
31 case ButtonType.icon:
32 return React.createElement(IconButton, __assign({}, props));
33 case ButtonType.primary:
34 return React.createElement(PrimaryButton, __assign({}, props));
35 default:
36 return React.createElement(DefaultButton, __assign({}, props));
37 }
38 };
39 return Button;
40}(React.Component));
41export { Button };
42//# sourceMappingURL=Button.js.map
\No newline at end of file