@oceanbase/design 0.2.25 → 0.2.27

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.
Files changed (78) hide show
  1. package/dist/design.min.js +1 -1
  2. package/es/_util/type.d.ts +4 -0
  3. package/es/_util/type.js +1 -0
  4. package/es/badge/index.d.ts +3 -4
  5. package/es/badge/index.js +7 -3
  6. package/es/button/index.d.ts +2 -4
  7. package/es/button/index.js +7 -5
  8. package/es/card/index.d.ts +2 -4
  9. package/es/card/index.js +7 -5
  10. package/es/config-provider/index.js +9 -11
  11. package/es/drawer/Drawer.d.ts +18 -0
  12. package/es/drawer/Drawer.js +69 -0
  13. package/es/drawer/index.d.ts +2 -0
  14. package/es/drawer/index.js +3 -1
  15. package/es/drawer/style/index.d.ts +9 -0
  16. package/es/drawer/style/index.js +31 -0
  17. package/es/index.d.ts +2 -1
  18. package/es/index.js +1 -0
  19. package/es/modal/style/index.js +3 -2
  20. package/es/select/index.d.ts +8 -2
  21. package/es/select/index.js +6 -6
  22. package/es/spin/index.js +1 -0
  23. package/es/static-function/index.d.ts +1 -1
  24. package/es/static-function/index.js +2 -2
  25. package/es/table/index.d.ts +17 -12
  26. package/es/table/index.js +19 -16
  27. package/es/tag/index.d.ts +2 -4
  28. package/es/tag/index.js +7 -5
  29. package/es/theme/dark.d.ts +56 -0
  30. package/es/theme/dark.js +10 -0
  31. package/es/theme/default.d.ts +94 -72
  32. package/es/theme/default.js +95 -72
  33. package/es/theme/index.d.ts +8 -13
  34. package/es/theme/index.js +15 -20
  35. package/es/theme/style/compact.less +211 -186
  36. package/es/theme/style/dark.less +194 -169
  37. package/es/theme/style/default.less +208 -183
  38. package/es/tooltip/index.d.ts +2 -2
  39. package/es/tooltip/index.js +3 -2
  40. package/lib/_util/type.d.ts +4 -0
  41. package/lib/_util/type.js +17 -0
  42. package/lib/badge/index.d.ts +3 -4
  43. package/lib/badge/index.js +56 -51
  44. package/lib/button/index.d.ts +2 -4
  45. package/lib/button/index.js +15 -10
  46. package/lib/card/index.d.ts +2 -4
  47. package/lib/card/index.js +40 -34
  48. package/lib/config-provider/index.js +8 -15
  49. package/lib/drawer/Drawer.d.ts +18 -0
  50. package/lib/drawer/Drawer.js +85 -0
  51. package/lib/drawer/index.d.ts +2 -0
  52. package/lib/drawer/index.js +19 -0
  53. package/lib/drawer/style/index.d.ts +9 -0
  54. package/lib/drawer/style/index.js +60 -0
  55. package/lib/index.d.ts +2 -1
  56. package/lib/index.js +3 -0
  57. package/lib/modal/style/index.js +3 -2
  58. package/lib/select/index.d.ts +8 -2
  59. package/lib/select/index.js +14 -10
  60. package/lib/spin/index.js +1 -0
  61. package/lib/static-function/index.d.ts +1 -1
  62. package/lib/static-function/index.js +1 -1
  63. package/lib/table/index.d.ts +17 -12
  64. package/lib/table/index.js +17 -14
  65. package/lib/tag/index.d.ts +2 -4
  66. package/lib/tag/index.js +25 -28
  67. package/lib/theme/dark.d.ts +56 -0
  68. package/lib/theme/dark.js +44 -0
  69. package/lib/theme/default.d.ts +94 -72
  70. package/lib/theme/default.js +94 -71
  71. package/lib/theme/index.d.ts +8 -13
  72. package/lib/theme/index.js +27 -21
  73. package/lib/theme/style/compact.less +211 -186
  74. package/lib/theme/style/dark.less +194 -169
  75. package/lib/theme/style/default.less +208 -183
  76. package/lib/tooltip/index.d.ts +2 -2
  77. package/lib/tooltip/index.js +83 -80
  78. package/package.json +6 -4
@@ -1,26 +1,27 @@
1
1
  @blue: #006aff;
2
- @purple: #722ed1;
3
- @cyan: #13c2c2;
2
+ @purple: #722ED1;
3
+ @cyan: #13C2C2;
4
4
  @green: #0ac185;
5
- @magenta: #eb2f96;
5
+ @magenta: #EB2F96;
6
6
  @pink: #eb2f96;
