fai-webui
Version:
40 lines (31 loc) • 1.51 kB
JavaScript
import React from 'react';
function styleInject(css, ref) {
if ( ref === void 0 ) ref = {};
var insertAt = ref.insertAt;
if (typeof document === 'undefined') { return; }
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';
if (insertAt === 'top') {
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
} else {
head.appendChild(style);
}
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
}
var css_248z = ".custom-button {\r\n padding: 10px 20px;\r\n font-size: 16px;\r\n background-color: #4caf50;\r\n color: white;\r\n border: none;\r\n border-radius: 5px;\r\n cursor: pointer;\r\n transition: background-color 0.3s ease;\r\n}\r\n\r\n.custom-button:hover {\r\n background-color: #45a049;\r\n}\r\n\r\n.custom-button:disabled {\r\n background-color: #ccc;\r\n cursor: not-allowed;\r\n}\r\n";
styleInject(css_248z);
var Button = function (_a) {
var _b = _a.label, label = _b === void 0 ? 'Button' : _b, onClick = _a.onClick, _c = _a.type, type = _c === void 0 ? 'button' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d;
return (React.createElement("button", { className: "custom-button", type: type, onClick: onClick, disabled: disabled }, label));
};
export { Button };
//# sourceMappingURL=index.js.map