@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.
- package/AGENTS.md +2 -0
- package/NOTICE.md +1 -1
- package/ai/component-guides.md +249 -24
- package/ai/component-registry.json +1044 -67
- package/ai/component-registry.md +238 -50
- package/ai/icons.md +1 -1
- package/ai/tokens.md +7 -3
- package/dist/blocks/delete-resource.js +1 -1
- package/dist/blocks/pages.js +5 -5
- package/dist/blocks/resource-list.js +4 -4
- package/dist/chunks/app-frame-B9vrgwaE.js +220 -0
- package/dist/chunks/app-frame-B9vrgwaE.js.map +1 -0
- package/dist/chunks/{avatar-D2nJNbtC.js → avatar-DOzOhYJr.js} +2 -2
- package/dist/chunks/{avatar-D2nJNbtC.js.map → avatar-DOzOhYJr.js.map} +1 -1
- package/dist/chunks/{badge-Dkyhs0_j.js → badge-wUHlj7m3.js} +2 -2
- package/dist/chunks/{badge-Dkyhs0_j.js.map → badge-wUHlj7m3.js.map} +1 -1
- package/dist/chunks/{banner-DxGBPQ7p.js → banner-BBlNFHd-.js} +4 -4
- package/dist/chunks/{banner-DxGBPQ7p.js.map → banner-BBlNFHd-.js.map} +1 -1
- package/dist/chunks/{button-DQvoOxVQ.js → button-CAPyW-v8.js} +8 -8
- package/dist/chunks/{button-DQvoOxVQ.js.map → button-CAPyW-v8.js.map} +1 -1
- package/dist/chunks/{calendar-CN3YJi2k.js → calendar-CBeptQFq.js} +2 -2
- package/dist/chunks/{calendar-CN3YJi2k.js.map → calendar-CBeptQFq.js.map} +1 -1
- package/dist/chunks/{checkbox-BgRdbfCE.js → checkbox-C5yvSS7O.js} +3 -3
- package/dist/chunks/{checkbox-BgRdbfCE.js.map → checkbox-C5yvSS7O.js.map} +1 -1
- package/dist/chunks/{cn-CidVUKMm.js → cn-DUDmdLpZ.js} +3 -1
- package/dist/chunks/cn-DUDmdLpZ.js.map +1 -0
- package/dist/chunks/{code-BADhvsgC.js → code-C49NzHUQ.js} +2 -2
- package/dist/chunks/{code-BADhvsgC.js.map → code-C49NzHUQ.js.map} +1 -1
- package/dist/chunks/{code-block-DxtladFW.js → code-block-DREsvJ-g.js} +24 -21
- package/dist/chunks/code-block-DREsvJ-g.js.map +1 -0
- package/dist/chunks/{collapsible-Cw_1aem5.js → collapsible-CDQq1Y9x.js} +6 -6
- package/dist/chunks/collapsible-CDQq1Y9x.js.map +1 -0
- package/dist/chunks/combobox-DqtzsAKG.js +314 -0
- package/dist/chunks/combobox-DqtzsAKG.js.map +1 -0
- package/dist/chunks/command-list-D5k0uvkR.js +417 -0
- package/dist/chunks/command-list-D5k0uvkR.js.map +1 -0
- package/dist/chunks/{copy-button-DXxn-YYZ.js → copy-button-CNpEnS04.js} +6 -6
- package/dist/chunks/{copy-button-DXxn-YYZ.js.map → copy-button-CNpEnS04.js.map} +1 -1
- package/dist/chunks/{core-K960A4OT.js → core-CqLWVMDI.js} +36 -36
- package/dist/chunks/core-CqLWVMDI.js.map +1 -0
- package/dist/chunks/{date-popup-B-6xhb-1.js → date-popup-BgDz6SUj.js} +4 -4
- package/dist/chunks/{date-popup-B-6xhb-1.js.map → date-popup-BgDz6SUj.js.map} +1 -1
- package/dist/chunks/{de-CTAo4KL7.js → de-CkXZKaBD.js} +37 -5
- package/dist/chunks/de-CkXZKaBD.js.map +1 -0
- package/dist/chunks/dialog-truWH0qe.js +353 -0
- package/dist/chunks/dialog-truWH0qe.js.map +1 -0
- package/dist/chunks/{empty-DIbBpytW.js → empty-YXmSkKzR.js} +2 -2
- package/dist/chunks/{empty-DIbBpytW.js.map → empty-YXmSkKzR.js.map} +1 -1
- package/dist/chunks/{field-d8V94bvZ.js → field-BZriODU7.js} +3 -3
- package/dist/chunks/field-BZriODU7.js.map +1 -0
- package/dist/chunks/{icon-CeNQtobn.js → icon-BqujXDUc.js} +2 -2
- package/dist/chunks/{icon-CeNQtobn.js.map → icon-BqujXDUc.js.map} +1 -1
- package/dist/chunks/{icon-button-_x1RUphC.js → icon-button-D4O4puwH.js} +3 -3
- package/dist/chunks/{icon-button-_x1RUphC.js.map → icon-button-D4O4puwH.js.map} +1 -1
- package/dist/chunks/identity-CsZvAUwu.js +361 -0
- package/dist/chunks/identity-CsZvAUwu.js.map +1 -0
- package/dist/chunks/{input-CNTfI6YE.js → input-B0wtkcNh.js} +5 -5
- package/dist/chunks/{input-CNTfI6YE.js.map → input-B0wtkcNh.js.map} +1 -1
- package/dist/chunks/{input-group-CYA1MEoZ.js → input-group-BQLw06B0.js} +33 -27
- package/dist/chunks/input-group-BQLw06B0.js.map +1 -0
- package/dist/chunks/{inset-BLMdxX4I.js → inset-BnBj8NJV.js} +12 -2
- package/dist/chunks/inset-BnBj8NJV.js.map +1 -0
- package/dist/chunks/{iso-field-1qmg7TP8.js → iso-field-BUXgY1dB.js} +5 -3
- package/dist/chunks/{iso-field-1qmg7TP8.js.map → iso-field-BUXgY1dB.js.map} +1 -1
- package/dist/chunks/{json-view-B6KHIWzh.js → json-view-BkG2hTXV.js} +11 -10
- package/dist/chunks/{json-view-B6KHIWzh.js.map → json-view-BkG2hTXV.js.map} +1 -1
- package/dist/chunks/{kbd-CBcBDvqU.js → kbd-DqWmbr_e.js} +2 -2
- package/dist/chunks/{kbd-CBcBDvqU.js.map → kbd-DqWmbr_e.js.map} +1 -1
- package/dist/chunks/{link-vz9aV8WX.js → link-YMcxM-BZ.js} +4 -4
- package/dist/chunks/{link-vz9aV8WX.js.map → link-YMcxM-BZ.js.map} +1 -1
- package/dist/chunks/{link-provider---9JdxTg.js → link-provider-BsUxhZKG.js} +2 -2
- package/dist/chunks/{link-provider---9JdxTg.js.map → link-provider-BsUxhZKG.js.map} +1 -1
- package/dist/chunks/list-wXZIZo_s.js +492 -0
- package/dist/chunks/list-wXZIZo_s.js.map +1 -0
- package/dist/chunks/{loader-CUehxvSZ.js → loader-ENBh2Fbt.js} +2 -2
- package/dist/chunks/{loader-CUehxvSZ.js.map → loader-ENBh2Fbt.js.map} +1 -1
- package/dist/chunks/{markdown-5NyaHHfN.js → markdown-DWyxjsSY.js} +10 -10
- package/dist/chunks/{markdown-5NyaHHfN.js.map → markdown-DWyxjsSY.js.map} +1 -1
- package/dist/chunks/{menu-DyVPwgfF.js → menu-Bnfi9P3t.js} +7 -7
- package/dist/chunks/{menu-DyVPwgfF.js.map → menu-Bnfi9P3t.js.map} +1 -1
- package/dist/chunks/{meter-DWhyzFGQ.js → meter-DhTnem4k.js} +2 -2
- package/dist/chunks/{meter-DWhyzFGQ.js.map → meter-DhTnem4k.js.map} +1 -1
- package/dist/chunks/nav-sheet-QqNRHo-y.js +60 -0
- package/dist/chunks/nav-sheet-QqNRHo-y.js.map +1 -0
- package/dist/chunks/{nav-wordmark-DLkItdvo.js → nav-wordmark-DmbT1Aiw.js} +2 -2
- package/dist/chunks/{nav-wordmark-DLkItdvo.js.map → nav-wordmark-DmbT1Aiw.js.map} +1 -1
- package/dist/chunks/option-checkbox-Df7WhGn4.js +25 -0
- package/dist/chunks/option-checkbox-Df7WhGn4.js.map +1 -0
- package/dist/chunks/over-sheet-B8vzr_zU.js +8 -0
- package/dist/chunks/over-sheet-B8vzr_zU.js.map +1 -0
- package/dist/chunks/{page-header-CEPZzhRp.js → page-header-Ccnrspbp.js} +5 -5
- package/dist/chunks/{page-header-CEPZzhRp.js.map → page-header-Ccnrspbp.js.map} +1 -1
- package/dist/chunks/{pagination-CCMxQ5pH.js → pagination-CEmWZNjp.js} +5 -4
- package/dist/chunks/{pagination-CCMxQ5pH.js.map → pagination-CEmWZNjp.js.map} +1 -1
- package/dist/chunks/picker-popover-C4ElNk7t.js +102 -0
- package/dist/chunks/picker-popover-C4ElNk7t.js.map +1 -0
- package/dist/chunks/{popover-BE7VO-a4.js → popover-bjxg020P.js} +3 -3
- package/dist/chunks/{popover-BE7VO-a4.js.map → popover-bjxg020P.js.map} +1 -1
- package/dist/chunks/{radio-CUxbLCvD.js → radio-DwYcXAzv.js} +2 -2
- package/dist/chunks/{radio-CUxbLCvD.js.map → radio-DwYcXAzv.js.map} +1 -1
- package/dist/chunks/range-popup-CG9Jo5B7.js +128 -0
- package/dist/chunks/range-popup-CG9Jo5B7.js.map +1 -0
- package/dist/chunks/release-art-Chd8l9Rf.js +555 -0
- package/dist/chunks/release-art-Chd8l9Rf.js.map +1 -0
- package/dist/chunks/{resize-motion-CMaidkwe.js → resize-motion-BWGMchyP.js} +27 -23
- package/dist/chunks/resize-motion-BWGMchyP.js.map +1 -0
- package/dist/chunks/{rights-BbiJ0AJB.js → rights-hMoaFasn.js} +12 -12
- package/dist/chunks/rights-hMoaFasn.js.map +1 -0
- package/dist/chunks/{section-DzOLLN1p.js → section-BsET7Fo-.js} +4 -4
- package/dist/chunks/{section-DzOLLN1p.js.map → section-BsET7Fo-.js.map} +1 -1
- package/dist/chunks/{segmented-MrinfDL8.js → segmented-DXKVF-nY.js} +4 -4
- package/dist/chunks/{segmented-MrinfDL8.js.map → segmented-DXKVF-nY.js.map} +1 -1
- package/dist/chunks/{select-Bc4kRiSG.js → select-Bbv2f5F8.js} +63 -80
- package/dist/chunks/select-Bbv2f5F8.js.map +1 -0
- package/dist/chunks/{separator-D5AzVFTS.js → separator-CpAUELNs.js} +2 -2
- package/dist/chunks/{separator-D5AzVFTS.js.map → separator-CpAUELNs.js.map} +1 -1
- package/dist/chunks/{sidebar-5IA18LuP.js → sidebar-Dey1ZfGt.js} +54 -51
- package/dist/chunks/sidebar-Dey1ZfGt.js.map +1 -0
- package/dist/chunks/{sidebar-menu-DRWRxcJ3.js → sidebar-menu-ct8IiL4z.js} +2 -2
- package/dist/chunks/{sidebar-menu-DRWRxcJ3.js.map → sidebar-menu-ct8IiL4z.js.map} +1 -1
- package/dist/chunks/{skeleton-kfuqdl1a.js → skeleton-BM797MAg.js} +2 -2
- package/dist/chunks/{skeleton-kfuqdl1a.js.map → skeleton-BM797MAg.js.map} +1 -1
- package/dist/chunks/{slider-DbhjJ3ML.js → slider-Ds-tqY-1.js} +2 -2
- package/dist/chunks/{slider-DbhjJ3ML.js.map → slider-Ds-tqY-1.js.map} +1 -1
- package/dist/chunks/status-dot-BqVOlShY.js +29 -0
- package/dist/chunks/status-dot-BqVOlShY.js.map +1 -0
- package/dist/chunks/{styles-Btvg2DCf.js → styles-CVJU9t9v.js} +2 -2
- package/dist/chunks/{styles-Btvg2DCf.js.map → styles-CVJU9t9v.js.map} +1 -1
- package/dist/chunks/{swap-text-BhPI8DOf.js → swap-text-Cica0pUr.js} +2 -2
- package/dist/chunks/{swap-text-BhPI8DOf.js.map → swap-text-Cica0pUr.js.map} +1 -1
- package/dist/chunks/{switch-XMY_CQE-.js → switch-CSKMEomo.js} +3 -3
- package/dist/chunks/{switch-XMY_CQE-.js.map → switch-CSKMEomo.js.map} +1 -1
- package/dist/chunks/{table-DYKa86af.js → table-D-36EM7f.js} +2 -2
- package/dist/chunks/{table-DYKa86af.js.map → table-D-36EM7f.js.map} +1 -1
- package/dist/chunks/{tag-Dg89uYpV.js → tag-CwDKXVHj.js} +4 -4
- package/dist/chunks/{tag-Dg89uYpV.js.map → tag-CwDKXVHj.js.map} +1 -1
- package/dist/chunks/{text--5MKh2G4.js → text-Dvvgg5Jt.js} +3 -3
- package/dist/chunks/{text--5MKh2G4.js.map → text-Dvvgg5Jt.js.map} +1 -1
- package/dist/chunks/{textarea-Cj8iR82R.js → textarea-2d373OyU.js} +35 -31
- package/dist/chunks/textarea-2d373OyU.js.map +1 -0
- package/dist/chunks/timeseries-LRDAZHV0.js +339 -0
- package/dist/chunks/timeseries-LRDAZHV0.js.map +1 -0
- package/dist/chunks/{toolbar-Dw3uxpsE.js → toolbar-nVLFWH2i.js} +3 -3
- package/dist/chunks/{toolbar-Dw3uxpsE.js.map → toolbar-nVLFWH2i.js.map} +1 -1
- package/dist/chunks/{tooltip-DEbCCsru.js → tooltip-S1DmyLVl.js} +4 -4
- package/dist/chunks/{tooltip-DEbCCsru.js.map → tooltip-S1DmyLVl.js.map} +1 -1
- package/dist/chunks/{tooltip-root-DRd4ciUv.js → tooltip-root-vjylFUqw.js} +4 -4
- package/dist/chunks/{tooltip-root-DRd4ciUv.js.map → tooltip-root-vjylFUqw.js.map} +1 -1
- package/dist/chunks/{virtual-rows-BZe49bKi.js → virtual-rows-yAMjeAwj.js} +4 -3
- package/dist/chunks/virtual-rows-yAMjeAwj.js.map +1 -0
- package/dist/chunks/{zh-CN-C7GmVswt.js → zh-CN-CqEA4PCM.js} +37 -5
- package/dist/chunks/zh-CN-CqEA4PCM.js.map +1 -0
- package/dist/components/app-frame.js +2 -2
- package/dist/components/avatar.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/button-group.js +33 -32
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/charts/bar.js +34 -31
- package/dist/components/charts/bar.js.map +1 -1
- package/dist/components/charts/donut.js +2 -2
- package/dist/components/charts/gauge.js +2 -2
- package/dist/components/charts/heatmap.js +1 -1
- package/dist/components/charts/sankey.js +2 -2
- package/dist/components/charts/sparkline.js +1 -1
- package/dist/components/charts/timeseries.js +1 -252
- package/dist/components/charts.js +3 -3
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code-block.js +2 -2
- package/dist/components/code.js +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/command-list.js +4 -0
- package/dist/components/command-palette.js +120 -171
- package/dist/components/command-palette.js.map +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.js +251 -193
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-picker.js +7 -7
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/dialog.js +7 -9
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/display-options.js +67 -53
- package/dist/components/display-options.js.map +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/filter-chip.js +138 -63
- package/dist/components/filter-chip.js.map +1 -1
- package/dist/components/filter-row.js +2 -2
- package/dist/components/flow.js +2 -2
- package/dist/components/heading.js +1 -1
- package/dist/components/icon-button.js +1 -1
- package/dist/components/icon.js +1 -1
- package/dist/components/input.js +56 -54
- package/dist/components/input.js.map +1 -1
- package/dist/components/kaeso/conversation.js +88 -79
- package/dist/components/kaeso/conversation.js.map +1 -1
- package/dist/components/kaeso/identity.js +1 -1
- package/dist/components/kaeso/moments.js +8 -8
- package/dist/components/kaeso/moments.js.map +1 -1
- package/dist/components/kaeso/rights.js +1 -1
- package/dist/components/kaeso/usage.js +6 -6
- package/dist/components/kaeso/usage.js.map +1 -1
- package/dist/components/kaeso.js +212 -84
- package/dist/components/kaeso.js.map +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/key-value.js +3 -3
- package/dist/components/label.js +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/loader.js +2 -2
- package/dist/components/logo.js +2 -2
- package/dist/components/markdown.js +1 -1
- package/dist/components/menu.js +2 -2
- package/dist/components/meter.js +1 -1
- package/dist/components/page-header.js +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/playground.js +654 -381
- package/dist/components/playground.js.map +1 -1
- package/dist/components/popover.js +2 -2
- package/dist/components/qr-code.js +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/release-art.js +2 -0
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/section.js +1 -1
- package/dist/components/segmented.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/settings.js +3 -3
- package/dist/components/sheet.js +69 -52
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/stat.js +88 -74
- package/dist/components/stat.js.map +1 -1
- package/dist/components/status-dot.js +1 -1
- package/dist/components/surface.js +1 -1
- package/dist/components/swap-text.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +48 -49
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/theme-image.js +1 -1
- package/dist/components/theme-menu.js +2 -2
- package/dist/components/theme-select.js +1 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/toast.js +4 -4
- package/dist/components/toc.js +1 -1
- package/dist/components/toolbar.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/visually-hidden.js +1 -1
- package/dist/format.js +132 -79
- package/dist/format.js.map +1 -1
- package/dist/i18n-provider.js +1 -1
- package/dist/index.js +115 -111
- package/dist/kaeso.css +43 -8
- package/dist/styles.css +1 -1
- package/dist/types/components/charts/bar.d.ts +6 -0
- package/dist/types/components/charts/core.d.ts +2 -2
- package/dist/types/components/charts/docs.d.ts +7 -0
- package/dist/types/components/charts/time-axis.d.ts +5 -0
- package/dist/types/components/charts/timeseries.d.ts +9 -0
- package/dist/types/components/code-block/highlighter.d.ts +2 -0
- package/dist/types/components/combobox/combobox.d.ts +2 -0
- package/dist/types/components/combobox/docs.d.ts +2 -4
- package/dist/types/components/command-list/command-list.d.ts +84 -0
- package/dist/types/components/command-list/docs.d.ts +52 -0
- package/dist/types/components/command-list/index.d.ts +3 -0
- package/dist/types/components/command-list/match.d.ts +1 -0
- package/dist/types/components/command-list/picker-popover.d.ts +44 -0
- package/dist/types/components/data-table/data-table.d.ts +3 -2
- package/dist/types/components/data-table/docs.d.ts +1 -0
- package/dist/types/components/date-picker/docs.d.ts +0 -6
- package/dist/types/components/dialog/dialog.d.ts +24 -0
- package/dist/types/components/dialog/docs.d.ts +4 -0
- package/dist/types/components/display-options/display-options.d.ts +1 -0
- package/dist/types/components/filter-chip/docs.d.ts +4 -0
- package/dist/types/components/filter-chip/filter-chip.d.ts +7 -0
- package/dist/types/components/input/docs.d.ts +2 -12
- package/dist/types/components/input/number-input.d.ts +1 -0
- package/dist/types/components/input/tag-input.d.ts +1 -0
- package/dist/types/components/kaeso/docs.d.ts +34 -0
- package/dist/types/components/kaeso/identity.d.ts +10 -1
- package/dist/types/components/kaeso/index.d.ts +1 -0
- package/dist/types/components/kaeso/provider-marks.d.ts +5 -1
- package/dist/types/components/kaeso/provider-picker.d.ts +42 -0
- package/dist/types/components/list/docs.d.ts +2 -0
- package/dist/types/components/list/list.d.ts +2 -0
- package/dist/types/components/menu/styles.d.ts +1 -1
- package/dist/types/components/playground/docs.d.ts +32 -0
- package/dist/types/components/playground/index.d.ts +1 -0
- package/dist/types/components/playground/model-picker.d.ts +39 -4
- package/dist/types/components/playground/reasoning.d.ts +29 -0
- package/dist/types/components/playground/response-view.d.ts +7 -1
- package/dist/types/components/release-art/docs.d.ts +13 -0
- package/dist/types/components/release-art/drawing.d.ts +48 -0
- package/dist/types/components/release-art/index.d.ts +1 -0
- package/dist/types/components/release-art/release-art.d.ts +37 -0
- package/dist/types/components/select/docs.d.ts +0 -2
- package/dist/types/components/select/option-checkbox.d.ts +1 -0
- package/dist/types/components/sidebar/sidebar.d.ts +1 -0
- package/dist/types/components/stat/docs.d.ts +1 -0
- package/dist/types/components/stat/stat.d.ts +1 -0
- package/dist/types/components/status-dot/docs.d.ts +2 -0
- package/dist/types/components/status-dot/status-dot.d.ts +2 -0
- package/dist/types/format/index.d.ts +8 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/inset.d.ts +5 -0
- package/dist/types/utils/over-sheet.d.ts +1 -0
- package/dist/types/utils/restore-focus.d.ts +1 -1
- package/dist/utils.js +4 -4
- package/foundations/accessibility.md +1 -0
- package/foundations/layout.md +45 -0
- package/foundations/writing.md +1 -0
- package/package.json +2 -2
- package/dist/chunks/app-frame-BXh-06HL.js +0 -214
- package/dist/chunks/app-frame-BXh-06HL.js.map +0 -1
- package/dist/chunks/cn-CidVUKMm.js.map +0 -1
- package/dist/chunks/code-block-DxtladFW.js.map +0 -1
- package/dist/chunks/collapsible-Cw_1aem5.js.map +0 -1
- package/dist/chunks/combobox-D30Wt11R.js +0 -291
- package/dist/chunks/combobox-D30Wt11R.js.map +0 -1
- package/dist/chunks/core-K960A4OT.js.map +0 -1
- package/dist/chunks/de-CTAo4KL7.js.map +0 -1
- package/dist/chunks/dialog-LNKgPEsV.js +0 -319
- package/dist/chunks/dialog-LNKgPEsV.js.map +0 -1
- package/dist/chunks/field-d8V94bvZ.js.map +0 -1
- package/dist/chunks/field-press-DwzBFafd.js +0 -10
- package/dist/chunks/field-press-DwzBFafd.js.map +0 -1
- package/dist/chunks/identity-BtZC_d_Q.js +0 -342
- package/dist/chunks/identity-BtZC_d_Q.js.map +0 -1
- package/dist/chunks/input-group-CYA1MEoZ.js.map +0 -1
- package/dist/chunks/inset-BLMdxX4I.js.map +0 -1
- package/dist/chunks/list-CzaiyNja.js +0 -483
- package/dist/chunks/list-CzaiyNja.js.map +0 -1
- package/dist/chunks/nav-sheet-BIErlV74.js +0 -58
- package/dist/chunks/nav-sheet-BIErlV74.js.map +0 -1
- package/dist/chunks/range-popup-DGOnGGag.js +0 -111
- package/dist/chunks/range-popup-DGOnGGag.js.map +0 -1
- package/dist/chunks/resize-motion-CMaidkwe.js.map +0 -1
- package/dist/chunks/rights-BbiJ0AJB.js.map +0 -1
- package/dist/chunks/select-Bc4kRiSG.js.map +0 -1
- package/dist/chunks/sidebar-5IA18LuP.js.map +0 -1
- package/dist/chunks/status-dot-CBoQpyL4.js +0 -25
- package/dist/chunks/status-dot-CBoQpyL4.js.map +0 -1
- package/dist/chunks/textarea-Cj8iR82R.js.map +0 -1
- package/dist/chunks/virtual-rows-BZe49bKi.js.map +0 -1
- package/dist/chunks/zh-CN-C7GmVswt.js.map +0 -1
- 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-
|
|
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
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { n as
|
|
9
|
-
import { t as
|
|
10
|
-
import { o as
|
|
11
|
-
import { r as
|
|
12
|
-
import { r as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
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
|
|
27
|
+
var le = { size: {
|
|
23
28
|
md: { classes: "rounded-frame" },
|
|
24
29
|
sm: { classes: "rounded-frame" }
|
|
25
|
-
} },
|
|
26
|
-
function
|
|
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(
|
|
33
|
+
let t = window.matchMedia(ue);
|
|
29
34
|
return t.addEventListener?.("change", e), () => t.removeEventListener?.("change", e);
|
|
30
35
|
}
|
|
31
|
-
var
|
|
32
|
-
let
|
|
33
|
-
let e =
|
|
34
|
-
e && (e.style.height = "auto", e.style.height = `${Math.min(Math.max(e.scrollHeight,
|
|
35
|
-
}, [g,
|
|
36
|
-
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
e.key === "Enter" && (e.nativeEvent.isComposing || e.keyCode === 229 || (e.metaKey || e.ctrlKey ||
|
|
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__ */
|
|
47
|
+
return /* @__PURE__ */ V("form", {
|
|
43
48
|
onSubmit: (e) => {
|
|
44
|
-
e.preventDefault(),
|
|
49
|
+
e.preventDefault(), F();
|
|
45
50
|
},
|
|
46
51
|
onMouseDown: (e) => {
|
|
47
|
-
e.target === e.currentTarget && !f && (e.preventDefault(),
|
|
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",
|
|
52
|
-
children: [/* @__PURE__ */
|
|
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
|
-
|
|
59
|
+
M.current = e, typeof w == "function" ? w(e) : w && (w.current = e);
|
|
55
60
|
},
|
|
56
|
-
rows:
|
|
57
|
-
value:
|
|
58
|
-
onChange: (e) =>
|
|
59
|
-
onKeyDown:
|
|
61
|
+
rows: te,
|
|
62
|
+
value: A,
|
|
63
|
+
onChange: (e) => j(e.target.value),
|
|
64
|
+
onKeyDown: z,
|
|
60
65
|
disabled: f,
|
|
61
|
-
placeholder:
|
|
62
|
-
"aria-label":
|
|
63
|
-
"aria-keyshortcuts":
|
|
64
|
-
...
|
|
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__ */
|
|
73
|
+
}), /* @__PURE__ */ V("div", {
|
|
69
74
|
className: "flex min-w-0 items-center gap-8 p-8 pt-4",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ B("div", {
|
|
71
76
|
className: "flex min-w-0 flex-1 items-center gap-4",
|
|
72
77
|
children: v
|
|
73
|
-
}),
|
|
78
|
+
}), l ? /* @__PURE__ */ B(u, {
|
|
74
79
|
type: "button",
|
|
75
80
|
size: "sm",
|
|
76
81
|
variant: "secondary",
|
|
77
|
-
reserveLabels: [
|
|
82
|
+
reserveLabels: [O, k],
|
|
78
83
|
onClick: () => s?.(),
|
|
79
84
|
disabled: f,
|
|
80
|
-
children:
|
|
81
|
-
}) : /* @__PURE__ */
|
|
85
|
+
children: k
|
|
86
|
+
}) : /* @__PURE__ */ B(u, {
|
|
82
87
|
type: "submit",
|
|
83
88
|
size: "sm",
|
|
84
89
|
variant: "primary",
|
|
85
|
-
reserveLabels: [
|
|
90
|
+
reserveLabels: [O, k],
|
|
86
91
|
loading: d,
|
|
87
|
-
disabled: !
|
|
88
|
-
children:
|
|
92
|
+
disabled: !re && !d,
|
|
93
|
+
children: O
|
|
89
94
|
})]
|
|
90
95
|
})]
|
|
91
96
|
});
|
|
92
97
|
});
|
|
93
|
-
process.env.NODE_ENV !== "production" && (
|
|
98
|
+
process.env.NODE_ENV !== "production" && (pe.displayName = "Composer");
|
|
94
99
|
//#endregion
|
|
95
100
|
//#region src/components/playground/compare-grid.tsx
|
|
96
|
-
var
|
|
101
|
+
var J = { divider: {
|
|
97
102
|
hairline: { classes: "hairline-l" },
|
|
98
103
|
none: { classes: "" }
|
|
99
|
-
} },
|
|
104
|
+
} }, Y = { divider: "hairline" }, X = /* @__PURE__ */ te({
|
|
100
105
|
index: 0,
|
|
101
106
|
count: 1,
|
|
102
107
|
divider: "hairline",
|
|
103
108
|
add: null
|
|
104
|
-
}),
|
|
105
|
-
let p = n(), m =
|
|
106
|
-
|
|
107
|
-
|
|
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
|
|
114
|
+
let S = P((e) => {
|
|
110
115
|
let t = g.current?.children[e], n = g.current;
|
|
111
116
|
if (!t || !n) return;
|
|
112
|
-
|
|
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
|
-
}, []),
|
|
123
|
+
}, []), C = (e) => {
|
|
119
124
|
let t = Math.max(0, Math.min(h - 1, e));
|
|
120
|
-
v(t), c?.(t),
|
|
125
|
+
v(t), c?.(t), S(t);
|
|
121
126
|
};
|
|
122
|
-
|
|
123
|
-
s !== void 0 &&
|
|
124
|
-
}, [s,
|
|
125
|
-
let
|
|
126
|
-
|
|
127
|
-
h >
|
|
128
|
-
}, [h,
|
|
129
|
-
let
|
|
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
|
-
|
|
140
|
+
I(() => {
|
|
136
141
|
let e = g.current;
|
|
137
142
|
if (!e || typeof ResizeObserver > "u") return;
|
|
138
|
-
|
|
139
|
-
let t = new ResizeObserver(
|
|
143
|
+
w();
|
|
144
|
+
let t = new ResizeObserver(w);
|
|
140
145
|
return t.observe(e), () => t.disconnect();
|
|
141
|
-
}, [
|
|
142
|
-
let
|
|
143
|
-
|
|
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 (
|
|
148
|
-
if (n !==
|
|
149
|
-
|
|
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
|
-
},
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
icon:
|
|
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:
|
|
160
|
-
...
|
|
161
|
-
}) : null,
|
|
162
|
-
return /* @__PURE__ */
|
|
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",
|
|
167
|
-
children: [h > 1 || i ? /* @__PURE__ */
|
|
168
|
-
className: "flex h-44 shrink-0 items-center gap-4 px-
|
|
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__ */
|
|
171
|
-
icon:
|
|
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: () =>
|
|
180
|
+
onClick: () => C(y - 1)
|
|
176
181
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
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__ */
|
|
185
|
+
children: [/* @__PURE__ */ B("span", {
|
|
181
186
|
className: "sr-only",
|
|
182
|
-
children: p("compareGrid.columnName", "{label}, ", { label:
|
|
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__ */
|
|
189
|
-
icon:
|
|
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: () =>
|
|
198
|
+
onClick: () => C(y + 1)
|
|
194
199
|
}),
|
|
195
|
-
|
|
200
|
+
O
|
|
196
201
|
]
|
|
197
|
-
}) : null, /* @__PURE__ */
|
|
202
|
+
}) : null, /* @__PURE__ */ B("div", {
|
|
198
203
|
ref: g,
|
|
199
|
-
onScroll:
|
|
200
|
-
onPointerDown:
|
|
201
|
-
onWheel:
|
|
202
|
-
onTouchStart:
|
|
203
|
-
onKeyDown:
|
|
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__ */
|
|
210
|
+
children: m.map((e, t) => /* @__PURE__ */ B(X.Provider, {
|
|
206
211
|
value: {
|
|
207
212
|
index: t,
|
|
208
213
|
count: h,
|
|
209
|
-
divider:
|
|
210
|
-
add: t === h - 1 ?
|
|
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" && (
|
|
218
|
-
function
|
|
219
|
-
let t =
|
|
220
|
-
return
|
|
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
|
|
241
|
-
let p = n(), { index: m, count: h, divider: g, add: _ } =
|
|
242
|
-
return /* @__PURE__ */
|
|
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 &&
|
|
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__ */
|
|
248
|
-
className: "flex h-52 min-w-0 items-center gap-4
|
|
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__ */
|
|
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__ */
|
|
256
|
-
icon:
|
|
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__ */
|
|
266
|
+
_ && /* @__PURE__ */ B("span", {
|
|
262
267
|
className: "hidden md:contents",
|
|
263
268
|
children: _
|
|
264
269
|
})
|
|
265
270
|
]
|
|
266
271
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
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__ */
|
|
278
|
+
children: /* @__PURE__ */ B("div", {
|
|
274
279
|
ref: y,
|
|
275
|
-
className: "flex min-h-full flex-col px-
|
|
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__ */
|
|
280
|
-
className: "flex min-h-44 min-w-0 items-
|
|
281
|
-
children:
|
|
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" && (
|
|
287
|
-
var
|
|
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
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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
|
-
|
|
303
|
-
let
|
|
304
|
-
return /* @__PURE__ */
|
|
305
|
-
|
|
306
|
-
...
|
|
307
|
-
...
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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__ */
|
|
313
|
-
className: e("shrink-0 font-medium",
|
|
314
|
-
children:
|
|
318
|
+
/* @__PURE__ */ B("span", {
|
|
319
|
+
className: e("shrink-0 font-medium", r && "animate-pulse-quiet reduced:animate-none"),
|
|
320
|
+
children: _
|
|
315
321
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
icon:
|
|
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__ */
|
|
322
|
-
"aria-hidden":
|
|
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:
|
|
330
|
+
children: g
|
|
325
331
|
})
|
|
326
332
|
]
|
|
327
|
-
}), /* @__PURE__ */
|
|
333
|
+
}), /* @__PURE__ */ B(G.Panel, {
|
|
328
334
|
className: "collapse-motion",
|
|
329
|
-
children: /* @__PURE__ */
|
|
330
|
-
className: "flex gap-12 pt-4 pb-8",
|
|
331
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
340
|
+
}), f ?? /* @__PURE__ */ B(j, {
|
|
335
341
|
text: t,
|
|
336
342
|
size: "small",
|
|
337
343
|
tone: "secondary",
|
|
338
|
-
streaming:
|
|
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
|
|
348
|
-
let
|
|
349
|
-
return /* @__PURE__ */
|
|
350
|
-
ref:
|
|
351
|
-
"aria-label":
|
|
352
|
-
"aria-busy":
|
|
353
|
-
"aria-describedby":
|
|
354
|
-
className: e("flex min-w-0 flex-col gap-8",
|
|
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
|
-
|
|
376
|
+
S && /* @__PURE__ */ B(be, {
|
|
357
377
|
text: r,
|
|
358
|
-
live:
|
|
378
|
+
live: C,
|
|
359
379
|
duration: a,
|
|
360
380
|
open: o,
|
|
361
381
|
defaultOpen: s,
|
|
362
|
-
onOpenChange:
|
|
382
|
+
onOpenChange: c
|
|
363
383
|
}),
|
|
364
|
-
|
|
384
|
+
x ? /* @__PURE__ */ B(j, {
|
|
365
385
|
text: t,
|
|
366
386
|
size: "lg",
|
|
367
|
-
streaming:
|
|
387
|
+
streaming: b,
|
|
368
388
|
collapseAfter: 0,
|
|
369
|
-
wrapCode: !0
|
|
370
|
-
|
|
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__ */
|
|
375
|
-
className: "flex min-h-24 flex-wrap items-center gap-x-12 gap-y-4",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
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:
|
|
379
|
-
}),
|
|
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:
|
|
383
|
-
children:
|
|
403
|
+
onClick: f,
|
|
404
|
+
children: _("responseView.retry", "Retry")
|
|
384
405
|
})]
|
|
385
406
|
}),
|
|
386
|
-
i === "
|
|
387
|
-
className: "flex min-h-24 flex-wrap items-center gap-x-12 gap-y-4",
|
|
388
|
-
children: [/* @__PURE__ */
|
|
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:
|
|
391
|
-
}),
|
|
411
|
+
children: Se(_, l)
|
|
412
|
+
}), f && /* @__PURE__ */ B(u, {
|
|
392
413
|
size: "xs",
|
|
393
|
-
variant: "
|
|
394
|
-
onClick:
|
|
395
|
-
children:
|
|
414
|
+
variant: "ghost",
|
|
415
|
+
onClick: f,
|
|
416
|
+
children: _("responseView.retry", "Retry")
|
|
396
417
|
})]
|
|
397
418
|
}),
|
|
398
|
-
i === "
|
|
399
|
-
|
|
400
|
-
|
|
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
|
-
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
-
id:
|
|
446
|
+
p,
|
|
447
|
+
/* @__PURE__ */ B("span", {
|
|
448
|
+
id: y,
|
|
405
449
|
className: "sr-only",
|
|
406
|
-
children: i === "pending" ?
|
|
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" && (
|
|
412
|
-
var
|
|
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
|
-
},
|
|
418
|
-
let
|
|
419
|
-
return /* @__PURE__ */
|
|
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":
|
|
423
|
-
className: e("flex min-w-0 flex-col items-start gap-2", a),
|
|
424
|
-
children: [/* @__PURE__ */
|
|
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 &&
|
|
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__ */
|
|
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" && (
|
|
439
|
-
var
|
|
440
|
-
return /* @__PURE__ */
|
|
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" && (
|
|
490
|
+
process.env.NODE_ENV !== "production" && (Ee.displayName = "Thread");
|
|
447
491
|
//#endregion
|
|
448
492
|
//#region src/components/playground/response-metrics.tsx
|
|
449
|
-
var
|
|
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
|
-
} },
|
|
453
|
-
function
|
|
454
|
-
return !Number.isFinite(e) || e < 0 ? "—" :
|
|
496
|
+
} }, Oe = { size: "sm" };
|
|
497
|
+
function ke(e) {
|
|
498
|
+
return !Number.isFinite(e) || e < 0 ? "—" : a(e, { precise: !0 });
|
|
455
499
|
}
|
|
456
|
-
function
|
|
457
|
-
let [t, n] =
|
|
458
|
-
return
|
|
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
|
|
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
|
|
469
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
518
|
+
children: [/* @__PURE__ */ B("dt", {
|
|
472
519
|
className: "text-fg-tertiary",
|
|
473
520
|
children: t
|
|
474
|
-
}), /* @__PURE__ */
|
|
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
|
|
482
|
-
let
|
|
483
|
-
if (!
|
|
484
|
-
ref:
|
|
485
|
-
"aria-label":
|
|
486
|
-
className: e(
|
|
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
|
|
534
|
+
let b = (e) => l || e, x = /* @__PURE__ */ V("span", {
|
|
489
535
|
className: "text-fg-tertiary",
|
|
490
|
-
children: [/* @__PURE__ */
|
|
536
|
+
children: [/* @__PURE__ */ B("span", {
|
|
491
537
|
"aria-hidden": !0,
|
|
492
538
|
children: "—"
|
|
493
|
-
}), /* @__PURE__ */
|
|
539
|
+
}), /* @__PURE__ */ B("span", {
|
|
494
540
|
className: "sr-only",
|
|
495
|
-
children:
|
|
541
|
+
children: h("responseMetrics.notYetKnown", "not yet known")
|
|
496
542
|
})]
|
|
497
543
|
});
|
|
498
|
-
return /* @__PURE__ */
|
|
499
|
-
ref:
|
|
500
|
-
"aria-label":
|
|
501
|
-
className:
|
|
544
|
+
return /* @__PURE__ */ V("dl", {
|
|
545
|
+
ref: m,
|
|
546
|
+
"aria-label": h("responseMetrics.metrics", "Metrics"),
|
|
547
|
+
className: y,
|
|
502
548
|
children: [
|
|
503
|
-
|
|
504
|
-
label:
|
|
549
|
+
b($(t)) && /* @__PURE__ */ B(Me, {
|
|
550
|
+
label: h("responseMetrics.firstToken", "First token"),
|
|
505
551
|
width: "min-w-40",
|
|
506
|
-
children:
|
|
552
|
+
children: $(t) ? ke(t) : x
|
|
507
553
|
}),
|
|
508
|
-
|
|
509
|
-
label:
|
|
554
|
+
b($(r)) && /* @__PURE__ */ B(Me, {
|
|
555
|
+
label: h("responseMetrics.total", "Total"),
|
|
510
556
|
width: "min-w-40",
|
|
511
|
-
children:
|
|
557
|
+
children: $(r) ? ke(r) : g === void 0 ? x : /* @__PURE__ */ B("span", {
|
|
512
558
|
className: "text-fg-tertiary",
|
|
513
|
-
children:
|
|
559
|
+
children: ke(g)
|
|
514
560
|
})
|
|
515
561
|
}),
|
|
516
|
-
|
|
517
|
-
label:
|
|
562
|
+
b(_) && /* @__PURE__ */ B(Me, {
|
|
563
|
+
label: h("responseMetrics.tokens", "Tokens"),
|
|
518
564
|
width: "min-w-48",
|
|
519
|
-
|
|
520
|
-
input:
|
|
521
|
-
output:
|
|
522
|
-
}) :
|
|
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
|
-
(
|
|
530
|
-
label:
|
|
570
|
+
($(s) || l && c) && /* @__PURE__ */ B(Me, {
|
|
571
|
+
label: h("responseMetrics.reasoning", "Reasoning"),
|
|
531
572
|
width: "min-w-24",
|
|
532
|
-
children:
|
|
573
|
+
children: $(s) ? o(s) : x
|
|
533
574
|
}),
|
|
534
|
-
|
|
535
|
-
label:
|
|
575
|
+
b(v) && /* @__PURE__ */ B(Me, {
|
|
576
|
+
label: h("responseMetrics.cost", "Cost"),
|
|
536
577
|
width: "min-w-40",
|
|
537
|
-
children:
|
|
578
|
+
children: v ? je(d) : x
|
|
538
579
|
})
|
|
539
580
|
]
|
|
540
581
|
});
|
|
541
582
|
});
|
|
542
|
-
process.env.NODE_ENV !== "production" && (
|
|
583
|
+
process.env.NODE_ENV !== "production" && (Ne.displayName = "ResponseMetrics");
|
|
543
584
|
//#endregion
|
|
544
585
|
//#region src/components/playground/parameter-panel.tsx
|
|
545
|
-
var
|
|
586
|
+
var Pe = { layout: {
|
|
546
587
|
popover: { classes: "w-full gap-20" },
|
|
547
588
|
panel: { classes: "w-full gap-24" }
|
|
548
|
-
} },
|
|
549
|
-
function
|
|
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
|
|
582
|
-
let
|
|
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__ */
|
|
627
|
+
return /* @__PURE__ */ V("div", {
|
|
587
628
|
className: "flex flex-col gap-8",
|
|
588
|
-
children: [/* @__PURE__ */
|
|
629
|
+
children: [/* @__PURE__ */ V("div", {
|
|
589
630
|
className: "flex items-baseline justify-between gap-12",
|
|
590
|
-
children: [/* @__PURE__ */
|
|
591
|
-
id:
|
|
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__ */
|
|
595
|
-
className: e("text-small tabular",
|
|
596
|
-
children:
|
|
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__ */
|
|
639
|
+
}), /* @__PURE__ */ B("div", {
|
|
599
640
|
className: "px-8",
|
|
600
|
-
children: /* @__PURE__ */
|
|
641
|
+
children: /* @__PURE__ */ B(_, {
|
|
601
642
|
"aria-label": t,
|
|
602
|
-
min:
|
|
643
|
+
min: a,
|
|
603
644
|
max: s,
|
|
604
645
|
step: c,
|
|
605
646
|
value: r,
|
|
606
647
|
disabled: u,
|
|
607
|
-
formatValue: (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] ??
|
|
652
|
+
onValueChange: (e) => d(Array.isArray(e) ? e[0] ?? a : e)
|
|
612
653
|
})
|
|
613
654
|
})]
|
|
614
655
|
});
|
|
615
656
|
}
|
|
616
|
-
var
|
|
617
|
-
let
|
|
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
|
-
}),
|
|
621
|
-
return /* @__PURE__ */
|
|
622
|
-
ref:
|
|
623
|
-
className: e("flex min-w-0 flex-col",
|
|
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__ */
|
|
626
|
-
label:
|
|
666
|
+
a && /* @__PURE__ */ B(g, {
|
|
667
|
+
label: m("parameterPanel.systemInstructions", "System instructions"),
|
|
627
668
|
rows: 3,
|
|
628
669
|
maxRows: 8,
|
|
629
|
-
placeholder:
|
|
670
|
+
placeholder: m("parameterPanel.instructionsPlaceholder", "You are a helpful assistant."),
|
|
630
671
|
value: t.instructions ?? "",
|
|
631
|
-
disabled:
|
|
632
|
-
onChange: (e) =>
|
|
672
|
+
disabled: l,
|
|
673
|
+
onChange: (e) => _({ instructions: e.target.value === "" ? void 0 : e.target.value })
|
|
633
674
|
}),
|
|
634
|
-
o && /* @__PURE__ */
|
|
635
|
-
label:
|
|
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:
|
|
643
|
-
onChange: (e) =>
|
|
644
|
-
}), /* @__PURE__ */
|
|
645
|
-
label:
|
|
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:
|
|
653
|
-
onChange: (e) =>
|
|
693
|
+
disabled: l,
|
|
694
|
+
onChange: (e) => _({ topP: e })
|
|
654
695
|
})] }),
|
|
655
|
-
/* @__PURE__ */
|
|
656
|
-
label:
|
|
696
|
+
/* @__PURE__ */ B(h, {
|
|
697
|
+
label: m("parameterPanel.maxOutputTokens", "Max output tokens"),
|
|
657
698
|
size: "sm",
|
|
658
|
-
placeholder:
|
|
699
|
+
placeholder: m("parameterPanel.modelDefault", "Model default"),
|
|
659
700
|
align: "start",
|
|
660
701
|
min: "1",
|
|
661
|
-
...
|
|
702
|
+
...c ? { max: String(c) } : {},
|
|
662
703
|
step: "256",
|
|
663
704
|
value: t.maxOutputTokens === void 0 ? "" : String(t.maxOutputTokens),
|
|
664
|
-
disabled:
|
|
705
|
+
disabled: l,
|
|
665
706
|
onValueChange: (e) => {
|
|
666
707
|
let t = Number(e);
|
|
667
|
-
|
|
708
|
+
_({ maxOutputTokens: e.trim() === "" || !Number.isFinite(t) || t <= 0 ? void 0 : Math.round(t) });
|
|
668
709
|
}
|
|
669
710
|
}),
|
|
670
|
-
|
|
671
|
-
label:
|
|
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:
|
|
715
|
+
disabled: l,
|
|
675
716
|
value: t.reasoningEffort ?? "default",
|
|
676
717
|
options: [{
|
|
677
718
|
value: "default",
|
|
678
|
-
label:
|
|
679
|
-
}, ...
|
|
680
|
-
onValueChange: (e) =>
|
|
681
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
684
|
-
className: e("text-body font-medium",
|
|
685
|
-
children:
|
|
686
|
-
}), /* @__PURE__ */
|
|
687
|
-
"aria-label":
|
|
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:
|
|
731
|
+
disabled: l,
|
|
691
732
|
value: t.reasoningSummary ?? "auto",
|
|
692
733
|
options: [
|
|
693
734
|
{
|
|
694
735
|
value: "auto",
|
|
695
|
-
label:
|
|
736
|
+
label: m("parameterPanel.summaryAuto", "Auto")
|
|
696
737
|
},
|
|
697
738
|
{
|
|
698
739
|
value: "concise",
|
|
699
|
-
label:
|
|
740
|
+
label: m("parameterPanel.summaryConcise", "Concise")
|
|
700
741
|
},
|
|
701
742
|
{
|
|
702
743
|
value: "detailed",
|
|
703
|
-
label:
|
|
744
|
+
label: m("parameterPanel.summaryDetailed", "Detailed")
|
|
704
745
|
},
|
|
705
746
|
{
|
|
706
747
|
value: "off",
|
|
707
|
-
label:
|
|
748
|
+
label: m("parameterPanel.summaryOff", "Off")
|
|
708
749
|
}
|
|
709
750
|
],
|
|
710
|
-
onValueChange: (e) =>
|
|
751
|
+
onValueChange: (e) => _({ reasoningSummary: e === "auto" ? void 0 : e })
|
|
711
752
|
})]
|
|
712
753
|
})] }),
|
|
713
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ B("div", {
|
|
714
755
|
className: "flex justify-end",
|
|
715
|
-
children: /* @__PURE__ */
|
|
756
|
+
children: /* @__PURE__ */ B(u, {
|
|
716
757
|
size: "sm",
|
|
717
758
|
variant: "ghost",
|
|
718
|
-
disabled:
|
|
759
|
+
disabled: l || !S,
|
|
719
760
|
onClick: () => r(t.instructions === void 0 ? {} : { instructions: t.instructions }),
|
|
720
|
-
children:
|
|
761
|
+
children: m("parameterPanel.resetToDefaults", "Reset to defaults")
|
|
721
762
|
})
|
|
722
763
|
})
|
|
723
764
|
]
|
|
724
765
|
});
|
|
725
766
|
});
|
|
726
|
-
process.env.NODE_ENV !== "production" && (
|
|
727
|
-
function
|
|
728
|
-
let
|
|
729
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
735
|
-
icon:
|
|
736
|
-
"aria-label":
|
|
775
|
+
children: [/* @__PURE__ */ B(S.Trigger, { children: e ?? /* @__PURE__ */ B(d, {
|
|
776
|
+
icon: W,
|
|
777
|
+
"aria-label": u,
|
|
737
778
|
size: "sm"
|
|
738
|
-
}) }), /* @__PURE__ */
|
|
739
|
-
title:
|
|
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__ */
|
|
784
|
+
children: /* @__PURE__ */ B(Re, { ...c })
|
|
744
785
|
})]
|
|
745
786
|
});
|
|
746
787
|
}
|
|
747
|
-
process.env.NODE_ENV !== "production" && (
|
|
788
|
+
process.env.NODE_ENV !== "production" && (ze.displayName = "ParameterPopover");
|
|
748
789
|
//#endregion
|
|
749
790
|
//#region src/components/playground/model-picker.tsx
|
|
750
|
-
var
|
|
791
|
+
var Be = {
|
|
751
792
|
ghost: "header",
|
|
752
793
|
default: "default"
|
|
753
|
-
},
|
|
754
|
-
ghost: { classes:
|
|
755
|
-
default: { classes:
|
|
756
|
-
} },
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
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
|
-
|
|
779
|
-
|
|
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" && (
|
|
1056
|
+
process.env.NODE_ENV !== "production" && (Xe.displayName = "ModelPicker");
|
|
784
1057
|
//#endregion
|
|
785
1058
|
//#region src/components/playground/prompt-suggestions.tsx
|
|
786
|
-
var
|
|
1059
|
+
var Ze = { align: {
|
|
787
1060
|
start: { classes: "items-stretch" },
|
|
788
1061
|
center: { classes: "items-center text-center" }
|
|
789
|
-
} },
|
|
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__ */
|
|
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",
|
|
795
|
-
children: t.slice(0, 3).map((t) => /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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" && (
|
|
1082
|
+
process.env.NODE_ENV !== "production" && ($e.displayName = "PromptSuggestions");
|
|
810
1083
|
//#endregion
|
|
811
|
-
export {
|
|
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
|