7
7
  @red: #ff4b4b;
8
- @orange: #fa8c16;
8
+ @orange: #FA8C16;
9
9
  @yellow: #ffac33;
10
- @volcano: #fa541c;
11
- @geekblue: #2f54eb;
12
- @gold: #faad14;
13
- @lime: #a0d911;
14
- @colorPrimary: #006aff;
10
+ @volcano: #FA541C;
11
+ @geekblue: #2F54EB;
12
+ @gold: #FAAD14;
13
+ @lime: #A0D911;
14
+ @colorPrimary: #006AFF;
15
15
  @colorSuccess: #0ac185;
16
16
  @colorWarning: #ffac33;
17
17
  @colorError: #ff4b4b;
18
18
  @colorInfo: #006aff;
19
+ @colorLink: #006aff;
19
20
  @colorTextBase: #132039;
20
21
  @colorBgBase: #ffffff;
21
22
  @fontFamily: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
22
- 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
23
- 'Noto Color Emoji';
23
+ 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
24
+ 'Noto Color Emoji';
24
25
  @fontFamilyCode: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
25
26
  @fontSize: 14;
26
27
  @lineWidth: 1;
@@ -45,26 +46,26 @@
45
46
  @opacityImage: 1;
46
47
  @wireframe: false;
47
48
  @motion: true;
48
- @blue-1: #e6fff2;
49
- @blue1: #e6fff2;
50
- @blue-2: #a9f5d1;
51
- @blue2: #a9f5d1;
52
- @blue-3: #7be8b9;
53
- @blue3: #7be8b9;
54
- @blue-4: #51dba4;
55
- @blue4: #51dba4;
56
- @blue-5: #2bcf93;
57
- @blue5: #2bcf93;
58
- @blue-6: #0ac185;
59
- @blue6: #0ac185;
60
- @blue-7: #009c6d;
61
- @blue7: #009c6d;
62
- @blue-8: #007556;
63
- @blue8: #007556;
64
- @blue-9: #004f3d;
65
- @blue9: #004f3d;
66
- @blue-10: #002921;
67
- @blue10: #002921;
49
+ @blue-1: #e6f4ff;
50
+ @blue1: #e6f4ff;
51
+ @blue-2: #bae0ff;
52
+ @blue2: #bae0ff;
53
+ @blue-3: #91caff;
54
+ @blue3: #91caff;
55
+ @blue-4: #69b1ff;
56
+ @blue4: #69b1ff;
57
+ @blue-5: #4096ff;
58
+ @blue5: #4096ff;
59
+ @blue-6: #1677ff;
60
+ @blue6: #1677ff;
61
+ @blue-7: #0958d9;
62
+ @blue7: #0958d9;
63
+ @blue-8: #003eb3;
64
+ @blue8: #003eb3;
65
+ @blue-9: #002c8c;
66
+ @blue9: #002c8c;
67
+ @blue-10: #001d66;
68
+ @blue10: #001d66;
68
69
  @purple-1: #f9f0ff;
69
70
  @purple1: #f9f0ff;
70
71
  @purple-2: #efdbff;
@@ -105,26 +106,26 @@
105
106
  @cyan9: #00474f;
106
107
  @cyan-10: #002329;
107
108
  @cyan10: #002329;
108
- @green-1: #fffbf0;
109
- @green1: #fffbf0;
110
- @green-2: #fff4d6;
111
- @green2: #fff4d6;
112
- @green-3: #ffe7ad;
113
- @green3: #ffe7ad;
114
- @green-4: #ffd685;
115
- @green4: #ffd685;
116
- @green-5: #ffc35c;
117
- @green5: #ffc35c;
118
- @green-6: #ffac33;
119
- @green6: #ffac33;
120
- @green-7: #d98921;
121
- @green7: #d98921;
122
- @green-8: #b36812;
123
- @green8: #b36812;
124
- @green-9: #8c4a07;
125
- @green9: #8c4a07;
126
- @green-10: #663204;
127
- @green10: #663204;
109
+ @green-1: #f6ffed;
110
+ @green1: #f6ffed;
111
+ @green-2: #d9f7be;
112
+ @green2: #d9f7be;
113
+ @green-3: #b7eb8f;
114
+ @green3: #b7eb8f;
115
+ @green-4: #95de64;
116
+ @green4: #95de64;
117
+ @green-5: #73d13d;
118
+ @green5: #73d13d;
119
+ @green-6: #52c41a;
120
+ @green6: #52c41a;
121
+ @green-7: #389e0d;
122
+ @green7: #389e0d;
123
+ @green-8: #237804;
124
+ @green8: #237804;
125
+ @green-9: #135200;
126
+ @green9: #135200;
127
+ @green-10: #092b00;
128
+ @green10: #092b00;
128
129
  @magenta-1: #fff0f6;
