-
-
Notifications
You must be signed in to change notification settings - Fork 46.7k
/
index.tsx
89 lines (75 loc) · 1.96 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import type { FullToken, GenerateStyle } from '../../theme/internal';
import { genComponentStyleHook } from '../../theme/internal';
export interface ComponentToken {
zIndexPopup: number;
}
export interface PopconfirmToken extends FullToken<'Popconfirm'> {}
// =============================== Base ===============================
const genBaseStyle: GenerateStyle<PopconfirmToken> = (token) => {
const {
componentCls,
iconCls,
zIndexPopup,
colorText,
colorWarning,
marginXS,
fontSize,
fontWeightStrong,
lineHeight,
} = token;
return {
[componentCls]: {
zIndex: zIndexPopup,
[`${componentCls}-inner-content`]: {
color: colorText,
},
[`${componentCls}-message`]: {
position: 'relative',
marginBottom: marginXS,
color: colorText,
fontSize,
display: 'flex',
flexWrap: 'nowrap',
alignItems: 'start',
[`> ${componentCls}-message-icon ${iconCls}`]: {
color: colorWarning,
fontSize,
flex: 'none',
lineHeight: 1,
paddingTop: (Math.round(fontSize * lineHeight) - fontSize) / 2,
},
'&-title': {
flex: 'auto',
marginInlineStart: marginXS,
},
'&-title-only': {
fontWeight: fontWeightStrong,
},
},
[`${componentCls}-description`]: {
position: 'relative',
marginInlineStart: fontSize + marginXS,
marginBottom: marginXS,
color: colorText,
fontSize,
},
[`${componentCls}-buttons`]: {
textAlign: 'end',
button: {
marginInlineStart: marginXS,
},
},
},
};
};
// ============================== Export ==============================
export default genComponentStyleHook(
'Popconfirm',
(token) => genBaseStyle(token),
(token) => {
const { zIndexPopupBase } = token;
return {
zIndexPopup: zIndexPopupBase + 60,
};
},
);