@photon-ai/pho-ui 4.18.4 → 4.18.5

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 (369) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/{IconAlertCircleFilled-VxKU8TYK.js → IconAlertCircleFilled-D6mUlVaE.js} +2 -2
  3. package/dist/chunks/IconAlertCircleFilled-D6mUlVaE.js.map +1 -0
  4. package/dist/chunks/{IconArrowUpRight-DGgKzQwV.js → IconArrowUpRight-OK8Fp0KQ.js} +2 -2
  5. package/dist/chunks/IconArrowUpRight-OK8Fp0KQ.js.map +1 -0
  6. package/dist/chunks/{IconCheck-D2WuculQ.js → IconCheck-DwSMn1wK.js} +2 -2
  7. package/dist/chunks/IconCheck-DwSMn1wK.js.map +1 -0
  8. package/dist/chunks/{IconChevronDown-CZilB71T.js → IconChevronDown-Cd68NnX2.js} +2 -2
  9. package/dist/chunks/IconChevronDown-Cd68NnX2.js.map +1 -0
  10. package/dist/chunks/{IconChevronLeft-CSWMKQ4C.js → IconChevronLeft-CptqhdxO.js} +2 -2
  11. package/dist/chunks/IconChevronLeft-CptqhdxO.js.map +1 -0
  12. package/dist/chunks/{IconChevronRight-CzoJnYNI.js → IconChevronRight-BNkXCTk6.js} +2 -2
  13. package/dist/chunks/IconChevronRight-BNkXCTk6.js.map +1 -0
  14. package/dist/chunks/{IconChevronUp-CrpWSgIl.js → IconChevronUp-Bxllwz8J.js} +2 -2
  15. package/dist/chunks/IconChevronUp-Bxllwz8J.js.map +1 -0
  16. package/dist/chunks/{IconInfoCircle-L0zfhg7R.js → IconInfoCircle-CTAynhe8.js} +2 -2
  17. package/dist/chunks/IconInfoCircle-CTAynhe8.js.map +1 -0
  18. package/dist/chunks/{IconSearch-BKAHkLyX.js → IconSearch-DkcWWZ1H.js} +2 -2
  19. package/dist/chunks/IconSearch-DkcWWZ1H.js.map +1 -0
  20. package/dist/chunks/{IconX-pZ9vrtSr.js → IconX-DnPlFC68.js} +2 -2
  21. package/dist/chunks/IconX-DnPlFC68.js.map +1 -0
  22. package/dist/chunks/animated-height-zr7BmFY1.js.map +1 -1
  23. package/dist/chunks/{avatar-BkmGDIqf.js → avatar-PgBOfszL.js} +4 -4
  24. package/dist/chunks/avatar-PgBOfszL.js.map +1 -0
  25. package/dist/chunks/{badge-DlLJPLeZ.js → badge-CVViIYj_.js} +2 -2
  26. package/dist/chunks/badge-CVViIYj_.js.map +1 -0
  27. package/dist/chunks/{bar-chart-CNCmuhQV.js → bar-chart-ZNuOoH7c.js} +2 -2
  28. package/dist/chunks/bar-chart-ZNuOoH7c.js.map +1 -0
  29. package/dist/chunks/{basic-page-D_Wgu2pJ.js → basic-page-BKvtEQkZ.js} +20 -20
  30. package/dist/chunks/basic-page-BKvtEQkZ.js.map +1 -0
  31. package/dist/chunks/{box-search-C9EVZgcb.js → box-search-CMl5bQ7Y.js} +5 -5
  32. package/dist/chunks/box-search-CMl5bQ7Y.js.map +1 -0
  33. package/dist/chunks/{bubble-eaoLJP4N.js → bubble-D88Edlgj.js} +2 -2
  34. package/dist/chunks/bubble-D88Edlgj.js.map +1 -0
  35. package/dist/chunks/{button-C9VqBBIr.js → button-CLfWdqm-.js} +3 -3
  36. package/dist/chunks/button-CLfWdqm-.js.map +1 -0
  37. package/dist/chunks/{calendar-4OFiCLAv.js → calendar-DDWITGo4.js} +7 -7
  38. package/dist/chunks/calendar-DDWITGo4.js.map +1 -0
  39. package/dist/chunks/{card-N-tvFsuV.js → card-zyRAihYE.js} +2 -2
  40. package/dist/chunks/{card-N-tvFsuV.js.map → card-zyRAihYE.js.map} +1 -1
  41. package/dist/chunks/{chart-B5wjhkBu.js → chart-Btnw7KXV.js} +3 -3
  42. package/dist/chunks/chart-Btnw7KXV.js.map +1 -0
  43. package/dist/chunks/{chat-Bu8UyIbT.js → chat-ZUzGmTWE.js} +11 -11
  44. package/dist/chunks/chat-ZUzGmTWE.js.map +1 -0
  45. package/dist/chunks/{checkbox-CwvoEJhd.js → checkbox-DpWLbKVS.js} +2 -2
  46. package/dist/chunks/checkbox-DpWLbKVS.js.map +1 -0
  47. package/dist/chunks/choice-card-_Ocs0iUj.js.map +1 -1
  48. package/dist/chunks/chrome-Ds7WykBJ.js.map +1 -1
  49. package/dist/chunks/{close-button-GvqWbLl0.js → close-button-Ck4rY1Fp.js} +3 -3
  50. package/dist/chunks/close-button-Ck4rY1Fp.js.map +1 -0
  51. package/dist/chunks/{cn-ChIgwEl3.js → cn-CPbhpG1q.js} +162 -83
  52. package/dist/chunks/cn-CPbhpG1q.js.map +1 -0
  53. package/dist/chunks/{code-block-DekLMMtV.js → code-block-Yxg2wZGJ.js} +10 -10
  54. package/dist/chunks/code-block-Yxg2wZGJ.js.map +1 -0
  55. package/dist/chunks/{collapsible-Dv306QOT.js → collapsible-C2tn_b1Q.js} +2 -2
  56. package/dist/chunks/collapsible-C2tn_b1Q.js.map +1 -0
  57. package/dist/chunks/{combobox-BJusx5b2.js → combobox-OQOi5hlB.js} +2 -2
  58. package/dist/chunks/combobox-OQOi5hlB.js.map +1 -0
  59. package/dist/chunks/{copy-button-BmGshaq9.js → copy-button-BLvirhXk.js} +4 -4
  60. package/dist/chunks/copy-button-BLvirhXk.js.map +1 -0
  61. package/dist/chunks/{createReactComponent-BqCmnqfX.js → createReactComponent-yKZn9MIX.js} +6 -6
  62. package/dist/chunks/createReactComponent-yKZn9MIX.js.map +1 -0
  63. package/dist/chunks/{data-table-T4QKnrxQ.js → data-table-CAz_8HQw.js} +8 -8
  64. package/dist/chunks/data-table-CAz_8HQw.js.map +1 -0
  65. package/dist/chunks/{date-picker-CZbcNIe-.js → date-picker-vJQrTol9.js} +5 -5
  66. package/dist/chunks/date-picker-vJQrTol9.js.map +1 -0
  67. package/dist/chunks/{description-list-BRRQ0oF6.js → description-list-Duhhralt.js} +3 -3
  68. package/dist/chunks/description-list-Duhhralt.js.map +1 -0
  69. package/dist/chunks/{dialog-12foDiQb.js → dialog-CCfeyQBG.js} +5 -5
  70. package/dist/chunks/dialog-CCfeyQBG.js.map +1 -0
  71. package/dist/chunks/{error-D5SzZ0ev.js → error-yAVi4cBu.js} +8 -8
  72. package/dist/chunks/error-yAVi4cBu.js.map +1 -0
  73. package/dist/chunks/{filter-bar-upeYW4dQ.js → filter-bar-qqCZf1x4.js} +9 -9
  74. package/dist/chunks/filter-bar-qqCZf1x4.js.map +1 -0
  75. package/dist/chunks/{form-AiHbbw4m.js → form-CXT6ayt0.js} +2 -2
  76. package/dist/chunks/{form-AiHbbw4m.js.map → form-CXT6ayt0.js.map} +1 -1
  77. package/dist/chunks/{ghost-search-8PzP73zS.js → ghost-search-CMUI2UH0.js} +4 -4
  78. package/dist/chunks/ghost-search-CMUI2UH0.js.map +1 -0
  79. package/dist/chunks/{input-fFWvPJOf.js → input-DWnb33UF.js} +4 -4
  80. package/dist/chunks/input-DWnb33UF.js.map +1 -0
  81. package/dist/chunks/{input-group-fc9_jD4d.js → input-group-C3upo2OU.js} +39 -37
  82. package/dist/chunks/input-group-C3upo2OU.js.map +1 -0
  83. package/dist/chunks/is-react-component-DSnjtBmo.js.map +1 -1
  84. package/dist/chunks/{kbd-DNI10uy7.js → kbd-DWDs_6U1.js} +2 -2
  85. package/dist/chunks/kbd-DWDs_6U1.js.map +1 -0
  86. package/dist/chunks/{line-chart-BODTNBrX.js → line-chart-pOwE2_Oz.js} +2 -2
  87. package/dist/chunks/line-chart-pOwE2_Oz.js.map +1 -0
  88. package/dist/chunks/link-provider-DXzDQ08N.js.map +1 -1
  89. package/dist/chunks/{log-list-tNuCFGlP.js → log-list-QbSYHZu3.js} +8 -8
  90. package/dist/chunks/log-list-QbSYHZu3.js.map +1 -0
  91. package/dist/chunks/{menu-CoMrYnd1.js → menu-CC3fhf83.js} +3 -3
  92. package/dist/chunks/menu-CC3fhf83.js.map +1 -0
  93. package/dist/chunks/{message-Dz2-numf.js → message-DRAWQlW-.js} +2 -2
  94. package/dist/chunks/message-DRAWQlW-.js.map +1 -0
  95. package/dist/chunks/{popover-BhBJO346.js → popover-B0NBrYV5.js} +2 -2
  96. package/dist/chunks/popover-B0NBrYV5.js.map +1 -0
  97. package/dist/chunks/popup-anchor-C3_iXdbh.js.map +1 -1
  98. package/dist/chunks/resolve-variant-CcD8iG5l.js.map +1 -1
  99. package/dist/chunks/{scroll-area-DSwD9th7.js → scroll-area-Dhl5hqay.js} +2 -2
  100. package/dist/chunks/scroll-area-Dhl5hqay.js.map +1 -0
  101. package/dist/chunks/{select-DU_0zVbn.js → select-xhSvDNbw.js} +3 -3
  102. package/dist/chunks/select-xhSvDNbw.js.map +1 -0
  103. package/dist/chunks/{sidebar-BP39w1iA.js → sidebar-CgaSEWVr.js} +11 -11
  104. package/dist/chunks/sidebar-CgaSEWVr.js.map +1 -0
  105. package/dist/chunks/{skeleton-DwjSl4vC.js → skeleton-CqZlGphn.js} +2 -2
  106. package/dist/chunks/skeleton-CqZlGphn.js.map +1 -0
  107. package/dist/chunks/{spinner-BzLUo4Xk.js → spinner-BSutFL4l.js} +2 -2
  108. package/dist/chunks/spinner-BSutFL4l.js.map +1 -0
  109. package/dist/chunks/{stat-hnNqjWVG.js → stat-BXBfMQ9Q.js} +4 -4
  110. package/dist/chunks/stat-BXBfMQ9Q.js.map +1 -0
  111. package/dist/chunks/{status-view-C8tabjDu.js → status-view-I_Y6eEyX.js} +2 -2
  112. package/dist/chunks/status-view-I_Y6eEyX.js.map +1 -0
  113. package/dist/chunks/{toast-BACxYsv6.js → toast-DrLKzrDJ.js} +7 -7
  114. package/dist/chunks/toast-DrLKzrDJ.js.map +1 -0
  115. package/dist/chunks/{toggle-o84tawXy.js → toggle-Ca4SS3YD.js} +2 -2
  116. package/dist/chunks/toggle-Ca4SS3YD.js.map +1 -0
  117. package/dist/chunks/{tooltip-BTF7GChl.js → tooltip-4J1PUJmB.js} +2 -2
  118. package/dist/chunks/tooltip-4J1PUJmB.js.map +1 -0
  119. package/dist/chunks/{trace-DyjsBY-S.js → trace-D9F0sne7.js} +11 -11
  120. package/dist/chunks/trace-D9F0sne7.js.map +1 -0
  121. package/dist/chunks/use-copy-D6JwKUll.js.map +1 -1
  122. package/dist/chunks/use-press-pulse-IbNstUT0.js.map +1 -1
  123. package/dist/components/accordion.js +1 -1
  124. package/dist/components/accordion.js.map +1 -1
  125. package/dist/components/autocomplete.js +1 -1
  126. package/dist/components/autocomplete.js.map +1 -1
  127. package/dist/components/avatar.js +1 -1
  128. package/dist/components/badge.js +1 -1
  129. package/dist/components/bar-chart.js +1 -1
  130. package/dist/components/bubble.js +1 -1
  131. package/dist/components/button.js +2 -2
  132. package/dist/components/calendar.js +1 -1
  133. package/dist/components/card.js +1 -1
  134. package/dist/components/chart.js +1 -1
  135. package/dist/components/chat.js +1 -1
  136. package/dist/components/checkbox.js +1 -1
  137. package/dist/components/code-block.js +1 -1
  138. package/dist/components/collapsible.js +1 -1
  139. package/dist/components/combobox.js +1 -1
  140. package/dist/components/command.js +4 -4
  141. package/dist/components/command.js.map +1 -1
  142. package/dist/components/context-menu.js +2 -2
  143. package/dist/components/context-menu.js.map +1 -1
  144. package/dist/components/copy-button.js +1 -1
  145. package/dist/components/data-table.js +2 -2
  146. package/dist/components/date-picker.js +1 -1
  147. package/dist/components/description-list.js +1 -1
  148. package/dist/components/dialog.js +1 -1
  149. package/dist/components/drawer.js +1 -1
  150. package/dist/components/drawer.js.map +1 -1
  151. package/dist/components/error.js +1 -1
  152. package/dist/components/field.js +1 -1
  153. package/dist/components/field.js.map +1 -1
  154. package/dist/components/fieldset.js +1 -1
  155. package/dist/components/fieldset.js.map +1 -1
  156. package/dist/components/filter-bar.js +1 -1
  157. package/dist/components/form.js +1 -1
  158. package/dist/components/input-group.js +1 -1
  159. package/dist/components/input.js +1 -1
  160. package/dist/components/kbd.js +1 -1
  161. package/dist/components/line-chart.js +1 -1
  162. package/dist/components/log-list.js +1 -1
  163. package/dist/components/menu.js +1 -1
  164. package/dist/components/menubar.js +1 -1
  165. package/dist/components/menubar.js.map +1 -1
  166. package/dist/components/message.js +1 -1
  167. package/dist/components/meter.js +1 -1
  168. package/dist/components/meter.js.map +1 -1
  169. package/dist/components/navigation-menu.js +1 -1
  170. package/dist/components/navigation-menu.js.map +1 -1
  171. package/dist/components/notification.js +4 -4
  172. package/dist/components/notification.js.map +1 -1
  173. package/dist/components/number-field.js +1 -1
  174. package/dist/components/number-field.js.map +1 -1
  175. package/dist/components/otp-field.js +1 -1
  176. package/dist/components/otp-field.js.map +1 -1
  177. package/dist/components/phone-input.js +35 -45
  178. package/dist/components/phone-input.js.map +1 -1
  179. package/dist/components/popover.js +1 -1
  180. package/dist/components/preview-card.js +1 -1
  181. package/dist/components/preview-card.js.map +1 -1
  182. package/dist/components/progress.js +1 -1
  183. package/dist/components/progress.js.map +1 -1
  184. package/dist/components/radio-group.js +1 -1
  185. package/dist/components/radio-group.js.map +1 -1
  186. package/dist/components/scope.js +10 -10
  187. package/dist/components/scope.js.map +1 -1
  188. package/dist/components/scroll-area.js +1 -1
  189. package/dist/components/select.js +1 -1
  190. package/dist/components/separator.js +1 -1
  191. package/dist/components/separator.js.map +1 -1
  192. package/dist/components/skeleton.js +1 -1
  193. package/dist/components/slider.js +1 -1
  194. package/dist/components/slider.js.map +1 -1
  195. package/dist/components/spinner.js +1 -1
  196. package/dist/components/stat.js +1 -1
  197. package/dist/components/status-view.js +1 -1
  198. package/dist/components/switch.js +1 -1
  199. package/dist/components/switch.js.map +1 -1
  200. package/dist/components/tabs.js +1 -1
  201. package/dist/components/tabs.js.map +1 -1
  202. package/dist/components/theme-toggle.js +2 -2
  203. package/dist/components/theme-toggle.js.map +1 -1
  204. package/dist/components/toast.js +1 -1
  205. package/dist/components/toggle-group.js +1 -1
  206. package/dist/components/toggle-group.js.map +1 -1
  207. package/dist/components/toggle.js +1 -1
  208. package/dist/components/toolbar.js +1 -1
  209. package/dist/components/toolbar.js.map +1 -1
  210. package/dist/components/tooltip.js +1 -1
  211. package/dist/components/trace.js +1 -1
  212. package/dist/icons.js.map +1 -1
  213. package/dist/index.js +27 -27
  214. package/dist/motion.js.map +1 -1
  215. package/dist/sections/basic-page.js +2 -2
  216. package/dist/sections/sidebar.js +1 -1
  217. package/dist/src/components/accordion/accordion.d.ts +5 -5
  218. package/dist/src/components/autocomplete/autocomplete.d.ts +9 -9
  219. package/dist/src/components/avatar/avatar.d.ts +3 -3
  220. package/dist/src/components/badge/badge.d.ts +1 -1
  221. package/dist/src/components/bar-chart/bar-chart.d.ts +1 -1
  222. package/dist/src/components/bubble/bubble.d.ts +3 -3
  223. package/dist/src/components/button/button.d.ts +4 -4
  224. package/dist/src/components/button/close-button.d.ts +1 -1
  225. package/dist/src/components/calendar/calendar.d.ts +1 -1
  226. package/dist/src/components/card/card.d.ts +7 -7
  227. package/dist/src/components/chart/chart.d.ts +1 -1
  228. package/dist/src/components/chart/legend.d.ts +2 -2
  229. package/dist/src/components/chart/shell.d.ts +1 -1
  230. package/dist/src/components/chart/skeleton.d.ts +1 -1
  231. package/dist/src/components/chart/tooltip.d.ts +1 -1
  232. package/dist/src/components/chat/chat.d.ts +17 -17
  233. package/dist/src/components/checkbox/check-glyph.d.ts +1 -1
  234. package/dist/src/components/checkbox/checkbox-card.d.ts +1 -1
  235. package/dist/src/components/checkbox/checkbox-group.d.ts +1 -1
  236. package/dist/src/components/checkbox/checkbox.d.ts +1 -1
  237. package/dist/src/components/code-block/code-block.d.ts +1 -1
  238. package/dist/src/components/code-block/languages.d.ts +27 -27
  239. package/dist/src/components/collapsible/collapsible.d.ts +2 -2
  240. package/dist/src/components/combobox/combobox.d.ts +15 -15
  241. package/dist/src/components/command/command.d.ts +12 -12
  242. package/dist/src/components/context-menu/context-menu.d.ts +48 -0
  243. package/dist/src/components/copy-button/copy-button.d.ts +1 -1
  244. package/dist/src/components/data-table/data-table.d.ts +1 -1
  245. package/dist/src/components/date-picker/date-picker.d.ts +1 -1
  246. package/dist/src/components/description-list/description-list.d.ts +2 -2
  247. package/dist/src/components/dialog/dialog.d.ts +11 -11
  248. package/dist/src/components/drawer/drawer.d.ts +6 -6
  249. package/dist/src/components/error/error.d.ts +2 -2
  250. package/dist/src/components/field/field.d.ts +6 -6
  251. package/dist/src/components/fieldset/fieldset.d.ts +2 -2
  252. package/dist/src/components/filter-bar/filter-bar.d.ts +1 -1
  253. package/dist/src/components/form/form.d.ts +1 -1
  254. package/dist/src/components/input/input.d.ts +1 -1
  255. package/dist/src/components/input-group/box-search.d.ts +1 -1
  256. package/dist/src/components/input-group/input-group.d.ts +6 -5
  257. package/dist/src/components/kbd/kbd.d.ts +1 -1
  258. package/dist/src/components/line-chart/line-chart.d.ts +1 -1
  259. package/dist/src/components/log-list/log-list.d.ts +7 -7
  260. package/dist/src/components/menu/menu-pending.d.ts +3 -4
  261. package/dist/src/components/menu/menu.d.ts +81 -0
  262. package/dist/src/components/menubar/menubar.d.ts +1 -1
  263. package/dist/src/components/message/message.d.ts +7 -7
  264. package/dist/src/components/meter/meter.d.ts +5 -5
  265. package/dist/src/components/navigation-menu/navigation-menu.d.ts +8 -8
  266. package/dist/src/components/notification/notification.d.ts +1 -1
  267. package/dist/src/components/number-field/number-field.d.ts +6 -6
  268. package/dist/src/components/otp-field/otp-field.d.ts +1 -1
  269. package/dist/src/components/phone-input/phone-input.d.ts +2 -2
  270. package/dist/src/components/popover/popover.d.ts +4 -4
  271. package/dist/src/components/preview-card/preview-card.d.ts +3 -3
  272. package/dist/src/components/progress/progress.d.ts +5 -5
  273. package/dist/src/components/radio-group/radio-card.d.ts +1 -1
  274. package/dist/src/components/radio-group/radio-group.d.ts +2 -2
  275. package/dist/src/components/scope/scope.d.ts +1 -1
  276. package/dist/src/components/scroll-area/scroll-area-edges.d.ts +1 -1
  277. package/dist/src/components/scroll-area/scroll-area.d.ts +5 -5
  278. package/dist/src/components/select/select.d.ts +9 -9
  279. package/dist/src/components/separator/separator.d.ts +1 -1
  280. package/dist/src/components/slider/slider.d.ts +7 -7
  281. package/dist/src/components/spinner/spinner.d.ts +1 -1
  282. package/dist/src/components/stat/stat.d.ts +2 -2
  283. package/dist/src/components/status-view/status-view.d.ts +1 -1
  284. package/dist/src/components/switch/switch.d.ts +1 -1
  285. package/dist/src/components/tabs/tabs.d.ts +4 -4
  286. package/dist/src/components/theme-toggle/theme-toggle.d.ts +1 -1
  287. package/dist/src/components/toast/toast.d.ts +7 -7
  288. package/dist/src/components/toggle/toggle.d.ts +1 -1
  289. package/dist/src/components/toggle-group/toggle-group.d.ts +1 -1
  290. package/dist/src/components/toolbar/toolbar.d.ts +6 -6
  291. package/dist/src/components/tooltip/tooltip.d.ts +3 -3
  292. package/dist/src/components/trace/span-primitive.d.ts +3 -3
  293. package/dist/src/components/trace/trace.d.ts +3 -3
  294. package/dist/src/icons/discord.d.ts +1 -1
  295. package/dist/src/icons/github.d.ts +1 -1
  296. package/dist/src/icons/google.d.ts +1 -1
  297. package/dist/src/icons/imessage.d.ts +1 -1
  298. package/dist/src/icons/photon-mark.d.ts +1 -1
  299. package/dist/src/icons/reddit.d.ts +1 -1
  300. package/dist/src/icons/slack.d.ts +1 -1
  301. package/dist/src/icons/telegram.d.ts +1 -1
  302. package/dist/src/icons/whatsapp.d.ts +1 -1
  303. package/dist/src/icons/x.d.ts +1 -1
  304. package/dist/src/icons/youtube.d.ts +1 -1
  305. package/dist/src/index.d.ts +1 -1
  306. package/dist/src/sections/basic-page/basic-page.d.ts +46 -46
  307. package/dist/src/sections/sidebar/sidebar.d.ts +11 -11
  308. package/dist/src/utils/animated-height.d.ts +1 -1
  309. package/dist/src/utils/ghost-search.d.ts +1 -1
  310. package/dist/src/utils/link-provider.d.ts +1 -1
  311. package/dist/src/utils/popup-anchor.d.ts +1 -1
  312. package/dist/utils.js +1 -1
  313. package/package.json +24 -24
  314. package/src/styles/pho.css +1 -1
  315. package/src/styles/theme.css +1 -1
  316. package/dist/chunks/IconAlertCircleFilled-VxKU8TYK.js.map +0 -1
  317. package/dist/chunks/IconArrowUpRight-DGgKzQwV.js.map +0 -1
  318. package/dist/chunks/IconCheck-D2WuculQ.js.map +0 -1
  319. package/dist/chunks/IconChevronDown-CZilB71T.js.map +0 -1
  320. package/dist/chunks/IconChevronLeft-CSWMKQ4C.js.map +0 -1
  321. package/dist/chunks/IconChevronRight-CzoJnYNI.js.map +0 -1
  322. package/dist/chunks/IconChevronUp-CrpWSgIl.js.map +0 -1
  323. package/dist/chunks/IconInfoCircle-L0zfhg7R.js.map +0 -1
  324. package/dist/chunks/IconSearch-BKAHkLyX.js.map +0 -1
  325. package/dist/chunks/IconX-pZ9vrtSr.js.map +0 -1
  326. package/dist/chunks/avatar-BkmGDIqf.js.map +0 -1
  327. package/dist/chunks/badge-DlLJPLeZ.js.map +0 -1
  328. package/dist/chunks/bar-chart-CNCmuhQV.js.map +0 -1
  329. package/dist/chunks/basic-page-D_Wgu2pJ.js.map +0 -1
  330. package/dist/chunks/box-search-C9EVZgcb.js.map +0 -1
  331. package/dist/chunks/bubble-eaoLJP4N.js.map +0 -1
  332. package/dist/chunks/button-C9VqBBIr.js.map +0 -1
  333. package/dist/chunks/calendar-4OFiCLAv.js.map +0 -1
  334. package/dist/chunks/chart-B5wjhkBu.js.map +0 -1
  335. package/dist/chunks/chat-Bu8UyIbT.js.map +0 -1
  336. package/dist/chunks/checkbox-CwvoEJhd.js.map +0 -1
  337. package/dist/chunks/close-button-GvqWbLl0.js.map +0 -1
  338. package/dist/chunks/cn-ChIgwEl3.js.map +0 -1
  339. package/dist/chunks/code-block-DekLMMtV.js.map +0 -1
  340. package/dist/chunks/collapsible-Dv306QOT.js.map +0 -1
  341. package/dist/chunks/combobox-BJusx5b2.js.map +0 -1
  342. package/dist/chunks/copy-button-BmGshaq9.js.map +0 -1
  343. package/dist/chunks/createReactComponent-BqCmnqfX.js.map +0 -1
  344. package/dist/chunks/data-table-T4QKnrxQ.js.map +0 -1
  345. package/dist/chunks/date-picker-CZbcNIe-.js.map +0 -1
  346. package/dist/chunks/description-list-BRRQ0oF6.js.map +0 -1
  347. package/dist/chunks/dialog-12foDiQb.js.map +0 -1
  348. package/dist/chunks/error-D5SzZ0ev.js.map +0 -1
  349. package/dist/chunks/filter-bar-upeYW4dQ.js.map +0 -1
  350. package/dist/chunks/ghost-search-8PzP73zS.js.map +0 -1
  351. package/dist/chunks/input-fFWvPJOf.js.map +0 -1
  352. package/dist/chunks/input-group-fc9_jD4d.js.map +0 -1
  353. package/dist/chunks/kbd-DNI10uy7.js.map +0 -1
  354. package/dist/chunks/line-chart-BODTNBrX.js.map +0 -1
  355. package/dist/chunks/log-list-tNuCFGlP.js.map +0 -1
  356. package/dist/chunks/menu-CoMrYnd1.js.map +0 -1
  357. package/dist/chunks/message-Dz2-numf.js.map +0 -1
  358. package/dist/chunks/popover-BhBJO346.js.map +0 -1
  359. package/dist/chunks/scroll-area-DSwD9th7.js.map +0 -1
  360. package/dist/chunks/select-DU_0zVbn.js.map +0 -1
  361. package/dist/chunks/sidebar-BP39w1iA.js.map +0 -1
  362. package/dist/chunks/skeleton-DwjSl4vC.js.map +0 -1
  363. package/dist/chunks/spinner-BzLUo4Xk.js.map +0 -1
  364. package/dist/chunks/stat-hnNqjWVG.js.map +0 -1
  365. package/dist/chunks/status-view-C8tabjDu.js.map +0 -1
  366. package/dist/chunks/toast-BACxYsv6.js.map +0 -1
  367. package/dist/chunks/toggle-o84tawXy.js.map +0 -1
  368. package/dist/chunks/tooltip-BTF7GChl.js.map +0 -1
  369. package/dist/chunks/trace-DyjsBY-S.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { t as s } from "./cn-ChIgwEl3.js";