129
130
  @magenta1: #fff0f6;
130
131
  @magenta-2: #ffd6e7;
@@ -165,26 +166,26 @@
165
166
  @pink9: #780650;
166
167
  @pink-10: #520339;
167
168
  @pink10: #520339;
168
- @red-1: #e6f4ff;
169
- @red1: #e6f4ff;
170
- @red-2: #a3d6ff;
171
- @red2: #a3d6ff;
172
- @red-3: #7abfff;
173
- @red3: #7abfff;
174
- @red-4: #52a5ff;
175
- @red4: #52a5ff;
176
- @red-5: #2989ff;
177
- @red5: #2989ff;
178
- @red-6: #006aff;
179
- @red6: #006aff;
180
- @red-7: #0053d9;
181
- @red7: #0053d9;
182
- @red-8: #003eb3;
183
- @red8: #003eb3;
184
- @red-9: #002c8c;
185
- @red9: #002c8c;
186
- @red-10: #001d66;
187
- @red10: #001d66;
169
+ @red-1: #fff1f0;
170
+ @red1: #fff1f0;
171
+ @red-2: #ffccc7;
172
+ @red2: #ffccc7;
173
+ @red-3: #ffa39e;
174
+ @red3: #ffa39e;
175
+ @red-4: #ff7875;
176
+ @red4: #ff7875;
177
+ @red-5: #ff4d4f;
178
+ @red5: #ff4d4f;
179
+ @red-6: #f5222d;
180
+ @red6: #f5222d;
181
+ @red-7: #cf1322;
182
+ @red7: #cf1322;
183
+ @red-8: #a8071a;
184
+ @red8: #a8071a;
185
+ @red-9: #820014;
186
+ @red9: #820014;
187
+ @red-10: #5c0011;
188
+ @red10: #5c0011;
188
189
  @orange-1: #fff7e6;
189
190
  @orange1: #fff7e6;
190
191
  @orange-2: #ffe7ba;
@@ -205,26 +206,26 @@
205
206
  @orange9: #873800;
206
207
  @orange-10: #612500;
207
208
  @orange10: #612500;
208
- @yellow-1: #fff2f0;
209
- @yellow1: #fff2f0;
210
- @yellow-2: #fff0ed;
211
- @yellow2: #fff0ed;
212
- @yellow-3: #ffcac4;
213
- @yellow3: #ffcac4;
214
- @yellow-4: #ffa29c;
215
- @yellow4: #ffa29c;
216
- @yellow-5: #ff7773;
217
- @yellow5: #ff7773;
218
- @yellow-6: #ff4b4b;
219
- @yellow6: #ff4b4b;
220
- @yellow-7: #d9343a;
221
- @yellow7: #d9343a;
222
- @yellow-8: #b3222c;
223
- @yellow8: #b3222c;
224
- @yellow-9: #8c1420;
225
- @yellow9: #8c1420;
226
- @yellow-10: #660d19;
227
- @yellow10: #660d19;
209
+ @yellow-1: #feffe6;
210
+ @yellow1: #feffe6;
211
+ @yellow-2: #ffffb8;
212
+ @yellow2: #ffffb8;
213
+ @yellow-3: #fffb8f;
214
+ @yellow3: #fffb8f;
215
+ @yellow-4: #fff566;
216
+ @yellow4: #fff566;
217
+ @yellow-5: #ffec3d;
218
+ @yellow5: #ffec3d;
219
+ @yellow-6: #fadb14;
220
+ @yellow6: #fadb14;
221
+ @yellow-7: #d4b106;
222
+ @yellow7: #d4b106;
223
+ @yellow-8: #ad8b00;
224
+ @yellow8: #ad8b00;
225
+ @yellow-9: #876800;
226
+ @yellow9: #876800;
227
+ @yellow-10: #614700;
228
+ @yellow10: #614700;
228
229
  @volcano-1: #fff2e8;
229
230
  @volcano1: #fff2e8;
230
231
  @volcano-2: #ffd8bf;
@@ -306,65 +307,68 @@
306
307
  @lime-10: #254000;
307
308
  @lime10: #254000;
308
309
  @colorText: #132039;
