@42-central/ui-react 0.17.1 → 0.18.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 (311) hide show
  1. package/dist/{chunk-FD6P6PLQ.js → chunk-5JHDSVEZ.js} +3 -3
  2. package/dist/{chunk-FD6P6PLQ.js.map → chunk-5JHDSVEZ.js.map} +1 -1
  3. package/dist/{chunk-QMW7D5GU.js → chunk-5OQLFX47.js} +4 -3
  4. package/dist/chunk-5OQLFX47.js.map +1 -0
  5. package/dist/{chunk-VZ2TPU4B.js → chunk-6GDMSENK.js} +3 -2
  6. package/dist/chunk-6GDMSENK.js.map +1 -0
  7. package/dist/{chunk-TNNH3FVQ.js → chunk-6OLTJYSX.js} +24 -8
  8. package/dist/chunk-6OLTJYSX.js.map +1 -0
  9. package/dist/{chunk-POKDSVQT.js → chunk-AE7QTLJ5.js} +5 -4
  10. package/dist/chunk-AE7QTLJ5.js.map +1 -0
  11. package/dist/{chunk-44OV3PNH.js → chunk-B2YJKRNQ.js} +3 -3
  12. package/dist/{chunk-44OV3PNH.js.map → chunk-B2YJKRNQ.js.map} +1 -1
  13. package/dist/{chunk-YIQI2CF3.js → chunk-CTSO6V72.js} +3 -2
  14. package/dist/chunk-CTSO6V72.js.map +1 -0
  15. package/dist/{chunk-EVVMHTCL.js → chunk-EBREIC3L.js} +4 -3
  16. package/dist/chunk-EBREIC3L.js.map +1 -0
  17. package/dist/{chunk-UNSAA7YG.js → chunk-FHG54IT5.js} +3 -2
  18. package/dist/chunk-FHG54IT5.js.map +1 -0
  19. package/dist/{chunk-3GYOIQW7.js → chunk-FZIHZT5R.js} +5 -5
  20. package/dist/{chunk-3GYOIQW7.js.map → chunk-FZIHZT5R.js.map} +1 -1
  21. package/dist/{chunk-2H46IXW4.js → chunk-HAQJQFE6.js} +28 -8
  22. package/dist/chunk-HAQJQFE6.js.map +1 -0
  23. package/dist/{chunk-IHYFYMHJ.js → chunk-HT5JAHR3.js} +6 -6
  24. package/dist/{chunk-IHYFYMHJ.js.map → chunk-HT5JAHR3.js.map} +1 -1
  25. package/dist/chunk-I4SQQIP5.js +12 -0
  26. package/dist/chunk-I4SQQIP5.js.map +1 -0
  27. package/dist/{chunk-J3PELDH3.js → chunk-JITF6I7N.js} +22 -6
  28. package/dist/chunk-JITF6I7N.js.map +1 -0
  29. package/dist/{chunk-IFWCCAQV.js → chunk-KHMFNH3X.js} +3 -2
  30. package/dist/chunk-KHMFNH3X.js.map +1 -0
  31. package/dist/{chunk-SIG4DMNZ.js → chunk-MI2WZRK3.js} +4 -4
  32. package/dist/{chunk-SIG4DMNZ.js.map → chunk-MI2WZRK3.js.map} +1 -1
  33. package/dist/{chunk-YON5Y336.js → chunk-O23Y5ML4.js} +8 -8
  34. package/dist/{chunk-YON5Y336.js.map → chunk-O23Y5ML4.js.map} +1 -1
  35. package/dist/{chunk-P7A3BCAC.js → chunk-OWG4BCQR.js} +3 -3
  36. package/dist/{chunk-P7A3BCAC.js.map → chunk-OWG4BCQR.js.map} +1 -1
  37. package/dist/{chunk-FUWSTUDM.js → chunk-PH354ECN.js} +4 -4
  38. package/dist/{chunk-FUWSTUDM.js.map → chunk-PH354ECN.js.map} +1 -1
  39. package/dist/{chunk-U5GW5EBR.js → chunk-RAUOFTUH.js} +12 -20
  40. package/dist/chunk-RAUOFTUH.js.map +1 -0
  41. package/dist/{chunk-2762HZYX.js → chunk-S2HWWR2H.js} +47 -25
  42. package/dist/chunk-S2HWWR2H.js.map +1 -0
  43. package/dist/{chunk-VLUKI3HL.js → chunk-S7N4LGLZ.js} +6 -13
  44. package/dist/chunk-S7N4LGLZ.js.map +1 -0
  45. package/dist/{chunk-NSOA3GMZ.js → chunk-UHNRAI6V.js} +3 -3
  46. package/dist/{chunk-NSOA3GMZ.js.map → chunk-UHNRAI6V.js.map} +1 -1
  47. package/dist/{chunk-3NZXWCGF.js → chunk-WHKKN3ZK.js} +6 -6
  48. package/dist/{chunk-3NZXWCGF.js.map → chunk-WHKKN3ZK.js.map} +1 -1
  49. package/dist/{chunk-MOI7B3KH.js → chunk-WQN64ZHG.js} +5 -5
  50. package/dist/{chunk-MOI7B3KH.js.map → chunk-WQN64ZHG.js.map} +1 -1
  51. package/dist/chunk-WSIVRDRB.js +34 -0
  52. package/dist/chunk-WSIVRDRB.js.map +1 -0
  53. package/dist/{chunk-6SWK4XG5.js → chunk-YXE4B6X3.js} +2 -2
  54. package/dist/chunk-YXE4B6X3.js.map +1 -0
  55. package/dist/{chunk-NGAQITWP.js → chunk-Z2Z5EXVT.js} +10 -7
  56. package/dist/chunk-Z2Z5EXVT.js.map +1 -0
  57. package/dist/{chunk-IXKELBJA.js → chunk-ZDXQ64A7.js} +63 -44
  58. package/dist/chunk-ZDXQ64A7.js.map +1 -0
  59. package/dist/components/accordion/accordion-data.d.ts +3 -2
  60. package/dist/components/accordion/accordion-data.d.ts.map +1 -1
  61. package/dist/components/accordion/accordion.d.ts +2 -2
  62. package/dist/components/accordion/accordion.d.ts.map +1 -1
  63. package/dist/components/accordion/index.js +20 -8
  64. package/dist/components/accordion/index.js.map +1 -1
  65. package/dist/components/action-icon/action-icon.d.ts +3 -4
  66. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  67. package/dist/components/action-icon/index.js +2 -1
  68. package/dist/components/alert/alert.d.ts +1 -1
  69. package/dist/components/alert/alert.d.ts.map +1 -1
  70. package/dist/components/alert/index.js +16 -4
  71. package/dist/components/alert/index.js.map +1 -1
  72. package/dist/components/app-shell/app-shell.d.ts +3 -2
  73. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  74. package/dist/components/app-shell/index.js +4 -2
  75. package/dist/components/app-shell/index.js.map +1 -1
  76. package/dist/components/autocomplete/index.js +5 -4
  77. package/dist/components/autocomplete/index.js.map +1 -1
  78. package/dist/components/breadcrumb/breadcrumb.d.ts +3 -2
  79. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
  80. package/dist/components/breadcrumb/index.js +11 -5
  81. package/dist/components/breadcrumb/index.js.map +1 -1
  82. package/dist/components/button/button.d.ts +4 -4
  83. package/dist/components/button/button.d.ts.map +1 -1
  84. package/dist/components/button/index.js +2 -1
  85. package/dist/components/button-multi-select/index.js +4 -3
  86. package/dist/components/button-multi-select/index.js.map +1 -1
  87. package/dist/components/button-select/index.js +4 -3
  88. package/dist/components/button-select/index.js.map +1 -1
  89. package/dist/components/calendar/index.js +3 -2
  90. package/dist/components/checkbox/index.js +2 -2
  91. package/dist/components/choice-card-group/index.js +1 -1
  92. package/dist/components/circular-progress/circular-progress.d.ts +3 -2
  93. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  94. package/dist/components/circular-progress/index.js +1 -0
  95. package/dist/components/circular-progress/index.js.map +1 -1
  96. package/dist/components/clipboard/clipboard.d.ts +1 -1
  97. package/dist/components/clipboard/clipboard.d.ts.map +1 -1
  98. package/dist/components/clipboard/index.js +9 -5
  99. package/dist/components/clipboard/index.js.map +1 -1
  100. package/dist/components/code-block/chrome.d.ts +4 -1
  101. package/dist/components/code-block/chrome.d.ts.map +1 -1
  102. package/dist/components/code-block/chrome.js +5 -4
  103. package/dist/components/code-block/code-block.d.ts +7 -1
  104. package/dist/components/code-block/code-block.d.ts.map +1 -1
  105. package/dist/components/code-block/index.d.ts +1 -1
  106. package/dist/components/code-block/index.js +12 -10
  107. package/dist/components/code-block/index.js.map +1 -1
  108. package/dist/components/code-block/notation.d.ts +5 -2
  109. package/dist/components/code-block/notation.d.ts.map +1 -1
  110. package/dist/components/code-block/static.d.ts +4 -1
  111. package/dist/components/code-block/static.d.ts.map +1 -1
  112. package/dist/components/code-block/static.js +5 -4
  113. package/dist/components/code-block/static.js.map +1 -1
  114. package/dist/components/collapse/collapse.d.ts +7 -3
  115. package/dist/components/collapse/collapse.d.ts.map +1 -1
  116. package/dist/components/collapse/index.js +2 -1
  117. package/dist/components/combobox/combobox.d.ts +11 -10
  118. package/dist/components/combobox/combobox.d.ts.map +1 -1
  119. package/dist/components/combobox/index.js +5 -4
  120. package/dist/components/combobox-list/index.js +6 -5
  121. package/dist/components/data-table/index.js +20 -19
  122. package/dist/components/data-table/index.js.map +1 -1
  123. package/dist/components/date-picker/index.js +12 -11
  124. package/dist/components/date-picker/index.js.map +1 -1
  125. package/dist/components/divider/divider.d.ts +3 -2
  126. package/dist/components/divider/divider.d.ts.map +1 -1
  127. package/dist/components/divider/index.js +1 -1
  128. package/dist/components/drawer/drawer.d.ts +6 -5
  129. package/dist/components/drawer/drawer.d.ts.map +1 -1
  130. package/dist/components/drawer/index.js +3 -2
  131. package/dist/components/field/field.d.ts +7 -4
  132. package/dist/components/field/field.d.ts.map +1 -1
  133. package/dist/components/field/index.js +1 -1
  134. package/dist/components/file-upload/index.js +3 -2
  135. package/dist/components/file-upload/index.js.map +1 -1
  136. package/dist/components/hover-card/index.js +1 -1
  137. package/dist/components/input/index.js +2 -2
  138. package/dist/components/input/input.d.ts +3 -2
  139. package/dist/components/input/input.d.ts.map +1 -1
  140. package/dist/components/menu/index.js +3 -2
  141. package/dist/components/menu/index.js.map +1 -1
  142. package/dist/components/menu/menu-data.d.ts +6 -1
  143. package/dist/components/menu/menu-data.d.ts.map +1 -1
  144. package/dist/components/menu/menu.d.ts +5 -5
  145. package/dist/components/menu/menu.d.ts.map +1 -1
  146. package/dist/components/modal/index.js +3 -2
  147. package/dist/components/modal/modal.d.ts +4 -3
  148. package/dist/components/modal/modal.d.ts.map +1 -1
  149. package/dist/components/multi-combobox-list/index.js +6 -5
  150. package/dist/components/multi-select/index.js +7 -6
  151. package/dist/components/multi-select/index.js.map +1 -1
  152. package/dist/components/nav-link/index.js +3 -2
  153. package/dist/components/nav-link/tanstack.js +3 -2
  154. package/dist/components/nav-link/tanstack.js.map +1 -1
  155. package/dist/components/notification/index.js +4 -3
  156. package/dist/components/notification/index.js.map +1 -1
  157. package/dist/components/notification/notification.d.ts +3 -2
  158. package/dist/components/notification/notification.d.ts.map +1 -1
  159. package/dist/components/number-input/index.js +4 -4
  160. package/dist/components/overlays/index.js +5 -4
  161. package/dist/components/overlays/index.js.map +1 -1
  162. package/dist/components/password-input/index.js +2 -2
  163. package/dist/components/pill/index.js +2 -1
  164. package/dist/components/pill/pill.d.ts +4 -2
  165. package/dist/components/pill/pill.d.ts.map +1 -1
  166. package/dist/components/pills-input/index.js +5 -4
  167. package/dist/components/pills-input/pills-input.d.ts +3 -2
  168. package/dist/components/pills-input/pills-input.d.ts.map +1 -1
  169. package/dist/components/pin-input/index.js +2 -2
  170. package/dist/components/popover/index.js +1 -1
  171. package/dist/components/popover/popover.d.ts +3 -2
  172. package/dist/components/popover/popover.d.ts.map +1 -1
  173. package/dist/components/progress/index.js +1 -0
  174. package/dist/components/progress/index.js.map +1 -1
  175. package/dist/components/progress/progress.d.ts +3 -2
  176. package/dist/components/progress/progress.d.ts.map +1 -1
  177. package/dist/components/radio-group/index.js +1 -1
  178. package/dist/components/rating/index.js +2 -1
  179. package/dist/components/rating/index.js.map +1 -1
  180. package/dist/components/rating/rating.d.ts +3 -2
  181. package/dist/components/rating/rating.d.ts.map +1 -1
  182. package/dist/components/schedule/index.d.ts +2 -2
  183. package/dist/components/schedule/index.js +50 -23
  184. package/dist/components/schedule/index.js.map +1 -1
  185. package/dist/components/schedule/schedule-agenda-list.d.ts +6 -7
  186. package/dist/components/schedule/schedule-agenda-list.d.ts.map +1 -1
  187. package/dist/components/schedule/schedule-agenda-view.d.ts +19 -16
  188. package/dist/components/schedule/schedule-agenda-view.d.ts.map +1 -1
  189. package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
  190. package/dist/components/schedule/schedule-days-view.d.ts +3 -2
  191. package/dist/components/schedule/schedule-days-view.d.ts.map +1 -1
  192. package/dist/components/schedule/schedule-month-view.d.ts +3 -2
  193. package/dist/components/schedule/schedule-month-view.d.ts.map +1 -1
  194. package/dist/components/schedule/schedule-next-up.d.ts +4 -3
  195. package/dist/components/schedule/schedule-next-up.d.ts.map +1 -1
  196. package/dist/components/schedule/schedule-toolbar.d.ts +1 -1
  197. package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -1
  198. package/dist/components/schedule/schedule-types.d.ts +5 -3
  199. package/dist/components/schedule/schedule-types.d.ts.map +1 -1
  200. package/dist/components/schedule/schedule-views.d.ts +2 -2
  201. package/dist/components/schedule/schedule-views.d.ts.map +1 -1
  202. package/dist/components/schedule/schedule-year-view.d.ts +3 -2
  203. package/dist/components/schedule/schedule-year-view.d.ts.map +1 -1
  204. package/dist/components/schedule/schedule.d.ts +9 -6
  205. package/dist/components/schedule/schedule.d.ts.map +1 -1
  206. package/dist/components/segment-group/index.js +2 -2
  207. package/dist/components/select/index.js +4 -4
  208. package/dist/components/slider/index.js +2 -1
  209. package/dist/components/slider/index.js.map +1 -1
  210. package/dist/components/slider/slider.d.ts +3 -2
  211. package/dist/components/slider/slider.d.ts.map +1 -1
  212. package/dist/components/switch/index.js +1 -1
  213. package/dist/components/tabs/index.js +1 -1
  214. package/dist/components/tabs/tabs-data.d.ts +3 -2
  215. package/dist/components/tabs/tabs-data.d.ts.map +1 -1
  216. package/dist/components/tags-input/index.js +6 -5
  217. package/dist/components/tags-input/index.js.map +1 -1
  218. package/dist/components/text-input/index.js +2 -2
  219. package/dist/components/textarea/index.js +2 -2
  220. package/dist/components/time-input/index.js +6 -6
  221. package/dist/components/timeline/index.js +8 -5
  222. package/dist/components/timeline/index.js.map +1 -1
  223. package/dist/components/timeline/timeline.d.ts +1 -1
  224. package/dist/components/timeline/timeline.d.ts.map +1 -1
  225. package/dist/components/tooltip/index.js +1 -1
  226. package/dist/components/tooltip/tooltip.d.ts +2 -1
  227. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  228. package/dist/components/tree-multi-select/index.js +6 -5
  229. package/dist/components/tree-multi-select/index.js.map +1 -1
  230. package/dist/components/tree-select/index.js +3 -3
  231. package/dist/lib/as-child.d.ts +104 -0
  232. package/dist/lib/as-child.d.ts.map +1 -0
  233. package/package.json +1 -1
  234. package/src/as-child.contract.test.tsx +809 -0
  235. package/src/components/accordion/accordion-data.tsx +8 -5
  236. package/src/components/accordion/accordion.test.tsx +40 -0
  237. package/src/components/accordion/accordion.tsx +23 -6
  238. package/src/components/action-icon/action-icon.tsx +9 -24
  239. package/src/components/alert/alert.test.tsx +17 -0
  240. package/src/components/alert/alert.tsx +21 -2
  241. package/src/components/app-shell/app-shell.tsx +3 -1
  242. package/src/components/breadcrumb/breadcrumb.test.tsx +30 -0
  243. package/src/components/breadcrumb/breadcrumb.tsx +21 -12
  244. package/src/components/button/button.tsx +21 -50
  245. package/src/components/circular-progress/circular-progress.tsx +4 -1
  246. package/src/components/clipboard/clipboard.test.tsx +18 -0
  247. package/src/components/clipboard/clipboard.tsx +8 -2
  248. package/src/components/code-block/chrome.tsx +60 -36
  249. package/src/components/code-block/code-block.test.tsx +27 -0
  250. package/src/components/code-block/code-block.tsx +13 -3
  251. package/src/components/code-block/notation.test.ts +8 -0
  252. package/src/components/code-block/notation.ts +6 -3
  253. package/src/components/code-block/static.tsx +8 -2
  254. package/src/components/collapse/collapse.tsx +33 -15
  255. package/src/components/combobox/combobox.test.tsx +38 -0
  256. package/src/components/combobox/combobox.tsx +24 -10
  257. package/src/components/divider/divider.tsx +3 -1
  258. package/src/components/drawer/drawer.tsx +37 -16
  259. package/src/components/field/field.tsx +7 -3
  260. package/src/components/input/input.tsx +3 -1
  261. package/src/components/menu/menu-data.tsx +8 -1
  262. package/src/components/menu/menu.test.tsx +52 -0
  263. package/src/components/menu/menu.tsx +83 -35
  264. package/src/components/modal/close-trigger.test.tsx +38 -0
  265. package/src/components/modal/modal.tsx +29 -13
  266. package/src/components/notification/notification.tsx +4 -1
  267. package/src/components/pill/pill.tsx +29 -20
  268. package/src/components/pills-input/pills-input.tsx +3 -1
  269. package/src/components/popover/popover.tsx +3 -1
  270. package/src/components/progress/progress.tsx +4 -1
  271. package/src/components/rating/rating.tsx +27 -23
  272. package/src/components/schedule/index.ts +1 -1
  273. package/src/components/schedule/schedule-agenda-list.tsx +6 -7
  274. package/src/components/schedule/schedule-agenda-view.test.tsx +105 -28
  275. package/src/components/schedule/schedule-agenda-view.tsx +41 -28
  276. package/src/components/schedule/schedule-dates.test.ts +37 -52
  277. package/src/components/schedule/schedule-dates.ts +22 -25
  278. package/src/components/schedule/schedule-days-view.tsx +3 -1
  279. package/src/components/schedule/schedule-month-view.tsx +3 -1
  280. package/src/components/schedule/schedule-next-up.tsx +6 -2
  281. package/src/components/schedule/schedule-toolbar.test.tsx +26 -0
  282. package/src/components/schedule/schedule-toolbar.tsx +13 -1
  283. package/src/components/schedule/schedule-types.ts +5 -3
  284. package/src/components/schedule/schedule-views.ts +4 -5
  285. package/src/components/schedule/schedule-year-view.tsx +3 -1
  286. package/src/components/schedule/schedule.test.tsx +66 -22
  287. package/src/components/schedule/schedule.tsx +22 -13
  288. package/src/components/slider/slider.tsx +4 -0
  289. package/src/components/tabs/tabs-data.tsx +17 -14
  290. package/src/components/timeline/timeline.tsx +102 -95
  291. package/src/components/tooltip/tooltip.tsx +2 -1
  292. package/src/lib/as-child.test.tsx +70 -0
  293. package/src/lib/as-child.ts +119 -0
  294. package/dist/chunk-2762HZYX.js.map +0 -1
  295. package/dist/chunk-2H46IXW4.js.map +0 -1
  296. package/dist/chunk-6SWK4XG5.js.map +0 -1
  297. package/dist/chunk-EVVMHTCL.js.map +0 -1
  298. package/dist/chunk-HWNPXAEN.js +0 -31
  299. package/dist/chunk-HWNPXAEN.js.map +0 -1
  300. package/dist/chunk-IFWCCAQV.js.map +0 -1
  301. package/dist/chunk-IXKELBJA.js.map +0 -1
  302. package/dist/chunk-J3PELDH3.js.map +0 -1
  303. package/dist/chunk-NGAQITWP.js.map +0 -1
  304. package/dist/chunk-POKDSVQT.js.map +0 -1
  305. package/dist/chunk-QMW7D5GU.js.map +0 -1
  306. package/dist/chunk-TNNH3FVQ.js.map +0 -1
  307. package/dist/chunk-U5GW5EBR.js.map +0 -1
  308. package/dist/chunk-UNSAA7YG.js.map +0 -1
  309. package/dist/chunk-VLUKI3HL.js.map +0 -1
  310. package/dist/chunk-VZ2TPU4B.js.map +0 -1
  311. package/dist/chunk-YIQI2CF3.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { useLinkComponent } from './chunk-GTKKRV5N.js';
