@megafon/ui-core 4.7.0 → 4.8.1
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 +30 -0
- package/dist/es/components/Accordion/Accordion.css +1 -0
- package/dist/es/components/Button/Button.d.ts +2 -0
- package/dist/es/components/Button/Button.js +7 -5
- package/dist/es/components/Notification/Notification.d.ts +4 -0
- package/dist/es/components/Notification/Notification.js +7 -1
- package/dist/es/components/Search/Search.css +27 -9
- package/dist/es/components/Search/Search.js +2 -1
- package/dist/es/components/Select/Select.css +2 -0
- package/dist/es/components/Tabs/Tabs.js +2 -1
- package/dist/es/components/TextField/TextField.css +4 -0
- package/dist/es/components/Tile/Tile.css +22 -6
- package/dist/es/components/Tile/Tile.d.ts +9 -5
- package/dist/es/components/Tile/Tile.js +11 -4
- package/dist/es/components/Tooltip/Tooltip.css +242 -71
- package/dist/es/components/Tooltip/Tooltip.d.ts +38 -0
- package/dist/es/components/Tooltip/Tooltip.js +162 -49
- package/dist/lib/components/Accordion/Accordion.css +1 -0
- package/dist/lib/components/Button/Button.d.ts +2 -0
- package/dist/lib/components/Button/Button.js +7 -5
- package/dist/lib/components/Notification/Notification.d.ts +4 -0
- package/dist/lib/components/Notification/Notification.js +7 -1
- package/dist/lib/components/Search/Search.css +27 -9
- package/dist/lib/components/Search/Search.js +2 -1
- package/dist/lib/components/Select/Select.css +2 -0
- package/dist/lib/components/Tabs/Tabs.js +2 -1
- package/dist/lib/components/TextField/TextField.css +4 -0
- package/dist/lib/components/Tile/Tile.css +22 -6
- package/dist/lib/components/Tile/Tile.d.ts +9 -5
- package/dist/lib/components/Tile/Tile.js +13 -6
- package/dist/lib/components/Tooltip/Tooltip.css +242 -71
- package/dist/lib/components/Tooltip/Tooltip.d.ts +38 -0
- package/dist/lib/components/Tooltip/Tooltip.js +168 -52
- package/package.json +2 -2
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
transition-duration: 0.3s;
|
|
7
7
|
-webkit-transition-property: opacity, visibility;
|
|
8
8
|
transition-property: opacity, visibility;
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
line-height: 18px;
|
|
9
11
|
pointer-events: none;
|
|
10
12
|
}
|
|
11
13
|
.mfui-tooltip_open {
|
|
@@ -14,7 +16,7 @@
|
|
|
14
16
|
pointer-events: all;
|
|
15
17
|
}
|
|
16
18
|
.mfui-tooltip_paddings_small .mfui-tooltip__content {
|
|
17
|
-
padding:
|
|
19
|
+
padding: 16px;
|
|
18
20
|
}
|
|
19
21
|
.mfui-tooltip_paddings_medium .mfui-tooltip__content {
|
|
20
22
|
padding: 24px;
|
|
@@ -22,102 +24,271 @@
|
|
|
22
24
|
.mfui-tooltip__content {
|
|
23
25
|
position: relative;
|
|
24
26
|
z-index: 1;
|
|
27
|
+
display: -webkit-box;
|
|
28
|
+
display: -ms-flexbox;
|
|
29
|
+
display: flex;
|
|
30
|
+
-webkit-box-orient: vertical;
|
|
31
|
+
-webkit-box-direction: normal;
|
|
32
|
+
-ms-flex-direction: column;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: 8px;
|
|
25
35
|
}
|
|
26
36
|
.mfui-tooltip__content-shadow {
|
|
27
37
|
position: absolute;
|
|
38
|
+
top: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
bottom: 0;
|
|
41
|
+
left: 0;
|
|
28
42
|
z-index: -1;
|
|
29
43
|
}
|
|
30
|
-
.mfui-tooltip__arrow {
|
|
31
|
-
width: 12px;
|
|
32
|
-
height: 12px;
|
|
44
|
+
.mfui-tooltip__arrow-container {
|
|
33
45
|
position: absolute;
|
|
34
46
|
}
|
|
35
|
-
.mfui-tooltip__arrow
|
|
36
|
-
width:
|
|
47
|
+
.mfui-tooltip__arrow-wrap {
|
|
48
|
+
width: 42px;
|
|
37
49
|
height: 12px;
|
|
38
|
-
content: '';
|
|
39
|
-
position: absolute;
|
|
40
|
-
top: 0;
|
|
41
|
-
left: 0;
|
|
42
|
-
-webkit-transform: rotate(45deg);
|
|
43
|
-
transform: rotate(45deg);
|
|
44
|
-
background-color: var(--base);
|
|
45
50
|
}
|
|
46
|
-
.mfui-tooltip__arrow
|
|
47
|
-
width:
|
|
51
|
+
.mfui-tooltip__arrow {
|
|
52
|
+
width: 42px;
|
|
48
53
|
height: 12px;
|
|
49
54
|
position: absolute;
|
|
50
|
-
z-index: -1;
|
|
51
55
|
}
|
|
52
|
-
.mfui-tooltip__arrow-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
.mfui-tooltip__arrow-inner {
|
|
57
|
+
-webkit-filter: drop-shadow(0 2px 9px rgba(0, 0, 0, 0.15));
|
|
58
|
+
filter: drop-shadow(0 2px 9px rgba(0, 0, 0, 0.15));
|
|
59
|
+
fill: var(--base);
|
|
60
|
+
}
|
|
61
|
+
.mfui-tooltip__text {
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
line-height: 18px;
|
|
64
|
+
}
|
|
65
|
+
.mfui-tooltip__button,
|
|
66
|
+
.mfui-tooltip__close-button {
|
|
67
|
+
display: -webkit-box;
|
|
68
|
+
display: -ms-flexbox;
|
|
69
|
+
display: flex;
|
|
70
|
+
-webkit-box-align: center;
|
|
71
|
+
-ms-flex-align: center;
|
|
72
|
+
align-items: center;
|
|
73
|
+
-webkit-box-sizing: border-box;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
padding: 0;
|
|
76
|
+
border: none;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
}
|
|
79
|
+
.mfui-tooltip__button {
|
|
80
|
+
font-family: inherit;
|
|
81
|
+
color: var(--brandGreen);
|
|
82
|
+
font-weight: 500;
|
|
83
|
+
font-size: 12px;
|
|
84
|
+
line-height: 14px;
|
|
85
|
+
background-color: transparent;
|
|
86
|
+
-webkit-transition: 300ms;
|
|
87
|
+
transition: 300ms;
|
|
88
|
+
}
|
|
89
|
+
.mfui-tooltip__button:hover {
|
|
90
|
+
color: var(--buttonHoverGreen);
|
|
91
|
+
}
|
|
92
|
+
.mfui-tooltip__button:hover .mfui-tooltip__button-arrow {
|
|
93
|
+
fill: var(--buttonHoverGreen);
|
|
94
|
+
}
|
|
95
|
+
.mfui-tooltip__button:active {
|
|
96
|
+
color: var(--buttonDown);
|
|
97
|
+
}
|
|
98
|
+
.mfui-tooltip__button:active .mfui-tooltip__button-arrow {
|
|
99
|
+
fill: var(--buttonDown);
|
|
100
|
+
}
|
|
101
|
+
.mfui-tooltip__close-button {
|
|
56
102
|
position: absolute;
|
|
57
|
-
top:
|
|
58
|
-
|
|
59
|
-
-webkit-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
103
|
+
top: 10px;
|
|
104
|
+
right: 10px;
|
|
105
|
+
-webkit-box-pack: center;
|
|
106
|
+
-ms-flex-pack: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
width: 24px;
|
|
109
|
+
height: 24px;
|
|
110
|
+
margin-left: 24px;
|
|
111
|
+
border-radius: 12px;
|
|
112
|
+
background-color: var(--spbSky0);
|
|
113
|
+
-webkit-transition: 300ms;
|
|
114
|
+
transition: 300ms;
|
|
63
115
|
}
|
|
64
|
-
.mfui-
|
|
65
|
-
|
|
66
|
-
right: calc(100% - 20px);
|
|
116
|
+
.mfui-tooltip__close-button:hover {
|
|
117
|
+
background-color: var(--spbSky1);
|
|
67
118
|
}
|
|
68
|
-
.mfui-
|
|
69
|
-
-
|
|
70
|
-
transform: translateX(14px);
|
|
119
|
+
.mfui-tooltip__close-button:active {
|
|
120
|
+
background-color: var(--spbSky2);
|
|
71
121
|
}
|
|
72
|
-
.mfui-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
122
|
+
.mfui-tooltip__close-icon {
|
|
123
|
+
display: block;
|
|
124
|
+
width: 20px;
|
|
125
|
+
height: 20px;
|
|
126
|
+
opacity: 0.5;
|
|
127
|
+
fill: var(--content);
|
|
77
128
|
}
|
|
78
|
-
.mfui-
|
|
79
|
-
|
|
80
|
-
|
|
129
|
+
.mfui-tooltip__button-arrow {
|
|
130
|
+
width: 20px;
|
|
131
|
+
min-width: 20px;
|
|
132
|
+
height: 20px;
|
|
133
|
+
margin-bottom: -2px;
|
|
134
|
+
-webkit-transition: 300ms;
|
|
135
|
+
transition: 300ms;
|
|
136
|
+
fill: var(--brandGreen);
|
|
81
137
|
}
|
|
82
|
-
.mfui-
|
|
83
|
-
-webkit-
|
|
84
|
-
|
|
138
|
+
.mfui-tooltip_small .mfui-tooltip__content {
|
|
139
|
+
display: -webkit-box;
|
|
140
|
+
display: -ms-flexbox;
|
|
141
|
+
display: flex;
|
|
142
|
+
-webkit-box-orient: horizontal;
|
|
143
|
+
-webkit-box-direction: normal;
|
|
144
|
+
-ms-flex-direction: row;
|
|
145
|
+
flex-direction: row;
|
|
146
|
+
gap: 18px;
|
|
147
|
+
-webkit-box-align: center;
|
|
148
|
+
-ms-flex-align: center;
|
|
149
|
+
align-items: center;
|
|
85
150
|
}
|
|
86
|
-
.mfui-
|
|
87
|
-
|
|
88
|
-
right: 14px;
|
|
89
|
-
bottom: 0;
|
|
90
|
-
left: -14px;
|
|
151
|
+
.mfui-tooltip_small .mfui-tooltip__text {
|
|
152
|
+
font-weight: 500;
|
|
91
153
|
}
|
|
92
|
-
.mfui-
|
|
93
|
-
|
|
94
|
-
|
|
154
|
+
.mfui-tooltip_small .mfui-tooltip__close-button {
|
|
155
|
+
position: static;
|
|
156
|
+
margin-left: 0;
|
|
95
157
|
}
|
|
96
|
-
.mfui-
|
|
97
|
-
|
|
98
|
-
|
|
158
|
+
.mfui-tooltip_theme_red .mfui-tooltip__content,
|
|
159
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__content,
|
|
160
|
+
.mfui-tooltip_theme_red .mfui-tooltip__arrow:before,
|
|
161
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__arrow:before,
|
|
162
|
+
.mfui-tooltip_theme_red .mfui-tooltip__title,
|
|
163
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__title,
|
|
164
|
+
.mfui-tooltip_theme_red .mfui-tooltip__button,
|
|
165
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__button {
|
|
166
|
+
color: var(--stcWhite);
|
|
99
167
|
}
|
|
100
|
-
.mfui-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
bottom: 14px;
|
|
104
|
-
left: 0;
|
|
168
|
+
.mfui-tooltip_theme_red .mfui-tooltip__button-arrow,
|
|
169
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__button-arrow {
|
|
170
|
+
fill: var(--stcWhite);
|
|
105
171
|
}
|
|
106
|
-
.mfui-
|
|
107
|
-
.mfui-
|
|
108
|
-
|
|
172
|
+
.mfui-tooltip_theme_red .mfui-tooltip__button:hover,
|
|
173
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__button:hover {
|
|
174
|
+
color: var(--buttonHoverGrey);
|
|
109
175
|
}
|
|
110
|
-
.mfui-
|
|
111
|
-
|
|
112
|
-
|
|
176
|
+
.mfui-tooltip_theme_red .mfui-tooltip__button:hover .mfui-tooltip__button-arrow,
|
|
177
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__button:hover .mfui-tooltip__button-arrow {
|
|
178
|
+
fill: var(--buttonHoverGrey);
|
|
113
179
|
}
|
|
114
|
-
.mfui-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
180
|
+
.mfui-tooltip_theme_red .mfui-tooltip__button:active,
|
|
181
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__button:active {
|
|
182
|
+
color: var(--buttonDown);
|
|
183
|
+
}
|
|
184
|
+
.mfui-tooltip_theme_red .mfui-tooltip__button:active .mfui-tooltip__button-arrow,
|
|
185
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__button:active .mfui-tooltip__button-arrow {
|
|
186
|
+
fill: var(--buttonDown);
|
|
187
|
+
}
|
|
188
|
+
.mfui-tooltip_theme_red .mfui-tooltip__close-button,
|
|
189
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__close-button {
|
|
190
|
+
background-color: var(--stcWhite10);
|
|
191
|
+
}
|
|
192
|
+
.mfui-tooltip_theme_red .mfui-tooltip__close-button:hover,
|
|
193
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__close-button:hover {
|
|
194
|
+
background-color: var(--stcWhite20);
|
|
195
|
+
}
|
|
196
|
+
.mfui-tooltip_theme_red .mfui-tooltip__close-button:active,
|
|
197
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__close-button:active {
|
|
198
|
+
background-color: var(--stcWhite50);
|
|
199
|
+
}
|
|
200
|
+
.mfui-tooltip_theme_red .mfui-tooltip__close-icon,
|
|
201
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__close-icon {
|
|
202
|
+
opacity: 1;
|
|
203
|
+
fill: var(--stcWhite);
|
|
204
|
+
}
|
|
205
|
+
.mfui-tooltip_theme_red .mfui-tooltip__content,
|
|
206
|
+
.mfui-tooltip_theme_red .mfui-tooltip__content-shadow,
|
|
207
|
+
.mfui-tooltip_theme_red .mfui-tooltip__arrow:before {
|
|
208
|
+
background-color: var(--fury80);
|
|
209
|
+
}
|
|
210
|
+
.mfui-tooltip_theme_red .mfui-tooltip__arrow-inner {
|
|
211
|
+
fill: var(--fury80);
|
|
212
|
+
}
|
|
213
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__content,
|
|
214
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__content-shadow,
|
|
215
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__arrow:before {
|
|
216
|
+
background-color: var(--reflexBlue80);
|
|
217
|
+
}
|
|
218
|
+
.mfui-tooltip_theme_blue .mfui-tooltip__arrow-inner {
|
|
219
|
+
fill: var(--reflexBlue80);
|
|
220
|
+
}
|
|
221
|
+
.mfui-tooltip[data-popper-placement='right'] .mfui-tooltip__arrow-container,
|
|
222
|
+
.mfui-tooltip[data-popper-placement='right-start'] .mfui-tooltip__arrow-container,
|
|
223
|
+
.mfui-tooltip[data-popper-placement='right-end'] .mfui-tooltip__arrow-container {
|
|
224
|
+
left: -12px;
|
|
225
|
+
width: 12px;
|
|
226
|
+
height: 100%;
|
|
227
|
+
}
|
|
228
|
+
.mfui-tooltip[data-popper-placement='right'] .mfui-tooltip__arrow-wrap,
|
|
229
|
+
.mfui-tooltip[data-popper-placement='right-start'] .mfui-tooltip__arrow-wrap,
|
|
230
|
+
.mfui-tooltip[data-popper-placement='right-end'] .mfui-tooltip__arrow-wrap {
|
|
231
|
+
left: -15px;
|
|
232
|
+
}
|
|
233
|
+
.mfui-tooltip[data-popper-placement='right'] .mfui-tooltip__arrow,
|
|
234
|
+
.mfui-tooltip[data-popper-placement='right-start'] .mfui-tooltip__arrow,
|
|
235
|
+
.mfui-tooltip[data-popper-placement='right-end'] .mfui-tooltip__arrow,
|
|
236
|
+
.mfui-tooltip[data-popper-placement='right'] .mfui-tooltip__arrow-shadow,
|
|
237
|
+
.mfui-tooltip[data-popper-placement='right-start'] .mfui-tooltip__arrow-shadow,
|
|
238
|
+
.mfui-tooltip[data-popper-placement='right-end'] .mfui-tooltip__arrow-shadow {
|
|
239
|
+
-webkit-transform: rotate(-90deg);
|
|
240
|
+
transform: rotate(-90deg);
|
|
241
|
+
}
|
|
242
|
+
.mfui-tooltip[data-popper-placement='left'] .mfui-tooltip__arrow-container,
|
|
243
|
+
.mfui-tooltip[data-popper-placement='left-start'] .mfui-tooltip__arrow-container,
|
|
244
|
+
.mfui-tooltip[data-popper-placement='left-end'] .mfui-tooltip__arrow-container {
|
|
245
|
+
right: -12px;
|
|
246
|
+
width: 12px;
|
|
247
|
+
height: 100%;
|
|
248
|
+
}
|
|
249
|
+
.mfui-tooltip[data-popper-placement='left'] .mfui-tooltip__arrow-wrap,
|
|
250
|
+
.mfui-tooltip[data-popper-placement='left-start'] .mfui-tooltip__arrow-wrap,
|
|
251
|
+
.mfui-tooltip[data-popper-placement='left-end'] .mfui-tooltip__arrow-wrap {
|
|
252
|
+
right: -15px;
|
|
253
|
+
}
|
|
254
|
+
.mfui-tooltip[data-popper-placement='left'] .mfui-tooltip__arrow,
|
|
255
|
+
.mfui-tooltip[data-popper-placement='left-start'] .mfui-tooltip__arrow,
|
|
256
|
+
.mfui-tooltip[data-popper-placement='left-end'] .mfui-tooltip__arrow,
|
|
257
|
+
.mfui-tooltip[data-popper-placement='left'] .mfui-tooltip__arrow-shadow,
|
|
258
|
+
.mfui-tooltip[data-popper-placement='left-start'] .mfui-tooltip__arrow-shadow,
|
|
259
|
+
.mfui-tooltip[data-popper-placement='left-end'] .mfui-tooltip__arrow-shadow {
|
|
260
|
+
-webkit-transform: rotate(90deg);
|
|
261
|
+
transform: rotate(90deg);
|
|
262
|
+
}
|
|
263
|
+
.mfui-tooltip[data-popper-placement='top'] .mfui-tooltip__arrow-container,
|
|
264
|
+
.mfui-tooltip[data-popper-placement='top-start'] .mfui-tooltip__arrow-container,
|
|
265
|
+
.mfui-tooltip[data-popper-placement='top-end'] .mfui-tooltip__arrow-container {
|
|
266
|
+
bottom: -12px;
|
|
267
|
+
width: 100%;
|
|
268
|
+
height: 12px;
|
|
269
|
+
}
|
|
270
|
+
.mfui-tooltip[data-popper-placement='top'] .mfui-tooltip__arrow-wrap,
|
|
271
|
+
.mfui-tooltip[data-popper-placement='top-start'] .mfui-tooltip__arrow-wrap,
|
|
272
|
+
.mfui-tooltip[data-popper-placement='top-end'] .mfui-tooltip__arrow-wrap {
|
|
273
|
+
top: 0;
|
|
274
|
+
}
|
|
275
|
+
.mfui-tooltip[data-popper-placement='top'] .mfui-tooltip__arrow,
|
|
276
|
+
.mfui-tooltip[data-popper-placement='top-start'] .mfui-tooltip__arrow,
|
|
277
|
+
.mfui-tooltip[data-popper-placement='top-end'] .mfui-tooltip__arrow,
|
|
278
|
+
.mfui-tooltip[data-popper-placement='top'] .mfui-tooltip__arrow-shadow,
|
|
279
|
+
.mfui-tooltip[data-popper-placement='top-start'] .mfui-tooltip__arrow-shadow,
|
|
280
|
+
.mfui-tooltip[data-popper-placement='top-end'] .mfui-tooltip__arrow-shadow {
|
|
281
|
+
-webkit-transform: rotate(180deg);
|
|
282
|
+
transform: rotate(180deg);
|
|
283
|
+
}
|
|
284
|
+
.mfui-tooltip[data-popper-placement='bottom'] .mfui-tooltip__arrow-container,
|
|
285
|
+
.mfui-tooltip[data-popper-placement='bottom-start'] .mfui-tooltip__arrow-container,
|
|
286
|
+
.mfui-tooltip[data-popper-placement='bottom-end'] .mfui-tooltip__arrow-container {
|
|
287
|
+
top: -12px;
|
|
288
|
+
width: 100%;
|
|
289
|
+
height: 12px;
|
|
119
290
|
}
|
|
120
|
-
.mfui-tooltip[data-popper-escaped='true'] {
|
|
291
|
+
.mfui-tooltip[data-popper-escaped='true'].mfui-tooltip_has-escape {
|
|
121
292
|
visibility: hidden;
|
|
122
293
|
pointer-events: none;
|
|
123
294
|
}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AccessibilityEventType } from '@megafon/ui-helpers';
|
|
2
3
|
import type { AccessibilityEventTypeNative } from '@megafon/ui-helpers';
|
|
3
4
|
import './Tooltip.less';
|
|
4
5
|
export declare const Placement: {
|
|
5
6
|
readonly LEFT: "left";
|
|
7
|
+
readonly LEFT_START: "left-start";
|
|
8
|
+
readonly LEFT_END: "left-end";
|
|
6
9
|
readonly TOP: "top";
|
|
10
|
+
readonly TOP_START: "top-start";
|
|
11
|
+
readonly TOP_END: "top-end";
|
|
7
12
|
readonly RIGHT: "right";
|
|
13
|
+
readonly RIGHT_START: "right-start";
|
|
14
|
+
readonly RIGHT_END: "right-end";
|
|
8
15
|
readonly BOTTOM: "bottom";
|
|
16
|
+
readonly BOTTOM_START: "bottom-start";
|
|
17
|
+
readonly BOTTOM_END: "bottom-end";
|
|
9
18
|
};
|
|
10
19
|
declare type PlacementType = typeof Placement[keyof typeof Placement];
|
|
11
20
|
export declare const Paddings: {
|
|
@@ -20,7 +29,30 @@ export declare const TriggerEvent: {
|
|
|
20
29
|
readonly CONTROLLED: "controlled";
|
|
21
30
|
};
|
|
22
31
|
declare type TriggerEventType = typeof TriggerEvent[keyof typeof TriggerEvent];
|
|
32
|
+
export declare const ColorTheme: {
|
|
33
|
+
readonly WHITE: "white";
|
|
34
|
+
readonly BLUE: "blue";
|
|
35
|
+
readonly RED: "red";
|
|
36
|
+
};
|
|
37
|
+
declare type ColorThemeType = typeof ColorTheme[keyof typeof ColorTheme];
|
|
38
|
+
export declare const Size: {
|
|
39
|
+
readonly SMALL: "small";
|
|
40
|
+
readonly BIG: "big";
|
|
41
|
+
};
|
|
42
|
+
declare type SizeType = typeof Size[keyof typeof Size];
|
|
23
43
|
export interface ITooltipProps {
|
|
44
|
+
/** Цветовая тема */
|
|
45
|
+
colorTheme?: ColorThemeType;
|
|
46
|
+
/** Размер тултипа */
|
|
47
|
+
size?: SizeType;
|
|
48
|
+
/** Заголовок */
|
|
49
|
+
title?: string;
|
|
50
|
+
/** Текст кнопки */
|
|
51
|
+
buttonText?: string;
|
|
52
|
+
/** Текст */
|
|
53
|
+
text?: string;
|
|
54
|
+
/** Наличие кнопки-крестика "Закрыть" */
|
|
55
|
+
hasCloseButton?: boolean;
|
|
24
56
|
/** Позиционирование относительно триггер-элемента */
|
|
25
57
|
placement?: PlacementType;
|
|
26
58
|
/** Направления перестроения тултипа при переполнении */
|
|
@@ -53,12 +85,18 @@ export interface ITooltipProps {
|
|
|
53
85
|
/** Дополнительные data атрибуты к внутренним элементам */
|
|
54
86
|
dataAttrs?: {
|
|
55
87
|
root?: Record<string, string>;
|
|
88
|
+
close?: Record<string, string>;
|
|
89
|
+
button?: Record<string, string>;
|
|
56
90
|
content?: Record<string, string>;
|
|
57
91
|
};
|
|
58
92
|
/** Обработчик на открытие */
|
|
59
93
|
onOpen?: (e: AccessibilityEventTypeNative) => void;
|
|
60
94
|
/** Обработчик на закрытие */
|
|
61
95
|
onClose?: (e: AccessibilityEventTypeNative | FocusEvent) => void;
|
|
96
|
+
/** Обработчик на клик по кнопке закрытия */
|
|
97
|
+
onCloseButtonClick?: (e: AccessibilityEventType) => void;
|
|
98
|
+
/** Обработчик клика по кнопке */
|
|
99
|
+
onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
|
62
100
|
}
|
|
63
101
|
declare const Tooltip: React.FC<ITooltipProps>;
|
|
64
102
|
export default Tooltip;
|