@topconsultnpm/sdkui-react 6.19.0-dev2.30 → 6.19.0-dev2.32
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/lib/components/features/tasks/TMTaskForm.js +5 -0
- package/lib/components/grids/TMBlogsPost.d.ts +2 -0
- package/lib/components/grids/TMBlogsPost.js +2 -2
- package/package.json +1 -1
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.d.ts +0 -4
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +0 -187
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +0 -11
- package/lib/components/NewComponents/ContextMenu/hooks.js +0 -48
- package/lib/components/NewComponents/ContextMenu/index.d.ts +0 -2
- package/lib/components/NewComponents/ContextMenu/index.js +0 -1
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +0 -27
- package/lib/components/NewComponents/ContextMenu/styles.js +0 -308
- package/lib/components/NewComponents/ContextMenu/types.d.ts +0 -26
- package/lib/components/NewComponents/ContextMenu/types.js +0 -1
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.d.ts +0 -4
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +0 -370
- package/lib/components/NewComponents/FloatingMenuBar/index.d.ts +0 -2
- package/lib/components/NewComponents/FloatingMenuBar/index.js +0 -2
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +0 -38
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +0 -267
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +0 -30
- package/lib/components/NewComponents/FloatingMenuBar/types.js +0 -1
- package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
- package/lib/components/NewComponents/Notification/Notification.js +0 -60
- package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
- package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
- package/lib/components/NewComponents/Notification/index.d.ts +0 -2
- package/lib/components/NewComponents/Notification/index.js +0 -2
- package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
- package/lib/components/NewComponents/Notification/styles.js +0 -180
- package/lib/components/NewComponents/Notification/types.d.ts +0 -18
- package/lib/components/NewComponents/Notification/types.js +0 -1
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import styled, { keyframes, css } from 'styled-components';
|
|
2
|
-
const fadeIn = keyframes `
|
|
3
|
-
from {
|
|
4
|
-
opacity: 0;
|
|
5
|
-
transform: scale(0.95);
|
|
6
|
-
}
|
|
7
|
-
to {
|
|
8
|
-
opacity: 1;
|
|
9
|
-
transform: scale(1);
|
|
10
|
-
}
|
|
11
|
-
`;
|
|
12
|
-
const shake = keyframes `
|
|
13
|
-
0%, 100% { transform: translateX(0); }
|
|
14
|
-
25% { transform: translateX(-2px); }
|
|
15
|
-
75% { transform: translateX(2px); }
|
|
16
|
-
`;
|
|
17
|
-
export const Overlay = styled.div `
|
|
18
|
-
position: fixed;
|
|
19
|
-
top: 0;
|
|
20
|
-
left: 0;
|
|
21
|
-
right: 0;
|
|
22
|
-
bottom: 0;
|
|
23
|
-
background: rgba(255, 255, 255, 0.8);
|
|
24
|
-
z-index: 9998;
|
|
25
|
-
display: ${props => props.$visible ? 'block' : 'none'};
|
|
26
|
-
animation: ${fadeIn} 0.2s ease-out;
|
|
27
|
-
backdrop-filter: blur(2px);
|
|
28
|
-
|
|
29
|
-
[data-theme='dark'] & {
|
|
30
|
-
background: rgba(0, 0, 0, 0.8);
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
33
|
-
export const FloatingContainer = styled.div.attrs(props => ({
|
|
34
|
-
style: {
|
|
35
|
-
left: `${props.$x}px`,
|
|
36
|
-
top: `${props.$y}px`,
|
|
37
|
-
},
|
|
38
|
-
})) `
|
|
39
|
-
position: ${props => props.$isConstrained ? 'absolute' : 'fixed'};
|
|
40
|
-
z-index: ${props => props.$isConfigMode ? 9999 : 10000};
|
|
41
|
-
display: flex;
|
|
42
|
-
flex-direction: ${props => props.$orientation === 'horizontal' ? 'row' : 'column'};
|
|
43
|
-
align-items: center;
|
|
44
|
-
background: ${props => props.$isDragging || props.$isConfigMode
|
|
45
|
-
? 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)'
|
|
46
|
-
: 'rgba(102, 126, 234, 0.9)'};
|
|
47
|
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
48
|
-
border-radius: 14px;
|
|
49
|
-
padding: 6px;
|
|
50
|
-
gap: 3px;
|
|
51
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
|
|
52
|
-
cursor: ${props => props.$isDragging ? 'grabbing' : 'default'};
|
|
53
|
-
user-select: none;
|
|
54
|
-
animation: ${props => props.$isConfigMode && css `${shake} 0.3s ease-in-out`};
|
|
55
|
-
transition: none;
|
|
56
|
-
|
|
57
|
-
&:hover {
|
|
58
|
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
59
|
-
border: 1px solid #667eea;
|
|
60
|
-
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3),
|
|
61
|
-
0 6px 16px rgba(0, 0, 0, 0.2);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
[data-theme='dark'] & {
|
|
65
|
-
background: ${props => props.$isDragging || props.$isConfigMode
|
|
66
|
-
? 'linear-gradient(135deg, #1a1a2e 0%, #16213e 100%)'
|
|
67
|
-
: 'rgba(26, 26, 46, 0.9)'};
|
|
68
|
-
border-color: rgba(255, 255, 255, 0.1);
|
|
69
|
-
|
|
70
|
-
&:hover {
|
|
71
|
-
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
|
|
72
|
-
border: 1px solid #1a1a2e;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
export const GripHandle = styled.div `
|
|
77
|
-
display: flex;
|
|
78
|
-
align-items: center;
|
|
79
|
-
justify-content: center;
|
|
80
|
-
padding: ${props => props.$orientation === 'horizontal' ? '10px 6px' : '6px 10px'};
|
|
81
|
-
cursor: grab;
|
|
82
|
-
color: rgba(255, 255, 255, 0.7);
|
|
83
|
-
transition: all 0.2s ease;
|
|
84
|
-
border-radius: 6px;
|
|
85
|
-
|
|
86
|
-
&:hover {
|
|
87
|
-
background: rgba(255, 255, 255, 0.1);
|
|
88
|
-
color: rgba(255, 255, 255, 1);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
&:active {
|
|
92
|
-
cursor: grabbing;
|
|
93
|
-
background: rgba(255, 255, 255, 0.15);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
svg {
|
|
97
|
-
width: 14px;
|
|
98
|
-
height: 14px;
|
|
99
|
-
}
|
|
100
|
-
`;
|
|
101
|
-
export const MenuButton = styled.button `
|
|
102
|
-
display: flex;
|
|
103
|
-
align-items: center;
|
|
104
|
-
justify-content: center;
|
|
105
|
-
width: 34px;
|
|
106
|
-
height: 34px;
|
|
107
|
-
background: transparent;
|
|
108
|
-
border: none;
|
|
109
|
-
border-radius: 8px;
|
|
110
|
-
color: white;
|
|
111
|
-
font-size: 16px;
|
|
112
|
-
cursor: pointer;
|
|
113
|
-
transition: all 0.2s ease;
|
|
114
|
-
position: relative;
|
|
115
|
-
|
|
116
|
-
&:hover:not(:disabled) {
|
|
117
|
-
background: rgba(255, 255, 255, 0.2);
|
|
118
|
-
transform: scale(1.1);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
&:active:not(:disabled) {
|
|
122
|
-
transform: scale(0.95);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
&:disabled {
|
|
126
|
-
opacity: 0.3;
|
|
127
|
-
cursor: not-allowed;
|
|
128
|
-
background: rgba(255, 255, 255, 0.05);
|
|
129
|
-
color: rgba(255, 255, 255, 0.4);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
svg {
|
|
133
|
-
width: 18px;
|
|
134
|
-
height: 18px;
|
|
135
|
-
}
|
|
136
|
-
`;
|
|
137
|
-
export const ConfigButton = styled.button `
|
|
138
|
-
display: flex;
|
|
139
|
-
align-items: center;
|
|
140
|
-
justify-content: center;
|
|
141
|
-
width: 34px;
|
|
142
|
-
height: 34px;
|
|
143
|
-
background: ${props => props.$isActive
|
|
144
|
-
? 'rgba(0, 0, 0, 0.2)'
|
|
145
|
-
: 'rgba(0, 0, 0, 0.1)'};
|
|
146
|
-
border: 1px solid ${props => props.$isActive
|
|
147
|
-
? 'rgba(255, 255, 255, 0.3)'
|
|
148
|
-
: 'rgba(255, 255, 255, 0.15)'};
|
|
149
|
-
border-radius: 8px;
|
|
150
|
-
color: white;
|
|
151
|
-
font-size: 16px;
|
|
152
|
-
cursor: pointer;
|
|
153
|
-
transition: all 0.2s ease;
|
|
154
|
-
position: relative;
|
|
155
|
-
|
|
156
|
-
&:hover {
|
|
157
|
-
background: ${props => props.$isActive
|
|
158
|
-
? 'rgba(0, 0, 0, 0.25)'
|
|
159
|
-
: 'rgba(0, 0, 0, 0.15)'};
|
|
160
|
-
border-color: rgba(255, 255, 255, 0.35);
|
|
161
|
-
transform: scale(1.05);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
&:active {
|
|
165
|
-
transform: scale(0.95);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
svg {
|
|
169
|
-
width: 20px;
|
|
170
|
-
height: 20px;
|
|
171
|
-
}
|
|
172
|
-
`;
|
|
173
|
-
export const RemoveButton = styled.button `
|
|
174
|
-
position: absolute;
|
|
175
|
-
top: -6px;
|
|
176
|
-
right: -6px;
|
|
177
|
-
width: 20px;
|
|
178
|
-
height: 20px;
|
|
179
|
-
background: #ef4444;
|
|
180
|
-
border: 2px solid white;
|
|
181
|
-
border-radius: 50%;
|
|
182
|
-
color: white;
|
|
183
|
-
font-size: 12px;
|
|
184
|
-
font-weight: bold;
|
|
185
|
-
cursor: pointer;
|
|
186
|
-
display: flex;
|
|
187
|
-
align-items: center;
|
|
188
|
-
justify-content: center;
|
|
189
|
-
transition: all 0.2s ease;
|
|
190
|
-
z-index: 1;
|
|
191
|
-
|
|
192
|
-
&:hover {
|
|
193
|
-
background: #dc2626;
|
|
194
|
-
transform: scale(1.15);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
&:active {
|
|
198
|
-
transform: scale(0.9);
|
|
199
|
-
}
|
|
200
|
-
`;
|
|
201
|
-
export const OrientationToggle = styled.button `
|
|
202
|
-
display: flex;
|
|
203
|
-
align-items: center;
|
|
204
|
-
justify-content: center;
|
|
205
|
-
width: 20px;
|
|
206
|
-
height: 20px;
|
|
207
|
-
background: transparent;
|
|
208
|
-
border: none;
|
|
209
|
-
border-radius: 4px;
|
|
210
|
-
color: rgba(255, 255, 255, 0.5);
|
|
211
|
-
font-size: 10px;
|
|
212
|
-
cursor: pointer;
|
|
213
|
-
transition: all 0.2s ease;
|
|
214
|
-
padding: 2px;
|
|
215
|
-
transform: ${props => props.$orientation === 'vertical' ? 'rotate(90deg)' : 'rotate(0deg)'};
|
|
216
|
-
|
|
217
|
-
&:hover {
|
|
218
|
-
background: rgba(255, 255, 255, 0.1);
|
|
219
|
-
color: rgba(255, 255, 255, 0.8);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
&:active {
|
|
223
|
-
transform: ${props => props.$orientation === 'vertical' ? 'rotate(90deg) scale(0.9)' : 'scale(0.9)'};
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
svg {
|
|
227
|
-
width: 10px;
|
|
228
|
-
height: 10px;
|
|
229
|
-
}
|
|
230
|
-
`;
|
|
231
|
-
export const DraggableItem = styled.div `
|
|
232
|
-
position: relative;
|
|
233
|
-
opacity: ${props => props.$isDragging ? 0.3 : 1};
|
|
234
|
-
transform: ${props => {
|
|
235
|
-
if (props.$isDragging)
|
|
236
|
-
return 'scale(1.1) rotate(5deg)';
|
|
237
|
-
if (props.$isDragOver)
|
|
238
|
-
return 'scale(1.05)';
|
|
239
|
-
return 'scale(1)';
|
|
240
|
-
}};
|
|
241
|
-
transition: all 0.2s ease;
|
|
242
|
-
filter: ${props => props.$isDragging ? 'brightness(1.3)' : 'brightness(1)'};
|
|
243
|
-
|
|
244
|
-
${props => props.$isDragging && css `
|
|
245
|
-
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
|
|
246
|
-
z-index: 100;
|
|
247
|
-
`}
|
|
248
|
-
|
|
249
|
-
${props => props.$isDragOver && css `
|
|
250
|
-
&::before {
|
|
251
|
-
content: '';
|
|
252
|
-
position: absolute;
|
|
253
|
-
top: -4px;
|
|
254
|
-
left: 50%;
|
|
255
|
-
transform: translateX(-50%);
|
|
256
|
-
width: 40px;
|
|
257
|
-
height: 3px;
|
|
258
|
-
background: rgba(255, 255, 255, 0.8);
|
|
259
|
-
border-radius: 2px;
|
|
260
|
-
box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
|
|
261
|
-
}
|
|
262
|
-
`}
|
|
263
|
-
`;
|
|
264
|
-
export const ContextMenuWrapper = styled.div `
|
|
265
|
-
position: static;
|
|
266
|
-
display: contents;
|
|
267
|
-
`;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { TMContextMenuItemProps } from '../ContextMenu';
|
|
2
|
-
export interface TMFloatingMenuItem {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
icon: React.ReactNode;
|
|
6
|
-
onClick: () => void;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
isPinned?: boolean;
|
|
9
|
-
originalMenuItem?: TMContextMenuItemProps;
|
|
10
|
-
}
|
|
11
|
-
export interface TMFloatingMenuBarProps {
|
|
12
|
-
containerRef: React.RefObject<HTMLElement | null>;
|
|
13
|
-
contextMenuItems?: TMContextMenuItemProps[];
|
|
14
|
-
storageKey?: string;
|
|
15
|
-
isConstrained?: boolean;
|
|
16
|
-
defaultPosition?: Position;
|
|
17
|
-
maxItems?: number;
|
|
18
|
-
}
|
|
19
|
-
export interface Position {
|
|
20
|
-
x: number;
|
|
21
|
-
y: number;
|
|
22
|
-
}
|
|
23
|
-
export interface TMFloatingMenuBarState {
|
|
24
|
-
position: Position;
|
|
25
|
-
isDragging: boolean;
|
|
26
|
-
isConfigMode: boolean;
|
|
27
|
-
orientation: 'horizontal' | 'vertical';
|
|
28
|
-
items: TMFloatingMenuItem[];
|
|
29
|
-
draggedItemIndex: number | null;
|
|
30
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useRef } from 'react';
|
|
3
|
-
import * as S from './styles';
|
|
4
|
-
const Notification = ({ title, message, mode = 'info', position = 'top-right', duration = 3000, closable = false, stopOnMouseEnter = true, hasProgress = true, onClose, }) => {
|
|
5
|
-
const [state, setState] = useState({
|
|
6
|
-
visible: true,
|
|
7
|
-
isPaused: false,
|
|
8
|
-
progress: 100,
|
|
9
|
-
});
|
|
10
|
-
const timeoutRef = useRef(undefined);
|
|
11
|
-
const remainingTimeRef = useRef(duration);
|
|
12
|
-
const pauseTimeRef = useRef(0);
|
|
13
|
-
const closeNotification = () => {
|
|
14
|
-
setState(prev => ({ ...prev, visible: false }));
|
|
15
|
-
setTimeout(() => {
|
|
16
|
-
onClose?.();
|
|
17
|
-
}, 300);
|
|
18
|
-
};
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
// Set up auto-close timer
|
|
21
|
-
timeoutRef.current = setTimeout(() => {
|
|
22
|
-
closeNotification();
|
|
23
|
-
}, duration);
|
|
24
|
-
return () => {
|
|
25
|
-
if (timeoutRef.current) {
|
|
26
|
-
clearTimeout(timeoutRef.current);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}, [duration]);
|
|
30
|
-
const handleMouseEnter = () => {
|
|
31
|
-
if (!stopOnMouseEnter)
|
|
32
|
-
return;
|
|
33
|
-
// Pause the timer
|
|
34
|
-
if (timeoutRef.current) {
|
|
35
|
-
clearTimeout(timeoutRef.current);
|
|
36
|
-
pauseTimeRef.current = Date.now();
|
|
37
|
-
}
|
|
38
|
-
setState(prev => ({ ...prev, isPaused: true }));
|
|
39
|
-
};
|
|
40
|
-
const handleMouseLeave = () => {
|
|
41
|
-
if (!stopOnMouseEnter)
|
|
42
|
-
return;
|
|
43
|
-
// Resume the timer with remaining time
|
|
44
|
-
const pauseDuration = Date.now() - pauseTimeRef.current;
|
|
45
|
-
remainingTimeRef.current = Math.max(0, remainingTimeRef.current - pauseDuration);
|
|
46
|
-
timeoutRef.current = setTimeout(() => {
|
|
47
|
-
closeNotification();
|
|
48
|
-
}, remainingTimeRef.current);
|
|
49
|
-
setState(prev => ({ ...prev, isPaused: false }));
|
|
50
|
-
};
|
|
51
|
-
const handleClose = (e) => {
|
|
52
|
-
e.stopPropagation();
|
|
53
|
-
if (timeoutRef.current) {
|
|
54
|
-
clearTimeout(timeoutRef.current);
|
|
55
|
-
}
|
|
56
|
-
closeNotification();
|
|
57
|
-
};
|
|
58
|
-
return (_jsxs(S.NotificationContainer, { "$position": position, "$mode": mode, "$visible": state.visible, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, role: "alert", "aria-live": "assertive", children: [_jsxs(S.NotificationContent, { children: [_jsx(S.NotificationTitle, { children: title }), _jsx(S.NotificationMessage, { children: message })] }), closable && (_jsx(S.CloseButton, { onClick: handleClose, "aria-label": "Close notification", children: "\u00D7" })), hasProgress && (_jsx(S.ProgressBar, { "$duration": duration, "$mode": mode, "$isPaused": state.isPaused }))] }));
|
|
59
|
-
};
|
|
60
|
-
export default Notification;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { NotificationPosition } from './types';
|
|
3
|
-
interface NotificationContainerProps {
|
|
4
|
-
position: NotificationPosition;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
declare const NotificationContainer: React.FC<NotificationContainerProps>;
|
|
8
|
-
export default NotificationContainer;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
const Container = styled.div `
|
|
4
|
-
position: fixed;
|
|
5
|
-
z-index: 10002;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
gap: 12px;
|
|
9
|
-
pointer-events: none;
|
|
10
|
-
|
|
11
|
-
${props => {
|
|
12
|
-
const isTop = props.$position.startsWith('top');
|
|
13
|
-
const isBottom = props.$position.startsWith('bottom');
|
|
14
|
-
const isLeft = props.$position.endsWith('left');
|
|
15
|
-
const isRight = props.$position.endsWith('right');
|
|
16
|
-
const isCenter = props.$position.endsWith('center');
|
|
17
|
-
return `
|
|
18
|
-
${isTop ? 'top: 24px;' : ''}
|
|
19
|
-
${isBottom ? 'bottom: 24px;' : ''}
|
|
20
|
-
${isLeft ? 'left: 24px;' : ''}
|
|
21
|
-
${isRight ? 'right: 24px;' : ''}
|
|
22
|
-
${isCenter ? 'left: 50%; transform: translateX(-50%);' : ''}
|
|
23
|
-
`;
|
|
24
|
-
}}
|
|
25
|
-
|
|
26
|
-
& > * {
|
|
27
|
-
pointer-events: auto;
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
const NotificationContainer = ({ position, children }) => {
|
|
31
|
-
return _jsx(Container, { "$position": position, children: children });
|
|
32
|
-
};
|
|
33
|
-
export default NotificationContainer;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { NotificationMode, NotificationPosition } from './types';
|
|
2
|
-
export declare const NotificationContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
|
-
$position: NotificationPosition;
|
|
4
|
-
$mode: NotificationMode;
|
|
5
|
-
$visible: boolean;
|
|
6
|
-
}>> & string;
|
|
7
|
-
export declare const NotificationContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
-
export declare const NotificationTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
9
|
-
export declare const NotificationMessage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
10
|
-
export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
11
|
-
export declare const ProgressBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
12
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
13
|
-
}>, {
|
|
14
|
-
$duration: number;
|
|
15
|
-
$mode: NotificationMode;
|
|
16
|
-
$isPaused: boolean;
|
|
17
|
-
}>, {
|
|
18
|
-
$duration: number;
|
|
19
|
-
$mode: NotificationMode;
|
|
20
|
-
$isPaused: boolean;
|
|
21
|
-
}>> & string;
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import styled, { keyframes } from 'styled-components';
|
|
2
|
-
const slideInFromTop = keyframes `
|
|
3
|
-
from {
|
|
4
|
-
opacity: 0;
|
|
5
|
-
transform: translateY(-100%);
|
|
6
|
-
}
|
|
7
|
-
to {
|
|
8
|
-
opacity: 1;
|
|
9
|
-
transform: translateY(0);
|
|
10
|
-
}
|
|
11
|
-
`;
|
|
12
|
-
const slideInFromBottom = keyframes `
|
|
13
|
-
from {
|
|
14
|
-
opacity: 0;
|
|
15
|
-
transform: translateY(100%);
|
|
16
|
-
}
|
|
17
|
-
to {
|
|
18
|
-
opacity: 1;
|
|
19
|
-
transform: translateY(0);
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
const slideOut = keyframes `
|
|
23
|
-
from {
|
|
24
|
-
opacity: 1;
|
|
25
|
-
transform: scale(1);
|
|
26
|
-
}
|
|
27
|
-
to {
|
|
28
|
-
opacity: 0;
|
|
29
|
-
transform: scale(0.9);
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
const getModeColors = (mode) => {
|
|
33
|
-
const colors = {
|
|
34
|
-
success: {
|
|
35
|
-
bg: '#10b981',
|
|
36
|
-
bgDark: '#059669',
|
|
37
|
-
border: '#34d399',
|
|
38
|
-
text: '#ffffff',
|
|
39
|
-
},
|
|
40
|
-
error: {
|
|
41
|
-
bg: '#ef4444',
|
|
42
|
-
bgDark: '#dc2626',
|
|
43
|
-
border: '#f87171',
|
|
44
|
-
text: '#ffffff',
|
|
45
|
-
},
|
|
46
|
-
warning: {
|
|
47
|
-
bg: '#f59e0b',
|
|
48
|
-
bgDark: '#d97706',
|
|
49
|
-
border: '#fbbf24',
|
|
50
|
-
text: '#ffffff',
|
|
51
|
-
},
|
|
52
|
-
info: {
|
|
53
|
-
bg: '#3b82f6',
|
|
54
|
-
bgDark: '#2563eb',
|
|
55
|
-
border: '#60a5fa',
|
|
56
|
-
text: '#ffffff',
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
return colors[mode];
|
|
60
|
-
};
|
|
61
|
-
export const NotificationContainer = styled.div `
|
|
62
|
-
position: relative;
|
|
63
|
-
z-index: 1;
|
|
64
|
-
min-width: 320px;
|
|
65
|
-
max-width: 420px;
|
|
66
|
-
background: ${props => getModeColors(props.$mode).bg};
|
|
67
|
-
border-radius: 12px;
|
|
68
|
-
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2),
|
|
69
|
-
0 4px 12px rgba(0, 0, 0, 0.15);
|
|
70
|
-
padding: 16px 20px;
|
|
71
|
-
animation: ${props => {
|
|
72
|
-
if (!props.$visible)
|
|
73
|
-
return slideOut;
|
|
74
|
-
return props.$position.startsWith('top') ? slideInFromTop : slideInFromBottom;
|
|
75
|
-
}} 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
|
76
|
-
backdrop-filter: blur(10px);
|
|
77
|
-
border: 2px solid ${props => getModeColors(props.$mode).border};
|
|
78
|
-
color: ${props => getModeColors(props.$mode).text};
|
|
79
|
-
overflow: hidden;
|
|
80
|
-
|
|
81
|
-
[data-theme='dark'] & {
|
|
82
|
-
background: ${props => getModeColors(props.$mode).bgDark};
|
|
83
|
-
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
|
|
84
|
-
0 4px 12px rgba(0, 0, 0, 0.3);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@media (max-width: 768px) {
|
|
88
|
-
min-width: 280px;
|
|
89
|
-
max-width: calc(100vw - 48px);
|
|
90
|
-
}
|
|
91
|
-
`;
|
|
92
|
-
export const NotificationContent = styled.div `
|
|
93
|
-
display: flex;
|
|
94
|
-
flex-direction: column;
|
|
95
|
-
gap: 6px;
|
|
96
|
-
padding-right: 24px;
|
|
97
|
-
`;
|
|
98
|
-
export const NotificationTitle = styled.div `
|
|
99
|
-
font-size: 16px;
|
|
100
|
-
font-weight: 600;
|
|
101
|
-
line-height: 1.4;
|
|
102
|
-
letter-spacing: -0.01em;
|
|
103
|
-
`;
|
|
104
|
-
export const NotificationMessage = styled.div `
|
|
105
|
-
font-size: 14px;
|
|
106
|
-
font-weight: 400;
|
|
107
|
-
line-height: 1.5;
|
|
108
|
-
opacity: 0.95;
|
|
109
|
-
`;
|
|
110
|
-
export const CloseButton = styled.button `
|
|
111
|
-
position: absolute;
|
|
112
|
-
top: 12px;
|
|
113
|
-
right: 12px;
|
|
114
|
-
background: transparent;
|
|
115
|
-
border: none;
|
|
116
|
-
color: inherit;
|
|
117
|
-
cursor: pointer;
|
|
118
|
-
width: 24px;
|
|
119
|
-
height: 24px;
|
|
120
|
-
display: flex;
|
|
121
|
-
align-items: center;
|
|
122
|
-
justify-content: center;
|
|
123
|
-
border-radius: 6px;
|
|
124
|
-
transition: all 0.15s ease;
|
|
125
|
-
font-size: 18px;
|
|
126
|
-
line-height: 1;
|
|
127
|
-
padding: 0;
|
|
128
|
-
opacity: 0.8;
|
|
129
|
-
|
|
130
|
-
&:hover {
|
|
131
|
-
opacity: 1;
|
|
132
|
-
background: rgba(255, 255, 255, 0.2);
|
|
133
|
-
transform: scale(1.1);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
&:active {
|
|
137
|
-
transform: scale(0.95);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
&:focus {
|
|
141
|
-
outline: 2px solid rgba(255, 255, 255, 0.5);
|
|
142
|
-
outline-offset: 2px;
|
|
143
|
-
}
|
|
144
|
-
`;
|
|
145
|
-
export const ProgressBar = styled.div.attrs(props => ({
|
|
146
|
-
style: {
|
|
147
|
-
animationDuration: `${props.$duration}ms`,
|
|
148
|
-
},
|
|
149
|
-
})) `
|
|
150
|
-
position: absolute;
|
|
151
|
-
bottom: 0;
|
|
152
|
-
left: 0;
|
|
153
|
-
height: 4px;
|
|
154
|
-
width: 100%;
|
|
155
|
-
background: ${props => getModeColors(props.$mode).border};
|
|
156
|
-
border-radius: 0 0 0 10px;
|
|
157
|
-
box-shadow: 0 0 8px ${props => getModeColors(props.$mode).border};
|
|
158
|
-
transform-origin: left;
|
|
159
|
-
animation: progress-shrink linear forwards;
|
|
160
|
-
animation-play-state: ${props => props.$isPaused ? 'paused' : 'running'};
|
|
161
|
-
|
|
162
|
-
@keyframes progress-shrink {
|
|
163
|
-
from {
|
|
164
|
-
transform: scaleX(1);
|
|
165
|
-
}
|
|
166
|
-
to {
|
|
167
|
-
transform: scaleX(0);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
&::after {
|
|
172
|
-
content: '';
|
|
173
|
-
position: absolute;
|
|
174
|
-
top: 0;
|
|
175
|
-
right: 0;
|
|
176
|
-
width: 20px;
|
|
177
|
-
height: 100%;
|
|
178
|
-
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
|
|
179
|
-
}
|
|
180
|
-
`;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type NotificationMode = 'warning' | 'info' | 'error' | 'success';
|
|
2
|
-
export type NotificationPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
3
|
-
export interface NotificationProps {
|
|
4
|
-
title: string;
|
|
5
|
-
message: string;
|
|
6
|
-
mode?: NotificationMode;
|
|
7
|
-
position?: NotificationPosition;
|
|
8
|
-
duration?: number;
|
|
9
|
-
closable?: boolean;
|
|
10
|
-
stopOnMouseEnter?: boolean;
|
|
11
|
-
hasProgress?: boolean;
|
|
12
|
-
onClose?: () => void;
|
|
13
|
-
}
|
|
14
|
-
export interface NotificationState {
|
|
15
|
-
visible: boolean;
|
|
16
|
-
isPaused: boolean;
|
|
17
|
-
progress: number;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|