@photon-ai/pho-ui 4.18.3 → 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 (370) 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-Dadmleu_.js → bar-chart-ZNuOoH7c.js} +2 -2
  28. package/dist/chunks/bar-chart-ZNuOoH7c.js.map +1 -0
  29. package/dist/chunks/{basic-page-Bfcda8w5.js → basic-page-BKvtEQkZ.js} +22 -22
  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-D4fw7E3w.js → chart-Btnw7KXV.js} +4 -4
  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-D4LiGJB2.js → combobox-OQOi5hlB.js} +83 -77
  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-Cp-ME94d.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 +40 -0
  98. package/dist/chunks/popup-anchor-C3_iXdbh.js.map +1 -0
  99. package/dist/chunks/resolve-variant-CcD8iG5l.js.map +1 -1
  100. package/dist/chunks/{scroll-area-DSwD9th7.js → scroll-area-Dhl5hqay.js} +2 -2
  101. package/dist/chunks/scroll-area-Dhl5hqay.js.map +1 -0
  102. package/dist/chunks/{select-COFV0NLb.js → select-xhSvDNbw.js} +62 -56
  103. package/dist/chunks/select-xhSvDNbw.js.map +1 -0
  104. package/dist/chunks/{sidebar-BP39w1iA.js → sidebar-CgaSEWVr.js} +11 -11
  105. package/dist/chunks/sidebar-CgaSEWVr.js.map +1 -0
  106. package/dist/chunks/{skeleton-DwjSl4vC.js → skeleton-CqZlGphn.js} +2 -2
  107. package/dist/chunks/skeleton-CqZlGphn.js.map +1 -0
  108. package/dist/chunks/{spinner-BzLUo4Xk.js → spinner-BSutFL4l.js} +2 -2
  109. package/dist/chunks/spinner-BSutFL4l.js.map +1 -0
  110. package/dist/chunks/{stat-hnNqjWVG.js → stat-BXBfMQ9Q.js} +4 -4
  111. package/dist/chunks/stat-BXBfMQ9Q.js.map +1 -0
  112. package/dist/chunks/{status-view-C8tabjDu.js → status-view-I_Y6eEyX.js} +2 -2
  113. package/dist/chunks/status-view-I_Y6eEyX.js.map +1 -0
  114. package/dist/chunks/{toast-BACxYsv6.js → toast-DrLKzrDJ.js} +7 -7
  115. package/dist/chunks/toast-DrLKzrDJ.js.map +1 -0
  116. package/dist/chunks/{toggle-o84tawXy.js → toggle-Ca4SS3YD.js} +2 -2
  117. package/dist/chunks/toggle-Ca4SS3YD.js.map +1 -0
  118. package/dist/chunks/{tooltip-BTF7GChl.js → tooltip-4J1PUJmB.js} +2 -2
  119. package/dist/chunks/tooltip-4J1PUJmB.js.map +1 -0
  120. package/dist/chunks/{trace-DyjsBY-S.js → trace-D9F0sne7.js} +11 -11
  121. package/dist/chunks/trace-D9F0sne7.js.map +1 -0
  122. package/dist/chunks/use-copy-D6JwKUll.js.map +1 -1
  123. package/dist/chunks/use-press-pulse-IbNstUT0.js.map +1 -1
  124. package/dist/components/accordion.js +1 -1
  125. package/dist/components/accordion.js.map +1 -1
  126. package/dist/components/autocomplete.js +1 -1
  127. package/dist/components/autocomplete.js.map +1 -1
  128. package/dist/components/avatar.js +1 -1
  129. package/dist/components/badge.js +1 -1
  130. package/dist/components/bar-chart.js +1 -1
  131. package/dist/components/bubble.js +1 -1
  132. package/dist/components/button.js +2 -2
  133. package/dist/components/calendar.js +1 -1
  134. package/dist/components/card.js +1 -1
  135. package/dist/components/chart.js +1 -1
  136. package/dist/components/chat.js +1 -1
  137. package/dist/components/checkbox.js +1 -1
  138. package/dist/components/code-block.js +1 -1
  139. package/dist/components/collapsible.js +1 -1
  140. package/dist/components/combobox.js +1 -1
  141. package/dist/components/command.js +4 -4
  142. package/dist/components/command.js.map +1 -1
  143. package/dist/components/context-menu.js +2 -2
  144. package/dist/components/context-menu.js.map +1 -1
  145. package/dist/components/copy-button.js +1 -1
  146. package/dist/components/data-table.js +2 -2
  147. package/dist/components/date-picker.js +1 -1
  148. package/dist/components/description-list.js +1 -1
  149. package/dist/components/dialog.js +1 -1
  150. package/dist/components/drawer.js +1 -1
  151. package/dist/components/drawer.js.map +1 -1
  152. package/dist/components/error.js +1 -1
  153. package/dist/components/field.js +1 -1
  154. package/dist/components/field.js.map +1 -1
  155. package/dist/components/fieldset.js +1 -1
  156. package/dist/components/fieldset.js.map +1 -1
  157. package/dist/components/filter-bar.js +1 -1
  158. package/dist/components/form.js +1 -1
  159. package/dist/components/input-group.js +1 -1
  160. package/dist/components/input.js +1 -1
  161. package/dist/components/kbd.js +1 -1
  162. package/dist/components/line-chart.js +1 -1
  163. package/dist/components/log-list.js +1 -1
  164. package/dist/components/menu.js +1 -1
  165. package/dist/components/menubar.js +1 -1
  166. package/dist/components/menubar.js.map +1 -1
  167. package/dist/components/message.js +1 -1
  168. package/dist/components/meter.js +1 -1
  169. package/dist/components/meter.js.map +1 -1
  170. package/dist/components/navigation-menu.js +1 -1
  171. package/dist/components/navigation-menu.js.map +1 -1
  172. package/dist/components/notification.js +4 -4
  173. package/dist/components/notification.js.map +1 -1
  174. package/dist/components/number-field.js +1 -1
  175. package/dist/components/number-field.js.map +1 -1
  176. package/dist/components/otp-field.js +1 -1
  177. package/dist/components/otp-field.js.map +1 -1
  178. package/dist/components/phone-input.js +35 -45
  179. package/dist/components/phone-input.js.map +1 -1
  180. package/dist/components/popover.js +1 -1
  181. package/dist/components/preview-card.js +1 -1
  182. package/dist/components/preview-card.js.map +1 -1
  183. package/dist/components/progress.js +1 -1
  184. package/dist/components/progress.js.map +1 -1
  185. package/dist/components/radio-group.js +1 -1
  186. package/dist/components/radio-group.js.map +1 -1
  187. package/dist/components/scope.js +10 -10
  188. package/dist/components/scope.js.map +1 -1
  189. package/dist/components/scroll-area.js +1 -1
  190. package/dist/components/select.js +1 -1
  191. package/dist/components/separator.js +1 -1
  192. package/dist/components/separator.js.map +1 -1
  193. package/dist/components/skeleton.js +1 -1
  194. package/dist/components/slider.js +1 -1
  195. package/dist/components/slider.js.map +1 -1
  196. package/dist/components/spinner.js +1 -1
  197. package/dist/components/stat.js +1 -1
  198. package/dist/components/status-view.js +1 -1
  199. package/dist/components/switch.js +1 -1
  200. package/dist/components/switch.js.map +1 -1
  201. package/dist/components/tabs.js +1 -1
  202. package/dist/components/tabs.js.map +1 -1
  203. package/dist/components/theme-toggle.js +2 -2
  204. package/dist/components/theme-toggle.js.map +1 -1
  205. package/dist/components/toast.js +1 -1
  206. package/dist/components/toggle-group.js +1 -1
  207. package/dist/components/toggle-group.js.map +1 -1
  208. package/dist/components/toggle.js +1 -1
  209. package/dist/components/toolbar.js +1 -1
  210. package/dist/components/toolbar.js.map +1 -1
  211. package/dist/components/tooltip.js +1 -1
  212. package/dist/components/trace.js +1 -1
  213. package/dist/icons.js.map +1 -1
  214. package/dist/index.js +27 -27
  215. package/dist/motion.js.map +1 -1
  216. package/dist/sections/basic-page.js +2 -2
  217. package/dist/sections/sidebar.js +1 -1
  218. package/dist/src/components/accordion/accordion.d.ts +5 -5
  219. package/dist/src/components/autocomplete/autocomplete.d.ts +9 -9
  220. package/dist/src/components/avatar/avatar.d.ts +3 -3
  221. package/dist/src/components/badge/badge.d.ts +1 -1
  222. package/dist/src/components/bar-chart/bar-chart.d.ts +1 -1
  223. package/dist/src/components/bubble/bubble.d.ts +3 -3
  224. package/dist/src/components/button/button.d.ts +4 -4
  225. package/dist/src/components/button/close-button.d.ts +1 -1
  226. package/dist/src/components/calendar/calendar.d.ts +1 -1
  227. package/dist/src/components/card/card.d.ts +7 -7
  228. package/dist/src/components/chart/chart.d.ts +1 -1
  229. package/dist/src/components/chart/legend.d.ts +2 -2
  230. package/dist/src/components/chart/shell.d.ts +1 -1
  231. package/dist/src/components/chart/skeleton.d.ts +1 -1
  232. package/dist/src/components/chart/tooltip.d.ts +1 -1
  233. package/dist/src/components/chat/chat.d.ts +17 -17
  234. package/dist/src/components/checkbox/check-glyph.d.ts +1 -1
  235. package/dist/src/components/checkbox/checkbox-card.d.ts +1 -1
  236. package/dist/src/components/checkbox/checkbox-group.d.ts +1 -1
  237. package/dist/src/components/checkbox/checkbox.d.ts +1 -1
  238. package/dist/src/components/code-block/code-block.d.ts +1 -1
  239. package/dist/src/components/code-block/languages.d.ts +27 -27
  240. package/dist/src/components/collapsible/collapsible.d.ts +2 -2
  241. package/dist/src/components/combobox/combobox.d.ts +15 -15
  242. package/dist/src/components/command/command.d.ts +12 -12
  243. package/dist/src/components/context-menu/context-menu.d.ts +48 -0
  244. package/dist/src/components/copy-button/copy-button.d.ts +1 -1
  245. package/dist/src/components/data-table/data-table.d.ts +1 -1
  246. package/dist/src/components/date-picker/date-picker.d.ts +1 -1
  247. package/dist/src/components/description-list/description-list.d.ts +2 -2
  248. package/dist/src/components/dialog/dialog.d.ts +11 -11
  249. package/dist/src/components/drawer/drawer.d.ts +6 -6
  250. package/dist/src/components/error/error.d.ts +2 -2
  251. package/dist/src/components/field/field.d.ts +6 -6
  252. package/dist/src/components/fieldset/fieldset.d.ts +2 -2
  253. package/dist/src/components/filter-bar/filter-bar.d.ts +1 -1
  254. package/dist/src/components/form/form.d.ts +1 -1
  255. package/dist/src/components/input/input.d.ts +1 -1
  256. package/dist/src/components/input-group/box-search.d.ts +1 -1
  257. package/dist/src/components/input-group/input-group.d.ts +6 -5
  258. package/dist/src/components/kbd/kbd.d.ts +1 -1
  259. package/dist/src/components/line-chart/line-chart.d.ts +1 -1
  260. package/dist/src/components/log-list/log-list.d.ts +7 -7
  261. package/dist/src/components/menu/menu-pending.d.ts +3 -4
  262. package/dist/src/components/menu/menu.d.ts +81 -0
  263. package/dist/src/components/menubar/menubar.d.ts +1 -1
  264. package/dist/src/components/message/message.d.ts +7 -7
  265. package/dist/src/components/meter/meter.d.ts +5 -5
  266. package/dist/src/components/navigation-menu/navigation-menu.d.ts +8 -8
  267. package/dist/src/components/notification/notification.d.ts +1 -1
  268. package/dist/src/components/number-field/number-field.d.ts +6 -6
  269. package/dist/src/components/otp-field/otp-field.d.ts +1 -1
  270. package/dist/src/components/phone-input/phone-input.d.ts +2 -2
  271. package/dist/src/components/popover/popover.d.ts +4 -4
  272. package/dist/src/components/preview-card/preview-card.d.ts +3 -3
  273. package/dist/src/components/progress/progress.d.ts +5 -5
  274. package/dist/src/components/radio-group/radio-card.d.ts +1 -1
  275. package/dist/src/components/radio-group/radio-group.d.ts +2 -2
  276. package/dist/src/components/scope/scope.d.ts +1 -1
  277. package/dist/src/components/scroll-area/scroll-area-edges.d.ts +1 -1
  278. package/dist/src/components/scroll-area/scroll-area.d.ts +5 -5
  279. package/dist/src/components/select/select.d.ts +9 -9
  280. package/dist/src/components/separator/separator.d.ts +1 -1
  281. package/dist/src/components/slider/slider.d.ts +7 -7
  282. package/dist/src/components/spinner/spinner.d.ts +1 -1
  283. package/dist/src/components/stat/stat.d.ts +2 -2
  284. package/dist/src/components/status-view/status-view.d.ts +1 -1
  285. package/dist/src/components/switch/switch.d.ts +1 -1
  286. package/dist/src/components/tabs/tabs.d.ts +4 -4
  287. package/dist/src/components/theme-toggle/theme-toggle.d.ts +1 -1
  288. package/dist/src/components/toast/toast.d.ts +7 -7
  289. package/dist/src/components/toggle/toggle.d.ts +1 -1
  290. package/dist/src/components/toggle-group/toggle-group.d.ts +1 -1
  291. package/dist/src/components/toolbar/toolbar.d.ts +6 -6
  292. package/dist/src/components/tooltip/tooltip.d.ts +3 -3
  293. package/dist/src/components/trace/span-primitive.d.ts +3 -3
  294. package/dist/src/components/trace/trace.d.ts +3 -3
  295. package/dist/src/icons/discord.d.ts +1 -1
  296. package/dist/src/icons/github.d.ts +1 -1
  297. package/dist/src/icons/google.d.ts +1 -1
  298. package/dist/src/icons/imessage.d.ts +1 -1
  299. package/dist/src/icons/photon-mark.d.ts +1 -1
  300. package/dist/src/icons/reddit.d.ts +1 -1
  301. package/dist/src/icons/slack.d.ts +1 -1
  302. package/dist/src/icons/telegram.d.ts +1 -1
  303. package/dist/src/icons/whatsapp.d.ts +1 -1
  304. package/dist/src/icons/x.d.ts +1 -1
  305. package/dist/src/icons/youtube.d.ts +1 -1
  306. package/dist/src/index.d.ts +1 -1
  307. package/dist/src/sections/basic-page/basic-page.d.ts +46 -46
  308. package/dist/src/sections/sidebar/sidebar.d.ts +11 -11
  309. package/dist/src/utils/animated-height.d.ts +1 -1
  310. package/dist/src/utils/ghost-search.d.ts +1 -1
  311. package/dist/src/utils/link-provider.d.ts +1 -1
  312. package/dist/src/utils/popup-anchor.d.ts +28 -0
  313. package/dist/utils.js +1 -1
  314. package/package.json +24 -24
  315. package/src/styles/pho.css +1 -1
  316. package/src/styles/theme.css +1 -1
  317. package/dist/chunks/IconAlertCircleFilled-VxKU8TYK.js.map +0 -1
  318. package/dist/chunks/IconArrowUpRight-DGgKzQwV.js.map +0 -1
  319. package/dist/chunks/IconCheck-D2WuculQ.js.map +0 -1
  320. package/dist/chunks/IconChevronDown-CZilB71T.js.map +0 -1
  321. package/dist/chunks/IconChevronLeft-CSWMKQ4C.js.map +0 -1
  322. package/dist/chunks/IconChevronRight-CzoJnYNI.js.map +0 -1
  323. package/dist/chunks/IconChevronUp-CrpWSgIl.js.map +0 -1
  324. package/dist/chunks/IconInfoCircle-L0zfhg7R.js.map +0 -1
  325. package/dist/chunks/IconSearch-BKAHkLyX.js.map +0 -1
  326. package/dist/chunks/IconX-pZ9vrtSr.js.map +0 -1
  327. package/dist/chunks/avatar-BkmGDIqf.js.map +0 -1
  328. package/dist/chunks/badge-DlLJPLeZ.js.map +0 -1
  329. package/dist/chunks/bar-chart-Dadmleu_.js.map +0 -1
  330. package/dist/chunks/basic-page-Bfcda8w5.js.map +0 -1
  331. package/dist/chunks/box-search-C9EVZgcb.js.map +0 -1
  332. package/dist/chunks/bubble-eaoLJP4N.js.map +0 -1
  333. package/dist/chunks/button-C9VqBBIr.js.map +0 -1
  334. package/dist/chunks/calendar-4OFiCLAv.js.map +0 -1
  335. package/dist/chunks/chart-D4fw7E3w.js.map +0 -1
  336. package/dist/chunks/chat-Bu8UyIbT.js.map +0 -1
  337. package/dist/chunks/checkbox-CwvoEJhd.js.map +0 -1
  338. package/dist/chunks/close-button-GvqWbLl0.js.map +0 -1
  339. package/dist/chunks/cn-ChIgwEl3.js.map +0 -1
  340. package/dist/chunks/code-block-DekLMMtV.js.map +0 -1
  341. package/dist/chunks/collapsible-Dv306QOT.js.map +0 -1
  342. package/dist/chunks/combobox-D4LiGJB2.js.map +0 -1
  343. package/dist/chunks/copy-button-BmGshaq9.js.map +0 -1
  344. package/dist/chunks/createReactComponent-BqCmnqfX.js.map +0 -1
  345. package/dist/chunks/data-table-T4QKnrxQ.js.map +0 -1
  346. package/dist/chunks/date-picker-CZbcNIe-.js.map +0 -1
  347. package/dist/chunks/description-list-BRRQ0oF6.js.map +0 -1
  348. package/dist/chunks/dialog-12foDiQb.js.map +0 -1
  349. package/dist/chunks/error-D5SzZ0ev.js.map +0 -1
  350. package/dist/chunks/filter-bar-upeYW4dQ.js.map +0 -1
  351. package/dist/chunks/ghost-search-8PzP73zS.js.map +0 -1
  352. package/dist/chunks/input-fFWvPJOf.js.map +0 -1
  353. package/dist/chunks/input-group-fc9_jD4d.js.map +0 -1
  354. package/dist/chunks/kbd-DNI10uy7.js.map +0 -1
  355. package/dist/chunks/line-chart-Cp-ME94d.js.map +0 -1
  356. package/dist/chunks/log-list-tNuCFGlP.js.map +0 -1
  357. package/dist/chunks/menu-CoMrYnd1.js.map +0 -1
  358. package/dist/chunks/message-Dz2-numf.js.map +0 -1
  359. package/dist/chunks/popover-BhBJO346.js.map +0 -1
  360. package/dist/chunks/scroll-area-DSwD9th7.js.map +0 -1
  361. package/dist/chunks/select-COFV0NLb.js.map +0 -1
  362. package/dist/chunks/sidebar-BP39w1iA.js.map +0 -1
  363. package/dist/chunks/skeleton-DwjSl4vC.js.map +0 -1
  364. package/dist/chunks/spinner-BzLUo4Xk.js.map +0 -1
  365. package/dist/chunks/stat-hnNqjWVG.js.map +0 -1
  366. package/dist/chunks/status-view-C8tabjDu.js.map +0 -1
  367. package/dist/chunks/toast-BACxYsv6.js.map +0 -1
  368. package/dist/chunks/toggle-o84tawXy.js.map +0 -1
  369. package/dist/chunks/tooltip-BTF7GChl.js.map +0 -1
  370. package/dist/chunks/trace-DyjsBY-S.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"copy-button-BmGshaq9.js","names":[],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.mjs","../../src/components/copy-button/copy-button.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.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\": \"M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1\", \"key\": \"svg-1\" }]];\nconst IconCopy = createReactComponent(\"outline\", \"copy\", \"Copy\", __iconNode);\n\nexport { __iconNode, IconCopy as default };\n//# sourceMappingURL=IconCopy.mjs.map\n","import {\n type ButtonHTMLAttributes,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { IconCheck, IconCopy } from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\nimport { useCopy } from \"../../utils/use-copy\";\n\n/**\n * Size axis — a square ghost control that sits inside a row or a panel\n * header. `sm` is the default: a 28px target beside 13px mono text.\n */\nexport const COPY_BUTTON_SIZES = {\n xs: {\n classes: \"size-6 -m-1.25 [&>svg]:size-3.5\",\n description:\n \"Extra small — 14px icon; 24px hover wash overflows the title line\",\n },\n sm: {\n classes: \"size-7 [&>svg]:size-4\",\n description: \"Small — the default; row cells, panel headers\",\n },\n md: {\n classes: \"size-8 [&>svg]:size-4\",\n description: \"Medium — toolbars\",\n },\n} satisfies VariantMap;\n\nexport type CopyButtonSize = keyof typeof COPY_BUTTON_SIZES;\n\ninterface CopyButtonBaseProps {\n /** The text that goes to the clipboard. */\n value: string;\n /**\n * The view of the value, before the button: anything (the id as text,\n * a masked key, a number beside its flag). A click on it copies too,\n * the way a `<label>` presses its control; the button stays the one\n * tab stop and the accessible name. The view sets a default type (the\n * mono face, `xs`, primary ink, one truncating line); what you put in\n * sets its own and wins.\n */\n children?: ReactNode;\n /**\n * What is being copied, for the accessible name — \"request id\",\n * \"API key\". Read as `Copy {label}`, then `{label} copied`.\n * @default \"to clipboard\"\n */\n label?: string;\n /** Size variant. @default \"sm\" */\n size?: CopyButtonSize;\n /** Called after the clipboard write lands. */\n onCopied?: (value: string) => void;\n ref?: Ref<HTMLButtonElement>;\n}\n\nexport interface CopyButtonProps\n extends\n CopyButtonBaseProps,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof CopyButtonBaseProps> {}\n\n/**\n * The view's default type: the value on one line in the mono face, the\n * loudest ink on its line. Inherited, so content with its own classes\n * overrides it.\n */\nconst VIEW = \"min-w-0 truncate font-mono text-xs text-pho-primary\";\n\n/**\n * View to button. The wash clears the view: `xs` lets its wash overflow\n * its box by 5px, so it sits two steps further out and the wash keeps\n * 3px off the text.\n */\nconst VIEW_GAP: Record<CopyButtonSize, string> = {\n xs: \"gap-2\",\n sm: \"gap-1\",\n md: \"gap-1\",\n};\n\n/** What keeps its own click inside the view. */\nconst INTERACTIVE = \"a, button, input, select, textarea, label\";\n\n/**\n * A click on the view presses the button, so both run the same path\n * (`onClick`, the write, `onCopied`). A link in the view keeps its\n * click, and a drag that selected text is a copy by hand in progress.\n */\nfunction pressFromValue(event: MouseEvent<HTMLSpanElement>) {\n const root = event.currentTarget;\n const interactive = (event.target as Element).closest(INTERACTIVE);\n if (interactive && root.contains(interactive)) return;\n const selection = window.getSelection();\n if (\n selection &&\n !selection.isCollapsed &&\n root.contains(selection.anchorNode)\n )\n return;\n event.stopPropagation();\n root.querySelector<HTMLButtonElement>(\":scope > [data-copy-button]\")?.click();\n}\n\n/**\n * Copy Button — the one copy affordance: a quiet icon button that writes\n * `value` to the clipboard, swaps its glyph to a check for a moment, and\n * says \"Copied\" to assistive tech through a polite live region. Ghost at\n * rest so a mono value stays the loudest thing on its line; the wash and\n * the ink lift on hover. Pass a view of the value as `children` and it\n * renders before the button, a click target too; the glyph then rests in\n * description ink, and the wash lifts over either.\n */\nexport function CopyButton({\n value,\n children,\n label = \"to clipboard\",\n size = \"sm\",\n onCopied,\n className,\n onClick,\n ...props\n}: CopyButtonProps) {\n const { copied, copy } = useCopy();\n const shown = children != null && children !== false && children !== \"\";\n return (\n // A pointer shortcut, like a <label>: keys and assistive tech reach\n // the button inside, which is the control.\n // oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions\n <span\n onClick={shown ? pressFromValue : undefined}\n className={cn(\n \"inline-flex overflow-visible\",\n shown\n ? cn(\"group/copy min-w-0 cursor-pointer items-center\", VIEW_GAP[size])\n : \"shrink-0\",\n )}\n >\n {shown ? (\n <span data-copy-view=\"\" className={VIEW}>\n {children}\n </span>\n ) : null}\n <button\n type=\"button\"\n data-copy-button=\"\"\n aria-label={copied ? `${label} copied` : `Copy ${label}`}\n data-copied={copied || undefined}\n onClick={async (event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n if (await copy(value)) onCopied?.(value);\n }}\n className={cn(\n \"text-pho-secondary outline-pho-brand hover:bg-pho-ghost-hover hover:text-pho-secondary-hover inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-[color,background-color] duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2\",\n \"data-[copied]:text-pho-success data-[copied]:hover:text-pho-success\",\n // With a view the glyph rests in the quietest ink, never louder\n // than the value it copies; the pointer on either lifts it.\n shown &&\n \"text-pho-description group-hover/copy:bg-pho-ghost-hover group-hover/copy:text-pho-secondary-hover\",\n resolveVariant(COPY_BUTTON_SIZES, size),\n className,\n )}\n {...props}\n >\n {copied ? <IconCheck aria-hidden /> : <IconCopy aria-hidden />}\n </button>\n <output className=\"sr-only\" aria-live=\"polite\">\n {copied ? \"Copied\" : \"\"}\n </output>\n </span>\n );\n}\n\nCopyButton.displayName = \"CopyButton\";\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;AASA,IAAM,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAoK,KAAO;AAAQ,CAAC,GAAG,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,EAAC,UAAD;AAAA,QACE,MAAK;AAAA,QACL,oBAAiB;AAAA,QACjB,cAAY,IAAS,GAAG,CAAA,YAAiB,QAAQ,CAAA;AAAA,QACjD,eAAa,KAAU;AAAA,QACvB,SAAS,OAAO,MAAU;AAExB,UADA,IAAU,CAAK,GACX,CAAA,EAAM,oBACN,MAAM,EAAK,CAAK,KAAG,IAAW,CAAK;AAAA,QACzC;AAAA,QACA,WAAW,EACT,+RACA,uEAGA,KACE,sGACF,EAAe,GAAmB,CAAI,GACtC,CACF;AAAA,QACA,GAAI;AAAA,QAEH,UAAA,IAAS,gBAAA,EAAC,GAAD,EAAW,eAAA,GAAa,CAAA,IAAI,gBAAA,EAAC,GAAD,EAAU,eAAA,GAAa,CAAA;AAAA,MACvD,CAAA;AAAA,MACR,gBAAA,EAAC,UAAD;AAAA,QAAQ,WAAU;AAAA,QAAU,aAAU;AAAA,QACnC,UAAA,IAAS,WAAW;AAAA,MACf,CAAA;AAAA,IACJ;AAAA;AAEV;AAEA,EAAW,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createReactComponent-BqCmnqfX.js","names":[],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs","../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.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\nvar defaultAttributes = {\n outline: {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n },\n filled: {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n stroke: \"none\"\n }\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.mjs.map\n","/**\n * @license @tabler/icons-react v3.46.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 { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.mjs';\n\nconst createReactComponent = (type, iconName, iconNamePascal, iconNode) => {\n const Component = forwardRef(\n ({ color = \"currentColor\", size = 24, stroke = 2, title, className, children, ...rest }, ref) => createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes[type],\n width: size,\n height: size,\n className: [`tabler-icon`, `tabler-icon-${iconName}`, className].join(\" \"),\n ...type === \"filled\" ? {\n fill: color\n } : {\n strokeWidth: stroke,\n stroke: color\n },\n ...rest\n },\n [\n title && createElement(\"title\", { key: \"svg-title\" }, title),\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n )\n );\n Component.displayName = `${iconNamePascal}`;\n return Component;\n};\n\nexport { createReactComponent as default };\n//# sourceMappingURL=createReactComponent.mjs.map\n"],"x_google_ignoreList":[0,1],"mappings":";;AAOA,IAAI,IAAoB;AAAA,EACtB,SAAS;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,eAAe;AAAA,IACf,gBAAgB;AAAA,EAClB;AAAA,EACA,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,EACV;AACF,GCjBM,IAAA,CAAwB,GAAM,GAAU,GAAgB,MAAa;AACzE,QAAM,IAAY,EAAA,CACf,EAAE,OAAA,IAAQ,gBAAgB,MAAA,IAAO,IAAI,QAAA,IAAS,GAAG,OAAA,GAAO,WAAA,GAAW,UAAA,GAAU,GAAG,EAAA,GAAQ,MAAQ,EAC/F,OACA;AAAA,IACE,KAAA;AAAA,IACA,GAAG,EAAkB,CAAA;AAAA,IACrB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,WAAW;AAAA,MAAC;AAAA,MAAe,eAAe,CAAA;AAAA,MAAY;AAAA,IAAS,EAAE,KAAK,GAAG;AAAA,IACzE,GAAG,MAAS,WAAW,EACrB,MAAM,EACR,IAAI;AAAA,MACF,aAAa;AAAA,MACb,QAAQ;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EACL,GACA;AAAA,IACE,KAAS,EAAc,SAAS,EAAE,KAAK,YAAY,GAAG,CAAK;AAAA,IAC3D,GAAG,EAAS,IAAA,CAAK,CAAC,GAAK,CAAA,MAAW,EAAc,GAAK,CAAK,CAAC;AAAA,IAC3D,GAAG,MAAM,QAAQ,CAAQ,IAAI,IAAW,CAAC,CAAQ;AAAA,EACnD,CACF,CACF;AACA,SAAA,EAAU,cAAc,GAAG,CAAA,IACpB;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-table-T4QKnrxQ.js","names":[],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconSelector.mjs","../../src/components/data-table/data-table.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.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\": \"M8 9l4 -4l4 4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M16 15l-4 4l-4 -4\", \"key\": \"svg-1\" }]];\nconst IconSelector = createReactComponent(\"outline\", \"selector\", \"Selector\", __iconNode);\n\nexport { __iconNode, IconSelector as default };\n//# sourceMappingURL=IconSelector.mjs.map\n","import {\n createContext,\n Fragment,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useState,\n useSyncExternalStore,\n type ComponentProps,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport {\n columnFilteringFeature,\n createColumnHelper,\n createFilteredRowModel,\n createSortedRowModel,\n filterFn_includesString,\n FlexRender,\n globalFilteringFeature,\n rowSelectionFeature,\n rowSortingFeature,\n sortFn_alphanumeric,\n sortFn_basic,\n sortFn_datetime,\n sortFn_text,\n tableFeatures,\n useTable,\n type ColumnDef,\n type RowData,\n type SortingState,\n} from \"@tanstack/react-table\";\nimport {\n IconChevronDown,\n IconChevronUp,\n IconSelector,\n} from \"@tabler/icons-react\";\nimport { Skeleton } from \"../skeleton\";\nimport {\n DATA_TABLE_BODY,\n DATA_TABLE_HEADER_CELL,\n DATA_TABLE_SURFACE,\n DATA_TABLE_TEXT,\n} from \"./chrome\";\nimport { Checkbox } from \"../checkbox\";\nimport { SPRING_ENTRANCE } from \"../../motion\";\nimport { AnimatedHeight } from \"../../utils/animated-height\";\nimport { cn } from \"../../utils/cn\";\nimport { resolveVariant, type VariantMap } from \"../../utils/resolve-variant\";\nimport { useLinkComponent } from \"../../utils/link-provider\";\n\n/**\n * DataTable — a table of records with column semantics: sortable headers,\n * aligned cells, rows that are links into a subpage. TanStack Table (v9)\n * does the thinking — column defs, sorting, row identity — and renders\n * nothing; every pixel here is Pho's.\n *\n * Design notes:\n * - The surface is `BasicPage.Card`'s: hairline border, `base` radius, the\n * page's primary fill, hairline rules between rows. A table is a card of\n * rows that happen to line up in columns, so it sits in a page's `Stack`\n * as any card does.\n * - Header cells are description ink at body size — never small caps, never\n * bold. Hierarchy comes from ink alone; the header is a label row, not a\n * banner.\n * - A sortable header is a button inside the cell: the label and its\n * indicator (`IconSelector` at rest, a chevron once sorted). `aria-sort`\n * sits on the `th`.\n * - Rows that navigate stretch one link across the row (the first cell's\n * link, extended with a pseudo-element), so the whole row is one target\n * for pointer and one stop for keyboard. Hover washes the row; the row\n * whose page is open beside the table (`current`) keeps the wash — the\n * same cue `BasicPage.RowLink` gives under `aria-current`.\n * - Numbers align to the end with tabular figures (`meta.align: \"end\"`).\n * - `search` is one box over every column — plain contains matching, and\n * the body says when nothing matches. In a page, `BasicPage.Search` in\n * the section header adopts the box; alone, the table keeps one in a\n * toolbar row inside its frame. Server-side search keeps its own box\n * outside.\n * - A wide table scrolls sideways inside its own frame; the page never does.\n * `contain: inline-size` keeps the table's intrinsic width out of the\n * page's — a host that sizes to content (a scroll area's fit-content\n * pane, a grid's auto column) would otherwise grow to the widest row.\n * Left with no width of its own, the frame takes its container's\n * (`w-full`); a shrink-to-fit host (a flex row) would collapse it.\n * `layout=\"fixed\"` is the other way out: columns size from the frame,\n * and a long cell truncates instead of stretching the table.\n *\n * Reach for it when a list needs column semantics — sorting, aligned\n * figures, several fields side by side. A list where each row is one\n * label and a chevron stays `BasicPage.RowLink`.\n */\n\n/** Column metadata a `DataTable` understands. */\nexport interface DataTableColumnMeta {\n /** Cell alignment — `end` for figures (right-aligned, tabular). */\n align?: \"start\" | \"end\";\n /**\n * Extra classes on every `th` and `td` in this column. With\n * `layout=\"fixed\"`, size a short column here (`w-24`) and leave the\n * flexible ones unsaid — they share what remains. Prefer this over\n * `nth-child` width hacks on the table's `className`.\n */\n className?: string;\n}\n\n/**\n * The feature set every `DataTable` runs on — sorting with the stock sort\n * functions, the column meta above. Fixed, so column definitions written\n * once fit every table.\n */\nconst features = tableFeatures({\n rowSortingFeature,\n rowSelectionFeature,\n columnFilteringFeature,\n globalFilteringFeature,\n sortedRowModel: createSortedRowModel(),\n filteredRowModel: createFilteredRowModel(),\n filterFns: { includesString: filterFn_includesString },\n sortFns: {\n alphanumeric: sortFn_alphanumeric,\n basic: sortFn_basic,\n datetime: sortFn_datetime,\n text: sortFn_text,\n },\n columnMeta: {} as DataTableColumnMeta,\n});\n\nexport type DataTableFeatures = typeof features;\n\n/** Body row height — the header keeps its own `h-10` on every size. */\nexport const DATA_TABLE_SIZES = {\n sm: {\n classes: \"h-10\",\n description: \"Small — 40px at 13px; the header's height, for dense lists\",\n },\n base: {\n classes: \"h-12\",\n description: \"Base — 48px at 14px; one line of body type\",\n },\n lg: {\n classes: \"h-14\",\n description:\n \"Large — 56px at 16px; two-line cells (a number and a caption)\",\n },\n} satisfies VariantMap;\n\nexport type DataTableSize = keyof typeof DATA_TABLE_SIZES;\n\n/** A column definition for a `DataTable` of `TData` rows. */\nexport type DataTableColumn<\n TData extends RowData,\n TValue = unknown,\n> = ColumnDef<DataTableFeatures, TData, TValue>;\n\n/**\n * The column helper, bound to the table's feature set — `accessor`,\n * `display`, `group`, and `columns` to collect them with their types\n * intact.\n *\n * @example\n * const col = createColumns<Request>();\n * const columns = col.columns([\n * col.accessor(\"actor\", { header: \"Actor\" }),\n * col.accessor(\"amount\", { header: \"Amount\", meta: { align: \"end\" } }),\n * ]);\n */\nexport function createColumns<TData extends RowData>() {\n return createColumnHelper<DataTableFeatures, TData>();\n}\n\n/**\n * The leading checkbox column selection adds. The header checkbox works\n * the visible set: everything the search still shows toggles together,\n * while rows selected earlier and then hidden stay selected.\n */\nconst SELECT_COLUMN = createColumns<RowData>().display({\n id: \"select\",\n enableSorting: false,\n header: ({ table }) => {\n const visible = table.getRowModel().rows;\n const chosen = visible.filter((row) => row.getIsSelected()).length;\n const all = visible.length > 0 && chosen === visible.length;\n return (\n <Checkbox\n size=\"sm\"\n aria-label=\"Select all\"\n checked={all}\n indeterminate={chosen > 0 && !all}\n onCheckedChange={(checked) => {\n table.setRowSelection((old) => {\n const next = { ...old };\n for (const row of visible) {\n if (checked === true) next[row.id] = true;\n else delete next[row.id];\n }\n return next;\n });\n }}\n />\n );\n },\n cell: ({ row }) => (\n <Checkbox\n size=\"sm\"\n aria-label=\"Select row\"\n checked={row.getIsSelected()}\n onCheckedChange={(checked) => row.toggleSelected(checked === true)}\n />\n ),\n});\n\nexport interface DataTableProps<TData extends RowData> extends Omit<\n ComponentProps<\"div\">,\n \"children\"\n> {\n columns: ReadonlyArray<DataTableColumn<TData, any>>;\n data: ReadonlyArray<TData>;\n /**\n * A row's identity — what `current` is matched against, and what keeps a\n * row itself across sorts. Defaults to the row's `id` field, else its\n * index.\n */\n getRowId?: (row: TData) => string;\n /**\n * Rows that navigate: each row is one link into a subpage, through the\n * host's `LinkProvider`. Beside a `BasicPage.Aside`, the subpage opens\n * next to the table. Return nothing for a row with no page yet (one\n * still in flight) and that row stays plain.\n */\n rowHref?: (row: TData) => string | null | undefined;\n /**\n * A click on the row (not on a link, button, or other control). The\n * table still activates `rowHref` unless the handler calls\n * `preventDefault`.\n */\n onRowClick?: (\n row: TData,\n event: MouseEvent<HTMLTableRowElement> | KeyboardEvent<HTMLTableRowElement>,\n ) => void;\n /** The row whose page is open (its id) — it keeps the wash. */\n current?: string | null;\n /**\n * Sorting is on for every accessor column (`enableSorting: false` on a\n * column turns it off there). Uncontrolled by default; `defaultSort`\n * seeds it. Pass `sort` with `onSortChange` to own it — the way to sort\n * on the server.\n */\n defaultSort?: SortingState;\n sort?: SortingState;\n onSortChange?: (sort: SortingState) => void;\n /**\n * A search box on the table — `true`, or the placeholder it should\n * show. One box searches every column (a column opts out with\n * `enableGlobalFilter: false`); matching is a plain case-insensitive\n * contains, on the client. With no matches the body says so. When the\n * list doesn't all come down, keep the box outside and ask the server.\n */\n search?: boolean | string;\n /**\n * Controls in the frame's top band — a `BasicPage.Search` first, then a\n * filter or two. The band is part of the table (one surface, a hairline\n * above the header row), so nothing floats over the page and the\n * spacing above and below is the frame's own. A `Search` here adopts\n * the table's box the way a header one does.\n */\n toolbar?: ReactNode;\n /**\n * Row selection: hand either of these and rows grow a leading checkbox\n * column. The header checkbox works the visible set — everything the\n * search still shows — so select-all after a search means what it says;\n * rows selected earlier and then hidden stay selected. `selected` is\n * the selected ids (ids come from `getRowId`; pair with\n * `onSelectedChange` to own the state); `onSelectedChange` alone\n * listens while the table keeps it. The page renders its own bulk\n * actions from the ids — the table only keeps the score.\n */\n selected?: readonly string[];\n onSelectedChange?: (ids: string[]) => void;\n /**\n * File rows into labeled groups: return a label and the row renders\n * under it, `null` and it stays in the main body. Groups follow the\n * main body, in the order their labels first appear in `data`, each\n * under a quiet label row — and only while they have rows, so a group\n * a search empties simply leaves. Sorting orders rows within their\n * group.\n */\n group?: (row: TData) => string | null;\n /**\n * Glide the frame's height when the rows change — a search narrowing,\n * a filter, bones becoming rows. The height follows the content on the\n * page spring instead of jumping; reserve it for tables whose rows\n * change while mounted (same contract as `BasicPage.Card`'s).\n */\n animateHeight?: boolean;\n /** Bones while the rows are on their way — `true` for five, or a count. */\n loading?: boolean | number;\n /** What the body says when there are no rows. */\n empty?: ReactNode;\n /**\n * How columns take width. `auto` (the default) sizes them from their\n * content — a long cell grows the table and the frame scrolls sideways.\n * `fixed` sizes them from the table's width (`table-layout: fixed`):\n * short columns take a width hint on `meta.className`, the rest share\n * what remains, and cells get `min-w-0` so an inner `truncate` can\n * shrink. `width: 0` (`w-0`) is not a content-size hint here — fixed\n * layout treats it as a real zero — so give a short column a real\n * width (`w-24`) rather than the auto-layout shrink-wrap trick.\n */\n layout?: \"auto\" | \"fixed\";\n /**\n * Body row height and the type that comes with it. `base` (the default)\n * is 48px rows at 14px — one line of body type. `sm` is 40px at 13px,\n * the header's own height, for a dense list scanned more than read.\n * `lg` is 56px at 16px, for a two-line cell (a number and a caption)\n * that would crowd `base`. The header row keeps its 40px on every size\n * and follows the type.\n */\n size?: DataTableSize;\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * A host that sizes itself around tables provides this; each table\n * announces itself while mounted. `BasicPage.Root` runs wide when the\n * page carries one and `width` was left unsaid.\n */\nexport const TableHostContext = createContext<\n ((present: boolean) => void) | null\n>(null);\n\n/** A searchable table's search, published for a header to adopt. */\nexport interface TableSearchApi {\n placeholder: string;\n query: string;\n setQuery: (query: string) => void;\n /** Rows still showing after the current query. */\n matched: number;\n /** Rows in the list, before search. */\n total: number;\n}\n\ninterface TableSearchState {\n api: TableSearchApi | null;\n adopted: boolean;\n}\n\n/**\n * The channel between a searchable table and a `BasicPage.Search` placed\n * in a section header: the table publishes its search (placeholder,\n * query, the setter); a mounted `Search` adopts it, and the table's own\n * box yields. Provided by `BasicPage.Root`; a table outside any page\n * keeps its built-in box. One searchable table per page — a later\n * publisher takes the slot.\n */\nexport interface TableSearchStore {\n get: () => TableSearchState;\n subscribe: (listener: () => void) => () => void;\n publish: (api: TableSearchApi | null) => void;\n adopt: (adopted: boolean) => void;\n}\n\nexport function createTableSearchStore(): TableSearchStore {\n let state: TableSearchState = { api: null, adopted: false };\n const listeners = new Set<() => void>();\n const emit = () => {\n for (const listener of listeners) listener();\n };\n return {\n get: () => state,\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n publish(api) {\n state = { ...state, api };\n emit();\n },\n adopt(adopted) {\n state = { ...state, adopted };\n emit();\n },\n };\n}\n\nexport const TableSearchContext = createContext<TableSearchStore | null>(null);\n\nconst subscribeToNothing = () => () => {};\n\nexport { GhostSearch, type GhostSearchProps } from \"../../utils/ghost-search\";\nimport { GhostSearch } from \"../../utils/ghost-search\";\n\nconst DEFAULT_BONES = 5;\n\nfunction defaultRowId(row: unknown, index: number): string {\n const id = (row as { id?: unknown } | null)?.id;\n return typeof id === \"string\" || typeof id === \"number\"\n ? String(id)\n : String(index);\n}\n\n/** Controls keep their own click; the row only navigates from empty surface. */\n// A copy view (CopyButton's children) is the copy, not the row's link.\nconst ROW_NAV_IGNORE =\n \"a, button, input, textarea, select, label, [data-copy-view]\";\n\nfunction shouldIgnoreRowNav(target: EventTarget | null): boolean {\n return target instanceof Element && target.closest(ROW_NAV_IGNORE) != null;\n}\n\nfunction activateRowHref(event: MouseEvent<HTMLTableRowElement>, href: string) {\n const newTab =\n event.button === 1 || event.metaKey || event.ctrlKey || event.shiftKey;\n if (event.button === 1) event.preventDefault();\n if (event.button !== 0 && event.button !== 1) return;\n if (newTab) {\n window.open(href, \"_blank\", \"noopener,noreferrer\");\n return;\n }\n event.currentTarget.querySelector<HTMLAnchorElement>(\"a[href]\")?.click();\n}\n\nfunction DataTable<TData extends RowData>({\n columns,\n data,\n getRowId,\n rowHref,\n onRowClick,\n current,\n selected,\n onSelectedChange,\n defaultSort,\n sort,\n onSortChange,\n search,\n toolbar,\n group,\n animateHeight,\n loading,\n empty = \"Nothing here yet.\",\n layout = \"auto\",\n size = \"base\",\n className,\n ...props\n}: DataTableProps<TData>) {\n const fixed = layout === \"fixed\";\n const rowSize = resolveVariant(DATA_TABLE_SIZES, size);\n const rowText = DATA_TABLE_TEXT[size] ?? DATA_TABLE_TEXT.base;\n const Link = useLinkComponent();\n const announce = useContext(TableHostContext);\n const searching = search === true || typeof search === \"string\";\n const [query, setQuery] = useState(\"\");\n const placeholder = typeof search === \"string\" ? search : \"Search\";\n // A `BasicPage.Search` in a section header adopts the box; the table\n // then renders no toolbar of its own.\n const searchStore = useContext(TableSearchContext);\n const adopted = useSyncExternalStore(\n searchStore?.subscribe ?? subscribeToNothing,\n () => searchStore?.get().adopted ?? false,\n () => false,\n );\n useLayoutEffect(() => {\n if (announce == null) return;\n announce(true);\n return () => announce(false);\n }, [announce]);\n const selecting = selected != null || onSelectedChange != null;\n const [ownSelection, setOwnSelection] = useState<Record<string, true>>({});\n const rowSelection: Record<string, true> =\n selected != null\n ? Object.fromEntries(selected.map((id) => [id, true as const]))\n : ownSelection;\n // Sorting mirrors selection: the component always owns a fallback state,\n // so `defaultSort` + `onSortChange` without `sort` still sorts — a custom\n // `onSortingChange` replaces the table's own updater entirely.\n const [ownSort, setOwnSort] = useState<SortingState>(defaultSort ?? []);\n const sorting: SortingState = sort ?? ownSort;\n const table = useTable<DataTableFeatures, TData>({\n features,\n columns: (selecting\n ? [SELECT_COLUMN as DataTableColumn<TData, any>, ...columns]\n : columns) as Array<DataTableColumn<TData, any>>,\n data: data as Array<TData>,\n getRowId: getRowId ? (row) => getRowId(row) : defaultRowId,\n // Keys only when meant: a present-but-undefined slice of `state` reads\n // as \"controlled, with nobody listening\".\n state: {\n sorting,\n ...(searching ? { globalFilter: query } : {}),\n ...(selecting ? { rowSelection } : {}),\n },\n ...(selecting\n ? {\n enableRowSelection: true,\n onRowSelectionChange: (\n updater:\n | Record<string, true>\n | ((old: Record<string, true>) => Record<string, true>),\n ) => {\n const next =\n typeof updater === \"function\" ? updater(rowSelection) : updater;\n if (selected == null) setOwnSelection(next);\n onSelectedChange?.(Object.keys(next));\n },\n }\n : {}),\n ...(searching\n ? {\n onGlobalFilterChange: setQuery,\n globalFilterFn: \"includesString\" as const,\n }\n : {}),\n onSortingChange: (\n updater: SortingState | ((prev: SortingState) => SortingState),\n ) => {\n const next = typeof updater === \"function\" ? updater(sorting) : updater;\n if (sort == null) setOwnSort(next);\n onSortChange?.(next);\n },\n });\n const rows = table.getRowModel().rows;\n const total = data.length;\n const matched = searching ? rows.length : total;\n useLayoutEffect(() => {\n if (!searching || searchStore == null) return;\n searchStore.publish({ placeholder, query, setQuery, matched, total });\n }, [searching, searchStore, placeholder, query, matched, total]);\n useEffect(() => {\n if (searchStore == null) return;\n return () => searchStore.publish(null);\n }, [searchStore]);\n const leafCount = table.getAllLeafColumns().length;\n const bones = useMemo(\n () =>\n loading\n ? Array.from({ length: loading === true ? DEFAULT_BONES : loading })\n : [],\n [loading],\n );\n\n const renderRow = (row: (typeof rows)[number]) => {\n const href = rowHref?.(row.original);\n const isCurrent = current != null && current === row.id;\n const navigable = href != null || onRowClick != null;\n const onActivate = (event: MouseEvent<HTMLTableRowElement>) => {\n if (event.button !== 0 && event.button !== 1) return;\n if (event.defaultPrevented || shouldIgnoreRowNav(event.target)) return;\n onRowClick?.(row.original, event);\n if (event.defaultPrevented || href == null) return;\n activateRowHref(event, href);\n };\n const onRowKeyDown = (event: KeyboardEvent<HTMLTableRowElement>) => {\n if (href != null) return;\n if (event.key !== \"Enter\" && event.key !== \" \") return;\n if (event.defaultPrevented || shouldIgnoreRowNav(event.target)) return;\n event.preventDefault();\n onRowClick?.(row.original, event);\n };\n return (\n <tr\n key={row.id}\n className={cn(\n navigable &&\n \"hover:bg-pho-primary-hover outline-pho-brand cursor-pointer transition-colors has-[a:focus-visible]:outline-2 has-[a:focus-visible]:-outline-offset-2\",\n (isCurrent || row.getIsSelected()) && \"bg-pho-primary-hover\",\n )}\n tabIndex={navigable && href == null ? 0 : undefined}\n onClick={navigable ? onActivate : undefined}\n onAuxClick={navigable ? onActivate : undefined}\n onKeyDown={navigable && href == null ? onRowKeyDown : undefined}\n >\n {row.getAllCells().map((cell, index) => {\n const align = cell.column.columnDef.meta?.align ?? \"start\";\n return (\n <td\n key={cell.id}\n className={cn(\n \"text-pho-primary px-5 align-middle whitespace-nowrap\",\n rowSize,\n fixed && \"min-w-0\",\n align === \"end\" && \"text-right tabular-nums\",\n cell.column.columnDef.meta?.className,\n )}\n >\n {/* The link lives in the first data cell; with selection on,\n cell 0 is the checkbox and must stay outside the anchor. */}\n {index === (selecting ? 1 : 0) && href != null ? (\n // One real link for keyboard and right-click; the row\n // click handler covers the rest of the surface.\n <Link\n href={href}\n aria-current={isCurrent ? \"page\" : undefined}\n className=\"outline-none\"\n >\n <FlexRender cell={cell} />\n </Link>\n ) : (\n <FlexRender cell={cell} />\n )}\n </td>\n );\n })}\n </tr>\n );\n };\n\n // Partition the (sorted, filtered) rows: the main body, then each\n // labeled group in the order labels first appear in `data`.\n let mainRows = rows;\n let groupSections: Array<[string, typeof rows]> = [];\n if (group != null) {\n mainRows = [];\n const byLabel = new Map<string, typeof rows>();\n const order: string[] = [];\n for (const item of data) {\n const label = group(item);\n if (label != null && !byLabel.has(label)) {\n byLabel.set(label, []);\n order.push(label);\n }\n }\n for (const row of rows) {\n const label = group(row.original);\n if (label == null) {\n mainRows.push(row);\n } else {\n if (!byLabel.has(label)) {\n byLabel.set(label, []);\n order.push(label);\n }\n byLabel.get(label)!.push(row);\n }\n }\n groupSections = order\n .map((label) => [label, byLabel.get(label)!] as [string, typeof rows])\n .filter(([, sectionRows]) => sectionRows.length > 0);\n }\n\n const grid = (\n <table\n className={cn(\"w-full border-collapse\", rowText, fixed && \"table-fixed\")}\n aria-busy={loading ? true : undefined}\n >\n <thead>\n {table.getHeaderGroups().map((headerGroup) => (\n <tr key={headerGroup.id}>\n {headerGroup.headers.map((header) => {\n const align = header.column.columnDef.meta?.align ?? \"start\";\n const sorted = header.column.getIsSorted();\n const sortable =\n !header.isPlaceholder && header.column.getCanSort();\n return (\n <th\n key={header.id}\n scope=\"col\"\n colSpan={header.colSpan}\n aria-sort={\n sorted === \"asc\"\n ? \"ascending\"\n : sorted === \"desc\"\n ? \"descending\"\n : undefined\n }\n className={cn(\n DATA_TABLE_HEADER_CELL,\n \"px-5\",\n fixed && \"min-w-0\",\n align === \"end\" && \"text-right\",\n header.column.columnDef.meta?.className,\n )}\n >\n {header.isPlaceholder ? null : sortable ? (\n <button\n type=\"button\"\n onClick={header.column.getToggleSortingHandler()}\n className={cn(\n \"group/sort outline-pho-brand hover:text-pho-primary -mx-1 inline-flex items-center gap-1 rounded-sm px-1 transition-colors focus-visible:outline-2\",\n align === \"end\" && \"flex-row-reverse\",\n sorted && \"text-pho-primary\",\n )}\n >\n <FlexRender header={header} />\n <SortIndicator sorted={sorted} />\n </button>\n ) : (\n <FlexRender header={header} />\n )}\n </th>\n );\n })}\n </tr>\n ))}\n </thead>\n <tbody className={DATA_TABLE_BODY}>\n {bones.length > 0 ? (\n bones.map((_, index) => (\n <tr key={index}>\n {table.getAllLeafColumns().map((column) => (\n <td\n key={column.id}\n className={cn(\n \"px-5 align-middle\",\n rowSize,\n fixed && \"min-w-0\",\n column.columnDef.meta?.className,\n )}\n >\n <Skeleton\n className={cn(\n \"h-3.5 w-24\",\n column.columnDef.meta?.align === \"end\" && \"ml-auto\",\n )}\n />\n </td>\n ))}\n </tr>\n ))\n ) : rows.length === 0 ? (\n <tr>\n <td\n colSpan={leafCount}\n className=\"text-pho-description px-5 py-10 text-center\"\n >\n {searching && query !== \"\" && data.length > 0 ? (\n <>Nothing matches “{query}”.</>\n ) : (\n empty\n )}\n </td>\n </tr>\n ) : (\n <>\n {mainRows.map(renderRow)}\n {groupSections.map(([label, sectionRows]) => (\n <Fragment key={label}>\n <tr data-table-group=\"\">\n <td\n colSpan={leafCount}\n // A tinted band, not spacing: the wash marks the group\n // off, the height stays compact.\n className=\"bg-pho-page text-pho-description h-9 px-5 align-middle text-xs font-medium\"\n >\n {label}\n </td>\n </tr>\n {sectionRows.map(renderRow)}\n </Fragment>\n ))}\n </>\n )}\n </tbody>\n </table>\n );\n\n return (\n <div\n className={cn(\n DATA_TABLE_SURFACE,\n \"w-full scroll-mt-12 contain-inline-size\",\n !animateHeight && \"overflow-x-auto\",\n className,\n )}\n {...props}\n data-data-table=\"\"\n >\n {(toolbar != null || (searching && !adopted)) && (\n // The toolbar band — table chrome, like the header row: the ghost\n // search on the cells' text line (`px-5`), filters at the end.\n // Quiet ink, no boxes in the box; the hairline below is the only\n // border it brings.\n <div className=\"border-pho-secondary flex min-h-11 flex-wrap items-center gap-x-4 gap-y-1 border-b px-5 py-2\">\n {searching && !adopted && (\n <GhostSearch\n value={query}\n onChange={setQuery}\n onClear={() => setQuery(\"\")}\n placeholder={placeholder}\n aria-label={placeholder}\n />\n )}\n {toolbar}\n </div>\n )}\n {animateHeight ? (\n // The height glides on the page spring while the rows inside swap;\n // sideways scrolling moves onto the measured layer so the frame\n // clips height only.\n <AnimatedHeight\n transition={SPRING_ENTRANCE}\n className=\"overflow-x-auto\"\n >\n {grid}\n </AnimatedHeight>\n ) : (\n grid\n )}\n </div>\n );\n}\n\n/**\n * The sort cue beside a sortable header: the two-way glyph at rest (shown\n * on hover and focus, so a header reads as plain text until it matters), a\n * chevron pointing the way once the column is sorted.\n */\nfunction SortIndicator({ sorted }: { sorted: false | \"asc\" | \"desc\" }) {\n return (\n <span\n aria-hidden\n className={cn(\n \"inline-flex shrink-0 [&>svg]:size-3.5\",\n !sorted &&\n \"opacity-0 transition-opacity group-hover/sort:opacity-100 group-focus-visible/sort:opacity-100\",\n )}\n >\n {sorted === \"asc\" ? (\n <IconChevronUp />\n ) : sorted === \"desc\" ? (\n <IconChevronDown />\n ) : (\n <IconSelector />\n )}\n </span>\n );\n}\n\nexport { DataTable, DATA_TABLE_SURFACE };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;AASA,IAAM,KAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAiB,KAAO;AAAQ,CAAC,GAAG,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAqB,KAAO;AAAQ,CAAC,CAAC,GACxH,KAAe,GAAqB,WAAW,YAAY,YAAY,EAAU,GCwGjF,KAAW,GAAc;AAAA,EAC7B,mBAAA;AAAA,EACA,qBAAA;AAAA,EACA,wBAAA;AAAA,EACA,wBAAA;AAAA,EACA,gBAAgB,GAAqB;AAAA,EACrC,kBAAkB,GAAuB;AAAA,EACzC,WAAW,EAAE,gBAAgB,GAAwB;AAAA,EACrD,SAAS;AAAA,IACP,cAAc;AAAA,IACd,OAAO;AAAA,IACP,UAAU;AAAA,IACV,MAAM;AAAA,EACR;AAAA,EACA,YAAY,CAAC;AACf,CAAC,GAKY,KAAmB;AAAA,EAC9B,IAAI;AAAA,IACF,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,IAAI;AAAA,IACF,SAAS;AAAA,IACT,aACE;AAAA,EACJ;AACF;AAsBA,SAAgB,KAAuC;AACrD,SAAO,GAA6C;AACtD;AAOA,IAAM,KAAgB,GAAuB,EAAE,QAAQ;AAAA,EACrD,IAAI;AAAA,EACJ,eAAe;AAAA,EACf,QAAA,CAAS,EAAE,OAAA,EAAA,MAAY;AACrB,UAAM,IAAU,EAAM,YAAY,EAAE,MAC9B,IAAS,EAAQ,OAAA,CAAQ,MAAQ,EAAI,cAAc,CAAC,EAAE,QACtD,IAAM,EAAQ,SAAS,KAAK,MAAW,EAAQ;AACrD,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ACE,gBAAA,EAAC,OAAD;AAAA,IACE,WAAW,EACT,IACA,2CACA,CAAC,KAAiB,mBAClB,EACF;AAAA,IACA,GAAI;AAAA,IACJ,mBAAgB;AAAA,IARlB,UAAA,EAUI,KAAW,QAAS,KAAa,CAAC,MAKlC,gBAAA,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAAf,UAAA,CACG,KAAa,CAAC,KACb,gBAAA,EAAC,IAAD;AAAA,QACE,OAAO;AAAA,QACP,UAAU;AAAA,QACV,SAAA,MAAe,EAAS,EAAE;AAAA,QACb,aAAA;AAAA,QACb,cAAY;AAAA,MACb,CAAA,GAEF,CACE;AAAA,IAEN,CAAA,GAAA,IAIC,gBAAA,EAAC,IAAD;AAAA,MACE,YAAY;AAAA,MACZ,WAAU;AAAA,MAET,UAAA;AAAA,IACa,CAAA,IAEhB,CAEC;AAAA;AAET;AAOA,SAAS,GAAc,EAAE,QAAA,EAAA,GAA8C;AACrE,SACE,gBAAA,EAAC,QAAD;AAAA,IACE,eAAA;AAAA,IACA,WAAW,EACT,yCACA,CAAC,KACC,gGACJ;AAAA,IAEC,UAAA,MAAW,QACV,gBAAA,EAAC,IAAD,CAAgB,CAAA,IACd,MAAW,SACb,gBAAA,EAAC,IAAD,CAAkB,CAAA,IAElB,gBAAA,EAAC,IAAD,CAAe,CAAA;AAAA,EAEb,CAAA;AAEV"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"date-picker-CZbcNIe-.js","names":[],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconCalendar.mjs","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.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\": \"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M16 3v4\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M8 3v4\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M4 11h16\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M11 15h1\", \"key\": \"svg-4\" }], [\"path\", { \"d\": \"M12 15v3\", \"key\": \"svg-5\" }]];\nconst IconCalendar = createReactComponent(\"outline\", \"calendar\", \"Calendar\", __iconNode);\n\nexport { __iconNode, IconCalendar as default };\n//# sourceMappingURL=IconCalendar.mjs.map\n","import {\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n useSyncExternalStore,\n type ReactNode,\n} from \"react\";\nimport { IconCalendar } from \"@tabler/icons-react\";\nimport type { DateRange, Matcher, PropsBase } from \"react-day-picker\";\nimport { Calendar } from \"../calendar\";\nimport { Popover } from \"../popover\";\nimport type { InputSize } from \"../input\";\nimport { cn } from \"../../utils/cn\";\n\n/** The trigger wears Input's sizes so the two line up in one form. */\nexport type DatePickerSize = InputSize;\n\n/**\n * How fine the time is asked for, and read back. Omit it for a date alone.\n * The value is always a `Date`; the granularity says which of its parts the\n * viewer sets, and everything below is zeroed.\n */\nexport type DatePickerTime = \"hour\" | \"minute\" | \"second\";\n\n/** `step` for a native time field — the unit it moves and shows. */\nconst TIME_STEP: Record<DatePickerTime, number> = {\n hour: 3600,\n minute: 60,\n second: 1,\n};\n\n// Effective padding matches Input's (12/8px, lg 14/10px); Input reaches it\n// through a 2px wrapper inset it has to compensate for, the trigger directly.\nconst SIZE_PAD: Record<DatePickerSize, string> = {\n // 16px until there is room — a 14px control next to a 16px field looks shrunk.\n sm: \"px-3 py-2 text-md md:text-base\",\n md: \"px-3 py-2 text-md\",\n lg: \"px-3.5 py-2.5 text-md\",\n};\n\nconst SIZE_RADIUS: Record<DatePickerSize, string> = {\n sm: \"rounded-base\",\n md: \"rounded-base\",\n lg: \"squircle rounded-base\",\n};\n\nconst TRIGGER_BASE = cn(\n \"bg-pho-primary ring-pho-primary text-pho-primary relative flex cursor-pointer items-center gap-2 text-left ring-1 ring-inset\",\n \"transition-shadow duration-100 ease-linear focus-visible:outline-none\",\n // Invalid is mid-weight — thicker than the rest hairline, thinner than focus.\n \"data-[invalid]:ring-pho-error-subtle data-[invalid]:ring-[1.5px]\",\n);\n\n// Open or focused, the edge is Input's: the brand ring at 2px in place of the\n// hairline. The popover path focuses the button itself; the native path puts a\n// system field over it, so the ring follows the field inside.\nconst TRIGGER_FIELD = cn(\n \"has-[input:focus-visible]:ring-pho-brand data-[popup-open]:ring-pho-brand has-[input:focus-visible]:ring-2 data-[popup-open]:ring-2\",\n \"data-[invalid]:has-[input:focus-visible]:ring-pho-error data-[invalid]:data-[popup-open]:ring-pho-error\",\n \"has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50\",\n);\n\nconst TRIGGER_NATIVE = cn(\n \"has-[input:focus-visible]:ring-pho-brand has-[input:focus-visible]:ring-2\",\n \"data-[invalid]:has-[input:focus-visible]:ring-pho-error\",\n \"has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50\",\n);\n\n/**\n * A named window in the rail beside the calendar — the Menu row's manners,\n * since that is what a list of choices is.\n */\nconst PRESET = cn(\n \"flex shrink-0 cursor-pointer items-center rounded-sm px-2.5 py-1.5 text-left text-base whitespace-nowrap select-none\",\n \"text-pho-secondary transition-[color,background-color] duration-150 ease-out\",\n \"hover:bg-pho-ghost-hover hover:text-pho-primary\",\n \"outline-pho-brand focus-visible:outline-2 focus-visible:-outline-offset-1\",\n \"sm:w-full\",\n);\n\n/** The one in play. Quiet, like a highlighted menu row — not an action fill. */\nconst PRESET_ON = \"bg-pho-ghost-hover text-pho-primary font-medium\";\n\n/* ------------------------------------------------------------------ words */\n\n/**\n * ICU disagrees with itself about which space belongs before `AM` and around\n * a range dash: Node sends a narrow no-break space and a thin space where\n * Chrome sends ordinary ones. The two strings look identical and are not, so\n * a server-rendered label would fail to hydrate. Flattening every space\n * separator to the ordinary one makes the words the same on both sides.\n */\nconst SPACE_SEPARATORS = /[\\u00a0\\u2000-\\u200a\\u202f\\u205f\\u3000]/g;\nconst flattenSpaces = (words: string) => words.replace(SPACE_SEPARATORS, \" \");\n\n/** The date's parts, all in figures — the shape that is quickest to type. */\nconst NUMERIC_DATE = {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n} as const;\n\n/** The clock, on a 24-hour dial: `15:04` is fewer keystrokes than `3:04 PM`. */\nconst NUMERIC_CLOCK: Record<DatePickerTime, Intl.DateTimeFormatOptions> = {\n hour: { hour: \"2-digit\", minute: \"2-digit\", hourCycle: \"h23\" },\n minute: { hour: \"2-digit\", minute: \"2-digit\", hourCycle: \"h23\" },\n second: {\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n hourCycle: \"h23\",\n },\n};\n\n/**\n * What sits between the two ends of a span. No spaces around it — the field\n * is tight and the dates are already grouped by their own separators. An en\n * dash rather than a hyphen because a hyphen is one: `2026-09-01-08` in a\n * year-first locale would read as three numbers, `2026-09-01–08` as two dates.\n */\nconst SPAN_DASH = \"\\u2013\";\n\n/** A day whose parts are all different, so the locale's order reads clearly. */\nconst SAMPLE = new Date(2026, 8, 12, 15, 4, 5);\n\nfunction numericFormat(\n locales: Intl.LocalesArgument,\n time: DatePickerTime | undefined,\n) {\n return new Intl.DateTimeFormat(locales, {\n ...NUMERIC_DATE,\n ...(time ? NUMERIC_CLOCK[time] : {}),\n });\n}\n\ntype DatePart = \"year\" | \"month\" | \"day\";\nconst isDatePart = (type: string): type is DatePart =>\n type === \"year\" || type === \"month\" || type === \"day\";\n\n/** Which of year, month and day comes first here, and which comes last. */\nfunction numericOrder(locales: Intl.LocalesArgument): DatePart[] {\n return new Intl.DateTimeFormat(locales, NUMERIC_DATE)\n .formatToParts(SAMPLE)\n .map((part) => part.type)\n .filter(isDatePart);\n}\n\nconst MASK: Record<DatePart, string> = {\n year: \"yyyy\",\n month: \"mm\",\n day: \"dd\",\n};\n\n/**\n * The shape to type, in this locale's own order — `mm/dd/yyyy`,\n * `yyyy-mm-dd`, `dd.mm.yyyy`. Lowercase, the way a browser's own date field\n * writes it, so the two paths read alike.\n */\nexport function dateFieldMask(\n locales?: Intl.LocalesArgument,\n time?: DatePickerTime,\n): string {\n return flattenSpaces(\n numericFormat(locales, time)\n .formatToParts(SAMPLE)\n .map((part) =>\n isDatePart(part.type)\n ? MASK[part.type]\n : part.type === \"hour\"\n ? \"hh\"\n : part.type === \"minute\"\n ? \"mm\"\n : part.type === \"second\"\n ? \"ss\"\n : part.value,\n )\n .join(\"\"),\n );\n}\n\n/**\n * The figures in the field — `09/12/2026`, or `09/10/2026–09/13/2026` for a\n * span, in the viewer's locale. An empty or half-finished range prints just\n * the day that is settled; nothing selected prints nothing. Pass `time` to\n * print the clock too, at the precision that was asked for.\n *\n * Figures rather than words (`Sep 12, 2026`) because the field is typed into:\n * a month's name is the one part of a date nobody wants to spell.\n */\nexport function formatDateLabel(\n value: Date | DateRange | undefined,\n locales?: Intl.LocalesArgument,\n time?: DatePickerTime,\n): string {\n if (value == null) return \"\";\n const format = numericFormat(locales, time);\n if (value instanceof Date) return flattenSpaces(format.format(value));\n if (value.from == null) return \"\";\n if (value.to == null) return flattenSpaces(format.format(value.from));\n // A span of one day is a day: printing it twice says nothing the once did\n // not, and the first click of a range makes exactly that shape.\n if (\n time == null &&\n value.from.getFullYear() === value.to.getFullYear() &&\n value.from.getMonth() === value.to.getMonth() &&\n value.from.getDate() === value.to.getDate()\n ) {\n return flattenSpaces(format.format(value.from));\n }\n return flattenSpaces(joinSpan(format, value.from, value.to, time != null));\n}\n\n/**\n * Both ends of a span, with whatever they say twice said once — a shared\n * year, and a shared month behind it, printed at the end that carries it.\n * `09/01–09/08/2026`, `01.–08.09.2026`, `2026-09-01–08`. A span carrying a\n * clock is printed whole.\n *\n * Joined here rather than by `Intl.formatRange`, which does this in `de-DE`\n * and `sv-SE` and not in `en-US` or `en-GB`, and which drops the padding the\n * single-date format asks for. Whole fields only, taken from whichever end\n * the year sits at, so the half that is dropped is never the half that\n * distinguishes the two dates.\n */\nfunction joinSpan(\n format: Intl.DateTimeFormat,\n from: Date,\n to: Date,\n hasClock: boolean,\n): string {\n const a = format.formatToParts(from);\n const b = format.formatToParts(to);\n const text = (parts: Intl.DateTimeFormatPart[]) =>\n parts.map((part) => part.value).join(\"\");\n\n // With a clock in it there is nothing worth merging: the tail fields are\n // hours and minutes, the saving is a year that would then print after a\n // time, and a trim that lands mid-clock eats one end's `:00`.\n if (hasClock || a.length !== b.length) {\n return `${text(a)}${SPAN_DASH}${text(b)}`;\n }\n const same = (at: number) =>\n a[at]!.type === b[at]!.type && a[at]!.value === b[at]!.value;\n\n // The year leads (`yyyy-mm-dd`): the second date drops the shared head.\n if (a[0]?.type === \"year\") {\n let cut = 0;\n while (cut < a.length && same(cut)) cut += 1;\n // Back off to a field boundary so a half-written number never survives.\n while (cut > 0 && b[cut - 1]!.type !== \"literal\") cut -= 1;\n if (cut > 0 && cut < a.length) {\n return `${text(a)}${SPAN_DASH}${text(b.slice(cut))}`;\n }\n return `${text(a)}${SPAN_DASH}${text(b)}`;\n }\n\n // The year trails (`mm/dd/yyyy`, `dd.mm.yyyy`): the first date drops the\n // shared tail.\n let keep = a.length;\n while (keep > 0 && same(keep - 1)) keep -= 1;\n while (keep < a.length && a[keep]!.type !== \"literal\") keep += 1;\n if (keep > 0 && keep < a.length) {\n return `${text(a.slice(0, keep))}${SPAN_DASH}${text(b)}`;\n }\n return `${text(a)}${SPAN_DASH}${text(b)}`;\n}\n\n/* ------------------------------------------------------- date arithmetic */\n\nconst pad = (n: number) => String(n).padStart(2, \"0\");\n\n/** `YYYY-MM-DD` in the viewer's own zone — never `toISOString`, which is UTC. */\nfunction toDateValue(date: Date): string {\n return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;\n}\n\nfunction toClockValue(date: Date, time: DatePickerTime): string {\n const hm = `${pad(date.getHours())}:${pad(date.getMinutes())}`;\n return time === \"second\" ? `${hm}:${pad(date.getSeconds())}` : hm;\n}\n\n/** The `datetime-local` spelling of an instant, at the asked-for precision. */\nfunction toDateTimeValue(date: Date, time: DatePickerTime): string {\n return `${toDateValue(date)}T${toClockValue(date, time)}`;\n}\n\n/**\n * Read back a `date` or `datetime-local` field. Parsed part by part rather\n * than handed to `new Date(string)`, which reads a bare `YYYY-MM-DD` as UTC\n * midnight and lands on the day before west of Greenwich.\n */\nfunction fromInputValue(value: string): Date | undefined {\n const match =\n /^(\\d{4})-(\\d{2})-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2}))?)?$/.exec(value);\n if (!match) return undefined;\n const [, y, m, d, hh, mm, ss] = match;\n const date = new Date(\n Number(y),\n Number(m) - 1,\n Number(d),\n Number(hh ?? 0),\n Number(mm ?? 0),\n Number(ss ?? 0),\n 0,\n );\n return Number.isNaN(date.getTime()) ? undefined : date;\n}\n\n/** A date the calendar could actually show — `Feb 31` rolled over, so no. */\nfunction makeLocalDate(\n shortYear: number,\n month: number,\n day: number,\n clock: number[],\n): Date | undefined {\n // `12/25/26` means 2026, not the year 26 — and `new Date(26, …)` would say\n // 1926. Two figures are this century.\n const year = shortYear < 100 ? 2000 + shortYear : shortYear;\n if (month < 1 || month > 12 || day < 1 || day > 31) return undefined;\n const [hh = 0, mm = 0, ss = 0] = clock;\n if (hh > 23 || mm > 59 || ss > 59) return undefined;\n const date = new Date(year, month - 1, day, hh, mm, ss, 0);\n return date.getMonth() === month - 1 && date.getDate() === day\n ? date\n : undefined;\n}\n\n/**\n * A date out of whatever the viewer typed, read in the same order the field\n * writes it — so what it shows is what it takes back. `yyyy-mm-dd` is read as\n * itself wherever it turns up, since nothing else starts with four figures,\n * and a date spelled out in words still parses so a paste of `Sep 12, 2026`\n * lands. Three numbers at least: the field must not flicker through\n * Decembers on the way to one date.\n */\nfunction parseDateText(\n text: string,\n locales: Intl.LocalesArgument,\n): Date | undefined {\n const trimmed = text.trim();\n if (trimmed === \"\") return undefined;\n\n const numbers = (trimmed.match(/\\d+/g) ?? []).map(Number);\n if (numbers.length >= 3) {\n const clock = numbers.slice(3);\n // `3:04 pm` is not the shape the field writes, but it is a shape people\n // type; move it onto the 24-hour dial the rest of this speaks.\n if (/\\bpm\\b/i.test(trimmed) && clock[0] !== undefined && clock[0] < 12) {\n clock[0] += 12;\n } else if (/\\bam\\b/i.test(trimmed) && clock[0] === 12) {\n clock[0] = 0;\n }\n\n // Four figures up front can only be a year; no locale puts a day or a\n // month there.\n if (/^\\d{4}\\D/.test(trimmed)) {\n const [year, month, day] = numbers;\n return makeLocalDate(year!, month!, day!, clock);\n }\n\n const slots: Partial<Record<DatePart, number>> = {};\n numericOrder(locales).forEach((part, at) => {\n slots[part] = numbers[at];\n });\n if (slots.year != null && slots.month != null && slots.day != null) {\n const made = makeLocalDate(slots.year, slots.month, slots.day, clock);\n if (made) return made;\n }\n }\n\n // Words — a pasted `Sep 12, 2026`. Only worth trying with letters in it and\n // a four-figure year to go with them: `new Date` turns a bare `Sep 12` into\n // this year's, which is a guess the field should not make.\n if (!/[a-z]/i.test(trimmed)) return undefined;\n if (numbers.length < 2 || !/\\b\\d{4}\\b/.test(trimmed)) return undefined;\n const spelled = new Date(trimmed);\n return Number.isNaN(spelled.getTime()) ? undefined : spelled;\n}\n\n/** Zero everything finer than the granularity, so the value means what it says. */\nfunction clampTime(date: Date, time: DatePickerTime | undefined): Date {\n const next = new Date(date);\n next.setMilliseconds(0);\n if (time === \"second\") return next;\n next.setSeconds(0);\n if (time === \"minute\") return next;\n next.setMinutes(0);\n if (time === \"hour\") return next;\n next.setHours(0);\n return next;\n}\n\n/**\n * A value's identity, for telling whether the window on screen is still the\n * one a preset put there. Instants, so a re-render cannot change the answer.\n */\nfunction valueKey(value: Date | DateRange | undefined): string {\n if (value == null) return \"\";\n if (value instanceof Date) return String(value.getTime());\n return `${value.from?.getTime() ?? \"\"}-${value.to?.getTime() ?? \"\"}`;\n}\n\n/** A day from the calendar, wearing the clock the value already carried. */\nfunction withDay(day: Date, keepTimeFrom: Date | undefined): Date {\n const next = new Date(day);\n if (keepTimeFrom) {\n next.setHours(\n keepTimeFrom.getHours(),\n keepTimeFrom.getMinutes(),\n keepTimeFrom.getSeconds(),\n 0,\n );\n }\n return next;\n}\n\nconst startOfMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth(), 1);\nconst endOfMonth = (d: Date) => new Date(d.getFullYear(), d.getMonth() + 1, 0);\n// DayPicker's matchers count calendar days, so a bound carrying a time of day\n// disables nothing extra on the calendar. Widen each to its whole day before\n// handing it to a system picker, which would otherwise enforce the clock too.\nconst startOfDay = (d: Date) =>\n new Date(d.getFullYear(), d.getMonth(), d.getDate());\nconst endOfDay = (d: Date) =>\n new Date(d.getFullYear(), d.getMonth(), d.getDate(), 23, 59, 59, 999);\nconst later = (a: Date | undefined, b: Date) => (a && a > b ? a : b);\nconst earlier = (a: Date | undefined, b: Date) => (a && a < b ? a : b);\n\n/**\n * The only rules a system picker enforces are its first and last day. Returns\n * them, or `null` when the page asked for something the OS cannot express — a\n * weekday rule, a predicate, a hidden set — in which case the calendar, which\n * can enforce it, stays on every device.\n */\nfunction nativeBounds(\n calendarProps: PropsBase | undefined,\n): { min?: Date; max?: Date } | null {\n if (calendarProps?.hidden != null) return null;\n\n let min: Date | undefined;\n let max: Date | undefined;\n const rules: Matcher[] =\n calendarProps?.disabled == null\n ? []\n : Array.isArray(calendarProps.disabled)\n ? calendarProps.disabled\n : [calendarProps.disabled];\n\n for (const rule of rules) {\n if (rule == null || typeof rule !== \"object\" || rule instanceof Date) {\n return null;\n }\n const keys = Object.keys(rule);\n // `{ before }` and `{ after }` alone are the two the OS understands; the\n // pair of them is DayPicker's *interval*, which means the opposite.\n if (keys.length !== 1) return null;\n if (\"before\" in rule && rule.before instanceof Date) {\n min = later(min, startOfDay(rule.before));\n } else if (\"after\" in rule && rule.after instanceof Date) {\n max = earlier(max, endOfDay(rule.after));\n } else {\n return null;\n }\n }\n\n if (calendarProps?.startMonth) {\n min = later(min, startOfMonth(calendarProps.startMonth));\n }\n if (calendarProps?.endMonth) {\n max = earlier(max, endOfDay(endOfMonth(calendarProps.endMonth)));\n }\n return { min, max };\n}\n\n/* --------------------------------------------------------------- devices */\n\nconst COARSE_POINTER = \"(pointer: coarse)\";\n\n/**\n * True where the primary input is a finger. `useSyncExternalStore` so the\n * server and the first client render agree (no match) and the swap happens in\n * the same commit as hydration, rather than as a mismatch.\n */\nfunction useCoarsePointer(): boolean {\n const subscribe = useCallback((notify: () => void) => {\n if (typeof window === \"undefined\" || !window.matchMedia) return () => {};\n const query = window.matchMedia(COARSE_POINTER);\n query.addEventListener(\"change\", notify);\n return () => query.removeEventListener(\"change\", notify);\n }, []);\n\n return useSyncExternalStore(\n subscribe,\n () =>\n typeof window !== \"undefined\" &&\n typeof window.matchMedia === \"function\" &&\n window.matchMedia(COARSE_POINTER).matches,\n () => false,\n );\n}\n\n/* ------------------------------------------------------------------ props */\n\n/**\n * A window the page offers by name — `Last 7 days` — beside the calendar.\n * Pass a function for anything measured from now, so it is resolved at the\n * click rather than at render.\n */\nexport interface DatePickerPreset<T> {\n label: string;\n value: T | (() => T);\n}\n\n/** Extra about a change — present when the value came from a named window. */\nexport interface DatePickerChangeDetails<T> {\n preset: DatePickerPreset<T>;\n}\n\ninterface DatePickerBaseProps {\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 /**\n * What the field shows until something is chosen.\n * @default the shape to type, in this locale's order (`mm/dd/yyyy`)\n */\n placeholder?: string;\n /** Render the invalid state (error ring + error-colored hint). */\n invalid?: boolean;\n disabled?: boolean;\n /** Marks the label with the required asterisk. */\n required?: boolean;\n /** Size variant. @default \"md\" */\n size?: DatePickerSize;\n /**\n * `fill` takes the column it is in, like every other field. `hug` shrinks\n * to the words it is showing, for a field that sits in a toolbar or beside\n * a title rather than in a form.\n * @default \"fill\"\n */\n width?: \"fill\" | \"hug\";\n /**\n * Ask for a time as well as a day, this fine. `hour` sets the hour and\n * zeroes the rest, `minute` the hour and minute, `second` all three. Omit\n * it and the value is midnight on the chosen day.\n */\n time?: DatePickerTime;\n /** Locale for the trigger's words. Defaults to the viewer's. */\n locales?: Intl.LocalesArgument;\n /**\n * Everything else React DayPicker takes — `disabled` days, `startMonth` /\n * `endMonth`, `numberOfMonths`, `weekStartsOn`, `captionLayout`.\n */\n calendarProps?: PropsBase;\n /** Id for the trigger, if the page needs its own. */\n id?: string;\n /** Class applied to the trigger. */\n className?: string;\n /**\n * Accessible name when there is no visible label — a toolbar control\n * beside a page title, which already says what the field is for.\n */\n \"aria-label\"?: string;\n /**\n * The named window the field should read. A page that already knows the\n * name (`Last 24 hours` in the URL) passes it so a remount, and a rolling\n * window recomputed each render, still write the name rather than the\n * figures. The name drops the moment the value is no longer that window\n * — a day picked by hand, or the page clearing this.\n */\n selectedPreset?: string;\n /**\n * How the popover lines up with the field. A hug field on the right of a\n * header wants `end`, so the calendar grows left instead of off-screen.\n * @default \"start\"\n */\n align?: \"start\" | \"center\" | \"end\";\n}\n\nexport interface DatePickerSingleProps extends DatePickerBaseProps {\n /** @default \"single\" */\n mode?: \"single\";\n value?: Date;\n defaultValue?: Date;\n onValueChange?: (\n value: Date | undefined,\n details?: DatePickerChangeDetails<Date>,\n ) => void;\n /** Named days offered beside the calendar. */\n presets?: DatePickerPreset<Date>[];\n}\n\nexport interface DatePickerRangeProps extends DatePickerBaseProps {\n mode: \"range\";\n value?: DateRange;\n defaultValue?: DateRange;\n onValueChange?: (\n value: DateRange | undefined,\n details?: DatePickerChangeDetails<DateRange>,\n ) => void;\n /** Named windows offered beside the calendar — `Last 7 days`, and so on. */\n presets?: DatePickerPreset<DateRange>[];\n /**\n * Shortest and longest span the viewer may pick, counted in days. A pick\n * that would break either restarts the span from the day just clicked, so\n * the bound is felt rather than explained.\n */\n minDays?: number;\n maxDays?: number;\n}\n\nexport type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps;\n\n/* ------------------------------------------------------------- the clock */\n\n/** One labelled time field — the popover's way of asking for the clock. */\nfunction ClockField({\n label,\n value,\n time,\n disabled,\n onChange,\n}: {\n label: string;\n value: Date | undefined;\n time: DatePickerTime;\n disabled?: boolean;\n onChange: (next: string) => void;\n}) {\n return (\n <>\n <span className=\"text-pho-description text-xs\">{label}</span>\n <label\n className={cn(\n \"bg-pho-primary ring-pho-primary rounded-sm px-2 py-1 ring-1 ring-inset\",\n \"focus-within:ring-pho-brand transition-shadow duration-100 ease-linear focus-within:ring-2\",\n )}\n >\n <input\n type=\"time\"\n step={TIME_STEP[time]}\n disabled={disabled}\n aria-label={label}\n value={value ? toClockValue(value, time) : \"\"}\n onChange={(event) => onChange(event.target.value)}\n className={cn(\n \"text-pho-primary w-full bg-transparent text-base tabular-nums outline-none\",\n // The browser's own clock glyph is off-brand and unstyleable;\n // the field's words are the control.\n \"[&::-webkit-calendar-picker-indicator]:hidden\",\n )}\n />\n </label>\n </>\n );\n}\n\n/* ------------------------------------------------------------ the picker */\n\n/**\n * Date Picker — a field that shows the chosen date and opens a `Calendar` to\n * change it. `mode=\"range\"` picks a span instead of a day; the popover stays\n * open until both ends are down.\n *\n * The value is a `Date` (or a `{ from, to }` range), never a string: pass\n * `value` to control it, `defaultValue` to let it keep its own. Clearing is\n * built in — clicking the chosen day again unsets it.\n *\n * `time` asks for the clock as well, to the hour, the minute, or the second.\n *\n * On a touch device the field hands off to the system picker — the OS wheel or\n * dialog, which people already know — as long as the rules the page set are\n * ones it can enforce. A weekday rule or a predicate keeps the calendar, which\n * can; so does `mode=\"range\"`, which no system picker offers.\n */\nexport function DatePicker(props: DatePickerProps) {\n const {\n mode = \"single\",\n defaultValue,\n onValueChange,\n label,\n hint,\n placeholder,\n invalid,\n disabled,\n required,\n size = \"md\",\n width = \"fill\",\n time,\n locales,\n calendarProps,\n id,\n className,\n selectedPreset,\n align = \"start\",\n \"aria-label\": ariaLabel,\n } = props;\n const presets = props.presets as\n DatePickerPreset<Date | DateRange>[] | undefined;\n // Range-only, and read off the union the same way.\n const { minDays, maxDays } = props as DatePickerRangeProps;\n\n // Presence of the prop, not its value: an empty controlled picker is the\n // normal starting state, so `value === undefined` cannot mean \"uncontrolled\".\n const controlled = \"value\" in props;\n const [ownValue, setOwnValue] = useState<Date | DateRange | undefined>(\n defaultValue,\n );\n const value = controlled ? props.value : ownValue;\n const [open, setOpen] = useState(false);\n // A range takes two clicks, and the first one already reads as a complete\n // one-day range ({ from, to } both set), so the value alone can't say when\n // the question is answered. Count the picks in this opening instead.\n const picks = useRef(0);\n\n // Empty, the field shows the shape to type. A span cannot be typed, so it\n // asks in words instead.\n const fieldPlaceholder =\n placeholder ??\n (mode === \"range\" ? \"Pick a date range\" : dateFieldMask(locales, time));\n\n const generatedId = useId();\n const triggerId = id ?? generatedId;\n const hintId = hint ? `${triggerId}-hint` : undefined;\n const calendarId = `${triggerId}-calendar`;\n\n // Whether the calendar should take the caret as it appears — true only when\n // a key asked for it, so a click leaves the caret in the field.\n const [gridFocus, setGridFocus] = useState(false);\n\n // The field is not a `Popover.Trigger`, so Base UI never routes its own\n // opening through `onOpenChange`: a controlled `open` is written straight\n // into the store. Every way in goes through here instead, or the reset an\n // opening owes — the pick count, the month on screen — silently never runs.\n const openPicker = (focusGrid = false) => {\n if (open) return;\n picks.current = 0;\n setMonth(undefined);\n setGridFocus(focusGrid);\n setOpen(true);\n };\n\n const notify = onValueChange as\n | ((\n v: Date | DateRange | undefined,\n d?: DatePickerChangeDetails<Date | DateRange>,\n ) => void)\n | undefined;\n\n const commit = (\n next: Date | DateRange | undefined,\n details?: DatePickerChangeDetails<Date | DateRange>,\n ) => {\n if (details) {\n setIgnoreSelected(false);\n } else {\n setIgnoreSelected(true);\n setChosen(null);\n }\n if (!controlled) setOwnValue(next);\n // The two modes have disjoint value types, and the union's callback is\n // only ever handed the shape its own mode produces. A second argument\n // is reserved for a named window, so a calendar pick stays a one-arg\n // call — existing listeners keep matching.\n if (details) notify?.(next, details);\n else notify?.(next);\n };\n\n const single = mode === \"single\" ? (value as Date | undefined) : undefined;\n const range = mode === \"range\" ? (value as DateRange | undefined) : undefined;\n // Reopen where the value lives, not on today's month.\n const anchor = single ?? range?.from;\n\n // The field is a text input, so the words in it are the viewer's until they\n // leave: `null` means \"whatever the value says\", anything else is what they\n // typed. Blur, a pick, and closing all hand the field back to the value.\n const [draft, setDraft] = useState<string | null>(null);\n // A preset names the window it set; the name stands only while the value is\n // still the one it produced, so a day picked afterwards drops the name with\n // no bookkeeping.\n const [chosen, setChosen] = useState<{ label: string; key: string } | null>(\n null,\n );\n // `selectedPreset` is the page's name for a rolling window. A hand pick\n // has to drop that name even if the page is a frame late clearing it —\n // otherwise the field still says \"Last 24 hours\" over a day the viewer\n // just chose. A new name from the page (or the same name after a remount)\n // starts honoring it again.\n const [ignoreSelected, setIgnoreSelected] = useState(false);\n useEffect(() => {\n setIgnoreSelected(false);\n }, [selectedPreset]);\n const presetLabel =\n selectedPreset && !ignoreSelected\n ? selectedPreset\n : chosen && chosen.key === valueKey(value)\n ? chosen.label\n : null;\n\n const text = draft ?? presetLabel ?? formatDateLabel(value, locales, time);\n // A typeable field stays wide enough for the shape to type, so it does\n // not jump when a date answers it. A span is read-only — hug the words\n // on screen, not the empty-state sentence sitting underneath.\n const hugChars = Math.max(\n text.length,\n mode === \"range\" ? 0 : fieldPlaceholder.length,\n 1,\n );\n const hugToWords = width === \"hug\" && mode === \"range\";\n\n const pickPreset = (preset: DatePickerPreset<Date | DateRange>) => {\n const next =\n typeof preset.value === \"function\" ? preset.value() : preset.value;\n setChosen({ label: preset.label, key: valueKey(next) });\n setDraft(null);\n commit(next, { preset });\n // A named window is the whole answer, clock included.\n setOpen(false);\n };\n\n // The month on screen follows what is typed, and resets to the value's own\n // month each time the calendar opens. Held from the first render rather than\n // handed over later: DayPicker keeps its own month until the prop arrives,\n // and a calendar that starts uncontrolled would ignore the first jump.\n const [month, setMonth] = useState<Date | undefined>(undefined);\n const [thisMonth] = useState(() => calendarProps?.today ?? new Date());\n const shownMonth =\n month ?? calendarProps?.defaultMonth ?? anchor ?? thisMonth;\n\n const fieldRef = useRef<HTMLDivElement>(null);\n const popupRef = useRef<HTMLDivElement>(null);\n\n const coarse = useCoarsePointer();\n const bounds = nativeBounds(calendarProps);\n // No system picker offers a range, so that mode keeps the calendar; so does\n // a rule the OS cannot enforce.\n const native =\n coarse && mode === \"single\" && bounds != null && !presets?.length;\n\n const face = (\n <>\n <IconCalendar className=\"text-pho-secondary size-4 shrink-0\" />\n <span\n className={cn(\n \"min-w-0 flex-1 truncate\",\n text === \"\" && \"text-pho-placeholder\",\n )}\n >\n {text === \"\" ? fieldPlaceholder : text}\n </span>\n </>\n );\n\n return (\n <div\n className={cn(\n \"flex flex-col gap-1.5\",\n width === \"hug\" ? \"w-fit\" : \"w-full\",\n )}\n >\n {label ? (\n <label\n htmlFor={triggerId}\n className=\"text-pho-secondary flex w-fit cursor-default items-center gap-0.5 text-base font-medium\"\n >\n {label}\n {required ? <span className=\"text-pho-brand\">*</span> : null}\n </label>\n ) : null}\n\n {native ? (\n <div\n data-invalid={invalid || undefined}\n className={cn(\n TRIGGER_BASE,\n TRIGGER_NATIVE,\n width === \"hug\" ? \"w-fit\" : \"w-full\",\n SIZE_PAD[size],\n SIZE_RADIUS[size],\n className,\n )}\n >\n {face}\n {/* The system field lies over the whole control at zero opacity:\n the tap opens the OS picker, the words underneath stay Pho's. */}\n <input\n id={triggerId}\n type={time ? \"datetime-local\" : \"date\"}\n step={time ? TIME_STEP[time] : undefined}\n min={\n bounds?.min\n ? time\n ? toDateTimeValue(clampTime(bounds.min, time), time)\n : toDateValue(bounds.min)\n : undefined\n }\n max={\n bounds?.max\n ? time\n ? toDateTimeValue(clampTime(bounds.max, time), time)\n : toDateValue(bounds.max)\n : undefined\n }\n required={required}\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={hintId}\n value={\n single\n ? time\n ? toDateTimeValue(single, time)\n : toDateValue(single)\n : \"\"\n }\n onChange={(event) => {\n const next = fromInputValue(event.target.value);\n commit(next ? clampTime(next, time) : undefined);\n }}\n className=\"absolute inset-0 size-full cursor-pointer opacity-0\"\n />\n </div>\n ) : (\n <Popover.Root\n open={open}\n onOpenChange={(next, details) => {\n // Clicking in the field is how the viewer reaches the caret, so it\n // opens the calendar and never takes it away again — the field is\n // not a trigger Base UI knows about, so its own presses arrive\n // here as presses from outside.\n if (\n !next &&\n details.reason === \"outside-press\" &&\n details.event.target instanceof Node &&\n fieldRef.current?.contains(details.event.target)\n ) {\n return;\n }\n // Opening is `openPicker`'s job; this only ever hears about\n // closes (Escape, a click outside) and the odd programmatic open.\n if (next) {\n picks.current = 0;\n setMonth(undefined);\n } else {\n setDraft(null);\n setGridFocus(false);\n }\n setOpen(next);\n }}\n >\n <div\n ref={fieldRef}\n data-invalid={invalid || undefined}\n data-popup-open={open || undefined}\n className={cn(\n TRIGGER_BASE,\n TRIGGER_FIELD,\n width === \"hug\" ? \"w-fit\" : \"w-full\",\n SIZE_PAD[size],\n SIZE_RADIUS[size],\n className,\n )}\n >\n <IconCalendar className=\"text-pho-secondary size-4 shrink-0\" />\n <input\n id={triggerId}\n type=\"text\"\n // A span is two dates and a separator; there is nothing\n // sensible to type, so the field only opens the calendar.\n readOnly={mode === \"range\"}\n disabled={disabled}\n required={required}\n placeholder={fieldPlaceholder}\n aria-label={ariaLabel}\n aria-describedby={hintId}\n // The APG's date-picker combobox: a text field that also says\n // what it opens. `textbox` alone does not support `aria-expanded`.\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-controls={open ? calendarId : undefined}\n autoComplete=\"off\"\n spellCheck={false}\n value={text}\n onFocus={() => openPicker()}\n onMouseDown={() => openPicker()}\n onChange={(event) => {\n const typed = event.target.value;\n setDraft(typed);\n if (typed.trim() === \"\") {\n commit(undefined);\n return;\n }\n const parsed = parseDateText(typed, locales);\n if (parsed) {\n commit(clampTime(parsed, time));\n // Follow the words: the calendar shows what was typed.\n setMonth(parsed);\n }\n }}\n onBlur={() => setDraft(null)}\n onKeyDown={(event) => {\n if (event.key === \"Escape\" && open) {\n event.preventDefault();\n setDraft(null);\n setOpen(false);\n return;\n }\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n // Hand the caret to the grid, where the arrows mean days.\n const grid = popupRef.current?.querySelector<HTMLElement>(\n \"td[data-day] button[tabindex='0']\",\n );\n if (grid) {\n grid.focus();\n return;\n }\n // Closed: the grid is not mounted yet, so the calendar takes\n // the caret itself as it appears — one press, not two.\n openPicker(true);\n }\n }}\n // Typed fields use `size`, not `field-sizing: content` — that\n // sizes from the current content and ignores `size` outright,\n // so a one-letter draft collapsed the field to 20px against\n // the shape to type. A span cannot be typed, so it hugs the\n // glyphs on screen (`Last 30 minutes`, not sixteen `M`s).\n size={width === \"hug\" && !hugToWords ? hugChars : undefined}\n className={cn(\n \"text-pho-primary placeholder:text-pho-placeholder bg-transparent outline-none\",\n hugToWords\n ? \"field-sizing-content w-auto min-w-min\"\n : width === \"hug\"\n ? \"min-w-0\"\n : \"min-w-0 flex-1\",\n mode === \"range\" && \"cursor-pointer\",\n )}\n />\n </div>\n\n <Popover.Portal>\n <Popover.Positioner anchor={fieldRef} align={align} sideOffset={6}>\n {/* Two months on a phone are taller than the room under the\n field; cap the popup at what Base UI measured and let it\n scroll rather than running off the screen. */}\n <Popover.Popup\n ref={popupRef}\n id={calendarId}\n // The field keeps the caret: the viewer is mid-word, and the\n // calendar is a second way to answer, not a takeover.\n initialFocus={false}\n finalFocus={false}\n className=\"max-h-[var(--available-height)] overflow-y-auto p-3\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row\">\n {presets?.length ? (\n // Beside the calendar where there is room, above it on a\n // phone, where a row that scrolls sideways costs no height.\n <div\n // A labelled set of buttons, not a form section.\n // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role\n role=\"group\"\n aria-label=\"Presets\"\n className={cn(\n \"flex shrink-0 gap-1 overflow-x-auto\",\n \"sm:border-pho-secondary sm:w-36 sm:flex-col sm:gap-0.5 sm:overflow-visible sm:border-r sm:pr-3\",\n )}\n >\n {presets.map((preset) => (\n <button\n key={preset.label}\n type=\"button\"\n aria-pressed={preset.label === presetLabel}\n onClick={() => pickPreset(preset)}\n className={cn(\n PRESET,\n preset.label === presetLabel && PRESET_ON,\n )}\n >\n {preset.label}\n </button>\n ))}\n </div>\n ) : null}\n\n <div>\n {mode === \"range\" ? (\n <Calendar\n {...calendarProps}\n mode=\"range\"\n min={minDays}\n max={maxDays}\n month={shownMonth}\n onMonthChange={setMonth}\n // DayPicker's own prop, not the DOM attribute.\n // oxlint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={gridFocus}\n selected={range}\n onSelect={(next, clicked) => {\n const first = picks.current === 0;\n picks.current += 1;\n // Reopened on a span that is already settled: the first\n // click starts a new one. DayPicker would otherwise drag\n // the nearer end over, so asking for Sep 20 – 25 on top\n // of Sep 1 – 8 would land on Sep 1 – 25.\n if (first && range?.to) {\n const day = clampTime(\n withDay(clicked, time ? range.from : undefined),\n time,\n );\n commit({ from: day, to: new Date(day) });\n setDraft(null);\n return;\n }\n const kept = next && {\n from:\n next.from &&\n clampTime(\n withDay(\n next.from,\n time ? range?.from : undefined,\n ),\n time,\n ),\n to:\n next.to &&\n clampTime(\n withDay(next.to, time ? range?.to : undefined),\n time,\n ),\n };\n commit(kept);\n setDraft(null);\n // Second pick, and the question is answered either way:\n // both ends down, or the same day twice, which DayPicker\n // reads as clearing the span. Unless a time is still to\n // be set, which lives below.\n if (\n !time &&\n picks.current >= 2 &&\n (!kept || (kept.from && kept.to))\n ) {\n setOpen(false);\n }\n }}\n />\n ) : (\n <Calendar\n {...calendarProps}\n mode=\"single\"\n month={shownMonth}\n onMonthChange={setMonth}\n // oxlint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={gridFocus}\n selected={single}\n onSelect={(next) => {\n commit(\n next &&\n clampTime(\n withDay(next, time ? single : undefined),\n time,\n ),\n );\n setDraft(null);\n // The clock is still to be set, and it is below.\n if (!time) setOpen(false);\n }}\n />\n )}\n\n {time ? (\n <div className=\"border-pho-secondary mt-3 grid grid-cols-[auto_1fr] items-center gap-x-3 gap-y-2 border-t pt-3\">\n {mode === \"range\" ? (\n <>\n <ClockField\n label=\"From\"\n value={range?.from}\n time={time}\n onChange={(clock) => {\n if (!range?.from) return;\n const next = fromInputValue(\n `${toDateValue(range.from)}T${clock}`,\n );\n if (next) {\n commit({\n ...range,\n from: clampTime(next, time),\n });\n }\n }}\n disabled={!range?.from}\n />\n <ClockField\n label=\"To\"\n value={range?.to}\n time={time}\n onChange={(clock) => {\n if (!range?.to) return;\n const next = fromInputValue(\n `${toDateValue(range.to)}T${clock}`,\n );\n if (next) {\n commit({\n ...range,\n to: clampTime(next, time),\n });\n }\n }}\n disabled={!range?.to}\n />\n </>\n ) : (\n <ClockField\n label=\"Time\"\n value={single}\n time={time}\n onChange={(clock) => {\n if (!single) return;\n const next = fromInputValue(\n `${toDateValue(single)}T${clock}`,\n );\n if (next) commit(clampTime(next, time));\n }}\n disabled={!single}\n />\n )}\n </div>\n ) : null}\n </div>\n </div>\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n )}\n\n {hint ? (\n <p\n id={hintId}\n className={cn(\n \"text-pho-description text-base\",\n invalid && \"text-pho-error\",\n )}\n >\n {hint}\n </p>\n ) : null}\n </div>\n );\n}\n\nDatePicker.displayName = \"DatePicker\";"],"x_google_ignoreList":[0],"mappings":";;;;;;;AASA,IAAM,KAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAkF,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAW,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAU,KAAO;A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,CAAA;AAAA,QACG,CAAA,EACN,CAAA,CACJ;AAAA;MAGf,IACC,gBAAA,EAAC,KAAD;AAAA,QACE,IAAI;AAAA,QACJ,WAAW,EACT,kCACA,KAAW,gBACb;AAAA,QAEC,UAAA;AAAA,MACA,CAAA,IACD;AAAA,IACD;AAAA;AAET;AAEA,GAAW,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"description-list-BRRQ0oF6.js","names":[],"sources":["../../src/components/description-list/description-list.tsx"],"sourcesContent":["import {\n createContext,\n useContext,\n type ComponentProps,\n type ReactNode,\n type Ref,\n} from \"react\";\nimport { CopyButton } from \"../copy-button\";\nimport { cn } from \"../../utils/cn\";\n\n/**\n * Description List — the facts about one record, label beside value:\n * the status, the request id, the time, the ip, the api version, the\n * idempotency key, the api key. A `<dl>` under the hood.\n *\n * Where `BasicPage.Row` is a 68px row built for a control on its right,\n * these are dense lines of text: `inline` puts the label in a column\n * beside the value, every label the same width (a subgrid), one line per\n * fact; `stacked` puts the label above the value and flows the pairs\n * into `columns`. A `mono` value wears the mono face with a copy\n * control after it; a value that is not there says so in muted ink.\n */\n\nexport type DescriptionListLayout = \"inline\" | \"stacked\";\n\nconst LayoutContext = createContext<DescriptionListLayout>(\"inline\");\n\nexport interface DescriptionListRootProps extends ComponentProps<\"dl\"> {\n /**\n * `inline` (default): label column beside the value column, one line\n * per item. `stacked`: label above value, pairs flowing into `columns`.\n */\n layout?: DescriptionListLayout;\n /** For `stacked`: pairs per row from `sm` up. @default 1 */\n columns?: 1 | 2 | 3;\n ref?: Ref<HTMLDListElement>;\n}\n\nconst COLUMNS: Record<1 | 2 | 3, string> = {\n 1: \"\",\n 2: \"sm:grid-cols-2\",\n 3: \"sm:grid-cols-3\",\n};\n\nfunction Root({\n layout = \"inline\",\n columns = 1,\n className,\n ...props\n}: DescriptionListRootProps) {\n return (\n <LayoutContext.Provider value={layout}>\n <dl\n data-description-list={layout}\n className={cn(\n \"m-0 grid min-w-0\",\n layout === \"inline\"\n ? \"grid-cols-[minmax(0,auto)_minmax(0,1fr)] gap-x-6\"\n : cn(\"gap-x-6 gap-y-3\", COLUMNS[columns]),\n className,\n )}\n {...props}\n />\n </LayoutContext.Provider>\n );\n}\n\nexport interface DescriptionListItemProps extends Omit<\n ComponentProps<\"div\">,\n \"children\" | \"title\"\n> {\n /** The fact's name — \"Request ID\", \"Idempotency key\". */\n label: ReactNode;\n /** The fact. A string wears the item's type; a node is yours to style. */\n value?: ReactNode;\n /** Composed content instead of `value` — a `Badge`, a link. */\n children?: ReactNode;\n /** The value in the mono face — ids, keys, addresses. */\n mono?: boolean;\n /**\n * A copy control after the value, and a click on the value copies\n * too. `true` copies a string `value`; pass the text to copy when the\n * value is composed.\n */\n copy?: boolean | string;\n /** Marks the label `(Optional)` — a fact that may not be there. */\n optional?: boolean;\n /** What an absent value says. @default \"Not set\" */\n empty?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nfunction Item({\n label,\n value,\n children,\n mono,\n copy,\n optional,\n empty = \"Not set\",\n className,\n ...props\n}: DescriptionListItemProps) {\n const layout = useContext(LayoutContext);\n const content = children ?? value;\n const absent = content == null || content === \"\" || content === false;\n const copyText =\n typeof copy === \"string\"\n ? copy\n : copy && typeof value === \"string\"\n ? value\n : null;\n // Verbatim: \"Copy Trace ID\" reads the acronym, \"Copy Meta number ID\" the brand.\n const copyLabel = typeof label === \"string\" ? label : \"value\";\n // An id keeps its line and truncates; prose wraps, in its own face\n // over the copy view's mono default.\n const shown = (\n <span\n className={cn(\n \"min-w-0\",\n mono\n ? \"truncate\"\n : \"font-sans text-base [overflow-wrap:anywhere] whitespace-normal\",\n )}\n >\n {content}\n </span>\n );\n return (\n <div\n data-description-item=\"\"\n data-empty={absent || undefined}\n className={cn(\n \"min-w-0\",\n layout === \"inline\"\n ? \"col-span-2 grid grid-cols-subgrid items-baseline py-1\"\n : \"flex flex-col gap-0.5\",\n className,\n )}\n {...props}\n >\n <dt className=\"text-pho-description min-w-0 text-base [overflow-wrap:anywhere]\">\n {label}\n {optional ? (\n <span className=\"text-pho-placeholder\"> (Optional)</span>\n ) : null}\n </dt>\n <dd\n className={cn(\n \"m-0 flex min-w-0 items-center gap-1\",\n absent\n ? \"text-pho-placeholder text-base\"\n : mono\n ? \"text-pho-primary font-mono text-xs\"\n : \"text-pho-primary text-base\",\n )}\n >\n {absent ? (\n <span className=\"truncate\">{empty}</span>\n ) : copyText != null && copyText !== \"\" ? (\n // The value is the copy control's too: a click on it copies.\n <CopyButton\n value={copyText}\n label={copyLabel}\n size=\"xs\"\n className=\"-my-1\"\n >\n {shown}\n </CopyButton>\n ) : (\n shown\n )}\n </dd>\n </div>\n );\n}\n\n/**\n * ```tsx\n * <DescriptionList.Root>\n * <DescriptionList.Item label=\"Status\"><Badge …/></DescriptionList.Item>\n * <DescriptionList.Item label=\"Request ID\" value=\"pho_req_…\" mono copy />\n * <DescriptionList.Item label=\"Idempotency key\" optional mono copy />\n * </DescriptionList.Root>\n * ```\n */\nexport const DescriptionList = { Root, Item };\n"],"mappings":";;;;;AAyBA,IAAM,IAAgB,EAAqC,QAAQ,GAa7D,IAAqC;AAAA,EACzC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,SAAS,EAAK,EACZ,QAAA,IAAS,UACT,SAAA,IAAU,GACV,WAAA,GACA,GAAG,EAAA,GACwB;AAC3B,SACE,gBAAA,EAAC,EAAc,UAAf;AAAA,IAAwB,OAAO;AAAA,IAC7B,UAAA,gBAAA,EAAC,MAAD;AAAA,MACE,yBAAuB;AAAA,MACvB,WAAW,EACT,oBACA,MAAW,WACP,qDACA,EAAG,mBAAmB,EAAQ,CAAA,CAAQ,GAC1C,CACF;AAAA,MACA,GAAI;AAAA,IACL,CAAA;AAAA,EACqB,CAAA;AAE5B;AA2BA,SAAS,EAAK,EACZ,OAAA,GACA,OAAA,GACA,UAAA,GACA,MAAA,GACA,MAAA,GACA,UAAA,GACA,OAAA,IAAQ,WACR,WAAA,GACA,GAAG,EAAA,GACwB;AAC3B,QAAM,IAAS,EAAW,CAAa,GACjC,IAAU,KAAY,GACtB,IAAS,KAAW,QAAQ,MAAY,MAAM,MAAY,IAC1D,IACJ,OAAO,KAAS,WACZ,IACA,KAAQ,OAAO,KAAU,WACvB,IACA,MAEF,IAAY,OAAO,KAAU,WAAW,IAAQ,SAGhD,IACJ,gBAAA,EAAC,QAAD;AAAA,IACE,WAAW,EACT,WACA,IACI,aACA,gEACN;AAAA,IAEC,UAAA;AAAA,EACG,CAAA;AAER,SACE,gBAAA,EAAC,OAAD;AAAA,IACE,yBAAsB;AAAA,IACtB,cAAY,KAAU;AAAA,IACtB,WAAW,EACT,WACA,MAAW,WACP,0DACA,yBACJ,CACF;AAAA,IACA,GAAI;AAAA,IAVN,UAAA,CAYE,gBAAA,EAAC,MAAD;AAAA,MAAI,WAAU;AAAA,MAAd,UAAA,CACG,GACA,IACC,gBAAA,EAAC,QAAD;AAAA,QAAM,WAAU;AAAA,QAAuB,UAAA;AAAA,MAAiB,CAAA,IACtD,IACF;AAAA,IACJ,CAAA,GAAA,gBAAA,EAAC,MAAD;AAAA,MACE,WAAW,EACT,uCACA,IACI,mCACA,IACE,uCACA,4BACR;AAAA,MAEC,UAAA,IACC,gBAAA,EAAC,QAAD;AAAA,QAAM,WAAU;AAAA,QAAY,UAAA;AAAA,MAAY,CAAA,IACtC,KAAY,QAAQ,MAAa,KAEnC,gBAAA,EAAC,GAAD;AAAA,QACE,OAAO;AAAA,QACP,OAAO;AAAA,QACP,MAAK;AAAA,QACL,WAAU;AAAA,QAET,UAAA;AAAA,MACS,CAAA,IAEZ;AAAA,IAEA,CAAA,CACD;AAAA;AAET;AAWA,IAAa,IAAkB;AAAA,EAAE,MAAA;AAAA,EAAM,MAAA;AAAK"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dialog-12foDiQb.js","names":[],"sources":["../../src/components/dialog/dialog.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentProps,\n type ElementType,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n} from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { AnimatedHeight } from \"../../utils/animated-height\";\nimport { cn } from \"../../utils/cn\";\nimport { ScrollArea } from \"../scroll-area\";\nimport { Button, type ButtonProps } from \"../button/button\";\nimport { CloseButton } from \"../button/close-button\";\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\n/* ========================== Async pending context ========================== */\n\n/** Imperative actions exposed by Base UI's `actionsRef`. */\ninterface RootActions {\n unmount: () => void;\n close: () => void;\n}\n\ninterface DialogPendingContextValue {\n /** True while a `Dialog.Action` promise is in flight. */\n pending: boolean;\n beginPending: () => void;\n endPending: () => void;\n /** Close the dialog imperatively (used by `Dialog.Action` on resolve). */\n close: () => void;\n}\n\nconst DialogPendingContext = createContext<DialogPendingContextValue | null>(\n null,\n);\n\n/**\n * Whether the surrounding dialog has a `Dialog.Action` promise in flight —\n * use it to disable secondary actions (Cancel etc.) while work is pending.\n * Returns `false` outside a `Dialog.Root`.\n */\nexport function useDialogPending(): boolean {\n return useContext(DialogPendingContext)?.pending ?? false;\n}\n\ntype RootProps = ComponentProps<typeof BaseDialog.Root>;\n\n/**\n * `Dialog.Root` with async awareness: while a `Dialog.Action` promise is\n * pending, every close request (outside press, Escape, `Dialog.Close`) is\n * cancelled so the dialog stays open until the work settles. Props pass\n * through to Base UI's `Dialog.Root` unchanged.\n */\nfunction Root({ onOpenChange, actionsRef, ...props }: RootProps) {\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 const internalActionsRef = useRef<RootActions | null>(null);\n\n // Keep a caller-supplied actionsRef working alongside our internal one.\n useEffect(() => {\n if (!actionsRef) return;\n actionsRef.current = internalActionsRef.current;\n return () => {\n actionsRef.current = null;\n };\n }, [actionsRef]);\n\n const handleOpenChange = useCallback<NonNullable<RootProps[\"onOpenChange\"]>>(\n (open, eventDetails) => {\n if (!open && pendingRef.current) {\n eventDetails.cancel();\n return;\n }\n onOpenChange?.(open, eventDetails);\n },\n [onOpenChange],\n );\n\n const contextValue = useMemo<DialogPendingContextValue>(\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 }),\n [pending],\n );\n\n return (\n <DialogPendingContext.Provider value={contextValue}>\n <BaseDialog.Root\n actionsRef={internalActionsRef}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </DialogPendingContext.Provider>\n );\n}\n\nconst Trigger = BaseDialog.Trigger;\nconst Portal = BaseDialog.Portal;\nconst Close = BaseDialog.Close;\n\n/* ============================== Dialog.Action ============================== */\n\nexport interface DialogActionProps extends Omit<ButtonProps, \"onClick\"> {\n /**\n * Confirm handler. Return a promise to keep the dialog open while it runs:\n * the button shows `loading`, all dismissal is locked, and the dialog\n * closes when the promise resolves. On rejection the dialog stays open —\n * surface errors inside the handler. A non-promise return closes\n * immediately, like `Dialog.Close`.\n */\n onClick?: (\n event: ReactMouseEvent<HTMLButtonElement>,\n ) => void | Promise<unknown>;\n}\n\nfunction isThenable(value: unknown): value is Promise<unknown> {\n return (\n value != null && typeof (value as { then?: unknown }).then === \"function\"\n );\n}\n\n/**\n * The confirm button of an action row, with native promise support — a\n * `Button` that runs its (possibly async) `onClick` and closes the dialog\n * when the work settles successfully.\n */\nfunction Action({ onClick, loading, disabled, ...props }: DialogActionProps) {\n const pendingContext = useContext(DialogPendingContext);\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 function handleClick(event: ReactMouseEvent<HTMLButtonElement>) {\n if (busy || loading) return;\n const result = onClick?.(event);\n if (!isThenable(result)) {\n pendingContext?.close();\n return;\n }\n setBusy(true);\n pendingContext?.beginPending();\n result.then(\n () => {\n pendingContext?.endPending();\n if (mountedRef.current) setBusy(false);\n 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(\"Dialog.Action: async onClick rejected —\", error);\n }\n },\n );\n }\n\n const inert = busy || loading;\n return (\n <Button\n {...props}\n disabled={disabled || inert}\n loading={inert}\n onClick={handleClick}\n />\n );\n}\n\nfunction Backdrop({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Backdrop>) {\n return (\n <BaseDialog.Backdrop\n className={cn(\n \"bg-pho-overlay fixed inset-0 z-50 transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n // Floating layer: bg-pho-primary + border-pho-secondary hairline, elevation kept.\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed top-1/2 left-1/2 z-50 w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg border outline-none\",\n // Global height cap — the inset panel's footprint (inset-4 /\n // sm:inset-8). A flex column so the body region can shrink and\n // scroll while header and actions stay pinned.\n \"flex max-h-[calc(100dvh-2rem)] flex-col sm:max-h-[calc(100dvh-4rem)]\",\n // Opacity + scale only — leave translate centering alone (no transition-all).\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Title({ className, ...props }: StyledProps<typeof BaseDialog.Title>) {\n return (\n <BaseDialog.Title\n className={cn(\n \"text-pho-primary font-display text-display-sm font-medium text-balance\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Description({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Description>) {\n return (\n <BaseDialog.Description\n className={cn(\n \"text-pho-description text-display-xs font-normal\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Header icon chrome: secondary ink, a hair of extra air before the title.\n * Panel dialogs use 32px (`size-8`); fullscreen gates step up to 48px\n * (`size-12`) so the glyph reads at viewport scale.\n */\nfunction DialogHeaderIcon({\n children,\n size = \"md\",\n}: {\n children: ReactNode;\n size?: \"md\" | \"lg\";\n}) {\n return (\n <span\n aria-hidden\n className={cn(\n \"text-pho-secondary mb-1\",\n size === \"lg\" ? \"[&>svg]:size-12\" : \"[&>svg]:size-8\",\n )}\n >\n {children}\n </span>\n );\n}\n\ninterface ContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — typically a Tabler outline icon.\n * Rendered aria-hidden in secondary ink at 32px (`[&>svg]:size-8`). Pass a\n * styled node to override the ink; the size is owned by the slot.\n */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Consequence bullets rendered as a list at the top of the body — one item\n * per outcome (what is deleted, what survives, who loses access). Use on\n * destructive confirms where the one-line description undersells the\n * impact; keep each item to a single short sentence. Wrap the load-bearing\n * figure in `<strong>` (\"<strong>3 members</strong> lose access\") — the\n * list styles it (secondary ink, medium weight); no classes needed.\n */\n consequences?: ReactNode[];\n /**\n * Final cautionary line under `consequences` — error ink at description\n * size (e.g. \"It cannot be undone. Please be certain.\"). Reserve it for\n * irreversible actions; keep it short.\n */\n warning?: ReactNode;\n /**\n * Footer action row (Cancel / Confirm, etc.). Iron rule: when `actions` is\n * set, the header close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * A quiet footnote at the panel's foot — the limit, cost or policy that\n * frames the decision without being it (\"You may change these up to five\n * times a week.\"). Description ink at `text-xs`, at the action row's\n * start with the actions at its end; when the row runs short of room it\n * takes a line of its own above them. One short sentence.\n */\n caption?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience panel: renders the portal, backdrop, and styled popup with an\n * optional header (title/description + close) and optional action row. For\n * full control, compose the parts directly (`Dialog.Portal` /\n * `Dialog.Backdrop` / `Dialog.Popup`).\n */\nfunction Content({\n icon,\n title,\n description,\n consequences,\n warning,\n actions,\n caption,\n showClose = true,\n children,\n className,\n ...props\n}: ContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n const hasConsequences = consequences != null && consequences.length > 0;\n // The scrollable middle region — actions stay pinned below it.\n const hasScrollBody = hasConsequences || warning != null || children != null;\n\n return (\n <Portal>\n <Backdrop />\n <Popup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n // Title row height = title only. Close is out of flow, centered\n // on the row, and may paint outside it (no clip, no stretch).\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {hasScrollBody && (\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"flex flex-col gap-5 px-6 py-5\">\n {hasConsequences && (\n <ul className=\"text-pho-description text-md [&_strong]:text-pho-secondary space-y-1 [&_strong]:font-medium\">\n {consequences.map((item, index) => (\n // Hand-drawn marker: a 4px dot on the first line's center —\n // quieter than the browser disc, ink tracks the text.\n <li\n key={index}\n className=\"relative pl-4 before:absolute before:top-2.5 before:left-1 before:size-1 before:rounded-full before:bg-current\"\n >\n {item}\n </li>\n ))}\n </ul>\n )}\n {warning != null && (\n <p className=\"text-pho-error text-display-xs font-medium\">\n {warning}\n </p>\n )}\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n )}\n {(actions != null || caption != null) && (\n <div\n className={cn(\n \"flex shrink-0 flex-wrap items-center justify-end gap-x-2 gap-y-3 px-6 pb-5\",\n !hasScrollBody && \"pt-5\",\n )}\n >\n {caption != null && (\n // Grows into the row's free width, never under 12rem: below\n // that it wraps to a line of its own above the actions.\n <p\n data-dialog-caption=\"\"\n className=\"text-pho-description min-w-48 flex-1 pr-2 text-xs\"\n >\n {caption}\n </p>\n )}\n {actions}\n </div>\n )}\n </Popup>\n </Portal>\n );\n}\n\n/* =========================== Dialog.InsetContent =========================== */\n\n/**\n * Near-fullscreen popup — the viewport minus a breathing ring, floating over\n * a backdrop (the page stays visible through the gap, so it dims like any\n * floating layer). Still a card: border, elevation, rounded corners; the\n * scale gesture stays but shrinks to 98% — at this size 95% reads like a jump.\n */\nfunction InsetPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"border-pho-secondary bg-pho-primary shadow-pho-xl fixed inset-4 z-50 flex flex-col overflow-hidden rounded-lg border outline-none sm:inset-8\",\n \"transition-[opacity,scale] duration-200 ease-out\",\n \"data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[ending-style]:duration-150\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface InsetContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /** Decorative icon above the title — same treatment as `Content`. */\n icon?: ReactNode;\n /** Heading rendered in the panel header. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Bottom action row. Iron rule as `Content`: when `actions` is set, the\n * header close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Header close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Convenience near-fullscreen panel: header pinned on top, body filling and\n * scrolling on its own, optional action row pinned at the bottom. Sits\n * between `Content` (a focused card) and `FullscreenContent` (a page\n * takeover): use it for roomy working surfaces — pickers, editors, previews —\n * that still want the page peeking through an edge.\n */\nfunction InsetContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n children,\n className,\n ...props\n}: InsetContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a header X.\n const showCloseButton = actions == null && showClose;\n const hasHeader = Boolean(icon || title || description || showCloseButton);\n\n return (\n <Portal>\n <Backdrop />\n <InsetPopup className={className} {...props}>\n {hasHeader && (\n <div className=\"flex shrink-0 flex-col gap-1 px-6 pt-6\">\n {icon && <DialogHeaderIcon>{icon}</DialogHeaderIcon>}\n {(title || showCloseButton) && (\n <div className=\"relative\">\n {title ? (\n <Title className={showCloseButton ? \"pr-12\" : undefined}>\n {title}\n </Title>\n ) : (\n <div className=\"h-[1.625rem]\" aria-hidden=\"true\" />\n )}\n {showCloseButton && (\n <Close\n render={\n <CloseButton className=\"absolute top-1/2 right-0 z-10 -translate-y-1/2\" />\n }\n />\n )}\n </div>\n )}\n {description && <Description>{description}</Description>}\n </div>\n )}\n <ScrollArea.Root className=\"min-h-0 flex-1\">\n <ScrollArea.Viewport>\n <ScrollArea.Content className=\"px-6 py-5\">\n {children}\n </ScrollArea.Content>\n </ScrollArea.Viewport>\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Root>\n {actions != null && (\n <div className=\"flex shrink-0 items-center justify-end gap-2 px-6 pb-5\">\n {actions}\n </div>\n )}\n </InsetPopup>\n </Portal>\n );\n}\n\n/* ========================= Dialog.FullscreenContent ======================== */\n\n/**\n * Full-viewport popup — a page-surface takeover instead of a floating card.\n * No backdrop: the popup itself is the layer. Fade only; scale is a floating-\n * card gesture and reads wrong at viewport size.\n */\nfunction FullscreenPopup({\n className,\n ...props\n}: StyledProps<typeof BaseDialog.Popup>) {\n return (\n <BaseDialog.Popup\n className={cn(\n \"bg-pho-page fixed inset-0 z-50 overflow-y-auto outline-none\",\n \"transition-opacity duration-200 ease-out\",\n \"data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\ninterface FullscreenContentProps extends Omit<\n StyledProps<typeof BaseDialog.Popup>,\n \"title\"\n> {\n /**\n * Decorative icon above the title — same chrome as `Content`, but 48px\n * (`size-12`) for viewport-scale gates.\n */\n icon?: ReactNode;\n /** Heading of the takeover. */\n title?: ReactNode;\n /** Supporting text under the title. */\n description?: ReactNode;\n /**\n * Action row under the body. Iron rule as `Content`: when `actions` is set,\n * the corner close button is never shown — dismiss via the actions.\n */\n actions?: ReactNode;\n /**\n * Corner close control. Only applies when `actions` is absent.\n * @default true\n */\n showClose?: boolean;\n /**\n * Classes on the viewport-centering frame (the `min-h-full` flex host).\n * Use to drop the default optical `pb-20` when the stack grows (e.g. a\n * captcha) so true center stays put: `frameClassName=\"pb-6\"`.\n */\n frameClassName?: string;\n children?: ReactNode;\n}\n\n/**\n * Convenience full-screen panel: the whole viewport becomes the dialog, with\n * a centered column at the standalone-flow width (28rem — the same measure as\n * onboarding / invite cards). Column height follows its content through\n * `AnimatedHeight` (same spring as the Card shell), so step swaps — phone →\n * OTP → captcha — glide instead of jumping. Use for gates the visitor must\n * deal with before the page behind makes sense (e.g. binding a phone number);\n * prefer `Content` for everything conversational.\n */\nfunction FullscreenContent({\n icon,\n title,\n description,\n actions,\n showClose = true,\n frameClassName,\n children,\n className,\n ...props\n}: FullscreenContentProps) {\n // Iron rule: action dialogs dismiss via their actions — never a corner X.\n const showCloseButton = actions == null && showClose;\n\n return (\n <Portal>\n <FullscreenPopup className={className} {...props}>\n {showCloseButton && (\n <Close\n render={<CloseButton className=\"fixed top-4 right-4 z-10\" />}\n />\n )}\n {/* Default `pb-20` optically lifts the column above true center. */}\n <div\n className={cn(\n \"flex min-h-full items-center justify-center px-6 pt-6 pb-20\",\n frameClassName,\n )}\n >\n {/* Width stays on the outer host; AnimatedHeight measures the\n header + body stack and springs its own height on content\n changes. The action row sits below it, outside the clip: while\n the body grows the container is shorter than its content for a\n few frames, and a row inside it would be cut off at the bottom\n (a pressed \"Send code\" turning grey right as a captcha mounts).\n Outside, the row rides the spring instead. */}\n <div className=\"w-full max-w-md\">\n <AnimatedHeight className=\"flex flex-col gap-5\">\n {(icon || title || description) && (\n <div className=\"flex flex-col gap-1\">\n {icon && (\n <DialogHeaderIcon size=\"lg\">{icon}</DialogHeaderIcon>\n )}\n {title && <Title>{title}</Title>}\n {description && <Description>{description}</Description>}\n </div>\n )}\n {children}\n </AnimatedHeight>\n {actions != null && (\n <div className=\"mt-5 flex items-center justify-end gap-2\">\n {actions}\n </div>\n )}\n </div>\n </div>\n </FullscreenPopup>\n </Portal>\n );\n}\n\n/**\n * Modal dialog built on Base UI `Dialog`. Controlled or uncontrolled via\n * `Dialog.Root` (`open` / `onOpenChange` / `defaultOpen`). `Dialog.Action`\n * adds native promise support: an async confirm keeps the dialog open and\n * undismissable until the work resolves.\n */\nexport const Dialog = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Popup,\n InsetPopup,\n FullscreenPopup,\n Title,\n Description,\n Close,\n Action,\n Content,\n InsetContent,\n FullscreenContent,\n};\n"],"mappings":";;;;;;;;;AA6CA,IAAM,IAAuB,EAC3B,IACF;AAOA,SAAgB,KAA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,GAAD;AAAA,gBAAkB,MAAK;AAAA,gBAAM,UAAA;AAAA,cAAuB,CAAA;AAAA,cAErD,KAAS,gBAAA,EAAC,GAAD,EAAA,UAAQ,EAAa,CAAA;AAAA,cAC9B,KAAe,gBAAA,EAAC,GAAD,EAAA,UAAc,EAAyB,CAAA;AAAA,YACpD;AAAA,UAEN,CAAA,GAAA,CACa;AAAA,QACf,CAAA,GAAA,KAAW,QACV,gBAAA,EAAC,OAAD;AAAA,UAAK,WAAU;AAAA,UACZ,UAAA;AAAA,QACE,CAAA,CAEJ;AAAA;IACF,CAAA,CACU;AAAA,EACX,CAAA,EAAA,CAAA;AAEZ;AAQA,IAAa,KAAS;AAAA,EACpB,MAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,OAAA;AAAA,EACA,YAAA;AAAA,EACA,iBAAA;AAAA,EACA,OAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,mBAAA;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-D5SzZ0ev.js","names":[],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconAlertTriangle.mjs","../../src/components/error/problem.ts","../../src/components/error/error.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.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\": \"M12 9v4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 16h.01\", \"key\": \"svg-2\" }]];\nconst IconAlertTriangle = createReactComponent(\"outline\", \"alert-triangle\", \"AlertTriangle\", __iconNode);\n\nexport { __iconNode, IconAlertTriangle as default };\n//# sourceMappingURL=IconAlertTriangle.mjs.map\n","/**\n * Client-side mirror of the `@photon-hq/error` response contract — the\n * RFC 9457 Problem Details body every Photon service returns for 4xx / 5xx.\n * Machine logic branches on `code`; `title` / `detail` / `remediation` are\n * the human-readable copy, already reviewed server-side and safe to render.\n *\n * Fetch layers may also hand us a thin status-only shape when the response\n * was not ok but the body was not a contract problem — `title` + `status`\n * still count so the UI can disclose the HTTP code we already know.\n */\n\nexport interface ProblemRemediation {\n /** What the user can do about it — a full sentence. */\n action?: string;\n /** Docs URL explaining the problem. */\n documentation?: string;\n}\n\nexport interface Problem {\n /** Stable machine-readable key (`RATE_LIMITED`) — the field to branch on. */\n code?: string;\n /** Human summary of the problem type (\"Too Many Requests\"). */\n title: string;\n /** HTTP status (4xx / 5xx). */\n status: number;\n /** Problem type URI (`urn:photon:problem:*` or an https URL). */\n type?: string;\n /** Occurrence-specific human sentence. */\n detail?: string;\n /** Correlation id for support (`X-Request-ID`). */\n requestId?: string;\n remediation?: ProblemRemediation;\n /** RFC 9457 extensions (`issues`, `actualVersion`, …). */\n [extension: string]: unknown;\n}\n\n/** Structural check: `title` + a 4xx/5xx status. `code` is optional. */\nexport function isProblem(value: unknown): value is Problem {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as Record<string, unknown>;\n return (\n typeof v.title === \"string\" &&\n typeof v.status === \"number\" &&\n Number.isInteger(v.status) &&\n v.status >= 400 &&\n v.status <= 599 &&\n (v.code === undefined || typeof v.code === \"string\")\n );\n}\n\n/**\n * Find the problem a caught value carries — the value itself, one typed onto\n * an error as a `problem` field (dashboard's `ApiError` shape), or one\n * wrapped in an `Error` `cause` chain (how fetch layers usually rethrow a\n * parsed body). Returns `null` when there is none.\n */\nexport function parseProblem(error: unknown): Problem | null {\n let current: unknown = error;\n for (\n let depth = 0;\n depth < 8 && typeof current === \"object\" && current !== null;\n depth++\n ) {\n if (isProblem(current)) return current;\n const carried = (current as { problem?: unknown }).problem;\n if (isProblem(carried)) return carried;\n current = (current as { cause?: unknown }).cause;\n }\n return null;\n}\n\nexport interface ErrorDescription {\n /** Short name of the failure — the problem `title`, or a generic fallback. */\n title: string;\n /** Sentence(s) to show — `detail` and `remediation.action` joined. */\n description?: string;\n /** Docs URL from `remediation.documentation`. */\n documentation?: string;\n /** Correlation id for support. */\n requestId?: string;\n /** The matched problem, when the input carried one. */\n problem?: Problem;\n}\n\n/**\n * Anything that isn't a problem renders as this — raw `Error` messages are\n * not contract copy and never shown (the same fail-closed stance as the\n * server side of `@photon-hq/error`). Always a full sentence (trailing\n * period).\n */\nexport const GENERIC_ERROR_TITLE = \"Something went wrong.\";\n\n/** Standard reason phrases for statuses we commonly surface without a body. */\nconst HTTP_REASON_PHRASE: Record<number, string> = {\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 413: \"Payload Too Large\",\n 415: \"Unsupported Media Type\",\n 422: \"Unprocessable Entity\",\n 429: \"Too Many Requests\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n};\n\n/** One-sentence explanations when the server gave a status but no problem copy. */\nconst HTTP_STATUS_EXPLANATION: Record<number, string> = {\n 400: \"The request was malformed or incomplete.\",\n 401: \"You need to sign in again.\",\n 403: \"You don't have permission to do that.\",\n 404: \"The requested resource was not found.\",\n 408: \"The request timed out before the server responded.\",\n 409: \"The request conflicts with the current state.\",\n 410: \"That resource is no longer available.\",\n 413: \"The request was too large for the server to accept.\",\n 415: \"That media type isn't supported.\",\n 422: \"The request was understood but couldn't be processed.\",\n 429: \"Request rate limit exceeded. Wait a moment before trying again.\",\n 500: \"The server hit an unexpected error.\",\n 501: \"The server doesn't support that operation.\",\n 502: \"The gateway got an invalid response from an upstream server.\",\n 503: \"The service is temporarily unavailable.\",\n 504: \"The gateway timed out waiting for an upstream server.\",\n};\n\nfunction hasContractCode(problem: Problem): boolean {\n return typeof problem.code === \"string\" && problem.code !== \"\";\n}\n\n/** Reason phrase for a status — map first, then a non-generic `problem.title`. */\nexport function httpReasonPhrase(\n status: number,\n fallbackTitle?: string,\n): string | undefined {\n if (HTTP_REASON_PHRASE[status]) return HTTP_REASON_PHRASE[status];\n if (\n fallbackTitle &&\n fallbackTitle !== GENERIC_ERROR_TITLE &&\n fallbackTitle !== \"Request failed\"\n ) {\n return fallbackTitle.replace(/\\.$/, \"\");\n }\n return undefined;\n}\n\n/** Human sentence for a bare HTTP status, when the body carried no copy. */\nexport function httpStatusExplanation(status: number): string {\n return (\n HTTP_STATUS_EXPLANATION[status] ??\n \"The request failed with an unexpected status.\"\n );\n}\n\n/**\n * Sentence-case the first character. Server `detail` / `title` sometimes\n * arrive fully lowercase; UI copy always leads with a capital.\n */\nexport function capitalizeFirst(text: string): string {\n if (!text) return text;\n const first = text.charAt(0);\n const upper = first.toUpperCase();\n if (first === upper) return text;\n return upper + text.slice(1);\n}\n\n/**\n * Turn a caught value into displayable copy. `Error` and `ErrorView` call\n * this internally; use it directly for other surfaces (a toast, a banner).\n *\n * Status-only failures (HTTP not ok, but no contract `code` / copy) still\n * keep `problem` so the details panel can show the status. Title becomes the\n * reason phrase (e.g. \"Bad Gateway\"); description is a short explanation —\n * not just the numeric code.\n */\nexport function describeError(error: unknown): ErrorDescription {\n const problem = parseProblem(error);\n if (problem == null) return { title: GENERIC_ERROR_TITLE };\n\n const description =\n [problem.detail, problem.remediation?.action]\n .filter((part): part is string => typeof part === \"string\" && part !== \"\")\n .join(\" \") || undefined;\n\n if (!hasContractCode(problem) && description == null) {\n const reason = httpReasonPhrase(problem.status, problem.title);\n return {\n title: capitalizeFirst(reason ?? GENERIC_ERROR_TITLE),\n description: httpStatusExplanation(problem.status),\n requestId: problem.requestId,\n problem,\n };\n }\n\n return {\n title: capitalizeFirst(problem.title || GENERIC_ERROR_TITLE),\n description: description ? capitalizeFirst(description) : undefined,\n documentation: problem.remediation?.documentation,\n requestId: problem.requestId,\n problem,\n };\n}\n","import {\n useEffect,\n useRef,\n useState,\n type ComponentProps,\n type ReactNode,\n} from \"react\";\nimport {\n IconAlertCircleFilled,\n IconAlertTriangle,\n IconInfoCircle,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button, ButtonLink } from \"../button/button\";\nimport { Popover } from \"../popover/popover\";\nimport { StatusView, type StatusViewSize } from \"../status-view/status-view\";\nimport {\n capitalizeFirst,\n describeError,\n httpReasonPhrase,\n type ErrorDescription,\n} from \"./problem\";\n\n/** Capitalize string copy; leave custom ReactNode overrides alone. */\nfunction displayCopy(value: ReactNode): ReactNode {\n return typeof value === \"string\" ? capitalizeFirst(value) : value;\n}\n\n/**\n * Design notes:\n * - ONE input: `error` is the caught value, whatever it is — a Problem\n * Details body from `@photon-hq/error`, an `Error` carrying one as\n * `cause`, or something unknown. The component derives its copy via\n * `describeError`; unknowns fall back to a generic line rather than\n * leaking raw messages.\n * - TWO presentations, one per altitude: `Error` is the inline line for\n * forms, cards, and action rows; `ErrorView` is the region / page state\n * built on StatusView (same `sm` / `base` size axis).\n * - Both render `null` when there is nothing to show, so they can sit\n * unconditionally in JSX (`<Error error={mutation.error} />`).\n * - Client-side *validation* is not this component's job — that belongs to\n * `Field.Error`, wired to control validity.\n */\n\nconst DOC_LINK_LABEL = \"Learn more\";\nconst RETRY_LABEL = \"Try again\";\n\ninterface ErrorBaseProps {\n /** The caught value — a problem body, an `Error` wrapping one, or unknown. */\n error?: unknown;\n /** Override the derived message. */\n children?: ReactNode;\n}\n\nexport interface ErrorProps\n extends ErrorBaseProps, Omit<ComponentProps<\"div\">, keyof ErrorBaseProps> {}\n\n/**\n * Error — one line of red ink naming a server failure (4xx / 5xx), placed\n * inline: under a form, in a card, beside the action that failed. Give it the\n * caught value and it renders the problem's `detail` (falling back to `title`,\n * then to a generic line), plus a docs link when the problem carries one.\n * Renders nothing while `error` is nullish, so it can stay mounted.\n *\n * For a region or page that failed to load, use {@link ErrorView}.\n */\nexport function Error({ error, children, className, ...props }: ErrorProps) {\n if (error == null && children == null) return null;\n const copy = describeError(error);\n return (\n <div\n role=\"alert\"\n className={cn(\n \"text-pho-error flex min-w-0 items-start gap-1.5 text-base\",\n className,\n )}\n {...props}\n >\n <span aria-hidden className=\"flex h-[1lh] shrink-0 items-center\">\n <IconAlertCircleFilled className=\"size-4\" />\n </span>\n <span className=\"min-w-0\">\n {displayCopy(children ?? copy.description ?? copy.title)}\n {copy.documentation != null && (\n <>\n {\" \"}\n <a\n href={copy.documentation}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"font-medium underline underline-offset-2\"\n >\n {DOC_LINK_LABEL}\n </a>\n </>\n )}\n {/* Trailing whitespace collapses when the details render null. */}{\" \"}\n <ErrorDetails copy={copy} />\n </span>\n </div>\n );\n}\n\nError.displayName = \"Error\";\n\n/**\n * Hover / focus disclosure on the inline line — the request's fuller story:\n * problem `title` (with the same alert icon + `text-pho-error` ink as the\n * inline line), the untruncated description, then `status` + `code` and the\n * copyable request id grouped below for a support handoff. Renders only when\n * the caught value actually carried a problem (or at least a request id); a\n * generic unknown has nothing more to disclose. Built on `Popover` rather\n * than `Tooltip` because the panel holds an interactive control (the copy\n * button) — `openOnHover` keeps the tooltip-like gesture.\n */\nfunction ErrorDetails({ copy }: { copy: ErrorDescription }) {\n const { problem, requestId } = copy;\n if (problem == null && requestId == null) return null;\n\n // Contract problems show `status CODE`; status-only shows `status Reason`.\n let statusLine: string | null = null;\n if (problem != null) {\n if (problem.code) {\n statusLine = `${problem.status} ${problem.code}`;\n } else {\n const reason = httpReasonPhrase(problem.status, problem.title);\n statusLine = reason\n ? `${problem.status} ${reason}`\n : String(problem.status);\n }\n }\n\n return (\n <Popover.Root>\n <Popover.Trigger\n openOnHover\n delay={150}\n aria-label=\"Error details\"\n className=\"outline-pho-brand inline-flex size-4 shrink-0 translate-y-[3px] cursor-help items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-2\"\n >\n <IconInfoCircle className=\"size-3.5\" />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Positioner align=\"start\">\n <Popover.Popup className=\"text-pho-error\">\n <Popover.Title className=\"text-pho-error flex items-start gap-1.5\">\n <span aria-hidden className=\"flex h-[1lh] shrink-0 items-center\">\n <IconAlertCircleFilled className=\"size-4\" />\n </span>\n {copy.title}\n </Popover.Title>\n {copy.description != null && (\n <Popover.Description className=\"text-pho-error\">\n {copy.description}\n </Popover.Description>\n )}\n {(statusLine != null || requestId != null) && (\n <div className=\"text-pho-error mt-1 font-mono text-[10px] leading-snug\">\n {statusLine != null && <p>{statusLine}</p>}\n {requestId != null && (\n <RequestId requestId={requestId} className=\"mt-0\" />\n )}\n </div>\n )}\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n\n/** Request-id footnote — click copies the id for support handoff. */\nfunction RequestId({\n requestId,\n className,\n}: {\n requestId: string;\n className?: string;\n}) {\n const [copied, setCopied] = useState(false);\n const copiedTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(\n () => () => {\n if (copiedTimer.current) clearTimeout(copiedTimer.current);\n },\n [],\n );\n\n return (\n <span\n className={cn(\"mt-1 block font-mono text-[10px] leading-snug\", className)}\n >\n Request ID:{\" \"}\n <button\n type=\"button\"\n className=\"outline-pho-brand inline cursor-pointer underline-offset-2 select-all hover:underline focus-visible:underline focus-visible:outline-2 focus-visible:-outline-offset-1\"\n aria-label={\n copied ? \"Request ID copied\" : `Copy request ID ${requestId}`\n }\n onClick={async () => {\n try {\n await navigator.clipboard.writeText(requestId);\n } catch {\n return;\n }\n setCopied(true);\n if (copiedTimer.current) clearTimeout(copiedTimer.current);\n copiedTimer.current = setTimeout(() => setCopied(false), 1500);\n }}\n >\n {requestId}\n </button>\n <output className=\"sr-only\" aria-live=\"polite\">\n {copied ? \"Copied\" : \"\"}\n </output>\n </span>\n );\n}\n\ninterface ErrorViewBaseProps {\n /** The caught value — a problem body, an `Error` wrapping one, or unknown. */\n error?: unknown;\n /** Override the derived title. */\n title?: ReactNode;\n /** Override the derived description. */\n description?: ReactNode;\n /** Override the warning glyph. */\n icon?: ReactNode;\n /** Offer a retry — renders a \"Try again\" button. */\n onRetry?: () => void;\n /** Replace the built-in action row entirely. */\n actions?: ReactNode;\n /** Size variant — StatusView's axis. @default \"base\" */\n size?: StatusViewSize;\n}\n\nexport interface ErrorViewProps\n extends\n ErrorViewBaseProps,\n Omit<ComponentProps<\"div\">, keyof ErrorViewBaseProps | \"children\"> {}\n\n/**\n * ErrorView — the failed state of a region or page, built on StatusView:\n * warning icon over the problem's `title`, its `detail` and remediation\n * below, an action row (`onRetry` and the problem's docs link), and the\n * request id as a footnote for support. Announces via `role=\"alert\"`.\n *\n * Use `size=\"sm\"` inside cards and panels, the default `base` for whole\n * pages. Renders nothing while `error` is nullish (unless given a static\n * `title`), so it can sit unconditionally next to a query.\n */\nexport function ErrorView({\n error,\n title,\n description,\n icon,\n onRetry,\n actions,\n size = \"base\",\n ...props\n}: ErrorViewProps) {\n if (error == null && title == null) return null;\n const copy = describeError(error);\n\n const resolvedDescription = displayCopy(description ?? copy.description);\n const body =\n resolvedDescription != null || copy.requestId != null ? (\n <>\n {resolvedDescription}\n {copy.requestId != null && <RequestId requestId={copy.requestId} />}\n </>\n ) : undefined;\n\n const resolvedActions =\n actions ??\n (onRetry != null || copy.documentation != null ? (\n <>\n {onRetry != null && (\n <Button size=\"sm\" onClick={onRetry}>\n {RETRY_LABEL}\n </Button>\n )}\n {copy.documentation != null && (\n <ButtonLink\n size=\"sm\"\n variant=\"outlined\"\n href={copy.documentation}\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n {DOC_LINK_LABEL}\n </ButtonLink>\n )}\n </>\n ) : undefined);\n\n return (\n <StatusView\n role=\"alert\"\n size={size}\n icon={icon ?? <IconAlertTriangle />}\n title={displayCopy(title ?? copy.title)}\n description={body}\n actions={resolvedActions}\n {...props}\n />\n );\n}\n\nErrorView.displayName = \"ErrorView\";\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;AASA,IAAM,IAAa;AAAA,EAAC,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAW,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAA4I,KAAO;AAAA,EAAQ,CAAC;AAAA,EAAG,CAAC,QAAQ;AAAA,IAAE,GAAK;AAAA,IAAc,KAAO;AAAA,EAAQ,CAAC;AAAC,GAC1R,IAAoB,EAAqB,WAAW,kBAAkB,iBAAiB,CAAU;AC2BvG,SAAgB,EAAU,GAAkC;AAC1D,MAAI,OAAO,KAAU,YAAY,MAAU,KAAM,QAAO;AACxD,QAAM,IAAI;AACV,SACE,OAAO,EAAE,SAAU,YACnB,OAAO,EAAE,UAAW,YACpB,OAAO,UAAU,EAAE,MAAM,KACzB,EAAE,UAAU,OACZ,EAAE,UAAU,QACX,EAAE,SAAS,UAAa,OAAO,EAAE,QAAS;AAE/C;AAQA,SAAgB,EAAa,GAAgC;AAC3D,MAAI,IAAmB;AACvB,WACM,IAAQ,GACZ,IAAQ,KAAK,OAAO,KAAY,YAAY,MAAY,MACxD,KACA;AACA,QAAI,EAAU,CAAO,EAAG,QAAO;AAC/B,UAAM,IAAW,EAAkC;AACnD,QAAI,EAAU,CAAO,EAAG,QAAO;AAC/B,IAAA,IAAW,EAAgC;AAAA,EAC7C;AACA,SAAO;AACT;AAqBA,IAAa,IAAsB,yBAG7B,IAA6C;AAAA,EACjD,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA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A,GACA,OAAA,GACA,aAAA,GACA,MAAA,GACA,SAAA,GACA,SAAA,GACA,MAAA,IAAO,QACP,GAAG,EAAA,GACc;AACjB,MAAI,KAAS,QAAQ,KAAS,KAAM,QAAO;AAC3C,QAAM,IAAO,EAAc,CAAK,GAE1B,IAAsB,EAAY,KAAe,EAAK,WAAW,GACjE,IACJ,KAAuB,QAAQ,EAAK,aAAa,OAC/C,gBAAA,EAAA,GAAA,EAAA,UAAA,CACG,GACA,EAAK,aAAa,QAAQ,gBAAA,EAAC,GAAD,EAAW,WAAW,EAAK,UAAY,CAAA,CAClE,EAAA,CAAA,IACA,QAEA,IACJ,MACC,KAAW,QAAQ,EAAK,iBAAiB,OACxC,gBAAA,EAAA,GAAA,EAAA,UAAA,CACG,KAAW,QACV,gBAAA,EAAC,GAAD;AAAA,IAAQ,MAAK;AAAA,IAAK,SAAS;AAAA,IACxB,UAAA;AAAA,EACK,CAAA,GAET,EAAK,iBAAiB,QACrB,gBAAA,EAAC,GAAD;AAAA,IACE,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,MAAM,EAAK;AAAA,IACX,QAAO;AAAA,IACP,KAAI;AAAA,IAEH,UAAA;AAAA,EACS,CAAA,CAEd,EAAA,CAAA,IACA;AAEN,SACE,gBAAA,EAAC,GAAD;AAAA,IACE,MAAK;AAAA,IACC,MAAA;AAAA,IACN,MAAM,KAAQ,gBAAA,EAAC,GAAD,CAAoB,CAAA;AAAA,IAClC,OAAO,EAAY,KAAS,EAAK,KAAK;AAAA,IACtC,aAAa;AAAA,IACb,SAAS;AAAA,IACT,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,EAAU,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"filter-bar-upeYW4dQ.js","names":[],"sources":["../../../../node_modules/.pnpm/@tabler+icons-react@3.46.0_react@19.2.8/node_modules/@tabler/icons-react/dist/esm/icons/IconPlus.mjs","../../src/components/filter-bar/filter-bar.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.46.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\": \"M12 5l0 14\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M5 12l14 0\", \"key\": \"svg-1\" }]];\nconst IconPlus = createReactComponent(\"outline\", \"plus\", \"Plus\", __iconNode);\n\nexport { __iconNode, IconPlus as default };\n//# sourceMappingURL=IconPlus.mjs.map\n","import {\n useRef,\n useState,\n type ComponentProps,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n type RefObject,\n} from \"react\";\nimport { IconCheck, IconPlus, IconSearch, IconX } from \"@tabler/icons-react\";\nimport { Button } from \"../button\";\nimport { BoxSearch } from \"../input-group/box-search\";\nimport { Menu } from \"../menu\";\nimport { cn } from \"../../utils/cn\";\n\n/**\n * Filter Bar — the row that pins above a log list: a search field for an\n * id, then one chip per filter. A chip with nothing chosen reads\n * `+ Status`; with a value it reads `Status: Failed` and carries its own\n * clear. Each chip opens a menu: a keyboard-first list of options (with a\n * search field past eight of them), or presets and a from / to pair for a\n * date range.\n *\n * Design notes:\n * - Built from the library's own controls, nothing bespoke: a chip is an\n * outlined `Button` (the clear beside it another), and what it opens is a\n * `Menu` — so a chip's menu wears the same hairline, shadow and\n * origin-scaled entrance as every other menu, in both themes.\n * - Fully controlled. The page owns `filters` and `search` and hands\n * them back changed; the bar keeps no state but which menu is open.\n * That keeps the query in one place (the URL, a store) and lets the\n * list refetch from it.\n * - Chips are real buttons (the trigger, and the clear beside it), so\n * the bar is one tab stop per control and Escape closes a menu back\n * onto its chip.\n * - No scroll container of its own: chips wrap. `sticky` pins it to the\n * top of the nearest scroll pane on the surface it sits on.\n */\n\nexport interface FilterOption {\n value: string;\n label: string;\n /**\n * Rich option row (a badge, mono path). Search and the set chip still\n * use `label` and `value` strings.\n */\n title?: ReactNode;\n}\n\ninterface FilterDefinitionBase {\n /** The key in `filters` this chip reads and writes. */\n key: string;\n /** The chip's word — \"Status\", \"Event type\". Sentence case. */\n label: string;\n}\n\nexport interface SelectFilterDefinition extends FilterDefinitionBase {\n type?: \"select\";\n options: readonly FilterOption[];\n /** Several values at once (`string[]`); one at a time by default. */\n multiple?: boolean;\n /**\n * A search field above the options. On by default past eight options,\n * off below; say so to override.\n */\n searchable?: boolean;\n /** The search field's placeholder. @default \"Search\" */\n searchPlaceholder?: string;\n}\n\n/** A relative preset for a date-range filter — \"Last 7 days\" is 168 hours. */\nexport interface DateRangePreset {\n label: string;\n hours: number;\n}\n\nexport interface DateRangeFilterDefinition extends FilterDefinitionBase {\n type: \"date-range\";\n /** The relative presets listed above the from / to pair. */\n presets?: readonly DateRangePreset[];\n}\n\nexport type FilterDefinition =\n SelectFilterDefinition | DateRangeFilterDefinition;\n\n/**\n * A date-range value. A preset stores an absolute ISO timestamp in `from`\n * (computed when chosen) and its label in `preset`; the from / to pair\n * stores plain `YYYY-MM-DD` dates. Either side may be open (`null`).\n */\nexport interface DateRangeValue {\n from: string | null;\n to: string | null;\n preset?: string;\n}\n\nexport type FilterValue = string | string[] | DateRangeValue;\n\n/** The page's filter state — one entry per definition key that is set. */\nexport type FilterValues = Record<string, FilterValue | undefined>;\n\n/** The relative presets a date-range chip lists when given none. */\nexport const FILTER_DATE_PRESETS: readonly DateRangePreset[] = [\n { label: \"Last hour\", hours: 1 },\n { label: \"Last 24 hours\", hours: 24 },\n { label: \"Last 7 days\", hours: 24 * 7 },\n { label: \"Last 30 days\", hours: 24 * 30 },\n];\n\n/** Past this many options a select chip shows a search field. */\nconst SEARCHABLE_PAST = 8;\n\n/** Whether a filter value counts as set — an empty string or list does not. */\nexport function isFilterSet(value: FilterValue | undefined): boolean {\n if (value == null) return false;\n if (typeof value === \"string\") return value !== \"\";\n if (Array.isArray(value)) return value.length > 0;\n return value.from != null || value.to != null;\n}\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nfunction formatDay(value: string): string {\n // A plain date is a calendar day: format it in UTC so the day survives\n // every viewer timezone. A timestamp is a moment: format it locally.\n const dateOnly = DATE_ONLY.test(value);\n const date = new Date(dateOnly ? `${value}T00:00:00Z` : value);\n if (Number.isNaN(date.getTime())) return value;\n return new Intl.DateTimeFormat(\"en-US\", {\n month: \"short\",\n day: \"numeric\",\n ...(dateOnly ? { timeZone: \"UTC\" } : {}),\n }).format(date);\n}\n\n/** The words a set chip shows after its label. */\nexport function formatFilterValue(\n definition: FilterDefinition,\n value: FilterValue | undefined,\n): string {\n if (!isFilterSet(value) || value == null) return \"\";\n if (definition.type === \"date-range\") {\n const range = value as DateRangeValue;\n if (range.preset) return range.preset;\n if (range.from && range.to) {\n return `${formatDay(range.from)} to ${formatDay(range.to)}`;\n }\n if (range.from) return `From ${formatDay(range.from)}`;\n if (range.to) return `Until ${formatDay(range.to)}`;\n return \"\";\n }\n const labelOf = (item: string) =>\n definition.options.find((option) => option.value === item)?.label ?? item;\n if (Array.isArray(value)) return value.map(labelOf).join(\", \");\n return typeof value === \"string\" ? labelOf(value) : \"\";\n}\n\n/* ------------------------------ menu fields ------------------------------ */\n\n// Keys a field inside a menu keeps to itself: text editing and the caret.\n// The menu owns the rest — Up/Down move to the rows, Escape closes, Tab\n// leaves. Base UI's menu typeahead would otherwise swallow every character\n// typed (it prevents the key to jump between rows).\nfunction isFieldKey(event: KeyboardEvent<HTMLElement>): boolean {\n if (event.ctrlKey || event.metaKey || event.altKey) return true;\n if (event.key.length === 1) return true;\n return [\n \"Backspace\",\n \"Delete\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"Home\",\n \"End\",\n ].includes(event.key);\n}\n\n// A native date field steps its parts with Up/Down too, so it keeps those\n// as well; only Escape and Tab reach the menu.\nfunction isDateFieldKey(event: KeyboardEvent<HTMLElement>): boolean {\n return event.key !== \"Escape\" && event.key !== \"Tab\";\n}\n\n/* --------------------------------- chips -------------------------------- */\n\nfunction FilterChip({\n definition,\n value,\n onChange,\n}: {\n definition: FilterDefinition;\n value: FilterValue | undefined;\n onChange: (next: FilterValue | undefined) => void;\n}) {\n const set = isFilterSet(value);\n const display = formatFilterValue(definition, value);\n // Uncontrolled: a pick closes the menu through its row, and the panel\n // inside unmounts with it, so a search typed there starts over next time.\n return (\n <Menu.Root>\n <span\n data-filter-chip={definition.key}\n data-set={set || undefined}\n className=\"inline-flex max-w-full shrink-0 items-stretch\"\n >\n <Menu.Trigger\n render={\n <Button\n variant=\"outlined\"\n size=\"sm\"\n prefix={set ? undefined : IconPlus}\n aria-label={set ? undefined : `${definition.label} filter`}\n className={cn(\n \"relative max-w-full min-w-0 hover:z-1 focus-visible:z-1\",\n set && \"rounded-r-none pr-2.5\",\n )}\n >\n {set ? (\n <span className=\"flex min-w-0 items-baseline gap-1\">\n <span className=\"text-pho-description shrink-0 font-normal\">\n {definition.label}:\n </span>\n <span className=\"text-pho-primary max-w-56 truncate\">\n {display}\n </span>\n </span>\n ) : (\n definition.label\n )}\n </Button>\n }\n />\n {set ? (\n <Button\n variant=\"outlined\"\n size=\"sm\"\n svgOnly\n aria-label={`Clear ${definition.label.toLowerCase()} filter`}\n onClick={() => onChange(undefined)}\n // Shares its left edge with the trigger: one hairline between\n // the two. Whichever half is hovered or focused rises to the\n // front, so its own ring reads whole over the seam.\n className=\"-ml-px h-auto rounded-l-none px-2 hover:z-1 focus-visible:z-1 [&>svg]:size-3.5\"\n >\n <IconX />\n </Button>\n ) : null}\n </span>\n <Menu.Portal>\n <Menu.Positioner align=\"start\">\n {/* As wide as its longest row up to a cap, so a path reads whole\n where it can and truncates where it cannot; padding moves off\n the popup and onto its sections so a search field runs edge\n to edge. */}\n <Menu.Popup\n aria-label={`${definition.label} filter`}\n // Base UI names the menu after its trigger, whose words change\n // with the value; the menu keeps one name.\n aria-labelledby={undefined}\n className=\"flex max-w-[min(30rem,calc(100vw-2rem))] min-w-64 flex-col p-0\"\n >\n {definition.type === \"date-range\" ? (\n <DateRangePanel\n definition={definition}\n value={value as DateRangeValue | undefined}\n onChange={onChange}\n />\n ) : (\n <OptionsPanel\n definition={definition}\n value={value as string | string[] | undefined}\n onChange={onChange}\n />\n )}\n </Menu.Popup>\n </Menu.Positioner>\n </Menu.Portal>\n </Menu.Root>\n );\n}\n\n/** A search field pinned over a menu's rows. */\nfunction MenuSearch({\n value,\n onChange,\n placeholder,\n label,\n listRef,\n}: {\n value: string;\n onChange: (next: string) => void;\n placeholder: string;\n label: string;\n listRef: RefObject<HTMLDivElement | null>;\n}) {\n return (\n <div className=\"border-pho-secondary relative flex items-center border-b\">\n <IconSearch\n aria-hidden\n className=\"text-pho-secondary pointer-events-none absolute left-3 size-4\"\n />\n <input\n type=\"text\"\n // The field takes focus as the menu opens, so a keystroke right\n // away already searches.\n // oxlint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n aria-label={label}\n placeholder={placeholder}\n autoComplete=\"off\"\n spellCheck={false}\n value={value}\n onChange={(event) => onChange(event.target.value)}\n onKeyDown={(event) => {\n // An IME confirming its composition sends Enter too: that Enter\n // is the field's, never a pick.\n if (event.nativeEvent.isComposing) {\n event.stopPropagation();\n return;\n }\n if (isFieldKey(event)) {\n event.stopPropagation();\n } else if (event.key === \"Enter\") {\n // Enter from the field takes the first row, as it would once\n // the arrows reached it — through the row itself, so the menu\n // closes the way it does on a click.\n event.preventDefault();\n event.stopPropagation();\n listRef.current\n ?.querySelector<HTMLElement>('[role^=\"menuitem\"]')\n ?.click();\n }\n }}\n className=\"text-pho-primary placeholder:text-pho-placeholder h-10 w-full bg-transparent pr-3 pl-9 text-base outline-none\"\n />\n </div>\n );\n}\n\nconst OPTION_ROW = \"min-w-0 flex-1 truncate\";\n\nfunction OptionsPanel({\n definition,\n value,\n onChange,\n}: {\n definition: SelectFilterDefinition;\n value: string | string[] | undefined;\n onChange: (next: string | string[] | undefined) => void;\n}) {\n const [query, setQuery] = useState(\"\");\n const listRef = useRef<HTMLDivElement>(null);\n const searchable =\n definition.searchable ?? definition.options.length > SEARCHABLE_PAST;\n const chosen = new Set(\n value == null ? [] : Array.isArray(value) ? value : [value],\n );\n const needle = query.trim().toLowerCase();\n const options = needle\n ? definition.options.filter(\n (option) =>\n option.label.toLowerCase().includes(needle) ||\n option.value.toLowerCase().includes(needle),\n )\n : definition.options;\n const toggle = (option: FilterOption) => {\n const next = new Set(chosen);\n if (next.has(option.value)) next.delete(option.value);\n else next.add(option.value);\n // Keep the definition's order, so the chip reads the same way\n // whatever order the values were chosen in.\n const ordered = definition.options\n .map((item) => item.value)\n .filter((item) => next.has(item));\n onChange(ordered.length > 0 ? ordered : undefined);\n };\n const row = (option: FilterOption) => (\n <span className={OPTION_ROW} title={option.label}>\n {option.title ?? option.label}\n </span>\n );\n return (\n <>\n {searchable ? (\n <MenuSearch\n value={query}\n onChange={setQuery}\n placeholder={definition.searchPlaceholder ?? \"Search\"}\n label={`Search ${definition.label.toLowerCase()} options`}\n listRef={listRef}\n />\n ) : null}\n {options.length === 0 ? (\n <p className=\"text-pho-description px-3 py-3 text-xs\">\n Nothing matches.\n </p>\n ) : (\n <div\n ref={listRef}\n className=\"max-h-[min(50vh,20rem)] overflow-y-auto p-1.5\"\n >\n {definition.multiple ? (\n options.map((option) => (\n <Menu.CheckboxItem\n key={option.value}\n checked={chosen.has(option.value)}\n closeOnClick={false}\n onClick={() => toggle(option)}\n >\n <Menu.CheckboxItemIndicator>\n <IconCheck />\n </Menu.CheckboxItemIndicator>\n {row(option)}\n </Menu.CheckboxItem>\n ))\n ) : (\n <Menu.RadioGroup\n value={typeof value === \"string\" ? value : \"\"}\n aria-label={`${definition.label} options`}\n >\n {options.map((option) => (\n <Menu.RadioItem\n key={option.value}\n value={option.value}\n // One pick is the answer, so the menu closes on it (a\n // radio row stays open unless told); the chosen row\n // picked again clears the filter.\n closeOnClick\n onClick={() =>\n onChange(\n chosen.has(option.value) ? undefined : option.value,\n )\n }\n >\n <Menu.RadioItemIndicator>\n <IconCheck />\n </Menu.RadioItemIndicator>\n {row(option)}\n </Menu.RadioItem>\n ))}\n </Menu.RadioGroup>\n )}\n </div>\n )}\n </>\n );\n}\n\nconst DATE_INPUT =\n \"bg-pho-primary ring-pho-primary text-pho-primary focus-visible:ring-pho-brand w-full min-w-0 rounded-sm px-2 py-1 text-base ring-1 transition-shadow duration-100 ease-linear outline-none ring-inset focus-visible:ring-2\";\n\nfunction DateRangePanel({\n definition,\n value,\n onChange,\n}: {\n definition: DateRangeFilterDefinition;\n value: DateRangeValue | undefined;\n onChange: (next: DateRangeValue | undefined) => void;\n}) {\n const presets = definition.presets ?? FILTER_DATE_PRESETS;\n // A preset's `from` is a timestamp; the day field shows its date.\n const day = (side: string | null | undefined) =>\n side == null ? \"\" : DATE_ONLY.test(side) ? side : side.slice(0, 10);\n const setSide = (side: \"from\" | \"to\", next: string) => {\n // Editing either day leaves a preset behind: the pair is the value now,\n // and a preset's timestamp becomes the day it fell on.\n const range: DateRangeValue = {\n from: day(value?.from) || null,\n to: day(value?.to) || null,\n [side]: next || null,\n };\n onChange(range.from == null && range.to == null ? undefined : range);\n };\n const stopFieldKeys = (event: KeyboardEvent<HTMLInputElement>) => {\n if (isDateFieldKey(event)) event.stopPropagation();\n };\n return (\n <>\n <div className=\"p-1.5\">\n <Menu.RadioGroup\n value={value?.preset ?? \"\"}\n aria-label={`${definition.label} presets`}\n >\n {presets.map((preset) => (\n <Menu.RadioItem\n key={preset.label}\n value={preset.label}\n closeOnClick\n onClick={() =>\n onChange({\n from: new Date(\n Date.now() - preset.hours * 60 * 60 * 1000,\n ).toISOString(),\n to: null,\n preset: preset.label,\n })\n }\n >\n <Menu.RadioItemIndicator>\n <IconCheck />\n </Menu.RadioItemIndicator>\n {preset.label}\n </Menu.RadioItem>\n ))}\n </Menu.RadioGroup>\n </div>\n {/* The day fields keep their keys: the menu's arrow handling would\n otherwise swallow the native date stepping. */}\n <div className=\"border-pho-secondary grid grid-cols-2 gap-2 border-t p-2\">\n <label className=\"text-pho-description flex min-w-0 flex-col gap-1 text-xs\">\n From\n <input\n type=\"date\"\n value={day(value?.from)}\n max={day(value?.to) || undefined}\n onChange={(event) => setSide(\"from\", event.target.value)}\n onKeyDown={stopFieldKeys}\n className={DATE_INPUT}\n />\n </label>\n <label className=\"text-pho-description flex min-w-0 flex-col gap-1 text-xs\">\n To\n <input\n type=\"date\"\n value={day(value?.to)}\n min={day(value?.from) || undefined}\n onChange={(event) => setSide(\"to\", event.target.value)}\n onKeyDown={stopFieldKeys}\n className={DATE_INPUT}\n />\n </label>\n </div>\n </>\n );\n}\n\n/* ---------------------------------- bar --------------------------------- */\n\nexport interface FilterBarProps extends Omit<\n ComponentProps<\"div\">,\n \"children\"\n> {\n /** One chip per definition, in this order. */\n definitions: readonly FilterDefinition[];\n /** The values, keyed by definition key. Absent or empty means unset. */\n filters: FilterValues;\n /** The whole map, changed — set, cleared, or cleared all. */\n onFiltersChange: (next: FilterValues) => void;\n /** The search field's text. The field renders only with `onSearchChange`. */\n search?: string;\n onSearchChange?: (value: string) => void;\n /** A teaching phrase — \"Find an event by id\". @default \"Search\" */\n searchPlaceholder?: string;\n /** The field's accessible name when the placeholder is too short to be one. */\n searchLabel?: string;\n /**\n * Pin the bar to the top of the nearest scroll pane. It paints the\n * surface it sits on (`--pho-surface`) so rows scroll under it.\n */\n sticky?: boolean;\n /** Controls after the chips — a range picker, an export button. */\n children?: ReactNode;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport function FilterBar({\n definitions,\n filters,\n onFiltersChange,\n search,\n onSearchChange,\n searchPlaceholder = \"Search\",\n searchLabel,\n sticky,\n className,\n children,\n ...props\n}: FilterBarProps) {\n const setCount = definitions.filter((definition) =>\n isFilterSet(filters[definition.key]),\n ).length;\n const change = (key: string, next: FilterValue | undefined) => {\n const rest = { ...filters };\n if (next === undefined) delete rest[key];\n else rest[key] = next;\n onFiltersChange(rest);\n };\n return (\n <div\n data-filter-bar=\"\"\n className={cn(\n \"flex min-w-0 flex-wrap items-center gap-2\",\n sticky &&\n \"sticky top-0 z-10 bg-[var(--pho-surface,var(--background-color-pho-page))] py-3\",\n className,\n )}\n {...props}\n >\n {onSearchChange != null ? (\n <BoxSearch\n value={search ?? \"\"}\n onChange={(event) => onSearchChange(event.target.value)}\n onClear={() => onSearchChange(\"\")}\n onKeyDown={(event) => {\n if (event.key !== \"Escape\") return;\n event.preventDefault();\n onSearchChange(\"\");\n }}\n placeholder={searchPlaceholder}\n aria-label={searchLabel ?? searchPlaceholder}\n className=\"w-64 max-w-full\"\n />\n ) : null}\n {definitions.map((definition) => (\n <FilterChip\n key={definition.key}\n definition={definition}\n value={filters[definition.key]}\n onChange={(next) => change(definition.key, next)}\n />\n ))}\n {setCount > 1 ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => {\n const rest = { ...filters };\n for (const definition of definitions) delete rest[definition.key];\n onFiltersChange(rest);\n }}\n >\n Clear filters\n </Button>\n ) : null}\n {children}\n </div>\n );\n}\n\nFilterBar.displayName = \"FilterBar\";\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AASA,IAAM,IAAa,CAAC,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAc,KAAO;AAAQ,CAAC,GAAG,CAAC,QAAQ;AAAA,EAAE,GAAK;AAAA,EAAc,KAAO;AAAQ,CAAC,CAAC,GAC9G,IAAW,EAAqB,WAAW,QAAQ,QAAQ,CAAU,GC4F9D,IAAkD;AAAA,EAC7D;AAAA,IAAE,OAAO;AAAA,IAAa,OAAO;AAAA,EAAE;AAAA,EAC/B;AAAA,IAAE,OAAO;AAAA,IAAiB,OAAO;AAAA,EAAG;AAAA,EACpC;AAAA,IAAE,OAAO;AAAA,IAAe,OAAO;AAAA,EAAO;AAAA,EACtC;AAAA,IAAE,OAAO;AAAA,IAAgB,OAAO;AAAA,EAAQ;AAC1C,GAGM,IAAkB;AAGxB,SAAgB,EAAY,GAAyC;AACnE,SAAI,KAAS,OAAa,KACtB,OAAO,KAAU,WAAiB,MAAU,KAC5C,MAAM,QAAQ,CAAK,IAAU,EAAM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QAC3B,WAAU;AAAA,MACX,CAAA,IACC;AAAA,MACH,EAAY,IAAA,CAAK,MAChB,gBAAA,EAAC,GAAD;AAAA,QAEc,YAAA;AAAA,QACZ,OAAO,EAAQ,EAAW,GAAA;AAAA,QAC1B,UAAA,CAAW,MAAS,EAAO,EAAW,KAAK,CAAI;AAAA,MAChD,GAJM,EAAW,GAIjB,CACF;AAAA,MACA,IAAW,IACV,gBAAA,EAAC,GAAD;AAAA,QACE,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,SAAA,MAAe;AACb,gBAAM,IAAO,EAAE,GAAG,EAAQ;AAC1B,qBAAW,KAAc,EAAa,QAAO,EAAK,EAAW,GAAA;AAC7D,UAAA,EAAgB,CAAI;AAAA,QACtB;AAAA,QACD,UAAA;AAAA,MAEO,CAAA,IACN;AAAA,MACH;AAAA,IACE;AAAA;AAET;AAEA,EAAU,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ghost-search-8PzP73zS.js","names":[],"sources":["../../src/utils/ghost-search.tsx"],"sourcesContent":["import { useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { IconSearch, IconX } from \"@tabler/icons-react\";\nimport { cn } from \"./cn\";\n\nexport interface GhostSearchProps extends Omit<\n ComponentProps<\"input\">,\n \"value\" | \"onChange\" | \"type\" | \"children\"\n> {\n value: string;\n onChange: (value: string) => void;\n /**\n * Empties the query from the field's own clear button, shown while it\n * holds text; focus stays in the field. Without it, the browser's own\n * clear glyph stays.\n */\n onClear?: () => void;\n /** Quiet words at the field's end, before the clear button — a count. */\n trailing?: ReactNode;\n}\n\n/**\n * A search box with no box: the glyph and the text on the surface's own\n * line, the way a toolbar band inside a card carries it (a `DataTable`'s\n * search, a `Trace.Waterfall`'s, a `Scope`'s first row). Quiet ink, and no\n * ring on focus either: a ring would draw the box the face exists not to\n * have. Focus shows in the caret and in the magnifier, which takes the\n * primary ink while the field holds focus.\n *\n * The query is the list's, not a form's: its change stops at the field, so\n * an enclosing form that saves on change (BasicPage `Form autoSave`) or\n * shows a save row once dirty never hears it. The type is an `sm` field's:\n * 16px on small viewports, where iOS zooms into anything smaller.\n */\nexport function GhostSearch({\n value,\n onChange,\n onClear,\n trailing,\n className,\n ref,\n ...props\n}: GhostSearchProps) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n return (\n <label\n className={cn(\"group flex min-w-40 flex-1 items-center gap-2\", className)}\n >\n <IconSearch\n aria-hidden\n className=\"text-pho-description group-focus-within:text-pho-primary size-4 shrink-0 transition-colors duration-100 ease-linear\"\n />\n <input\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref != null) ref.current = node;\n }}\n type=\"search\"\n value={value}\n onChange={(event) => {\n event.stopPropagation();\n onChange(event.target.value);\n }}\n className={cn(\n \"text-pho-primary placeholder:text-pho-description text-md w-full min-w-0 bg-transparent outline-none md:text-base\",\n // The field's own clear takes over from the browser's.\n onClear != null &&\n \"[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none\",\n )}\n {...props}\n aria-label={\n props[\"aria-label\"] ??\n (props[\"aria-labelledby\"] ? undefined : \"Search\")\n }\n />\n {trailing != null ? (\n <span className=\"text-pho-description shrink-0 text-xs tabular-nums\">\n {trailing}\n </span>\n ) : null}\n {onClear != null && value !== \"\" && !props.disabled ? (\n <button\n type=\"button\"\n aria-label=\"Clear search\"\n // Reachable by click, skipped by Tab: `Escape` clears from the\n // keyboard, and Tab moves on to the list.\n tabIndex={-1}\n onClick={() => {\n onClear();\n inputRef.current?.focus();\n }}\n className=\"text-pho-secondary hover:text-pho-secondary-hover flex shrink-0 cursor-pointer items-center transition-colors duration-100 ease-linear [&>svg]:size-4\"\n >\n <IconX aria-hidden />\n </button>\n ) : null}\n </label>\n );\n}\n"],"mappings":";;;;;;AAiCA,SAAgB,EAAY,EAC1B,OAAA,GACA,UAAA,GACA,SAAA,GACA,UAAA,GACA,WAAA,GACA,KAAA,GACA,GAAG,EAAA,GACgB;AACnB,QA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