@helpscout/artboard
Version:
A tool kit for React UI development and design
49 lines • 2.68 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var fancy_1 = require("@helpscout/fancy");
var utils_1 = require("../../../utils");
var Base_1 = require("../../../UI/Base");
var ButtonControl_1 = require("../../../UI/ButtonControl");
var ToolbarButton = /** @class */ (function (_super) {
__extends(ToolbarButton, _super);
function ToolbarButton() {
return _super !== null && _super.apply(this, arguments) || this;
}
ToolbarButton.prototype.render = function () {
var _a = this.props, isActive = _a.isActive, label = _a.label, icon = _a.icon, onClick = _a.onClick;
return (React.createElement(ToolbarButtonUI, { className: utils_1.cx('ToolbarButton') },
React.createElement(ButtonUI, null,
React.createElement(ButtonControl_1.default, { onClick: onClick, isActive: isActive, icon: icon, label: label }))));
};
ToolbarButton.defaultProps = {
isActive: false,
label: 'Action',
icon: 'Box',
onClick: utils_1.noop,
};
return ToolbarButton;
}(React.PureComponent));
exports.ToolbarButton = ToolbarButton;
var ToolbarButtonUI = fancy_1.default(Base_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n flex-direction: column;\n width: 64px;\n flex: 1;\n"], ["\n display: flex;\n align-items: center;\n flex-direction: column;\n width: 64px;\n flex: 1;\n"])));
var ButtonUI = fancy_1.default('div')(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n pointer-events: auto;\n\n * {\n pointer-events: auto;\n }\n"], ["\n pointer-events: auto;\n\n * {\n pointer-events: auto;\n }\n"])));
exports.default = ToolbarButton;
var templateObject_1, templateObject_2;
//# sourceMappingURL=ToolbarButton.js.map