@tribepad/themis 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/dist/elements/Accordion/index.js +325 -66
  2. package/dist/elements/Accordion/index.js.map +1 -1
  3. package/dist/elements/Accordion/index.mjs +317 -3
  4. package/dist/elements/Accordion/index.mjs.map +1 -1
  5. package/dist/elements/Avatar/index.js +461 -45
  6. package/dist/elements/Avatar/index.js.map +1 -1
  7. package/dist/elements/Avatar/index.mjs +456 -3
  8. package/dist/elements/Avatar/index.mjs.map +1 -1
  9. package/dist/elements/Badge/index.js +238 -36
  10. package/dist/elements/Badge/index.js.map +1 -1
  11. package/dist/elements/Badge/index.mjs +234 -4
  12. package/dist/elements/Badge/index.mjs.map +1 -1
  13. package/dist/elements/Breadcrumbs/index.js +808 -39
  14. package/dist/elements/Breadcrumbs/index.js.map +1 -1
  15. package/dist/elements/Breadcrumbs/index.mjs +810 -7
  16. package/dist/elements/Breadcrumbs/index.mjs.map +1 -1
  17. package/dist/elements/Button/index.js +282 -19
  18. package/dist/elements/Button/index.js.map +1 -1
  19. package/dist/elements/Button/index.mjs +283 -4
  20. package/dist/elements/Button/index.mjs.map +1 -1
  21. package/dist/elements/ButtonGroup/index.js +229 -56
  22. package/dist/elements/ButtonGroup/index.js.map +1 -1
  23. package/dist/elements/ButtonGroup/index.mjs +222 -3
  24. package/dist/elements/ButtonGroup/index.mjs.map +1 -1
  25. package/dist/elements/Card/Card.d.ts.map +1 -1
  26. package/dist/elements/Card/index.js +563 -67
  27. package/dist/elements/Card/index.js.map +1 -1
  28. package/dist/elements/Card/index.mjs +560 -6
  29. package/dist/elements/Card/index.mjs.map +1 -1
  30. package/dist/elements/Carousel/index.js +782 -14
  31. package/dist/elements/Carousel/index.js.map +1 -1
  32. package/dist/elements/Carousel/index.mjs +786 -8
  33. package/dist/elements/Carousel/index.mjs.map +1 -1
  34. package/dist/elements/Chart/index.js +1833 -36
  35. package/dist/elements/Chart/index.js.map +1 -1
  36. package/dist/elements/Chart/index.mjs +1832 -4
  37. package/dist/elements/Chart/index.mjs.map +1 -1
  38. package/dist/elements/Checkbox/index.js +310 -39
  39. package/dist/elements/Checkbox/index.js.map +1 -1
  40. package/dist/elements/Checkbox/index.mjs +306 -4
  41. package/dist/elements/Checkbox/index.mjs.map +1 -1
  42. package/dist/elements/CheckboxGroup/index.js +445 -59
  43. package/dist/elements/CheckboxGroup/index.js.map +1 -1
  44. package/dist/elements/CheckboxGroup/index.mjs +439 -4
  45. package/dist/elements/CheckboxGroup/index.mjs.map +1 -1
  46. package/dist/elements/DatePicker/index.js +871 -89
  47. package/dist/elements/DatePicker/index.js.map +1 -1
  48. package/dist/elements/DatePicker/index.mjs +853 -4
  49. package/dist/elements/DatePicker/index.mjs.map +1 -1
  50. package/dist/elements/Dropdown/index.js +189 -35
  51. package/dist/elements/Dropdown/index.js.map +1 -1
  52. package/dist/elements/Dropdown/index.mjs +184 -2
  53. package/dist/elements/Dropdown/index.mjs.map +1 -1
  54. package/dist/elements/FileField/index.js +1532 -129
  55. package/dist/elements/FileField/index.js.map +1 -1
  56. package/dist/elements/FileField/index.mjs +1507 -7
  57. package/dist/elements/FileField/index.mjs.map +1 -1
  58. package/dist/elements/FormLayout/index.js +166 -11
  59. package/dist/elements/FormLayout/index.js.map +1 -1
  60. package/dist/elements/FormLayout/index.mjs +167 -2
  61. package/dist/elements/FormLayout/index.mjs.map +1 -1
  62. package/dist/elements/Modal/index.js +228 -46
  63. package/dist/elements/Modal/index.js.map +1 -1
  64. package/dist/elements/Modal/index.mjs +220 -1
  65. package/dist/elements/Modal/index.mjs.map +1 -1
  66. package/dist/elements/NumberField/index.js +659 -48
  67. package/dist/elements/NumberField/index.js.map +1 -1
  68. package/dist/elements/NumberField/index.mjs +654 -6
  69. package/dist/elements/NumberField/index.mjs.map +1 -1
  70. package/dist/elements/OTPInput/index.js +729 -6
  71. package/dist/elements/OTPInput/index.js.map +1 -1
  72. package/dist/elements/OTPInput/index.mjs +732 -2
  73. package/dist/elements/OTPInput/index.mjs.map +1 -1
  74. package/dist/elements/Panel/index.js +326 -27
  75. package/dist/elements/Panel/index.js.map +1 -1
  76. package/dist/elements/Panel/index.mjs +323 -2
  77. package/dist/elements/Panel/index.mjs.map +1 -1
  78. package/dist/elements/Progress/index.js +181 -22
  79. package/dist/elements/Progress/index.js.map +1 -1
  80. package/dist/elements/Progress/index.mjs +181 -3
  81. package/dist/elements/Progress/index.mjs.map +1 -1
  82. package/dist/elements/RadioGroup/index.js +358 -34
  83. package/dist/elements/RadioGroup/index.js.map +1 -1
  84. package/dist/elements/RadioGroup/index.mjs +359 -4
  85. package/dist/elements/RadioGroup/index.mjs.map +1 -1
  86. package/dist/elements/Resizable/components/ResizableHandle.d.ts +0 -8
  87. package/dist/elements/Resizable/components/ResizableHandle.d.ts.map +1 -1
  88. package/dist/elements/Resizable/components/ResizablePanel.d.ts +0 -8
  89. package/dist/elements/Resizable/components/ResizablePanel.d.ts.map +1 -1
  90. package/dist/elements/Resizable/components/ResizablePanelGroup.d.ts +0 -8
  91. package/dist/elements/Resizable/components/ResizablePanelGroup.d.ts.map +1 -1
  92. package/dist/elements/Resizable/components/ResizablePopover.d.ts +0 -8
  93. package/dist/elements/Resizable/components/ResizablePopover.d.ts.map +1 -1
  94. package/dist/elements/Resizable/index.js +1568 -51
  95. package/dist/elements/Resizable/index.js.map +1 -1
  96. package/dist/elements/Resizable/index.mjs +1566 -6
  97. package/dist/elements/Resizable/index.mjs.map +1 -1
  98. package/dist/elements/Select/index.js +580 -22
  99. package/dist/elements/Select/index.js.map +1 -1
  100. package/dist/elements/Select/index.mjs +582 -2
  101. package/dist/elements/Select/index.mjs.map +1 -1
  102. package/dist/elements/Skeleton/index.js +77 -15
  103. package/dist/elements/Skeleton/index.js.map +1 -1
  104. package/dist/elements/Skeleton/index.mjs +78 -3
  105. package/dist/elements/Skeleton/index.mjs.map +1 -1
  106. package/dist/elements/Switch/index.js +153 -21
  107. package/dist/elements/Switch/index.js.map +1 -1
  108. package/dist/elements/Switch/index.mjs +149 -5
  109. package/dist/elements/Switch/index.mjs.map +1 -1
  110. package/dist/elements/Table/index.js +589 -68
  111. package/dist/elements/Table/index.js.map +1 -1
  112. package/dist/elements/Table/index.mjs +578 -5
  113. package/dist/elements/Table/index.mjs.map +1 -1
  114. package/dist/elements/Tabs/index.js +328 -63
  115. package/dist/elements/Tabs/index.js.map +1 -1
  116. package/dist/elements/Tabs/index.mjs +320 -3
  117. package/dist/elements/Tabs/index.mjs.map +1 -1
  118. package/dist/elements/TextField/index.js +695 -51
  119. package/dist/elements/TextField/index.js.map +1 -1
  120. package/dist/elements/TextField/index.mjs +684 -7
  121. package/dist/elements/TextField/index.mjs.map +1 -1
  122. package/dist/elements/TimeField/index.js +244 -33
  123. package/dist/elements/TimeField/index.js.map +1 -1
  124. package/dist/elements/TimeField/index.mjs +238 -2
  125. package/dist/elements/TimeField/index.mjs.map +1 -1
  126. package/dist/elements/Toast/index.js +727 -48
  127. package/dist/elements/Toast/index.js.map +1 -1
  128. package/dist/elements/Toast/index.mjs +724 -5
  129. package/dist/elements/Toast/index.mjs.map +1 -1
  130. package/dist/elements/Tooltip/index.js +315 -49
  131. package/dist/elements/Tooltip/index.js.map +1 -1
  132. package/dist/elements/Tooltip/index.mjs +310 -4
  133. package/dist/elements/Tooltip/index.mjs.map +1 -1
  134. package/dist/elements/index.js +12417 -799
  135. package/dist/elements/index.js.map +1 -1
  136. package/dist/elements/index.mjs +12233 -40
  137. package/dist/elements/index.mjs.map +1 -1
  138. package/dist/index.js +12452 -825
  139. package/dist/index.js.map +1 -1
  140. package/dist/index.mjs +12262 -42
  141. package/dist/index.mjs.map +1 -1
  142. package/dist/schemas/index.js +47 -21
  143. package/dist/schemas/index.js.map +1 -1
  144. package/dist/schemas/index.mjs +47 -2
  145. package/dist/schemas/index.mjs.map +1 -1
  146. package/dist/styles/index.js +161 -147
  147. package/dist/styles/index.js.map +1 -1
  148. package/dist/styles/index.mjs +128 -2
  149. package/dist/styles/index.mjs.map +1 -1
  150. package/dist/utils/index.js +7 -7
  151. package/dist/utils/index.js.map +1 -1
  152. package/dist/utils/index.mjs +9 -2
  153. package/dist/utils/index.mjs.map +1 -1
  154. package/package.json +1 -1
  155. package/dist/Carousel-NTZX5TOW.js +0 -16
  156. package/dist/Carousel-NTZX5TOW.js.map +0 -1
  157. package/dist/Carousel-YH3DOQJU.mjs +0 -7
  158. package/dist/Carousel-YH3DOQJU.mjs.map +0 -1
  159. package/dist/chunk-2HIUTHMU.mjs +0 -234
  160. package/dist/chunk-2HIUTHMU.mjs.map +0 -1
  161. package/dist/chunk-34GTFTDO.js +0 -431
  162. package/dist/chunk-34GTFTDO.js.map +0 -1
  163. package/dist/chunk-3H7ASYR7.js +0 -250
  164. package/dist/chunk-3H7ASYR7.js.map +0 -1
  165. package/dist/chunk-3IEN7JOP.js +0 -316
  166. package/dist/chunk-3IEN7JOP.js.map +0 -1
  167. package/dist/chunk-3JHN4GAL.js +0 -326
  168. package/dist/chunk-3JHN4GAL.js.map +0 -1
  169. package/dist/chunk-3MJPASQU.js +0 -232
  170. package/dist/chunk-3MJPASQU.js.map +0 -1
  171. package/dist/chunk-3XD2JUL3.js +0 -572
  172. package/dist/chunk-3XD2JUL3.js.map +0 -1
  173. package/dist/chunk-3YOY2VJ6.js +0 -189
  174. package/dist/chunk-3YOY2VJ6.js.map +0 -1
  175. package/dist/chunk-4DU5JSXB.js +0 -408
  176. package/dist/chunk-4DU5JSXB.js.map +0 -1
  177. package/dist/chunk-4E4E2GSS.js +0 -352
  178. package/dist/chunk-4E4E2GSS.js.map +0 -1
  179. package/dist/chunk-4NHAP4AN.mjs +0 -3
  180. package/dist/chunk-4NHAP4AN.mjs.map +0 -1
  181. package/dist/chunk-4S33J5NY.mjs +0 -415
  182. package/dist/chunk-4S33J5NY.mjs.map +0 -1
  183. package/dist/chunk-5SMGRT3G.mjs +0 -354
  184. package/dist/chunk-5SMGRT3G.mjs.map +0 -1
  185. package/dist/chunk-5SVLJN2C.mjs +0 -22
  186. package/dist/chunk-5SVLJN2C.mjs.map +0 -1
  187. package/dist/chunk-66WTU4EB.mjs +0 -299
  188. package/dist/chunk-66WTU4EB.mjs.map +0 -1
  189. package/dist/chunk-6S25NMOT.mjs +0 -335
  190. package/dist/chunk-6S25NMOT.mjs.map +0 -1
  191. package/dist/chunk-6SP7UB3D.js +0 -4
  192. package/dist/chunk-6SP7UB3D.js.map +0 -1
  193. package/dist/chunk-6TYWWQHM.mjs +0 -565
  194. package/dist/chunk-6TYWWQHM.mjs.map +0 -1
  195. package/dist/chunk-A3YUJA6W.mjs +0 -384
  196. package/dist/chunk-A3YUJA6W.mjs.map +0 -1
  197. package/dist/chunk-A6KEDVUR.js +0 -61
  198. package/dist/chunk-A6KEDVUR.js.map +0 -1
  199. package/dist/chunk-A77RUEWL.js +0 -730
  200. package/dist/chunk-A77RUEWL.js.map +0 -1
  201. package/dist/chunk-AA4IKMPE.mjs +0 -3
  202. package/dist/chunk-AA4IKMPE.mjs.map +0 -1
  203. package/dist/chunk-AKIA6GW6.mjs +0 -163
  204. package/dist/chunk-AKIA6GW6.mjs.map +0 -1
  205. package/dist/chunk-AL6P275L.mjs +0 -435
  206. package/dist/chunk-AL6P275L.mjs.map +0 -1
  207. package/dist/chunk-AZ3RJYTB.js +0 -37
  208. package/dist/chunk-AZ3RJYTB.js.map +0 -1
  209. package/dist/chunk-B5Q4UPL6.js +0 -32
  210. package/dist/chunk-B5Q4UPL6.js.map +0 -1
  211. package/dist/chunk-B6DHPMDP.mjs +0 -335
  212. package/dist/chunk-B6DHPMDP.mjs.map +0 -1
  213. package/dist/chunk-BDXKKMBZ.mjs +0 -184
  214. package/dist/chunk-BDXKKMBZ.mjs.map +0 -1
  215. package/dist/chunk-BL6E2DLZ.mjs +0 -52
  216. package/dist/chunk-BL6E2DLZ.mjs.map +0 -1
  217. package/dist/chunk-CGFDS4XS.mjs +0 -121
  218. package/dist/chunk-CGFDS4XS.mjs.map +0 -1
  219. package/dist/chunk-CJIW5TKI.js +0 -139
  220. package/dist/chunk-CJIW5TKI.js.map +0 -1
  221. package/dist/chunk-CKNISJOQ.js +0 -314
  222. package/dist/chunk-CKNISJOQ.js.map +0 -1
  223. package/dist/chunk-D6CBOECS.mjs +0 -1757
  224. package/dist/chunk-D6CBOECS.mjs.map +0 -1
  225. package/dist/chunk-DDWEVC2S.js +0 -166
  226. package/dist/chunk-DDWEVC2S.js.map +0 -1
  227. package/dist/chunk-DZ556D2F.mjs +0 -176
  228. package/dist/chunk-DZ556D2F.mjs.map +0 -1
  229. package/dist/chunk-E2KQFV3O.mjs +0 -10
  230. package/dist/chunk-E2KQFV3O.mjs.map +0 -1
  231. package/dist/chunk-EMMLADSC.js +0 -126
  232. package/dist/chunk-EMMLADSC.js.map +0 -1
  233. package/dist/chunk-EP4WOI5D.mjs +0 -926
  234. package/dist/chunk-EP4WOI5D.mjs.map +0 -1
  235. package/dist/chunk-FJRXLJC2.mjs +0 -160
  236. package/dist/chunk-FJRXLJC2.mjs.map +0 -1
  237. package/dist/chunk-FKQI434R.js +0 -345
  238. package/dist/chunk-FKQI434R.js.map +0 -1
  239. package/dist/chunk-FPKEAJRZ.mjs +0 -100
  240. package/dist/chunk-FPKEAJRZ.mjs.map +0 -1
  241. package/dist/chunk-FWQYB22U.js +0 -183
  242. package/dist/chunk-FWQYB22U.js.map +0 -1
  243. package/dist/chunk-GD5GHTMA.js +0 -189
  244. package/dist/chunk-GD5GHTMA.js.map +0 -1
  245. package/dist/chunk-GE5XTSDZ.js +0 -447
  246. package/dist/chunk-GE5XTSDZ.js.map +0 -1
  247. package/dist/chunk-GVE47ZAX.mjs +0 -32
  248. package/dist/chunk-GVE47ZAX.mjs.map +0 -1
  249. package/dist/chunk-HK46BT5U.mjs +0 -18
  250. package/dist/chunk-HK46BT5U.mjs.map +0 -1
  251. package/dist/chunk-HQVRMR6N.js +0 -365
  252. package/dist/chunk-HQVRMR6N.js.map +0 -1
  253. package/dist/chunk-HSGBJPJO.mjs +0 -398
  254. package/dist/chunk-HSGBJPJO.mjs.map +0 -1
  255. package/dist/chunk-I3AUTOMZ.mjs +0 -125
  256. package/dist/chunk-I3AUTOMZ.mjs.map +0 -1
  257. package/dist/chunk-IEI5LD5C.mjs +0 -1161
  258. package/dist/chunk-IEI5LD5C.mjs.map +0 -1
  259. package/dist/chunk-IIPTC2X7.mjs +0 -118
  260. package/dist/chunk-IIPTC2X7.mjs.map +0 -1
  261. package/dist/chunk-J7TLHF2Q.js +0 -4
  262. package/dist/chunk-J7TLHF2Q.js.map +0 -1
  263. package/dist/chunk-JJOWXFXQ.mjs +0 -765
  264. package/dist/chunk-JJOWXFXQ.mjs.map +0 -1
  265. package/dist/chunk-JPTSS2OA.mjs +0 -3
  266. package/dist/chunk-JPTSS2OA.mjs.map +0 -1
  267. package/dist/chunk-KFXXRLTP.js +0 -396
  268. package/dist/chunk-KFXXRLTP.js.map +0 -1
  269. package/dist/chunk-KPRRBSG6.mjs +0 -272
  270. package/dist/chunk-KPRRBSG6.mjs.map +0 -1
  271. package/dist/chunk-NFSBGRDB.mjs +0 -57
  272. package/dist/chunk-NFSBGRDB.mjs.map +0 -1
  273. package/dist/chunk-NGJVCFTM.js +0 -219
  274. package/dist/chunk-NGJVCFTM.js.map +0 -1
  275. package/dist/chunk-NSQ6MZJ6.mjs +0 -728
  276. package/dist/chunk-NSQ6MZJ6.mjs.map +0 -1
  277. package/dist/chunk-NYQYHT76.mjs +0 -296
  278. package/dist/chunk-NYQYHT76.mjs.map +0 -1
  279. package/dist/chunk-OLJJGI5B.js +0 -1193
  280. package/dist/chunk-OLJJGI5B.js.map +0 -1
  281. package/dist/chunk-Q3572X2J.js +0 -292
  282. package/dist/chunk-Q3572X2J.js.map +0 -1
  283. package/dist/chunk-QH7N7D4I.mjs +0 -210
  284. package/dist/chunk-QH7N7D4I.mjs.map +0 -1
  285. package/dist/chunk-R7XUIV25.js +0 -466
  286. package/dist/chunk-R7XUIV25.js.map +0 -1
  287. package/dist/chunk-RFFO4KPM.js +0 -135
  288. package/dist/chunk-RFFO4KPM.js.map +0 -1
  289. package/dist/chunk-RFX7QKA7.mjs +0 -180
  290. package/dist/chunk-RFX7QKA7.mjs.map +0 -1
  291. package/dist/chunk-SN5LFAP3.js +0 -940
  292. package/dist/chunk-SN5LFAP3.js.map +0 -1
  293. package/dist/chunk-T4COXKQ3.js +0 -24
  294. package/dist/chunk-T4COXKQ3.js.map +0 -1
  295. package/dist/chunk-TS54QM27.js +0 -125
  296. package/dist/chunk-TS54QM27.js.map +0 -1
  297. package/dist/chunk-UE2S4PCX.mjs +0 -220
  298. package/dist/chunk-UE2S4PCX.mjs.map +0 -1
  299. package/dist/chunk-UTW3QX2A.mjs +0 -282
  300. package/dist/chunk-UTW3QX2A.mjs.map +0 -1
  301. package/dist/chunk-V74LGMAE.js +0 -1767
  302. package/dist/chunk-V74LGMAE.js.map +0 -1
  303. package/dist/chunk-VIREG536.js +0 -12
  304. package/dist/chunk-VIREG536.js.map +0 -1
  305. package/dist/chunk-VY7M7346.js +0 -4
  306. package/dist/chunk-VY7M7346.js.map +0 -1
  307. package/dist/chunk-W3TJOO7H.mjs +0 -319
  308. package/dist/chunk-W3TJOO7H.mjs.map +0 -1
  309. package/dist/chunk-WIUOB36M.js +0 -54
  310. package/dist/chunk-WIUOB36M.js.map +0 -1
  311. package/dist/chunk-WJGLM4CY.js +0 -291
  312. package/dist/chunk-WJGLM4CY.js.map +0 -1
  313. package/dist/chunk-WNURH5OO.mjs +0 -453
  314. package/dist/chunk-WNURH5OO.mjs.map +0 -1
  315. package/dist/chunk-X25TNRSD.mjs +0 -364
  316. package/dist/chunk-X25TNRSD.mjs.map +0 -1
  317. package/dist/chunk-Y3GT7ETK.js +0 -108
  318. package/dist/chunk-Y3GT7ETK.js.map +0 -1
  319. package/dist/chunk-Z4FRNOF6.mjs +0 -115
  320. package/dist/chunk-Z4FRNOF6.mjs.map +0 -1
  321. package/dist/chunk-ZMYLD3BN.js +0 -166
  322. package/dist/chunk-ZMYLD3BN.js.map +0 -1
  323. package/dist/chunk-ZP2KV6EX.js +0 -815
  324. package/dist/chunk-ZP2KV6EX.js.map +0 -1
  325. package/dist/chunk-ZVKXFELU.js +0 -366
  326. package/dist/chunk-ZVKXFELU.js.map +0 -1
