2022-11-23 20:22:38 +08:00
|
|
|
import type { FullToken, GenerateStyle } from '../../theme/internal';
|
|
|
|
import { genComponentStyleHook } from '../../theme/internal';
|
2017-02-22 18:10:02 +08:00
|
|
|
|
2022-05-23 20:34:20 +08:00
|
|
|
export interface ComponentToken {
|
|
|
|
zIndexPopup: number;
|
|
|
|
}
|
2020-07-20 13:39:28 +08:00
|
|
|
|
2022-05-23 20:34:20 +08:00
|
|
|
export interface PopconfirmToken extends FullToken<'Popconfirm'> {}
|
|
|
|
|
|
|
|
// =============================== Base ===============================
|
2022-11-19 13:47:33 +08:00
|
|
|
const genBaseStyle: GenerateStyle<PopconfirmToken> = (token) => {
|
2022-05-23 20:34:20 +08:00
|
|
|
const {
|
|
|
|
componentCls,
|
|
|
|
iconCls,
|
|
|
|
zIndexPopup,
|
|
|
|
colorText,
|
|
|
|
colorWarning,
|
|
|
|
marginXS,
|
|
|
|
fontSize,
|
2022-12-08 16:39:42 +08:00
|
|
|
fontWeightStrong,
|
2022-05-23 20:34:20 +08:00
|
|
|
lineHeight,
|
|
|
|
} = token;
|
|
|
|
|
|
|
|
return {
|
|
|
|
[componentCls]: {
|
|
|
|
zIndex: zIndexPopup,
|
|
|
|
|
|
|
|
[`${componentCls}-inner-content`]: {
|
|
|
|
color: colorText,
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${componentCls}-message`]: {
|
|
|
|
position: 'relative',
|
2022-09-06 10:13:18 +08:00
|
|
|
marginBottom: marginXS,
|
2022-05-23 20:34:20 +08:00
|
|
|
color: colorText,
|
|
|
|
fontSize,
|
|
|
|
display: 'flex',
|
|
|
|
flexWrap: 'nowrap',
|
|
|
|
alignItems: 'start',
|
|
|
|
|
2022-10-21 10:16:03 +08:00
|
|
|
[`> ${componentCls}-message-icon ${iconCls}`]: {
|
2022-05-23 20:34:20 +08:00
|
|
|
color: colorWarning,
|
|
|
|
fontSize,
|
|
|
|
flex: 'none',
|
|
|
|
lineHeight: 1,
|
|
|
|
paddingTop: (Math.round(fontSize * lineHeight) - fontSize) / 2,
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-title': {
|
|
|
|
flex: 'auto',
|
|
|
|
marginInlineStart: marginXS,
|
|
|
|
},
|
2022-12-08 16:39:42 +08:00
|
|
|
|
|
|
|
'&-title-only': {
|
|
|
|
fontWeight: fontWeightStrong,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${componentCls}-description`]: {
|
|
|
|
position: 'relative',
|
|
|
|
marginInlineStart: fontSize + marginXS,
|
|
|
|
marginBottom: marginXS,
|
|
|
|
color: colorText,
|
|
|
|
fontSize,
|
2022-05-23 20:34:20 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
[`${componentCls}-buttons`]: {
|
|
|
|
textAlign: 'end',
|
|
|
|
|
|
|
|
button: {
|
|
|
|
marginInlineStart: marginXS,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// ============================== Export ==============================
|
|
|
|
export default genComponentStyleHook(
|
|
|
|
'Popconfirm',
|
2022-11-19 13:47:33 +08:00
|
|
|
(token) => genBaseStyle(token),
|
|
|
|
(token) => {
|
2022-05-23 20:34:20 +08:00
|
|
|
const { zIndexPopupBase } = token;
|
|
|
|
|
|
|
|
return {
|
|
|
|
zIndexPopup: zIndexPopupBase + 60,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
);
|