309
- @colorTextSecondary: #364563;
310
- @colorTextTertiary: #8592ad;
311
- @colorTextQuaternary: #cdd5e4;
312
- @colorFill: #f5f8fe;
313
- @colorFillSecondary: #f5f8fe;
314
- @colorFillTertiary: #f5f8fe;
315
- @colorFillQuaternary: #f8fafe;
316
- @colorBgLayout: #f5f8fe;
310
+ @colorTextSecondary: #5C6B8A;
311
+ @colorTextTertiary: #8592AD;
312
+ @colorTextQuaternary: #ABB7CF;
313
+ @colorFill: #E2E8F3;
314
+ @colorFillSecondary: #F3F6FC;
315
+ @colorFillTertiary: #F8FAFE;
316
+ @colorFillQuaternary: #F8FAFE;
317
+ @colorBgLayout: #F8FAFE;
317
318
  @colorBgContainer: #ffffff;
318
319
  @colorBgElevated: #ffffff;
319
- @colorBgSpotlight: rgba(19, 32, 57, 0.85);
320
- @colorBorder: #cdd5e4;
321
- @colorBorderSecondary: #e2e8f3;
322
- @colorPrimaryBg: #eaf1ff;
323
- @colorPrimaryBgHover: #eaf1ff;
324
- @colorPrimaryBorder: #b3ccff;
325
- @colorPrimaryBorderHover: #5189fb;
326
- @colorPrimaryHover: #004ce6;
327
- @colorPrimaryActive: #004ce6;
328
- @colorPrimaryTextHover: #5189fb;
329
- @colorPrimaryText: #006aff;
330
- @colorPrimaryTextActive: #004ce6;
331
- @colorSuccessBg: #eef8f5;
332
- @colorSuccessBgHover: #b3e6d5;
333
- @colorSuccessBorder: #b3e6d5;
334
- @colorSuccessBorderHover: #4dcca2;
335
- @colorSuccessHover: #4dcca2;
336
- @colorSuccessActive: #00b378;
337
- @colorSuccessTextHover: #4dcca2;
338
- @colorSuccessText: #0ac185;
339
- @colorSuccessTextActive: #00b378;
340
- @colorErrorBg: #ffebeb;
341
- @colorErrorBgHover: #ffb3b3;
342
- @colorErrorBorder: #ffb3b3;
343
- @colorErrorBorderHover: #ff8080;
344
- @colorErrorHover: #ff8080;
345
- @colorErrorActive: #ec1313;
346
- @colorErrorTextHover: #ff8080;
347
- @colorErrorText: #ff4b4b;
348
- @colorErrorTextActive: #ec1313;
349
- @colorWarningBg: #fff5e5;
350
- @colorWarningBgHover: #ffd699;
351
- @colorWarningBorder: #ffd699;
352
- @colorWarningBorderHover: #ffc166;
353
- @colorWarningHover: #ffc166;
354
- @colorWarningActive: #ff9700;
355
- @colorWarningTextHover: #ffc166;
356
- @colorWarningText: #ffac33;
357
- @colorWarningTextActive: #ff9700;
358
- @colorInfoBg: #eaf1ff;
359
- @colorInfoBgHover: #eaf1ff;
360
- @colorInfoBorder: #b3ccff;
361
- @colorInfoBorderHover: #5189fb;
362
- @colorInfoHover: #5189fb;
363
- @colorInfoActive: #004ce6;
364
- @colorInfoTextHover: #5189fb;
365
- @colorInfoText: #006aff;
366
- @colorInfoTextActive: #004ce6;
367
- @colorBgMask: rgba(19, 32, 57, 0.65);
320
+ @colorBgSpotlight: rgba(19, 32, 57, 0.8);
321
+ @colorBgBlur: transparent;
322
+ @colorBorder: #CDD5E4;
323
+ @colorBorderSecondary: #E2E8F3;
324
+ @colorPrimaryBg: #EAF1FF;
325
+ @colorPrimaryBgHover: #EAF1FF;
326
+ @colorPrimaryBorder: #B3CCFF;
327
+ @colorPrimaryBorderHover: #5189FB;
328
+ @colorPrimaryHover: #5189FB;
329
+ @colorPrimaryActive: #004CE6;
330
+ @colorPrimaryTextHover: #5189FB;
331
+ @colorPrimaryText: #006AFF;
332
+ @colorPrimaryTextActive: #004CE6;
333
+ @colorSuccessBg: #EEF8F5;
334
+ @colorSuccessBgHover: #B3E6D5;
335
+ @colorSuccessBorder: #B3E6D5;
336
+ @colorSuccessBorderHover: #4DCCA2;
337
+ @colorSuccessHover: #4DCCA2;
338
+ @colorSuccessActive: #00B378;
339
+ @colorSuccessTextHover: #4DCCA2;
340
+ @colorSuccessText: #0AC185;
341
+ @colorSuccessTextActive: #00B378;
342
+ @colorErrorBg: #FFEBEB;
343
+ @colorErrorBgHover: #FFB3B3;
344
+ @colorErrorBorder: #FFB3B3;
345
+ @colorErrorBorderHover: #FF8080;
346
+ @colorErrorHover: #FF8080;
347
+ @colorErrorActive: #EC1313;
348
+ @colorErrorTextHover: #FF8080;
349
+ @colorErrorText: #FF4B4B;
350
+ @colorErrorTextActive: #EC1313;
351
+ @colorWarningBg: #FFF5E5;
352
+ @colorWarningBgHover: #FFD699;
353
+ @colorWarningBorder: #FFD699;
354
+ @colorWarningBorderHover: #FFC166;
355
+ @colorWarningHover: #FFC166;
356
+ @colorWarningActive: #FF9700;
357
+ @colorWarningTextHover: #FFC166;
358
+ @colorWarningText: #FFAC33;
359
+ @colorWarningTextActive: #FF9700;
360
+ @colorInfoBg: #EAF1FF;
361
+ @colorInfoBgHover: #EAF1FF;
362
+ @colorInfoBorder: #B3CCFF;
363
+ @colorInfoBorderHover: #5189FB;
364
+ @colorInfoHover: #5189FB;
365
+ @colorInfoActive: #004CE6;
366
+ @colorInfoTextHover: #5189FB;
367
+ @colorInfoText: #006AFF;
368
+ @colorInfoTextActive: #004CE6;
369
+ @colorLinkHover: #52a5ff;
370
+ @colorLinkActive: #0053d9;
371
+ @colorBgMask: rgba(19, 32, 57, 0.6);
368
372
  @colorWhite: #fff;