3
- import { t as f } from "./createReactComponent-BqCmnqfX.js";
4
- import { t as D } from "./IconAlertCircleFilled-VxKU8TYK.js";
2
+ import { t as s } from "./cn-CPbhpG1q.js";
3
+ import { t as f } from "./createReactComponent-yKZn9MIX.js";
4
+ import { t as D } from "./IconAlertCircleFilled-D6mUlVaE.js";
5
5
  import { useState as R } from "react";
6
6
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
7
7
  import { Field as o } from "@base-ui/react/field";
@@ -107,4 +107,4 @@ export {
107
107
  G as t
108
108
  };
109
109
 
110
- //# sourceMappingURL=input-fFWvPJOf.js.map
110
+ //# sourceMappingURL=input-DWnb33UF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-DWnb33UF.js","names":["__iconNode","cn","createReactComponent","IconAlertCircleFilled","useState","jsx","jsxs","Field","__iconNode$1","IconEyeOff","__iconNode","IconEye","SIZE_PAD","LEADING_PAD","LEADING_ICON_POS","SIZE_RADIUS","SIZE_RING_COVER","SIZE_AUTOFILL_RADIUS","Input","label","hint","size","invalid","Icon","labelTrailing","trailing","disabled","required","type","className","wrapperClassName","id","ref","props","reveal","setReveal","isPassword","resolvedType","hasLeadingIcon","hasTrailingIcon","hasTrailing","v"],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconEyeOff.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.49.0_react@19.3.1/node_modules/@tabler/icons-react/dist/esm/icons/IconEye.mjs","../../src/components/input/input.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M10.585 10.587a2 2 0 0 0 2.829 2.828\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M3 3l18 18\", \"key\": \"svg-2\" }]];\nconst IconEyeOff = createReactComponent(\"outline\", \"eye-off\", \"EyeOff\", __iconNode);\n\nexport { __iconNode, IconEyeOff as default };\n","/**\n * @license @tabler/icons-react v3.49.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6\", \"key\": \"svg-1\" }]];\nconst IconEye = createReactComponent(\"outline\", \"eye\", \"Eye\", __iconNode);\n\nexport { __iconNode, IconEye as default };\n","import {\n useState,\n type ComponentType,\n type InputHTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n IconAlertCircleFilled,\n IconEye,\n IconEyeOff,\n} from \"@tabler/icons-react\";\nimport { Field } from \"@base-ui/react/field\";\nimport { cn } from \"../../utils/cn\";\n\nexport type InputSize = \"sm\" | \"md\" | \"lg\";\n\n// Control padding per size. The wrapper carries a 2px inset (`p-0.5`) so the\n// control's border box — and the browser's autofill fill it paints — sits\n// inside the ring instead of over it; these paddings are the documented\n// effective padding (sm/md 12/8px, lg 14/10px) minus that 2px inset, so the\n// text position and total field height are unchanged.\nconst SIZE_PAD: Record<InputSize, string> = {\n // 16px on small viewports — iOS zooms into any focused field under 16px.\n sm: \"px-2.5 py-1.5 text-md md:text-base\",\n md: \"px-2.5 py-1.5 text-md\",\n lg: \"px-3 py-2 text-md\",\n};\n// Effective icon clearance minus the wrapper's 2px inset.\nconst LEADING_PAD: Record<InputSize, string> = {\n sm: \"pl-8.5\",\n md: \"pl-9.5\",\n lg: \"pl-10\",\n};\n// Icons are absolutely positioned, so they're placed from the wrapper's\n// padding edge — which, with no border, is the visible field edge; the\n// wrapper's `p-0.5` does not offset them.\nconst LEADING_ICON_POS: Record<InputSize, string> = {\n sm: \"left-3 size-4\",\n md: \"left-3 size-5\",\n lg: \"left-3.5 size-5\",\n};\n// Wrapper corner radius — `rounded-base` (12px) at every size; `lg` also gets\n// `squircle` superellipse smoothing (the ring is a box-shadow on this wrapper,\n// so it follows the border-radius automatically).\nconst SIZE_RADIUS: Record<InputSize, string> = {\n sm: \"rounded-base\",\n md: \"rounded-base\",\n lg: \"squircle rounded-base\",\n};\n// Concentric inner-curve cover, `lg` only. Nested corner radii must follow\n// innerRadius = outerRadius − inset, so the hairline's inner edge at a 12px\n// outer radius is 11px at rest (ring-1) and 10px when focused (ring-2).\n// Browsers derive that automatically for plain round corners, but with\n// `corner-shape: superellipse(...)` shipping engines still scale (rather than\n// offset) the inner shadow curve, which renders the ring visibly thicker at\n// the four corners (see w3c/csswg-drafts#12961). This ::before repaints the\n// field surface over everything inside the correct concentric curve — a round\n// radius is the right parallel-offset approximation of the mild superellipse —\n// so the ring reads as a uniform hairline in every engine. `isolate` +\n// `-z-10` slot the cover above the wrapper's background/ring but below the\n// control's text, icons, and autofill fill. `sm`/`md` have no corner-shape,\n// so the native (already concentric) rendering is kept there.\n// The ::before is absolutely positioned, so its inset is measured from the\n// wrapper's border box (border 0): 1px in at rest, 2px in when focused.\nconst SIZE_RING_COVER: Record<InputSize, string> = {\n sm: \"\",\n md: \"\",\n lg: cn(\n \"isolate before:pointer-events-none before:absolute before:-z-10 before:content-['']\",\n \"before:bg-pho-primary before:inset-px before:rounded-[calc(var(--radius-base)-1px)]\",\n // Invalid sits between rest (1px) and focus (2px) — keep the cover concentric.\n \"data-[invalid]:before:inset-[1.5px] data-[invalid]:before:rounded-[calc(var(--radius-base)-1.5px)]\",\n \"has-[input:focus-visible]:before:inset-0.5 has-[input:focus-visible]:before:rounded-[calc(var(--radius-base)-2px)]\",\n \"before:transition-[inset,border-radius] before:duration-100 before:ease-linear\",\n ),\n};\n// The control's border box sits 2px inside the wrapper (its `p-0.5` inset),\n// clear of both ring widths, so the browser's autofill fill paints inside the\n// hairline instead of over it. Rounding follows inner = outer − gap, derived\n// from the token with calc. Round (not squircle) — the parallel offset of\n// the wrapper's mild superellipse is effectively circular.\nconst SIZE_AUTOFILL_RADIUS: Record<InputSize, string> = {\n sm: \"autofill:rounded-[calc(var(--radius-base)-2px)]\",\n md: \"autofill:rounded-[calc(var(--radius-base)-2px)]\",\n lg: \"autofill:rounded-[calc(var(--radius-base)-2px)]\",\n};\n\nexport interface InputProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"size\"\n> {\n /** Field label (associated for accessibility). */\n label?: ReactNode;\n /** Helper text below the field; rendered in the error color when `invalid`. */\n hint?: ReactNode;\n /** Size variant. @default \"md\" */\n size?: InputSize;\n /** Render the invalid state (ring + icon + error-colored hint). */\n invalid?: boolean;\n /** Leading icon component (e.g. a Tabler icon). */\n icon?: ComponentType<{ className?: string }>;\n /** Node rendered at the right edge of the label row (e.g. \"Forgot?\"). */\n labelTrailing?: ReactNode;\n /**\n * Quiet word or glyph inside the field at its trailing edge (an\n * auto-save's `Saved`, a live character count). Non-interactive overlay:\n * it never takes the pointer, the invalid icon takes the corner over\n * it, and the input reserves nothing — content that shows only\n * sometimes brings its own surface wash (as `Saved` does) so long text\n * fades beneath it instead of colliding.\n */\n trailing?: ReactNode;\n /** Class applied to the input wrapper. */\n wrapperClassName?: string;\n ref?: Ref<HTMLInputElement>;\n}\n\n/**\n * Text input built on Base UI `Field` (label/description a11y wiring) with\n * Pho's bordered surface, leading icon, invalid state, and a built-in password\n * reveal toggle.\n */\nexport function Input({\n label,\n hint,\n size = \"md\",\n invalid,\n icon: Icon,\n labelTrailing,\n trailing,\n disabled,\n required,\n type = \"text\",\n className,\n wrapperClassName,\n id,\n ref,\n ...props\n}: InputProps) {\n const [reveal, setReveal] = useState(false);\n const isPassword = type === \"password\";\n const resolvedType = isPassword && reveal ? \"text\" : type;\n const hasLeadingIcon = Boolean(Icon);\n const hasTrailingIcon = isPassword || invalid;\n const hasTrailing = trailing != null && !invalid && !isPassword;\n\n return (\n <Field.Root\n disabled={disabled}\n className=\"group/field flex w-full flex-col gap-1.5\"\n >\n {label && (\n <div className=\"flex items-center justify-between gap-2\">\n <Field.Label className=\"text-pho-secondary flex cursor-default items-center gap-0.5 text-base font-medium\">\n {label}\n {required && (\n <span className=\"text-pho-brand\" aria-hidden=\"true\">\n *\n </span>\n )}\n </Field.Label>\n {labelTrailing}\n </div>\n )}\n\n <div\n data-invalid={invalid || undefined}\n className={cn(\n // Flat field surface — hairline ring only; elevation shadows are\n // reserved for floating layers (menus/popovers/dialogs). `p-0.5`\n // insets the control 2px (the focused ring width) so its background\n // and the browser's autofill fill nest inside the ring; the size\n // maps compensate so effective padding/height are unchanged.\n \"bg-pho-primary ring-pho-primary relative flex w-full items-center p-0.5 ring-1 transition-shadow duration-100 ease-linear ring-inset\",\n SIZE_RADIUS[size],\n SIZE_RING_COVER[size],\n \"has-[input:focus-visible]:ring-pho-brand has-[input:focus-visible]:ring-2\",\n // Invalid is mid-weight: thicker than the 1px rest hairline, thinner\n // than the 2px focus ring. Rest uses the subtle error ink; focus\n // steps up to the solid error (same hue, full opacity).\n \"data-[invalid]:ring-pho-error-subtle data-[invalid]:has-[input:focus-visible]:ring-pho-error data-[invalid]:ring-[1.5px]\",\n \"group-data-[disabled]/field:cursor-not-allowed group-data-[disabled]/field:opacity-50\",\n wrapperClassName,\n )}\n >\n {Icon && (\n <Icon\n className={cn(\n \"text-pho-secondary pointer-events-none absolute\",\n LEADING_ICON_POS[size],\n )}\n />\n )}\n\n <Field.Control\n ref={ref}\n id={id}\n type={resolvedType}\n required={required}\n {...props}\n className={cn(\n \"text-pho-primary placeholder:text-pho-placeholder m-0 w-full bg-transparent outline-none disabled:cursor-not-allowed\",\n SIZE_PAD[size],\n SIZE_AUTOFILL_RADIUS[size],\n hasLeadingIcon && LEADING_PAD[size],\n // 34px + the wrapper's 2px inset = the previous 36px clearance.\n hasTrailingIcon && \"pr-8.5\",\n className,\n )}\n />\n\n {invalid && !isPassword && (\n <IconAlertCircleFilled className=\"text-pho-error pointer-events-none absolute right-3 size-4\" />\n )}\n {hasTrailing && (\n <span className=\"text-pho-description pointer-events-none absolute right-3 flex items-center\">\n {trailing}\n </span>\n )}\n\n {isPassword && (\n <button\n type=\"button\"\n // Reachable by click but skipped in tab order so Tab moves field→field.\n tabIndex={-1}\n aria-label=\"Toggle password visibility\"\n onClick={() => setReveal((v) => !v)}\n className=\"text-pho-secondary hover:text-pho-secondary-hover absolute right-3 flex cursor-pointer items-center transition duration-100 ease-linear focus:outline-none\"\n >\n {reveal ? (\n <IconEyeOff className=\"size-4\" />\n ) : (\n <IconEye className=\"size-4\" />\n )}\n </button>\n )}\n </div>\n\n {hint && (\n <Field.Description\n className={cn(\n \"text-pho-description text-base\",\n invalid && \"text-pho-error\",\n )}\n >\n {hint}\n </Field.Description>\n )}\n {/* Validation and server errors routed here by Field / Form. */}\n <Field.Error className=\"text-pho-error text-base\" />\n </Field.Root>\n );\n}\n\nInput.displayName = \"Input\";\n"],"ignoreList":[0,1],"mappings":";;;;;;;AASA,IAAMA,IAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAwC,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAuM,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,EAAQ,CAAC;AAAC,GAClXS,IAAaP,EAAqB,WAAW,WAAW,UAAUF,CAAU,GCD5EU,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAuC,KAAO;AAAQ,CAAC,GAAG,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAqF,KAAO;AAAQ,CAAC,CAAC,GAC9MC,IAAUT,EAAqB,WAAW,OAAO,OAAOQ,CAAU,GCYlEE,IAAsC;AAAA,EAE1C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,IAAyC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A,IACzC;AAAA,E;AAEhB;AAEAW,EAAM,cAAc"}
@@ -1,91 +1,93 @@
1
1
  "use client";
