@stevederico/skateboard-ui 3.11.0 → 4.0.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 (336) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +37 -31
  3. package/dist/shadcn/ui/accordion.d.ts +1 -6
  4. package/dist/shadcn/ui/accordion.js +3 -17
  5. package/dist/shadcn/ui/alert-dialog.d.ts +1 -18
  6. package/dist/shadcn/ui/alert-dialog.js +3 -43
  7. package/dist/shadcn/ui/alert.d.ts +1 -13
  8. package/dist/shadcn/ui/alert.js +3 -28
  9. package/dist/shadcn/ui/aspect-ratio.d.ts +1 -4
  10. package/dist/shadcn/ui/aspect-ratio.js +3 -8
  11. package/dist/shadcn/ui/avatar.d.ts +1 -11
  12. package/dist/shadcn/ui/avatar.js +3 -24
  13. package/dist/shadcn/ui/badge.d.ts +1 -14
  14. package/dist/shadcn/ui/badge.js +3 -33
  15. package/dist/shadcn/ui/breadcrumb.d.ts +1 -10
  16. package/dist/shadcn/ui/breadcrumb.js +3 -37
  17. package/dist/shadcn/ui/button-group.d.ts +1 -13
  18. package/dist/shadcn/ui/button-group.js +3 -36
  19. package/dist/shadcn/ui/button.d.ts +1 -34
  20. package/dist/shadcn/ui/button.js +3 -48
  21. package/dist/shadcn/ui/calendar.d.ts +1 -13
  22. package/dist/shadcn/ui/calendar.js +3 -75
  23. package/dist/shadcn/ui/card.d.ts +1 -11
  24. package/dist/shadcn/ui/card.js +3 -25
  25. package/dist/shadcn/ui/checkbox.d.ts +1 -3
  26. package/dist/shadcn/ui/checkbox.js +3 -9
  27. package/dist/shadcn/ui/collapsible.d.ts +1 -5
  28. package/dist/shadcn/ui/collapsible.js +3 -13
  29. package/dist/shadcn/ui/command.d.ts +1 -19
  30. package/dist/shadcn/ui/command.js +3 -35
  31. package/dist/shadcn/ui/context-menu.d.ts +1 -29
  32. package/dist/shadcn/ui/context-menu.js +3 -52
  33. package/dist/shadcn/ui/dialog.d.ts +1 -17
  34. package/dist/shadcn/ui/dialog.js +3 -38
  35. package/dist/shadcn/ui/drawer.d.ts +1 -13
  36. package/dist/shadcn/ui/drawer.js +3 -196
  37. package/dist/shadcn/ui/dropdown-menu.d.ts +1 -29
  38. package/dist/shadcn/ui/dropdown-menu.js +3 -52
  39. package/dist/shadcn/ui/empty.d.ts +1 -14
  40. package/dist/shadcn/ui/empty.js +3 -33
  41. package/dist/shadcn/ui/field.d.ts +1 -28
  42. package/dist/shadcn/ui/field.js +3 -68
  43. package/dist/shadcn/ui/hover-card.d.ts +1 -5
  44. package/dist/shadcn/ui/hover-card.js +3 -14
  45. package/dist/shadcn/ui/input-group.d.ts +1 -28
  46. package/dist/shadcn/ui/input-group.js +3 -58
  47. package/dist/shadcn/ui/input.d.ts +1 -3
  48. package/dist/shadcn/ui/input.js +3 -8
  49. package/dist/shadcn/ui/item.d.ts +1 -34
  50. package/dist/shadcn/ui/item.js +3 -79
  51. package/dist/shadcn/ui/kbd.d.ts +1 -3
  52. package/dist/shadcn/ui/kbd.js +3 -9
  53. package/dist/shadcn/ui/label.d.ts +1 -3
  54. package/dist/shadcn/ui/label.js +3 -8
  55. package/dist/shadcn/ui/menubar.d.ts +1 -29
  56. package/dist/shadcn/ui/menubar.js +3 -57
  57. package/dist/shadcn/ui/navigation-menu.d.ts +1 -13
  58. package/dist/shadcn/ui/navigation-menu.js +3 -31
  59. package/dist/shadcn/ui/pagination.d.ts +1 -17
  60. package/dist/shadcn/ui/pagination.js +3 -27
  61. package/dist/shadcn/ui/popover.d.ts +1 -9
  62. package/dist/shadcn/ui/popover.js +3 -24
  63. package/dist/shadcn/ui/progress.d.ts +1 -7
  64. package/dist/shadcn/ui/progress.js +3 -20
  65. package/dist/shadcn/ui/radio-group.d.ts +1 -5
  66. package/dist/shadcn/ui/radio-group.js +3 -12
  67. package/dist/shadcn/ui/scroll-area.d.ts +1 -5
  68. package/dist/shadcn/ui/scroll-area.js +3 -12
  69. package/dist/shadcn/ui/select.d.ts +1 -15
  70. package/dist/shadcn/ui/select.js +3 -35
  71. package/dist/shadcn/ui/separator.d.ts +1 -3
  72. package/dist/shadcn/ui/separator.js +3 -8
  73. package/dist/shadcn/ui/sheet.d.ts +1 -14
  74. package/dist/shadcn/ui/sheet.js +3 -38
  75. package/dist/shadcn/ui/sidebar.d.ts +1 -70
  76. package/dist/shadcn/ui/sidebar.js +3 -256
  77. package/dist/shadcn/ui/skeleton.d.ts +1 -2
  78. package/dist/shadcn/ui/skeleton.js +3 -6
  79. package/dist/shadcn/ui/slider.d.ts +1 -3
  80. package/dist/shadcn/ui/slider.js +3 -12
  81. package/dist/shadcn/ui/spinner.d.ts +1 -2
  82. package/dist/shadcn/ui/spinner.js +3 -7
  83. package/dist/shadcn/ui/switch.d.ts +1 -5
  84. package/dist/shadcn/ui/switch.js +3 -8
  85. package/dist/shadcn/ui/table.d.ts +1 -10
  86. package/dist/shadcn/ui/table.js +3 -29
  87. package/dist/shadcn/ui/tabs.d.ts +1 -13
  88. package/dist/shadcn/ui/tabs.js +3 -29
  89. package/dist/shadcn/ui/textarea.d.ts +1 -3
  90. package/dist/shadcn/ui/textarea.js +3 -7
  91. package/dist/shadcn/ui/toggle-group.d.ts +1 -11
  92. package/dist/shadcn/ui/toggle-group.js +3 -25
  93. package/dist/shadcn/ui/toggle.d.ts +1 -15
  94. package/dist/shadcn/ui/toggle.js +3 -26
  95. package/dist/shadcn/ui/tooltip.d.ts +1 -6
  96. package/dist/shadcn/ui/tooltip.js +3 -17
  97. package/dist/ui/accordion.d.ts +21 -0
  98. package/dist/ui/accordion.js +67 -0
  99. package/dist/ui/alert-dialog.d.ts +32 -0
  100. package/dist/ui/alert-dialog.js +102 -0
  101. package/dist/ui/alert.d.ts +13 -0
  102. package/dist/ui/alert.js +28 -0
  103. package/dist/ui/aspect-ratio.d.ts +5 -0
  104. package/dist/ui/aspect-ratio.js +9 -0
  105. package/dist/ui/avatar.d.ts +14 -0
  106. package/dist/ui/avatar.js +49 -0
  107. package/dist/ui/badge.d.ts +22 -0
  108. package/dist/ui/badge.js +26 -0
  109. package/dist/ui/breadcrumb.d.ts +13 -0
  110. package/dist/ui/breadcrumb.js +29 -0
  111. package/dist/ui/button-group.d.ts +21 -0
  112. package/dist/ui/button-group.js +29 -0
  113. package/dist/ui/button.d.ts +38 -0
  114. package/dist/ui/button.js +49 -0
  115. package/dist/ui/calendar.d.ts +13 -0
  116. package/dist/ui/calendar.js +75 -0
  117. package/dist/ui/card.d.ts +11 -0
  118. package/dist/ui/card.js +25 -0
  119. package/dist/ui/checkbox.d.ts +17 -0
  120. package/dist/ui/checkbox.js +25 -0
  121. package/dist/ui/collapsible.d.ts +11 -0
  122. package/dist/ui/collapsible.js +40 -0
  123. package/dist/ui/command.d.ts +19 -0
  124. package/dist/ui/command.js +35 -0
  125. package/dist/ui/context-menu.d.ts +53 -0
  126. package/dist/ui/context-menu.js +345 -0
  127. package/dist/ui/dialog.d.ts +40 -0
  128. package/dist/ui/dialog.js +109 -0
  129. package/dist/ui/drawer.d.ts +36 -0
  130. package/dist/ui/drawer.js +234 -0
  131. package/dist/ui/dropdown-menu.d.ts +61 -0
  132. package/dist/ui/dropdown-menu.js +323 -0
  133. package/dist/ui/empty.d.ts +14 -0
  134. package/dist/ui/empty.js +33 -0
  135. package/dist/ui/field.d.ts +28 -0
  136. package/dist/ui/field.js +68 -0
  137. package/dist/ui/hover-card.d.ts +32 -0
  138. package/dist/ui/hover-card.js +119 -0
  139. package/dist/ui/input-group.d.ts +28 -0
  140. package/dist/ui/input-group.js +58 -0
  141. package/dist/ui/input.d.ts +3 -0
  142. package/dist/ui/input.js +7 -0
  143. package/dist/ui/item.d.ts +41 -0
  144. package/dist/ui/item.js +69 -0
  145. package/dist/ui/kbd.d.ts +4 -0
  146. package/dist/ui/kbd.js +10 -0
  147. package/dist/ui/label.d.ts +3 -0
  148. package/dist/ui/label.js +8 -0
  149. package/dist/ui/menubar.d.ts +59 -0
  150. package/dist/ui/menubar.js +384 -0
  151. package/dist/ui/navigation-menu.d.ts +24 -0
  152. package/dist/ui/navigation-menu.js +134 -0
  153. package/dist/ui/pagination.d.ts +17 -0
  154. package/dist/ui/pagination.js +36 -0
  155. package/dist/ui/popover.d.ts +25 -0
  156. package/dist/ui/popover.js +68 -0
  157. package/dist/ui/portal.d.ts +7 -0
  158. package/dist/ui/portal.js +12 -0
  159. package/dist/ui/progress.d.ts +15 -0
  160. package/dist/ui/progress.js +36 -0
  161. package/dist/ui/radio-group.d.ts +17 -0
  162. package/dist/ui/radio-group.js +54 -0
  163. package/dist/ui/scroll-area.d.ts +9 -0
  164. package/dist/ui/scroll-area.js +72 -0
  165. package/dist/ui/select.d.ts +37 -0
  166. package/dist/ui/select.js +216 -0
  167. package/dist/ui/separator.d.ts +14 -0
  168. package/dist/ui/separator.js +13 -0
  169. package/dist/ui/sheet.d.ts +31 -0
  170. package/dist/ui/sheet.js +121 -0
  171. package/dist/ui/sidebar.d.ts +86 -0
  172. package/dist/ui/sidebar.js +211 -0
  173. package/dist/ui/skeleton.d.ts +3 -0
  174. package/dist/ui/skeleton.js +7 -0
  175. package/dist/ui/slider.d.ts +18 -0
  176. package/dist/ui/slider.js +94 -0
  177. package/dist/ui/slot.d.ts +27 -0
  178. package/dist/ui/slot.js +62 -0
  179. package/dist/ui/spinner.d.ts +3 -0
  180. package/dist/ui/spinner.js +8 -0
  181. package/dist/ui/switch.d.ts +17 -0
  182. package/dist/ui/switch.js +23 -0
  183. package/dist/ui/table.d.ts +10 -0
  184. package/dist/ui/table.js +29 -0
  185. package/dist/ui/tabs.d.ts +29 -0
  186. package/dist/ui/tabs.js +82 -0
  187. package/dist/ui/textarea.d.ts +3 -0
  188. package/dist/ui/textarea.js +7 -0
  189. package/dist/ui/toggle-group.d.ts +23 -0
  190. package/dist/ui/toggle-group.js +52 -0
  191. package/dist/ui/toggle.d.ts +25 -0
  192. package/dist/ui/toggle.js +41 -0
  193. package/dist/ui/tooltip.d.ts +25 -0
  194. package/dist/ui/tooltip.js +90 -0
  195. package/dist/ui/use-controllable-state.d.ts +10 -0
  196. package/dist/ui/use-controllable-state.js +17 -0
  197. package/dist/ui/use-dismiss.d.ts +10 -0
  198. package/dist/ui/use-dismiss.js +51 -0
  199. package/dist/ui/use-floating.d.ts +38 -0
  200. package/dist/ui/use-floating.js +128 -0
  201. package/dist/ui/use-presence.d.ts +8 -0
  202. package/dist/ui/use-presence.js +48 -0
  203. package/package.json +6 -1
  204. package/dist/shadcn/lib/base-ui/LICENSE +0 -21
  205. package/dist/shadcn/lib/base-ui/_chunk-000kmre8.js +0 -150
  206. package/dist/shadcn/lib/base-ui/_chunk-1vw45v38.js +0 -64
  207. package/dist/shadcn/lib/base-ui/_chunk-23rx7haq.js +0 -81
  208. package/dist/shadcn/lib/base-ui/_chunk-242gh8ph.js +0 -230
  209. package/dist/shadcn/lib/base-ui/_chunk-26cc610z.js +0 -6
  210. package/dist/shadcn/lib/base-ui/_chunk-2z044bba.js +0 -5890
  211. package/dist/shadcn/lib/base-ui/_chunk-3cpd1vjz.js +0 -13
  212. package/dist/shadcn/lib/base-ui/_chunk-3enq1vat.js +0 -82
  213. package/dist/shadcn/lib/base-ui/_chunk-3xpke33f.js +0 -23
  214. package/dist/shadcn/lib/base-ui/_chunk-451nqgsa.js +0 -6
  215. package/dist/shadcn/lib/base-ui/_chunk-4maf6pas.js +0 -11
  216. package/dist/shadcn/lib/base-ui/_chunk-4zhfq4d3.js +0 -16
  217. package/dist/shadcn/lib/base-ui/_chunk-5gaqyne5.js +0 -21
  218. package/dist/shadcn/lib/base-ui/_chunk-5tt5hk59.js +0 -4
  219. package/dist/shadcn/lib/base-ui/_chunk-5tze5c8q.js +0 -13
  220. package/dist/shadcn/lib/base-ui/_chunk-5xmdvndx.js +0 -225
  221. package/dist/shadcn/lib/base-ui/_chunk-6adaer33.js +0 -435
  222. package/dist/shadcn/lib/base-ui/_chunk-6ejf1z1r.js +0 -9
  223. package/dist/shadcn/lib/base-ui/_chunk-6kqramh9.js +0 -27
  224. package/dist/shadcn/lib/base-ui/_chunk-7b9dc493.js +0 -14
  225. package/dist/shadcn/lib/base-ui/_chunk-8a9vv8am.js +0 -89
  226. package/dist/shadcn/lib/base-ui/_chunk-8ctgmf06.js +0 -129
  227. package/dist/shadcn/lib/base-ui/_chunk-8ganmsbg.js +0 -54
  228. package/dist/shadcn/lib/base-ui/_chunk-8xaqxgck.js +0 -15
  229. package/dist/shadcn/lib/base-ui/_chunk-95tf2rxq.js +0 -62
  230. package/dist/shadcn/lib/base-ui/_chunk-9x63vfqj.js +0 -70
  231. package/dist/shadcn/lib/base-ui/_chunk-ase0ydtt.js +0 -9
  232. package/dist/shadcn/lib/base-ui/_chunk-b0nc8wq7.js +0 -34
  233. package/dist/shadcn/lib/base-ui/_chunk-b5ya6xds.js +0 -10
  234. package/dist/shadcn/lib/base-ui/_chunk-b6dkjkbw.js +0 -43
  235. package/dist/shadcn/lib/base-ui/_chunk-c2bz952e.js +0 -19
  236. package/dist/shadcn/lib/base-ui/_chunk-cdgfsr3q.js +0 -15
  237. package/dist/shadcn/lib/base-ui/_chunk-cdj8cpx5.js +0 -347
  238. package/dist/shadcn/lib/base-ui/_chunk-cgptgywc.js +0 -104
  239. package/dist/shadcn/lib/base-ui/_chunk-cwvtvwc7.js +0 -35
  240. package/dist/shadcn/lib/base-ui/_chunk-dan0mva4.js +0 -23
  241. package/dist/shadcn/lib/base-ui/_chunk-dzvjwv25.js +0 -0
  242. package/dist/shadcn/lib/base-ui/_chunk-e13rsb6b.js +0 -184
  243. package/dist/shadcn/lib/base-ui/_chunk-e56mpvk1.js +0 -118
  244. package/dist/shadcn/lib/base-ui/_chunk-e6k2ecs7.js +0 -48
  245. package/dist/shadcn/lib/base-ui/_chunk-ebyxgtb4.js +0 -29
  246. package/dist/shadcn/lib/base-ui/_chunk-f2wttwrf.js +0 -39
  247. package/dist/shadcn/lib/base-ui/_chunk-fdzctasg.js +0 -38
  248. package/dist/shadcn/lib/base-ui/_chunk-ffpjy0ta.js +0 -39
  249. package/dist/shadcn/lib/base-ui/_chunk-fqry7pew.js +0 -603
  250. package/dist/shadcn/lib/base-ui/_chunk-ghn1tzt8.js +0 -84
  251. package/dist/shadcn/lib/base-ui/_chunk-gy0bpkmx.js +0 -12
  252. package/dist/shadcn/lib/base-ui/_chunk-hm5h9vsk.js +0 -16
  253. package/dist/shadcn/lib/base-ui/_chunk-htdj1jps.js +0 -833
  254. package/dist/shadcn/lib/base-ui/_chunk-j29xjete.js +0 -146
  255. package/dist/shadcn/lib/base-ui/_chunk-j3qkyd10.js +0 -50
  256. package/dist/shadcn/lib/base-ui/_chunk-ktvsd5k6.js +0 -2386
  257. package/dist/shadcn/lib/base-ui/_chunk-kw8nnq00.js +0 -546
  258. package/dist/shadcn/lib/base-ui/_chunk-m307wpdj.js +0 -18
  259. package/dist/shadcn/lib/base-ui/_chunk-mnd0j7v9.js +0 -15
  260. package/dist/shadcn/lib/base-ui/_chunk-n11h505c.js +0 -32
  261. package/dist/shadcn/lib/base-ui/_chunk-p0e2qacz.js +0 -26
  262. package/dist/shadcn/lib/base-ui/_chunk-pv7b791x.js +0 -106
  263. package/dist/shadcn/lib/base-ui/_chunk-q5cg71p7.js +0 -83
  264. package/dist/shadcn/lib/base-ui/_chunk-qbezxj1g.js +0 -385
  265. package/dist/shadcn/lib/base-ui/_chunk-qmsqz6nt.js +0 -15
  266. package/dist/shadcn/lib/base-ui/_chunk-rrh8rt4v.js +0 -65
  267. package/dist/shadcn/lib/base-ui/_chunk-s5pwkz8v.js +0 -25
  268. package/dist/shadcn/lib/base-ui/_chunk-svxv97ph.js +0 -218
  269. package/dist/shadcn/lib/base-ui/_chunk-t7ppm3t0.js +0 -68
  270. package/dist/shadcn/lib/base-ui/_chunk-vg16xxmb.js +0 -52
  271. package/dist/shadcn/lib/base-ui/_chunk-vgkfmtbe.js +0 -21
  272. package/dist/shadcn/lib/base-ui/_chunk-watha94s.js +0 -14
  273. package/dist/shadcn/lib/base-ui/_chunk-wdqynnjf.js +0 -35
  274. package/dist/shadcn/lib/base-ui/_chunk-wx2nxg0p.js +0 -15
  275. package/dist/shadcn/lib/base-ui/_chunk-x11e1k9r.js +0 -0
  276. package/dist/shadcn/lib/base-ui/_chunk-x8xehj6d.js +0 -302
  277. package/dist/shadcn/lib/base-ui/_chunk-xcqbtm2f.js +0 -28
  278. package/dist/shadcn/lib/base-ui/_chunk-ytnp24gq.js +0 -328
  279. package/dist/shadcn/lib/base-ui/_chunk-yzr7eg4b.js +0 -6
  280. package/dist/shadcn/lib/base-ui/_chunk-zk4mtm9m.js +0 -9
  281. package/dist/shadcn/lib/base-ui/accordion.d.ts +0 -447
  282. package/dist/shadcn/lib/base-ui/accordion.js +0 -630
  283. package/dist/shadcn/lib/base-ui/alert-dialog.d.ts +0 -1467
  284. package/dist/shadcn/lib/base-ui/alert-dialog.js +0 -98
  285. package/dist/shadcn/lib/base-ui/avatar.d.ts +0 -123
  286. package/dist/shadcn/lib/base-ui/avatar.js +0 -235
  287. package/dist/shadcn/lib/base-ui/button.d.ts +0 -84
  288. package/dist/shadcn/lib/base-ui/button.js +0 -51
  289. package/dist/shadcn/lib/base-ui/checkbox.d.ts +0 -341
  290. package/dist/shadcn/lib/base-ui/checkbox.js +0 -501
  291. package/dist/shadcn/lib/base-ui/collapsible.d.ts +0 -291
  292. package/dist/shadcn/lib/base-ui/collapsible.js +0 -264
  293. package/dist/shadcn/lib/base-ui/context-menu.d.ts +0 -2213
  294. package/dist/shadcn/lib/base-ui/context-menu.js +0 -323
  295. package/dist/shadcn/lib/base-ui/dialog.d.ts +0 -1448
  296. package/dist/shadcn/lib/base-ui/dialog.js +0 -79
  297. package/dist/shadcn/lib/base-ui/input.d.ts +0 -506
  298. package/dist/shadcn/lib/base-ui/input.js +0 -1027
  299. package/dist/shadcn/lib/base-ui/menu.d.ts +0 -2275
  300. package/dist/shadcn/lib/base-ui/menu.js +0 -60
  301. package/dist/shadcn/lib/base-ui/menubar.d.ts +0 -48
  302. package/dist/shadcn/lib/base-ui/menubar.js +0 -156
  303. package/dist/shadcn/lib/base-ui/merge-props.d.ts +0 -70
  304. package/dist/shadcn/lib/base-ui/merge-props.js +0 -15
  305. package/dist/shadcn/lib/base-ui/navigation-menu.d.ts +0 -825
  306. package/dist/shadcn/lib/base-ui/navigation-menu.js +0 -1849
  307. package/dist/shadcn/lib/base-ui/popover.d.ts +0 -1743
  308. package/dist/shadcn/lib/base-ui/popover.js +0 -1089
  309. package/dist/shadcn/lib/base-ui/preview-card.d.ts +0 -1608
  310. package/dist/shadcn/lib/base-ui/preview-card.js +0 -919
  311. package/dist/shadcn/lib/base-ui/progress.d.ts +0 -172
  312. package/dist/shadcn/lib/base-ui/progress.js +0 -272
  313. package/dist/shadcn/lib/base-ui/radio-group.d.ts +0 -260
  314. package/dist/shadcn/lib/base-ui/radio-group.js +0 -239
  315. package/dist/shadcn/lib/base-ui/radio.d.ts +0 -176
  316. package/dist/shadcn/lib/base-ui/radio.js +0 -387
  317. package/dist/shadcn/lib/base-ui/scroll-area.d.ts +0 -241
  318. package/dist/shadcn/lib/base-ui/scroll-area.js +0 -1055
  319. package/dist/shadcn/lib/base-ui/select.d.ts +0 -1266
  320. package/dist/shadcn/lib/base-ui/select.js +0 -2450
  321. package/dist/shadcn/lib/base-ui/separator.d.ts +0 -76
  322. package/dist/shadcn/lib/base-ui/separator.js +0 -11
  323. package/dist/shadcn/lib/base-ui/slider.d.ts +0 -551
  324. package/dist/shadcn/lib/base-ui/slider.js +0 -1583
  325. package/dist/shadcn/lib/base-ui/switch.d.ts +0 -313
  326. package/dist/shadcn/lib/base-ui/switch.js +0 -326
  327. package/dist/shadcn/lib/base-ui/tabs.d.ts +0 -406
  328. package/dist/shadcn/lib/base-ui/tabs.js +0 -915
  329. package/dist/shadcn/lib/base-ui/toggle-group.d.ts +0 -235
  330. package/dist/shadcn/lib/base-ui/toggle-group.js +0 -145
  331. package/dist/shadcn/lib/base-ui/toggle.d.ts +0 -224
  332. package/dist/shadcn/lib/base-ui/toggle.js +0 -127
  333. package/dist/shadcn/lib/base-ui/tooltip.d.ts +0 -1656
  334. package/dist/shadcn/lib/base-ui/tooltip.js +0 -920
  335. package/dist/shadcn/lib/base-ui/use-render.d.ts +0 -87
  336. package/dist/shadcn/lib/base-ui/use-render.js +0 -15
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../shadcn/lib/utils.js";
5
+ import { Slot, mergeRefs, resolveRender } from "./slot.js";
6
+ import { Portal } from "./portal.js";
7
+ import { useFloating } from "./use-floating.js";
8
+ import { useDismiss } from "./use-dismiss.js";
9
+ import { usePresence } from "./use-presence.js";
10
+ import { useControllableState } from "./use-controllable-state.js";
11
+ const PopoverContext = React.createContext(null);
12
+ function usePopover() {
13
+ const ctx = React.useContext(PopoverContext);
14
+ if (!ctx)
15
+ throw new Error("Popover parts must be used within <Popover>");
16
+ return ctx;
17
+ }
18
+ function Popover({ open, defaultOpen = false, onOpenChange, children }) {
19
+ const [isOpen, setOpen] = useControllableState({
20
+ value: open,
21
+ defaultValue: defaultOpen,
22
+ onChange: onOpenChange,
23
+ });
24
+ const triggerRef = React.useRef(null);
25
+ const contentId = React.useId();
26
+ return (_jsx(PopoverContext.Provider, { value: { open: isOpen, setOpen, triggerRef, contentId }, children: children }));
27
+ }
28
+ function PopoverTrigger({ asChild = false, render, nativeButton: _nativeButton, children, onClick, ...props }) {
29
+ const { open, setOpen, triggerRef, contentId } = usePopover();
30
+ const { useSlot, slotChild } = resolveRender(asChild, render, children);
31
+ const Comp = useSlot ? Slot : "button";
32
+ return (_jsx(Comp, { ref: triggerRef, type: useSlot ? undefined : "button", "data-slot": "popover-trigger", "aria-haspopup": "dialog", "aria-expanded": open, "aria-controls": open ? contentId : undefined, "data-state": open ? "open" : "closed", onClick: (e) => {
33
+ onClick?.(e);
34
+ if (!e.defaultPrevented)
35
+ setOpen(!open);
36
+ }, ...props, children: slotChild }));
37
+ }
38
+ function PopoverContent({ className, style, ref, align = "center", alignOffset = 0, side = "bottom", sideOffset = 4, ...props }) {
39
+ const { open, setOpen, triggerRef, contentId } = usePopover();
40
+ const [mounted, presenceRef] = usePresence(open);
41
+ const { floatingRef, pos } = useFloating(triggerRef, mounted, {
42
+ side,
43
+ align,
44
+ sideOffset,
45
+ alignOffset,
46
+ });
47
+ useDismiss(open, () => setOpen(false), [triggerRef, floatingRef]);
48
+ if (!mounted)
49
+ return null;
50
+ return (_jsx(Portal, { children: _jsx("div", { ref: mergeRefs(floatingRef, presenceRef, ref), id: contentId, role: "dialog", "data-slot": "popover-content", "data-state": open ? "open" : "closed", "data-open": open ? "" : undefined, "data-closed": open ? undefined : "", "data-side": pos?.side ?? side, style: {
51
+ ...style,
52
+ position: "fixed",
53
+ left: pos?.x ?? 0,
54
+ top: pos?.y ?? 0,
55
+ visibility: pos ? "visible" : "hidden",
56
+ ["--transform-origin"]: pos?.transformOrigin ?? "center",
57
+ }, className: cn("isolate z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props }) }));
58
+ }
59
+ function PopoverHeader({ className, ...props }) {
60
+ return (_jsx("div", { "data-slot": "popover-header", className: cn("flex flex-col gap-1 text-sm", className), ...props }));
61
+ }
62
+ function PopoverTitle({ className, ...props }) {
63
+ return (_jsx("h2", { "data-slot": "popover-title", className: cn("font-medium", className), ...props }));
64
+ }
65
+ function PopoverDescription({ className, ...props }) {
66
+ return (_jsx("p", { "data-slot": "popover-description", className: cn("text-muted-foreground", className), ...props }));
67
+ }
68
+ export { Popover, PopoverTrigger, PopoverContent, PopoverHeader, PopoverTitle, PopoverDescription, };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ /** Render children into `container` (defaults to document.body), SSR-safe. */
3
+ declare function Portal({ children, container, }: {
4
+ children: React.ReactNode;
5
+ container?: Element | null;
6
+ }): React.ReactPortal | null;
7
+ export { Portal };
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import { createPortal } from "react-dom";
4
+ /** Render children into `container` (defaults to document.body), SSR-safe. */
5
+ function Portal({ children, container, }) {
6
+ const [mounted, setMounted] = React.useState(false);
7
+ React.useEffect(() => setMounted(true), []);
8
+ if (!mounted)
9
+ return null;
10
+ return createPortal(children, container ?? document.body);
11
+ }
12
+ export { Portal };
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ export interface ProgressProps extends React.ComponentProps<"div"> {
3
+ value?: number | null;
4
+ max?: number;
5
+ }
6
+ /**
7
+ * Self-contained progress bar. Presentational only — exposes value/max via
8
+ * context so the indicator can size itself and the value label can format.
9
+ */
10
+ declare function Progress({ className, children, value, max, ...props }: ProgressProps): React.JSX.Element;
11
+ declare function ProgressTrack({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+ declare function ProgressIndicator({ className, style, ...props }: React.ComponentProps<"div">): React.JSX.Element;
13
+ declare function ProgressLabel({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
14
+ declare function ProgressValue({ className, children, ...props }: React.ComponentProps<"span">): React.JSX.Element;
15
+ export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue, };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../shadcn/lib/utils.js";
5
+ const ProgressContext = React.createContext({
6
+ value: null,
7
+ max: 100,
8
+ });
9
+ function usePercent() {
10
+ const { value, max } = React.useContext(ProgressContext);
11
+ if (value == null)
12
+ return null;
13
+ return Math.min(100, Math.max(0, (value / max) * 100));
14
+ }
15
+ /**
16
+ * Self-contained progress bar. Presentational only — exposes value/max via
17
+ * context so the indicator can size itself and the value label can format.
18
+ */
19
+ function Progress({ className, children, value = null, max = 100, ...props }) {
20
+ return (_jsx(ProgressContext.Provider, { value: { value, max }, children: _jsxs("div", { role: "progressbar", "aria-valuemin": 0, "aria-valuemax": max, "aria-valuenow": value ?? undefined, "data-slot": "progress", className: cn("flex flex-wrap gap-3", className), ...props, children: [children, _jsx(ProgressTrack, { children: _jsx(ProgressIndicator, {}) })] }) }));
21
+ }
22
+ function ProgressTrack({ className, ...props }) {
23
+ return (_jsx("div", { "data-slot": "progress-track", className: cn("relative flex h-1.5 w-full items-center overflow-x-hidden rounded-full bg-muted", className), ...props }));
24
+ }
25
+ function ProgressIndicator({ className, style, ...props }) {
26
+ const percent = usePercent();
27
+ return (_jsx("div", { "data-slot": "progress-indicator", className: cn("h-full bg-primary transition-all", className), style: { width: `${percent ?? 0}%`, ...style }, ...props }));
28
+ }
29
+ function ProgressLabel({ className, ...props }) {
30
+ return (_jsx("span", { "data-slot": "progress-label", className: cn("text-sm font-medium", className), ...props }));
31
+ }
32
+ function ProgressValue({ className, children, ...props }) {
33
+ const percent = usePercent();
34
+ return (_jsx("span", { "data-slot": "progress-value", className: cn("ml-auto text-sm text-muted-foreground tabular-nums", className), ...props, children: children ?? (percent == null ? null : `${Math.round(percent)}%`) }));
35
+ }
36
+ export { Progress, ProgressTrack, ProgressIndicator, ProgressLabel, ProgressValue, };
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ export interface RadioGroupProps extends Omit<React.ComponentProps<"div">, "onChange" | "defaultValue"> {
3
+ value?: string;
4
+ defaultValue?: string;
5
+ onValueChange?: (value: string) => void;
6
+ name?: string;
7
+ }
8
+ /**
9
+ * Self-contained radio group. Single-select with roving tab index and arrow-key
10
+ * navigation that moves focus and selection together (WAI-ARIA radiogroup).
11
+ */
12
+ declare function RadioGroup({ className, value, defaultValue, onValueChange, name, onKeyDown, ...props }: RadioGroupProps): React.JSX.Element;
13
+ export interface RadioGroupItemProps extends Omit<React.ComponentProps<"button">, "value"> {
14
+ value: string;
15
+ }
16
+ declare function RadioGroupItem({ className, value, onClick, disabled, ...props }: RadioGroupItemProps): React.JSX.Element;
17
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../shadcn/lib/utils.js";
5
+ import { useControllableState } from "./use-controllable-state.js";
6
+ const RadioGroupContext = React.createContext(null);
7
+ function useRadioGroup() {
8
+ const ctx = React.useContext(RadioGroupContext);
9
+ if (!ctx)
10
+ throw new Error("RadioGroupItem must be used within <RadioGroup>");
11
+ return ctx;
12
+ }
13
+ /**
14
+ * Self-contained radio group. Single-select with roving tab index and arrow-key
15
+ * navigation that moves focus and selection together (WAI-ARIA radiogroup).
16
+ */
17
+ function RadioGroup({ className, value, defaultValue, onValueChange, name, onKeyDown, ...props }) {
18
+ const [selected, setSelected] = useControllableState({
19
+ value,
20
+ defaultValue,
21
+ onChange: onValueChange,
22
+ });
23
+ return (_jsxs(RadioGroupContext.Provider, { value: { value: selected, setValue: setSelected, name }, children: [_jsx("div", { role: "radiogroup", "data-slot": "radio-group", className: cn("grid w-full gap-3", className), onKeyDown: (e) => {
24
+ onKeyDown?.(e);
25
+ if (e.defaultPrevented)
26
+ return;
27
+ if (!["ArrowDown", "ArrowRight", "ArrowUp", "ArrowLeft"].includes(e.key))
28
+ return;
29
+ const radios = Array.from(e.currentTarget.querySelectorAll('[role="radio"]:not([disabled]):not([data-disabled])'));
30
+ const current = radios.indexOf(document.activeElement);
31
+ if (current < 0)
32
+ return;
33
+ e.preventDefault();
34
+ const forward = e.key === "ArrowDown" || e.key === "ArrowRight";
35
+ const next = forward
36
+ ? (current + 1) % radios.length
37
+ : (current - 1 + radios.length) % radios.length;
38
+ radios[next].focus();
39
+ radios[next].click();
40
+ }, ...props }), name ? (_jsx("input", { type: "hidden", name: name, value: selected ?? "" })) : null] }));
41
+ }
42
+ function RadioGroupItem({ className, value, onClick, disabled, ...props }) {
43
+ const { value: selected, setValue } = useRadioGroup();
44
+ const checked = selected === value;
45
+ // Roving tab index: the checked radio is tabbable; if none checked, the first
46
+ // item is reachable (handled by Base UI semantics via tabIndex below).
47
+ const tabbable = checked || selected === undefined;
48
+ return (_jsx("button", { type: "button", role: "radio", "aria-checked": checked, disabled: disabled, tabIndex: tabbable ? 0 : -1, "data-slot": "radio-group-item", "data-state": checked ? "checked" : "unchecked", "data-checked": checked ? "" : undefined, className: cn("cursor-pointer group/radio-group-item peer relative flex aspect-square size-4 shrink-0 items-center justify-center rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className), onClick: (e) => {
49
+ onClick?.(e);
50
+ if (!e.defaultPrevented)
51
+ setValue(value);
52
+ }, ...props, children: checked ? (_jsx("span", { "data-slot": "radio-group-indicator", className: "size-2 rounded-full bg-primary-foreground" })) : null }));
53
+ }
54
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Self-contained scroll area: a native-overflow viewport with the platform
4
+ * scrollbar hidden, plus a custom thumb synced to scroll position and draggable.
5
+ * Vertical and horizontal bars appear only when their axis overflows.
6
+ */
7
+ declare function ScrollArea({ className, children, ...props }: React.ComponentProps<"div">): React.JSX.Element;
8
+ declare function ScrollBar(_props: React.ComponentProps<"div">): null;
9
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../shadcn/lib/utils.js";
5
+ /**
6
+ * Self-contained scroll area: a native-overflow viewport with the platform
7
+ * scrollbar hidden, plus a custom thumb synced to scroll position and draggable.
8
+ * Vertical and horizontal bars appear only when their axis overflows.
9
+ */
10
+ function ScrollArea({ className, children, ...props }) {
11
+ const viewportRef = React.useRef(null);
12
+ const [thumb, setThumb] = React.useState({
13
+ vSize: 0,
14
+ vPos: 0,
15
+ hSize: 0,
16
+ hPos: 0,
17
+ });
18
+ const sync = React.useCallback(() => {
19
+ const vp = viewportRef.current;
20
+ if (!vp)
21
+ return;
22
+ const { scrollTop, scrollHeight, clientHeight, scrollLeft, scrollWidth, clientWidth } = vp;
23
+ setThumb({
24
+ vSize: scrollHeight > clientHeight ? (clientHeight / scrollHeight) * 100 : 0,
25
+ vPos: scrollHeight > clientHeight ? (scrollTop / scrollHeight) * 100 : 0,
26
+ hSize: scrollWidth > clientWidth ? (clientWidth / scrollWidth) * 100 : 0,
27
+ hPos: scrollWidth > clientWidth ? (scrollLeft / scrollWidth) * 100 : 0,
28
+ });
29
+ }, []);
30
+ React.useLayoutEffect(() => {
31
+ sync();
32
+ const vp = viewportRef.current;
33
+ if (!vp)
34
+ return;
35
+ const ro = new ResizeObserver(sync);
36
+ ro.observe(vp);
37
+ for (const child of Array.from(vp.children))
38
+ ro.observe(child);
39
+ return () => ro.disconnect();
40
+ }, [sync]);
41
+ const dragBar = (axis) => (e) => {
42
+ const vp = viewportRef.current;
43
+ if (!vp)
44
+ return;
45
+ const startPos = axis === "v" ? e.clientY : e.clientX;
46
+ const startScroll = axis === "v" ? vp.scrollTop : vp.scrollLeft;
47
+ const track = e.currentTarget;
48
+ const trackLen = axis === "v" ? track.clientHeight : track.clientWidth;
49
+ const scrollLen = axis === "v" ? vp.scrollHeight : vp.scrollWidth;
50
+ track.setPointerCapture(e.pointerId);
51
+ const onMove = (ev) => {
52
+ const delta = (axis === "v" ? ev.clientY : ev.clientX) - startPos;
53
+ const next = startScroll + (delta / trackLen) * scrollLen;
54
+ if (axis === "v")
55
+ vp.scrollTop = next;
56
+ else
57
+ vp.scrollLeft = next;
58
+ };
59
+ const onUp = (ev) => {
60
+ track.releasePointerCapture(ev.pointerId);
61
+ track.removeEventListener("pointermove", onMove);
62
+ track.removeEventListener("pointerup", onUp);
63
+ };
64
+ track.addEventListener("pointermove", onMove);
65
+ track.addEventListener("pointerup", onUp);
66
+ };
67
+ return (_jsxs("div", { "data-slot": "scroll-area", className: cn("relative overflow-hidden", className), ...props, children: [_jsx("div", { ref: viewportRef, "data-slot": "scroll-area-viewport", onScroll: sync, className: "size-full overflow-auto rounded-[inherit] outline-none [-ms-overflow-style:none] [scrollbar-width:none] focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 [&::-webkit-scrollbar]:hidden", children: children }), thumb.vSize > 0 && (_jsx("div", { "data-slot": "scroll-area-scrollbar", "data-orientation": "vertical", onPointerDown: dragBar("v"), className: "absolute top-0 right-0 bottom-0 w-2.5 touch-none p-px select-none", children: _jsx("div", { "data-slot": "scroll-area-thumb", className: "absolute inset-x-px rounded-full bg-border", style: { height: `${thumb.vSize}%`, top: `${thumb.vPos}%` } }) })), thumb.hSize > 0 && (_jsx("div", { "data-slot": "scroll-area-scrollbar", "data-orientation": "horizontal", onPointerDown: dragBar("h"), className: "absolute right-0 bottom-0 left-0 h-2.5 touch-none p-px select-none", children: _jsx("div", { "data-slot": "scroll-area-thumb", className: "absolute inset-y-px rounded-full bg-border", style: { width: `${thumb.hSize}%`, left: `${thumb.hPos}%` } }) }))] }));
68
+ }
69
+ function ScrollBar(_props) {
70
+ return null;
71
+ }
72
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ import { type Side, type Align } from "./use-floating.js";
3
+ export interface SelectProps {
4
+ value?: string;
5
+ defaultValue?: string;
6
+ onValueChange?: (value: string) => void;
7
+ open?: boolean;
8
+ defaultOpen?: boolean;
9
+ onOpenChange?: (open: boolean) => void;
10
+ children?: React.ReactNode;
11
+ }
12
+ declare function Select({ value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, children, }: SelectProps): React.JSX.Element;
13
+ declare function SelectGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
14
+ declare function SelectValue({ className, placeholder, ...props }: React.ComponentProps<"span"> & {
15
+ placeholder?: React.ReactNode;
16
+ }): React.JSX.Element;
17
+ declare function SelectTrigger({ className, size, children, onClick, onKeyDown, ...props }: React.ComponentProps<"button"> & {
18
+ size?: "sm" | "default";
19
+ }): React.JSX.Element;
20
+ export interface SelectContentProps extends React.ComponentProps<"div"> {
21
+ side?: Side;
22
+ align?: Align;
23
+ sideOffset?: number;
24
+ alignOffset?: number;
25
+ }
26
+ declare function SelectContent({ className, children, side, sideOffset, align, alignOffset, onKeyDown, ...props }: SelectContentProps): React.JSX.Element;
27
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
28
+ export interface SelectItemProps extends Omit<React.ComponentProps<"div">, "value"> {
29
+ value: string;
30
+ disabled?: boolean;
31
+ }
32
+ declare function SelectItem({ className, children, value, disabled, onClick, ...props }: SelectItemProps): React.JSX.Element;
33
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
34
+ /** No-op scroll buttons — native overflow handles scrolling. Kept for API parity. */
35
+ declare function SelectScrollUpButton(_props: React.ComponentProps<"div">): null;
36
+ declare function SelectScrollDownButton(_props: React.ComponentProps<"div">): null;
37
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
@@ -0,0 +1,216 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../shadcn/lib/utils.js";
5
+ import { mergeRefs } from "./slot.js";
6
+ import { Portal } from "./portal.js";
7
+ import { useFloating } from "./use-floating.js";
8
+ import { usePresence } from "./use-presence.js";
9
+ import { useControllableState } from "./use-controllable-state.js";
10
+ import { ChevronDownIcon, CheckIcon } from "../icons/index.js";
11
+ const SelectContext = React.createContext(null);
12
+ function useSelect() {
13
+ const ctx = React.useContext(SelectContext);
14
+ if (!ctx)
15
+ throw new Error("Select parts must be used within <Select>");
16
+ return ctx;
17
+ }
18
+ function Select({ value, defaultValue, onValueChange, open, defaultOpen = false, onOpenChange, children, }) {
19
+ const [selected, setSelected] = useControllableState({
20
+ value,
21
+ defaultValue,
22
+ onChange: onValueChange,
23
+ });
24
+ const [isOpen, setOpen] = useControllableState({
25
+ value: open,
26
+ defaultValue: defaultOpen,
27
+ onChange: onOpenChange,
28
+ });
29
+ const triggerRef = React.useRef(null);
30
+ const contentId = React.useId();
31
+ const [labels, setLabels] = React.useState({});
32
+ const registerLabel = React.useCallback((v, label) => setLabels((prev) => ({ ...prev, [v]: label })), []);
33
+ const unregisterLabel = React.useCallback((v) => setLabels((prev) => {
34
+ const { [v]: _, ...rest } = prev;
35
+ return rest;
36
+ }), []);
37
+ const setValue = React.useCallback((v) => {
38
+ setSelected(v);
39
+ setOpen(false);
40
+ triggerRef.current?.focus();
41
+ }, [setSelected, setOpen]);
42
+ return (_jsx(SelectContext.Provider, { value: {
43
+ open: isOpen,
44
+ setOpen,
45
+ value: selected,
46
+ setValue,
47
+ triggerRef,
48
+ contentId,
49
+ labels,
50
+ registerLabel,
51
+ unregisterLabel,
52
+ }, children: children }));
53
+ }
54
+ function SelectGroup({ className, ...props }) {
55
+ return (_jsx("div", { role: "group", "data-slot": "select-group", className: cn("scroll-my-1 p-1", className), ...props }));
56
+ }
57
+ function SelectValue({ className, placeholder, ...props }) {
58
+ const { value, labels } = useSelect();
59
+ const label = value !== undefined ? labels[value] : undefined;
60
+ return (_jsx("span", { "data-slot": "select-value", "data-placeholder": value === undefined ? "" : undefined, className: cn("flex flex-1 text-left", className), ...props, children: label ?? placeholder ?? null }));
61
+ }
62
+ function SelectTrigger({ className, size = "default", children, onClick, onKeyDown, ...props }) {
63
+ const { open, setOpen, value, triggerRef, contentId } = useSelect();
64
+ return (_jsxs("button", { ref: triggerRef, type: "button", role: "combobox", "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? contentId : undefined, "data-slot": "select-trigger", "data-size": size, "data-state": open ? "open" : "closed", "data-placeholder": value === undefined ? "" : undefined, className: cn("flex w-fit cursor-pointer items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), onClick: (e) => {
65
+ onClick?.(e);
66
+ if (!e.defaultPrevented)
67
+ setOpen(!open);
68
+ }, onKeyDown: (e) => {
69
+ onKeyDown?.(e);
70
+ if (e.defaultPrevented)
71
+ return;
72
+ if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
73
+ e.preventDefault();
74
+ setOpen(true);
75
+ }
76
+ }, ...props, children: [children, _jsx(ChevronDownIcon, {})] }));
77
+ }
78
+ function optionsOf(container) {
79
+ return Array.from(container.querySelectorAll('[role="option"]:not([data-disabled])'));
80
+ }
81
+ function SelectContent({ className, children, side = "bottom", sideOffset = 4, align = "center", alignOffset = 0, onKeyDown, ...props }) {
82
+ const { open, setOpen, value, triggerRef, contentId } = useSelect();
83
+ const [mounted, presenceRef] = usePresence(open);
84
+ const { floatingRef, pos } = useFloating(triggerRef, mounted, {
85
+ side,
86
+ align,
87
+ sideOffset,
88
+ alignOffset,
89
+ });
90
+ const containerRef = React.useRef(null);
91
+ // Focus the selected (or first) option once the popup is actually visible.
92
+ const didFocus = React.useRef(false);
93
+ React.useEffect(() => {
94
+ if (!open) {
95
+ didFocus.current = false;
96
+ return;
97
+ }
98
+ let raf = 0;
99
+ const tryFocus = () => {
100
+ const c = containerRef.current;
101
+ if (c && getComputedStyle(c).visibility !== "hidden") {
102
+ didFocus.current = true;
103
+ const opts = optionsOf(c);
104
+ const selected = opts.find((o) => o.getAttribute("data-value") === value);
105
+ (selected ?? opts[0])?.focus();
106
+ }
107
+ else if (!didFocus.current) {
108
+ raf = requestAnimationFrame(tryFocus);
109
+ }
110
+ };
111
+ raf = requestAnimationFrame(tryFocus);
112
+ return () => cancelAnimationFrame(raf);
113
+ }, [open, value]);
114
+ React.useEffect(() => {
115
+ if (!open)
116
+ return;
117
+ const onPointerDown = (e) => {
118
+ const t = e.target;
119
+ if (triggerRef.current?.contains(t))
120
+ return;
121
+ if (containerRef.current?.contains(t))
122
+ return;
123
+ setOpen(false);
124
+ };
125
+ document.addEventListener("pointerdown", onPointerDown, true);
126
+ return () => {
127
+ document.removeEventListener("pointerdown", onPointerDown, true);
128
+ };
129
+ }, [open, setOpen, triggerRef]);
130
+ // While closed, render the items into a hidden tree so their value→label
131
+ // mappings register — this lets SelectValue show the selected label on initial
132
+ // render, before the listbox has ever been opened.
133
+ if (!mounted) {
134
+ return (_jsx("div", { hidden: true, "aria-hidden": true, "data-slot": "select-content-registry", children: children }));
135
+ }
136
+ const triggerWidth = triggerRef.current?.offsetWidth;
137
+ return (_jsx(Portal, { children: _jsx("div", { ref: mergeRefs(floatingRef, presenceRef, containerRef), id: contentId, role: "listbox", tabIndex: -1, "data-slot": "select-content", "data-state": open ? "open" : "closed", "data-open": open ? "" : undefined, "data-closed": open ? undefined : "", "data-side": pos?.side ?? side, style: {
138
+ position: "fixed",
139
+ left: pos?.x ?? 0,
140
+ top: pos?.y ?? 0,
141
+ minWidth: triggerWidth,
142
+ visibility: pos ? "visible" : "hidden",
143
+ ["--transform-origin"]: pos?.transformOrigin ?? "center",
144
+ }, onPointerMove: (e) => {
145
+ const opt = e.target.closest('[role="option"]:not([data-disabled])');
146
+ if (opt && opt !== document.activeElement)
147
+ opt.focus();
148
+ }, onKeyDown: (e) => {
149
+ onKeyDown?.(e);
150
+ if (e.defaultPrevented)
151
+ return;
152
+ const c = containerRef.current;
153
+ const opts = optionsOf(c);
154
+ const idx = opts.indexOf(document.activeElement);
155
+ if (e.key === "ArrowDown") {
156
+ e.preventDefault();
157
+ opts[idx < 0 ? 0 : (idx + 1) % opts.length]?.focus();
158
+ }
159
+ else if (e.key === "ArrowUp") {
160
+ e.preventDefault();
161
+ opts[idx < 0 ? opts.length - 1 : (idx - 1 + opts.length) % opts.length]?.focus();
162
+ }
163
+ else if (e.key === "Home") {
164
+ e.preventDefault();
165
+ opts[0]?.focus();
166
+ }
167
+ else if (e.key === "End") {
168
+ e.preventDefault();
169
+ opts[opts.length - 1]?.focus();
170
+ }
171
+ else if (e.key === "Escape") {
172
+ e.preventDefault();
173
+ setOpen(false);
174
+ triggerRef.current?.focus();
175
+ }
176
+ else if (e.key === "Enter" || e.key === " ") {
177
+ const active = document.activeElement;
178
+ if (active && c.contains(active) && active.getAttribute("role") === "option") {
179
+ e.preventDefault();
180
+ active.click();
181
+ }
182
+ }
183
+ }, className: cn("relative isolate z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: children }) }));
184
+ }
185
+ function SelectLabel({ className, ...props }) {
186
+ return (_jsx("div", { "data-slot": "select-label", className: cn("px-2 py-1.5 text-xs text-muted-foreground", className), ...props }));
187
+ }
188
+ function SelectItem({ className, children, value, disabled, onClick, ...props }) {
189
+ const ctx = useSelect();
190
+ const selected = ctx.value === value;
191
+ // Register the value→label mapping. Kept sticky (no unregister on unmount) so
192
+ // SelectValue can still render the selected label after the list closes and
193
+ // its items unmount.
194
+ const { registerLabel } = ctx;
195
+ React.useEffect(() => {
196
+ registerLabel(value, children);
197
+ }, [value, children, registerLabel]);
198
+ return (_jsxs("div", { role: "option", tabIndex: -1, "aria-selected": selected, "aria-disabled": disabled || undefined, "data-slot": "select-item", "data-value": value, "data-disabled": disabled ? "" : undefined, className: cn("relative flex w-full cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), onClick: (e) => {
199
+ if (disabled)
200
+ return;
201
+ onClick?.(e);
202
+ if (!e.defaultPrevented)
203
+ ctx.setValue(value);
204
+ }, ...props, children: [_jsx("span", { className: "flex flex-1 shrink-0 items-center gap-2 whitespace-nowrap", children: children }), selected ? (_jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center", children: _jsx(CheckIcon, {}) })) : null] }));
205
+ }
206
+ function SelectSeparator({ className, ...props }) {
207
+ return (_jsx("div", { role: "separator", "data-slot": "select-separator", className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className), ...props }));
208
+ }
209
+ /** No-op scroll buttons — native overflow handles scrolling. Kept for API parity. */
210
+ function SelectScrollUpButton(_props) {
211
+ return null;
212
+ }
213
+ function SelectScrollDownButton(_props) {
214
+ return null;
215
+ }
216
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ export interface SeparatorProps extends React.ComponentProps<"div"> {
3
+ orientation?: "horizontal" | "vertical";
4
+ /** Set true for a purely-visual divider hidden from a11y. Defaults to false
5
+ * so the separator keeps `role="separator"` semantics (matches the spec). */
6
+ decorative?: boolean;
7
+ }
8
+ /**
9
+ * Self-contained separator: a styled `<div>` with the correct ARIA role and
10
+ * orientation. No primitive framework, no `data-orientation` style bridge —
11
+ * orientation classes are applied directly.
12
+ */
13
+ declare function Separator({ className, orientation, decorative, ...props }: SeparatorProps): React.JSX.Element;
14
+ export { Separator };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../shadcn/lib/utils.js";
5
+ /**
6
+ * Self-contained separator: a styled `<div>` with the correct ARIA role and
7
+ * orientation. No primitive framework, no `data-orientation` style bridge —
8
+ * orientation classes are applied directly.
9
+ */
10
+ function Separator({ className, orientation = "horizontal", decorative = false, ...props }) {
11
+ return (_jsx("div", { "data-slot": "separator", "data-orientation": orientation, role: decorative ? "none" : "separator", "aria-orientation": decorative ? undefined : orientation, className: cn("shrink-0 bg-border", orientation === "horizontal" ? "h-px w-full" : "w-px self-stretch", className), ...props }));
12
+ }
13
+ export { Separator };
@@ -0,0 +1,31 @@
1
+ import * as React from "react";
2
+ type SheetSide = "top" | "right" | "bottom" | "left";
3
+ export interface SheetProps {
4
+ open?: boolean;
5
+ defaultOpen?: boolean;
6
+ onOpenChange?: (open: boolean) => void;
7
+ children?: React.ReactNode;
8
+ }
9
+ /** Self-contained sheet (drawer) on native `<dialog>`, sliding in from an edge.
10
+ * Exit slide is preserved via {@link usePresence} before `dialog.close()`. */
11
+ declare function Sheet({ open, defaultOpen, onOpenChange, children }: SheetProps): React.JSX.Element;
12
+ declare function SheetTrigger({ asChild, render, nativeButton: _nativeButton, children, onClick, ...props }: React.ComponentProps<"button"> & {
13
+ asChild?: boolean;
14
+ render?: React.ReactElement;
15
+ nativeButton?: boolean;
16
+ }): React.JSX.Element;
17
+ declare function SheetClose({ asChild, render, nativeButton: _nativeButton, children, onClick, ...props }: React.ComponentProps<"button"> & {
18
+ asChild?: boolean;
19
+ render?: React.ReactElement;
20
+ nativeButton?: boolean;
21
+ }): React.JSX.Element;
22
+ export interface SheetContentProps extends React.ComponentProps<"dialog"> {
23
+ side?: SheetSide;
24
+ showCloseButton?: boolean;
25
+ }
26
+ declare function SheetContent({ className, children, side, showCloseButton, ...props }: SheetContentProps): React.JSX.Element | null;
27
+ declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
28
+ declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
29
+ declare function SheetTitle({ className, ...props }: React.ComponentProps<"h2">): React.JSX.Element;
30
+ declare function SheetDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
31
+ export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };