@ariakit/react 0.4.26 → 0.4.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 (319) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/cjs/__chunks/2HXQHKBC.cjs +59 -0
  3. package/cjs/__chunks/2MDC3Z3V.cjs +43 -0
  4. package/cjs/__chunks/334WKW6I.cjs +19 -0
  5. package/cjs/__chunks/34UJGLOZ.cjs +236 -0
  6. package/cjs/__chunks/3FIXGHZ2.cjs +59 -0
  7. package/cjs/__chunks/4RKQMGBK.cjs +1179 -0
  8. package/cjs/__chunks/5NTEPQ2U.cjs +148 -0
  9. package/cjs/__chunks/66G6K4UR.cjs +1 -0
  10. package/cjs/__chunks/6GNM57O7.cjs +1 -0
  11. package/cjs/__chunks/7M4GY5DS.cjs +255 -0
  12. package/cjs/__chunks/7MXJT4IN.cjs +17 -0
  13. package/cjs/__chunks/7POA4244.cjs +184 -0
  14. package/cjs/__chunks/ASOIXRUN.cjs +305 -0
  15. package/cjs/__chunks/C4NVIV6V.cjs +455 -0
  16. package/cjs/__chunks/CR6AS7WL.cjs +1 -0
  17. package/cjs/__chunks/D4HCGWOU.cjs +464 -0
  18. package/cjs/__chunks/DVWS2XPY.cjs +107 -0
  19. package/cjs/__chunks/DWSXHZYM.cjs +20 -0
  20. package/cjs/__chunks/E6EV2Q5P.cjs +1 -0
  21. package/cjs/__chunks/FELYQPO5.cjs +1025 -0
  22. package/cjs/__chunks/FHQ5DVYQ.cjs +34 -0
  23. package/cjs/__chunks/FIPBE5IX.cjs +23 -0
  24. package/cjs/__chunks/FVIS5BFZ.cjs +41 -0
  25. package/cjs/__chunks/GUB6WHB6.cjs +51 -0
  26. package/cjs/__chunks/GUY4MKX2.cjs +56 -0
  27. package/cjs/__chunks/IF5DZKAR.cjs +1 -0
  28. package/cjs/__chunks/IFZV5LA3.cjs +94 -0
  29. package/cjs/__chunks/IHVFJGGN.cjs +32 -0
  30. package/cjs/__chunks/L2IFVMDU.cjs +96 -0
  31. package/cjs/__chunks/LCX235VJ.cjs +53 -0
  32. package/cjs/__chunks/LMCBLO3G.cjs +42 -0
  33. package/cjs/__chunks/LS5VO6AA.cjs +44 -0
  34. package/cjs/__chunks/LVHC4DSB.cjs +117 -0
  35. package/cjs/__chunks/MN5TONXW.cjs +123 -0
  36. package/cjs/__chunks/N3DLR7OL.cjs +34 -0
  37. package/cjs/__chunks/NFZWL7LE.cjs +24 -0
  38. package/cjs/__chunks/NG34QRI6.cjs +264 -0
  39. package/cjs/__chunks/NIOJG7C4.cjs +1 -0
  40. package/cjs/__chunks/NMUCJYMR.cjs +496 -0
  41. package/cjs/__chunks/OOFUBC32.cjs +109 -0
  42. package/cjs/__chunks/OQRQJNBU.cjs +1 -0
  43. package/cjs/__chunks/PDPE2VAZ.cjs +1035 -0
  44. package/cjs/__chunks/PTE2IJM5.cjs +143 -0
  45. package/cjs/__chunks/PU63IQFD.cjs +447 -0
  46. package/cjs/__chunks/PZXRBFZF.cjs +38 -0
  47. package/cjs/__chunks/QAUJZR6Y.cjs +996 -0
  48. package/cjs/__chunks/QYDAT3QF.cjs +1 -0
  49. package/cjs/__chunks/QYLMYWKV.cjs +1 -0
  50. package/cjs/__chunks/RGH2H3WL.cjs +34 -0
  51. package/cjs/__chunks/RLKC7JVT.cjs +19 -0
  52. package/cjs/__chunks/RR46KI45.cjs +17 -0
  53. package/cjs/__chunks/RVXPEX7O.cjs +150 -0
  54. package/cjs/__chunks/RXZPZPJX.cjs +95 -0
  55. package/cjs/__chunks/SIF7IN4L.cjs +62 -0
  56. package/cjs/__chunks/SQ72MZ63.cjs +294 -0
  57. package/cjs/__chunks/SXAPGTJ4.cjs +23 -0
  58. package/cjs/__chunks/TLUFYZC7.cjs +37 -0
  59. package/cjs/__chunks/TSBEWPNT.cjs +1922 -0
  60. package/cjs/__chunks/U2UYQT45.cjs +1 -0
  61. package/cjs/__chunks/UUEFM3TG.cjs +75 -0
  62. package/cjs/__chunks/UV7CXZEM.cjs +36 -0
  63. package/cjs/__chunks/VXDLN5CP.cjs +234 -0
  64. package/cjs/__chunks/VXUZM542.cjs +789 -0
  65. package/cjs/__chunks/W27WRDUB.cjs +1 -0
  66. package/cjs/__chunks/X4U3XKYQ.cjs +7 -0
  67. package/cjs/__chunks/XH4GE3VE.cjs +29 -0
  68. package/cjs/__chunks/XPQIHUQ7.cjs +172 -0
  69. package/cjs/__chunks/YEXJT4IL.cjs +55 -0
  70. package/cjs/__chunks/Z5PDS46M.cjs +975 -0
  71. package/cjs/__chunks/ZNW2LLWJ.cjs +108 -0
  72. package/cjs/__chunks/ZYPARRXG.cjs +19 -0
  73. package/cjs/button.cjs +7 -3
  74. package/cjs/button.d.cts +2 -2
  75. package/cjs/button.d.ts +2 -2
  76. package/cjs/checkbox.cjs +11 -2
  77. package/cjs/checkbox.d.cts +9 -9
  78. package/cjs/checkbox.d.ts +9 -9
  79. package/cjs/collection.cjs +8 -2
  80. package/cjs/collection.d.cts +9 -9
  81. package/cjs/collection.d.ts +9 -9
  82. package/cjs/combobox.cjs +33 -2
  83. package/cjs/combobox.d.cts +33 -33
  84. package/cjs/combobox.d.ts +33 -33
  85. package/cjs/command.cjs +6 -3
  86. package/cjs/command.d.cts +2 -2
  87. package/cjs/command.d.ts +2 -2
  88. package/cjs/composite.cjs +24 -2
  89. package/cjs/composite.d.cts +21 -21
  90. package/cjs/composite.d.ts +21 -21
  91. package/cjs/dialog.cjs +24 -2
  92. package/cjs/dialog.d.cts +15 -15
  93. package/cjs/dialog.d.ts +15 -15
  94. package/cjs/disclosure.cjs +11 -2
  95. package/cjs/disclosure.d.cts +9 -9
  96. package/cjs/disclosure.d.ts +9 -9
  97. package/cjs/focus-trap.cjs +6 -2
  98. package/cjs/focus-trap.d.cts +4 -4
  99. package/cjs/focus-trap.d.ts +4 -4
  100. package/cjs/focusable.cjs +5 -3
  101. package/cjs/focusable.d.cts +2 -2
  102. package/cjs/focusable.d.ts +2 -2
  103. package/cjs/form.cjs +15 -2
  104. package/cjs/form.d.cts +37 -37
  105. package/cjs/form.d.ts +37 -37
  106. package/cjs/group.cjs +5 -3
  107. package/cjs/group.d.cts +4 -4
  108. package/cjs/group.d.ts +4 -4
  109. package/cjs/heading.cjs +7 -3
  110. package/cjs/heading.d.cts +4 -4
  111. package/cjs/heading.d.ts +4 -4
  112. package/cjs/hovercard.cjs +28 -2
  113. package/cjs/hovercard.d.cts +19 -19
  114. package/cjs/hovercard.d.ts +19 -19
  115. package/cjs/index.cjs +103 -28
  116. package/cjs/menu.cjs +44 -2
  117. package/cjs/menu.d.cts +41 -41
  118. package/cjs/menu.d.ts +41 -41
  119. package/cjs/menubar.cjs +10 -3
  120. package/cjs/menubar.d.cts +7 -7
  121. package/cjs/menubar.d.ts +7 -7
  122. package/cjs/popover.cjs +33 -2
  123. package/cjs/popover.d.cts +21 -21
  124. package/cjs/popover.d.ts +21 -21
  125. package/cjs/portal.cjs +7 -3
  126. package/cjs/portal.d.cts +3 -3
  127. package/cjs/portal.d.ts +3 -3
  128. package/cjs/radio.cjs +13 -2
  129. package/cjs/radio.d.cts +9 -9
  130. package/cjs/radio.d.ts +9 -9
  131. package/cjs/role.cjs +5 -3
  132. package/cjs/role.d.cts +2 -2
  133. package/cjs/role.d.ts +2 -2
  134. package/cjs/select.cjs +39 -2
  135. package/cjs/select.d.cts +33 -33
  136. package/cjs/select.d.ts +33 -33
  137. package/cjs/separator.cjs +5 -3
  138. package/cjs/separator.d.cts +2 -2
  139. package/cjs/separator.d.ts +2 -2
  140. package/cjs/store.cjs +5 -3
  141. package/cjs/store.d.cts +1 -1
  142. package/cjs/store.d.ts +1 -1
  143. package/cjs/tab.cjs +15 -2
  144. package/cjs/tab.d.cts +11 -11
  145. package/cjs/tab.d.ts +11 -11
  146. package/cjs/toolbar.cjs +13 -2
  147. package/cjs/toolbar.d.cts +15 -15
  148. package/cjs/toolbar.d.ts +15 -15
  149. package/cjs/tooltip.cjs +16 -2
  150. package/cjs/tooltip.d.cts +11 -11
  151. package/cjs/tooltip.d.ts +11 -11
  152. package/cjs/visually-hidden.cjs +5 -3
  153. package/cjs/visually-hidden.d.cts +2 -2
  154. package/cjs/visually-hidden.d.ts +2 -2
  155. package/esm/__chunks/2RKMXQTW.js +10 -0
  156. package/esm/__chunks/3Y4V2DTP.js +8 -0
  157. package/esm/__chunks/5FGJT4YF.js +10 -0
  158. package/esm/__chunks/ASWYYI35.js +26 -0
  159. package/esm/__chunks/BCX2X2B5.js +40 -0
  160. package/esm/__chunks/BLUBZ7NO.js +28 -0
  161. package/esm/__chunks/CKEWLSMJ.js +8 -0
  162. package/esm/__chunks/CSCX5ZBZ.js +40 -0
  163. package/esm/__chunks/CTJDBGJU.js +18 -0
  164. package/esm/__chunks/DAO5N24L.js +16 -0
  165. package/esm/__chunks/E3G6CWS6.js +16 -0
  166. package/esm/__chunks/IVVNCX6W.js +16 -0
  167. package/esm/__chunks/LQB76ROL.js +16 -0
  168. package/esm/__chunks/MALDUIAO.js +28 -0
  169. package/esm/__chunks/MP5ILXF3.js +14 -0
  170. package/esm/__chunks/O3FPWSHV.js +10 -0
  171. package/esm/__chunks/OKEWM6H4.js +10 -0
  172. package/esm/__chunks/QL3WKMBE.js +8 -0
  173. package/esm/__chunks/RD2DI27Y.js +44 -0
  174. package/esm/__chunks/SB7MN4B3.js +22 -0
  175. package/esm/__chunks/UA4GRLAL.js +52 -0
  176. package/esm/__chunks/UBB5N3OM.js +22 -0
  177. package/esm/__chunks/WC6KFHZH.js +8 -0
  178. package/esm/__chunks/WFREFNZD.js +8 -0
  179. package/esm/__chunks/WH35KJXV.js +8 -0
  180. package/esm/__chunks/WQKZESWL.js +18 -0
  181. package/esm/__chunks/YAS6EMRP.js +8 -0
  182. package/esm/button.d.ts +2 -2
  183. package/esm/button.js +1 -1
  184. package/esm/checkbox.d.ts +9 -9
  185. package/esm/checkbox.js +1 -1
  186. package/esm/collection.d.ts +9 -9
  187. package/esm/collection.js +1 -1
  188. package/esm/combobox.d.ts +33 -33
  189. package/esm/combobox.js +1 -1
  190. package/esm/command.d.ts +2 -2
  191. package/esm/command.js +1 -1
  192. package/esm/composite.d.ts +21 -21
  193. package/esm/composite.js +1 -1
  194. package/esm/dialog.d.ts +15 -15
  195. package/esm/dialog.js +1 -1
  196. package/esm/disclosure.d.ts +9 -9
  197. package/esm/disclosure.js +1 -1
  198. package/esm/focus-trap.d.ts +4 -4
  199. package/esm/focus-trap.js +1 -1
  200. package/esm/focusable.d.ts +2 -2
  201. package/esm/focusable.js +1 -1
  202. package/esm/form.d.ts +37 -37
  203. package/esm/form.js +1 -1
  204. package/esm/group.d.ts +4 -4
  205. package/esm/group.js +1 -1
  206. package/esm/heading.d.ts +4 -4
  207. package/esm/heading.js +1 -1
  208. package/esm/hovercard.d.ts +19 -19
  209. package/esm/hovercard.js +1 -1
  210. package/esm/index.js +27 -27
  211. package/esm/menu.d.ts +41 -41
  212. package/esm/menu.js +1 -1
  213. package/esm/menubar.d.ts +7 -7
  214. package/esm/menubar.js +1 -1
  215. package/esm/popover.d.ts +21 -21
  216. package/esm/popover.js +1 -1
  217. package/esm/portal.d.ts +3 -3
  218. package/esm/portal.js +1 -1
  219. package/esm/radio.d.ts +9 -9
  220. package/esm/radio.js +1 -1
  221. package/esm/role.d.ts +2 -2
  222. package/esm/role.js +1 -1
  223. package/esm/select.d.ts +33 -33
  224. package/esm/select.js +1 -1
  225. package/esm/separator.d.ts +2 -2
  226. package/esm/separator.js +1 -1
  227. package/esm/store.d.ts +1 -1
  228. package/esm/store.js +1 -1
  229. package/esm/tab.d.ts +11 -11
  230. package/esm/tab.js +1 -1
  231. package/esm/toolbar.d.ts +15 -15
  232. package/esm/toolbar.js +1 -1
  233. package/esm/tooltip.d.ts +11 -11
  234. package/esm/tooltip.js +1 -1
  235. package/esm/visually-hidden.d.ts +2 -2
  236. package/esm/visually-hidden.js +1 -1
  237. package/package.json +2 -2
  238. package/src/button.ts +5 -0
  239. package/src/checkbox.ts +19 -0
  240. package/src/collection.ts +19 -0
  241. package/src/combobox.ts +76 -0
  242. package/src/command.ts +5 -0
  243. package/src/composite.ts +49 -0
  244. package/src/dialog.ts +34 -0
  245. package/src/disclosure.ts +19 -0
  246. package/src/focus-trap.ts +11 -0
  247. package/src/focusable.ts +5 -0
  248. package/src/form.ts +90 -0
  249. package/src/group.ts +10 -0
  250. package/src/heading.ts +7 -0
  251. package/src/hovercard.ts +44 -0
  252. package/src/index.ts +27 -0
  253. package/src/menu.ts +100 -0
  254. package/src/menubar.ts +14 -0
  255. package/src/popover.ts +49 -0
  256. package/src/portal.ts +6 -0
  257. package/src/radio.ts +19 -0
  258. package/src/role.ts +5 -0
  259. package/src/select.ts +76 -0
  260. package/src/separator.ts +5 -0
  261. package/src/store.ts +1 -0
  262. package/src/tab.ts +21 -0
  263. package/src/toolbar.ts +34 -0
  264. package/src/tooltip.ts +24 -0
  265. package/src/visually-hidden.ts +5 -0
  266. package/cjs/__chunks/24MX6KII.cjs +0 -14
  267. package/cjs/__chunks/2IFRJ7YS.cjs +0 -6
  268. package/cjs/__chunks/32YVOHOP.cjs +0 -50
  269. package/cjs/__chunks/4BAIAF3U.cjs +0 -14
  270. package/cjs/__chunks/4J2CIZDN.cjs +0 -14
  271. package/cjs/__chunks/4TTUYQMJ.cjs +0 -20
  272. package/cjs/__chunks/6QAXTQNM.cjs +0 -16
  273. package/cjs/__chunks/6WNPYLAU.cjs +0 -6
  274. package/cjs/__chunks/A2CP2RQF.cjs +0 -24
  275. package/cjs/__chunks/AEV4Y6LH.cjs +0 -8
  276. package/cjs/__chunks/APHGV4DJ.cjs +0 -6
  277. package/cjs/__chunks/B34XK6WF.cjs +0 -8
  278. package/cjs/__chunks/BFD7ZBIV.cjs +0 -26
  279. package/cjs/__chunks/CZIDOP5N.cjs +0 -38
  280. package/cjs/__chunks/ETUDK33Z.cjs +0 -26
  281. package/cjs/__chunks/GJC4LCYO.cjs +0 -16
  282. package/cjs/__chunks/KGVA5X7R.cjs +0 -38
  283. package/cjs/__chunks/LAX4QA6C.cjs +0 -42
  284. package/cjs/__chunks/MDOKA7B5.cjs +0 -6
  285. package/cjs/__chunks/Q2GGGIV7.cjs +0 -6
  286. package/cjs/__chunks/QKCQWENM.cjs +0 -6
  287. package/cjs/__chunks/QPSUJCLN.cjs +0 -12
  288. package/cjs/__chunks/TDX6HS73.cjs +0 -8
  289. package/cjs/__chunks/UPMOBIQ3.cjs +0 -20
  290. package/cjs/__chunks/W6XMZ4GT.cjs +0 -14
  291. package/cjs/__chunks/WXEUE6MJ.cjs +0 -6
  292. package/cjs/__chunks/XTZIX6PF.cjs +0 -8
  293. package/esm/__chunks/3IMSX6M3.js +0 -8
  294. package/esm/__chunks/4H6IIOQF.js +0 -22
  295. package/esm/__chunks/5OF2JM6T.js +0 -16
  296. package/esm/__chunks/6FL2IFMJ.js +0 -16
  297. package/esm/__chunks/6N4GEF7O.js +0 -18
  298. package/esm/__chunks/6OHDLPN7.js +0 -8
  299. package/esm/__chunks/7FQAKYJR.js +0 -26
  300. package/esm/__chunks/AJMZU3YP.js +0 -28
  301. package/esm/__chunks/DZPSY7QT.js +0 -22
  302. package/esm/__chunks/H2GJECQG.js +0 -8
  303. package/esm/__chunks/JBAWBCWC.js +0 -8
  304. package/esm/__chunks/LI3X5M2M.js +0 -8
  305. package/esm/__chunks/NV5BVS3O.js +0 -8
  306. package/esm/__chunks/PGIWSRTG.js +0 -28
  307. package/esm/__chunks/PRYHFEBA.js +0 -10
  308. package/esm/__chunks/UTW5KHW6.js +0 -16
  309. package/esm/__chunks/VGHCPDMA.js +0 -8
  310. package/esm/__chunks/VHD2YK6B.js +0 -18
  311. package/esm/__chunks/WA3BE3AY.js +0 -10
  312. package/esm/__chunks/XHSNLTYJ.js +0 -10
  313. package/esm/__chunks/XIMRDTWX.js +0 -14
  314. package/esm/__chunks/YQF2RGHD.js +0 -44
  315. package/esm/__chunks/ZDPYYVJP.js +0 -40
  316. package/esm/__chunks/ZFJPKQV6.js +0 -52
  317. package/esm/__chunks/ZL4AJIDL.js +0 -10
  318. package/esm/__chunks/ZQSDMYJA.js +0 -16
  319. package/esm/__chunks/ZVIXWGHS.js +0 -40