2
- import { t as i } from "./cn-ChIgwEl3.js";
3
- import { createContext as b, useContext as c } from "react";
4
- import { jsx as t, jsxs as f } from "react/jsx-runtime";
5
- import { Field as m } from "@base-ui/react/field";
6
- import { Separator as v } from "@base-ui/react/separator";
2
+ import { t as i } from "./cn-CPbhpG1q.js";
3
+ import { createContext as b, useContext as f } from "react";
4
+ import { jsx as o, jsxs as m } from "react/jsx-runtime";
5
+ import { Field as v } from "@base-ui/react/field";
6
+ import { Separator as h } from "@base-ui/react/separator";
7
7
  var u = b({
8
8
  size: "md",
9
9
  invalid: !1
10
- }), h = {
10
+ }), x = {
11
11
  sm: "gap-2 px-3 text-md md:text-base",
12
12
  md: "gap-2 px-3 text-md",
13
13
  lg: "gap-2 px-3.5 text-md"
14
- }, x = {
14
+ }, g = {
15
15
  sm: "my-0.5 py-1.5",
16
16
  md: "my-0.5 py-1.5",
17
17
  lg: "my-0.5 py-2"
18
- }, g = {
18
+ }, y = {
19
19
  sm: "[&_svg]:size-4",
20
20
  md: "[&_svg]:size-5",
21
21
  lg: "[&_svg]:size-5"
22
- }, y = {
22
+ }, I = {
23
23
  sm: "rounded-base",
24
24
  md: "rounded-base",
25
25
  lg: "squircle rounded-base"
26
- }, I = {
26
+ }, w = {
27
27
  sm: "",
28
28
  md: "",
29
29
  lg: i("isolate before:pointer-events-none before:absolute before:-z-10 before:content-['']", "before:bg-pho-primary before:inset-px before:rounded-[calc(var(--radius-base)-1px)]", "data-[invalid]:before:inset-[1.5px] data-[invalid]:before:rounded-[calc(var(--radius-base)-1.5px)]", "has-[:focus-visible]:before:inset-0.5 has-[:focus-visible]:before:rounded-[calc(var(--radius-base)-2px)]", "before:transition-[inset,border-radius] before:duration-100 before:ease-linear")
30
30
  };
