cynx-lib 1.3.115 → 1.3.117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gen.js +77 -77
- package/package.json +1 -1
- package/ui/components/ActionsMenu.jsx +357 -357
- package/ui/components/BrandingCard.jsx +6 -6
- package/ui/components/Drawer.jsx +208 -208
- package/ui/components/Globe.jsx +764 -764
- package/ui/components/HoverCard.jsx +85 -85
- package/ui/components/PrivacyBlur.jsx +603 -603
- package/utils/index.js +24 -24
- package/utils/utils/db.cjs +6 -6
- package/utils/utils/db.js +8 -8
- package/utils/utils/duration.js +139 -139
- package/utils/utils/oidc.js +214 -214
- package/utils/utils/realtime.js +1634 -1634
- package/utils/utils/server.js +371 -371
- package/utils/utils/session.js +131 -131
- package/utils/utils/session_manager.js +580 -580
- package/utils/utils/sso_manager.js +702 -702
- package/utils/utils/storage.js +393 -393
- package/utils/utils/ui.js +111 -111
- package/vue/components/Badge.vue +79 -79
- package/vue/components/Button.vue +209 -209
- package/vue/components/Checkbox.vue +103 -103
- package/vue/components/CircularProgress.vue +383 -383
- package/vue/components/Divider.vue +94 -94
- package/vue/components/Drawer.vue +243 -243
- package/vue/components/InfoBadge.vue +223 -223
- package/vue/components/Input.vue +341 -341
- package/vue/components/LinearProgress.vue +268 -268
- package/vue/components/Modal.vue +226 -226
- package/vue/components/Pagination.vue +199 -199
- package/vue/components/Select.vue +713 -713
- package/vue/components/Sidebar.vue +955 -955
- package/vue/components/Skeleton.vue +91 -91
- package/vue/components/Spinner.vue +263 -263
- package/vue/components/StatusTag.vue +89 -89
- package/vue/components/TabBar.vue +176 -176
- package/vue/components/Table.vue +393 -393
- package/vue/components/TimePicker.vue +399 -399
- package/vue/components/Toggle.vue +115 -115
- package/vue/components/XTable.vue +140 -140
- package/vue/composables/useAutoSkeletonRows.ts +71 -71
- package/vue/index.d.ts +67 -67
- package/vue/index.js +86 -86
|
@@ -76,10 +76,10 @@ export function BrandingCard({ label, hint, value, onUpload, onRemove, saving, o
|
|
|
76
76
|
{filename || 'Not set'}
|
|
77
77
|
</div>
|
|
78
78
|
)}
|
|
79
|
-
<div style={{ display: 'flex', gap:
|
|
80
|
-
<Button variant="ghost" size="
|
|
79
|
+
<div style={{ display: 'flex', gap: 6, flexShrink: 0 }}>
|
|
80
|
+
<Button variant="ghost" size="md" type="button" icon={<Pencil size={14} />} onClick={() => setEditOpen(true)} style={cardStyle ? { background: 'var(--surface,#fff)', color: 'var(--t, #333)' } : undefined}>Edit</Button>
|
|
81
81
|
{hasExisting && (
|
|
82
|
-
<Button variant="ghost" size="
|
|
82
|
+
<Button variant="ghost" size="md" type="button" icon={<Trash2 size={14} />} style={cardStyle ? { background: 'var(--surface,#fff)', color: 'var(--danger, #f64747)' } : { color: 'var(--danger, #f64747)' }}
|
|
83
83
|
onClick={handleRemove} disabled={saving}>Remove</Button>
|
|
84
84
|
)}
|
|
85
85
|
</div>
|
|
@@ -88,7 +88,7 @@ export function BrandingCard({ label, hint, value, onUpload, onRemove, saving, o
|
|
|
88
88
|
|
|
89
89
|
{previewOpen && (
|
|
90
90
|
<Modal title={label} open={previewOpen} onClose={() => setPreviewOpen(false)}
|
|
91
|
-
footer={<Button variant="ghost" size="
|
|
91
|
+
footer={<Button variant="ghost" size="md" onClick={() => setPreviewOpen(false)}>Close</Button>}>
|
|
92
92
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', padding: '16px 0' }}>
|
|
93
93
|
<img src={previewUrl} alt={label} style={{ maxWidth: '100%', maxHeight: 400, objectFit: 'contain', borderRadius: 6 }} />
|
|
94
94
|
</div>
|
|
@@ -99,8 +99,8 @@ export function BrandingCard({ label, hint, value, onUpload, onRemove, saving, o
|
|
|
99
99
|
<Modal title={`Edit ${label}`} open={editOpen} onClose={() => { setEditOpen(false); setPendingFile(null); setPendingUrl(''); }}
|
|
100
100
|
footer={
|
|
101
101
|
<>
|
|
102
|
-
<Button variant="ghost" size="
|
|
103
|
-
<Button variant="primary" size="
|
|
102
|
+
<Button variant="ghost" size="md" onClick={() => { setEditOpen(false); setPendingFile(null); setPendingUrl(''); }}>Cancel</Button>
|
|
103
|
+
<Button variant="primary" size="md" disabled={saving || uploading} onClick={handleSave}>
|
|
104
104
|
{uploading ? 'Uploading...' : saving ? 'Saving...' : 'Save'}
|
|
105
105
|
</Button>
|
|
106
106
|
</>
|
package/ui/components/Drawer.jsx
CHANGED
|
@@ -1,208 +1,208 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import { createPortal } from 'react-dom';
|
|
3
|
-
import { X } from 'lucide-react';
|
|
4
|
-
|
|
5
|
-
const DRAWER_STYLES = `
|
|
6
|
-
@keyframes cynxDrawerFadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
7
|
-
@keyframes cynxDrawerFadeOut { from { opacity: 1; } to { opacity: 0; } }
|
|
8
|
-
@keyframes cynxDrawerSlideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
|
|
9
|
-
@keyframes cynxDrawerSlideOutRight { from { transform: translateX(0); } to { transform: translateX(100%); } }
|
|
10
|
-
@keyframes cynxDrawerSlideInLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }
|
|
11
|
-
@keyframes cynxDrawerSlideOutLeft { from { transform: translateX(0); } to { transform: translateX(-100%); } }
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
let _drawer_id = 'cynx-drawer-styles';
|
|
15
|
-
function ensureDrawerStyles() {
|
|
16
|
-
if (typeof document === 'undefined') return;
|
|
17
|
-
if (document.getElementById(_drawer_id)) return;
|
|
18
|
-
const tag = document.createElement('style');
|
|
19
|
-
tag.id = _drawer_id;
|
|
20
|
-
tag.textContent = DRAWER_STYLES;
|
|
21
|
-
document.head.appendChild(tag);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function Drawer({
|
|
25
|
-
open = false,
|
|
26
|
-
onClose,
|
|
27
|
-
title = '',
|
|
28
|
-
description = '',
|
|
29
|
-
width = 560,
|
|
30
|
-
side = 'right',
|
|
31
|
-
showClose = true,
|
|
32
|
-
children,
|
|
33
|
-
footer,
|
|
34
|
-
header,
|
|
35
|
-
style = {},
|
|
36
|
-
bodyStyle = {},
|
|
37
|
-
}) {
|
|
38
|
-
const [closing, setClosing] = useState(false);
|
|
39
|
-
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
ensureDrawerStyles();
|
|
42
|
-
}, []);
|
|
43
|
-
|
|
44
|
-
const handleClose = () => {
|
|
45
|
-
if (closing) return;
|
|
46
|
-
setClosing(true);
|
|
47
|
-
setTimeout(() => {
|
|
48
|
-
setClosing(false);
|
|
49
|
-
onClose?.();
|
|
50
|
-
}, 260);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
if (typeof document === 'undefined') return;
|
|
55
|
-
const handleKeydown = (e) => {
|
|
56
|
-
if (e.key === 'Escape' && open) handleClose();
|
|
57
|
-
};
|
|
58
|
-
if (open) {
|
|
59
|
-
document.body.style.overflow = 'hidden';
|
|
60
|
-
window.addEventListener('keydown', handleKeydown);
|
|
61
|
-
} else {
|
|
62
|
-
document.body.style.overflow = '';
|
|
63
|
-
window.removeEventListener('keydown', handleKeydown);
|
|
64
|
-
}
|
|
65
|
-
return () => {
|
|
66
|
-
document.body.style.overflow = '';
|
|
67
|
-
window.removeEventListener('keydown', handleKeydown);
|
|
68
|
-
};
|
|
69
|
-
}, [open]);
|
|
70
|
-
|
|
71
|
-
if (!open && !closing) return null;
|
|
72
|
-
if (typeof document === 'undefined') return null;
|
|
73
|
-
|
|
74
|
-
const resolvedWidth = typeof width === 'number' ? `${width}px` : width;
|
|
75
|
-
const slideInAnim = side === 'left' ? 'cynxDrawerSlideInLeft' : 'cynxDrawerSlideInRight';
|
|
76
|
-
const slideOutAnim = side === 'left' ? 'cynxDrawerSlideOutLeft' : 'cynxDrawerSlideOutRight';
|
|
77
|
-
|
|
78
|
-
return createPortal(
|
|
79
|
-
<div
|
|
80
|
-
style={{
|
|
81
|
-
position: 'fixed',
|
|
82
|
-
inset: 0,
|
|
83
|
-
background: 'rgba(20, 22, 41, .45)',
|
|
84
|
-
zIndex: 8500,
|
|
85
|
-
display: 'flex',
|
|
86
|
-
justifyContent: side === 'left' ? 'flex-start' : 'flex-end',
|
|
87
|
-
animation: `${closing ? 'cynxDrawerFadeOut' : 'cynxDrawerFadeIn'} .26s ease forwards`,
|
|
88
|
-
}}
|
|
89
|
-
onMouseDown={(e) => {
|
|
90
|
-
if (e.target === e.currentTarget) handleClose();
|
|
91
|
-
}}
|
|
92
|
-
>
|
|
93
|
-
<div
|
|
94
|
-
style={{
|
|
95
|
-
background: 'var(--surface, #ffffff)',
|
|
96
|
-
borderLeft: side === 'right' ? '1px solid var(--border, var(--bd, #e2e8f0))' : 'none',
|
|
97
|
-
borderRight: side === 'left' ? '1px solid var(--border, var(--bd, #e2e8f0))' : 'none',
|
|
98
|
-
width: resolvedWidth,
|
|
99
|
-
maxWidth: '100vw',
|
|
100
|
-
height: '100%',
|
|
101
|
-
boxShadow: 'var(--shadow-lg, 0 20px 60px rgba(0, 0, 0, .25))',
|
|
102
|
-
display: 'flex',
|
|
103
|
-
flexDirection: 'column',
|
|
104
|
-
overflow: 'hidden',
|
|
105
|
-
animation: `${closing ? slideOutAnim : slideInAnim} .26s cubic-bezier(.16, 1, .3, 1) forwards`,
|
|
106
|
-
...style,
|
|
107
|
-
}}
|
|
108
|
-
onMouseDown={(e) => e.stopPropagation()}
|
|
109
|
-
>
|
|
110
|
-
{/* Header */}
|
|
111
|
-
<div
|
|
112
|
-
style={{
|
|
113
|
-
display: 'flex',
|
|
114
|
-
alignItems: 'center',
|
|
115
|
-
justifyContent: 'space-between',
|
|
116
|
-
padding: '16px 20px',
|
|
117
|
-
borderBottom: '1px solid var(--border-light, #ebebf0)',
|
|
118
|
-
flexShrink: 0,
|
|
119
|
-
}}
|
|
120
|
-
>
|
|
121
|
-
{header ? (
|
|
122
|
-
header
|
|
123
|
-
) : (
|
|
124
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
|
|
125
|
-
<span
|
|
126
|
-
style={{
|
|
127
|
-
fontSize: '1rem',
|
|
128
|
-
fontWeight: 700,
|
|
129
|
-
letterSpacing: '-.01em',
|
|
130
|
-
color: 'var(--t, var(--primary-text, #0f111c))',
|
|
131
|
-
}}
|
|
132
|
-
>
|
|
133
|
-
{{ title }}
|
|
134
|
-
</span>
|
|
135
|
-
{description && (
|
|
136
|
-
<span
|
|
137
|
-
style={{
|
|
138
|
-
fontSize: '.75rem',
|
|
139
|
-
color: 'var(--muted, #797b8d)',
|
|
140
|
-
}}
|
|
141
|
-
>
|
|
142
|
-
{description}
|
|
143
|
-
</span>
|
|
144
|
-
)}
|
|
145
|
-
</div>
|
|
146
|
-
)}
|
|
147
|
-
|
|
148
|
-
{showClose && (
|
|
149
|
-
<button
|
|
150
|
-
type="button"
|
|
151
|
-
style={{
|
|
152
|
-
background: 'none',
|
|
153
|
-
border: 'none',
|
|
154
|
-
cursor: 'pointer',
|
|
155
|
-
padding: '6px',
|
|
156
|
-
borderRadius: '6px',
|
|
157
|
-
color: 'var(--muted, #797b8d)',
|
|
158
|
-
display: 'flex',
|
|
159
|
-
alignItems: 'center',
|
|
160
|
-
justifyContent: 'center',
|
|
161
|
-
transition: 'all .14s',
|
|
162
|
-
}}
|
|
163
|
-
onClick={handleClose}
|
|
164
|
-
>
|
|
165
|
-
<X size={18} />
|
|
166
|
-
</button>
|
|
167
|
-
)}
|
|
168
|
-
</div>
|
|
169
|
-
|
|
170
|
-
{/* Body */}
|
|
171
|
-
<div
|
|
172
|
-
className="custom-scrollbar"
|
|
173
|
-
style={{
|
|
174
|
-
padding: '20px',
|
|
175
|
-
overflowX: 'hidden',
|
|
176
|
-
overflowY: 'auto',
|
|
177
|
-
flex: '1 1 auto',
|
|
178
|
-
minHeight: 0,
|
|
179
|
-
color: 'var(--t, var(--primary-text, #0f111c))',
|
|
180
|
-
...bodyStyle,
|
|
181
|
-
}}
|
|
182
|
-
>
|
|
183
|
-
{children}
|
|
184
|
-
</div>
|
|
185
|
-
|
|
186
|
-
{/* Footer */}
|
|
187
|
-
{footer && (
|
|
188
|
-
<div
|
|
189
|
-
style={{
|
|
190
|
-
display: 'flex',
|
|
191
|
-
justifyContent: 'flex-end',
|
|
192
|
-
gap: 8,
|
|
193
|
-
padding: '14px 20px',
|
|
194
|
-
borderTop: '1px solid var(--border-light, #ebebf0)',
|
|
195
|
-
background: 'var(--grey-1, #f5f5f8)',
|
|
196
|
-
flexShrink: 0,
|
|
197
|
-
}}
|
|
198
|
-
>
|
|
199
|
-
{footer}
|
|
200
|
-
</div>
|
|
201
|
-
)}
|
|
202
|
-
</div>
|
|
203
|
-
</div>,
|
|
204
|
-
document.body
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export default Drawer;
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
import { X } from 'lucide-react';
|
|
4
|
+
|
|
5
|
+
const DRAWER_STYLES = `
|
|
6
|
+
@keyframes cynxDrawerFadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
7
|
+
@keyframes cynxDrawerFadeOut { from { opacity: 1; } to { opacity: 0; } }
|
|
8
|
+
@keyframes cynxDrawerSlideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
|
|
9
|
+
@keyframes cynxDrawerSlideOutRight { from { transform: translateX(0); } to { transform: translateX(100%); } }
|
|
10
|
+
@keyframes cynxDrawerSlideInLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }
|
|
11
|
+
@keyframes cynxDrawerSlideOutLeft { from { transform: translateX(0); } to { transform: translateX(-100%); } }
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
let _drawer_id = 'cynx-drawer-styles';
|
|
15
|
+
function ensureDrawerStyles() {
|
|
16
|
+
if (typeof document === 'undefined') return;
|
|
17
|
+
if (document.getElementById(_drawer_id)) return;
|
|
18
|
+
const tag = document.createElement('style');
|
|
19
|
+
tag.id = _drawer_id;
|
|
20
|
+
tag.textContent = DRAWER_STYLES;
|
|
21
|
+
document.head.appendChild(tag);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function Drawer({
|
|
25
|
+
open = false,
|
|
26
|
+
onClose,
|
|
27
|
+
title = '',
|
|
28
|
+
description = '',
|
|
29
|
+
width = 560,
|
|
30
|
+
side = 'right',
|
|
31
|
+
showClose = true,
|
|
32
|
+
children,
|
|
33
|
+
footer,
|
|
34
|
+
header,
|
|
35
|
+
style = {},
|
|
36
|
+
bodyStyle = {},
|
|
37
|
+
}) {
|
|
38
|
+
const [closing, setClosing] = useState(false);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
ensureDrawerStyles();
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
const handleClose = () => {
|
|
45
|
+
if (closing) return;
|
|
46
|
+
setClosing(true);
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
setClosing(false);
|
|
49
|
+
onClose?.();
|
|
50
|
+
}, 260);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (typeof document === 'undefined') return;
|
|
55
|
+
const handleKeydown = (e) => {
|
|
56
|
+
if (e.key === 'Escape' && open) handleClose();
|
|
57
|
+
};
|
|
58
|
+
if (open) {
|
|
59
|
+
document.body.style.overflow = 'hidden';
|
|
60
|
+
window.addEventListener('keydown', handleKeydown);
|
|
61
|
+
} else {
|
|
62
|
+
document.body.style.overflow = '';
|
|
63
|
+
window.removeEventListener('keydown', handleKeydown);
|
|
64
|
+
}
|
|
65
|
+
return () => {
|
|
66
|
+
document.body.style.overflow = '';
|
|
67
|
+
window.removeEventListener('keydown', handleKeydown);
|
|
68
|
+
};
|
|
69
|
+
}, [open]);
|
|
70
|
+
|
|
71
|
+
if (!open && !closing) return null;
|
|
72
|
+
if (typeof document === 'undefined') return null;
|
|
73
|
+
|
|
74
|
+
const resolvedWidth = typeof width === 'number' ? `${width}px` : width;
|
|
75
|
+
const slideInAnim = side === 'left' ? 'cynxDrawerSlideInLeft' : 'cynxDrawerSlideInRight';
|
|
76
|
+
const slideOutAnim = side === 'left' ? 'cynxDrawerSlideOutLeft' : 'cynxDrawerSlideOutRight';
|
|
77
|
+
|
|
78
|
+
return createPortal(
|
|
79
|
+
<div
|
|
80
|
+
style={{
|
|
81
|
+
position: 'fixed',
|
|
82
|
+
inset: 0,
|
|
83
|
+
background: 'rgba(20, 22, 41, .45)',
|
|
84
|
+
zIndex: 8500,
|
|
85
|
+
display: 'flex',
|
|
86
|
+
justifyContent: side === 'left' ? 'flex-start' : 'flex-end',
|
|
87
|
+
animation: `${closing ? 'cynxDrawerFadeOut' : 'cynxDrawerFadeIn'} .26s ease forwards`,
|
|
88
|
+
}}
|
|
89
|
+
onMouseDown={(e) => {
|
|
90
|
+
if (e.target === e.currentTarget) handleClose();
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
<div
|
|
94
|
+
style={{
|
|
95
|
+
background: 'var(--surface, #ffffff)',
|
|
96
|
+
borderLeft: side === 'right' ? '1px solid var(--border, var(--bd, #e2e8f0))' : 'none',
|
|
97
|
+
borderRight: side === 'left' ? '1px solid var(--border, var(--bd, #e2e8f0))' : 'none',
|
|
98
|
+
width: resolvedWidth,
|
|
99
|
+
maxWidth: '100vw',
|
|
100
|
+
height: '100%',
|
|
101
|
+
boxShadow: 'var(--shadow-lg, 0 20px 60px rgba(0, 0, 0, .25))',
|
|
102
|
+
display: 'flex',
|
|
103
|
+
flexDirection: 'column',
|
|
104
|
+
overflow: 'hidden',
|
|
105
|
+
animation: `${closing ? slideOutAnim : slideInAnim} .26s cubic-bezier(.16, 1, .3, 1) forwards`,
|
|
106
|
+
...style,
|
|
107
|
+
}}
|
|
108
|
+
onMouseDown={(e) => e.stopPropagation()}
|
|
109
|
+
>
|
|
110
|
+
{/* Header */}
|
|
111
|
+
<div
|
|
112
|
+
style={{
|
|
113
|
+
display: 'flex',
|
|
114
|
+
alignItems: 'center',
|
|
115
|
+
justifyContent: 'space-between',
|
|
116
|
+
padding: '16px 20px',
|
|
117
|
+
borderBottom: '1px solid var(--border-light, #ebebf0)',
|
|
118
|
+
flexShrink: 0,
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
{header ? (
|
|
122
|
+
header
|
|
123
|
+
) : (
|
|
124
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
|
|
125
|
+
<span
|
|
126
|
+
style={{
|
|
127
|
+
fontSize: '1rem',
|
|
128
|
+
fontWeight: 700,
|
|
129
|
+
letterSpacing: '-.01em',
|
|
130
|
+
color: 'var(--t, var(--primary-text, #0f111c))',
|
|
131
|
+
}}
|
|
132
|
+
>
|
|
133
|
+
{{ title }}
|
|
134
|
+
</span>
|
|
135
|
+
{description && (
|
|
136
|
+
<span
|
|
137
|
+
style={{
|
|
138
|
+
fontSize: '.75rem',
|
|
139
|
+
color: 'var(--muted, #797b8d)',
|
|
140
|
+
}}
|
|
141
|
+
>
|
|
142
|
+
{description}
|
|
143
|
+
</span>
|
|
144
|
+
)}
|
|
145
|
+
</div>
|
|
146
|
+
)}
|
|
147
|
+
|
|
148
|
+
{showClose && (
|
|
149
|
+
<button
|
|
150
|
+
type="button"
|
|
151
|
+
style={{
|
|
152
|
+
background: 'none',
|
|
153
|
+
border: 'none',
|
|
154
|
+
cursor: 'pointer',
|
|
155
|
+
padding: '6px',
|
|
156
|
+
borderRadius: '6px',
|
|
157
|
+
color: 'var(--muted, #797b8d)',
|
|
158
|
+
display: 'flex',
|
|
159
|
+
alignItems: 'center',
|
|
160
|
+
justifyContent: 'center',
|
|
161
|
+
transition: 'all .14s',
|
|
162
|
+
}}
|
|
163
|
+
onClick={handleClose}
|
|
164
|
+
>
|
|
165
|
+
<X size={18} />
|
|
166
|
+
</button>
|
|
167
|
+
)}
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
{/* Body */}
|
|
171
|
+
<div
|
|
172
|
+
className="custom-scrollbar"
|
|
173
|
+
style={{
|
|
174
|
+
padding: '20px',
|
|
175
|
+
overflowX: 'hidden',
|
|
176
|
+
overflowY: 'auto',
|
|
177
|
+
flex: '1 1 auto',
|
|
178
|
+
minHeight: 0,
|
|
179
|
+
color: 'var(--t, var(--primary-text, #0f111c))',
|
|
180
|
+
...bodyStyle,
|
|
181
|
+
}}
|
|
182
|
+
>
|
|
183
|
+
{children}
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
{/* Footer */}
|
|
187
|
+
{footer && (
|
|
188
|
+
<div
|
|
189
|
+
style={{
|
|
190
|
+
display: 'flex',
|
|
191
|
+
justifyContent: 'flex-end',
|
|
192
|
+
gap: 8,
|
|
193
|
+
padding: '14px 20px',
|
|
194
|
+
borderTop: '1px solid var(--border-light, #ebebf0)',
|
|
195
|
+
background: 'var(--grey-1, #f5f5f8)',
|
|
196
|
+
flexShrink: 0,
|
|
197
|
+
}}
|
|
198
|
+
>
|
|
199
|
+
{footer}
|
|
200
|
+
</div>
|
|
201
|
+
)}
|
|
202
|
+
</div>
|
|
203
|
+
</div>,
|
|
204
|
+
document.body
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export default Drawer;
|