@megafon/ui-core 5.1.2 → 5.2.0
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/CHANGELOG.md +11 -0
- package/dist/es/components/Snackbar/Snackbar.css +217 -0
- package/dist/es/components/Snackbar/Snackbar.d.ts +49 -0
- package/dist/es/components/Snackbar/Snackbar.js +258 -0
- package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.css +63 -0
- package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.d.ts +9 -0
- package/dist/es/components/Snackbar/SnackbarTimer/SnackbarTimer.js +79 -0
- package/dist/es/hooks/useResolution.d.ts +5 -0
- package/dist/es/hooks/useResolution.js +40 -0
- package/dist/es/hooks/useSwipe.d.ts +14 -0
- package/dist/es/hooks/useSwipe.js +112 -0
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +2 -0
- package/dist/lib/components/Snackbar/Snackbar.css +217 -0
- package/dist/lib/components/Snackbar/Snackbar.d.ts +49 -0
- package/dist/lib/components/Snackbar/Snackbar.js +286 -0
- package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.css +63 -0
- package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.d.ts +9 -0
- package/dist/lib/components/Snackbar/SnackbarTimer/SnackbarTimer.js +99 -0
- package/dist/lib/hooks/useResolution.d.ts +5 -0
- package/dist/lib/hooks/useResolution.js +58 -0
- package/dist/lib/hooks/useSwipe.d.ts +14 -0
- package/dist/lib/hooks/useSwipe.js +132 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +16 -0
- package/package.json +2 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
var RESOLUTIONS;
|
|
4
|
+
|
|
5
|
+
(function (RESOLUTIONS) {
|
|
6
|
+
RESOLUTIONS[RESOLUTIONS["MOBILE_END"] = 767] = "MOBILE_END";
|
|
7
|
+
})(RESOLUTIONS || (RESOLUTIONS = {}));
|
|
8
|
+
|
|
9
|
+
var _RESOLUTIONS = RESOLUTIONS,
|
|
10
|
+
MOBILE_END = _RESOLUTIONS.MOBILE_END;
|
|
11
|
+
var MEDIA_QUERIES = {
|
|
12
|
+
MAX_WIDTH_MOBILE_END: "(max-width: ".concat(MOBILE_END, "px)")
|
|
13
|
+
};
|
|
14
|
+
var MAX_WIDTH_MOBILE_END = MEDIA_QUERIES.MAX_WIDTH_MOBILE_END;
|
|
15
|
+
|
|
16
|
+
function useResolution() {
|
|
17
|
+
var _React$useState = React.useState(window.innerWidth <= MOBILE_END),
|
|
18
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
19
|
+
isMobile = _React$useState2[0],
|
|
20
|
+
setIsMobile = _React$useState2[1];
|
|
21
|
+
|
|
22
|
+
var handleMediaChange = function handleMediaChange(updateStateFn) {
|
|
23
|
+
return function (e) {
|
|
24
|
+
return updateStateFn(e.matches);
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var handleMaxWidthMobileEnd = handleMediaChange(setIsMobile);
|
|
29
|
+
React.useEffect(function () {
|
|
30
|
+
window.matchMedia(MAX_WIDTH_MOBILE_END).addEventListener('change', handleMaxWidthMobileEnd);
|
|
31
|
+
return function () {
|
|
32
|
+
window.matchMedia(MAX_WIDTH_MOBILE_END).removeEventListener('change', handleMaxWidthMobileEnd);
|
|
33
|
+
};
|
|
34
|
+
}, [handleMaxWidthMobileEnd]);
|
|
35
|
+
return {
|
|
36
|
+
isMobile: isMobile
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default useResolution;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare enum TransitionSteps {
|
|
3
|
+
INITIAL_STEP = "initial-step",
|
|
4
|
+
MOVE_STEP = "move-step",
|
|
5
|
+
MOVE_END_STEP = "move-end-step"
|
|
6
|
+
}
|
|
7
|
+
declare type UseSwipeReturnType = {
|
|
8
|
+
/** Значение для css-свойства transform управляемого элемента */
|
|
9
|
+
transform: string;
|
|
10
|
+
/** Текущий этап смахивания элемента */
|
|
11
|
+
transitionStep: TransitionSteps;
|
|
12
|
+
};
|
|
13
|
+
declare function useSwipe(element: React.MutableRefObject<null>): UseSwipeReturnType;
|
|
14
|
+
export default useSwipe;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import useResolution from "./useResolution";
|
|
4
|
+
export var TransitionSteps;
|
|
5
|
+
|
|
6
|
+
(function (TransitionSteps) {
|
|
7
|
+
TransitionSteps["INITIAL_STEP"] = "initial-step";
|
|
8
|
+
TransitionSteps["MOVE_STEP"] = "move-step";
|
|
9
|
+
TransitionSteps["MOVE_END_STEP"] = "move-end-step";
|
|
10
|
+
})(TransitionSteps || (TransitionSteps = {})); // Смахивание элемента влево или вправо на мобильном устройстве.
|
|
11
|
+
// Элемент закрывается на событии 'touchend', если он был смещен пользователем больше, чем на половину ширины окна.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
function useSwipe(element) {
|
|
15
|
+
var _useResolution = useResolution(),
|
|
16
|
+
isMobile = _useResolution.isMobile;
|
|
17
|
+
|
|
18
|
+
var _React$useState = React.useState(null),
|
|
19
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
20
|
+
initialTouchPosition = _React$useState2[0],
|
|
21
|
+
setInitialTouchPosition = _React$useState2[1];
|
|
22
|
+
|
|
23
|
+
var _React$useState3 = React.useState(TransitionSteps.INITIAL_STEP),
|
|
24
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
25
|
+
transitionStep = _React$useState4[0],
|
|
26
|
+
setTransitionStep = _React$useState4[1];
|
|
27
|
+
|
|
28
|
+
var _React$useState5 = React.useState(''),
|
|
29
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
30
|
+
transform = _React$useState6[0],
|
|
31
|
+
setTransform = _React$useState6[1];
|
|
32
|
+
|
|
33
|
+
var animationFrameId = React.useRef(0);
|
|
34
|
+
var currentElement = element.current;
|
|
35
|
+
var isTransitionMoveStep = transitionStep === TransitionSteps.MOVE_STEP;
|
|
36
|
+
var handleWindowTouchMove = React.useCallback(function (e) {
|
|
37
|
+
if (animationFrameId) {
|
|
38
|
+
window.cancelAnimationFrame(animationFrameId.current);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
animationFrameId.current = window.requestAnimationFrame(function () {
|
|
42
|
+
setTransitionStep(TransitionSteps.MOVE_STEP);
|
|
43
|
+
|
|
44
|
+
if (!currentElement) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (!initialTouchPosition) {
|
|
49
|
+
setInitialTouchPosition(e.touches[0].clientX);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
var positionsDiff = initialTouchPosition - e.touches[0].clientX;
|
|
54
|
+
positionsDiff !== 0 && setTransform("translateX(".concat(-positionsDiff, "px)"));
|
|
55
|
+
animationFrameId.current = 0;
|
|
56
|
+
});
|
|
57
|
+
}, [currentElement, animationFrameId, initialTouchPosition]);
|
|
58
|
+
var handleWindowTouchEnd = React.useCallback(function (e) {
|
|
59
|
+
var _a;
|
|
60
|
+
|
|
61
|
+
if (!currentElement || !isTransitionMoveStep || !initialTouchPosition) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
window.cancelAnimationFrame(animationFrameId.current);
|
|
66
|
+
var windowCenterPosition = window.innerWidth / 2;
|
|
67
|
+
var touchPosition = (_a = e.changedTouches[0]) === null || _a === void 0 ? void 0 : _a.clientX;
|
|
68
|
+
var isRightSwipe = touchPosition > initialTouchPosition;
|
|
69
|
+
var isLeftSwipe = touchPosition < initialTouchPosition;
|
|
70
|
+
var isMoreHalfSwiped = Math.abs(initialTouchPosition - touchPosition) > windowCenterPosition;
|
|
71
|
+
setInitialTouchPosition(null);
|
|
72
|
+
|
|
73
|
+
switch (true) {
|
|
74
|
+
case isMoreHalfSwiped && isRightSwipe:
|
|
75
|
+
{
|
|
76
|
+
setTransform('translateX(110%)');
|
|
77
|
+
setTransitionStep(TransitionSteps.MOVE_END_STEP);
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
case isMoreHalfSwiped && isLeftSwipe:
|
|
82
|
+
{
|
|
83
|
+
setTransform('translateX(-110%)');
|
|
84
|
+
setTransitionStep(TransitionSteps.MOVE_END_STEP);
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
default:
|
|
89
|
+
{
|
|
90
|
+
setTransform('none');
|
|
91
|
+
setTransitionStep(TransitionSteps.INITIAL_STEP);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, [currentElement, isTransitionMoveStep, initialTouchPosition, animationFrameId]);
|
|
95
|
+
React.useEffect(function () {
|
|
96
|
+
if (isMobile) {
|
|
97
|
+
window.addEventListener('touchmove', handleWindowTouchMove);
|
|
98
|
+
window.addEventListener('touchend', handleWindowTouchEnd);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return function () {
|
|
102
|
+
window.removeEventListener('touchmove', handleWindowTouchMove);
|
|
103
|
+
window.removeEventListener('touchend', handleWindowTouchEnd);
|
|
104
|
+
};
|
|
105
|
+
}, [isMobile, handleWindowTouchMove, handleWindowTouchEnd]);
|
|
106
|
+
return {
|
|
107
|
+
transform: transform,
|
|
108
|
+
transitionStep: transitionStep
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default useSwipe;
|
package/dist/es/index.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export { default as RadioButton } from './components/RadioButton/RadioButton';
|
|
|
36
36
|
export { default as Search } from './components/Search/Search';
|
|
37
37
|
export { default as Select } from './components/Select/Select';
|
|
38
38
|
export { default as selectReducer } from './components/Select/reducer/selectReducer';
|
|
39
|
+
export { default as Snackbar } from './components/Snackbar/Snackbar';
|
|
40
|
+
export { default as SnackbarTimer } from './components/Snackbar/SnackbarTimer/SnackbarTimer';
|
|
39
41
|
export { default as Switcher } from './components/Switcher/Switcher';
|
|
40
42
|
export { default as Tab } from './components/Tabs/Tab';
|
|
41
43
|
export { default as Tabs } from './components/Tabs/Tabs';
|
package/dist/es/index.js
CHANGED
|
@@ -36,6 +36,8 @@ export { default as RadioButton } from "./components/RadioButton/RadioButton";
|
|
|
36
36
|
export { default as Search } from "./components/Search/Search";
|
|
37
37
|
export { default as Select } from "./components/Select/Select";
|
|
38
38
|
export { default as selectReducer } from "./components/Select/reducer/selectReducer";
|
|
39
|
+
export { default as Snackbar } from "./components/Snackbar/Snackbar";
|
|
40
|
+
export { default as SnackbarTimer } from "./components/Snackbar/SnackbarTimer/SnackbarTimer";
|
|
39
41
|
export { default as Switcher } from "./components/Switcher/Switcher";
|
|
40
42
|
export { default as Tab } from "./components/Tabs/Tab";
|
|
41
43
|
export { default as Tabs } from "./components/Tabs/Tabs";
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
h1,
|
|
2
|
+
h2,
|
|
3
|
+
h3,
|
|
4
|
+
h4,
|
|
5
|
+
h5 {
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
.mfui-snackbar {
|
|
9
|
+
z-index: 1;
|
|
10
|
+
width: 480px;
|
|
11
|
+
-webkit-transition: -webkit-transform 300ms;
|
|
12
|
+
transition: -webkit-transform 300ms;
|
|
13
|
+
transition: transform 300ms;
|
|
14
|
+
transition: transform 300ms, -webkit-transform 300ms;
|
|
15
|
+
}
|
|
16
|
+
@-webkit-keyframes snackbar-show {
|
|
17
|
+
from {
|
|
18
|
+
-webkit-transform: scale(90%);
|
|
19
|
+
transform: scale(90%);
|
|
20
|
+
opacity: 0;
|
|
21
|
+
}
|
|
22
|
+
to {
|
|
23
|
+
-webkit-transform: scale(100%);
|
|
24
|
+
transform: scale(100%);
|
|
25
|
+
opacity: 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
@keyframes snackbar-show {
|
|
29
|
+
from {
|
|
30
|
+
-webkit-transform: scale(90%);
|
|
31
|
+
transform: scale(90%);
|
|
32
|
+
opacity: 0;
|
|
33
|
+
}
|
|
34
|
+
to {
|
|
35
|
+
-webkit-transform: scale(100%);
|
|
36
|
+
transform: scale(100%);
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
@-webkit-keyframes snackbar-hide {
|
|
41
|
+
0% {
|
|
42
|
+
-webkit-transform: scale(100%);
|
|
43
|
+
transform: scale(100%);
|
|
44
|
+
opacity: 1;
|
|
45
|
+
}
|
|
46
|
+
99% {
|
|
47
|
+
-webkit-transform: scale(90%);
|
|
48
|
+
transform: scale(90%);
|
|
49
|
+
opacity: 0;
|
|
50
|
+
}
|
|
51
|
+
100% {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
@keyframes snackbar-hide {
|
|
56
|
+
0% {
|
|
57
|
+
-webkit-transform: scale(100%);
|
|
58
|
+
transform: scale(100%);
|
|
59
|
+
opacity: 1;
|
|
60
|
+
}
|
|
61
|
+
99% {
|
|
62
|
+
-webkit-transform: scale(90%);
|
|
63
|
+
transform: scale(90%);
|
|
64
|
+
opacity: 0;
|
|
65
|
+
}
|
|
66
|
+
100% {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
@media screen and (max-width: 767px) {
|
|
71
|
+
.mfui-snackbar {
|
|
72
|
+
width: 304px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
.mfui-snackbar_move {
|
|
76
|
+
-webkit-transition: none;
|
|
77
|
+
transition: none;
|
|
78
|
+
}
|
|
79
|
+
.mfui-snackbar__tile {
|
|
80
|
+
display: -webkit-box;
|
|
81
|
+
display: -ms-flexbox;
|
|
82
|
+
display: flex;
|
|
83
|
+
-webkit-box-align: center;
|
|
84
|
+
-ms-flex-align: center;
|
|
85
|
+
align-items: center;
|
|
86
|
+
-webkit-box-pack: justify;
|
|
87
|
+
-ms-flex-pack: justify;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
min-height: 64px;
|
|
90
|
+
padding: 12px 16px 12px 12px;
|
|
91
|
+
background-color: var(--content);
|
|
92
|
+
opacity: 0;
|
|
93
|
+
-webkit-animation: 200ms linear 200ms 1 forwards snackbar-show;
|
|
94
|
+
animation: 200ms linear 200ms 1 forwards snackbar-show;
|
|
95
|
+
}
|
|
96
|
+
@media screen and (max-width: 767px) {
|
|
97
|
+
.mfui-snackbar__tile {
|
|
98
|
+
min-height: 48px;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
.mfui-snackbar__tile_closed {
|
|
102
|
+
-webkit-animation: 100ms linear 1 snackbar-hide;
|
|
103
|
+
animation: 100ms linear 1 snackbar-hide;
|
|
104
|
+
}
|
|
105
|
+
.mfui-snackbar__tile_type_success .mfui-snackbar__icon-container svg {
|
|
106
|
+
fill: var(--brandGreen);
|
|
107
|
+
}
|
|
108
|
+
.mfui-snackbar__tile_type_attention .mfui-snackbar__icon-container svg {
|
|
109
|
+
fill: var(--fury80);
|
|
110
|
+
}
|
|
111
|
+
.mfui-snackbar__icon-container {
|
|
112
|
+
display: -webkit-box;
|
|
113
|
+
display: -ms-flexbox;
|
|
114
|
+
display: flex;
|
|
115
|
+
-webkit-box-align: center;
|
|
116
|
+
-ms-flex-align: center;
|
|
117
|
+
align-items: center;
|
|
118
|
+
-webkit-box-pack: center;
|
|
119
|
+
-ms-flex-pack: center;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
width: 32px;
|
|
122
|
+
min-width: 32px;
|
|
123
|
+
height: 32px;
|
|
124
|
+
margin-right: 8px;
|
|
125
|
+
}
|
|
126
|
+
.mfui-snackbar__icon-container svg {
|
|
127
|
+
fill: var(--base);
|
|
128
|
+
}
|
|
129
|
+
@media screen and (max-width: 767px) {
|
|
130
|
+
.mfui-snackbar__icon-container {
|
|
131
|
+
width: 20px;
|
|
132
|
+
min-width: 20px;
|
|
133
|
+
height: 20px;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
.mfui-snackbar__icon-container_desktop {
|
|
137
|
+
display: none;
|
|
138
|
+
}
|
|
139
|
+
@media screen and (min-width: 768px) {
|
|
140
|
+
.mfui-snackbar__icon-container_desktop {
|
|
141
|
+
display: block;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
.mfui-snackbar__icon-container_mobile {
|
|
145
|
+
display: none;
|
|
146
|
+
}
|
|
147
|
+
@media screen and (max-width: 767px) {
|
|
148
|
+
.mfui-snackbar__icon-container_mobile {
|
|
149
|
+
display: block;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
.mfui-snackbar__text {
|
|
153
|
+
display: none;
|
|
154
|
+
-webkit-box-flex: 1;
|
|
155
|
+
-ms-flex-positive: 1;
|
|
156
|
+
flex-grow: 1;
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
}
|
|
159
|
+
@media screen and (min-width: 768px) {
|
|
160
|
+
.mfui-snackbar__text_desktop {
|
|
161
|
+
display: block;
|
|
162
|
+
max-height: 48px;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
@media screen and (max-width: 767px) {
|
|
166
|
+
.mfui-snackbar__text_mobile {
|
|
167
|
+
display: block;
|
|
168
|
+
max-height: 36px;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
.mfui-snackbar__text_short {
|
|
172
|
+
max-width: 272px;
|
|
173
|
+
}
|
|
174
|
+
.mfui-snackbar__text-button {
|
|
175
|
+
min-width: -webkit-min-content;
|
|
176
|
+
min-width: -moz-min-content;
|
|
177
|
+
min-width: min-content;
|
|
178
|
+
margin-left: 12px;
|
|
179
|
+
}
|
|
180
|
+
.mfui-snackbar__close-button {
|
|
181
|
+
display: -webkit-box;
|
|
182
|
+
display: -ms-flexbox;
|
|
183
|
+
display: flex;
|
|
184
|
+
-webkit-box-align: center;
|
|
185
|
+
-ms-flex-align: center;
|
|
186
|
+
align-items: center;
|
|
187
|
+
-webkit-box-pack: center;
|
|
188
|
+
-ms-flex-pack: center;
|
|
189
|
+
justify-content: center;
|
|
190
|
+
-webkit-box-sizing: border-box;
|
|
191
|
+
box-sizing: border-box;
|
|
192
|
+
width: 32px;
|
|
193
|
+
height: 32px;
|
|
194
|
+
margin-left: 24px;
|
|
195
|
+
padding: 0;
|
|
196
|
+
border: none;
|
|
197
|
+
border-radius: 40px;
|
|
198
|
+
background-color: transparent;
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
}
|
|
201
|
+
@media screen and (max-width: 767px) {
|
|
202
|
+
.mfui-snackbar__close-button {
|
|
203
|
+
display: none;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
.mfui-snackbar__close-button:hover {
|
|
207
|
+
background-color: #99999933;
|
|
208
|
+
}
|
|
209
|
+
.mfui-snackbar__close-button:active {
|
|
210
|
+
background-color: #99999966;
|
|
211
|
+
}
|
|
212
|
+
.mfui-snackbar__close-button-icon {
|
|
213
|
+
width: 40px;
|
|
214
|
+
min-width: 40px;
|
|
215
|
+
height: 40px;
|
|
216
|
+
fill: var(--spbSky3);
|
|
217
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Snackbar.less';
|
|
3
|
+
export declare const SnackbarTypes: {
|
|
4
|
+
readonly ATTENTION: "attention";
|
|
5
|
+
readonly SUCCESS: "success";
|
|
6
|
+
readonly TIMER: "timer";
|
|
7
|
+
readonly INFO: "info";
|
|
8
|
+
};
|
|
9
|
+
export declare type SnackbarType = typeof SnackbarTypes[keyof typeof SnackbarTypes];
|
|
10
|
+
export interface ISnackbarProps {
|
|
11
|
+
/** Текст */
|
|
12
|
+
text: string;
|
|
13
|
+
/** Тип отображения */
|
|
14
|
+
type?: SnackbarType;
|
|
15
|
+
/** Кастомная иконка для типа 'info' */
|
|
16
|
+
icon?: JSX.Element;
|
|
17
|
+
/** Отображение иконки. Скрыть иконку можно только для типа 'info' */
|
|
18
|
+
hasIcon?: boolean;
|
|
19
|
+
/** Кастомный текст кнопки. Не работает для типа 'timer' */
|
|
20
|
+
buttonText?: string;
|
|
21
|
+
/** Максимальное значение таймера */
|
|
22
|
+
maxTimerValue?: number;
|
|
23
|
+
/** Отображение текстовой кнопки */
|
|
24
|
+
hasTextButton?: boolean;
|
|
25
|
+
/** Отключение анимации закрытия */
|
|
26
|
+
disableCloseAnimation?: boolean;
|
|
27
|
+
/** Дополнительный класс корневого элемента */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Дополнительные классы для корневого и внутренних элементов */
|
|
30
|
+
classes?: {
|
|
31
|
+
root?: string;
|
|
32
|
+
container?: string;
|
|
33
|
+
icon?: string;
|
|
34
|
+
text?: string;
|
|
35
|
+
};
|
|
36
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
37
|
+
dataAttrs?: {
|
|
38
|
+
root?: Record<string, string>;
|
|
39
|
+
text?: Record<string, string>;
|
|
40
|
+
closeButton?: Record<string, string>;
|
|
41
|
+
textButton?: Record<string, string>;
|
|
42
|
+
};
|
|
43
|
+
/** Обработчик клика по кнопке */
|
|
44
|
+
onButtonClick?: () => void;
|
|
45
|
+
/** Обработчик на закрытие */
|
|
46
|
+
onClose?: () => void;
|
|
47
|
+
}
|
|
48
|
+
declare const Snackbar: React.FC<ISnackbarProps>;
|
|
49
|
+
export default Snackbar;
|