369
373
  @fontSizeSM: 12;
370
374
  @fontSizeLG: 16;
@@ -402,29 +406,32 @@
402
406
  @borderRadiusSM: 4;
403
407
  @borderRadiusLG: 8;
404
408
  @borderRadiusOuter: 4;
405
- @colorIcon: #8592ad;
406
- @boxShadowSecondary: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12),
407
- 0 9px 28px 8px rgba(0, 0, 0, 0.05);
408
- @boxShadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12),
409
- 0 9px 28px 8px rgba(0, 0, 0, 0.05);
410
- @colorLink: #006aff;
411
- @colorLinkHover: #5189fb;
412
- @colorLinkActive: #004ce6;
413
- @colorFillContent: #f5f8fe;
414
- @colorFillContentHover: #f5f8fe;
415
- @colorFillAlter: #f8fafe;
416
- @colorBgContainerDisabled: #f5f8fe;
409
+ @boxShadowSecondary:
410
+ 0 6px 16px 0 rgba(0, 0, 0, 0.08),
411
+ 0 3px 6px -4px rgba(0, 0, 0, 0.12),
412
+ 0 9px 28px 8px rgba(0, 0, 0, 0.05)
413
+ ;
414
+ @boxShadow:
415
+ 0 6px 16px 0 rgba(0, 0, 0, 0.08),
416
+ 0 3px 6px -4px rgba(0, 0, 0, 0.12),
417
+ 0 9px 28px 8px rgba(0, 0, 0, 0.05)
418
+ ;
419
+ @colorFillContent: #F3F6FC;
420
+ @colorFillContentHover: #E2E8F3;
421
+ @colorFillAlter: #F8FAFE;
422
+ @colorBgContainerDisabled: #F8FAFE;
417
423
  @colorBorderBg: #ffffff;
418
424
  @colorSplit: rgba(13, 63, 155, 0.12);
419
- @colorTextPlaceholder: #cdd5e4;
420
- @colorTextDisabled: #cdd5e4;
425
+ @colorTextPlaceholder: #ABB7CF;
426
+ @colorTextDisabled: #ABB7CF;
421
427
  @colorTextHeading: #132039;
422
- @colorTextLabel: #364563;
423
- @colorTextDescription: #8592ad;
428
+ @colorTextLabel: #5C6B8A;
429
+ @colorTextDescription: #8592AD;
424
430
  @colorTextLightSolid: #fff;
425
431
  @colorHighlight: #ff4b4b;
426
- @colorBgTextHover: #f5f8fe;
427
- @colorBgTextActive: #f5f8fe;
432
+ @colorBgTextHover: #F3F6FC;
433
+ @colorBgTextActive: #E2E8F3;
434
+ @colorIcon: #8592AD;
428
435
  @colorIconHover: #132039;
