@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
125 lines • 4.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var typestyle_1 = require("typestyle");
var classnames = require("classnames");
var utils_1 = require("../../../Common/theming/utils");
var noGutterStyle = function (props) {
if (props.gutter !== 0) {
return {};
}
switch (props.isAddOn) {
case 'none': {
return {
$nest: {
'& .up-btn-wrapper:first-child:not(:last-child):not(.up-dropdown-toggle) .up-btn': {
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
},
'& .up-btn-wrapper:last-child:not(:first-child):not(.up-dropdown-toggle) .up-btn': {
borderTopLeftRadius: 0,
borderBottomLeftRadius: 0,
},
'& .up-btn-wrapper:not(:last-child):not(:first-child) .up-btn': {
borderRadius: 0,
}
}
};
}
case 'right': {
return {
$nest: {
'& .up-btn-wrapper:first-child .up-btn': {
borderTopLeftRadius: 0,
borderBottomLeftRadius: 0,
},
'& .up-btn-wrapper:first-child:not(:last-child):not(.up-dropdown-toggle) .up-btn': {
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
},
'& .up-btn-wrapper:last-child:not(:first-child):not(.up-dropdown-toggle) .up-btn': {
borderTopLeftRadius: 0,
borderBottomLeftRadius: 0,
},
'& .up-btn-wrapper:not(:last-child):not(:first-child) .up-btn': {
borderRadius: 0,
}
}
};
}
case 'left': {
return {
$nest: {
'& .up-btn-wrapper:last-child .up-btn': {
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
},
'& .up-btn-wrapper:first-child:not(:last-child):not(.up-dropdown-toggle) .up-btn': {
borderTopRightRadius: 0,
borderBottomRightRadius: 0,
},
'& .up-btn-wrapper:last-child:not(:first-child):not(.up-dropdown-toggle) .up-btn': {
borderTopLeftRadius: 0,
borderBottomLeftRadius: 0,
},
'& .up-btn-wrapper:not(:last-child):not(:first-child) .up-btn': {
borderRadius: 0
},
}
};
}
}
};
var setGutter = function (props) {
if (props.align === 'v') {
return {
$nest: {
'& .up-btn-wrapper': {
marginBottom: utils_1.toRem(props.gutter),
},
},
};
}
else {
return {
$nest: {
'& .up-btn-wrapper': {
marginRight: utils_1.toRem(props.gutter),
},
},
};
}
};
var setAlignment = function (props) {
if (props.align === 'v') {
return {
display: 'flex',
flexDirection: 'column',
justifyContent: 'flex-start',
alignItems: 'center'
};
}
else {
return {
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-start',
alignItems: 'center'
};
}
};
var setWidth = function (props) {
if (props.width === 'full') {
return {
width: '100%'
};
}
else {
return {
width: 'auto'
};
}
};
exports.getStyles = function (props) {
return classnames('up-buttons-wrapper', typestyle_1.style(setGutter(props)), typestyle_1.style(setAlignment(props)), typestyle_1.style(noGutterStyle(props)), typestyle_1.style(setWidth(props)));
};
//# sourceMappingURL=styles.js.map