@@ -1,65 +1,1582 @@
1
+ "use client";
1
2
  'use strict';
2
3
 
3
- var chunkSN5LFAP3_js = require('../../chunk-SN5LFAP3.js');
4
- require('../../chunk-KFXXRLTP.js');
5
- require('../../chunk-3YOY2VJ6.js');
6
- require('../../chunk-Y3GT7ETK.js');
7
- require('../../chunk-B5Q4UPL6.js');
8
- require('../../chunk-VIREG536.js');
4
+ var react = require('react');
5
+ var clsx = require('clsx');
6
+ var tailwindMerge = require('tailwind-merge');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+ var zod = require('zod');
9
+ var classVarianceAuthority = require('class-variance-authority');
10
+ var lucideReact = require('lucide-react');
11
+ var reactAriaComponents = require('react-aria-components');
9
12
 
10
-
11
-
12
- Object.defineProperty(exports, "DEFAULT_MAX_SIZE", {
13
- enumerable: true,
14
- get: function () { return chunkSN5LFAP3_js.DEFAULT_MAX_SIZE; }
15
- });
16
- Object.defineProperty(exports, "DEFAULT_MIN_SIZE", {
17
- enumerable: true,
18
- get: function () { return chunkSN5LFAP3_js.DEFAULT_MIN_SIZE; }
19
- });
20
- Object.defineProperty(exports, "LONG_PRESS_THRESHOLD", {
21
- enumerable: true,
22
- get: function () { return chunkSN5LFAP3_js.LONG_PRESS_THRESHOLD; }
13
+ // src/elements/Resizable/components/ResizablePanelGroup.tsx
14
+ function cn(...inputs) {
15
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
16
+ }
17
+ var ResizableContext = react.createContext(
18
+ null
19
+ );
20
+ ResizableContext.displayName = "ResizableContext";
21
+ function useResizableContext() {
22
+ const context = react.useContext(ResizableContext);
23
+ if (!context) {
24
+ throw new Error(
25
+ "useResizableContext must be used within a ResizablePanelGroup. Make sure ResizablePanel and ResizableHandle are children of ResizablePanelGroup."
26
+ );
27
+ }
28
+ return context;
29
+ }
30
+ function useResizableProvider({
31
+ direction,
32
+ groupLabel,
33
+ sizes: controlledSizes,
34
+ onSizesChange
35
+ }) {
36
+ const [internalSizes, setInternalSizes] = react.useState([]);
37
+ const [panels, setPanels] = react.useState([]);
38
+ const containerRef = react.useRef(null);
39
+ const liveRegionRef = react.useRef(null);
40
+ const announceTimeoutRef = react.useRef(null);
41
+ const sizesInitializedRef = react.useRef(false);
42
+ const isControlled = controlledSizes !== void 0;
43
+ const sizes = isControlled ? controlledSizes : internalSizes;
44
+ const setSizes = react.useCallback(
45
+ (newSizes) => {
46
+ if (isControlled) {
47
+ onSizesChange?.(newSizes);
48
+ } else {
49
+ setInternalSizes(newSizes);
50
+ }
51
+ },
52
+ [isControlled, onSizesChange]
53
+ );
54
+ const registerPanel = react.useCallback((index, info) => {
55
+ setPanels((prev) => {
56
+ const newPanels = [...prev];
57
+ newPanels[index] = info;
58
+ return newPanels;
59
+ });
60
+ }, []);
61
+ const unregisterPanel = react.useCallback((index) => {
62
+ setPanels((prev) => {
63
+ const newPanels = [...prev];
64
+ delete newPanels[index];
65
+ return newPanels.filter(Boolean);
66
+ });
67
+ }, []);
68
+ react.useEffect(() => {
69
+ if (isControlled || sizesInitializedRef.current) return;
70
+ const registeredPanels = panels.filter(Boolean);
71
+ const panelCount = registeredPanels.length;
72
+ if (panelCount < 2) return;
73
+ const needsInit = sizes.length < panelCount || sizes.some((s) => s === void 0);
74
+ if (needsInit) {
75
+ const newSizes = [];
76
+ const equalSize = 100 / panelCount;
77
+ for (let i = 0; i < panelCount; i++) {
78
+ newSizes[i] = equalSize;
79
+ }
80
+ sizesInitializedRef.current = true;
81
+ setInternalSizes(newSizes);
82
+ }
83
+ }, [panels, sizes, isControlled]);
84
+ react.useEffect(() => {
85
+ return () => {
86
+ if (announceTimeoutRef.current) {
87
+ clearTimeout(announceTimeoutRef.current);
88
+ }
89
+ if (liveRegionRef.current) {
90
+ document.body.removeChild(liveRegionRef.current);
91
+ liveRegionRef.current = null;
92
+ }
93
+ };
94
+ }, []);
95
+ const announce = react.useCallback((message) => {
96
+ if (!liveRegionRef.current) {
97
+ const liveRegion = document.createElement("div");
98
+ liveRegion.setAttribute("aria-live", "polite");
99
+ liveRegion.setAttribute("aria-atomic", "true");
100
+ liveRegion.className = "sr-only";
101
+ liveRegion.style.cssText = "position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;";
102
+ document.body.appendChild(liveRegion);
103
+ liveRegionRef.current = liveRegion;
104
+ }
105
+ liveRegionRef.current.textContent = message;
106
+ if (announceTimeoutRef.current) {
107
+ clearTimeout(announceTimeoutRef.current);
108
+ }
109
+ announceTimeoutRef.current = setTimeout(() => {
110
+ if (liveRegionRef.current) {
111
+ liveRegionRef.current.textContent = "";
112
+ }
113
+ }, 1e3);
114
+ }, []);
115
+ return {
116
+ direction,
117
+ groupLabel,
118
+ sizes,
119
+ setSizes,
120
+ panels,
121
+ registerPanel,
122
+ unregisterPanel,
123
+ announce,
124
+ containerRef
125
+ };
126
+ }
127
+ var ResizablePanelGroup = react.forwardRef(function ResizablePanelGroup2({ direction, groupLabel, sizes, onSizesChange, className, children }, ref) {
128
+ const contextValue = useResizableProvider({
129
+ direction,
130
+ groupLabel,
131
+ sizes,
132
+ onSizesChange
133
+ });
134
+ react.useImperativeHandle(
135
+ ref,
136
+ () => contextValue.containerRef.current,
137
+ [contextValue.containerRef]
138
+ );
139
+ return /* @__PURE__ */ jsxRuntime.jsx(ResizableContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
140
+ "div",
141
+ {
142
+ ref: contextValue.containerRef,
143
+ role: "group",
144
+ "aria-label": `${groupLabel}, ${direction}`,
145
+ "data-direction": direction,
146
+ className: cn(
147
+ "flex h-full w-full",
148
+ direction === "horizontal" ? "flex-row" : "flex-col",
149
+ className
150
+ ),
151
+ children
152
+ }
153
+ ) });
23
154
  });
