@expcat/tigercat-react 0.1.8 → 0.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.
Files changed (169) hide show
  1. package/dist/{chunk-TBIEWDY5.js → chunk-36RRHNZD.js} +13 -2
  2. package/dist/chunk-3CDAG4HD.mjs +151 -0
  3. package/dist/chunk-3QFHVAZT.js +68 -0
  4. package/dist/{chunk-ALP3KYYY.mjs → chunk-3XKBDV2Q.mjs} +5 -5
  5. package/dist/chunk-42UKIFFQ.js +278 -0
  6. package/dist/{chunk-K7ZMB2TH.mjs → chunk-5XKYWZZZ.mjs} +16 -22
  7. package/dist/chunk-677VSTPW.mjs +65 -0
  8. package/dist/chunk-6DYS4PJT.mjs +99 -0
  9. package/dist/chunk-6PBNFLM7.js +95 -0
  10. package/dist/{chunk-DCRVIDMY.mjs → chunk-6ZC7H22S.mjs} +1 -1
  11. package/dist/{chunk-WSCSDSV7.mjs → chunk-7IKJBQQV.mjs} +27 -5
  12. package/dist/{chunk-OTRGVENC.js → chunk-7SLNHUGJ.js} +1 -1
  13. package/dist/chunk-A2UW5OKX.mjs +415 -0
  14. package/dist/{chunk-NOOPXNR4.mjs → chunk-AGUPZEUL.mjs} +2 -3
  15. package/dist/chunk-AX5XRD2Q.js +35 -0
  16. package/dist/{chunk-BJU5N7WU.mjs → chunk-BAPR7UUR.mjs} +7 -7
  17. package/dist/chunk-CBALIFPW.mjs +275 -0
  18. package/dist/{chunk-BIWO5KB4.mjs → chunk-CJJ56NVL.mjs} +2 -2
  19. package/dist/{chunk-ENR3RIMM.js → chunk-DGBYGBLR.js} +72 -59
  20. package/dist/chunk-DUWAV47E.js +42 -0
  21. package/dist/chunk-E5GD3H7L.js +94 -0
  22. package/dist/chunk-EJLJYOO7.js +367 -0
  23. package/dist/{chunk-FQ6UHRAO.js → chunk-GQMYCYZ4.js} +6 -27
  24. package/dist/{chunk-G6FSHN2I.mjs → chunk-GW4EWT2K.mjs} +45 -31
  25. package/dist/{chunk-AQQRWISY.js → chunk-GXTBCX3M.js} +1 -1
  26. package/dist/{chunk-HQXZVTP4.mjs → chunk-HGF2EL25.mjs} +74 -61
  27. package/dist/{chunk-R5BQHZWB.js → chunk-HRYBEBZC.js} +15 -21
  28. package/dist/{chunk-PAD2DX5M.mjs → chunk-IIVRVCCP.mjs} +6 -24
  29. package/dist/chunk-IS467WAO.mjs +39 -0
  30. package/dist/{chunk-CTAMMQBC.mjs → chunk-IS7YOBR7.mjs} +16 -13
  31. package/dist/{chunk-ADOPAXPG.mjs → chunk-JI7SFMUT.mjs} +2 -2
  32. package/dist/chunk-KBGURVTD.mjs +282 -0
  33. package/dist/{chunk-O3EUFIOS.mjs → chunk-KELLYJZY.mjs} +36 -30
  34. package/dist/{chunk-XZDJ5FRB.js → chunk-KPZTGRNA.js} +5 -23
  35. package/dist/chunk-KQZ4F7FZ.js +153 -0
  36. package/dist/{chunk-XDKXL2BP.mjs → chunk-KV4LLPAY.mjs} +14 -3
  37. package/dist/{chunk-LNKI6HQ3.js → chunk-LIJLFLYE.js} +27 -5
  38. package/dist/chunk-LVC43YX2.mjs +72 -0
  39. package/dist/chunk-LZNG2HGC.mjs +227 -0
  40. package/dist/chunk-M375I56K.js +75 -0
  41. package/dist/{chunk-7OLWGHUR.mjs → chunk-MF3H7WWW.mjs} +13 -2
  42. package/dist/chunk-N32MAX4A.js +230 -0
  43. package/dist/{chunk-YYKJ63LD.mjs → chunk-NMDNLB3C.mjs} +7 -28
  44. package/dist/{chunk-77D7VQMG.js → chunk-OD2NNQD2.js} +2 -2
  45. package/dist/chunk-OONM7FO7.js +418 -0
  46. package/dist/{chunk-Q5Q7FG4U.js → chunk-OZLGNWET.js} +7 -7
  47. package/dist/{chunk-LAZGEMA2.mjs → chunk-P4EFJIXU.mjs} +1 -1
  48. package/dist/chunk-QI6WAP6Y.js +285 -0
  49. package/dist/{chunk-WK5HN4OH.js → chunk-QY6I7LU5.js} +43 -29
  50. package/dist/{chunk-KSW5JDIV.js → chunk-R7TOQU3U.js} +1 -1
  51. package/dist/chunk-RQSQXQN6.mjs +91 -0
  52. package/dist/chunk-SDLMB34Y.mjs +32 -0
  53. package/dist/chunk-UG3I4PCY.js +102 -0
  54. package/dist/chunk-VBSK4TGO.mjs +364 -0
  55. package/dist/{chunk-DZJUFU55.js → chunk-VXHBQTZS.js} +14 -11
  56. package/dist/chunk-WLIFEALE.mjs +111 -0
  57. package/dist/{chunk-AQ6DHCP6.js → chunk-XRFK2IXM.js} +4 -4
  58. package/dist/{chunk-5FRENLDC.js → chunk-Y2JOJ4D6.js} +14 -3
  59. package/dist/chunk-YER7IQF4.mjs +429 -0
  60. package/dist/{chunk-NI2WNZRT.js → chunk-YESS6YKC.js} +1 -2
  61. package/dist/chunk-Z6F67MJE.mjs +92 -0
  62. package/dist/{chunk-QORSSZX4.js → chunk-ZPFZMXA6.js} +34 -28
  63. package/dist/chunk-ZUUG3WOL.js +432 -0
  64. package/dist/chunk-ZYPEO2KY.js +115 -0
  65. package/dist/components/AreaChart.d.mts +19 -0
  66. package/dist/components/AreaChart.d.ts +19 -0
  67. package/dist/components/AreaChart.js +23 -0
  68. package/dist/components/AreaChart.mjs +8 -0
  69. package/dist/components/BarChart.d.mts +16 -0
  70. package/dist/components/BarChart.d.ts +16 -0
  71. package/dist/components/BarChart.js +23 -0
  72. package/dist/components/BarChart.mjs +8 -0
  73. package/dist/components/ChartAxis.d.mts +10 -0
  74. package/dist/components/ChartAxis.d.ts +10 -0
  75. package/dist/components/ChartAxis.js +16 -0
  76. package/dist/components/ChartAxis.mjs +1 -0
  77. package/dist/components/ChartCanvas.d.mts +9 -0
  78. package/dist/components/ChartCanvas.d.ts +9 -0
  79. package/dist/components/ChartCanvas.js +16 -0
  80. package/dist/components/ChartCanvas.mjs +1 -0
  81. package/dist/components/ChartGrid.d.mts +11 -0
  82. package/dist/components/ChartGrid.d.ts +11 -0
  83. package/dist/components/ChartGrid.js +16 -0
  84. package/dist/components/ChartGrid.mjs +1 -0
  85. package/dist/components/ChartLegend.d.mts +17 -0
  86. package/dist/components/ChartLegend.d.ts +17 -0
  87. package/dist/components/ChartLegend.js +16 -0
  88. package/dist/components/ChartLegend.mjs +1 -0
  89. package/dist/components/ChartSeries.d.mts +18 -0
  90. package/dist/components/ChartSeries.d.ts +18 -0
  91. package/dist/components/ChartSeries.js +16 -0
  92. package/dist/components/ChartSeries.mjs +1 -0
  93. package/dist/components/ChartTooltip.d.mts +12 -0
  94. package/dist/components/ChartTooltip.d.ts +12 -0
  95. package/dist/components/ChartTooltip.js +16 -0
  96. package/dist/components/ChartTooltip.mjs +1 -0
  97. package/dist/components/DonutChart.d.mts +14 -0
  98. package/dist/components/DonutChart.d.ts +14 -0
  99. package/dist/components/DonutChart.js +21 -0
  100. package/dist/components/DonutChart.mjs +6 -0
  101. package/dist/components/Drawer.js +3 -3
  102. package/dist/components/Drawer.mjs +2 -2
  103. package/dist/components/Dropdown.d.mts +12 -2
  104. package/dist/components/Dropdown.d.ts +12 -2
  105. package/dist/components/Dropdown.js +4 -4
  106. package/dist/components/Dropdown.mjs +2 -2
  107. package/dist/components/DropdownItem.js +4 -4
  108. package/dist/components/DropdownItem.mjs +3 -3
  109. package/dist/components/Icon.js +2 -2
  110. package/dist/components/Icon.mjs +1 -1
  111. package/dist/components/LineChart.d.mts +19 -0
  112. package/dist/components/LineChart.d.ts +19 -0
  113. package/dist/components/LineChart.js +23 -0
  114. package/dist/components/LineChart.mjs +8 -0
  115. package/dist/components/List.js +3 -3
  116. package/dist/components/List.mjs +2 -2
  117. package/dist/components/Message.js +4 -4
  118. package/dist/components/Message.mjs +1 -1
  119. package/dist/components/Modal.js +3 -3
  120. package/dist/components/Modal.mjs +2 -2
  121. package/dist/components/Notification.js +4 -4
  122. package/dist/components/Notification.mjs +1 -1
  123. package/dist/components/Pagination.d.mts +5 -1
  124. package/dist/components/Pagination.d.ts +5 -1
  125. package/dist/components/Pagination.js +3 -3
  126. package/dist/components/Pagination.mjs +1 -1
  127. package/dist/components/PieChart.d.mts +14 -0
  128. package/dist/components/PieChart.d.ts +14 -0
  129. package/dist/components/PieChart.js +20 -0
  130. package/dist/components/PieChart.mjs +5 -0
  131. package/dist/components/Popconfirm.d.mts +12 -2
  132. package/dist/components/Popconfirm.d.ts +12 -2
  133. package/dist/components/Popconfirm.js +3 -2
  134. package/dist/components/Popconfirm.mjs +2 -1
  135. package/dist/components/Popover.d.mts +12 -2
  136. package/dist/components/Popover.d.ts +12 -2
  137. package/dist/components/Popover.js +3 -2
  138. package/dist/components/Popover.mjs +2 -1
  139. package/dist/components/RadarChart.d.mts +20 -0
  140. package/dist/components/RadarChart.d.ts +20 -0
  141. package/dist/components/RadarChart.js +20 -0
  142. package/dist/components/RadarChart.mjs +5 -0
  143. package/dist/components/ScatterChart.d.mts +32 -0
  144. package/dist/components/ScatterChart.d.ts +32 -0
  145. package/dist/components/ScatterChart.js +23 -0
  146. package/dist/components/ScatterChart.mjs +8 -0
  147. package/dist/components/Select.js +2 -2
  148. package/dist/components/Select.mjs +1 -1
  149. package/dist/components/Slider.js +2 -2
  150. package/dist/components/Slider.mjs +1 -1
  151. package/dist/components/Space.js +2 -2
  152. package/dist/components/Space.mjs +1 -1
  153. package/dist/components/Steps.js +3 -3
  154. package/dist/components/Steps.mjs +1 -1
  155. package/dist/components/StepsItem.js +2 -2
  156. package/dist/components/StepsItem.mjs +1 -1
  157. package/dist/components/Table.js +2 -2
  158. package/dist/components/Table.mjs +1 -1
  159. package/dist/components/Tooltip.d.mts +12 -2
  160. package/dist/components/Tooltip.d.ts +12 -2
  161. package/dist/components/Tooltip.js +3 -2
  162. package/dist/components/Tooltip.mjs +2 -1
  163. package/dist/index.d.mts +97 -1
  164. package/dist/index.d.ts +97 -1
  165. package/dist/index.js +178 -108
  166. package/dist/index.mjs +41 -27
  167. package/package.json +2 -2
  168. package/dist/chunk-NEULKOYJ.js +0 -48
  169. package/dist/chunk-ZO4XVOHU.mjs +0 -45
