@blockstack/ui
Version:
Blockstack UI components built using React and styled-components with styled-system.
180 lines (167 loc) • 3.91 kB
JavaScript
import { objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
import { system } from 'styled-system';
var config = {
roundedTop: {
properties: ['borderTopLeftRadius', 'borderTopRightRadius'],
scale: 'radii'
},
roundedBottom: {
properties: ['borderBottomLeftRadius', 'borderBottomRightRadius'],
scale: 'radii'
},
roundedLeft: {
properties: ['borderTopLeftRadius', 'borderBottomLeftRadius'],
scale: 'radii'
},
roundedRight: {
properties: ['borderTopRightRadius', 'borderBottomRightRadius'],
scale: 'radii'
},
roundedTopRight: {
property: 'borderTopRightRadius',
scale: 'radii'
},
roundedTopLeft: {
property: 'borderTopLeftRadius',
scale: 'radii'
},
roundedBottomRight: {
property: 'borderBottomRightRadius',
scale: 'radii'
},
roundedBottomLeft: {
property: 'borderBottomLeftRadius',
scale: 'radii'
},
rounded: {
property: 'borderRadius',
scale: 'radii'
},
d: {
property: 'display'
},
w: {
property: 'width',
scale: 'sizes'
},
minW: {
property: 'minWidth',
scale: 'sizes'
},
maxW: {
property: 'maxWidth',
scale: 'sizes'
},
h: {
property: 'height',
scale: 'sizes'
},
minH: {
property: 'minHeight',
scale: 'sizes'
},
maxH: {
property: 'maxHeight',
scale: 'sizes'
},
bgImg: {
property: 'backgroundImage'
},
bgSize: {
property: 'backgroundSize'
},
bgPos: {
property: 'backgroundPosition'
},
bgRepeat: {
property: 'backgroundRepeat'
},
pos: {
property: 'position'
},
flexDir: {
property: 'flexDirection'
},
shadow: {
property: 'boxShadow',
scale: 'shadows'
},
textDecoration: true,
overflowX: true,
overflowY: true,
textTransform: true,
animation: true,
appearance: true,
transform: true,
transformOrigin: true,
visibility: true,
whiteSpace: true,
userSelect: true,
pointerEvents: true,
wordBreak: true,
overflowWrap: true,
textOverflow: true,
boxSizing: true,
cursor: true,
resize: true,
transition: true,
listStyleType: true,
listStylePosition: true,
listStyleImage: true,
fill: {
property: 'fill',
scale: 'colors'
},
stroke: {
property: 'stroke',
scale: 'colors'
},
objectFit: true,
objectPosition: true,
backgroundAttachment: true,
outline: true
};
config.bgAttachment = config.backgroundAttachment;
config.textDecor = config.textDecoration;
config.listStylePos = config.listStylePosition;
config.listStyleImg = config.listStyleImage;
var extraConfig = /*#__PURE__*/system(config);
var transformAlias = function transformAlias(prop, propValue) {
var configKeys = Object.keys(config);
var result = {};
if (configKeys.includes(prop)) {
var _config$prop = config[prop],
properties = _config$prop.properties,
property = _config$prop.property;
if (properties) {
properties.forEach(function (_cssProp) {
return result[_cssProp] = propValue;
});
}
if (property) {
result[property] = propValue;
}
if (config[prop] === true) {
result[prop] = propValue;
}
} else {
result[prop] = propValue;
}
return result;
};
var transformAliasProps = function transformAliasProps(props) {
var result = {};
for (var prop in props) {
if (typeof props[prop] === 'object' && !Array.isArray(props[prop])) {
var _objectSpread2$1;
result = _objectSpread2({}, result, (_objectSpread2$1 = {}, _objectSpread2$1[prop] = transformAliasProps(props[prop]), _objectSpread2$1));
} else {
result = _objectSpread2({}, result, {}, transformAlias(prop, props[prop]));
}
}
return result;
};
var extraProps = /*#__PURE__*/Object.keys(config);
export default extraConfig;
export { config, extraProps, transformAliasProps };
//# sourceMappingURL=config.esm.js.map