@arche-mc2/arche-controls
Version:
We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get
110 lines • 5.02 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var theming_1 = require("../../../Common/theming");
var classnames = require("classnames");
var typestyle_1 = require("typestyle");
var utils_1 = require("../../../Common/theming/utils");
var base = function (props) { return ({
borderRadius: props.theme.borderRadius || utils_1.toRem(6),
verticalAlign: 'top',
borderWidth: '1px',
borderStyle: 'solid',
width: '100%',
marginBottom: utils_1.toRem(10),
boxShadow: '0px 0px 1px grey',
$nest: {
'& .up-panel_header': {
padding: utils_1.toRem(8),
fontWeight: 700,
color: '#fff',
},
'& .up-panel_body': {
background: 'linear-gradient(to bottom, #ffffff, rgba(255, 255, 255, 0)) left no-repeat, center no-repeat',
backgroundColor: '#fff',
padding: utils_1.toRem(20),
borderRadius: props.theme.borderRadius || utils_1.toRem(6),
},
'& .up-panel_message': {
margin: utils_1.toRem(10),
display: 'inline-block',
},
'& .up-panel_footer': {
background: 'linear-gradient(to bottom, #ffffff, rgba(255, 255, 255, 0)) left no-repeat, center no-repeat',
backgroundColor: props.theme.colorMap ? props.theme.colorMap.lightGray5 : theming_1.default.colorMap.lightGray5,
borderColor: props.theme.colorMap ? props.theme.colorMap.lightGray1 : theming_1.default.colorMap.lightGray1,
borderTopWidth: '1px',
borderTopStyle: 'solid',
padding: utils_1.toRem(6),
},
svg: {
margin: utils_1.toRem(4) + " " + utils_1.toRem(4) + " " + utils_1.toRem(4) + " " + utils_1.toRem(0),
display: 'inline-block',
float: 'left',
},
}
}); };
exports.DefaultPanelStyle = function (props) { return (classnames(typestyle_1.style(base(props)), typestyle_1.style({
borderColor: props.theme.colorMap ? props.theme.colorMap.default : theming_1.default.colorMap.default,
$nest: {
'& .up-panel_header': {
backgroundColor: props.theme.colorMap ? props.theme.colorMap.default : theming_1.default.colorMap.default,
}
}
}))); };
exports.PrimaryDefaultPanel = function (props) { return (classnames(typestyle_1.style(base(props)), typestyle_1.style({
borderColor: props.theme.colorMap ? props.theme.colorMap.primary : theming_1.default.colorMap.primary,
$nest: {
'& .up-panel_header': {
backgroundColor: props.theme.colorMap ? props.theme.colorMap.primary : theming_1.default.colorMap.primary,
}
}
}))); };
exports.WarningDefaultPanel = function (props) { return (classnames(typestyle_1.style(base(props)), typestyle_1.style({
borderColor: props.theme.colorMap ? props.theme.colorMap.warning : theming_1.default.colorMap.warning,
$nest: {
'& .up-panel_header': {
backgroundColor: props.theme.colorMap ? props.theme.colorMap.warning : theming_1.default.colorMap.warning,
}
}
}))); };
exports.SuccessDefaultPanel = function (props) { return (classnames(typestyle_1.style(base(props)), typestyle_1.style({
borderColor: props.theme.colorMap ? props.theme.colorMap.successDark : theming_1.default.colorMap.successDark,
$nest: {
'& .up-panel_header': {
backgroundColor: props.theme.colorMap ? props.theme.colorMap.success : theming_1.default.colorMap.success,
}
}
}))); };
exports.InfoDefaultPanel = function (props) { return (classnames(typestyle_1.style(base(props)), typestyle_1.style({
borderColor: props.theme.colorMap ? props.theme.colorMap.infoDark : theming_1.default.colorMap.infoDark,
$nest: {
'& .up-panel_header': {
backgroundColor: props.theme.colorMap ? props.theme.colorMap.info : theming_1.default.colorMap.info,
}
}
}))); };
exports.DangerDefaultPanel = function (props) { return (classnames(typestyle_1.style(base(props)), typestyle_1.style({
borderColor: props.theme.colorMap ? props.theme.colorMap.danger : theming_1.default.colorMap.danger,
$nest: {
'& .up-panel_header': {
backgroundColor: props.theme.colorMap ? props.theme.colorMap.danger : theming_1.default.colorMap.danger,
}
}
}))); };
exports.getStyles = function (props) {
switch (props.type) {
case 'primary':
return exports.PrimaryDefaultPanel(props);
case 'info':
return exports.InfoDefaultPanel(props);
case 'warning':
return exports.WarningDefaultPanel(props);
case 'danger':
return exports.DangerDefaultPanel(props);
case 'success':
return exports.SuccessDefaultPanel(props);
default:
return exports.DefaultPanelStyle(props);
}
};
//# sourceMappingURL=styles.js.map