package/dist/index.js CHANGED
@@ -1,52 +1,57 @@
1
1
  'use strict';
2
2
 
3
- var chunkQ3DPJHNM_js = require('./chunk-Q3DPJHNM.js');
4
- var chunk2TS6X5RA_js = require('./chunk-2TS6X5RA.js');
5
- var chunkYYGTJKP5_js = require('./chunk-YYGTJKP5.js');
6
3
  var chunkR7MS42PL_js = require('./chunk-R7MS42PL.js');
7
4
  var chunk7P6PHSFM_js = require('./chunk-7P6PHSFM.js');
8
5
  var chunkIQINYCU6_js = require('./chunk-IQINYCU6.js');
9
- var chunkWK5HN4OH_js = require('./chunk-WK5HN4OH.js');
6
+ var chunkQY6I7LU5_js = require('./chunk-QY6I7LU5.js');
10
7
  var chunkC5EFBJBR_js = require('./chunk-C5EFBJBR.js');
11
- var chunkXZDJ5FRB_js = require('./chunk-XZDJ5FRB.js');
12
- var chunkNI2WNZRT_js = require('./chunk-NI2WNZRT.js');
13
- var chunkAQQRWISY_js = require('./chunk-AQQRWISY.js');
8
+ var chunkQ3DPJHNM_js = require('./chunk-Q3DPJHNM.js');
14
9
  var chunkD3I2SY7X_js = require('./chunk-D3I2SY7X.js');
