antd
Version:
An enterprise-class UI design language and React components implementation
58 lines (57 loc) • 1.95 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _genStyleUtils = require("../../theme/util/genStyleUtils");
const genStepsProgressStyle = token => {
const {
calc,
antCls,
componentCls,
lineWidthBold,
motionDurationSlow
} = token;
const itemCls = `${componentCls}-item`;
const [varName, varRef] = (0, _genStyleUtils.genCssVar)(antCls, 'cmp-steps');
const enhanceSize = calc(lineWidthBold).add(lineWidthBold).equal();
return {
[`${componentCls}${componentCls}-with-progress`]: {
[varName('item-wrapper-padding-top')]: enhanceSize,
[`${itemCls}${itemCls}-process`]: {
[`${itemCls}-icon`]: {
position: 'relative'
}
},
[`${itemCls}-progress-icon`]: {
'&-svg': {
[varName('svg-size')]: calc(enhanceSize).mul(2).add(varRef('icon-size')).equal(),
[varName('icon-size-ptg-unitless')]: `calc(100 / tan(atan2(${varRef('svg-size')}, 1px)))`,
fontSize: varRef('svg-size'),
lineHeight: varRef('icon-size-ptg-unitless'),
position: 'absolute',
inset: calc(enhanceSize).mul(-1).equal(),
width: 'auto',
height: 'auto'
},
'&-circle': {
lineHeight: varRef('icon-size-ptg-unitless'),
strokeWidth: calc(varRef('icon-size-ptg-unitless')).mul(lineWidthBold).equal(),
[varName('progress-radius')]: calc(varRef('svg-size')).sub(lineWidthBold).mul(varRef('icon-size-ptg-unitless')).div(2).equal(),
r: varRef('progress-radius'),
fill: 'none',
cx: 50,
cy: 50,
transition: `all ${motionDurationSlow} ease-in-out`,
'&-rail': {
stroke: token.colorSplit
},
'&-ptg': {
stroke: token.colorPrimary
}
}
}
}
};
};
var _default = exports.default = genStepsProgressStyle;