forked from ant-design/md-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfloatBarStyle.ts
62 lines (59 loc) · 1.38 KB
/
floatBarStyle.ts
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
import {
ChatTokenType,
GenerateStyle,
resetComponent,
useEditorStyleRegister,
} from '../../utils/useStyle';
const genStyle: GenerateStyle<ChatTokenType> = (token) => {
return {
[token.componentCls]: {
position: 'absolute',
zIndex: 20,
border: '1px solid rgb(229 231 235 / 0.8)',
overflow: 'hidden',
height: '28px',
borderRadius: '12px',
backgroundColor: 'rgb(255 255 255)',
fontSize: '1.05em',
color: 'rgb(107 114 128 / 80%)',
backdropFilter: 'blur(8px)',
padding: '4px 0',
'&-item': {
display: 'flex',
height: '48px',
alignItems: 'center',
gap: '8px',
borderRadius: '4px',
lineHeight: '32px',
fontSize: '1.05em',
justifyContent: 'center',
padding: '0 8px',
cursor: 'pointer',
'&:hover': {
backgroundColor: 'rgb(229 231 235 / 0.65)',
},
},
'&&-item-min-plus-icon': {
color: '#1677ff',
},
},
};
};
/**
* AgentChat
* @param prefixCls
* @returns
*/
export function useStyle(prefixCls?: string) {
return useEditorStyleRegister('ToolBar-' + prefixCls, (token) => {
const editorToken = {
...token,
componentCls: `.${prefixCls}`,
};
return [
resetComponent(editorToken),
genStyle(editorToken),
resetComponent(editorToken),
];
});
}