31
- function w({ size: e = "md", invalid: r, className: a, onPointerDown: o, ref: l, ...d }) {
32
- const s = (n) => {
33
- if (o?.(n), n.defaultPrevented || n.target.closest("input, button, a, select, textarea, label")) return;
34
- const p = n.currentTarget.querySelector("input");
35
- !p || p.disabled || (n.preventDefault(), p.focus());
31
+ function _({ size: e = "md", invalid: r, className: a, onPointerDown: n, ref: l, ...d }) {
32
+ const s = (t) => {
33
+ if (n?.(t), t.defaultPrevented) return;
34
+ const c = t.target;
35
+ if (!t.currentTarget.contains(c) || c.closest("input, button, a, select, textarea, label")) return;
36
+ const p = t.currentTarget.querySelector("input");
37
+ !p || p.disabled || (t.preventDefault(), p.focus());
36
38
  };
37
- return /* @__PURE__ */ t(u.Provider, {
39
+ return /* @__PURE__ */ o(u.Provider, {
38
40
  value: {
39
41
  size: e,
40
42
  invalid: !!r
41
43
  },
42
- children: /* @__PURE__ */ t("div", {
44
+ children: /* @__PURE__ */ o("div", {
43
45
  ref: l,
44
46
  "data-invalid": r || void 0,
45
47
  onPointerDown: s,
46
- className: i("bg-pho-primary ring-pho-primary relative flex w-full cursor-text items-center ring-1 transition-shadow duration-100 ease-linear ring-inset", h[e], y[e], I[e], "has-[:focus-visible]:ring-pho-brand has-[:focus-visible]:ring-2", "has-[button[data-popup-open]]:ring-pho-brand has-[button[data-popup-open]]:ring-2", "data-[invalid]:ring-pho-error-subtle data-[invalid]:has-[:focus-visible]:ring-pho-error data-[invalid]:has-[button[data-popup-open]]:ring-pho-error data-[invalid]:ring-[1.5px]", "has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50", a),
48
+ className: i("bg-pho-primary ring-pho-primary relative flex w-full cursor-text items-center ring-1 transition-shadow duration-100 ease-linear ring-inset", x[e], I[e], w[e], "has-[:focus-visible]:ring-pho-brand has-[:focus-visible]:ring-2", "has-[button[data-popup-open]]:ring-pho-brand has-[button[data-popup-open]]:ring-2", "data-[invalid]:ring-pho-error-subtle data-[invalid]:has-[:focus-visible]:ring-pho-error data-[invalid]:has-[button[data-popup-open]]:ring-pho-error data-[invalid]:ring-[1.5px]", "has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50", a),
47
49
  ...d
48
50
  })
49
51
  });
50
52
  }
51
- function _({ className: e, trailing: r, ref: a, ...o }) {
52
- const { size: l, invalid: d } = c(u), s = /* @__PURE__ */ t(m.Control, {
53
+ function N({ className: e, trailing: r, ref: a, ...n }) {
54
+ const { size: l, invalid: d } = f(u), s = /* @__PURE__ */ o(v.Control, {
53
55
  ref: a,
54
56
  "aria-invalid": d || void 0,
55
- ...o,
56
- className: i("text-pho-primary placeholder:text-pho-placeholder m-0 w-full min-w-0 flex-1 bg-transparent outline-none disabled:cursor-not-allowed", "autofill:rounded-[calc(var(--radius-base)-2px)]", x[l], e)
57
+ ...n,
58
+ className: i("text-pho-primary placeholder:text-pho-placeholder m-0 w-full min-w-0 flex-1 bg-transparent outline-none disabled:cursor-not-allowed", "autofill:rounded-[calc(var(--radius-base)-2px)]", g[l], e)
57
59
  });
58
- return r == null ? s : /* @__PURE__ */ f("span", {
60
+ return r == null ? s : /* @__PURE__ */ m("span", {
59
61
  className: "relative flex w-full min-w-0 flex-1 items-center",
60
- children: [s, /* @__PURE__ */ t("span", {
62
+ children: [s, /* @__PURE__ */ o("span", {
61
63
  className: "text-pho-description pointer-events-none absolute right-2 flex items-center",
62
64
  children: r
63
65
  })]
64
66
  });
65
67
  }
66
- function N({ className: e, ref: r, ...a }) {
67
- const { size: o } = c(u);
68
- return /* @__PURE__ */ t("div", {
68
+ function S({ className: e, ref: r, ...a }) {
69
+ const { size: n } = f(u);
70
+ return /* @__PURE__ */ o("div", {
69
71
  ref: r,
70
- className: i("text-pho-secondary flex shrink-0 items-center gap-1 select-none", "[&_svg]:shrink-0", g[o], e),
72
+ className: i("text-pho-secondary flex shrink-0 items-center gap-1 select-none", "[&_svg]:shrink-0", y[n], e),
71
73
  ...a
72
74
  });
73
75
  }
74
- function S({ className: e, orientation: r = "vertical", ...a }) {
75
- return /* @__PURE__ */ t(v, {
76
+ function C({ className: e, orientation: r = "vertical", ...a }) {
77
+ return /* @__PURE__ */ o(h, {
76
78
  orientation: r,
77
79
  className: i("my-0.5 w-px shrink-0 self-stretch bg-[var(--border-color-pho-secondary)]", e),
78
80
  ...a
79
81
  });
80
82
  }
81
- var G = {
82
- Root: w,
83
- Input: _,
84
- Addon: N,
85
- Separator: S
83
+ var Z = {
84
+ Root: _,
85
+ Input: N,
86
+ Addon: S,
87
+ Separator: C
86
88
  };
87
89
  export {
88
- G as t
90
+ Z as t
89
91
  };
90
92
 
91
- //# sourceMappingURL=input-group-fc9_jD4d.js.map
93
+ //# sourceMappingURL=input-group-C3upo2OU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-group-C3upo2OU.js","names":["BaseSeparator","cn","createContext","useContext","jsx","jsxs","Field","Separator","InputGroupContext","SIZE_ROOT","SIZE_CONTROL","SIZE_ADDON_ICON","SIZE_RADIUS","SIZE_RING_COVER","Root","size","invalid","className","onPointerDown","ref","props","handlePointerDown","event","target","input","GroupInput","trailing","control","Addon","GroupSeparator","orientation","InputGroup"],"sources":["../../src/components/input-group/input-group.tsx"],"sourcesContent":["import {\n createContext,\n useContext,\n type ComponentProps,\n type ElementType,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type PointerEvent,\n type Ref,\n type ReactNode,\n} from \"react\";\nimport { Field } from \"@base-ui/react/field\";\nimport { Separator as BaseSeparator } from \"@base-ui/react/separator\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nexport type InputGroupSize = \"sm\" | \"md\" | \"lg\";\n\n/** Lets `Addon` and the control read the Root's size/invalid state. */\nconst InputGroupContext = createContext<{\n size: InputGroupSize;\n invalid: boolean;\n}>({ size: \"md\", invalid: false });\n\n// Mirrors Input's size math (see input.tsx): the group surface carries the\n// horizontal padding and text scale, the control carries the vertical\n// padding. Effective metrics — sm/md 12/8px, lg 14/10px — land the same\n// 36/40/44px field heights, so grouped and plain inputs align in a form.\nconst SIZE_ROOT: Record<InputGroupSize, string> = {\n // 16px on small viewports — iOS zooms into any focused field under 16px.\n sm: \"gap-2 px-3 text-md md:text-base\",\n md: \"gap-2 px-3 text-md\",\n lg: \"gap-2 px-3.5 text-md\",\n};\n// `my-0.5` insets the control 2px (the focused ring width) so the browser's\n// autofill fill nests inside the ring; `py` makes up the rest of the height.\nconst SIZE_CONTROL: Record<InputGroupSize, string> = {\n sm: \"my-0.5 py-1.5\",\n md: \"my-0.5 py-1.5\",\n lg: \"my-0.5 py-2\",\n};\n// In-field icon size per group size — same scale as Input's leading icon.\nconst SIZE_ADDON_ICON: Record<InputGroupSize, string> = {\n sm: \"[&_svg]:size-4\",\n md: \"[&_svg]:size-5\",\n lg: \"[&_svg]:size-5\",\n};\n// `lg` gets the squircle treatment like Input; sm/md stay plain round.\nconst SIZE_RADIUS: Record<InputGroupSize, string> = {\n sm: \"rounded-base\",\n md: \"rounded-base\",\n lg: \"squircle rounded-base\",\n};\n// Concentric inner-curve cover for the `lg` squircle — same engine workaround\n// as Input (see input.tsx `SIZE_RING_COVER` for the full story).\nconst SIZE_RING_COVER: Record<InputGroupSize, string> = {\n sm: \"\",\n md: \"\",\n lg: cn(\n \"isolate before:pointer-events-none before:absolute before:-z-10 before:content-['']\",\n \"before:bg-pho-primary before:inset-px before:rounded-[calc(var(--radius-base)-1px)]\",\n // Invalid sits between rest (1px) and focus (2px) — keep the cover concentric.\n \"data-[invalid]:before:inset-[1.5px] data-[invalid]:before:rounded-[calc(var(--radius-base)-1.5px)]\",\n \"has-[:focus-visible]:before:inset-0.5 has-[:focus-visible]:before:rounded-[calc(var(--radius-base)-2px)]\",\n \"before:transition-[inset,border-radius] before:duration-100 before:ease-linear\",\n ),\n};\n\nexport interface InputGroupRootProps extends HTMLAttributes<HTMLDivElement> {\n /** Size variant, matching Input's scale. @default \"md\" */\n size?: InputGroupSize;\n /** Render the invalid state (error ring; `aria-invalid` on the control). */\n invalid?: boolean;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * The shared field surface: one hairline ring around the control and its\n * addons, with the same focus / invalid / disabled treatment as `Input`.\n * Clicking anywhere on the surface (addon text, icons, blank space) focuses\n * the control, so the whole group reads as a single field. Presses inside a\n * portaled popup it opened (a Select's options) are left alone.\n */\nfunction Root({\n size = \"md\",\n invalid,\n className,\n onPointerDown,\n ref,\n ...props\n}: InputGroupRootProps) {\n const handlePointerDown = (event: PointerEvent<HTMLDivElement>) => {\n onPointerDown?.(event);\n if (event.defaultPrevented) return;\n // React bubbles events through portals, so a press inside a popup this\n // group opened (a Select's options) lands here too. Only presses on the\n // surface itself focus the control; otherwise mobile Safari raises the\n // keyboard mid-tap, the popup closes, and the option never gets picked.\n const target = event.target as HTMLElement;\n if (!event.currentTarget.contains(target)) return;\n // Interactive children keep their own pointer behavior (and the control\n // itself keeps native caret placement).\n if (target.closest(\"input, button, a, select, textarea, label\")) return;\n const input = event.currentTarget.querySelector(\"input\");\n if (!input || input.disabled) return;\n // Focus the control instead of the wrapper — and don't blur it again.\n event.preventDefault();\n input.focus();\n };\n\n return (\n <InputGroupContext.Provider value={{ size, invalid: Boolean(invalid) }}>\n <div\n ref={ref}\n data-invalid={invalid || undefined}\n onPointerDown={handlePointerDown}\n className={cn(\n // Flat field surface — hairline ring only, same as Input; elevation\n // shadows are reserved for floating layers.\n \"bg-pho-primary ring-pho-primary relative flex w-full cursor-text items-center ring-1 transition-shadow duration-100 ease-linear ring-inset\",\n SIZE_ROOT[size],\n SIZE_RADIUS[size],\n SIZE_RING_COVER[size],\n // Any focusable child (input, a Select trigger, an addon button)\n // lights the shared ring — including an open Select popup.\n \"has-[:focus-visible]:ring-pho-brand has-[:focus-visible]:ring-2\",\n \"has-[button[data-popup-open]]:ring-pho-brand has-[button[data-popup-open]]:ring-2\",\n // Invalid is mid-weight: thicker than the 1px rest hairline, thinner\n // than the 2px focus / open ring. Rest uses the subtle error ink;\n // focus / open steps up to the solid error.\n \"data-[invalid]:ring-pho-error-subtle data-[invalid]:has-[:focus-visible]:ring-pho-error data-[invalid]:has-[button[data-popup-open]]:ring-pho-error data-[invalid]:ring-[1.5px]\",\n \"has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50\",\n className,\n )}\n {...props}\n />\n </InputGroupContext.Provider>\n );\n}\n\nexport interface InputGroupInputProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"size\"\n> {\n /**\n * Quiet word or glyph over the control's trailing edge, before the\n * addons (an auto-save's `Saved`). Non-interactive overlay; content\n * that shows only sometimes brings its own surface wash so long text\n * fades beneath it. Reserves nothing.\n */\n trailing?: ReactNode;\n ref?: Ref<HTMLInputElement>;\n}\n\n/**\n * The text control. Rendered as Base UI `Field.Control`, so inside a\n * `Field.Root` it picks up the label and description wiring automatically;\n * standalone it behaves as a plain `<input>` (pass `aria-label` then).\n */\nfunction GroupInput({\n className,\n trailing,\n ref,\n ...props\n}: InputGroupInputProps) {\n const { size, invalid } = useContext(InputGroupContext);\n const control = (\n <Field.Control\n ref={ref}\n aria-invalid={invalid || undefined}\n {...props}\n className={cn(\n \"text-pho-primary placeholder:text-pho-placeholder m-0 w-full min-w-0 flex-1 bg-transparent outline-none disabled:cursor-not-allowed\",\n // Rounding for the autofill fill nested 2px inside the ring.\n \"autofill:rounded-[calc(var(--radius-base)-2px)]\",\n SIZE_CONTROL[size],\n className,\n )}\n />\n );\n if (trailing == null) return control;\n return (\n <span className=\"relative flex w-full min-w-0 flex-1 items-center\">\n {control}\n <span className=\"text-pho-description pointer-events-none absolute right-2 flex items-center\">\n {trailing}\n </span>\n </span>\n );\n}\n\n/**\n * Inline content beside the control — prefix/suffix text, an icon, a `Kbd`\n * hint, or a small button. Text and icons render in the secondary tone so the\n * value stays the loudest thing on the surface.\n */\nfunction Addon({\n className,\n ref,\n ...props\n}: HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> }) {\n const { size } = useContext(InputGroupContext);\n return (\n <div\n ref={ref}\n className={cn(\n \"text-pho-secondary flex shrink-0 items-center gap-1 select-none\",\n \"[&_svg]:shrink-0\",\n SIZE_ADDON_ICON[size],\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * A hairline between segments — turns an addon into a boxed section\n * (`https:// │ workspace │ .photon.dev`).\n */\nfunction GroupSeparator({\n className,\n orientation = \"vertical\",\n ...props\n}: StyledProps<typeof BaseSeparator>) {\n return (\n <BaseSeparator\n orientation={orientation}\n className={cn(\n // `my-0.5` keeps the line 2px clear of the ring (children paint over\n // the inset box-shadow, so a full-bleed line would notch it) — the\n // same inset the control itself uses, covering the focused 2px ring.\n \"my-0.5 w-px shrink-0 self-stretch bg-[var(--border-color-pho-secondary)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Input Group — one field surface shared by a text control and its addons:\n * prefix/suffix text, icons, keyboard hints, or a trailing button. Same\n * ring, sizes, and focus / invalid / disabled behavior as `Input`, so grouped\n * and plain fields align in the same form. For a leading icon alone, plain\n * `Input` with `icon` is enough.\n */\nexport const InputGroup = {\n Root,\n Input: GroupInput,\n Addon,\n Separator: GroupSeparator,\n};\n"],"mappings":";;;;;;AA0BA,IAAMQ,IAAoBN,EAGvB;AAAA,EAAE,MAAM;AAAA,EAAM,SAAS;AAAM,CAAC,GAM3BO,IAA4C;AAAA,EAEhD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAGMC,IAA+C;AAAA,EACnD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,IAAkD;AAAA,EACtD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAEMC,IAA8C;AAAA,EAClD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAGMC,IAAkD;AAAA,EACtD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAIZ,EACF,uFACA,uFAEA,sGACA,4GACA,gFACF;AACF;AAiBA,SAASa,EAAK,EACZ,MAAAC,IAAO,MACP,S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AAC,QAAD;AAAA,MAAM,WAAU;AAAA,MACb,UAAAsB;AAAA,IACG,CAAA,CACF;AAAA,E;AAEV;AAOA,SAASE,EAAM,EACb,WAAAX,GACA,KAAAE,GACA,GAAGC,EAAA,GAC8D;AACjE,QAAM,EAAE,MAAAL,EAAA,IAASZ,EAAWK,CAAiB;AAC7C,SACE,gBAAAJ,EAAC,OAAD;AAAA,IACO,KAAAe;AAAA,IACL,WAAWlB,EACT,mEACA,oBACAU,EAAgBI,CAAA,GAChBE,CACF;AAAA,IACA,GAAIG;AAAA,EACL,CAAA;AAEL;AAMA,SAASS,EAAe,EACtB,WAAAZ,GACA,aAAAa,IAAc,YACd,GAAGV,EAAA,GACiC;AACpC,SACE,gBAAAhB,EAACJ,GAAD;AAAA,IACe,aAAA8B;AAAA,IACb,WAAW7B,EAIT,4EACAgB,CACF;AAAA,IACA,GAAIG;AAAA,EACL,CAAA;AAEL;AASA,IAAaW,IAAa;AAAA,EACxB,MAAAjB;AAAA,EACA,OAAOW;AAAA,EACP,OAAAG;AAAA,EACA,WAAWC;AACb"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-react-component-DSnjtBmo.js","names":[],"sources":["../../src/utils/is-react-component.ts"],"sourcesContent":["import { isValidElement, type ComponentType } from \"react\";\n\n/**\n * Distinguish an icon passed as a *component* (e.g. a Tabler icon or any\n * `FC`/forwardRef) from one passed as an already-rendered *element*. Lets icon\n * props accept either form: `prefix={Plus}` or `prefix={<Plus />}`.\n */\nexport function isReactComponent(\n value: unknown,\n): value is ComponentType<{ className?: string }> {\n if (typeof value === \"function\") return true;\n // forwardRef / memo components are objects carrying `$$typeof` but, unlike a\n // rendered element, are not valid React elements.\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"$$typeof\" in value &&\n !isValidElement(value)\n );\n}\n"],"mappings":";;AAOA,SAAgB,EACd,GACgD;AAChD,SAAI,OAAO,KAAU,aAAmB,KAItC,OAAO,KAAU,YACjB,MAAU,QACV,cAAc,KACd,CAAC,EAAe,CAAK;AAEzB"}
1
+ {"version":3,"file":"is-react-component-DSnjtBmo.js","names":["isValidElement","isReactComponent","value"],"sources":["../../src/utils/is-react-component.ts"],"sourcesContent":["import { isValidElement, type ComponentType } from \"react\";\n\n/**\n * Distinguish an icon passed as a *component* (e.g. a Tabler icon or any\n * `FC`/forwardRef) from one passed as an already-rendered *element*. Lets icon\n * props accept either form: `prefix={Plus}` or `prefix={<Plus />}`.\n */\nexport function isReactComponent(\n value: unknown,\n): value is ComponentType<{ className?: string }> {\n if (typeof value === \"function\") return true;\n // forwardRef / memo components are objects carrying `$$typeof` but, unlike a\n // rendered element, are not valid React elements.\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"$$typeof\" in value &&\n !isValidElement(value)\n );\n}\n"],"mappings":";;AAOA,SAAgBC,EACdC,GACgD;AAChD,SAAI,OAAOA,KAAU,aAAmB,KAItC,OAAOA,KAAU,YACjBA,MAAU,QACV,cAAcA,KACd,CAACF,EAAeE,CAAK;AAEzB"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as i } from "./cn-ChIgwEl3.js";
2
+ import { t as i } from "./cn-CPbhpG1q.js";
3
3
  import "react";
4
4
  import { jsx as o } from "react/jsx-runtime";
5
5
  var s = "inline-flex h-4 min-w-4 items-center justify-center rounded-[3px] px-1 font-mono text-xs font-medium text-pho-secondary ring-1 ring-pho-secondary ring-inset select-none";
@@ -15,4 +15,4 @@ export {
15
15
  m as t
16
16
  };
17
17
 
18
- //# sourceMappingURL=kbd-DNI10uy7.js.map
18
+ //# sourceMappingURL=kbd-DWDs_6U1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kbd-DWDs_6U1.js","names":["cn","jsx","KBD_CLASS","Kbd","keys","className","children","props"],"sources":["../../src/components/kbd/kbd.tsx"],"sourcesContent":["import { type ComponentProps } from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** A single keycap surface — a mono-label pill with the site hairline (ring-pho-secondary) in secondary ink. */\nconst KBD_CLASS =\n \"inline-flex h-4 min-w-4 items-center justify-center rounded-[3px] px-1 font-mono text-xs font-medium text-pho-secondary ring-1 ring-pho-secondary ring-inset select-none\";\n\ninterface KbdBaseProps {\n /** Convenience string for the key(s) to show, e.g. \"⌘K\". Ignored when `children` are provided. */\n keys?: string;\n}\n\nexport interface KbdProps\n extends KbdBaseProps, Omit<ComponentProps<\"kbd\">, keyof KbdBaseProps> {}\n\n/**\n * Kbd — a keyboard keycap for documenting a shortcut (`⌘K`, `Esc`, `↵`). Supply\n * the key via `children` or the `keys` string; for a chord, place several in a\n * row (`Press ⌘ K`). It's purely presentational and carries no interaction — to\n * actually trigger a shortcut, wire a key handler on the target control.\n */\nexport function Kbd({ keys, className, children, ...props }: KbdProps) {\n return (\n <kbd className={cn(KBD_CLASS, className)} {...props}>\n {children ?? keys}\n </kbd>\n );\n}\n\nKbd.displayName = \"Kbd\";\n"],"mappings":";;;;AAIA,IAAME,IACJ;AAgBF,SAAgBC,EAAI,EAAE,MAAAC,GAAM,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAAmB;AACrE,SACE,gBAAAN,EAAC,OAAD;AAAA,IAAK,WAAWD,EAAGE,GAAWG,CAAS;AAAA,IAAG,GAAIE;AAAA,IAC3C,UAAAD,KAAYF;AAAA,EACV,CAAA;AAET;AAEAD,EAAI,cAAc"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { r as d, t as h } from "./chart-B5wjhkBu.js";
2
+ import { r as d, t as h } from "./chart-Btnw7KXV.js";
3
3
  import { jsx as e } from "react/jsx-runtime";
4
4
  function m({ series: r, curve: t = "linear", area: l = !1, gaps: i = "break", ...o }) {
5
5
  return /* @__PURE__ */ e(h, {
@@ -20,4 +20,4 @@ export {
20
20
  m as t
21
21
  };
22
22
 
23
- //# sourceMappingURL=line-chart-BODTNBrX.js.map
23
+ //# sourceMappingURL=line-chart-pOwE2_Oz.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-chart-pOwE2_Oz.js","names":["ChartLine","Chart","jsx","LineChart","series","curve","area","gaps","props","s","index"],"sources":["../../src/components/line-chart/line-chart.tsx"],"sourcesContent":["import { Chart, ChartLine } from \"../chart/chart\";\nimport type {\n ChartBaseProps,\n ChartCurve,\n ChartDatum,\n ChartGaps,\n} from \"../chart/types\";\n\n/**\n * LineChart — series over time as lines: latency percentiles, one line\n * per destination, a min / average / max where the bounds are dashed.\n *\n * A preset on `Chart`: the `series` array becomes one `Chart.Line` per\n * entry, in order; `curve` and `gaps` apply to every line and `area`\n * washes the surface under the first. The marks, axes, tooltip and legend are the\n * root's.\n */\nexport interface LineChartProps<\n T extends ChartDatum,\n> extends ChartBaseProps<T> {\n /** Straight segments, or a monotone curve that never overshoots a sample. @default \"linear\" */\n curve?: ChartCurve;\n /** A soft fill under the first series (a lone one, as a rule). */\n area?: boolean;\n /**\n * What every line does at a bucket with no value: break there, or\n * connect its neighbours across it — for a measure that has no reading\n * in an empty bucket rather than a reading of nothing. @default \"break\"\n */\n gaps?: ChartGaps;\n}\n\nexport function LineChart<T extends ChartDatum>({\n series,\n curve = \"linear\",\n area = false,\n gaps = \"break\",\n ...props\n}: LineChartProps<T>) {\n return (\n <Chart {...props}>\n {series.map((s, index) => (\n <ChartLine\n key={s.key}\n dataKey={s.key}\n label={s.label}\n color={s.color}\n dashed={s.dashed}\n curve={curve}\n area={area && index === 0}\n gaps={gaps}\n />\n ))}\n </Chart>\n );\n}\n\nLineChart.displayName = \"LineChart\";\n"],"mappings":";;;AAgCA,SAAgBG,EAAgC,EAC9C,QAAAC,GACA,OAAAC,IAAQ,UACR,MAAAC,IAAO,IACP,MAAAC,IAAO,SACP,GAAGC,EAAA,GACiB;AACpB,SACE,gBAAAN,EAACD,GAAD;AAAA,IAAO,GAAIO;AAAA,IACR,UAAAJ,EAAO,IAAA,CAAKK,GAAGC,MACd,gBAAAR,EAACF,GAAD;AAAA,MAEE,SAASS,EAAE;AAAA,MACX,OAAOA,EAAE;AAAA,MACT,OAAOA,EAAE;AAAA,MACT,QAAQA,EAAE;AAAA,MACH,OAAAJ;AAAA,MACP,MAAMC,KAAQI,MAAU;AAAA,MAClB,MAAAH;AAAA,IACP,GARME,EAAE,GAQR,CACF;AAAA,EACI,CAAA;AAEX;AAEAN,EAAU,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"link-provider-DXzDQ08N.js","names":[],"sources":["../../src/utils/link-provider.tsx"],"sourcesContent":["import {\n createContext,\n createElement,\n forwardRef,\n useContext,\n type AnchorHTMLAttributes,\n type ComponentType,\n type ReactNode,\n} from \"react\";\n\n/**\n * The shape a host app's link component must satisfy. Routers (TanStack Router,\n * React Router, Next.js) expose a `Link` that takes `href` + anchor props; this\n * lets Pho components render real client-side links without depending on any\n * specific router.\n */\nexport type LinkComponent = ComponentType<\n AnchorHTMLAttributes<HTMLAnchorElement> & { href: string }\n>;\n\n// Forwards its ref so wrappers (e.g. Motion) can reach the underlying anchor.\nconst DefaultLink: LinkComponent = forwardRef<\n HTMLAnchorElement,\n AnchorHTMLAttributes<HTMLAnchorElement> & { href: string }\n>((props, ref) => createElement(\"a\", { ...props, ref }));\nDefaultLink.displayName = \"DefaultLink\";\n\nconst LinkContext = createContext<LinkComponent>(DefaultLink);\n\n/** Inject the host router's link component for all Pho links beneath it. */\nexport function LinkProvider({\n component,\n children,\n}: {\n component: LinkComponent;\n children: ReactNode;\n}) {\n return (\n <LinkContext.Provider value={component}>{children}</LinkContext.Provider>\n );\n}\n\n/** Read the active link component (falls back to a plain `<a>`). */\nexport function useLinkComponent(): LinkComponent {\n return useContext(LinkContext);\n}\n"],"mappings":";;;AAqBA,IAAM,IAA6B,EAAA,CAGhC,GAAO,MAAQ,EAAc,KAAK;AAAA,EAAE,GAAG;AAAA,EAAO,KAAA;AAAI,CAAC,CAAC;AACvD,EAAY,cAAc;AAE1B,IAAM,IAAc,EAA6B,CAAW;AAG5D,SAAgB,EAAa,EAC3B,WAAA,GACA,UAAA,EAAA,GAIC;AACD,SACE,gBAAA,EAAC,EAAY,UAAb;AAAA,IAAsB,OAAO;AAAA,IAAY,UAAA;AAAA,EAA+B,CAAA;AAE5E;AAGA,SAAgB,IAAkC;AAChD,SAAO,EAAW,CAAW;AAC/B"}
1
+ {"version":3,"file":"link-provider-DXzDQ08N.js","names":["createContext","createElement","forwardRef","useContext","jsx","DefaultLink","props","ref","LinkContext","LinkProvider","component","children","useLinkComponent"],"sources":["../../src/utils/link-provider.tsx"],"sourcesContent":["import {\n createContext,\n createElement,\n forwardRef,\n useContext,\n type AnchorHTMLAttributes,\n type ComponentType,\n type ReactNode,\n} from \"react\";\n\n/**\n * The shape a host app's link component must satisfy. Routers (TanStack Router,\n * React Router, Next.js) expose a `Link` that takes `href` + anchor props; this\n * lets Pho components render real client-side links without depending on any\n * specific router.\n */\nexport type LinkComponent = ComponentType<\n AnchorHTMLAttributes<HTMLAnchorElement> & { href: string }\n>;\n\n// Forwards its ref so wrappers (e.g. Motion) can reach the underlying anchor.\nconst DefaultLink: LinkComponent = forwardRef<\n HTMLAnchorElement,\n AnchorHTMLAttributes<HTMLAnchorElement> & { href: string }\n>((props, ref) => createElement(\"a\", { ...props, ref }));\nDefaultLink.displayName = \"DefaultLink\";\n\nconst LinkContext = createContext<LinkComponent>(DefaultLink);\n\n/** Inject the host router's link component for all Pho links beneath it. */\nexport function LinkProvider({\n component,\n children,\n}: {\n component: LinkComponent;\n children: ReactNode;\n}) {\n return (\n <LinkContext.Provider value={component}>{children}</LinkContext.Provider>\n );\n}\n\n/** Read the active link component (falls back to a plain `<a>`). */\nexport function useLinkComponent(): LinkComponent {\n return useContext(LinkContext);\n}\n"],"mappings":";;;AAqBA,IAAMK,IAA6BH,EAAA,CAGhCI,GAAOC,MAAQN,EAAc,KAAK;AAAA,EAAE,GAAGK;AAAA,EAAO,KAAAC;AAAI,CAAC,CAAC;AACvDF,EAAY,cAAc;AAE1B,IAAMG,IAAcR,EAA6BK,CAAW;AAG5D,SAAgBI,EAAa,EAC3B,WAAAC,GACA,UAAAC,EAAA,GAIC;AACD,SACE,gBAAAP,EAACI,EAAY,UAAb;AAAA,IAAsB,OAAOE;AAAA,IAAY,UAAAC;AAAA,EAA+B,CAAA;AAE5E;AAGA,SAAgBC,IAAkC;AAChD,SAAOT,EAAWK,CAAW;AAC/B"}
@@ -1,13 +1,13 @@
1
1
  "use client";
2
- import { t as a } from "./cn-ChIgwEl3.js";
2
+ import { t as a } from "./cn-CPbhpG1q.js";
3
3
  import { n as k } from "./link-provider-DXzDQ08N.js";
4
4
  import { n as j } from "./use-copy-D6JwKUll.js";
5
- import { n as O } from "./spinner-BzLUo4Xk.js";
6
- import { a as A } from "./button-C9VqBBIr.js";
7
- import { i as D } from "./status-view-C8tabjDu.js";
8
- import { t as g } from "./skeleton-DwjSl4vC.js";
9
- import { t as h } from "./tooltip-BTF7GChl.js";
10
- import { r as E } from "./badge-DlLJPLeZ.js";
5
+ import { n as O } from "./spinner-BSutFL4l.js";
6
+ import { a as A } from "./button-CLfWdqm-.js";
7
+ import { i as D } from "./status-view-I_Y6eEyX.js";
8
+ import { t as g } from "./skeleton-CqZlGphn.js";
9
+ import { t as h } from "./tooltip-4J1PUJmB.js";
10
+ import { r as E } from "./badge-CVViIYj_.js";
11
11
  import { useEffect as T, useId as B, useRef as N } from "react";
12
12
  import { Fragment as W, jsx as t, jsxs as v } from "react/jsx-runtime";
13
13
  import { useRender as z } from "@base-ui/react/use-render";
@@ -241,4 +241,4 @@ export {
241
241
  pe as t
242
242
  };
243
243
 
244
- //# sourceMappingURL=log-list-tNuCFGlP.js.map
244
+ //# sourceMappingURL=log-list-QbSYHZu3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-list-QbSYHZu3.js","names":["_Fragment","cn","useLinkComponent","useCopy","Spinner","Button","StatusView","Skeleton","Tooltip","Badge","useEffect","useId","useRef","Fragment$1","jsx","jsxs","useRender","LOG_LIST_SURFACE","ID_HEAD","ID_TAIL","truncateMiddle","value","head","tail","SUCCESS_WORDS","ERROR_WORDS","WARNING_WORDS","logStatusColor","status","word","logStatusLabel","Status","label","size","className","props","Method","IdCell","id","cellId","copied","copy","Row","method","code","description","duration","time","children","href","onClick","render","current","Link","base","interactive","cellIds","hasMeta","describedBy","primary","Empty","title","Loading","rows","_","index","LoadMore","onLoadMore","loading","hasMore","rootMargin","ref","latest","el","observer","entries","entry","Root","LogList"],"sources":["../../src/components/log-list/log-list.tsx"],"sourcesContent":["import {\n useEffect,\n useId,\n useRef,\n type ComponentProps,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { Badge, type BadgeColor, type BadgeSize } from \"../badge\";\nimport { Button } from \"../button\";\nimport { Skeleton } from \"../skeleton\";\nimport { Spinner } from \"../spinner\";\nimport { StatusView } from \"../status-view\";\nimport { Tooltip } from \"../tooltip\";\nimport { cn } from \"../../utils/cn\";\nimport { useCopy } from \"../../utils/use-copy\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\n\n/**\n * Log List — rows of requests, deliveries, or messages, newest first,\n * each one line: a mono id you can copy, a status, the method, what\n * happened, and how long ago. Reach for it where a `DataTable` would be\n * columns of the same few fields: a log reads left to right as one line,\n * and the page filters it from a `FilterBar` pinned above.\n *\n * Design notes:\n * - The surface is `BasicPage.Card`'s: hairline border, `base` radius,\n * hairline rules between rows. It sits in a `Stack` as any card does.\n * - The row is one link (or one button). It stretches over the row from\n * the label, the way a `DataTable` row's does, so the whole row is one\n * pointer target and one tab stop; the copy control sits above it.\n * - The id truncates in the middle, keeping the prefix that says what it\n * is and the tail that tells it apart. The full id is a tooltip away,\n * and one click copies it.\n * - `LoadMore` is the sentinel at the end: it asks for the next page as\n * it scrolls into view, and offers a button for keyboards and for\n * browsers without an observer.\n */\n\n/** Same chrome as `BasicPage.Card`. */\nconst LOG_LIST_SURFACE =\n \"rounded-base border border-pho-secondary bg-pho-primary divide-y divide-pho-secondary\";\n\n/** Middle truncation: the prefix and this many after it, then the tail. */\nconst ID_HEAD = 12;\nconst ID_TAIL = 5;\n\n/**\n * Keep the start and the end of an id and fold the middle into an\n * ellipsis — `pho_req_01m04axjqrfzxv4xjet40a84gb` reads\n * `pho_req_01m0…a84gb`. Ids that fit are returned whole.\n */\nexport function truncateMiddle(\n value: string,\n head = ID_HEAD,\n tail = ID_TAIL,\n): string {\n if (value.length <= head + tail + 1) return value;\n return `${value.slice(0, head)}…${value.slice(-tail)}`;\n}\n\n/* -------------------------------- status -------------------------------- */\n\nconst SUCCESS_WORDS = new Set([\n \"success\",\n \"succeeded\",\n \"successful\",\n \"delivered\",\n \"ok\",\n \"sent\",\n \"received\",\n \"completed\",\n \"complete\",\n \"done\",\n \"active\",\n]);\nconst ERROR_WORDS = new Set([\n \"failed\",\n \"failure\",\n \"error\",\n \"errored\",\n \"rejected\",\n \"undelivered\",\n \"timeout\",\n \"timed_out\",\n \"timed out\",\n \"canceled\",\n \"cancelled\",\n]);\nconst WARNING_WORDS = new Set([\n \"pending\",\n \"queued\",\n \"retrying\",\n \"processing\",\n \"sending\",\n \"in_progress\",\n \"in progress\",\n \"scheduled\",\n \"waiting\",\n]);\n\n/**\n * The `Badge` color for a log status: an HTTP status code (2xx success,\n * 3xx gray, 4xx warning, 5xx error) or a word (`delivered` / `failed` /\n * `pending`). Anything else is gray.\n */\nexport function logStatusColor(status: number | string): BadgeColor {\n if (typeof status === \"number\") {\n if (status < 300) return \"success\";\n if (status < 400) return \"gray\";\n if (status < 500) return \"warning\";\n return \"error\";\n }\n const word = status.trim().toLowerCase();\n if (/^\\d{3}$/.test(word)) return logStatusColor(Number(word));\n if (SUCCESS_WORDS.has(word)) return \"success\";\n if (ERROR_WORDS.has(word)) return \"error\";\n if (WARNING_WORDS.has(word)) return \"warning\";\n return \"gray\";\n}\n\n/** A status word as a label: `timed_out` reads `Timed out`. */\nexport function logStatusLabel(status: number | string): string {\n if (typeof status === \"number\") return String(status);\n const word = status.trim().replace(/_/g, \" \");\n return word.charAt(0).toUpperCase() + word.slice(1);\n}\n\nexport interface LogStatusProps extends Omit<\n ComponentProps<\"span\">,\n \"children\" | \"color\"\n> {\n /** An HTTP status code or a status word. */\n value: number | string;\n /** Override the derived word. */\n label?: ReactNode;\n /** Badge size. @default \"sm\" */\n size?: BadgeSize;\n}\n\n/** The status slot — a low-contrast `Badge` colored by `logStatusColor`. */\nfunction Status({\n value,\n label,\n size = \"sm\",\n className,\n ...props\n}: LogStatusProps) {\n return (\n <Badge\n color={logStatusColor(value)}\n contrast=\"low\"\n size={size}\n className={cn(\"tabular-nums\", className)}\n {...props}\n >\n {label ?? logStatusLabel(value)}\n </Badge>\n );\n}\n\n/** The method slot — `POST`, `GET` as a quiet mono chip. */\nfunction Method({\n className,\n ...props\n}: ComponentProps<\"span\"> & { ref?: Ref<HTMLSpanElement> }) {\n return (\n <span\n className={cn(\n \"bg-pho-secondary text-pho-secondary inline-flex h-5 min-w-12 shrink-0 items-center justify-center rounded-sm px-1.5 font-mono text-xs font-medium whitespace-nowrap\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* ---------------------------------- id ---------------------------------- */\n\n/**\n * The id cell: a mono button that copies the full id, with a tooltip\n * holding the whole of it. The cell is a fixed width in characters so\n * ids line up down the list.\n */\nfunction IdCell({ id, cellId }: { id: string; cellId: string }) {\n const { copied, copy } = useCopy();\n return (\n <Tooltip.Root>\n <Tooltip.Trigger\n id={cellId}\n aria-label={copied ? `${id} copied` : `Copy ${id}`}\n data-copied={copied || undefined}\n onClick={() => void copy(id)}\n className={cn(\n \"text-pho-secondary outline-pho-brand hover:text-pho-primary relative z-10 -mx-1 w-[calc(18ch+0.5rem)] shrink-0 cursor-pointer truncate rounded-sm px-1 py-0.5 text-left font-mono text-xs transition-colors duration-100 ease-linear focus-visible:outline-2\",\n \"data-[copied]:text-pho-success\",\n )}\n >\n {copied ? \"Copied\" : truncateMiddle(id)}\n </Tooltip.Trigger>\n <output className=\"sr-only\" aria-live=\"polite\">\n {copied ? \"Copied\" : \"\"}\n </output>\n <Tooltip.Portal>\n <Tooltip.Positioner>\n <Tooltip.Popup className=\"font-mono\">{id}</Tooltip.Popup>\n </Tooltip.Positioner>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n}\n\n/* ---------------------------------- row --------------------------------- */\n\nexport interface LogListRowProps extends Omit<\n ComponentProps<\"div\">,\n \"children\" | \"title\" | \"onClick\" | \"id\"\n> {\n /** The record's id — mono, middle-truncated, copied on click. */\n id?: string;\n /** The status slot — usually `LogList.Status`. */\n status?: ReactNode;\n /** The method — `POST`, `GET`; rendered in `LogList.Method`. */\n method?: string;\n /** What happened — the route, the event type, the message. */\n label: ReactNode;\n /** The label in mono — for a route or an event type. */\n code?: boolean;\n /**\n * The line under the label, with real content: who received what from\n * whom, the destination that answered. A sentence, with its period.\n */\n description?: ReactNode;\n /** Trailing: how long it took — \"59 ms\". */\n duration?: ReactNode;\n /** Trailing: when — \"2 min ago\". */\n time?: ReactNode;\n /** Trailing content before the duration and time. */\n children?: ReactNode;\n /** The row is a link to its page, through the host's `LinkProvider`. */\n href?: string;\n /** The row is a button. */\n onClick?: (event: MouseEvent<HTMLElement>) => void;\n /**\n * Replace the row's link element — a router's `Link`, the way Base UI\n * components take `render`. The row's classes and handlers merge in.\n */\n render?: useRender.RenderProp;\n /** The row whose page is open beside the list — it keeps the wash. */\n current?: boolean;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction Row({\n id,\n status,\n method,\n label,\n code,\n description,\n duration,\n time,\n children,\n href,\n onClick,\n render,\n current,\n className,\n ...props\n}: LogListRowProps) {\n const Link = useLinkComponent();\n const base = useId();\n const interactive = href != null || onClick != null || render != null;\n const cellIds = {\n id: `${base}-id`,\n status: `${base}-status`,\n method: `${base}-method`,\n meta: `${base}-meta`,\n };\n const hasMeta = children != null || duration != null || time != null;\n const describedBy = [\n id != null && cellIds.id,\n status != null && cellIds.status,\n method != null && cellIds.method,\n hasMeta && cellIds.meta,\n ]\n .filter(Boolean)\n .join(\" \");\n const primary = useRender({\n render: render ?? (href != null ? <Link href={href} /> : undefined),\n defaultTagName: href != null ? \"a\" : onClick != null ? \"button\" : \"span\",\n props: {\n className: cn(\n \"text-pho-primary block min-w-0 max-w-full truncate text-left text-base font-medium outline-none\",\n code && \"font-mono text-xs\",\n // The one link, stretched over the row; the ring is the row's.\n interactive &&\n \"cursor-pointer after:absolute after:inset-0 after:content-['']\",\n ),\n onClick,\n type:\n render == null && href == null && onClick != null\n ? \"button\"\n : undefined,\n \"aria-current\": current ? \"page\" : undefined,\n \"aria-describedby\": describedBy || undefined,\n \"data-log-primary\": \"\",\n children: label,\n },\n });\n return (\n <div\n data-log-row=\"\"\n data-current={current || undefined}\n className={cn(\n \"relative flex min-h-12 min-w-0 items-center gap-3 px-5 py-2.5\",\n interactive &&\n \"hover:bg-pho-primary-hover outline-pho-brand transition-colors has-[[data-log-primary]:focus-visible]:outline-2 has-[[data-log-primary]:focus-visible]:-outline-offset-2\",\n current && \"bg-pho-primary-hover\",\n // The wash follows the card's rounding (minus the 1px border).\n \"first:rounded-t-[calc(var(--radius-base)-1px)] last:rounded-b-[calc(var(--radius-base)-1px)]\",\n className,\n )}\n {...props}\n >\n {id != null ? <IdCell id={id} cellId={cellIds.id} /> : null}\n {status != null ? (\n <span id={cellIds.status} className=\"flex shrink-0 items-center\">\n {status}\n </span>\n ) : null}\n {method != null ? <Method id={cellIds.method}>{method}</Method> : null}\n <div data-log-primary-cell=\"\" className=\"min-w-0 flex-1\">\n {primary}\n {description != null ? (\n <p className=\"text-pho-description truncate text-xs\">{description}</p>\n ) : null}\n </div>\n {hasMeta ? (\n <div\n id={cellIds.meta}\n className=\"text-pho-description ml-auto flex shrink-0 items-center gap-3 text-xs whitespace-nowrap tabular-nums\"\n >\n {children}\n {duration != null ? <span>{duration}</span> : null}\n {time != null ? <span>{time}</span> : null}\n </div>\n ) : null}\n </div>\n );\n}\n\n/* -------------------------------- states -------------------------------- */\n\nexport interface LogListEmptyProps extends Omit<\n ComponentProps<\"div\">,\n \"title\" | \"children\"\n> {\n /** One short line naming the state. @default \"Nothing here yet.\" */\n title?: ReactNode;\n /** What fills it, or why it is empty. */\n description?: ReactNode;\n /** An action, when there is one. */\n children?: ReactNode;\n}\n\n/** The list with no rows — `StatusView` at card size. */\nfunction Empty({\n title = \"Nothing here yet.\",\n description,\n children,\n className,\n ...props\n}: LogListEmptyProps) {\n return (\n <div className={cn(\"flex justify-center\", className)} {...props}>\n <StatusView\n size=\"sm\"\n title={title}\n description={description}\n actions={children}\n />\n </div>\n );\n}\n\n/** Bones in the rows' place while the first page is on its way. */\nfunction Loading({ rows = 5 }: { rows?: number }) {\n return (\n <>\n {Array.from({ length: rows }, (_, index) => (\n <div\n key={index}\n aria-hidden\n className=\"flex min-h-12 items-center gap-3 px-5 py-2.5\"\n >\n <Skeleton className=\"h-3.5 w-32\" />\n <Skeleton className=\"h-5 w-12 rounded-full\" />\n <Skeleton className=\"h-3.5 w-48\" />\n <Skeleton className=\"ml-auto h-3.5 w-16\" />\n </div>\n ))}\n </>\n );\n}\n\nexport interface LogListLoadMoreProps extends Omit<\n ComponentProps<\"div\">,\n \"children\"\n> {\n /** Asked for as the sentinel scrolls into view, and on the button. */\n onLoadMore: () => void;\n /** The next page is on its way — the sentinel shows a spinner and waits. */\n loading?: boolean;\n /** Nothing left to load — renders nothing. @default true */\n hasMore?: boolean;\n /** How far ahead of the viewport to ask. @default \"200px\" */\n rootMargin?: string;\n /** The button's words. @default \"Load more\" */\n label?: ReactNode;\n}\n\n/**\n * The sentinel at the end of the list. An `IntersectionObserver` asks for\n * the next page as it comes into view (`rootMargin` ahead of it); while\n * `loading` it shows a spinner and asks for nothing. The button is the\n * same request for keyboards and for a browser without the observer.\n * SSR-safe: the observer is created in an effect.\n */\nfunction LoadMore({\n onLoadMore,\n loading,\n hasMore = true,\n rootMargin = \"200px\",\n label = \"Load more\",\n className,\n ...props\n}: LogListLoadMoreProps) {\n const ref = useRef<HTMLDivElement | null>(null);\n const latest = useRef(onLoadMore);\n latest.current = onLoadMore;\n useEffect(() => {\n const el = ref.current;\n if (!hasMore || loading || el == null) return;\n if (typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) latest.current();\n },\n { rootMargin },\n );\n observer.observe(el);\n return () => observer.disconnect();\n }, [hasMore, loading, rootMargin]);\n if (!hasMore) return null;\n return (\n <div\n ref={ref}\n data-log-load-more=\"\"\n aria-busy={loading || undefined}\n className={cn(\n \"flex min-h-12 items-center justify-center px-5 py-2\",\n className,\n )}\n {...props}\n >\n {loading ? (\n <Spinner aria-label=\"Loading more\" className=\"text-pho-secondary\" />\n ) : (\n <Button variant=\"ghost\" size=\"sm\" onClick={() => onLoadMore()}>\n {label}\n </Button>\n )}\n </div>\n );\n}\n\n/* ---------------------------------- root -------------------------------- */\n\nexport interface LogListRootProps extends ComponentProps<\"div\"> {\n ref?: Ref<HTMLDivElement>;\n}\n\n/** The card the rows stack in. Mark it `aria-busy` while bones show. */\nfunction Root({ className, ...props }: LogListRootProps) {\n return (\n <div\n data-log-list=\"\"\n className={cn(LOG_LIST_SURFACE, \"min-w-0\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Log List — a card of one-line log rows.\n *\n * ```tsx\n * <LogList.Root>\n * <LogList.Row\n * id=\"pho_req_01m04axjqrfzxv4xjet40a84gb\"\n * status={<LogList.Status value={200} />}\n * method=\"POST\"\n * code\n * label=\"/v1/messages\"\n * description=\"+1 332 259 3374 received a message from +1 332 222 1111.\"\n * duration=\"59 ms\"\n * time=\"2 min ago\"\n * href=\"/requests/pho_req_01m04axjqrfzxv4xjet40a84gb\"\n * />\n * <LogList.LoadMore onLoadMore={fetchNextPage} loading={isFetching} hasMore={hasNextPage} />\n * </LogList.Root>\n * ```\n */\nexport const LogList = {\n Root,\n Row,\n Status,\n Method,\n Empty,\n Loading,\n LoadMore,\n};\n"],"mappings":";;;;;;;;;;;;;AA0CA,IAAMiB,IACJ,yFAGIC,IAAU,IACVC,IAAU;A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AI,EAAS,QAAQD,CAAE,GACnB,MAAaC,EAAS,WAAW;AAAA,EACnC,GAAG;AAAA,IAACL;AAAA,IAASD;AAAA,IAASE;AAAA,EAAU,CAAC,GAC5BD,IAEH,gBAAAvD,EAAC,OAAD;AAAA,IACO,KAAAyD;AAAA,IACL,sBAAmB;AAAA,IACnB,aAAWH,KAAW;AAAA,IACtB,WAAWnE,EACT,uDACAiC,CACF;AAAA,IACA,GAAIC;AAAA,IAEH,UAAAiC,IACC,gBAAAtD,EAACV,GAAD;AAAA,MAAS,cAAW;AAAA,MAAe,WAAU;AAAA,IAAsB,CAAA,IAEnE,gBAAAU,EAACT,GAAD;AAAA,MAAQ,SAAQ;AAAA,MAAQ,MAAK;AAAA,MAAK,SAAA,MAAe8D,EAAW;AAAA,MACzD,UAAAnC;AAAA,IACK,CAAA;AAAA,EAEP,CAAA,IAnBc;AAqBvB;AASA,SAAS6C,GAAK,EAAE,WAAA3C,GAAW,GAAGC,EAAA,GAA2B;AACvD,SACE,gBAAArB,EAAC,OAAD;AAAA,IACE,iBAAc;AAAA,IACd,WAAWb,EAAGgB,GAAkB,WAAWiB,CAAS;AAAA,IACpD,GAAIC;AAAA,EACL,CAAA;AAEL;AAsBA,IAAa2C,KAAU;AAAA,EACrB,MAAAD;AAAA,EACA,KAAAnC;AAAA,EACA,QAAAX;AAAA,EACA,QAAAK;AAAA,EACA,OAAAwB;AAAA,EACA,SAAAE;AAAA,EACA,UAAAI;AACF"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { t as d } from "./cn-ChIgwEl3.js";
2
+ import { t as d } from "./cn-CPbhpG1q.js";
3
3
  import { t as T } from "./resolve-variant-CcD8iG5l.js";
4
- import { n as B } from "./spinner-BzLUo4Xk.js";
4
+ import { n as B } from "./spinner-BSutFL4l.js";
5
5
  import { createContext as G, useCallback as v, useContext as N, useEffect as C, useMemo as H, useRef as h, useState as M } from "react";
6
6
  import { Fragment as K, jsx as c, jsxs as R } from "react/jsx-runtime";
7
7
  import { Separator as L } from "@base-ui/react/separator";
@@ -261,4 +261,4 @@ export {
261
261
  y as t
262
262
  };
263
263
 
264
- //# sourceMappingURL=menu-CoMrYnd1.js.map
264
+ //# sourceMappingURL=menu-CC3fhf83.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-CC3fhf83.js","names":["BaseMenu","_Fragment","Separator","BaseSeparator","Menu","cn","resolveVariant","Spinner","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","Fragment$1","jsx","jsxs","Separator","Menu","MenuPendingContext","useMenuPending","isThenable","value","withMenuPendingRoot","BaseRoot","PendingRoot","onOpenChange","actionsRef","props","pending","setPending","pendingRef","heldRef","hold","on","isHeld","internalActionsRef","handleOpenChange","open","eventDetails","contextValue","MENU_BLINK_MS","hush","event","useMenuItemBlink","blinks","context","blinking","setBlinking","phase","timer","intercept","row","useAsyncMenuItem","onClick","closeOnClick","loading","disabled","pendingContext","menuPending","busy","setBusy","mountedRef","inert","blocked","blinkProps","handleClick","result","error","MenuItemSpinner","MENU_POPUP","MENU_ITEM","MENU_ITEM_COLORS","Root","Trigger","Portal","Group","RadioGroup","SubmenuRoot","Positioner","className","sideOffset","Popup","Item","color","children","LinkItem","GroupLabel","Separator$1","SubmenuTrigger","CheckboxItem","RadioItem","CHECK_INDICATOR","CheckboxItemIndicator","RadioItemIndicator","Menu$1"],"sources":["../../src/components/menu/menu-pending.tsx","../../src/components/menu/menu.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentType,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n type RefObject,\n} from \"react\";\nimport { Spinner } from \"../spinner/spinner\";\n\n/** Imperative actions exposed by Base UI menu `actionsRef`. */\nexport interface RootActions {\n unmount: () => void;\n close: () => void;\n}\n\ninterface MenuPendingContextValue {\n /** True while a menu item promise is in flight. */\n pending: boolean;\n beginPending: () => void;\n endPending: () => void;\n /** Close the menu imperatively (used by async items on resolve). */\n close: () => void;\n /** Hold the menu open (no dismissal, no other row) through a blink. */\n hold: (on: boolean) => void;\n /** Whether a row is blinking. */\n isHeld: () => boolean;\n}\n\nconst MenuPendingContext = createContext<MenuPendingContextValue | null>(null);\n\n/**\n * Whether the surrounding menu has an async item promise in flight —\n * use it to disable sibling items while work is pending.\n * Returns `false` outside a `Menu.Root` / `ContextMenu.Root`.\n */\nexport function useMenuPending(): boolean {\n return useContext(MenuPendingContext)?.pending ?? false;\n}\n\nexport function isThenable(value: unknown): value is Promise<unknown> {\n return (\n value != null && typeof (value as { then?: unknown }).then === \"function\"\n );\n}\n\ntype PreventableMouseEvent = ReactMouseEvent<HTMLElement> & {\n preventBaseUIHandler?: () => void;\n};\n\nexport type RootWithPendingProps = {\n onOpenChange?: (open: boolean, eventDetails: { cancel: () => void }) => void;\n actionsRef?: RefObject<RootActions | null>;\n children?: ReactNode;\n};\n\n/**\n * Wraps a Base UI menu root so async `Menu.Item` clicks can lock dismissal\n * (outside press, Escape) until the promise settles.\n */\nexport function withMenuPendingRoot<P extends RootWithPendingProps>(\n BaseRoot: ComponentType<P>,\n): ComponentType<P> {\n function PendingRoot({ onOpenChange, actionsRef, ...props }: P) {\n const [pending, setPending] = useState(false);\n // Guard reads a ref so a resolve → close() in the same tick isn't blocked\n // by a not-yet-flushed state update.\n const pendingRef = useRef(false);\n // A row's confirm blink holds the menu the same way, without a render.\n // Stable across pending flips: a blinking row's effect keys on `hold`.\n const heldRef = useRef(false);\n const hold = useCallback((on: boolean) => {\n heldRef.current = on;\n }, []);\n const isHeld = useCallback(() => heldRef.current, []);\n const internalActionsRef = useRef<RootActions | null>(null);\n\n useEffect(() => {\n if (!actionsRef) return;\n // Proxy so callers always hit the live Base UI actions, even if the\n // popup remounts after this effect runs.\n actionsRef.current = {\n unmount: () => internalActionsRef.current?.unmount(),\n close: () => internalActionsRef.current?.close(),\n };\n return () => {\n actionsRef.current = null;\n };\n }, [actionsRef]);\n\n const handleOpenChange = useCallback(\n (open: boolean, eventDetails: { cancel: () => void }) => {\n if (!open && (pendingRef.current || heldRef.current)) {\n eventDetails.cancel();\n return;\n }\n onOpenChange?.(open, eventDetails);\n },\n [onOpenChange],\n );\n\n const contextValue = useMemo<MenuPendingContextValue>(\n () => ({\n pending,\n beginPending: () => {\n pendingRef.current = true;\n setPending(true);\n },\n endPending: () => {\n pendingRef.current = false;\n setPending(false);\n },\n close: () => internalActionsRef.current?.close(),\n hold,\n isHeld,\n }),\n [pending, hold, isHeld],\n );\n\n return (\n <MenuPendingContext.Provider value={contextValue}>\n <BaseRoot\n {...(props as P)}\n actionsRef={internalActionsRef}\n onOpenChange={handleOpenChange}\n />\n </MenuPendingContext.Provider>\n );\n }\n\n return PendingRoot as ComponentType<P>;\n}\n\n/** Each half of a row's confirm blink: its wash off, then back on. */\nexport const MENU_BLINK_MS = 90;\n\nfunction hush(event: ReactMouseEvent<HTMLElement>) {\n event.preventDefault();\n (event as PreventableMouseEvent).preventBaseUIHandler?.();\n}\n\n/**\n * The chosen row blinks before the menu closes, as on macOS: its wash\n * goes off for `MENU_BLINK_MS`, comes back for as long, and then the\n * press goes through — the action runs, the menu closes, a link\n * navigates. It confirms the press landed on the right row, where most\n * web menus close on the same frame. `blinks` is whether this row's\n * press ends the menu (an item that closes on click, a link); a row\n * that leaves the menu open, or a modified click (a link to a new tab),\n * goes through at once. The menu holds through the blink: no dismissal,\n * no second press.\n *\n * `intercept` goes first in the row's click handler and returns true\n * when it took the press. Spread `data-blink` on the row: `MENU_ITEM`\n * drops the wash while it is set.\n */\nexport function useMenuItemBlink(blinks: boolean) {\n const context = useContext(MenuPendingContext);\n const hold = context?.hold;\n const [blinking, setBlinking] = useState(false);\n const phase = useRef<\"idle\" | \"blinking\" | \"passing\">(\"idle\");\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n if (phase.current === \"blinking\") hold?.(false);\n phase.current = \"idle\";\n },\n [hold],\n );\n\n function intercept(event: ReactMouseEvent<HTMLElement>) {\n // The press going through after the blink.\n if (phase.current === \"passing\") return false;\n if (phase.current === \"blinking\" || context?.isHeld()) {\n hush(event);\n return true;\n }\n if (\n !blinks ||\n !context ||\n event.button !== 0 ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey\n ) {\n return false;\n }\n hush(event);\n const row = event.currentTarget;\n phase.current = \"blinking\";\n context.hold(true);\n setBlinking(true);\n timer.current = setTimeout(() => {\n setBlinking(false);\n timer.current = setTimeout(() => {\n timer.current = null;\n context.hold(false);\n phase.current = \"passing\";\n row.click();\n phase.current = \"idle\";\n }, MENU_BLINK_MS);\n }, MENU_BLINK_MS);\n return true;\n }\n\n return {\n intercept,\n blinkProps: { \"data-blink\": blinking || undefined },\n };\n}\n\nexport type AsyncMenuItemClick = (\n event: ReactMouseEvent<HTMLElement>,\n) => void | Promise<unknown>;\n\n/**\n * Shared click handler for `Menu.Item` / `ContextMenu.Item` promise support.\n * Returns whether the item should show its loading state.\n */\nexport function useAsyncMenuItem({\n onClick,\n closeOnClick = true,\n loading = false,\n disabled = false,\n}: {\n onClick?: AsyncMenuItemClick;\n closeOnClick?: boolean;\n loading?: boolean;\n disabled?: boolean;\n}) {\n const pendingContext = useContext(MenuPendingContext);\n const menuPending = pendingContext?.pending ?? false;\n const [busy, setBusy] = useState(false);\n const mountedRef = useRef(true);\n\n useEffect(() => {\n mountedRef.current = true;\n return () => {\n mountedRef.current = false;\n };\n }, []);\n\n const inert = busy || loading;\n // Disable siblings while any item promise is in flight — not the busy item itself.\n const blocked = disabled || (menuPending && !busy);\n const { intercept, blinkProps } = useMenuItemBlink(closeOnClick);\n\n function handleClick(event: ReactMouseEvent<HTMLElement>) {\n if (inert || (menuPending && !busy)) {\n (event as PreventableMouseEvent).preventBaseUIHandler?.();\n return;\n }\n // Blink first; the promise, if any, starts once the press goes through.\n if (intercept(event)) return;\n const result = onClick?.(event);\n if (!isThenable(result)) {\n return;\n }\n // Stop Base UI's closeOnClick for this press; close on resolve instead.\n (event as PreventableMouseEvent).preventBaseUIHandler?.();\n setBusy(true);\n pendingContext?.beginPending();\n result.then(\n () => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n if (closeOnClick) pendingContext?.close();\n },\n (error: unknown) => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n if (\n typeof process !== \"undefined\" &&\n process.env?.NODE_ENV !== \"production\"\n ) {\n console.error(\"Menu.Item: async onClick rejected —\", error);\n }\n },\n );\n }\n\n return { inert, blocked, handleClick, blinkProps };\n}\n\n/** Menu-row spinner — keeps `data-menu-spinner` for the hide-siblings CSS. */\nexport function MenuItemSpinner() {\n return <Spinner data-menu-spinner=\"\" size=\"md\" />;\n}\n","import {\n type ComponentProps,\n type ElementType,\n type MouseEvent as ReactMouseEvent,\n} from \"react\";\nimport { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { Separator as BaseSeparator } from \"@base-ui/react/separator\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\nimport {\n MENU_BLINK_MS,\n MenuItemSpinner,\n useAsyncMenuItem,\n useMenuItemBlink,\n useMenuPending,\n withMenuPendingRoot,\n type AsyncMenuItemClick,\n} from \"./menu-pending\";\n\nexport { useMenuPending, MENU_BLINK_MS };\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\" | \"color\"\n> & {\n className?: string;\n};\n\n/** Shared popup + item styles, reused by `ContextMenu` and `Menubar` menus. */\n// Floating layer: keeps its elevation shadow, sits on the primary surface\n// with the site's hairline (ring-pho-secondary, #eee/#202020) as its edge.\n// `base` radius + p-1.5 inset — the highlight floats 6px clear of the edge.\nexport const MENU_POPUP =\n \"bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary origin-[var(--transform-origin)] min-w-44 rounded-base p-1.5 ring-1 ring-inset outline-none transition-[transform,opacity] duration-[330ms] ease-pho-spring data-[ending-style]:duration-150 data-[ending-style]:ease-out data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0\";\n// Rest at secondary; highlighted lifts to primary with the quiet ghost wash.\n// Icons use `text-current` so they follow the row ink (including destructive).\n// While loading, the spinner is first; hide the rest of the leading icons.\n// Concentric correction (see /scale): row radius = popup radius − popup\n// padding (base − 6px). py-2 + 20px line-height lands the 36px row height.\n// `data-blink` is the off half of the confirm blink (useMenuItemBlink): the\n// wash drops, over any color's, and comes back on the next frame it clears.\nexport const MENU_ITEM =\n \"relative flex cursor-pointer items-center gap-2 rounded-[calc(var(--radius-base)-6px)] py-2 pr-2.5 pl-2.5 text-base text-pho-secondary outline-none select-none data-[highlighted]:bg-pho-ghost-hover data-[highlighted]:text-pho-primary data-[highlighted]:data-[blink]:bg-transparent data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-loading:data-[disabled]:opacity-100 data-loading:[&>svg:not([data-menu-spinner])]:hidden [&>svg]:size-4 [&>svg]:text-current\";\n\n/** Semantic ink for `Menu.Item` / `LinkItem` / `ContextMenu.Item`. */\nexport const MENU_ITEM_COLORS = {\n default: { classes: \"\", description: \"Secondary → primary on highlight\" },\n destructive: {\n classes:\n \"text-pho-error data-[highlighted]:bg-pho-error-primary data-[highlighted]:text-pho-error\",\n description: \"Error ink + error wash on highlight\",\n },\n} satisfies VariantMap;\n\nexport type MenuItemColor = keyof typeof MENU_ITEM_COLORS;\n\ntype ItemColorProps = {\n /** Semantic ink. @default \"default\" */\n color?: MenuItemColor;\n};\n\nexport type MenuItemProps = Omit<StyledProps<typeof BaseMenu.Item>, \"onClick\"> &\n ItemColorProps & {\n /**\n * Action handler. Return a promise to keep the menu open while it runs:\n * the item shows a spinner, dismissal is locked, and the menu closes when\n * the promise resolves (if `closeOnClick`). On rejection the menu stays\n * open — surface errors inside the handler.\n */\n onClick?: AsyncMenuItemClick;\n /**\n * Declarative loading state (same visual as an in-flight promise).\n * @default false\n */\n loading?: boolean;\n };\n\nconst Root = withMenuPendingRoot(BaseMenu.Root);\nconst Trigger = BaseMenu.Trigger;\nconst Portal = BaseMenu.Portal;\nconst Group = BaseMenu.Group;\nconst RadioGroup = BaseMenu.RadioGroup;\n// Don't wrap SubmenuRoot — nested pending context would shadow the parent\n// Root and fail to lock dismissal for async items inside a submenu.\nconst SubmenuRoot = BaseMenu.SubmenuRoot;\n\nfunction Positioner({\n className,\n sideOffset = 6,\n ...props\n}: StyledProps<typeof BaseMenu.Positioner>) {\n return (\n <BaseMenu.Positioner\n sideOffset={sideOffset}\n className={cn(\"z-50\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseMenu.Popup>) {\n return <BaseMenu.Popup className={cn(MENU_POPUP, className)} {...props} />;\n}\n\nfunction Item({\n className,\n color = \"default\",\n onClick,\n closeOnClick = true,\n loading = false,\n disabled = false,\n children,\n ...props\n}: MenuItemProps) {\n const { inert, blocked, handleClick, blinkProps } = useAsyncMenuItem({\n onClick,\n closeOnClick,\n loading,\n disabled,\n });\n\n return (\n <BaseMenu.Item\n className={cn(\n MENU_ITEM,\n resolveVariant(MENU_ITEM_COLORS, color),\n className,\n )}\n closeOnClick={closeOnClick}\n disabled={blocked}\n data-loading={inert || undefined}\n aria-busy={inert || undefined}\n {...blinkProps}\n onClick={handleClick as (event: ReactMouseEvent<HTMLElement>) => void}\n {...props}\n >\n {inert ? (\n <>\n <MenuItemSpinner />\n <output className=\"sr-only\" aria-live=\"polite\" />\n </>\n ) : null}\n {children}\n </BaseMenu.Item>\n );\n}\n\nfunction LinkItem({\n className,\n color = \"default\",\n onClick,\n ...props\n}: StyledProps<typeof BaseMenu.LinkItem> & ItemColorProps) {\n // A link's press leaves the menu wherever it goes, so it always blinks.\n const { intercept, blinkProps } = useMenuItemBlink(true);\n return (\n <BaseMenu.LinkItem\n className={cn(\n MENU_ITEM,\n resolveVariant(MENU_ITEM_COLORS, color),\n className,\n )}\n {...blinkProps}\n onClick={(event) => {\n if (!intercept(event)) onClick?.(event);\n }}\n {...props}\n />\n );\n}\n\nfunction GroupLabel({\n className,\n ...props\n}: StyledProps<typeof BaseMenu.GroupLabel>) {\n return (\n <BaseMenu.GroupLabel\n className={cn(\n \"text-pho-secondary px-2.5 py-1.5 text-xs font-medium\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Separator({ className, ...props }: StyledProps<typeof BaseSeparator>) {\n return (\n <BaseSeparator\n className={cn(\n \"-mx-1.5 my-1.5 h-px bg-[var(--border-color-pho-secondary)]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SubmenuTrigger({\n className,\n ...props\n}: StyledProps<typeof BaseMenu.SubmenuTrigger>) {\n return (\n <BaseMenu.SubmenuTrigger\n className={cn(\n MENU_ITEM,\n \"data-[popup-open]:bg-pho-ghost-hover\",\n className,\n )}\n {...props}\n />\n );\n}\n\n// A checkbox or radio row stays open by default (Base UI); it blinks only\n// when `closeOnClick` makes its press the menu's last.\nfunction CheckboxItem({\n className,\n closeOnClick = false,\n onClick,\n ...props\n}: StyledProps<typeof BaseMenu.CheckboxItem>) {\n const { intercept, blinkProps } = useMenuItemBlink(closeOnClick);\n return (\n <BaseMenu.CheckboxItem\n className={cn(MENU_ITEM, \"pl-8\", className)}\n closeOnClick={closeOnClick}\n {...blinkProps}\n onClick={(event) => {\n if (!intercept(event)) onClick?.(event);\n }}\n {...props}\n />\n );\n}\n\nfunction RadioItem({\n className,\n closeOnClick = false,\n onClick,\n ...props\n}: StyledProps<typeof BaseMenu.RadioItem>) {\n const { intercept, blinkProps } = useMenuItemBlink(closeOnClick);\n return (\n <BaseMenu.RadioItem\n className={cn(MENU_ITEM, \"pl-8\", className)}\n closeOnClick={closeOnClick}\n {...blinkProps}\n onClick={(event) => {\n if (!intercept(event)) onClick?.(event);\n }}\n {...props}\n />\n );\n}\n\nconst CHECK_INDICATOR =\n \"text-pho-brand absolute left-2.5 flex items-center [&>svg]:size-4\";\n\nfunction CheckboxItemIndicator({\n className,\n ...props\n}: StyledProps<typeof BaseMenu.CheckboxItemIndicator>) {\n return (\n <BaseMenu.CheckboxItemIndicator\n className={cn(CHECK_INDICATOR, className)}\n {...props}\n />\n );\n}\n\nfunction RadioItemIndicator({\n className,\n ...props\n}: StyledProps<typeof BaseMenu.RadioItemIndicator>) {\n return (\n <BaseMenu.RadioItemIndicator\n className={cn(CHECK_INDICATOR, className)}\n {...props}\n />\n );\n}\n\n/**\n * Dropdown menu built on Base UI `Menu` — a list of actions opened from a\n * trigger. Supports grouped items, separators, submenus\n * (`SubmenuRoot` + `SubmenuTrigger`), and stateful `CheckboxItem` /\n * `RadioItem`s. `Menu.Item` has native promise support (spinner + locked\n * dismissal while pending). A press that closes the menu blinks its row\n * first, as on macOS (`MENU_BLINK_MS` off, as long on), then goes\n * through. For a right-click menu use `ContextMenu`.\n */\nexport const Menu = {\n Root,\n Trigger,\n Portal,\n Positioner,\n Popup,\n Item,\n LinkItem,\n Group,\n GroupLabel,\n Separator,\n SubmenuRoot,\n SubmenuTrigger,\n CheckboxItem,\n CheckboxItemIndicator,\n RadioGroup,\n RadioItem,\n RadioItemIndicator,\n};\n"],"mappings":";;;;;;;;AAkCA,IAAMoB,IAAqBZ,EAA8C,IAAI;AAO7E,SAAgBa,KAA0B;AACxC,SAAOX,EAAWU,CAAkB,GAAG,WAAW;AACpD;AAEA,SAAgBE,EAAWC,GAA2C;AACpE,SACEA,KAAS,QAAQ,OAAQA,EAA6B,QAAS;AAEnE;AAgBA,SAAgBC,EACdC,GACkB;AAClB,WAASC,EAAY,EAAE,cAAAC,GAAc,YAAAC,GAAY,GAAGC,EAAA,GAAY;AAC9D,UAAM,CAACC,GAASC,CAAA,IAAcjB,EAAS,EAAK,GAGtCkB,IAAanB,EAAO,EAAK,GAGzBoB,IAAUpB,EAAO,EAAK,GACtBqB,IAAOzB,EAAA,CAAa0B,MAAgB;AACxC,MAAAF,EAAQ,UAAUE;AAAA,IAC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AWA,IAAazB,KAAO;AAAA,EAClB,MAAAsE;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAI;AAAA,EACA,OAAAG;AAAA,EACA,MAAAC;AAAA,EACA,UAAAG;AAAA,EACA,OAAAV;AAAA,EACA,YAAAW;AAAA,EACA,WAAAC;AAAA,EACA,aAAAV;AAAA,EACA,gBAAAW;AAAA,EACA,cAAAC;AAAA,EACA,uBAAAG;AAAA,EACA,YAAAhB;AAAA,EACA,WAAAc;AAAA,EACA,oBAAAG;AACF"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as r } from "./cn-ChIgwEl3.js";
2
+ import { t as r } from "./cn-CPbhpG1q.js";
3
3
  import { createContext as f, useContext as m } from "react";
4
4
  import { jsx as s } from "react/jsx-runtime";
5
5
  var u = f("start");
@@ -89,4 +89,4 @@ export {
89
89
  d as t
90
90
  };
91
91
 
92
- //# sourceMappingURL=message-Dz2-numf.js.map
92
+ //# sourceMappingURL=message-DRAWQlW-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-DRAWQlW-.js","names":["cn","createContext","useContext","jsx","MessageContext","Group","className","props","Root","align","Avatar","Content","Header","Time","Footer","Message","messageStatusKey","outbound","status","text","word","shouldShowMessageStatus","messages","index","current","key","at","next","nextKey"],"sources":["../../src/components/message/message.tsx","../../src/components/message/message-status.ts"],"sourcesContent":["import { createContext, useContext, type ComponentProps } from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/**\n * Message — one turn in a thread: the row that seats an avatar beside a\n * column of header, bubble, and footer, on the author's side. It owns the\n * row layout and nothing else: the surface is `Bubble`'s, the scrolling\n * and the composer are `Chat`'s.\n *\n * Design notes:\n * - `align=\"end\"` mirrors the row — avatar on the right, column\n * right-aligned — for the reader's own messages.\n * - The avatar sits at the row's bottom, level with the bubble. When a\n * `Footer` (status) sits under the bubble, the avatar shifts up by one\n * line so it stays beside the surface.\n * - `Time` sits beside the bubble, last-line aligned — right of inbound,\n * left of outbound — and is invisible until the row is hovered or\n * focused. `Footer` is the status caption under the bubble (Delivered,\n * Failed). Inbound has no status.\n */\n\nexport type MessageAlign = \"start\" | \"end\";\n\nconst MessageContext = createContext<MessageAlign>(\"start\");\n\n/* --------------------------------- group -------------------------------- */\n\n/** Consecutive messages from one author, spaced as one turn. */\nfunction Group({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-message-group=\"\"\n className={cn(\"flex min-w-0 flex-col gap-2\", className)}\n {...props}\n />\n );\n}\n\n/* --------------------------------- root --------------------------------- */\n\nexport interface MessageRootProps extends ComponentProps<\"div\"> {\n /** Which side the author sits on. @default \"start\" */\n align?: MessageAlign;\n}\n\n/** The row: avatar beside the content column, mirrored for `end`. */\nfunction Root({ align = \"start\", className, ...props }: MessageRootProps) {\n return (\n <MessageContext.Provider value={align}>\n <div\n data-message=\"\"\n data-align={align}\n className={cn(\n \"group/message @container relative flex w-full min-w-0 gap-2 text-base\",\n align === \"end\" && \"flex-row-reverse\",\n className,\n )}\n {...props}\n />\n </MessageContext.Provider>\n );\n}\n\n/* -------------------------------- avatar -------------------------------- */\n\n/**\n * The avatar's seat — pass an `Avatar.Root`. Bottom-aligned with the\n * bubble; lifts by one footer line when the message has a `Footer`.\n */\nfunction Avatar({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-message-avatar=\"\"\n className={cn(\n // Footer line = xs line-height (18px) + the column's 4px gap.\n \"flex shrink-0 self-end group-has-[[data-message-footer]]/message:-translate-y-[1.375rem]\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* -------------------------------- content ------------------------------- */\n\n/**\n * Header over the bubble; time beside it; status under it. Inbound is\n * `[bubble][time]`. Outbound is `[time][bubble]` with `Footer` below\n * the bubble column.\n */\nfunction Content({ className, ...props }: ComponentProps<\"div\">) {\n const align = useContext(MessageContext);\n return (\n <div\n data-message-content=\"\"\n className={cn(\n \"grid w-max max-w-full flex-none items-end gap-x-1.5 gap-y-1 break-words\",\n \"[&>[data-message-header]]:[grid-area:header]\",\n \"[&>[data-bubble]]:max-w-[80cqw] [&>[data-bubble]]:[grid-area:main]\",\n \"[&>[data-bubble-group]]:max-w-[80cqw] [&>[data-bubble-group]]:[grid-area:main]\",\n \"[&>[data-bubble][data-variant=ghost]]:max-w-full\",\n \"[&>[data-message-time]]:[grid-area:time]\",\n \"[&>[data-message-footer]]:[grid-area:status]\",\n align === \"end\"\n ? \"ml-auto grid-cols-[auto_minmax(0,max-content)] [grid-template-areas:'._header'_'time_main'_'._status'] [&>[data-bubble-group]]:justify-self-end [&>[data-bubble]]:justify-self-end [&>[data-message-header]]:justify-self-end\"\n : \"grid-cols-[minmax(0,max-content)_auto] [grid-template-areas:'header_.'_'main_time'_'status_.'] [&>[data-bubble-group]]:justify-self-start [&>[data-bubble]]:justify-self-start\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Who — the sender's name over the bubble, secondary ink. */\nfunction Header({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-message-header=\"\"\n className={cn(\n \"text-pho-secondary flex w-full max-w-full min-w-0 items-center gap-1.5 px-1 text-xs font-medium group-has-[[data-bubble][data-variant=ghost]]/message:px-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Clock beside the bubble, last-line aligned. Description ink, tabular.\n * Inbound sits to the right; outbound to the left. The slot stays in\n * layout; the digits show when the row is hovered or focused.\n */\nfunction Time({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div\n data-message-time=\"\"\n className={cn(\n \"text-pho-description shrink-0 self-end text-xs whitespace-nowrap tabular-nums opacity-0 transition-opacity duration-100 ease-linear group-focus-within/message:opacity-100 group-hover/message:opacity-100\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Status under the bubble — Delivered, Failed. Inbound leaves it off.\n * Description ink.\n */\nfunction Footer({ className, ...props }: ComponentProps<\"div\">) {\n const align = useContext(MessageContext);\n return (\n <div\n data-message-footer=\"\"\n className={cn(\n \"text-pho-description flex max-w-full min-w-0 items-center gap-1.5 px-1 text-xs group-has-[[data-bubble][data-variant=ghost]]/message:px-0\",\n align === \"end\" && \"justify-self-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * A turn in a thread. `Root` takes `align`; `Avatar` seats an\n * `Avatar.Root`; `Content` places `Header` over the bubble, `Time`\n * beside it, and `Footer` under it.\n *\n * ```tsx\n * <Message.Root align=\"end\">\n * <Message.Content>\n * <Bubble.Root variant=\"inverse\" align=\"end\">\n * <Bubble.Content>On my way.</Bubble.Content>\n * </Bubble.Root>\n * <Message.Time>2:47 PM</Message.Time>\n * <Message.Footer>Delivered.</Message.Footer>\n * </Message.Content>\n * </Message.Root>\n * ```\n */\nexport const Message = { Root, Group, Avatar, Content, Header, Time, Footer };\n","/**\n * One row in a thread, enough to decide whether its outbound status\n * caption should show. Inbound rows leave `outbound` off.\n */\nexport interface MessageStatusItem {\n outbound?: boolean;\n /** Delivered, Sent, Failed — or a token like `delivered`. */\n status?: string | null;\n}\n\n/**\n * The coalesce key for a row: outbound status word, lowercased. Inbound\n * and empty statuses are `null`: they carry no status and sit outside the\n * runs (see `shouldShowMessageStatus`). A failure keeps its\n * whole text (`failed. 30007`) so two different error codes never\n * collapse into one caption.\n */\nexport function messageStatusKey(\n outbound: boolean,\n status: string | null | undefined,\n): string | null {\n if (!outbound || status == null) return null;\n const text = status.trim().toLowerCase();\n const word = text.split(/[\\s.]+/)[0];\n if (!word) return null;\n return word === \"failed\" ? text : word;\n}\n\n/**\n * Whether this row should render its outbound status (Delivered, Sent,\n * Failed). Only the last message in a same-status run shows it. Inbound\n * never does, and a reply in between does not break the run: the run is\n * over the outbound messages alone, so a conversation going back and forth\n * wears one Delivered, under the latest message it holds for, not one\n * under every turn.\n */\nexport function shouldShowMessageStatus(\n messages: readonly MessageStatusItem[],\n index: number,\n): boolean {\n const current = messages[index];\n if (!current) return false;\n const key = messageStatusKey(current.outbound === true, current.status);\n if (key == null) return false;\n for (let at = index + 1; at < messages.length; at++) {\n const next = messages[at];\n const nextKey = messageStatusKey(next?.outbound === true, next?.status);\n if (nextKey != null) return nextKey !== key;\n }\n return true;\n}\n"],"mappings":";;;;AAuBA,IAAMI,IAAiBH,EAA4B,OAAO;AAK1D,SAASI,EAAM,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAAgC;AAC7D,SACE,gBAAAJ,EAAC,OAAD;AAAA,IACE,sBAAmB;AAAA,IACnB,WAAWH,EAAG,+BAA+BM,CAAS;AAAA,IACtD,GAAIC;AAAA,EACL,CAAA;AAEL;AAUA,SAASC,EAAK,EAAE,OAAAC,IAAQ,SAAS,WAAAH,GAAW,GAAGC,EAAA,GAA2B;AACxE,SACE,gBAAAJ,EAACC,EAAe,UAAhB;AAAA,IAAyB,OAAOK;AAAA,IAC9B,UAAA,gBAAAN,EAAC,OAAD;AAAA,MACE,gBAAa;AAAA,MACb,cAAYM;AAAA,MACZ,WAAWT,EACT,yEACAS,MAAU,SAAS,oBACnBH,CACF;AAAA,MACA,GAAIC;AAAA,IACL,CAAA;AAAA,EACsB,CAAA;AAE7B;AAQA,SAASG,EAAO,EAAE,WAAAJ,GAAW,GAAGC,EAAA,GAAgC;AAC9D,SACE,gBAAAJ,EAAC,OAAD;AAAA,IACE,uBAAoB;AAAA,IACpB,WAAWH,EAET,4FACAM,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AASA,SAASI,EAAQ,EAAE,WAAAL,GAAW,GAAGC,EAAA,GAAgC;AAC/D,QAAME,IAAQP,EAAWE,CAAc;AACvC,SACE,gBAAAD,EAAC,OAAD;AAAA,IACE,wBAAqB;AAAA,IACrB,WAAWH,EACT,2EACA,gDACA,sEACA,kFACA,oDACA,4CACA,gDACAS,MAAU,QACN,kOACA,kLACJH,CACF;AAAA,IACA,GAAIC;AAAA,EACL,CAAA;AAEL;AAGA,SAASK,EAAO,EAAE,WAAAN,GAAW,GAAGC,EAAA,GAAgC;AAC9D,SACE,gBAAAJ,EAAC,OAAD;AAAA,IACE,uBAAo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,QAAIC,KAAW,KAAM,QAAOA,MAAYH;AAAA,EAC1C;AACA,SAAO;AACT"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "./cn-ChIgwEl3.js";
2
+ import { t as e } from "./cn-CPbhpG1q.js";
3
3
  import "react";
4
4
  import { jsx as a } from "react/jsx-runtime";
5
5
  import { Popover as t } from "@base-ui/react/popover";
@@ -43,4 +43,4 @@ export {
43
43
  h as t
44
44
  };
45
45
 
46
- //# sourceMappingURL=popover-BhBJO346.js.map
46
+ //# sourceMappingURL=popover-B0NBrYV5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover-B0NBrYV5.js","names":["BasePopover","Popover","cn","jsx","Popover","Root","Trigger","Portal","Close","Positioner","className","sideOffset","props","Popup","Title","Description","Popover$1"],"sources":["../../src/components/popover/popover.tsx"],"sourcesContent":["import { type ComponentProps, type ElementType } from \"react\";\nimport { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nconst Root = BasePopover.Root;\nconst Trigger = BasePopover.Trigger;\nconst Portal = BasePopover.Portal;\nconst Close = BasePopover.Close;\n\nfunction Positioner({\n className,\n sideOffset = 8,\n ...props\n}: StyledProps<typeof BasePopover.Positioner>) {\n return (\n <BasePopover.Positioner\n sideOffset={sideOffset}\n className={cn(\"z-50\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BasePopover.Popup>) {\n return (\n <BasePopover.Popup\n className={cn(\n // Floating layer: keeps shadow elevation; ring-pho-secondary is the\n // site card-hairline edge (#eee / #202020).\n \"bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary rounded-base ease-pho-spring max-w-[calc(100vw-2rem)] origin-[var(--transform-origin)] p-4 ring-1 transition-[transform,opacity] duration-[330ms] outline-none ring-inset data-[ending-style]:duration-150 data-[ending-style]:ease-out\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BasePopover.Title>) {\n return (\n <BasePopover.Title\n className={cn(\"text-pho-primary text-base font-medium\", className)}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BasePopover.Description>) {\n return (\n <BasePopover.Description\n className={cn(\"text-pho-description text-base\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Popover built on Base UI `Popover` — a click-triggered floating panel\n * anchored to its trigger, for rich, interactive content (forms, menus of\n * actions, details). Unlike a `Tooltip`, it can hold focusable controls and is\n * dismissed by clicking away or pressing Escape.\n */\nexport const Popover = {\n Root,\n Trigger,\n Portal,\n Positioner,\n Popup,\n Title,\n Description,\n Close,\n};\n"],"mappings":";;;;;AAYA,IAAMK,IAAOL,EAAY,MACnBM,IAAUN,EAAY,SACtBO,IAASP,EAAY,QACrBQ,IAAQR,EAAY;AAE1B,SAASS,EAAW,EAClB,WAAAC,GACA,YAAAC,IAAa,GACb,GAAGC,EAAA,GAC0C;AAC7C,SACE,gBAAAT,EAACH,EAAY,YAAb;AAAA,IACc,YAAAW;AAAA,IACZ,WAAWT,EAAG,QAAQQ,CAAS;AAAA,IAC/B,GAAIE;AAAA,EACL,CAAA;AAEL;AAEA,SAASC,EAAM,EAAE,WAAAH,GAAW,GAAGE,EAAA,GAAgD;AAC7E,SACE,gBAAAT,EAACH,EAAY,OAAb;AAAA,IACE,WAAWE,EAGT,4SACA,kEACA,8DACAQ,CACF;AAAA,IACA,GAAIE;AAAA,EACL,CAAA;AAEL;AAEA,SAASE,EAAM,EAAE,WAAAJ,GAAW,GAAGE,EAAA,GAAgD;AAC7E,SACE,gBAAAT,EAACH,EAAY,OAAb;AAAA,IACE,WAAWE,EAAG,0CAA0CQ,CAAS;AAAA,IACjE,GAAIE;AAAA,EACL,CAAA;AAEL;AAEA,SAASG,EAAY,EACnB,WAAAL,GACA,GAAGE,EAAA,GAC2C;AAC9C,SACE,gBAAAT,EAACH,EAAY,aAAb;AAAA,IACE,WAAWE,EAAG,kCAAkCQ,CAAS;AAAA,IACzD,GAAIE;AAAA,EACL,CAAA;AAEL;AAQA,IAAaX,IAAU;AAAA,EACrB,MAAAI;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAE;AAAA,EACA,OAAAI;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAP;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"popup-anchor-C3_iXdbh.js","names":[],"sources":["../../src/utils/popup-anchor.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n type ReactNode,\n} from \"react\";\n\n/**\n * Where a popup anchors when its trigger pulses on press.\n *\n * The press pulse scales the trigger with a transform, and the popup opens on\n * that same press, so Base UI's positioner measures the trigger mid-pulse.\n * Its anchor rect includes the transform, so `--anchor-width` (the popup's\n * width) follows the scale frame by frame. The positioner's own\n * ResizeObserver then sees the popup resize inside its own callback, which the\n * browser reports as \"ResizeObserver loop completed with undelivered\n * notifications\". Anchoring to the trigger's laid-out box, the transform\n * taken back out, keeps the anchor still while the trigger pulses.\n */\nconst PopupAnchorContext = createContext<{\n element: HTMLElement | null;\n register: (element: HTMLElement | null) => void;\n} | null>(null);\n\n/** Holds the pulsing trigger a Root's positioner anchors to. */\nexport function PopupAnchorProvider({ children }: { children: ReactNode }) {\n const [element, register] = useState<HTMLElement | null>(null);\n const value = useMemo(() => ({ element, register }), [element]);\n return (\n <PopupAnchorContext.Provider value={value}>\n {children}\n </PopupAnchorContext.Provider>\n );\n}\n\n/**\n * The ref for a trigger that pulses on press (`usePressPulse`), so the\n * popup it opens anchors to its laid-out box rather than its scaled one.\n * Outside a Pho `Select.Root` or `Combobox.Root` it does nothing.\n */\nexport function usePopupAnchorTrigger() {\n const context = useContext(PopupAnchorContext);\n const register = context?.register;\n return useCallback(\n (element: HTMLElement | null) => register?.(element),\n [register],\n );\n}\n\n/**\n * The positioner's `anchor`: the registered trigger's laid-out box. With no\n * trigger registered (a Combobox anchored to its input, a trigger whose\n * `render` dropped the ref) it is `undefined`, so Base UI keeps its own\n * default anchor; a callback resolving to `null` would clear that anchor and\n * leave the popup unpositioned.\n */\nexport function usePopupAnchor() {\n const element = useContext(PopupAnchorContext)?.element ?? null;\n return useMemo(\n () =>\n element\n ? () => ({\n contextElement: element,\n getBoundingClientRect: () => layoutRect(element),\n })\n : undefined,\n [element],\n );\n}\n\n/**\n * The element's border box as laid out, its own scale undone. Only a scale\n * and a translate (what a press pulse writes) are undone; any other transform\n * leaves the measured rect as it is.\n */\nexport function layoutRect(element: Element): DOMRect {\n const rect = element.getBoundingClientRect();\n const style = getComputedStyle(element);\n if (!style.transform || style.transform === \"none\") return rect;\n const matrix = new DOMMatrixReadOnly(style.transform);\n if (!matrix.is2D || matrix.b !== 0 || matrix.c !== 0) return rect;\n if (matrix.a <= 0 || matrix.d <= 0) return rect;\n // A point x of the box lands at origin + scale * (x - origin) + translate.\n const [originX = 0, originY = 0] = style.transformOrigin\n .split(\" \")\n .map((value) => parseFloat(value) || 0);\n return new DOMRect(\n rect.left - matrix.e - originX * (1 - matrix.a),\n rect.top - matrix.f - originY * (1 - matrix.d),\n rect.width / matrix.a,\n rect.height / matrix.d,\n );\n}\n"],"mappings":";;;AAqBA,IAAM,IAAqB,EAGjB,IAAI;AAGd,SAAgB,EAAoB,EAAE,UAAA,EAAA,GAAqC;AACzE,QAAM,CAAC,GAAS,CAAA,IAAY,EAA6B,IAAI,GACvD,IAAQ,EAAA,OAAe;AAAA,IAAE,SAAA;AAAA,IAAS,UAAA;AAAA,EAAS,IAAI,CAAC,CAAO,CAAC;AAC9D,SACE,gBAAA,EAAC,EAAmB,UAApB;AAAA,IAAoC,OAAA;AAAA,IACjC,UAAA;AAAA,EAC0B,CAAA;AAEjC;AAOA,SAAgB,IAAwB;AAEtC,QAAM,IADU,EAAW,CACV,GAAS;AAC1B,SAAO,EAAA,CACJ,MAAgC,IAAW,CAAO,GACnD,CAAC,CAAQ,CACX;AACF;AASA,SAAgB,IAAiB;AAC/B,QAAM,IAAU,EAAW,CAAkB,GAAG,WAAW;AAC3D,SAAO,EAAA,MAEH,IAAA,OACW;AAAA,IACL,gBAAgB;AAAA,IAChB,uBAAA,MAA6B,EAAW,CAAO;AAAA,EACjD,KACA,QACN,CAAC,CAAO,CACV;AACF;AAOA,SAAgB,EAAW,GAA2B;AACpD,QAAM,IAAO,EAAQ,sBAAsB,GACrC,IAAQ,iBAAiB,CAAO;AACtC,MAAI,CAAC,EAAM,aAAa,EAAM,cAAc,OAAQ,QAAO;AAC3D,QAAM,IAAS,IAAI,kBAAkB,EAAM,SAAS;AAEpD,MADI,CAAC,EAAO,QAAQ,EAAO,MAAM,KAAK,EAAO,MAAM,KAC/C,EAAO,KAAK,KAAK,EAAO,KAAK,EAAG,QAAO;AAE3C,QAAM,CAAC,IAAU,GAAG,IAAU,CAAA,IAAK,EAAM,gBACtC,MAAM,GAAG,EACT,IAAA,CAAK,MAAU,WAAW,CAAK,KAAK,CAAC;AACxC,SAAO,IAAI,QACT,EAAK,OAAO,EAAO,IAAI,KAAW,IAAI,EAAO,IAC7C,EAAK,MAAM,EAAO,IAAI,KAAW,IAAI,EAAO,IAC5C,EAAK,QAAQ,EAAO,GACpB,EAAK,SAAS,EAAO,CACvB;AACF"}
1
+ {"version":3,"file":"popup-anchor-C3_iXdbh.js","names":["createContext","useCallback","useContext","useMemo","useState","jsx","PopupAnchorContext","PopupAnchorProvider","children","element","register","value","usePopupAnchorTrigger","usePopupAnchor","layoutRect","rect","style","matrix","originX","originY"],"sources":["../../src/utils/popup-anchor.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n type ReactNode,\n} from \"react\";\n\n/**\n * Where a popup anchors when its trigger pulses on press.\n *\n * The press pulse scales the trigger with a transform, and the popup opens on\n * that same press, so Base UI's positioner measures the trigger mid-pulse.\n * Its anchor rect includes the transform, so `--anchor-width` (the popup's\n * width) follows the scale frame by frame. The positioner's own\n * ResizeObserver then sees the popup resize inside its own callback, which the\n * browser reports as \"ResizeObserver loop completed with undelivered\n * notifications\". Anchoring to the trigger's laid-out box, the transform\n * taken back out, keeps the anchor still while the trigger pulses.\n */\nconst PopupAnchorContext = createContext<{\n element: HTMLElement | null;\n register: (element: HTMLElement | null) => void;\n} | null>(null);\n\n/** Holds the pulsing trigger a Root's positioner anchors to. */\nexport function PopupAnchorProvider({ children }: { children: ReactNode }) {\n const [element, register] = useState<HTMLElement | null>(null);\n const value = useMemo(() => ({ element, register }), [element]);\n return (\n <PopupAnchorContext.Provider value={value}>\n {children}\n </PopupAnchorContext.Provider>\n );\n}\n\n/**\n * The ref for a trigger that pulses on press (`usePressPulse`), so the\n * popup it opens anchors to its laid-out box rather than its scaled one.\n * Outside a Pho `Select.Root` or `Combobox.Root` it does nothing.\n */\nexport function usePopupAnchorTrigger() {\n const context = useContext(PopupAnchorContext);\n const register = context?.register;\n return useCallback(\n (element: HTMLElement | null) => register?.(element),\n [register],\n );\n}\n\n/**\n * The positioner's `anchor`: the registered trigger's laid-out box. With no\n * trigger registered (a Combobox anchored to its input, a trigger whose\n * `render` dropped the ref) it is `undefined`, so Base UI keeps its own\n * default anchor; a callback resolving to `null` would clear that anchor and\n * leave the popup unpositioned.\n */\nexport function usePopupAnchor() {\n const element = useContext(PopupAnchorContext)?.element ?? null;\n return useMemo(\n () =>\n element\n ? () => ({\n contextElement: element,\n getBoundingClientRect: () => layoutRect(element),\n })\n : undefined,\n [element],\n );\n}\n\n/**\n * The element's border box as laid out, its own scale undone. Only a scale\n * and a translate (what a press pulse writes) are undone; any other transform\n * leaves the measured rect as it is.\n */\nexport function layoutRect(element: Element): DOMRect {\n const rect = element.getBoundingClientRect();\n const style = getComputedStyle(element);\n if (!style.transform || style.transform === \"none\") return rect;\n const matrix = new DOMMatrixReadOnly(style.transform);\n if (!matrix.is2D || matrix.b !== 0 || matrix.c !== 0) return rect;\n if (matrix.a <= 0 || matrix.d <= 0) return rect;\n // A point x of the box lands at origin + scale * (x - origin) + translate.\n const [originX = 0, originY = 0] = style.transformOrigin\n .split(\" \")\n .map((value) => parseFloat(value) || 0);\n return new DOMRect(\n rect.left - matrix.e - originX * (1 - matrix.a),\n rect.top - matrix.f - originY * (1 - matrix.d),\n rect.width / matrix.a,\n rect.height / matrix.d,\n );\n}\n"],"mappings":";;;AAqBA,IAAMM,IAAqBN,EAGjB,IAAI;AAGd,SAAgBO,EAAoB,EAAE,UAAAC,EAAA,GAAqC;AACzE,QAAM,CAACC,GAASC,CAAA,IAAYN,EAA6B,IAAI,GACvDO,IAAQR,EAAA,OAAe;AAAA,IAAE,SAAAM;AAAA,IAAS,UAAAC;AAAA,EAAS,IAAI,CAACD,CAAO,CAAC;AAC9D,SACE,gBAAAJ,EAACC,EAAmB,UAApB;AAAA,IAAoC,OAAAK;AAAA,IACjC,UAAAH;AAAA,EAC0B,CAAA;AAEjC;AAOA,SAAgBI,IAAwB;AAEtC,QAAMF,IADUR,EAAWI,CACV,GAAS;AAC1B,SAAOL,EAAA,CACJQ,MAAgCC,IAAWD,CAAO,GACnD,CAACC,CAAQ,CACX;AACF;AASA,SAAgBG,IAAiB;AAC/B,QAAMJ,IAAUP,EAAWI,CAAkB,GAAG,WAAW;AAC3D,SAAOH,EAAA,MAEHM,IAAA,OACW;AAAA,IACL,gBAAgBA;AAAA,IAChB,uBAAA,MAA6BK,EAAWL,CAAO;AAAA,EACjD,KACA,QACN,CAACA,CAAO,CACV;AACF;AAOA,SAAgBK,EAAWL,GAA2B;AACpD,QAAMM,IAAON,EAAQ,sBAAsB,GACrCO,IAAQ,iBAAiBP,CAAO;AACtC,MAAI,CAACO,EAAM,aAAaA,EAAM,cAAc,OAAQ,QAAOD;AAC3D,QAAME,IAAS,IAAI,kBAAkBD,EAAM,SAAS;AAEpD,MADI,CAACC,EAAO,QAAQA,EAAO,MAAM,KAAKA,EAAO,MAAM,KAC/CA,EAAO,KAAK,KAAKA,EAAO,KAAK,EAAG,QAAOF;AAE3C,QAAM,CAACG,IAAU,GAAGC,IAAU,CAAA,IAAKH,EAAM,gBACtC,MAAM,GAAG,EACT,IAAA,CAAKL,MAAU,WAAWA,CAAK,KAAK,CAAC;AACxC,SAAO,IAAI,QACTI,EAAK,OAAOE,EAAO,IAAIC,KAAW,IAAID,EAAO,IAC7CF,EAAK,MAAME,EAAO,IAAIE,KAAW,IAAIF,EAAO,IAC5CF,EAAK,QAAQE,EAAO,GACpBF,EAAK,SAASE,EAAO,CACvB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-variant-CcD8iG5l.js","names":[],"sources":["../../src/utils/resolve-variant.ts"],"sourcesContent":["/**\n * A single option within a variant axis: the Tailwind classes it applies plus a\n * human description (surfaced in docs and the future component registry).\n */\nexport interface VariantDef {\n classes: string;\n description?: string;\n}\n\n/** One variant axis — maps each option name to its definition. */\nexport type VariantMap = Record<string, VariantDef>;\n\n/**\n * Resolve the Tailwind classes for a chosen option of a variant axis.\n * Returns `\"\"` for an unknown key so callers can compose safely with `cn`.\n *\n * @example\n * const SIZE = { sm: { classes: \"h-6 px-2\" }, md: { classes: \"h-9 px-3\" } };\n * cn(base, resolveVariant(SIZE, size));\n */\nexport function resolveVariant<M extends VariantMap>(\n map: M,\n key: keyof M | (string & {}),\n): string {\n return map[key as keyof M]?.classes ?? \"\";\n}\n"],"mappings":";AAoBA,SAAgB,EACd,GACA,GACQ;AACR,SAAO,EAAI,CAAA,GAAiB,WAAW;AACzC"}
1
+ {"version":3,"file":"resolve-variant-CcD8iG5l.js","names":["resolveVariant","map","key"],"sources":["../../src/utils/resolve-variant.ts"],"sourcesContent":["/**\n * A single option within a variant axis: the Tailwind classes it applies plus a\n * human description (surfaced in docs and the future component registry).\n */\nexport interface VariantDef {\n classes: string;\n description?: string;\n}\n\n/** One variant axis — maps each option name to its definition. */\nexport type VariantMap = Record<string, VariantDef>;\n\n/**\n * Resolve the Tailwind classes for a chosen option of a variant axis.\n * Returns `\"\"` for an unknown key so callers can compose safely with `cn`.\n *\n * @example\n * const SIZE = { sm: { classes: \"h-6 px-2\" }, md: { classes: \"h-9 px-3\" } };\n * cn(base, resolveVariant(SIZE, size));\n */\nexport function resolveVariant<M extends VariantMap>(\n map: M,\n key: keyof M | (string & {}),\n): string {\n return map[key as keyof M]?.classes ?? \"\";\n}\n"],"mappings":";AAoBA,SAAgBA,EACdC,GACAC,GACQ;AACR,SAAOD,EAAIC,CAAA,GAAiB,WAAW;AACzC"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as d } from "./cn-ChIgwEl3.js";
2
+ import { t as d } from "./cn-CPbhpG1q.js";
3
3
  import "../motion.js";
4
4
  import { createContext as A, useContext as k, useLayoutEffect as C, useRef as b } from "react";
5
5
  import { Fragment as L, jsx as i, jsxs as v } from "react/jsx-runtime";
@@ -165,4 +165,4 @@ export {
165
165
  Z as t
166
166
  };
167
167
 
168
- //# sourceMappingURL=scroll-area-DSwD9th7.js.map
168
+ //# sourceMappingURL=scroll-area-Dhl5hqay.js.map