15
10
  var chunkVVO4V4IK_js = require('./chunk-VVO4V4IK.js');
11
+ var chunkHRYBEBZC_js = require('./chunk-HRYBEBZC.js');
16
12
  var chunkHDDBBZQH_js = require('./chunk-HDDBBZQH.js');
17
- var chunkR5BQHZWB_js = require('./chunk-R5BQHZWB.js');
18
- var chunkQORSSZX4_js = require('./chunk-QORSSZX4.js');
13
+ var chunk2TS6X5RA_js = require('./chunk-2TS6X5RA.js');
14
+ var chunkYYGTJKP5_js = require('./chunk-YYGTJKP5.js');
15
+ var chunk42UKIFFQ_js = require('./chunk-42UKIFFQ.js');
16
+ var chunkIFY46RWU_js = require('./chunk-IFY46RWU.js');
17
+ var chunkIY4LEJYF_js = require('./chunk-IY4LEJYF.js');
18
+ var chunkKPZTGRNA_js = require('./chunk-KPZTGRNA.js');
19
+ var chunkYESS6YKC_js = require('./chunk-YESS6YKC.js');
20
+ var chunkGXTBCX3M_js = require('./chunk-GXTBCX3M.js');
21
+ var chunkVXHBQTZS_js = require('./chunk-VXHBQTZS.js');
22
+ var chunkDGBYGBLR_js = require('./chunk-DGBYGBLR.js');
23
+ var chunkZPFZMXA6_js = require('./chunk-ZPFZMXA6.js');
19
24
  var chunkYE2M2HNM_js = require('./chunk-YE2M2HNM.js');
25
+ var chunkZUUG3WOL_js = require('./chunk-ZUUG3WOL.js');
20
26
  var chunk5QKMQRCW_js = require('./chunk-5QKMQRCW.js');
21
27
  var chunkVSF4DF7N_js = require('./chunk-VSF4DF7N.js');
22
- var chunkIFY46RWU_js = require('./chunk-IFY46RWU.js');
23
- var chunkIY4LEJYF_js = require('./chunk-IY4LEJYF.js');
28
+ var chunkOZLGNWET_js = require('./chunk-OZLGNWET.js');
29
+ var chunkGQMYCYZ4_js = require('./chunk-GQMYCYZ4.js');
30
+ var chunk6MGEGOYJ_js = require('./chunk-6MGEGOYJ.js');
24
31
  var chunkLXA2YBAO_js = require('./chunk-LXA2YBAO.js');
25
32
  var chunk3WPKVV4N_js = require('./chunk-3WPKVV4N.js');
26
33
  var chunkQFVE7GKD_js = require('./chunk-QFVE7GKD.js');
27
- var chunkKSW5JDIV_js = require('./chunk-KSW5JDIV.js');
28
- var chunkTBIEWDY5_js = require('./chunk-TBIEWDY5.js');
29
- var chunkOTRGVENC_js = require('./chunk-OTRGVENC.js');
30
- var chunkDZJUFU55_js = require('./chunk-DZJUFU55.js');
31
- var chunkENR3RIMM_js = require('./chunk-ENR3RIMM.js');
34
+ var chunkR7TOQU3U_js = require('./chunk-R7TOQU3U.js');
35
+ var chunk36RRHNZD_js = require('./chunk-36RRHNZD.js');
36
+ var chunk7SLNHUGJ_js = require('./chunk-7SLNHUGJ.js');
32
37
  var chunkP273E6XE_js = require('./chunk-P273E6XE.js');
38
+ var chunkJW64IJP2_js = require('./chunk-JW64IJP2.js');
33
39
  var chunkVJJ76I7U_js = require('./chunk-VJJ76I7U.js');
34
- var chunkAQ6DHCP6_js = require('./chunk-AQ6DHCP6.js');
40
+ var chunkXRFK2IXM_js = require('./chunk-XRFK2IXM.js');
35
41
  var chunkCIL2AC3F_js = require('./chunk-CIL2AC3F.js');
36
42
  var chunkR4JSBXGG_js = require('./chunk-R4JSBXGG.js');
43
+ var chunkEJLJYOO7_js = require('./chunk-EJLJYOO7.js');
37
44
  var chunkMKWXJZ3T_js = require('./chunk-MKWXJZ3T.js');
38
- var chunkQ5Q7FG4U_js = require('./chunk-Q5Q7FG4U.js');
39
- var chunkFQ6UHRAO_js = require('./chunk-FQ6UHRAO.js');
40
- var chunk6MGEGOYJ_js = require('./chunk-6MGEGOYJ.js');
41
45
  var chunkUFAXJVMD_js = require('./chunk-UFAXJVMD.js');
42
46
  var chunkZREFCRX3_js = require('./chunk-ZREFCRX3.js');
43
- var chunk5FRENLDC_js = require('./chunk-5FRENLDC.js');
44
- var chunk77D7VQMG_js = require('./chunk-77D7VQMG.js');
45
- var chunkLNKI6HQ3_js = require('./chunk-LNKI6HQ3.js');
46
- require('./chunk-NEULKOYJ.js');
47
+ var chunkUG3I4PCY_js = require('./chunk-UG3I4PCY.js');
48
+ var chunkN32MAX4A_js = require('./chunk-N32MAX4A.js');
49
+ var chunkY2JOJ4D6_js = require('./chunk-Y2JOJ4D6.js');
50
+ var chunkOD2NNQD2_js = require('./chunk-OD2NNQD2.js');
51
+ var chunkLIJLFLYE_js = require('./chunk-LIJLFLYE.js');
52
+ require('./chunk-ZYPEO2KY.js');
47
53
  var chunkEQWQXURG_js = require('./chunk-EQWQXURG.js');
