@logicplanes/kaeso-ui 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (356) hide show
  1. package/AGENTS.md +2 -0
  2. package/NOTICE.md +1 -1
  3. package/ai/component-guides.md +249 -24
  4. package/ai/component-registry.json +1044 -67
  5. package/ai/component-registry.md +238 -50
  6. package/ai/icons.md +1 -1
  7. package/ai/tokens.md +7 -3
  8. package/dist/blocks/delete-resource.js +1 -1
  9. package/dist/blocks/pages.js +5 -5
  10. package/dist/blocks/resource-list.js +4 -4
  11. package/dist/chunks/app-frame-B9vrgwaE.js +220 -0
  12. package/dist/chunks/app-frame-B9vrgwaE.js.map +1 -0
  13. package/dist/chunks/{avatar-D2nJNbtC.js → avatar-DOzOhYJr.js} +2 -2
  14. package/dist/chunks/{avatar-D2nJNbtC.js.map → avatar-DOzOhYJr.js.map} +1 -1
  15. package/dist/chunks/{badge-Dkyhs0_j.js → badge-wUHlj7m3.js} +2 -2
  16. package/dist/chunks/{badge-Dkyhs0_j.js.map → badge-wUHlj7m3.js.map} +1 -1
  17. package/dist/chunks/{banner-DxGBPQ7p.js → banner-BBlNFHd-.js} +4 -4
  18. package/dist/chunks/{banner-DxGBPQ7p.js.map → banner-BBlNFHd-.js.map} +1 -1
  19. package/dist/chunks/{button-DQvoOxVQ.js → button-CAPyW-v8.js} +8 -8
  20. package/dist/chunks/{button-DQvoOxVQ.js.map → button-CAPyW-v8.js.map} +1 -1
  21. package/dist/chunks/{calendar-CN3YJi2k.js → calendar-CBeptQFq.js} +2 -2
  22. package/dist/chunks/{calendar-CN3YJi2k.js.map → calendar-CBeptQFq.js.map} +1 -1
  23. package/dist/chunks/{checkbox-BgRdbfCE.js → checkbox-C5yvSS7O.js} +3 -3
  24. package/dist/chunks/{checkbox-BgRdbfCE.js.map → checkbox-C5yvSS7O.js.map} +1 -1
  25. package/dist/chunks/{cn-CidVUKMm.js → cn-DUDmdLpZ.js} +3 -1
  26. package/dist/chunks/cn-DUDmdLpZ.js.map +1 -0
  27. package/dist/chunks/{code-BADhvsgC.js → code-C49NzHUQ.js} +2 -2
  28. package/dist/chunks/{code-BADhvsgC.js.map → code-C49NzHUQ.js.map} +1 -1
  29. package/dist/chunks/{code-block-DxtladFW.js → code-block-DREsvJ-g.js} +24 -21
  30. package/dist/chunks/code-block-DREsvJ-g.js.map +1 -0
  31. package/dist/chunks/{collapsible-Cw_1aem5.js → collapsible-CDQq1Y9x.js} +6 -6
  32. package/dist/chunks/collapsible-CDQq1Y9x.js.map +1 -0
  33. package/dist/chunks/combobox-DqtzsAKG.js +314 -0
  34. package/dist/chunks/combobox-DqtzsAKG.js.map +1 -0
  35. package/dist/chunks/command-list-D5k0uvkR.js +417 -0
  36. package/dist/chunks/command-list-D5k0uvkR.js.map +1 -0
  37. package/dist/chunks/{copy-button-DXxn-YYZ.js → copy-button-CNpEnS04.js} +6 -6
  38. package/dist/chunks/{copy-button-DXxn-YYZ.js.map → copy-button-CNpEnS04.js.map} +1 -1
  39. package/dist/chunks/{core-K960A4OT.js → core-CqLWVMDI.js} +36 -36
  40. package/dist/chunks/core-CqLWVMDI.js.map +1 -0
  41. package/dist/chunks/{date-popup-B-6xhb-1.js → date-popup-BgDz6SUj.js} +4 -4
  42. package/dist/chunks/{date-popup-B-6xhb-1.js.map → date-popup-BgDz6SUj.js.map} +1 -1
  43. package/dist/chunks/{de-CTAo4KL7.js → de-CkXZKaBD.js} +37 -5
  44. package/dist/chunks/de-CkXZKaBD.js.map +1 -0
  45. package/dist/chunks/dialog-truWH0qe.js +353 -0
  46. package/dist/chunks/dialog-truWH0qe.js.map +1 -0
  47. package/dist/chunks/{empty-DIbBpytW.js → empty-YXmSkKzR.js} +2 -2
  48. package/dist/chunks/{empty-DIbBpytW.js.map → empty-YXmSkKzR.js.map} +1 -1
  49. package/dist/chunks/{field-d8V94bvZ.js → field-BZriODU7.js} +3 -3
  50. package/dist/chunks/field-BZriODU7.js.map +1 -0
  51. package/dist/chunks/{icon-CeNQtobn.js → icon-BqujXDUc.js} +2 -2
  52. package/dist/chunks/{icon-CeNQtobn.js.map → icon-BqujXDUc.js.map} +1 -1
  53. package/dist/chunks/{icon-button-_x1RUphC.js → icon-button-D4O4puwH.js} +3 -3
  54. package/dist/chunks/{icon-button-_x1RUphC.js.map → icon-button-D4O4puwH.js.map} +1 -1
  55. package/dist/chunks/identity-CsZvAUwu.js +361 -0
  56. package/dist/chunks/identity-CsZvAUwu.js.map +1 -0
  57. package/dist/chunks/{input-CNTfI6YE.js → input-B0wtkcNh.js} +5 -5
  58. package/dist/chunks/{input-CNTfI6YE.js.map → input-B0wtkcNh.js.map} +1 -1
  59. package/dist/chunks/{input-group-CYA1MEoZ.js → input-group-BQLw06B0.js} +33 -27
  60. package/dist/chunks/input-group-BQLw06B0.js.map +1 -0
  61. package/dist/chunks/{inset-BLMdxX4I.js → inset-BnBj8NJV.js} +12 -2
  62. package/dist/chunks/inset-BnBj8NJV.js.map +1 -0
  63. package/dist/chunks/{iso-field-1qmg7TP8.js → iso-field-BUXgY1dB.js} +5 -3
  64. package/dist/chunks/{iso-field-1qmg7TP8.js.map → iso-field-BUXgY1dB.js.map} +1 -1
  65. package/dist/chunks/{json-view-B6KHIWzh.js → json-view-BkG2hTXV.js} +11 -10
  66. package/dist/chunks/{json-view-B6KHIWzh.js.map → json-view-BkG2hTXV.js.map} +1 -1
  67. package/dist/chunks/{kbd-CBcBDvqU.js → kbd-DqWmbr_e.js} +2 -2
  68. package/dist/chunks/{kbd-CBcBDvqU.js.map → kbd-DqWmbr_e.js.map} +1 -1
  69. package/dist/chunks/{link-vz9aV8WX.js → link-YMcxM-BZ.js} +4 -4
  70. package/dist/chunks/{link-vz9aV8WX.js.map → link-YMcxM-BZ.js.map} +1 -1
  71. package/dist/chunks/{link-provider---9JdxTg.js → link-provider-BsUxhZKG.js} +2 -2
  72. package/dist/chunks/{link-provider---9JdxTg.js.map → link-provider-BsUxhZKG.js.map} +1 -1
  73. package/dist/chunks/list-wXZIZo_s.js +492 -0
  74. package/dist/chunks/list-wXZIZo_s.js.map +1 -0
  75. package/dist/chunks/{loader-CUehxvSZ.js → loader-ENBh2Fbt.js} +2 -2
  76. package/dist/chunks/{loader-CUehxvSZ.js.map → loader-ENBh2Fbt.js.map} +1 -1
  77. package/dist/chunks/{markdown-5NyaHHfN.js → markdown-DWyxjsSY.js} +10 -10
  78. package/dist/chunks/{markdown-5NyaHHfN.js.map → markdown-DWyxjsSY.js.map} +1 -1
  79. package/dist/chunks/{menu-DyVPwgfF.js → menu-Bnfi9P3t.js} +7 -7
  80. package/dist/chunks/{menu-DyVPwgfF.js.map → menu-Bnfi9P3t.js.map} +1 -1
  81. package/dist/chunks/{meter-DWhyzFGQ.js → meter-DhTnem4k.js} +2 -2
  82. package/dist/chunks/{meter-DWhyzFGQ.js.map → meter-DhTnem4k.js.map} +1 -1
  83. package/dist/chunks/nav-sheet-QqNRHo-y.js +60 -0
  84. package/dist/chunks/nav-sheet-QqNRHo-y.js.map +1 -0
  85. package/dist/chunks/{nav-wordmark-DLkItdvo.js → nav-wordmark-DmbT1Aiw.js} +2 -2
  86. package/dist/chunks/{nav-wordmark-DLkItdvo.js.map → nav-wordmark-DmbT1Aiw.js.map} +1 -1
  87. package/dist/chunks/option-checkbox-Df7WhGn4.js +25 -0
  88. package/dist/chunks/option-checkbox-Df7WhGn4.js.map +1 -0
  89. package/dist/chunks/over-sheet-B8vzr_zU.js +8 -0
  90. package/dist/chunks/over-sheet-B8vzr_zU.js.map +1 -0
  91. package/dist/chunks/{page-header-CEPZzhRp.js → page-header-Ccnrspbp.js} +5 -5
  92. package/dist/chunks/{page-header-CEPZzhRp.js.map → page-header-Ccnrspbp.js.map} +1 -1
  93. package/dist/chunks/{pagination-CCMxQ5pH.js → pagination-CEmWZNjp.js} +5 -4
  94. package/dist/chunks/{pagination-CCMxQ5pH.js.map → pagination-CEmWZNjp.js.map} +1 -1
  95. package/dist/chunks/picker-popover-C4ElNk7t.js +102 -0
  96. package/dist/chunks/picker-popover-C4ElNk7t.js.map +1 -0
  97. package/dist/chunks/{popover-BE7VO-a4.js → popover-bjxg020P.js} +3 -3
  98. package/dist/chunks/{popover-BE7VO-a4.js.map → popover-bjxg020P.js.map} +1 -1
  99. package/dist/chunks/{radio-CUxbLCvD.js → radio-DwYcXAzv.js} +2 -2
  100. package/dist/chunks/{radio-CUxbLCvD.js.map → radio-DwYcXAzv.js.map} +1 -1
  101. package/dist/chunks/range-popup-CG9Jo5B7.js +128 -0
  102. package/dist/chunks/range-popup-CG9Jo5B7.js.map +1 -0
  103. package/dist/chunks/release-art-Chd8l9Rf.js +555 -0
  104. package/dist/chunks/release-art-Chd8l9Rf.js.map +1 -0
  105. package/dist/chunks/{resize-motion-CMaidkwe.js → resize-motion-BWGMchyP.js} +27 -23
  106. package/dist/chunks/resize-motion-BWGMchyP.js.map +1 -0
  107. package/dist/chunks/{rights-BbiJ0AJB.js → rights-hMoaFasn.js} +12 -12
  108. package/dist/chunks/rights-hMoaFasn.js.map +1 -0
  109. package/dist/chunks/{section-DzOLLN1p.js → section-BsET7Fo-.js} +4 -4
  110. package/dist/chunks/{section-DzOLLN1p.js.map → section-BsET7Fo-.js.map} +1 -1
  111. package/dist/chunks/{segmented-MrinfDL8.js → segmented-DXKVF-nY.js} +4 -4
  112. package/dist/chunks/{segmented-MrinfDL8.js.map → segmented-DXKVF-nY.js.map} +1 -1
  113. package/dist/chunks/{select-Bc4kRiSG.js → select-Bbv2f5F8.js} +63 -80
  114. package/dist/chunks/select-Bbv2f5F8.js.map +1 -0
  115. package/dist/chunks/{separator-D5AzVFTS.js → separator-CpAUELNs.js} +2 -2
  116. package/dist/chunks/{separator-D5AzVFTS.js.map → separator-CpAUELNs.js.map} +1 -1
  117. package/dist/chunks/{sidebar-5IA18LuP.js → sidebar-Dey1ZfGt.js} +54 -51
  118. package/dist/chunks/sidebar-Dey1ZfGt.js.map +1 -0
  119. package/dist/chunks/{sidebar-menu-DRWRxcJ3.js → sidebar-menu-ct8IiL4z.js} +2 -2
  120. package/dist/chunks/{sidebar-menu-DRWRxcJ3.js.map → sidebar-menu-ct8IiL4z.js.map} +1 -1
  121. package/dist/chunks/{skeleton-kfuqdl1a.js → skeleton-BM797MAg.js} +2 -2
  122. package/dist/chunks/{skeleton-kfuqdl1a.js.map → skeleton-BM797MAg.js.map} +1 -1
  123. package/dist/chunks/{slider-DbhjJ3ML.js → slider-Ds-tqY-1.js} +2 -2
  124. package/dist/chunks/{slider-DbhjJ3ML.js.map → slider-Ds-tqY-1.js.map} +1 -1
  125. package/dist/chunks/status-dot-BqVOlShY.js +29 -0
  126. package/dist/chunks/status-dot-BqVOlShY.js.map +1 -0
  127. package/dist/chunks/{styles-Btvg2DCf.js → styles-CVJU9t9v.js} +2 -2
  128. package/dist/chunks/{styles-Btvg2DCf.js.map → styles-CVJU9t9v.js.map} +1 -1
  129. package/dist/chunks/{swap-text-BhPI8DOf.js → swap-text-Cica0pUr.js} +2 -2
  130. package/dist/chunks/{swap-text-BhPI8DOf.js.map → swap-text-Cica0pUr.js.map} +1 -1
  131. package/dist/chunks/{switch-XMY_CQE-.js → switch-CSKMEomo.js} +3 -3
  132. package/dist/chunks/{switch-XMY_CQE-.js.map → switch-CSKMEomo.js.map} +1 -1
  133. package/dist/chunks/{table-DYKa86af.js → table-D-36EM7f.js} +2 -2
  134. package/dist/chunks/{table-DYKa86af.js.map → table-D-36EM7f.js.map} +1 -1
  135. package/dist/chunks/{tag-Dg89uYpV.js → tag-CwDKXVHj.js} +4 -4
  136. package/dist/chunks/{tag-Dg89uYpV.js.map → tag-CwDKXVHj.js.map} +1 -1
  137. package/dist/chunks/{text--5MKh2G4.js → text-Dvvgg5Jt.js} +3 -3
  138. package/dist/chunks/{text--5MKh2G4.js.map → text-Dvvgg5Jt.js.map} +1 -1
  139. package/dist/chunks/{textarea-Cj8iR82R.js → textarea-2d373OyU.js} +35 -31
  140. package/dist/chunks/textarea-2d373OyU.js.map +1 -0
  141. package/dist/chunks/timeseries-LRDAZHV0.js +339 -0
  142. package/dist/chunks/timeseries-LRDAZHV0.js.map +1 -0
  143. package/dist/chunks/{toolbar-Dw3uxpsE.js → toolbar-nVLFWH2i.js} +3 -3
  144. package/dist/chunks/{toolbar-Dw3uxpsE.js.map → toolbar-nVLFWH2i.js.map} +1 -1
  145. package/dist/chunks/{tooltip-DEbCCsru.js → tooltip-S1DmyLVl.js} +4 -4
  146. package/dist/chunks/{tooltip-DEbCCsru.js.map → tooltip-S1DmyLVl.js.map} +1 -1
  147. package/dist/chunks/{tooltip-root-DRd4ciUv.js → tooltip-root-vjylFUqw.js} +4 -4
  148. package/dist/chunks/{tooltip-root-DRd4ciUv.js.map → tooltip-root-vjylFUqw.js.map} +1 -1
  149. package/dist/chunks/{virtual-rows-BZe49bKi.js → virtual-rows-yAMjeAwj.js} +4 -3
  150. package/dist/chunks/virtual-rows-yAMjeAwj.js.map +1 -0
  151. package/dist/chunks/{zh-CN-C7GmVswt.js → zh-CN-CqEA4PCM.js} +37 -5
  152. package/dist/chunks/zh-CN-CqEA4PCM.js.map +1 -0
  153. package/dist/components/app-frame.js +2 -2
  154. package/dist/components/avatar.js +1 -1
  155. package/dist/components/badge.js +1 -1
  156. package/dist/components/banner.js +1 -1
  157. package/dist/components/button-group.js +33 -32
  158. package/dist/components/button-group.js.map +1 -1
  159. package/dist/components/button.js +1 -1
  160. package/dist/components/calendar.js +1 -1
  161. package/dist/components/charts/bar.js +34 -31
  162. package/dist/components/charts/bar.js.map +1 -1
  163. package/dist/components/charts/donut.js +2 -2
  164. package/dist/components/charts/gauge.js +2 -2
  165. package/dist/components/charts/heatmap.js +1 -1
  166. package/dist/components/charts/sankey.js +2 -2
  167. package/dist/components/charts/sparkline.js +1 -1
  168. package/dist/components/charts/timeseries.js +1 -252
  169. package/dist/components/charts.js +3 -3
  170. package/dist/components/checkbox.js +1 -1
  171. package/dist/components/code-block.js +2 -2
  172. package/dist/components/code.js +1 -1
  173. package/dist/components/collapsible.js +1 -1
  174. package/dist/components/combobox.js +1 -1
  175. package/dist/components/command-list.js +4 -0
  176. package/dist/components/command-palette.js +120 -171
  177. package/dist/components/command-palette.js.map +1 -1
  178. package/dist/components/copy-button.js +1 -1
  179. package/dist/components/data-table.js +251 -193
  180. package/dist/components/data-table.js.map +1 -1
  181. package/dist/components/date-picker.js +7 -7
  182. package/dist/components/date-picker.js.map +1 -1
  183. package/dist/components/dialog.js +7 -9
  184. package/dist/components/dialog.js.map +1 -1
  185. package/dist/components/display-options.js +67 -53
  186. package/dist/components/display-options.js.map +1 -1
  187. package/dist/components/empty.js +1 -1
  188. package/dist/components/field.js +1 -1
  189. package/dist/components/filter-chip.js +138 -63
  190. package/dist/components/filter-chip.js.map +1 -1
  191. package/dist/components/filter-row.js +2 -2
  192. package/dist/components/flow.js +2 -2
  193. package/dist/components/heading.js +1 -1
  194. package/dist/components/icon-button.js +1 -1
  195. package/dist/components/icon.js +1 -1
  196. package/dist/components/input.js +56 -54
  197. package/dist/components/input.js.map +1 -1
  198. package/dist/components/kaeso/conversation.js +88 -79
  199. package/dist/components/kaeso/conversation.js.map +1 -1
  200. package/dist/components/kaeso/identity.js +1 -1
  201. package/dist/components/kaeso/moments.js +8 -8
  202. package/dist/components/kaeso/moments.js.map +1 -1
  203. package/dist/components/kaeso/rights.js +1 -1
  204. package/dist/components/kaeso/usage.js +6 -6
  205. package/dist/components/kaeso/usage.js.map +1 -1
  206. package/dist/components/kaeso.js +212 -84
  207. package/dist/components/kaeso.js.map +1 -1
  208. package/dist/components/kbd.js +1 -1
  209. package/dist/components/key-value.js +3 -3
  210. package/dist/components/label.js +1 -1
  211. package/dist/components/layout.js +1 -1
  212. package/dist/components/link.js +1 -1
  213. package/dist/components/list.js +1 -1
  214. package/dist/components/loader.js +2 -2
  215. package/dist/components/logo.js +2 -2
  216. package/dist/components/markdown.js +1 -1
  217. package/dist/components/menu.js +2 -2
  218. package/dist/components/meter.js +1 -1
  219. package/dist/components/page-header.js +1 -1
  220. package/dist/components/pagination.js +1 -1
  221. package/dist/components/playground.js +654 -381
  222. package/dist/components/playground.js.map +1 -1
  223. package/dist/components/popover.js +2 -2
  224. package/dist/components/qr-code.js +1 -1
  225. package/dist/components/radio.js +1 -1
  226. package/dist/components/release-art.js +2 -0
  227. package/dist/components/scroll-area.js +1 -1
  228. package/dist/components/section.js +1 -1
  229. package/dist/components/segmented.js +1 -1
  230. package/dist/components/select.js +1 -1
  231. package/dist/components/separator.js +1 -1
  232. package/dist/components/settings.js +3 -3
  233. package/dist/components/sheet.js +69 -52
  234. package/dist/components/sheet.js.map +1 -1
  235. package/dist/components/sidebar.js +1 -1
  236. package/dist/components/skeleton.js +1 -1
  237. package/dist/components/slider.js +1 -1
  238. package/dist/components/stat.js +88 -74
  239. package/dist/components/stat.js.map +1 -1
  240. package/dist/components/status-dot.js +1 -1
  241. package/dist/components/surface.js +1 -1
  242. package/dist/components/swap-text.js +1 -1
  243. package/dist/components/switch.js +1 -1
  244. package/dist/components/table.js +1 -1
  245. package/dist/components/tabs.js +48 -49
  246. package/dist/components/tabs.js.map +1 -1
  247. package/dist/components/tag.js +1 -1
  248. package/dist/components/text.js +1 -1
  249. package/dist/components/theme-image.js +1 -1
  250. package/dist/components/theme-menu.js +2 -2
  251. package/dist/components/theme-select.js +1 -1
  252. package/dist/components/timeline.js +1 -1
  253. package/dist/components/toast.js +4 -4
  254. package/dist/components/toc.js +1 -1
  255. package/dist/components/toolbar.js +1 -1
  256. package/dist/components/tooltip.js +1 -1
  257. package/dist/components/visually-hidden.js +1 -1
  258. package/dist/format.js +132 -79
  259. package/dist/format.js.map +1 -1
  260. package/dist/i18n-provider.js +1 -1
  261. package/dist/index.js +115 -111
  262. package/dist/kaeso.css +43 -8
  263. package/dist/styles.css +1 -1
  264. package/dist/types/components/charts/bar.d.ts +6 -0
  265. package/dist/types/components/charts/core.d.ts +2 -2
  266. package/dist/types/components/charts/docs.d.ts +7 -0
  267. package/dist/types/components/charts/time-axis.d.ts +5 -0
  268. package/dist/types/components/charts/timeseries.d.ts +9 -0
  269. package/dist/types/components/code-block/highlighter.d.ts +2 -0
  270. package/dist/types/components/combobox/combobox.d.ts +2 -0
  271. package/dist/types/components/combobox/docs.d.ts +2 -4
  272. package/dist/types/components/command-list/command-list.d.ts +84 -0
  273. package/dist/types/components/command-list/docs.d.ts +52 -0
  274. package/dist/types/components/command-list/index.d.ts +3 -0
  275. package/dist/types/components/command-list/match.d.ts +1 -0
  276. package/dist/types/components/command-list/picker-popover.d.ts +44 -0
  277. package/dist/types/components/data-table/data-table.d.ts +3 -2
  278. package/dist/types/components/data-table/docs.d.ts +1 -0
  279. package/dist/types/components/date-picker/docs.d.ts +0 -6
  280. package/dist/types/components/dialog/dialog.d.ts +24 -0
  281. package/dist/types/components/dialog/docs.d.ts +4 -0
  282. package/dist/types/components/display-options/display-options.d.ts +1 -0
  283. package/dist/types/components/filter-chip/docs.d.ts +4 -0
  284. package/dist/types/components/filter-chip/filter-chip.d.ts +7 -0
  285. package/dist/types/components/input/docs.d.ts +2 -12
  286. package/dist/types/components/input/number-input.d.ts +1 -0
  287. package/dist/types/components/input/tag-input.d.ts +1 -0
  288. package/dist/types/components/kaeso/docs.d.ts +34 -0
  289. package/dist/types/components/kaeso/identity.d.ts +10 -1
  290. package/dist/types/components/kaeso/index.d.ts +1 -0
  291. package/dist/types/components/kaeso/provider-marks.d.ts +5 -1
  292. package/dist/types/components/kaeso/provider-picker.d.ts +42 -0
  293. package/dist/types/components/list/docs.d.ts +2 -0
  294. package/dist/types/components/list/list.d.ts +2 -0
  295. package/dist/types/components/menu/styles.d.ts +1 -1
  296. package/dist/types/components/playground/docs.d.ts +32 -0
  297. package/dist/types/components/playground/index.d.ts +1 -0
  298. package/dist/types/components/playground/model-picker.d.ts +39 -4
  299. package/dist/types/components/playground/reasoning.d.ts +29 -0
  300. package/dist/types/components/playground/response-view.d.ts +7 -1
  301. package/dist/types/components/release-art/docs.d.ts +13 -0
  302. package/dist/types/components/release-art/drawing.d.ts +48 -0
  303. package/dist/types/components/release-art/index.d.ts +1 -0
  304. package/dist/types/components/release-art/release-art.d.ts +37 -0
  305. package/dist/types/components/select/docs.d.ts +0 -2
  306. package/dist/types/components/select/option-checkbox.d.ts +1 -0
  307. package/dist/types/components/sidebar/sidebar.d.ts +1 -0
  308. package/dist/types/components/stat/docs.d.ts +1 -0
  309. package/dist/types/components/stat/stat.d.ts +1 -0
  310. package/dist/types/components/status-dot/docs.d.ts +2 -0
  311. package/dist/types/components/status-dot/status-dot.d.ts +2 -0
  312. package/dist/types/format/index.d.ts +8 -0
  313. package/dist/types/index.d.ts +2 -0
  314. package/dist/types/utils/index.d.ts +1 -1
  315. package/dist/types/utils/inset.d.ts +5 -0
  316. package/dist/types/utils/over-sheet.d.ts +1 -0
  317. package/dist/types/utils/restore-focus.d.ts +1 -1
  318. package/dist/utils.js +4 -4
  319. package/foundations/accessibility.md +1 -0
  320. package/foundations/layout.md +45 -0
  321. package/foundations/writing.md +1 -0
  322. package/package.json +2 -2
  323. package/dist/chunks/app-frame-BXh-06HL.js +0 -214
  324. package/dist/chunks/app-frame-BXh-06HL.js.map +0 -1
  325. package/dist/chunks/cn-CidVUKMm.js.map +0 -1
  326. package/dist/chunks/code-block-DxtladFW.js.map +0 -1
  327. package/dist/chunks/collapsible-Cw_1aem5.js.map +0 -1
  328. package/dist/chunks/combobox-D30Wt11R.js +0 -291
  329. package/dist/chunks/combobox-D30Wt11R.js.map +0 -1
  330. package/dist/chunks/core-K960A4OT.js.map +0 -1
  331. package/dist/chunks/de-CTAo4KL7.js.map +0 -1
  332. package/dist/chunks/dialog-LNKgPEsV.js +0 -319
  333. package/dist/chunks/dialog-LNKgPEsV.js.map +0 -1
  334. package/dist/chunks/field-d8V94bvZ.js.map +0 -1
  335. package/dist/chunks/field-press-DwzBFafd.js +0 -10
  336. package/dist/chunks/field-press-DwzBFafd.js.map +0 -1
  337. package/dist/chunks/identity-BtZC_d_Q.js +0 -342
  338. package/dist/chunks/identity-BtZC_d_Q.js.map +0 -1
  339. package/dist/chunks/input-group-CYA1MEoZ.js.map +0 -1
  340. package/dist/chunks/inset-BLMdxX4I.js.map +0 -1
  341. package/dist/chunks/list-CzaiyNja.js +0 -483
  342. package/dist/chunks/list-CzaiyNja.js.map +0 -1
  343. package/dist/chunks/nav-sheet-BIErlV74.js +0 -58
  344. package/dist/chunks/nav-sheet-BIErlV74.js.map +0 -1
  345. package/dist/chunks/range-popup-DGOnGGag.js +0 -111
  346. package/dist/chunks/range-popup-DGOnGGag.js.map +0 -1
  347. package/dist/chunks/resize-motion-CMaidkwe.js.map +0 -1
  348. package/dist/chunks/rights-BbiJ0AJB.js.map +0 -1
  349. package/dist/chunks/select-Bc4kRiSG.js.map +0 -1
  350. package/dist/chunks/sidebar-5IA18LuP.js.map +0 -1
  351. package/dist/chunks/status-dot-CBoQpyL4.js +0 -25
  352. package/dist/chunks/status-dot-CBoQpyL4.js.map +0 -1
  353. package/dist/chunks/textarea-Cj8iR82R.js.map +0 -1
  354. package/dist/chunks/virtual-rows-BZe49bKi.js.map +0 -1
  355. package/dist/chunks/zh-CN-C7GmVswt.js.map +0 -1
  356. package/dist/components/charts/timeseries.js.map +0 -1