2
2
  import { useUncontrolled } from './chunk-BEL75C7N.js';
3
3
  import { ChevronIcon } from './chunk-IG7FBZVM.js';
4
- import { Collapse } from './chunk-HWNPXAEN.js';
4
+ import { Collapse } from './chunk-WSIVRDRB.js';
5
5
  import { focusStyles } from './chunk-B2LCHXUB.js';
6
6
  import { cn } from './chunk-QP4I37PA.js';
7
7
  import { cva } from 'class-variance-authority';
@@ -149,5 +149,5 @@ function Navigation(props) {
149
149
  }
150
150
 
151
151
  export { NavLink, Navigation };
152
- //# sourceMappingURL=chunk-FD6P6PLQ.js.map
153
- //# sourceMappingURL=chunk-FD6P6PLQ.js.map
152
+ //# sourceMappingURL=chunk-5JHDSVEZ.js.map
153
+ //# sourceMappingURL=chunk-5JHDSVEZ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/nav-link/nav-link.tsx","../src/components/nav-link/navigation.tsx"],"names":["jsx","Fragment"],"mappings":";;;;;;;;;AAsCA,IAAM,UAAA,GAAa,GAAA;AAAA,EACjB;AAAA,IACE,iGAAA;AAAA,IACA,gCAAA;AAAA,IACA,wCAAA;AAAA,IACA,WAAA,EAAY;AAAA,IACZ;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,mFAAA;AAAA,QACN,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,OAAA,EAAS,KAAA;AAAM;AAEtC,CAAA;AAEA,IAAM,aAAA,GAAgB,EAAA;AAAA,EACpB,+GAAA;AAAA,EACA,gEAAA;AAAA,EACA,WAAA;AACF,CAAA;AAEA,IAAM,OAAA,GAAU,CAAC,IAAA,qBACf,GAAA;AAAA,EAAC,MAAA;AAA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AAA,EAAgB,GAAG,KAAA,EAAO,CAAA;AACpC","file":"chunk-FD6P6PLQ.js","sourcesContent":["\"use client\"\n\nimport { cva } from \"class-variance-authority\"\nimport type { ElementType, ReactNode } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useLinkComponent } from \"../../lib/link-component\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Collapse } from \"../collapse/collapse\"\nimport { ChevronIcon } from \"../popover/icons\"\n\n/**\n * NavLink — a single sidebar/nav row: leading `startSlot`, `label`, trailing\n * `endSlot`, current-page treatment, and self-nesting via `children` for\n * arbitrary-depth sub-navigation (each nested `<NavLink>` renders indented,\n * revealed with `Collapse` when the parent is `open`).\n *\n * Router-agnostic: pass whatever the target link needs as `linkOptions` (a\n * plain `{ href }` for a bare `<a>`, or a framework router's own shape, e.g.\n * TanStack Router's `{ to, params }`) — it's spread verbatim onto whatever\n * renders the link. `linkComponent` picks what that is; if omitted, it falls\n * back to the app-wide `<LinkComponentProvider>` (see `lib/link-component`),\n * then to a plain `<a>`. Generic over `linkOptions`'s shape so a router's own\n * type-safety utilities can validate/autocomplete it — see\n * `nav-link/tanstack.tsx` for a TanStack Router–typed wrapper built this way.\n *\n * A row with no `linkOptions` (a pure category / toggle heading) renders as a\n * `<button>` instead of a link. A row with both `linkOptions` and nested\n * children renders the link and its expand/collapse toggle as two separate\n * controls (a link nested inside a button, or vice versa, isn't valid HTML).\n *\n * <NavLink label=\"Dashboard\" startSlot={<Home />} linkOptions={{ href: \"/dashboard\" }} />\n * <NavLink label=\"Settings\" startSlot={<Settings />} defaultOpen>\n * <NavLink label=\"Profile\" linkOptions={{ href: \"/settings/profile\" }} />\n * <NavLink label=\"Security\" linkOptions={{ href: \"/settings/security\" }} />\n * </NavLink>\n */\n\nconst navLinkRow = cva(\n [\n \"flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2.5 py-2 text-start text-sm\",\n \"outline-none transition-colors\",\n \"hover:bg-black/5 dark:hover:bg-white/8\",\n focusStyles(),\n \"aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n ],\n {\n variants: {\n current: {\n true: \"bg-black/5 font-medium text-gray-light-900 dark:bg-white/8 dark:text-gray-dark-25\",\n false: \"text-gray-light-700 dark:text-gray-dark-200\",\n },\n },\n defaultVariants: { current: false },\n },\n)\n\nconst chevronButton = cn(\n \"flex shrink-0 cursor-pointer items-center justify-center rounded-md p-2 text-gray-light-500 transition-colors\",\n \"hover:bg-black/5 dark:text-gray-dark-400 dark:hover:bg-white/8\",\n focusStyles(),\n)\n\nconst chevron = (open: boolean) => (\n <span\n aria-hidden=\"true\"\n data-state={open ? \"open\" : \"closed\"}\n className=\"ms-auto flex shrink-0 transition-transform data-[state=open]:rotate-180 [&_svg]:size-4\"\n >\n <ChevronIcon />\n </span>\n)\n\nexport type NavLinkClassNames = {\n /** The link/button row itself. */\n row?: string\n /** The indented container holding nested `<NavLink>` children. */\n items?: string\n}\n\nexport type NavLinkProps<TOptions = unknown> = {\n label: ReactNode\n /** Leading slot (icon, avatar, etc). */\n startSlot?: ReactNode\n /** Trailing slot (e.g. a count or status badge). */\n endSlot?: ReactNode\n /** Marks this as the active/current page. */\n current?: boolean\n disabled?: boolean\n /** Whether nested `children` are revealed. Uncontrolled by default. */\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** The router's own link options — e.g. `{ href: \"/x\" }` for a plain `<a>`,\n * or `{ to: \"/x\", params: {...} }` for TanStack Router. Omit for a pure\n * category/toggle row with no link of its own. */\n linkOptions?: TOptions\n /** Overrides the `<LinkComponentProvider>` for this row only. */\n linkComponent?: ElementType\n classNames?: NavLinkClassNames\n className?: string\n /** Nested `<NavLink>` elements, revealed when `open`. */\n children?: ReactNode\n}\n\nfunction NavLinkImpl({\n label,\n startSlot,\n endSlot,\n current,\n disabled,\n open,\n defaultOpen,\n onOpenChange,\n linkOptions,\n linkComponent,\n classNames,\n className,\n children,\n}: NavLinkProps) {\n const [isOpen, setOpen] = useUncontrolled<boolean>({\n value: open,\n defaultValue: defaultOpen,\n finalValue: false,\n onChange: onOpenChange,\n })\n const hasChildren = children != null\n const isLink = linkOptions != null\n const Comp = useLinkComponent(linkComponent) ?? \"a\"\n\n const content = (\n <>\n {startSlot}\n <span className=\"min-w-0 flex-1 truncate\">{label}</span>\n {endSlot}\n </>\n )\n\n const rowClassName = cn(navLinkRow({ current }), classNames?.row, className)\n\n return (\n <div>\n <div className=\"flex items-stretch gap-1\">\n {isLink ? (\n <Comp\n {...linkOptions}\n aria-current={current ? \"page\" : undefined}\n aria-disabled={disabled || undefined}\n className={rowClassName}\n >\n {content}\n </Comp>\n ) : (\n <button\n type=\"button\"\n aria-current={current ? \"page\" : undefined}\n aria-disabled={disabled || undefined}\n aria-expanded={hasChildren ? isOpen : undefined}\n disabled={disabled}\n onClick={() => hasChildren && setOpen(!isOpen)}\n className={rowClassName}\n >\n {content}\n {hasChildren && chevron(isOpen)}\n </button>\n )}\n {hasChildren && isLink && (\n <button\n type=\"button\"\n aria-expanded={isOpen}\n aria-label={isOpen ? \"Collapse\" : \"Expand\"}\n onClick={() => setOpen(!isOpen)}\n className={chevronButton}\n >\n {chevron(isOpen)}\n </button>\n )}\n </div>\n {hasChildren && (\n <Collapse open={isOpen}>\n <div\n className={cn(\n \"ms-4.5 space-y-0.5 border-s border-brand-900/20 ps-2 pt-0.5 dark:border-white/15\",\n classNames?.items,\n )}\n >\n {children}\n </div>\n </Collapse>\n )}\n </div>\n )\n}\n\n/**\n * `NavLink<TOptions>` — generic so a router's own type-safety utility (e.g.\n * TanStack Router's `ValidateLinkOptions`) can validate `linkOptions` when\n * explicitly parameterized. The implementation itself stays untyped/loose\n * (the generic can't be forwarded through the JSX body); see\n * TanStack Router's own documented pattern for this exact split.\n */\nexport function NavLink<TOptions = unknown>(props: NavLinkProps<TOptions>): ReactNode\nexport function NavLink(props: NavLinkProps): ReactNode {\n return <NavLinkImpl {...props} />\n}\n","\"use client\"\n\nimport type { ElementType, ReactNode } from \"react\"\nimport { NavLink, type NavLinkClassNames } from \"./nav-link\"\n\n/**\n * `Navigation` — the `data`-driven convenience wrapper over `NavLink` (same\n * relationship as `menu-data.tsx` to `menu.tsx`): pass a `data` array, get a\n * fully wired, arbitrarily-nested nav tree.\n *\n * <Navigation\n * data={[\n * { label: \"Dashboard\", startSlot: <Home />, linkOptions: { href: \"/dashboard\" } },\n * { label: \"Settings\", startSlot: <Settings />, items: [\n * { label: \"Profile\", linkOptions: { href: \"/settings/profile\" } },\n * { label: \"Security\", linkOptions: { href: \"/settings/security\" } },\n * ]},\n * ]}\n * />\n *\n * Generic over the same `TOptions` as `NavLink` — parameterize it (e.g. with\n * `TanStackLinkOptions` from `nav-link/tanstack`) to get a router's own\n * type-safety utilities validating every entry's `linkOptions`.\n */\nexport type NavigationItem<TOptions = unknown> = {\n label: ReactNode\n startSlot?: ReactNode\n endSlot?: ReactNode\n current?: boolean\n disabled?: boolean\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n linkOptions?: TOptions\n classNames?: NavLinkClassNames\n /** Nested entries — an item with `items` renders its children indented,\n * revealed on expand/collapse. Recursive: nests to any depth. */\n items?: readonly NavigationItem<TOptions>[]\n}\n\nexport type NavigationProps<TOptions = unknown> = {\n /** The nav entries, in order. */\n data: readonly NavigationItem<TOptions>[]\n /** Overrides the app-wide `<LinkComponentProvider>` for every generated row. */\n linkComponent?: ElementType\n}\n\nconst renderItem = (\n item: NavigationItem,\n key: string,\n linkComponent: ElementType | undefined,\n): ReactNode => (\n <NavLink\n key={key}\n label={item.label}\n startSlot={item.startSlot}\n endSlot={item.endSlot}\n current={item.current}\n disabled={item.disabled}\n open={item.open}\n defaultOpen={item.defaultOpen}\n onOpenChange={item.onOpenChange}\n linkOptions={item.linkOptions}\n linkComponent={linkComponent}\n classNames={item.classNames}\n >\n {item.items && item.items.length > 0\n ? item.items.map((child, i) => renderItem(child, `${key}.${i}`, linkComponent))\n : undefined}\n </NavLink>\n)\n\nfunction NavigationImpl({ data, linkComponent }: NavigationProps) {\n return <>{data.map((item, i) => renderItem(item, `nav-${i}`, linkComponent))}</>\n}\n\n/** Generic for the same reason as `NavLink` — see its doc comment. */\nexport function Navigation<TOptions = unknown>(props: NavigationProps<TOptions>): ReactNode\nexport function Navigation(props: NavigationProps): ReactNode {\n return <NavigationImpl {...props} />\n}\n"]}
1
+ {"version":3,"sources":["../src/components/nav-link/nav-link.tsx","../src/components/nav-link/navigation.tsx"],"names":["jsx","Fragment"],"mappings":";;;;;;;;;AAsCA,IAAM,UAAA,GAAa,GAAA;AAAA,EACjB;AAAA,IACE,iGAAA;AAAA,IACA,gCAAA;AAAA,IACA,wCAAA;AAAA,IACA,WAAA,EAAY;AAAA,IACZ;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,mFAAA;AAAA,QACN,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,OAAA,EAAS,KAAA;AAAM;AAEtC,CAAA;AAEA,IAAM,aAAA,GAAgB,EAAA;AAAA,EACpB,+GAAA;AAAA,EACA,gEAAA;AAAA,EACA,WAAA;AACF,CAAA;AAEA,IAAM,OAAA,GAAU,CAAC,IAAA,qBACf,GAAA;AAAA,EAAC,MAAA;AAAA,EAAA;AAAA,IACC,aAAA,EAAY,MAAA;AAAA,IACZ,YAAA,EAAY,OAAO,MAAA,GAAS,QAAA;AAAA,IAC5B,SAAA,EAAU,wFAAA;AAAA,IAEV,8BAAC,WAAA,EAAA,EAAY;AAAA;AACf,CAAA;AAmCF,SAAS,WAAA,CAAY;AAAA,EACnB,KAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,aAA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AS,IAAA,CAAK,OAAA;AAAA,IACd,UAAU,IAAA,CAAK,QAAA;AAAA,IACf,MAAM,IAAA,CAAK,IAAA;AAAA,IACX,aAAa,IAAA,CAAK,WAAA;AAAA,IAClB,cAAc,IAAA,CAAK,YAAA;AAAA,IACnB,aAAa,IAAA,CAAK,WAAA;AAAA,IAClB,aAAA;AAAA,IACA,YAAY,IAAA,CAAK,UAAA;AAAA,IAEhB,QAAA,EAAA,IAAA,CAAK,SAAS,IAAA,CAAK,KAAA,CAAM,SAAS,CAAA,GAC/B,IAAA,CAAK,MAAM,GAAA,CAAI,CAAC,OAAO,CAAA,KAAM,UAAA,CAAW,OAAO,CAAA,EAAG,GAAG,IAAI,CAAC,CAAA,CAAA,EAAI,aAAa,CAAC,CAAA,GAC5E;AAAA,GAAA;AAAA,EAfC;AAgBP,CAAA;AAGF,SAAS,cAAA,CAAe,EAAE,IAAA,EAAM,aAAA,EAAc,EAAoB;AAChE,EAAA,uBAAOA,GAAAA,CAAAC,QAAAA,EAAA,EAAG,QAAA,EAAA,IAAA,CAAK,IAAI,CAAC,IAAA,EAAM,CAAA,KAAM,UAAA,CAAW,MAAM,CAAA,IAAA,EAAO,CAAC,CAAA,CAAA,EAAI,aAAa,CAAC,CAAA,EAAE,CAAA;AAC/E;AAIO,SAAS,WAAW,KAAA,EAAmC;AAC5D,EAAA,uBAAOD,GAAAA,CAAC,cAAA,EAAA,EAAgB,GAAG,KAAA,EAAO,CAAA;AACpC","file":"chunk-5JHDSVEZ.js","sourcesContent":["\"use client\"\n\nimport { cva } from \"class-variance-authority\"\nimport type { ElementType, ReactNode } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useLinkComponent } from \"../../lib/link-component\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Collapse } from \"../collapse/collapse\"\nimport { ChevronIcon } from \"../popover/icons\"\n\n/**\n * NavLink — a single sidebar/nav row: leading `startSlot`, `label`, trailing\n * `endSlot`, current-page treatment, and self-nesting via `children` for\n * arbitrary-depth sub-navigation (each nested `<NavLink>` renders indented,\n * revealed with `Collapse` when the parent is `open`).\n *\n * Router-agnostic: pass whatever the target link needs as `linkOptions` (a\n * plain `{ href }` for a bare `<a>`, or a framework router's own shape, e.g.\n * TanStack Router's `{ to, params }`) — it's spread verbatim onto whatever\n * renders the link. `linkComponent` picks what that is; if omitted, it falls\n * back to the app-wide `<LinkComponentProvider>` (see `lib/link-component`),\n * then to a plain `<a>`. Generic over `linkOptions`'s shape so a router's own\n * type-safety utilities can validate/autocomplete it — see\n * `nav-link/tanstack.tsx` for a TanStack Router–typed wrapper built this way.\n *\n * A row with no `linkOptions` (a pure category / toggle heading) renders as a\n * `<button>` instead of a link. A row with both `linkOptions` and nested\n * children renders the link and its expand/collapse toggle as two separate\n * controls (a link nested inside a button, or vice versa, isn't valid HTML).\n *\n * <NavLink label=\"Dashboard\" startSlot={<Home />} linkOptions={{ href: \"/dashboard\" }} />\n * <NavLink label=\"Settings\" startSlot={<Settings />} defaultOpen>\n * <NavLink label=\"Profile\" linkOptions={{ href: \"/settings/profile\" }} />\n * <NavLink label=\"Security\" linkOptions={{ href: \"/settings/security\" }} />\n * </NavLink>\n */\n\nconst navLinkRow = cva(\n [\n \"flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2.5 py-2 text-start text-sm\",\n \"outline-none transition-colors\",\n \"hover:bg-black/5 dark:hover:bg-white/8\",\n focusStyles(),\n \"aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n ],\n {\n variants: {\n current: {\n true: \"bg-black/5 font-medium text-gray-light-900 dark:bg-white/8 dark:text-gray-dark-25\",\n false: \"text-gray-light-700 dark:text-gray-dark-200\",\n },\n },\n defaultVariants: { current: false },\n },\n)\n\nconst chevronButton = cn(\n \"flex shrink-0 cursor-pointer items-center justify-center rounded-md p-2 text-gray-light-500 transition-colors\",\n \"hover:bg-black/5 dark:text-gray-dark-400 dark:hover:bg-white/8\",\n focusStyles(),\n)\n\nconst chevron = (open: boolean) => (\n <span\n aria-hidden=\"true\"\n data-state={open ? \"open\" : \"closed\"}\n className=\"ms-auto flex shrink-0 transition-transform data-[state=open]:rotate-180 [&_svg]:size-4\"\n >\n <ChevronIcon />\n </span>\n)\n\nexport type NavLinkClassNames = {\n /** The link/button row itself. */\n row?: string\n /** The indented container holding nested `<NavLink>` children. */\n items?: string\n}\n\nexport type NavLinkProps<TOptions = unknown> = {\n label: ReactNode\n /** Leading slot (icon, avatar, etc). */\n startSlot?: ReactNode\n /** Trailing slot (e.g. a count or status badge). */\n endSlot?: ReactNode\n /** Marks this as the active/current page. */\n current?: boolean\n disabled?: boolean\n /** Whether nested `children` are revealed. Uncontrolled by default. */\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** The router's own link options — e.g. `{ href: \"/x\" }` for a plain `<a>`,\n * or `{ to: \"/x\", params: {...} }` for TanStack Router. Omit for a pure\n * category/toggle row with no link of its own. */\n linkOptions?: TOptions\n /** Overrides the `<LinkComponentProvider>` for this row only. */\n linkComponent?: ElementType\n classNames?: NavLinkClassNames\n className?: string\n /** Nested `<NavLink>` elements, revealed when `open`. */\n children?: ReactNode\n}\n\nfunction NavLinkImpl({\n label,\n startSlot,\n endSlot,\n current,\n disabled,\n open,\n defaultOpen,\n onOpenChange,\n linkOptions,\n linkComponent,\n classNames,\n className,\n children,\n}: NavLinkProps) {\n const [isOpen, setOpen] = useUncontrolled<boolean>({\n value: open,\n defaultValue: defaultOpen,\n finalValue: false,\n onChange: onOpenChange,\n })\n const hasChildren = children != null\n const isLink = linkOptions != null\n const Comp = useLinkComponent(linkComponent) ?? \"a\"\n\n const content = (\n <>\n {startSlot}\n <span className=\"min-w-0 flex-1 truncate\">{label}</span>\n {endSlot}\n </>\n )\n\n const rowClassName = cn(navLinkRow({ current }), classNames?.row, className)\n\n return (\n <div>\n <div className=\"flex items-stretch gap-1\">\n {isLink ? (\n <Comp\n {...linkOptions}\n aria-current={current ? \"page\" : undefined}\n aria-disabled={disabled || undefined}\n className={rowClassName}\n >\n {content}\n </Comp>\n ) : (\n <button\n type=\"button\"\n aria-current={current ? \"page\" : undefined}\n aria-disabled={disabled || undefined}\n aria-expanded={hasChildren ? isOpen : undefined}\n disabled={disabled}\n onClick={() => hasChildren && setOpen(!isOpen)}\n className={rowClassName}\n >\n {content}\n {hasChildren && chevron(isOpen)}\n </button>\n )}\n {hasChildren && isLink && (\n <button\n type=\"button\"\n aria-expanded={isOpen}\n aria-label={isOpen ? \"Collapse\" : \"Expand\"}\n onClick={() => setOpen(!isOpen)}\n className={chevronButton}\n >\n {chevron(isOpen)}\n </button>\n )}\n </div>\n {hasChildren && (\n <Collapse open={isOpen}>\n <div\n className={cn(\n \"ms-4.5 space-y-0.5 border-s border-brand-900/20 ps-2 pt-0.5 dark:border-white/15\",\n classNames?.items,\n )}\n >\n {children}\n </div>\n </Collapse>\n )}\n </div>\n )\n}\n\n/**\n * `NavLink<TOptions>` — generic so a router's own type-safety utility (e.g.\n * TanStack Router's `ValidateLinkOptions`) can validate `linkOptions` when\n * explicitly parameterized. The implementation itself stays untyped/loose\n * (the generic can't be forwarded through the JSX body); see\n * TanStack Router's own documented pattern for this exact split.\n */\nexport function NavLink<TOptions = unknown>(props: NavLinkProps<TOptions>): ReactNode\nexport function NavLink(props: NavLinkProps): ReactNode {\n return <NavLinkImpl {...props} />\n}\n","\"use client\"\n\nimport type { ElementType, ReactNode } from \"react\"\nimport { NavLink, type NavLinkClassNames } from \"./nav-link\"\n\n/**\n * `Navigation` — the `data`-driven convenience wrapper over `NavLink` (same\n * relationship as `menu-data.tsx` to `menu.tsx`): pass a `data` array, get a\n * fully wired, arbitrarily-nested nav tree.\n *\n * <Navigation\n * data={[\n * { label: \"Dashboard\", startSlot: <Home />, linkOptions: { href: \"/dashboard\" } },\n * { label: \"Settings\", startSlot: <Settings />, items: [\n * { label: \"Profile\", linkOptions: { href: \"/settings/profile\" } },\n * { label: \"Security\", linkOptions: { href: \"/settings/security\" } },\n * ]},\n * ]}\n * />\n *\n * Generic over the same `TOptions` as `NavLink` — parameterize it (e.g. with\n * `TanStackLinkOptions` from `nav-link/tanstack`) to get a router's own\n * type-safety utilities validating every entry's `linkOptions`.\n */\nexport type NavigationItem<TOptions = unknown> = {\n label: ReactNode\n startSlot?: ReactNode\n endSlot?: ReactNode\n current?: boolean\n disabled?: boolean\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n linkOptions?: TOptions\n classNames?: NavLinkClassNames\n /** Nested entries — an item with `items` renders its children indented,\n * revealed on expand/collapse. Recursive: nests to any depth. */\n items?: readonly NavigationItem<TOptions>[]\n}\n\nexport type NavigationProps<TOptions = unknown> = {\n /** The nav entries, in order. */\n data: readonly NavigationItem<TOptions>[]\n /** Overrides the app-wide `<LinkComponentProvider>` for every generated row. */\n linkComponent?: ElementType\n}\n\nconst renderItem = (\n item: NavigationItem,\n key: string,\n linkComponent: ElementType | undefined,\n): ReactNode => (\n <NavLink\n key={key}\n label={item.label}\n startSlot={item.startSlot}\n endSlot={item.endSlot}\n current={item.current}\n disabled={item.disabled}\n open={item.open}\n defaultOpen={item.defaultOpen}\n onOpenChange={item.onOpenChange}\n linkOptions={item.linkOptions}\n linkComponent={linkComponent}\n classNames={item.classNames}\n >\n {item.items && item.items.length > 0\n ? item.items.map((child, i) => renderItem(child, `${key}.${i}`, linkComponent))\n : undefined}\n </NavLink>\n)\n\nfunction NavigationImpl({ data, linkComponent }: NavigationProps) {\n return <>{data.map((item, i) => renderItem(item, `nav-${i}`, linkComponent))}</>\n}\n\n/** Generic for the same reason as `NavLink` — see its doc comment. */\nexport function Navigation<TOptions = unknown>(props: NavigationProps<TOptions>): ReactNode\nexport function Navigation(props: NavigationProps): ReactNode {\n return <NavigationImpl {...props} />\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { fieldA11yProps } from './chunk-UNSAA7YG.js';
1
+ import { fieldA11yProps } from './chunk-FHG54IT5.js';
2
2
  import { props } from './chunk-WYCMIIRR.js';
3
3
  import { cn } from './chunk-QP4I37PA.js';
4
4
  import { ark } from '@ark-ui/react';
@@ -120,6 +120,7 @@ var InputBase = ({
120
120
  className,
121
121
  classNames,
122
122
  testId,
123
+ asChild: _asChild,
123
124
  ...rest
124
125
  }) => /* @__PURE__ */ jsxs(
125
126
  ark.div,
@@ -203,5 +204,5 @@ var Input = ({
203
204
  };
204
205
 
205
206
  export { Input, InputBase, inputControlClasses, inputShell, inputSlot, placeholderColor, shellChrome, shellGap, shellVariants };
206
- //# sourceMappingURL=chunk-QMW7D5GU.js.map
207
- //# sourceMappingURL=chunk-QMW7D5GU.js.map
207
+ //# sourceMappingURL=chunk-5OQLFX47.js.map
208
+ //# sourceMappingURL=chunk-5OQLFX47.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/input/input.tsx"],"names":[],"mappings":";;;;;;;;AAuCO,IAAM,mBAAA,GAAsB,EAAA;AAAA,EACjC,uEAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,6BAAA;AAAA,EACA,iCAAA;AAAA,EACA,qEAAA;AAAA,EACA;AACF;AAQO,IAAM,WAAA,GAAc;AAAA,EACzB,wDAAA;AAAA,EACA,4CAAA;AAAA,EACA,4CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,mLAAA;AAAA;AAAA;AAAA,EAGA,yMAAA;AAAA;AAAA,EAEA,2DAAA;AAAA,EACA,0BAAA;AAAA,EACA,6BAAA;AAAA,EACA;AACF;AAGO,IAAM,aAAA,GAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ3B,OAAA,EAAS,CAAC,YAAA,EAAc,0CAA0C,CAAA;AAAA;AAAA;AAAA,EAGlE,QAAA,EAAU;AAAA,IACR,mCAAA;AAAA,IACA;AAAA;AAEJ;AAQO,IAAM,QAAA,GAAW;AAAA,EACtB,EAAA,EAAI,SAAA;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ui/react\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ReactNode, Ref } from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { fieldA11yProps } from \"../field/field\"\n\n/**\n * Input / InputBase — the styled input *shell* the whole form family renders\n * into (Select trigger, Combobox/Autocomplete search field, PillsInput, and\n * `TextInput`). It is deliberately the lowest layer: label / description /\n * error live in `Field`, not here — reach for `TextInput` when you want them\n * built in, which is the common case, and for `Input` when you're composing\n * the shell yourself or the control needs no accessible name of its own.\n *\n * - `InputBase` is the polymorphic shell. It draws the bordered box, the\n * focus-visible ring, the disabled / invalid states, and lays out\n * an optional `startSlot` / `endSlot` around a single control child. The\n * child can be anything — an `<input>`, a `<button>` (Select trigger), or a\n * `<div>` of pills (PillsInput). Style your control with the exported\n * `inputControlClasses` so it sits flush inside the shell.\n * - `Input` is `InputBase` wrapping a real `<input>`. Native\n * input props (`value`, `onChange`, `placeholder`, `name`, `type`, `ref`, …)\n * are forwarded straight to the element; `className` styles the shell root\n * (matching the kit's other components), and `classNames` overrides parts.\n *\n * The shell is palette-independent, so there is no `color` prop: the focus halo\n * and border are a fixed `brand-500` per the 42 UI Kit Figma (see `shellChrome`),\n * and `de33dee` removed both `color` and the `filled` variant. `invalid` swaps\n * the border / ring to red.\n */\n\n/** Inner-control reset — apply to whatever element you nest inside `InputBase`\n * (input, button, …) so it inherits the shell's font and fills the row. */\nexport const inputControlClasses = cn(\n \"w-full flex-1 min-w-0 appearance-none border-0 bg-transparent p-0 m-0\",\n // `font: inherit` is the canonical form-control reset — without it the UA\n // forces its own font-size and the shell's `size` text scale is ignored.\n // No `text-trim`: a native `<input>`'s text renders inside the UA's own\n // form-control internals, not a normal CSS line box, so `text-box-trim`\n // computes an inconsistent (content-dependent) box height there — Chrome\n // was scrolling the text vertically once its computed box stopped matching\n // the element's actual rendered height.\n \"font-[inherit] text-inherit\",\n \"outline-none focus:outline-none\",\n \"placeholder:text-gray-light-500 dark:placeholder:text-gray-dark-400\",\n \"disabled:cursor-not-allowed\",\n)\n\n/**\n * Shared shell chrome — surface, border, focus ring, and state styling. The\n * single-line `Input` shell and the multi-line `PillsInput` shell both build on\n * these; only the layout (row vs wrap) and the sizing differ, so the visual\n * treatment (incl. the invalid red halo) lives in exactly one place.\n */\nexport const shellChrome = [\n \"group/input relative rounded-input border outline-none\",\n \"text-gray-light-900 dark:text-gray-dark-25\",\n \"transition-[color,box-shadow,border-color]\",\n // Fixed brand-500 focus halo + border, per the 42 UI Kit Figma — independent\n // of the instance's own `color`. The combined selector matches either shape\n // in the family: a shell wrapping a real focusable descendant (Input,\n // Select, Combobox, MultiSelect, ComboboxList, MultiComboboxList, PinInput's\n // per-cell shell) or a shell that IS the tabbable element itself (TreeSelect,\n // TreeMultiSelect). `:has()` alone only matches the former.\n \"[&:is(:focus-visible,:has(:focus-visible))]:border-brand-500 [&:is(:focus-visible,:has(:focus-visible))]:ring-[3px] [&:is(:focus-visible,:has(:focus-visible))]:ring-brand-500/15\",\n // Invalid wins over the palette: red border + red halo. Same combined\n // selector as the rule above so the two can't drift out of sync.\n \"data-invalid:border-red-500 data-invalid:[&:is(:focus-visible,:has(:focus-visible))]:border-red-500 data-invalid:[&:is(:focus-visible,:has(:focus-visible))]:ring-red-500/15 data-invalid:bg-red-500/10\",\n // Disabled affordances on the shell.\n \"data-disabled:cursor-not-allowed data-disabled:opacity-60\",\n \"data-disabled:bg-white/8\",\n \"data-pointer:cursor-pointer\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n]\n\n/** Surface treatment per `variant`, shared across the input shells. */\nexport const shellVariants = {\n // Translucent border to go with the translucent fill: at `bg-white/4` the\n // shell has no ground of its own, so a fixed opaque hairline can vanish (on\n // a light-gray card) or over-assert (on a mid-tone host page). Same hue\n // language as Card's `default` (navy-tinted light / white-tinted dark), one\n // alpha step tighter — these render within a shade of the opaque colors\n // they replace, so the hairline keeps its weight and only gains\n // background-adaptivity.\n default: [\"bg-white/4\", \"border-brand-900/20 dark:border-white/15\"],\n // Escape hatch: strip the chrome but keep the layout (height / slots). Same\n // combined selector as `shellChrome`'s \"on\" rule so the cancel can't drift.\n unstyled: [\n \"border-transparent bg-transparent\",\n \"rounded-none [&:is(:focus-visible,:has(:focus-visible))]:ring-0\",\n ],\n}\n\n/**\n * Inline gap between the shell's slots and control, per `size`. The single\n * source for this spacing: `inputShell` applies it to the shell row, and any\n * control that lays out its *own* slots inside a nested flex (e.g. the Select\n * trigger) reuses it so adornments sit identically across the family.\n */\nexport const shellGap = {\n xs: \"gap-1.5\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-2.5\",\n xl: \"gap-3\",\n} as const\n\n/** Single-line input shell. Reused by the family's button / input controls. */\nexport const inputShell = cva([...shellChrome, \"flex w-full items-center gap-y-0.5\"], {\n variants: {\n variant: shellVariants,\n // Padding is slot-aware: the base is the tight, no-adornment inset, and each\n // side gains a step of inline padding only when `InputBase` flags an\n // adornment there (`data-with-start-slot` / `data-with-end-slot`). These are\n // self-referential `data-*` variants — the attributes live on this same\n // shell element, so a `group-*` variant (which targets descendants) wouldn't\n // match.\n size: {\n xs: [\n \"ps-1.5 pe-1.5\",\n \"data-with-start-slot:ps-2 data-with-end-slot:pe-2\",\n `min-h-7 ${shellGap.xs} text-xs [&_svg]:size-3`,\n ],\n sm: [\n \"ps-2 pe-2\",\n \"data-with-start-slot:ps-2.5 data-with-end-slot:pe-2.5\",\n `min-h-8 ${shellGap.sm} text-sm [&_svg]:size-3.5`,\n ],\n md: [\n \"ps-2 pe-2\",\n \"data-with-start-slot:ps-2.5 data-with-end-slot:pe-2.5\",\n `min-h-9 ${shellGap.md} text-md [&_svg]:size-4`,\n ],\n lg: [\n \"ps-3 pe-3\",\n \"data-with-start-slot:ps-3.5 data-with-end-slot:pe-3.5\",\n `min-h-10 ${shellGap.lg} text-lg [&_svg]:size-5`,\n ],\n xl: [\n \"ps-3.5 pe-3.5\",\n \"data-with-start-slot:ps-4 data-with-end-slot:pe-4\",\n `min-h-12 ${shellGap.xl} text-xl [&_svg]:size-6`,\n ],\n },\n },\n defaultVariants: { variant: \"default\", size: \"md\" },\n})\n\n/** Start/end adornment slot — the shared visual contract for the inline-start /\n * inline-end content the whole form family lays out (icon, chevron, clear).\n * Exported so Select / Combobox / the pills controls slot their adornments\n * identically to `InputBase` instead of re-deriving the layout. */\nexport const inputSlot = cn(\n \"inline-flex shrink-0 items-center justify-center\",\n \"text-gray-light-500 dark:text-gray-dark-400\",\n)\n\n/** Muted color for a component's own custom-rendered placeholder / empty-state text — a\n * `<span>` standing in for a native `::placeholder` wherever the value display isn't a real\n * `<input>` (Select's trigger, MultiSelect's non-searchable mode, TreeSelect / TreeMultiSelect's\n * trigger, DatePicker's range-mode trigger). Same color pairing as `inputControlClasses`'s native\n * `::placeholder` rule above. Kept as its own export, not folded into `inputSlot` — `inputSlot`'s\n * `inline-flex items-center justify-center shrink-0` are icon-slot layout rules; forced onto a\n * run of text they'd center it and block it from shrinking, silently breaking truncation on the\n * call sites where this color sits on the same span as `flex-1`/`truncate`. */\nexport const placeholderColor = \"text-gray-light-500 dark:text-gray-dark-400\"\n\nexport type InputVariant = NonNullable<VariantProps<typeof inputShell>[\"variant\"]>\nexport type InputSize = NonNullable<VariantProps<typeof inputShell>[\"size\"]>\n\ntype ShellClassNames = {\n /** The shell `<div>` (also targeted by `className`). */\n root?: string\n startSlot?: string\n endSlot?: string\n}\n\n/** Props shared by the shell and the convenience `Input`. */\ntype ShellOwnProps = VariantProps<typeof inputShell> & {\n /** Red border + ring; also wires `aria-invalid` on `Input`. */\n invalid?: boolean\n /** Dims the shell and (on `Input`) disables the element. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits (on `Input`). */\n readOnly?: boolean\n /** `cursor: pointer` — for button-like triggers (Select). */\n pointer?: boolean\n /** Decorative or interactive content at the inline-start of the control. */\n startSlot?: ReactNode\n /** Content at the inline-end — chevron, clear button, spinner. */\n endSlot?: ReactNode\n}\n\nexport type InputBaseProps = NoAsChild<Omit<HTMLArkProps<\"div\">, \"color\">> &\n ShellOwnProps &\n WithTestId & {\n classNames?: ShellClassNames\n }\n\nexport const InputBase = ({\n variant,\n size,\n invalid,\n disabled,\n readOnly,\n pointer,\n startSlot,\n endSlot,\n children,\n className,\n classNames,\n testId,\n asChild: _asChild,\n ...rest\n}: InputBaseProps) => (\n <ark.div\n {...props({\n \"data-invalid\": invalid,\n \"data-disabled\": disabled,\n \"data-readonly\": readOnly,\n \"data-pointer\": pointer,\n // Drive the slot-aware padding in `inputShell`: each side gains a step of\n // inline padding when an adornment sits there (`data-with-*-slot:`).\n \"data-with-start-slot\": startSlot != null,\n \"data-with-end-slot\": endSlot != null,\n // Only meaningful when `InputBase` is used bare (no `Input`-style inner\n // control routing its own `testId`) — a `testId` given to a control that\n // wraps `InputBase` itself (Input, NumberInput, Select, …) always lands\n // on that control's real interactive element instead, never here.\n \"data-testid\": testId,\n })}\n className={cn(className, classNames?.root, inputShell({ variant, size }))}\n {...rest}\n >\n {startSlot != null && (\n <span className={cn(inputSlot, classNames?.startSlot)} aria-hidden>\n {startSlot}\n </span>\n )}\n {children}\n {endSlot != null && (\n <span className={cn(inputSlot, classNames?.endSlot)} aria-hidden>\n {endSlot}\n </span>\n )}\n </ark.div>\n)\n\nexport type InputProps = Omit<HTMLArkProps<\"input\">, \"size\" | \"color\"> &\n ShellOwnProps &\n WithTestId & {\n /** Lands on the underlying `<input>` for focus-on-error. Declared\n * explicitly because `HTMLArkProps` is `ComponentPropsWithoutRef`, so the\n * native prop types alone don't carry it — same as `Textarea`,\n * `PasswordInput`, and `NumberInput`. */\n ref?: Ref<HTMLInputElement>\n classNames?: ShellClassNames & {\n /** The inner `<input>` element. */\n input?: string\n }\n }\n\nexport const Input = ({\n variant,\n size,\n invalid,\n disabled,\n readOnly,\n pointer,\n startSlot,\n endSlot,\n className,\n classNames,\n testId,\n ...rest\n}: InputProps) => {\n // When nested in a `Field`, inherit its id / aria-describedby / state so the\n // label, description, and error wire up — exactly how Ark's own `Field.Input`\n // behaves. `useFieldContext` is null outside a Field, so this is a no-op then.\n const field = useFieldContext()\n const fieldInputProps = field?.getInputProps()\n\n return (\n <InputBase\n variant={variant}\n size={size}\n pointer={pointer}\n startSlot={startSlot}\n endSlot={endSlot}\n className={className}\n classNames={{\n root: classNames?.root,\n startSlot: classNames?.startSlot,\n endSlot: classNames?.endSlot,\n }}\n {...props({\n disabled: disabled || field?.disabled,\n invalid: invalid || field?.invalid,\n readOnly: readOnly || field?.readOnly,\n })}\n >\n <ark.input\n {...fieldInputProps}\n {...fieldA11yProps(field)}\n {...props({\n disabled: disabled || field?.disabled,\n \"aria-invalid\": invalid || field?.invalid,\n readOnly: readOnly || field?.readOnly,\n \"data-testid\": testId,\n })}\n className={cn(inputControlClasses, classNames?.input)}\n {...rest}\n />\n </InputBase>\n )\n}\n"]}
@@ -277,6 +277,7 @@ var Content = ({
277
277
  onPointerLeave,
278
278
  onPointerDown,
279
279
  onFocus,
280
+ asChild: _asChild,
280
281
  ...rest
281
282
  }) => {
282
283
  const { width, withinPortal, container, layers, hover } = useContext(PopoverContext);
@@ -344,5 +345,5 @@ var Popover = {
344
345
  };
345
346
 
346
347
  export { Popover, popoverCheckbox, popoverChevron, popoverChrome, popoverClearTrigger, popoverContent, popoverEmpty, popoverGroupLabel, popoverIndicator, popoverList, popoverOption, popoverPanel, scrollHighlightedIntoView };
347
- //# sourceMappingURL=chunk-VZ2TPU4B.js.map
348
- //# sourceMappingURL=chunk-VZ2TPU4B.js.map
348
+ //# sourceMappingURL=chunk-6GDMSENK.js.map
349
+ //# sourceMappingURL=chunk-6GDMSENK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/popover/popover.tsx"],"names":["ArkPopover"],"mappings":";;;;;;;;;;;AAgDO,IAAM,aAAA,GAAgB,E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AC,KAAA;AAAA,EAAA;AAAA,IACC,SAAA,EAAW,EAAA,CAAG,eAAA,EAAiB,QAAA,EAAU,SAAS,CAAA;AAAA,IACjD,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AAKK,IAAM,OAAA,GAAU;AAAA,EACrB,IAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,QAAQA,SAAA,CAAW,MAAA;AAAA,EACnB,OAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF","file":"chunk-6GDMSENK.js","sourcesContent":["\"use client\"\n\nimport { Popover as ArkPopover, usePopoverContext } from \"@ark-ui/react/popover\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { cva } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type MouseEvent,\n type PointerEvent,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport type { UnavailableProps } from \"../../lib/available-if\"\nimport { cn } from \"../../lib/cn\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport {\n OverlayLayerProvider,\n type OverlayLayers,\n useLayerGuard,\n useNestedLayer,\n} from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\n\n/*\n * Shared popover presentation. Co-located with the Popover component and reused\n * across the form family (Combobox / Select / TreeSelect / TagsInput); Ark's\n * Select / Combobox expose different part components, so these class generators\n * are applied to each machine's own parts — keeping every popover surface\n * visually identical and cheap to retheme.\n */\n\n/** Shared floating-panel chrome — border, surface, shadow, layering token, and\n * the open/close animation (origin follows `data-placement`). Every popover\n * surface builds on this so they stay visually identical. Exported so overlays\n * that aren't scroll-clipping listboxes (e.g. Menu) can build their own surface\n * on the exact same border/shadow/animation without drift.\n *\n * Brand-tinted surface, matching `InputBase`'s shell (`border-brand-900/20\n * dark:border-white/15`): the fill sits at the two extreme ends of the brand\n * scale (`brand-50` / `brand-950`, near-white/near-black) so floating panels\n * read as part of the same brand-derived surface family as inputs rather than\n * a neutral gray. The backdrop blur stays; only the fill/border are tinted. */\nexport const popoverChrome = cn(\n \"rounded-input border border-brand-900/20 dark:border-white/15\",\n \"bg-brand-50/90 dark:bg-brand-950/85\",\n \"backdrop-blur-sm\",\n \"shadow-lg focus:outline-none\",\n \"data-[state=open]:animate-popover-in data-[state=closed]:animate-popover-out\",\n \"data-[placement^=top]:origin-bottom data-[placement^=bottom]:origin-top\",\n)\n\n/** Outer chrome for the machine-driven listboxes (Combobox / Select / Autocomplete\n * / MultiSelect): border, surface, shadow, and the open/close animation. It's a\n * rounded **clipping** wrapper (`overflow-hidden`), NOT the scroller — the inner\n * `popoverList` scrolls, and this clip rounds that scrollbar's corners on the\n * scrollbar side. Border + clip on one element (like `popoverPanel`) keep the\n * border whole, and `data-state` rides here so the whole box animates in/out and\n * unmounts cleanly — no eaten corner, no floating frame on close. */\nexport const popoverContent = cn(popoverChrome, \"flex w-full flex-col overflow-hidden\")\n\n/** Inner scroll region for the machine-driven listboxes — the actual scroller,\n * nested in `popoverContent`, capped at 16rem via `--available-height`. Has no\n * border/radius of its own; the parent clip rounds its scrollbar corners. Since\n * Content is `overflow-hidden`, the machines can't auto-scroll it natively, so\n * scrolling is routed here via `scrollHighlightedIntoView` (the root's\n * `scrollToIndexFn`). */\nexport const popoverList = cva(\n [\n \"flex w-full flex-col ps-1 pe-1 pb-1\",\n \"overflow-y-auto overscroll-contain\",\n \"max-h-[min(16rem,var(--available-height,16rem))]\",\n ],\n {\n variants: {\n withPaddingTop: {\n true: \"pt-1\",\n },\n },\n },\n)\n\n/** Scroll the highlighted option into view from inside the `popoverList` scroller.\n * Wired as the combobox/select root's `scrollToIndexFn` so the machine routes\n * scrolling through here instead of its native path — which early-returns unless\n * the (now `overflow-hidden`) Content is itself scrollable. Native `scrollIntoView`\n * walks to the nearest scrollable ancestor, i.e. the List. */\nexport const scrollHighlightedIntoView = ({\n getElement,\n}: {\n getElement: () => HTMLElement | null\n}) => getElement()?.scrollIntoView({ block: \"nearest\" })\n\n/** Panel chrome for the `Popover` component — NOT a scroll container: it clips\n * its children so fixed Header/Footer and the scrolling Body sit flush inside\n * the rounded border. Pair with `popoverViewport`. Its own `overflow-hidden`\n * never clips its own shadow, and the inner Body's scrollbar is rounded by this\n * panel's clip — so it doesn't need `scrollbar-soft`. */\nexport const popoverPanel = cn(popoverChrome, \"flex flex-col overflow-hidden\")\n\n/** The scroll region inside a `Popover` panel (its `Body`). Height tracks the\n * positioner's `--available-height`, capped at 24rem. */\nexport const popoverViewport = cn(\n \"flex flex-col overflow-y-auto overscroll-contain p-1\",\n \"max-h-[min(24rem,var(--available-height,24rem))]\",\n)\n\n/** Trigger chevron — base look; add rotation per machine\n * (`data-[state=open]:rotate-180`, or `open && \"rotate-180\"`). */\nexport const popoverChevron =\n \"shrink-0 text-gray-light-500 transition-transform dark:text-gray-dark-400\"\n\n/** Clear (×) button — shared by Combobox / Select / TagsInput / NumberInput clear triggers. */\nexport const popoverClearTrigger =\n \"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-full text-gray-light-500 transition-colors hover:text-gray-light-700 dark:text-gray-dark-400 dark:hover:text-gray-dark-200\"\n\n/** A single option row. Highlight is `data-highlighted`, selection is\n * `data-state=checked`, both owned by the Ark machine. Highlight is neutral\n * and transparent — a low-opacity black/white wash, not an opaque gray —\n * matching the surface's own background-dependent tint (no Figma reference\n * for this specific state yet, so this is a considered default, not an\n * extracted value). */\nexport const popoverOption = cva(\n [\n \"relative flex cursor-pointer items-center gap-2 rounded-sm\",\n \"select-none outline-none\",\n \"text-gray-light-900 dark:text-gray-dark-100\",\n \"data-highlighted:bg-black/5 dark:data-highlighted:bg-white/8\",\n \"data-[state=checked]:font-medium\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n ],\n {\n variants: {\n size: {\n xs: \"px-2 py-1 text-xs\",\n sm: \"px-2 py-1 text-sm\",\n md: \"px-2.5 py-1.5 text-md\",\n lg: \"px-3 py-2 text-lg\",\n xl: \"px-3.5 py-2.5 text-xl\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n/** The check / selected indicator slot at the inline-end of an option. */\nexport const popoverIndicator =\n \"ms-auto inline-flex shrink-0 items-center text-(--c-solid) [&_svg]:size-4\"\n\n/** Presentational checkbox for a multi-select option row — a box that fills\n * once its parent row carries `data-state=\"checked\"` (needs `group/item` on\n * the row; the check icon itself should still be an `Ark.ItemIndicator` so it\n * only mounts when selected). Modeled on `TreeMultiSelect`'s local\n * `treeCheckbox`, generalized off `data-state` instead of that component's own\n * hand-rolled `data-checked`/`data-mixed` (there's no tri-state \"mixed\" outside\n * a tree, so this only needs the one variant). */\nexport const popoverCheckbox = cva(\n [\n \"inline-flex shrink-0 items-center justify-center rounded-xs border transition-colors\",\n \"border-gray-light-300 dark:border-gray-dark-700\",\n \"bg-gray-light-25 dark:bg-gray-dark-900\",\n \"text-(--c-on-solid)\",\n \"group-data-[state=checked]/item:border-(--c-solid) group-data-[state=checked]/item:bg-(--c-solid)\",\n ],\n {\n variants: {\n size: {\n xs: \"size-3.5 [&_svg]:size-2.5\",\n sm: \"size-4 [&_svg]:size-3\",\n md: \"size-4 [&_svg]:size-3\",\n lg: \"size-4.5 [&_svg]:size-3.5\",\n xl: \"size-5 [&_svg]:size-4\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n/** Group heading above a set of options. */\nexport const popoverGroupLabel =\n \"px-2 py-1.5 text-xs font-medium select-none text-gray-light-500 dark:text-gray-dark-400\"\n\n/** Empty / nothing-found message. */\nexport const popoverEmpty =\n \"px-2 py-6 text-center text-sm select-none text-gray-light-500 dark:text-gray-dark-400\"\n\n/**\n * Popover — the kit's floating panel, a styled layer over Ark UI's Popover.\n *\n * <Popover.Root open={open} onOpenChange={...}>\n * <Popover.Trigger asChild><button>…</button></Popover.Trigger>\n * <Popover.Content>\n * <Popover.Header>…</Popover.Header> // optional fixed slot\n * <Popover.Body>…</Popover.Body> // the scroll region\n * <Popover.Footer>…</Popover.Footer> // optional fixed slot\n * </Popover.Content>\n * </Popover.Root>\n *\n * It's a *panel*, not a menu: hosts (TreeSelect, custom pickers) render their own\n * rows inside `Body`. Portaled by default (escapes `overflow:hidden` ancestors),\n * width-matched to the trigger, and animated via the kit's `popover-in/out`.\n *\n * `mode=\"hover\"` adds a delayed hover preview on top of the click: hovering the\n * trigger opens the panel after `openDelay` without moving focus, and leaving\n * both the trigger and the panel closes it after `closeDelay`. A click, a tap\n * or Enter/Space on the trigger — or a press or focus inside a previewing\n * panel — *pins* it: from then on it behaves as a plain Popover (focus moves\n * in, pointer-leave is ignored, Escape / outside click / Tab out dismisses).\n * It's the interactive counterpart of `HoverCard`, whose content is a\n * mouse-only, unfocusable link preview by design (Ark's HoverCard ignores\n * touch and never takes focus).\n */\n\ntype PopoverPosition = NonNullable<NonNullable<ArkPopover.RootProps[\"positioning\"]>[\"placement\"]>\n\n/** Elements a pinned panel can move focus to — the first one wins, else the\n * panel itself (it carries `tabIndex={-1}`). Mirrors what zag's own\n * `autoFocus` picks on a fresh open, which the upgrade path can't reuse: zag\n * only runs it on entering the open state, and an upgraded preview is\n * already open. */\nconst tabbableSelector = [\n \"a[href]\",\n \"button:not(:disabled)\",\n \"input:not(:disabled):not([type=hidden])\",\n \"select:not(:disabled)\",\n \"textarea:not(:disabled)\",\n \"[contenteditable=true]\",\n \"[tabindex]:not([tabindex='-1'])\",\n].join(\",\")\n\n/** How a `mode=\"hover\"` panel was opened: `\"hover\"` is the delayed,\n * focus-free preview; `\"press\"` is the pinned, regular Popover. */\ntype HoverSource = \"hover\" | \"press\"\n\ntype PopoverHover = {\n /** Open and opened by a press (or upgraded from a preview). */\n pinned: boolean\n /** Pointer entering the trigger or the panel. */\n onPointerEnter: (event: PointerEvent) => void\n /** Pointer leaving the trigger or the panel. */\n onPointerLeave: (event: PointerEvent) => void\n /** A trigger click about to reach Ark — flags a click on an open preview,\n * so the close Ark answers it with becomes a pin instead. */\n onTriggerClickCapture: (event: MouseEvent<HTMLElement>) => void\n /** A press or focus inside the panel. */\n pin: () => void\n}\n\ntype PopoverContextValue = {\n width: \"target\" | \"auto\"\n withinPortal: boolean\n container?: HTMLElement | null\n /** Open layers nested in this popover; see `lib/overlay-layer.tsx`. */\n layers: OverlayLayers\n /** Set only in `mode=\"hover\"`. */\n hover?: PopoverHover\n}\nconst PopoverContext = createContext<PopoverContextValue>({\n width: \"target\",\n withinPortal: true,\n layers: new Set(),\n})\n\ntype PopoverHoverDelays = {\n /** Hover time in ms before the preview opens. Default `600`, like `HoverCard`. */\n openDelay?: number\n /** Time in ms after the pointer leaves the trigger and the panel before the\n * preview closes. Default `300`, like `HoverCard`. A pinned panel ignores it. */\n closeDelay?: number\n}\n\n/** `openDelay`/`closeDelay` only mean something with `mode=\"hover\"`, so a\n * click popover rejects them at compile time instead of dropping them. */\ntype PopoverModeProps =\n | ({\n /** `\"click\"` (default) opens on click/tap/Enter only. `\"hover\"` also\n * opens a delayed, focus-free preview on hover, which a click, or a\n * press or focus inside it, pins open as a regular popover. */\n mode?: \"click\"\n } & UnavailableProps<PopoverHoverDelays, 'requires mode=\"hover\"'>)\n | ({ mode: \"hover\" } & PopoverHoverDelays)\n\nexport type PopoverProps = ArkPopover.RootProps &\n PopoverModeProps & {\n /** Match the trigger's width (`\"target\"`, default) or size to content (`\"auto\"`). */\n width?: \"target\" | \"auto\"\n /** Panel placement relative to the trigger. Defaults to Ark's `\"bottom\"`. */\n position?: PopoverPosition\n /** Gap in px between the trigger and the panel. */\n gutter?: number\n /** Positionner offset */\n offset?:\n | {\n mainAxis?: number | undefined\n crossAxis?: number | undefined\n }\n | undefined\n /** Hide the panel (`visibility: hidden`, no pointer events) once the\n * trigger is fully clipped by its own scrolling ancestor, and restore it\n * once back in view — Floating UI's `hide()` middleware\n * (`strategy: \"referenceHidden\"`), already wired into Ark's positioning\n * engine, just not exposed until now. Rides the positioner's existing\n * scroll/resize listeners, so no extra observer is needed. Default `true`\n * — a panel that can't see its own trigger is never in a state worth\n * keeping visible; pass `false` to restore the old \"keep following the\n * trigger's last known position\" behavior. */\n hideWhenDetached?: boolean\n /** Ark's full positioning options (`flip`, `slide`, `overlap`, `boundary`,\n * `getAnchorElement`, …), for placements the props above can't express.\n * Applied over them, so a key set here wins. */\n positioning?: ArkPopover.RootProps[\"positioning\"]\n\n /** Render the panel in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Fires on close (any source) — Escape, outside interaction, or a controlled `onOpenChange`. */\n onClose?: () => void\n }\n\n/** A `Unavailable`-branded delay narrows back to its default. */\nconst delay = (value: unknown, fallback: number) => (typeof value === \"number\" ? value : fallback)\n\n/** Focus the first tabbable element of the panel a trigger controls, else the\n * panel itself — on the next frame, once the pin has re-rendered. */\nconst focusInto = (trigger: HTMLElement, initialFocusEl?: () => HTMLElement | null) =>\n requestAnimationFrame(() => {\n const id = trigger.getAttribute(\"aria-controls\")\n const panel = id ? trigger.ownerDocument.getElementById(id) : null\n if (!panel || panel.contains(trigger.ownerDocument.activeElement)) return\n const target = initialFocusEl?.() ?? panel.querySelector<HTMLElement>(tabbableSelector) ?? panel\n target.focus({ preventScroll: true })\n })\n\ntype UsePopoverHoverOptions = {\n open?: boolean\n defaultOpen?: boolean\n openDelay: number\n closeDelay: number\n autoFocus: boolean\n initialFocusEl?: () => HTMLElement | null\n onChange: (open: boolean) => void\n}\n\n/**\n * `mode=\"hover\"`'s state: owns `open` (still controllable through\n * `open`/`defaultOpen`/`onOpenChange`) and *how* it was opened, and drives\n * Ark's machine fully controlled. The hover path never goes through Ark —\n * zag's Popover has no hover — it just flips `open` on a timer. Everything\n * else is Ark's: its trigger click, Escape and outside-click arrive as\n * `onArkOpenChange`, and the only one rewritten is a click on an open preview,\n * which zag answers with a close and this turns into a pin.\n *\n * `source` is deliberately not reset on close: zag reads `restoreFocus` when\n * the close lands, so a preview closing must still read as `\"hover\"` there,\n * or it would yank focus to a trigger the user never focused.\n */\nconst usePopoverHover = ({\n open,\n defaultOpen,\n openDelay,\n closeDelay,\n autoFocus,\n initialFocusEl,\n onChange,\n}: UsePopoverHoverOptions) => {\n const [isOpen, setOpen] = useUncontrolled<boolean>({\n value: open,\n defaultValue: defaultOpen,\n finalValue: false,\n onChange,\n })\n const [source, setSource] = useState<HoverSource>(\"press\")\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n // The trigger of a click that landed on an open preview, between its\n // capture phase and the close Ark answers it with.\n const upgrading = useRef<HTMLElement | null>(null)\n const clear = () => {\n clearTimeout(timer.current)\n timer.current = undefined\n }\n // Unmount only; reads the ref at cleanup time, so it needs no deps.\n useEffect(() => () => clearTimeout(timer.current), [])\n const later = (next: boolean, ms: number) => {\n clear()\n timer.current = setTimeout(() => {\n timer.current = undefined\n setOpen(next)\n }, ms)\n }\n\n const pinned = isOpen && source === \"press\"\n const hover: PopoverHover = {\n pinned,\n onPointerEnter: (event) => {\n if (event.pointerType === \"touch\" || pinned) return\n if (isOpen) return clear()\n setSource(\"hover\")\n later(true, openDelay)\n },\n onPointerLeave: (event) => {\n if (event.pointerType === \"touch\" || pinned) return\n if (isOpen) later(false, closeDelay)\n else clear()\n },\n onTriggerClickCapture: (event) => {\n upgrading.current = isOpen && source === \"hover\" ? event.currentTarget : null\n },\n pin: () => {\n clear()\n setSource(\"press\")\n },\n }\n\n const onArkOpenChange = ({ open: next }: { open: boolean }) => {\n clear()\n const trigger = upgrading.current\n upgrading.current = null\n if (!next && trigger) {\n setSource(\"press\")\n if (autoFocus) focusInto(trigger, initialFocusEl)\n return\n }\n if (next) setSource(\"press\")\n setOpen(next)\n }\n\n return { open: isOpen, press: source === \"press\", hover, onArkOpenChange }\n}\n\nconst Root = ({\n mode = \"click\",\n openDelay,\n closeDelay,\n width = \"target\",\n position,\n gutter,\n offset,\n hideWhenDetached = true,\n positioning,\n withinPortal = true,\n container,\n children,\n open,\n defaultOpen,\n autoFocus = true,\n restoreFocus = true,\n modal = false,\n onOpenChange,\n onClose,\n onPointerDownOutside,\n ...rest\n}: PopoverProps) => {\n const guard = useLayerGuard(onPointerDownOutside)\n const notify = (details: { open: boolean }) => {\n onOpenChange?.(details)\n if (!details.open) onClose?.()\n }\n const hovering = usePopoverHover({\n open,\n defaultOpen,\n openDelay: delay(openDelay, 600),\n closeDelay: delay(closeDelay, 300),\n autoFocus,\n initialFocusEl: rest.initialFocusEl,\n onChange: (next) => notify({ open: next }),\n })\n const hover = mode === \"hover\" ? hovering.hover : undefined\n // A preview is never modal and never moves or restores focus; a pinned\n // panel takes the consumer's settings. zag reads all three on entering or\n // leaving the open state, which `source` is stable across.\n const press = !hover || hovering.press\n const state = hover\n ? { open: hovering.open, onOpenChange: hovering.onArkOpenChange }\n : { open, defaultOpen, onOpenChange: notify }\n return (\n <PopoverContext.Provider\n value={{ width, withinPortal, container, layers: guard.layers, hover }}\n >\n <ArkPopover.Root\n onPointerDownOutside={guard.onPointerDownOutside}\n positioning={{\n sameWidth: width === \"target\",\n placement: position,\n gutter,\n offset,\n hideWhenDetached,\n ...positioning,\n }}\n autoFocus={press && autoFocus}\n restoreFocus={press && restoreFocus}\n modal={press && modal}\n {...state}\n {...rest}\n >\n {children}\n </ArkPopover.Root>\n </PopoverContext.Provider>\n )\n}\n\nexport type PopoverTriggerProps = ArkPopover.TriggerProps\n\n/** Ark's trigger, plus the hover handlers in `mode=\"hover\"`. Ark merges them\n * with its own, so `asChild` and the click/keyboard toggle are untouched. */\nconst Trigger = ({\n onPointerEnter,\n onPointerLeave,\n onClickCapture,\n ...rest\n}: PopoverTriggerProps) => {\n const { hover } = useContext(PopoverContext)\n return (\n <ArkPopover.Trigger\n onPointerEnter={(event) => {\n onPointerEnter?.(event)\n hover?.onPointerEnter(event)\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event)\n hover?.onPointerLeave(event)\n }}\n onClickCapture={(event) => {\n onClickCapture?.(event)\n hover?.onTriggerClickCapture(event)\n }}\n {...rest}\n />\n )\n}\n\nexport type PopoverContentProps = NoAsChild<ArkPopover.ContentProps> & WithTestId\n\nconst Content = ({\n className,\n children,\n testId,\n onPointerEnter,\n onPointerLeave,\n onPointerDown,\n onFocus,\n asChild: _asChild,\n ...rest\n}: PopoverContentProps) => {\n const { width, withinPortal, container, layers, hover } = useContext(PopoverContext)\n const portalContainer = useOverlayContainer(container)\n // A child of the enclosing Modal/Drawer/Popover (read above this popover's\n // own provider), and the parent of whatever opens from its body.\n useNestedLayer(usePopoverContext().open)\n const panel = (\n <ArkPopover.Positioner>\n <ArkPopover.Content\n tabIndex={-1}\n // target → fill the sameWidth positioner; auto → size to content (max-content).\n className={cn(popoverPanel, width === \"target\" ? \"w-full\" : \"w-max\", className)}\n {...props({ \"data-testid\": testId })}\n // In `mode=\"hover\"`: reaching the panel keeps a preview open, and\n // pressing or focusing anything in it (a click, or Tab through\n // zag's `proxyTabFocus`) pins it.\n onPointerEnter={(event) => {\n onPointerEnter?.(event)\n hover?.onPointerEnter(event)\n }}\n onPointerLeave={(event) => {\n onPointerLeave?.(event)\n hover?.onPointerLeave(event)\n }}\n onPointerDown={(event) => {\n onPointerDown?.(event)\n hover?.pin()\n }}\n onFocus={(event) => {\n onFocus?.(event)\n hover?.pin()\n }}\n {...rest}\n >\n <OverlayLayerProvider value={layers}>{children}</OverlayLayerProvider>\n </ArkPopover.Content>\n </ArkPopover.Positioner>\n )\n if (!withinPortal) return panel\n return <Portal container={portalContainer}>{panel}</Portal>\n}\n\nconst slotEdge = \"shrink-0 px-2 py-1.5 border-brand-900/20 dark:border-white/15\"\n\nexport type PopoverHeaderProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n/** Fixed slot above the scrolling Body — a search input, filters, etc. */\nconst Header = ({ className, testId, ...rest }: PopoverHeaderProps) => (\n <div\n className={cn(slotEdge, \"border-b\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type PopoverFooterProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n/** Fixed slot below the scrolling Body. */\nconst Footer = ({ className, testId, ...rest }: PopoverFooterProps) => (\n <div className={cn(slotEdge, className)} {...props({ \"data-testid\": testId })} {...rest} />\n)\n\nexport type PopoverBodyProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\n/** The scroll region; hosts render their rows (and any empty message) here. */\nconst Body = ({ className, testId, ...rest }: PopoverBodyProps) => (\n <div\n className={cn(popoverViewport, slotEdge, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type PopoverAnchorProps = ArkPopover.AnchorProps\n\nexport const Popover = {\n Root,\n Trigger,\n /** Positions the panel without attaching any click/keyboard trigger\n * semantics — for a host that already owns its own click resolution\n * (e.g. `Schedule`'s drag-vs-click gesture) and only needs the panel to\n * float relative to a given element. */\n Anchor: ArkPopover.Anchor,\n Content,\n Header,\n Body,\n Footer,\n}\n"]}
@@ -1,8 +1,9 @@
1
- import { inputSlot, inputShell, inputControlClasses } from './chunk-QMW7D5GU.js';
2
- import { scrollHighlightedIntoView, popoverChevron, popoverClearTrigger, popoverList, popoverContent, popoverIndicator, popoverOption, popoverGroupLabel, popoverEmpty } from './chunk-VZ2TPU4B.js';
1
+ import { inputSlot, inputShell, inputControlClasses } from './chunk-5OQLFX47.js';
2
+ import { scrollHighlightedIntoView, popoverChevron, popoverClearTrigger, popoverList, popoverContent, popoverIndicator, popoverOption, popoverGroupLabel, popoverEmpty } from './chunk-6GDMSENK.js';
3
3
  import { useNestedLayer } from './chunk-AIQG7IIT.js';
4
4
  import { useOverlayContainer } from './chunk-7P32XCEU.js';
5
5
  import { ChevronIcon, CloseIcon, CheckIcon } from './chunk-IG7FBZVM.js';
6
+ import { composeChildren } from './chunk-I4SQQIP5.js';
6
7
  import { props } from './chunk-WYCMIIRR.js';
7
8
  import { cn } from './chunk-QP4I37PA.js';
8
9
  import { Combobox as Combobox$1, useComboboxContext } from '@ark-ui/react/combobox';
@@ -39,6 +40,7 @@ var Control = ({
39
40
  className,
40
41
  children,
41
42
  testId,
43
+ asChild: _asChild,
42
44
  ...rest
43
45
  }) => {
44
46
  const { size, variant } = useContext(ComboboxStyleContext);
@@ -72,6 +74,7 @@ var Input = ({ className, testId, ...rest }) => /* @__PURE__ */ jsx(
72
74
  var Trigger = ({
73
75
  className,
74
76
  children,
77
+ asChild,
75
78
  ...rest
76
79
  }) => /* @__PURE__ */ jsx(
77
80
  Combobox$1.Trigger,
@@ -82,19 +85,30 @@ var Trigger = ({
82
85
  "data-[state=open]:rotate-180 disabled:cursor-not-allowed",
83
86
  className
84
87
  ),
88
+ asChild,
85
89
  ...rest,
86
- children: children ?? /* @__PURE__ */ jsx(ChevronIcon, {})
90
+ children: composeChildren(asChild, children, (own) => own ?? /* @__PURE__ */ jsx(ChevronIcon, {}))
87
91
  }
88
92
  );
89
93
  var ClearTrigger = ({
90
94
  className,
91
95
  children,
96
+ asChild,
92
97
  ...rest
93
98
  }) => (
94
99
  // zag marks the combobox clear control `tabIndex={-1}`; surface it in the tab
95
100
  // order so keyboard users can reach it (matching Select's clear and the tree
96
101
  // clears). A caller can still override via `tabIndex` in `rest`.
97
- /* @__PURE__ */ jsx(Combobox$1.ClearTrigger, { tabIndex: 0, className: cn(popoverClearTrigger, className), ...rest, children: children ?? /* @__PURE__ */ jsx(CloseIcon, {}) })
102
+ /* @__PURE__ */ jsx(
103
+ Combobox$1.ClearTrigger,
104
+ {
105
+ tabIndex: 0,
106
+ className: cn(popoverClearTrigger, className),
107
+ asChild,
108
+ ...rest,
109
+ children: composeChildren(asChild, children, (own) => own ?? /* @__PURE__ */ jsx(CloseIcon, {}))
110
+ }
111
+ )
98
112
  );
99
113
  var Content = ({
100
114
  className,
@@ -102,6 +116,7 @@ var Content = ({
102
116
  withPaddingTop = true,
103
117
  withinPortal = true,
104
118
  container,
119
+ asChild: _asChild,
105
120
  ...rest
106
121
  }) => {
107
122
  const portalContainer = useOverlayContainer(container);
@@ -112,11 +127,12 @@ var Panel = ({
112
127
  className,
113
128
  children,
114
129
  withPaddingTop = true,
130
+ asChild: _asChild,
115
131
  ...rest
116
132
  }) => {
117
133
  return /* @__PURE__ */ jsx(Combobox$1.Content, { ...rest, children: /* @__PURE__ */ jsx(Combobox$1.List, { className: cn(popoverList({ withPaddingTop }), className), children }) });
118
134
  };
119
- var Item = ({ className, children, testId, ...rest }) => {
135
+ var Item = ({ className, children, testId, asChild: _asChild, ...rest }) => {
120
136
  const { size } = useContext(ComboboxStyleContext);
121
137
  return /* @__PURE__ */ jsx(
122
138
  Combobox$1.Item,
@@ -131,7 +147,7 @@ var Item = ({ className, children, testId, ...rest }) => {
131
147
  }
132
148
  );
133
149
  };
134
- var Group = ({ label, className, children, ...rest }) => /* @__PURE__ */ jsxs(Combobox$1.ItemGroup, { className, ...rest, children: [
150
+ var Group = ({ label, className, children, asChild: _asChild, ...rest }) => /* @__PURE__ */ jsxs(Combobox$1.ItemGroup, { className, ...rest, children: [
135
151
  label != null && /* @__PURE__ */ jsx(Combobox$1.ItemGroupLabel, { className: popoverGroupLabel, children: label }),
136
152
  children
137
153
  ] });
@@ -151,5 +167,5 @@ var Combobox = {
151
167
  };
152
168
 
153
169
  export { Combobox };
154
- //# sourceMappingURL=chunk-TNNH3FVQ.js.map
155
- //# sourceMappingURL=chunk-TNNH3FVQ.js.map
170
+ //# sourceMappingURL=chunk-6OLTJYSX.js.map
171
+ //# sourceMappingURL=chunk-6OLTJYSX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/combobox/combobox.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;AAuEA,IAAM,uBAAuB,aAAA,CAA6B;AAAA,EACxD,IAAA,EAAM,IAAA;AAAA,EACN,OAAA,EAAS;AACX,CAAC,CAAA;AAi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AW,mBAAoB,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,EAE1D;AAAA,CAAA,EACH,CAAA;AAGF,IAAM,QAAQ,CAAC,EAAE,SAAA,EAAW,GAAG,MAAK,qBAClC,GAAA,CAACA,UAAA,CAAI,KAAA,EAAJ,EAAU,SAAA,EAAW,EAAA,CAAG,cAAc,SAAS,CAAA,EAAI,GAAG,IAAA,EAAM,CAAA;AAOxD,IAAM,QAAA,GAAW;AAAA,EACtB,IAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,SAASA,UAAA,CAAI;AACf","file":"chunk-6OLTJYSX.js","sourcesContent":["\"use client\"\n\nimport { Combobox as Ark, useComboboxContext } from \"@ark-ui/react/combobox\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport {\n type ComponentProps,\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n useContext,\n} from \"react\"\nimport { composeChildren, type NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { useNestedLayer } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { ItemRenderState } from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n} from \"../input/input\"\nimport { CheckIcon, ChevronIcon, CloseIcon } from \"../popover/icons\"\nimport {\n popoverChevron,\n popoverClearTrigger,\n popoverContent,\n popoverEmpty,\n popoverGroupLabel,\n popoverIndicator,\n popoverList,\n popoverOption,\n scrollHighlightedIntoView,\n} from \"../popover/popover\"\n\n/**\n * Combobox — the kit's composable search-select primitive, a thin styled layer\n * over Ark UI's Combobox parts. It's the engine `Autocomplete` and `MultiSelect`\n * build on, and the escape hatch when the data-driven components don't fit.\n *\n * Compose the parts yourself, Ark-style — pass a `collection`\n * (`createListCollection`, re-exported here), filter it on input change, and\n * render `Combobox.Item`s from it:\n *\n * const collection = createListCollection({ items });\n * <Combobox.Root collection={collection} onInputValueChange={...}>\n * <Combobox.Control>\n * <Combobox.Input />\n * <Combobox.Trigger />\n * </Combobox.Control>\n * <Combobox.Content>\n * {items.map((i) => <Combobox.Item key={i.value} item={i}>{i.label}</Combobox.Item>)}\n * <Combobox.Empty>Nothing found</Combobox.Empty>\n * </Combobox.Content>\n * </Combobox.Root>\n *\n * `Content` is the floating popover panel (Portal + Positioner + card chrome) —\n * the right choice behind a `Trigger`. For a combobox that renders permanently\n * open inside a container you already own (no trigger of its own — see\n * `ComboboxList` / `MultiComboboxList`), use `Panel` instead: same `Ark.Content`\n * + `Ark.List` wiring, no Portal/Positioner/card chrome.\n *\n * `size` / `variant` / `color` set once on `Root` flow to the control and\n * options through context. Ark owns the state machine: filtering contract,\n * keyboard nav, `multiple`, custom values, RTL, and Field wiring.\n */\n\ntype ComboboxStyle = { size: InputSize; variant: InputVariant }\nconst ComboboxStyleContext = createContext<ComboboxStyle>({\n size: \"md\",\n variant: \"default\",\n})\n\nexport type ComboboxRootProps<T extends Ark.CollectionItem = Ark.CollectionItem> = Omit<\n Ark.RootProps<T>,\n \"color\" | \"className\"\n> &\n WithTestId & {\n /** Control + option sizing. Flows to the parts via context. */\n size?: InputSize\n /** Control shell treatment. */\n variant?: InputVariant\n /** Focus-ring accent for the control. */\n className?: string\n }\n\n// Generic over the collection item type (like Ark's Root) so a typed\n// `ListCollection<T>` flows through without widening to `unknown`.\nconst Root = <T extends Ark.CollectionItem = Ark.CollectionItem>({\n size = \"md\",\n variant = \"default\",\n positioning,\n className,\n children,\n testId,\n ...rest\n}: ComboboxRootProps<T>) => (\n <ComboboxStyleContext.Provider value={{ size, variant }}>\n <Ark.Root\n // Match the popover width to the control by default; callers can override.\n positioning={{ sameWidth: true, ...positioning }}\n // The popover's Content is an `overflow-hidden` clip wrapper, so the\n // machine's native auto-scroll (which needs Content to be scrollable) is a\n // no-op; route scrolling to the inner List scroller instead. Callers in\n // `rest` can still override.\n scrollToIndexFn={scrollHighlightedIntoView}\n className={cn(\"w-full\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children}\n </Ark.Root>\n </ComboboxStyleContext.Provider>\n)\n\nexport type ComboboxControlProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Control>> &\n WithTestId & {\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the composed Trigger / ClearTrigger. */\n endSlot?: ReactNode\n }\n\nconst Control = ({\n startSlot,\n endSlot,\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: ComboboxControlProps) => {\n const { size, variant } = useContext(ComboboxStyleContext)\n return (\n <Ark.Control\n {...props({\n \"data-with-start-slot\": startSlot != null,\n // The composed Trigger / ClearTrigger always sits at the end.\n \"data-with-end-slot\": true,\n \"data-testid\": testId,\n })}\n className={cn(inputShell({ size, variant }), className)}\n {...rest}\n >\n {startSlot != null && (\n <span className={inputSlot} aria-hidden>\n {startSlot}\n </span>\n )}\n {children}\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n </Ark.Control>\n )\n}\n\n// `ComponentProps` (not `…WithoutRef`) so a caller's `ref` reaches the underlying\n// `<input>` — it's the focus target for the form-control contract (focus-on-error).\nconst Input = ({ className, testId, ...rest }: ComponentProps<typeof Ark.Input> & WithTestId) => (\n <Ark.Input\n className={cn(inputControlClasses, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nconst Trigger = ({\n className,\n children,\n asChild,\n ...rest\n}: ComponentPropsWithoutRef<typeof Ark.Trigger>) => (\n <Ark.Trigger\n className={cn(\n popoverChevron,\n \"inline-flex cursor-pointer items-center justify-center rounded-sm\",\n \"data-[state=open]:rotate-180 disabled:cursor-not-allowed\",\n className,\n )}\n asChild={asChild}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => own ?? <ChevronIcon />)}\n </Ark.Trigger>\n)\n\nconst ClearTrigger = ({\n className,\n children,\n asChild,\n ...rest\n}: ComponentPropsWithoutRef<typeof Ark.ClearTrigger>) => (\n // zag marks the combobox clear control `tabIndex={-1}`; surface it in the tab\n // order so keyboard users can reach it (matching Select's clear and the tree\n // clears). A caller can still override via `tabIndex` in `rest`.\n <Ark.ClearTrigger\n tabIndex={0}\n className={cn(popoverClearTrigger, className)}\n asChild={asChild}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => own ?? <CloseIcon />)}\n </Ark.ClearTrigger>\n)\n\nconst Content = ({\n className,\n children,\n withPaddingTop = true,\n withinPortal = true,\n container,\n asChild: _asChild,\n ...rest\n}: NoAsChild<ComponentPropsWithoutRef<typeof Ark.Content>> & {\n withPaddingTop?: boolean\n /** Render the panel in a Portal so it escapes clipping ancestors.\n * Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n}) => {\n const portalContainer = useOverlayContainer(container)\n // Holds an enclosing Modal/Drawer/Popover open while the list is; see `lib/overlay-layer.tsx`.\n useNestedLayer(useComboboxContext().open)\n return (\n <Portal disabled={!withinPortal} container={portalContainer}>\n <Ark.Positioner>\n <Ark.Content className={cn(popoverContent, className)} {...rest}>\n <Ark.List className={popoverList({ withPaddingTop })}>{children}</Ark.List>\n </Ark.Content>\n </Ark.Positioner>\n </Portal>\n )\n}\n\n/**\n * Inline alternative to `Content` — no `Portal`, no `Positioner`, no floating\n * chrome. For a combobox meant to render permanently open inside a container\n * the caller already owns (e.g. another `Popover`'s body), where the floating\n * machinery would just be dead weight and the wrong chrome (a card inside a\n * card). `getContentProps` doesn't require a Positioner to work — it's a plain\n * `hidden`-toggled element — so `Ark.Content` renders inline in normal flow.\n */\nconst Panel = ({\n className,\n children,\n withPaddingTop = true,\n asChild: _asChild,\n ...rest\n}: NoAsChild<ComponentPropsWithoutRef<typeof Ark.Content>> & { withPaddingTop?: boolean }) => {\n return (\n <Ark.Content {...rest}>\n <Ark.List className={cn(popoverList({ withPaddingTop }), className)}>{children}</Ark.List>\n </Ark.Content>\n )\n}\n\nexport type ComboboxItemProps = NoAsChild<\n Omit<ComponentPropsWithoutRef<typeof Ark.Item>, \"children\">\n> &\n WithTestId & {\n /**\n * Option content. A plain node renders as the label (the kit adds the check\n * indicator); a function takes over the whole row, receiving the item's live\n * state so it can draw its own affordance.\n */\n children?: ReactNode | ((state: ItemRenderState) => ReactNode)\n }\n\nconst Item = ({ className, children, testId, asChild: _asChild, ...rest }: ComboboxItemProps) => {\n const { size } = useContext(ComboboxStyleContext)\n return (\n <Ark.Item\n className={cn(popoverOption({ size }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {typeof children === \"function\" ? (\n <Ark.ItemContext>\n {(ctx) => children({ selected: ctx.selected, highlighted: ctx.highlighted })}\n </Ark.ItemContext>\n ) : (\n <>\n <Ark.ItemText>{children}</Ark.ItemText>\n <Ark.ItemIndicator className={popoverIndicator}>\n <CheckIcon />\n </Ark.ItemIndicator>\n </>\n )}\n </Ark.Item>\n )\n}\n\nexport type ComboboxGroupProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.ItemGroup>> & {\n /** Group heading rendered above the options. */\n label?: ReactNode\n}\n\nconst Group = ({ label, className, children, asChild: _asChild, ...rest }: ComboboxGroupProps) => (\n <Ark.ItemGroup className={className} {...rest}>\n {label != null && (\n <Ark.ItemGroupLabel className={popoverGroupLabel}>{label}</Ark.ItemGroupLabel>\n )}\n {children}\n </Ark.ItemGroup>\n)\n\nconst Empty = ({ className, ...rest }: ComponentPropsWithoutRef<typeof Ark.Empty>) => (\n <Ark.Empty className={cn(popoverEmpty, className)} {...rest} />\n)\n\n/**\n * Composable parts namespace (Ark-style). `Context` is Ark's render-prop access\n * to the live machine api (e.g. to map over the filtered collection).\n */\nexport const Combobox = {\n Root,\n Control,\n Input,\n Trigger,\n ClearTrigger,\n Content,\n Panel,\n Item,\n Group,\n Empty,\n Context: Ark.Context,\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { PillGroupContext, pill } from './chunk-NGAQITWP.js';
2
- import { inputSlot, inputShell, inputControlClasses } from './chunk-QMW7D5GU.js';
1
+ import { PillGroupContext, pill } from './chunk-Z2Z5EXVT.js';
2
+ import { inputSlot, inputShell, inputControlClasses } from './chunk-5OQLFX47.js';
3
3
  import { props } from './chunk-WYCMIIRR.js';
4
4
  import { cn } from './chunk-QP4I37PA.js';
5
5
  import { ark } from '@ark-ui/react';
@@ -144,6 +144,7 @@ var PillsInputBase = ({
144
144
  classNames,
145
145
  children,
146
146
  testId,
147
+ asChild: _asChild,
147
148
  ...rest
148
149
  }) => {
149
150
  const items = Children.toArray(children);
@@ -219,5 +220,5 @@ var PillsInput = Object.assign(PillsInputBase, {
219
220
  });
220
221
 
221
222
  export { PillOverflowCounter, PillsInput, pillsContent, pillsShell, usePillOverflow };
222
- //# sourceMappingURL=chunk-POKDSVQT.js.map
223
- //# sourceMappingURL=chunk-POKDSVQT.js.map
223
+ //# sourceMappingURL=chunk-AE7QTLJ5.js.map
224
+ //# sourceMappingURL=chunk-AE7QTLJ5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/pills-input/pills-input.tsx"],"names":[],"mappings":";;;;;;;;;AAoDO,IAAM,UAAA,GAAa,GAAG,aAAa;AAMnC,IAAM,YAAA,GAAe,IAAI,2DAAA,EAA6D;AAAA,EAC3F,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,OAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI;AAAA;AACN,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,IAAA,EAAM,IAAA;AAC3B,CAAC;AAKD,IAAM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,CAAC;AAAA,EACvB,SAAA;AAAA,EACA,YAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACE,GAAA;AAAA,EAAC,OAAA;AAAA,EAAA;AAAA,IAEC,qBAAA,EAAmB,IAAA;AAAA,IAGnB,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,iBAAA,EAAmB,SAAS,CAAA;AAAA,IAC/D,SAAA,EAAW,CAAC,KAAA,KAAU;AACpB,MAAA,IAAI,gBAAgB,KAAA,CAAM,GAAA,KAAQ,eAAe,KAAA,CAAM,aAAA,CAAc,UAAU,EAAA,EAAI;AACjF,QAAA,YAAA,EAAa;AAAA,MACf;AACA,MAAA,SAAA,GAAY,KAAK,CAAA;AAAA,IACnB,CAAA;AAAA,IACC,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AAGK,IAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACtD,KAAA,EAAO;AACT,CAAC","file":"chunk-AE7QTLJ5.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport {\n Children,\n type ComponentPropsWithoutRef,\n cloneElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type RefObject,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n} from \"../input/input\"\nimport { PillGroupContext, type PillSize, pill } from \"../pill/pill\"\n\n/**\n * PillsInput — a multi-line input shell that lays out `Pill`s alongside a search\n * field. Same chrome as `Input` (border, focus ring, invalid / disabled states)\n * but it wraps as values accumulate. It's the visual `MultiSelect` and\n * `TagsInput` mount as their target.\n *\n * - It reuses `Input`'s slot layout: a `startSlot` / `endSlot` flank a\n * `pillsContent` region that holds the `Pill`s + the field and is the only\n * thing that wraps, so a trailing control (chevron, clear) pins to the edge\n * instead of wrapping inline with the pills.\n * - Host `Pill`s + a single `PillsInputField` inside it (pills first, field\n * last). The shell sets the pill `size` / `disabled` through context, so the\n * pills match with no prop drilling.\n * - `maxLines` caps the pills at N rows and collapses the rest into a static\n * \"+N\" counter (measured, since pills have variable widths).\n *\n * Presentational by design: the value state lives with the consumer.\n */\n\n/** The pills *row*: same single-line flex shell as `inputShell`, just text-cursor\n * for the click-to-focus affordance. Layout/wrap live on `pillsContent`. */\nexport const pillsShell = cn(\"cursor-text\")\n\n/** The wrapping region inside a pills shell — holds the pills + field, grows to\n * fill the row (`flex-1`), and is the only element that wraps, so the shell's\n * start/end slots stay pinned as `shrink-0` siblings. Gap tracks `inputShell`'s\n * per-size gap so pill spacing is unchanged from the flat layout. */\nexport const pillsContent = cva(\"flex min-w-0 flex-1 flex-wrap items-center py-1 gap-y-0.5\", {\n variants: {\n size: {\n xs: \"gap-1.5\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-2.5\",\n xl: \"gap-3\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\n// `useLayoutEffect` measures before paint (no flash); fall back to `useEffect`\n// on the server so SSR doesn't warn. Measurement is client-only anyway — the\n// server render shows every pill, which is the correct no-cap fallback.\nconst useIsoLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect\n\n/**\n * Pure row-grouping math behind `usePillOverflow` (exported for testing).\n *\n * Given each measured pill's `offsetTop` (in document order), count how many\n * fit within `maxLines` wrapped rows. A jump in `offsetTop` (beyond a sub-pixel\n * epsilon) marks a new row. When the pills overflow, reserve one slot on the\n * last visible row for the \"+N\" counter (it's narrower than a typical pill, so\n * dropping one always makes room).\n */\nexport function visiblePillCount(offsetTops: number[], maxLines: number): number {\n let rows = 0\n let lastTop = Number.NEGATIVE_INFINITY\n for (let i = 0; i < offsetTops.length; i++) {\n const top = offsetTops[i] ?? lastTop\n if (top - lastTop > 1) {\n rows += 1\n lastTop = top\n if (rows > maxLines) {\n // `i` begins the row past the cap — keep the rows before it, minus one\n // for the counter.\n return Math.max(0, i - 1)\n }\n }\n }\n return offsetTops.length\n}\n\n/**\n * Like `visiblePillCount`, but also keeps the trailing input field on the last\n * visible row (exported for testing).\n *\n * `visiblePillCount` only reasons about pills, so when the last visible row is\n * packed, the field — which is `min-w-16` and the last flex child — can't claim\n * its minimum width and wraps onto a new line. A flex item wraps exactly when\n * the space left on its row drops below its `min-width`, so we drop pills until\n * the last visible pill leaves room on its row for `gap + fieldMinWidth` (plus\n * the `+N` counter, once anything is hidden). Pills are passed as their measured\n * `{ top, right }` in a single coordinate space; removing a trailing pill never\n * reflows the ones before it, so each drop is checked against real geometry.\n */\nexport function pillCountWithField(\n pills: { top: number; right: number }[],\n maxLines: number,\n rowRight: number,\n trailing: { fieldMinWidth: number; counterWidth: number; gap: number },\n): number {\n const total = pills.length\n const { fieldMinWidth, counterWidth, gap } = trailing\n // Start from the pill-only cap (already reserves one slot for the counter on\n // overflow), then back off until the field's minimum fits on the last row.\n let visible = visiblePillCount(\n pills.map((p) => p.top),\n maxLines,\n )\n while (visible > 0) {\n const last = pills[visible - 1]\n if (last == null) break\n // Hiding any pill surfaces the \"+N\" counter, which shares the last row.\n const needsCounter = visible < total\n const trailingWidth = gap + fieldMinWidth + (needsCounter ? counterWidth + gap : 0)\n if (last.right + trailingWidth <= rowRight) break\n visible--\n }\n return visible\n}\n\n/**\n * Measure how many pills fit within `maxLines` rows and how many overflow.\n *\n * Line caps are width-dependent (pills vary in width), so this measures the DOM.\n * Pills to be measured must carry `data-overflow-item`; the trailing field and\n * the counter must NOT (they would corrupt row detection) — instead the field\n * carries `data-overflow-field` and the counter `data-overflow-counter` so the\n * hook can locate and measure them without mistaking them for pills. The hook\n * renders the full set during a pre-paint \"measuring\" pass, groups pills into\n * rows, then settles on a `visibleCount` — reserving the last row for the \"+N\"\n * chip and, when a field is present, its `min-width` too, so the field never\n * wraps onto a new line (see `pillCountWithField`). Re-measures on width change\n * only (ignoring the height change our own slicing causes, which would loop).\n *\n * `measuring` is exposed so consumers can render the counter during the\n * measuring pass (it is otherwise hidden when nothing overflows), letting the\n * hook measure its real width for the last-row reservation.\n */\nexport function usePillOverflow({\n maxLines,\n count,\n}: {\n /** Cap the rendered pills at this many rows. Omit to render every pill. */\n maxLines?: number\n /** Total number of pills — drives re-measurement on add / remove. */\n count: number\n}): {\n containerRef: RefObject<HTMLDivElement | null>\n visibleCount: number\n hiddenCount: number\n measuring: boolean\n} {\n const containerRef = useRef<HTMLDivElement>(null)\n const [visibleCount, setVisibleCount] = useState(count)\n // While true, every pill is rendered so the DOM reflects the full set; flipped\n // off (pre-paint) once the cutoff is computed.\n const [measuring, setMeasuring] = useState(true)\n const lastWidth = useRef(0)\n\n // Any change to the inputs re-enters a full-render measuring pass.\n useIsoLayoutEffect(() => {\n setMeasuring(true)\n }, [count, maxLines])\n\n useIsoLayoutEffect(() => {\n if (!measuring) return\n const container = containerRef.current\n if (maxLines == null || container == null) {\n setVisibleCount(count)\n setMeasuring(false)\n return\n }\n const items = Array.from(container.querySelectorAll<HTMLElement>(\"[data-overflow-item]\"))\n lastWidth.current = container.clientWidth\n\n const fieldEl = container.querySelector<HTMLElement>(\"[data-overflow-field]\")\n if (fieldEl == null) {\n // No trailing field (e.g. TreeMultiSelect's read-only trigger) — pills +\n // counter only, the original behavior.\n setVisibleCount(\n visiblePillCount(\n items.map((el) => el.offsetTop),\n maxLines,\n ),\n )\n setMeasuring(false)\n return\n }\n\n // Field-aware: reserve the field's min width (and the counter slot) on the\n // last visible row. Measure in viewport coords via `getBoundingClientRect`\n // so pill edges and the row's right edge share one coordinate space\n // regardless of `offsetParent` (the positioned shell, not this container).\n const style = getComputedStyle(container)\n const gap = Number.parseFloat(style.columnGap || style.gap) || 0\n const rowRight = container.getBoundingClientRect().right\n const fieldMinWidth = Number.parseFloat(getComputedStyle(fieldEl).minWidth) || 0\n const counterEl = container.querySelector<HTMLElement>(\"[data-overflow-counter]\")\n const counterWidth = counterEl?.getBoundingClientRect().width ?? 0\n const pills = items.map((el) => {\n const rect = el.getBoundingClientRect()\n return { top: rect.top, right: rect.right }\n })\n setVisibleCount(\n pillCountWithField(pills, maxLines, rowRight, { fieldMinWidth, counterWidth, gap }),\n )\n setMeasuring(false)\n }, [measuring, count, maxLines])\n\n // Re-measure when the field's width changes (a wider field reveals more\n // pills again). Ignore height-only changes — our own slicing shrinks the\n // height and would otherwise feed back into an infinite measure loop.\n useIsoLayoutEffect(() => {\n const container = containerRef.current\n if (maxLines == null || container == null || typeof ResizeObserver === \"undefined\") {\n return\n }\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0\n if (Math.abs(width - lastWidth.current) < 1) return\n lastWidth.current = width\n setMeasuring(true)\n })\n observer.observe(container)\n return () => observer.disconnect()\n }, [maxLines])\n\n const resolved = maxLines == null || measuring ? count : Math.min(visibleCount, count)\n return {\n containerRef,\n visibleCount: resolved,\n hiddenCount: Math.max(0, count - resolved),\n measuring,\n }\n}\n\nexport type PillOverflowCounterProps = {\n /** How many pills are hidden. */\n count: number\n size?: PillSize\n className?: string\n}\n\n/** Static \"+N\" chip the pill controls render at the end of the visible rows.\n * Non-interactive: the visible \"+N\" is its own accessible text, and the full\n * set stays reachable via the dropdown (where one exists) or the consumer's\n * own state. */\nexport const PillOverflowCounter = ({\n count,\n size = \"md\",\n className,\n}: PillOverflowCounterProps) => (\n <span data-overflow-counter className={cn(pill({ size }), \"tabular-nums\", className)}>\n +{count}\n </span>\n)\n\ntype PillsInputClassNames = {\n root?: string\n content?: string\n startSlot?: string\n endSlot?: string\n}\n\nexport type PillsInputProps = NoAsChild<Omit<HTMLArkProps<\"div\">, \"color\">> &\n WithTestId & {\n size?: InputSize\n variant?: InputVariant\n color?: Color\n invalid?: boolean\n disabled?: boolean\n pointer?: boolean\n /** Cap the pills at N rows; the rest collapse into a static \"+N\" counter. */\n maxLines?: number\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before any trailing control. */\n endSlot?: ReactNode\n classNames?: PillsInputClassNames\n }\n\n/**\n * PillsInput — the wrapping input shell for multi-value fields. Host `Pill`s\n * and a single `PillsInput.Field` inside; the shell sizes and disables them\n * through context. Presentational by design: it holds no value state.\n *\n * `testId` here lands on the shell `<div>` itself — useful when `PillsInput`\n * is used bare. `PillsInput.Field` has its own `testId`, landing on the real\n * focusable `<input>`; prefer that one when targeting the field.\n */\nconst PillsInputBase = ({\n size = \"md\",\n variant = \"default\",\n color,\n invalid,\n disabled,\n pointer,\n maxLines,\n startSlot,\n endSlot,\n className,\n classNames,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: PillsInputProps) => {\n // Convention: pills first, the field last. Only the pills feed the line cap;\n // the field always stays visible (it is never sliced away).\n const items = Children.toArray(children)\n const field = items.length > 0 ? items[items.length - 1] : null\n const pills = items.length > 0 ? items.slice(0, -1) : []\n\n const { containerRef, visibleCount, hiddenCount, measuring } = usePillOverflow({\n maxLines,\n count: pills.length,\n })\n\n const renderedPills = (maxLines == null ? pills : pills.slice(0, visibleCount)).map((child, i) =>\n isValidElement(child)\n ? cloneElement(child as ReactElement<Record<string, unknown>>, {\n key: child.key ?? i,\n \"data-overflow-item\": true,\n })\n : child,\n )\n\n return (\n <PillGroupContext.Provider value={{ size, disabled }}>\n <ark.div\n data-color={color}\n {...props({\n \"data-invalid\": invalid,\n \"data-disabled\": disabled,\n \"data-pointer\": pointer,\n // Slot-aware padding in `inputShell` — see InputBase for the rationale.\n \"data-with-start-slot\": startSlot != null,\n \"data-with-end-slot\": endSlot != null,\n \"data-testid\": testId,\n })}\n className={cn(inputShell({ size, variant }), pillsShell, className, classNames?.root)}\n {...rest}\n >\n {startSlot != null && (\n <span className={cn(inputSlot, classNames?.startSlot)} aria-hidden>\n {startSlot}\n </span>\n )}\n <div ref={containerRef} className={cn(pillsContent({ size }), classNames?.content)}>\n {renderedPills}\n {/* Mounted during the measuring pass so the hook can size the last-row\n reservation off the real counter, but kept `invisible` then (still\n measurable) so it never paints on the SSR HTML before the first\n measure. Only mounts while measuring when a cap is configured. */}\n {(hiddenCount > 0 || (measuring && maxLines != null)) && (\n <PillOverflowCounter\n count={measuring ? pills.length : hiddenCount}\n size={size}\n className={measuring ? \"invisible\" : undefined}\n />\n )}\n {field}\n </div>\n {endSlot != null && <span className={cn(inputSlot, classNames?.endSlot)}>{endSlot}</span>}\n </ark.div>\n </PillGroupContext.Provider>\n )\n}\n\nexport type PillsInputFieldProps = ComponentPropsWithoutRef<\"input\"> &\n WithTestId & {\n /** Fired on Backspace when the field is empty — pop the last value. */\n onRemoveLast?: () => void\n }\n\nconst PillsInputField = ({\n className,\n onRemoveLast,\n onKeyDown,\n testId,\n ...rest\n}: PillsInputFieldProps) => (\n <input\n // The trailing field the overflow hook keeps on the last visible row.\n data-overflow-field\n // Grow to fill the line, but keep a clickable minimum when empty. Overrides\n // `inputControlClasses`' `w-full min-w-0` so pills can share the row.\n className={cn(inputControlClasses, \"w-auto min-w-16\", className)}\n onKeyDown={(event) => {\n if (onRemoveLast && event.key === \"Backspace\" && event.currentTarget.value === \"\") {\n onRemoveLast()\n }\n onKeyDown?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const PillsInput = Object.assign(PillsInputBase, {\n Field: PillsInputField,\n})\n"]}
@@ -1,5 +1,5 @@
1
1
  import { mergeRefs } from './chunk-UVYTJQTJ.js';
2
- import { FieldShell, fieldA11yProps } from './chunk-UNSAA7YG.js';
2
+ import { FieldShell, fieldA11yProps } from './chunk-FHG54IT5.js';
3
3
  import { useDirectionCheck } from './chunk-7NZSTCJO.js';
4
4
  import { useUncontrolled } from './chunk-BEL75C7N.js';
5
5
  import { props } from './chunk-WYCMIIRR.js';
@@ -290,5 +290,5 @@ var SegmentGroup = ({
290
290
  };
291
291
 
292
292
  export { SegmentGroup };
293
- //# sourceMappingURL=chunk-44OV3PNH.js.map
294
- //# sourceMappingURL=chunk-44OV3PNH.js.map
293
+ //# sourceMappingURL=chunk-B2YJKRNQ.js.map
294
+ //# sourceMappingURL=chunk-B2YJKRNQ.js.map