@psnext/design-system 2.4.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/DESIGN.md +32 -4
  2. package/SKILL.md +1 -1
  3. package/dist/Header.cjs +3 -3
  4. package/dist/Header.cjs.map +1 -1
  5. package/dist/Header.js +3 -3
  6. package/dist/Header.js.map +1 -1
  7. package/dist/Mosaic.cjs +472 -0
  8. package/dist/Mosaic.cjs.map +1 -0
  9. package/dist/Mosaic.js +459 -0
  10. package/dist/Mosaic.js.map +1 -0
  11. package/dist/index.cjs +25 -4
  12. package/dist/index.d.cts +5 -5
  13. package/dist/index.d.cts.map +1 -1
  14. package/dist/index.d.ts +5 -5
  15. package/dist/index.js +10 -5
  16. package/dist/index10.d.cts +5 -5
  17. package/dist/index10.d.ts +6 -6
  18. package/dist/index11.d.cts +3 -3
  19. package/dist/index11.d.ts +3 -3
  20. package/dist/index12.d.cts +12 -12
  21. package/dist/index12.d.cts.map +1 -1
  22. package/dist/index12.d.ts +12 -12
  23. package/dist/index12.d.ts.map +1 -1
  24. package/dist/index13.d.cts +6 -6
  25. package/dist/index13.d.cts.map +1 -1
  26. package/dist/index13.d.ts +6 -6
  27. package/dist/index13.d.ts.map +1 -1
  28. package/dist/index14.d.cts +5 -5
  29. package/dist/index14.d.ts +5 -5
  30. package/dist/index15.d.cts +58 -23
  31. package/dist/index15.d.cts.map +1 -1
  32. package/dist/index15.d.ts +58 -23
  33. package/dist/index15.d.ts.map +1 -1
  34. package/dist/index16.d.cts +23 -32
  35. package/dist/index16.d.cts.map +1 -1
  36. package/dist/index16.d.ts +23 -32
  37. package/dist/index16.d.ts.map +1 -1
  38. package/dist/index17.d.cts +34 -15
  39. package/dist/index17.d.cts.map +1 -1
  40. package/dist/index17.d.ts +34 -15
  41. package/dist/index17.d.ts.map +1 -1
  42. package/dist/index18.d.cts +13 -67
  43. package/dist/index18.d.cts.map +1 -1
  44. package/dist/index18.d.ts +13 -67
  45. package/dist/index18.d.ts.map +1 -1
  46. package/dist/index19.d.cts +55 -48
  47. package/dist/index19.d.cts.map +1 -1
  48. package/dist/index19.d.ts +55 -48
  49. package/dist/index19.d.ts.map +1 -1
  50. package/dist/index2.d.cts +8 -8
  51. package/dist/index2.d.cts.map +1 -1
  52. package/dist/index2.d.ts +8 -8
  53. package/dist/index2.d.ts.map +1 -1
  54. package/dist/index20.d.cts +45 -75
  55. package/dist/index20.d.cts.map +1 -1
  56. package/dist/index20.d.ts +45 -75
  57. package/dist/index20.d.ts.map +1 -1
  58. package/dist/index21.d.cts +39 -28
  59. package/dist/index21.d.cts.map +1 -1
  60. package/dist/index21.d.ts +39 -28
  61. package/dist/index21.d.ts.map +1 -1
  62. package/dist/index22.d.cts +98 -44
  63. package/dist/index22.d.cts.map +1 -1
  64. package/dist/index22.d.ts +98 -44
  65. package/dist/index22.d.ts.map +1 -1
  66. package/dist/index23.d.cts +65 -68
  67. package/dist/index23.d.cts.map +1 -1
  68. package/dist/index23.d.ts +65 -68
  69. package/dist/index23.d.ts.map +1 -1
  70. package/dist/index24.d.cts +27 -42
  71. package/dist/index24.d.cts.map +1 -1
  72. package/dist/index24.d.ts +27 -42
  73. package/dist/index24.d.ts.map +1 -1
  74. package/dist/index25.d.cts +68 -11
  75. package/dist/index25.d.cts.map +1 -1
  76. package/dist/index25.d.ts +68 -11
  77. package/dist/index25.d.ts.map +1 -1
  78. package/dist/index26.d.cts +75 -56
  79. package/dist/index26.d.cts.map +1 -1
  80. package/dist/index26.d.ts +75 -56
  81. package/dist/index26.d.ts.map +1 -1
  82. package/dist/index27.d.cts +38 -60
  83. package/dist/index27.d.cts.map +1 -1
  84. package/dist/index27.d.ts +38 -60
  85. package/dist/index27.d.ts.map +1 -1
  86. package/dist/index28.d.cts +10 -30
  87. package/dist/index28.d.cts.map +1 -1
  88. package/dist/index28.d.ts +10 -30
  89. package/dist/index28.d.ts.map +1 -1
  90. package/dist/index29.d.cts +72 -17
  91. package/dist/index29.d.cts.map +1 -1
  92. package/dist/index29.d.ts +72 -17
  93. package/dist/index29.d.ts.map +1 -1
  94. package/dist/index3.d.cts +13 -13
  95. package/dist/index3.d.cts.map +1 -1
  96. package/dist/index3.d.ts +13 -13
  97. package/dist/index30.d.cts +46 -80
  98. package/dist/index30.d.cts.map +1 -1
  99. package/dist/index30.d.ts +46 -80
  100. package/dist/index30.d.ts.map +1 -1
  101. package/dist/index31.d.cts +64 -33
  102. package/dist/index31.d.cts.map +1 -1
  103. package/dist/index31.d.ts +64 -33
  104. package/dist/index31.d.ts.map +1 -1
  105. package/dist/index32.d.cts +29 -18
  106. package/dist/index32.d.cts.map +1 -1
  107. package/dist/index32.d.ts +29 -18
  108. package/dist/index32.d.ts.map +1 -1
  109. package/dist/index33.d.cts +17 -51
  110. package/dist/index33.d.cts.map +1 -1
  111. package/dist/index33.d.ts +17 -51
  112. package/dist/index33.d.ts.map +1 -1
  113. package/dist/index34.d.cts +81 -36
  114. package/dist/index34.d.cts.map +1 -1
  115. package/dist/index34.d.ts +81 -36
  116. package/dist/index34.d.ts.map +1 -1
  117. package/dist/index35.d.cts +32 -69
  118. package/dist/index35.d.cts.map +1 -1
  119. package/dist/index35.d.ts +32 -69
  120. package/dist/index35.d.ts.map +1 -1
  121. package/dist/index36.d.cts +20 -13
  122. package/dist/index36.d.cts.map +1 -1
  123. package/dist/index36.d.ts +20 -13
  124. package/dist/index36.d.ts.map +1 -1
  125. package/dist/index37.d.cts +51 -21
  126. package/dist/index37.d.cts.map +1 -1
  127. package/dist/index37.d.ts +51 -21
  128. package/dist/index37.d.ts.map +1 -1
  129. package/dist/index38.d.cts +38 -15
  130. package/dist/index38.d.cts.map +1 -1
  131. package/dist/index38.d.ts +38 -15
  132. package/dist/index38.d.ts.map +1 -1
  133. package/dist/index39.d.cts +53 -81
  134. package/dist/index39.d.cts.map +1 -1
  135. package/dist/index39.d.ts +53 -81
  136. package/dist/index39.d.ts.map +1 -1
  137. package/dist/index4.d.cts +2 -2
  138. package/dist/index4.d.ts +2 -2
  139. package/dist/index4.d.ts.map +1 -1
  140. package/dist/index40.d.cts +13 -16
  141. package/dist/index40.d.cts.map +1 -1
  142. package/dist/index40.d.ts +13 -16
  143. package/dist/index40.d.ts.map +1 -1
  144. package/dist/index41.d.cts +25 -52
  145. package/dist/index41.d.cts.map +1 -1
  146. package/dist/index41.d.ts +24 -51
  147. package/dist/index41.d.ts.map +1 -1
  148. package/dist/index42.d.cts +15 -40
  149. package/dist/index42.d.cts.map +1 -1
  150. package/dist/index42.d.ts +15 -40
  151. package/dist/index42.d.ts.map +1 -1
  152. package/dist/index43.d.cts +86 -77
  153. package/dist/index43.d.cts.map +1 -1
  154. package/dist/index43.d.ts +86 -77
  155. package/dist/index43.d.ts.map +1 -1
  156. package/dist/index44.d.cts +125 -1
  157. package/dist/index44.d.cts.map +1 -0
  158. package/dist/index44.d.ts +125 -1
  159. package/dist/index44.d.ts.map +1 -0
  160. package/dist/index45.d.cts +15 -41
  161. package/dist/index45.d.cts.map +1 -1
  162. package/dist/index45.d.ts +15 -41
  163. package/dist/index45.d.ts.map +1 -1
  164. package/dist/index46.d.cts +52 -24
  165. package/dist/index46.d.cts.map +1 -1
  166. package/dist/index46.d.ts +52 -24
  167. package/dist/index46.d.ts.map +1 -1
  168. package/dist/index47.d.cts +86 -31
  169. package/dist/index47.d.cts.map +1 -1
  170. package/dist/index47.d.ts +86 -31
  171. package/dist/index47.d.ts.map +1 -1
  172. package/dist/index48.d.cts +1 -25
  173. package/dist/index48.d.ts +1 -25
  174. package/dist/index49.d.cts +120 -14
  175. package/dist/index49.d.cts.map +1 -1
  176. package/dist/index49.d.ts +120 -14
  177. package/dist/index49.d.ts.map +1 -1
  178. package/dist/index5.d.cts +7 -7
  179. package/dist/index5.d.ts +7 -7
  180. package/dist/index50.d.cts +32 -53
  181. package/dist/index50.d.cts.map +1 -1
  182. package/dist/index50.d.ts +32 -53
  183. package/dist/index50.d.ts.map +1 -1
  184. package/dist/index51.d.cts +21 -56
  185. package/dist/index51.d.cts.map +1 -1
  186. package/dist/index51.d.ts +21 -56
  187. package/dist/index51.d.ts.map +1 -1
  188. package/dist/index52.d.cts +33 -23
  189. package/dist/index52.d.cts.map +1 -1
  190. package/dist/index52.d.ts +33 -23
  191. package/dist/index52.d.ts.map +1 -1
  192. package/dist/index53.d.cts +17 -201
  193. package/dist/index53.d.cts.map +1 -1
  194. package/dist/index53.d.ts +17 -201
  195. package/dist/index53.d.ts.map +1 -1
  196. package/dist/index54.d.cts +14 -19
  197. package/dist/index54.d.cts.map +1 -1
  198. package/dist/index54.d.ts +14 -19
  199. package/dist/index54.d.ts.map +1 -1
  200. package/dist/index55.d.cts +64 -23
  201. package/dist/index55.d.cts.map +1 -1
  202. package/dist/index55.d.ts +64 -23
  203. package/dist/index55.d.ts.map +1 -1
  204. package/dist/index56.d.cts +95 -22
  205. package/dist/index56.d.cts.map +1 -1
  206. package/dist/index56.d.ts +95 -22
  207. package/dist/index56.d.ts.map +1 -1
  208. package/dist/index57.d.cts +25 -6
  209. package/dist/index57.d.cts.map +1 -1
  210. package/dist/index57.d.ts +25 -6
  211. package/dist/index57.d.ts.map +1 -1
  212. package/dist/index58.d.cts +202 -43
  213. package/dist/index58.d.cts.map +1 -1
  214. package/dist/index58.d.ts +202 -43
  215. package/dist/index58.d.ts.map +1 -1
  216. package/dist/index59.d.cts +15 -40
  217. package/dist/index59.d.cts.map +1 -1
  218. package/dist/index59.d.ts +15 -40
  219. package/dist/index59.d.ts.map +1 -1
  220. package/dist/index6.d.cts +5 -5
  221. package/dist/index6.d.cts.map +1 -1
  222. package/dist/index6.d.ts +5 -5
  223. package/dist/index6.d.ts.map +1 -1
  224. package/dist/index60.d.cts +20 -55
  225. package/dist/index60.d.cts.map +1 -1
  226. package/dist/index60.d.ts +20 -55
  227. package/dist/index60.d.ts.map +1 -1
  228. package/dist/index61.d.cts +21 -41
  229. package/dist/index61.d.cts.map +1 -1
  230. package/dist/index61.d.ts +21 -41
  231. package/dist/index61.d.ts.map +1 -1
  232. package/dist/index62.d.cts +6 -18
  233. package/dist/index62.d.cts.map +1 -1
  234. package/dist/index62.d.ts +6 -18
  235. package/dist/index62.d.ts.map +1 -1
  236. package/dist/index63.d.cts +46 -41
  237. package/dist/index63.d.cts.map +1 -1
  238. package/dist/index63.d.ts +46 -41
  239. package/dist/index63.d.ts.map +1 -1
  240. package/dist/index64.d.cts +47 -19
  241. package/dist/index64.d.cts.map +1 -1
  242. package/dist/index64.d.ts +47 -19
  243. package/dist/index64.d.ts.map +1 -1
  244. package/dist/index65.d.cts +50 -35
  245. package/dist/index65.d.cts.map +1 -1
  246. package/dist/index65.d.ts +50 -35
  247. package/dist/index65.d.ts.map +1 -1
  248. package/dist/index66.d.cts +33 -13
  249. package/dist/index66.d.cts.map +1 -1
  250. package/dist/index66.d.ts +33 -13
  251. package/dist/index66.d.ts.map +1 -1
  252. package/dist/index67.d.cts +17 -84
  253. package/dist/index67.d.cts.map +1 -1
  254. package/dist/index67.d.ts +17 -84
  255. package/dist/index67.d.ts.map +1 -1
  256. package/dist/index68.d.cts +40 -14
  257. package/dist/index68.d.cts.map +1 -1
  258. package/dist/index68.d.ts +40 -14
  259. package/dist/index68.d.ts.map +1 -1
  260. package/dist/index69.d.cts +16 -30
  261. package/dist/index69.d.cts.map +1 -1
  262. package/dist/index69.d.ts +16 -30
  263. package/dist/index69.d.ts.map +1 -1
  264. package/dist/index7.d.cts +8 -8
  265. package/dist/index7.d.ts +8 -8
  266. package/dist/index70.d.cts +39 -27
  267. package/dist/index70.d.cts.map +1 -1
  268. package/dist/index70.d.ts +39 -27
  269. package/dist/index70.d.ts.map +1 -1
  270. package/dist/index71.d.cts +22 -79
  271. package/dist/index71.d.cts.map +1 -1
  272. package/dist/index71.d.ts +22 -79
  273. package/dist/index71.d.ts.map +1 -1
  274. package/dist/index72.d.cts +77 -264
  275. package/dist/index72.d.cts.map +1 -1
  276. package/dist/index72.d.ts +77 -264
  277. package/dist/index72.d.ts.map +1 -1
  278. package/dist/index73.d.cts +19 -0
  279. package/dist/index73.d.cts.map +1 -0
  280. package/dist/index73.d.ts +19 -0
  281. package/dist/index73.d.ts.map +1 -0
  282. package/dist/index74.d.cts +37 -0
  283. package/dist/index74.d.cts.map +1 -0
  284. package/dist/index74.d.ts +37 -0
  285. package/dist/index74.d.ts.map +1 -0
  286. package/dist/index75.d.cts +36 -0
  287. package/dist/index75.d.cts.map +1 -0
  288. package/dist/index75.d.ts +36 -0
  289. package/dist/index75.d.ts.map +1 -0
  290. package/dist/index76.d.cts +87 -0
  291. package/dist/index76.d.cts.map +1 -0
  292. package/dist/index76.d.ts +87 -0
  293. package/dist/index76.d.ts.map +1 -0
  294. package/dist/index77.d.cts +278 -0
  295. package/dist/index77.d.cts.map +1 -0
  296. package/dist/index77.d.ts +278 -0
  297. package/dist/index77.d.ts.map +1 -0
  298. package/dist/index8.d.cts +4 -4
  299. package/dist/index8.d.cts.map +1 -1
  300. package/dist/index8.d.ts +4 -4
  301. package/dist/index9.d.cts +2 -2
  302. package/dist/index9.d.ts +2 -2
  303. package/dist/index9.d.ts.map +1 -1
  304. package/dist/layouts/Container/index.d.cts +1 -1
  305. package/dist/layouts/Container/index.d.ts +1 -1
  306. package/dist/layouts/MultiColumn/index.d.cts +1 -1
  307. package/dist/layouts/MultiColumn/index.d.ts +1 -1
  308. package/dist/layouts/PageBackground/index.d.cts +1 -1
  309. package/dist/layouts/PageBackground/index.d.ts +1 -1
  310. package/dist/layouts/Stack/index.d.cts +1 -1
  311. package/dist/layouts/Stack/index.d.ts +1 -1
  312. package/dist/layouts/TwoColumn/index.d.cts +1 -1
  313. package/dist/layouts/TwoColumn/index.d.ts +1 -1
  314. package/dist/layouts/index.d.cts +5 -5
  315. package/dist/layouts/index.d.ts +5 -5
  316. package/dist/patterns/DataTable/index.d.cts +3 -3
  317. package/dist/patterns/DataTable/index.d.cts.map +1 -1
  318. package/dist/patterns/DataTable/index.d.ts +3 -3
  319. package/dist/patterns/DataTable/index.d.ts.map +1 -1
  320. package/dist/patterns/Footer/index.d.cts +7 -7
  321. package/dist/patterns/Footer/index.d.ts +7 -7
  322. package/dist/patterns/Footer/index.d.ts.map +1 -1
  323. package/dist/patterns/Header/index.d.cts +1 -1
  324. package/dist/patterns/Header/index.d.ts +1 -1
  325. package/dist/patterns/MediaObject/index.d.cts +14 -14
  326. package/dist/patterns/MediaObject/index.d.cts.map +1 -1
  327. package/dist/patterns/MediaObject/index.d.ts +14 -14
  328. package/dist/patterns/NavRail/index.d.cts +1 -1
  329. package/dist/patterns/NavRail/index.d.ts +1 -1
  330. package/dist/patterns/SectionCard/index.d.cts +2 -2
  331. package/dist/patterns/SectionCard/index.d.ts +2 -2
  332. package/dist/patterns/SectionCard/index.d.ts.map +1 -1
  333. package/dist/patterns/SectionHeading/index.d.cts +3 -3
  334. package/dist/patterns/SectionHeading/index.d.ts +3 -3
  335. package/dist/patterns/SectionHeading/index.d.ts.map +1 -1
  336. package/dist/patterns/index.d.cts +2 -2
  337. package/dist/patterns/index.d.ts +2 -2
  338. package/dist/primitives/Checkbox/index.cjs +1 -1
  339. package/dist/primitives/Checkbox/index.cjs.map +1 -1
  340. package/dist/primitives/Checkbox/index.d.cts +1 -1
  341. package/dist/primitives/Checkbox/index.d.ts +1 -1
  342. package/dist/primitives/Checkbox/index.js +1 -1
  343. package/dist/primitives/Checkbox/index.js.map +1 -1
  344. package/dist/primitives/CheckboxTree/index.d.cts +1 -1
  345. package/dist/primitives/CheckboxTree/index.d.ts +1 -1
  346. package/dist/primitives/CircularProgress/index.cjs +106 -0
  347. package/dist/primitives/CircularProgress/index.cjs.map +1 -0
  348. package/dist/primitives/CircularProgress/index.d.cts +2 -0
  349. package/dist/primitives/CircularProgress/index.d.ts +2 -0
  350. package/dist/primitives/CircularProgress/index.js +105 -0
  351. package/dist/primitives/CircularProgress/index.js.map +1 -0
  352. package/dist/primitives/Collapsible/index.d.cts +1 -1
  353. package/dist/primitives/Collapsible/index.d.ts +1 -1
  354. package/dist/primitives/Combobox/index.cjs +210 -0
  355. package/dist/primitives/Combobox/index.cjs.map +1 -0
  356. package/dist/primitives/Combobox/index.d.cts +2 -0
  357. package/dist/primitives/Combobox/index.d.ts +2 -0
  358. package/dist/primitives/Combobox/index.js +199 -0
  359. package/dist/primitives/Combobox/index.js.map +1 -0
  360. package/dist/primitives/Command/index.d.cts +1 -1
  361. package/dist/primitives/Command/index.d.ts +1 -1
  362. package/dist/primitives/ContextMenu/index.d.cts +1 -1
  363. package/dist/primitives/ContextMenu/index.d.ts +1 -1
  364. package/dist/primitives/Credits/index.d.cts +1 -1
  365. package/dist/primitives/Credits/index.d.ts +1 -1
  366. package/dist/primitives/Dialog/index.d.cts +1 -1
  367. package/dist/primitives/Dialog/index.d.ts +1 -1
  368. package/dist/primitives/Drawer/index.cjs +34 -2
  369. package/dist/primitives/Drawer/index.cjs.map +1 -1
  370. package/dist/primitives/Drawer/index.d.cts +1 -1
  371. package/dist/primitives/Drawer/index.d.ts +1 -1
  372. package/dist/primitives/Drawer/index.js +34 -2
  373. package/dist/primitives/Drawer/index.js.map +1 -1
  374. package/dist/primitives/DropdownMenu/index.d.cts +1 -1
  375. package/dist/primitives/DropdownMenu/index.d.ts +1 -1
  376. package/dist/primitives/Empty/index.d.cts +1 -1
  377. package/dist/primitives/Empty/index.d.ts +1 -1
  378. package/dist/primitives/Field/index.d.cts +1 -1
  379. package/dist/primitives/Field/index.d.ts +1 -1
  380. package/dist/primitives/FileUpload/index.cjs +354 -0
  381. package/dist/primitives/FileUpload/index.cjs.map +1 -0
  382. package/dist/primitives/FileUpload/index.d.cts +2 -0
  383. package/dist/primitives/FileUpload/index.d.ts +2 -0
  384. package/dist/primitives/FileUpload/index.js +351 -0
  385. package/dist/primitives/FileUpload/index.js.map +1 -0
  386. package/dist/primitives/Form/index.d.cts +1 -1
  387. package/dist/primitives/Form/index.d.ts +1 -1
  388. package/dist/primitives/Heading/index.d.cts +1 -1
  389. package/dist/primitives/Heading/index.d.ts +1 -1
  390. package/dist/primitives/HoverCard/index.d.cts +1 -1
  391. package/dist/primitives/HoverCard/index.d.ts +1 -1
  392. package/dist/primitives/Icon/index.d.cts +1 -1
  393. package/dist/primitives/Icon/index.d.ts +1 -1
  394. package/dist/primitives/InfoBanner/index.d.cts +1 -1
  395. package/dist/primitives/InfoBanner/index.d.ts +1 -1
  396. package/dist/primitives/Input/index.d.cts +1 -1
  397. package/dist/primitives/Input/index.d.ts +1 -1
  398. package/dist/primitives/InputGroup/index.d.cts +1 -1
  399. package/dist/primitives/InputGroup/index.d.ts +1 -1
  400. package/dist/primitives/InputOtp/index.d.cts +1 -1
  401. package/dist/primitives/InputOtp/index.d.ts +1 -1
  402. package/dist/primitives/Item/index.d.cts +1 -1
  403. package/dist/primitives/Item/index.d.ts +1 -1
  404. package/dist/primitives/Kbd/index.d.cts +1 -1
  405. package/dist/primitives/Kbd/index.d.ts +1 -1
  406. package/dist/primitives/Label/index.d.cts +1 -1
  407. package/dist/primitives/Label/index.d.ts +1 -1
  408. package/dist/primitives/Link/index.d.cts +1 -1
  409. package/dist/primitives/Link/index.d.ts +1 -1
  410. package/dist/primitives/Logo/index.d.cts +1 -1
  411. package/dist/primitives/Logo/index.d.ts +1 -1
  412. package/dist/primitives/Menubar/index.d.cts +1 -1
  413. package/dist/primitives/Menubar/index.d.ts +1 -1
  414. package/dist/primitives/Mosaic/index.cjs +4 -0
  415. package/dist/primitives/Mosaic/index.d.cts +2 -0
  416. package/dist/primitives/Mosaic/index.d.ts +2 -0
  417. package/dist/primitives/Mosaic/index.js +2 -0
  418. package/dist/primitives/NativeSelect/index.d.cts +1 -1
  419. package/dist/primitives/NativeSelect/index.d.ts +1 -1
  420. package/dist/primitives/NavRail/index.d.cts +2 -2
  421. package/dist/primitives/NavRail/index.d.ts +2 -2
  422. package/dist/primitives/NavigationMenu/index.d.cts +1 -1
  423. package/dist/primitives/NavigationMenu/index.d.ts +1 -1
  424. package/dist/primitives/NotchedCard/index.cjs +390 -0
  425. package/dist/primitives/NotchedCard/index.cjs.map +1 -0
  426. package/dist/primitives/NotchedCard/index.d.cts +2 -0
  427. package/dist/primitives/NotchedCard/index.d.ts +2 -0
  428. package/dist/primitives/NotchedCard/index.js +385 -0
  429. package/dist/primitives/NotchedCard/index.js.map +1 -0
  430. package/dist/primitives/Pagination/index.d.cts +1 -1
  431. package/dist/primitives/Pagination/index.d.ts +1 -1
  432. package/dist/primitives/Popover/index.d.cts +1 -1
  433. package/dist/primitives/Popover/index.d.ts +1 -1
  434. package/dist/primitives/Progress/index.d.cts +1 -1
  435. package/dist/primitives/Progress/index.d.ts +1 -1
  436. package/dist/primitives/RadioGroup/index.cjs +1 -1
  437. package/dist/primitives/RadioGroup/index.cjs.map +1 -1
  438. package/dist/primitives/RadioGroup/index.d.cts +1 -1
  439. package/dist/primitives/RadioGroup/index.d.ts +1 -1
  440. package/dist/primitives/RadioGroup/index.js +1 -1
  441. package/dist/primitives/RadioGroup/index.js.map +1 -1
  442. package/dist/primitives/Resizable/index.d.cts +1 -1
  443. package/dist/primitives/Resizable/index.d.ts +1 -1
  444. package/dist/primitives/ScrollArea/index.d.cts +1 -1
  445. package/dist/primitives/ScrollArea/index.d.ts +1 -1
  446. package/dist/primitives/Select/index.d.cts +1 -1
  447. package/dist/primitives/Select/index.d.ts +1 -1
  448. package/dist/primitives/Sheet/index.cjs +34 -2
  449. package/dist/primitives/Sheet/index.cjs.map +1 -1
  450. package/dist/primitives/Sheet/index.d.cts +1 -1
  451. package/dist/primitives/Sheet/index.d.ts +1 -1
  452. package/dist/primitives/Sheet/index.js +34 -2
  453. package/dist/primitives/Sheet/index.js.map +1 -1
  454. package/dist/primitives/Sidebar/index.d.cts +1 -1
  455. package/dist/primitives/Sidebar/index.d.ts +1 -1
  456. package/dist/primitives/Skeleton/index.d.cts +1 -1
  457. package/dist/primitives/Skeleton/index.d.ts +1 -1
  458. package/dist/primitives/Slider/index.d.cts +1 -1
  459. package/dist/primitives/Slider/index.d.ts +1 -1
  460. package/dist/primitives/Sonner/index.d.cts +1 -1
  461. package/dist/primitives/Sonner/index.d.ts +1 -1
  462. package/dist/primitives/Spinner/index.d.cts +1 -1
  463. package/dist/primitives/Spinner/index.d.ts +1 -1
  464. package/dist/primitives/Switch/index.d.cts +1 -1
  465. package/dist/primitives/Switch/index.d.ts +1 -1
  466. package/dist/primitives/Table/index.d.cts +1 -1
  467. package/dist/primitives/Table/index.d.ts +1 -1
  468. package/dist/primitives/Tabs/index.cjs +153 -10
  469. package/dist/primitives/Tabs/index.cjs.map +1 -1
  470. package/dist/primitives/Tabs/index.d.cts +1 -1
  471. package/dist/primitives/Tabs/index.d.ts +1 -1
  472. package/dist/primitives/Tabs/index.js +153 -10
  473. package/dist/primitives/Tabs/index.js.map +1 -1
  474. package/dist/primitives/Text/index.d.cts +1 -1
  475. package/dist/primitives/Text/index.d.ts +1 -1
  476. package/dist/primitives/Textarea/index.d.cts +1 -1
  477. package/dist/primitives/Textarea/index.d.ts +1 -1
  478. package/dist/primitives/ThemeProvider/index.d.cts +1 -1
  479. package/dist/primitives/ThemeProvider/index.d.ts +1 -1
  480. package/dist/primitives/Toggle/index.d.cts +1 -1
  481. package/dist/primitives/Toggle/index.d.ts +1 -1
  482. package/dist/primitives/ToggleGroup/index.d.cts +1 -1
  483. package/dist/primitives/ToggleGroup/index.d.ts +1 -1
  484. package/dist/primitives/Tooltip/index.d.cts +1 -1
  485. package/dist/primitives/Tooltip/index.d.ts +1 -1
  486. package/dist/primitives/index.cjs +25 -4
  487. package/dist/primitives/index.d.cts +56 -51
  488. package/dist/primitives/index.d.ts +56 -51
  489. package/dist/primitives/index.js +10 -5
  490. package/dist/styles/tokens/mode-dark.css +1 -1
  491. package/package.json +1 -1
  492. package/dist/index48.d.cts.map +0 -1
  493. package/dist/index48.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- import { i as creditsVariants, n as CreditsProps, r as CreditsVariant, t as Credits } from "../../index21.cjs";
1
+ import { i as creditsVariants, n as CreditsProps, r as CreditsVariant, t as Credits } from "../../index24.cjs";
2
2
  export { Credits, CreditsProps, CreditsVariant, creditsVariants };
@@ -1,2 +1,2 @@
1
- import { i as creditsVariants, n as CreditsProps, r as CreditsVariant, t as Credits } from "../../index21.js";
1
+ import { i as creditsVariants, n as CreditsProps, r as CreditsVariant, t as Credits } from "../../index24.js";
2
2
  export { Credits, CreditsProps, CreditsVariant, creditsVariants };
@@ -1,2 +1,2 @@
1
- import { a as DialogFooter, c as DialogPortal, i as DialogDescription, l as DialogTitle, n as DialogClose, o as DialogHeader, r as DialogContent, s as DialogOverlay, t as Dialog, u as DialogTrigger } from "../../index18.cjs";
1
+ import { a as DialogFooter, c as DialogPortal, i as DialogDescription, l as DialogTitle, n as DialogClose, o as DialogHeader, r as DialogContent, s as DialogOverlay, t as Dialog, u as DialogTrigger } from "../../index19.cjs";
2
2
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -1,2 +1,2 @@
1
- import { a as DialogFooter, c as DialogPortal, i as DialogDescription, l as DialogTitle, n as DialogClose, o as DialogHeader, r as DialogContent, s as DialogOverlay, t as Dialog, u as DialogTrigger } from "../../index18.js";
1
+ import { a as DialogFooter, c as DialogPortal, i as DialogDescription, l as DialogTitle, n as DialogClose, o as DialogHeader, r as DialogContent, s as DialogOverlay, t as Dialog, u as DialogTrigger } from "../../index19.js";
2
2
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -39,13 +39,45 @@ function DrawerOverlay({ className, ...props }) {
39
39
  ...props
40
40
  });
41
41
  }
42
+ const drawerSizeVariants = {
43
+ small: [
44
+ "data-[vaul-drawer-direction=top]:max-h-[60vh]",
45
+ "data-[vaul-drawer-direction=bottom]:max-h-[60vh]",
46
+ "data-[vaul-drawer-direction=right]:w-2/3 data-[vaul-drawer-direction=right]:sm:max-w-xs",
47
+ "data-[vaul-drawer-direction=left]:w-2/3 data-[vaul-drawer-direction=left]:sm:max-w-xs"
48
+ ].join(" "),
49
+ default: [
50
+ "data-[vaul-drawer-direction=top]:max-h-[80vh]",
51
+ "data-[vaul-drawer-direction=bottom]:max-h-[80vh]",
52
+ "data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm",
53
+ "data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm"
54
+ ].join(" "),
55
+ medium: [
56
+ "data-[vaul-drawer-direction=top]:max-h-[85vh]",
57
+ "data-[vaul-drawer-direction=bottom]:max-h-[85vh]",
58
+ "data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md",
59
+ "data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md"
60
+ ].join(" "),
61
+ large: [
62
+ "data-[vaul-drawer-direction=top]:max-h-[90vh]",
63
+ "data-[vaul-drawer-direction=bottom]:max-h-[90vh]",
64
+ "data-[vaul-drawer-direction=right]:w-11/12 data-[vaul-drawer-direction=right]:sm:max-w-lg",
65
+ "data-[vaul-drawer-direction=left]:w-11/12 data-[vaul-drawer-direction=left]:sm:max-w-lg"
66
+ ].join(" "),
67
+ extraLarge: [
68
+ "data-[vaul-drawer-direction=top]:max-h-[95vh]",
69
+ "data-[vaul-drawer-direction=bottom]:max-h-[95vh]",
70
+ "data-[vaul-drawer-direction=right]:w-[95vw] data-[vaul-drawer-direction=right]:sm:max-w-2xl",
71
+ "data-[vaul-drawer-direction=left]:w-[95vw] data-[vaul-drawer-direction=left]:sm:max-w-2xl"
72
+ ].join(" ")
73
+ };
42
74
  /** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */
