@csegames/camelot-unchained
Version:
Camelot Unchained Client Library
55 lines (54 loc) • 2.09 kB
JavaScript
;
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
var __assign = undefined && undefined.__assign || Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var aphrodite_1 = require("aphrodite");
exports.defaultRaisedButtonStyle = {
button: {
padding: '5px 15px',
backgroundColor: '#666',
cursor: 'pointer',
userSelect: 'none',
webkitUserSelect: 'none',
boxShadow: '0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)',
transition: 'box-shadow 0.3s cubic-bezier(.25,.8,.25,1), background-color 0.3s cubic-bezier(.25,.8,.25,1)',
':hover': {
boxShadow: '0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22)',
backgroundColor: '#777'
},
':active': {
boxShadow: '0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)',
backgroundColor: '#AAA'
}
},
buttonDisabled: {
padding: '5px 15px',
backgroundColor: '#555',
color: '#777',
cursor: 'default',
userSelect: 'none',
webkitUserSelect: 'none'
}
};
exports.RaisedButton = function (props) {
var ss = aphrodite_1.StyleSheet.create(exports.defaultRaisedButtonStyle);
var custom = aphrodite_1.StyleSheet.create(props.styles || {});
if (props.disabled) {
return React.createElement("div", { className: aphrodite_1.css(ss.buttonDisabled, custom.buttonDisabled) }, props.children);
}
return React.createElement("div", __assign({ className: aphrodite_1.css(ss.button, custom.button) }, props), props.children);
};
exports.default = exports.RaisedButton;