429
436
  @colorErrorOutline: rgba(255, 5, 5, 0.08);
430
437
  @colorWarningOutline: rgba(255, 164, 19, 0.11);
@@ -432,11 +439,11 @@
432
439
  @lineWidthFocus: 4;
433
440
  @controlOutlineWidth: 2;
434
441
  @controlInteractiveSize: 16;
435
- @controlItemBgHover: #f5f8fe;
436
- @controlItemBgActive: #eaf1ff;
437
- @controlItemBgActiveHover: #eaf1ff;
438
- @controlItemBgActiveDisabled: #f5f8fe;
439
- @controlTmpOutline: #f8fafe;
442
+ @controlItemBgHover: #F8FAFE;
443
+ @controlItemBgActive: #EAF1FF;
444
+ @controlItemBgActiveHover: #EAF1FF;
445
+ @controlItemBgActiveDisabled: #E2E8F3;
446
+ @controlTmpOutline: #F8FAFE;
440
447
  @controlOutline: rgba(22, 99, 255, 0.09);
441
448
  @fontWeightStrong: 600;
442
449
  @opacityLoading: 0.65;
@@ -466,8 +473,11 @@
466
473
  @marginLG: 24;
467
474
  @marginXL: 32;
468
475
  @marginXXL: 48;
469
- @boxShadowTertiary: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02),
470
- 0 2px 4px 0 rgba(0, 0, 0, 0.02);
476
+ @boxShadowTertiary:
477
+ 0 1px 2px 0 rgba(0, 0, 0, 0.03),
478
+ 0 1px 6px -1px rgba(0, 0, 0, 0.02),
479
+ 0 2px 4px 0 rgba(0, 0, 0, 0.02)
480
+ ;
471
481
  @screenXS: 480;
472
482
  @screenXSMin: 480;
473
483
  @screenXSMax: 575;
@@ -486,16 +496,31 @@
486
496
  @screenXXL: 1600;
487
497
  @screenXXLMin: 1600;
488
498
  @boxShadowPopoverArrow: 2px 2px 5px rgba(0, 0, 0, 0.05);
489
- @boxShadowCard: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12),
490
- 0 5px 12px 4px rgba(0, 0, 0, 0.09);
491
- @boxShadowDrawerRight: -6px 0 16px 0 rgba(0, 0, 0, 0.08), -3px 0 6px -4px rgba(0, 0, 0, 0.12),
492
- -9px 0 28px 8px rgba(0, 0, 0, 0.05);
493
- @boxShadowDrawerLeft: 6px 0 16px 0 rgba(0, 0, 0, 0.08), 3px 0 6px -4px rgba(0, 0, 0, 0.12),
494
- 9px 0 28px 8px rgba(0, 0, 0, 0.05);
495
- @boxShadowDrawerUp: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12),
496
- 0 9px 28px 8px rgba(0, 0, 0, 0.05);
497
- @boxShadowDrawerDown: 0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -3px 6px -4px rgba(0, 0, 0, 0.12),
498
- 0 -9px 28px 8px rgba(0, 0, 0, 0.05);
499
+ @boxShadowCard:
500
+ 0 1px 2px -2px rgba(0, 0, 0, 0.16),
501
+ 0 3px 6px 0 rgba(0, 0, 0, 0.12),
502
+ 0 5px 12px 4px rgba(0, 0, 0, 0.09)
503
+ ;
504
+ @boxShadowDrawerRight:
505
+ -6px 0 16px 0 rgba(0, 0, 0, 0.08),
506
+ -3px 0 6px -4px rgba(0, 0, 0, 0.12),
507
+ -9px 0 28px 8px rgba(0, 0, 0, 0.05)
508
+ ;
509
+ @boxShadowDrawerLeft:
510
+ 6px 0 16px 0 rgba(0, 0, 0, 0.08),
511
+ 3px 0 6px -4px rgba(0, 0, 0, 0.12),
512
+ 9px 0 28px 8px rgba(0, 0, 0, 0.05)
513
+ ;
514
+ @boxShadowDrawerUp:
515
+ 0 6px 16px 0 rgba(0, 0, 0, 0.08),
516
+ 0 3px 6px -4px rgba(0, 0, 0, 0.12),
517
+ 0 9px 28px 8px rgba(0, 0, 0, 0.05)
518
+ ;
519
+ @boxShadowDrawerDown:
520
+ 0 -6px 16px 0 rgba(0, 0, 0, 0.08),
521
+ 0 -3px 6px -4px rgba(0, 0, 0, 0.12),
522
+ 0 -9px 28px 8px rgba(0, 0, 0, 0.05)
523
+ ;
499
524
  @boxShadowTabsOverflowLeft: inset 10px 0 8px -8px rgba(0, 0, 0, 0.08);