@@ -0,0 +1,143 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+ var _PU63IQFDcjs = require('./PU63IQFD.cjs');
7
+
8
+
9
+ var _RVXPEX7Ocjs = require('./RVXPEX7O.cjs');
10
+
11
+
12
+ var _FVIS5BFZcjs = require('./FVIS5BFZ.cjs');
13
+
14
+
15
+ var _RGH2H3WLcjs = require('./RGH2H3WL.cjs');
16
+
17
+
18
+ var _D4HCGWOUcjs = require('./D4HCGWOU.cjs');
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+ var _QAUJZR6Ycjs = require('./QAUJZR6Y.cjs');
29
+
30
+ // ../ariakit-react-components/dist/hovercard/hovercard-arrow.js
31
+ var TagName = "div";
32
+ var useHovercardArrow = _QAUJZR6Ycjs.createHook.call(void 0, function useHovercardArrow2({ store, ...props }) {
33
+ const context = _PU63IQFDcjs.useHovercardContext.call(void 0, );
34
+ store = store || context;
35
+ props = _RVXPEX7Ocjs.usePopoverArrow.call(void 0, {
36
+ store,
37
+ ...props
38
+ });
39
+ return props;
40
+ });
41
+ var HovercardArrow = _QAUJZR6Ycjs.forwardRef.call(void 0, function HovercardArrow2(props) {
42
+ return _QAUJZR6Ycjs.createElement.call(void 0, TagName, useHovercardArrow(props));
43
+ });
44
+
45
+ // ../ariakit-react-components/dist/hovercard/hovercard-disclosure.js
46
+ var _react = require('react');
47
+ var _jsxruntime = require('react/jsx-runtime');
48
+ var TagName2 = "button";
49
+ var useHovercardDisclosure = _QAUJZR6Ycjs.createHook.call(void 0, function useHovercardDisclosure2({ store, ...props }) {
50
+ const context = _PU63IQFDcjs.useHovercardProviderContext.call(void 0, );
51
+ store = store || context;
52
+ _QAUJZR6Ycjs.invariant.call(void 0, store, "HovercardDisclosure must receive a `store` prop or be wrapped in a HovercardProvider component.");
53
+ const [visible, setVisible] = _react.useState.call(void 0, false);
54
+ _react.useEffect.call(void 0, () => {
55
+ if (!visible) return;
56
+ const onBlur = (event) => {
57
+ if (!store) return;
58
+ const nextActiveElement = event.relatedTarget;
59
+ if (nextActiveElement) {
60
+ const { anchorElement: anchor, popoverElement: popover, disclosureElement: disclosure } = store.getState();
61
+ if (anchor && _QAUJZR6Ycjs.contains.call(void 0, anchor, nextActiveElement)) return;
62
+ if (popover && _QAUJZR6Ycjs.contains.call(void 0, popover, nextActiveElement)) return;
63
+ if (disclosure && _QAUJZR6Ycjs.contains.call(void 0, disclosure, nextActiveElement)) return;
64
+ if (nextActiveElement.hasAttribute("data-focus-trap")) return;
65
+ }
66
+ setVisible(false);
67
+ };
68
+ return _QAUJZR6Ycjs.addGlobalEventListener.call(void 0, "focusout", onBlur, true);
69
+ }, [visible, store]);
70
+ _react.useEffect.call(void 0, () => {
71
+ return _D4HCGWOUcjs.sync.call(void 0, store, ["anchorElement"], (state) => {
72
+ const anchor = state.anchorElement;
73
+ if (!anchor) return;
74
+ const observer = new MutationObserver(() => {
75
+ if (!anchor.hasAttribute("data-focus-visible")) return;
76
+ setVisible(true);
77
+ });
78
+ observer.observe(anchor, { attributeFilter: ["data-focus-visible"] });
79
+ return () => observer.disconnect();
80
+ });
81
+ }, [store]);
82
+ const onClickProp = props.onClick;
83
+ const onClick = _QAUJZR6Ycjs.useEvent.call(void 0, (event) => {
84
+ onClickProp == null ? void 0 : onClickProp(event);
85
+ if (event.defaultPrevented) return;
86
+ store == null ? void 0 : store.setAutoFocusOnShow(true);
87
+ });
88
+ const onFocusProp = props.onFocus;
89
+ const onFocus = _QAUJZR6Ycjs.useEvent.call(void 0, (event) => {
90
+ onFocusProp == null ? void 0 : onFocusProp(event);
91
+ if (event.defaultPrevented) return;
92
+ setVisible(true);
93
+ });
94
+ const { style } = _RGH2H3WLcjs.useVisuallyHidden.call(void 0, );
95
+ if (!visible) props = {
96
+ ...props,
97
+ style: {
98
+ ...style,
99
+ ...props.style
100
+ }
101
+ };
102
+ props = {
103
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", {
104
+ display: "block",
105
+ fill: "none",
106
+ stroke: "currentColor",
107
+ strokeLinecap: "round",
108
+ strokeLinejoin: "round",
109
+ strokeWidth: 1.5,
110
+ viewBox: "0 0 16 16",
111
+ height: "1em",
112
+ width: "1em",
113
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "polyline", { points: "4,6 8,10 12,6" })
114
+ }),
115
+ ...props,
116
+ ref: _QAUJZR6Ycjs.useMergeRefs.call(void 0, store.setDisclosureElement, props.ref),
117
+ onClick,
118
+ onFocus
119
+ };
120
+ props = _FVIS5BFZcjs.useDialogDisclosure.call(void 0, {
121
+ store,
122
+ ...props
123
+ });
124
+ return props;
125
+ });
126
+ var HovercardDisclosure = _QAUJZR6Ycjs.forwardRef.call(void 0, function HovercardDisclosure2(props) {
127
+ return _QAUJZR6Ycjs.createElement.call(void 0, TagName2, useHovercardDisclosure(props));
128
+ });
129
+
130
+ // ../ariakit-react-components/dist/hovercard/hovercard-provider.js
131
+
132
+ function HovercardProvider(props = {}) {
133
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _PU63IQFDcjs.HovercardContextProvider, {
134
+ value: _PU63IQFDcjs.useHovercardStore.call(void 0, props),
135
+ children: props.children
136
+ });
137
+ }
138
+
139
+
140
+
141
+
142
+
143
+ exports.HovercardArrow = HovercardArrow; exports.HovercardDisclosure = HovercardDisclosure; exports.HovercardProvider = HovercardProvider;
@@ -0,0 +1,447 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _TSBEWPNTcjs = require('./TSBEWPNT.cjs');
6
+
7
+
8
+
9
+ var _FIPBE5IXcjs = require('./FIPBE5IX.cjs');
10
+
11
+
12
+ var _PDPE2VAZcjs = require('./PDPE2VAZ.cjs');
13
+
14
+
15
+
16
+
17
+
18
+
19
+ var _D4HCGWOUcjs = require('./D4HCGWOU.cjs');
20
+
21
+
22
+ var _NG34QRI6cjs = require('./NG34QRI6.cjs');
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+ var _QAUJZR6Ycjs = require('./QAUJZR6Y.cjs');
45
+
46
+ // ../ariakit-react-components/dist/hovercard/hovercard-context.js
47
+ var ctx = _QAUJZR6Ycjs.createStoreContext.call(void 0, [_FIPBE5IXcjs.PopoverContextProvider], [_FIPBE5IXcjs.PopoverScopedContextProvider]);
48
+ var useHovercardContext = ctx.useContext;
49
+ var useHovercardScopedContext = ctx.useScopedContext;
50
+ var useHovercardProviderContext = ctx.useProviderContext;
51
+ var HovercardContextProvider = ctx.ContextProvider;
52
+ var HovercardScopedContextProvider = ctx.ScopedContextProvider;
53
+
54
+ // ../ariakit-react-components/dist/hovercard/utils/polygon.js
55
+ function getEventPoint(event) {
56
+ return [event.clientX, event.clientY];
57
+ }
58
+ function isPointInPolygon(point, polygon) {
59
+ const [x, y] = point;
60
+ let inside = false;
61
+ const length = polygon.length;
62
+ for (let l = length, i = 0, j = l - 1; i < l; j = i++) {
63
+ const currentPoint = polygon[i];
64
+ const previousPoint = polygon[j];
65
+ const vertexPoint = polygon[j === 0 ? l - 1 : j - 1];
66
+ if (currentPoint == null) return false;
67
+ if (previousPoint == null) return false;
68
+ if (vertexPoint == null) return false;
69
+ const [xi, yi] = currentPoint;
70
+ const [xj, yj] = previousPoint;
71
+ const [, vy] = vertexPoint;
72
+ const where = (yi - yj) * (x - xi) - (xi - xj) * (y - yi);
73
+ if (yj < yi) {
74
+ if (y >= yj && y < yi) {
75
+ if (where === 0) return true;
76
+ if (where > 0) if (y === yj) {
77
+ if (y > vy) inside = !inside;
78
+ } else inside = !inside;
79
+ }
80
+ } else if (yi < yj) {
81
+ if (y > yi && y <= yj) {
82
+ if (where === 0) return true;
83
+ if (where < 0) if (y === yj) {
84
+ if (y < vy) inside = !inside;
85
+ } else inside = !inside;
86
+ }
87
+ } else if (y === yi && (x >= xj && x <= xi || x >= xi && x <= xj)) return true;
88
+ }
89
+ return inside;
90
+ }
91
+ function getEnterPointPlacement(enterPoint, rect) {
92
+ const { top, right, bottom, left } = rect;
93
+ const [x, y] = enterPoint;
94
+ return [x < left ? "left" : x > right ? "right" : null, y < top ? "top" : y > bottom ? "bottom" : null];
95
+ }
96
+ function getElementPolygon(element, enterPoint) {
97
+ const rect = element.getBoundingClientRect();
98
+ const { top, right, bottom, left } = rect;
99
+ const [x, y] = getEnterPointPlacement(enterPoint, rect);
100
+ const polygon = [enterPoint];
101
+ if (x) {
102
+ if (y !== "top") polygon.push([x === "left" ? left : right, top]);
103
+ polygon.push([x === "left" ? right : left, top]);
104
+ polygon.push([x === "left" ? right : left, bottom]);
105
+ if (y !== "bottom") polygon.push([x === "left" ? left : right, bottom]);
106
+ } else if (y === "top") {
107
+ polygon.push([left, top]);
108
+ polygon.push([left, bottom]);
109
+ polygon.push([right, bottom]);
110
+ polygon.push([right, top]);
111
+ } else {
112
+ polygon.push([left, bottom]);
113
+ polygon.push([left, top]);
114
+ polygon.push([right, top]);
115
+ polygon.push([right, bottom]);
116
+ }
117
+ return polygon;
118
+ }
119
+
120
+ // ../ariakit-react-components/dist/hovercard/hovercard.js
121
+ var _react = require('react');
122
+ var _jsxruntime = require('react/jsx-runtime');
123
+ var TagName = "div";
124
+ function isMovingOnHovercard(target, card, anchor, nested) {
125
+ if (_QAUJZR6Ycjs.hasFocusWithin.call(void 0, card)) return true;
126
+ if (!target) return false;
127
+ if (_QAUJZR6Ycjs.contains.call(void 0, card, target)) return true;
128
+ if (anchor && _QAUJZR6Ycjs.contains.call(void 0, anchor, target)) return true;
129
+ if (nested == null ? void 0 : nested.some((card2) => isMovingOnHovercard(target, card2, anchor))) return true;
130
+ return false;
131
+ }
132
+ function useAutoFocusOnHide({ store, ...props }) {
133
+ const [autoFocusOnHide, setAutoFocusOnHide] = _react.useState.call(void 0, false);
134
+ const mounted = _D4HCGWOUcjs.useStoreState.call(void 0, store, "mounted");
135
+ _react.useEffect.call(void 0, () => {
136
+ if (!mounted) setAutoFocusOnHide(false);
137
+ }, [mounted]);
138
+ const onFocusProp = props.onFocus;
139
+ const onFocus = _QAUJZR6Ycjs.useEvent.call(void 0, (event) => {
140
+ onFocusProp == null ? void 0 : onFocusProp(event);
141
+ if (event.defaultPrevented) return;
142
+ setAutoFocusOnHide(true);
143
+ });
144
+ const finalFocusRef = _react.useRef.call(void 0, null);
145
+ _react.useEffect.call(void 0, () => {
146
+ return _D4HCGWOUcjs.sync.call(void 0, store, ["anchorElement"], (state) => {
147
+ finalFocusRef.current = state.anchorElement;
148
+ });
149
+ }, [store]);
150
+ props = {
151
+ autoFocusOnHide,
152
+ finalFocus: finalFocusRef,
153
+ ...props,
154
+ onFocus
155
+ };
156
+ return props;
157
+ }
158
+ var NestedHovercardContext = _react.createContext.call(void 0, null);
159
+ var useHovercard = _QAUJZR6Ycjs.createHook.call(void 0, function useHovercard2({ store, modal = false, portal = modal, hideOnEscape = true, hideOnHoverOutside = true, disablePointerEventsOnApproach = !!hideOnHoverOutside, ...props }) {
160
+ const context = useHovercardProviderContext();
161
+ store = store || context;
162
+ _QAUJZR6Ycjs.invariant.call(void 0, store, "Hovercard must receive a `store` prop or be wrapped in a HovercardProvider component.");
163
+ const ref = _react.useRef.call(void 0, null);
164
+ const [nestedHovercards, setNestedHovercards] = _react.useState.call(void 0, []);
165
+ const hideTimeoutRef = _react.useRef.call(void 0, 0);
166
+ const enterPointRef = _react.useRef.call(void 0, null);
167
+ const { portalRef, domReady } = _QAUJZR6Ycjs.usePortalRef.call(void 0, portal, props.portalRef);
168
+ const isMouseMoving = _QAUJZR6Ycjs.useIsMouseMoving.call(void 0, );
169
+ const mayHideOnHoverOutside = !!hideOnHoverOutside;
170
+ const hideOnHoverOutsideProp = _QAUJZR6Ycjs.useBooleanEvent.call(void 0, hideOnHoverOutside);
171
+ const mayDisablePointerEvents = !!disablePointerEventsOnApproach;
172
+ const disablePointerEventsProp = _QAUJZR6Ycjs.useBooleanEvent.call(void 0, disablePointerEventsOnApproach);
173
+ const open = _D4HCGWOUcjs.useStoreState.call(void 0, store, "open");
174
+ const mounted = _D4HCGWOUcjs.useStoreState.call(void 0, store, "mounted");
175
+ _react.useEffect.call(void 0, () => {
176
+ if (!domReady) return;
177
+ if (!mounted) return;
178
+ if (!mayHideOnHoverOutside && !mayDisablePointerEvents) return;
179
+ const element = ref.current;
180
+ if (!element) return;
181
+ const onMouseMove = (event) => {
182
+ if (!store) return;
183
+ if (!isMouseMoving()) return;
184
+ const { anchorElement, hideTimeout, timeout } = store.getState();
185
+ const enterPoint = enterPointRef.current;
186
+ const [target] = event.composedPath();
187
+ const anchor = anchorElement;
188
+ if (isMovingOnHovercard(target, element, anchor, nestedHovercards)) {
189
+ enterPointRef.current = target && anchor && _QAUJZR6Ycjs.contains.call(void 0, anchor, target) ? getEventPoint(event) : null;
190
+ window.clearTimeout(hideTimeoutRef.current);
191
+ hideTimeoutRef.current = 0;
192
+ return;
193
+ }
194
+ if (hideTimeoutRef.current) return;
195
+ if (enterPoint) {
196
+ const currentPoint = getEventPoint(event);
197
+ if (isPointInPolygon(currentPoint, getElementPolygon(element, enterPoint))) {
198
+ enterPointRef.current = currentPoint;
199
+ if (!disablePointerEventsProp(event)) return;
200
+ event.preventDefault();
201
+ event.stopPropagation();
202
+ return;
203
+ }
204
+ }
205
+ if (!hideOnHoverOutsideProp(event)) return;
206
+ hideTimeoutRef.current = window.setTimeout(() => {
207
+ hideTimeoutRef.current = 0;
208
+ store == null ? void 0 : store.hide();
209
+ }, hideTimeout != null ? hideTimeout : timeout);
210
+ };
211
+ return _QAUJZR6Ycjs.chain.call(void 0, _QAUJZR6Ycjs.addGlobalEventListener.call(void 0, "mousemove", onMouseMove, true), () => clearTimeout(hideTimeoutRef.current));
212
+ }, [
213
+ store,
214
+ isMouseMoving,
215
+ domReady,
216
+ mounted,
217
+ mayHideOnHoverOutside,
218
+ mayDisablePointerEvents,
219
+ nestedHovercards,
220
+ disablePointerEventsProp,
221
+ hideOnHoverOutsideProp
222
+ ]);
223
+ _react.useEffect.call(void 0, () => {
224
+ if (!domReady) return;
225
+ if (!mounted) return;
226
+ if (!mayDisablePointerEvents) return;
227
+ const disableEvent = (event) => {
228
+ const element = ref.current;
229
+ if (!element) return;
230
+ const enterPoint = enterPointRef.current;
231
+ if (!enterPoint) return;
232
+ const polygon = getElementPolygon(element, enterPoint);
233
+ if (isPointInPolygon(getEventPoint(event), polygon)) {
234
+ if (!disablePointerEventsProp(event)) return;
235
+ event.preventDefault();
236
+ event.stopPropagation();
237
+ }
238
+ };
239
+ return _QAUJZR6Ycjs.chain.call(void 0, _QAUJZR6Ycjs.addGlobalEventListener.call(void 0, "mouseenter", disableEvent, true), _QAUJZR6Ycjs.addGlobalEventListener.call(void 0, "mouseover", disableEvent, true), _QAUJZR6Ycjs.addGlobalEventListener.call(void 0, "mouseout", disableEvent, true), _QAUJZR6Ycjs.addGlobalEventListener.call(void 0, "mouseleave", disableEvent, true));
240
+ }, [
241
+ domReady,
242
+ mounted,
243
+ mayDisablePointerEvents,
244
+ disablePointerEventsProp
245
+ ]);
246
+ _react.useEffect.call(void 0, () => {
247
+ if (!domReady) return;
248
+ if (open) return;
249
+ store == null ? void 0 : store.setAutoFocusOnShow(false);
250
+ }, [
251
+ store,
252
+ domReady,
253
+ open
254
+ ]);
255
+ const openRef = _QAUJZR6Ycjs.useLiveRef.call(void 0, open);
256
+ _react.useEffect.call(void 0, () => {
257
+ if (!domReady) return;
258
+ return () => {
259
+ if (!openRef.current) store == null ? void 0 : store.setAutoFocusOnShow(false);
260
+ };
261
+ }, [store, domReady]);
262
+ const registerOnParent = _react.useContext.call(void 0, NestedHovercardContext);
263
+ _QAUJZR6Ycjs.useSafeLayoutEffect.call(void 0, () => {
264
+ if (modal) return;
265
+ if (!portal) return;
266
+ if (!mounted) return;
267
+ if (!domReady) return;
268
+ const element = ref.current;
269
+ if (!element) return;
270
+ return registerOnParent == null ? void 0 : registerOnParent(element);
271
+ }, [
272
+ modal,
273
+ portal,
274
+ mounted,
275
+ domReady
276
+ ]);
277
+ const registerNestedHovercard = _react.useCallback.call(void 0, (element) => {
278
+ setNestedHovercards((prevElements) => [...prevElements, element]);
279
+ const parentUnregister = registerOnParent == null ? void 0 : registerOnParent(element);
280
+ return () => {
281
+ setNestedHovercards((prevElements) => prevElements.filter((item) => item !== element));
282
+ parentUnregister == null ? void 0 : parentUnregister();
283
+ };
284
+ }, [registerOnParent]);
285
+ props = _QAUJZR6Ycjs.useWrapElement.call(void 0, props, (element) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HovercardScopedContextProvider, {
286
+ value: store,
287
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NestedHovercardContext.Provider, {
288
+ value: registerNestedHovercard,
289
+ children: element
290
+ })
291
+ }), [store, registerNestedHovercard]);
292
+ props = {
293
+ ...props,
294
+ ref: _QAUJZR6Ycjs.useMergeRefs.call(void 0, ref, props.ref)
295
+ };
296
+ props = useAutoFocusOnHide({
297
+ store,
298
+ ...props
299
+ });
300
+ const autoFocusOnShow = _D4HCGWOUcjs.useStoreState.call(void 0, store, (state) => modal || state.autoFocusOnShow);
301
+ props = _TSBEWPNTcjs.usePopover.call(void 0, {
302
+ store,
303
+ modal,
304
+ portal,
305
+ autoFocusOnShow,
306
+ ...props,
307
+ portalRef,
308
+ hideOnEscape(event) {
309
+ if (_QAUJZR6Ycjs.isFalsyBooleanCallback.call(void 0, hideOnEscape, event)) return false;
310
+ requestAnimationFrame(() => {
311
+ requestAnimationFrame(() => {
312
+ store == null ? void 0 : store.hide();
313
+ });
314
+ });
315
+ return true;
316
+ }
317
+ });
318
+ return props;
319
+ });
320
+ var Hovercard = _PDPE2VAZcjs.createDialogComponent.call(void 0, _QAUJZR6Ycjs.forwardRef.call(void 0, function Hovercard2(props) {
321
+ return _QAUJZR6Ycjs.createElement.call(void 0, TagName, useHovercard(props));
322
+ }), useHovercardProviderContext);
323
+
324
+ // ../ariakit-react-components/dist/hovercard/hovercard-anchor.js
325
+
326
+ var TagName2 = "a";
327
+ var useHovercardAnchor = _QAUJZR6Ycjs.createHook.call(void 0, function useHovercardAnchor2({ store, showOnHover = true, ...props }) {
328
+ const context = useHovercardProviderContext();
329
+ store = store || context;
330
+ _QAUJZR6Ycjs.invariant.call(void 0, store, "HovercardAnchor must receive a `store` prop or be wrapped in a HovercardProvider component.");
331
+ const disabled = _QAUJZR6Ycjs.disabledFromProps.call(void 0, props);
332
+ const showTimeoutRef = _react.useRef.call(void 0, 0);
333
+ _react.useEffect.call(void 0, () => () => window.clearTimeout(showTimeoutRef.current), []);
334
+ _react.useEffect.call(void 0, () => {
335
+ const onMouseLeave = (event) => {
336
+ if (!store) return;
337
+ const { anchorElement } = store.getState();
338
+ if (!anchorElement) return;
339
+ if (event.target !== anchorElement) return;
340
+ window.clearTimeout(showTimeoutRef.current);
341
+ showTimeoutRef.current = 0;
342
+ };
343
+ return _QAUJZR6Ycjs.addGlobalEventListener.call(void 0, "mouseleave", onMouseLeave, true);
344
+ }, [store]);
345
+ const onMouseMoveProp = props.onMouseMove;
346
+ const showOnHoverProp = _QAUJZR6Ycjs.useBooleanEvent.call(void 0, showOnHover);
347
+ const isMouseMoving = _QAUJZR6Ycjs.useIsMouseMoving.call(void 0, );
348
+ const onMouseMove = _QAUJZR6Ycjs.useEvent.call(void 0, (event) => {
349
+ onMouseMoveProp == null ? void 0 : onMouseMoveProp(event);
350
+ if (disabled) return;
351
+ if (!store) return;
352
+ if (event.defaultPrevented) return;
353
+ if (showTimeoutRef.current) return;
354
+ if (!isMouseMoving()) return;
355
+ if (!showOnHoverProp(event)) return;
356
+ const element = event.currentTarget;
357
+ store.setAnchorElement(element);
358
+ store.setDisclosureElement(element);
359
+ const { showTimeout, timeout } = store.getState();
360
+ const showHovercard = () => {
361
+ showTimeoutRef.current = 0;
362
+ if (!isMouseMoving()) return;
363
+ store == null ? void 0 : store.setAnchorElement(element);
364
+ store == null ? void 0 : store.show();
365
+ queueMicrotask(() => {
366
+ store == null ? void 0 : store.setDisclosureElement(element);
367
+ });
368
+ };
369
+ const timeoutMs = showTimeout != null ? showTimeout : timeout;
370
+ if (timeoutMs === 0) showHovercard();
371
+ else showTimeoutRef.current = window.setTimeout(showHovercard, timeoutMs);
372
+ });
373
+ const onClickProp = props.onClick;
374
+ const onClick = _QAUJZR6Ycjs.useEvent.call(void 0, (event) => {
375
+ onClickProp == null ? void 0 : onClickProp(event);
376
+ if (!store) return;
377
+ window.clearTimeout(showTimeoutRef.current);
378
+ showTimeoutRef.current = 0;
379
+ });
380
+ const ref = _react.useCallback.call(void 0, (element) => {
381
+ if (!store) return;
382
+ const { anchorElement } = store.getState();
383
+ if (anchorElement == null ? void 0 : anchorElement.isConnected) return;
384
+ store.setAnchorElement(element);
385
+ }, [store]);
386
+ props = {
387
+ ...props,
388
+ ref: _QAUJZR6Ycjs.useMergeRefs.call(void 0, ref, props.ref),
389
+ onMouseMove,
390
+ onClick
391
+ };
392
+ props = _NG34QRI6cjs.useFocusable.call(void 0, props);
393
+ return props;
394
+ });
395
+ var HovercardAnchor = _QAUJZR6Ycjs.forwardRef.call(void 0, function HovercardAnchor2(props) {
396
+ return _QAUJZR6Ycjs.createElement.call(void 0, TagName2, useHovercardAnchor(props));
397
+ });
398
+
399
+ // ../ariakit-components/dist/hovercard/hovercard-store.js
400
+ function createHovercardStore(props = {}) {
401
+ var _a;
402
+ const syncState = (_a = props.store) == null ? void 0 : _a.getState();
403
+ const popover = _TSBEWPNTcjs.createPopoverStore.call(void 0, {
404
+ ...props,
405
+ placement: _QAUJZR6Ycjs.defaultValue.call(void 0, props.placement, syncState == null ? void 0 : syncState.placement, "bottom")
406
+ });
407
+ const timeout = _QAUJZR6Ycjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
408
+ const hovercard = _D4HCGWOUcjs.createStore.call(void 0, {
409
+ ...popover.getState(),
410
+ timeout,
411
+ showTimeout: _QAUJZR6Ycjs.defaultValue.call(void 0, props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
412
+ hideTimeout: _QAUJZR6Ycjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
413
+ autoFocusOnShow: _QAUJZR6Ycjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
414
+ }, popover, props.store);
415
+ return {
416
+ ...popover,
417
+ ...hovercard,
418
+ setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
419
+ };
420
+ }
421
+
422
+ // ../ariakit-react-components/dist/hovercard/hovercard-store.js
423
+ function useHovercardStoreProps(store, update, props) {
424
+ _D4HCGWOUcjs.useStoreProps.call(void 0, store, props, "timeout");
425
+ _D4HCGWOUcjs.useStoreProps.call(void 0, store, props, "showTimeout");
426
+ _D4HCGWOUcjs.useStoreProps.call(void 0, store, props, "hideTimeout");
427
+ return _TSBEWPNTcjs.usePopoverStoreProps.call(void 0, store, update, props);
428
+ }
429
+ function useHovercardStore(props = {}) {
430
+ const [store, update] = _D4HCGWOUcjs.useStore.call(void 0, createHovercardStore, props);
431
+ return useHovercardStoreProps(store, update, props);
432
+ }
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+ exports.useHovercardContext = useHovercardContext; exports.useHovercardScopedContext = useHovercardScopedContext; exports.useHovercardProviderContext = useHovercardProviderContext; exports.HovercardContextProvider = HovercardContextProvider; exports.HovercardScopedContextProvider = HovercardScopedContextProvider; exports.useHovercard = useHovercard; exports.Hovercard = Hovercard; exports.useHovercardAnchor = useHovercardAnchor; exports.HovercardAnchor = HovercardAnchor; exports.createHovercardStore = createHovercardStore; exports.useHovercardStoreProps = useHovercardStoreProps; exports.useHovercardStore = useHovercardStore;
@@ -0,0 +1,38 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _DWSXHZYMcjs = require('./DWSXHZYM.cjs');
4
+
5
+
6
+
7
+
8
+
9
+
10
+ var _QAUJZR6Ycjs = require('./QAUJZR6Y.cjs');
11
+
12
+ // ../ariakit-react-components/dist/heading/heading.js
13
+ var _react = require('react');
14
+ var _jsxruntime = require('react/jsx-runtime');
15
+ var TagName = "h1";
16
+ var useHeading = _QAUJZR6Ycjs.createHook.call(void 0, function useHeading2(props) {
17
+ const ref = _react.useRef.call(void 0, null);
18
+ const level = _react.useContext.call(void 0, _DWSXHZYMcjs.HeadingContext) || 1;
19
+ const Element = `h${level}`;
20
+ const tagName = _QAUJZR6Ycjs.useTagName.call(void 0, ref, Element);
21
+ const isNativeHeading = _react.useMemo.call(void 0, () => !!tagName && /^h\d$/.test(tagName), [tagName]);
22
+ props = {
23
+ render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Element, {}),
24
+ role: !isNativeHeading ? "heading" : void 0,
25
+ "aria-level": !isNativeHeading ? level : void 0,
26
+ ...props,
27
+ ref: _QAUJZR6Ycjs.useMergeRefs.call(void 0, ref, props.ref)
28
+ };
29
+ return props;
30
+ });
31
+ var Heading = _QAUJZR6Ycjs.forwardRef.call(void 0, function Heading2(props) {
32
+ return _QAUJZR6Ycjs.createElement.call(void 0, TagName, useHeading(props));
33
+ });
34
+
35
+
36
+
37
+
38
+ exports.useHeading = useHeading; exports.Heading = Heading;