@@ -1,223 +1,228 @@
1
1
  "use client";
2
- import { t as e } from "../chunks/cn-CidVUKMm.js";
2
+ import { t as e } from "../chunks/cn-DUDmdLpZ.js";
3
3
  import { t } from "../chunks/use-controllable-B5Fd12Bx.js";
4
- import { i as n } from "../chunks/context-BELWW79w.js";
5
- import { formatDuration as r, formatNumber as i, formatUSD as a } from "../format.js";
6
- import { t as o } from "../chunks/icon-CeNQtobn.js";
7
- import { t as s } from "../chunks/use-truncated-CW0hByYt.js";
8
- import { n as c } from "../chunks/button-DQvoOxVQ.js";
9
- import { t as l } from "../chunks/icon-button-_x1RUphC.js";
10
- import { o as u, r as d } from "../chunks/textarea-Cj8iR82R.js";
11
- import { r as f } from "../chunks/slider-DbhjJ3ML.js";
12
- import { r as p } from "../chunks/segmented-MrinfDL8.js";
13
- import { n as m, r as h } from "../chunks/select-Bc4kRiSG.js";
14
- import { i as g } from "../chunks/popover-BE7VO-a4.js";
15
- import { i as _, l as v } from "../chunks/identity-BtZC_d_Q.js";
16
- import { r as y } from "../chunks/markdown-5NyaHHfN.js";
17
- import { Children as b, createContext as x, forwardRef as S, isValidElement as C, useCallback as w, useContext as T, useEffect as E, useId as D, useLayoutEffect as O, useRef as k, useState as A, useSyncExternalStore as j } from "react";
18
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
19
- import { Add01Icon as F, ArrowLeft01Icon as I, ArrowRight01Icon as L, Cancel01Icon as R, SlidersHorizontalIcon as z } from "@hugeicons/core-free-icons";
20
- import { Collapsible as B } from "@base-ui/react/collapsible";
4
+ import { i as n, r } from "../chunks/context-BELWW79w.js";
5
+ import { formatContext as i, formatDuration as a, formatNumber as o, formatUSD as s } from "../format.js";
6
+ import { t as c } from "../chunks/icon-BqujXDUc.js";
7
+ import { t as l } from "../chunks/use-truncated-CW0hByYt.js";
8
+ import { n as u } from "../chunks/button-CAPyW-v8.js";
9
+ import { t as d } from "../chunks/icon-button-D4O4puwH.js";
10
+ import { a as f, o as p, s as m } from "../chunks/field-BZriODU7.js";
11
+ import { o as h, r as g } from "../chunks/textarea-2d373OyU.js";
12
+ import { r as _ } from "../chunks/slider-Ds-tqY-1.js";
13
+ import { r as v } from "../chunks/switch-CSKMEomo.js";
14
+ import { r as y } from "../chunks/segmented-DXKVF-nY.js";
15
+ import { n as b, r as x } from "../chunks/select-Bbv2f5F8.js";
16
+ import { i as S } from "../chunks/popover-bjxg020P.js";
17
+ import { r as C } from "../chunks/combobox-DqtzsAKG.js";
18
+ import { a as ee, t as w } from "../chunks/command-list-D5k0uvkR.js";
19
+ import { i as T, r as E } from "../chunks/picker-popover-C4ElNk7t.js";
20
+ import { a as D, o as O, t as k, u as A } from "../chunks/identity-CsZvAUwu.js";
21
+ import { r as j } from "../chunks/markdown-DWyxjsSY.js";
22
+ import { Children as M, createContext as te, forwardRef as N, isValidElement as ne, useCallback as P, useContext as re, useEffect as F, useId as ie, useLayoutEffect as I, useMemo as L, useRef as R, useState as z, useSyncExternalStore as ae } from "react";
23
+ import { Fragment as oe, jsx as B, jsxs as V } from "react/jsx-runtime";
24
+ import { Add01Icon as se, ArrowLeft01Icon as ce, ArrowRight01Icon as H, Cancel01Icon as U, SlidersHorizontalIcon as W } from "@hugeicons/core-free-icons";
25
+ import { Collapsible as G } from "@base-ui/react/collapsible";
21
26
  //#region src/components/playground/composer.tsx