500
525
  @boxShadowTabsOverflowRight: inset -10px 0 8px -8px rgba(0, 0, 0, 0.08);
501
526
  @boxShadowTabsOverflowTop: inset 0 10px 8px -8px rgba(0, 0, 0, 0.08);
@@ -1,4 +1,4 @@
1
- import type { TooltipPropsWithTitle as AntTooltipPropsWithTitle } from 'antd/es/tooltip';
1
+ import type { TooltipPropsWithTitle as AntTooltipPropsWithTitle, TooltipRef } from 'antd/es/tooltip';
2
2
  import React from 'react';
3
3
  export * from 'antd/es/tooltip';
4
4
  export type TooltipType = 'default' | 'light' | 'success' | 'info' | 'warning' | 'error';
@@ -8,7 +8,7 @@ export interface TooltipProps extends AntTooltipPropsWithTitle {
8
8
  closeIcon?: boolean | React.ReactNode;
9
9
  onClose?: (e: React.MouseEvent<HTMLElement>) => void;
10
10
  }
11
- type CompoundedComponent = React.FC<TooltipProps> & {
11
+ type CompoundedComponent = React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<TooltipRef | undefined>> & {
12
12
  /** @internal */
13
13
  __ANT_TOOLTIP: boolean;
14
14
  };
@@ -43,88 +43,91 @@ var import_config_provider = __toESM(require("../config-provider"));
43
43
  var import_style = __toESM(require("./style"));
44
44
  var import_useTooltipTypeList = require("./hooks/useTooltipTypeList");
45
45
  __reExport(tooltip_exports, require("antd/es/tooltip"), module.exports);
46
- var Tooltip = ({
47
- children,
48
- title,
49
- type = "default",
50
- color,
51
- mouseFollow,
52
- closeIcon = false,
53
- onClose,
54
- open,
55
- defaultOpen,
56
- onOpenChange,
57
- visible,
58
- defaultVisible,
59
- onVisibleChange,
60
- overlayInnerStyle,
61
- className,
62
- ...restProps
63
- }) => {
64
- const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
65
- const { prefixCls: customizePrefixCls } = restProps;
66
- const prefixCls = getPrefixCls("tooltip", customizePrefixCls);
67
- const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
68
- const tooltipCls = (0, import_classnames.default)(className, hashId);
69
- const [innerOpen, setInnerOpen] = (0, import_react.useState)(open ?? visible ?? defaultOpen ?? defaultVisible);
70
- const newOpen = open ?? visible ?? innerOpen;
71
- (0, import_react.useEffect)(() => {
72
- if (!(0, import_lodash.isNil)(open)) {
73
- setInnerOpen(open);
74
- } else if (!(0, import_lodash.isNil)(visible)) {
75
- setInnerOpen(visible);
76
- }
77
- }, [open, visible]);
78
- const handleCloseClick = (e) => {
79
- e.stopPropagation();
80
- onClose == null ? void 0 : onClose(e);
81
- if (e.defaultPrevented) {
82
- return;
83
- }
84
- setInnerOpen(false);
85
- };
86
- const closeIconNode = closeIcon ? closeIcon === true ? /* @__PURE__ */ import_react.default.createElement(import_icons.CloseOutlined, { className: `${prefixCls}-close-icon`, onClick: handleCloseClick }) : /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-close-icon`, onClick: handleCloseClick }, closeIcon) : null;
87
- const titleNode = typeof title === "function" ? title() : title;
88
- const newTitle = closeIcon ? /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: `${prefixCls}-close-icon-wrap` }, titleNode, closeIconNode) : titleNode;
89
- const typeList = (0, import_useTooltipTypeList.useTooltipTypeList)();
90
- const typeItem = typeList.find((item) => item.type === type);
91
- return wrapSSR(
92
- mouseFollow ? /* @__PURE__ */ import_react.default.createElement(
93
- import_MouseTooltip.default,
94
- {
95
- title,
96
- color: color || (typeItem == null ? void 0 : typeItem.backgroundColor),
97
- overlayInnerStyle: {
98
- color: typeItem == null ? void 0 : typeItem.color,
99
- ...overlayInnerStyle
46
+ var Tooltip = import_react.default.forwardRef(
47
+ ({
48
+ children,
49
+ title,
50
+ type = "default",
51
+ color,
52
+ mouseFollow,
53
+ closeIcon = false,
54
+ onClose,
55
+ open,
56
+ defaultOpen,
57
+ onOpenChange,
58
+ visible,
59
+ defaultVisible,
60
+ onVisibleChange,
61
+ overlayInnerStyle,
62
+ className,
63
+ ...restProps
64
+ }, ref) => {
65
+ const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
66
+ const { prefixCls: customizePrefixCls } = restProps;
67
+ const prefixCls = getPrefixCls("tooltip", customizePrefixCls);
68
+ const { wrapSSR, hashId } = (0, import_style.default)(prefixCls);
69
+ const tooltipCls = (0, import_classnames.default)(className, hashId);
70
+ const [innerOpen, setInnerOpen] = (0, import_react.useState)(open ?? visible ?? defaultOpen ?? defaultVisible);
71
+ const newOpen = open ?? visible ?? innerOpen;
72
+ (0, import_react.useEffect)(() => {
73
+ if (!(0, import_lodash.isNil)(open)) {
74
+ setInnerOpen(open);
75
+ } else if (!(0, import_lodash.isNil)(visible)) {
76
+ setInnerOpen(visible);
77
+ }
78
+ }, [open, visible]);
79
+ const handleCloseClick = (e) => {
80
+ e.stopPropagation();
81
+ onClose == null ? void 0 : onClose(e);
82
+ if (e.defaultPrevented) {
83
+ return;
84
+ }
85
+ setInnerOpen(false);
86
+ };
87
+ const closeIconNode = closeIcon ? closeIcon === true ? /* @__PURE__ */ import_react.default.createElement(import_icons.CloseOutlined, { className: `${prefixCls}-close-icon`, onClick: handleCloseClick }) : /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-close-icon`, onClick: handleCloseClick }, closeIcon) : null;
88
+ const titleNode = typeof title === "function" ? title() : title;
89
+ const newTitle = closeIcon ? /* @__PURE__ */ import_react.default.createElement(import_antd.Space, { className: `${prefixCls}-close-icon-wrap` }, titleNode, closeIconNode) : titleNode;
90
+ const typeList = (0, import_useTooltipTypeList.useTooltipTypeList)();
91
+ const typeItem = typeList.find((item) => item.type === type);
92
+ return wrapSSR(
93
+ mouseFollow ? /* @__PURE__ */ import_react.default.createElement(
94
+ import_MouseTooltip.default,
95
+ {
96
+ title,
97
+ color: color || (typeItem == null ? void 0 : typeItem.backgroundColor),
98
+ overlayInnerStyle: {
99
+ color: typeItem == null ? void 0 : typeItem.color,
100
+ ...overlayInnerStyle
101
+ },
102
+ className: tooltipCls,
103
+ ...restProps
100
104
  },
101
- className: tooltipCls,
102
- ...restProps
103
- },
104
- children
105
- ) : /* @__PURE__ */ import_react.default.createElement(
106
- import_antd.Tooltip,
107
- {
108
- title: newTitle,
109
- color: color || (typeItem == null ? void 0 : typeItem.backgroundColor),
110
- open: newOpen,
111
- defaultOpen,
112
- onOpenChange: (value) => {
113
- setInnerOpen(value);
114
- onVisibleChange == null ? void 0 : onVisibleChange(value);
115
- onOpenChange == null ? void 0 : onOpenChange(value);
105
+ children
106
+ ) : /* @__PURE__ */ import_react.default.createElement(
107
+ import_antd.Tooltip,
108
+ {
109
+ ref,
110
+ title: newTitle,
111
+ color: color || (typeItem == null ? void 0 : typeItem.backgroundColor),
112
+ open: newOpen,
113
+ defaultOpen,
114
+ onOpenChange: (value) => {
115
+ setInnerOpen(value);
116
+ onVisibleChange == null ? void 0 : onVisibleChange(value);
117
+ onOpenChange == null ? void 0 : onOpenChange(value);
118
+ },
119
+ overlayInnerStyle: {
120
+ color: typeItem == null ? void 0 : typeItem.color,
121
+ ...overlayInnerStyle
122
+ },
123
+ className: tooltipCls,
124
+ ...restProps
116
125
  },
117
- overlayInnerStyle: {
118
- color: typeItem == null ? void 0 : typeItem.color,
119
- ...overlayInnerStyle
120
- },
121
- className: tooltipCls,
122
- ...restProps
123
- },
124
- children
125
- )
126
- );
127
- };
126
+ children
127
+ )
128
+ );
129
+ }
130
+ );
128
131
  if (process.env.NODE_ENV !== "production") {
129
132
  Tooltip.displayName = import_antd.Tooltip.displayName;
130
133
  }