48
54
  var chunkTB2UHDOZ_js = require('./chunk-TB2UHDOZ.js');
49
- var chunkJW64IJP2_js = require('./chunk-JW64IJP2.js');
50
55
  var chunkU4ZVEPYD_js = require('./chunk-U4ZVEPYD.js');
51
56
  var chunkTJFS44SH_js = require('./chunk-TJFS44SH.js');
52
57
  var chunkGX74TC62_js = require('./chunk-GX74TC62.js');
@@ -56,29 +61,26 @@ var chunkQL6UEG3U_js = require('./chunk-QL6UEG3U.js');
56
61
  var chunk72ZRDBXN_js = require('./chunk-72ZRDBXN.js');
57
62
  var chunkOFCKGWTS_js = require('./chunk-OFCKGWTS.js');
58
63
  var chunk2Y327ZU4_js = require('./chunk-2Y327ZU4.js');
64
+ var chunkA3DJSVTE_js = require('./chunk-A3DJSVTE.js');
65
+ var chunkVO4WDK4K_js = require('./chunk-VO4WDK4K.js');
59
66
  var chunk3OF7XPIQ_js = require('./chunk-3OF7XPIQ.js');
67
+ var chunkOONM7FO7_js = require('./chunk-OONM7FO7.js');
60
68
  var chunkTZ26HQAW_js = require('./chunk-TZ26HQAW.js');
61
69
  var chunk5ZVSFIZD_js = require('./chunk-5ZVSFIZD.js');
70
+ var chunkQI6WAP6Y_js = require('./chunk-QI6WAP6Y.js');
71
+ var chunkKQZ4F7FZ_js = require('./chunk-KQZ4F7FZ.js');
72
+ var chunkE5GD3H7L_js = require('./chunk-E5GD3H7L.js');
73
+ var chunkDUWAV47E_js = require('./chunk-DUWAV47E.js');
74
+ var chunk3QFHVAZT_js = require('./chunk-3QFHVAZT.js');
75
+ var chunk6PBNFLM7_js = require('./chunk-6PBNFLM7.js');
76
+ var chunkAX5XRD2Q_js = require('./chunk-AX5XRD2Q.js');
77
+ var chunkM375I56K_js = require('./chunk-M375I56K.js');
62
78
  var chunk6PUSRC6S_js = require('./chunk-6PUSRC6S.js');
63
79
  var chunk2DOPHSZP_js = require('./chunk-2DOPHSZP.js');
64
- var chunkA3DJSVTE_js = require('./chunk-A3DJSVTE.js');
65
- var chunkVO4WDK4K_js = require('./chunk-VO4WDK4K.js');
66
80
  var tigercatCore = require('@expcat/tigercat-core');
67
81
 
68
82
  var version = "0.0.1";
69
83
 