43
- function DrawerContent({ className, children, ...props }) {
75
+ function DrawerContent({ className, children, size = "default", ...props }) {
44
76
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerPortal, {
45
77
  "data-slot": "drawer-portal",
46
78
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DrawerOverlay, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(vaul.Drawer.Content, {
47
79
  "data-slot": "drawer-content",
48
- className: require_cn.cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-10 data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-10 data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", className),
80
+ className: require_cn.cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:rounded-b-10 data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:rounded-t-10 data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:border-l", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:border-r", drawerSizeVariants[size], className),
49
81
  ...props,
50
82
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "mx-auto mt-2 hidden h-0.75 w-12.5 shrink-0 rounded-2 bg-muted-bg group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children]
51
83
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["DrawerPrimitive","cn"],"sources":["../../../src/primitives/Drawer/Drawer.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"@/utils\";\n\n/** Root provider for a vaul-backed sliding drawer; controls open state and slide `direction`. */\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\n/** Element that toggles the drawer open when interacted with. */\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\n/** Portals the overlay and content out to the document body. */\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\n/** Element that closes the drawer when interacted with. */\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\n/** Dimmed backdrop rendered behind the drawer content. */\nfunction DrawerOverlay({\n /** Extra classes merged onto the overlay surface. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-overlay-bg data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */\nfunction DrawerContent({\n /** Extra classes merged onto the content panel. */\n className,\n /** Body of the drawer, typically header/footer plus content. */\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-10 data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-10 data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-2 hidden h-0.75 w-12.5 shrink-0 rounded-2 bg-muted-bg group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\n/** Top region of the drawer; groups the title and description. */\nfunction DrawerHeader({\n /** Extra classes merged onto the header wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Bottom region of the drawer; typically holds actions, pinned to the panel base. */\nfunction DrawerFooter({\n /** Extra classes merged onto the footer wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/** Accessible title for the drawer, announced to assistive tech. */\nfunction DrawerTitle({\n /** Extra classes merged onto the title. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\n \"font-heading text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal text-primary-txt\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Supporting description text shown beneath the drawer title. */\nfunction DrawerDescription({\n /** Extra classes merged onto the description. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-txt text-sm leading-5\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"mappings":";;;;;;AAMA,SAAS,OAAO,EAAE,GAAG,SAA4D;CAC/E,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;;AAGA,SAAS,cAAc,EAAE,GAAG,SAA+D;CACzF,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;;AAGA,SAAS,aAAa,EAAE,GAAG,SAA8D;CACvF,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;;AAGA,SAAS,YAAY,EAAE,GAAG,SAA6D;CACrF,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;;AAGA,SAAS,cAAc,EAErB,WACA,GAAG,SACoD;CACvD,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,SAAjB;EACE,aAAU;EACV,WAAWC,WAAAA,GACT,4JACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,cAAc,EAErB,WAEA,UACA,GAAG,SACoD;CACvD,OACE,iBAAA,GAAA,kBAAA,MAAC,cAAD;EAAc,aAAU;YAAxB,CACE,iBAAA,GAAA,kBAAA,KAAC,eAAD,CAAgB,CAAA,GAChB,iBAAA,GAAA,kBAAA,MAACD,KAAAA,OAAgB,SAAjB;GACE,aAAU;GACV,WAAWC,WAAAA,GACT,gFACA,kQACA,uRACA,+NACA,yNACA,SACF;GACA,GAAI;aAVN,CAYE,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAU,kIAAmI,CAAA,GACjJ,QACsB;IACb;;AAElB;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GACT,4LACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAEnB,WACA,GAAG,SACkD;CACrD,OACE,iBAAA,GAAA,kBAAA,KAACD,KAAAA,OAAgB,OAAjB;EACE,aAAU;EACV,WAAWC,WAAAA,GACT,6HACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,kBAAkB,EAEzB,WACA,GAAG,SACwD;CAC3D,OACE,iBAAA,GAAA,kBAAA,KAACD,KAAAA,OAAgB,aAAjB;EACE,aAAU;EACV,WAAWC,WAAAA,GAAG,oCAAoC,SAAS;EAC3D,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"index.cjs","names":["DrawerPrimitive","cn"],"sources":["../../../src/primitives/Drawer/Drawer.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"@/utils\";\n\n/** Root provider for a vaul-backed sliding drawer; controls open state and slide `direction`. */\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\n/** Element that toggles the drawer open when interacted with. */\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\n/** Portals the overlay and content out to the document body. */\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\n/** Element that closes the drawer when interacted with. */\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\n/** Dimmed backdrop rendered behind the drawer content. */\nfunction DrawerOverlay({\n /** Extra classes merged onto the overlay surface. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-overlay-bg data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst drawerSizeVariants = {\n small: [\n \"data-[vaul-drawer-direction=top]:max-h-[60vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[60vh]\",\n \"data-[vaul-drawer-direction=right]:w-2/3 data-[vaul-drawer-direction=right]:sm:max-w-xs\",\n \"data-[vaul-drawer-direction=left]:w-2/3 data-[vaul-drawer-direction=left]:sm:max-w-xs\",\n ].join(\" \"),\n default: [\n \"data-[vaul-drawer-direction=top]:max-h-[80vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[80vh]\",\n \"data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n ].join(\" \"),\n medium: [\n \"data-[vaul-drawer-direction=top]:max-h-[85vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[85vh]\",\n \"data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md\",\n \"data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md\",\n ].join(\" \"),\n large: [\n \"data-[vaul-drawer-direction=top]:max-h-[90vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[90vh]\",\n \"data-[vaul-drawer-direction=right]:w-11/12 data-[vaul-drawer-direction=right]:sm:max-w-lg\",\n \"data-[vaul-drawer-direction=left]:w-11/12 data-[vaul-drawer-direction=left]:sm:max-w-lg\",\n ].join(\" \"),\n extraLarge: [\n \"data-[vaul-drawer-direction=top]:max-h-[95vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[95vh]\",\n \"data-[vaul-drawer-direction=right]:w-[95vw] data-[vaul-drawer-direction=right]:sm:max-w-2xl\",\n \"data-[vaul-drawer-direction=left]:w-[95vw] data-[vaul-drawer-direction=left]:sm:max-w-2xl\",\n ].join(\" \"),\n} as const;\n\n/** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */\nfunction DrawerContent({\n /** Extra classes merged onto the content panel. */\n className,\n /** Body of the drawer, typically header/footer plus content. */\n children,\n /** Optional size variant for the drawer panel. */\n size = \"default\",\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content> & {\n /** Panel size. `default` matches the existing production sizing. */\n size?: keyof typeof drawerSizeVariants;\n}) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:rounded-b-10 data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:rounded-t-10 data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:border-l\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:border-r\",\n drawerSizeVariants[size],\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-2 hidden h-0.75 w-12.5 shrink-0 rounded-2 bg-muted-bg group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\n/** Top region of the drawer; groups the title and description. */\nfunction DrawerHeader({\n /** Extra classes merged onto the header wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Bottom region of the drawer; typically holds actions, pinned to the panel base. */\nfunction DrawerFooter({\n /** Extra classes merged onto the footer wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/** Accessible title for the drawer, announced to assistive tech. */\nfunction DrawerTitle({\n /** Extra classes merged onto the title. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\n \"font-heading text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal text-primary-txt\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Supporting description text shown beneath the drawer title. */\nfunction DrawerDescription({\n /** Extra classes merged onto the description. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-txt text-sm leading-5\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"mappings":";;;;;;AAMA,SAAS,OAAO,EAAE,GAAG,SAA4D;CAC/E,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;;AAGA,SAAS,cAAc,EAAE,GAAG,SAA+D;CACzF,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;;AAGA,SAAS,aAAa,EAAE,GAAG,SAA8D;CACvF,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;;AAGA,SAAS,YAAY,EAAE,GAAG,SAA6D;CACrF,OAAO,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;;AAGA,SAAS,cAAc,EAErB,WACA,GAAG,SACoD;CACvD,OACE,iBAAA,GAAA,kBAAA,KAACA,KAAAA,OAAgB,SAAjB;EACE,aAAU;EACV,WAAWC,WAAAA,GACT,4JACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,qBAAqB;CACzB,OAAO;EACL;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,SAAS;EACP;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,QAAQ;EACN;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,OAAO;EACL;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,YAAY;EACV;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;AACZ;;AAGA,SAAS,cAAc,EAErB,WAEA,UAEA,OAAO,WACP,GAAG,SAIF;CACD,OACE,iBAAA,GAAA,kBAAA,MAAC,cAAD;EAAc,aAAU;YAAxB,CACE,iBAAA,GAAA,kBAAA,KAAC,eAAD,CAAgB,CAAA,GAChB,iBAAA,GAAA,kBAAA,MAACD,KAAAA,OAAgB,SAAjB;GACE,aAAU;GACV,WAAWC,WAAAA,GACT,gFACA,oNACA,sOACA,uIACA,mIACA,mBAAmB,OACnB,SACF;GACA,GAAI;aAXN,CAaE,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAU,kIAAmI,CAAA,GACjJ,QACsB;IACb;;AAElB;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GACT,4LACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAWA,WAAAA,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAEnB,WACA,GAAG,SACkD;CACrD,OACE,iBAAA,GAAA,kBAAA,KAACD,KAAAA,OAAgB,OAAjB;EACE,aAAU;EACV,WAAWC,WAAAA,GACT,6HACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,kBAAkB,EAEzB,WACA,GAAG,SACwD;CAC3D,OACE,iBAAA,GAAA,kBAAA,KAACD,KAAAA,OAAgB,aAAjB;EACE,aAAU;EACV,WAAWC,WAAAA,GAAG,oCAAoC,SAAS;EAC3D,GAAI;CACL,CAAA;AAEL"}
@@ -1,2 +1,2 @@
1
- import { a as DrawerFooter, c as DrawerPortal, i as DrawerDescription, l as DrawerTitle, n as DrawerClose, o as DrawerHeader, r as DrawerContent, s as DrawerOverlay, t as Drawer, u as DrawerTrigger } from "../../index22.cjs";
1
+ import { a as DrawerFooter, c as DrawerPortal, i as DrawerDescription, l as DrawerTitle, n as DrawerClose, o as DrawerHeader, r as DrawerContent, s as DrawerOverlay, t as Drawer, u as DrawerTrigger } from "../../index25.cjs";
2
2
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
@@ -1,2 +1,2 @@
1
- import { a as DrawerFooter, c as DrawerPortal, i as DrawerDescription, l as DrawerTitle, n as DrawerClose, o as DrawerHeader, r as DrawerContent, s as DrawerOverlay, t as Drawer, u as DrawerTrigger } from "../../index22.js";
1
+ import { a as DrawerFooter, c as DrawerPortal, i as DrawerDescription, l as DrawerTitle, n as DrawerClose, o as DrawerHeader, r as DrawerContent, s as DrawerOverlay, t as Drawer, u as DrawerTrigger } from "../../index25.js";
2
2
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
@@ -38,13 +38,45 @@ function DrawerOverlay({ className, ...props }) {
38
38
  ...props
39
39
  });
40
40
  }
41
+ const drawerSizeVariants = {
42
+ small: [
43
+ "data-[vaul-drawer-direction=top]:max-h-[60vh]",
44
+ "data-[vaul-drawer-direction=bottom]:max-h-[60vh]",
45
+ "data-[vaul-drawer-direction=right]:w-2/3 data-[vaul-drawer-direction=right]:sm:max-w-xs",
46
+ "data-[vaul-drawer-direction=left]:w-2/3 data-[vaul-drawer-direction=left]:sm:max-w-xs"
47
+ ].join(" "),
48
+ default: [
49
+ "data-[vaul-drawer-direction=top]:max-h-[80vh]",
50
+ "data-[vaul-drawer-direction=bottom]:max-h-[80vh]",
51
+ "data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm",
52
+ "data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm"
53
+ ].join(" "),
54
+ medium: [
55
+ "data-[vaul-drawer-direction=top]:max-h-[85vh]",
56
+ "data-[vaul-drawer-direction=bottom]:max-h-[85vh]",
57
+ "data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md",
58
+ "data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md"
59
+ ].join(" "),
60
+ large: [
61
+ "data-[vaul-drawer-direction=top]:max-h-[90vh]",
62
+ "data-[vaul-drawer-direction=bottom]:max-h-[90vh]",
63
+ "data-[vaul-drawer-direction=right]:w-11/12 data-[vaul-drawer-direction=right]:sm:max-w-lg",
64
+ "data-[vaul-drawer-direction=left]:w-11/12 data-[vaul-drawer-direction=left]:sm:max-w-lg"
65
+ ].join(" "),
66
+ extraLarge: [
67
+ "data-[vaul-drawer-direction=top]:max-h-[95vh]",
68
+ "data-[vaul-drawer-direction=bottom]:max-h-[95vh]",
69
+ "data-[vaul-drawer-direction=right]:w-[95vw] data-[vaul-drawer-direction=right]:sm:max-w-2xl",
70
+ "data-[vaul-drawer-direction=left]:w-[95vw] data-[vaul-drawer-direction=left]:sm:max-w-2xl"
71
+ ].join(" ")
72
+ };
41
73
  /** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */
42
- function DrawerContent({ className, children, ...props }) {
74
+ function DrawerContent({ className, children, size = "default", ...props }) {
43
75
  return /* @__PURE__ */ jsxs(DrawerPortal, {
44
76
  "data-slot": "drawer-portal",
45
77
  children: [/* @__PURE__ */ jsx(DrawerOverlay, {}), /* @__PURE__ */ jsxs(Drawer$1.Content, {
46
78
  "data-slot": "drawer-content",
47
- className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-10 data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-10 data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", className),
79
+ className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:rounded-b-10 data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:rounded-t-10 data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:border-l", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:border-r", drawerSizeVariants[size], className),
48
80
  ...props,
49
81
  children: [/* @__PURE__ */ jsx("div", { className: "mx-auto mt-2 hidden h-0.75 w-12.5 shrink-0 rounded-2 bg-muted-bg group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children]
50
82
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["DrawerPrimitive"],"sources":["../../../src/primitives/Drawer/Drawer.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"@/utils\";\n\n/** Root provider for a vaul-backed sliding drawer; controls open state and slide `direction`. */\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\n/** Element that toggles the drawer open when interacted with. */\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\n/** Portals the overlay and content out to the document body. */\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\n/** Element that closes the drawer when interacted with. */\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\n/** Dimmed backdrop rendered behind the drawer content. */\nfunction DrawerOverlay({\n /** Extra classes merged onto the overlay surface. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-overlay-bg data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */\nfunction DrawerContent({\n /** Extra classes merged onto the content panel. */\n className,\n /** Body of the drawer, typically header/footer plus content. */\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-10 data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-10 data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-2 hidden h-0.75 w-12.5 shrink-0 rounded-2 bg-muted-bg group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\n/** Top region of the drawer; groups the title and description. */\nfunction DrawerHeader({\n /** Extra classes merged onto the header wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Bottom region of the drawer; typically holds actions, pinned to the panel base. */\nfunction DrawerFooter({\n /** Extra classes merged onto the footer wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/** Accessible title for the drawer, announced to assistive tech. */\nfunction DrawerTitle({\n /** Extra classes merged onto the title. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\n \"font-heading text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal text-primary-txt\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Supporting description text shown beneath the drawer title. */\nfunction DrawerDescription({\n /** Extra classes merged onto the description. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-txt text-sm leading-5\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"mappings":";;;;;AAMA,SAAS,OAAO,EAAE,GAAG,SAA4D;CAC/E,OAAO,oBAACA,SAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;;AAGA,SAAS,cAAc,EAAE,GAAG,SAA+D;CACzF,OAAO,oBAACA,SAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;;AAGA,SAAS,aAAa,EAAE,GAAG,SAA8D;CACvF,OAAO,oBAACA,SAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;;AAGA,SAAS,YAAY,EAAE,GAAG,SAA6D;CACrF,OAAO,oBAACA,SAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;;AAGA,SAAS,cAAc,EAErB,WACA,GAAG,SACoD;CACvD,OACE,oBAACA,SAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,4JACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,cAAc,EAErB,WAEA,UACA,GAAG,SACoD;CACvD,OACE,qBAAC,cAAD;EAAc,aAAU;YAAxB,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,qBAACA,SAAgB,SAAjB;GACE,aAAU;GACV,WAAW,GACT,gFACA,kQACA,uRACA,+NACA,yNACA,SACF;GACA,GAAI;aAVN,CAYE,oBAAC,OAAD,EAAK,WAAU,kIAAmI,CAAA,GACjJ,QACsB;IACb;;AAElB;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,4LACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAEnB,WACA,GAAG,SACkD;CACrD,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GACT,6HACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,kBAAkB,EAEzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAACA,SAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,oCAAoC,SAAS;EAC3D,GAAI;CACL,CAAA;AAEL"}
1
+ {"version":3,"file":"index.js","names":["DrawerPrimitive"],"sources":["../../../src/primitives/Drawer/Drawer.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"@/utils\";\n\n/** Root provider for a vaul-backed sliding drawer; controls open state and slide `direction`. */\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\n/** Element that toggles the drawer open when interacted with. */\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\n/** Portals the overlay and content out to the document body. */\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\n/** Element that closes the drawer when interacted with. */\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\n/** Dimmed backdrop rendered behind the drawer content. */\nfunction DrawerOverlay({\n /** Extra classes merged onto the overlay surface. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-overlay-bg data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst drawerSizeVariants = {\n small: [\n \"data-[vaul-drawer-direction=top]:max-h-[60vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[60vh]\",\n \"data-[vaul-drawer-direction=right]:w-2/3 data-[vaul-drawer-direction=right]:sm:max-w-xs\",\n \"data-[vaul-drawer-direction=left]:w-2/3 data-[vaul-drawer-direction=left]:sm:max-w-xs\",\n ].join(\" \"),\n default: [\n \"data-[vaul-drawer-direction=top]:max-h-[80vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[80vh]\",\n \"data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n ].join(\" \"),\n medium: [\n \"data-[vaul-drawer-direction=top]:max-h-[85vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[85vh]\",\n \"data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md\",\n \"data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md\",\n ].join(\" \"),\n large: [\n \"data-[vaul-drawer-direction=top]:max-h-[90vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[90vh]\",\n \"data-[vaul-drawer-direction=right]:w-11/12 data-[vaul-drawer-direction=right]:sm:max-w-lg\",\n \"data-[vaul-drawer-direction=left]:w-11/12 data-[vaul-drawer-direction=left]:sm:max-w-lg\",\n ].join(\" \"),\n extraLarge: [\n \"data-[vaul-drawer-direction=top]:max-h-[95vh]\",\n \"data-[vaul-drawer-direction=bottom]:max-h-[95vh]\",\n \"data-[vaul-drawer-direction=right]:w-[95vw] data-[vaul-drawer-direction=right]:sm:max-w-2xl\",\n \"data-[vaul-drawer-direction=left]:w-[95vw] data-[vaul-drawer-direction=left]:sm:max-w-2xl\",\n ].join(\" \"),\n} as const;\n\n/** Sliding panel that holds the drawer's content; auto-portals and renders the overlay. */\nfunction DrawerContent({\n /** Extra classes merged onto the content panel. */\n className,\n /** Body of the drawer, typically header/footer plus content. */\n children,\n /** Optional size variant for the drawer panel. */\n size = \"default\",\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content> & {\n /** Panel size. `default` matches the existing production sizing. */\n size?: keyof typeof drawerSizeVariants;\n}) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content fixed z-50 flex h-auto flex-col bg-primary-bg shadow-lg\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:rounded-b-10 data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:rounded-t-10 data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:border-l\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:border-r\",\n drawerSizeVariants[size],\n className,\n )}\n {...props}\n >\n <div className=\"mx-auto mt-2 hidden h-0.75 w-12.5 shrink-0 rounded-2 bg-muted-bg group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\n/** Top region of the drawer; groups the title and description. */\nfunction DrawerHeader({\n /** Extra classes merged onto the header wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Bottom region of the drawer; typically holds actions, pinned to the panel base. */\nfunction DrawerFooter({\n /** Extra classes merged onto the footer wrapper. */\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/** Accessible title for the drawer, announced to assistive tech. */\nfunction DrawerTitle({\n /** Extra classes merged onto the title. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\n \"font-heading text-[length:var(--heading-4-font-size)] leading-[var(--heading-4-line-height)] font-normal text-primary-txt\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Supporting description text shown beneath the drawer title. */\nfunction DrawerDescription({\n /** Extra classes merged onto the description. */\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-txt text-sm leading-5\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"mappings":";;;;;AAMA,SAAS,OAAO,EAAE,GAAG,SAA4D;CAC/E,OAAO,oBAACA,SAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;;AAGA,SAAS,cAAc,EAAE,GAAG,SAA+D;CACzF,OAAO,oBAACA,SAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;;AAGA,SAAS,aAAa,EAAE,GAAG,SAA8D;CACvF,OAAO,oBAACA,SAAgB,QAAjB;EAAwB,aAAU;EAAgB,GAAI;CAAQ,CAAA;AACvE;;AAGA,SAAS,YAAY,EAAE,GAAG,SAA6D;CACrF,OAAO,oBAACA,SAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;;AAGA,SAAS,cAAc,EAErB,WACA,GAAG,SACoD;CACvD,OACE,oBAACA,SAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,4JACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,qBAAqB;CACzB,OAAO;EACL;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,SAAS;EACP;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,QAAQ;EACN;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,OAAO;EACL;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;CACV,YAAY;EACV;EACA;EACA;EACA;CACF,EAAE,KAAK,GAAG;AACZ;;AAGA,SAAS,cAAc,EAErB,WAEA,UAEA,OAAO,WACP,GAAG,SAIF;CACD,OACE,qBAAC,cAAD;EAAc,aAAU;YAAxB,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,qBAACA,SAAgB,SAAjB;GACE,aAAU;GACV,WAAW,GACT,gFACA,oNACA,sOACA,uIACA,mIACA,mBAAmB,OACnB,SACF;GACA,GAAI;aAXN,CAaE,oBAAC,OAAD,EAAK,WAAU,kIAAmI,CAAA,GACjJ,QACsB;IACb;;AAElB;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,4LACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,aAAa,EAEpB,WACA,GAAG,SAC2B;CAC9B,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,YAAY,EAEnB,WACA,GAAG,SACkD;CACrD,OACE,oBAACA,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GACT,6HACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;;AAGA,SAAS,kBAAkB,EAEzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAACA,SAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,oCAAoC,SAAS;EAC3D,GAAI;CACL,CAAA;AAEL"}
@@ -1,2 +1,2 @@
1
- import { a as DropdownMenuItem, c as DropdownMenuRadioGroup, d as DropdownMenuShortcut, f as DropdownMenuSub, h as DropdownMenuTrigger, i as DropdownMenuGroup, l as DropdownMenuRadioItem, m as DropdownMenuSubTrigger, n as DropdownMenuCheckboxItem, o as DropdownMenuLabel, p as DropdownMenuSubContent, r as DropdownMenuContent, s as DropdownMenuPortal, t as DropdownMenu, u as DropdownMenuSeparator } from "../../index23.cjs";
1
+ import { a as DropdownMenuItem, c as DropdownMenuRadioGroup, d as DropdownMenuShortcut, f as DropdownMenuSub, h as DropdownMenuTrigger, i as DropdownMenuGroup, l as DropdownMenuRadioItem, m as DropdownMenuSubTrigger, n as DropdownMenuCheckboxItem, o as DropdownMenuLabel, p as DropdownMenuSubContent, r as DropdownMenuContent, s as DropdownMenuPortal, t as DropdownMenu, u as DropdownMenuSeparator } from "../../index26.cjs";
2
2
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
@@ -1,2 +1,2 @@
1
- import { a as DropdownMenuItem, c as DropdownMenuRadioGroup, d as DropdownMenuShortcut, f as DropdownMenuSub, h as DropdownMenuTrigger, i as DropdownMenuGroup, l as DropdownMenuRadioItem, m as DropdownMenuSubTrigger, n as DropdownMenuCheckboxItem, o as DropdownMenuLabel, p as DropdownMenuSubContent, r as DropdownMenuContent, s as DropdownMenuPortal, t as DropdownMenu, u as DropdownMenuSeparator } from "../../index23.js";
1
+ import { a as DropdownMenuItem, c as DropdownMenuRadioGroup, d as DropdownMenuShortcut, f as DropdownMenuSub, h as DropdownMenuTrigger, i as DropdownMenuGroup, l as DropdownMenuRadioItem, m as DropdownMenuSubTrigger, n as DropdownMenuCheckboxItem, o as DropdownMenuLabel, p as DropdownMenuSubContent, r as DropdownMenuContent, s as DropdownMenuPortal, t as DropdownMenu, u as DropdownMenuSeparator } from "../../index26.js";
2
2
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
@@ -1,2 +1,2 @@
1
- import { a as EmptyMedia, i as EmptyHeader, n as EmptyContent, o as EmptyTitle, r as EmptyDescription, s as emptyVariants, t as Empty } from "../../index24.cjs";
1
+ import { a as EmptyMedia, i as EmptyHeader, n as EmptyContent, o as EmptyTitle, r as EmptyDescription, s as emptyVariants, t as Empty } from "../../index27.cjs";
2
2
  export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, emptyVariants };
@@ -1,2 +1,2 @@
1
- import { a as EmptyMedia, i as EmptyHeader, n as EmptyContent, o as EmptyTitle, r as EmptyDescription, s as emptyVariants, t as Empty } from "../../index24.js";
1
+ import { a as EmptyMedia, i as EmptyHeader, n as EmptyContent, o as EmptyTitle, r as EmptyDescription, s as emptyVariants, t as Empty } from "../../index27.js";
2
2
  export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, emptyVariants };
@@ -1,2 +1,2 @@
1
- import { a as FieldGroup, c as FieldSeparator, i as FieldError, l as FieldSet, n as FieldContent, o as FieldLabel, r as FieldDescription, s as FieldLegend, t as Field, u as FieldTitle } from "../../index26.cjs";
1
+ import { a as FieldGroup, c as FieldSeparator, i as FieldError, l as FieldSet, n as FieldContent, o as FieldLabel, r as FieldDescription, s as FieldLegend, t as Field, u as FieldTitle } from "../../index29.cjs";
2
2
  export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
@@ -1,2 +1,2 @@
1
- import { a as FieldGroup, c as FieldSeparator, i as FieldError, l as FieldSet, n as FieldContent, o as FieldLabel, r as FieldDescription, s as FieldLegend, t as Field, u as FieldTitle } from "../../index26.js";
1
+ import { a as FieldGroup, c as FieldSeparator, i as FieldError, l as FieldSet, n as FieldContent, o as FieldLabel, r as FieldDescription, s as FieldLegend, t as Field, u as FieldTitle } from "../../index29.js";
2
2
  export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
@@ -0,0 +1,354 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_chunk = require("../../chunk.cjs");
3
+ const require_cn = require("../../cn.cjs");
4
+ const require_primitives_Button_index = require("../Button/index.cjs");
5
+ const require_primitives_Progress_index = require("../Progress/index.cjs");
6
+ let react = require("react");
7
+ react = require_chunk.__toESM(react);
8
+ let react_jsx_runtime = require("react/jsx-runtime");
9
+ let lucide_react = require("lucide-react");
10
+ //#region src/primitives/FileUpload/FileUpload.tsx
11
+ function clamp(value, min, max) {
12
+ return Math.min(max, Math.max(min, value));
13
+ }
14
+ function formatBytes(value) {
15
+ if (!Number.isFinite(value) || value <= 0) return "0 B";
16
+ const units = [
17
+ "B",
18
+ "KB",
19
+ "MB",
20
+ "GB",
21
+ "TB"
22
+ ];
23
+ const exponent = Math.min(Math.floor(Math.log(value) / Math.log(1024)), units.length - 1);
24
+ const size = value / 1024 ** exponent;
25
+ return `${size.toFixed(size >= 10 || exponent === 0 ? 0 : 1)} ${units[exponent]}`;
26
+ }
27
+ function getAcceptTokens(accept) {
28
+ return (accept ?? "").split(",").map((token) => token.trim().toLowerCase()).filter(Boolean);
29
+ }
30
+ function matchesAccept(file, accept) {
31
+ const tokens = getAcceptTokens(accept);
32
+ if (tokens.length === 0) return true;
33
+ const fileName = file.name.toLowerCase();
34
+ const fileType = file.type.toLowerCase();
35
+ return tokens.some((token) => {
36
+ if (token.startsWith(".")) return fileName.endsWith(token);
37
+ if (token.endsWith("/*")) {
38
+ const category = token.slice(0, token.length - 1);
39
+ return fileType.startsWith(category);
40
+ }
41
+ return fileType === token;
42
+ });
43
+ }
44
+ function createFileItem(file) {
45
+ return {
46
+ id: typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : `${file.name}-${file.lastModified}-${Math.random().toString(36).slice(2)}`,
47
+ file,
48
+ status: "idle",
49
+ progress: 0
50
+ };
51
+ }
52
+ function hasFiles(event) {
53
+ return Array.from(event.dataTransfer?.types ?? []).includes("Files");
54
+ }
55
+ function getStatusLabel(item) {
56
+ if (item.status === "idle") return "Ready to upload";
57
+ if (item.status === "uploading") return `Uploading… ${Math.round(item.progress)}%`;
58
+ if (item.status === "success") return "Upload complete";
59
+ return item.error ? `Upload failed: ${item.error}` : "Upload failed";
60
+ }
61
+ /** File upload primitive with click-to-browse and drag-and-drop interactions, validation, and per-file upload states. */
62
+ function FileUpload({ className, multiple = false, accept, maxFiles, maxFileSize, validateFile, onUpload, onItemsChange, dropzoneAriaLabel = "File upload drop zone", disabled, ...props }) {
63
+ const inputRef = react.useRef(null);
64
+ const uploadControllersRef = react.useRef(/* @__PURE__ */ new Map());
65
+ const [items, setItems] = react.useState([]);
66
+ const [errors, setErrors] = react.useState([]);
67
+ const [dragState, setDragState] = react.useState("idle");
68
+ const dragDepthRef = react.useRef(0);
69
+ const baseId = react.useId();
70
+ const hintId = `${baseId}-hint`;
71
+ const errorId = `${baseId}-errors`;
72
+ const updateItem = react.useCallback((itemId, updater) => {
73
+ setItems((current) => current.map((item) => item.id === itemId ? updater(item) : item));
74
+ }, []);
75
+ const removeItem = react.useCallback((itemId) => {
76
+ uploadControllersRef.current.get(itemId)?.abort();
77
+ uploadControllersRef.current.delete(itemId);
78
+ setItems((current) => current.filter((item) => item.id !== itemId));
79
+ }, []);
80
+ const beginUpload = react.useCallback((item) => {
81
+ if (!onUpload) return;
82
+ const controller = new AbortController();
83
+ uploadControllersRef.current.set(item.id, controller);
84
+ updateItem(item.id, (current) => ({
85
+ ...current,
86
+ status: "uploading",
87
+ progress: 0,
88
+ error: void 0
89
+ }));
90
+ onUpload({
91
+ file: item.file,
92
+ signal: controller.signal,
93
+ reportProgress: (value) => {
94
+ updateItem(item.id, (current) => {
95
+ if (current.status !== "uploading") return current;
96
+ return {
97
+ ...current,
98
+ progress: clamp(value, 0, 100)
99
+ };
100
+ });
101
+ }
102
+ }).then(() => {
103
+ if (controller.signal.aborted) return;
104
+ updateItem(item.id, (current) => ({
105
+ ...current,
106
+ status: "success",
107
+ progress: 100,
108
+ error: void 0
109
+ }));
110
+ }).catch((uploadError) => {
111
+ if (controller.signal.aborted) return;
112
+ const message = uploadError instanceof Error && uploadError.message ? uploadError.message : "Upload failed.";
113
+ updateItem(item.id, (current) => ({
114
+ ...current,
115
+ status: "error",
116
+ error: message
117
+ }));
118
+ }).finally(() => {
119
+ uploadControllersRef.current.delete(item.id);
120
+ });
121
+ }, [onUpload, updateItem]);
122
+ const queueFiles = react.useCallback((queuedFiles) => {
123
+ const incoming = Array.isArray(queuedFiles) ? queuedFiles : Array.from(queuedFiles);
124
+ if (incoming.length === 0) return;
125
+ if (!multiple) {
126
+ uploadControllersRef.current.forEach((controller) => controller.abort());
127
+ uploadControllersRef.current.clear();
128
+ }
129
+ const nextErrors = [];
130
+ const acceptedItems = [];
131
+ const nextItems = multiple ? [...items] : [];
132
+ const effectiveMaxFiles = multiple ? maxFiles ?? Number.POSITIVE_INFINITY : 1;
133
+ let candidates = incoming;
134
+ if (!multiple && incoming.length > 1) {
135
+ nextErrors.push("Only one file can be selected at a time.");
136
+ candidates = [incoming[0]];
137
+ }
138
+ const availableSlots = Math.max(0, effectiveMaxFiles - nextItems.length);
139
+ if (availableSlots < candidates.length) {
140
+ nextErrors.push(`You can upload up to ${effectiveMaxFiles} file${effectiveMaxFiles === 1 ? "" : "s"}.`);
141
+ candidates = candidates.slice(0, availableSlots);
142
+ }
143
+ for (const file of candidates) {
144
+ if (!matchesAccept(file, accept)) {
145
+ nextErrors.push(`${file.name} has an unsupported file type.`);
146
+ continue;
147
+ }
148
+ if (maxFileSize != null && file.size > maxFileSize) {
149
+ nextErrors.push(`${file.name} exceeds the ${formatBytes(maxFileSize)} size limit.`);
150
+ continue;
151
+ }
152
+ const customError = validateFile?.(file);
153
+ if (customError) {
154
+ nextErrors.push(customError);
155
+ continue;
156
+ }
157
+ const item = createFileItem(file);
158
+ acceptedItems.push(item);
159
+ nextItems.push(item);
160
+ }
161
+ setItems(nextItems);
162
+ setErrors(nextErrors);
163
+ setDragState(nextErrors.length > 0 ? "invalid-drop" : "idle");
164
+ if (onUpload) acceptedItems.forEach((item) => beginUpload(item));
165
+ }, [
166
+ accept,
167
+ beginUpload,
168
+ items,
169
+ maxFileSize,
170
+ maxFiles,
171
+ multiple,
172
+ onUpload,
173
+ validateFile
174
+ ]);
175
+ const openPicker = react.useCallback(() => {
176
+ if (disabled) return;
177
+ inputRef.current?.click();
178
+ }, [disabled]);
179
+ const handleInputChange = react.useCallback((event) => {
180
+ queueFiles(event.target.files ?? []);
181
+ event.target.value = "";
182
+ }, [queueFiles]);
183
+ const handleDragEnter = react.useCallback((event) => {
184
+ event.preventDefault();
185
+ if (disabled) return;
186
+ if (!hasFiles(event)) {
187
+ setDragState("invalid-drop");
188
+ return;
189
+ }
190
+ dragDepthRef.current += 1;
191
+ setDragState("drag-over");
192
+ }, [disabled]);
193
+ const handleDragOver = react.useCallback((event) => {
194
+ event.preventDefault();
195
+ if (disabled) return;
196
+ if (event.dataTransfer) event.dataTransfer.dropEffect = "copy";
197
+ if (!hasFiles(event)) setDragState("invalid-drop");
198
+ }, [disabled]);
199
+ const handleDragLeave = react.useCallback((event) => {
200
+ event.preventDefault();
201
+ dragDepthRef.current = Math.max(0, dragDepthRef.current - 1);
202
+ if (dragDepthRef.current === 0) setDragState("idle");
203
+ }, []);
204
+ const handleDrop = react.useCallback((event) => {
205
+ event.preventDefault();
206
+ dragDepthRef.current = 0;
207
+ if (disabled) return;
208
+ if (!hasFiles(event)) {
209
+ setErrors(["Only files can be dropped here."]);
210
+ setDragState("invalid-drop");
211
+ return;
212
+ }
213
+ queueFiles(event.dataTransfer.files);
214
+ }, [disabled, queueFiles]);
215
+ react.useEffect(() => {
216
+ onItemsChange?.(items);
217
+ }, [items, onItemsChange]);
218
+ react.useEffect(() => () => {
219
+ uploadControllersRef.current.forEach((controller) => controller.abort());
220
+ uploadControllersRef.current.clear();
221
+ }, []);
222
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
223
+ "data-slot": "file-upload",
224
+ className: require_cn.cn("flex flex-col gap-3", className),
225
+ ...props,
226
+ children: [
227
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
228
+ ref: inputRef,
229
+ type: "file",
230
+ accept,
231
+ multiple,
232
+ disabled,
233
+ "data-slot": "file-upload-input",
234
+ className: "hidden",
235
+ onChange: handleInputChange,
236
+ tabIndex: -1
237
+ }),
238
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
239
+ "data-slot": "file-upload-dropzone",
240
+ "data-drag-state": dragState,
241
+ role: "button",
242
+ tabIndex: disabled ? -1 : 0,
243
+ "aria-label": dropzoneAriaLabel,
244
+ "aria-disabled": disabled || void 0,
245
+ "aria-describedby": errors.length > 0 ? `${hintId} ${errorId}` : hintId,
246
+ className: require_cn.cn("flex cursor-pointer flex-col items-center justify-center gap-2 rounded-12 border-2 border-dashed px-5 py-8 text-center outline-none transition-colors focus-visible:ring-3 focus-visible:ring-focus", "data-[drag-state=idle]:border-primary-border data-[drag-state=idle]:bg-secondary-bg/25", "data-[drag-state=drag-over]:border-primary-invert-border data-[drag-state=drag-over]:bg-primary-bg", "data-[drag-state=invalid-drop]:border-danger-border data-[drag-state=invalid-drop]:bg-danger-bg/35", disabled && "cursor-not-allowed opacity-60"),
247
+ onClick: openPicker,
248
+ onKeyDown: (event) => {
249
+ if (event.key === "Enter" || event.key === " ") {
250
+ event.preventDefault();
251
+ openPicker();
252
+ }
253
+ },
254
+ onDragEnter: handleDragEnter,
255
+ onDragOver: handleDragOver,
256
+ onDragLeave: handleDragLeave,
257
+ onDrop: handleDrop,
258
+ children: [
259
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.UploadCloud, {
260
+ className: "size-8 text-muted-txt",
261
+ "aria-hidden": "true"
262
+ }),
263
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
264
+ className: "font-medium text-sm text-primary-txt",
265
+ children: "Drag files here or click to browse"
266
+ }),
267
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
268
+ id: hintId,
269
+ className: "text-muted-txt text-xs",
270
+ children: [
271
+ multiple ? "Supports multiple files." : "Supports one file.",
272
+ accept ? ` Accepted: ${accept}.` : "",
273
+ maxFileSize ? ` Max file size: ${formatBytes(maxFileSize)}.` : ""
274
+ ]
275
+ })
276
+ ]
277
+ }),
278
+ errors.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
279
+ id: errorId,
280
+ role: "alert",
281
+ className: "space-y-1 text-danger-txt text-xs",
282
+ children: errors.map((message, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
283
+ className: "flex items-start gap-1.5",
284
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleAlert, {
285
+ className: "mt-0.5 size-3.5 shrink-0",
286
+ "aria-hidden": "true"
287
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: message })]
288
+ }, `${message}-${index}`))
289
+ }) : null,
290
+ items.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
291
+ "data-slot": "file-upload-list",
292
+ className: "space-y-2",
293
+ "aria-live": "polite",
294
+ children: items.map((item) => {
295
+ const showProgress = item.status === "uploading" || item.status === "success";
296
+ const progressVariant = item.status === "error" ? "destructive" : "default";
297
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
298
+ "data-slot": "file-upload-item",
299
+ "data-state": item.status,
300
+ className: "rounded-12 border border-primary-border bg-secondary-bg/20 px-3 py-2",
301
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
302
+ className: "flex items-start gap-2.5",
303
+ children: [
304
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
305
+ className: "mt-0.5 shrink-0 text-muted-txt",
306
+ "aria-hidden": "true",
307
+ children: item.status === "success" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CheckCircle2, { className: "size-4 text-success-txt" }) : item.status === "error" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleAlert, { className: "size-4 text-danger-txt" }) : item.status === "uploading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.FileIcon, { className: "size-4" })
308
+ }),
309
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
310
+ className: "min-w-0 flex-1",
311
+ children: [
312
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
313
+ className: "flex items-center justify-between gap-3",
314
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
315
+ className: "truncate font-medium text-sm text-primary-txt",
316
+ children: item.file.name
317
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
318
+ className: "shrink-0 text-muted-txt text-xs",
319
+ children: formatBytes(item.file.size)
320
+ })]
321
+ }),
322
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
323
+ className: "mt-0.5 text-muted-txt text-xs",
324
+ children: getStatusLabel(item)
325
+ }),
326
+ showProgress ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Progress_index.Progress, {
327
+ className: "mt-2",
328
+ value: item.status === "success" ? 100 : item.progress,
329
+ variant: progressVariant,
330
+ "aria-label": `Upload progress for ${item.file.name}`
331
+ }) : null
332
+ ]
333
+ }),
334
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_primitives_Button_index.Button, {
335
+ type: "button",
336
+ variant: item.status === "uploading" ? "destructive-ghost" : "ghost",
337
+ size: "icon-sm",
338
+ shape: "square",
339
+ "aria-label": item.status === "uploading" ? `Cancel upload for ${item.file.name}` : `Remove ${item.file.name}`,
340
+ onClick: () => removeItem(item.id),
341
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.XIcon, {})
342
+ })
343
+ ]
344
+ })
345
+ }, item.id);
346
+ })
347
+ }) : null
348
+ ]
349
+ });
350
+ }
351
+ //#endregion
352
+ exports.FileUpload = FileUpload;
353
+
354
+ //# sourceMappingURL=index.cjs.map