24
- Object.defineProperty(exports, "ResizableHandle", {
25
- enumerable: true,
26
- get: function () { return chunkSN5LFAP3_js.ResizableHandle; }
155
+ ResizablePanelGroup.displayName = "ResizablePanelGroup";
156
+ var DEFAULT_MIN_SIZE = 10;
157
+ var DEFAULT_MAX_SIZE = 90;
158
+ var LONG_PRESS_THRESHOLD = 300;
159
+ var ResizePresetSchema = zod.z.object({
160
+ label: zod.z.string().min(1),
161
+ sizes: zod.z.array(zod.z.number().min(0).max(100))
27
162
  });
28
- Object.defineProperty(exports, "ResizableHandlePropsSchema", {
29
- enumerable: true,
30
- get: function () { return chunkSN5LFAP3_js.ResizableHandlePropsSchema; }
163
+ var ResizablePanelGroupPropsSchema = zod.z.object({
164
+ /** Layout direction */
165
+ direction: zod.z.enum(["horizontal", "vertical"]),
166
+ /** REQUIRED: Label for screen reader identification of this group */
167
+ groupLabel: zod.z.string().min(1),
168
+ /** Controlled mode: current sizes as percentages */
169
+ sizes: zod.z.array(zod.z.number().min(0).max(100)).optional(),
170
+ /** Callback when sizes change */
171
+ onSizesChange: zod.z.function().optional(),
172
+ /** Additional CSS classes */
173
+ className: zod.z.string().optional(),
174
+ /** Panel children */
175
+ children: zod.z.custom()
31
176
  });
32
- Object.defineProperty(exports, "ResizablePanel", {
33
- enumerable: true,
34
- get: function () { return chunkSN5LFAP3_js.ResizablePanel; }
177
+ var ResizablePanelPropsSchema = zod.z.object({
178
+ /** REQUIRED: Name for screen reader identification */
179
+ name: zod.z.string().min(1),
180
+ /** Default size as percentage (auto-distributes equally if omitted) */
181
+ defaultSize: zod.z.number().min(0).max(100).optional(),
182
+ /** Minimum size as percentage */
183
+ minSize: zod.z.number().min(0).max(100).optional().default(DEFAULT_MIN_SIZE),
184
+ /** Maximum size as percentage */
185
+ maxSize: zod.z.number().min(0).max(100).optional().default(DEFAULT_MAX_SIZE),
186
+ /** Whether panel can collapse to 0% */
187
+ collapsible: zod.z.boolean().optional().default(false),
188
+ /** Callback when panel collapses */
189
+ onCollapse: zod.z.function().optional(),
190
+ /** Callback when panel expands from collapsed */
191
+ onExpand: zod.z.function().optional(),
192
+ /** Callback when panel resizes */
193
+ onResize: zod.z.function().optional(),
194
+ /** Additional CSS classes */
195
+ className: zod.z.string().optional(),
196
+ /** Panel content */
197
+ children: zod.z.custom()
35
198
  });
36
- Object.defineProperty(exports, "ResizablePanelGroup", {
37
- enumerable: true,
38
- get: function () { return chunkSN5LFAP3_js.ResizablePanelGroup; }
199
+ var ResizableHandlePropsSchema = zod.z.object({
200
+ /** Whether to show the visual grip indicator */
201
+ withHandle: zod.z.boolean().optional().default(true),
202
+ /** Size presets for quick adjustment */
203
+ presets: zod.z.array(ResizePresetSchema).optional(),
204
+ /** Whether the handle is disabled */
205
+ disabled: zod.z.boolean().optional().default(false),
206
+ /** Additional CSS classes */
207
+ className: zod.z.string().optional()
39
208
  });
40
- Object.defineProperty(exports, "ResizablePanelGroupPropsSchema", {
41
- enumerable: true,
42
- get: function () { return chunkSN5LFAP3_js.ResizablePanelGroupPropsSchema; }
209
+ var resizableHandleVariants = classVarianceAuthority.cva(
210
+ [
211
+ // Base styles - 44px touch target
212
+ "relative flex items-center justify-center",
213
+ "shrink-0",
214
+ "bg-transparent",
215
+ "transition-colors duration-150",
216
+ // Focus styles
217
+ "focus-visible:outline-none focus-visible:ring-2",
218
+ "focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2",
219
+ // Touch target padding for accessibility
220
+ "touch-none select-none"
221
+ ],
222
+ {
223
+ variants: {
224
+ direction: {
225
+ horizontal: [
226
+ "w-3 min-w-[12px]",
227
+ "cursor-col-resize",
228
+ "hover:bg-[var(--accent)]/50",
229
+ // Ensure 44px touch target via padding
230
+ "before:absolute before:inset-y-0 before:-inset-x-4",
231
+ "before:min-w-[44px]"
232
+ ],
233
+ vertical: [
234
+ "h-3 min-h-[12px]",
235
+ "cursor-row-resize",
236
+ "hover:bg-[var(--accent)]/50",
237
+ // Ensure 44px touch target via padding
238
+ "before:absolute before:inset-x-0 before:-inset-y-4",
239
+ "before:min-h-[44px]"
240
+ ]
241
+ },
242
+ disabled: {
243
+ true: "cursor-not-allowed opacity-50 pointer-events-none",
244
+ false: ""
245
+ },
246
+ isDragging: {
247
+ true: "bg-[var(--accent)]",
248
+ false: ""
249
+ }
250
+ },
251
+ defaultVariants: {
252
+ direction: "horizontal",
253
+ disabled: false,
254
+ isDragging: false
255
+ }
256
+ }
257
+ );
258
+ var resizableGripVariants = classVarianceAuthority.cva(
259
+ [
260
+ "flex items-center justify-center",
261
+ "rounded-full",
262
+ "bg-[var(--border)]",
263
+ "text-[var(--menu-muted)]"
264
+ ],
265
+ {
266
+ variants: {
267
+ direction: {
268
+ horizontal: "h-8 w-1",
269
+ vertical: "h-1 w-8"
270
+ }
271
+ },
272
+ defaultVariants: {
273
+ direction: "horizontal"
274
+ }
275
+ }
276
+ );
277
+ var ResizablePanel = react.forwardRef(
278
+ function ResizablePanel2({
279
+ name,
280
+ defaultSize: _defaultSize,
281
+ minSize = DEFAULT_MIN_SIZE,
282
+ maxSize = DEFAULT_MAX_SIZE,
283
+ collapsible = false,
284
+ onCollapse,
285
+ onExpand,
286
+ onResize,
287
+ className,
288
+ children
289
+ }, ref) {
290
+ const { sizes, registerPanel, unregisterPanel, containerRef } = useResizableContext();
291
+ const internalRef = react.useRef(null);
292
+ const [panelIndex, setPanelIndex] = react.useState(-1);
293
+ const prevSizeRef = react.useRef(null);
294
+ const isRegisteredRef = react.useRef(false);
295
+ const registeredIndexRef = react.useRef(-1);
296
+ react.useEffect(() => {
297
+ const panel = internalRef.current;
298
+ const container = containerRef.current;
299
+ if (!panel || !container) return;
300
+ const allPanels = container.querySelectorAll("[data-resizable-panel]");
301
+ let foundIndex = -1;
302
+ for (let i = 0; i < allPanels.length; i++) {
303
+ if (allPanels[i] === panel) {
304
+ foundIndex = i;
305
+ break;
306
+ }
307
+ }
308
+ if (foundIndex === -1) return;
309
+ if (panelIndex !== foundIndex) {
310
+ setPanelIndex(foundIndex);
311
+ }
312
+ if (!isRegisteredRef.current) {
313
+ isRegisteredRef.current = true;
314
+ registeredIndexRef.current = foundIndex;
315
+ registerPanel(foundIndex, {
316
+ name,
317
+ minSize,
318
+ maxSize,
319
+ collapsible
320
+ });
321
+ }
322
+ return () => {
323
+ if (isRegisteredRef.current) {
324
+ unregisterPanel(registeredIndexRef.current);
325
+ isRegisteredRef.current = false;
326
+ }
327
+ };
328
+ }, [containerRef, registerPanel, unregisterPanel, name, minSize, maxSize, collapsible, panelIndex]);
329
+ const currentSize = panelIndex >= 0 ? sizes[panelIndex] ?? 50 : 50;
330
+ react.useEffect(() => {
331
+ if (prevSizeRef.current === null) {
332
+ prevSizeRef.current = currentSize;
333
+ return;
334
+ }
335
+ const wasCollapsed = prevSizeRef.current === 0;
336
+ const isCollapsed = currentSize === 0;
337
+ if (!wasCollapsed && isCollapsed && onCollapse) {
338
+ onCollapse();
339
+ } else if (wasCollapsed && !isCollapsed && onExpand) {
340
+ onExpand();
341
+ }
342
+ if (onResize && prevSizeRef.current !== currentSize) {
343
+ onResize(currentSize);
344
+ }
345
+ prevSizeRef.current = currentSize;
346
+ }, [currentSize, onCollapse, onExpand, onResize]);
347
+ return /* @__PURE__ */ jsxRuntime.jsx(
348
+ "div",
349
+ {
350
+ ref: (node) => {
351
+ internalRef.current = node;
352
+ if (typeof ref === "function") {
353
+ ref(node);
354
+ } else if (ref) {
355
+ ref.current = node;
356
+ }
357
+ },
358
+ role: "region",
359
+ "aria-label": name,
360
+ "data-resizable-panel": "",
361
+ "data-panel-name": name,
362
+ "data-panel-index": panelIndex,
363
+ "data-collapsed": currentSize === 0,
364
+ style: {
365
+ flexBasis: `${currentSize}%`,
366
+ flexGrow: 0,
367
+ flexShrink: 0,
368
+ overflow: "hidden"
369
+ },
370
+ className: cn("relative", className),
371
+ children
372
+ }
373
+ );
374
+ }
375
+ );
376
+ ResizablePanel.displayName = "ResizablePanel";
377
+ function clampSize(size, min, max) {
378
+ return Math.max(min, Math.min(max, size));
379
+ }
380
+ function calculateNewSizes(sizes, panels, leftIndex, rightIndex, delta) {
381
+ const newSizes = [...sizes];
382
+ const leftPanel = panels[leftIndex];
383
+ const rightPanel = panels[rightIndex];
384
+ if (!leftPanel || !rightPanel) return sizes;
385
+ const leftSize = sizes[leftIndex] ?? 50;
386
+ const rightSize = sizes[rightIndex] ?? 50;
387
+ let newLeftSize = leftSize + delta;
388
+ let newRightSize = rightSize - delta;
389
+ const leftMin = leftPanel.collapsible ? 0 : leftPanel.minSize;
390
+ const leftMax = leftPanel.maxSize;
391
+ const rightMin = rightPanel.collapsible ? 0 : rightPanel.minSize;
392
+ const rightMax = rightPanel.maxSize;
393
+ newLeftSize = clampSize(newLeftSize, leftMin, leftMax);
394
+ newRightSize = leftSize + rightSize - newLeftSize;
395
+ newRightSize = clampSize(newRightSize, rightMin, rightMax);
396
+ newLeftSize = leftSize + rightSize - newRightSize;
397
+ newSizes[leftIndex] = newLeftSize;
398
+ newSizes[rightIndex] = newRightSize;
399
+ return newSizes;
400
+ }
401
+ function useResizable({
402
+ direction,
403
+ sizes,
404
+ setSizes,
405
+ panels,
406
+ containerRef,
407
+ leftPanelIndex,
408
+ rightPanelIndex,
409
+ disabled = false,
410
+ announce,
411
+ groupLabel,
412
+ onOpenPopover
413
+ }) {
414
+ const [isDragging, setIsDragging] = react.useState(false);
415
+ const dragStartRef = react.useRef(null);
416
+ const longPressTimerRef = react.useRef(null);
417
+ const pointerDownTimeRef = react.useRef(0);
418
+ const wasLongPressRef = react.useRef(false);
419
+ const panelsRef = react.useRef(panels);
420
+ const sizesRef = react.useRef(sizes);
421
+ const setSizesRef = react.useRef(setSizes);
422
+ const handlePointerMoveRef = react.useRef(() => {
423
+ });
424
+ const handlePointerUpRef = react.useRef(() => {
425
+ });
426
+ react.useEffect(() => {
427
+ panelsRef.current = panels;
428
+ sizesRef.current = sizes;
429
+ setSizesRef.current = setSizes;
430
+ }, [panels, sizes, setSizes]);
431
+ const getContainerSize = react.useCallback(() => {
432
+ const container = containerRef.current;
433
+ if (!container) return 0;
434
+ return direction === "horizontal" ? container.offsetWidth : container.offsetHeight;
435
+ }, [containerRef, direction]);
436
+ const pixelsToPercent = react.useCallback(
437
+ (pixels) => {
438
+ const containerSize = getContainerSize();
439
+ if (containerSize === 0) return 0;
440
+ return pixels / containerSize * 100;
441
+ },
442
+ [getContainerSize]
443
+ );
444
+ const onPointerMove = react.useCallback((e) => {
445
+ handlePointerMoveRef.current(e);
446
+ }, []);
447
+ const onPointerUp = react.useCallback(() => {
448
+ handlePointerUpRef.current();
449
+ }, []);
450
+ const handlePointerMove = react.useCallback(
451
+ (event) => {
452
+ if (!dragStartRef.current || disabled) return;
453
+ const position = direction === "horizontal" ? event.clientX : event.clientY;
454
+ const delta = position - dragStartRef.current.position;
455
+ const percentDelta = pixelsToPercent(delta);
456
+ const newSizes = calculateNewSizes(
457
+ dragStartRef.current.sizes,
458
+ panelsRef.current,
459
+ leftPanelIndex,
460
+ rightPanelIndex,
461
+ percentDelta
462
+ );
463
+ setSizesRef.current(newSizes);
464
+ },
465
+ [
466
+ direction,
467
+ disabled,
468
+ leftPanelIndex,
469
+ pixelsToPercent,
470
+ rightPanelIndex
471
+ ]
472
+ );
473
+ const handlePointerUp = react.useCallback(() => {
474
+ if (longPressTimerRef.current) {
475
+ clearTimeout(longPressTimerRef.current);
476
+ longPressTimerRef.current = null;
477
+ }
478
+ const duration = Date.now() - pointerDownTimeRef.current;
479
+ const wasTap = duration < LONG_PRESS_THRESHOLD && !wasLongPressRef.current;
480
+ if (wasTap && onOpenPopover && !disabled) {
481
+ onOpenPopover();
482
+ }
483
+ if (isDragging) {
484
+ setIsDragging(false);
485
+ const leftPanel = panelsRef.current[leftPanelIndex];
486
+ const newSize = Math.round(sizesRef.current[leftPanelIndex] ?? 50);
487
+ if (announce && leftPanel && groupLabel) {
488
+ announce(
489
+ `${leftPanel.name} in ${groupLabel} resized to ${newSize} percent`
490
+ );
491
+ }
492
+ }
493
+ dragStartRef.current = null;
494
+ wasLongPressRef.current = false;
495
+ document.removeEventListener("pointermove", onPointerMove);
496
+ document.removeEventListener("pointerup", onPointerUp);
497
+ document.removeEventListener("pointercancel", onPointerUp);
498
+ document.body.style.cursor = "";
499
+ document.body.style.userSelect = "";
500
+ }, [
501
+ announce,
502
+ disabled,
503
+ groupLabel,
504
+ isDragging,
505
+ leftPanelIndex,
506
+ onOpenPopover,
507
+ onPointerMove,
508
+ onPointerUp
509
+ ]);
510
+ react.useEffect(() => {
511
+ handlePointerMoveRef.current = handlePointerMove;
512
+ handlePointerUpRef.current = handlePointerUp;
513
+ });
514
+ const handlePointerDown = react.useCallback(
515
+ (event) => {
516
+ if (disabled) return;
517
+ event.preventDefault();
518
+ const position = direction === "horizontal" ? event.clientX : event.clientY;
519
+ pointerDownTimeRef.current = Date.now();
520
+ wasLongPressRef.current = false;
521
+ dragStartRef.current = {
522
+ position,
523
+ sizes: [...sizes],
524
+ containerSize: getContainerSize()
525
+ };
526
+ longPressTimerRef.current = setTimeout(() => {
527
+ wasLongPressRef.current = true;
528
+ setIsDragging(true);
529
+ document.body.style.cursor = direction === "horizontal" ? "col-resize" : "row-resize";
530
+ document.body.style.userSelect = "none";
531
+ }, LONG_PRESS_THRESHOLD);
532
+ document.addEventListener("pointermove", onPointerMove);
533
+ document.addEventListener("pointerup", onPointerUp);
534
+ document.addEventListener("pointercancel", onPointerUp);
535
+ if (event.pointerType === "mouse") {
536
+ if (longPressTimerRef.current) {
537
+ clearTimeout(longPressTimerRef.current);
538
+ longPressTimerRef.current = null;
539
+ }
540
+ wasLongPressRef.current = true;
541
+ setIsDragging(true);
542
+ document.body.style.cursor = direction === "horizontal" ? "col-resize" : "row-resize";
543
+ document.body.style.userSelect = "none";
544
+ }
545
+ },
546
+ [
547
+ direction,
548
+ disabled,
549
+ getContainerSize,
550
+ onPointerMove,
551
+ onPointerUp,
552
+ sizes
553
+ ]
554
+ );
555
+ const handleKeyDown = react.useCallback(
556
+ (event) => {
557
+ if (disabled) return;
558
+ const step = event.shiftKey ? 10 : 1;
559
+ let delta = 0;
560
+ switch (event.key) {
561
+ case "ArrowLeft":
562
+ case "ArrowUp":
563
+ delta = -step;
564
+ break;
565
+ case "ArrowRight":
566
+ case "ArrowDown":
567
+ delta = step;
568
+ break;
569
+ case "Home": {
570
+ const leftPanel = panels[leftPanelIndex];
571
+ if (leftPanel) {
572
+ const minSize = leftPanel.collapsible ? 0 : leftPanel.minSize;
573
+ delta = minSize - (sizes[leftPanelIndex] ?? 50);
574
+ }
575
+ break;
576
+ }
577
+ case "End": {
578
+ const leftPanel = panels[leftPanelIndex];
579
+ if (leftPanel) {
580
+ delta = leftPanel.maxSize - (sizes[leftPanelIndex] ?? 50);
581
+ }
582
+ break;
583
+ }
584
+ case "Enter":
585
+ case " ":
586
+ event.preventDefault();
587
+ onOpenPopover?.();
588
+ return;
589
+ default:
590
+ return;
591
+ }
592
+ if (delta !== 0) {
593
+ event.preventDefault();
594
+ const newSizes = calculateNewSizes(
595
+ sizes,
596
+ panels,
597
+ leftPanelIndex,
598
+ rightPanelIndex,
599
+ delta
600
+ );
601
+ setSizes(newSizes);
602
+ const leftPanel = panels[leftPanelIndex];
603
+ const newSize = Math.round(newSizes[leftPanelIndex] ?? 50);
604
+ if (announce && leftPanel && groupLabel) {
605
+ announce(
606
+ `${leftPanel.name} in ${groupLabel} resized to ${newSize} percent`
607
+ );
608
+ }
609
+ }
610
+ },
611
+ [
612
+ announce,
613
+ disabled,
614
+ groupLabel,
615
+ leftPanelIndex,
616
+ onOpenPopover,
617
+ panels,
618
+ rightPanelIndex,
619
+ setSizes,
620
+ sizes
621
+ ]
622
+ );
623
+ react.useEffect(() => {
624
+ const moveHandler = onPointerMove;
625
+ const upHandler = onPointerUp;
626
+ return () => {
627
+ if (longPressTimerRef.current) {
628
+ clearTimeout(longPressTimerRef.current);
629
+ }
630
+ document.removeEventListener("pointermove", moveHandler);
631
+ document.removeEventListener("pointerup", upHandler);
632
+ document.removeEventListener("pointercancel", upHandler);
633
+ };
634
+ }, [onPointerMove, onPointerUp]);
635
+ return {
636
+ isDragging,
637
+ handlePointerDown,
638
+ handleKeyDown
639
+ };
640
+ }
641
+ var PRESSED_STYLES = "data-[pressed]:scale-[0.97]";
642
+ var HOVER_STYLES = "data-[hovered]:shadow-md";
643
+ var HIGH_CONTRAST_HOVER = "hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground";
644
+ var HIGH_CONTRAST_PRESSED = "hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground";
645
+ var ButtonGroupContext = react.createContext(null);
646
+ ButtonGroupContext.displayName = "ButtonGroupContext";
647
+ function useButtonGroupContext() {
648
+ return react.useContext(ButtonGroupContext);
649
+ }
650
+ var ButtonGroupItemContext = react.createContext(null);
651
+ ButtonGroupItemContext.displayName = "ButtonGroupItemContext";
652
+ function useButtonGroupItemContext() {
653
+ return react.useContext(ButtonGroupItemContext);
654
+ }
655
+ classVarianceAuthority.cva("inline-flex items-center gap-0", {
656
+ variants: {
657
+ orientation: {
658
+ horizontal: "flex-row",
659
+ vertical: "flex-col w-full"
660
+ }
661
+ },
662
+ defaultVariants: {
663
+ orientation: "horizontal"
664
+ }
43
665
  });
44
- Object.defineProperty(exports, "ResizablePanelPropsSchema", {
45
- enumerable: true,
46
- get: function () { return chunkSN5LFAP3_js.ResizablePanelPropsSchema; }
666
+ var buttonGroupItemVariants = classVarianceAuthority.cva("", {
667
+ variants: {
668
+ orientation: {
669
+ // min-w-[44px] ensures visual layer fills touch target width (for icon buttons)
670
+ horizontal: "min-w-[44px]",
671
+ // flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,
672
+ // eliminating gaps between stacked buttons in vertical orientation
673
+ vertical: "flex min-h-[44px]"
674
+ },
675
+ position: {
676
+ first: "",
677
+ middle: "",
678
+ last: "",
679
+ only: ""
680
+ // Single button - no modifications needed
681
+ }
682
+ },
683
+ compoundVariants: [
684
+ // ==========================================================================
685
+ // Horizontal Orientation
686
+ // ==========================================================================
687
+ {
688
+ orientation: "horizontal",
689
+ position: "first",
690
+ className: "rounded-r-none border-r-0"
691
+ },
692
+ {
693
+ orientation: "horizontal",
694
+ position: "middle",
695
+ className: "rounded-none border-r-0"
696
+ },
697
+ {
698
+ orientation: "horizontal",
699
+ position: "last",
700
+ className: "rounded-l-none"
701
+ },
702
+ // ==========================================================================
703
+ // Vertical Orientation
704
+ // Note: w-full is handled by Button's effectiveFullWidth for both layers
705
+ // ==========================================================================
706
+ {
707
+ orientation: "vertical",
708
+ position: "first",
709
+ className: "rounded-b-none border-b-0"
710
+ },
711
+ {
712
+ orientation: "vertical",
713
+ position: "middle",
714
+ className: "rounded-none border-b-0"
715
+ },
716
+ {
717
+ orientation: "vertical",
718
+ position: "last",
719
+ className: "rounded-t-none"
720
+ }
721
+ ],
722
+ defaultVariants: {
723
+ orientation: "horizontal",
724
+ position: "only"
725
+ }
47
726
  });
48
- Object.defineProperty(exports, "ResizePresetSchema", {
49
- enumerable: true,
50
- get: function () { return chunkSN5LFAP3_js.ResizePresetSchema; }
727
+ classVarianceAuthority.cva("bg-[var(--border)]", {
728
+ variants: {
729
+ orientation: {
730
+ horizontal: "w-px h-6 mx-1",
731
+ vertical: "h-px w-full my-1"
732
+ }
733
+ },
734
+ defaultVariants: {
735
+ orientation: "horizontal"
736
+ }
51
737
  });
52
- Object.defineProperty(exports, "resizableGripVariants", {
53
- enumerable: true,
54
- get: function () { return chunkSN5LFAP3_js.resizableGripVariants; }
55
- });
56
- Object.defineProperty(exports, "resizableHandleVariants", {
57
- enumerable: true,
58
- get: function () { return chunkSN5LFAP3_js.resizableHandleVariants; }
59
- });
60
- Object.defineProperty(exports, "useResizableContext", {
61
- enumerable: true,
62
- get: function () { return chunkSN5LFAP3_js.useResizableContext; }
738
+ var buttonOuterVariants = classVarianceAuthority.cva(
739
+ "inline-flex justify-center min-h-[44px] min-w-[44px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",
740
+ {
741
+ variants: {
742
+ fullWidth: {
743
+ true: "w-full",
744
+ false: ""
745
+ },
746
+ inVerticalGroup: {
747
+ true: "items-stretch",
748
+ false: "items-center"
749
+ }
750
+ },
751
+ defaultVariants: {
752
+ fullWidth: false,
753
+ inVerticalGroup: false
754
+ }
755
+ }
756
+ );
757
+ var buttonVisualVariants = classVarianceAuthority.cva(
758
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 relative cursor-pointer",
759
+ {
760
+ variants: {
761
+ variant: {
762
+ default: "bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] data-[pressed]:bg-[var(--primary-action)]/80",
763
+ destructive: "bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background)]/90 data-[pressed]:bg-[var(--destructive-background)]/80",
764
+ outline: "border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)] data-[pressed]:bg-[var(--input-border)]",
765
+ secondary: "bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary)]/80 data-[pressed]:bg-[var(--secondary)]/70",
766
+ ghost: "hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] data-[pressed]:bg-[var(--accent)]",
767
+ link: "text-[var(--text-link)] underline-offset-4 hover:underline data-[pressed]:text-[var(--text-link-hover)]"
768
+ },
769
+ fullWidth: {
770
+ true: "w-full",
771
+ false: ""
772
+ },
773
+ visualSize: {
774
+ default: "h-10 px-4 py-2",
775
+ sm: "h-9 rounded-md px-3 text-xs",
776
+ lg: "h-11 rounded-md px-8",
777
+ icon: "h-10 w-10",
778
+ dot: "h-5 w-5 rounded-full p-0 min-h-0 min-w-0"
779
+ },
780
+ paywall: {
781
+ true: "!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent",
782
+ false: ""
783
+ }
784
+ },
785
+ defaultVariants: {
786
+ variant: "default",
787
+ visualSize: "default",
788
+ paywall: false
789
+ }
790
+ }
791
+ );
792
+ var Button = react.memo(react.forwardRef(
793
+ ({
794
+ className,
795
+ buttonVisualClassName,
796
+ variant,
797
+ size,
798
+ visualSize,
799
+ fullWidth,
800
+ loading = false,
801
+ loadingText = "Loading...",
802
+ shortcut,
803
+ children,
804
+ isDisabled,
805
+ paywall = false,
806
+ paywallRedirect,
807
+ paywallDescription,
808
+ onPress,
809
+ ...props
810
+ }, ref) => {
811
+ const paywallDescriptionId = react.useId();
812
+ const groupContext = useButtonGroupContext();
813
+ const itemContext = useButtonGroupItemContext();
814
+ const effectiveVariant = variant ?? groupContext?.variant ?? "default";
815
+ const effectiveSize = size ?? groupContext?.size;
816
+ const effectiveIsDisabled = isDisabled ?? groupContext?.isDisabled ?? false;
817
+ const isInVerticalGroup = groupContext?.orientation === "vertical";
818
+ const effectiveFullWidth = fullWidth || isInVerticalGroup;
819
+ const positionClassName = itemContext ? buttonGroupItemVariants({
820
+ orientation: groupContext?.orientation ?? "horizontal",
821
+ position: itemContext.position
822
+ }) : "";
823
+ const effectiveVisualSize = visualSize ?? effectiveSize ?? "default";
824
+ if (process.env.NODE_ENV !== "production") {
825
+ if ((effectiveVisualSize === "dot" || effectiveVisualSize === "icon") && !props["aria-label"] && !children) {
826
+ console.warn(
827
+ '[Button] visualSize="dot" or "icon" requires aria-label when no visible text is provided (WCAG 1.1.1)'
828
+ );
829
+ }
830
+ }
831
+ const handlePress = (e) => {
832
+ if (paywall) {
833
+ if (paywallRedirect) {
834
+ window.open(paywallRedirect, "_blank", "noopener,noreferrer");
835
+ }
836
+ return;
837
+ }
838
+ onPress?.(e);
839
+ };
840
+ const computedIsDisabled = effectiveIsDisabled || loading || void 0;
841
+ return /* @__PURE__ */ jsxRuntime.jsx(
842
+ reactAriaComponents.Button,
843
+ {
844
+ ref,
845
+ isDisabled: computedIsDisabled,
846
+ "aria-disabled": paywall ? true : void 0,
847
+ "aria-describedby": paywall ? paywallDescriptionId : void 0,
848
+ onPress: handlePress,
849
+ className: cn(buttonOuterVariants({ fullWidth: effectiveFullWidth, inVerticalGroup: isInVerticalGroup }), className),
850
+ ...props,
851
+ children: (renderProps) => (
852
+ /* Layer 2: Visual Button */
853
+ /* @__PURE__ */ jsxRuntime.jsxs(
854
+ "span",
855
+ {
856
+ className: cn(
857
+ buttonVisualVariants({
858
+ variant: effectiveVariant,
859
+ visualSize: effectiveVisualSize,
860
+ paywall,
861
+ fullWidth: effectiveFullWidth
862
+ }),
863
+ // Position styling from ButtonGroup context (border-radius adjustments)
864
+ positionClassName,
865
+ buttonVisualClassName,
866
+ // Layer 2 interaction styles (no focus - focus ring is on Layer 1)
867
+ PRESSED_STYLES,
868
+ HOVER_STYLES,
869
+ HIGH_CONTRAST_HOVER,
870
+ HIGH_CONTRAST_PRESSED
871
+ ),
872
+ "data-pressed": renderProps.isPressed || void 0,
873
+ children: [
874
+ loading && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
875
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "motion-safe:animate-spin", "aria-hidden": "true" }),
876
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", "aria-live": "polite", children: loadingText })
877
+ ] }),
878
+ !loading && children,
879
+ paywall && /* @__PURE__ */ jsxRuntime.jsx(
880
+ lucideReact.Zap,
881
+ {
882
+ "data-testid": "zap-icon",
883
+ "aria-hidden": "true",
884
+ className: "ml-1"
885
+ }
886
+ ),
887
+ paywall && /* @__PURE__ */ jsxRuntime.jsxs("span", { id: paywallDescriptionId, className: "sr-only", children: [
888
+ "Premium feature: ",
889
+ paywallDescription || "Upgrade required to access this feature"
890
+ ] }),
891
+ renderProps.isFocusVisible && shortcut && /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "ml-auto hidden text-xs opacity-60 lg:inline", children: shortcut }),
892
+ renderProps.isPressed && /* @__PURE__ */ jsxRuntime.jsx(
893
+ "span",
894
+ {
895
+ className: "absolute inset-0 rounded-[inherit] bg-current opacity-10 motion-safe:animate-in motion-safe:zoom-in-95",
896
+ "aria-hidden": "true"
897
+ }
898
+ )
899
+ ]
900
+ }
901
+ )
902
+ )
903
+ }
904
+ );
905
+ }
906
+ ));
907
+ Button.displayName = "Button";
908
+ var DEFAULT_MAX_VALUE = 4294967295;
909
+ var DEFAULT_MIN_VALUE = 0;
910
+ var NEGATIVE_MIN_VALUE = -2147483647;
911
+ zod.z.object({
912
+ // Value props
913
+ /** Current value (controlled mode) */
914
+ value: zod.z.number().nullable().optional(),
915
+ /** Default value (uncontrolled mode) */
916
+ defaultValue: zod.z.number().optional(),
917
+ // Constraint props
918
+ /** Minimum allowed value (default: 0) */
919
+ minValue: zod.z.number().optional(),
920
+ /** Maximum allowed value (default: 4294967295 / UINT32_MAX) */
921
+ maxValue: zod.z.number().optional(),
922
+ /** Allow negative numbers (sets minValue to -2147483647 if not explicitly set) */
923
+ allowNegative: zod.z.boolean().optional(),
924
+ /** Step increment for stepper buttons and arrow keys (default: 1) */
925
+ step: zod.z.number().positive().optional(),
926
+ // Formatting props
927
+ /** Intl.NumberFormat options for locale-aware formatting */
928
+ formatOptions: zod.z.custom().optional(),
929
+ // State props
930
+ /** Whether the field is disabled */
931
+ isDisabled: zod.z.boolean().optional(),
932
+ /** Whether the field is read-only */
933
+ isReadOnly: zod.z.boolean().optional(),
934
+ /** Whether the field is required */
935
+ isRequired: zod.z.boolean().optional(),
936
+ /** Whether the field is in an invalid state */
937
+ isInvalid: zod.z.boolean().optional(),
938
+ /** Whether scroll wheel adjustment is disabled */
939
+ isWheelDisabled: zod.z.boolean().optional(),
940
+ // Validation props
941
+ /** Custom validation function that returns an error message or null */
942
+ validate: zod.z.function().optional(),
943
+ /** Validation behavior: 'native' for HTML5 validation, 'aria' for ARIA-only */
944
+ validationBehavior: zod.z.enum(["native", "aria"]).default("native"),
945
+ // Display props
946
+ /** Field label (required for accessibility) */
947
+ label: zod.z.string(),
948
+ /** Description text below the field */
949
+ description: zod.z.string().optional(),
950
+ /** Error message string or render function */
951
+ errorMessage: zod.z.union([zod.z.string(), zod.z.function()]).optional(),
952
+ // Stepper props
953
+ /** Layout for stepper buttons */
954
+ stepperLayout: zod.z.enum(["sides", "stacked", "hidden"]).default("sides"),
955
+ /** Custom aria-label for increment button */
956
+ incrementAriaLabel: zod.z.string().optional(),
957
+ /** Custom aria-label for decrement button */
958
+ decrementAriaLabel: zod.z.string().optional(),
959
+ // Form props
960
+ /** Name attribute for form submission */
961
+ name: zod.z.string().optional(),
962
+ // Variant props
963
+ /** Size variant */
964
+ size: zod.z.enum(["sm", "default", "lg"]).default("default"),
965
+ // Event props
966
+ /** Called when the numeric value changes */
967
+ onChange: zod.z.function().optional(),
968
+ /** Called when the field gains focus */
969
+ onFocus: zod.z.function().optional(),
970
+ /** Called when the field loses focus */
971
+ onBlur: zod.z.function().optional(),
972
+ /** Called when focus state changes */
973
+ onFocusChange: zod.z.function().optional(),
974
+ // Standard props
975
+ /** Additional CSS classes */
976
+ className: zod.z.string().optional(),
977
+ /** Whether to auto-focus on mount */
978
+ autoFocus: zod.z.boolean().optional()
63
979
  });
980
+ var numberFieldVariants = classVarianceAuthority.cva(
981
+ [
982
+ // Base styles
983
+ "inline-flex items-center rounded-md border",
984
+ "bg-[var(--content-background)] text-[var(--content-foreground)]",
985
+ "transition-colors duration-200",
986
+ // Focus within
987
+ "focus-within:ring-2 focus-within:ring-[var(--ring)] focus-within:ring-offset-2",
988
+ // Disabled
989
+ "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50"
990
+ ],
991
+ {
992
+ variants: {
993
+ size: {
994
+ sm: "h-9 text-sm",
995
+ default: "h-10 text-base",
996
+ lg: "h-12 text-lg"
997
+ },
998
+ isInvalid: {
999
+ true: "border-[var(--destructive)] focus-within:ring-[var(--destructive)]",
1000
+ false: "border-[var(--input)] hover:border-[var(--input)]/80"
1001
+ }
1002
+ },
1003
+ defaultVariants: {
1004
+ size: "default",
1005
+ isInvalid: false
1006
+ }
1007
+ }
1008
+ );
1009
+ var numberFieldInputVariants = classVarianceAuthority.cva(
1010
+ [
1011
+ // Base styles
1012
+ "flex-1 bg-transparent text-center tabular-nums",
1013
+ "min-w-0",
1014
+ // Allow shrinking
1015
+ // Focus
1016
+ "focus:outline-none",
1017
+ // Hide native spinners
1018
+ "[appearance:textfield]",
1019
+ "[&::-webkit-outer-spin-button]:appearance-none",
1020
+ "[&::-webkit-inner-spin-button]:appearance-none"
1021
+ ],
1022
+ {
1023
+ variants: {
1024
+ size: {
1025
+ sm: "px-2 text-sm",
1026
+ default: "px-3 text-base",
1027
+ lg: "px-4 text-lg"
1028
+ }
1029
+ },
1030
+ defaultVariants: {
1031
+ size: "default"
1032
+ }
1033
+ }
1034
+ );
1035
+ var numberFieldStepperVariants = classVarianceAuthority.cva(
1036
+ [
1037
+ // Base styles
1038
+ "flex items-center justify-center",
1039
+ "transition-colors duration-150",
1040
+ "select-none",
1041
+ // Hover
1042
+ "hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]",
1043
+ // Focus
1044
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]",
1045
+ "focus-visible:ring-inset",
1046
+ // Active (pressed)
1047
+ "active:bg-[var(--accent)]/80",
1048
+ // Disabled
1049
+ "disabled:pointer-events-none disabled:opacity-50"
1050
+ ],
1051
+ {
1052
+ variants: {
1053
+ size: {
1054
+ sm: "min-w-8 min-h-8 text-sm",
1055
+ default: "min-w-10 min-h-10 text-base",
1056
+ lg: "min-w-12 min-h-12 text-lg"
1057
+ },
1058
+ position: {
1059
+ left: "rounded-l-md border-r border-[var(--input)]",
1060
+ right: "rounded-r-md border-l border-[var(--input)]",
1061
+ top: "rounded-tr-md border-b border-l border-[var(--input)] h-1/2",
1062
+ bottom: "rounded-br-md border-l border-[var(--input)] h-1/2"
1063
+ }
1064
+ },
1065
+ defaultVariants: {
1066
+ size: "default"
1067
+ }
1068
+ }
1069
+ );
1070
+ var numberFieldLabelVariants = classVarianceAuthority.cva(
1071
+ [
1072
+ "block font-medium text-[var(--content-foreground)]",
1073
+ "mb-1.5",
1074
+ // Required indicator
1075
+ 'data-[required]:after:content-["*"] data-[required]:after:ml-0.5',
1076
+ "data-[required]:after:text-[var(--destructive)]"
1077
+ ],
1078
+ {
1079
+ variants: {
1080
+ size: {
1081
+ sm: "text-sm",
1082
+ default: "text-sm",
1083
+ lg: "text-base"
1084
+ }
1085
+ },
1086
+ defaultVariants: {
1087
+ size: "default"
1088
+ }
1089
+ }
1090
+ );
1091
+ var numberFieldDescriptionVariants = classVarianceAuthority.cva(
1092
+ [
1093
+ "text-[var(--menu-muted)]",
1094
+ "mt-1"
1095
+ ],
1096
+ {
1097
+ variants: {
1098
+ size: {
1099
+ sm: "text-xs",
1100
+ default: "text-sm",
1101
+ lg: "text-base"
1102
+ }
1103
+ },
1104
+ defaultVariants: {
1105
+ size: "default"
1106
+ }
1107
+ }
1108
+ );
1109
+ var numberFieldErrorVariants = classVarianceAuthority.cva(
1110
+ [
1111
+ "flex items-center gap-1",
1112
+ "text-[var(--destructive)]",
1113
+ "mt-1"
1114
+ ],
1115
+ {
1116
+ variants: {
1117
+ size: {
1118
+ sm: "text-xs",
1119
+ default: "text-sm",
1120
+ lg: "text-base"
1121
+ }
1122
+ },
1123
+ defaultVariants: {
1124
+ size: "default"
1125
+ }
1126
+ }
1127
+ );
1128
+ var NumberField = react.forwardRef(
1129
+ ({
1130
+ // Display props
1131
+ label,
1132
+ description,
1133
+ errorMessage,
1134
+ // Variant props
1135
+ size = "default",
1136
+ stepperLayout = "sides",
1137
+ // Custom props
1138
+ allowNegative = false,
1139
+ incrementAriaLabel,
1140
+ decrementAriaLabel,
1141
+ // Constraint props (apply defaults)
1142
+ minValue,
1143
+ maxValue,
1144
+ // Standard props
1145
+ className,
1146
+ isInvalid,
1147
+ isRequired,
1148
+ isDisabled,
1149
+ isReadOnly,
1150
+ // All other props go to AriaNumberField
1151
+ ...props
1152
+ }, ref) => {
1153
+ const effectiveMinValue = minValue ?? (allowNegative ? NEGATIVE_MIN_VALUE : DEFAULT_MIN_VALUE);
1154
+ const effectiveMaxValue = maxValue ?? DEFAULT_MAX_VALUE;
1155
+ const showSteppers = stepperLayout !== "hidden" && !isReadOnly;
1156
+ const isStackedLayout = stepperLayout === "stacked";
1157
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1158
+ reactAriaComponents.NumberField,
1159
+ {
1160
+ ref,
1161
+ className: cn("group flex flex-col", className),
1162
+ minValue: effectiveMinValue,
1163
+ maxValue: effectiveMaxValue,
1164
+ isInvalid,
1165
+ isRequired,
1166
+ isDisabled,
1167
+ isReadOnly,
1168
+ ...props,
1169
+ children: [
1170
+ /* @__PURE__ */ jsxRuntime.jsx(
1171
+ reactAriaComponents.Label,
1172
+ {
1173
+ className: cn(numberFieldLabelVariants({ size })),
1174
+ "data-required": isRequired || void 0,
1175
+ children: label
1176
+ }
1177
+ ),
1178
+ /* @__PURE__ */ jsxRuntime.jsxs(
1179
+ reactAriaComponents.Group,
1180
+ {
1181
+ className: cn(
1182
+ numberFieldVariants({
1183
+ size,
1184
+ isInvalid: isInvalid ?? false
1185
+ }),
1186
+ isStackedLayout && "pr-0"
1187
+ ),
1188
+ children: [
1189
+ showSteppers && !isStackedLayout && /* @__PURE__ */ jsxRuntime.jsx(
1190
+ Button,
1191
+ {
1192
+ slot: "decrement",
1193
+ variant: "ghost",
1194
+ className: "!min-h-0 !min-w-0",
1195
+ buttonVisualClassName: cn(
1196
+ numberFieldStepperVariants({
1197
+ size,
1198
+ position: "left"
1199
+ })
1200
+ ),
1201
+ "aria-label": decrementAriaLabel ?? "Decrease value",
1202
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { className: "h-4 w-4", "aria-hidden": "true" })
1203
+ }
1204
+ ),
1205
+ /* @__PURE__ */ jsxRuntime.jsx(
1206
+ reactAriaComponents.Input,
1207
+ {
1208
+ className: cn(numberFieldInputVariants({ size }))
1209
+ }
1210
+ ),
1211
+ showSteppers && isStackedLayout && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col h-full", children: [
1212
+ /* @__PURE__ */ jsxRuntime.jsx(
1213
+ Button,
1214
+ {
1215
+ slot: "increment",
1216
+ variant: "ghost",
1217
+ className: "!min-h-0 !min-w-0",
1218
+ buttonVisualClassName: cn(
1219
+ numberFieldStepperVariants({
1220
+ size,
1221
+ position: "top"
1222
+ })
1223
+ ),
1224
+ "aria-label": incrementAriaLabel ?? "Increase value",
1225
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-3 w-3", "aria-hidden": "true" })
1226
+ }
1227
+ ),
1228
+ /* @__PURE__ */ jsxRuntime.jsx(
1229
+ Button,
1230
+ {
1231
+ slot: "decrement",
1232
+ variant: "ghost",
1233
+ className: "!min-h-0 !min-w-0",
1234
+ buttonVisualClassName: cn(
1235
+ numberFieldStepperVariants({
1236
+ size,
1237
+ position: "bottom"
1238
+ })
1239
+ ),
1240
+ "aria-label": decrementAriaLabel ?? "Decrease value",
1241
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { className: "h-3 w-3", "aria-hidden": "true" })
1242
+ }
1243
+ )
1244
+ ] }),
1245
+ showSteppers && !isStackedLayout && /* @__PURE__ */ jsxRuntime.jsx(
1246
+ Button,
1247
+ {
1248
+ slot: "increment",
1249
+ variant: "ghost",
1250
+ className: "!min-h-0 !min-w-0",
1251
+ buttonVisualClassName: cn(
1252
+ numberFieldStepperVariants({
1253
+ size,
1254
+ position: "right"
1255
+ })
1256
+ ),
1257
+ "aria-label": incrementAriaLabel ?? "Increase value",
1258
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4", "aria-hidden": "true" })
1259
+ }
1260
+ )
1261
+ ]
1262
+ }
1263
+ ),
1264
+ description && /* @__PURE__ */ jsxRuntime.jsx(
1265
+ reactAriaComponents.Text,
1266
+ {
1267
+ slot: "description",
1268
+ className: cn(numberFieldDescriptionVariants({ size })),
1269
+ children: description
1270
+ }
1271
+ ),
1272
+ /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.FieldError, { className: cn(numberFieldErrorVariants({ size })), children: errorMessage })
1273
+ ]
1274
+ }
1275
+ );
1276
+ }
1277
+ );
1278
+ NumberField.displayName = "NumberField";
1279
+ var ResizablePopover = react.forwardRef(
1280
+ function ResizablePopover2({
1281
+ isOpen,
1282
+ onOpenChange,
1283
+ groupLabel,
1284
+ leftPanel,
1285
+ rightPanel,
1286
+ leftSize,
1287
+ rightSize,
1288
+ onSizesChange,
1289
+ presets,
1290
+ triggerRef,
1291
+ direction
1292
+ }, _ref) {
1293
+ const [originalSizes, setOriginalSizes] = react.useState({ left: leftSize, right: rightSize });
1294
+ const wasOpenRef = react.useRef(false);
1295
+ react.useEffect(() => {
1296
+ if (isOpen && !wasOpenRef.current) {
1297
+ setOriginalSizes({ left: leftSize, right: rightSize });
1298
+ }
1299
+ wasOpenRef.current = isOpen;
1300
+ }, [isOpen, leftSize, rightSize]);
1301
+ const handleLeftChange = react.useCallback(
1302
+ (value) => {
1303
+ if (value === null) return;
1304
+ const newLeft = Math.max(
1305
+ leftPanel.collapsible ? 0 : leftPanel.minSize,
1306
+ Math.min(leftPanel.maxSize, value)
1307
+ );
1308
+ const newRight = 100 - newLeft;
1309
+ const rightMin = rightPanel.collapsible ? 0 : rightPanel.minSize;
1310
+ const rightMax = rightPanel.maxSize;
1311
+ if (newRight < rightMin || newRight > rightMax) {
1312
+ return;
1313
+ }
1314
+ onSizesChange(newLeft, newRight);
1315
+ },
1316
+ [leftPanel, rightPanel, onSizesChange]
1317
+ );
1318
+ const handleRightChange = react.useCallback(
1319
+ (value) => {
1320
+ if (value === null) return;
1321
+ const newRight = Math.max(
1322
+ rightPanel.collapsible ? 0 : rightPanel.minSize,
1323
+ Math.min(rightPanel.maxSize, value)
1324
+ );
1325
+ const newLeft = 100 - newRight;
1326
+ const leftMin = leftPanel.collapsible ? 0 : leftPanel.minSize;
1327
+ const leftMax = leftPanel.maxSize;
1328
+ if (newLeft < leftMin || newLeft > leftMax) {
1329
+ return;
1330
+ }
1331
+ onSizesChange(newLeft, newRight);
1332
+ },
1333
+ [leftPanel, rightPanel, onSizesChange]
1334
+ );
1335
+ const handlePreset = react.useCallback(
1336
+ (preset) => {
1337
+ const leftSize2 = preset.sizes[0];
1338
+ const rightSize2 = preset.sizes[1];
1339
+ if (leftSize2 !== void 0 && rightSize2 !== void 0) {
1340
+ onSizesChange(leftSize2, rightSize2);
1341
+ }
1342
+ },
1343
+ [onSizesChange]
1344
+ );
1345
+ const handleCancel = react.useCallback(() => {
1346
+ onSizesChange(originalSizes.left, originalSizes.right);
1347
+ onOpenChange(false);
1348
+ }, [onSizesChange, onOpenChange, originalSizes]);
1349
+ const handleClose = react.useCallback(() => {
1350
+ onOpenChange(false);
1351
+ }, [onOpenChange]);
1352
+ if (!isOpen) return null;
1353
+ const placement = direction === "horizontal" ? "bottom" : "right";
1354
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.DialogTrigger, { isOpen, onOpenChange, children: [
1355
+ /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Button, { className: "sr-only", children: "Open resize controls" }),
1356
+ /* @__PURE__ */ jsxRuntime.jsx(
1357
+ reactAriaComponents.Popover,
1358
+ {
1359
+ triggerRef,
1360
+ placement,
1361
+ offset: 8,
1362
+ className: cn(
1363
+ "w-72",
1364
+ "rounded-lg border border-[var(--border)]",
1365
+ "bg-[var(--popover)] text-[var(--popover-foreground)]",
1366
+ "shadow-lg",
1367
+ "outline-none",
1368
+ "animate-in fade-in-0 zoom-in-95",
1369
+ "data-[exiting]:animate-out data-[exiting]:fade-out-0 data-[exiting]:zoom-out-95"
1370
+ ),
1371
+ children: /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.Dialog, { className: "outline-none", children: [
1372
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between border-b border-[var(--border)] px-4 py-3", children: [
1373
+ /* @__PURE__ */ jsxRuntime.jsxs("h3", { className: "text-sm font-medium", children: [
1374
+ "Resize: ",
1375
+ groupLabel
1376
+ ] }),
1377
+ /* @__PURE__ */ jsxRuntime.jsx(
1378
+ reactAriaComponents.Button,
1379
+ {
1380
+ onPress: handleClose,
1381
+ className: cn(
1382
+ "inline-flex items-center justify-center rounded-md",
1383
+ "min-h-[44px] min-w-[44px]",
1384
+ "text-[var(--menu-muted)]",
1385
+ "hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)]",
1386
+ "focus-visible:outline-none focus-visible:ring-2",
1387
+ "focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2"
1388
+ ),
1389
+ "aria-label": "Close",
1390
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
1391
+ }
1392
+ )
1393
+ ] }),
1394
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4 px-4 py-4", children: [
1395
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
1396
+ NumberField,
1397
+ {
1398
+ label: `${leftPanel.name} (%)`,
1399
+ value: Math.round(leftSize),
1400
+ onChange: handleLeftChange,
1401
+ minValue: leftPanel.collapsible ? 0 : leftPanel.minSize,
1402
+ maxValue: leftPanel.maxSize,
1403
+ step: 1,
1404
+ stepperLayout: "sides"
1405
+ }
1406
+ ) }),
1407
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
1408
+ NumberField,
1409
+ {
1410
+ label: `${rightPanel.name} (%)`,
1411
+ value: Math.round(rightSize),
1412
+ onChange: handleRightChange,
1413
+ minValue: rightPanel.collapsible ? 0 : rightPanel.minSize,
1414
+ maxValue: rightPanel.maxSize,
1415
+ step: 1,
1416
+ stepperLayout: "sides"
1417
+ }
1418
+ ) }),
1419
+ presets && presets.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-[var(--border)] pt-4", children: [
1420
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 text-xs font-medium text-[var(--menu-muted)]", children: "Presets" }),
1421
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: presets.map((preset, index) => /* @__PURE__ */ jsxRuntime.jsx(
1422
+ Button,
1423
+ {
1424
+ variant: "outline",
1425
+ size: "sm",
1426
+ onPress: () => handlePreset(preset),
1427
+ children: preset.label
1428
+ },
1429
+ index
1430
+ )) })
1431
+ ] })
1432
+ ] }),
1433
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end border-t border-[var(--border)] px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", onPress: handleCancel, children: "Cancel" }) })
1434
+ ] })
1435
+ }
1436
+ )
1437
+ ] });
1438
+ }
1439
+ );
1440
+ ResizablePopover.displayName = "ResizablePopover";
1441
+ var ResizableHandle = react.forwardRef(
1442
+ function ResizableHandle2({ withHandle = true, presets, disabled = false, className }, ref) {
1443
+ const {
1444
+ direction,
1445
+ groupLabel,
1446
+ sizes,
1447
+ setSizes,
1448
+ panels,
1449
+ announce,
1450
+ containerRef
1451
+ } = useResizableContext();
1452
+ const internalRef = react.useRef(null);
1453
+ const handleRef = ref || internalRef;
1454
+ const [handleIndex, setHandleIndex] = react.useState(0);
1455
+ react.useEffect(() => {
1456
+ const handle = handleRef.current;
1457
+ const container = containerRef.current;
1458
+ if (!handle || !container) return;
1459
+ const handles = container.querySelectorAll('[role="slider"]');
1460
+ let index = 0;
1461
+ handles.forEach((h, i) => {
1462
+ if (h === handle) {
1463
+ index = i;
1464
+ }
1465
+ });
1466
+ setHandleIndex(index);
1467
+ }, [containerRef, handleRef]);
1468
+ const leftPanelIndex = handleIndex;
1469
+ const rightPanelIndex = handleIndex + 1;
1470
+ const leftPanel = panels[leftPanelIndex];
1471
+ const rightPanel = panels[rightPanelIndex];
1472
+ const leftSize = sizes[leftPanelIndex] ?? 50;
1473
+ const rightSize = sizes[rightPanelIndex] ?? 50;
1474
+ const [isPopoverOpen, setIsPopoverOpen] = react.useState(false);
1475
+ const handlePopoverSizesChange = react.useCallback(
1476
+ (newLeftSize, newRightSize) => {
1477
+ const newSizes = [...sizes];
1478
+ newSizes[leftPanelIndex] = newLeftSize;
1479
+ newSizes[rightPanelIndex] = newRightSize;
1480
+ setSizes(newSizes);
1481
+ },
1482
+ [sizes, setSizes, leftPanelIndex, rightPanelIndex]
1483
+ );
1484
+ const { isDragging, handlePointerDown, handleKeyDown } = useResizable({
1485
+ direction,
1486
+ sizes,
1487
+ setSizes,
1488
+ panels,
1489
+ containerRef,
1490
+ leftPanelIndex,
1491
+ rightPanelIndex,
1492
+ disabled,
1493
+ announce,
1494
+ groupLabel,
1495
+ onOpenPopover: () => setIsPopoverOpen(true)
1496
+ });
1497
+ const ariaLabel = leftPanel && rightPanel ? `Resize handle between ${leftPanel.name} and ${rightPanel.name} in ${groupLabel}` : `Resize handle in ${groupLabel}`;
1498
+ const GripIcon = direction === "horizontal" ? lucideReact.GripVertical : lucideReact.GripHorizontal;
1499
+ const leftPanelInfo = leftPanel ?? {
1500
+ name: "Panel 1",
1501
+ minSize: DEFAULT_MIN_SIZE,
1502
+ maxSize: DEFAULT_MAX_SIZE,
1503
+ collapsible: false
1504
+ };
1505
+ const rightPanelInfo = rightPanel ?? {
1506
+ name: "Panel 2",
1507
+ minSize: DEFAULT_MIN_SIZE,
1508
+ maxSize: DEFAULT_MAX_SIZE,
1509
+ collapsible: false
1510
+ };
1511
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1512
+ /* @__PURE__ */ jsxRuntime.jsx(
1513
+ "div",
1514
+ {
1515
+ ref: handleRef,
1516
+ role: "slider",
1517
+ tabIndex: disabled ? -1 : 0,
1518
+ "aria-label": ariaLabel,
1519
+ "aria-valuenow": Math.round(leftSize),
1520
+ "aria-valuemin": leftPanel?.collapsible ? 0 : leftPanel?.minSize ?? 0,
1521
+ "aria-valuemax": leftPanel?.maxSize ?? 100,
1522
+ "aria-orientation": direction,
1523
+ "aria-disabled": disabled,
1524
+ "data-direction": direction,
1525
+ "data-dragging": isDragging,
1526
+ "data-disabled": disabled,
1527
+ onPointerDown: handlePointerDown,
1528
+ onKeyDown: handleKeyDown,
1529
+ className: cn(
1530
+ resizableHandleVariants({
1531
+ direction,
1532
+ disabled,
1533
+ isDragging
1534
+ }),
1535
+ className
1536
+ ),
1537
+ children: withHandle && /* @__PURE__ */ jsxRuntime.jsx(
1538
+ "div",
1539
+ {
1540
+ className: cn(resizableGripVariants({ direction })),
1541
+ "aria-hidden": "true",
1542
+ children: /* @__PURE__ */ jsxRuntime.jsx(GripIcon, { className: "h-4 w-4" })
1543
+ }
1544
+ )
1545
+ }
1546
+ ),
1547
+ /* @__PURE__ */ jsxRuntime.jsx(
1548
+ ResizablePopover,
1549
+ {
1550
+ isOpen: isPopoverOpen,
1551
+ onOpenChange: setIsPopoverOpen,
1552
+ groupLabel,
1553
+ leftPanel: leftPanelInfo,
1554
+ rightPanel: rightPanelInfo,
1555
+ leftSize,
1556
+ rightSize,
1557
+ onSizesChange: handlePopoverSizesChange,
1558
+ presets,
1559
+ triggerRef: handleRef,
1560
+ direction
1561
+ }
1562
+ )
1563
+ ] });
1564
+ }
1565
+ );
1566
+ ResizableHandle.displayName = "ResizableHandle";
1567
+
1568
+ exports.DEFAULT_MAX_SIZE = DEFAULT_MAX_SIZE;
1569
+ exports.DEFAULT_MIN_SIZE = DEFAULT_MIN_SIZE;
1570
+ exports.LONG_PRESS_THRESHOLD = LONG_PRESS_THRESHOLD;
1571
+ exports.ResizableHandle = ResizableHandle;
1572
+ exports.ResizableHandlePropsSchema = ResizableHandlePropsSchema;
1573
+ exports.ResizablePanel = ResizablePanel;
1574
+ exports.ResizablePanelGroup = ResizablePanelGroup;
1575
+ exports.ResizablePanelGroupPropsSchema = ResizablePanelGroupPropsSchema;
1576
+ exports.ResizablePanelPropsSchema = ResizablePanelPropsSchema;
1577
+ exports.ResizePresetSchema = ResizePresetSchema;
1578
+ exports.resizableGripVariants = resizableGripVariants;
1579
+ exports.resizableHandleVariants = resizableHandleVariants;
1580
+ exports.useResizableContext = useResizableContext;
64
1581
  //# sourceMappingURL=index.js.map
65
1582
  //# sourceMappingURL=index.js.map