70
- Object.defineProperty(exports, "Upload", {
71
- enumerable: true,
72
- get: function () { return chunkQ3DPJHNM_js.Upload; }
73
- });
74
- Object.defineProperty(exports, "Tag", {
75
- enumerable: true,
76
- get: function () { return chunk2TS6X5RA_js.Tag; }
77
- });
78
- Object.defineProperty(exports, "Text", {
79
- enumerable: true,
80
- get: function () { return chunkYYGTJKP5_js.Text; }
81
- });
82
84
  Object.defineProperty(exports, "Textarea", {
83
85
  enumerable: true,
84
86
  get: function () { return chunkR7MS42PL_js.Textarea; }
@@ -93,31 +95,15 @@ Object.defineProperty(exports, "Timeline", {
93
95
  });
94
96
  Object.defineProperty(exports, "Tooltip", {
95
97
  enumerable: true,
96
- get: function () { return chunkWK5HN4OH_js.Tooltip; }
98
+ get: function () { return chunkQY6I7LU5_js.Tooltip; }
97
99
  });
98
100
  Object.defineProperty(exports, "Tree", {
99
101
  enumerable: true,
100
102
  get: function () { return chunkC5EFBJBR_js.Tree; }
101
103
  });
102
- Object.defineProperty(exports, "Slider", {
103
- enumerable: true,
104
- get: function () { return chunkXZDJ5FRB_js.Slider; }
105
- });
106
- Object.defineProperty(exports, "Space", {
107
- enumerable: true,
108
- get: function () { return chunkNI2WNZRT_js.Space; }
109
- });
110
- Object.defineProperty(exports, "Steps", {
111
- enumerable: true,
112
- get: function () { return chunkAQQRWISY_js.Steps; }
113
- });
114
- Object.defineProperty(exports, "StepsItem", {
115
- enumerable: true,
116
- get: function () { return chunkAQQRWISY_js.StepsItem; }
117
- });
118
- Object.defineProperty(exports, "useStepsContext", {
104
+ Object.defineProperty(exports, "Upload", {
119
105
  enumerable: true,
120
- get: function () { return chunkAQQRWISY_js.useStepsContext; }
106
+ get: function () { return chunkQ3DPJHNM_js.Upload; }
121
107
  });
122
108
  Object.defineProperty(exports, "SubMenu", {
123
109
  enumerable: true,
@@ -127,6 +113,10 @@ Object.defineProperty(exports, "Switch", {
127
113
  enumerable: true,
128
114
  get: function () { return chunkVVO4V4IK_js.Switch; }
129
115
  });
116
+ Object.defineProperty(exports, "Table", {
117
+ enumerable: true,
118
+ get: function () { return chunkHRYBEBZC_js.Table; }
119
+ });
130
120
  Object.defineProperty(exports, "TabPane", {
131
121
  enumerable: true,
132
122
  get: function () { return chunkHDDBBZQH_js.TabPane; }
@@ -139,18 +129,66 @@ Object.defineProperty(exports, "useTabsContext", {
139
129
  enumerable: true,
140
130
  get: function () { return chunkHDDBBZQH_js.useTabsContext; }
141
131
  });
142
- Object.defineProperty(exports, "Table", {
132
+ Object.defineProperty(exports, "Tag", {
133
+ enumerable: true,
134
+ get: function () { return chunk2TS6X5RA_js.Tag; }
135
+ });
136
+ Object.defineProperty(exports, "Text", {
137
+ enumerable: true,
138
+ get: function () { return chunkYYGTJKP5_js.Text; }
139
+ });
140
+ Object.defineProperty(exports, "ScatterChart", {
141
+ enumerable: true,
142
+ get: function () { return chunk42UKIFFQ_js.ScatterChart; }
143
+ });
144
+ Object.defineProperty(exports, "Sidebar", {
145
+ enumerable: true,
146
+ get: function () { return chunkIFY46RWU_js.Sidebar; }
147
+ });
148
+ Object.defineProperty(exports, "Skeleton", {
149
+ enumerable: true,
150
+ get: function () { return chunkIY4LEJYF_js.Skeleton; }
151
+ });
152
+ Object.defineProperty(exports, "Slider", {
153
+ enumerable: true,
154
+ get: function () { return chunkKPZTGRNA_js.Slider; }
155
+ });
156
+ Object.defineProperty(exports, "Space", {
157
+ enumerable: true,
158
+ get: function () { return chunkYESS6YKC_js.Space; }
159
+ });
160
+ Object.defineProperty(exports, "Steps", {
161
+ enumerable: true,
162
+ get: function () { return chunkGXTBCX3M_js.Steps; }
163
+ });
164
+ Object.defineProperty(exports, "StepsItem", {
165
+ enumerable: true,
166
+ get: function () { return chunkGXTBCX3M_js.StepsItem; }
167
+ });
168
+ Object.defineProperty(exports, "useStepsContext", {
169
+ enumerable: true,
170
+ get: function () { return chunkGXTBCX3M_js.useStepsContext; }
171
+ });
172
+ Object.defineProperty(exports, "Pagination", {
143
173
  enumerable: true,
144
- get: function () { return chunkR5BQHZWB_js.Table; }
174
+ get: function () { return chunkVXHBQTZS_js.Pagination; }
175
+ });
176
+ Object.defineProperty(exports, "Popconfirm", {
177
+ enumerable: true,
178
+ get: function () { return chunkDGBYGBLR_js.Popconfirm; }
145
179
  });
146
180
  Object.defineProperty(exports, "Popover", {
147
181
  enumerable: true,
148
- get: function () { return chunkQORSSZX4_js.Popover; }
182
+ get: function () { return chunkZPFZMXA6_js.Popover; }
149
183
  });
150
184
  Object.defineProperty(exports, "Progress", {
151
185
  enumerable: true,
152
186
  get: function () { return chunkYE2M2HNM_js.Progress; }
153
187
  });
188
+ Object.defineProperty(exports, "RadarChart", {
189
+ enumerable: true,
190
+ get: function () { return chunkZUUG3WOL_js.RadarChart; }
191
+ });
154
192
  Object.defineProperty(exports, "Radio", {
155
193
  enumerable: true,
156
194
  get: function () { return chunk5QKMQRCW_js.Radio; }
@@ -159,13 +197,17 @@ Object.defineProperty(exports, "RadioGroup", {
159
197
  enumerable: true,
160
198
  get: function () { return chunkVSF4DF7N_js.RadioGroup; }
161
199
  });
162
- Object.defineProperty(exports, "Sidebar", {
200
+ Object.defineProperty(exports, "List", {
163
201
  enumerable: true,
164
- get: function () { return chunkIFY46RWU_js.Sidebar; }
202
+ get: function () { return chunkOZLGNWET_js.List; }
165
203
  });
166
- Object.defineProperty(exports, "Skeleton", {
204
+ Object.defineProperty(exports, "Select", {
167
205
  enumerable: true,
168
- get: function () { return chunkIY4LEJYF_js.Skeleton; }
206
+ get: function () { return chunkGQMYCYZ4_js.Select; }
207
+ });
208
+ Object.defineProperty(exports, "Loading", {
209
+ enumerable: true,
210
+ get: function () { return chunk6MGEGOYJ_js.Loading; }
169
211
  });
170
212
  Object.defineProperty(exports, "MenuItemGroup", {
171
213
  enumerable: true,
@@ -185,35 +227,35 @@ Object.defineProperty(exports, "useMenuContext", {
185
227
  });
186
228
  Object.defineProperty(exports, "Message", {
187
229
  enumerable: true,
188
- get: function () { return chunkKSW5JDIV_js.Message; }
230
+ get: function () { return chunkR7TOQU3U_js.Message; }
189
231
  });
190
232
  Object.defineProperty(exports, "MessageContainer", {
191
233
  enumerable: true,
192
- get: function () { return chunkKSW5JDIV_js.MessageContainer; }
234
+ get: function () { return chunkR7TOQU3U_js.MessageContainer; }
193
235
  });
194
236
  Object.defineProperty(exports, "Modal", {
195
237
  enumerable: true,
196
- get: function () { return chunkTBIEWDY5_js.Modal; }
238
+ get: function () { return chunk36RRHNZD_js.Modal; }
197
239
  });
198
240
  Object.defineProperty(exports, "NotificationContainer", {
199
241
  enumerable: true,
200
- get: function () { return chunkOTRGVENC_js.NotificationContainer; }
242
+ get: function () { return chunk7SLNHUGJ_js.NotificationContainer; }
201
243
  });
202
244
  Object.defineProperty(exports, "notification", {
203
245
  enumerable: true,
204
- get: function () { return chunkOTRGVENC_js.notification; }
246
+ get: function () { return chunk7SLNHUGJ_js.notification; }
205
247
  });
206
- Object.defineProperty(exports, "Pagination", {
248
+ Object.defineProperty(exports, "FormItem", {
207
249
  enumerable: true,
208
- get: function () { return chunkDZJUFU55_js.Pagination; }
250
+ get: function () { return chunkP273E6XE_js.FormItem; }
209
251
  });
210
- Object.defineProperty(exports, "Popconfirm", {
252
+ Object.defineProperty(exports, "Form", {
211
253
  enumerable: true,
212
- get: function () { return chunkENR3RIMM_js.Popconfirm; }
254
+ get: function () { return chunkJW64IJP2_js.Form; }
213
255
  });
214
- Object.defineProperty(exports, "FormItem", {
256
+ Object.defineProperty(exports, "useFormContext", {
215
257
  enumerable: true,
216
- get: function () { return chunkP273E6XE_js.FormItem; }
258
+ get: function () { return chunkJW64IJP2_js.useFormContext; }
217
259
  });
218
260
  Object.defineProperty(exports, "Header", {
219
261
  enumerable: true,
@@ -221,7 +263,7 @@ Object.defineProperty(exports, "Header", {
221
263
  });
222
264
  Object.defineProperty(exports, "Icon", {
223
265
  enumerable: true,
224
- get: function () { return chunkAQ6DHCP6_js.Icon; }
266
+ get: function () { return chunkXRFK2IXM_js.Icon; }
225
267
  });
226
268
  Object.defineProperty(exports, "Input", {
227
269
  enumerable: true,
@@ -231,21 +273,13 @@ Object.defineProperty(exports, "Layout", {
231
273
  enumerable: true,
232
274
  get: function () { return chunkR4JSBXGG_js.Layout; }
233
275
  });
234
- Object.defineProperty(exports, "Link", {
276
+ Object.defineProperty(exports, "LineChart", {
235
277
  enumerable: true,
236
- get: function () { return chunkMKWXJZ3T_js.Link; }
278
+ get: function () { return chunkEJLJYOO7_js.LineChart; }
237
279
  });
238
- Object.defineProperty(exports, "List", {
239
- enumerable: true,
240
- get: function () { return chunkQ5Q7FG4U_js.List; }
241
- });
242
- Object.defineProperty(exports, "Select", {
243
- enumerable: true,
244
- get: function () { return chunkFQ6UHRAO_js.Select; }
245
- });
246
- Object.defineProperty(exports, "Loading", {
280
+ Object.defineProperty(exports, "Link", {
247
281
  enumerable: true,
248
- get: function () { return chunk6MGEGOYJ_js.Loading; }
282
+ get: function () { return chunkMKWXJZ3T_js.Link; }
249
283
  });
250
284
  Object.defineProperty(exports, "Descriptions", {
251
285
  enumerable: true,
@@ -255,17 +289,25 @@ Object.defineProperty(exports, "Divider", {
255
289
  enumerable: true,
256
290
  get: function () { return chunkZREFCRX3_js.Divider; }
257
291
  });
292
+ Object.defineProperty(exports, "DonutChart", {
293
+ enumerable: true,
294
+ get: function () { return chunkUG3I4PCY_js.DonutChart; }
295
+ });
296
+ Object.defineProperty(exports, "PieChart", {
297
+ enumerable: true,
298
+ get: function () { return chunkN32MAX4A_js.PieChart; }
299
+ });
258
300
  Object.defineProperty(exports, "Drawer", {
259
301
  enumerable: true,
260
- get: function () { return chunk5FRENLDC_js.Drawer; }
302
+ get: function () { return chunkY2JOJ4D6_js.Drawer; }
261
303
  });
262
304
  Object.defineProperty(exports, "DropdownItem", {
263
305
  enumerable: true,
264
- get: function () { return chunk77D7VQMG_js.DropdownItem; }
306
+ get: function () { return chunkOD2NNQD2_js.DropdownItem; }
265
307
  });
266
308
  Object.defineProperty(exports, "Dropdown", {
267
309
  enumerable: true,
268
- get: function () { return chunkLNKI6HQ3_js.Dropdown; }
310
+ get: function () { return chunkLIJLFLYE_js.Dropdown; }
269
311
  });
270
312
  Object.defineProperty(exports, "DropdownMenu", {
271
313
  enumerable: true,
@@ -275,14 +317,6 @@ Object.defineProperty(exports, "Footer", {
275
317
  enumerable: true,
276
318
  get: function () { return chunkTB2UHDOZ_js.Footer; }
277
319
  });
278
- Object.defineProperty(exports, "Form", {
279
- enumerable: true,
280
- get: function () { return chunkJW64IJP2_js.Form; }
281
- });
282
- Object.defineProperty(exports, "useFormContext", {
283
- enumerable: true,
284
- get: function () { return chunkJW64IJP2_js.useFormContext; }
285
- });
286
320
  Object.defineProperty(exports, "Checkbox", {
287
321
  enumerable: true,
288
322
  get: function () { return chunkU4ZVEPYD_js.Checkbox; }
@@ -323,10 +357,22 @@ Object.defineProperty(exports, "DatePicker", {
323
357
  enumerable: true,
324
358
  get: function () { return chunk2Y327ZU4_js.DatePicker; }
325
359
  });
360
+ Object.defineProperty(exports, "Button", {
361
+ enumerable: true,
362
+ get: function () { return chunkA3DJSVTE_js.Button; }
363
+ });
364
+ Object.defineProperty(exports, "Card", {
365
+ enumerable: true,
366
+ get: function () { return chunkVO4WDK4K_js.Card; }
367
+ });
326
368
  Object.defineProperty(exports, "Alert", {
327
369
  enumerable: true,
328
370
  get: function () { return chunk3OF7XPIQ_js.Alert; }
329
371
  });
372
+ Object.defineProperty(exports, "AreaChart", {
373
+ enumerable: true,
374
+ get: function () { return chunkOONM7FO7_js.AreaChart; }
375
+ });
330
376
  Object.defineProperty(exports, "Avatar", {
331
377
  enumerable: true,
332
378
  get: function () { return chunkTZ26HQAW_js.Avatar; }
@@ -335,6 +381,38 @@ Object.defineProperty(exports, "Badge", {
335
381
  enumerable: true,
336
382
  get: function () { return chunk5ZVSFIZD_js.Badge; }
337
383
  });
384
+ Object.defineProperty(exports, "BarChart", {
385
+ enumerable: true,
386
+ get: function () { return chunkQI6WAP6Y_js.BarChart; }
387
+ });
388
+ Object.defineProperty(exports, "useChartInteraction", {
389
+ enumerable: true,
390
+ get: function () { return chunkKQZ4F7FZ_js.useChartInteraction; }
391
+ });
392
+ Object.defineProperty(exports, "ChartAxis", {
393
+ enumerable: true,
394
+ get: function () { return chunkE5GD3H7L_js.ChartAxis; }
395
+ });
396
+ Object.defineProperty(exports, "ChartCanvas", {
397
+ enumerable: true,
398
+ get: function () { return chunkDUWAV47E_js.ChartCanvas; }
399
+ });
400
+ Object.defineProperty(exports, "ChartGrid", {
401
+ enumerable: true,
402
+ get: function () { return chunk3QFHVAZT_js.ChartGrid; }
403
+ });
404
+ Object.defineProperty(exports, "ChartLegend", {
405
+ enumerable: true,
406
+ get: function () { return chunk6PBNFLM7_js.ChartLegend; }
407
+ });
408
+ Object.defineProperty(exports, "ChartSeries", {
409
+ enumerable: true,
410
+ get: function () { return chunkAX5XRD2Q_js.ChartSeries; }
411
+ });
412
+ Object.defineProperty(exports, "ChartTooltip", {
413
+ enumerable: true,
414
+ get: function () { return chunkM375I56K_js.ChartTooltip; }
415
+ });
338
416
  Object.defineProperty(exports, "BreadcrumbItem", {
339
417
  enumerable: true,
340
418
  get: function () { return chunk6PUSRC6S_js.BreadcrumbItem; }
@@ -347,14 +425,6 @@ Object.defineProperty(exports, "useBreadcrumbContext", {
347
425
  enumerable: true,
348
426
  get: function () { return chunk2DOPHSZP_js.useBreadcrumbContext; }
349
427
  });
350
- Object.defineProperty(exports, "Button", {
351
- enumerable: true,
352
- get: function () { return chunkA3DJSVTE_js.Button; }
353
- });
354
- Object.defineProperty(exports, "Card", {
355
- enumerable: true,
356
- get: function () { return chunkVO4WDK4K_js.Card; }
357
- });
358
428
  exports.version = version;
359
429
  Object.keys(tigercatCore).forEach(function (k) {
360
430
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
package/dist/index.mjs CHANGED
@@ -1,50 +1,55 @@
1
- export { Upload } from './chunk-RTQNWZN4.mjs';
2
- export { Tag } from './chunk-DIZNY6N4.mjs';
3
- export { Text } from './chunk-6YDIBMCM.mjs';
4
1
  export { Textarea } from './chunk-672SCJWZ.mjs';
5
2
  export { TimePicker } from './chunk-CES6LGQ7.mjs';
6
3
  export { Timeline } from './chunk-LADCWARG.mjs';
7
- export { Tooltip } from './chunk-G6FSHN2I.mjs';
4
+ export { Tooltip } from './chunk-GW4EWT2K.mjs';
8
5
  export { Tree } from './chunk-KAEHFMTQ.mjs';
9
- export { Slider } from './chunk-PAD2DX5M.mjs';
10
- export { Space } from './chunk-NOOPXNR4.mjs';
11
- export { Steps, StepsItem, useStepsContext } from './chunk-LAZGEMA2.mjs';
6
+ export { Upload } from './chunk-RTQNWZN4.mjs';
12
7
  export { SubMenu } from './chunk-QEAC4MIG.mjs';
13
8
  export { Switch } from './chunk-7CAJK2ZK.mjs';
9
+ export { Table } from './chunk-5XKYWZZZ.mjs';
14
10
  export { TabPane, Tabs, useTabsContext } from './chunk-C52ZCGYG.mjs';
15
- export { Table } from './chunk-K7ZMB2TH.mjs';
16
- export { Popover } from './chunk-O3EUFIOS.mjs';
11
+ export { Tag } from './chunk-DIZNY6N4.mjs';
12
+ export { Text } from './chunk-6YDIBMCM.mjs';
13
+ export { ScatterChart } from './chunk-CBALIFPW.mjs';
14
+ export { Sidebar } from './chunk-3GD3LOII.mjs';
15
+ export { Skeleton } from './chunk-427CM2U6.mjs';
16
+ export { Slider } from './chunk-IIVRVCCP.mjs';
17
+ export { Space } from './chunk-AGUPZEUL.mjs';
18
+ export { Steps, StepsItem, useStepsContext } from './chunk-P4EFJIXU.mjs';
19
+ export { Pagination } from './chunk-IS7YOBR7.mjs';
20
+ export { Popconfirm } from './chunk-HGF2EL25.mjs';
21
+ export { Popover } from './chunk-KELLYJZY.mjs';
17
22
  export { Progress } from './chunk-Z4Z3I74Q.mjs';
23
+ export { RadarChart } from './chunk-YER7IQF4.mjs';
18
24
  export { Radio } from './chunk-MQXBU5YX.mjs';
19
25
  export { RadioGroup } from './chunk-5HUYCSA4.mjs';
20
- export { Sidebar } from './chunk-3GD3LOII.mjs';
21
- export { Skeleton } from './chunk-427CM2U6.mjs';
26
+ export { List } from './chunk-BAPR7UUR.mjs';
27
+ export { Select } from './chunk-NMDNLB3C.mjs';
28
+ export { Loading } from './chunk-PUDU34R4.mjs';
22
29
  export { MenuItemGroup } from './chunk-IWENGARY.mjs';
23
30
  export { MenuItem } from './chunk-NSGDRTSQ.mjs';
24
31
  export { Menu, useMenuContext } from './chunk-WDAMDVLU.mjs';
25
- export { Message, MessageContainer } from './chunk-BIWO5KB4.mjs';
26
- export { Modal } from './chunk-7OLWGHUR.mjs';
27
- export { NotificationContainer, notification } from './chunk-ADOPAXPG.mjs';
28
- export { Pagination } from './chunk-CTAMMQBC.mjs';
29
- export { Popconfirm } from './chunk-HQXZVTP4.mjs';
32
+ export { Message, MessageContainer } from './chunk-CJJ56NVL.mjs';
33
+ export { Modal } from './chunk-MF3H7WWW.mjs';
34
+ export { NotificationContainer, notification } from './chunk-JI7SFMUT.mjs';
30
35
  export { FormItem } from './chunk-GIYBVWR4.mjs';
36
+ export { Form, useFormContext } from './chunk-3XXXM4OB.mjs';
31
37
  export { Header } from './chunk-HUMGEP7S.mjs';
32
- export { Icon } from './chunk-ALP3KYYY.mjs';
38
+ export { Icon } from './chunk-3XKBDV2Q.mjs';
33
39
  export { Input } from './chunk-6ZTCBQJ7.mjs';
34
40
  export { Layout } from './chunk-7O2OQKVY.mjs';
41
+ export { LineChart } from './chunk-VBSK4TGO.mjs';
35
42
  export { Link } from './chunk-WSJO2PIE.mjs';
36
- export { List } from './chunk-BJU5N7WU.mjs';
37
- export { Select } from './chunk-YYKJ63LD.mjs';
38
- export { Loading } from './chunk-PUDU34R4.mjs';
39
43
  export { Descriptions } from './chunk-6575DOCV.mjs';
40
44
  export { Divider } from './chunk-EB6EDLJZ.mjs';
41
- export { Drawer } from './chunk-XDKXL2BP.mjs';
42
- export { DropdownItem } from './chunk-DCRVIDMY.mjs';
43
- export { Dropdown } from './chunk-WSCSDSV7.mjs';
44
- import './chunk-ZO4XVOHU.mjs';
45
+ export { DonutChart } from './chunk-6DYS4PJT.mjs';
46
+ export { PieChart } from './chunk-LZNG2HGC.mjs';
47
+ export { Drawer } from './chunk-KV4LLPAY.mjs';
48
+ export { DropdownItem } from './chunk-6ZC7H22S.mjs';
49
+ export { Dropdown } from './chunk-7IKJBQQV.mjs';
50
+ import './chunk-WLIFEALE.mjs';
45
51
  export { DropdownMenu } from './chunk-SIVJX7VU.mjs';
46
52
  export { Footer } from './chunk-SJ5RFU2O.mjs';
47
- export { Form, useFormContext } from './chunk-3XXXM4OB.mjs';
48
53
  export { Checkbox } from './chunk-TR246HQP.mjs';
49
54
  export { CheckboxGroup } from './chunk-OCVQ3LOT.mjs';
50
55
  export { Code } from './chunk-OHIZYM65.mjs';
@@ -54,13 +59,22 @@ export { ConfigProvider, useTigerConfig } from './chunk-VEGBO77D.mjs';
54
59
  export { Container } from './chunk-472D2S4R.mjs';
55
60
  export { Content } from './chunk-OQTPXPAP.mjs';
56
61
  export { DatePicker } from './chunk-XS5JP2KO.mjs';
62
+ export { Button } from './chunk-STEIWBMF.mjs';
63
+ export { Card } from './chunk-VD3IK5XT.mjs';
57
64
  export { Alert } from './chunk-CR4QK2AB.mjs';
65
+ export { AreaChart } from './chunk-A2UW5OKX.mjs';
58
66
  export { Avatar } from './chunk-V2HVHLBY.mjs';
59
67
  export { Badge } from './chunk-HQLZL3XQ.mjs';
68
+ export { BarChart } from './chunk-KBGURVTD.mjs';
69
+ export { useChartInteraction } from './chunk-3CDAG4HD.mjs';
70
+ export { ChartAxis } from './chunk-RQSQXQN6.mjs';
71
+ export { ChartCanvas } from './chunk-IS467WAO.mjs';
72
+ export { ChartGrid } from './chunk-677VSTPW.mjs';
73
+ export { ChartLegend } from './chunk-Z6F67MJE.mjs';
74
+ export { ChartSeries } from './chunk-SDLMB34Y.mjs';
75
+ export { ChartTooltip } from './chunk-LVC43YX2.mjs';
60
76
  export { BreadcrumbItem } from './chunk-WEGU7O4J.mjs';
61
77
  export { Breadcrumb, useBreadcrumbContext } from './chunk-7JQ7LURS.mjs';
62
- export { Button } from './chunk-STEIWBMF.mjs';
63
- export { Card } from './chunk-VD3IK5XT.mjs';
64
78
  export * from '@expcat/tigercat-core';
65
79
 
66
80
  var version = "0.0.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expcat/tigercat-react",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "React components for Tigercat UI library",
5
5
  "license": "MIT",
6
6
  "author": "Yizhe Wang",
@@ -38,7 +38,7 @@
38
38
  "access": "public"
39
39
  },
40
40
  "dependencies": {
41
- "@expcat/tigercat-core": "0.1.8"
41
+ "@expcat/tigercat-core": "0.2.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^25.0.3",
@@ -1,48 +0,0 @@
1
- 'use strict';
2
-
3
- var react = require('react');
4
- var tigercatCore = require('@expcat/tigercat-core');
5
-
6
- // src/utils/overlay.ts
7
- function useClickOutside({
8
- enabled,
9
- refs,
10
- onOutsideClick,
11
- defer = false
12
- }) {
13
- react.useEffect(() => {
14
- if (!enabled) return;
15
- const handler = (event) => {
16
- const elements = refs.map((ref) => ref?.current);
17
- if (tigercatCore.isEventOutside(event, elements)) {
18
- onOutsideClick();
19
- }
20
- };
21
- const attach = () => document.addEventListener("click", handler);
22
- const detach = () => document.removeEventListener("click", handler);
23
- if (!defer) {
24
- attach();
25
- return () => detach();
26
- }
27
- const timer = window.setTimeout(() => attach(), 0);
28
- return () => {
29
- window.clearTimeout(timer);
30
- detach();
31
- };
32
- }, [enabled, refs, onOutsideClick, defer]);
33
- }
34
- function useEscapeKey({ enabled, onEscape }) {
35
- react.useEffect(() => {
36
- if (!enabled) return;
37
- const handler = (event) => {
38
- if (event.defaultPrevented) return;
39
- if (!tigercatCore.isEscapeKey(event)) return;
40
- onEscape();
41
- };
42
- document.addEventListener("keydown", handler);
43
- return () => document.removeEventListener("keydown", handler);
44
- }, [enabled, onEscape]);
45
- }
46
-
47
- exports.useClickOutside = useClickOutside;
48
- exports.useEscapeKey = useEscapeKey;
@@ -1,45 +0,0 @@
1
- import { useEffect } from 'react';
2
- import { isEscapeKey, isEventOutside } from '@expcat/tigercat-core';
3
-
4
- // src/utils/overlay.ts
5
- function useClickOutside({
6
- enabled,
7
- refs,
8
- onOutsideClick,
9
- defer = false
10
- }) {
11
- useEffect(() => {
12
- if (!enabled) return;
13
- const handler = (event) => {
14
- const elements = refs.map((ref) => ref?.current);
15
- if (isEventOutside(event, elements)) {
16
- onOutsideClick();
17
- }
18
- };
19
- const attach = () => document.addEventListener("click", handler);
20
- const detach = () => document.removeEventListener("click", handler);
21
- if (!defer) {
22
- attach();
23
- return () => detach();
24
- }
25
- const timer = window.setTimeout(() => attach(), 0);
26
- return () => {
27
- window.clearTimeout(timer);
28
- detach();
29
- };
30
- }, [enabled, refs, onOutsideClick, defer]);
31
- }
32
- function useEscapeKey({ enabled, onEscape }) {
33
- useEffect(() => {
34
- if (!enabled) return;
35
- const handler = (event) => {
36
- if (event.defaultPrevented) return;
37
- if (!isEscapeKey(event)) return;
38
- onEscape();
39
- };
40
- document.addEventListener("keydown", handler);
41
- return () => document.removeEventListener("keydown", handler);
42
- }, [enabled, onEscape]);
43
- }
44
-
45
- export { useClickOutside, useEscapeKey };