@ant-design/x
Version:
Craft AI-driven interfaces effortlessly
85 lines (84 loc) • 2.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.prepareComponentToken = exports.default = void 0;
var _cssinjsUtils = require("@ant-design/cssinjs-utils");
var _style = require("../../style");
var _genStyleUtils = require("../../theme/genStyleUtils");
const genThinkStyle = token => {
const {
componentCls,
paddingXS,
paddingSM,
marginSM,
colorTextSecondary,
colorTextDescription,
fontSize,
fontSizeHeading5,
fontSizeSM,
lineHeight,
colorBorder,
lineWidth,
calc
} = token;
return {
[componentCls]: {
[`${componentCls}-status-wrapper`]: {
width: 'fit-content',
display: 'flex',
flexDirection: 'row',
gridGap: paddingXS,
alignItems: 'center',
fontSize: fontSize,
color: colorTextSecondary,
lineHeight: lineHeight,
cursor: 'pointer'
},
[`${componentCls}-status-icon`]: {
fontSize: fontSizeHeading5,
display: 'flex'
},
[`${componentCls}-status-text`]: {
lineHeight: token.lineHeight,
fontSize: token.fontSize
},
[`${componentCls}-status-down-icon`]: {
fontSize: fontSizeSM,
svg: {
transition: `all ${token.motionDurationMid} ${token.motionEaseInOut}`
}
},
[`${componentCls}-content`]: {
marginTop: marginSM,
width: '100%',
color: colorTextDescription,
paddingInlineStart: paddingSM,
borderInlineStart: `${calc(lineWidth).mul(2).equal()} solid ${colorBorder}`
},
[`&${componentCls}-rtl`]: {
direction: 'rtl'
}
}
};
};
const prepareComponentToken = token => {
const {
colorTextDescription,
colorTextBase
} = token;
const colorTextBlinkDefault = colorTextDescription;
const colorTextBlink = colorTextBase;
return {
colorTextBlinkDefault,
colorTextBlink
};
};
exports.prepareComponentToken = prepareComponentToken;
var _default = exports.default = (0, _genStyleUtils.genStyleHooks)('Think', token => {
const compToken = (0, _cssinjsUtils.mergeToken)(token, {});
const {
componentCls
} = token;
return [genThinkStyle(compToken), (0, _style.genCollapseMotion)(compToken), (0, _style.blinkMotion)(compToken, `${componentCls}-motion-blink`)];
}, prepareComponentToken);