22
- var V = { size: {
27
+ var le = { size: {
23
28
  md: { classes: "rounded-frame" },
24
29
  sm: { classes: "rounded-frame" }
25
- } }, H = { size: "md" }, U = "(pointer: coarse)";
26
- function W(e) {
30
+ } }, K = { size: "md" }, ue = "(pointer: coarse)";
31
+ function q(e) {
27
32
  if (typeof window > "u" || !window.matchMedia) return () => {};
28
- let t = window.matchMedia(U);
33
+ let t = window.matchMedia(ue);
29
34
  return t.addEventListener?.("change", e), () => t.removeEventListener?.("change", e);
30
35
  }
31
- var G = () => typeof window < "u" && !!window.matchMedia?.(U).matches, ee = () => j(W, G, () => !1), K = /* @__PURE__ */ S(function({ value: r, defaultValue: i = "", onValueChange: a, onSubmit: o, onStop: s, submitOn: l = "enter", streaming: u = !1, loading: d = !1, disabled: f = !1, clearOnSubmit: p = !0, placeholder: m, "aria-label": h, maxRows: g = 10, size: _ = "md", actions: v, submitLabel: y, stopLabel: b, autoFocus: x, name: S, "data-force": C, className: T }, E) {
32
- let D = n(), A = m ?? D("composer.placeholder", "Write a prompt"), j = h ?? D("composer.prompt", "Prompt"), M = y ?? D("composer.send", "Send"), F = b ?? D("composer.stop", "Stop"), [I, L] = t(r, i, a), R = k(null), z = _ === "sm" ? 1 : 2, B = w(() => {
33
- let e = R.current;
34
- e && (e.style.height = "auto", e.style.height = `${Math.min(Math.max(e.scrollHeight, z * 20 + 16), g * 20 + 16)}px`);
35
- }, [g, z]);
36
- O(B, [B, I]);
37
- let H = I.trim() === "", U = !f && !u && !d && !H, W = () => {
38
- U && (o?.(I), p && r === void 0 && L(""));
39
- }, G = ee(), K = l === "enter" && !G, q = (e) => {
40
- e.key === "Enter" && (e.nativeEvent.isComposing || e.keyCode === 229 || (e.metaKey || e.ctrlKey || K && !e.shiftKey && !e.altKey) && (e.preventDefault(), W()));
36
+ var de = () => typeof window < "u" && !!window.matchMedia?.(ue).matches, fe = () => ae(q, de, () => !1), pe = /* @__PURE__ */ N(function({ value: r, defaultValue: i = "", onValueChange: a, onSubmit: o, onStop: s, submitOn: c = "enter", streaming: l = !1, loading: d = !1, disabled: f = !1, clearOnSubmit: p = !0, placeholder: m, "aria-label": h, maxRows: g = 10, size: _ = "md", actions: v, submitLabel: y, stopLabel: b, autoFocus: x, name: S, "data-force": C, className: ee }, w) {
37
+ let T = n(), E = m ?? T("composer.placeholder", "Write a prompt"), D = h ?? T("composer.prompt", "Prompt"), O = y ?? T("composer.send", "Send"), k = b ?? T("composer.stop", "Stop"), [A, j] = t(r, i, a), M = R(null), te = _ === "sm" ? 1 : 2, N = P(() => {
38
+ let e = M.current;
39
+ e && (e.style.height = "auto", e.style.height = `${Math.min(Math.max(e.scrollHeight, te * 20 + 16), g * 20 + 16)}px`);
40
+ }, [g, te]);
41
+ I(N, [N, A]);
42
+ let ne = A.trim() === "", re = !f && !l && !d && !ne, F = () => {
43
+ re && (o?.(A), p && r === void 0 && j(""));
44
+ }, ie = fe(), L = c === "enter" && !ie, z = (e) => {
45
+ e.key === "Enter" && (e.nativeEvent.isComposing || e.keyCode === 229 || (e.metaKey || e.ctrlKey || L && !e.shiftKey && !e.altKey) && (e.preventDefault(), F()));
41
46
  };
42
- return /* @__PURE__ */ P("form", {
47
+ return /* @__PURE__ */ V("form", {
43
48
  onSubmit: (e) => {
44
- e.preventDefault(), W();
49
+ e.preventDefault(), F();
45
50
  },
46
51
  onMouseDown: (e) => {
47
- e.target === e.currentTarget && !f && (e.preventDefault(), R.current?.focus());
52
+ e.target === e.currentTarget && !f && (e.preventDefault(), M.current?.focus());
48
53
  },
49
54
  ...C ? { "data-force": C } : {},
50
55
  ...f ? { "data-disabled": "" } : {},
51
- className: e("flex min-w-0 cursor-text flex-col material-composer transition-control", V.size[_].classes, f && "cursor-not-allowed", T),
52
- children: [/* @__PURE__ */ N("textarea", {
56
+ className: e("flex min-w-0 cursor-text flex-col material-composer transition-control", le.size[_].classes, f && "cursor-not-allowed", ee),
57
+ children: [/* @__PURE__ */ B("textarea", {
53
58
  ref: (e) => {
54
- R.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
59
+ M.current = e, typeof w == "function" ? w(e) : w && (w.current = e);
55
60
  },
56
- rows: z,
57
- value: I,
58
- onChange: (e) => L(e.target.value),
59
- onKeyDown: q,
61
+ rows: te,
62
+ value: A,
63
+ onChange: (e) => j(e.target.value),
64
+ onKeyDown: z,
60
65
  disabled: f,
61
- placeholder: A,
62
- "aria-label": j,
63
- "aria-keyshortcuts": K ? "Enter Meta+Enter Control+Enter" : "Meta+Enter Control+Enter",
64
- ...K ? { enterKeyHint: "send" } : {},
66
+ placeholder: E,
67
+ "aria-label": D,
68
+ "aria-keyshortcuts": L ? "Enter Meta+Enter Control+Enter" : "Meta+Enter Control+Enter",
69
+ ...L ? { enterKeyHint: "send" } : {},
65
70
  autoFocus: x,
66
71
  ...S ? { name: S } : {},
67
72
  className: "block w-full min-w-0 resize-none bg-transparent px-16 pt-12 pb-4 text-body text-fg outline-none scrollbar-quiet placeholder:text-fg-tertiary disabled:cursor-not-allowed disabled:text-fg-disabled"
68
- }), /* @__PURE__ */ P("div", {
73
+ }), /* @__PURE__ */ V("div", {
69
74
  className: "flex min-w-0 items-center gap-8 p-8 pt-4",
70
- children: [/* @__PURE__ */ N("div", {
75
+ children: [/* @__PURE__ */ B("div", {
71
76
  className: "flex min-w-0 flex-1 items-center gap-4",
72
77
  children: v
73
- }), u ? /* @__PURE__ */ N(c, {
78
+ }), l ? /* @__PURE__ */ B(u, {
74
79
  type: "button",
75
80
  size: "sm",
76
81
  variant: "secondary",
77
- reserveLabels: [M, F],
82
+ reserveLabels: [O, k],
78
83
  onClick: () => s?.(),
79
84
  disabled: f,
80
- children: F
81
- }) : /* @__PURE__ */ N(c, {
85
+ children: k
86
+ }) : /* @__PURE__ */ B(u, {
82
87
  type: "submit",
83
88
  size: "sm",
84
89
  variant: "primary",
85
- reserveLabels: [M, F],
90
+ reserveLabels: [O, k],
86
91
  loading: d,
87
- disabled: !U && !d,
88
- children: M
92
+ disabled: !re && !d,
93
+ children: O
89
94
  })]
90
95
  })]
91
96
  });
92
97
  });
93
- process.env.NODE_ENV !== "production" && (K.displayName = "Composer");
98
+ process.env.NODE_ENV !== "production" && (pe.displayName = "Composer");
94
99
  //#endregion
95
100
  //#region src/components/playground/compare-grid.tsx
96
- var q = { divider: {
101
+ var J = { divider: {
97
102
  hairline: { classes: "hairline-l" },
98
103
  none: { classes: "" }
99
- } }, te = { divider: "hairline" }, J = /* @__PURE__ */ x({
104
+ } }, Y = { divider: "hairline" }, X = /* @__PURE__ */ te({
100
105
  index: 0,
101
106
  count: 1,
102
107
  divider: "hairline",
103
108
  add: null
104
- }), Y = /* @__PURE__ */ S(function({ children: t, "aria-label": r, onAdd: i, addLabel: a, max: o = 4, active: s, onActiveChange: c, divider: u = "hairline", className: d }, f) {
105
- let p = n(), m = b.toArray(t).filter(C), h = m.length, g = k(null), [_, v] = A(0), y = Math.min(s ?? _, Math.max(0, h - 1)), x = k(null), S = k(c);
106
- O(() => {
107
- S.current = c;
109
+ }), me = /* @__PURE__ */ N(function({ children: t, "aria-label": r, onAdd: i, addLabel: a, max: o = 4, active: s, onActiveChange: c, divider: l = "hairline", className: u }, f) {
110
+ let p = n(), m = M.toArray(t).filter(ne), h = m.length, g = R(null), [_, v] = z(0), y = Math.min(s ?? _, Math.max(0, h - 1)), b = R(null), x = R(c);
111
+ I(() => {
112
+ x.current = c;
108
113
  });
109
- let T = w((e) => {
114
+ let S = P((e) => {
110
115
  let t = g.current?.children[e], n = g.current;
111
116
  if (!t || !n) return;
112
- x.current = n.scrollLeft === t.offsetLeft ? null : e;
117
+ b.current = n.scrollLeft === t.offsetLeft ? null : e;
113
118
  let r = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
114
119
  n.scrollTo({
115
120
  left: t.offsetLeft,
116
121
  behavior: r ? "auto" : "smooth"
117
122
  });
118
- }, []), D = (e) => {
123
+ }, []), C = (e) => {
119
124
  let t = Math.max(0, Math.min(h - 1, e));
120
- v(t), c?.(t), T(t);
125
+ v(t), c?.(t), S(t);
121
126
  };
122
- E(() => {
123
- s !== void 0 && T(s);
124
- }, [s, T]);
125
- let j = k(h);
126
- O(() => {
127
- h > j.current && (v(h - 1), S.current?.(h - 1), T(h - 1)), j.current = h;
128
- }, [h, T]);
129
- let M = w(() => {
127
+ F(() => {
128
+ s !== void 0 && S(s);
129
+ }, [s, S]);
130
+ let ee = R(h);
131
+ I(() => {
132
+ h > ee.current && (v(h - 1), x.current?.(h - 1), S(h - 1)), ee.current = h;
133
+ }, [h, S]);
134
+ let w = P(() => {
130
135
  let e = g.current;
131
136
  if (!e) return;
132
137
  let t = e.scrollWidth - e.clientWidth - e.scrollLeft;
133
138
  e.style.setProperty("--k-fade-start", e.scrollLeft > 1 ? "24px" : "0px"), e.style.setProperty("--k-fade-end", t > 1 ? "24px" : "0px");
134
139
  }, []);
135
- O(() => {
140
+ I(() => {
136
141
  let e = g.current;
137
142
  if (!e || typeof ResizeObserver > "u") return;
138
- M();
139
- let t = new ResizeObserver(M);
143
+ w();
144
+ let t = new ResizeObserver(w);
140
145
  return t.observe(e), () => t.disconnect();
141
- }, [M, h]);
142
- let R = () => {
143
- M();
146
+ }, [w, h]);
147
+ let T = () => {
148
+ w();
144
149
  let e = g.current, t = e?.children[0];
145
150
  if (!e || !t || !t.offsetWidth) return;
146
151
  let n = Math.max(0, Math.min(h - 1, Math.round(e.scrollLeft / t.offsetWidth)));
147
- if (x.current !== null) {
148
- if (n !== x.current) return;
149
- x.current = null;
152
+ if (b.current !== null) {
153
+ if (n !== b.current) return;
154
+ b.current = null;
150
155
  }
151
156
  n !== y && (v(n), c?.(n));
152
- }, z = () => {
153
- x.current = null;
154
- }, B = h >= o, V = i ? /* @__PURE__ */ N(l, {
155
- icon: F,
157
+ }, E = () => {
158
+ b.current = null;
159
+ }, D = h >= o, O = i ? /* @__PURE__ */ B(d, {
160
+ icon: se,
156
161
  "aria-label": a ?? p("compareGrid.addModel", "Add model"),
157
162
  size: "sm",
158
163
  onClick: i,
159
- disabled: B,
160
- ...B ? { disabledReason: p("compareGrid.compareUpTo", "Compare up to {max} at once", { max: o }) } : {}
161
- }) : null, H = m[y]?.props.label ?? "";
162
- return /* @__PURE__ */ P("div", {
164
+ disabled: D,
165
+ ...D ? { disabledReason: p("compareGrid.compareUpTo", "Compare up to {max} at once", { max: o }) } : {}
166
+ }) : null, k = m[y]?.props.label ?? "";
167
+ return /* @__PURE__ */ V("div", {
163
168
  ref: f,
164
169
  role: "group",
165
170
  "aria-label": r,
166
- className: e("flex h-full min-h-0 min-w-0 flex-col", d),
167
- children: [h > 1 || i ? /* @__PURE__ */ P("div", {
168
- className: "flex h-44 shrink-0 items-center gap-4 px-8 hairline-b md:hidden",
171
+ className: e("flex h-full min-h-0 min-w-0 flex-col", u),
172
+ children: [h > 1 || i ? /* @__PURE__ */ V("div", {
173
+ className: "flex h-44 shrink-0 items-center gap-4 px-24 hairline-b md:hidden",
169
174
  children: [
170
- /* @__PURE__ */ N(l, {
171
- icon: I,
175
+ /* @__PURE__ */ B(d, {
176
+ icon: ce,
172
177
  "aria-label": p("compareGrid.previousColumn", "Previous column"),
173
178
  size: "sm",
174
179
  disabled: y === 0,
175
- onClick: () => D(y - 1)
180
+ onClick: () => C(y - 1)
176
181
  }),
177
- /* @__PURE__ */ P("span", {
182
+ /* @__PURE__ */ V("span", {
178
183
  "aria-live": "polite",
179
184
  className: "min-w-0 flex-1 truncate text-center text-small text-fg-secondary tabular",
180
- children: [/* @__PURE__ */ N("span", {
185
+ children: [/* @__PURE__ */ B("span", {
181
186
  className: "sr-only",
182
- children: p("compareGrid.columnName", "{label}, ", { label: H })
187
+ children: p("compareGrid.columnName", "{label}, ", { label: k })
183
188
  }), p("compareGrid.position", "{index} of {count}", {
184
189
  index: y + 1,
185
190
  count: h
186
191
  })]
187
192
  }),
188
- /* @__PURE__ */ N(l, {
189
- icon: L,
193
+ /* @__PURE__ */ B(d, {
194
+ icon: H,
190
195
  "aria-label": p("compareGrid.nextColumn", "Next column"),
191
196
  size: "sm",
192
197
  disabled: y >= h - 1,
193
- onClick: () => D(y + 1)
198
+ onClick: () => C(y + 1)
194
199
  }),
195
- V
200
+ O
196
201
  ]
197
- }) : null, /* @__PURE__ */ N("div", {
202
+ }) : null, /* @__PURE__ */ B("div", {
198
203
  ref: g,
199
- onScroll: R,
200
- onPointerDown: z,
201
- onWheel: z,
202
- onTouchStart: z,
203
- onKeyDown: z,
204
+ onScroll: T,
205
+ onPointerDown: E,
206
+ onWheel: E,
207
+ onTouchStart: E,
208
+ onKeyDown: E,
204
209
  className: "relative min-h-0 min-w-0 flex-1 compare-grid",
205
- children: m.map((e, t) => /* @__PURE__ */ N(J.Provider, {
210
+ children: m.map((e, t) => /* @__PURE__ */ B(X.Provider, {
206
211
  value: {
207
212
  index: t,
208
213
  count: h,
209
- divider: u,
210
- add: t === h - 1 ? V : null
214
+ divider: l,
215
+ add: t === h - 1 ? O : null
211
216
  },
212
217
  children: e
213
218
  }, e.key ?? t))
214
219
  })]
215
220
  });
216
221
  });
217
- process.env.NODE_ENV !== "production" && (Y.displayName = "CompareGrid");
218
- function ne(e) {
219
- let t = k(null), n = k(null), r = k(!0);
220
- return E(() => {
222
+ process.env.NODE_ENV !== "production" && (me.displayName = "CompareGrid");
223
+ function he(e) {
224
+ let t = R(null), n = R(null), r = R(!0);
225
+ return F(() => {
221
226
  let i = t.current, a = n.current;
222
227
  if (!e || !i || !a || typeof ResizeObserver > "u") return;
223
228
  let o = i.scrollTop, s = () => {
@@ -237,61 +242,61 @@ function ne(e) {
237
242
  content: n
238
243
  };
239
244
  }
240
- var re = /* @__PURE__ */ S(function({ label: t, header: r, actions: i, children: a, footer: o, onRemove: s, removeLabel: c, stickToEnd: u = !0, className: d }, f) {
241
- let p = n(), { index: m, count: h, divider: g, add: _ } = T(J), { body: v, content: y } = ne(u);
242
- return /* @__PURE__ */ P("section", {
245
+ var Z = /* @__PURE__ */ N(function({ label: t, header: r, actions: i, children: a, footer: o, onRemove: s, removeLabel: c, stickToEnd: l = !0, className: u }, f) {
246
+ let p = n(), { index: m, count: h, divider: g, add: _ } = re(X), { body: v, content: y } = he(l);
247
+ return /* @__PURE__ */ V("section", {
243
248
  ref: f,
244
249
  "aria-label": t,
245
- className: e("row-span-3 grid min-h-0 min-w-0 snap-start snap-always grid-rows-subgrid", m > 0 && q.divider[g].classes, d),
250
+ className: e("row-span-3 grid min-h-0 min-w-0 snap-start snap-always grid-rows-subgrid", m > 0 && J.divider[g].classes, u),
246
251
  children: [
247
- /* @__PURE__ */ P("header", {
248
- className: "flex h-52 min-w-0 items-center gap-4 pr-10 pl-8 hairline-b",
252
+ /* @__PURE__ */ V("header", {
253
+ className: "flex h-52 min-w-0 items-center gap-4 px-24 hairline-b",
249
254
  children: [
250
- /* @__PURE__ */ N("div", {
255
+ /* @__PURE__ */ B("div", {
251
256
  className: "flex min-w-0 flex-1 items-center",
252
257
  children: r
253
258
  }),
254
259
  i,
255
- s && h > 1 && /* @__PURE__ */ N(l, {
256
- icon: R,
260
+ s && h > 1 && /* @__PURE__ */ B(d, {
261
+ icon: U,
257
262
  "aria-label": c ?? p("compareGrid.remove", "Remove {label}", { label: t }),
258
263
  size: "sm",
259
264
  onClick: s
260
265
  }),
261
- _ && /* @__PURE__ */ N("span", {
266
+ _ && /* @__PURE__ */ B("span", {
262
267
  className: "hidden md:contents",
263
268
  children: _
264
269
  })
265
270
  ]
266
271
  }),
267
- /* @__PURE__ */ N("div", {
272
+ /* @__PURE__ */ B("div", {
268
273
  ref: v,
269
274
  tabIndex: 0,
270
275
  "aria-label": p("compareGrid.thread", "{label} thread", { label: t }),
271
276
  role: "region",
272
277
  className: "relative min-h-0 overflow-y-auto overscroll-contain scrollbar-quiet scroll-fade-y focus-ring-inset",
273
- children: /* @__PURE__ */ N("div", {
278
+ children: /* @__PURE__ */ B("div", {
274
279
  ref: y,
275
- className: "flex min-h-full flex-col px-16 pt-16 pb-24",
280
+ className: "flex min-h-full flex-col px-24 pt-16 pb-24",
276
281
  children: a
277
282
  })
278
283
  }),
279
- o != null && /* @__PURE__ */ N("footer", {
280
- className: "flex min-h-44 min-w-0 items-center px-16 pt-8 pb-12",
281
- children: o
284
+ o != null && /* @__PURE__ */ B("footer", {
285
+ className: "flex min-h-44 min-w-0 items-start px-24 pt-12 pb-12",
286
+ children: /* @__PURE__ */ B("div", {
287
+ className: "min-w-0 px-12",
288
+ children: o
289
+ })
282
290
  })
283
291
  ]
284
292
  });
285
293
  });
286
- process.env.NODE_ENV !== "production" && (re.displayName = "CompareGrid.Column");
287
- var ie = /* @__PURE__ */ Object.assign(Y, { Column: re }), ae = { status: {
288
- pending: { classes: "" },
289
- streaming: { classes: "" },
294
+ process.env.NODE_ENV !== "production" && (Z.displayName = "CompareGrid.Column");
295
+ var ge = /* @__PURE__ */ Object.assign(me, { Column: Z }), _e = { state: {
290
296
  done: { classes: "" },
291
- stopped: { classes: "" },
292
- error: { classes: "" }
293
- } }, oe = { status: "done" };
294
- function se(e) {
297
+ live: { classes: "" }
298
+ } }, ve = { state: "done" };
299
+ function ye(e) {
295
300
  let t = e.trim().split("\n");
296
301
  for (let e = t.length - 1; e >= 0; e--) {
297
302
  let n = (t[e] ?? "").replace(/[*_`#>]+/g, "").trim();
@@ -299,43 +304,44 @@ function se(e) {
299
304
  }
300
305
  return "";
301
306
  }
302
- function ce({ text: t, live: i, duration: a, open: s, defaultOpen: c, onOpenChange: l }) {
303
- let u = n(), d = i ? se(t) : "", f = i || a === void 0 ? u("responseView.thinking", "Thinking") : u("responseView.thoughtFor", "Thought for {duration}", { duration: r(a) });
304
- return /* @__PURE__ */ P(B.Root, {
305
- ...s === void 0 ? {} : { open: s },
306
- ...c === void 0 ? {} : { defaultOpen: c },
307
- ...l ? { onOpenChange: (e) => l(e) } : {},
308
- className: "flex min-w-0 flex-col",
309
- children: [/* @__PURE__ */ P(B.Trigger, {
310
- className: "group/think -mx-8 flex h-32 min-w-0 cursor-pointer items-center gap-6 rounded-pill px-8 text-left text-small text-fg-secondary transition-control hover:bg-fill-1 hover:text-fg focus-ring-inset",
307
+ var be = /* @__PURE__ */ N(function({ text: t = "", live: r = !1, duration: i, title: o, hint: s, open: l, defaultOpen: u, onOpenChange: d, children: f, className: p }, m) {
308
+ let h = n(), g = s ?? (r ? ye(t) : ""), _ = o ?? (!r && i !== void 0 ? h("responseView.thoughtFor", "Thought for {duration}", { duration: a(i) }) : h("responseView.thinking", "Thinking"));
309
+ return /* @__PURE__ */ V(G.Root, {
310
+ ref: m,
311
+ ...l === void 0 ? {} : { open: l },
312
+ ...u === void 0 ? {} : { defaultOpen: u },
313
+ ...d ? { onOpenChange: (e) => d(e) } : {},
314
+ className: e("flex min-w-0 flex-col", p),
315
+ children: [/* @__PURE__ */ V(G.Trigger, {
316
+ className: "group/think flex h-32 min-w-0 cursor-pointer items-center gap-6 rounded-pill px-12 text-left text-small text-fg-secondary transition-control hover:bg-fill-1 hover:text-fg focus-ring-inset",
311
317
  children: [
312
- /* @__PURE__ */ N("span", {
313
- className: e("shrink-0 font-medium", i && "animate-pulse-quiet reduced:animate-none"),
314
- children: f
318
+ /* @__PURE__ */ B("span", {
319
+ className: e("shrink-0 font-medium", r && "animate-pulse-quiet reduced:animate-none"),
320
+ children: _
315
321
  }),
316
- /* @__PURE__ */ N(o, {
317
- icon: L,
322
+ /* @__PURE__ */ B(c, {
323
+ icon: H,
318
324
  size: "xs",
319
325
  className: "shrink-0 text-fg-tertiary transition-transform duration-180 ease-overlay group-data-panel-open/think:rotate-90"
320
326
  }),
321
- /* @__PURE__ */ N("span", {
322
- "aria-hidden": !0,
327
+ /* @__PURE__ */ B("span", {
328
+ "aria-hidden": s === void 0,
323
329
  className: "min-w-0 flex-1 truncate text-fg-tertiary group-data-panel-open/think:invisible",
324
- children: d
330
+ children: g
325
331
  })
326
332
  ]
327
- }), /* @__PURE__ */ N(B.Panel, {
333
+ }), /* @__PURE__ */ B(G.Panel, {
328
334
  className: "collapse-motion",
329
- children: /* @__PURE__ */ P("div", {
330
- className: "flex gap-12 pt-4 pb-8",
331
- children: [/* @__PURE__ */ N("span", {
335
+ children: /* @__PURE__ */ V("div", {
336
+ className: "flex gap-12 pt-4 pb-8 pl-12",
337
+ children: [/* @__PURE__ */ B("span", {
332
338
  "aria-hidden": !0,
333
339
  className: "w-1 shrink-0 rounded-pill bg-line"
334
- }), /* @__PURE__ */ N(y, {
340
+ }), f ?? /* @__PURE__ */ B(j, {
335
341
  text: t,
336
342
  size: "small",
337
343
  tone: "secondary",
338
- streaming: i,
344
+ streaming: r,
339
345
  collapseAfter: 0,
340
346
  wrapCode: !0,
341
347
  className: "min-w-0 flex-1"
@@ -343,89 +349,127 @@ function ce({ text: t, live: i, duration: a, open: s, defaultOpen: c, onOpenChan
343
349
  })
344
350
  })]
345
351
  });
352
+ });
353
+ process.env.NODE_ENV !== "production" && (be.displayName = "Reasoning");
354
+ //#endregion
355
+ //#region src/components/playground/response-view.tsx
356
+ var Q = { status: {
357
+ pending: { classes: "" },
358
+ streaming: { classes: "" },
359
+ done: { classes: "" },
360
+ stopped: { classes: "" },
361
+ incomplete: { classes: "" },
362
+ error: { classes: "" }
363
+ } }, xe = { status: "done" };
364
+ function Se(e, t) {
365
+ return t === "max_output_tokens" ? e("responseView.outputLimit", "Stopped at the output limit") : t === "content_filter" ? e("responseView.contentFilter", "Stopped by the provider's content filter") : e("responseView.incomplete", "The model ended the response early");
346
366
  }
347
- var le = /* @__PURE__ */ S(function({ text: t = "", reasoning: r, status: i = "done", reasoningDuration: a, reasoningOpen: o, defaultReasoningOpen: s, onReasoningOpenChange: l, onRetry: u, footer: d, "aria-label": f, className: p }, m) {
348
- let h = n(), g = f ?? h("responseView.response", "Response"), _ = D(), v = i === "pending" || i === "streaming", b = t.trim() !== "", x = !!r && r.trim() !== "", S = v && x && !b;
349
- return /* @__PURE__ */ P("article", {
350
- ref: m,
351
- "aria-label": g,
352
- "aria-busy": v || void 0,
353
- "aria-describedby": _,
354
- className: e("flex min-w-0 flex-col gap-8", p),
367
+ var Ce = /* @__PURE__ */ N(function({ text: t = "", reasoning: r, status: i = "done", reasoningDuration: a, reasoningOpen: o, defaultReasoningOpen: s, onReasoningOpenChange: c, incompleteReason: l, error: d, onRetry: f, footer: p, "aria-label": m, className: h }, g) {
368
+ let _ = n(), v = m ?? _("responseView.response", "Response"), y = ie(), b = i === "pending" || i === "streaming", x = t.trim() !== "", S = !!r && r.trim() !== "", C = b && S && !x;
369
+ return /* @__PURE__ */ V("article", {
370
+ ref: g,
371
+ "aria-label": v,
372
+ "aria-busy": b || void 0,
373
+ "aria-describedby": y,
374
+ className: e("flex min-w-0 flex-col gap-8", h),
355
375
  children: [
356
- x && /* @__PURE__ */ N(ce, {
376
+ S && /* @__PURE__ */ B(be, {
357
377
  text: r,
358
- live: S,
378
+ live: C,
359
379
  duration: a,
360
380
  open: o,
361
381
  defaultOpen: s,
362
- onOpenChange: l
382
+ onOpenChange: c
363
383
  }),
364
- b ? /* @__PURE__ */ N(y, {
384
+ x ? /* @__PURE__ */ B(j, {
365
385
  text: t,
366
386
  size: "lg",
367
- streaming: v,
387
+ streaming: b,
368
388
  collapseAfter: 0,
369
- wrapCode: !0
370
- }) : v && !x ? /* @__PURE__ */ N("div", {
389
+ wrapCode: !0,
390
+ className: "px-12"
391
+ }) : b && !S ? /* @__PURE__ */ B("div", {
371
392
  "aria-hidden": !0,
372
- className: "h-22"
393
+ className: "h-22 px-12"
373
394
  }) : null,
374
- i === "stopped" && /* @__PURE__ */ P("div", {
375
- className: "flex min-h-24 flex-wrap items-center gap-x-12 gap-y-4",
376
- children: [/* @__PURE__ */ N("span", {
395
+ i === "stopped" && /* @__PURE__ */ V("div", {
396
+ className: "flex min-h-24 flex-wrap items-center gap-x-12 gap-y-4 px-12",
397
+ children: [/* @__PURE__ */ B("span", {
377
398
  className: "text-small text-fg-tertiary",
378
- children: b ? h("responseView.stopped", "Stopped") : h("responseView.stoppedBeforeResponse", "Stopped before a response")
379
- }), u && /* @__PURE__ */ N(c, {
399
+ children: x ? _("responseView.stopped", "Stopped") : _("responseView.stoppedBeforeResponse", "Stopped before a response")
400
+ }), f && /* @__PURE__ */ B(u, {
380
401
  size: "xs",
381
402
  variant: "ghost",
382
- onClick: u,
383
- children: h("responseView.retry", "Retry")
403
+ onClick: f,
404
+ children: _("responseView.retry", "Retry")
384
405
  })]
385
406
  }),
386
- i === "error" && /* @__PURE__ */ P("div", {
387
- className: "flex min-h-24 flex-wrap items-center gap-x-12 gap-y-4",
388
- children: [/* @__PURE__ */ N("span", {
407
+ i === "incomplete" && /* @__PURE__ */ V("div", {
408
+ className: "flex min-h-24 flex-wrap items-center gap-x-12 gap-y-4 px-12",
409
+ children: [/* @__PURE__ */ B("span", {
389
410
  className: "text-small text-fg-secondary",
390
- children: b ? h("responseView.stoppedEarly", "The response stopped early") : h("responseView.noResponse", "No response")
391
- }), u && /* @__PURE__ */ N(c, {
411
+ children: Se(_, l)
412
+ }), f && /* @__PURE__ */ B(u, {
392
413
  size: "xs",
393
- variant: "secondary",
394
- onClick: u,
395
- children: h("responseView.retry", "Retry")
414
+ variant: "ghost",
415
+ onClick: f,
416
+ children: _("responseView.retry", "Retry")
396
417
  })]
397
418
  }),
398
- i === "done" && !b && /* @__PURE__ */ N("span", {
399
- className: "text-small text-fg-tertiary",
400
- children: h("responseView.noText", "The model returned no text")
419
+ i === "error" && /* @__PURE__ */ V("div", {
420
+ role: "alert",
421
+ className: "flex min-h-24 flex-col items-start gap-4 px-12",
422
+ children: [
423
+ /* @__PURE__ */ B("span", {
424
+ className: "text-small font-medium text-fg",
425
+ children: x ? _("responseView.stoppedEarly", "The response stopped early") : _("responseView.noResponse", "No response")
426
+ }),
427
+ d && /* @__PURE__ */ B(j, {
428
+ text: d,
429
+ size: "small",
430
+ tone: "secondary",
431
+ className: "max-w-prose min-w-0"
432
+ }),
433
+ f && /* @__PURE__ */ B(u, {
434
+ size: "xs",
435
+ variant: "secondary",
436
+ onClick: f,
437
+ className: "mt-4",
438
+ children: _("responseView.retry", "Retry")
439
+ })
440
+ ]
441
+ }),
442
+ i === "done" && !x && /* @__PURE__ */ B("span", {
443
+ className: "px-12 text-small text-fg-tertiary",
444
+ children: _("responseView.noText", "The model returned no text")
401
445
  }),
402
- d,
403
- /* @__PURE__ */ N("span", {
404
- id: _,
446
+ p,
447
+ /* @__PURE__ */ B("span", {
448
+ id: y,
405
449
  className: "sr-only",
406
- children: i === "pending" ? h("responseView.waiting", "Waiting for the response") : i === "streaming" ? h("responseView.responding", "Responding") : ""
450
+ children: i === "pending" ? _("responseView.waiting", "Waiting for the response") : i === "streaming" ? _("responseView.responding", "Responding") : ""
407
451
  })
408
452
  ]
409
453
  });
410
454
  });
411
- process.env.NODE_ENV !== "production" && (le.displayName = "ResponseView");
412
- var ue = {
455
+ process.env.NODE_ENV !== "production" && (Ce.displayName = "ResponseView");
456
+ var we = {
413
457
  2: "line-clamp-2",
414
458
  3: "line-clamp-3",
415
459
  4: "line-clamp-4",
416
460
  6: "line-clamp-6"
417
- }, de = /* @__PURE__ */ S(function({ children: t, maxLines: r = 4, "aria-label": i, className: a }, o) {
418
- let l = n(), u = i ?? l("userMessage.prompt", "Prompt"), d = l("userMessage.showAll", "Show all"), f = l("userMessage.showLess", "Show less"), [p, m] = A(!1), h = k(null), g = s(h, r > 0 && !p);
419
- return /* @__PURE__ */ P("div", {
461
+ }, Te = /* @__PURE__ */ N(function({ children: t, maxLines: r = 4, "aria-label": i, className: a }, o) {
462
+ let s = n(), c = i ?? s("userMessage.prompt", "Prompt"), d = s("userMessage.showAll", "Show all"), f = s("userMessage.showLess", "Show less"), [p, m] = z(!1), h = R(null), g = l(h, r > 0 && !p);
463
+ return /* @__PURE__ */ V("div", {
420
464
  ref: o,
421
465
  role: "group",
422
- "aria-label": u,
423
- className: e("flex min-w-0 flex-col items-start gap-2", a),
424
- children: [/* @__PURE__ */ N("p", {
466
+ "aria-label": c,
467
+ className: e("flex min-w-0 flex-col items-start gap-2 px-12", a),
468
+ children: [/* @__PURE__ */ B("p", {
425
469
  ref: h,
426
- className: e("max-w-prose min-w-0 text-body font-medium whitespace-pre-wrap wrap-break-word text-fg-secondary", r !== 0 && !p && ue[r]),
470
+ className: e("max-w-prose min-w-0 text-body font-medium whitespace-pre-wrap wrap-break-word text-fg-secondary", r !== 0 && !p && we[r]),
427
471
  children: t
428
- }), (g || p) && /* @__PURE__ */ N(c, {
472
+ }), (g || p) && /* @__PURE__ */ B(u, {
429
473
  size: "xs",
430
474
  variant: "link",
431
475
  reserveLabels: [d, f],
@@ -435,118 +479,115 @@ var ue = {
435
479
  })]
436
480
  });
437
481
  });
438
- process.env.NODE_ENV !== "production" && (de.displayName = "UserMessage");
439
- var fe = /* @__PURE__ */ S(function({ children: t, className: n }, r) {
440
- return /* @__PURE__ */ N("div", {
482
+ process.env.NODE_ENV !== "production" && (Te.displayName = "UserMessage");
483
+ var Ee = /* @__PURE__ */ N(function({ children: t, className: n }, r) {
484
+ return /* @__PURE__ */ B("div", {
441
485
  ref: r,
442
486
  className: e("flex min-w-0 flex-col gap-32", n),
443
487
  children: t
444
488
  });
445
489
  });
446
- process.env.NODE_ENV !== "production" && (fe.displayName = "Thread");
490
+ process.env.NODE_ENV !== "production" && (Ee.displayName = "Thread");
447
491
  //#endregion
448
492
  //#region src/components/playground/response-metrics.tsx
449
- var pe = { size: {
493
+ var De = { size: {
450
494
  sm: { classes: "text-caption gap-x-12 gap-y-2" },
451
495
  md: { classes: "text-small gap-x-16 gap-y-4" }
452
- } }, me = { size: "sm" };
453
- function X(e) {
454
- return !Number.isFinite(e) || e < 0 ? "—" : r(e, { precise: !0 });
496
+ } }, Oe = { size: "sm" };
497
+ function ke(e) {
498
+ return !Number.isFinite(e) || e < 0 ? "—" : a(e, { precise: !0 });
455
499
  }
456
- function he(e) {
457
- let [t, n] = A(() => Date.now());
458
- return E(() => {
500
+ function Ae(e) {
501
+ let [t, n] = z(() => Date.now());
502
+ return F(() => {
459
503
  if (e === void 0) return;
460
504
  n(Date.now());
461
505
  let t = setInterval(() => n(Date.now()), 100);
462
506
  return () => clearInterval(t);
463
507
  }, [e]), e === void 0 ? void 0 : Math.max(0, t - e);
464
508
  }
465
- function Z(e) {
509
+ function je(e) {
510
+ return /[1-9]/.test(e) ? s(e, { decimals: 6 }) : s("0", { decimals: 0 });
511
+ }
512
+ function $(e) {
466
513
  return typeof e == "number" && Number.isFinite(e);
467
514
  }
468
- function Q({ label: t, width: n, children: r, value: i }) {
469
- return /* @__PURE__ */ P("div", {
515
+ function Me({ label: t, width: n, children: r }) {
516
+ return /* @__PURE__ */ V("div", {
470
517
  className: "flex items-baseline gap-4 whitespace-nowrap",
471
- children: [/* @__PURE__ */ N("dt", {
518
+ children: [/* @__PURE__ */ B("dt", {
472
519
  className: "text-fg-tertiary",
473
520
  children: t
474
- }), /* @__PURE__ */ N("dd", {
521
+ }), /* @__PURE__ */ B("dd", {
475
522
  className: e("text-fg-secondary tabular", n),
476
- ...i ? { "aria-label": i } : {},
477
523
  children: r
478
524
  })]
479
525
  });
480
526
  }
481
- var ge = /* @__PURE__ */ S(function({ timeToFirstToken: t, duration: r, inputTokens: o, outputTokens: s, reasoningTokens: c, reasoning: l, live: u = !1, startedAt: d, cost: f, size: p = "sm", className: m }, h) {
482
- let g = n(), _ = he(u && d !== void 0 && !Z(r) ? d : void 0), v = Z(o) || Z(s), y = f != null && f !== "", b = e("flex min-w-0 flex-wrap items-baseline", pe.size[p].classes, m);
483
- if (!u && !v && !y && !Z(t) && !Z(r) && !Z(c)) return /* @__PURE__ */ N("dl", {
484
- ref: h,
485
- "aria-label": g("responseMetrics.metrics", "Metrics"),
486
- className: e(b, p === "sm" ? "min-h-16" : "min-h-18")
527
+ var Ne = /* @__PURE__ */ N(function({ timeToFirstToken: t, duration: r, inputTokens: i, outputTokens: a, reasoningTokens: s, reasoning: c, live: l = !1, startedAt: u, cost: d, size: f = "sm", className: p }, m) {
528
+ let h = n(), g = Ae(l && u !== void 0 && !$(r) ? u : void 0), _ = $(i) || $(a), v = d != null && d !== "", y = e("flex min-w-0 flex-wrap items-baseline", De.size[f].classes, p);
529
+ if (!l && !_ && !v && !$(t) && !$(r) && !$(s)) return /* @__PURE__ */ B("dl", {
530
+ ref: m,
531
+ "aria-label": h("responseMetrics.metrics", "Metrics"),
532
+ className: e(y, f === "sm" ? "min-h-16" : "min-h-18")
487
533
  });
488
- let x = (e) => u || e, S = /* @__PURE__ */ P("span", {
534
+ let b = (e) => l || e, x = /* @__PURE__ */ V("span", {
489
535
  className: "text-fg-tertiary",
490
- children: [/* @__PURE__ */ N("span", {
536
+ children: [/* @__PURE__ */ B("span", {
491
537
  "aria-hidden": !0,
492
538
  children: "—"
493
- }), /* @__PURE__ */ N("span", {
539
+ }), /* @__PURE__ */ B("span", {
494
540
  className: "sr-only",
495
- children: g("responseMetrics.notYetKnown", "not yet known")
541
+ children: h("responseMetrics.notYetKnown", "not yet known")
496
542
  })]
497
543
  });
498
- return /* @__PURE__ */ P("dl", {
499
- ref: h,
500
- "aria-label": g("responseMetrics.metrics", "Metrics"),
501
- className: b,
544
+ return /* @__PURE__ */ V("dl", {
545
+ ref: m,
546
+ "aria-label": h("responseMetrics.metrics", "Metrics"),
547
+ className: y,
502
548
  children: [
503
- x(Z(t)) && /* @__PURE__ */ N(Q, {
504
- label: g("responseMetrics.firstToken", "First token"),
549
+ b($(t)) && /* @__PURE__ */ B(Me, {
550
+ label: h("responseMetrics.firstToken", "First token"),
505
551
  width: "min-w-40",
506
- children: Z(t) ? X(t) : S
552
+ children: $(t) ? ke(t) : x
507
553
  }),
508
- x(Z(r)) && /* @__PURE__ */ N(Q, {
509
- label: g("responseMetrics.total", "Total"),
554
+ b($(r)) && /* @__PURE__ */ B(Me, {
555
+ label: h("responseMetrics.total", "Total"),
510
556
  width: "min-w-40",
511
- children: Z(r) ? X(r) : _ === void 0 ? S : /* @__PURE__ */ N("span", {
557
+ children: $(r) ? ke(r) : g === void 0 ? x : /* @__PURE__ */ B("span", {
512
558
  className: "text-fg-tertiary",
513
- children: X(_)
559
+ children: ke(g)
514
560
  })
515
561
  }),
516
- x(v) && /* @__PURE__ */ N(Q, {
517
- label: g("responseMetrics.tokens", "Tokens"),
562
+ b(_) && /* @__PURE__ */ B(Me, {
563
+ label: h("responseMetrics.tokens", "Tokens"),
518
564
  width: "min-w-48",
519
- value: v ? g("responseMetrics.tokensInOut", "{input} in, {output} out", {
520
- input: Z(o) ? i(o) : g("responseMetrics.unknown", "unknown"),
521
- output: Z(s) ? i(s) : g("responseMetrics.unknown", "unknown")
522
- }) : void 0,
523
- children: v ? /* @__PURE__ */ P(M, { children: [
524
- Z(o) ? i(o) : S,
525
- " → ",
526
- Z(s) ? i(s) : S
527
- ] }) : S
565
+ children: _ ? h("responseMetrics.tokensValue", "{input} in · {output} out", {
566
+ input: $(i) ? o(i) : "—",
567
+ output: $(a) ? o(a) : "—"
568
+ }) : x
528
569
  }),
529
- (Z(c) || u && l) && /* @__PURE__ */ N(Q, {
530
- label: g("responseMetrics.reasoning", "Reasoning"),
570
+ ($(s) || l && c) && /* @__PURE__ */ B(Me, {
571
+ label: h("responseMetrics.reasoning", "Reasoning"),
531
572
  width: "min-w-24",
532
- children: Z(c) ? i(c) : S
573
+ children: $(s) ? o(s) : x
533
574
  }),
534
- x(y) && /* @__PURE__ */ N(Q, {
535
- label: g("responseMetrics.cost", "Cost"),
575
+ b(v) && /* @__PURE__ */ B(Me, {
576
+ label: h("responseMetrics.cost", "Cost"),
536
577
  width: "min-w-40",
537
- children: y ? a(f) : S
578
+ children: v ? je(d) : x
538
579
  })
539
580
  ]
540
581
  });
541
582
  });
542
- process.env.NODE_ENV !== "production" && (ge.displayName = "ResponseMetrics");
583
+ process.env.NODE_ENV !== "production" && (Ne.displayName = "ResponseMetrics");
543
584
  //#endregion
544
585
  //#region src/components/playground/parameter-panel.tsx
545
- var _e = { layout: {
586
+ var Pe = { layout: {
546
587
  popover: { classes: "w-full gap-20" },
547
588
  panel: { classes: "w-full gap-24" }
548
- } }, ve = { layout: "popover" };
549
- function ye(e) {
589
+ } }, Fe = { layout: "popover" };
590
+ function Ie(e) {
550
591
  return [
551
592
  {
552
593
  value: "none",
@@ -578,227 +619,459 @@ function ye(e) {
578
619
  }
579
620
  ];
580
621
  }
581
- function be({ label: t, value: r, unset: a, min: o, max: s, step: c, digits: l, disabled: u, onChange: d }) {
582
- let p = D(), m = n(), h = i(r, {
622
+ function Le({ label: t, value: r, unset: i, min: a, max: s, step: c, digits: l, disabled: u, onChange: d }) {
623
+ let f = ie(), p = n(), m = o(r, {
583
624
  minimumFractionDigits: l,
584
625
  maximumFractionDigits: l
585
626
  });
586
- return /* @__PURE__ */ P("div", {
627
+ return /* @__PURE__ */ V("div", {
587
628
  className: "flex flex-col gap-8",
588
- children: [/* @__PURE__ */ P("div", {
629
+ children: [/* @__PURE__ */ V("div", {
589
630
  className: "flex items-baseline justify-between gap-12",
590
- children: [/* @__PURE__ */ N("span", {
591
- id: p,
631
+ children: [/* @__PURE__ */ B("span", {
632
+ id: f,
592
633
  className: e("text-body font-medium", u ? "text-fg-disabled" : "text-fg"),
593
634
  children: t
594
- }), /* @__PURE__ */ N("span", {
595
- className: e("text-small tabular", a ? "text-fg-tertiary" : "text-fg-secondary"),
596
- children: a ? m("parameterPanel.valueDefault", "{value} default", { value: h }) : h
635
+ }), /* @__PURE__ */ B("span", {
636
+ className: e("text-small tabular", i ? "text-fg-tertiary" : "text-fg-secondary"),
637
+ children: i ? p("parameterPanel.valueDefault", "{value} default", { value: m }) : m
597
638
  })]
598
- }), /* @__PURE__ */ N("div", {
639
+ }), /* @__PURE__ */ B("div", {
599
640
  className: "px-8",
600
- children: /* @__PURE__ */ N(f, {
641
+ children: /* @__PURE__ */ B(_, {
601
642
  "aria-label": t,
602
- min: o,
643
+ min: a,
603
644
  max: s,
604
645
  step: c,
605
646
  value: r,
606
647
  disabled: u,
607
- formatValue: (e) => i(e, {
648
+ formatValue: (e) => o(e, {
608
649
  minimumFractionDigits: l,
609
650
  maximumFractionDigits: l
610
651
  }),
611
- onValueChange: (e) => d(Array.isArray(e) ? e[0] ?? o : e)
652
+ onValueChange: (e) => d(Array.isArray(e) ? e[0] ?? a : e)
612
653
  })
613
654
  })]
614
655
  });
615
656
  }
616
- var $ = /* @__PURE__ */ S(function({ value: t, onValueChange: r, defaults: i, instructions: a = !0, sampling: o = !0, reasoning: s = !1, maxOutputTokensLimit: l, disabled: f = !1, layout: m = "popover", className: g }, _) {
617
- let v = n(), y = (e) => r({
657
+ var Re = /* @__PURE__ */ N(function({ value: t, onValueChange: r, defaults: i, instructions: a = !0, sampling: o = !0, reasoning: s = !1, maxOutputTokensLimit: c, disabled: l = !1, layout: d = "popover", className: f }, p) {
658
+ let m = n(), _ = (e) => r({
618
659
  ...t,
619
660
  ...e
620
- }), b = ye(v), x = s === !0 ? b : Array.isArray(s) ? b.filter((e) => s.includes(e.value)) : [], S = t.temperature !== void 0 || t.topP !== void 0 || t.maxOutputTokens !== void 0 || t.reasoningEffort !== void 0 || t.reasoningSummary !== void 0;
621
- return /* @__PURE__ */ P("div", {
622
- ref: _,
623
- className: e("flex min-w-0 flex-col", _e.layout[m].classes, g),
661
+ }), v = Ie(m), b = s === !0 ? v : Array.isArray(s) ? v.filter((e) => s.includes(e.value)) : [], S = t.temperature !== void 0 || t.topP !== void 0 || t.maxOutputTokens !== void 0 || t.reasoningEffort !== void 0 || t.reasoningSummary !== void 0;
662
+ return /* @__PURE__ */ V("div", {
663
+ ref: p,
664
+ className: e("flex min-w-0 flex-col", Pe.layout[d].classes, f),
624
665
  children: [
625
- a && /* @__PURE__ */ N(d, {
626
- label: v("parameterPanel.systemInstructions", "System instructions"),
666
+ a && /* @__PURE__ */ B(g, {
667
+ label: m("parameterPanel.systemInstructions", "System instructions"),
627
668
  rows: 3,
628
669
  maxRows: 8,
629
- placeholder: v("parameterPanel.instructionsPlaceholder", "You are a helpful assistant."),
670
+ placeholder: m("parameterPanel.instructionsPlaceholder", "You are a helpful assistant."),
630
671
  value: t.instructions ?? "",
631
- disabled: f,
632
- onChange: (e) => y({ instructions: e.target.value === "" ? void 0 : e.target.value })
672
+ disabled: l,
673
+ onChange: (e) => _({ instructions: e.target.value === "" ? void 0 : e.target.value })
633
674
  }),
634
- o && /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(be, {
635
- label: v("parameterPanel.temperature", "Temperature"),
675
+ o && /* @__PURE__ */ V(oe, { children: [/* @__PURE__ */ B(Le, {
676
+ label: m("parameterPanel.temperature", "Temperature"),
636
677
  value: t.temperature ?? i?.temperature ?? 1,
637
678
  unset: t.temperature === void 0,
638
679
  min: 0,
639
680
  max: 2,
640
681
  step: .05,
641
682
  digits: 2,
642
- disabled: f,
643
- onChange: (e) => y({ temperature: e })
644
- }), /* @__PURE__ */ N(be, {
645
- label: v("parameterPanel.topP", "Top P"),
683
+ disabled: l,
684
+ onChange: (e) => _({ temperature: e })
685
+ }), /* @__PURE__ */ B(Le, {
686
+ label: m("parameterPanel.topP", "Top P"),
646
687
  value: t.topP ?? i?.topP ?? 1,
647
688
  unset: t.topP === void 0,
648
689
  min: 0,
649
690
  max: 1,
650
691
  step: .01,
651
692
  digits: 2,
652
- disabled: f,
653
- onChange: (e) => y({ topP: e })
693
+ disabled: l,
694
+ onChange: (e) => _({ topP: e })
654
695
  })] }),
655
- /* @__PURE__ */ N(u, {
656
- label: v("parameterPanel.maxOutputTokens", "Max output tokens"),
696
+ /* @__PURE__ */ B(h, {
697
+ label: m("parameterPanel.maxOutputTokens", "Max output tokens"),
657
698
  size: "sm",
658
- placeholder: v("parameterPanel.modelDefault", "Model default"),
699
+ placeholder: m("parameterPanel.modelDefault", "Model default"),
659
700
  align: "start",
660
701
  min: "1",
661
- ...l ? { max: String(l) } : {},
702
+ ...c ? { max: String(c) } : {},
662
703
  step: "256",
663
704
  value: t.maxOutputTokens === void 0 ? "" : String(t.maxOutputTokens),
664
- disabled: f,
705
+ disabled: l,
665
706
  onValueChange: (e) => {
666
707
  let t = Number(e);
667
- y({ maxOutputTokens: e.trim() === "" || !Number.isFinite(t) || t <= 0 ? void 0 : Math.round(t) });
708
+ _({ maxOutputTokens: e.trim() === "" || !Number.isFinite(t) || t <= 0 ? void 0 : Math.round(t) });
668
709
  }
669
710
  }),
670
- x.length > 0 && /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(h, {
671
- label: v("parameterPanel.reasoningEffort", "Reasoning effort"),
711
+ b.length > 0 && /* @__PURE__ */ V(oe, { children: [/* @__PURE__ */ B(x, {
712
+ label: m("parameterPanel.reasoningEffort", "Reasoning effort"),
672
713
  size: "sm",
673
714
  fullWidth: !0,
674
- disabled: f,
715
+ disabled: l,
675
716
  value: t.reasoningEffort ?? "default",
676
717
  options: [{
677
718
  value: "default",
678
- label: v("parameterPanel.modelDefault", "Model default")
679
- }, ...x],
680
- onValueChange: (e) => y({ reasoningEffort: e === "default" ? void 0 : e })
681
- }), /* @__PURE__ */ P("div", {
719
+ label: m("parameterPanel.modelDefault", "Model default")
720
+ }, ...b],
721
+ onValueChange: (e) => _({ reasoningEffort: e === "default" ? void 0 : e })
722
+ }), /* @__PURE__ */ V("div", {
682
723
  className: "flex flex-col gap-8",
683
- children: [/* @__PURE__ */ N("span", {
684
- className: e("text-body font-medium", f ? "text-fg-disabled" : "text-fg"),
685
- children: v("parameterPanel.reasoningSummary", "Reasoning summary")
686
- }), /* @__PURE__ */ N(p, {
687
- "aria-label": v("parameterPanel.reasoningSummary", "Reasoning summary"),
724
+ children: [/* @__PURE__ */ B("span", {
725
+ className: e("text-body font-medium", l ? "text-fg-disabled" : "text-fg"),
726
+ children: m("parameterPanel.reasoningSummary", "Reasoning summary")
727
+ }), /* @__PURE__ */ B(y, {
728
+ "aria-label": m("parameterPanel.reasoningSummary", "Reasoning summary"),
688
729
  size: "sm",
689
730
  fullWidth: !0,
690
- disabled: f,
731
+ disabled: l,
691
732
  value: t.reasoningSummary ?? "auto",
692
733
  options: [
693
734
  {
694
735
  value: "auto",
695
- label: v("parameterPanel.summaryAuto", "Auto")
736
+ label: m("parameterPanel.summaryAuto", "Auto")
696
737
  },
697
738
  {
698
739
  value: "concise",
699
- label: v("parameterPanel.summaryConcise", "Concise")
740
+ label: m("parameterPanel.summaryConcise", "Concise")
700
741
  },
701
742
  {
702
743
  value: "detailed",
703
- label: v("parameterPanel.summaryDetailed", "Detailed")
744
+ label: m("parameterPanel.summaryDetailed", "Detailed")
704
745
  },
705
746
  {
706
747
  value: "off",
707
- label: v("parameterPanel.summaryOff", "Off")
748
+ label: m("parameterPanel.summaryOff", "Off")
708
749
  }
709
750
  ],
710
- onValueChange: (e) => y({ reasoningSummary: e === "auto" ? void 0 : e })
751
+ onValueChange: (e) => _({ reasoningSummary: e === "auto" ? void 0 : e })
711
752
  })]
712
753
  })] }),
713
- /* @__PURE__ */ N("div", {
754
+ /* @__PURE__ */ B("div", {
714
755
  className: "flex justify-end",
715
- children: /* @__PURE__ */ N(c, {
756
+ children: /* @__PURE__ */ B(u, {
716
757
  size: "sm",
717
758
  variant: "ghost",
718
- disabled: f || !S,
759
+ disabled: l || !S,
719
760
  onClick: () => r(t.instructions === void 0 ? {} : { instructions: t.instructions }),
720
- children: v("parameterPanel.resetToDefaults", "Reset to defaults")
761
+ children: m("parameterPanel.resetToDefaults", "Reset to defaults")
721
762
  })
722
763
  })
723
764
  ]
724
765
  });
725
766
  });
726
- process.env.NODE_ENV !== "production" && ($.displayName = "ParameterPanel");
727
- function xe({ trigger: e, title: t, open: r, defaultOpen: i, onOpenChange: a, side: o = "bottom", align: s = "end", ...c }) {
728
- let u = n(), d = t ?? u("parameterPopover.parameters", "Parameters");
729
- return /* @__PURE__ */ P(g, {
767
+ process.env.NODE_ENV !== "production" && (Re.displayName = "ParameterPanel");
768
+ function ze({ trigger: e, title: t, open: r, defaultOpen: i, onOpenChange: a, side: o = "bottom", align: s = "end", ...c }) {
769
+ let l = n(), u = t ?? l("parameterPopover.parameters", "Parameters");
770
+ return /* @__PURE__ */ V(S, {
730
771
  trapFocus: !0,
731
772
  ...r === void 0 ? {} : { open: r },
732
773
  ...i === void 0 ? {} : { defaultOpen: i },
733
774
  ...a ? { onOpenChange: a } : {},
734
- children: [/* @__PURE__ */ N(g.Trigger, { children: e ?? /* @__PURE__ */ N(l, {
735
- icon: z,
736
- "aria-label": d,
775
+ children: [/* @__PURE__ */ B(S.Trigger, { children: e ?? /* @__PURE__ */ B(d, {
776
+ icon: W,
777
+ "aria-label": u,
737
778
  size: "sm"
738
- }) }), /* @__PURE__ */ N(g.Content, {
739
- title: d,
779
+ }) }), /* @__PURE__ */ B(S.Content, {
780
+ title: u,
740
781
  side: o,
741
782
  align: s,
742
783
  className: "w-320 max-w-(--available-width)",
743
- children: /* @__PURE__ */ N($, { ...c })
784
+ children: /* @__PURE__ */ B(Re, { ...c })
744
785
  })]
745
786
  });
746
787
  }
747
- process.env.NODE_ENV !== "production" && (xe.displayName = "ParameterPopover");
788
+ process.env.NODE_ENV !== "production" && (ze.displayName = "ParameterPopover");
748
789
  //#endregion
749
790
  //#region src/components/playground/model-picker.tsx
750
- var Se = {
791
+ var Be = {
751
792
  ghost: "header",
752
793
  default: "default"
753
- }, Ce = { appearance: {
754
- ghost: { classes: m.appearance.header.classes },
755
- default: { classes: m.appearance.default.classes }
756
- } }, we = { appearance: "ghost" }, Te = /* @__PURE__ */ S(function({ options: t, value: r, defaultValue: i, onValueChange: a, groupByProvider: o, placeholder: s, "aria-label": c, appearance: l = "ghost", size: u = "sm", disabled: d, "data-force": f, className: p }, m) {
757
- let g = n(), y = o ?? new Set(t.map((e) => e.provider)).size > 1, b = y ? [...t].sort((e, t) => v(e.provider).localeCompare(v(t.provider))) : t;
758
- return /* @__PURE__ */ N(h, {
759
- ref: m,
760
- "aria-label": c ?? g("modelPicker.model", "Model"),
761
- appearance: Se[l],
762
- size: u,
763
- placeholder: s ?? g("modelPicker.choose", "Choose a model"),
764
- ...r === void 0 ? {} : { value: r },
765
- ...i === void 0 ? {} : { defaultValue: i },
766
- ...a ? { onValueChange: a } : {},
767
- ...d === void 0 ? {} : { disabled: d },
768
- ...f ? { "data-force": f } : {},
769
- className: e("max-w-full", p),
770
- options: b.map((e) => ({
771
- value: e.value,
772
- textValue: e.name ?? e.model ?? e.value,
773
- label: /* @__PURE__ */ N(_, {
774
- provider: e.provider,
775
- model: e.model ?? e.value,
776
- ...e.name ? { name: e.name } : {}
794
+ }, Ve = { appearance: {
795
+ ghost: { classes: b.appearance.header.classes },
796
+ default: { classes: b.appearance.default.classes }
797
+ } }, He = { appearance: "ghost" }, Ue = "", We = "*";
798
+ function Ge({ option: t, query: n, providerLabel: r }) {
799
+ let a = t.model ?? t.value, o = [t.context ? i(t.context) : "", t.price ?? ""].filter(Boolean).join(" · ");
800
+ return /* @__PURE__ */ V(oe, { children: [
801
+ r !== void 0 && /* @__PURE__ */ B("span", {
802
+ "aria-hidden": !0,
803
+ className: "flex",
804
+ children: /* @__PURE__ */ B(O, {
805
+ provider: t.provider,
806
+ name: r
807
+ })
808
+ }),
809
+ /* @__PURE__ */ V("span", {
810
+ className: "flex min-w-0 flex-1 items-baseline gap-8",
811
+ children: [/* @__PURE__ */ B("span", {
812
+ className: "min-w-0 shrink truncate",
813
+ children: /* @__PURE__ */ B(C, {
814
+ text: t.name ?? a,
815
+ query: n
816
+ })
817
+ }), t.name && t.name !== a && /* @__PURE__ */ B("span", {
818
+ className: "min-w-0 flex-1 truncate mono text-small font-regular text-fg-tertiary",
819
+ children: /* @__PURE__ */ B(C, {
820
+ text: a,
821
+ query: n
822
+ })
823
+ })]
824
+ }),
825
+ t.capabilities && t.capabilities.length > 0 && /* @__PURE__ */ B(k, {
826
+ capabilities: t.capabilities,
827
+ className: "hidden sm:flex"
828
+ }),
829
+ (t.note ?? o) && /* @__PURE__ */ B("span", {
830
+ className: e("shrink-0 text-caption font-regular tabular", t.note ? "text-fg-secondary" : "hidden text-fg-tertiary sm:inline"),
831
+ children: t.note ?? o
832
+ })
833
+ ] });
834
+ }
835
+ function Ke(e, t, n) {
836
+ let r = e.model ?? e.value, i = t(e.provider);
837
+ return {
838
+ value: e.value,
839
+ label: e.name ?? r,
840
+ keywords: [
841
+ r,
842
+ i,
843
+ e.provider
844
+ ],
845
+ render: ({ query: t }) => /* @__PURE__ */ B(Ge, {
846
+ option: e,
847
+ query: t,
848
+ ...n ? { providerLabel: i } : {}
849
+ }),
850
+ ...e.disabled ? { disabled: !0 } : {}
851
+ };
852
+ }
853
+ function qe(e, t, n, r) {
854
+ return n ? t.flatMap((t) => {
855
+ let n = e.filter((e) => e.provider === t);
856
+ return n.length ? [{
857
+ id: `provider:${t}`,
858
+ label: r(t),
859
+ leading: /* @__PURE__ */ B("span", {
860
+ "aria-hidden": !0,
861
+ className: "flex",
862
+ children: /* @__PURE__ */ B(O, {
863
+ provider: t,
864
+ name: r(t),
865
+ size: "sm"
866
+ })
777
867
  }),
778
- ...y ? { group: v(e.provider) } : {},
779
- ...e.disabled ? { disabled: !0 } : {}
780
- }))
868
+ count: n.length,
869
+ items: n.map((e) => Ke(e, r, !1))
870
+ }] : [];
871
+ }) : [{
872
+ id: "models",
873
+ items: e.map((e) => Ke(e, r, !0))
874
+ }];
875
+ }
876
+ function Je(e, t) {
877
+ let n = r(), i = L(() => new Map(t.map((e) => [e.id, e])), [t]), a = P((e) => A(e, i.get(e)?.name), [i]);
878
+ return {
879
+ nameOf: a,
880
+ providerOrder: L(() => [...new Set(e.map((e) => e.provider))].sort((e, t) => Number(!!i.get(t)?.connected) - Number(!!i.get(e)?.connected) || a(e).localeCompare(a(t), n, { sensitivity: "base" })), [
881
+ e,
882
+ i,
883
+ a,
884
+ n
885
+ ])
886
+ };
887
+ }
888
+ function Ye(e, { providers: t = [], groupByProvider: n } = {}) {
889
+ let { nameOf: r, providerOrder: i } = Je(e, t), a = n ?? i.length > 1;
890
+ return L(() => qe(e, i, a, r), [
891
+ e,
892
+ i,
893
+ a,
894
+ r
895
+ ]);
896
+ }
897
+ var Xe = /* @__PURE__ */ N(function(t, r) {
898
+ let { options: i, providers: a = [], recent: s = [], groupByProvider: c, placeholder: l, "aria-label": u, appearance: d = "ghost", size: h = "sm", fullWidth: g, disabled: _, invalid: y, open: b, onOpenChange: S, "data-force": C, className: k, label: A, description: j, error: M, optional: te, required: N, layout: ne } = t, P = n(), re = f(), F = p(t), [ie, I] = z(!1), R = b ?? ie, ae = (e) => {
899
+ b === void 0 && I(e), S?.(e);
900
+ }, [se, ce] = z(() => t.defaultValue ?? (t.multiple ? [] : null)), H = t.value === void 0 ? se : t.value, U = Array.isArray(H) ? H : H ? [H] : [], W = t.multiple ? void 0 : t.allLabel, [G, le] = z(""), [K, ue] = z(null), [q, de] = z(!1), [fe, pe] = z(R);
901
+ R !== fe && (pe(R), R && (le(""), ue(null)));
902
+ let J = L(() => new Map(i.map((e) => [e.value, e])), [i]), { nameOf: Y, providerOrder: X } = Je(i, a), me = c ?? X.length > 1, he = i.some((e) => e.deprecated && !U.includes(e.value)), Z = U.join("\0"), ge = L(() => {
903
+ let e = new Set(Z.split("\0")), t = (t) => (q || !t.deprecated || e.has(t.value)) && (!K || t.provider === K), n = [];
904
+ W && !K && n.push({
905
+ id: "all",
906
+ items: [{
907
+ value: Ue,
908
+ label: W
909
+ }]
910
+ });
911
+ let r = G.trim() || K ? [] : s.flatMap((e) => J.get(e) && t(J.get(e)) ? [Ke(J.get(e), Y, !0)] : []);
912
+ return r.length && n.push({
913
+ id: "recent",
914
+ label: P("modelPicker.recent", "Recent"),
915
+ items: r
916
+ }), [...n, ...qe(i.filter(t), X, me, Y)];
917
+ }, [
918
+ i,
919
+ X,
920
+ me,
921
+ s,
922
+ J,
923
+ G,
924
+ K,
925
+ q,
926
+ Z,
927
+ W,
928
+ P,
929
+ Y
930
+ ]), _e = (e) => {
931
+ if (t.multiple) {
932
+ let n = U.includes(e) ? U.filter((t) => t !== e) : [...U, e];
933
+ t.value === void 0 && ce(n), t.onValueChange?.(n);
934
+ } else t.value === void 0 && ce(e === Ue ? null : e), t.onValueChange?.(e), ae(!1);
935
+ }, ve = L(() => {
936
+ let e = G.trim(), t = new Set(Z.split("\0")), n = /* @__PURE__ */ new Map();
937
+ for (let r of i) {
938
+ if (r.deprecated && !q && !t.has(r.value)) continue;
939
+ let i = r.model ?? r.value;
940
+ e && ee(e, [
941
+ r.name ?? i,
942
+ i,
943
+ Y(r.provider),
944
+ r.provider
945
+ ]) <= 0 || n.set(r.provider, (n.get(r.provider) ?? 0) + 1);
946
+ }
947
+ return X.filter((e) => n.has(e) || e === K).map((e) => ({
948
+ id: e,
949
+ count: n.get(e) ?? 0
950
+ }));
951
+ }, [
952
+ i,
953
+ X,
954
+ G,
955
+ q,
956
+ Z,
957
+ K,
958
+ Y
959
+ ]), ye = me && X.length > 1 ? /* @__PURE__ */ B(x, {
960
+ "aria-label": P("modelPicker.provider", "Provider"),
961
+ size: "sm",
962
+ appearance: "ghost",
963
+ value: K ?? We,
964
+ onValueChange: (e) => ue(e === We ? null : e),
965
+ options: [{
966
+ value: We,
967
+ label: P("modelPicker.everyProvider", "All providers")
968
+ }, ...ve.map(({ id: e, count: t }) => ({
969
+ value: e,
970
+ textValue: Y(e),
971
+ label: /* @__PURE__ */ V("span", {
972
+ className: "flex min-w-0 items-center gap-8",
973
+ children: [
974
+ /* @__PURE__ */ B("span", {
975
+ "aria-hidden": !0,
976
+ className: "flex shrink-0",
977
+ children: /* @__PURE__ */ B(O, {
978
+ provider: e,
979
+ size: "sm"
980
+ })
981
+ }),
982
+ /* @__PURE__ */ B("span", {
983
+ className: "min-w-0 truncate",
984
+ children: Y(e)
985
+ }),
986
+ /* @__PURE__ */ B("span", {
987
+ className: "shrink-0 text-fg-tertiary tabular",
988
+ children: o(t)
989
+ })
990
+ ]
991
+ })
992
+ }))]
993
+ }) : null, be = ye || he ? /* @__PURE__ */ V(oe, { children: [ye, he && /* @__PURE__ */ B(v, {
994
+ size: "sm",
995
+ label: P("modelPicker.showDeprecated", "Deprecated"),
996
+ checked: q,
997
+ onCheckedChange: de
998
+ })] }) : void 0, Q = U[0] ? J.get(U[0]) : void 0, xe = t.multiple ? Q ? U.length === 1 ? /* @__PURE__ */ B(D, {
999
+ provider: Q.provider,
1000
+ providerName: Y(Q.provider),
1001
+ model: Q.model ?? Q.value,
1002
+ ...Q.name ? { name: Q.name } : {}
1003
+ }) : P("modelPicker.firstAndMore", "{first} +{count}", {
1004
+ first: Q.name ?? Q.model ?? Q.value,
1005
+ count: String(U.length - 1)
1006
+ }) : void 0 : Q ? /* @__PURE__ */ B(D, {
1007
+ provider: Q.provider,
1008
+ providerName: Y(Q.provider),
1009
+ model: Q.model ?? Q.value,
1010
+ ...Q.name ? { name: Q.name } : {}
1011
+ }) : H === Ue || H === null && W ? W : void 0, Se = u ?? (typeof A == "string" ? A : P("modelPicker.model", "Model")), Ce = /* @__PURE__ */ B(E, {
1012
+ title: Se,
1013
+ width: "lg",
1014
+ open: R,
1015
+ onOpenChange: ae,
1016
+ trigger: /* @__PURE__ */ B(T, {
1017
+ ref: r,
1018
+ appearance: Be[d],
1019
+ size: h,
1020
+ ...F.controlProps,
1021
+ ...u || !A ? { "aria-label": Se } : {},
1022
+ ..._ ? { disabled: _ } : {},
1023
+ ...y ? { invalid: y } : {},
1024
+ ...g ? { fullWidth: g } : {},
1025
+ ...C ? { "data-force": C } : {},
1026
+ placeholder: l ?? (t.multiple ? P("modelPicker.chooseSome", "Choose models") : P("modelPicker.choose", "Choose a model")),
1027
+ className: e("max-w-full", !(A || j || M) && k),
1028
+ children: xe
1029
+ }),
1030
+ children: /* @__PURE__ */ B(w, {
1031
+ groups: ge,
1032
+ "aria-label": Se,
1033
+ value: t.multiple ? U : U[0] ?? (W ? Ue : null),
1034
+ ...t.multiple ? { multiple: !0 } : {},
1035
+ onSelect: _e,
1036
+ query: G,
1037
+ onQueryChange: le,
1038
+ placeholder: P("modelPicker.search", "Search models"),
1039
+ emptyText: P("modelPicker.noMatch", "No models match"),
1040
+ toolbar: be,
1041
+ autoFocus: !0
1042
+ })
781
1043
  });
1044
+ return re ? Ce : m({
1045
+ label: A,
1046
+ description: j,
1047
+ error: M,
1048
+ optional: te,
1049
+ required: N,
1050
+ layout: ne,
1051
+ id: F.wrapId,
1052
+ disabled: _,
1053
+ className: k
1054
+ }, Ce);
782
1055
  });
783
- process.env.NODE_ENV !== "production" && (Te.displayName = "ModelPicker");
1056
+ process.env.NODE_ENV !== "production" && (Xe.displayName = "ModelPicker");
784
1057
  //#endregion
785
1058
  //#region src/components/playground/prompt-suggestions.tsx
786
- var Ee = { align: {
1059
+ var Ze = { align: {
787
1060
  start: { classes: "items-stretch" },
788
1061
  center: { classes: "items-center text-center" }
789
- } }, De = { align: "start" }, Oe = /* @__PURE__ */ S(function({ suggestions: t, onSelect: r, "aria-label": i, align: a = "start", className: o }, s) {
1062
+ } }, Qe = { align: "start" }, $e = /* @__PURE__ */ N(function({ suggestions: t, onSelect: r, "aria-label": i, align: a = "start", className: o }, s) {
790
1063
  let c = n(), l = i ?? c("promptSuggestions.examplePrompts", "Example prompts");
791
- return /* @__PURE__ */ N("ul", {
1064
+ return /* @__PURE__ */ B("ul", {
792
1065
  ref: s,
793
1066
  "aria-label": l,
794
- className: e("flex min-w-0 flex-col gap-2", Ee.align[a].classes, o),
795
- children: t.slice(0, 3).map((t) => /* @__PURE__ */ N("li", {
1067
+ className: e("flex min-w-0 flex-col gap-2", Ze.align[a].classes, o),
1068
+ children: t.slice(0, 3).map((t) => /* @__PURE__ */ B("li", {
796
1069
  className: e("flex min-w-0", a === "center" && "justify-center"),
797
- children: /* @__PURE__ */ N("button", {
1070
+ children: /* @__PURE__ */ B("button", {
798
1071
  type: "button",
799
1072
  onClick: () => r(t),
800
1073
  className: e("flex h-36 max-w-full min-w-0 cursor-pointer items-center rounded-item px-16 text-body text-fg-secondary transition-control hover:bg-fill-1 hover:text-fg focus-ring-inset", a === "start" && "flex-1"),
801
- children: /* @__PURE__ */ N("span", {
1074
+ children: /* @__PURE__ */ B("span", {
802
1075
  className: "min-w-0 truncate",
803
1076
  children: t
804
1077
  })
@@ -806,8 +1079,8 @@ var Ee = { align: {
806
1079
  }, t))
807
1080
  });
808
1081
  });
809
- process.env.NODE_ENV !== "production" && (Oe.displayName = "PromptSuggestions");
1082
+ process.env.NODE_ENV !== "production" && ($e.displayName = "PromptSuggestions");
810
1083
  //#endregion
811
- export { ie as CompareGrid, K as Composer, te as KAESO_COMPARE_GRID_DEFAULT_VARIANTS, q as KAESO_COMPARE_GRID_VARIANTS, H as KAESO_COMPOSER_DEFAULT_VARIANTS, V as KAESO_COMPOSER_VARIANTS, we as KAESO_MODEL_PICKER_DEFAULT_VARIANTS, Ce as KAESO_MODEL_PICKER_VARIANTS, ve as KAESO_PARAMETER_PANEL_DEFAULT_VARIANTS, _e as KAESO_PARAMETER_PANEL_VARIANTS, De as KAESO_PROMPT_SUGGESTIONS_DEFAULT_VARIANTS, Ee as KAESO_PROMPT_SUGGESTIONS_VARIANTS, me as KAESO_RESPONSE_METRICS_DEFAULT_VARIANTS, pe as KAESO_RESPONSE_METRICS_VARIANTS, oe as KAESO_RESPONSE_VIEW_DEFAULT_VARIANTS, ae as KAESO_RESPONSE_VIEW_VARIANTS, Te as ModelPicker, $ as ParameterPanel, xe as ParameterPopover, Oe as PromptSuggestions, ge as ResponseMetrics, le as ResponseView, fe as Thread, de as UserMessage, X as formatLatency };
1084
+ export { ge as CompareGrid, pe as Composer, Y as KAESO_COMPARE_GRID_DEFAULT_VARIANTS, J as KAESO_COMPARE_GRID_VARIANTS, K as KAESO_COMPOSER_DEFAULT_VARIANTS, le as KAESO_COMPOSER_VARIANTS, He as KAESO_MODEL_PICKER_DEFAULT_VARIANTS, Ve as KAESO_MODEL_PICKER_VARIANTS, Fe as KAESO_PARAMETER_PANEL_DEFAULT_VARIANTS, Pe as KAESO_PARAMETER_PANEL_VARIANTS, Qe as KAESO_PROMPT_SUGGESTIONS_DEFAULT_VARIANTS, Ze as KAESO_PROMPT_SUGGESTIONS_VARIANTS, ve as KAESO_REASONING_DEFAULT_VARIANTS, _e as KAESO_REASONING_VARIANTS, Oe as KAESO_RESPONSE_METRICS_DEFAULT_VARIANTS, De as KAESO_RESPONSE_METRICS_VARIANTS, xe as KAESO_RESPONSE_VIEW_DEFAULT_VARIANTS, Q as KAESO_RESPONSE_VIEW_VARIANTS, Xe as ModelPicker, Re as ParameterPanel, ze as ParameterPopover, $e as PromptSuggestions, be as Reasoning, Ne as ResponseMetrics, Ce as ResponseView, Ee as Thread, Te as UserMessage, ke as formatLatency, Ye as useModelGroups };
812
1085
 
813
1086
  //# sourceMappingURL=playground.js.map